hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a1de5b026019452c5fa5d9e4252d98c94c55795 | 8,629 | py | Python | cpgames/modules/core/flappybird/flappybird.py | Wasabii88/Games | 33262ca1958207a24e57e3532feded7e275b1dd1 | [
"MIT"
] | 1 | 2022-02-27T10:33:41.000Z | 2022-02-27T10:33:41.000Z | cpgames/modules/core/flappybird/flappybird.py | beiwei365/Games | f6499f378802d3212a08aeca761191b58714b7f0 | [
"MIT"
] | null | null | null | cpgames/modules/core/flappybird/flappybird.py | beiwei365/Games | f6499f378802d3212a08aeca761191b58714b7f0 | [
"MIT"
] | null | null | null | '''
Function:
飞扬的小鸟小游戏
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import os
import random
import pygame
from ...utils import QuitGame
from ..base import PygameBaseGame
from .modules import GameEndIterface, GameStartInterface, Bird, Pipe
'''配置类'''
class Config():
# 根目录
rootdir = os.path.split(os.path.a... | 46.643243 | 155 | 0.554178 |
4a1de71dcd740ea68c0b556dce82fc3b88c4a6f5 | 662 | py | Python | third_party/cyw30739_sdk/btp_reader.py | carol-apple/connectedhomeip | b1d40eb423ba5c2f4bbe15ff42a2b5d1b78ba2ce | [
"Apache-2.0"
] | 1 | 2022-02-22T02:02:10.000Z | 2022-02-22T02:02:10.000Z | third_party/cyw30739_sdk/btp_reader.py | carol-apple/connectedhomeip | b1d40eb423ba5c2f4bbe15ff42a2b5d1b78ba2ce | [
"Apache-2.0"
] | null | null | null | third_party/cyw30739_sdk/btp_reader.py | carol-apple/connectedhomeip | b1d40eb423ba5c2f4bbe15ff42a2b5d1b78ba2ce | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import json
import sys
def main():
btp_file = sys.argv[1]
items = {}
with open(btp_file) as btp:
for line in btp:
item = line.strip().split("=")
if len(item) == 2:
key = item[0].strip()
value = item[1].strip()
... | 20.6875 | 44 | 0.522659 |
4a1de7c04ee4bad3a93f90c2c06b81bde823b9b1 | 802 | py | Python | bin/Python27/Lib/site-packages/numpy/linalg/tests/test_deprecations.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/numpy/linalg/tests/test_deprecations.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/numpy/linalg/tests/test_deprecations.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | 1 | 2020-05-07T11:04:14.000Z | 2020-05-07T11:04:14.000Z | """Test deprecation and future warnings.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_warns, run_module_suite
def test_qr_mode_full_future_warning():
"""Check mode='full' FutureWarning.
In numpy 1.8 the mode options 'fu... | 29.703704 | 74 | 0.704489 |
4a1de98b863672b08e5c8675021aed9a3b396b45 | 19,081 | py | Python | keras/activations.py | slowy07/keras | d3688b72924a4235598f0f80038de8c897f44799 | [
"Apache-2.0"
] | 1 | 2021-07-21T15:54:12.000Z | 2021-07-21T15:54:12.000Z | keras/activations.py | slowy07/keras | d3688b72924a4235598f0f80038de8c897f44799 | [
"Apache-2.0"
] | null | null | null | keras/activations.py | slowy07/keras | d3688b72924a4235598f0f80038de8c897f44799 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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... | 31.538843 | 80 | 0.68052 |
4a1de9bbdfbab437a671f76fc1b03b0a1264b20d | 5,203 | py | Python | scanpy/tools/_tsne_fix.py | aertslab/scanpy | da0ffd787681a5df98d523f93374853481fac8b8 | [
"BSD-3-Clause"
] | null | null | null | scanpy/tools/_tsne_fix.py | aertslab/scanpy | da0ffd787681a5df98d523f93374853481fac8b8 | [
"BSD-3-Clause"
] | null | null | null | scanpy/tools/_tsne_fix.py | aertslab/scanpy | da0ffd787681a5df98d523f93374853481fac8b8 | [
"BSD-3-Clause"
] | 1 | 2022-03-21T15:28:17.000Z | 2022-03-21T15:28:17.000Z | # Author: David DeTomaso (https://github.com/deto)
"""\
Fix for sklearn.tsne gradient descent.
This module fixes it by patching the original function with this
modified version. Patch is only applied for versions earlier than 0.19.
Code courtesy of David DeTomaso; available from
https://github.com/YosefLab/FastProjec... | 31.920245 | 78 | 0.601576 |
4a1dea19f5ab73bc0e4ed6791daa6b7d02d56e12 | 21,640 | py | Python | payment_lib_examples/weixin-python/virtual_environement/lib/python3.4/site-packages/Cryptodome/Util/RFC1751.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | 2 | 2022-01-21T12:51:19.000Z | 2022-01-21T12:51:30.000Z | payment_lib_examples/weixin-python/virtual_environement/lib/python3.4/site-packages/Cryptodome/Util/RFC1751.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | 3 | 2021-03-10T03:52:20.000Z | 2021-10-06T09:50:47.000Z | payment_lib_examples/weixin-python/virtual_environement/lib/python3.4/site-packages/Cryptodome/Util/RFC1751.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | 1 | 2019-12-30T08:22:13.000Z | 2019-12-30T08:22:13.000Z | # rfc1751.py : Converts between 128-bit strings and a human-readable
# sequence of words, as defined in RFC1751: "A Convention for
# Human-Readable 128-bit Keys", by Daniel L. McDonald.
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew M. Kuchling and others
#
# =========================================... | 55.204082 | 94 | 0.490342 |
4a1dea3426c2e4f2eb67e4ac5eca24a5a675a1d8 | 4,365 | py | Python | app/main_lbr.py | ansjin/memory_leak_detection | 47497fb495ade3e98f46a9d3ddd44ac229de85b0 | [
"MIT"
] | 2 | 2021-06-24T12:57:43.000Z | 2021-08-13T12:56:13.000Z | app/main_lbr.py | ansjin/memory_leak_detection | 47497fb495ade3e98f46a9d3ddd44ac229de85b0 | [
"MIT"
] | null | null | null | app/main_lbr.py | ansjin/memory_leak_detection | 47497fb495ade3e98f46a9d3ddd44ac229de85b0 | [
"MIT"
] | 1 | 2021-10-05T01:28:59.000Z | 2021-10-05T01:28:59.000Z | import warnings # `do not disturbe` mode
import pandas as pd
import numpy as np
warnings.filterwarnings('ignore')
from influxdb import InfluxDBClient
from influxdb import DataFrameClient
from .operations import Operations
import sys
sys.path.append('../')
from mem_leak_detection import MemLeakDetectionAlgorithm
from ... | 40.045872 | 119 | 0.635739 |
4a1ded9197e8f527c83c268481b3d091a067fb07 | 9,775 | py | Python | pymatgen/io/abinitio/netcdf.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | 1 | 2015-05-18T14:31:20.000Z | 2015-05-18T14:31:20.000Z | pymatgen/io/abinitio/netcdf.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | null | null | null | pymatgen/io/abinitio/netcdf.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | null | null | null | # coding: utf-8
"""Wrapper for netCDF readers."""
from __future__ import unicode_literals, division, print_function
import os.path
from monty.dev import requires, deprecated
from monty.collections import AttrDict
from monty.functools import lazy_property
from pymatgen.core.units import ArrayWithUnit
from pymatgen.cor... | 31.840391 | 99 | 0.617187 |
4a1dee40a7b2b65b2078c707f4bdcc24e6397ed1 | 3,669 | py | Python | python/oneflow/test/modules/test_rand.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/test/modules/test_rand.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/test/modules/test_rand.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 33.054054 | 83 | 0.674298 |
4a1def160ced25838644d0de04bd98307bcb51c3 | 938 | py | Python | parlai/tasks/fvqa/build.py | ricsinaruto/ParlAI | 733b627ae456d6b11a2fc4624088a781bc6c1d03 | [
"MIT"
] | 258 | 2020-04-10T07:01:06.000Z | 2022-03-26T11:49:30.000Z | parlai/tasks/fvqa/build.py | ricsinaruto/ParlAI | 733b627ae456d6b11a2fc4624088a781bc6c1d03 | [
"MIT"
] | 33 | 2020-04-10T04:28:51.000Z | 2022-03-31T02:52:02.000Z | parlai/tasks/fvqa/build.py | ricsinaruto/ParlAI | 733b627ae456d6b11a2fc4624088a781bc6c1d03 | [
"MIT"
] | 43 | 2020-04-14T10:43:33.000Z | 2022-03-13T02:27:54.000Z | #!/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 parlai.core.build_data as build_data
import os
def build(opt):
dpath = os.path.join(opt['datapath'], 'FVQA'... | 33.5 | 139 | 0.683369 |
4a1def353a73f0b22c84c5e6453921c23433896c | 1,114 | py | Python | share/rpcuser/rpcuser.py | e5e5/YoloYachtCoin | 5d439df14fe66ecef326ed23c9b8c0108a12ce8c | [
"MIT"
] | 5 | 2021-04-06T19:04:37.000Z | 2021-04-19T23:31:23.000Z | share/rpcuser/rpcuser.py | e5e5/YoloYachtCoin | 5d439df14fe66ecef326ed23c9b8c0108a12ce8c | [
"MIT"
] | null | null | null | share/rpcuser/rpcuser.py | e5e5/YoloYachtCoin | 5d439df14fe66ecef326ed23c9b8c0108a12ce8c | [
"MIT"
] | 3 | 2021-05-18T23:21:45.000Z | 2021-05-19T21:51:24.000Z | #!/usr/bin/env python2
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(s... | 26.52381 | 79 | 0.728007 |
4a1def4c2ccb09c763f19d0e54e3dabeb0c7204d | 10,524 | py | Python | journal/models.py | amiyatulu/journal_biohelikon | 47e99410110a42abeec20e2d3b5c383ae06cddbf | [
"MIT"
] | null | null | null | journal/models.py | amiyatulu/journal_biohelikon | 47e99410110a42abeec20e2d3b5c383ae06cddbf | [
"MIT"
] | null | null | null | journal/models.py | amiyatulu/journal_biohelikon | 47e99410110a42abeec20e2d3b5c383ae06cddbf | [
"MIT"
] | null | null | null | from PIL import Image
import datetime
from django import forms
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_save
from django.dispatch.dispatcher import receiver
from django.forms.models import Mode... | 39.268657 | 187 | 0.654029 |
4a1def8424f6afdee5510b5b7717b7f3c635764b | 990 | py | Python | api/migrations/20210429_01_zBzXQ-add-endpoint-name-to-models-table-and-remove-upload-timestamp-column-which-is-now-redundant.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 15 | 2021-09-24T00:46:04.000Z | 2022-03-16T13:24:56.000Z | api/migrations/20210429_01_zBzXQ-add-endpoint-name-to-models-table-and-remove-upload-timestamp-column-which-is-now-redundant.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 98 | 2021-09-22T12:33:21.000Z | 2022-03-21T22:23:52.000Z | api/migrations/20210429_01_zBzXQ-add-endpoint-name-to-models-table-and-remove-upload-timestamp-column-which-is-now-redundant.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 12 | 2021-09-25T05:08:18.000Z | 2022-02-28T21:02:20.000Z | # 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.
"""
Add endpoint name to models table and
remove upload_timestamp column which is now redundant
"""
from yoyo import step
__depends__ = {"202... | 23.571429 | 81 | 0.60404 |
4a1df038cec2afe914a7f0c9c70483ea17893d4c | 3,101 | py | Python | huaweicloud-sdk-bcs/huaweicloudsdkbcs/v2/model/show_blockchain_nodes_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-bcs/huaweicloudsdkbcs/v2/model/show_blockchain_nodes_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-bcs/huaweicloudsdkbcs/v2/model/show_blockchain_nodes_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowBlockchainNodesRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict):... | 27.201754 | 83 | 0.567559 |
4a1df063347a5955c18d4be0e1938f549504ae05 | 5,891 | py | Python | custom_components/ui_lovelace_minimalist/configure.py | basbruss/UI | d5b1dd4799b9cb3a8b43c4e8b8b9df8a14f303a2 | [
"Apache-2.0"
] | null | null | null | custom_components/ui_lovelace_minimalist/configure.py | basbruss/UI | d5b1dd4799b9cb3a8b43c4e8b8b9df8a14f303a2 | [
"Apache-2.0"
] | null | null | null | custom_components/ui_lovelace_minimalist/configure.py | basbruss/UI | d5b1dd4799b9cb3a8b43c4e8b8b9df8a14f303a2 | [
"Apache-2.0"
] | null | null | null | """Process Yaml and Config for UI Lovelace Minimalist Integration."""
from __future__ import annotations
import logging
import os
import shutil
from homeassistant.core import HomeAssistant
from .base import UlmBase
from .const import DOMAIN
_LOGGER: logging.Logger = logging.getLogger(__name__)
LANGUAGES = {
... | 36.364198 | 83 | 0.615345 |
4a1df09449ca04f73e50d22600c28160aae1d431 | 2,523 | py | Python | src/opnsense/scripts/filter/kill_table.py | ass-a2s/opnsense-core | a0634d180325f6afe3be7f514b4470e47ff5eb75 | [
"BSD-2-Clause"
] | 2 | 2019-03-15T03:35:54.000Z | 2019-03-15T07:50:36.000Z | src/opnsense/scripts/filter/kill_table.py | ass-a2s/opnsense-core | a0634d180325f6afe3be7f514b4470e47ff5eb75 | [
"BSD-2-Clause"
] | null | null | null | src/opnsense/scripts/filter/kill_table.py | ass-a2s/opnsense-core | a0634d180325f6afe3be7f514b4470e47ff5eb75 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/local/bin/python3.6
"""
Copyright (c) 2016-2019 Ad Schellevis <ad@opnsense.org>
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 ... | 45.053571 | 139 | 0.658343 |
4a1df0c64775906cdfcbc4f108dd32ca387dfc47 | 167,693 | py | Python | python/ccxt/async_support/okex3.py | ysdede/ccxt | c64cfdb0c364f4b965ef588bf67d1bdedad410a5 | [
"MIT"
] | 1 | 2021-01-12T07:03:55.000Z | 2021-01-12T07:03:55.000Z | python/ccxt/async_support/okex3.py | ysdede/ccxt | c64cfdb0c364f4b965ef588bf67d1bdedad410a5 | [
"MIT"
] | 3 | 2022-01-27T15:38:05.000Z | 2022-03-31T23:04:15.000Z | python/ccxt/async_support/okex3.py | RonSherfey/ccxt | c64cfdb0c364f4b965ef588bf67d1bdedad410a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 47.45133 | 521 | 0.472685 |
4a1df2c43725772399718246e5945f6772873f84 | 5,562 | py | Python | caserec/evaluation/base_evaluation.py | caserec2018/CaseRecommender | 1b63fe79aa26786c99f35e6b8f0a0dd9e591811b | [
"MIT"
] | 16 | 2018-09-19T07:29:24.000Z | 2022-03-30T07:32:36.000Z | caserec/evaluation/base_evaluation.py | caserec2018/CaseRecommender | 1b63fe79aa26786c99f35e6b8f0a0dd9e591811b | [
"MIT"
] | 1 | 2018-09-10T17:43:56.000Z | 2018-09-10T17:43:56.000Z | caserec/evaluation/base_evaluation.py | caserec2018/CaseRecommender | 1b63fe79aa26786c99f35e6b8f0a0dd9e591811b | [
"MIT"
] | 2 | 2019-07-11T10:13:24.000Z | 2020-03-12T10:09:39.000Z | # coding=utf-8
""""
This class is base for evaluation strategies
Types of evaluation:
- Simple: Evaluation with traditional strategy
- All-but-one Protocol: Considers only one pair (u, i) from the test set to evaluate the ranking
"""
# © 2018. Case Recommender (MIT License)
from collections ... | 32.911243 | 117 | 0.63826 |
4a1df300130e98c361cfe736b4618b24cd2c0a67 | 3,109 | py | Python | sdks/python/appcenter_sdk/models/DateTimeProperty.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/models/DateTimeProperty.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/models/DateTimeProperty.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class DateTimeProper... | 27.758929 | 91 | 0.559022 |
4a1df320e5f7f99fd7cea334cfe987920dd52df4 | 30,855 | py | Python | pkgs/conf-pkg/src/genie/libs/conf/lisp/lisp.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/conf-pkg/src/genie/libs/conf/lisp/lisp.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/conf-pkg/src/genie/libs/conf/lisp/lisp.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z |
__all__ = (
'Lisp',
)
# Python
from enum import Enum
# Genie
from genie.utils.cisco_collections import typedset
from genie.decorator import managedattribute
from genie.conf.base import ConfigurableBase
from genie.conf.base.config import CliConfig
from genie.conf.base.base import DeviceFeature, InterfaceFeature, ... | 36.952096 | 143 | 0.506012 |
4a1df322b84731b89aeae752a25a60dac76d431b | 7,731 | py | Python | demo/DecodeVideoDemo.py | ZoroWang/python-barcode | a5fb175661dda768c5102ddbb236f0f831d708d3 | [
"OLDAP-2.5"
] | 13 | 2020-05-18T13:13:17.000Z | 2021-09-30T12:33:26.000Z | demo/DecodeVideoDemo.py | ZoroWang/python-barcode | a5fb175661dda768c5102ddbb236f0f831d708d3 | [
"OLDAP-2.5"
] | 3 | 2020-08-17T02:16:14.000Z | 2021-10-08T00:59:27.000Z | demo/DecodeVideoDemo.py | ZoroWang/python-barcode | a5fb175661dda768c5102ddbb236f0f831d708d3 | [
"OLDAP-2.5"
] | 10 | 2020-05-11T08:03:58.000Z | 2021-07-17T21:18:29.000Z | import os
import sys
import time
from dbr import *
import cv2
reader = BarcodeReader()
results = None
Template_Settings = {
'1': '{"ImageParameter":{'
'"Name":"BestCoverage",'
'"DeblurLevel":9,'
'"ExpectedBarcodesCount":512,'
'"ScaleDownThreshold":100000,'
... | 33.323276 | 138 | 0.559436 |
4a1df39d7b14f0de11034afafc11eff2d62bc480 | 3,423 | py | Python | build_tools/gen_hotfix_res.py | xiuzhifu/KSFramework | 87a5f4bd597971517d04b9e60caeb00baed57d21 | [
"Apache-2.0"
] | null | null | null | build_tools/gen_hotfix_res.py | xiuzhifu/KSFramework | 87a5f4bd597971517d04b9e60caeb00baed57d21 | [
"Apache-2.0"
] | null | null | null | build_tools/gen_hotfix_res.py | xiuzhifu/KSFramework | 87a5f4bd597971517d04b9e60caeb00baed57d21 | [
"Apache-2.0"
] | null | null | null | """
Author: zhaoqingqing(569032731@qq.com)
Date: 2021/3/3 20:01
Desc:发布热更新资源到cdn
压缩lua和setting目录为zip文件
拷贝ab文件到cdn目录下
在python3.7.4+win10下测试通过
"""
# coding=utf-8
import os
import shutil
from shutil import copytree, ignore_patterns
import sys
import zipfile
import gen_filelist
filelist_name = 'fileli... | 29.508621 | 94 | 0.584575 |
4a1df4f040b4670f858d2d577c1a2b66e7866764 | 2,839 | py | Python | bin/make-book.py | tsibley/software-carpentry-2015-01-15-uw | 1bd3eab80b5058af2111d2f922bd4ea6038117e1 | [
"CC-BY-3.0"
] | null | null | null | bin/make-book.py | tsibley/software-carpentry-2015-01-15-uw | 1bd3eab80b5058af2111d2f922bd4ea6038117e1 | [
"CC-BY-3.0"
] | null | null | null | bin/make-book.py | tsibley/software-carpentry-2015-01-15-uw | 1bd3eab80b5058af2111d2f922bd4ea6038117e1 | [
"CC-BY-3.0"
] | null | null | null | from __future__ import print_function
import sys
import os.path
import re
# Header required to make this a Jekyll file.
HEADER = '''---
layout: book
title: "Software Carpentry Volume 1: Basics"
root: .
---'''
def main():
print(HEADER)
for filename in sys.argv[1:]:
with open(filename, 'r... | 29.884211 | 86 | 0.557943 |
4a1df7c8c4bb4c2ddaaf5d9d39b33e63504dbf91 | 2,172 | py | Python | bingo/bingo-elastic/python/tests/model/test_helpers.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | bingo/bingo-elastic/python/tests/model/test_helpers.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | bingo/bingo-elastic/python/tests/model/test_helpers.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import bingo_elastic.model.helpers as helpers
from bingo_elastic.model.record import (
IndigoRecordMolecule,
IndigoRecordReaction,
)
def test_iterate_sdf(resource_loader):
results = []
for step in range(0, 2):
if 0 == step:
sdf = helpers.iterate_sdf(
... | 28.578947 | 73 | 0.603591 |
4a1df8067e1c0494761885beb2ee57876a743c0d | 2,855 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/ScheduleSheetInstance.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/ScheduleSheetInstance.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/ScheduleSheetInstance.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class ScheduleSheetInstance(Element, IDisposable):
""" An element that represents a particular placement of a schedule on a sheet. """
@staticmethod
def Create(document, viewSheetId, scheduleId, origin):
"""
Create(document: Document,viewSheetId: ElementId,scheduleId: ElementId,origin: XYZ)... | 26.933962 | 221 | 0.656392 |
4a1df8aa137f0d0505f1c4cd297efe3613d41362 | 13,659 | py | Python | cnn_models/convolutional_sutskever.py | maburto00/ndsgo | 9cd27adcdf937cdf9863c158e039ad131d6b24eb | [
"MIT"
] | 1 | 2018-02-20T15:51:05.000Z | 2018-02-20T15:51:05.000Z | cnn_models/convolutional_sutskever.py | maburto00/ndsgo | 9cd27adcdf937cdf9863c158e039ad131d6b24eb | [
"MIT"
] | 2 | 2020-02-11T13:11:08.000Z | 2020-02-12T16:59:11.000Z | cnn_models/convolutional_sutskever.py | maburto00/ndsgo | 9cd27adcdf937cdf9863c158e039ad131d6b24eb | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import sys
import time
import struct
import numpy
from six.moves import urllib
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
IMAGE_SIZE = 9
NU... | 42.287926 | 111 | 0.63028 |
4a1dfa4b88f84d7416e86488890e925cc43bcaa6 | 9,685 | py | Python | search/routes/classic_api/tests/test_classic.py | ID2797370/arxiv-search | 889402e8eef9a2faaa8e900978cd27ff2784ce33 | [
"MIT"
] | 35 | 2018-12-18T02:51:09.000Z | 2022-03-30T04:43:20.000Z | search/routes/classic_api/tests/test_classic.py | ID2797370/arxiv-search | 889402e8eef9a2faaa8e900978cd27ff2784ce33 | [
"MIT"
] | 172 | 2018-02-02T14:35:11.000Z | 2018-12-04T15:35:30.000Z | search/routes/classic_api/tests/test_classic.py | ID2797370/arxiv-search | 889402e8eef9a2faaa8e900978cd27ff2784ce33 | [
"MIT"
] | 13 | 2019-01-10T22:01:48.000Z | 2021-11-05T12:25:08.000Z | """Tests for API routes."""
import os
from http import HTTPStatus
from xml.etree import ElementTree
from unittest import TestCase, mock, skip
from arxiv.users import helpers, auth
from arxiv.users.domain import Scope
from search import consts
from search import factory
from search import domain
from search.tests impo... | 37.832031 | 77 | 0.621786 |
4a1dfa6f946e4eac519d3991b0c76b21a0eaf60a | 754 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripDropDownClosingEventArgs.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripDropDownClosingEventArgs.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripDropDownClosingEventArgs.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class ToolStripDropDownClosingEventArgs(CancelEventArgs):
"""
Provides data for the System.Windows.Forms.ToolStripDropDown.Closing event.
ToolStripDropDownClosingEventArgs(reason: ToolStripDropDownCloseReason)
"""
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
retu... | 32.782609 | 91 | 0.762599 |
4a1dfaed85ec187b98ffe39338c11d7ff497edba | 7,064 | py | Python | lib/cell_subtype_hierarchy.py | calico/2019_murine_cell_aging | 11ab15b82df886c4a51f73b25c061a9360862c2e | [
"Apache-2.0"
] | 1 | 2020-12-03T21:28:05.000Z | 2020-12-03T21:28:05.000Z | lib/cell_subtype_hierarchy.py | calico/2019_murine_cell_aging | 11ab15b82df886c4a51f73b25c061a9360862c2e | [
"Apache-2.0"
] | null | null | null | lib/cell_subtype_hierarchy.py | calico/2019_murine_cell_aging | 11ab15b82df886c4a51f73b25c061a9360862c2e | [
"Apache-2.0"
] | 1 | 2021-04-16T12:01:16.000Z | 2021-04-16T12:01:16.000Z | '''Define cell type subtype hierarchy'''
import numpy as np
import torch
'''
The following hash table provides a formal description of our
cell type::cell state ontology, which we combine to describe
unique cell identities.
We name canonical cell states (e.g. CD4 T cell) where possible,
and otherwise name transcript... | 36.791667 | 116 | 0.659117 |
4a1dfb620aa87b790969554d8674dd1580828a8f | 2,800 | py | Python | airflow/utils/state.py | diggzhang/airflow-dingit | 41482b83130d5815b772840681fb36eb9bfa69b9 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 5 | 2019-05-17T01:30:27.000Z | 2021-06-17T21:03:30.000Z | airflow/utils/state.py | curest0x1021/incubator-airflow | e6d3160a061dbaa6042d524095dcd1cbc15e0bcd | [
"Apache-2.0"
] | 4 | 2020-12-08T05:25:08.000Z | 2021-06-25T15:40:57.000Z | airflow/utils/state.py | curest0x1021/incubator-airflow | e6d3160a061dbaa6042d524095dcd1cbc15e0bcd | [
"Apache-2.0"
] | 9 | 2017-08-24T15:47:44.000Z | 2022-02-14T03:30:49.000Z | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | 24.561404 | 76 | 0.584286 |
4a1dfc63120f0b1cbfb3b2dda2a35d15b946ba45 | 4,693 | py | Python | src/utils.py | kk19990709/pytorch-AAPR | 1bd1cbae704f6cb6313da015cbfd2cba80b06638 | [
"OML"
] | null | null | null | src/utils.py | kk19990709/pytorch-AAPR | 1bd1cbae704f6cb6313da015cbfd2cba80b06638 | [
"OML"
] | null | null | null | src/utils.py | kk19990709/pytorch-AAPR | 1bd1cbae704f6cb6313da015cbfd2cba80b06638 | [
"OML"
] | null | null | null | import nltk
import re
# nltk.download(['wordnet', "stopwords", "tagsets", "averaged_perceptron_tagger", "punkt", "vader_lexicon"])
english_stopwords = nltk.corpus.stopwords.words("english")
def tokenizer_author(text):
return text.split(',')
def tokenizer_category(text):
return text.split(',')
... | 33.049296 | 120 | 0.530791 |
4a1dfc84d9c48088cfddf9ea4d6b71f241f4d363 | 1,131 | py | Python | applePicker.py | DarkTheCross/rl_experiments | 3b448d946e18b8d8e40b45b71f4da2fba4e6eb66 | [
"MIT"
] | null | null | null | applePicker.py | DarkTheCross/rl_experiments | 3b448d946e18b8d8e40b45b71f4da2fba4e6eb66 | [
"MIT"
] | null | null | null | applePicker.py | DarkTheCross/rl_experiments | 3b448d946e18b8d8e40b45b71f4da2fba4e6eb66 | [
"MIT"
] | 1 | 2021-02-27T07:40:48.000Z | 2021-02-27T07:40:48.000Z | import numpy as np
import random
class ApplePicker:
def __init__(self):
self.gameState = {"board": np.random.choice(5, 1), "y": 0, "x": np.random.choice(7, 1)}
def render(self):
gameScene = np.zeros((7,7), dtype=np.float32)
gameScene[6, int(self.gameState["board"]):int(self.gameState["... | 33.264706 | 116 | 0.543767 |
4a1dfddf96857edb95f960f83bf9b8a930f51071 | 1,862 | py | Python | tempest/api_schema/compute/parameter_types.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | 3 | 2015-03-03T15:43:06.000Z | 2016-10-24T06:12:40.000Z | tempest/api_schema/compute/parameter_types.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | null | null | null | tempest/api_schema/compute/parameter_types.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | 1 | 2019-02-14T23:36:55.000Z | 2019-02-14T23:36:55.000Z | # Copyright 2014 NEC Corporation. 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 ... | 27.382353 | 78 | 0.459184 |
4a1dfe6ceb6fbba544f7a14479bb135a89eab35b | 9,937 | py | Python | scripts/Odometry_class.py | MostafaOsman144/moving_horizon_estimation_localization | 5d8ba1575b54a867bc8c1b9b1e482b1fbc2799ef | [
"MIT"
] | 5 | 2021-07-09T08:01:00.000Z | 2021-12-30T12:26:16.000Z | scripts/Odometry_class.py | MostafaOsman144/moving_horizon_estimation_localization | 5d8ba1575b54a867bc8c1b9b1e482b1fbc2799ef | [
"MIT"
] | null | null | null | scripts/Odometry_class.py | MostafaOsman144/moving_horizon_estimation_localization | 5d8ba1575b54a867bc8c1b9b1e482b1fbc2799ef | [
"MIT"
] | 3 | 2021-11-14T06:33:26.000Z | 2021-12-30T12:26:36.000Z | #!/usr/bin/env python
"""
Moving Horizon Estimation Localization
Copyright © 2020 Mostafa Osman
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,
... | 41.577406 | 109 | 0.633592 |
4a1dffc1258dd80c57f5b288ff0a0fb55525e32f | 23,557 | py | Python | lingvo/tasks/car/pillars.py | HubBucket-Team/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:08:35.000Z | 2019-10-10T06:08:35.000Z | lingvo/tasks/car/pillars.py | VonRosenchild/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/car/pillars.py | VonRosenchild/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:08:39.000Z | 2019-10-10T06:08:39.000Z | # Lint as: python2, python3
# Copyright 2019 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
#
... | 38.681445 | 80 | 0.658445 |
4a1e0067946c2877de6afa411f62ce622e8ce0d2 | 438 | py | Python | setup.py | frascoweb/frasco-images | b54e0c06e14fd816e7fd74dd23918acff3bcc828 | [
"MIT"
] | null | null | null | setup.py | frascoweb/frasco-images | b54e0c06e14fd816e7fd74dd23918acff3bcc828 | [
"MIT"
] | null | null | null | setup.py | frascoweb/frasco-images | b54e0c06e14fd816e7fd74dd23918acff3bcc828 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='frasco-images',
version='0.1',
url='http://github.com/frascoweb/frasco-images',
license='MIT',
author='Maxime Bouroumeau-Fuseau',
author_email='maxime.bouroumeau@gmail.com',
description="Image manipulation for Frasco",
py_modules=['frasco_image... | 23.052632 | 52 | 0.643836 |
4a1e010f1030ccf8bf2898b527ebff6bf1e9ee9b | 375 | py | Python | tests/system/errlogbeat.py | inxonic/errlogbeat | 068748f2518c7ee220a80fce166783ebd093fbfb | [
"Apache-2.0"
] | null | null | null | tests/system/errlogbeat.py | inxonic/errlogbeat | 068748f2518c7ee220a80fce166783ebd093fbfb | [
"Apache-2.0"
] | null | null | null | tests/system/errlogbeat.py | inxonic/errlogbeat | 068748f2518c7ee220a80fce166783ebd093fbfb | [
"Apache-2.0"
] | null | null | null | import os
import sys
sys.path.append('../../vendor/github.com/elastic/beats/libbeat/tests/system')
from beat.beat import TestCase
class BaseTest(TestCase):
@classmethod
def setUpClass(self):
self.beat_name = "errlogbeat"
self.beat_path = os.path.abspath(os.path.join(os.path.dirname(__file__),... | 26.785714 | 91 | 0.685333 |
4a1e027e36f1119094479ab4e90f5ae12f47d96d | 2,706 | py | Python | glyce/glyce/layers/combo_position_embed.py | jsonW0/StrokeOrderEmbeddings | aa73b216a118de2efba1d299b96990ba9244fa3f | [
"Apache-2.0"
] | null | null | null | glyce/glyce/layers/combo_position_embed.py | jsonW0/StrokeOrderEmbeddings | aa73b216a118de2efba1d299b96990ba9244fa3f | [
"Apache-2.0"
] | null | null | null | glyce/glyce/layers/combo_position_embed.py | jsonW0/StrokeOrderEmbeddings | aa73b216a118de2efba1d299b96990ba9244fa3f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Jason Wang
# Based on code by: Xiaoya Li(Glyce)
import os
import sys
root_path = "/".join(os.path.realpath(__file__).split("/")[:-3])
if root_path not in sys.path:
sys.path.insert(0, root_path)
import json
import math
import shutil
import tarfile
imp... | 38.657143 | 135 | 0.752402 |
4a1e0292c6a5298296c489bee16d0afcf400d946 | 1,713 | py | Python | POA_02_create_node_link_incidence.py | salomonw/Price_of_Anarchy_for_Transportation_Networks | 1af117feecf36bc06eabe1d3b3749147734851e0 | [
"MIT"
] | 2 | 2018-07-16T02:55:15.000Z | 2021-11-21T16:13:33.000Z | POA_02_create_node_link_incidence.py | salomonw/Price_of_Anarchy_for_Transportation_Networks | 1af117feecf36bc06eabe1d3b3749147734851e0 | [
"MIT"
] | null | null | null | POA_02_create_node_link_incidence.py | salomonw/Price_of_Anarchy_for_Transportation_Networks | 1af117feecf36bc06eabe1d3b3749147734851e0 | [
"MIT"
] | 1 | 2019-02-09T15:37:10.000Z | 2019-02-09T15:37:10.000Z | from utils_julia import *
def create_node_link_incidence(instance):
from utils_julia import *
import json
link_label_dict = zload( out_dir + 'link_label_dict.pkz')
instance = time_instances['id'][0]
with open(out_dir + "/data_traffic_assignment_uni-class/" + files_ID + '_net_' + month_w + '_fu... | 36.446809 | 144 | 0.581436 |
4a1e02bfee2e634ff016a8dd4c0e6ce013c74e2b | 2,697 | py | Python | loginpass/_django.py | authlib/socialism | 635823a78a2a92cf8630f9935aebb9afcccb8656 | [
"BSD-3-Clause"
] | 223 | 2018-04-23T14:48:17.000Z | 2022-03-19T09:27:36.000Z | loginpass/_django.py | authlib/socialism | 635823a78a2a92cf8630f9935aebb9afcccb8656 | [
"BSD-3-Clause"
] | 68 | 2018-04-22T13:55:25.000Z | 2022-03-15T15:28:42.000Z | loginpass/_django.py | authlib/socialism | 635823a78a2a92cf8630f9935aebb9afcccb8656 | [
"BSD-3-Clause"
] | 86 | 2018-04-24T21:09:26.000Z | 2022-03-17T08:55:34.000Z |
def create_django_urlpatterns(backend, oauth, handle_authorize):
from authlib.integrations.django_client import DjangoRemoteApp
from django.urls import path
class RemoteApp(backend, DjangoRemoteApp):
OAUTH_APP_CONFIG = backend.OAUTH_CONFIG
token_name = '_loginpass_{}_token'.format(backend.NAM... | 33.7125 | 75 | 0.664442 |
4a1e02c3ca9a166d5bfa4e122d945e0e6b109d97 | 1,276 | py | Python | day-07/sol-07.py | guptaanmol184/advent-or-code | 6622e3242239d271bdaf89cf3d9aa16f98bbf5f5 | [
"Unlicense"
] | null | null | null | day-07/sol-07.py | guptaanmol184/advent-or-code | 6622e3242239d271bdaf89cf3d9aa16f98bbf5f5 | [
"Unlicense"
] | null | null | null | day-07/sol-07.py | guptaanmol184/advent-or-code | 6622e3242239d271bdaf89cf3d9aa16f98bbf5f5 | [
"Unlicense"
] | null | null | null | # Advent of code Year 2021 Day 07 solution
# Author = Anmol Gupta
# Date = December 2021
from collections import Counter
import sys
input = list()
with open("input.txt", "r") as input_file:
input = input_file.readlines()
horizontal_positions = [int(position) for position in input[0].strip().split(",")]
# 1
# Fi... | 29.674419 | 97 | 0.710031 |
4a1e03166696f8e50afcd8aad6293fd2a27fe8e5 | 5,471 | py | Python | actioncable/connection.py | dazzl-tv/python-actioncable-zwei | 123bc4a992d25f5218abba1b280af29de7cd3a7b | [
"MIT"
] | null | null | null | actioncable/connection.py | dazzl-tv/python-actioncable-zwei | 123bc4a992d25f5218abba1b280af29de7cd3a7b | [
"MIT"
] | null | null | null | actioncable/connection.py | dazzl-tv/python-actioncable-zwei | 123bc4a992d25f5218abba1b280af29de7cd3a7b | [
"MIT"
] | null | null | null | """
ActionCable connection.
"""
import threading
import uuid
import json
import logging
import time
import websocket
class Connection:
"""
The connection to a websocket server
"""
def __init__(self, url, origin=None, log_ping=False, cookie=None, header=None):
"""
:param url: The url of... | 29.733696 | 114 | 0.571011 |
4a1e037a15ce86ab909686b8933941cda5c6ada6 | 1,954 | py | Python | preprocess.py | magungh1/Tacotron-2 | 711369e5e37764ca7a5cca9b04cdec0065394efb | [
"MIT"
] | null | null | null | preprocess.py | magungh1/Tacotron-2 | 711369e5e37764ca7a5cca9b04cdec0065394efb | [
"MIT"
] | null | null | null | preprocess.py | magungh1/Tacotron-2 | 711369e5e37764ca7a5cca9b04cdec0065394efb | [
"MIT"
] | null | null | null | import argparse
import os
from multiprocessing import cpu_count
from datasets import preprocessor
from hparams import hparams
from tqdm import tqdm
def preprocess(args, out_dir, hparams):
mel_dir = os.path.join(out_dir, 'mels')
wav_dir = os.path.join(out_dir, 'audio')
linear_dir = os.path.join(out_dir, 'linear')
... | 34.892857 | 103 | 0.726714 |
4a1e0483760c70f2df0af84e32a096e139e805ea | 837 | py | Python | subseries/subseries.py | mamaz/learn-stuffs-with-python | 2677203717bb5ddc30b0a907b8e38a9c9c7f8015 | [
"MIT"
] | null | null | null | subseries/subseries.py | mamaz/learn-stuffs-with-python | 2677203717bb5ddc30b0a907b8e38a9c9c7f8015 | [
"MIT"
] | null | null | null | subseries/subseries.py | mamaz/learn-stuffs-with-python | 2677203717bb5ddc30b0a907b8e38a9c9c7f8015 | [
"MIT"
] | null | null | null | from typing import List
def is_subseries(first: List[int], second: List[int]) -> bool:
"""
returns True if second is subseries of first
Args:
first (List[int]): source of subseries
second (List[int]): series that will be checked against first series
Returns:
bool: True if sec... | 24.617647 | 84 | 0.542413 |
4a1e04fc87962918286f9c8bc1c17c918f309504 | 8,577 | py | Python | crafting/gridworld/algorithms/composite_dataset.py | cdevin/cpv | 49e20a79f555f695aafb7ed2e1580b65f8b7bef8 | [
"MIT"
] | 8 | 2019-11-11T02:04:42.000Z | 2021-09-26T18:43:10.000Z | crafting/gridworld/algorithms/composite_dataset.py | cdevin/cpv | 49e20a79f555f695aafb7ed2e1580b65f8b7bef8 | [
"MIT"
] | 11 | 2020-03-24T17:45:34.000Z | 2022-03-12T00:03:33.000Z | crafting/gridworld/algorithms/composite_dataset.py | cdevin/cpv | 49e20a79f555f695aafb7ed2e1580b65f8b7bef8 | [
"MIT"
] | null | null | null | import torch
import glob
#from skimage import io, transform
import cv2
from torchvision import transforms, utils
import numpy as np
import pickle
from natsort import natsorted
MAX_ACTIONS = 7
import time
class ActionToTensor(object):
"""Convert ndarrays in sample to Tensors."""
def convert_image(self, image):
... | 37.784141 | 111 | 0.546578 |
4a1e0551bceb008dc507a500864bfdac33a68374 | 1,877 | py | Python | qbwc/base.py | tyler-n-lovely-test/qbwc | 9cc8e733135d3c177d8073d2cfd56684e42ed735 | [
"Apache-2.0"
] | null | null | null | qbwc/base.py | tyler-n-lovely-test/qbwc | 9cc8e733135d3c177d8073d2cfd56684e42ed735 | [
"Apache-2.0"
] | 1 | 2022-02-16T15:43:32.000Z | 2022-02-16T15:43:32.000Z | qbwc/base.py | tyler-n-lovely-test/qbwc | 9cc8e733135d3c177d8073d2cfd56684e42ed735 | [
"Apache-2.0"
] | 1 | 2020-12-02T14:13:40.000Z | 2020-12-02T14:13:40.000Z | import xmltodict
import requests
import json
from typing import Union, List
from qbwc.generated import types
from qbwc.generated.types import QBXMLMsgsRq, QBXMLMsgsRs
from qbwc.config import uri, request_headers, debug
from qbwc.helpers import (
dict_to_out,
dict_to_in,
split_pascal_case
)
_base_xml = ... | 24.697368 | 73 | 0.5935 |
4a1e05cbad884816a99b9053029798a9c2d554c0 | 1,656 | py | Python | app_js/code/app/__init__.py | mellemahp/python_app_template | cee503d32054629d9b67ce6dea67e7ea0928aafa | [
"MIT"
] | 1 | 2020-11-03T17:35:07.000Z | 2020-11-03T17:35:07.000Z | app_js/code/app/__init__.py | mellemahp/python_app_template | cee503d32054629d9b67ce6dea67e7ea0928aafa | [
"MIT"
] | 2 | 2020-02-05T05:05:42.000Z | 2021-05-11T03:31:52.000Z | app_js/code/app/__init__.py | mellemahp/python_app_template | cee503d32054629d9b67ce6dea67e7ea0928aafa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""/app/__init__.py
Description: Application factory for Template app
Project: Python App Template
Author: Hunter Mellema
Date: 1/20/2020
"""
# === Start imports ===#
# third party
import bottle
from bottle import Bottle
import toml
# local imports
from config import con... | 23.323944 | 78 | 0.63285 |
4a1e06063edc54d649ace7547ed49647a118cbc1 | 684 | py | Python | grr/lib/rdfvalues/hunts.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | 5 | 2017-03-17T08:25:09.000Z | 2022-02-22T05:28:14.000Z | grr/lib/rdfvalues/hunts.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | null | null | null | grr/lib/rdfvalues/hunts.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | 3 | 2018-12-07T07:04:37.000Z | 2022-02-22T05:28:16.000Z | #!/usr/bin/env python
"""RDFValue implementations for hunts."""
from grr.lib.rdfvalues import structs as rdf_structs
from grr.proto import flows_pb2
from grr.proto import jobs_pb2
class HuntNotification(rdf_structs.RDFProtoStruct):
protobuf = jobs_pb2.HuntNotification
class HuntContext(rdf_structs.RDFProtoStru... | 22.8 | 52 | 0.78655 |
4a1e0779ab9593cf081c6fd79afd30271b7ab07a | 395 | py | Python | Neighbour/wsgi.py | FabianMatata/Neighbours | fba748fd8172072a851f5c6aa9c62f50fc193e4e | [
"MIT"
] | null | null | null | Neighbour/wsgi.py | FabianMatata/Neighbours | fba748fd8172072a851f5c6aa9c62f50fc193e4e | [
"MIT"
] | null | null | null | Neighbour/wsgi.py | FabianMatata/Neighbours | fba748fd8172072a851f5c6aa9c62f50fc193e4e | [
"MIT"
] | null | null | null | """
WSGI config for Neighbour project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
4a1e0782cd7e825ff1b2586c03fbf7a3ce8103a9 | 513 | py | Python | palpatine/line.py | uranusjr/palpatine | 401b8c02a27f754c54a5a4212d892950abe169a5 | [
"BSD-3-Clause"
] | 1 | 2015-03-12T20:55:05.000Z | 2015-03-12T20:55:05.000Z | palpatine/line.py | uranusjr/palpatine | 401b8c02a27f754c54a5a4212d892950abe169a5 | [
"BSD-3-Clause"
] | null | null | null | palpatine/line.py | uranusjr/palpatine | 401b8c02a27f754c54a5a4212d892950abe169a5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import const
from .utils import out
def clear(clear_type=const.ALL):
"""Clear part of, or all characters in the current line.
The cursor is *not* moved after the line is cleared. You will need to call
cursor-moving functions (see :py:mod:`.cursor`) to... | 28.5 | 78 | 0.674464 |
4a1e07fada71574bce478dda19bbdc2891d1c691 | 75 | py | Python | Configuration/Eras/python/Modifier_run2_ECAL_2016_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/Eras/python/Modifier_run2_ECAL_2016_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/Eras/python/Modifier_run2_ECAL_2016_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
run2_ECAL_2016 = cms.Modifier()
| 18.75 | 40 | 0.8 |
4a1e080cfa6908106a566087df18195e3e31cbeb | 5,405 | py | Python | docs/source/conf.py | supsi-dacd-isaac/krangpower | eba38942af552992ad466f1b432121a99870c9b2 | [
"MIT"
] | 12 | 2018-07-19T10:03:11.000Z | 2021-01-12T22:30:58.000Z | docs/source/conf.py | supsi-dacd-isaac/krangpower | eba38942af552992ad466f1b432121a99870c9b2 | [
"MIT"
] | null | null | null | docs/source/conf.py | supsi-dacd-isaac/krangpower | eba38942af552992ad466f1b432121a99870c9b2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# krangpower documentation build configuration file, created by
# sphinx-quickstart on Fri May 18 12:01:42 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
#... | 30.536723 | 82 | 0.684181 |
4a1e08871dedca029bbfe21b78447986aeac1f73 | 840 | py | Python | dags/simple_dag.py | denironyx/docker-airflow-tutorial | dde72fe933fd1a241636c7bf27d2a6409263ffb2 | [
"Apache-2.0"
] | null | null | null | dags/simple_dag.py | denironyx/docker-airflow-tutorial | dde72fe933fd1a241636c7bf27d2a6409263ffb2 | [
"Apache-2.0"
] | null | null | null | dags/simple_dag.py | denironyx/docker-airflow-tutorial | dde72fe933fd1a241636c7bf27d2a6409263ffb2 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
def print_hello():
return "Hello world!"
default_args = {
"owner": "airflow",
"depends_on_past": False,
"start_date... | 24 | 79 | 0.708333 |
4a1e096dcae0185b37c9aca953b78e2579e66c65 | 4,221 | py | Python | scripts/build_tokens.py | amis-erc20/NetherDelta | cbc39f20c56e3dd669017cea271d9e860c8dcd4a | [
"MIT"
] | null | null | null | scripts/build_tokens.py | amis-erc20/NetherDelta | cbc39f20c56e3dd669017cea271d9e860c8dcd4a | [
"MIT"
] | null | null | null | scripts/build_tokens.py | amis-erc20/NetherDelta | cbc39f20c56e3dd669017cea271d9e860c8dcd4a | [
"MIT"
] | 1 | 2018-08-19T03:48:44.000Z | 2018-08-19T03:48:44.000Z | import json
from os import listdir, path
import sys
import yaml
TOKEN_KEYS_MAPPING = {
"addr": "addr",
"symbol": "name",
"name": "fullName",
"decimals": "decimals"
}
def make_listing_entry(defn):
token = {
dst_key: defn[src_key]
for (src_key, dst_key) in TOKEN_KEYS_MAPPING.items()... | 29.110345 | 88 | 0.610045 |
4a1e09780033da5f54f90f19743b5c7096fb93a5 | 1,244 | py | Python | tools/ams_checker.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | null | null | null | tools/ams_checker.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | 1 | 2021-05-06T16:26:32.000Z | 2021-06-28T17:26:09.000Z | tools/ams_checker.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | 3 | 2021-06-16T13:55:09.000Z | 2021-09-10T13:11:58.000Z | """Script to query AMS subscriptions and show the backlog of messages."""
# References used in the creation of this script.
# https://realpython.com/python-string-formatting/
# https://stackoverflow.com/a/12965254/1442342
from __future__ import print_function
import json
import urllib
# An admin token for the AMS p... | 33.621622 | 76 | 0.635048 |
4a1e09a95e8a4b7f7755fb1439f578706b88e68e | 3,919 | py | Python | cloudshell/snmp/snmp_configurator.py | QualiSystems/cloudshell-snmp | 9f8c4a927997d69cf85cac2a9bb1c36952d62d99 | [
"Apache-2.0"
] | null | null | null | cloudshell/snmp/snmp_configurator.py | QualiSystems/cloudshell-snmp | 9f8c4a927997d69cf85cac2a9bb1c36952d62d99 | [
"Apache-2.0"
] | 36 | 2016-05-13T08:42:13.000Z | 2021-07-07T13:53:23.000Z | cloudshell/snmp/snmp_configurator.py | QualiSystems/cloudshell-snmp | 9f8c4a927997d69cf85cac2a9bb1c36952d62d99 | [
"Apache-2.0"
] | 5 | 2016-08-05T17:49:21.000Z | 2019-05-28T03:27:22.000Z | from abc import ABCMeta, abstractmethod
from cloudshell.snmp.cloudshell_snmp import Snmp
from cloudshell.snmp.snmp_parameters import SnmpParametersHelper
ABC = ABCMeta("ABC", (object,), {"__slots__": ()})
class SnmpConfigurator(object):
"""Create snmp service, according to resource config values."""
def __... | 32.932773 | 121 | 0.676193 |
4a1e0d4358ddc73e3e5279434c3b5eda9a7d48fe | 20,475 | py | Python | tf2onnxnightly/rewriter/rnn_utils.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | tf2onnxnightly/rewriter/rnn_utils.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | tf2onnxnightly/rewriter/rnn_utils.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
"""
tf2onnx.rewriter.rnn_utils - rnn support
"""
from __future__ import unicode_literals
from collections import defaultdict
from enum import Enum
import logging
import numpy as np
from tf2onnxnightly import utils
from tf2onnxnightly.graph_builder import GraphBuilder
from tf2on... | 34.940273 | 110 | 0.591013 |
4a1e0e7f8e629d87f457af6fe5d0225893b6c81b | 6,367 | py | Python | fhir/resources/DSTU2/referralrequest.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 144 | 2019-05-08T14:24:43.000Z | 2022-03-30T02:37:11.000Z | fhir/resources/DSTU2/referralrequest.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 82 | 2019-05-13T17:43:13.000Z | 2022-03-30T16:45:17.000Z | fhir/resources/DSTU2/referralrequest.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 48 | 2019-04-04T14:14:53.000Z | 2022-03-30T06:07:31.000Z | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/DSTU2/referralrequest.html
Release: DSTU2
Version: 1.0.2
Revision: 7202
"""
from typing import List as ListType
from pydantic import Field
from . import domainresource, fhirtypes
class ReferralRequest(domainresource.DomainResource):
"""A request for refer... | 33.867021 | 95 | 0.627925 |
4a1e0ea2f066d60846c01eaf3d5c581da08c2977 | 473 | py | Python | HackerRank/Python/Easy/E0087.py | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 54 | 2019-05-13T12:13:09.000Z | 2022-02-27T02:59:00.000Z | HackerRank/Python/Easy/E0087.py | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 2 | 2020-10-02T07:16:43.000Z | 2020-10-19T04:36:19.000Z | HackerRank/Python/Easy/E0087.py | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 20 | 2020-05-26T09:48:13.000Z | 2022-03-18T15:18:27.000Z | # Problem Statement: https://www.hackerrank.com/challenges/html-parser-part-2/problem
import sys
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser):
def handle_data(self, data):
if data != '\n':
print(f'>>> Data\n{data}')
def handle_comment(self, data):
if '\n' in data:
print('>>> Multi-li... | 21.5 | 85 | 0.689218 |
4a1e0ead252d7d88fe5a51276d58cb99807cfcb8 | 13,958 | py | Python | Addons/ImportFbxWithVertexColor.py | Stmdotcom/Spiraloid-Toolkit-for-Blender | 9a09d3ece77338a18776ff8719aff9bf15fa99ed | [
"MIT"
] | 65 | 2018-08-21T08:59:41.000Z | 2022-02-18T08:50:02.000Z | Addons/ImportFbxWithVertexColor.py | Stmdotcom/Spiraloid-Toolkit-for-Blender | 9a09d3ece77338a18776ff8719aff9bf15fa99ed | [
"MIT"
] | 4 | 2018-09-16T16:43:38.000Z | 2022-02-21T00:30:19.000Z | Addons/ImportFbxWithVertexColor.py | Stmdotcom/Spiraloid-Toolkit-for-Blender | 9a09d3ece77338a18776ff8719aff9bf15fa99ed | [
"MIT"
] | 14 | 2019-03-30T16:07:20.000Z | 2021-07-03T04:32:01.000Z | bl_info = {
'name': 'ImportFbxWithVertexColor',
'author': 'Bay Raitt',
'version': (0, 4),
'blender': (2, 80, 0),
"description": "Imports an .fbx file with vertex color and sets up the material and creates an optional decimation",
'category': 'Import-Export',
'loca... | 37.023873 | 127 | 0.523427 |
4a1e0f0ee0cc458aa82e8b05c426067fb736b5fe | 5,187 | py | Python | pruebas.py | JCGALVIS/Proyecto2Programacion20191 | 3054e61ddb9f89427dad8b96dcdd0f0b4d92eda2 | [
"MIT"
] | null | null | null | pruebas.py | JCGALVIS/Proyecto2Programacion20191 | 3054e61ddb9f89427dad8b96dcdd0f0b4d92eda2 | [
"MIT"
] | 1 | 2019-03-27T16:01:26.000Z | 2019-03-27T16:01:26.000Z | pruebas.py | JCGALVIS/Proyecto2Programacion20191 | 3054e61ddb9f89427dad8b96dcdd0f0b4d92eda2 | [
"MIT"
] | null | null | null | import sys
import unittest
import adn as adn
class prueba(unittest.TestCase):
def test_obtener_complemento(self):
self.assertEqual(adn.obtener_complemento('A'), 'T')
self.assertEqual(adn.obtener_complemento('T'), 'A')
self.assertEqual(adn.obtener_complemento('C'), 'G')
self.assertE... | 46.72973 | 118 | 0.640833 |
4a1e0f3d009cd37d5796cfb48871d54f8a8da86c | 1,084 | py | Python | apero/tools/module/setup/drs_trigger.py | njcuk9999/apero-drs | 83b043e9f277a011b03e0227c77307961b200901 | [
"MIT"
] | 1 | 2021-03-09T17:49:31.000Z | 2021-03-09T17:49:31.000Z | apero/tools/module/setup/drs_trigger.py | njcuk9999/apero-drs | 83b043e9f277a011b03e0227c77307961b200901 | [
"MIT"
] | 43 | 2020-10-06T18:42:24.000Z | 2022-03-28T21:23:10.000Z | apero/tools/module/setup/drs_trigger.py | njcuk9999/apero-drs | 83b043e9f277a011b03e0227c77307961b200901 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# CODE DESCRIPTION HERE
Created on 2019-11-02 10:09
@author: ncook
Version 0.0.1
"""
# =============================================================================
# Define variables
# =============================================================================
... | 30.111111 | 79 | 0.168819 |
4a1e101650b97bf512272a22f7a8e29f232aa680 | 2,828 | py | Python | test/functional/p2p_timeouts.py | Lexxos/dash | 6f2e0420c3a8ba1f9ffbc4601e31ff760b9446b9 | [
"MIT"
] | 1 | 2021-12-14T10:08:03.000Z | 2021-12-14T10:08:03.000Z | test/functional/p2p_timeouts.py | Lexxos/digital-cash | 6f2e0420c3a8ba1f9ffbc4601e31ff760b9446b9 | [
"MIT"
] | null | null | null | test/functional/p2p_timeouts.py | Lexxos/digital-cash | 6f2e0420c3a8ba1f9ffbc4601e31ff760b9446b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various net timeouts.
- Create three amerox nodes:
no_verack_node - we never send a verack in res... | 33.666667 | 93 | 0.709335 |
4a1e10949541756adce2b76f91f1de189bb2c7f4 | 5,539 | py | Python | nits/file.py | scott-howard-james/nits | 9ac76b6885e3306083cc4931a9428ae99a976a04 | [
"Apache-2.0"
] | null | null | null | nits/file.py | scott-howard-james/nits | 9ac76b6885e3306083cc4931a9428ae99a976a04 | [
"Apache-2.0"
] | null | null | null | nits/file.py | scott-howard-james/nits | 9ac76b6885e3306083cc4931a9428ae99a976a04 | [
"Apache-2.0"
] | null | null | null | # standard
from collections import defaultdict, OrderedDict
import csv
import sys
import tempfile
import unittest
class File:
'''
An abstract class simplifying file access through the use of only two functions:
- read (file)
- write (data, file):
'''
@classmethod
def read(cls, filename):
... | 29 | 84 | 0.484022 |
4a1e11471b9c741e7d84dd582c0af639d1448f2d | 17,955 | py | Python | tests/test_cli.py | logworthy/cookiecutter | 8073c27271545e4ef6d3221ef3eeeaeaaa65e7b8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_cli.py | logworthy/cookiecutter | 8073c27271545e4ef6d3221ef3eeeaeaaa65e7b8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_cli.py | logworthy/cookiecutter | 8073c27271545e4ef6d3221ef3eeeaeaaa65e7b8 | [
"BSD-3-Clause"
] | null | null | null | """Collection of tests around cookiecutter's command-line interface."""
import json
import os
import pytest
from click.testing import CliRunner
from cookiecutter import utils
from cookiecutter.__main__ import main
from cookiecutter.main import cookiecutter
@pytest.fixture(scope='session')
def cli_runner():
"""... | 30.956897 | 88 | 0.683654 |
4a1e119b327c0ff4fac105bd7a83fcb547eb3c2d | 11,171 | py | Python | examples/speech_synthesis/preprocessing/get_feature_manifest.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"MIT"
] | 8 | 2022-03-19T15:20:10.000Z | 2022-03-30T20:29:25.000Z | examples/speech_synthesis/preprocessing/get_feature_manifest.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"MIT"
] | 2 | 2022-02-22T08:28:06.000Z | 2022-02-22T09:26:26.000Z | examples/speech_synthesis/preprocessing/get_feature_manifest.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"MIT"
] | 2 | 2022-03-18T14:42:41.000Z | 2022-03-19T15:23:20.000Z | # 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 argparse
import logging
from pathlib import Path
import shutil
from tempfile import NamedTemporaryFile
from collections import Counter,... | 42.475285 | 80 | 0.644168 |
4a1e13fcac08706f1b193ead2b7c29eb454392a2 | 3,199 | py | Python | do_wide_and_deep_networks_learn_the_same_things/large_scale_training/single_task_evaluator.py | xxdreck/google-research | dac724bc2b9362d65c26747a8754504fe4c615f8 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | do_wide_and_deep_networks_learn_the_same_things/large_scale_training/single_task_evaluator.py | xxdreck/google-research | dac724bc2b9362d65c26747a8754504fe4c615f8 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | do_wide_and_deep_networks_learn_the_same_things/large_scale_training/single_task_evaluator.py | admariner/google-research | 7cee4b22b925581d912e8d993625c180da2a5a4f | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 36.352273 | 80 | 0.703345 |
4a1e14374087d1ae3c33e104551080f4d2d858c8 | 86 | py | Python | data/studio21_generated/interview/0122/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/0122/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/0122/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | class Solution:
def maxScore(self, cardPoints: List[int], k: int) -> int:
| 28.666667 | 61 | 0.604651 |
4a1e14f7f9da4ce3ed8b032af73ee39d5bfb95a6 | 485 | py | Python | webapp/track/models.py | drylikov/mappad.ru | 98672ec4c880848aa865a6dbcd88c3b44cbc64e2 | [
"MIT"
] | null | null | null | webapp/track/models.py | drylikov/mappad.ru | 98672ec4c880848aa865a6dbcd88c3b44cbc64e2 | [
"MIT"
] | null | null | null | webapp/track/models.py | drylikov/mappad.ru | 98672ec4c880848aa865a6dbcd88c3b44cbc64e2 | [
"MIT"
] | null | null | null | from datetime import datetime
from webapp import db
class Track(db.Model):
__tablename__ = 'tracks'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(140))
timestamp = db.Column(db.DateTime, index=True, default=datetime.utcnow)
user_id = db.Column(db.Integer, db.ForeignKey... | 26.944444 | 75 | 0.680412 |
4a1e162aa2fd45a32f60c42a34e6854e2b722649 | 32,335 | py | Python | edk2basetools/BPDG/GenVpd.py | YuweiChen1110/edk2-basetools | cfd05c928492b7ffd1329634cfcb089db995eeca | [
"BSD-2-Clause-Patent"
] | 7 | 2020-09-08T01:16:14.000Z | 2021-12-25T06:32:42.000Z | edk2basetools/BPDG/GenVpd.py | YuweiChen1110/edk2-basetools | cfd05c928492b7ffd1329634cfcb089db995eeca | [
"BSD-2-Clause-Patent"
] | 25 | 2020-11-02T23:28:42.000Z | 2022-03-29T01:57:40.000Z | edk2basetools/BPDG/GenVpd.py | YuweiChen1110/edk2-basetools | cfd05c928492b7ffd1329634cfcb089db995eeca | [
"BSD-2-Clause-Patent"
] | 18 | 2020-09-10T02:54:03.000Z | 2021-11-29T06:41:52.000Z | ## @file
# This file include GenVpd class for fix the Vpd type PCD offset, and PcdEntry for describe
# and process each entry of vpd type PCD.
#
# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
from __future__ import absolute_import
import ... | 46.862319 | 206 | 0.55658 |
4a1e174967505a67d5f72cc5b322936c0bf73d68 | 5,280 | py | Python | audiobook.py | wyb330/Tacotron-2 | 54824d091f50d730fbbd30d2b8f048e9874b6800 | [
"MIT"
] | null | null | null | audiobook.py | wyb330/Tacotron-2 | 54824d091f50d730fbbd30d2b8f048e9874b6800 | [
"MIT"
] | null | null | null | audiobook.py | wyb330/Tacotron-2 | 54824d091f50d730fbbd30d2b8f048e9874b6800 | [
"MIT"
] | null | null | null | import argparse
from hparams import hparams, hparams_debug_string
import tensorflow as tf
from infolog import log
from multi_speaker.synthesizer import Synthesizer
import os
import nltk
from konlpy.tag import Kkma
from tqdm import tqdm
import numpy as np
from datasets import audio
def generate_fast(model, text, speak... | 34.285714 | 113 | 0.628788 |
4a1e1b1b8004b4842af2509738644ed5a6e818cb | 246 | py | Python | Mundo 1/ex011.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | Mundo 1/ex011.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | Mundo 1/ex011.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | alt = float(input('Qual a altura da parede? '))
lar = float(input('Qual a largura daparede? '))
area = alt * lar
qtde = area / 2
print('A sua área é {:.2f}m2. \nA quantidade de tinta para pintar sua parede é {:.2f} unidades.'.format(area, qtde))
| 41 | 116 | 0.670732 |
4a1e1cd39412672f2d604c5d4a4eafe5effc09de | 11,271 | py | Python | src/lib/zothero/zotero.py | ai0/zothero | 5b057ef080ee730d82d5dd15e064d2a4730c2b11 | [
"MIT"
] | 372 | 2017-12-20T22:56:25.000Z | 2022-03-30T22:43:52.000Z | src/lib/zothero/zotero.py | dishantpandya777/zothero | 5b057ef080ee730d82d5dd15e064d2a4730c2b11 | [
"MIT"
] | 65 | 2017-12-20T23:03:42.000Z | 2022-03-30T13:07:18.000Z | src/lib/zothero/zotero.py | dishantpandya777/zothero | 5b057ef080ee730d82d5dd15e064d2a4730c2b11 | [
"MIT"
] | 26 | 2018-05-23T07:59:52.000Z | 2022-03-21T04:37:16.000Z | # encoding: utf-8
#
# Copyright (c) 2017 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2017-12-15
#
"""Interface to the Zotero database.
All data classes are based on ``AttrDict``, which means their data
can be accesses either as ``dict`` values or as attr... | 30.298387 | 76 | 0.600657 |
4a1e1d36ac36a792f3a75b9afcb7823762559961 | 264 | py | Python | tests/clienttest.py | netrack/bayes | 15e0c54b795f4ce527cc5e2c46bbb7da434ac036 | [
"Apache-2.0"
] | 12 | 2019-07-15T11:15:23.000Z | 2019-12-05T12:19:48.000Z | tests/clienttest.py | netrack/bayes | 15e0c54b795f4ce527cc5e2c46bbb7da434ac036 | [
"Apache-2.0"
] | 10 | 2019-06-25T17:42:44.000Z | 2019-07-09T13:28:12.000Z | tests/clienttest.py | netrack/tensorcraft | 15e0c54b795f4ce527cc5e2c46bbb7da434ac036 | [
"Apache-2.0"
] | 1 | 2019-05-23T13:22:19.000Z | 2019-05-23T13:22:19.000Z | import unittest.mock
from tensorcraft.client import Model
from tests import asynctest
def unittest_mock_model_client(method: str):
return unittest.mock.patch.object(Model, method,
new_callable=asynctest.AsyncMagicMock)
| 26.4 | 76 | 0.708333 |
4a1e1e2f2efccb4e47c47b7d154486fedf75fef1 | 3,110 | py | Python | test/FileShare/tests/TestAll.py | mkozuharov/DataStage | a61e67c901c2b43afa0fec6a99ef72152391a55f | [
"MIT"
] | 8 | 2015-02-25T10:58:52.000Z | 2020-04-17T03:11:48.000Z | test/FileShare/tests/TestAll.py | mkozuharov/DataStage | a61e67c901c2b43afa0fec6a99ef72152391a55f | [
"MIT"
] | null | null | null | test/FileShare/tests/TestAll.py | mkozuharov/DataStage | a61e67c901c2b43afa0fec6a99ef72152391a55f | [
"MIT"
] | 7 | 2015-02-25T10:58:54.000Z | 2019-11-04T16:19:22.000Z | # ---------------------------------------------------------------------
#
# Copyright (c) 2012 University of Oxford
#
# 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, incl... | 40.38961 | 77 | 0.690997 |
4a1e1e7cc611f532060cf4df276e65181147ab42 | 134 | py | Python | configs/upernet/upernet_r101_512x1024_80k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/upernet/upernet_r101_512x1024_80k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/upernet/upernet_r101_512x1024_80k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | _base_ = './upernet_r50_512x1024_80k_cityscapes.py'
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
| 44.666667 | 80 | 0.776119 |
4a1e1f7b851f1c0f06d6f07977f1f8d9f9882075 | 1,804 | py | Python | test_station.py | AldricGoh/year1_floodwaringsystem | d56ede73f64a351ef349f8e9d53d9db6e35a6e6f | [
"MIT"
] | null | null | null | test_station.py | AldricGoh/year1_floodwaringsystem | d56ede73f64a351ef349f8e9d53d9db6e35a6e6f | [
"MIT"
] | null | null | null | test_station.py | AldricGoh/year1_floodwaringsystem | d56ede73f64a351ef349f8e9d53d9db6e35a6e6f | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
"""Unit test for the station module"""
from floodsystem.station import MonitoringStation
from floodsystem.station import inconsistent_typical_range_stations
def test_create_monitoring_station():
# Create a station
s_id = "test-s-id"
m_i... | 33.407407 | 88 | 0.682373 |
4a1e20bb4a39bdc6ef98f2373e2351e1581a59c4 | 24,201 | py | Python | test/test_numpy.py | necaris/orjson | 02d6805af278493f657c17305a2f0cc054f04078 | [
"Apache-2.0",
"MIT"
] | 3,041 | 2018-11-26T08:15:46.000Z | 2022-03-31T22:14:51.000Z | test/test_numpy.py | brandery/orjson | 02d6805af278493f657c17305a2f0cc054f04078 | [
"Apache-2.0",
"MIT"
] | 240 | 2018-11-25T20:01:02.000Z | 2022-03-31T19:48:08.000Z | test/test_numpy.py | brandery/orjson | 02d6805af278493f657c17305a2f0cc054f04078 | [
"Apache-2.0",
"MIT"
] | 145 | 2018-12-20T08:54:32.000Z | 2022-03-30T06:17:47.000Z | # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import unittest
import pytest
import orjson
try:
import numpy
except ImportError:
numpy = None
def numpy_default(obj):
return obj.tolist()
@pytest.mark.skipif(numpy is None, reason="numpy is not installed")
class NumpyTests(unittest.TestCase):
def t... | 34.474359 | 359 | 0.488699 |
4a1e21282625011cd694487871ef8b2c91f95370 | 6,250 | py | Python | examples/quant_engine_single_unit_feather_example_scr_expr_univ_ids.py | factset/analyticsapi-engines-python-sdk | fd066c537344667102c44a4a3d50bd7df7e545fe | [
"Apache-2.0"
] | 12 | 2019-12-01T10:34:50.000Z | 2022-03-14T00:11:21.000Z | examples/quant_engine_single_unit_feather_example_scr_expr_univ_ids.py | factset/analyticsapi-engines-python-sdk | fd066c537344667102c44a4a3d50bd7df7e545fe | [
"Apache-2.0"
] | 33 | 2019-12-01T12:14:01.000Z | 2022-03-22T04:50:30.000Z | examples/quant_engine_single_unit_feather_example_scr_expr_univ_ids.py | factset/analyticsapi-engines-python-sdk | fd066c537344667102c44a4a3d50bd7df7e545fe | [
"Apache-2.0"
] | 1 | 2019-12-01T10:34:52.000Z | 2019-12-01T10:34:52.000Z | import time
import os
from pathlib import Path
import pandas as pd
from fds.analyticsapi.engines import ApiException
from fds.analyticsapi.engines.api.quant_calculations_api import QuantCalculationsApi
from fds.analyticsapi.engines.api_client import ApiClient
from fds.analyticsapi.engines.configuration import Configur... | 48.076923 | 140 | 0.6592 |
4a1e2158151850be24e601655b11d229fa7e5dc4 | 3,241 | py | Python | webdriver/tests/forward/forward.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | null | null | null | webdriver/tests/forward/forward.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 6 | 2021-03-31T20:00:14.000Z | 2022-03-12T00:50:17.000Z | webdriver/tests/forward/forward.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 1 | 2020-05-10T17:24:35.000Z | 2020-05-10T17:24:35.000Z | from tests.support.asserts import assert_error, assert_success
from tests.support.inline import inline
def forward(session):
return session.transport.send(
"POST", "session/{session_id}/forward".format(**vars(session)))
def test_null_response_value(session):
session.url = inline("<div>")
session... | 24.368421 | 76 | 0.653502 |
4a1e22125c8d496581247ff39bb592ea881647bb | 157 | py | Python | code/exercises/exercise_04.py | DahlitzFlorian/python-basic-training | baedaee1259ed91e7403ab121519b1257270c700 | [
"Apache-2.0"
] | 3 | 2019-08-02T14:05:17.000Z | 2022-01-09T02:00:12.000Z | code/exercises/exercise_04.py | DahlitzFlorian/python-basic-training | baedaee1259ed91e7403ab121519b1257270c700 | [
"Apache-2.0"
] | null | null | null | code/exercises/exercise_04.py | DahlitzFlorian/python-basic-training | baedaee1259ed91e7403ab121519b1257270c700 | [
"Apache-2.0"
] | 1 | 2019-10-14T14:20:30.000Z | 2019-10-14T14:20:30.000Z | # Ask the user for a string and print out whether this string is a palindrome or not.
# A palindrome is a string that reads the same forwards and backwards.
| 52.333333 | 85 | 0.77707 |
4a1e22311be58669ca6060cd3adc33942c403f61 | 185 | py | Python | mockidp/__init__.py | fefeme/mock-idp | a74c8c5b378ae9f547e33e0a646e76696b78ed7a | [
"MIT"
] | null | null | null | mockidp/__init__.py | fefeme/mock-idp | a74c8c5b378ae9f547e33e0a646e76696b78ed7a | [
"MIT"
] | null | null | null | mockidp/__init__.py | fefeme/mock-idp | a74c8c5b378ae9f547e33e0a646e76696b78ed7a | [
"MIT"
] | null | null | null | # coding: utf-8
from flask import Flask
__version__ = "0.3.1"
app = Flask(__name__)
app.config['SECRET_KEY'] = 'you-will-never-guess'
import mockidp.saml.routes
import mockidp.routes
| 18.5 | 49 | 0.745946 |
4a1e227a17ade390eb76f5f5a6c242f664bb108d | 383 | py | Python | tools/_make_style_table.py | DarkCode01/rich | c4287eff031d03addac79fd9035e146c7d868b78 | [
"MIT"
] | 2 | 2021-05-11T19:27:06.000Z | 2021-05-12T06:08:08.000Z | tools/_make_style_table.py | antomuli/rich | 5097f44092a4ba4ef7741755b3752d2aebe772a0 | [
"MIT"
] | 2 | 2020-05-09T12:42:28.000Z | 2020-05-09T14:44:04.000Z | tools/_make_style_table.py | antomuli/rich | 5097f44092a4ba4ef7741755b3752d2aebe772a0 | [
"MIT"
] | 1 | 2020-08-14T13:47:25.000Z | 2020-08-14T13:47:25.000Z | """Generate a ANSI style table."""
def make_table():
table = []
for attributes in range(0, 512):
ansi_codes = []
for bit_no in range(0, 9):
bit = 1 << bit_no
if attributes & bit:
ansi_codes.append(str(1 + bit_no))
table.append(";".join(ansi_codes... | 20.157895 | 50 | 0.545692 |
4a1e22e7cfb27daf7a2588a1050655095758c4a5 | 102,927 | py | Python | UMLRT2Kiltera_MM/UMLRT2Kiltera_MM_META.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | UMLRT2Kiltera_MM/UMLRT2Kiltera_MM_META.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | UMLRT2Kiltera_MM/UMLRT2Kiltera_MM_META.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z | """
__UMLRT2Kiltera_MM_META.py_____________________________________________________
Automatically generated AToM3 button model (DO NOT MODIFY DIRECTLY)
Author: gehan
Modified: Sat Aug 30 18:25:18 2014
_______________________________________________________________________________
"""
from ASG_Buttons import *
from But... | 67.938614 | 535 | 0.72668 |
4a1e246ab4a0d349788cbcc9523f979b2f56fee4 | 1,263 | py | Python | foundation_tenant/models/bizmula/documenttype.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | 1 | 2020-07-16T10:58:23.000Z | 2020-07-16T10:58:23.000Z | foundation_tenant/models/bizmula/documenttype.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | 13 | 2018-11-30T02:29:39.000Z | 2022-03-11T23:35:49.000Z | foundation_tenant/models/bizmula/documenttype.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | null | null | null | from django.db import models
from django.utils.translation import ugettext_lazy as _
class DocumentTypeManager(models.Manager):
def delete_all(self):
items = DocumentType.objects.all()
for item in items.all():
item.delete()
class DocumentType(models.Model):
"""
The supported ... | 28.704545 | 123 | 0.637371 |
4a1e246c376ad4013fc615680355ec0bfa07f343 | 1,805 | py | Python | abstractive_summary/AbstractiveSummary.py | oikeusministerio/summarization | 5f20ff2753b0889827b29bc1ef5bf33748c20287 | [
"MIT"
] | 4 | 2018-06-21T06:52:28.000Z | 2022-01-18T01:01:10.000Z | abstractive_summary/AbstractiveSummary.py | oikeusministerio/summarization | 5f20ff2753b0889827b29bc1ef5bf33748c20287 | [
"MIT"
] | 2 | 2018-06-08T07:59:06.000Z | 2021-03-31T18:42:11.000Z | abstractive_summary/AbstractiveSummary.py | oikeusministerio/summarization | 5f20ff2753b0889827b29bc1ef5bf33748c20287 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import tensorflow as tf
class AbstractiveSummary:
def __init__(self, dictionary):
self.batch_size = 16
self.checkpoint = "./abstractive_summary/best_model.ckpt"
self.dictionary = dictionary
self.reverse_dictionary = dict(zip(range(len(dictiona... | 46.282051 | 119 | 0.613296 |
4a1e253e96f65c2df9a4d35139edaba9080de1b9 | 4,151 | py | Python | gpflow/training/scipy_optimizer.py | NuhaSaud/GPflow | 763fd2d3d2f4664575a0e4b63584574f1d5ef7cb | [
"Apache-2.0"
] | null | null | null | gpflow/training/scipy_optimizer.py | NuhaSaud/GPflow | 763fd2d3d2f4664575a0e4b63584574f1d5ef7cb | [
"Apache-2.0"
] | null | null | null | gpflow/training/scipy_optimizer.py | NuhaSaud/GPflow | 763fd2d3d2f4664575a0e4b63584574f1d5ef7cb | [
"Apache-2.0"
] | 1 | 2020-12-15T09:56:33.000Z | 2020-12-15T09:56:33.000Z | # Copyright 2017 Artem Artemev @awav
#
# 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 writi... | 42.357143 | 94 | 0.67815 |
4a1e25607aa5f8c0cec6726875a2d6ec1192ba82 | 2,423 | py | Python | examples/Python/ReconstructionSystem/integrate_scene.py | martinruenz/Open3D | 30983e89956dcd233531870ca20e87e6769ba903 | [
"MIT"
] | 3 | 2018-04-24T21:17:24.000Z | 2018-06-02T12:44:06.000Z | examples/Python/ReconstructionSystem/integrate_scene.py | martinruenz/Open3D | 30983e89956dcd233531870ca20e87e6769ba903 | [
"MIT"
] | null | null | null | examples/Python/ReconstructionSystem/integrate_scene.py | martinruenz/Open3D | 30983e89956dcd233531870ca20e87e6769ba903 | [
"MIT"
] | 1 | 2020-03-31T14:30:40.000Z | 2020-03-31T14:30:40.000Z | # Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/Python/ReconstructionSystem/integrate_scene.py
import numpy as np
import math
import sys
from open3d import *
sys.path.append("../Utility")
from file import *
sys.path.append(".")
from make_fragments imp... | 39.721311 | 79 | 0.69253 |
4a1e257e2a6774827cd953c3fdf69c833af22049 | 27,473 | py | Python | perma_web/perma/views/common.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | null | null | null | perma_web/perma/views/common.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | null | null | null | perma_web/perma/views/common.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | null | null | null | from ratelimit.decorators import ratelimit
from datetime import timedelta
from dateutil.tz import tzutc
from io import StringIO
from link_header import Link as Rel, LinkHeader
from urllib.parse import urlencode
import time
from timegate.utils import closest
from warcio.timeutils import datetime_to_http_date
from werkze... | 44.16881 | 165 | 0.651076 |
4a1e2763d7b6cc85877e8a783415c2a072fea66e | 861 | py | Python | Coding the Matrix/00_the_function/dictutil.py | bustinstuff/linearalgebra | a343ba57785f4d76e38e04d97892da54199ceeac | [
"MIT"
] | null | null | null | Coding the Matrix/00_the_function/dictutil.py | bustinstuff/linearalgebra | a343ba57785f4d76e38e04d97892da54199ceeac | [
"MIT"
] | null | null | null | Coding the Matrix/00_the_function/dictutil.py | bustinstuff/linearalgebra | a343ba57785f4d76e38e04d97892da54199ceeac | [
"MIT"
] | null | null | null | def dict2list(dct, keylist):
"""
task 0.6.3
procedure taking a dictionary and a keylist
output should be a list of the dict keylist values
e.g. input dct={'a':'A', 'b':'B', 'c':'C'} keylist=['b', 'c', 'a'] output=['B', 'C', 'A']
"""
return [dct[key] for key in keylist]
def list2dict(L, ke... | 26.090909 | 93 | 0.5482 |
4a1e27ab9fa9f09282a7d0934d69375db488cfc7 | 502 | py | Python | solutions/tier_02/python/uri_2343_cacadores_de_mitos.py | EstevaoNaval/URI_repository | 373681078f237231a6ec2c5a2ab04be434f54968 | [
"MIT"
] | null | null | null | solutions/tier_02/python/uri_2343_cacadores_de_mitos.py | EstevaoNaval/URI_repository | 373681078f237231a6ec2c5a2ab04be434f54968 | [
"MIT"
] | null | null | null | solutions/tier_02/python/uri_2343_cacadores_de_mitos.py | EstevaoNaval/URI_repository | 373681078f237231a6ec2c5a2ab04be434f54968 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
qntOcorrenciaRaio = int(input())
caiuMesmoLugar = 0
dictCoordRaio = [501 * [0] for x in range(501)]
for indexOcorrencia in range(qntOcorrenciaRaio):
listCoordRaioCaiu = list(map(int, input().split()))
if caiuMesmoLugar == 0:
if dictCoordRaio[listCoordRaioCaiu[0]][listCoordRaioCa... | 31.375 | 74 | 0.649402 |
4a1e27c3c6511ecb711f546d078ceb0ef621330a | 3,130 | py | Python | model/evaluation_audio.py | ggzhang0071/multimodal-speech-emotion | 2c3f491442dd057a8dc2215cf1f39bcdf55b6318 | [
"MIT"
] | 194 | 2019-01-13T19:05:29.000Z | 2022-03-29T20:13:28.000Z | model/evaluation_audio.py | ggzhang0071/multimodal-speech-emotion | 2c3f491442dd057a8dc2215cf1f39bcdf55b6318 | [
"MIT"
] | 10 | 2019-02-07T12:28:52.000Z | 2021-03-20T14:47:09.000Z | model/evaluation_audio.py | ggzhang0071/multimodal-speech-emotion | 2c3f491442dd057a8dc2215cf1f39bcdf55b6318 | [
"MIT"
] | 63 | 2019-02-03T13:19:46.000Z | 2022-03-20T07:51:04.000Z | #-*- coding: utf-8 -*-
"""
what : evaluation
"""
from tensorflow.core.framework import summary_pb2
from random import shuffle
import numpy as np
from scipy.stats import rankdata
from project_config import *
"""
desc :
inputs:
sess : tf session
model : model for test
data ... | 32.604167 | 98 | 0.566454 |
4a1e294ad8f3b1a23adea50990143f93c132eab0 | 383 | py | Python | client/basic.py | Luanxpg9/django-generic-api | 27de5de1c10815346a3071577c043f5f698b479e | [
"Apache-2.0"
] | null | null | null | client/basic.py | Luanxpg9/django-generic-api | 27de5de1c10815346a3071577c043f5f698b479e | [
"Apache-2.0"
] | null | null | null | client/basic.py | Luanxpg9/django-generic-api | 27de5de1c10815346a3071577c043f5f698b479e | [
"Apache-2.0"
] | null | null | null | import requests
#endpoint = "https://httpbin.org"
#endpoint_status = "https://httpbin.org/status/200"
#endpoint_anything = "https://httpbin.org/anything"
endpoint = "http://localhost:8000"
get_response = requests.get(endpoint_anything, json={
"query": "Hello World"}) # API -> Method
pri... | 29.461538 | 69 | 0.678851 |
4a1e2a8c9c01e20bb7c55a43716c8b8c58f02eb9 | 9,354 | py | Python | coinone/views.py | poohc300/auto-trade-system | d4950f2d8ef06747b53c62358e62b0df7d99d822 | [
"MIT"
] | null | null | null | coinone/views.py | poohc300/auto-trade-system | d4950f2d8ef06747b53c62358e62b0df7d99d822 | [
"MIT"
] | null | null | null | coinone/views.py | poohc300/auto-trade-system | d4950f2d8ef06747b53c62358e62b0df7d99d822 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from .models import CoinoneService
from rest_framework.views import APIView
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.permissions import IsAuthenticated, AllowAny, IsAdminUser
from rest_framework.decora... | 35.56654 | 98 | 0.590977 |
4a1e2adbd3c312d35b7601ffecc8cd386ff38e02 | 919 | py | Python | sobel_operator.py | LeslieWongCV/CV | 517902122348d23456700e05806557b0c62d6c3a | [
"MIT"
] | 2 | 2020-12-02T07:49:33.000Z | 2022-01-17T16:48:38.000Z | sobel_operator.py | LeslieWongCV/CV | 517902122348d23456700e05806557b0c62d6c3a | [
"MIT"
] | null | null | null | sobel_operator.py | LeslieWongCV/CV | 517902122348d23456700e05806557b0c62d6c3a | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import scipy
from scipy import signal
LENA = cv2.imread('/Users/leslie/Desktop/革命成果-学术/LENA_FULL.jpg',0) #选1为真彩色读取方式
# cv2.namedWindow("Image")
# cv2.imshow('image',LENA)
# cv2.waitKey (0)
row, colum = LENA.shape #增加channel接受色彩通道,but 'convolve2d inputs must both be 2D arrays'
LENA_f = np.... | 20.422222 | 87 | 0.68444 |
4a1e2b01054686c89e52e91ad942317ed2ef1604 | 718 | py | Python | clients/python/test/test_reset_creation.py | adipolak/lakeFS | 798e7b7d42f20dba2261c7ecbdc56a5c9131a28c | [
"Apache-2.0"
] | 1 | 2022-02-02T08:52:15.000Z | 2022-02-02T08:52:15.000Z | clients/python/test/test_reset_creation.py | adipolak/lakeFS | 798e7b7d42f20dba2261c7ecbdc56a5c9131a28c | [
"Apache-2.0"
] | null | null | null | clients/python/test/test_reset_creation.py | adipolak/lakeFS | 798e7b7d42f20dba2261c7ecbdc56a5c9131a28c | [
"Apache-2.0"
] | null | null | null | """
lakeFS API
lakeFS HTTP API # noqa: E501
The version of the OpenAPI document: 0.1.0
Contact: services@treeverse.io
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import lakefs_client
from lakefs_client.model.reset_creation import ResetCreation
class TestResetC... | 19.405405 | 79 | 0.671309 |
4a1e2c6c5263992b4cc803aa878db4144adf6beb | 989 | py | Python | think/qPrac4_LS_strat.py | jasonyum/math-puzzles | 006b51d92a942efe469873735a204cf976f479fd | [
"MIT"
] | null | null | null | think/qPrac4_LS_strat.py | jasonyum/math-puzzles | 006b51d92a942efe469873735a204cf976f479fd | [
"MIT"
] | null | null | null | think/qPrac4_LS_strat.py | jasonyum/math-puzzles | 006b51d92a942efe469873735a204cf976f479fd | [
"MIT"
] | null | null | null | # Pipeline imports
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.psychsignal import stocktwits
from quantopian.pipeline.factors import SimpleMovingAverage
from quantopian.pipeline.experimental import QTradableStocksUS
# Pipeline definition
def make_pipeline():
base_universe = QTradableS... | 27.472222 | 121 | 0.734075 |
4a1e2ca31281c6e6500133be3ad74e9d1e58198d | 20,440 | py | Python | kombu/tests/transport/test_pubsub.py | cldcvr/kombu | 5399cd83a361e0708956ca7e4708d4474f6939a9 | [
"BSD-3-Clause"
] | null | null | null | kombu/tests/transport/test_pubsub.py | cldcvr/kombu | 5399cd83a361e0708956ca7e4708d4474f6939a9 | [
"BSD-3-Clause"
] | null | null | null | kombu/tests/transport/test_pubsub.py | cldcvr/kombu | 5399cd83a361e0708956ca7e4708d4474f6939a9 | [
"BSD-3-Clause"
] | 1 | 2020-11-20T13:21:57.000Z | 2020-11-20T13:21:57.000Z | import unittest
from mock import patch, call, Mock, MagicMock, PropertyMock
from kombu.transport.pubsub import Channel, Message, QoS
from kombu.exceptions import ChannelError
from google.cloud import tasks_v2
from google.api_core.exceptions import AlreadyExists
class InnerMsg(object):
def __init__(self, **kwargs... | 47.205543 | 89 | 0.590166 |
4a1e2eadafff678a35eb5220106cb17efe480cc8 | 8,016 | py | Python | tests/handlers/test_base_handler.py | appotry/thumbor | c2e75918da09ddd3086e8eeaca00d1d2747cf57c | [
"MIT"
] | null | null | null | tests/handlers/test_base_handler.py | appotry/thumbor | c2e75918da09ddd3086e8eeaca00d1d2747cf57c | [
"MIT"
] | null | null | null | tests/handlers/test_base_handler.py | appotry/thumbor | c2e75918da09ddd3086e8eeaca00d1d2747cf57c | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import shutil
import tempfile
from os.path import abspath, dirname, ... | 35.157895 | 115 | 0.702096 |
4a1e2f667148e2f17921d39d0824565f234e1ebf | 459 | py | Python | RoboticsLanguage/Transformers/Events/Language.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 64 | 2018-05-15T14:36:44.000Z | 2022-03-09T05:00:31.000Z | RoboticsLanguage/Transformers/Events/Language.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 9 | 2018-04-17T21:12:27.000Z | 2019-11-08T20:53:32.000Z | RoboticsLanguage/Transformers/Events/Language.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 10 | 2018-03-27T12:09:12.000Z | 2021-02-16T08:07:26.000Z | #
# This is the Robotics Language compiler
#
# Parameters.py: Definition of the parameters for this package
#
# Created on: 05 September, 2018
# Author: Gabriel Lopes
# Licence: license
# Copyright: copyright
#
from RoboticsLanguage.Base.Types import arguments, returns
language = {
'when': {
... | 21.857143 | 64 | 0.620915 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.