hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | 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 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | 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 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7cbedb5f0ec0d72afb67e9ab2c10e59ba20ddebb | 4,804 | py | Python | official/cv/vit/src/cross_entropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/vit/src/cross_entropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/vit/src/cross_entropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 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.432 | 106 | 0.640924 |
86904f1de669bea33ec4688c68fc040019e1fe4b | 379 | py | Python | Contests/DMOPC '17 Contest 4 P0 - Catch.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/DMOPC '17 Contest 4 P0 - Catch.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/DMOPC '17 Contest 4 P0 - Catch.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | alice = input().split(" ")
bob = input().split(" ")
charlie = input().split(" ")
alice = [int(i) for i in alice]
bob = [int(i) for i in bob]
charlie = [int(i) for i in charlie]
dis = [(((bob[0] - alice[0])**2) + ((bob[1] - alice[1])**2)), (((charlie[0] - bob[0])**2) + ((charlie[1] - bob[1])**2)), (((charlie[0] - alic... | 34.454545 | 183 | 0.519789 |
92e97b1bfcf9e2bcec13f013be77d784f87db75d | 4,229 | py | Python | oneflow/python/framework/placement_context.py | ncnnnnn/oneflow | f6e81f65eed1d87c3125e7a78247cfaa72220020 | [
"Apache-2.0"
] | 1 | 2020-12-24T09:26:36.000Z | 2020-12-24T09:26:36.000Z | oneflow/python/framework/placement_context.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/framework/placement_context.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 30.644928 | 83 | 0.720501 |
b9bae2045df3f0db168c032fd92f802cf5ac20a0 | 368 | py | Python | Python/Buch_ATBS/Teil_1/Kapitel_06_Stringbearbeitung/13_ausgabe_als_tabelle.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_1/Kapitel_06_Stringbearbeitung/13_ausgabe_als_tabelle.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_1/Kapitel_06_Stringbearbeitung/13_ausgabe_als_tabelle.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | liste=[ 'Rasenmäher', 'Spachtelmasse', 'Zwieback',
'Hundehalsband', 'Teeblätter', 'Schrauben',
'Rollator', 'Ersatzreifen', 'Discman' ]
maxl, string = 0, ''
for wort in liste:
if maxl < len(wort):
maxl=len(wort)
maxl+=3
for wort in liste:
string+=wort.rjust(maxl)
if len(string) == ... | 21.647059 | 51 | 0.584239 |
b9c2e1587fd14e8934493e287dcfa778513e1557 | 6,984 | py | Python | Utils/py/MotionAnalysis/plot_standard_vs_simpleStiffJointControl.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/MotionAnalysis/plot_standard_vs_simpleStiffJointControl.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/MotionAnalysis/plot_standard_vs_simpleStiffJointControl.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import BehaviorParser
from matplotlib import pyplot
import numpy as np
JointID = {
"HeadPitch": 0,
"HeadYaw": 1,
"RShoulderRoll": 2,
"LShoulderRoll": 3,
"RShoulderPitch": 4,
"LShoulderPitch": 5,
"RElbowRoll": 6,
"LElbowRoll": 7,
"RElbowYaw": 8,
"LElbowYaw": 9,
"RHipYawPitch": 10,
"LHipYawPitch... | 30.902655 | 139 | 0.607102 |
6a21259bd99eaba98c39dcd7d52c719afa44532c | 600 | py | Python | Algorithms/Implementation/manasa_and_stones.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/manasa_and_stones.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/manasa_and_stones.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
for _ in range(int(input())):
n = int(input())
a = int(input())
b = int(input())
if a > b:
a, b = b, a
result = set([a * (n - i - 1) + b * i for i in range(n)])
res = sorted(list(result))
print(' '.join(map(str, res)))
'''
# slow
for _ in range(int(input()... | 20.689655 | 61 | 0.471667 |
dbe430b25f26fa4edc1c6cc0f783b0505ce9a344 | 671 | py | Python | elements/python/13/18/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/13/18/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/13/18/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | class Trie(object):
def __init__(self):
self.children = {}
def add(self, s):
if len(s) == 0:
return
self.children.setdefault(s[0], Trie()).add(s[1:])
def unique_prefix(self, s):
if len(s) == 0:
return ''
sub = self.children.get(s[0])
... | 18.135135 | 66 | 0.502235 |
0ec91665d2e937176a732b560c0e88bb98b3ef06 | 762 | py | Python | nz_django/day8/djang_drf_demo/front/migrations/0004_user.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day8/djang_drf_demo/front/migrations/0004_user.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day8/djang_drf_demo/front/migrations/0004_user.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # Generated by Django 2.0 on 2020-02-28 08:50
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('front', '0003_movie'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
... | 33.130435 | 152 | 0.632546 |
16a18d6a3c16f891e306160a80d9016f4a1799b7 | 767 | py | Python | tools/pythonpkg/tests/fast/test_parameter_list.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/test_parameter_list.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/test_parameter_list.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
import pandas as pd
import pytest
class TestParameterList(object):
def test_bool(self, duckdb_cursor):
conn = duckdb.connect()
conn.execute("create table bool_table (a bool)")
conn.execute("insert into bool_table values (TRUE)")
res = conn.execute("select count(*) fro... | 38.35 | 84 | 0.64146 |
bcbcec3cbf76e60fd9267c5fbdf71c46eb6bd2d9 | 1,345 | py | Python | scripts/sdk/common/files.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | scripts/sdk/common/files.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/sdk/common/files.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python2.7
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import errno
import os
import shutil
def make_dir(file_path):
'''Creates the directory hierarchy for the given file and returns... | 29.888889 | 76 | 0.630483 |
4c16990fe2c03e5ccd16d8db69f107f9f5e2a819 | 6,337 | py | Python | classification_snips/classifier/trainer.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | classification_snips/classifier/trainer.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | classification_snips/classifier/trainer.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | import os
import shutil
import zipfile
from snips_nlu import SnipsNLUEngine, load_resources
from pathlib import Path
ENGINE_PATH_OLD = Path(__file__).parents[1] / "engine/nlu_old"
ENGINE_PATH_NEW = Path(__file__).parents[1] / "engine/nlu_new"
ENGINE_PATH_ZIP = Path(__file__).parents[1] / "engine"
NEW_ENGINE_NAME_Z... | 40.621795 | 99 | 0.641944 |
4c60f7274b84956d3605e3ce9e166816da252f91 | 2,622 | py | Python | backend/app/core/polygon_extractor.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/core/polygon_extractor.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/core/polygon_extractor.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from typing import Union
import cv2.cv2
import imutils
import numpy as np
from imutils import contours
from app.schemas.extractor import GrayGroup, ExtractionResult, ImageDimension
from app.schemas.polygon_data import Point
from app.utils.logger import logger
from app.utils.timer import Timer
def convert_image_to_a... | 38 | 87 | 0.677727 |
d5cac2cb4eaea81644c8b2afe462a4ff57b6d2f4 | 16,684 | py | Python | src/pfun/logging.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 126 | 2019-09-16T15:28:20.000Z | 2022-03-20T10:57:53.000Z | src/pfun/logging.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 54 | 2019-09-30T08:44:01.000Z | 2022-03-20T11:10:00.000Z | src/pfun/logging.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 11 | 2020-01-02T08:32:46.000Z | 2022-03-20T11:10:24.000Z | from __future__ import annotations
import logging
from types import TracebackType
from typing import Optional, Tuple, Type, Union
from typing_extensions import Protocol
from .effect import Depends, Success, add_repr, depend, from_io_bound_callable
from .either import Right
from .functions import curry
from .immutabl... | 28.182432 | 79 | 0.575042 |
91121efb0eabfb924072b023c5b5b85d50f97eb2 | 4,811 | py | Python | bin/hash_all.py | Submitty/Lichen | a45457ed5e46ef12216bdf6c7051209bc00c4dff | [
"BSD-3-Clause"
] | 5 | 2019-03-04T12:59:53.000Z | 2022-03-25T03:07:00.000Z | bin/hash_all.py | Submitty/Lichen | a45457ed5e46ef12216bdf6c7051209bc00c4dff | [
"BSD-3-Clause"
] | 12 | 2018-06-05T16:35:31.000Z | 2022-02-14T21:43:40.000Z | bin/hash_all.py | Submitty/Lichen | a45457ed5e46ef12216bdf6c7051209bc00c4dff | [
"BSD-3-Clause"
] | 2 | 2018-06-05T18:00:09.000Z | 2019-03-04T12:59:57.000Z | #!/usr/bin/env python3
"""
Walks the submission directory and creates a parallel directory of
the tokenized files.
"""
import argparse
import os
import json
import time
import hashlib
from pathlib import Path
def parse_args():
parser = argparse.ArgumentParser(description="")
parser.add_argument("basepath")
... | 39.760331 | 125 | 0.621492 |
913334db9705c7e42193f14563c878c3e2c219ca | 2,443 | py | Python | larq_compute_engine/tf/python/ops/bconv2d_ops_test.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | larq_compute_engine/tf/python/ops/bconv2d_ops_test.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | larq_compute_engine/tf/python/ops/bconv2d_ops_test.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | """Tests for compute engine ops."""
import numpy as np
import tensorflow as tf
import sys
import pytest
try:
from larq_compute_engine.tf.python.ops.compute_engine_ops import (
bconv2d8,
bconv2d32,
bconv2d64,
)
from larq_compute_engine.tf.python.utils import eval_op
except ImportErr... | 28.741176 | 85 | 0.636103 |
fc4506da04d04230d280f1a9d508a0c3ee0e2445 | 2,180 | py | Python | official/cv/faster_rcnn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/faster_rcnn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/faster_rcnn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020-2021 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 agre... | 38.928571 | 108 | 0.737615 |
fc985ec77da2fa14c5674d33d77b4fae6336591e | 1,043 | py | Python | Pi.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | Pi.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | Pi.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | import turtle as tu
import math
lines = 10
with open("1miopi.txt", "r") as f:
pi = f.read()
print(pi[0:10]) # gib mir nur die ersten 10 Zeichen wieder der gegebenen Liste
print(pi[-10:]) #du sollst anfangen 10 zeichen vor Ende und das ausdrucken
tu.mode("logo")
tu.tracer(False)
tu.screensize(5000,5000,"blac... | 21.285714 | 102 | 0.5628 |
b9038def1ac731af73ca4a35eeeeaea6bad172b8 | 782 | py | Python | api/clean/sequence_label.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/clean/sequence_label.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/clean/sequence_label.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | 1 | 2022-02-11T04:44:37.000Z | 2022-02-11T04:44:37.000Z | # !/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2021/7/19 下午6:06
# @Author : Latent
# @Email : latentsky@gmail.com
# @File : sequence_label.py
# @Software: PyCharm
# @class : 类别
"""
字段说明:
1.nick_id ---->数据库自增
2.nick_name
3.nick
4.brand
5.company_name
6.platform
"""
class Sequence_Label(object):
# 产品分类标签
... | 19.55 | 49 | 0.534527 |
53c125ec58877de84ccd523b4c7e086cc9c31f09 | 12,482 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #! /usr/bin/env python
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
from django.core.urlresolvers import reverse
from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import Project... | 37.14881 | 83 | 0.609518 |
4ad57bcff247b2175c4a9605d454c5d04cec4987 | 237 | py | Python | Chapter2_Python/18-fStrings.py | olebause/TensorFlow2 | 70fcb7c85c7ead0dc4f88ffa35be5f2eb93e618e | [
"MIT"
] | 2 | 2021-02-13T19:18:00.000Z | 2021-11-10T09:54:49.000Z | Chapter4_Intermediate/fStrings.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | Chapter4_Intermediate/fStrings.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | my_value1 = 27
my_value2 = "Jan"
print("Age: %s Name: %s" % (my_value1, my_value2))
print("Age: ", my_value1, " Name: ", my_value2)
print("Age: {} Name: {}".format(my_value1, my_value2))
print(f"Age: {my_value1} Name: {my_value2}")
| 19.75 | 54 | 0.64135 |
530f1d34a115833a135a618c8ba16222854972c7 | 256 | py | Python | chord_rec/chord_predition/models/Baseline.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/chord_predition/models/Baseline.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/chord_predition/models/Baseline.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
class Baseline(nn.Module):
def __init__(self, hidden_dim, output_dim):
pass
def forward(self, input):
output = None
return output
| 18.285714 | 47 | 0.652344 |
4a7a983c02ac33dab928faef576681adb1ce2d81 | 1,445 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/ex3/ex3_tests.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/ex3/ex3_tests.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/ex3/ex3_tests.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import unittest
from ex3 import intersection
class TestEx2(unittest.TestCase):
def test_small(self):
result = intersection([
[1,2,3],
[1,4,5],
[1,6,7]
])
self.assertTrue(result == [1])
result = intersection([
[1],
... | 25.803571 | 53 | 0.449135 |
43a620ac4b70cf5373a9bd95a9465b80d5bc1d63 | 18,723 | py | Python | Material/stroop-selfmade/stroopselfmade_lastrun.py | sebastiansauer/fopra | a35f002deb252039cbfcdab940781b1095289039 | [
"MIT"
] | 1 | 2022-02-03T09:45:18.000Z | 2022-02-03T09:45:18.000Z | Material/stroop-selfmade/stroopselfmade_lastrun.py | sebastiansauer/fopra | a35f002deb252039cbfcdab940781b1095289039 | [
"MIT"
] | null | null | null | Material/stroop-selfmade/stroopselfmade_lastrun.py | sebastiansauer/fopra | a35f002deb252039cbfcdab940781b1095289039 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2022.1.3),
on Mon Apr 25 19:30:40 2022
If you publish work using this script the most relevant publication is:
Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindel... | 42.649203 | 111 | 0.688031 |
60c4019f95be55b501b72f90fe9e678f7551289e | 155 | py | Python | Calculation/interaction_01.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | 2 | 2020-11-25T07:53:48.000Z | 2021-09-19T14:19:51.000Z | Calculation/interaction_01.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | null | null | null | Calculation/interaction_01.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | null | null | null |
class Interaction(object):
def __init__(self, Sample):
self.adsorption = Sample.a
self.ads_max = Sample.max_adsorption
| 17.222222 | 44 | 0.612903 |
717725c8bb3663f4e0e35bcebd34f0bdb069b2d6 | 618 | py | Python | exercises/de/solution_02_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/solution_02_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/solution_02_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.de import German
nlp = German()
# Importiere die Klassen Doc und Span
from spacy.tokens import Doc, Span
words = ["Ich", "mag", "David", "Bowie"]
spaces = [True, True, True, False]
# Erstelle ein Doc mit den Wörtern und Leerzeichen
doc = Doc(nlp.vocab, words=words, spaces=spaces)
print(doc.text)
# ... | 25.75 | 71 | 0.713592 |
71a5679f213b96d85513ff295275a7924d8feac0 | 242 | py | Python | leetcode/191-Number-of-1-Bits/Numberof1Bits_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/191-Number-of-1-Bits/Numberof1Bits_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/191-Number-of-1-Bits/Numberof1Bits_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param n, an integer
# @return an integer
def hammingWeight(self, n):
a = bin(n)
b = a[2:]
c = b.split('0')
sm = 0
for d in c:
sm += len(d)
return sm
| 17.285714 | 31 | 0.429752 |
e0d229c6f2cc8f4a879638c44d6457004855fd9d | 3,597 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/ocslog.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/ocslog.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/ocslog.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
import tra... | 25.153846 | 80 | 0.580206 |
1cd714b7375620a7f374722c24e9c68dcb1628f8 | 18,271 | py | Python | src/Sephrasto/Hilfsmethoden.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/Hilfsmethoden.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/Hilfsmethoden.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 18 16:35:08 2017
@author: Aeolitus
"""
import Definitionen
import logging
import unicodedata
import os
import re
from Wolke import Wolke
import Objekte
class VoraussetzungException(Exception):
pass
class WaffeneigenschaftException(Exception):
pass
class Hilfsme... | 45.450249 | 240 | 0.511028 |
40ebc45153db4a5f90cceac60adf47e512daa724 | 1,148 | py | Python | listings/chapter05/trees.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter05/trees.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter05/trees.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | from data_structures import Stack, Queue
class Node:
def __init__(self, value, parent = None):
self.value = value
self.parent = parent
self.successors = []
if parent:
parent.add_successor(self)
def add_successor(self, successor):
self.successors.append(succe... | 28 | 63 | 0.651568 |
9050c1278f8e954b4840e7448198769b27ddb572 | 921 | py | Python | src/utils/db/init.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/utils/db/init.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/utils/db/init.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | from ruamel import yaml
from data.transform import lon_to_index, lat_to_index
from settings import resources
from utils.db.dao import StationDao
from utils.db.table import Station, drop_db, init_db
def init_Station():
drop_db()
init_db()
dao = StationDao()
station_list = []
with open(resources.jo... | 29.709677 | 108 | 0.662324 |
90bec769342b21fb360c3083061600a65e66608f | 271 | py | Python | module_5/Mongodb_test.py | RandyGoodnight/TEST | 0a24db0d4914b046f768543203c761dd0fb02721 | [
"MIT"
] | null | null | null | module_5/Mongodb_test.py | RandyGoodnight/TEST | 0a24db0d4914b046f768543203c761dd0fb02721 | [
"MIT"
] | null | null | null | module_5/Mongodb_test.py | RandyGoodnight/TEST | 0a24db0d4914b046f768543203c761dd0fb02721 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
url = "mongodb+srv://admin:admin@cluster0.gg85n.mongodb.net/myFirstDatabase?retryWrites=true&w=majority"
client = MongoClient(url)
db = client.pytech
print(db.list_collection_names())
print( "end of program, press any key to exit..")
| 22.583333 | 104 | 0.771218 |
293de2beefc736ea1312693da47e831c1997079a | 1,717 | py | Python | basic/37-charm.fi/scripts/upgrade_strategy.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 987 | 2021-12-19T09:57:18.000Z | 2022-03-31T15:39:45.000Z | basic/37-charm.fi/scripts/upgrade_strategy.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 73 | 2021-07-04T03:53:57.000Z | 2021-12-18T06:17:13.000Z | basic/37-charm.fi/scripts/upgrade_strategy.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 263 | 2021-06-28T15:26:56.000Z | 2021-12-19T08:14:37.000Z | from brownie import (
accounts,
project,
AlphaVault,
PassiveStrategy,
)
from brownie.network.gas.strategies import GasNowScalingStrategy
VAULT_ADDRESS = "0x9bf7b46c7ad5ab62034e9349ab912c0345164322"
BASE_THRESHOLD = 3600
LIMIT_THRESHOLD = 1200
PERIOD = 41400 # ~12 hours
MIN_TICK_MOVE = 0
MAX_TWAP_DEV... | 30.660714 | 86 | 0.701223 |
46535e6e66e0832b1c27e855dcc9dca125e5be2d | 668 | py | Python | Packs/ThreatIntelReports/Scripts/PublishThreatIntelReport/PublishThreatIntelReport.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ThreatIntelReports/Scripts/PublishThreatIntelReport/PublishThreatIntelReport.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ThreatIntelReports/Scripts/PublishThreatIntelReport/PublishThreatIntelReport.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from datetime import datetime
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def publish():
now_utc = datetime.now(timezone.utc)
object_id = demisto.getArg('object.id')
roles = execute_command('getRoles', {})
execute_command(
'setThreatIntelReport'... | 23.034483 | 55 | 0.591317 |
314d27e41689603cadfb539979b0f4609b21de1d | 4,254 | py | Python | model.py | ottermegazord/nmt-graph | 7e2f73cd617fe262d984eb05f2157f7aebac8982 | [
"MIT"
] | null | null | null | model.py | ottermegazord/nmt-graph | 7e2f73cd617fe262d984eb05f2157f7aebac8982 | [
"MIT"
] | null | null | null | model.py | ottermegazord/nmt-graph | 7e2f73cd617fe262d984eb05f2157f7aebac8982 | [
"MIT"
] | null | null | null | """
***************************************************************************************
*
* Yara English to Cypher Neural Machine Translation
*
*
* Name : Idaly Ali
*
* Designation : Research Scientist
*
* Description : Seq2Seq: Neural Machine Translation with Attention for translation
* ... | 34.032 | 87 | 0.586507 |
6f3043968cfae00f93d451a3187b2d62dcdcc155 | 549 | py | Python | Python/Sonstige_Uebungen/concat.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/concat.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/concat.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from pyperclip import copy as copy
file_reader = open(r"C:\Users\rbald\OneDrive\Dokumente\Kursjahr 1\114 Kodierungs- Kompressions und Verschlüsselungsverfahren\Zus. Dokumente\02_Dateien\4.6\Beispiel4.6.1.rtf", "rb")
file_content = file_reader.read()
file_writer = open(r"... | 45.75 | 192 | 0.781421 |
48af77a00401e171e1b4911290e7bf370681d269 | 3,042 | py | Python | src/importscripts/main.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 1 | 2021-12-20T20:15:26.000Z | 2021-12-20T20:15:26.000Z | src/importscripts/main.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | null | null | null | src/importscripts/main.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os, django, sys
sys.path.append('..')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bin.settings")
django.setup()
from aemter.models import Organisationseinheit, Funktion, Unterbereich
import csv
def importAemter(file):
"""
Diese Funktion importiert Organisationseinheiten, ... | 33.065217 | 115 | 0.635766 |
82c6a4bd8850c43fa35f9273db8948772723d9f7 | 62 | py | Python | year_3/databases_sem2/lab2/wikimanager/__init__.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/databases_sem2/lab2/wikimanager/__init__.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/databases_sem2/lab2/wikimanager/__init__.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from .category import analyze_category
from .page import Page
| 20.666667 | 38 | 0.83871 |
81535cb77d41231a108bde8b040d0e12e9cc1d5d | 743 | py | Python | tests/test_abrechnung.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null | tests/test_abrechnung.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null | tests/test_abrechnung.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null | # pylint: disable=no-self-use
from decimal import Decimal
from pykasso.abrechnung import Abrechnung, AbrechnungsPosition
class TestAbrechnungsSaldo:
def test_betrag_wenn_keine_positionen_vorhanden(self):
abrechnung = Abrechnung(None, positionen=[])
assert abrechnung.betrag == 0
def test_be... | 33.772727 | 84 | 0.675639 |
c492b17fccc8eeeaad10b95f5a96c4358adc86fb | 1,183 | py | Python | nz_crawl_demo/day2/demo4.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/demo4.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day2/demo4.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from urllib import request
from urllib import parse
import json
headers = {
"User-Agent":"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.8.131 Version/11.11",
}
# url = "https://job.alibaba.com/zhaopin/socialPositionList/doList.json?pageSize="+"%d"+"&t=0.7576443766726075&keyWord=python" %( i*10)... | 35.848485 | 139 | 0.655959 |
c4dc7c91eee31e16aa2ce1521c0447d9ea8411ee | 34,712 | py | Python | resources/lib/funk.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | resources/lib/funk.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | resources/lib/funk.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
# funk.py - Teil von Kodi-Addon-ARDundZDF
# Kanäle und Serien von https://www.funk.net/
#
# Credits: cemrich (github) für die wichtigsten api-Calls
#
# 02.11.2019 Migration Python3 Modul future
# 17.11.2019 M... | 40.083141 | 181 | 0.656257 |
48711f2c834f66c1a27886c6b688efafa625d742 | 542 | py | Python | sketches/circlepacking01/circles.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/circlepacking01/circles.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/circlepacking01/circles.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | class Circle(object):
def __init__(self, x, y, c):
self.x = x
self.y = y
self.c = c
self.r = 1
self.growing = True
def grow(self):
if self.growing:
self.r += 0.5
def edges(self):
return(self.x + self.r > width or self.x -... | 23.565217 | 64 | 0.464945 |
6fd60022641d5109be7a0bff73451046c369e636 | 3,943 | py | Python | Union/2021/crypto/neoclassical/neoclassical.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Union/2021/crypto/neoclassical/neoclassical.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Union/2021/crypto/neoclassical/neoclassical.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import os
from hashlib import sha1
from random import randint
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
FLAG = b"union{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}"
def list_valid(l):
x = l // 2
checked = set([x])
while x * x != l:
x = (x + (l // x)) // 2
if x in checke... | 46.388235 | 1,972 | 0.785189 |
b50f90c0d82351621c9b97f2245a8316efd61790 | 1,695 | py | Python | solve3.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | 1 | 2021-06-15T11:19:43.000Z | 2021-06-15T11:19:43.000Z | solve3.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | null | null | null | solve3.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
from Reader import ReadU
from ops import MakeR, Fidelity
from utils import Minimize, QSystem, RLayer, CLayer
INPUT_TXT = 'Questions/Question_3_Unitary.txt'
ANSWER_TXT = '../Answer/Question_3_Answer.txt'
def main(in_txt=INPUT_TXT, out_txt=ANSWER_TXT):
MakeSystem = lambda t1,t... | 35.3125 | 76 | 0.559882 |
82fbeaaeaf7e56e32337fe968728951d8282c202 | 217 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/update_lft_rgt_for_employee.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/update_lft_rgt_for_employee.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/update_lft_rgt_for_employee.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
from frappe.utils.nestedset import rebuild_tree
def execute():
""" assign lft and rgt appropriately """
frappe.reload_doc("hr", "doctype", "employee")
rebuild_tree("Employee", "reports_to") | 27.125 | 50 | 0.714286 |
d2629c95b11b1cac0b93ff84f6274ddbb0c76204 | 2,045 | py | Python | python/oneflow/compatible/single_client/framework/sysconfig.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/compatible/single_client/framework/sysconfig.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/compatible/single_client/framework/sysconfig.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-01-17T03:34:39.000Z | 2021-01-17T03:34:39.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 28.402778 | 77 | 0.730562 |
73730c20873173b0b53cf4d9caf1b0176b53a7e4 | 5,544 | py | Python | app.py | MarkusWET/secure_password_website | 257d0e7d463dea4777d5d92f7f56499f2a4b5044 | [
"MIT"
] | null | null | null | app.py | MarkusWET/secure_password_website | 257d0e7d463dea4777d5d92f7f56499f2a4b5044 | [
"MIT"
] | null | null | null | app.py | MarkusWET/secure_password_website | 257d0e7d463dea4777d5d92f7f56499f2a4b5044 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID as pgUUID, TEXT
import uuid
import os
import hashlib
import base64
app = Flask(__name__)
app.debug = True
app.config["SQLALCHEMY_DATABASE_URI"] = "postgresql://dbadmin@localhost:543... | 36 | 117 | 0.600649 |
fba47d3a50a423f31fb12b1cba7f0b9131a79045 | 56 | py | Python | python/python_backup/PRAC_PYTHON/mm.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/mm.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/mm.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | j=5
for i in range(1,11,1):
print (j**2)-1
j=j+5
| 11.2 | 24 | 0.5 |
83e29f74451480795f29d38a6c701909730ec2f7 | 232 | py | Python | Language Proficiency/Python/Sets/Symmetric Difference/symmetric_difference.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Sets/Symmetric Difference/symmetric_difference.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Sets/Symmetric Difference/symmetric_difference.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
M = int(input())
a = set(input().split())
N = int(input())
b = set(input().split())
print('\n'.join(sorted(a.difference(b).union(b.difference(a)), key=int)))
| 19.333333 | 77 | 0.564655 |
7933f00aeb49a7ded90045e8b68a07410d08be7d | 1,840 | py | Python | webinterface/signals.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | webinterface/signals.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | webinterface/signals.py | monoclecat/cleaning-schedule-management-system | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 1 | 2020-07-04T11:42:17.000Z | 2020-07-04T11:42:17.000Z | from django.db.models.signals import m2m_changed
from django.dispatch import receiver
from webinterface.models import *
@receiver(signal=m2m_changed, sender=ScheduleGroup.schedules.through)
def schedule_group_changed(instance, action, model, pk_set, **kwargs):
if action == 'post_add' or action == 'post_remove':
... | 49.72973 | 117 | 0.707065 |
58718ff084b354f3bd12ea253630cba330545c7b | 2,122 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_dict.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_dict.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_dict.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
class TestTransformDict(unittest.TestCase):
def setUp(self):
self.data = {
"test": {
"hallo": 1
},
"test1": {
"hallo": 4
}... | 25.566265 | 86 | 0.33836 |
b7356feed5edd009a9c4fe494eb7761daecc50b6 | 8,314 | py | Python | python/DeepLearning/lesson1/week4/my_main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/DeepLearning/lesson1/week4/my_main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/DeepLearning/lesson1/week4/my_main.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import numpy.random
import matplotlib.pyplot as plt
import random
import lr_utils # 参见资料包,或者在文章底部copy
# 设置常量
# 激活函数的标识字符串
SIGMOID_NAME = 'sigmoid'
TANH_NAME = 'tanh'
# 激活函数
# def sigmoid(x):
# return 1 / (1 + np.exp(-x))
def sigmoid(x):
s = 1 / (1 + np.exp(-x))
return s
# 深层神经网络主驱动
... | 25.581538 | 97 | 0.532115 |
4d28ca9e48097ede64a2daf20fe374353b81ec86 | 141 | py | Python | Shivani/div2&3.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/div2&3.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/div2&3.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | x = int(input("enter number\n"))
if(x%2==0 and x%3==0):
print(x,"is divisible by 2 and 3")
else:
print(x,"not divisible by 2 and 3")
| 23.5 | 39 | 0.602837 |
4dd65063519c4606342ddf0f1e11f24520438008 | 6,679 | py | Python | research/nlp/senta/src/data/data_set_reader/roberta_twosentclassification_dataset_reader_en.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/senta/src/data/data_set_reader/roberta_twosentclassification_dataset_reader_en.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/senta/src/data/data_set_reader/roberta_twosentclassification_dataset_reader_en.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | """task reader"""
# Copyright 2021 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 applicabl... | 41.228395 | 94 | 0.634826 |
12c0569864fecb0b2c4e3916d040ca1e5ced3e5b | 3,894 | py | Python | test/test_npu/test_network_ops/test_log_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_log_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_log_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 35.4 | 74 | 0.6415 |
42836946850d05db3b812bfd719470abfe31c093 | 384 | py | Python | Project Euler Questions 1 - 10/Project Euler Question 1.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Questions 1 - 10/Project Euler Question 1.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Questions 1 - 10/Project Euler Question 1.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Prject Euler Question 1
#If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
#Find the sum of all the multiples of 3 or 5 below 1000.
x = 1
y = 0
while (x < 1000):
if ((x % 3 == 0) or (x % 5 == 0)):
y += x
x +=1
p... | 27.428571 | 130 | 0.601563 |
675ef50e470754e40f971092afcbc1694472fa7c | 3,073 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/EGG-INFO/scripts/pbt_plotting_example.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/EGG-INFO/scripts/pbt_plotting_example.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/EGG-INFO/scripts/pbt_plotting_example.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | from __future__ import print_function
import time
import os
import pybedtools
from pybedtools.contrib import plotting
from matplotlib import pyplot as plt
colors = ['r', 'b', 'g']
def plot_a_b_tool(a, b, method, **kwargs):
"""
Use for BEDTools programs that use -a and -b input arguments. Filenames
`a` a... | 30.127451 | 90 | 0.625447 |
db0f4b383ff99a58ec7a7c165550e12db3760177 | 2,589 | py | Python | Packs/Nmap/Integrations/Nmap/Nmap.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/Nmap/Integrations/Nmap/Nmap.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/Nmap/Integrations/Nmap/Nmap.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto
from CommonServerPython import *
from libnmap.process import NmapProcess
from libnmap.parser import NmapParser
from libnmap.reportjson import ReportEncoder
if demisto.command() == 'test-module':
demisto.results('ok')
sys.exit(0)
if demisto.command() == 'nmap-scan':
nm = NmapPr... | 32.772152 | 98 | 0.531093 |
c02a7a45ec6171c90cdf18593d4ec4b530f5f824 | 24,357 | py | Python | tests/onegov/org/test_views_directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_views_directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_views_directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import timedelta, datetime
from io import BytesIO
import transaction
from purl import URL
from pytz import UTC
from sedate import standardize_date, utcnow, to_timezone, replace_timezone
from webtest import Upload
from onegov.directory import DirectoryEntry, DirectoryCollection, \
DirectoryConfigurat... | 34.018156 | 92 | 0.660919 |
2269785e1ab69354331a1e3ae510bd03a28777f7 | 195 | py | Python | relu_test.py | rusty1s/tensorflow-graph-plugin | 2282888e74ab59c288d329c426a80f735c5163a1 | [
"MIT"
] | null | null | null | relu_test.py | rusty1s/tensorflow-graph-plugin | 2282888e74ab59c288d329c426a80f735c5163a1 | [
"MIT"
] | null | null | null | relu_test.py | rusty1s/tensorflow-graph-plugin | 2282888e74ab59c288d329c426a80f735c5163a1 | [
"MIT"
] | null | null | null | import tensorflow as tf
from grad_ops.relu import relu
x = tf.random_normal([10])
y = relu(x * x)
with tf.Session():
diff = tf.test.compute_gradient_error(x, [10], y, [10])
print(diff)
| 19.5 | 59 | 0.671795 |
58c444125eea39d61e9526f470782420edd5461b | 327 | py | Python | pacman-termux/test/pacman/tests/sign002.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/sign002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/sign002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Verify a signature in a sync DB (failure)"
sp = pmpkg("pkg1")
sp.pgpsig = "iEYEABECAAYFAkhMOggACgkQXC5GoPU6du2WVQCffVxF8GKXJIY4juJBIw/ljLrQxygAnj2QlvsUd7MdFekLX18+Ov/xzgZ1"
self.addpkg2db("sync+Required", sp)
self.args = "-S %s" % sp.name
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=... | 29.727273 | 110 | 0.770642 |
189292816bcf1af9870394b3155fd2193c2b3846 | 515 | py | Python | lintcode/000-079-Longest-Common-Substring/LngstCmnSubstr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | lintcode/000-079-Longest-Common-Substring/LngstCmnSubstr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/000-079-Longest-Common-Substring/LngstCmnSubstr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param A, B: Two string.
# @return: the length of the longest common substring.
def longestCommonSubstring(self, A, B):
# write your code here
m, n = len(A), len(B)
dp = [[0 for j in range(n + 1)] for i in range(m + 1)]
mx = 0
for i in range(1, m + 1... | 34.333333 | 62 | 0.440777 |
36dabbebeec64a88c625218fc63c07f0aafcc12e | 1,737 | py | Python | python/oneflow/compatible/single_client/env.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/env.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/env.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 40.395349 | 86 | 0.822107 |
e9f7b26882996eddedbb90c0795701bab277f29e | 827 | py | Python | Algorithms/5_Searching/17.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/5_Searching/17.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/5_Searching/17.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/xor-quadruples/problem
#!/bin/python3
import os
import sys
#
# Complete the beautifulQuadruples function below.
#
def beautifulQuadruples(a, b, c, d):
a,b,c,d = sorted([a,b,c,d])
k,t,ans = [0]*(2**len('{:b}'.format(d))),0,0
for z in range(c):
for y in ran... | 21.205128 | 68 | 0.541717 |
62e5c5538d3cba063ceadf7018b5c5280b29eb78 | 1,795 | py | Python | MiniProjects/Projects/2020_PY/happy2020.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | MiniProjects/Projects/2020_PY/happy2020.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | MiniProjects/Projects/2020_PY/happy2020.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | import schedule
import time
import vlc
import os
import sys
from datetime import datetime
audioNewYear = vlc.MediaPlayer("happy_new_year.mp3")
audioParty = vlc.MediaPlayer("party_music.mp3")
countDownStartTime="23:59"
newYearTime="00:00"
countDownEndTime=newYearTime
closeTime="00:01"
os.system("clear")
def audioPartyPl... | 32.636364 | 116 | 0.706407 |
a7fb2e3ca07658a80390e42a760cd17075813f10 | 152 | py | Python | src/python3_learn_video/for_condition.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/for_condition.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/for_condition.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | favourite = 'FishC'
for i in favourite:
print(i, end=' ')
member = ['小甲鱼', '小布丁', '黑夜', '迷途', '怡静']
for each in member:
print(each, len(each))
| 19 | 41 | 0.572368 |
c550bab901fa92cea0ea2b2ea8cd79a29a003ea2 | 698 | py | Python | Hackerrank_problems/Mini-Max Sum/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/Mini-Max Sum/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/Mini-Max Sum/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # Complete the miniMaxSum function below.
def miniMaxSum(arr):
a=[] #empty list to add sum of numbers except the number of each element the list
for i in range(len(arr)):
if i==0: #checking for the empty list
a=[sum(arr)-arr[i]] #addin... | 36.736842 | 114 | 0.597421 |
c5740ab7ab678719ba6d2355a1a59e6f3c6dc3bc | 17,820 | py | Python | python/oneflow/nn/graph/graph.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/graph/graph.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/graph/graph.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 36.367347 | 107 | 0.565825 |
3dc095e99b93f787a3a1cd08a2272874288d425c | 267 | py | Python | ISTp/2014/NEZAMOV_S_I/task_5_31.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/NEZAMOV_S_I/task_5_31.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/NEZAMOV_S_I/task_5_31.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 5. Вариант 31.
# Напишите программу, которая бы при запуске случайным образом отображала имя одного из двух братьев, создателей старославянской азбуки.
# Nezamov S.I.
# 14.04.2016
import random
brothers = ('Кирилл','Мефодий')
print(random.choice(brothers))
| 29.666667 | 136 | 0.771536 |
b1426ff37cc2b896c0949fa6d71f1583eadf9bb1 | 974 | py | Python | docs/_ext/fontawesome.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | null | null | null | docs/_ext/fontawesome.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 2 | 2021-03-24T19:24:40.000Z | 2021-03-24T19:54:46.000Z | docs/_ext/fontawesome.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-03-24T19:51:45.000Z | 2021-03-24T19:51:45.000Z | import os
from docutils.nodes import strong, emphasis, reference, Text
from docutils.parsers.rst.roles import set_classes
from docutils.parsers.rst import Directive
import docutils.parsers.rst.directives as directives
# add role
def fa_global(key="", style="fa"):
def fa(role, rawtext, text, lineno, inliner, option... | 28.647059 | 73 | 0.606776 |
623b7f4e95e9aa379a5c694f11d1dce67540f560 | 1,160 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/tools/binman/etype/fill.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/binman/etype/fill.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/binman/etype/fill.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2018 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
from entry import Entry
import fdt_util
import tools
class Entry_fill(Entry):
"""An entry which is filled to a particular byte value
Properties / Entry arguments:
- fill-byte: Byte to us... | 32.222222 | 79 | 0.693103 |
65cabf951bd8843184098e27236043fd6f171e58 | 217 | py | Python | OSINT-SPY-master/modules/config.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | OSINT-SPY-master/modules/config.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | OSINT-SPY-master/modules/config.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | ##############################
# Paste API Key's Here
##############################
clearbit_api_key = ""
shodan_api_key = ""
fullcontact_api_key = ""
virus_total_api_key = ""
email_hunter_api_key = ""
| 21.7 | 31 | 0.479263 |
a2423e9b1367865754e03f3899b743ea86f7175b | 1,627 | py | Python | src/aijack/defense/ckks/ciphertext.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/ckks/ciphertext.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/ckks/ciphertext.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | from numpy.polynomial import Polynomial
from .plaintext import CKKSPlaintext
from .utils import polydiv_coef
class CKKSCiphertext:
def __init__(self, c0: Polynomial, c1: Polynomial, N: int, q: int, scale: int):
self.c0 = c0
self.c1 = c1
self.N = N
self.q = q
self.scale = s... | 31.288462 | 83 | 0.505224 |
e7e54ab00d29bbe18da3c346b61fbee8973ed9c1 | 1,973 | py | Python | app/controllers/abtms/StudentStatement.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/controllers/abtms/StudentStatement.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/controllers/abtms/StudentStatement.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | 1 | 2019-03-13T14:34:24.000Z | 2019-03-13T14:34:24.000Z | import os
from werkzeug.security import generate_password_hash, check_password_hash
from flask_mail import Mail
from flask import request, redirect, session, render_template, jsonify, send_from_directory
from flask_mail import Message
from app import app
from app.models.abtms.User import User
from app.models.abtms.St... | 41.104167 | 268 | 0.706031 |
f069d0675ac544bff7984a3da5dfd8db52aff7dd | 47,964 | py | Python | Packs/Code42/Integrations/Code42/Code42.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Code42/Integrations/Code42/Code42.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Code42/Integrations/Code42/Code42.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
""" IMPORTS """
import json
import os
import requests
import py42.sdk
import py42.settings
from datetime import datetime
from py42.services.detectionlists.departing_employee import DepartingEmployeeFilters
from py42.services.detectionlists.high_risk_employ... | 34.706223 | 115 | 0.680615 |
f06ebf2202fe5cad74155d306d2817c9392e925d | 5,584 | py | Python | alerts.py | BlueMesa/PiAlert | cd36ac3139ed45199e2b962b18e07edd309dc7bf | [
"BSD-2-Clause"
] | null | null | null | alerts.py | BlueMesa/PiAlert | cd36ac3139ed45199e2b962b18e07edd309dc7bf | [
"BSD-2-Clause"
] | null | null | null | alerts.py | BlueMesa/PiAlert | cd36ac3139ed45199e2b962b18e07edd309dc7bf | [
"BSD-2-Clause"
] | null | null | null | from datetime import datetime, timedelta
from typing import Iterable
import platform
import yaml
if platform.machine() == 'armv6l':
from gsmHat import GSMHat
LEVELS = ['alert', 'warning', 'notify', 'info']
with open('alerts.yml') as file:
yaml_alerts = yaml.load(file, Loader=yaml.FullLoader)
minutes = in... | 25.851852 | 113 | 0.563933 |
b2d72be26d77305d41e3753dbcb101f89664ca1e | 1,453 | py | Python | tests/rbac/api/__init__.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | tests/rbac/api/__init__.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | tests/rbac/api/__init__.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 33.022727 | 79 | 0.706125 |
b2f21fcf43a46affd2657da031c9dc550598b1b5 | 3,555 | py | Python | skripte/python/patuse/long_s_conversion.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/patuse/long_s_conversion.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/patuse/long_s_conversion.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
# :Copyright: © 2014 Günter Milde.
# Released without warranty under the terms of the
# GNU General Public License (v. 2 or later)
# :Id: $Id: $
# long_s_conversion.py: Demonstrator für die Lang-S Wandlung
# =========================================... | 33.537736 | 79 | 0.587342 |
652549558492cd524f2a5942ea894d9919734c77 | 132 | py | Python | CS208/exercise1/pown.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS208/exercise1/pown.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS208/exercise1/pown.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | import random
def work(n):
if n == 0:
return
work(n - 1)
work(n - 1)
if __name__ == "__main__":
work(10)
| 11 | 26 | 0.5 |
d7eb603ded02c9437b40e89959465a901c2057ed | 355 | py | Python | showcase6/com/aaron/demo3.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase6/com/aaron/demo3.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase6/com/aaron/demo3.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | import wx
class MyFrame(wx.Frame):
""" We simply derive a new class of Frame. """
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(200,100))
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
self.Show(True)
app = wx.App(False)
frame = MyFrame(N... | 32.272727 | 68 | 0.661972 |
0454593146e1322e262b8dd8defccea7cda34447 | 3,756 | py | Python | test/test_npu/test_network_ops/test_scatter.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_scatter.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_scatter.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 37.188119 | 87 | 0.623802 |
045510f9ea43904fcef8439114d9f669e0ebe553 | 523 | py | Python | V000_Vorlage/python/plot1.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | 1 | 2021-08-21T17:08:39.000Z | 2021-08-21T17:08:39.000Z | V000_Vorlage/python/plot1.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | null | null | null | V000_Vorlage/python/plot1.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | null | null | null | # wechsle die Working Directory zum Versuchsordner, damit das Python-Script von überall ausgeführt werden kann
import os,pathlib
project_path = pathlib.Path(__file__).absolute().parent.parent
os.chdir(project_path)
# benutze die matplotlibrc und header-matplotlib.tex Dateien aus dem default Ordner
os.environ['MATPLOTLI... | 47.545455 | 110 | 0.795411 |
f0c697d9ae804b0b089cc426f11dfe8c2d949abb | 1,653 | py | Python | chapter4/dataprocess.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | 1 | 2020-02-16T13:31:42.000Z | 2020-02-16T13:31:42.000Z | chapter4/dataprocess.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | null | null | null | chapter4/dataprocess.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2019/2/10 14:35
# @Author : LunaFire
# @Email : gilgemesh2012@gmail.com
# @File : dataprocess.py
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
def normalize_feature(data):
return data.apply(... | 31.788462 | 97 | 0.647913 |
9bdaed5546c81b6e58069f68c5f3388d36189b47 | 1,236 | py | Python | p01/src/flask/routes-deployments.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/src/flask/routes-deployments.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/src/flask/routes-deployments.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | import os
from flask import Flask, flash, request, redirect, url_for
from werkzeug.utils import secure_filename
from werkzeug.middleware.shared_data import SharedDataMiddleware
import json
app = Flask(__name__)
@app.route('/deployment', methods=['POST'])
def new_deployment():
# check if the post request has ... | 24.72 | 84 | 0.673139 |
4a18df88f9eb8e6d5ea2048117a038ecb972baee | 1,016 | py | Python | Algorithms/Strings/hackerrank_in_a_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/hackerrank_in_a_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/hackerrank_in_a_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
q = int(input().strip())
for a0 in range(q):
s = input().strip()
start = s.find('h', 0)
if start == -1:
print('NO')
continue
start = s.find('a', start+1)
if start == -1:
print('NO')
continue
start = s.find('c', start+1)
if s... | 20.734694 | 32 | 0.458661 |
96e0d2afd6fc5a9e19f61a2ce3525f13a206ddee | 375 | py | Python | paraview.py | jibonaronno/RP2040AudioRecord | c31824129d8b603ae2662bbba5bcc63d1213556b | [
"CC0-1.0"
] | null | null | null | paraview.py | jibonaronno/RP2040AudioRecord | c31824129d8b603ae2662bbba5bcc63d1213556b | [
"CC0-1.0"
] | null | null | null | paraview.py | jibonaronno/RP2040AudioRecord | c31824129d8b603ae2662bbba5bcc63d1213556b | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python3
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
'''
This class will show and set parameters for a selected object. A json structure will guide
the parameter structure. Let the object name should be params.
'''
class Paraview(QWidget):
def __init__(self, *args... | 26.785714 | 90 | 0.722667 |
e876e620cce84f82f38decfb8eadd1b9cfee4dc7 | 125 | py | Python | Online-Judges/CodingBat/Python/Warmup-01/01-sleep-in.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/Warmup-01/01-sleep-in.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/Warmup-01/01-sleep-in.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def sleep_in(weekday, vacation):
if weekday is False:
return True
if vacation is True:
return True
return False | 20.833333 | 32 | 0.712 |
fa2d606eeccbbde5193eebdf88f63d67587c73d1 | 104 | py | Python | workSpace/wifi/down.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | 5 | 2018-07-24T17:41:15.000Z | 2021-02-07T13:59:42.000Z | workSpace/wifi/down.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | null | null | null | workSpace/wifi/down.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | 5 | 2018-07-24T17:41:03.000Z | 2021-10-01T07:06:16.000Z | import network
sta_if = network.WLAN(network.STA_IF)
sta_if.active(False)
# usage:
# import wifi.down
| 14.857143 | 37 | 0.759615 |
0e6345f53560aaae8dd14b17397f142851152a94 | 7,375 | py | Python | MA/00 Archive/Car_V001h.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/00 Archive/Car_V001h.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/00 Archive/Car_V001h.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | #!/usr/bin/python
#from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor
import time
import atexit
import pygame
import pygame.camera
import sys
#from picamera import PiCamera
from time import sleep
from PIL import Image
#from pylab import *
sys.path.append("/home/pi/Adafruit-Motor-HAT-Python-Library") ##... | 32.20524 | 96 | 0.504407 |
7ef97e292e057a9b467719170b0b218ed90612e3 | 8,418 | py | Python | oldp/apps/backend/processing/processing_steps/post/send_to_es.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/backend/processing/processing_steps/post/send_to_es.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/backend/processing/processing_steps/post/send_to_es.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | import json
import logging
import os
from urllib.parse import urlparse
import requests
from django.conf import settings
from django.db.models import Model
from django.forms import model_to_dict
from elasticsearch import NotFoundError
from elasticsearch.client import IndicesClient, Elasticsearch
from oldp.apps.backend... | 31.29368 | 111 | 0.593847 |
bc3978997cb18d3851b4b89493597185e7906359 | 24,143 | py | Python | autojail/extract/device_tree.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/extract/device_tree.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/extract/device_tree.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | import os
import subprocess
from collections import OrderedDict, defaultdict
from pathlib import Path
from tempfile import mktemp
from typing import Any, List, MutableMapping, Set, Tuple, Union
import fdt
import tabulate
from dataclasses import dataclass, field
from fdt.items import Node
from autojail.model.board imp... | 32.450269 | 114 | 0.523879 |
1dabcda57a90f75da4b4335e0a364a7c110b355d | 1,578 | py | Python | src/data_science/data_science/tools/threading_utilities.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/tools/threading_utilities.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/tools/threading_utilities.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | import threading
from data_science.simulation.time import TimeSimulator
class StoppableThread(threading.Thread):
"""
Thread class with a stop() method. The thread itself has to check
regularly for the stopped() condition.
"""
def __init__(self, target=None):
if target is None:
... | 23.909091 | 77 | 0.562738 |
69c00cb36d1b61fa773d7cbc6d57bbcb2e3d4d9d | 2,394 | py | Python | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Tuple
import demistomock as demisto
from CommonServerPython import *
SCRIPT_NAME = 'CustomPackInstaller'
def install_custom_pack(pack_id: str) -> Tuple[bool, str]:
"""Installs a custom pack in the machine.
Args:
pack_id (str): The ID of the pack to install.
Returns:
... | 29.195122 | 105 | 0.621136 |
69ed4a81862139264cccc218aa9062bcce4e7931 | 619 | py | Python | BMI.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | 11 | 2018-10-14T20:13:29.000Z | 2021-01-04T12:03:12.000Z | BMI.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | 14 | 2018-10-08T17:35:48.000Z | 2020-10-01T14:43:57.000Z | BMI.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | 35 | 2018-10-04T11:15:44.000Z | 2020-10-26T06:25:23.000Z | # getting input from the user and assigning it to user
height = float(input("Enter height in meters: "))
weight = float(input("Enter weight in kg: "))
# the formula for calculating bmi
bmi = weight/(height**2)
# ** is the power of operator i.e height*height in this case
print("Your BMI is: {0} and you are: ".forma... | 22.107143 | 60 | 0.647819 |
3862e4fbc6fa1ce1ebf82b7f50415c6025d3a7c5 | 1,829 | py | Python | FlaskOccupations/app.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | FlaskOccupations/app.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | FlaskOccupations/app.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
Khyber Sen and Michael Ruvinshteyn
SoftDev1 pd7
HW5 -- Jinja Tuning
2017-09-26
"""
__authors__ = ['Khyber Sen', 'Michael Ruvinshteyn']
__date__ = '2017-09-22'
from flask import Flask
from flask import render_template
# noinspection PyUnresolvedReferences
import util.flask_utils
try:
from ... | 23.448718 | 82 | 0.703116 |
38e6068950266e782a848dbdcf02e69724b5b331 | 1,137 | py | Python | source/pkgsrc/devel/gobject-introspection/patches/patch-giscanner_ast.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/gobject-introspection/patches/patch-giscanner_ast.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/gobject-introspection/patches/patch-giscanner_ast.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-giscanner_ast.py,v 1.1 2019/06/03 10:47:20 prlw1 Exp $
- add double underscore versions
- 32/64-bit time_t fix
--- giscanner/ast.py.orig 2019-01-06 10:32:10.000000000 +0000
+++ giscanner/ast.py
@@ -307,6 +307,15 @@ type_names['uint32_t'] = TYPE_UINT32
type_names['int64_t'] = TYPE_INT64
type_names['ui... | 34.454545 | 69 | 0.728232 |
2a5556d4d7a8f065ef1fc03598645467e3e42e86 | 6,558 | py | Python | example/model_inversion/soteria.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:44.000Z | 2022-03-17T21:17:44.000Z | example/model_inversion/soteria.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | example/model_inversion/soteria.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:46.000Z | 2022-03-17T21:17:46.000Z | import random
import cv2
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
from matplotlib import pyplot as plt
from aijack.attack import GradientInversion_Attack
from aijack.collaborative import FedAvgClient, FedAvgServer
... | 30.082569 | 89 | 0.605672 |
2a8ea7bc0cec891712eee9c559b10451066462dc | 383 | py | Python | algorithm/factorial.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | algorithm/factorial.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | algorithm/factorial.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def factorial(n):
if n == 0:
return 1
elif n > 0:
return n * factorial(n - 1)
def test_factorial(n):
result = 1
for i in range(1, n + 1):
result *= i
compare = factorial(n)
print(f'{n}! = {compare}')
assert result == compare, f'Wrong answer in {n}!'
if __name__ =... | 19.15 | 53 | 0.535248 |
17d0dec0537d967cd4095b2f17cf6c9011347b95 | 411 | py | Python | 10.3389/fgene.2020.567262/local/scripts/sortvcf.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fgene.2020.567262/local/scripts/sortvcf.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fgene.2020.567262/local/scripts/sortvcf.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
def main():
fp = open(sys.argv[1], "r")
vcfs = []
for line in fp:
if line[0] == "#":
print line.rstrip()
continue
cols = line.split("\t")
vcfs.append([cols[0], int(cols[1]), line.rstrip()])
vcfs = sorted(vcfs, key=lambda x... | 21.631579 | 59 | 0.498783 |
a4d0fefb08865b112bad22189b742710c9d2c70c | 1,624 | py | Python | app/mq/judger.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | 2 | 2019-06-24T08:34:39.000Z | 2019-06-27T12:23:47.000Z | app/mq/judger.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | app/mq/judger.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | # encoding:utf-8
from app import queue, db, app
from app.judgement.models import JudgementResult
from app.submission.models import JudgementStatus, Submission
from utils import logger
import os
@queue(queue='go-docker-judger-callback')
def judge_callback(ch, method, props, body):
data = str(body, encoding='utf-8'... | 31.843137 | 86 | 0.727833 |
52b00d31b0d092145a1fe3235dcb7e68963d450c | 23,115 | py | Python | service/wkb/tf_continue_train/train_fund.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/tf_continue_train/train_fund.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/tf_continue_train/train_fund.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
所有的tensor都要命名便于索引和使用,所有的程序都可以放在session中设计,
计算图可以保存和继续训练的关键在于变量tensor的命名始终保持一致,
因为最终也是为了获得更合适的变量。
版本3的改进地方:1、参数初始化改为正太分布(0,1);2、采用正则化方法增加泛化性能;
3、采用随步数而减小的学习率;4、适当引入tf的高层API;5、是否可以采用抽样降低
训练数据的不对称性造成的损失失衡?。【2、4、5】留着在下一版本中探索研究.
6、AdaGrad,一种先进的梯度下降法,用于重新调整每个参数的梯度,以便有效地为每个参数
指定独立的学习速率;7... | 42.490809 | 85 | 0.574389 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.