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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
898072de5f9e47e21b41b92c73b1d8e7e7c47ece | 22,046 | py | Python | homeassistant/components/mqtt/mixins.py | CantankerousBullMoose/core | 2178e27fb4c62271d4872e16838331defed82226 | [
"Apache-2.0"
] | 1 | 2021-03-12T20:46:40.000Z | 2021-03-12T20:46:40.000Z | homeassistant/components/mqtt/mixins.py | CantankerousBullMoose/core | 2178e27fb4c62271d4872e16838331defed82226 | [
"Apache-2.0"
] | 46 | 2020-12-18T07:15:15.000Z | 2022-03-31T06:04:00.000Z | homeassistant/components/mqtt/mixins.py | CantankerousBullMoose/core | 2178e27fb4c62271d4872e16838331defed82226 | [
"Apache-2.0"
] | 2 | 2021-03-22T21:42:48.000Z | 2021-04-12T12:26:39.000Z | """MQTT component mixins and helpers."""
from abc import abstractmethod
import json
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.const import CONF_DEVICE, CONF_ICON, CONF_NAME, CONF_UNIQUE_ID
from homeassistant.core import callback
from homeassistant.helpers import config_val... | 36.621262 | 106 | 0.658623 |
613bf7fe2495ca54b58358a5a4925941fdad71d2 | 65 | py | Python | LeitorPython.py | amrals/Python | 711194814d9a4862abb18dd60814870555085d5d | [
"MIT"
] | null | null | null | LeitorPython.py | amrals/Python | 711194814d9a4862abb18dd60814870555085d5d | [
"MIT"
] | null | null | null | LeitorPython.py | amrals/Python | 711194814d9a4862abb18dd60814870555085d5d | [
"MIT"
] | null | null | null | arq2 = open("C:\Matheus\Arquivos/oi.txt","r")
print(arq2.read())
| 21.666667 | 45 | 0.661538 |
d872011661142c20ba20eced2cb7c4c0d63041ef | 235 | py | Python | models/news_model.py | ismdeep/jxust-news-monitor | a5dc6ba689a21e85e9e44847dbbd4d6ed02a3d34 | [
"MIT"
] | null | null | null | models/news_model.py | ismdeep/jxust-news-monitor | a5dc6ba689a21e85e9e44847dbbd4d6ed02a3d34 | [
"MIT"
] | null | null | null | models/news_model.py | ismdeep/jxust-news-monitor | a5dc6ba689a21e85e9e44847dbbd4d6ed02a3d34 | [
"MIT"
] | null | null | null | class NewsModel:
title = None
url = None
def __init__(self, __title__, __url__):
self.title = __title__
self.url = __url__
def __str__(self):
return '''["%s", "%s"]''' % (self.title, self.url)
| 21.363636 | 58 | 0.557447 |
4adb038433ffab1ba1473d0365e278bbd5a2edff | 1,891 | py | Python | runners/mlcommons_box_ssh/mlcommons_box_ssh/__main__.py | vibhatha/mlbox | f76aa0043175988109d020be42dad5f32003190f | [
"Apache-2.0"
] | 3 | 2021-02-06T06:47:32.000Z | 2021-08-11T10:05:29.000Z | runners/mlcommons_box_ssh/mlcommons_box_ssh/__main__.py | vibhatha/mlbox | f76aa0043175988109d020be42dad5f32003190f | [
"Apache-2.0"
] | null | null | null | runners/mlcommons_box_ssh/mlcommons_box_ssh/__main__.py | vibhatha/mlbox | f76aa0043175988109d020be42dad5f32003190f | [
"Apache-2.0"
] | null | null | null | import os
import click
from mlcommons_box import parse # Do not remove (it registers schemas on import)
from mlcommons_box.common import mlbox_metadata
from mlcommons_box_ssh import ssh_metadata
from mlcommons_box_ssh.ssh_run import SSHRun
@click.group(name='mlcommons_box_ssh')
def cli():
"""
MLCommons-Box ... | 41.108696 | 120 | 0.742993 |
c32dddbd6b2fcd643516ea430a4b02656a2ed988 | 9,897 | py | Python | ndm/model_cnn12_mp_bn_att_a_w2t.py | oplatek/ndm | d32bd9d685902d9da52b7e7abd286fb5d9c7274a | [
"Apache-2.0"
] | 2 | 2016-01-26T15:29:30.000Z | 2016-12-07T23:36:23.000Z | ndm/model_cnn12_mp_bn_att_a_w2t.py | oplatek/ndm | d32bd9d685902d9da52b7e7abd286fb5d9c7274a | [
"Apache-2.0"
] | 1 | 2018-05-10T08:03:32.000Z | 2018-05-10T08:03:32.000Z | ndm/model_cnn12_mp_bn_att_a_w2t.py | oplatek/ndm | d32bd9d685902d9da52b7e7abd286fb5d9c7274a | [
"Apache-2.0"
] | 1 | 2016-02-25T14:35:47.000Z | 2016-02-25T14:35:47.000Z | #!/usr/bin/env python3
import sys
import tensorflow as tf
from model import ModelW2T
from tfx.bricks import embedding, dense_to_one_hot, linear, conv2d, multicolumn_embedding, \
glorot_mul, reduce_max, dropout, conv2d_bn, batch_norm_lin, pow_1, max_pool
class Model(ModelW2T):
def __init__(self, data, FLAGS)... | 47.128571 | 128 | 0.565929 |
9c345f3f0902c8558da5b28d6f3c02dfc8a73732 | 1,306 | py | Python | py/g1/http/http2_servers/g1/http/http2_servers/__init__.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | 3 | 2016-01-04T06:28:52.000Z | 2020-09-20T13:18:40.000Z | py/g1/http/http2_servers/g1/http/http2_servers/__init__.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | py/g1/http/http2_servers/g1/http/http2_servers/__init__.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | __all__ = [
'HttpServer',
]
import logging
import socket
import ssl
from . import nghttp2 as ng
from . import wsgi
logging.getLogger(__name__).addHandler(logging.NullHandler())
VERSION = '%s/nghttp2=%s' % (
__name__,
# pylint: disable=no-member
ng.F.nghttp2_version(0).contents.version_str.decode('ut... | 27.787234 | 65 | 0.61562 |
3cc63e801d166f36909f35dc299de7ba4fac34ef | 20,694 | py | Python | luna/gateware/soc/simplesoc.py | TomKeddie/luna | 6688f7ae2a1b506eb6498cc2ad15dddcef0cc06a | [
"BSD-3-Clause"
] | 2 | 2020-11-04T10:54:15.000Z | 2022-03-17T20:38:21.000Z | luna/gateware/soc/simplesoc.py | hxkrrzq/luna | e56a3eef6a9fa138755512bec1252725601425c1 | [
"BSD-3-Clause"
] | null | null | null | luna/gateware/soc/simplesoc.py | hxkrrzq/luna | e56a3eef6a9fa138755512bec1252725601425c1 | [
"BSD-3-Clause"
] | 2 | 2021-06-26T06:06:52.000Z | 2022-01-19T22:36:19.000Z | #
# This file is part of LUNA.
#
# Copyright (c) 2020 Great Scott Gadgets <info@greatscottgadgets.com>
# SPDX-License-Identifier: BSD-3-Clause
""" Simple SoC abstraction for LUNA examples."""
import os
import datetime
import logging
from nmigen import Elaboratable, Module
from nmigen_soc ... | 36.561837 | 131 | 0.585242 |
c1c661e766b1775fc3ccbb9da940a4850bc8fcc3 | 5,859 | py | Python | keyring/backends/_OS_X_API.py | mathstuf/python-keyring | be19f913cf85e829b1b8f718e047535823acf2ff | [
"MIT"
] | 7 | 2018-01-19T05:34:48.000Z | 2022-01-19T01:53:18.000Z | keyring/backends/_OS_X_API.py | mathstuf/python-keyring | be19f913cf85e829b1b8f718e047535823acf2ff | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/hackedit/vendor/keyring/backends/_OS_X_API.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 4 | 2018-01-19T05:34:30.000Z | 2021-09-08T08:38:21.000Z | import contextlib
import ctypes
from ctypes import c_void_p, c_uint16, c_uint32, c_int32, c_char_p, POINTER
sec_keychain_ref = sec_keychain_item_ref = c_void_p
OS_status = c_int32
class error:
item_not_found = -25300
fw = '/System/Library/Frameworks/{name}.framework/Versions/A/{name}'.format
_sec = ctypes.CDLL(f... | 29.442211 | 84 | 0.676566 |
954fd9b37a1d4d6ceca6c17d863ba22404a38986 | 2,658 | py | Python | week4/trainClassifier.py | linkian209/search_with_machine_learning_course | 402b4686de85b86bde96d068ebdda3b766b14b12 | [
"Apache-2.0"
] | null | null | null | week4/trainClassifier.py | linkian209/search_with_machine_learning_course | 402b4686de85b86bde96d068ebdda3b766b14b12 | [
"Apache-2.0"
] | null | null | null | week4/trainClassifier.py | linkian209/search_with_machine_learning_course | 402b4686de85b86bde96d068ebdda3b766b14b12 | [
"Apache-2.0"
] | null | null | null | import fasttext
import itertools
import sys
import pandas as pd
from multiprocessing import Pool
output_dir = '/workspace/datasets'
base_model = 'query_data'
training_file_base = output_dir + '/labeled_query_data_mq_{}.train'
testing_file_base = output_dir + '/labeled_query_data_mq_{}.test'
output_file = output_dir + ... | 36.916667 | 144 | 0.64936 |
96ecbbb699caccfa18335ee9fb0eb2acce344d46 | 1,307 | py | Python | py_client/communication/response_processing.py | sma-software/openviriato.algorithm-platform.py-client | 73d4cf89aa6f4d02ab15b5504d92107848742325 | [
"Apache-2.0"
] | 2 | 2021-06-21T06:50:29.000Z | 2021-06-30T15:58:02.000Z | py_client/communication/response_processing.py | sma-software/openviriato.algorithm-platform.py-client | 73d4cf89aa6f4d02ab15b5504d92107848742325 | [
"Apache-2.0"
] | null | null | null | py_client/communication/response_processing.py | sma-software/openviriato.algorithm-platform.py-client | 73d4cf89aa6f4d02ab15b5504d92107848742325 | [
"Apache-2.0"
] | null | null | null | import requests
def raise_if_unsuccessful_response_code(api_response: requests.Response) -> None:
try:
api_response.raise_for_status()
except requests.HTTPError:
if api_response.text != '':
algorithm_platform_error_information = api_response.json()
raise Algo... | 31.878049 | 82 | 0.680184 |
de42762bcaff5d184eb80990b9729b98752814cc | 4,175 | py | Python | atomic_reactor/plugins/post_rpmqa.py | tveverka-RH/atomic-reactor | e3fca7dd435250cb06565f19c8758a908f7f3c62 | [
"BSD-3-Clause"
] | 16 | 2019-07-04T16:00:13.000Z | 2022-01-28T19:51:58.000Z | atomic_reactor/plugins/post_rpmqa.py | tveverka-RH/atomic-reactor | e3fca7dd435250cb06565f19c8758a908f7f3c62 | [
"BSD-3-Clause"
] | 577 | 2019-06-03T07:53:16.000Z | 2022-03-31T04:01:23.000Z | atomic_reactor/plugins/post_rpmqa.py | ben-alkov/atomic-reactor | be6b626b7d822f77999f245193fefcc00c501ca9 | [
"BSD-3-Clause"
] | 17 | 2020-02-21T13:30:06.000Z | 2022-02-15T10:42:32.000Z | """
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import os
import subprocess
import tempfile
import tarfile
from atomic_reactor.plugin import PostBuildPlugin
from atomic_reactor.utils.rpm im... | 36.622807 | 99 | 0.64024 |
242506ea341b335247b363883619a0d2c6a43503 | 726 | py | Python | interview/leet/897_Increasing_Order_Search_Tree.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2020-10-12T13:33:29.000Z | 2020-10-12T13:33:29.000Z | interview/leet/897_Increasing_Order_Search_Tree.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | null | null | null | interview/leet/897_Increasing_Order_Search_Tree.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2016-11-09T07:28:45.000Z | 2016-11-09T07:28:45.000Z | #!/usr/bin/env python3
from tree import *
class Solution:
def increasingBST(self, root):
stack, node = [], root
new_root = dummy = TreeNode(None)
while stack or node:
while node:
stack, node = stack+[node], node.left
node = stack.pop()
pr... | 25.928571 | 55 | 0.582645 |
13ac6430fa7f5b9a69d70676db79b2bfeafbf8b5 | 145,404 | py | Python | sympy/physics/continuum_mechanics/beam.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | sympy/physics/continuum_mechanics/beam.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | sympy/physics/continuum_mechanics/beam.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | """
This module can be used to solve 2D beam bending problems with
singularity functions in mechanics.
"""
from sympy.core import S, Symbol, diff, symbols
from sympy.solvers import linsolve
from sympy.printing import sstr
from sympy.functions import SingularityFunction, Piecewise, factorial
from sympy.core import symp... | 40.661074 | 206 | 0.560542 |
a539ff701301d789acf314da41d57c26fb8a7ee2 | 2,364 | py | Python | sandy-disaster-recovery/old_file_delete_handler.py | toddjcrane/crisiscleanup-legacy | 74dbad143ebc3bfae4cc5afc478e43ab4033ff69 | [
"Apache-2.0"
] | 1 | 2017-01-07T21:44:21.000Z | 2017-01-07T21:44:21.000Z | sandy-disaster-recovery/old_file_delete_handler.py | aarontitus/crisiscleanup-legacy | 74dbad143ebc3bfae4cc5afc478e43ab4033ff69 | [
"Apache-2.0"
] | 1 | 2021-03-26T00:25:19.000Z | 2021-03-26T00:25:19.000Z | sandy-disaster-recovery/old_file_delete_handler.py | toddjcrane/crisiscleanup-legacy | 74dbad143ebc3bfae4cc5afc478e43ab4033ff69 | [
"Apache-2.0"
] | 1 | 2017-09-07T09:52:15.000Z | 2017-09-07T09:52:15.000Z | #!/usr/bin/env python
#
# Copyright 2013 Chris Wood
#
# 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... | 31.52 | 91 | 0.653976 |
36c55f6ecf57f6fb1c1a06698edfff54117c57d9 | 3,246 | py | Python | tests/ut/python/dataset/test_random_vertical_flip.py | ythlml/mindspore | 028ae212624164044cfaa84f347fc502cb7fcb0f | [
"Apache-2.0"
] | 7 | 2020-05-24T03:19:26.000Z | 2020-05-24T03:20:00.000Z | tests/ut/python/dataset/test_random_vertical_flip.py | ythlml/mindspore | 028ae212624164044cfaa84f347fc502cb7fcb0f | [
"Apache-2.0"
] | null | null | null | tests/ut/python/dataset/test_random_vertical_flip.py | ythlml/mindspore | 028ae212624164044cfaa84f347fc502cb7fcb0f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | 32.138614 | 91 | 0.69008 |
af9fafb506b56702f39203c961ce1da1db92b7e7 | 2,571 | py | Python | web/middleware.py | baronpan/SysmonHunter | 0ec6e28c07386c9e8f470bf7dedce097a899dde5 | [
"MIT"
] | 187 | 2019-07-30T08:11:02.000Z | 2022-03-28T06:19:03.000Z | web/middleware.py | l3ngd0n/SysmonHunter | 0ec6e28c07386c9e8f470bf7dedce097a899dde5 | [
"MIT"
] | 2 | 2020-05-15T07:10:48.000Z | 2021-06-05T13:55:56.000Z | web/middleware.py | l3ngd0n/SysmonHunter | 0ec6e28c07386c9e8f470bf7dedce097a899dde5 | [
"MIT"
] | 61 | 2019-08-08T09:39:25.000Z | 2021-12-06T05:59:43.000Z | import pandas
import server
from data.sysmon import SysmonData
from core import rule
from core.behavior import *
from db import esapi
import analyst.statistic as ast
from core.attck import *
def daterange_format(d):
start = d.split(' - ')[0]
end = d.split(' - ')[1]
start_date = '{}-{}-{}'.format(start.sp... | 33.828947 | 115 | 0.622326 |
7b031b549854c8a94b7a644d628f093ecda7355a | 2,093 | py | Python | examples/ad_manager/v201805/placement_service/deactivate_placements.py | beamc83/python-googleads | 6039d08e2d85850a46a70f24359d362ffde2f7ed | [
"Apache-2.0"
] | 2 | 2019-07-11T13:01:56.000Z | 2019-07-11T13:01:58.000Z | examples/ad_manager/v201805/placement_service/deactivate_placements.py | SoungMo/googleads-python-lib | fe86335c416e0571328c0a481c4b0cff863c01d9 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201805/placement_service/deactivate_placements.py | SoungMo/googleads-python-lib | fe86335c416e0571328c0a481c4b0cff863c01d9 | [
"Apache-2.0"
] | 1 | 2020-07-19T14:24:05.000Z | 2020-07-19T14:24:05.000Z | #!/usr/bin/env python
#
# Copyright 2015 Google Inc. 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 requir... | 33.222222 | 78 | 0.716675 |
88a41edfbc4cb45f2256a7cc83e0f49b4721eb5f | 6,278 | py | Python | df_generator.py | NTerlemes/opportunity | 6444b1779261ce594bab5d804fb3d0ab36affc13 | [
"MIT"
] | 1 | 2021-05-21T15:17:54.000Z | 2021-05-21T15:17:54.000Z | df_generator.py | NTerlemes/opportunity | 6444b1779261ce594bab5d804fb3d0ab36affc13 | [
"MIT"
] | null | null | null | df_generator.py | NTerlemes/opportunity | 6444b1779261ce594bab5d804fb3d0ab36affc13 | [
"MIT"
] | null | null | null | import os
import json
import re
import pandas as pd
import numpy as np
from pathlib import Path
from typing import List, Tuple
from tqdm import tqdm
import shutil
data_folder = os.path.join(os.path.dirname(os.path.dirname(__file__)), '../Data/OpportunityUCIDataset/dataset')
results_folder = os.path.join(os.path.dirnam... | 41.302632 | 123 | 0.660083 |
f971be029b8cea596ecacf841ffc35d863658bcf | 1,881 | py | Python | python/raydp/tests/conftest.py | KepingYan/raydp | 7d9f0e88907addeb32dcd5af04c57c7b69da8025 | [
"Apache-2.0"
] | null | null | null | python/raydp/tests/conftest.py | KepingYan/raydp | 7d9f0e88907addeb32dcd5af04c57c7b69da8025 | [
"Apache-2.0"
] | null | null | null | python/raydp/tests/conftest.py | KepingYan/raydp | 7d9f0e88907addeb32dcd5af04c57c7b69da8025 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 31.35 | 87 | 0.738969 |
398a932361b092daca65c60d697b8f436d108009 | 7,405 | py | Python | cachier/pickle_core.py | shaoyucheng/cachier | 278e395cedc2a10616eed208682c296d01985074 | [
"MIT"
] | null | null | null | cachier/pickle_core.py | shaoyucheng/cachier | 278e395cedc2a10616eed208682c296d01985074 | [
"MIT"
] | null | null | null | cachier/pickle_core.py | shaoyucheng/cachier | 278e395cedc2a10616eed208682c296d01985074 | [
"MIT"
] | null | null | null | """A pickle-based caching core for cachier."""
# This file is part of Cachier.
# https://github.com/shaypal5/cachier
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2016, Shay Palachy <shaypal5@gmail.com>
import os
import pickle # for local caching
from datetime im... | 33.206278 | 100 | 0.567319 |
b14ef1df8ff4c660b9b6f2abfd5df6572d10b1e8 | 12,018 | py | Python | tensorflow/contrib/eager/python/examples/resnet50/resnet50_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/eager/python/examples/resnet50/resnet50_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/eager/python/examples/resnet50/resnet50_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2017 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... | 36.752294 | 80 | 0.670078 |
48cec7034cfb639fce5eadf2956d392a73fa44cf | 1,414 | py | Python | sciencebeam_parser/document/tei/citation.py | elifesciences/sciencebeam-parser | 66964f283612b8d6fa8a23ad8790292c1ec07651 | [
"MIT"
] | 13 | 2021-08-04T12:11:17.000Z | 2022-03-28T20:41:20.000Z | sciencebeam_parser/document/tei/citation.py | elifesciences/sciencebeam-parser | 66964f283612b8d6fa8a23ad8790292c1ec07651 | [
"MIT"
] | 33 | 2021-08-05T08:37:59.000Z | 2022-03-29T18:42:09.000Z | sciencebeam_parser/document/tei/citation.py | elifesciences/sciencebeam-parser | 66964f283612b8d6fa8a23ad8790292c1ec07651 | [
"MIT"
] | 1 | 2022-01-05T14:53:06.000Z | 2022-01-05T14:53:06.000Z | from typing import (
Any,
Mapping,
Type
)
from lxml import etree
from sciencebeam_parser.document.semantic_document import (
SemanticCitation,
SemanticContentWrapper,
SemanticFigureCitation,
SemanticReferenceCitation,
SemanticTableCitation
)
from sciencebeam_parser.document.tei.common ... | 27.72549 | 75 | 0.713579 |
9ad7f79c73ee093c6aad22ea5e5fa007fd7c93a9 | 826 | py | Python | handler/weui.py | hulingfeng211/weixin | e3b869ffa2bf54366d561535c84e118db0e9827e | [
"Apache-2.0"
] | null | null | null | handler/weui.py | hulingfeng211/weixin | e3b869ffa2bf54366d561535c84e118db0e9827e | [
"Apache-2.0"
] | null | null | null | handler/weui.py | hulingfeng211/weixin | e3b869ffa2bf54366d561535c84e118db0e9827e | [
"Apache-2.0"
] | null | null | null | # -*- conding:utf -*-
#===================================================
# creater:george
# email:hulingfeng211@163.com
# create time:2016-06-06 15:07
# description:
#
#===================================================
from tornado.web import RequestHandler,url
class IndexHandler(RequestHandler):
def get(self,*... | 22.324324 | 69 | 0.599274 |
a3e6980802b41287b739767c4b278aff6ec89c11 | 2,079 | py | Python | day5/server/controllers/users/controllers.py | smalljiny/raspi-class-example | 7f92f34d366b94f9ae3c7da5ebeacdeb628be446 | [
"Apache-2.0"
] | null | null | null | day5/server/controllers/users/controllers.py | smalljiny/raspi-class-example | 7f92f34d366b94f9ae3c7da5ebeacdeb628be446 | [
"Apache-2.0"
] | null | null | null | day5/server/controllers/users/controllers.py | smalljiny/raspi-class-example | 7f92f34d366b94f9ae3c7da5ebeacdeb628be446 | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint, abort, request, json, Response
import pymysql.cursors
from pymysql.err import IntegrityError
from encryption import password
from error import db_error
users = Blueprint('users', __name__)
# 사용자 리스트 조회, 사용자 추가
@users.route('', methods=['GET', 'POST'])
def route_user():
if request.meth... | 23.359551 | 78 | 0.597403 |
e0f3b2a4ffec4df78702ca35140b23de9b38cfcb | 1,166 | py | Python | peek_agent/plugin/PeekAgentPlatformHook.py | Synerty/peek-agent | 12ebeaa2e8017760d926e3d41dbd6112f8fdf142 | [
"MIT"
] | null | null | null | peek_agent/plugin/PeekAgentPlatformHook.py | Synerty/peek-agent | 12ebeaa2e8017760d926e3d41dbd6112f8fdf142 | [
"MIT"
] | null | null | null | peek_agent/plugin/PeekAgentPlatformHook.py | Synerty/peek-agent | 12ebeaa2e8017760d926e3d41dbd6112f8fdf142 | [
"MIT"
] | 1 | 2016-12-12T21:44:39.000Z | 2016-12-12T21:44:39.000Z | from typing import Optional
from peek_platform import PeekPlatformConfig
from peek_plugin_base.agent.PeekAgentPlatformHookABC import PeekAgentPlatformHookABC
class PeekAgentPlatformHook(PeekAgentPlatformHookABC):
def getOtherPluginApi(self, pluginName: str) -> Optional[object]:
pluginLoader = PeekPlatfor... | 33.314286 | 90 | 0.745283 |
4486f02418f841ca5dfd6f54e11b77061a649af4 | 56,328 | py | Python | legacy/autodiff.py | chao-ji/np-auto-diff | 4b21a8895755072f8e0390ce4cc96b17308f8a90 | [
"MIT"
] | 2 | 2021-03-07T09:43:38.000Z | 2021-09-09T21:20:19.000Z | legacy/autodiff.py | chao-ji/reverse-mode-auto-differentiation | 4b21a8895755072f8e0390ce4cc96b17308f8a90 | [
"MIT"
] | null | null | null | legacy/autodiff.py | chao-ji/reverse-mode-auto-differentiation | 4b21a8895755072f8e0390ce4cc96b17308f8a90 | [
"MIT"
] | null | null | null | import numpy as np
class _BaseOp(object):
"""Base class of all Op classes. An Op emits a tensor of a specific shape, and contains the
following attributes:
sess: `Session`;
The session in which the Op is defined.
shape: `numpy.ndarray`;
1D array, e.g. [2, 3, 3, 2], specifying the shape of th... | 33.648746 | 100 | 0.635723 |
17b6b0e20f79b58c3892da663d62d9ef39e2d612 | 1,565 | py | Python | csv_Output_match_norm.py | maxcurie1996/SLiM | bdb480f7e73ce9d9b3ff58e4b0245c514e2c64ed | [
"MIT"
] | null | null | null | csv_Output_match_norm.py | maxcurie1996/SLiM | bdb480f7e73ce9d9b3ff58e4b0245c514e2c64ed | [
"MIT"
] | null | null | null | csv_Output_match_norm.py | maxcurie1996/SLiM | bdb480f7e73ce9d9b3ff58e4b0245c514e2c64ed | [
"MIT"
] | null | null | null | import pandas as pd
intput_para='./Test_files/Output_test/parameter_list.csv'
intput_calc='./Test_files/Output_test/0Disperson_calc.csv'
output_name='./Test_files/Output_test/joint_and_normed.csv'
mode=1 #mode1 is for the results from the MPI calculations(has normalized frequency and growth rate)
#mode2 is for the... | 38.170732 | 101 | 0.703514 |
dd4b2190b28f08b4704bb017661253da96d012f4 | 3,463 | py | Python | django_extensions/tests/test_dumpscript.py | watc/django-extensions | 695af4098355148c477382425dc4e20d3e09a30d | [
"MIT"
] | 1 | 2016-11-29T21:31:59.000Z | 2016-11-29T21:31:59.000Z | django_extensions/tests/test_dumpscript.py | watc/django-extensions | 695af4098355148c477382425dc4e20d3e09a30d | [
"MIT"
] | null | null | null | django_extensions/tests/test_dumpscript.py | watc/django-extensions | 695af4098355148c477382425dc4e20d3e09a30d | [
"MIT"
] | null | null | null | import sys
# conditional imports for python 3
try:
import compiler # NOQA
from StringIO import StringIO # NOQA
except ImportError:
import ast as compiler # NOQA
from io import StringIO # NOQA
from django.test import TestCase
from django.core.management import call_command
from django_extensions.te... | 36.072917 | 103 | 0.596881 |
69cabf467d85a31676a6a93e76a9ce9a8b553d61 | 4,466 | py | Python | gamestonk_terminal/common/technical_analysis/trend_indicators_view.py | Aerex/GamestonkTerminal | 680e0cd278f0d8e45031cdc9d51f247e9aa90ce1 | [
"MIT"
] | 3 | 2021-02-28T09:54:47.000Z | 2021-03-11T17:42:35.000Z | gamestonk_terminal/common/technical_analysis/trend_indicators_view.py | Aerex/GamestonkTerminal | 680e0cd278f0d8e45031cdc9d51f247e9aa90ce1 | [
"MIT"
] | 3 | 2022-02-28T03:37:52.000Z | 2022-02-28T03:37:53.000Z | gamestonk_terminal/common/technical_analysis/trend_indicators_view.py | Aerex/GamestonkTerminal | 680e0cd278f0d8e45031cdc9d51f247e9aa90ce1 | [
"MIT"
] | 1 | 2021-11-20T16:09:48.000Z | 2021-11-20T16:09:48.000Z | """Trend Indicators View"""
__docformat__ = "numpy"
import os
import matplotlib.pyplot as plt
import pandas as pd
from pandas.plotting import register_matplotlib_converters
from gamestonk_terminal import feature_flags as gtff
from gamestonk_terminal.common.technical_analysis import trend_indicators_model
from gamest... | 27.066667 | 83 | 0.610614 |
2b6b4656e11013f2f963a379fad6c8b7a6d48495 | 1,466 | py | Python | tests/test_settlers_of_the_north_pole.py | nullus/advent2018 | b7b139d0128c74e3a744c14367ebb34775ffe747 | [
"BSD-2-Clause"
] | null | null | null | tests/test_settlers_of_the_north_pole.py | nullus/advent2018 | b7b139d0128c74e3a744c14367ebb34775ffe747 | [
"BSD-2-Clause"
] | 1 | 2021-06-10T04:56:55.000Z | 2021-06-10T04:56:55.000Z | tests/test_settlers_of_the_north_pole.py | nullus/advent2018 | b7b139d0128c74e3a744c14367ebb34775ffe747 | [
"BSD-2-Clause"
] | null | null | null | # coding: utf-8
#
# Copyright (c) 2018, Dylan Perry <dylan.perry@gmail.com>. All rights reserved.
# Licensed under BSD 2-Clause License. See LICENSE file for full license.
from pytest import mark
from advent.input import text
from advent.settlers_of_the_north_pole import parse, resource_value, next_state, part1, part... | 18.325 | 93 | 0.562756 |
04877f255c3cbf2af46bba902e4d6856170065de | 16,493 | py | Python | wagtail/tests/demosite/models.py | balkantechnologies/BalkanCMS_core | 68625199028fc96abb175e410a4a7a92c02cb261 | [
"BSD-3-Clause"
] | 1 | 2021-09-21T00:06:52.000Z | 2021-09-21T00:06:52.000Z | wagtail/tests/demosite/models.py | balkantechnologies/BalkanCMS_core | 68625199028fc96abb175e410a4a7a92c02cb261 | [
"BSD-3-Clause"
] | 1 | 2021-02-24T08:25:30.000Z | 2021-02-24T08:25:30.000Z | wagtail/tests/demosite/models.py | balkantechnologies/BalkanCMS_core | 68625199028fc96abb175e410a4a7a92c02cb261 | [
"BSD-3-Clause"
] | 1 | 2020-11-24T10:21:24.000Z | 2020-11-24T10:21:24.000Z | from datetime import date
from django.db import models
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from modelcluster.fields import ParentalKey
from modelcluster.tags import ClusterTaggableManager
from taggit.models import TaggedItemBase
from wagtail.wagtailcore.models import Page, Ordera... | 27.719328 | 78 | 0.659795 |
6706748301b7dca2f051a9b6eb408e0cb775b34a | 3,702 | py | Python | load_atari_model.py | ac-93/soft-actor-critic | 32d637f7da03fe427ada1db325825bc48507a1dc | [
"MIT"
] | 81 | 2020-02-20T13:14:25.000Z | 2022-03-30T12:36:05.000Z | load_atari_model.py | ac-93/soft-actor-critic | 32d637f7da03fe427ada1db325825bc48507a1dc | [
"MIT"
] | 3 | 2020-07-28T07:10:05.000Z | 2021-04-29T18:37:43.000Z | load_atari_model.py | ac-93/soft-actor-critic | 32d637f7da03fe427ada1db325825bc48507a1dc | [
"MIT"
] | 7 | 2020-07-06T21:46:05.000Z | 2021-09-15T13:11:55.000Z | import sys, os
import numpy as np
import time
import gym
import tensorflow as tf
from spinup.utils.logx import *
from image_observation.sac_discrete_kl_atari.common_utils import *
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.6)
tf_config = tf.compat.v1.ConfigProto(gpu_options=gpu_options)
tf_config.g... | 35.257143 | 130 | 0.634792 |
24018f18a80fb0058f94c89a6ffa6f34c9c5a1f2 | 5,667 | py | Python | sumy/evaluation/__main__.py | mapado/sumy | 046aa6302d996f65db064d291d47a158af4b6861 | [
"Apache-2.0"
] | 1 | 2015-07-28T12:45:55.000Z | 2015-07-28T12:45:55.000Z | sumy/evaluation/__main__.py | mapado/sumy | 046aa6302d996f65db064d291d47a158af4b6861 | [
"Apache-2.0"
] | null | null | null | sumy/evaluation/__main__.py | mapado/sumy | 046aa6302d996f65db064d291d47a158af4b6861 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
"""
Sumy - evaluation of automatic text summary.
Usage:
sumy_eval (random | luhn | edmundson | lsa) <reference_summary> [--length=<length>]
sumy_eval (random | luhn | edmundson | lsa) <reference_summary> [--length=<length>] --url=<url>
sumy_eval (random | luhn | edmundson | lsa) <re... | 32.757225 | 129 | 0.712546 |
791a31e5afa76509dfd6b875145a69ef97e61ca0 | 4,410 | py | Python | src/utils.py | catrionamurray/chromatic_fitting | 4903373b385abbf0e67d6ea3ba15d7621f44f2dd | [
"MIT"
] | null | null | null | src/utils.py | catrionamurray/chromatic_fitting | 4903373b385abbf0e67d6ea3ba15d7621f44f2dd | [
"MIT"
] | null | null | null | src/utils.py | catrionamurray/chromatic_fitting | 4903373b385abbf0e67d6ea3ba15d7621f44f2dd | [
"MIT"
] | null | null | null | from .imports import *
def rainbow_to_vector(r, timeformat='h'):
""" Convert Rainbow object to np.arrays
Parameters
----------
r : Rainbow object
chromatic Rainbow object to convert into array format
timeformat : str
(optional, default='hours')
The time ... | 32.910448 | 112 | 0.578005 |
6800edf8be729fbd47336e54a83bae77e97aee5a | 10,181 | py | Python | interval.py | theodox/disempower | 3e8df240a9b63250b6f78e2ec9bd5414d63cea07 | [
"MIT"
] | 1 | 2019-05-20T05:28:32.000Z | 2019-05-20T05:28:32.000Z | interval.py | theodox/disempower | 3e8df240a9b63250b6f78e2ec9bd5414d63cea07 | [
"MIT"
] | 1 | 2019-09-04T04:52:15.000Z | 2019-09-04T04:52:15.000Z | interval.py | theodox/disempower | 3e8df240a9b63250b6f78e2ec9bd5414d63cea07 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from collections import defaultdict
import itertools
import pickle
import time
import logging
logger = logging.getLogger("disempower.interval")
CREDITS = defaultdict(int) # per-user bank
INTERVALS = defaultdict(list) # per-user allowable times
BLACKOUTS = def... | 25.076355 | 95 | 0.600923 |
0cda0d81fc7f687db0c38a696b3e71ffb2c30984 | 1,599 | py | Python | e2e/Tests/Merit/LockedMerit/PendingDieRegainTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 66 | 2019-01-14T08:39:52.000Z | 2022-01-06T11:39:15.000Z | e2e/Tests/Merit/LockedMerit/PendingDieRegainTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 228 | 2019-01-16T15:42:44.000Z | 2022-02-05T07:48:07.000Z | e2e/Tests/Merit/LockedMerit/PendingDieRegainTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 19 | 2019-01-14T08:53:04.000Z | 2021-11-03T20:19:28.000Z | from typing import Dict, Any
import json
from e2e.Meros.RPC import RPC
from e2e.Meros.Liver import Liver
from e2e.Tests.Errors import TestError
correctVectorsHeight: bool = False
def PendingDieRegainTest(
rpc: RPC
) -> None:
def verifyCorrectlyLocked(
height: int
) -> None:
merit: Dict[str, Any] = rpc.... | 26.213115 | 80 | 0.594747 |
c56207b5708566bd33f4e0a0d69f73959d9031c8 | 2,259 | py | Python | ds2_arxiv/tools/my_proxy_complicated.py | liusida/ds2_arxiv | 1ee8a3f65cfb662a1af6dca29cde3e07ec5b322b | [
"MIT"
] | null | null | null | ds2_arxiv/tools/my_proxy_complicated.py | liusida/ds2_arxiv | 1ee8a3f65cfb662a1af6dca29cde3e07ec5b322b | [
"MIT"
] | null | null | null | ds2_arxiv/tools/my_proxy_complicated.py | liusida/ds2_arxiv | 1ee8a3f65cfb662a1af6dca29cde3e07ec5b322b | [
"MIT"
] | null | null | null | import random
import urllib3
from urllib3 import ProxyManager
from urllib3.contrib.socks import SOCKSProxyManager
class MyProxy:
def __init__(self, proxy_txt_filename="proxies.txt", proxy_disabled=False):
self.proxy_disabled = proxy_disabled
self.bad_proxies = []
self.proxies = []
... | 37.032787 | 99 | 0.631695 |
048d5da96044a07ef609106e181c24e425560862 | 20,221 | py | Python | azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancers_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancers_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancers_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 44.441758 | 144 | 0.657139 |
fa110e615caee73b6504e7f18629456025242704 | 3,193 | py | Python | quaternary_FOM_stackedtern10.py | johnmgregoire/PythonCompositionPlots | e105c575463b7d4512d9aac18c7330d1a0dc2c14 | [
"BSD-3-Clause"
] | 4 | 2018-03-05T09:34:49.000Z | 2022-02-01T15:33:54.000Z | quaternary_FOM_stackedtern10.py | johnmgregoire/PythonCompositionPlots | e105c575463b7d4512d9aac18c7330d1a0dc2c14 | [
"BSD-3-Clause"
] | null | null | null | quaternary_FOM_stackedtern10.py | johnmgregoire/PythonCompositionPlots | e105c575463b7d4512d9aac18c7330d1a0dc2c14 | [
"BSD-3-Clause"
] | 2 | 2016-01-24T19:09:21.000Z | 2019-10-11T12:43:07.000Z | import matplotlib.cm as cm
import numpy
import pylab
import operator, copy, os
#pylab.rc('font',**{'family':'serif''serif':['Times New Roman']})
#pylab.rcParams['font.family']='serif'
#pylab.rcParams['font.serif']='Times New Roman'
pylab.rc('font', family='serif', serif='Times New Roman')
#os.chdir('C:/Users/Gregoire... | 36.284091 | 170 | 0.541497 |
d792558e8cf671406d503429159a49a429a004d8 | 3,395 | py | Python | pyEpiabm/pyEpiabm/property/spatial_foi.py | Saketkr21/epiabm | 3ec0dcbc78d3fd4114ed3c6bdd78ef39f0013d2f | [
"BSD-3-Clause"
] | null | null | null | pyEpiabm/pyEpiabm/property/spatial_foi.py | Saketkr21/epiabm | 3ec0dcbc78d3fd4114ed3c6bdd78ef39f0013d2f | [
"BSD-3-Clause"
] | null | null | null | pyEpiabm/pyEpiabm/property/spatial_foi.py | Saketkr21/epiabm | 3ec0dcbc78d3fd4114ed3c6bdd78ef39f0013d2f | [
"BSD-3-Clause"
] | 1 | 2022-03-14T06:00:30.000Z | 2022-03-14T06:00:30.000Z | #
# Calculate spatial force of infection based on Covidsim code
#
import pyEpiabm.core
class SpatialInfection:
"""Class to calculate the infectiousness and susceptibility
parameters for the force of infection parameter, between cells.
"""
@staticmethod
def cell_inf(inf_cell, time: float):
... | 28.529412 | 83 | 0.582032 |
28af5d7714017e57b17ec52269a7e9a005b9d28e | 467 | py | Python | tag/models.py | AICAN-Research/learn-pathology | 663f9c5f125857badf5bb41b6bfa2d9100578e2e | [
"MIT"
] | 2 | 2021-09-16T08:38:10.000Z | 2021-09-16T10:46:53.000Z | tag/models.py | AICAN-Research/learn-pathology | 663f9c5f125857badf5bb41b6bfa2d9100578e2e | [
"MIT"
] | 6 | 2021-09-20T10:56:21.000Z | 2022-01-05T08:25:17.000Z | tag/models.py | AICAN-Research/learn-pathology | 663f9c5f125857badf5bb41b6bfa2d9100578e2e | [
"MIT"
] | null | null | null | from django.db import models
from django.forms import ModelForm
class Tag(models.Model):
name = models.CharField(max_length=255)
is_organ = models.BooleanField(help_text='Is this an organ tag?', default=False)
is_stain = models.BooleanField(help_text='Is this a stain tag?', default=False)
def __str__... | 25.944444 | 84 | 0.689507 |
67b7e26991e36436e5063706c53daba481bea7a4 | 622 | py | Python | var/spack/repos/builtin/packages/py-funcsigs/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-funcsigs/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-funcsigs/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2020 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)
from spack import *
class PyFuncsigs(PythonPackage):
"""Python function signatures from PEP362 for Python 2.6, 2.7 a... | 34.555556 | 95 | 0.755627 |
37ef57b4935d10b4c5c193bcd4cc8e493d204014 | 1,331 | py | Python | supplement/dataPro2.py | 5966466/software-curriculum-design | 42af2401371da30faf6b461d6c29a3c37f691656 | [
"MIT"
] | null | null | null | supplement/dataPro2.py | 5966466/software-curriculum-design | 42af2401371da30faf6b461d6c29a3c37f691656 | [
"MIT"
] | null | null | null | supplement/dataPro2.py | 5966466/software-curriculum-design | 42af2401371da30faf6b461d6c29a3c37f691656 | [
"MIT"
] | null | null | null | import sqlite3
import os, shutil
import numpy as np
import pickle
class DataPro():
def __init__(self, pre):
self.pre = pre
self.path = os.path.join(pre.setpath, pre.setName)
dm = "SELECT COUNT(*) FROM %s" % self.pre.tableName
data = self.pre.execute_set(dm)
if data[0][0] == 0:
self.st_msg = (False, "The... | 23.767857 | 73 | 0.663411 |
d0e5902b0f039d444afee0c1be3669e6f7a5c6ad | 2,185 | py | Python | pytestgen/cli/pytestgen.py | notionparallax/pytestgen | 52821ac1ed3aa4864fa47af9dd1825f92d4367d7 | [
"MIT"
] | 5 | 2019-10-20T19:58:50.000Z | 2021-12-15T00:44:41.000Z | pytestgen/cli/pytestgen.py | notionparallax/pytestgen | 52821ac1ed3aa4864fa47af9dd1825f92d4367d7 | [
"MIT"
] | 2 | 2020-02-02T12:23:37.000Z | 2021-12-13T23:58:42.000Z | pytestgen/cli/pytestgen.py | notionparallax/pytestgen | 52821ac1ed3aa4864fa47af9dd1825f92d4367d7 | [
"MIT"
] | 2 | 2020-05-18T13:56:30.000Z | 2021-12-15T00:44:46.000Z | """pytestgen.py
This is the CLI of pytestgen.
Author:
Figglewatts <me@figglewatts.co.uk>
"""
import logging
from os.path import isdir, exists
import click
from pytestgen import load
from pytestgen import parse
from pytestgen import output
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.com... | 28.376623 | 81 | 0.632494 |
b7579543feed4f0925f6c1d88059c9e008118fde | 1,936 | py | Python | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_storage/v2018_07_01/models/encryption.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2019-05-10T19:58:09.000Z | 2019-05-10T19:58:09.000Z | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_storage/v2018_07_01/models/encryption.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_storage/v2018_07_01/models/encryption.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2020-07-16T23:49:49.000Z | 2020-07-16T23:49:49.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 ... | 41.191489 | 92 | 0.654442 |
063db16adb90266f3d5599ee61db97655a1a6425 | 1,024 | py | Python | Incomplete/build-hybrid.py | andrewginns/CycleGAN-Tensorflow-PyTorch | 2715ca0ef611b8e3031e2fa4dda5b1c84b2011c9 | [
"MIT"
] | 1 | 2018-12-11T09:07:26.000Z | 2018-12-11T09:07:26.000Z | Incomplete/build-hybrid.py | andrewginns/CycleGAN-Tensorflow-PyTorch | 2715ca0ef611b8e3031e2fa4dda5b1c84b2011c9 | [
"MIT"
] | null | null | null | Incomplete/build-hybrid.py | andrewginns/CycleGAN-Tensorflow-PyTorch | 2715ca0ef611b8e3031e2fa4dda5b1c84b2011c9 | [
"MIT"
] | null | null | null | import tensorflow as tf
import sys
from tensorflow.core.framework import graph_pb2
import copy
INPUT_GRAPH_DEF_FILE = 'C:/Users/ag17634/Desktop/optimized-graph.pb'
OUTPUT_GRAPH_DEF_FILE = 'C:/Users/ag17634/Desktop/hybrid-graph.pb'
# load our graph
def load_graph(filename):
graph_def = tf.GraphDef()
with tf.g... | 32 | 68 | 0.753906 |
0484b724b52fc8183fbe1f9221a4ca27066cc920 | 403 | py | Python | farmer/urls.py | davidiweala/Precision-agriculture-project | b371221ea5b7e85311ed362b6c45af66995f1407 | [
"Apache-2.0"
] | null | null | null | farmer/urls.py | davidiweala/Precision-agriculture-project | b371221ea5b7e85311ed362b6c45af66995f1407 | [
"Apache-2.0"
] | null | null | null | farmer/urls.py | davidiweala/Precision-agriculture-project | b371221ea5b7e85311ed362b6c45af66995f1407 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
from django.conf import settings
urlpatterns = [
path('farmerlogin/', views.farmerlogin, name="farmerlogin"),
path('farmerregister/', views.register, name="farmerregister"),
path('farmerdash/', views.dashboard, name="farmerdash"),
path('logout/', views.l... | 36.636364 | 67 | 0.712159 |
b6bcef2adf280c9e297c7e1fc90df8cd52d39046 | 21,227 | py | Python | lib/util.py | bitcoinnano/btcnano-wallet-client-desktop | a368d86b38582c09aa1ec1a8fe27f574056db065 | [
"MIT"
] | 3 | 2018-01-16T09:45:41.000Z | 2018-01-27T04:07:10.000Z | lib/util.py | bitcoinnano/btcnano-wallet-client-desktop | a368d86b38582c09aa1ec1a8fe27f574056db065 | [
"MIT"
] | null | null | null | lib/util.py | bitcoinnano/btcnano-wallet-client-desktop | a368d86b38582c09aa1ec1a8fe27f574056db065 | [
"MIT"
] | null | null | null | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... | 30.674855 | 127 | 0.616055 |
bf70bd98d77e44ac07dd2a3a40b47116bcdb975c | 2,014 | py | Python | docs/conf.py | spam128/notes | 100008b7e0a2afa5677c15826588105027f52883 | [
"MIT"
] | null | null | null | docs/conf.py | spam128/notes | 100008b7e0a2afa5677c15826588105027f52883 | [
"MIT"
] | null | null | null | docs/conf.py | spam128/notes | 100008b7e0a2afa5677c15826588105027f52883 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.724138 | 79 | 0.666832 |
0e6390c5886e8a827c4d5636acb7eb595483e169 | 1,406 | py | Python | Submission_Assignment_3_CV/Source/getIntrinsic.py | rahuljain1310/Augmented-Reality-Application | 6a464151fc08af45197b35a68734bc613ed2a7db | [
"MIT"
] | null | null | null | Submission_Assignment_3_CV/Source/getIntrinsic.py | rahuljain1310/Augmented-Reality-Application | 6a464151fc08af45197b35a68734bc613ed2a7db | [
"MIT"
] | null | null | null | Submission_Assignment_3_CV/Source/getIntrinsic.py | rahuljain1310/Augmented-Reality-Application | 6a464151fc08af45197b35a68734bc613ed2a7db | [
"MIT"
] | null | null | null | import os,glob,math,argparse
import cv2
import numpy as np
def getGrayImage(fname,shape):
img = cv2.imread(fname)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
gray = cv2.resize(gray, shape)
return gray
def getK():
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
# prepare object points,... | 29.291667 | 91 | 0.686344 |
b09126c70b5dd5df0a2e63be61fa49e2ce60c511 | 2,254 | py | Python | data/task_scripts/main/task00215.py | aallaire91/phyre | ee882194c12bae5561c25ec65f95a7c0944f8129 | [
"Apache-2.0"
] | 432 | 2019-08-15T15:45:43.000Z | 2022-02-26T23:13:34.000Z | data/task_scripts/main/task00215.py | aallaire91/phyre | ee882194c12bae5561c25ec65f95a7c0944f8129 | [
"Apache-2.0"
] | 38 | 2019-09-06T15:39:03.000Z | 2022-03-12T00:11:25.000Z | data/task_scripts/main/task00215.py | aallaire91/phyre | ee882194c12bae5561c25ec65f95a7c0944f8129 | [
"Apache-2.0"
] | 69 | 2019-08-16T02:08:41.000Z | 2022-01-27T23:23:03.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... | 39.54386 | 92 | 0.679681 |
d8633272c320677f64ea6c3ce926d2e2b42b06a1 | 1,546 | py | Python | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_tensorboard_service_get_tensorboard_run_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_tensorboard_service_get_tensorboard_run_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_tensorboard_service_get_tensorboard_run_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.608696 | 91 | 0.774256 |
d589bbe25ff2ed16a904c8051b6ad3bca7da05ae | 9,191 | py | Python | google/cloud/redis_v1beta1/services/cloud_redis/transports/base.py | googleapis/python-redis | 9c0cd3dc619557e6f73e418f0af16f38cfdcfc44 | [
"Apache-2.0"
] | 9 | 2020-09-19T11:31:25.000Z | 2022-03-18T04:43:06.000Z | google/cloud/redis_v1beta1/services/cloud_redis/transports/base.py | googleapis/python-redis | 9c0cd3dc619557e6f73e418f0af16f38cfdcfc44 | [
"Apache-2.0"
] | 50 | 2020-02-03T19:18:21.000Z | 2022-03-15T21:27:39.000Z | google/cloud/redis_v1beta1/services/cloud_redis/transports/base.py | googleapis/python-redis | 9c0cd3dc619557e6f73e418f0af16f38cfdcfc44 | [
"Apache-2.0"
] | 4 | 2020-02-03T19:00:51.000Z | 2022-01-29T08:13:18.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.328063 | 101 | 0.656403 |
cdb1af5c3d133ed31beb95e15f951f66ed9c9659 | 13,487 | py | Python | Src/StdLib/Lib/test/test_gzip.py | cwensley/ironpython2 | f854444e1e08afc8850cb7c1a739a7dd2d10d32a | [
"Apache-2.0"
] | 1,078 | 2016-07-19T02:48:30.000Z | 2022-03-30T21:22:34.000Z | Src/StdLib/Lib/test/test_gzip.py | cwensley/ironpython2 | f854444e1e08afc8850cb7c1a739a7dd2d10d32a | [
"Apache-2.0"
] | 576 | 2017-05-21T12:36:48.000Z | 2022-03-30T13:47:03.000Z | Src/StdLib/Lib/test/test_gzip.py | cwensley/ironpython2 | f854444e1e08afc8850cb7c1a739a7dd2d10d32a | [
"Apache-2.0"
] | 269 | 2017-05-21T04:44:47.000Z | 2022-03-31T16:18:13.000Z | """Test script for the gzip module.
"""
import unittest
from test import test_support
import os
import io
import struct
import tempfile
gzip = test_support.import_module('gzip')
data1 = """ int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
int flushmode = Z_FINISH;
unsigned long start_total_out;
"""
dat... | 35.306283 | 82 | 0.571884 |
15245dd767567eec3488665c510e0a6aa2660ded | 1,127 | py | Python | setup.py | quickdata-team/panamah-sdk-python | 746f3fb7ebcf01810917bf9afa8e7ff5a4efad21 | [
"MIT"
] | null | null | null | setup.py | quickdata-team/panamah-sdk-python | 746f3fb7ebcf01810917bf9afa8e7ff5a4efad21 | [
"MIT"
] | null | null | null | setup.py | quickdata-team/panamah-sdk-python | 746f3fb7ebcf01810917bf9afa8e7ff5a4efad21 | [
"MIT"
] | null | null | null | import setuptools
import json
with open("README.md", "r") as fh:
long_description = fh.read()
with open('Pipfile.lock') as fd:
lock_data = json.load(fd)
install_requires = [
package_name + package_data['version']
for package_name, package_data in lock_data['default'].items()
]
test... | 32.2 | 70 | 0.681455 |
2e72720dfb831ca3a8cbe8bdddf92b58602d17b8 | 24,950 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/system/cron.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/system/cron.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/system/cron.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# Copyright: (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# Copyright: (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# Copyright: (c) 2015, Evan Kaufman <evan@digitalflophouse.com>
# Copyright: (c) 2015, Luca... | 33.355615 | 155 | 0.576433 |
7269619203c127b21552a8c5cb5999fc501a6f6f | 226 | py | Python | 1stMonth{ImageManipulation}/Files/17edge.py | KariukiKirubi/computer-vision-ai-saturdays | e18c7557bc29a00c0586411f019fd33d2eb5ebb4 | [
"MIT"
] | 2 | 2019-11-28T16:11:08.000Z | 2019-11-28T16:14:19.000Z | 1stMonth{ImageManipulation}/Files/17edge.py | KariukiKirubi/computer-vision-ai-saturdays | e18c7557bc29a00c0586411f019fd33d2eb5ebb4 | [
"MIT"
] | null | null | null | 1stMonth{ImageManipulation}/Files/17edge.py | KariukiKirubi/computer-vision-ai-saturdays | e18c7557bc29a00c0586411f019fd33d2eb5ebb4 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
img = cv2.imread('../Images/love.jpg',cv2.IMREAD_COLOR)
edges = cv2.Canny(img,100,200)
cv2.imwrite('../Images/17edge.jpg', edges)
cv2.imshow('image',edges)
cv2.waitKey(0)
cv2.destroyAllWindows() | 22.6 | 55 | 0.734513 |
15e0d569c221d7f197678adce673b465835174b0 | 3,389 | py | Python | src/recipes/textcat/textcat_teach.py | bastiancy/prodigy-multi-annotator | 69fbe523dac6b7d7abc72e55932568e228ac3b5c | [
"MIT"
] | 12 | 2018-12-03T23:22:04.000Z | 2022-03-16T10:03:12.000Z | textcat/textcat_teach.py | vitojph/prodigy-recipes | ca14bd7e4c59e47a2fedc62f12fef7ee5bbf89e8 | [
"MIT"
] | 1 | 2020-08-13T06:52:55.000Z | 2020-08-13T06:52:55.000Z | textcat/textcat_teach.py | vitojph/prodigy-recipes | ca14bd7e4c59e47a2fedc62f12fef7ee5bbf89e8 | [
"MIT"
] | 4 | 2019-06-18T18:58:42.000Z | 2022-01-24T15:59:20.000Z | # coding: utf8
from __future__ import unicode_literals
import prodigy
from prodigy.components.loaders import JSONL
from prodigy.models.textcat import TextClassifier
from prodigy.models.matcher import PatternMatcher
from prodigy.components.sorters import prefer_uncertain
from prodigy.util import combine_models, split_s... | 45.797297 | 84 | 0.680142 |
e74467ae8609417d97f8d81ebb8dde12c4ec9fd2 | 4,788 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 ... | 43.527273 | 133 | 0.658521 |
fabfc8a560c0b2e8510aac66aab9ff6a417d7686 | 6,050 | py | Python | custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py | nickcj931/ha-samsungtv-encrypted | a3b65e0bce4c37a21f302053089c793b2113cead | [
"Apache-2.0"
] | 1 | 2020-04-12T22:39:46.000Z | 2020-04-12T22:39:46.000Z | custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py | nickcj931/ha-samsungtv-encrypted | a3b65e0bce4c37a21f302053089c793b2113cead | [
"Apache-2.0"
] | null | null | null | custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py | nickcj931/ha-samsungtv-encrypted | a3b65e0bce4c37a21f302053089c793b2113cead | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from . import crypto
import sys
import re
from .command_encryption import AESCipher
import requests
import time
import websocket
import threading
class PySmartCrypto():
UserId = "654321"
AppId = "12345"
deviceId = "7e509404-9d7c-46b4-8f6a-e2a9668ad184"
def discon... | 38.291139 | 155 | 0.610083 |
b0b8832cd79d013420fc63dddf98aac5e2d4a77a | 1,167 | py | Python | google/cloud/deploy/v1/deploy-v1-py/google/cloud/deploy_v1/services/cloud_deploy/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/deploy/v1/deploy-v1-py/google/cloud/deploy_v1/services/cloud_deploy/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/deploy/v1/deploy-v1-py/google/cloud/deploy_v1/services/cloud_deploy/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 34.323529 | 82 | 0.782348 |
8d1017d0d40e64625ee4cb9616fa6aca17421239 | 6,464 | py | Python | odtlearn/utils/StrongTreeBendersOCT.py | nathanljustin/decision_tree_estimators | 84b37197e88d85f32d10c0412b369e94f563f155 | [
"BSD-3-Clause"
] | 2 | 2022-03-09T01:08:00.000Z | 2022-03-09T07:15:26.000Z | odtlearn/utils/StrongTreeBendersOCT.py | nathanljustin/decision_tree_estimators | 84b37197e88d85f32d10c0412b369e94f563f155 | [
"BSD-3-Clause"
] | null | null | null | odtlearn/utils/StrongTreeBendersOCT.py | nathanljustin/decision_tree_estimators | 84b37197e88d85f32d10c0412b369e94f563f155 | [
"BSD-3-Clause"
] | 3 | 2022-02-07T18:12:08.000Z | 2022-02-16T00:17:15.000Z | """
This module formulate the BendersOCT problem in gurobipy.
"""
from gurobipy import Model, GRB, quicksum, LinExpr
import numpy as np
import pandas as pd
class BendersOCT:
def __init__(
self,
X,
y,
tree,
X_col_labels,
labels,
_lambda,
time_limit,
... | 35.322404 | 112 | 0.538985 |
89d169c9eef51cf323009fdfccbdcc9c74a8f7fc | 230 | py | Python | ThinkPython/chap5/ex2.py | sokolowskik/Tutorials | d2681d4f18b03e00f90f9132c77f0b23b74d2629 | [
"MIT"
] | null | null | null | ThinkPython/chap5/ex2.py | sokolowskik/Tutorials | d2681d4f18b03e00f90f9132c77f0b23b74d2629 | [
"MIT"
] | null | null | null | ThinkPython/chap5/ex2.py | sokolowskik/Tutorials | d2681d4f18b03e00f90f9132c77f0b23b74d2629 | [
"MIT"
] | null | null | null | def print_string(s):
print s
def do_n(f, s, n):
if n <= 0:
print 'done!'
else:
f(s)
do_n(f, s, n-1)
do_n(print_string, 'Hello', 2)
do_n(print_string, 'Nana', 4)
do_n(print_string, 'Dada', 8)
| 15.333333 | 30 | 0.534783 |
0853c301fa397e5e18bc2d3e7ce60223bd775cb0 | 3,860 | py | Python | Fora 2.0/commands/leveling.py | Dolsity/meet-fora | 4b2bce766c7420fd0c324dd6f5ea1f612df1cb09 | [
"Unlicense"
] | 1 | 2022-03-07T18:16:20.000Z | 2022-03-07T18:16:20.000Z | Fora 2.0/commands/leveling.py | radiantdinosaurs/meet-fora | 00997ab82e04a2e057a08b2d5d23ffcc85817bd5 | [
"Unlicense"
] | null | null | null | Fora 2.0/commands/leveling.py | radiantdinosaurs/meet-fora | 00997ab82e04a2e057a08b2d5d23ffcc85817bd5 | [
"Unlicense"
] | 1 | 2022-03-05T03:17:11.000Z | 2022-03-05T03:17:11.000Z | from discord import File, Member
from discord.ext import commands
from easy_pil import Editor, load_image_async, Font, Canvas
from PIL import Image ,ImageDraw ,ImageFont, ImageDraw
from database.levels import *
class Level(commands.Cog):
def __init__(self, bot) -> None:
self.bot = bot
# Check your ran... | 32.436975 | 93 | 0.585233 |
970357ef6c34e067dbba07696d2a84e09960d012 | 4,671 | py | Python | src/wfleet/scraper/utils/utilities_http.py | dmitry-ed-gusev/fleet-infoservice | cb96dc42b8eedacc4055ff4f92d27e4c6afdacc6 | [
"MIT"
] | 1 | 2021-05-21T20:49:09.000Z | 2021-05-21T20:49:09.000Z | src/wfleet/scraper/utils/utilities_http.py | dmitry-ed-gusev/fleet-infoservice | cb96dc42b8eedacc4055ff4f92d27e4c6afdacc6 | [
"MIT"
] | 16 | 2021-05-21T20:40:14.000Z | 2022-01-19T21:52:24.000Z | src/wfleet/scraper/utils/utilities_http.py | dmitry-ed-gusev/fleet-infoservice | cb96dc42b8eedacc4055ff4f92d27e4c6afdacc6 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
HTTP / network related utilities module for Fleet DB Scraper.
Useful resources:
- (download file) https://stackoverflow.com/questions/7243750/download-file-from-web-in-python-3
Created: Dmitrii Gusev, 01.06.2021
Modified: Dmitrii Gusev, 16.06.2021
"""
import ssl
import lo... | 39.923077 | 108 | 0.677371 |
423082f680750f21f9c0fc85ed6dcfbe12c33c4f | 2,581 | py | Python | tests/test_report.py | mrchapp/squad-client | 06612961fc16c5f4af9983fcfe6f378e7159f965 | [
"MIT"
] | 3 | 2020-03-30T18:34:57.000Z | 2020-04-12T07:51:25.000Z | tests/test_report.py | mrchapp/squad-client | 06612961fc16c5f4af9983fcfe6f378e7159f965 | [
"MIT"
] | 127 | 2020-03-05T23:20:37.000Z | 2022-03-23T18:44:19.000Z | tests/test_report.py | mrchapp/squad-client | 06612961fc16c5f4af9983fcfe6f378e7159f965 | [
"MIT"
] | 17 | 2020-02-14T14:37:38.000Z | 2022-03-17T15:59:56.000Z | import unittest
from unittest.mock import patch
from io import StringIO
from squad_client.report import Report, ReportContext, ReportGenerator
from squad_client.exceptions import InvalidSquadObject
class ReportContextTest(unittest.TestCase):
def test_basics(self):
context = {
'var1': {
... | 29.666667 | 86 | 0.573421 |
20c3702b4a04a72faffb724f41bede4fd438a773 | 126 | py | Python | pycmakeserver/errors.py | anarthal/py-cmake-server | 480f3b45d8ec99a4c5c822dcc5252ee3def88c6b | [
"MIT"
] | null | null | null | pycmakeserver/errors.py | anarthal/py-cmake-server | 480f3b45d8ec99a4c5c822dcc5252ee3def88c6b | [
"MIT"
] | null | null | null | pycmakeserver/errors.py | anarthal/py-cmake-server | 480f3b45d8ec99a4c5c822dcc5252ee3def88c6b | [
"MIT"
] | null | null | null |
class CmakeError(Exception):
pass
class CommunicationError(CmakeError):
pass
class ErrorReply(CmakeError):
pass | 14 | 37 | 0.746032 |
1f7dcb55d2eb8ca17761f2802d541bb49500d0cc | 59,407 | py | Python | sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner_test.py | jphalip/beam | 26f694d2c8a8791ea0357ba44c7580c78f617bf8 | [
"Apache-2.0"
] | 1 | 2021-08-14T15:28:41.000Z | 2021-08-14T15:28:41.000Z | sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner_test.py | RocMarshal/beam | 34c58c42f14d2534a2f72f9194ddf9cc69138eea | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2020-11-13T19:06:10.000Z | 2021-11-10T19:56:12.000Z | sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner_test.py | espv/beam-plus-wrapper | 901b762c0b331c31217c0a66a830a6050b7cd257 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 35.36131 | 89 | 0.64218 |
9d201abac3b691c2352ce49c740540fec78b5ebb | 7,117 | py | Python | enaml/qt/qt_ipython_console.py | jwiggins/enaml | 1c8793ba5390c52e119423684753fc3b1b893ae2 | [
"BSD-3-Clause-Clear"
] | 26 | 2016-04-01T18:49:31.000Z | 2020-07-21T22:19:46.000Z | enaml/qt/qt_ipython_console.py | jwiggins/enaml | 1c8793ba5390c52e119423684753fc3b1b893ae2 | [
"BSD-3-Clause-Clear"
] | 29 | 2016-02-22T17:40:55.000Z | 2018-08-21T18:18:36.000Z | enaml/qt/qt_ipython_console.py | jwiggins/enaml | 1c8793ba5390c52e119423684753fc3b1b893ae2 | [
"BSD-3-Clause-Clear"
] | 4 | 2016-08-29T13:07:19.000Z | 2018-11-04T01:31:46.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2014, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | 32.20362 | 79 | 0.567795 |
4522524af481a64849c54040c7dba2f2494167b8 | 129 | py | Python | info.py | Immain/PurchasingBot-Oct2021-MacOS | 340de3ea37c4c14a9c2e8c6f2e5ce6e35ae32291 | [
"MIT"
] | null | null | null | info.py | Immain/PurchasingBot-Oct2021-MacOS | 340de3ea37c4c14a9c2e8c6f2e5ce6e35ae32291 | [
"MIT"
] | null | null | null | info.py | Immain/PurchasingBot-Oct2021-MacOS | 340de3ea37c4c14a9c2e8c6f2e5ce6e35ae32291 | [
"MIT"
] | null | null | null | # BEST BUY LOGIN CREDENTIALS MUST MATCH BESTBUY.COM WEBSITE
email = "Example@Example.com"
password = "LoginPassword"
cvv = "000"
| 25.8 | 59 | 0.75969 |
94ce9cf8a75f697fc0cead2dd85da1fb571faccd | 2,382 | py | Python | primitive_tests/feature_analysis/StatisticalMeanAbs_pipeline.py | 1326899446/tods | 2bf27fab2d8bab80ec222beb8f615800d77a01a4 | [
"Apache-2.0"
] | 544 | 2020-09-21T06:02:33.000Z | 2022-03-27T07:16:32.000Z | primitive_tests/feature_analysis/StatisticalMeanAbs_pipeline.py | 1326899446/tods | 2bf27fab2d8bab80ec222beb8f615800d77a01a4 | [
"Apache-2.0"
] | 35 | 2020-09-21T06:33:13.000Z | 2022-03-11T14:20:21.000Z | primitive_tests/feature_analysis/StatisticalMeanAbs_pipeline.py | 1326899446/tods | 2bf27fab2d8bab80ec222beb8f615800d77a01a4 | [
"Apache-2.0"
] | 86 | 2020-09-21T16:44:33.000Z | 2022-03-11T18:20:22.000Z | from d3m import index
from d3m.metadata.base import ArgumentType
from d3m.metadata.pipeline import Pipeline, PrimitiveStep
# Creating pipeline
pipeline_description = Pipeline()
pipeline_description.add_input(name='inputs')
# Step 0: dataset_to_dataframe
primitive_0 = index.get_primitive('d3m.primitives.tods.data_pro... | 47.64 | 126 | 0.816961 |
1efb6c5f79c020f692535b33b366362534f7d77f | 2,173 | py | Python | neutronclient/osc/plugin.py | lmaycotte/python-neutronclient | 5da767d36e8b2343fabab674dbacb75181efb774 | [
"Apache-2.0"
] | null | null | null | neutronclient/osc/plugin.py | lmaycotte/python-neutronclient | 5da767d36e8b2343fabab674dbacb75181efb774 | [
"Apache-2.0"
] | null | null | null | neutronclient/osc/plugin.py | lmaycotte/python-neutronclient | 5da767d36e8b2343fabab674dbacb75181efb774 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | 35.048387 | 77 | 0.693971 |
05181bb03f5a012fe32b24a5d453dcff0d361ac9 | 1,311 | py | Python | etldjango/etldata/management/commands/worker_init_bucket.py | DavidCastilloAlvarado/opencovid_ETL | 0cd7afcb0e7e6247a01c0aced9aab02b8ad1edaf | [
"MIT"
] | 5 | 2021-05-21T20:02:34.000Z | 2021-08-04T21:06:19.000Z | etldjango/etldata/management/commands/worker_init_bucket.py | DavidCastilloAlvarado/opencovid_ETL | 0cd7afcb0e7e6247a01c0aced9aab02b8ad1edaf | [
"MIT"
] | 1 | 2021-06-04T06:17:17.000Z | 2021-06-04T06:17:17.000Z | etldjango/etldata/management/commands/worker_init_bucket.py | DavidCastilloAlvarado/opencovid_ETL | 0cd7afcb0e7e6247a01c0aced9aab02b8ad1edaf | [
"MIT"
] | null | null | null | import os
from django.core.management.base import BaseCommand, CommandError
from etldjango.settings import GCP_PROJECT_ID, BUCKET_NAME, BUCKET_ROOT
from .utils.storage import Bucket_handler
from .utils.extractor import Data_Extractor
from datetime import datetime
from etldata.models import Logs_extractor
from tqdm impo... | 34.5 | 71 | 0.687262 |
6ab093ab85241601262e64152255955c7c19f3fa | 92 | py | Python | test/Manifest.py | hdl-util/image-processing | 92f74d8a3894f365b2be6dd588351aff4e7b8565 | [
"Apache-2.0",
"MIT"
] | 5 | 2020-09-15T09:47:32.000Z | 2021-06-10T07:33:30.000Z | test/Manifest.py | hdl-util/image-processing | 92f74d8a3894f365b2be6dd588351aff4e7b8565 | [
"Apache-2.0",
"MIT"
] | null | null | null | test/Manifest.py | hdl-util/image-processing | 92f74d8a3894f365b2be6dd588351aff4e7b8565 | [
"Apache-2.0",
"MIT"
] | 3 | 2020-07-07T10:10:01.000Z | 2021-05-26T06:03:56.000Z | files = [
"malvar_he_cutler_demosaic_tb.sv"
]
modules = {
"local" : [ "../src/" ],
}
| 11.5 | 37 | 0.543478 |
ec567606d5894b23ef854872e5c4e423d8454b2c | 15,359 | py | Python | tests/data/challenge_response.py | yashdusing/evalai-cli | 4649fd520e2d7c4477589cc23f54a56b30f62e98 | [
"BSD-3-Clause"
] | null | null | null | tests/data/challenge_response.py | yashdusing/evalai-cli | 4649fd520e2d7c4477589cc23f54a56b30f62e98 | [
"BSD-3-Clause"
] | null | null | null | tests/data/challenge_response.py | yashdusing/evalai-cli | 4649fd520e2d7c4477589cc23f54a56b30f62e98 | [
"BSD-3-Clause"
] | null | null | null | challenges = """
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"allowed_email_domains": [],
"anonymous_leaderboard": false,
... | 38.883544 | 114 | 0.454978 |
9f8b57427258138600df40245a4348ca99b5274a | 526 | py | Python | push_data_to_kafka.py | Pahulpreet86/Pahulpreet86-Real-Time-Data-Pipeline-Using-Kafka-and-Spark | c7ff90b4b0399d95d70aad787de45075198474e1 | [
"MIT"
] | 4 | 2020-07-23T20:23:47.000Z | 2022-03-23T03:25:49.000Z | push_data_to_kafka.py | Pahulpreet86/Real-Time-Data-Pipeline-Using-Kafka-and-Spark | c7ff90b4b0399d95d70aad787de45075198474e1 | [
"MIT"
] | null | null | null | push_data_to_kafka.py | Pahulpreet86/Real-Time-Data-Pipeline-Using-Kafka-and-Spark | c7ff90b4b0399d95d70aad787de45075198474e1 | [
"MIT"
] | null | null | null | import time
import json
import requests
import datetime
from kafka import KafkaProducer, KafkaClient
from websocket import create_connection
def get_sensor_data_stream():
try:
url = 'http://0.0.0.0:3030/sensordata'
r = requests.get(url)
return r.text
except:
return "Error in Co... | 18.785714 | 62 | 0.692015 |
dfe9463100c9df51aa15e9de97cea539501e7868 | 4,267 | py | Python | tests/workflow/scripts/test_qc_report_table.py | Monia234/NCI-GwasQc | 9e3ca52085c891e1d4d7972e5337c4a1888f992c | [
"MIT"
] | null | null | null | tests/workflow/scripts/test_qc_report_table.py | Monia234/NCI-GwasQc | 9e3ca52085c891e1d4d7972e5337c4a1888f992c | [
"MIT"
] | 43 | 2021-03-02T04:10:01.000Z | 2022-03-16T20:26:55.000Z | tests/workflow/scripts/test_qc_report_table.py | Monia234/NCI-GwasQc | 9e3ca52085c891e1d4d7972e5337c4a1888f992c | [
"MIT"
] | 2 | 2021-03-02T12:27:00.000Z | 2021-12-16T03:22:20.000Z | import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from cgr_gwas_qc.workflow.scripts import qc_report_table
@pytest.mark.real_data
def test_sample_qc(real_data_cache):
dtypes = {
"Contaminated": bool,
"Low Call Rate": bool,
"Sex Discordant": bool,
"Une... | 38.441441 | 137 | 0.719006 |
5370e8e53a36c78872545723c30128e493b7c154 | 2,631 | py | Python | gedl/schema/validate-gedl.py | gaps-closure/capo | 894d2f6d291ff79e18c77e0ca7073531147cbee8 | [
"BSD-3-Clause"
] | 1 | 2021-04-20T18:43:44.000Z | 2021-04-20T18:43:44.000Z | gedl/schema/validate-gedl.py | gaps-closure/capo | 894d2f6d291ff79e18c77e0ca7073531147cbee8 | [
"BSD-3-Clause"
] | 1 | 2021-09-23T14:55:43.000Z | 2021-09-23T18:09:35.000Z | gedl/schema/validate-gedl.py | gaps-closure/capo | 894d2f6d291ff79e18c77e0ca7073531147cbee8 | [
"BSD-3-Clause"
] | 1 | 2020-05-21T03:12:16.000Z | 2020-05-21T03:12:16.000Z | #!/usr/bin/env python3
"""
Test the gedl schema, and a test GEDL json is valid using
json schema Draft 7
This requires MIT licensed jsonschema library 3.2.0 or newer (via pip)
For more information on jsonschema see:
github.com/Julian/jsonschema/
Author: Terrence Ezrol tezrol@perspectalabs.com
"""
import jsonschema
... | 26.575758 | 92 | 0.622577 |
73b607b5ad4c41cab9ae8818371009e1088fea68 | 43,214 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_public_ip_addresses_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2019-08-23T21:14:00.000Z | 2021-09-07T18:32:34.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_public_ip_addresses_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_public_ip_addresses_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 ... | 51.32304 | 395 | 0.674457 |
d449a9f5dbb5bd14356719f92972c2579b305f51 | 731 | py | Python | cabocha/filter.py | kenkov/cabocha | 05baedbf66a928704d738c61738ba5065c1f0797 | [
"MIT"
] | 53 | 2015-01-19T08:24:37.000Z | 2021-11-15T12:34:28.000Z | ref_src/cabocha/filter.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 2 | 2018-11-05T04:49:18.000Z | 2018-11-22T00:30:35.000Z | cabocha/filter.py | kenkov/cabocha | 05baedbf66a928704d738c61738ba5065c1f0797 | [
"MIT"
] | 1 | 2018-10-25T08:32:17.000Z | 2018-10-25T08:32:17.000Z | #! /usr/bin/env python
# coding:utf-8
class NotFoundException(Exception):
"""述語が見つからない時に発生する例外"""
def _is_function_token(token):
return token.pos in {"動詞", "形容詞", "名詞"}
def _is_function_chunk(chunk):
for token in chunk:
if _is_function_token(token):
return True
return False
d... | 18.275 | 43 | 0.618331 |
888622ff8081c8b71bbd497221d3a68c93f19d99 | 11,882 | py | Python | grr/server/grr_response_server/databases/mysql_users.py | dekoder/grr | 27ba38dc0f5ad4f3e0cdbfb146a0a789e3b0d27b | [
"Apache-2.0"
] | 3 | 2018-09-30T01:31:29.000Z | 2019-04-22T11:44:54.000Z | grr/server/grr_response_server/databases/mysql_users.py | tomchop/grr | 27ba38dc0f5ad4f3e0cdbfb146a0a789e3b0d27b | [
"Apache-2.0"
] | 1 | 2022-03-02T09:58:05.000Z | 2022-03-02T09:58:05.000Z | grr/server/grr_response_server/databases/mysql_users.py | tomchop/grr | 27ba38dc0f5ad4f3e0cdbfb146a0a789e3b0d27b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""The MySQL database methods for GRR users and approval handling."""
from __future__ import unicode_literals
import MySQLdb
from grr_response_core.lib import rdfvalue
from grr_response_core.lib import utils
from grr_response_server import db
from grr_response_server.databases import mysql_utils... | 35.57485 | 80 | 0.660158 |
2849a58cfd3f0a3f71c796f6a6b58d790f42576a | 4,725 | py | Python | toontown/catalog/CatalogEmoteItemNotWorking.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | toontown/catalog/CatalogEmoteItemNotWorking.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | toontown/catalog/CatalogEmoteItemNotWorking.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | import CatalogItem
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from otp.otpbase import OTPLocalizer
from direct.interval.IntervalGlobal import *
class CatalogEmoteItem(CatalogItem.CatalogItem):
sequenceNumber = 0
pictureToon = None
def makeNewItem(self, emoteInd... | 36.914063 | 115 | 0.660317 |
f66de99d96b46d730d75b4e207da96f396a26e41 | 16,504 | py | Python | pyannote/audio/applications/pyannote_audio.py | emmaducos/pyannote-audio | 52cd867b5ed6a19fafd79a8dfa365d067234c2d0 | [
"MIT"
] | 1 | 2022-02-23T08:46:10.000Z | 2022-02-23T08:46:10.000Z | pyannote/audio/applications/pyannote_audio.py | emmaducos/pyannote-audio | 52cd867b5ed6a19fafd79a8dfa365d067234c2d0 | [
"MIT"
] | null | null | null | pyannote/audio/applications/pyannote_audio.py | emmaducos/pyannote-audio | 52cd867b5ed6a19fafd79a8dfa365d067234c2d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2019-2020 CNRS
# 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 limita... | 37.94023 | 103 | 0.61373 |
b2ce03c30a249309be4681b95f5589aa50717a03 | 2,524 | py | Python | nanodlna/cli.py | Nightdavisao/nano-dlna | 1489bf2cba1f3fd52fdf95c2f9d298900ea56397 | [
"MIT"
] | null | null | null | nanodlna/cli.py | Nightdavisao/nano-dlna | 1489bf2cba1f3fd52fdf95c2f9d298900ea56397 | [
"MIT"
] | null | null | null | nanodlna/cli.py | Nightdavisao/nano-dlna | 1489bf2cba1f3fd52fdf95c2f9d298900ea56397 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import json
import os
import sys
from . import devices, dlna, streaming
def get_subtitle(file_video):
video, extension = os.path.splitext(file_video)
file_subtitle = "{0}.srt".format(video)
if not os.path.exists(file_subtit... | 24.745098 | 77 | 0.650158 |
e07d5198ebec6f7388646a14a3d25e22b1a181d3 | 1,070 | py | Python | python/graphs/binary_indexed_tree.py | tachyonsoftware/algorithms | 29149a55de173b42dfa461838877fa66d018629f | [
"MIT"
] | 17 | 2016-06-29T08:41:51.000Z | 2022-02-04T13:39:13.000Z | python/graphs/binary_indexed_tree.py | tachyonsoftware/algorithms | 29149a55de173b42dfa461838877fa66d018629f | [
"MIT"
] | null | null | null | python/graphs/binary_indexed_tree.py | tachyonsoftware/algorithms | 29149a55de173b42dfa461838877fa66d018629f | [
"MIT"
] | 4 | 2016-05-09T19:02:47.000Z | 2021-02-22T02:05:41.000Z | class BinaryIndexedTree(object):
def __init__(self, nums=tuple()):
self.bit = [0] * (len(nums) + 1)
for index, val in enumerate(nums):
self.update(index, val)
def update(self, index, val):
index += 1
while index < len(self.bit):
self.bit[index] += val
index = index + (index & -ind... | 27.435897 | 84 | 0.578505 |
96c4e9ec76a5ab40d9c8e43603ad70354ba4c394 | 6,831 | py | Python | src/python/grpcio_tests/tests/unit/_auth_context_test.py | samotarnik/grpc | 3278bdceda8030d5aa130f12765e5f07263c860d | [
"Apache-2.0"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | src/python/grpcio_tests/tests/unit/_auth_context_test.py | samotarnik/grpc | 3278bdceda8030d5aa130f12765e5f07263c860d | [
"Apache-2.0"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | src/python/grpcio_tests/tests/unit/_auth_context_test.py | samotarnik/grpc | 3278bdceda8030d5aa130f12765e5f07263c860d | [
"Apache-2.0"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 35.030769 | 80 | 0.669302 |
7d36bb9ea203eff6282835edce65b7f78c8c6e35 | 2,152 | py | Python | services/workshop/utils/messages.py | jay-nanduri/crAPI | 082c3effd4171e077d2dd61786faf9e3f95a072f | [
"Apache-2.0",
"0BSD"
] | 89 | 2021-02-09T16:30:26.000Z | 2022-03-27T17:14:18.000Z | services/workshop/utils/messages.py | jay-nanduri/crAPI | 082c3effd4171e077d2dd61786faf9e3f95a072f | [
"Apache-2.0",
"0BSD"
] | 12 | 2021-07-28T03:05:25.000Z | 2022-02-28T01:27:30.000Z | services/workshop/utils/messages.py | jay-nanduri/crAPI | 082c3effd4171e077d2dd61786faf9e3f95a072f | [
"Apache-2.0",
"0BSD"
] | 38 | 2021-02-10T07:11:00.000Z | 2022-03-28T13:58:58.000Z | # Copyright 2020 Traceable, Inc.
#
# Licensed under the Apache License, Version 2.0 (the “License”);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 47.822222 | 107 | 0.777416 |
e748bf6fbc038f5225f40130b420b883e1aff89d | 17,470 | py | Python | lib/src/cgcloud/lib/ec2.py | ompcloud/cgcloud | ec97c3e6df2df549ebf45c69f16fb6d118877d9c | [
"Apache-2.0"
] | null | null | null | lib/src/cgcloud/lib/ec2.py | ompcloud/cgcloud | ec97c3e6df2df549ebf45c69f16fb6d118877d9c | [
"Apache-2.0"
] | null | null | null | lib/src/cgcloud/lib/ec2.py | ompcloud/cgcloud | ec97c3e6df2df549ebf45c69f16fb6d118877d9c | [
"Apache-2.0"
] | null | null | null | import errno
import logging
import time
from collections import Iterator
from operator import attrgetter
from bd2k.util.exceptions import panic
from bd2k.util.retry import retry
from boto.ec2.ec2object import TaggedEC2Object
from boto.ec2.instance import Instance
from boto.ec2.spotinstancerequest import SpotInstanceRe... | 41.794258 | 100 | 0.5917 |
73c45d840a7f3512a27b0f7cd808368a4b77c418 | 10,115 | py | Python | gcloud/iam_auth/conf.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 2 | 2021-07-28T01:48:31.000Z | 2021-11-17T11:02:26.000Z | gcloud/iam_auth/conf.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | null | null | null | gcloud/iam_auth/conf.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 32.009494 | 115 | 0.581809 |
0690ea2fa92764711ec8101b43b1138d2377dcde | 271 | py | Python | playerhand.py | dlavery/pokerpractice | 80f89974be4a08fc8f7d1c94b0ebfb7d5758b3e4 | [
"MIT"
] | null | null | null | playerhand.py | dlavery/pokerpractice | 80f89974be4a08fc8f7d1c94b0ebfb7d5758b3e4 | [
"MIT"
] | null | null | null | playerhand.py | dlavery/pokerpractice | 80f89974be4a08fc8f7d1c94b0ebfb7d5758b3e4 | [
"MIT"
] | null | null | null |
class PlayerHand:
# player's hand
def __init__(self):
self.__hand = []
def deal(self, card):
# receive a card
self.__hand.append(card)
def gethand(self):
return self.__hand
def burnhand(self):
self.__hand = []
| 15.941176 | 32 | 0.564576 |
a27d44ad455fbc99f3e825520cfd1566a03d1296 | 542 | py | Python | packages/pyright-internal/src/tests/samples/unpack1.py | steverice/pyright | 27fb622a5e87597e03d1e204eae1ef1382ab5193 | [
"MIT"
] | null | null | null | packages/pyright-internal/src/tests/samples/unpack1.py | steverice/pyright | 27fb622a5e87597e03d1e204eae1ef1382ab5193 | [
"MIT"
] | 3 | 2022-03-03T03:03:24.000Z | 2022-03-25T14:43:54.000Z | packages/pyright-internal/src/tests/samples/unpack1.py | isabella232/pyright | a192486099503353413e02078c41d0d82bd696e8 | [
"MIT"
] | null | null | null | # This sample tests the type checker's handling of the unpack operator.
# pyright: strict
class Foo: ...
class Bar: ...
a = [1, 'hello', 3.4, Foo()]
b = [*a]
def int_only(a: int): ...
for c in b:
if not isinstance(c, (float, str)):
# This should generate an error because c can
# be an int or f... | 18.066667 | 71 | 0.555351 |
57c6406a8f4b7dd0a901391e79d085141903ac3c | 481 | py | Python | back-end/quiz/migrations/0003_auto_20201203_1410.py | Lukmanhakim112/guro | 6be3448f076c28f5495252f8da91545553e79d01 | [
"MIT"
] | null | null | null | back-end/quiz/migrations/0003_auto_20201203_1410.py | Lukmanhakim112/guro | 6be3448f076c28f5495252f8da91545553e79d01 | [
"MIT"
] | null | null | null | back-end/quiz/migrations/0003_auto_20201203_1410.py | Lukmanhakim112/guro | 6be3448f076c28f5495252f8da91545553e79d01 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-03 14:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('quiz', '0002_score_score'),
]
operations = [
migrations.AlterField(
model_name='question',
... | 24.05 | 122 | 0.636175 |
7683debdb79f13052c5c801fb12af4a140a9628e | 1,995 | py | Python | src/users/models/microsoftgraphworkbook.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | src/users/models/microsoftgraphworkbook.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | src/users/models/microsoftgraphworkbook.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 40.714286 | 123 | 0.629574 |
b49a8dfbd135e68688630e12f1566b990248f71e | 7,372 | py | Python | kitectl/release.py | cihangir/kite | 17e712e6fea3cae07fe3c792d3e0d6b8225c1125 | [
"MIT"
] | 3,107 | 2015-01-04T15:00:31.000Z | 2022-03-31T05:59:01.000Z | kitectl/release.py | cihangir/kite | 17e712e6fea3cae07fe3c792d3e0d6b8225c1125 | [
"MIT"
] | 176 | 2019-12-27T09:01:42.000Z | 2021-08-03T06:19:39.000Z | kitectl/release.py | cihangir/kite | 17e712e6fea3cae07fe3c792d3e0d6b8225c1125 | [
"MIT"
] | 356 | 2015-01-13T04:05:46.000Z | 2022-03-04T06:01:38.000Z | #!/usr/bin/env python2.7
"""
A script for packaging and releasing kite tool for OS X and Linux platforms.
It can also upload the generated package file to S3 if you provide --upload flag.
usage: release.py [-h] [--upload]
Run it at the same directory as this script. It will put the generated files
into the current wo... | 31.775862 | 94 | 0.625475 |
5fd789836e68e5500bac265a50945d9cfa65eb4d | 2,369 | py | Python | examples/com.xxjr.cfs/test_login.py | 100440175/facebook-wda | d335b5506c210e15a220d6734510f9c40d11261d | [
"MIT"
] | null | null | null | examples/com.xxjr.cfs/test_login.py | 100440175/facebook-wda | d335b5506c210e15a220d6734510f9c40d11261d | [
"MIT"
] | null | null | null | examples/com.xxjr.cfs/test_login.py | 100440175/facebook-wda | d335b5506c210e15a220d6734510f9c40d11261d | [
"MIT"
] | null | null | null | #coding=utf-8
import os
import time
import unittest
import wda
bundle_id = 'com.xxjr.cfsApp'
c = wda.Client('http://localhost:8100')
# USERNAME = os.getenv('4080')
# PASSWORD = os.getenv('12345678')
USERNAME = '4080'
PASSWORD = '12345678'
def setup_function():
# 每次测试之前,保证帐号是登录的
global d
d = create... | 22.140187 | 99 | 0.617982 |
6e134e1b390faffee93427e6af2f7c6532134c62 | 7,524 | py | Python | src/monitor.py | javiermarcon/xmr-stak-monitor | cfdc9271da4e05cc605423d5255396e4f77ab6a6 | [
"MIT"
] | null | null | null | src/monitor.py | javiermarcon/xmr-stak-monitor | cfdc9271da4e05cc605423d5255396e4f77ab6a6 | [
"MIT"
] | null | null | null | src/monitor.py | javiermarcon/xmr-stak-monitor | cfdc9271da4e05cc605423d5255396e4f77ab6a6 | [
"MIT"
] | null | null | null | import chardet
import datetime
import eventlet
import json
import os
import requests
#import shlex
import subprocess
import threading
import traceback
class Command(object):
"""
code from: https://gist.github.com/kirpit/1306188
Enables to run subprocess commands in a different thread with TIMEOUT option.
... | 39.6 | 107 | 0.548113 |
a9f3713351de123631df3e3a7dff5517f135d6a6 | 29,820 | py | Python | main.py | sourcery-ai-bot/discord-bot | 528fcfb8909296b012cae5f416c3d90c84c25910 | [
"MIT"
] | null | null | null | main.py | sourcery-ai-bot/discord-bot | 528fcfb8909296b012cae5f416c3d90c84c25910 | [
"MIT"
] | null | null | null | main.py | sourcery-ai-bot/discord-bot | 528fcfb8909296b012cae5f416c3d90c84c25910 | [
"MIT"
] | null | null | null | # Aurexine 2020
## IMPORTS
import os
import shutil
import json
from datetime import datetime
from sqlitedict import SqliteDict
from discord import Guild, Message, User, Member, Embed, Game, TextChannel
from discord.ext import commands
from discord.ext.commands import Context
from helpers import *
VERSION = "2.2.1b1"... | 35.331754 | 158 | 0.585714 |
e71d81f2b79048d093d2b47dc0c439e0c978dfd0 | 9,890 | py | Python | homeassistant/components/nfandroidtv/notify.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | homeassistant/components/nfandroidtv/notify.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 60 | 2020-08-03T07:32:56.000Z | 2022-03-31T06:02:07.000Z | homeassistant/components/nfandroidtv/notify.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Notifications for Android TV notification service."""
import base64
import io
import logging
import requests
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_TITLE,
ATTR_TITLE_DEFAULT,
PLATFORM_SCHEMA,
... | 35.57554 | 88 | 0.595349 |
e30887350809a016f498d3221d64f929e913fb1b | 31,440 | py | Python | grr/core/grr_response_core/lib/parsers/linux_file_parser.py | magnologan/grr | 06eeb071e9a925b34f67caf776c3330b39154850 | [
"Apache-2.0"
] | null | null | null | grr/core/grr_response_core/lib/parsers/linux_file_parser.py | magnologan/grr | 06eeb071e9a925b34f67caf776c3330b39154850 | [
"Apache-2.0"
] | null | null | null | grr/core/grr_response_core/lib/parsers/linux_file_parser.py | magnologan/grr | 06eeb071e9a925b34f67caf776c3330b39154850 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Simple parsers for Linux files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import logging
import os
import re
from future.builtins import zip
from future.utils import iteritems
from future.utils import ... | 35.890411 | 80 | 0.653085 |
5f6a16e9d80c068b3155f507c3440fe2487aec77 | 474 | py | Python | convolut_telegram/settings.py | convolut/convolut-telegram | 4a32484496aff293aca47b3454fa929fe3dc77a7 | [
"Apache-2.0"
] | null | null | null | convolut_telegram/settings.py | convolut/convolut-telegram | 4a32484496aff293aca47b3454fa929fe3dc77a7 | [
"Apache-2.0"
] | null | null | null | convolut_telegram/settings.py | convolut/convolut-telegram | 4a32484496aff293aca47b3454fa929fe3dc77a7 | [
"Apache-2.0"
] | null | null | null | import os
from .constants import TelegramMode
from convolut.settings import GLOBAL_PREFIX
LOGGER_TELEGRAM_TOKEN = os.environ.get(f"{GLOBAL_PREFIX}LOGGER_TELEGRAM_TOKEN", None)
LOGGER_TELEGRAM_CHAT_ID = os.environ.get(f"{GLOBAL_PREFIX}LOGGER_TELEGRAM_CHAT_ID", None)
LOGGER_TELEGRAM_MODE = os.environ.get(f"{GLOBAL_PREF... | 47.4 | 107 | 0.835443 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.