hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
67816c4b1b7f64ed39520fc8c6840aced134f043 | 1,685 | py | Python | test/find_template/get_sorted_top_k.py | songofhawk/simplerpa | 69491f3e9a84c106921be972242d05c5e3db5849 | [
"MIT"
] | 1 | 2022-02-16T08:37:25.000Z | 2022-02-16T08:37:25.000Z | test/find_template/get_sorted_top_k.py | songofhawk/simplerpa | 69491f3e9a84c106921be972242d05c5e3db5849 | [
"MIT"
] | null | null | null | test/find_template/get_sorted_top_k.py | songofhawk/simplerpa | 69491f3e9a84c106921be972242d05c5e3db5849 | [
"MIT"
] | null | null | null | import numpy as np
def get_sorted_top_k(array, top_k=1, axis=-1, reverse=False):
"""
多维数组排序
Args:
array: 多维数组
top_k: 取数
axis: 轴维度
reverse: 是否倒序
Returns:
top_sorted_scores: 值
top_sorted_indexes: 位置
"""
if reverse:
# argpartition分区排序,在给定轴上找... | 33.7 | 102 | 0.663501 |
98657a3b7b4d7a55f50cb61361886680b9a94685 | 6,915 | py | Python | src/opnsense/scripts/interfaces/traffic_top.py | onedr0p/core | 74e1ccfd40623f42a1dbf8b1d109c2e3e3736489 | [
"BSD-2-Clause"
] | 2,109 | 2015-01-02T15:42:12.000Z | 2022-03-31T20:16:10.000Z | src/opnsense/scripts/interfaces/traffic_top.py | onedr0p/core | 74e1ccfd40623f42a1dbf8b1d109c2e3e3736489 | [
"BSD-2-Clause"
] | 5,452 | 2015-01-03T10:30:09.000Z | 2022-03-31T19:58:33.000Z | src/opnsense/scripts/interfaces/traffic_top.py | onedr0p/core | 74e1ccfd40623f42a1dbf8b1d109c2e3e3736489 | [
"BSD-2-Clause"
] | 834 | 2015-01-04T05:29:59.000Z | 2022-03-30T00:45:49.000Z | #!/usr/local/bin/python3
"""
Copyright (c) 2020 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 the abo... | 41.909091 | 109 | 0.572813 |
67f9a3be13a1e450efbb68b759dce30edb646361 | 2,339 | py | Python | test/vanilla/AcceptanceTests/asynctests/test_duration.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/vanilla/AcceptanceTests/asynctests/test_duration.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/vanilla/AcceptanceTests/asynctests/test_duration.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | 37.126984 | 123 | 0.734074 |
3952a913ac76819cfa05076c4bc6c51dc8571e4e | 10,157 | py | Python | selfdrive/controls/radard.py | Orbbec-3DPG/openpilot | 27e0adc434906e37fd7674160a0a8c2dd5c3c180 | [
"MIT"
] | 7 | 2020-09-22T18:45:03.000Z | 2021-06-18T13:41:49.000Z | selfdrive/controls/radard.py | Orbbec-3DPG/openpilot | 27e0adc434906e37fd7674160a0a8c2dd5c3c180 | [
"MIT"
] | 2 | 2020-09-23T18:29:30.000Z | 2020-09-29T02:20:45.000Z | selfdrive/controls/radard.py | Orbbec-3DPG/openpilot | 27e0adc434906e37fd7674160a0a8c2dd5c3c180 | [
"MIT"
] | 2 | 2021-07-08T19:30:13.000Z | 2022-01-03T09:28:59.000Z | #!/usr/bin/env python
import zmq
import numpy as np
import numpy.matlib
import importlib
from collections import defaultdict
from fastcluster import linkage_vector
import selfdrive.messaging as messaging
from selfdrive.services import service_list
from selfdrive.controls.lib.latcontrol_helpers import calc_lookahead_off... | 33.63245 | 145 | 0.656395 |
28e60fb2823c48b414188ad36f4734802e947eb5 | 4,996 | py | Python | MaksimovKA_solution/models/qubvel_segmentation_models/linknet/blocks.py | ktncktnc/SpaceNet_Off_Nadir_Solutions | 2a9ef1c3b72fb749c808ddb8593a85cb16b9f1ca | [
"Apache-2.0"
] | 164 | 2019-01-31T16:37:09.000Z | 2022-03-31T02:47:49.000Z | MaksimovKA_solution/models/qubvel_segmentation_models/linknet/blocks.py | xiaofanglegoc/SpaceNet_Off_Nadir_Solutions | 812f151d244565f29987ebec7683ef42622ae16e | [
"Apache-2.0"
] | 3 | 2019-11-20T03:32:29.000Z | 2021-12-20T05:52:50.000Z | MaksimovKA_solution/models/qubvel_segmentation_models/linknet/blocks.py | xiaofanglegoc/SpaceNet_Off_Nadir_Solutions | 812f151d244565f29987ebec7683ef42622ae16e | [
"Apache-2.0"
] | 36 | 2019-02-08T19:12:35.000Z | 2021-12-23T06:52:35.000Z | import keras.backend as K
from keras.layers import Conv2DTranspose as Transpose
from keras.layers import UpSampling2D
from keras.layers import Conv2D
from keras.layers import BatchNormalization
from keras.layers import Activation
from keras.layers import Add
def handle_block_names(stage):
conv_name = 'decoder_sta... | 29.738095 | 87 | 0.514612 |
bbc7b73659aa8faa453672d5584fb7484ac1dc3d | 457 | py | Python | movies/migrations/0004_auto_20180627_0933.py | dimkl/movierama | 20f2ec3ba4f26484628399227188aef5536d4a3e | [
"MIT"
] | null | null | null | movies/migrations/0004_auto_20180627_0933.py | dimkl/movierama | 20f2ec3ba4f26484628399227188aef5536d4a3e | [
"MIT"
] | null | null | null | movies/migrations/0004_auto_20180627_0933.py | dimkl/movierama | 20f2ec3ba4f26484628399227188aef5536d4a3e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-06-27 09:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movies', '0003_auto_20180627_0844'),
]
operations = [
migrations.AlterField(
... | 21.761905 | 58 | 0.617068 |
8f2dbdaf579f21a1018064ee8a7efc845e38ad33 | 12,958 | py | Python | src/data_upload.py | nyu-mlab/iot-inspector-client | 37b235e4bc51bca12cb9cd613ad4dbd9024e626b | [
"MIT"
] | 52 | 2020-09-21T18:46:06.000Z | 2022-03-29T02:05:14.000Z | proxy2/data_upload.py | rmarx/quic_iot | 56e3c184bdaa20c065150c33851a5b6608987b8b | [
"MIT"
] | 19 | 2020-09-21T06:57:55.000Z | 2022-03-25T02:55:12.000Z | src/data_upload.py | william1357chen/iot-inspector-client | 37b235e4bc51bca12cb9cd613ad4dbd9024e626b | [
"MIT"
] | 13 | 2020-09-17T13:56:49.000Z | 2022-03-11T17:18:12.000Z | """
Anonymizes and uploads DNS and flow data to cloud.
"""
import datetime
import json
import requests
import threading
import time
import traceback
from host_state import HostState
import server_config
import utils
UPLOAD_INTERVAL = 5
class DataUploader(object):
def __init__(self, host_state):
asse... | 35.598901 | 110 | 0.580182 |
79a099a24216c0714f34d063e6df3012646580a4 | 666 | py | Python | simbots/simbots/utils/exceptions.py | vaibhavrr1/simbots | 9cc432c39e125962b37494be50a6ecf77aba7f39 | [
"MIT"
] | 26 | 2021-11-23T04:55:32.000Z | 2021-12-12T12:02:52.000Z | simbots/simbots/utils/exceptions.py | vaibhavrr1/simbots | 9cc432c39e125962b37494be50a6ecf77aba7f39 | [
"MIT"
] | null | null | null | simbots/simbots/utils/exceptions.py | vaibhavrr1/simbots | 9cc432c39e125962b37494be50a6ecf77aba7f39 | [
"MIT"
] | null | null | null |
class SchemaException(Exception):
"""
Exception raised for errors in schema.
"""
def __init__(self, type=None,name=None, message=None):
self.message = "\n\n Error encountered in {0} : {1} \n Detail : {2}".format(type,name,message)
super().__init__(self.message)
class IndexingError(... | 22.965517 | 102 | 0.636637 |
7ce6f646c79925edf5e262b7fea8037143bf6c6f | 3,918 | py | Python | server.py | chrisbloecker/as1-final | ff260a8511e0c22ebb58662ec188251b3cc47311 | [
"MIT"
] | null | null | null | server.py | chrisbloecker/as1-final | ff260a8511e0c22ebb58662ec188251b3cc47311 | [
"MIT"
] | null | null | null | server.py | chrisbloecker/as1-final | ff260a8511e0c22ebb58662ec188251b3cc47311 | [
"MIT"
] | null | null | null | # Author: Christopher Blöcker, Timotheus Kampik, Tobias Sundqvist
from http.server import HTTPServer, BaseHTTPRequestHandler
from json import loads, dumps
from json.decoder import JSONDecodeError
from controller import *
# The request handler for commands that should be sent to the crazyflie.
class CrazyHa... | 36.616822 | 97 | 0.605411 |
df1c33c11c2654307ba0f0b4a10a9b7d303542f2 | 2,703 | py | Python | receipt_split/models/receipt_model.py | isaaclo123/reciept-split | 331a6f16c05d2ee77a2668060c062cbd836939e4 | [
"CC-BY-3.0"
] | 1 | 2020-06-27T21:43:56.000Z | 2020-06-27T21:43:56.000Z | receipt_split/models/receipt_model.py | isaaclo123/reciept-split | 331a6f16c05d2ee77a2668060c062cbd836939e4 | [
"CC-BY-3.0"
] | 1 | 2021-03-27T20:26:04.000Z | 2021-03-27T20:26:04.000Z | receipt_split/models/receipt_model.py | isaaclo123/reciept-split | 331a6f16c05d2ee77a2668060c062cbd836939e4 | [
"CC-BY-3.0"
] | null | null | null | # from flask import current_app as app
from sqlalchemy.orm import relationship, column_property
from sqlalchemy.sql import func, select, exists, and_
from receipt_split.meta import db
from . import Base, Balance
receiptitem_association_table = db.Table(
'user_receiptitem_association',
db.metadata,
db.Colu... | 30.033333 | 75 | 0.564188 |
64ad1763f958e5147e6e1c9cfd621dd9252bfd41 | 899 | py | Python | fepy/adaptive/interval.py | EastMagica/fepy | e5ede0921f887baebde643502f82fceb85a5e9a2 | [
"MIT"
] | null | null | null | fepy/adaptive/interval.py | EastMagica/fepy | e5ede0921f887baebde643502f82fceb85a5e9a2 | [
"MIT"
] | null | null | null | fepy/adaptive/interval.py | EastMagica/fepy | e5ede0921f887baebde643502f82fceb85a5e9a2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding:utf-8 -*-
# @author : east
# @time : 2021/7/16 20:54
# @file : interval.py
# @project : fepy
# software : PyCharm
import numpy as np
class Adaptive1D(object):
def __init__(self, err, fem, f):
self.f = f
self.fem = fem
self.err = err
def adaptive(... | 23.051282 | 63 | 0.561735 |
a89de1e5c1883f4cb910b6cb458f0cc72df704a5 | 91,204 | py | Python | src/commercetools/types/_order_edit.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | null | null | null | src/commercetools/types/_order_edit.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | null | null | null | src/commercetools/types/_order_edit.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | null | null | null | # DO NOT EDIT! This file is automatically generated
import datetime
import typing
from commercetools.types._abstract import _BaseType
from commercetools.types._common import (
BaseResource,
Reference,
ReferenceTypeId,
ResourceIdentifier,
)
from commercetools.types._order import Order, StagedOrderUpdate... | 36.235201 | 724 | 0.651759 |
19b387532b6c33f5ab04782012a1f61b2d7edbc9 | 2,030 | py | Python | NFCow/shopping_carts/views.py | jojoriveraa/titulacion-NFCOW | 643f7f2cbe9c68d9343f38d12629720b12e9ce1e | [
"Apache-2.0"
] | null | null | null | NFCow/shopping_carts/views.py | jojoriveraa/titulacion-NFCOW | 643f7f2cbe9c68d9343f38d12629720b12e9ce1e | [
"Apache-2.0"
] | 11 | 2016-01-09T06:27:02.000Z | 2016-01-10T05:21:05.000Z | NFCow/shopping_carts/views.py | jojoriveraa/titulacion-NFCOW | 643f7f2cbe9c68d9343f38d12629720b12e9ce1e | [
"Apache-2.0"
] | null | null | null | from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.utils import timezone
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from .models import Shopping_Cart
from orders.models import Order
from rel_products_shopping_carts.models ... | 40.6 | 161 | 0.800985 |
bf3119bfa20aa0221a64766dedd5a2d148dc7fd7 | 927 | py | Python | generate_waveforms_script_EOB.py | iphysresearch/lfi-gw | afcfbb68ca6f8f4b5bdcf7f2e7fe71d4ff19f6fb | [
"MIT"
] | 18 | 2020-09-15T15:30:19.000Z | 2022-03-11T14:11:37.000Z | generate_waveforms_script_EOB.py | iphysresearch/lfi-gw | afcfbb68ca6f8f4b5bdcf7f2e7fe71d4ff19f6fb | [
"MIT"
] | 2 | 2021-09-08T14:36:38.000Z | 2021-09-17T07:52:59.000Z | generate_waveforms_script_EOB.py | iphysresearch/lfi-gw | afcfbb68ca6f8f4b5bdcf7f2e7fe71d4ff19f6fb | [
"MIT"
] | 10 | 2020-09-15T15:33:38.000Z | 2022-02-04T11:24:48.000Z | import lfigw.waveform_generator as wfg
wfd = wfg.WaveformDataset(spins_aligned=False, domain='RB',
extrinsic_at_train=True)
wfd.Nrb = 600
wfd.approximant = 'SEOBNRv4P'
wfd.load_event('data/events/GW150914_10Hz/')
wfd.importance_sampling = 'uniform_distance'
wfd.prior['distance'] = [100.0,... | 25.054054 | 59 | 0.742179 |
c02ba99afc3012c3ce1ef048f623c1e1fd22a1ba | 646 | py | Python | tests/test_conformance.py | iscc/iscc-core | 45cfb0c092ffb8dc97d926528cb2b16aa20e2c43 | [
"Apache-2.0"
] | 5 | 2021-08-31T19:06:57.000Z | 2022-01-13T16:11:22.000Z | tests/test_conformance.py | iscc/iscc-core | 45cfb0c092ffb8dc97d926528cb2b16aa20e2c43 | [
"Apache-2.0"
] | 54 | 2021-12-25T11:25:09.000Z | 2022-03-03T09:04:31.000Z | tests/test_conformance.py | iscc/iscc-core | 45cfb0c092ffb8dc97d926528cb2b16aa20e2c43 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Run conformance tests"""
from typing import Generator
import pytest
from iscc_core import conformance
def test_generate_tests():
test_generator = conformance.generate_tests()
assert isinstance(test_generator, Generator)
def test_confromance_selftest():
assert conformance.selft... | 26.916667 | 90 | 0.73065 |
54e05eddf3ecd34375c73782ee4bb5ec425ddedf | 313 | py | Python | openfl/tensor_transformation_pipelines/__init__.py | sbakas/OpenFederatedLearning-1 | d8e2d22dfccfb8488f70f1fb5593d4e6ee1eca1f | [
"Apache-2.0"
] | 3 | 2020-12-23T02:41:16.000Z | 2021-12-07T00:01:56.000Z | openfl/tensor_transformation_pipelines/__init__.py | sbakas/OpenFederatedLearning-1 | d8e2d22dfccfb8488f70f1fb5593d4e6ee1eca1f | [
"Apache-2.0"
] | null | null | null | openfl/tensor_transformation_pipelines/__init__.py | sbakas/OpenFederatedLearning-1 | d8e2d22dfccfb8488f70f1fb5593d4e6ee1eca1f | [
"Apache-2.0"
] | 1 | 2020-09-05T04:36:27.000Z | 2020-09-05T04:36:27.000Z | from .pipeline import Transformer, TransformationPipeline
from .no_compression_pipeline import NoCompressionPipeline, Float32NumpyArrayToBytes
from .random_shift_pipeline import RandomShiftPipeline
from .stc_pipeline import STCPipeline
from .skc_pipeline import SKCPipeline
from .kc_pipeline import KCPipeline
| 31.3 | 84 | 0.881789 |
dfe394bed9b155463f6344b1b1f1679327248506 | 3,894 | py | Python | Functions/Project_Functions.py | ArrigoCoen/Insurance_expenses_prediction | 7a24165a0c68a942aaa567641f9bb75898a0dfcc | [
"MIT"
] | null | null | null | Functions/Project_Functions.py | ArrigoCoen/Insurance_expenses_prediction | 7a24165a0c68a942aaa567641f9bb75898a0dfcc | [
"MIT"
] | null | null | null | Functions/Project_Functions.py | ArrigoCoen/Insurance_expenses_prediction | 7a24165a0c68a942aaa567641f9bb75898a0dfcc | [
"MIT"
] | 2 | 2021-10-31T15:51:13.000Z | 2022-01-24T20:00:07.000Z |
def my_piclke_dump(var, file_name):
"""
This function saves 'var' in a pickle file with the name 'file_name'.
We use the folder 'Pickles' to save all the pickles.
Example:
file_name = "test"
x = 4
var = x
my_piclke_dump(var, file_name)
:param var: variable to save
:param file_... | 34.767857 | 116 | 0.673857 |
93a03a7e8f152a7dec8b2d28df5bca85c0d1e4ce | 2,047 | py | Python | utests/test_utils.py | bli74/robotframework-httpx | 0f1010c20a721b6ccdff024210f7d02d037beaab | [
"MIT"
] | 1 | 2021-08-03T06:28:20.000Z | 2021-08-03T06:28:20.000Z | utests/test_utils.py | bli74/robotframework-httpx | 0f1010c20a721b6ccdff024210f7d02d037beaab | [
"MIT"
] | null | null | null | utests/test_utils.py | bli74/robotframework-httpx | 0f1010c20a721b6ccdff024210f7d02d037beaab | [
"MIT"
] | null | null | null | import os
import httpx
import pytest
from HttpxLibrary import HttpxLibrary
from HttpxLibrary.utils import is_file_descriptor, merge_headers
from utests import SCRIPT_DIR
from utests import mock
def test_none():
assert is_file_descriptor(None) is False
def test_is_not_file_descriptor():
nf = 'a string'
... | 26.934211 | 77 | 0.752809 |
526579624f023fa092a90979aad15fa759153907 | 158 | py | Python | tests/model_control/detailed/transf_None/model_control_one_enabled_None_PolyTrend_Seasonal_DayOfMonth_LSTM.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/model_control/detailed/transf_None/model_control_one_enabled_None_PolyTrend_Seasonal_DayOfMonth_LSTM.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/model_control/detailed/transf_None/model_control_one_enabled_None_PolyTrend_Seasonal_DayOfMonth_LSTM.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['PolyTrend'] , ['Seasonal_DayOfMonth'] , ['LSTM'] ); | 39.5 | 85 | 0.753165 |
2756226bb6fce6217a10ac3ec455eb369c85329f | 17,564 | py | Python | tests/test_lint.py | EmadAlamoudi/libpetab-python-MS | 7d21d79e9c02200d361a19c737d61c0e56123ca0 | [
"MIT"
] | null | null | null | tests/test_lint.py | EmadAlamoudi/libpetab-python-MS | 7d21d79e9c02200d361a19c737d61c0e56123ca0 | [
"MIT"
] | null | null | null | tests/test_lint.py | EmadAlamoudi/libpetab-python-MS | 7d21d79e9c02200d361a19c737d61c0e56123ca0 | [
"MIT"
] | null | null | null | import os
import subprocess
from math import nan
from unittest.mock import patch
import libsbml
import pandas as pd
import pytest
import petab
from petab import (lint, sbml) # noqa: E402
from petab.C import *
# import fixtures
pytest_plugins = [
"tests.test_petab",
]
def test_assert_measured_observables_prese... | 35.34004 | 78 | 0.687543 |
23958d8d8c5fac6732730f4429fb00f4a3eeb4b2 | 32,582 | py | Python | tests/unit/gapic/v1/test_device_manager_client_v1.py | vam-google/python-iot | 6054a14c007ea967bcef275fc4aafc70e48b8b5d | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/v1/test_device_manager_client_v1.py | vam-google/python-iot | 6054a14c007ea967bcef275fc4aafc70e48b8b5d | [
"Apache-2.0"
] | 40 | 2019-07-16T10:04:48.000Z | 2020-01-20T09:04:59.000Z | tests/unit/gapic/v1/test_device_manager_client_v1.py | vam-google/python-iot | 6054a14c007ea967bcef275fc4aafc70e48b8b5d | [
"Apache-2.0"
] | 2 | 2019-07-18T00:05:31.000Z | 2019-11-27T14:17:22.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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 37.450575 | 88 | 0.661562 |
476c460c0332ded5e8775c48891c6b2307fdf85a | 506 | py | Python | tests/test_imports.py | hlibbabii/log-recommender | 03c975da4029676acb2c29f5915e30b2b29fce6c | [
"MIT"
] | 2 | 2019-04-02T13:46:55.000Z | 2022-03-18T02:33:51.000Z | tests/test_imports.py | hlibbabii/log-recommender | 03c975da4029676acb2c29f5915e30b2b29fce6c | [
"MIT"
] | 119 | 2018-09-10T13:45:41.000Z | 2022-03-11T23:55:07.000Z | tests/test_imports.py | hlibbabii/log-recommender | 03c975da4029676acb2c29f5915e30b2b29fce6c | [
"MIT"
] | 1 | 2019-04-02T14:29:24.000Z | 2019-04-02T14:29:24.000Z | import importlib
import os
import pkgutil
import unittest
from logrec.dataprep import base_project_dir
class ImportsTest(unittest.TestCase):
def test_imports(self):
importlib.import_module('torch')
__all__ = []
for loader, module_name, is_pkg in pkgutil.walk_packages([os.path.join(base_pr... | 29.764706 | 109 | 0.709486 |
b57789c27ead1becc7d7cb5d51b1d9bb3427d21f | 6,747 | py | Python | i3/.config/i3/bin/autoname_workspaces.py | obeijaflor/dotfiles | 3bfe251bb16ee3bfb84d88a95ddf7ac5613d94c6 | [
"BSD-2-Clause"
] | null | null | null | i3/.config/i3/bin/autoname_workspaces.py | obeijaflor/dotfiles | 3bfe251bb16ee3bfb84d88a95ddf7ac5613d94c6 | [
"BSD-2-Clause"
] | null | null | null | i3/.config/i3/bin/autoname_workspaces.py | obeijaflor/dotfiles | 3bfe251bb16ee3bfb84d88a95ddf7ac5613d94c6 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# github.com/justbuchanan/i3scripts
#
# This script listens for i3 events and updates workspace names to show icons
# for running programs. It contains icons for a few programs, but more can
# easily be added by editing the WINDOW_ICONS list below.
#
# It also re-numbers workspaces in ascendin... | 34.958549 | 87 | 0.653476 |
6308b573821c7b2bceaa8666fe76ba1c485c646c | 3,021 | py | Python | docs/conf.py | CameronLonsdale/cckrusher | 3d9d99d27e56a78b0c4982c30f30818f13150e47 | [
"MIT"
] | 19 | 2017-04-08T08:03:40.000Z | 2022-02-23T03:06:33.000Z | docs/conf.py | CameronLonsdale/cckrusher | 3d9d99d27e56a78b0c4982c30f30818f13150e47 | [
"MIT"
] | 21 | 2017-04-23T12:42:22.000Z | 2019-06-15T03:51:43.000Z | docs/conf.py | CameronLonsdale/cckrypto | 3d9d99d27e56a78b0c4982c30f30818f13150e47 | [
"MIT"
] | 4 | 2017-06-28T06:10:05.000Z | 2019-11-19T04:23:46.000Z | #!/usr/bin/env python3
import alabaster
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your cust... | 29.617647 | 78 | 0.690831 |
7396e5f71bcb2bfb62e74de2ea9a5f82420659fd | 6,427 | py | Python | test/functional/rpc_bind.py | DiniMuhd7/asusucoin | a28c442369571bc0280a84a686e00e7dffd91064 | [
"MIT"
] | null | null | null | test/functional/rpc_bind.py | DiniMuhd7/asusucoin | a28c442369571bc0280a84a686e00e7dffd91064 | [
"MIT"
] | null | null | null | test/functional/rpc_bind.py | DiniMuhd7/asusucoin | a28c442369571bc0280a84a686e00e7dffd91064 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running asusucoind with the -rpcbind and -rpcallowip options."""
import sys
from test_framework.... | 49.438462 | 172 | 0.633266 |
ad6b7e84b6d86b588f68ea22769de9d56b773955 | 596 | py | Python | scripts/utils.py | nirvishek/k8-vmware | 986c153b61e028a033b62aa6d198b068a4ed0eb0 | [
"Apache-2.0"
] | null | null | null | scripts/utils.py | nirvishek/k8-vmware | 986c153b61e028a033b62aa6d198b068a4ed0eb0 | [
"Apache-2.0"
] | null | null | null | scripts/utils.py | nirvishek/k8-vmware | 986c153b61e028a033b62aa6d198b068a4ed0eb0 | [
"Apache-2.0"
] | null | null | null | import datetime
class Utils:
@staticmethod
def format_expected_date(dt, dt_format):
try:
day, time = dt.split(",")
d = datetime.date.today()
while d.strftime("%A") != day.title():
d += datetime.timedelta(1)
d = datetime.datetime.strftime... | 29.8 | 81 | 0.533557 |
a420b4c0b85e76bdf53113f09f0bd49946af5dc8 | 821 | py | Python | x710_GeoVisit.py | charliechocho/py-crash-course | b42b8a4c1cb8d76e8316f55c1565ff42d920ee63 | [
"Apache-2.0"
] | null | null | null | x710_GeoVisit.py | charliechocho/py-crash-course | b42b8a4c1cb8d76e8316f55c1565ff42d920ee63 | [
"Apache-2.0"
] | null | null | null | x710_GeoVisit.py | charliechocho/py-crash-course | b42b8a4c1cb8d76e8316f55c1565ff42d920ee63 | [
"Apache-2.0"
] | null | null | null | # Create a directory to store name a places
place_visit = {}
#Laddar input frågan i en variabel att användas senare
prompt = "Vi skulle vilja höra vad ditt favoritresemål är"
prompt += '\nSå, vad är ditt namn? '
#sätter en Flagga
active_chk = True
while active_chk == True:
name = input(prompt)
place = input(... | 30.407407 | 71 | 0.693057 |
26161947123ff0664d409b8deac4d5da859849d6 | 1,929 | py | Python | easy/806_number_of_lines_to_write_string.py | niki4/leetcode_py3 | 794f560a09a8950da21bd58ea222e0c74449ffa6 | [
"MIT"
] | null | null | null | easy/806_number_of_lines_to_write_string.py | niki4/leetcode_py3 | 794f560a09a8950da21bd58ea222e0c74449ffa6 | [
"MIT"
] | null | null | null | easy/806_number_of_lines_to_write_string.py | niki4/leetcode_py3 | 794f560a09a8950da21bd58ea222e0c74449ffa6 | [
"MIT"
] | null | null | null | """
We are to write the letters of a given string S, from left to right into lines.
Each line has maximum width 100 units, and if writing a letter would cause
the width of the line to exceed 100 units, it is written on the next line.
We are given an array widths, an array where widths[0] is the width of 'a',
widths[1] ... | 37.823529 | 94 | 0.659927 |
da5b4b33071c436d97c49e401ebaecef61d5d3ae | 175,646 | py | Python | dojo/models.py | Homopatrol/django-DefectDojo | f85de542fbb82e4258bf1bb3d7ab9886eacc0084 | [
"BSD-3-Clause"
] | null | null | null | dojo/models.py | Homopatrol/django-DefectDojo | f85de542fbb82e4258bf1bb3d7ab9886eacc0084 | [
"BSD-3-Clause"
] | null | null | null | dojo/models.py | Homopatrol/django-DefectDojo | f85de542fbb82e4258bf1bb3d7ab9886eacc0084 | [
"BSD-3-Clause"
] | null | null | null | import base64
import hashlib
import logging
from operator import itemgetter
import os
import re
from uuid import uuid4
from django.conf import settings
from auditlog.registry import auditlog
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.core... | 47.742865 | 333 | 0.61493 |
a0bc5d91bb50cb85d6a768b403d7fe2110f67e02 | 2,008 | py | Python | Day 3/Python/src.py | Torak28/AdventOfCode2020 | 3e9f9f24f37ee70f813b08d6b78dad1fb246677d | [
"MIT"
] | 1 | 2020-12-22T12:56:31.000Z | 2020-12-22T12:56:31.000Z | Day 3/Python/src.py | Torak28/AdventOfCode2020 | 3e9f9f24f37ee70f813b08d6b78dad1fb246677d | [
"MIT"
] | null | null | null | Day 3/Python/src.py | Torak28/AdventOfCode2020 | 3e9f9f24f37ee70f813b08d6b78dad1fb246677d | [
"MIT"
] | null | null | null | from functools import reduce
def load_data(file_name: str) -> list:
lst = []
with open(file_name) as f:
lines = f.readlines()
for elem in lines:
lst.append(elem.strip())
return lst
def applay_rule(pos: tuple, rule: tuple) -> tuple:
pos = list(pos)
for elem in rule:
... | 25.74359 | 66 | 0.406873 |
4b0a97f10441c838126badb9662de8490221dc03 | 568 | py | Python | PisP.py | HuajiMUR233/PythonIsPlugin | f8b34ebef70b87670f0d79eba0a30c627a99fc85 | [
"Unlicense"
] | null | null | null | PisP.py | HuajiMUR233/PythonIsPlugin | f8b34ebef70b87670f0d79eba0a30c627a99fc85 | [
"Unlicense"
] | null | null | null | PisP.py | HuajiMUR233/PythonIsPlugin | f8b34ebef70b87670f0d79eba0a30c627a99fc85 | [
"Unlicense"
] | null | null | null | import sys
def get_python_version():
major=sys.version_info.major
minor=sys.version_info.minor
micro=sys.version_info.micro
releaselevel=sys.version_info.releaselevel
serial=sys.version_info.serial
version=f"{major}.{minor}.{micro}"
if releaselevel!="final":
version+=f"-{r... | 27.047619 | 47 | 0.660211 |
45d4bbcabe0fcca2cbdb55e1a8c5341be2db8488 | 20,324 | py | Python | ironic/db/sqlalchemy/api.py | hongbin/ironic | 857690560657bbfc5342000908bc84c918da1b11 | [
"Apache-2.0"
] | null | null | null | ironic/db/sqlalchemy/api.py | hongbin/ironic | 857690560657bbfc5342000908bc84c918da1b11 | [
"Apache-2.0"
] | null | null | null | ironic/db/sqlalchemy/api.py | hongbin/ironic | 857690560657bbfc5342000908bc84c918da1b11 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# ... | 36.292857 | 79 | 0.61174 |
0c238e29024bf6f2fdb3106a92ffe69682af43b0 | 16,848 | py | Python | python_modules/dagster-graphql/dagster_graphql/schema/solids.py | jmswaney/dagster | 510080abc541250a4b74f6a0ada4484d67d5e037 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/schema/solids.py | jmswaney/dagster | 510080abc541250a4b74f6a0ada4484d67d5e037 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/schema/solids.py | jmswaney/dagster | 510080abc541250a4b74f6a0ada4484d67d5e037 | [
"Apache-2.0"
] | null | null | null | from dagster_graphql import dauphin
from dagster import check
from dagster.core.definitions import (
CompositeSolidDefinition,
IContainSolids,
ISolidDefinition,
InputDefinition,
OutputDefinition,
Solid,
SolidDefinition,
SolidHandle,
SolidInputHandle,
SolidOutputHandle,
)
from da... | 35.173278 | 100 | 0.678003 |
c5b806b6f7736bf8b5e9683e501ca73963640355 | 1,443 | py | Python | src/utils/osm2gmns/util.py | wenke727/RoadNetworkCreator | a359d2e5c5f0921b1af514c3a88b5e3a25707407 | [
"MIT"
] | 1 | 2021-04-24T07:56:46.000Z | 2021-04-24T07:56:46.000Z | src/utils/osm2gmns/util.py | wenke727/RoadNetworkCreator | a359d2e5c5f0921b1af514c3a88b5e3a25707407 | [
"MIT"
] | null | null | null | src/utils/osm2gmns/util.py | wenke727/RoadNetworkCreator | a359d2e5c5f0921b1af514c3a88b5e3a25707407 | [
"MIT"
] | null | null | null | import math
from .settings import *
from shapely import geometry
default_bounds = {'minlat':-90.0, 'minlon':-180.0, 'maxlat':90.0, 'maxlon':180.0}
def getDistanceFromCoord(lon1, lat1, lon2, lat2):
# return km
lon1, lat1, lon2, lat2 = map(math.radians, [lon1, lat1, lon2, lat2])
dlon = lon2 - lon... | 27.226415 | 92 | 0.621622 |
48511858001f5ac6a12f1bad620f77a137e5fbe3 | 741 | py | Python | api/custom_auth/urls.py | mevinbabuc/flagsmith | 751bd6cb4a34bd2f80af5a9c547559da9c2fa010 | [
"BSD-3-Clause"
] | 1,259 | 2021-06-10T11:24:09.000Z | 2022-03-31T10:30:44.000Z | api/custom_auth/urls.py | mevinbabuc/flagsmith | 751bd6cb4a34bd2f80af5a9c547559da9c2fa010 | [
"BSD-3-Clause"
] | 392 | 2021-06-10T11:12:29.000Z | 2022-03-31T10:13:53.000Z | api/custom_auth/urls.py | mevinbabuc/flagsmith | 751bd6cb4a34bd2f80af5a9c547559da9c2fa010 | [
"BSD-3-Clause"
] | 58 | 2021-06-11T03:18:07.000Z | 2022-03-31T14:39:10.000Z | from django.urls import include, path
from custom_auth.views import (
CustomAuthTokenLoginOrRequestMFACode,
CustomAuthTokenLoginWithMFACode,
)
app_name = "custom_auth"
urlpatterns = [
# Override some endpoints for throttling requests
path(
"login/",
CustomAuthTokenLoginOrRequestMFACo... | 26.464286 | 84 | 0.661269 |
deedd628107f3e480d7b66c73b521fa82cfa9007 | 1,018 | py | Python | hapast/models.py | cuizhenduo/apple | 7701a0664aaf712aa9f855b28d8f19eb8b71645d | [
"Apache-2.0"
] | null | null | null | hapast/models.py | cuizhenduo/apple | 7701a0664aaf712aa9f855b28d8f19eb8b71645d | [
"Apache-2.0"
] | null | null | null | hapast/models.py | cuizhenduo/apple | 7701a0664aaf712aa9f855b28d8f19eb8b71645d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Chong(models.Model):
title = models.CharField('标题',max_length=200)
article = models.TextField('文章')
time = models.DateTimeField('时间', auto_now=True)
class Meta:
verbose... | 28.277778 | 52 | 0.657171 |
41221b24e04212e8e5e871e13c0153884bc50944 | 1,230 | py | Python | services/streaming/backend/endpoint.py | SashaNullptr/FNWClient | 0f49bf6f2355951c05c4971bed3c5d814ca286cd | [
"MIT"
] | null | null | null | services/streaming/backend/endpoint.py | SashaNullptr/FNWClient | 0f49bf6f2355951c05c4971bed3c5d814ca286cd | [
"MIT"
] | null | null | null | services/streaming/backend/endpoint.py | SashaNullptr/FNWClient | 0f49bf6f2355951c05c4971bed3c5d814ca286cd | [
"MIT"
] | null | null | null | # System
import json
# Third Party
from flask import Blueprint, request, Response, jsonify
from injector import inject
from prometheus_client import generate_latest, CONTENT_TYPE_LATEST
blueprint = Blueprint('fnwclient', __name__)
@blueprint.route('/healthz', methods=['GET'])
@inject
def health_check( event=None, co... | 17.323944 | 86 | 0.598374 |
fd469a2d0640832c788c96a77ab33ee5620fc586 | 6,949 | py | Python | Conversely_Frontend/app/Server/server.py | sam-aldis/Conversley | 1fc30d6b768cc03f727229a52e0879fac3af1e3a | [
"MIT"
] | null | null | null | Conversely_Frontend/app/Server/server.py | sam-aldis/Conversley | 1fc30d6b768cc03f727229a52e0879fac3af1e3a | [
"MIT"
] | null | null | null | Conversely_Frontend/app/Server/server.py | sam-aldis/Conversley | 1fc30d6b768cc03f727229a52e0879fac3af1e3a | [
"MIT"
] | null | null | null | import tornado.web
import tornado.httpserver
import tornado.websocket
import tornado.escape
import os
import tornado.ioloop
import ssl
import json
import tornado.httpclient
import pymongo
import ukjp.language
import ukjp.database
import ukjp.facebook
import ukjp.templates
import time
import thread
import random
class... | 43.43125 | 201 | 0.618362 |
0b41ff3cf795e1e4035c65bbc0895df67a001566 | 3,209 | py | Python | experiments/deep_learning/src/config.py | ntnu-ai-lab/harth-ml-experiments | 4b4eefa27db111665c23c697005916703eac0a2c | [
"MIT"
] | 3 | 2022-03-12T19:22:24.000Z | 2022-03-29T21:03:25.000Z | experiments/deep_learning/src/config.py | ntnu-ai-lab/harth-ml-experiments | 4b4eefa27db111665c23c697005916703eac0a2c | [
"MIT"
] | null | null | null | experiments/deep_learning/src/config.py | ntnu-ai-lab/harth-ml-experiments | 4b4eefa27db111665c23c697005916703eac0a2c | [
"MIT"
] | null | null | null | import os
import yaml
class Config():
def __init__(self, path):
with open(path, 'r') as f:
cfg = yaml.load(f, Loader=yaml.Loader)
self.CLASSES = cfg['CLASSES']
self.LABEL_COLUMN = cfg['LABEL_COLUMN']
self.SAMPLE_RATE = cfg['FREQUENCY']
self.TRAIN_DATA = cfg['TRA... | 34.138298 | 84 | 0.611405 |
7c37c27c16b5cd44e5c60394aae9bcc1a787928f | 428 | py | Python | app/main/views.py | lifeng6mail/flask-tutorial | 260f2e78ec244ddf2622555633f830cf7155c5b1 | [
"MIT"
] | 1 | 2021-06-06T00:10:23.000Z | 2021-06-06T00:10:23.000Z | docs/app/main/views.py | lifeng6mail/flask-tutorial | 260f2e78ec244ddf2622555633f830cf7155c5b1 | [
"MIT"
] | null | null | null | docs/app/main/views.py | lifeng6mail/flask-tutorial | 260f2e78ec244ddf2622555633f830cf7155c5b1 | [
"MIT"
] | null | null | null | from flask import render_template
from . import main
from ..models import Article
@main.route('/', methods=['GET', 'POST'])
def index():
articles = Article.query.all()
return render_template('index.html', articles=articles)
@main.route('/article/<title>')
def article(title):
article = Article.query.filt... | 26.75 | 80 | 0.721963 |
c4f6afa44b697790e8497a5aea7cd7b8edaf6332 | 1,151 | py | Python | integration_test/src/python/integration_test/core/terminal_bolt.py | Munyola/incubator-heron | 4aa106c6eaef9c60ed2d692e41998adda8115e6f | [
"Apache-2.0"
] | 2 | 2016-07-04T07:10:31.000Z | 2018-03-28T16:59:02.000Z | integration_test/src/python/integration_test/core/terminal_bolt.py | Munyola/incubator-heron | 4aa106c6eaef9c60ed2d692e41998adda8115e6f | [
"Apache-2.0"
] | 1 | 2019-05-08T22:30:16.000Z | 2019-05-08T22:30:16.000Z | integration_test/src/python/integration_test/core/terminal_bolt.py | Munyola/incubator-heron | 4aa106c6eaef9c60ed2d692e41998adda8115e6f | [
"Apache-2.0"
] | 1 | 2017-06-05T17:55:45.000Z | 2017-06-05T17:55:45.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | 34.878788 | 63 | 0.75152 |
2bf53ae5f9833800f522e29954fb183e87bef39e | 5,644 | py | Python | multiMNIST/solvers/gradvacc.py | kelvin95/EPOSearch | 020f0a8890437449dd7bb37534697aa9f71e8305 | [
"MIT"
] | null | null | null | multiMNIST/solvers/gradvacc.py | kelvin95/EPOSearch | 020f0a8890437449dd7bb37534697aa9f71e8305 | [
"MIT"
] | null | null | null | multiMNIST/solvers/gradvacc.py | kelvin95/EPOSearch | 020f0a8890437449dd7bb37534697aa9f71e8305 | [
"MIT"
] | null | null | null | # This code is from
# Pareto Multi-Task LearningLin
# Xi Lin, Hui-Ling Zhen, Zhenhua Li, Qingfu Zhang, Sam Kwong
# Neural Information Processing Systems (NeurIPS) 2019
# https://github.com/Xi-L/ParetoMTL
import numpy as np
import torch
from .base import Solver
from .utils import flatten_grad, recover_flattened
from ... | 39.468531 | 88 | 0.543409 |
02a994eab6dbdc03f1c942e463c53777f9252687 | 753 | py | Python | openfasoc/generators/dcdc-gen/flow/util/add_ndr_rule.py | Elon-J/OpenFASOC | f59127eb72ef715f60d4ad7031c098c8ac9ae08e | [
"Apache-2.0"
] | null | null | null | openfasoc/generators/dcdc-gen/flow/util/add_ndr_rule.py | Elon-J/OpenFASOC | f59127eb72ef715f60d4ad7031c098c8ac9ae08e | [
"Apache-2.0"
] | null | null | null | openfasoc/generators/dcdc-gen/flow/util/add_ndr_rule.py | Elon-J/OpenFASOC | f59127eb72ef715f60d4ad7031c098c8ac9ae08e | [
"Apache-2.0"
] | null | null | null | import re
import argparse
parser = argparse.ArgumentParser(description="Add ndr rules to specified nets")
parser.add_argument("--inputDef", "-i", required=True, help="Input DEF")
parser.add_argument("--nets", "-n", required=True, help="target Nets")
parser.add_argument("--rule", "-r", required=True, help="ndr rule")
p... | 28.961538 | 79 | 0.638778 |
80b9f5c4dd67d96954ba8f4581935ca87b3fbee5 | 4,942 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/inspur/sm/plugins/modules/edit_media_instance.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/inspur/sm/plugins/modules/edit_media_instance.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/inspur/sm/plugins/modules/edit_media_instance.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Copyright(C) 2020 Inspur Inc. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
module: edit_medi... | 29.951515 | 105 | 0.625051 |
c4326e8bfd322284dcf0e6f43d35bcec26413233 | 946 | py | Python | py/tests/testImplementTrie_PrefixTree/test_ImplementTrie_PrefixTree.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | 1 | 2022-01-26T16:33:45.000Z | 2022-01-26T16:33:45.000Z | py/tests/testImplementTrie_PrefixTree/test_ImplementTrie_PrefixTree.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | null | null | null | py/tests/testImplementTrie_PrefixTree/test_ImplementTrie_PrefixTree.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | 1 | 2022-01-26T16:35:44.000Z | 2022-01-26T16:35:44.000Z | import unittest
from parameterized import parameterized as p
from solns.implementTrie_PrefixTree.implementTrie_PrefixTree import *
class UnitTest_ImplementTrie_PrefixTree(unittest.TestCase):
@p.expand([
[["Trie","insert","search","search",
"startsWith","insert","search"],
[[],["apple"]... | 33.785714 | 69 | 0.533827 |
a2482ad91d7817a744aec2e58d8c4714e9d1a485 | 8,714 | py | Python | cli/psym/api/property_type.py | danielrh135568/symphony-1 | 54c92a0f8775d1a837ab7c7bd6a08ccd906d28a4 | [
"BSD-3-Clause"
] | null | null | null | cli/psym/api/property_type.py | danielrh135568/symphony-1 | 54c92a0f8775d1a837ab7c7bd6a08ccd906d28a4 | [
"BSD-3-Clause"
] | 12 | 2022-02-14T04:20:30.000Z | 2022-03-28T04:20:17.000Z | cli/psym/api/property_type.py | danielrh135568/symphony-1 | 54c92a0f8775d1a837ab7c7bd6a08ccd906d28a4 | [
"BSD-3-Clause"
] | 1 | 2022-02-24T21:47:51.000Z | 2022-02-24T21:47:51.000Z | #!/usr/bin/env python3
# Copyright (c) 2004-present Facebook All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from typing import Dict, List, Optional, Sequence, Union
from psym.client import SymphonyClient
from psym.common.cache import (
EQ... | 31.232975 | 140 | 0.689924 |
5ae492050e82ae81341920bdd47dc4bdd885d697 | 1,104 | py | Python | plotly/validators/splom/stream/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 6 | 2019-05-03T02:12:04.000Z | 2020-03-01T06:33:21.000Z | plotly/validators/splom/stream/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | null | null | null | plotly/validators/splom/stream/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 5 | 2019-05-18T16:50:11.000Z | 2021-07-06T21:14:36.000Z |
import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name='token', parent_name='splom.stream', **kwargs
):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | 28.307692 | 75 | 0.610507 |
34fd9eef4aa735917e44e80921636ca079bde23d | 7,055 | py | Python | srunner/scenarios/new_scenario.py | ll7/scenario_runner | 277c570b0bc046ef1f9936d3b633d665d4a79197 | [
"MIT"
] | null | null | null | srunner/scenarios/new_scenario.py | ll7/scenario_runner | 277c570b0bc046ef1f9936d3b633d665d4a79197 | [
"MIT"
] | null | null | null | srunner/scenarios/new_scenario.py | ll7/scenario_runner | 277c570b0bc046ef1f9936d3b633d665d4a79197 | [
"MIT"
] | 1 | 2020-05-28T11:41:29.000Z | 2020-05-28T11:41:29.000Z | # ToDo
import random
import py_trees
import carla
from srunner.scenariomanager.carla_data_provider import CarlaDataProvider
from srunner.scenariomanager.scenarioatomics.atomic_behaviors import (ActorTransformSetter,
ActorDestroy,
... | 46.721854 | 124 | 0.626364 |
a7b5a30cdd8cfd882b1b97fef377684efa9b1190 | 5,691 | py | Python | planners/opPlanner.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T12:56:56.000Z | 2021-09-28T12:56:56.000Z | planners/opPlanner.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | null | null | null | planners/opPlanner.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T16:30:39.000Z | 2022-03-31T16:30:39.000Z | __author__ = 'patras'
from shared.timer import SetMode
from shared import GLOBALS
from shared.dataStructures import PlanArgs
import signal # for interrupting when planner's time limit is reached
from shared import rTree # refinement tree
from shared.exceptions import *
from shared.utility import Utility # the utility f... | 37.440789 | 114 | 0.611843 |
801c34ce461182ec70980526b940ddd82cbe331f | 4,088 | py | Python | venv/Lib/site-packages/trio/_core/tests/test_unbounded_queue.py | gilbertekalea/booking.com_crawler | 71e52c87cd72a77f80a3e5fc0af0e1a68a5712ae | [
"MIT"
] | 4,681 | 2017-03-10T22:38:41.000Z | 2022-03-31T11:47:44.000Z | venv/Lib/site-packages/trio/_core/tests/test_unbounded_queue.py | gilbertekalea/booking.com_crawler | 71e52c87cd72a77f80a3e5fc0af0e1a68a5712ae | [
"MIT"
] | 2,143 | 2017-03-11T05:58:32.000Z | 2022-03-31T10:29:00.000Z | venv/Lib/site-packages/trio/_core/tests/test_unbounded_queue.py | gilbertekalea/booking.com_crawler | 71e52c87cd72a77f80a3e5fc0af0e1a68a5712ae | [
"MIT"
] | 313 | 2017-03-11T05:24:33.000Z | 2022-03-23T18:26:02.000Z | import itertools
import pytest
from ... import _core
from ...testing import assert_checkpoints, wait_all_tasks_blocked
pytestmark = pytest.mark.filterwarnings(
"ignore:.*UnboundedQueue:trio.TrioDeprecationWarning"
)
async def test_UnboundedQueue_basic():
q = _core.UnboundedQueue()
q.put_nowait("hi")
... | 26.718954 | 79 | 0.621086 |
ee25036aae2c686a1d61127fd97ff64a50f0a48f | 1,740 | py | Python | tests/sites_framework/tests.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | 1 | 2015-11-08T11:42:08.000Z | 2015-11-08T11:42:08.000Z | tests/sites_framework/tests.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | null | null | null | tests/sites_framework/tests.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase
from .models import (SyndicatedArticle, ExclusiveArticle, CustomArticle,
InvalidArticle, ConfusedArticle)
class SitesFrameworkTestCase(TestCase):
def setUp(self):
Site.objects.get_or_create(... | 47.027027 | 128 | 0.741954 |
358726072b14af15f555792e36773663b7b35297 | 23,441 | py | Python | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.809603 | 118 | 0.705303 |
29e1a00a97343cd149603b45841a2e24b0168225 | 1,001 | py | Python | common/GameBoard.py | riftadi/dragonsarena | 61c8c5af19b0757749234bcba2a54561486bbd31 | [
"MIT"
] | 1 | 2018-03-29T17:09:19.000Z | 2018-03-29T17:09:19.000Z | common/GameBoard.py | riftadi/dragonsarena | 61c8c5af19b0757749234bcba2a54561486bbd31 | [
"MIT"
] | 21 | 2018-03-01T09:57:02.000Z | 2018-03-29T05:31:01.000Z | common/GameBoard.py | riftadi/dragonsarena | 61c8c5af19b0757749234bcba2a54561486bbd31 | [
"MIT"
] | null | null | null | class GameBoard(object):
"""
The board of the game, default size is 25x25
"""
def __init__(self, width, height):
self.width = width
self.height = height
self.gameboard = []
for i in xrange(width):
self.gameboard.append([])
for j in xrange(heig... | 27.805556 | 67 | 0.58042 |
8f5a735ee37cccca2af25df3128cb6dbbd4f45ca | 733 | pyw | Python | b64cp.pyw | maximx1/b64cp | 0f74084b41b0cea2488c1a057d3028608ff923fe | [
"MIT"
] | null | null | null | b64cp.pyw | maximx1/b64cp | 0f74084b41b0cea2488c1a057d3028608ff923fe | [
"MIT"
] | null | null | null | b64cp.pyw | maximx1/b64cp | 0f74084b41b0cea2488c1a057d3028608ff923fe | [
"MIT"
] | null | null | null | import sys
import base64
import os
from threading import Thread
try:
from Tkinter import Tk
except ImportError:
from tkinter import Tk
def encodeToBase64(originalString):
return base64.b64encode(bytes(originalString, "utf-8")).decode("utf-8")
def unicornMethod(cp, b64string):
cp.clipboard_clear()
cp.clipboard_... | 22.212121 | 72 | 0.757162 |
1197800d4006c6f85e4df04e506b184f5580bfff | 2,370 | py | Python | src/noos_pyk/clients/http.py | noosenergy/noos-requests | 8bfe4c55872fb00d03a3bddac231d7878252668b | [
"MIT"
] | null | null | null | src/noos_pyk/clients/http.py | noosenergy/noos-requests | 8bfe4c55872fb00d03a3bddac231d7878252668b | [
"MIT"
] | null | null | null | src/noos_pyk/clients/http.py | noosenergy/noos-requests | 8bfe4c55872fb00d03a3bddac231d7878252668b | [
"MIT"
] | null | null | null | import abc
from typing import Optional, TypeVar
from urllib import parse
import requests
from requests import auth
from . import base
T = TypeVar("T")
class HTTPError(base.ClientError):
"""Exception encountered over a HTTP client connection."""
pass
class HTTPClient(base.BaseHTTPClient[T]):
"""Base... | 26.629213 | 95 | 0.621097 |
ae14f10547b6a17e3319ccf2ee0a70815b2216a3 | 1,915 | py | Python | configs_DCP2/7/config_ours.py | megaman727/pooled-cell-painting-image-processing | bcee2e08f78849398a364d98cc8efde024f10435 | [
"BSD-3-Clause"
] | null | null | null | configs_DCP2/7/config_ours.py | megaman727/pooled-cell-painting-image-processing | bcee2e08f78849398a364d98cc8efde024f10435 | [
"BSD-3-Clause"
] | null | null | null | configs_DCP2/7/config_ours.py | megaman727/pooled-cell-painting-image-processing | bcee2e08f78849398a364d98cc8efde024f10435 | [
"BSD-3-Clause"
] | 1 | 2022-01-26T08:30:54.000Z | 2022-01-26T08:30:54.000Z | # Constants (User configurable)
APP_NAME = '2018_11_20_Periscope_X_PreprocessBarcoding' # Used to generate derivative names unique to the application.
# DOCKER REGISTRY INFORMATION:
DOCKERHUB_TAG = 'cellprofiler/distributed-cellprofiler:2.0.0_4.0.7'
# AWS GENERAL SETTINGS:
AWS_REGION = 'us-east-1'
AWS... | 42.555556 | 136 | 0.715405 |
72b342f557fb2df1495be21a972fc857f518efa6 | 746 | py | Python | plconv/convert/sokul_mmo.py | valtronforever/plconv | ffc0aeea932d9dfc6494a75c733325b867916432 | [
"MIT"
] | null | null | null | plconv/convert/sokul_mmo.py | valtronforever/plconv | ffc0aeea932d9dfc6494a75c733325b867916432 | [
"MIT"
] | null | null | null | plconv/convert/sokul_mmo.py | valtronforever/plconv | ffc0aeea932d9dfc6494a75c733325b867916432 | [
"MIT"
] | null | null | null | import pandas as pd
from decimal import Decimal
from plconv.models.supplier import ConvertParams
def sokul_mmo(params: ConvertParams):
in_path = params.in_params[0].filepath
out_path = params.out_params.path
df = pd.read_csv(in_path, encoding='cp1251', sep='\t', names=range(23))
df_head = df[:3]
d... | 41.444444 | 114 | 0.69437 |
c27055faf732d8c0f1f3e82ecaf952ffde8329b8 | 747 | py | Python | publications/utils/cache_all_tasks.py | fmohr/llcv | 22ba7b9712397f750150ed7e793245b5a0ae3fdf | [
"BSD-3-Clause"
] | 3 | 2021-11-30T18:58:58.000Z | 2022-03-07T20:40:41.000Z | publications/utils/cache_all_tasks.py | fmohr/llcv | 22ba7b9712397f750150ed7e793245b5a0ae3fdf | [
"BSD-3-Clause"
] | null | null | null | publications/utils/cache_all_tasks.py | fmohr/llcv | 22ba7b9712397f750150ed7e793245b5a0ae3fdf | [
"BSD-3-Clause"
] | null | null | null | import argparse
import logging
import openml
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--study_id', type=str, default=271)
return parser.parse_args()
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO,
format='[%(asctime)s] [%(l... | 31.125 | 75 | 0.657296 |
fab1cc459a019240b2cd924af21ca2acadd6693a | 1,302 | py | Python | trdg/utils.py | Cospel/TextRecognitionDataGenerator | 2339383f61a926945c06206ba5bb6358c0cb3568 | [
"MIT"
] | null | null | null | trdg/utils.py | Cospel/TextRecognitionDataGenerator | 2339383f61a926945c06206ba5bb6358c0cb3568 | [
"MIT"
] | null | null | null | trdg/utils.py | Cospel/TextRecognitionDataGenerator | 2339383f61a926945c06206ba5bb6358c0cb3568 | [
"MIT"
] | null | null | null | """
Utility functions
"""
import os
def load_dict(lang):
"""Read the dictionnary file and returns all words in it.
"""
lang_dict = []
with open(
os.path.join(os.path.dirname(__file__), "dicts", lang + ".txt"),
"r",
encoding="utf8",
errors="ignore",
) as d:
... | 30.27907 | 87 | 0.569124 |
01c88f0ee1a48e738e0c94f686f75a6caaa54ad4 | 21,291 | py | Python | Source/Common/wb_diff_side_by_side_view.py | cadappl/scm-workbench | 302cdb8e36bb755f4977062e8977c37e7f4491f9 | [
"Apache-2.0"
] | null | null | null | Source/Common/wb_diff_side_by_side_view.py | cadappl/scm-workbench | 302cdb8e36bb755f4977062e8977c37e7f4491f9 | [
"Apache-2.0"
] | null | null | null | Source/Common/wb_diff_side_by_side_view.py | cadappl/scm-workbench | 302cdb8e36bb755f4977062e8977c37e7f4491f9 | [
"Apache-2.0"
] | null | null | null | '''
====================================================================
Copyright (c) 2003-2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
======================================================... | 41.502924 | 157 | 0.638674 |
659c07b716b5f22c3d79a676b5566057f284cad2 | 3,897 | py | Python | src/nn/sequential_tests.py | renmengye/imageqa-public | 4e3ceb092495fb8c1056e55b870631907bb31d46 | [
"MIT"
] | 100 | 2015-09-23T22:56:51.000Z | 2021-09-27T05:25:40.000Z | src/nn/sequential_tests.py | renmengye/imageqa-public | 4e3ceb092495fb8c1056e55b870631907bb31d46 | [
"MIT"
] | 1 | 2016-03-23T02:03:20.000Z | 2016-03-24T10:42:23.000Z | src/nn/sequential_tests.py | renmengye/imageqa-public | 4e3ceb092495fb8c1056e55b870631907bb31d46 | [
"MIT"
] | 34 | 2015-09-28T21:22:59.000Z | 2020-09-28T03:14:20.000Z | from sequential import *
from lstm_old import *
from map import *
from dropout import *
from reshape import *
from lut import *
from active_func import *
import unittest
class Sequential_Tests(unittest.TestCase):
"""Sequential stacks of stages tests"""
def setUp(self):
random = np.random.Ra... | 30.209302 | 92 | 0.510393 |
77c5f6f0453527191e89a49218913955ba9c6aad | 3,843 | py | Python | test/test_unit_tests.py | till-m/triple_e | c323e9bcc9aca63894a0f47e4e80390505862fca | [
"Apache-2.0"
] | 1 | 2022-03-09T08:16:36.000Z | 2022-03-09T08:16:36.000Z | test/test_unit_tests.py | till-m/triple_e | c323e9bcc9aca63894a0f47e4e80390505862fca | [
"Apache-2.0"
] | null | null | null | test/test_unit_tests.py | till-m/triple_e | c323e9bcc9aca63894a0f47e4e80390505862fca | [
"Apache-2.0"
] | null | null | null | from triple_e import empirical_fisher, empirical_fisher_
import numpy as np
from math import comb
import pytest
from triple_e.effective_dimension import effective_dimension_, normalised_fisher
def test_single_binomial():
# p(k, theta) = binom(n, k) * theta^k * (1-theta)^(n-k)
# d/dtheta p(k, theta) = binom... | 27.255319 | 86 | 0.537601 |
faf41274dc3a352cd5556cfd65ec37e0948c2d9c | 1,128 | py | Python | superset/models/user_attributes.py | sssswangzi/superset | 3ff53b20bbe8ecc80d7dd3bf91d5d7af7c6c43cb | [
"Apache-2.0"
] | 11 | 2020-04-23T02:20:49.000Z | 2022-02-14T12:58:25.000Z | superset/models/user_attributes.py | sssswangzi/superset | 3ff53b20bbe8ecc80d7dd3bf91d5d7af7c6c43cb | [
"Apache-2.0"
] | 16 | 2019-12-30T04:58:10.000Z | 2022-03-08T23:41:14.000Z | superset/models/user_attributes.py | sssswangzi/superset | 3ff53b20bbe8ecc80d7dd3bf91d5d7af7c6c43cb | [
"Apache-2.0"
] | 1 | 2019-12-25T08:03:34.000Z | 2019-12-25T08:03:34.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from flask_appbuilder import Model
from sqlalchemy import Column, ForeignKey, Integer
from sqlalchemy.orm import relationship
from superset impor... | 30.486486 | 78 | 0.758865 |
b87b76af1f77ca06b2151923725dcbbc21559a64 | 14,704 | py | Python | src/syft/grid/duet/webrtc_duet.py | aeroaks/PySyft | 88220c38faf3cd72ddc63c73f3c0533695df53c9 | [
"Apache-2.0"
] | null | null | null | src/syft/grid/duet/webrtc_duet.py | aeroaks/PySyft | 88220c38faf3cd72ddc63c73f3c0533695df53c9 | [
"Apache-2.0"
] | null | null | null | src/syft/grid/duet/webrtc_duet.py | aeroaks/PySyft | 88220c38faf3cd72ddc63c73f3c0533695df53c9 | [
"Apache-2.0"
] | null | null | null | """
PySyft Duet (WebRTC)
This class aims to implement the PySyft Duet concept by using WebRTC protocol as a
connection channel in order to allow two different users to establish a direct
connection with high-quality Real-time Communication using private addresses.
The most common example showing how it can be used is... | 42.744186 | 117 | 0.629421 |
fdc2d649f0c13b544e8ed13f7253c160976d3787 | 7,044 | py | Python | lib/Crypto/Hash/HMAC.py | schlenk/pycryptodome | 80d6becc5c203d5663776d6814253fe87d4e044d | [
"Unlicense"
] | null | null | null | lib/Crypto/Hash/HMAC.py | schlenk/pycryptodome | 80d6becc5c203d5663776d6814253fe87d4e044d | [
"Unlicense"
] | null | null | null | lib/Crypto/Hash/HMAC.py | schlenk/pycryptodome | 80d6becc5c203d5663776d6814253fe87d4e044d | [
"Unlicense"
] | null | null | null | #
# HMAC.py - Implements the HMAC algorithm as described by RFC 2104.
#
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitte... | 32.915888 | 88 | 0.610165 |
dd45fee6b89825f14f626530c16b878c507a49f0 | 1,420 | py | Python | coldwallet/coldwallet/sql/ecpt.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | 2 | 2022-03-17T04:50:20.000Z | 2022-03-17T04:51:31.000Z | coldwallet/coldwallet/sql/ecpt.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | coldwallet/coldwallet/sql/ecpt.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING, Optional, Type, Union
import petlib.ec
import sqlalchemy.types as types
from sqlalchemy.engine.interfaces import Dialect
if TYPE_CHECKING:
EcPtEngine = types.TypeDecorator[petlib.ec.EcPt] # pylint: disable=unsubscriptable-object
else:
EcPtEngine = types.TypeDecorator
class... | 35.5 | 104 | 0.684507 |
35ec956fc3c3576996de0bb65a67b9108e163e89 | 4,877 | py | Python | pyvoltha/common/structlog_setup.py | rohan-agra/VOL-2311-pyvoltha | 54ac9266cf4fc27a7583ba08ada779ad107e9cfe | [
"Apache-2.0"
] | null | null | null | pyvoltha/common/structlog_setup.py | rohan-agra/VOL-2311-pyvoltha | 54ac9266cf4fc27a7583ba08ada779ad107e9cfe | [
"Apache-2.0"
] | 1 | 2021-03-25T23:34:15.000Z | 2021-03-25T23:34:15.000Z | pyvoltha/common/structlog_setup.py | rohan-agra/VOL-2311-pyvoltha | 54ac9266cf4fc27a7583ba08ada779ad107e9cfe | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2017 the original author or 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... | 31.464516 | 95 | 0.661062 |
71861257caedd6673f94dc344a0668f1a9da34c5 | 94,700 | py | Python | pybind/slxos/v16r_1_00b/routing_system/router/ospf/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/routing_system/router/ospf/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/routing_system/router/ospf/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 91.763566 | 1,053 | 0.744741 |
34fb498a753a359992e5e806bda307e8757c03a4 | 202 | py | Python | semester-6/Python Practice/fact.py | saranshbht/bsc-codes | 7386c09cc986de9c84947f7dea7db3dc42219a35 | [
"MIT"
] | 3 | 2021-03-22T12:07:14.000Z | 2021-08-30T17:28:23.000Z | semester-6/Python Practice/fact.py | saranshbht/bsc-codes | 7386c09cc986de9c84947f7dea7db3dc42219a35 | [
"MIT"
] | null | null | null | semester-6/Python Practice/fact.py | saranshbht/bsc-codes | 7386c09cc986de9c84947f7dea7db3dc42219a35 | [
"MIT"
] | null | null | null | def fact(n):
if n == 0:
return 1
return n * fact(n - 1)
n = int(input("Enter a number: "))
if n < 0:
print("Enter a non-negative integer")
else:
print(str(n) + "! =", fact(n))
| 18.363636 | 41 | 0.514851 |
446e18afc11e4783dded257f5a5b2adc1f8f8c86 | 6,183 | py | Python | optuna/_deprecated.py | nmasahiro/optuna | 0b334f1d6405ca59e7ed26fddd95b092750fe59b | [
"MIT"
] | null | null | null | optuna/_deprecated.py | nmasahiro/optuna | 0b334f1d6405ca59e7ed26fddd95b092750fe59b | [
"MIT"
] | null | null | null | optuna/_deprecated.py | nmasahiro/optuna | 0b334f1d6405ca59e7ed26fddd95b092750fe59b | [
"MIT"
] | null | null | null | import functools
import inspect
import textwrap
from typing import Any
from typing import Callable
from typing import Optional
import warnings
from packaging import version
from optuna._experimental import _get_docstring_indent
from optuna._experimental import _validate_version
_DEPRECATION_NOTE_TEMPLATE = """
.. ... | 38.403727 | 99 | 0.607634 |
b53265afa1af1e5b90aca90948e5ea22bb7be4f0 | 1,694 | py | Python | scripts/run-diagram.py | BBN-Q/macrospin_gpu | ac0a2fcb1f5a1b435930381c997ae2e25799548e | [
"Apache-2.0"
] | 3 | 2019-06-01T16:50:45.000Z | 2021-03-31T11:34:08.000Z | scripts/run-diagram.py | BBN-Q/macrospin_gpu | ac0a2fcb1f5a1b435930381c997ae2e25799548e | [
"Apache-2.0"
] | null | null | null | scripts/run-diagram.py | BBN-Q/macrospin_gpu | ac0a2fcb1f5a1b435930381c997ae2e25799548e | [
"Apache-2.0"
] | 2 | 2017-01-31T03:22:01.000Z | 2018-05-31T18:46:02.000Z | # From this package
from macrospin_gpu.kernels import Macrospin_2DPhaseDiagram
from macrospin_gpu.simulations import Simulation2D
# Numerical libraries
import numpy as np
# Plotting
import matplotlib.pyplot as plt
if __name__ == '__main__':
min_duration = 0.001
max_duration = 0.5
min_current = 0
max... | 33.215686 | 101 | 0.673554 |
a3df510d6e92b07c6f337df37cb3fbc65da0d4aa | 971 | py | Python | tools/testnet/files/dockerfiles/raiden/run_raiden.py | offerm/raiden | 7a79026af70830bbbed44d73035f9a274e41c6a3 | [
"MIT"
] | 8 | 2019-06-12T14:50:06.000Z | 2022-02-15T16:20:07.000Z | tools/testnet/files/dockerfiles/raiden/run_raiden.py | offerm/raiden | 7a79026af70830bbbed44d73035f9a274e41c6a3 | [
"MIT"
] | 141 | 2019-06-18T13:04:08.000Z | 2021-11-23T22:00:32.000Z | tools/testnet/files/dockerfiles/raiden/run_raiden.py | offerm/raiden | 7a79026af70830bbbed44d73035f9a274e41c6a3 | [
"MIT"
] | 17 | 2019-05-21T18:09:05.000Z | 2020-10-29T13:01:01.000Z | #!/usr/bin/env python
import os
import sys
import click
ETH_RPC_ENDPOINT_ARG = "--eth-rpc-endpoint"
@click.command()
@click.option("--eth-nodes", required=True)
@click.option("--seed", required=True)
@click.option("--raiden-executable", default="raiden", show_default=True)
@click.argument("raiden_args", nargs=-1)
d... | 32.366667 | 99 | 0.718847 |
dc5bf3b5cb7d55d8e291d4f8e505ec802fef5a58 | 8,837 | py | Python | xcp_abcd/workflow/restingstate.py | mb3152/xcp_abcd | 2da0913b18df035085663b98af51989e19775e26 | [
"MIT"
] | null | null | null | xcp_abcd/workflow/restingstate.py | mb3152/xcp_abcd | 2da0913b18df035085663b98af51989e19775e26 | [
"MIT"
] | null | null | null | xcp_abcd/workflow/restingstate.py | mb3152/xcp_abcd | 2da0913b18df035085663b98af51989e19775e26 | [
"MIT"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
post processing the bold/cifti
^^^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: init_post_process_wf
"""
import numpy as np
from nipype.pipeline import engine as pe
from ..interfaces import (computealff, sur... | 30.790941 | 111 | 0.607333 |
bfc7008090c8c50b2b714d0b68f225f643e9b234 | 3,698 | py | Python | sdk/deploymentmanager/azure-mgmt-deploymentmanager/azure/mgmt/deploymentmanager/operations/operations.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/deploymentmanager/azure-mgmt-deploymentmanager/azure/mgmt/deploymentmanager/operations/operations.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/deploymentmanager/azure-mgmt-deploymentmanager/azure/mgmt/deploymentmanager/operations/operations.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 38.926316 | 140 | 0.656842 |
ce7da5416a83039de321e72e1cb954118ca4ff55 | 87 | py | Python | django_demo/models.py | zconnect-iot/zconnect-django-demo | f669bf107b013ab33d327387c870e1d150bde00c | [
"MIT"
] | 2 | 2018-08-19T16:17:23.000Z | 2019-06-11T02:24:28.000Z | django_demo/models.py | zconnect-iot/zconnect-django-demo | f669bf107b013ab33d327387c870e1d150bde00c | [
"MIT"
] | null | null | null | django_demo/models.py | zconnect-iot/zconnect-django-demo | f669bf107b013ab33d327387c870e1d150bde00c | [
"MIT"
] | null | null | null | #pylint: disable=wildcard-import,unused-wildcard-import
from ._models import * # noqa
| 29 | 55 | 0.781609 |
908df5ec1eb135c0066d0dbef4ad591e240d18be | 4,282 | py | Python | expert/ECG/resnet1d/test_physionet_net1d.py | rtu715/NAS-Bench-360 | d075006848c664371855c34082b0a00cda62be67 | [
"MIT"
] | 10 | 2021-06-15T17:48:34.000Z | 2022-02-23T18:34:28.000Z | test_physionet_net1d.py | hsd1503/resnet-1d | 9cccb9f08fde65087272472d0572c2dbe16a8119 | [
"Apache-2.0"
] | 1 | 2021-11-12T15:12:38.000Z | 2021-11-12T19:38:00.000Z | test_physionet_net1d.py | hsd1503/resnet-1d | 9cccb9f08fde65087272472d0572c2dbe16a8119 | [
"Apache-2.0"
] | 1 | 2021-11-15T04:07:17.000Z | 2021-11-15T04:07:17.000Z | """
test on physionet data
Shenda Hong, Nov 2019
"""
import numpy as np
from collections import Counter
from tqdm import tqdm
from matplotlib import pyplot as plt
from sklearn.metrics import classification_report, confusion_matrix
from util import read_data_physionet_2, read_data_physionet_4, preprocess_physionet
fr... | 35.098361 | 140 | 0.640822 |
e6db7ee7e7720c2d066326935c093e12ed3e3cd7 | 5,830 | py | Python | fairseq/optim/adam.py | jgruber99/Sampford_Sampling | 74fef71364252240f199870f6f93422731474ef0 | [
"BSD-3-Clause"
] | 84 | 2019-05-29T18:47:21.000Z | 2021-12-15T19:12:07.000Z | fairseq/optim/adam.py | rycolab/cpsbs | 413c207957e57ac4f44086c9a0c25bef9f60a936 | [
"BSD-3-Clause"
] | 2 | 2020-07-03T12:41:44.000Z | 2020-07-12T10:19:25.000Z | fairseq/optim/adam.py | rycolab/cpsbs | 413c207957e57ac4f44086c9a0c25bef9f60a936 | [
"BSD-3-Clause"
] | 11 | 2020-05-19T15:59:58.000Z | 2021-01-26T16:15:56.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch
import to... | 40.206897 | 116 | 0.587479 |
91a95719089a488be6e23bc09b470e3c69d1df79 | 2,849 | py | Python | pymoo/optimize.py | AIasd/pymoo | 08705ca866367d9fab675c30ffe585c837df9654 | [
"Apache-2.0"
] | 11 | 2018-05-22T17:38:02.000Z | 2022-02-28T03:34:33.000Z | pymoo/optimize.py | AIasd/pymoo | 08705ca866367d9fab675c30ffe585c837df9654 | [
"Apache-2.0"
] | 15 | 2022-01-03T19:36:36.000Z | 2022-03-30T03:57:58.000Z | pymoo/optimize.py | AIasd/pymoo | 08705ca866367d9fab675c30ffe585c837df9654 | [
"Apache-2.0"
] | 3 | 2021-11-22T08:01:47.000Z | 2022-03-11T08:53:58.000Z | import copy
from pymoo.factory import get_termination
from pymoo.model.termination import Termination
from pymoo.util.termination.default import MultiObjectiveDefaultTermination, SingleObjectiveDefaultTermination
def minimize(problem,
algorithm,
termination=None,
**kwargs):
... | 34.743902 | 111 | 0.710425 |
52d0daa6e78b80973ea0395ebecaf080ffbc870b | 3,096 | py | Python | crazycar/algos_torch/encoder.py | nutorbit/crazycar | f265c3f799525774c66529bb39ccc8380c2a3b2e | [
"MIT"
] | 1 | 2020-03-25T10:16:50.000Z | 2020-03-25T10:16:50.000Z | crazycar/algos_torch/encoder.py | nutorbit/CrazyCar | f265c3f799525774c66529bb39ccc8380c2a3b2e | [
"MIT"
] | 3 | 2021-06-08T21:12:21.000Z | 2022-03-12T00:27:30.000Z | crazycar/algos_torch/encoder.py | nutorbit/CrazyCar | f265c3f799525774c66529bb39ccc8380c2a3b2e | [
"MIT"
] | null | null | null | import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from crazycar.agents.constants import SENSOR_SHAPE, CAMERA_HEIGHT, CAMERA_DEPT
class Sensor(nn.Module):
"""
For sensor feature with 256 feature
"""
def __init__(self):
super().__init__()
... | 27.642857 | 79 | 0.572997 |
03b040b924bfd983cdf25fd4f9da6a130b1a5977 | 6,208 | py | Python | src/lib/cur_projected_spend.py | alanyee/costBuddy | 6b27a0d5fa4d3f6bc8f0cf8c4c69756e068050c2 | [
"Apache-2.0"
] | 101 | 2020-02-06T17:58:06.000Z | 2022-02-23T12:04:21.000Z | src/lib/cur_projected_spend.py | alanyee/costBuddy | 6b27a0d5fa4d3f6bc8f0cf8c4c69756e068050c2 | [
"Apache-2.0"
] | 14 | 2020-03-26T22:50:11.000Z | 2022-03-06T06:57:53.000Z | src/lib/cur_projected_spend.py | alanyee/costBuddy | 6b27a0d5fa4d3f6bc8f0cf8c4c69756e068050c2 | [
"Apache-2.0"
] | 18 | 2020-02-11T03:10:49.000Z | 2022-03-15T05:46:33.000Z | """ This module uses AWS Cost and Usage report file to get month to date spend and monthly projected spend.
"""
from multiprocessing import Process
# custom modules
from lib.metric_exporter import PrometheusPushMetric
from lib.util import Utils, LOGGER
class CostUsageReportProjected:
"""
Calculates AWS ac... | 50.471545 | 120 | 0.574581 |
6d0f1f81b9cfda961ea5d432bd627b3ec617706a | 5,291 | py | Python | redsys/response.py | nmdevanddesign/python-redsys | eb025d3b78c55707e38afc383aa9153f5f7d744a | [
"MIT"
] | null | null | null | redsys/response.py | nmdevanddesign/python-redsys | eb025d3b78c55707e38afc383aa9153f5f7d744a | [
"MIT"
] | null | null | null | redsys/response.py | nmdevanddesign/python-redsys | eb025d3b78c55707e38afc383aa9153f5f7d744a | [
"MIT"
] | null | null | null | from decimal import Decimal
from typing import Any, Dict
RESPONSE = "Ds_Response"
DATE = "Ds_Date"
HOUR = "Ds_Hour"
MERCHANT_CODE = "Ds_MerchantCode"
TERMINAL = "Ds_Terminal"
TRANSACTION_TYPE = "Ds_TransactionType"
ORDER = "Ds_Order"
CURRENCY = "Ds_Currency"
AMOUNT = "Ds_Amount"
MERCHANT_DATA = "Ds_MerchantData"
CONSU... | 35.75 | 96 | 0.682291 |
c5752affa0e229d3d1e28c1039877b73c383ec80 | 2,676 | py | Python | build.py | soeren-m/pixelpart-plugin-unity | 622dab395e04bb5c44ab170f6d399b241cd0557e | [
"MIT"
] | 1 | 2022-03-22T09:21:22.000Z | 2022-03-22T09:21:22.000Z | build.py | soeren-m/pixelpart-plugin-unity | 622dab395e04bb5c44ab170f6d399b241cd0557e | [
"MIT"
] | null | null | null | build.py | soeren-m/pixelpart-plugin-unity | 622dab395e04bb5c44ab170f6d399b241cd0557e | [
"MIT"
] | null | null | null | import sys
import subprocess
import os
import shutil
if "platform=windows" in sys.argv:
subprocess.run("scons platform=windows bits=32 target=release", shell = True)
subprocess.run("scons platform=windows bits=64 target=release", shell = True)
elif "platform=linux" in sys.argv:
subprocess.run("scons platf... | 43.868852 | 184 | 0.608371 |
f7de8a2e1603d2fd03e5a692240550baf7da20e7 | 233 | py | Python | ex15.py | ayeethirikyaww/python-exercises | 882cc4b771c7a8edfbddd5126a58130579c399fd | [
"MIT"
] | null | null | null | ex15.py | ayeethirikyaww/python-exercises | 882cc4b771c7a8edfbddd5126a58130579c399fd | [
"MIT"
] | null | null | null | ex15.py | ayeethirikyaww/python-exercises | 882cc4b771c7a8edfbddd5126a58130579c399fd | [
"MIT"
] | 1 | 2018-06-24T15:06:15.000Z | 2018-06-24T15:06:15.000Z | from sys import argv
script ,filename=argv
txt=open(filename)
print(f"Here's your file {filename}:")
print(txt.read())
print("Type the filename again:")
file_again=input("> ")
txt_again=open(file_again)
print(txt_again.read())
| 14.5625 | 38 | 0.729614 |
289c28e27e2a5142b6a802ee08da809fd7514825 | 652 | py | Python | pages/login_page.py | Coriolan8/Finale_project_for_Python | cece2b3b706b9ae51bd1dc77615f174a0b4cc18b | [
"Apache-2.0"
] | null | null | null | pages/login_page.py | Coriolan8/Finale_project_for_Python | cece2b3b706b9ae51bd1dc77615f174a0b4cc18b | [
"Apache-2.0"
] | null | null | null | pages/login_page.py | Coriolan8/Finale_project_for_Python | cece2b3b706b9ae51bd1dc77615f174a0b4cc18b | [
"Apache-2.0"
] | null | null | null | from .base_page import BasePage
from .locators import LoginPageLocators
class LoginPage(BasePage):
def should_be_login_page(self):
self.should_be_login_url()
self.should_be_login_form()
self.should_be_register_form()
def should_be_login_url(self):
assert "login" in self.browse... | 34.315789 | 106 | 0.75 |
c2c8f09721c5f323c2b821934b4fe7bb97dff1f8 | 580 | py | Python | q2_composition/tests/test_plugin_setup.py | ChrisKeefe/q2-composition | 7977c29ee5f6b18d1f79cff0223661a15d3cabd5 | [
"BSD-3-Clause"
] | null | null | null | q2_composition/tests/test_plugin_setup.py | ChrisKeefe/q2-composition | 7977c29ee5f6b18d1f79cff0223661a15d3cabd5 | [
"BSD-3-Clause"
] | 1 | 2018-08-22T01:02:01.000Z | 2018-08-22T01:02:01.000Z | q2_composition/tests/test_plugin_setup.py | ChrisKeefe/q2-composition | 7977c29ee5f6b18d1f79cff0223661a15d3cabd5 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 32.222222 | 78 | 0.568966 |
ed62a6b40f5a3631d4a5ca6bac359c1fa155bb83 | 3,260 | py | Python | todoist/managers/sections.py | jonringer/todoist-python | 3040c42aab5eb09e3e91095ac53b1f3e6b9d7610 | [
"MIT"
] | 617 | 2015-01-07T21:58:21.000Z | 2022-03-21T15:57:50.000Z | todoist/managers/sections.py | CorinnaBuerger/todoist-python | 3598a7e36a857f8b247075266e2e142c92d88852 | [
"MIT"
] | 91 | 2015-02-11T23:04:28.000Z | 2022-02-01T15:44:27.000Z | todoist/managers/sections.py | CorinnaBuerger/todoist-python | 3598a7e36a857f8b247075266e2e142c92d88852 | [
"MIT"
] | 110 | 2015-04-01T11:25:19.000Z | 2022-03-24T19:19:52.000Z | # -*- coding: utf-8 -*-
from .. import models
from .generic import AllMixin, GetByIdMixin, Manager, SyncMixin
class SectionsManager(Manager, AllMixin, GetByIdMixin, SyncMixin):
state_name = "sections"
object_type = "section"
def add(self, name, project_id, **kwargs):
"""
Creates a local ... | 28.596491 | 80 | 0.512577 |
d05399ed0162f3d27faa40486153554b21d90648 | 8,336 | py | Python | CNNectome/utils/convert_unaligned.py | davidackerman/CNNectome | 2815f96f40f5df66cc0a17e33db1353b1d0b6351 | [
"BSD-2-Clause"
] | 4 | 2019-06-21T18:06:22.000Z | 2021-11-29T08:28:46.000Z | CNNectome/utils/convert_unaligned.py | GenevieveBuckley/CNNectome | bde8528ed5adc0a4aefca3b19ecc4c2144f2cbcc | [
"BSD-2-Clause"
] | 4 | 2018-12-18T19:31:04.000Z | 2022-01-10T16:06:45.000Z | CNNectome/utils/convert_unaligned.py | GenevieveBuckley/CNNectome | bde8528ed5adc0a4aefca3b19ecc4c2144f2cbcc | [
"BSD-2-Clause"
] | 9 | 2018-03-22T18:17:57.000Z | 2022-03-24T01:17:21.000Z | import h5py
import sys
import numpy as np
import logging
def pad(labels_in, shape, raw_offset=(0, 0, 0)):
logging.info("padding...")
off_vox = (
np.array((labels_in.attrs["offset"]) - np.array(raw_offset))
/ np.array(labels_in.attrs["resolution"])
).astype(np.int)
logging.debug(
... | 35.776824 | 95 | 0.644314 |
f121e56f107a67bd04a9a963829343b06ec5dd94 | 2,480 | py | Python | chronos/docker/chronos/modules/postgresql/main.py | guadaltech/kubernetes-containers-tools | 5d4d9da6bf95162404b927cf23178d86dd99dd85 | [
"Apache-2.0"
] | 6 | 2019-07-16T22:10:30.000Z | 2021-12-27T09:19:49.000Z | chronos/docker/chronos/modules/postgresql/main.py | guadaltech/kubernetes-containers-tools | 5d4d9da6bf95162404b927cf23178d86dd99dd85 | [
"Apache-2.0"
] | 2 | 2021-04-30T21:26:44.000Z | 2021-06-02T02:52:11.000Z | chronos/docker/chronos/modules/postgresql/main.py | guadaltech/kubernetes-containers-tools | 5d4d9da6bf95162404b927cf23178d86dd99dd85 | [
"Apache-2.0"
] | 5 | 2019-12-05T17:50:44.000Z | 2020-12-21T13:43:59.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# By: Juan Manuel Torres (Tedezed)
# Source: https://github.com/Tedezed
# Mail: juanmanuel.torres@aventurabinaria.es
import psycopg2, subprocess
from os import path, getlogin, system, listdir, getuid, environ
class chronos_module():
def __init__(self, module_control):
... | 42.758621 | 112 | 0.518548 |
e63d1cbc64b0ae33d6c4af218034a6ec3d9a0094 | 442,779 | py | Python | ironic/tests/unit/conductor/test_manager.py | Rachit7194/ironic | a17b20d12554133931f44c78c415f2ea0f61ac74 | [
"Apache-2.0"
] | null | null | null | ironic/tests/unit/conductor/test_manager.py | Rachit7194/ironic | a17b20d12554133931f44c78c415f2ea0f61ac74 | [
"Apache-2.0"
] | null | null | null | ironic/tests/unit/conductor/test_manager.py | Rachit7194/ironic | a17b20d12554133931f44c78c415f2ea0f61ac74 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 International Business Machines 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
# ... | 49.334708 | 79 | 0.635175 |
6ec9eee55d11aee794839ff151ebd7bd75415e8e | 4,843 | py | Python | official/cv/Deepsort/show_results.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/Deepsort/show_results.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/Deepsort/show_results.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2022 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... | 38.436508 | 80 | 0.664258 |
816b0a9e81ff401066ff8249cc7dc861a1feabb9 | 2,536 | py | Python | pandaloginvestigator/core/utils/string_utils.py | ClonedOne/pandalog_investigator | 1734114f54723d29d80704cc00c1987957228ea3 | [
"MIT"
] | 1 | 2016-12-15T01:48:27.000Z | 2016-12-15T01:48:27.000Z | pandaloginvestigator/core/utils/string_utils.py | ClonedOne/pandalog_investigator | 1734114f54723d29d80704cc00c1987957228ea3 | [
"MIT"
] | null | null | null | pandaloginvestigator/core/utils/string_utils.py | ClonedOne/pandalog_investigator | 1734114f54723d29d80704cc00c1987957228ea3 | [
"MIT"
] | null | null | null | """
This module contains fixed string parameters used by different modules inside the application.
"""
# File extensions
ext_investigator_clue = '_ss.txt'
ext_pandalog_file = '.plog'
# Paths relevant to the application.
dir_unpacked_path = 'dir_unpacked'
dir_translated_path = 'dir_translated'
dir_results_path = 'di... | 30.554217 | 94 | 0.783517 |
75e04227b0a0378da4fd0588c780e5895ad14c00 | 1,743 | py | Python | steamtags/tests/test_steamtags.py | woctezuma/match-steam-tags | f14346d1e3b675f8715abe2fdbd0505d81bec6f2 | [
"MIT"
] | 1 | 2019-04-06T11:01:02.000Z | 2019-04-06T11:01:02.000Z | steamtags/tests/test_steamtags.py | woctezuma/match-steam-tags | f14346d1e3b675f8715abe2fdbd0505d81bec6f2 | [
"MIT"
] | 1 | 2019-04-06T12:23:00.000Z | 2019-04-06T12:27:24.000Z | steamtags/tests/test_steamtags.py | woctezuma/match-steam-tags | f14346d1e3b675f8715abe2fdbd0505d81bec6f2 | [
"MIT"
] | null | null | null | import unittest
import steamtags
class TestSteamTagsMethods(unittest.TestCase):
def test_download_top100in2weeks(self):
data_source = "top100in2weeks"
genres_dict, tags_dict = steamtags.download(data_source)
sentence = "[request = {}] #genres = {} & #tags = {}"
print(sentence.for... | 31.690909 | 77 | 0.649455 |
231faa8c684d64ca09f1704bde478b7737934f8d | 1,906 | py | Python | imiss-django-master/imiss/music/views.py | WiitterSimithYU/-scollview-imissMusic | 146757323aa5a9ba7b8d8d5b4064ab66f0241bef | [
"MIT"
] | 121 | 2018-10-08T08:32:53.000Z | 2021-12-06T06:47:52.000Z | imiss-django-master/imiss/music/views.py | WiitterSimithYU/-scollview-imissMusic | 146757323aa5a9ba7b8d8d5b4064ab66f0241bef | [
"MIT"
] | null | null | null | imiss-django-master/imiss/music/views.py | WiitterSimithYU/-scollview-imissMusic | 146757323aa5a9ba7b8d8d5b4064ab66f0241bef | [
"MIT"
] | 21 | 2018-10-09T04:18:15.000Z | 2021-12-18T08:53:07.000Z | from django.shortcuts import render
from imiss.category.model_tool import *
from imiss.category.sql_tool import *
from .models import *
"""
返回受欢迎歌曲
"""
def get_popular_request(request):
# 歌曲
SQL = "SELECT * FROM Song"
RESULT = Song.objects.raw(SQL)
datas = []
for n in RESULT:
data = n.__di... | 19.06 | 74 | 0.622246 |
59ce35cc5269b42624efdc6a75c81258eb039447 | 1,921 | py | Python | mains/main_train_rf.py | hantoine/accident-prediction-montreal | 4c22c0f5a7dca216f027ef09e6547a3c0232206a | [
"MIT"
] | 1 | 2020-05-18T05:04:55.000Z | 2020-05-18T05:04:55.000Z | mains/main_train_rf.py | hantoine/accident-prediction-montreal | 4c22c0f5a7dca216f027ef09e6547a3c0232206a | [
"MIT"
] | null | null | null | mains/main_train_rf.py | hantoine/accident-prediction-montreal | 4c22c0f5a7dca216f027ef09e6547a3c0232206a | [
"MIT"
] | 1 | 2021-06-18T14:29:32.000Z | 2021-06-18T14:29:32.000Z | #!/usr/bin/env python
from from accident_prediction_montreal.preprocess import get_negative_samples, get_positive_samplespreprocess import get_negative_samples, get_positive_samples
from from accident_prediction_montreal.utils import init_sparkutils import init_spark
from from accident_prediction_montreal.preprocess im... | 44.674419 | 159 | 0.717855 |
b393fe50891612f3375fadfa011e2b0ed27fa037 | 20,534 | py | Python | ushanti/ushanti/report/gstr_3b_report.py | finbyz/ushanti | f01d1734e7b5755bada82ad2789c7245294cc1a9 | [
"MIT"
] | 1 | 2021-09-24T05:39:33.000Z | 2021-09-24T05:39:33.000Z | ushanti/ushanti/report/gstr_3b_report.py | finbyz/ushanti | f01d1734e7b5755bada82ad2789c7245294cc1a9 | [
"MIT"
] | null | null | null | ushanti/ushanti/report/gstr_3b_report.py | finbyz/ushanti | f01d1734e7b5755bada82ad2789c7245294cc1a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import json
import os
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr, flt... | 36.087873 | 115 | 0.713159 |
fb967fa63a9a39b10b0ce53d9e35bbcc41bd60c1 | 111 | py | Python | polls/StatisticsManager/StatisticsManager.py | kuPacemaker/app-server | 272079cb64600b4c59aa79de42fd6b939761d782 | [
"MIT"
] | null | null | null | polls/StatisticsManager/StatisticsManager.py | kuPacemaker/app-server | 272079cb64600b4c59aa79de42fd6b939761d782 | [
"MIT"
] | null | null | null | polls/StatisticsManager/StatisticsManager.py | kuPacemaker/app-server | 272079cb64600b4c59aa79de42fd6b939761d782 | [
"MIT"
] | 1 | 2020-10-23T12:19:16.000Z | 2020-10-23T12:19:16.000Z |
class statisticsManager():
def inquireIntoChannelStatistics():
def inquireIntoPersonalStatistics():
| 15.857143 | 40 | 0.765766 |
f7aed230c62ea6fd02bee77fccc3247c69025276 | 945 | py | Python | hitb_client/tests/test_teams.py | ENOFLAG/HITB-client | 61766e466f32adb05dfdca4c5ec76bdc9604aeac | [
"Unlicense"
] | 1 | 2021-11-12T10:49:47.000Z | 2021-11-12T10:49:47.000Z | hitb_client/tests/test_teams.py | ENOFLAG/HITB-client | 61766e466f32adb05dfdca4c5ec76bdc9604aeac | [
"Unlicense"
] | null | null | null | hitb_client/tests/test_teams.py | ENOFLAG/HITB-client | 61766e466f32adb05dfdca4c5ec76bdc9604aeac | [
"Unlicense"
] | null | null | null | import unittest
import requests_mock
from .. import client as hitbctf_client
TEST_DATA_TEAMS = {
"1": {
"id": 1,
"name": "Hackerdom",
"network": "10.60.1.0/24",
"logo": "https://ctf.hitb.org/logos/hackerdom.png",
"country": "RU"
},
}
def mock(f):
def wrapped_f(*... | 23.04878 | 71 | 0.478307 |
3edf98ab63ffc1c31cb2472a05360897ad43eee1 | 330 | py | Python | src/applications/cli/env/Production.py | kolesa-team/python-ms-skeleton | b0ac658a0539ce18bb4384f96dc7f7473e701111 | [
"MIT"
] | null | null | null | src/applications/cli/env/Production.py | kolesa-team/python-ms-skeleton | b0ac658a0539ce18bb4384f96dc7f7473e701111 | [
"MIT"
] | 1 | 2021-06-01T22:48:10.000Z | 2021-06-01T22:48:10.000Z | src/applications/cli/env/Production.py | kolesa-team/python-ms-skeleton | b0ac658a0539ce18bb4384f96dc7f7473e701111 | [
"MIT"
] | 1 | 2018-10-12T11:40:55.000Z | 2018-10-12T11:40:55.000Z | from src.applications.env.Production import Production as RootProduction
class Production(RootProduction):
def __init__(self):
self.setParent(RootProduction())
self.setConfig(
self.mergeConfig(
self.getParent().getConfig(),
{
}
... | 23.571429 | 72 | 0.560606 |
1d73298beae5e2b450d3da8d0c0046a7c42b4087 | 19,567 | py | Python | ucsmsdk/mometa/vnic/VnicEther.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 78 | 2015-11-30T14:10:05.000Z | 2022-02-13T00:29:08.000Z | ucsmsdk/mometa/vnic/VnicEther.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 113 | 2015-11-20T09:42:46.000Z | 2022-03-16T16:53:29.000Z | ucsmsdk/mometa/vnic/VnicEther.py | Kego/ucsmsdk | 244f283a5c295cf746110bb96686d079b19927ce | [
"Apache-2.0"
] | 86 | 2015-12-12T08:22:18.000Z | 2022-01-23T03:56:34.000Z | """This module contains the general information for VnicEther ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class VnicEtherConsts:
ADDR_DERIVED = "derived"
ADMIN_HOST_PORT_1 = "1"
ADMIN_HOST_PORT_2 = "2"
ADMIN... | 80.522634 | 3,582 | 0.702765 |
a21082ba01826b0c03d04e54c179115b0b7475f2 | 10,144 | py | Python | salt/modules/pf.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | 5 | 2018-05-01T20:51:14.000Z | 2021-11-09T05:43:00.000Z | salt/modules/pf.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | 4 | 2019-02-08T17:53:38.000Z | 2019-06-06T16:17:27.000Z | salt/modules/pf.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | 7 | 2017-09-29T18:49:53.000Z | 2021-11-09T05:42:49.000Z | # -*- coding: utf-8 -*-
'''
Control the OpenBSD packet filter (PF).
:codeauthor: Jasper Lievisse Adriaanse <j@jasper.la>
.. versionadded:: 2019.2.0
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import logging
import re
# Import salt libs
import salt.utils.path
fr... | 28.414566 | 98 | 0.554515 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.