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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6059c932e152e3b9d227f8831d4c5f1446130057 | 7,924 | py | Python | research/cv/AVA_cifar/src/knn_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/AVA_cifar/src/knn_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/AVA_cifar/src/knn_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.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... | 40.635897 | 119 | 0.590989 |
e81a5c5949538fb31d79439b6f55a45002a91c7b | 888 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Arrays/Array Manipulation/array_manipulation.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Arrays/Array Manipulation/array_manipulation.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Arrays/Array Manipulation/array_manipulation.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the arrayManipulation function below.
def arrayManipulation(n, queries):
arr = [0] * (n+1)
for i in range(len(queries)):
a = queries[i][0]
b = queries[i][1]
k = queries[i][2]
arr[a] += k
... | 18.893617 | 64 | 0.533784 |
98f16bbdbe92ef3693ecbcfb405e8cc2d856e3f4 | 896 | py | Python | elements/python/12/1/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/12/1/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/12/1/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def bsearch(A, pred):
"""
Assume the boolean function pred returns all False and then all True for
values in A. Return the index of the first True, or len(A) if that does
not exist.
"""
# invariant: last False lies in [l, r) and A[l] is False
if pred(A[0]):
return 0
l = 0
r =... | 20.837209 | 76 | 0.530134 |
98fa25302361a60278a0e6a24c143acc35cf1124 | 119,945 | py | Python | System_monitoringu/skrypt_sterujacy.py | Beanarny/Praca_inz | 38f843af8deeb1f1be6c77b553cfdcc4ad2a7c00 | [
"MIT"
] | null | null | null | System_monitoringu/skrypt_sterujacy.py | Beanarny/Praca_inz | 38f843af8deeb1f1be6c77b553cfdcc4ad2a7c00 | [
"MIT"
] | null | null | null | System_monitoringu/skrypt_sterujacy.py | Beanarny/Praca_inz | 38f843af8deeb1f1be6c77b553cfdcc4ad2a7c00 | [
"MIT"
] | null | null | null | import sys
from PyQt5 import QtWidgets
from PyQt5.uic import loadUi
from time import sleep
import csv
import mysql.connector
import serial
import datetime
import matplotlib.pyplot as plt
import hashlib
import numpy as np
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *... | 52.839207 | 308 | 0.556605 |
c749ac16a8cd30198397fdec33f935761ede12d9 | 492 | py | Python | examples/tensorflow-yolo/yolo_skil_web_cam.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | examples/tensorflow-yolo/yolo_skil_web_cam.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | examples/tensorflow-yolo/yolo_skil_web_cam.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | import skil
import cv2
skil_server = skil.Skil()
model = skil.Model('yolo_v2.pb', name='yolo-tf', model_id='yolo-3493723')
deployment = skil.Deployment(skil_server, 'yolo')
service = model.deploy(deployment, input_names=[
'input'], output_names=['output'], scale=2)
cap = cv2.VideoCapture(0)
whi... | 30.75 | 73 | 0.684959 |
409fbe183ea9ee7dc90f361e5e3982985cbfc0be | 785 | py | Python | app/main.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | app/main.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | app/main.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
openbikebox websocket-client
Copyright (c) 2021, binary butterfly GmbH
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
"""
import asyncio
from .websocket import websocket
from .cardreader import cardreader
from .websocket_queue import websocket_... | 25.322581 | 98 | 0.690446 |
40aea581262d185a3e4389235cdc2a1715b0429e | 342 | py | Python | setup.py | raicheff/flask-sri | 83e062b80e4a3c309906bf1dc8bdbb42e529576b | [
"MIT"
] | null | null | null | setup.py | raicheff/flask-sri | 83e062b80e4a3c309906bf1dc8bdbb42e529576b | [
"MIT"
] | null | null | null | setup.py | raicheff/flask-sri | 83e062b80e4a3c309906bf1dc8bdbb42e529576b | [
"MIT"
] | null | null | null | #
# Flask-SRI
#
# Copyright (C) 2017 Boris Raicheff
# All rights reserved
#
from setuptools import setup
setup(
name='Flask-SRI',
version='0.2.0',
description='Flask-SRI',
author='Boris Raicheff',
author_email='b@raicheff.com',
url='https://github.com/raicheff/flask-sri',
py_modules=('fl... | 14.25 | 48 | 0.646199 |
40af3fbbbd88e194fbd91699d3a5972a9cd8b7cf | 1,617 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Search/Making Candies/making_candies.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Search/Making Candies/making_candies.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Search/Making Candies/making_candies.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the minimumPasses function below.
def minimumPasses(machines, workers, price, candies):
current_machines = machines
current_workers = workers
current_candies = 0
current_passes = 0
final_passes = sys.maxsize
whi... | 29.4 | 136 | 0.644403 |
46ad0cfc32a53eab5cd77517fa87784ea15b9786 | 1,547 | py | Python | Packs/EWS/Scripts/GetEWSFolder/GetEWSFolder.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/EWS/Scripts/GetEWSFolder/GetEWSFolder.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/EWS/Scripts/GetEWSFolder/GetEWSFolder.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import List, Dict
from CommonServerPython import *
def convert_mail_to_json(item, folder):
return {
'subject': item.get('subject', ''),
'textBody': item.get('textBody', ''),
'body': item.get('body', ''),
'folder': folder
}
def main():
folders_paths_str = demi... | 35.976744 | 118 | 0.634131 |
9ef5e410e2ad41ed19824f3d5a0e88f29628bf16 | 96 | py | Python | public_identifiers/__init__.py | strange-dv/django-public-identifiers | 1d3f7752b16f48d1004328b5dad7acf6e83a9703 | [
"MIT"
] | null | null | null | public_identifiers/__init__.py | strange-dv/django-public-identifiers | 1d3f7752b16f48d1004328b5dad7acf6e83a9703 | [
"MIT"
] | null | null | null | public_identifiers/__init__.py | strange-dv/django-public-identifiers | 1d3f7752b16f48d1004328b5dad7acf6e83a9703 | [
"MIT"
] | null | null | null | from .fields import ISBNField, DOIField, ISSNField
__all__ = [ISBNField, DOIField, ISSNField]
| 19.2 | 50 | 0.78125 |
731e863e9c88a40cadbbd6e080e4a25655161d33 | 28,260 | py | Python | src/sick_ldmrs/dataproc.py | achambers16/sick_ldmrs | a65f2239f474263a16b382bae6fc4cb5e5505ba5 | [
"BSD-2-Clause"
] | 1 | 2017-12-29T07:58:31.000Z | 2017-12-29T07:58:31.000Z | src/sick_ldmrs/dataproc.py | achambers16/sick_ldmrs | a65f2239f474263a16b382bae6fc4cb5e5505ba5 | [
"BSD-2-Clause"
] | null | null | null | src/sick_ldmrs/dataproc.py | achambers16/sick_ldmrs | a65f2239f474263a16b382bae6fc4cb5e5505ba5 | [
"BSD-2-Clause"
] | null | null | null | #* Software License Agreement (BSD License)
#*
#* Copyright (c) 2010, CSIRO Autonomous Systems Laboratory
#* All rights reserved.
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions
#* are met:
#*
#* * Redistributions of s... | 46.865672 | 120 | 0.611253 |
b42a78998e0e46cd77f57f6ed86bf86773992a06 | 3,665 | py | Python | Packs/CommonScripts/Scripts/LookupCSV/LookupCSV.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/LookupCSV/LookupCSV.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/LookupCSV/LookupCSV.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """
Given a CSV file in the War Room by entry ID, searches based on column and value.
If the column is not present, simply parse the CSV into a list of lists or list of dicts (if header row supplied).
"""
from CommonServerPython import *
import csv
def search_dicts(k, v, data):
"""
Search a list of dicts by k... | 30.289256 | 119 | 0.580082 |
b44ca279fa516e51328f360799be9e337a10538b | 559 | py | Python | tag_1/p_2_2_groesste_zahl_von_dreien.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_2_2_groesste_zahl_von_dreien.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_2_2_groesste_zahl_von_dreien.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
2 If-Abfragen (Tag 1)
2.2 Bestimme die größte von drei vorher festgelegten Zahlen und gib diese Zahl aus.
"""
from hilfprogramme import float_number_input
if __name__ == '__main__':
print('Bestimmung der größten von drei Zahlen a, b und c.')
a = float_number_input('a? ')
b = float_number_input('b? ')
... | 27.95 | 83 | 0.588551 |
d2f4ba9b49c28a3839f1b5fc9dc48ed29ef0dc0a | 144 | py | Python | pages/themes/beginners/logicalExpressionsAndConditionalStatements/labs/while_loop.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/logicalExpressionsAndConditionalStatements/labs/while_loop.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/logicalExpressionsAndConditionalStatements/labs/while_loop.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null |
while 1:
user_number = int(input("Entersitive number: "))
if user_number > 0:
break
print("Do somet7hing with number!")
| 16 | 52 | 0.611111 |
7de89e19e2188e37b9a811f275d48bad19a0a257 | 540 | py | Python | app/views/apis/parser.py | luoweis/xskAdmin | d92d0297102140ce5241a0c9f3a80f520bee96a8 | [
"MIT"
] | null | null | null | app/views/apis/parser.py | luoweis/xskAdmin | d92d0297102140ce5241a0c9f3a80f520bee96a8 | [
"MIT"
] | null | null | null | app/views/apis/parser.py | luoweis/xskAdmin | d92d0297102140ce5241a0c9f3a80f520bee96a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding=utf-8 -*-
from flask_restful.reqparse import RequestParser
parser = RequestParser()
'''
默认参数类型为str
允许传入的是空值,None
通过required=True,不允许为空值
'''
parser.add_argument(
"id",
type=int,
required=True,
# action="append",# 允许传入多个值,最终是一个列表形式
help="传入的值不能... | 18 | 48 | 0.624074 |
6fce8a5ff9b3666160e64aa4d93bf8b51e557f6a | 3,634 | py | Python | src/visitpy/visit_flow/flow/tests/test_filters_npy_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/flow/tests/test_filters_npy_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/flow/tests/test_filters_npy_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: test_filters_npy_ops.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 3/24/2012
d... | 31.059829 | 73 | 0.560815 |
d2682116e9b41175911f414ea445f65505ef2001 | 163 | py | Python | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/height_round.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/height_round.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/height_round.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | print("Input your height :")
h_ft=int(input("Feet :"))
h_inch=int(input("Inches :"))
h_inch+=h_ft*12
h_cm=round(h_inch*2.54,1)
print("Your height is : %d cm"%h_cm) | 27.166667 | 36 | 0.680982 |
838a5da57026647158a07560fb026f3f34086b49 | 1,165 | py | Python | Packs/DemistoRESTAPI/Scripts/DemistoUploadFileV2/DemistoUploadFileV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DemistoRESTAPI/Scripts/DemistoUploadFileV2/DemistoUploadFileV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DemistoRESTAPI/Scripts/DemistoUploadFileV2/DemistoUploadFileV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Tuple
from CommonServerPython import *
def upload_file(incident_id: str, entry_id: str, body: str = ''):
return demisto.executeCommand("demisto-api-multipart",
{"uri": f'entry/upload/{incident_id}', "entryID": entry_id, "body": body})
def upload_file_command... | 30.657895 | 108 | 0.656652 |
f7cd7d10fe18b1dfa6091427745884f777c5c68e | 1,085 | py | Python | books/PythonCleanCode/ch3_good_code/test_exceptions_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch3_good_code/test_exceptions_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch3_good_code/test_exceptions_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 3: General Traits of Good Code
"""
import unittest
from unittest.mock import Mock, patch
from exceptions_1 import DataTransport, Event
class FailsAfterNTimes:
def __init__(self, n_times: int, with_exception) -> None:
self._remaining_failures = n_times
self._exc... | 25.833333 | 84 | 0.690323 |
f7ceaec3f165d68502ab2e79f89237cc0e1f5fd4 | 1,654 | py | Python | _test_.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | _test_.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | _test_.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | from quark_core_api.core import QuarkApplication
from quark_core_api.context import ApplicationContext
from quark_core_api.common import ContextInitializer
import json
import os
app_dir = os.path.expanduser("~\\")
app = QuarkApplication(ApplicationContext(app_dir, ContextInitializer.application))
location = "D:\\qua... | 23.971014 | 89 | 0.734583 |
f75199dee264bbd9684b8c372ddf97bb6e2be2ba | 492 | py | Python | exercises/es/solution_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/solution_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/solution_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("es_core_news_sm")
text = (
"De acuerdo con la revista Fortune, Apple fue la empresa "
"más admirada en el mundo entre 2008 y 2012."
)
# Procesa el texto
doc = nlp(text)
for token in doc:
# Obtén el texto del token, el part-of-speech tag y el dependency label
token_text... | 24.6 | 75 | 0.676829 |
f7721c10cce179af262e3ef00ac909e6a4fceff6 | 9,244 | py | Python | src/onegov/winterthur/views/mission_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/mission_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/mission_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.core.elements import Link
from onegov.core.security import Public, Private
from onegov.form import FieldDependency, WTFormsClassBuilder, move_fields
from onegov.org.views.files import view_get_image_collection
from onegov.winterthur import WinterthurApp, _
from onegov.winterthur.co... | 28.619195 | 76 | 0.636629 |
f79eb89a720fe844729864ef93df4ddadd5ea21d | 3,072 | py | Python | guidelight/app/routes.py | prototypefund/guidelight-website | 6496baeb33675aadcd401acd00d6922f909484a4 | [
"MIT"
] | null | null | null | guidelight/app/routes.py | prototypefund/guidelight-website | 6496baeb33675aadcd401acd00d6922f909484a4 | [
"MIT"
] | null | null | null | guidelight/app/routes.py | prototypefund/guidelight-website | 6496baeb33675aadcd401acd00d6922f909484a4 | [
"MIT"
] | null | null | null | from flask import render_template, request, redirect, url_for, send_from_directory
from app import app, mongo
from .helper import render_form_data, get_action, get_doc
################################################################################
# PAPGES
#############################################################... | 28.71028 | 86 | 0.555664 |
583611d554ef6503d6a4e438b82777d0cabd8ff1 | 698 | py | Python | books/PythonAutomate/file_organize/selective_search.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/file_organize/selective_search.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/file_organize/selective_search.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """selective_search.py
선택적 복사
- 인자로 받은 확장자로 끝나는 파일을 지정한 디렉터리에 저장
"""
import os
import sys
import shutil
from pathlib import Path
def copy(format, dest_dir="new"):
cur_dir = Path.cwd()
dir_path = Path(dest_dir).absolute()
dir_path.mkdir(exist_ok=True)
for path in cur_dir.rglob(f"**/*.{... | 21.151515 | 89 | 0.588825 |
544675eca71aae1e4d82edd529b01f6fe34d6a01 | 7,529 | py | Python | quant/observers/c_usdt.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/observers/c_usdt.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/observers/c_usdt.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import logging
from quant.observers.basicbot import BasicBot
"""
./venv/bin/python -m quant.cli -mBinance_ETH_USDT,Binance_BTC_USDT,Huobi_ETH_USDT,Huobi_BTC_USDT -oC_USDT -f=c_usdt -v
"""
class C_USDT(BasicBot):
def __init__(self):
super(C_USDT, self).__in... | 41.827778 | 118 | 0.625847 |
b75b3ff7a53a1d5834931510bcd08e2f8a5a0ce0 | 5,999 | py | Python | research/cv/DnCNN/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DnCNN/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DnCNN/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.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... | 46.867188 | 130 | 0.668611 |
4d9e239880c22e59c110c33013d0ee5b22ee922b | 1,134 | py | Python | linear_data_structure/trapping_rain_water.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | linear_data_structure/trapping_rain_water.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | linear_data_structure/trapping_rain_water.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | from typing import List
def trap_two_pointer(height: List[int]) -> int:
if not height:
return 0
volume = 0
left, right = 0, len(height) - 1
left_max, right_max = height[left], height[right]
while left < right:
left_max, right_max = max(height[left], left_max), max(height[right], ... | 21.807692 | 88 | 0.549383 |
670b63e449cbf8d057768d99f03d611ad6677032 | 37,008 | py | Python | paddlenlp/transformers/gau_alpha/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/gau_alpha/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/gau_alpha/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle 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 appli... | 38.751832 | 131 | 0.601681 |
67d5ee64eae1907099136d93d11c7438714c2c4a | 215 | py | Python | __init__.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | __init__.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | __init__.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 26 16:00:46 2019 @author: sfd
"""
import sys,os
sys.path.append(os.getcwd()+"/service")
#os.popen('adb shell mkdir foldername')
| 16.538462 | 50 | 0.609302 |
221784b90744c8ad8addeb3cf5bb8982987ed7d6 | 744 | py | Python | tarefas-poo/lista-03/navio/view/paineis/painel_mostra_navio.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/navio/view/paineis/painel_mostra_navio.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/navio/view/paineis/painel_mostra_navio.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício do Navio
# --------------------------
# Classe que permite mostra na tela os dados de um navio.
#
class PainelMostraNavio:
def mostre(self, navio):
pt = navio.peso_transportado()
pm = navio.peso_maximo()
perc_t = (pt / p... | 33.818182 | 111 | 0.545699 |
1891ed554b7f58dbabc3dfd92bb83f6c6326bc6a | 1,050 | py | Python | making_anagrams.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | making_anagrams.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | making_anagrams.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | def main():
a = input().strip()
b = input().strip()
print(number_needed(a, b))
def number_needed(a, b):
sort_a = sorted(a)
sort_b = sorted(b)
a_len = len(sort_a)
b_len = len(sort_b)
if a_len < 1:
return b_len
elif b_len < 1:
return a_len
else:
num_need... | 22.826087 | 39 | 0.444762 |
55e6df57f02b71d6bd2a8eea1d5fd82809606ea3 | 950 | py | Python | backend/apps/iamstudent/migrations/0015_custom_migration_timestamps.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/iamstudent/migrations/0015_custom_migration_timestamps.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/iamstudent/migrations/0015_custom_migration_timestamps.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | import logging
from django.db import migrations, transaction
logger = logging.getLogger("django")
def update_emails(apps, schema_editor):
EmailToSend = apps.get_model('iamstudent', 'EmailToSend')
EmailToHospital = apps.get_model('iamstudent', 'EmailToHospital')
for email in EmailToSend.objects.all():
... | 23.170732 | 69 | 0.647368 |
7fe0c2a6b8a10de2335d04924b2ab5a369ba3558 | 3,739 | py | Python | src/server/app/endpoints/standby/profile/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/endpoints/standby/profile/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/endpoints/standby/profile/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from ...db.settings import db, oidc
from flask import Flask, Blueprint, render_template, abort, g, request
from oauth2client.client import OAuth2Credentials
from flask_jwt_extended import (create_access_token, create_refresh_token, jwt_required, jwt_refresh_token_required, get_jwt_identity, get_raw_jwt, set_access_coo... | 27.902985 | 176 | 0.72506 |
187eecd48f84c8f1b492fed02beda070c3344b73 | 312 | py | Python | randtext.py | two-doges/tpf | a98f68fba40b3f07ce0ef14f6ca982e915ee3e07 | [
"MIT"
] | 2 | 2018-03-04T13:36:22.000Z | 2018-03-04T13:36:33.000Z | randtext.py | two-doges/tpf | a98f68fba40b3f07ce0ef14f6ca982e915ee3e07 | [
"MIT"
] | null | null | null | randtext.py | two-doges/tpf | a98f68fba40b3f07ce0ef14f6ca982e915ee3e07 | [
"MIT"
] | null | null | null | import random
import sys
sys.path.append("..")
def get_randtext(len=50):
ans = ""
chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789'
for i in range(len):
e = random.randint(0,61)
ans += chars[e]
return ans
if __name__=="__main__":
print(get_randtext())
| 22.285714 | 76 | 0.666667 |
a101cc0cc7d2f3e30ced2bd7fea990a1dccc4ca4 | 2,744 | py | Python | games/rpg/dqn_controller.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | 2 | 2021-01-07T01:10:49.000Z | 2022-01-21T09:37:16.000Z | games/rpg/dqn_controller.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | games/rpg/dqn_controller.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | from envs.rpg.rpg import RPGEnvironment
from envs.rpg.levels.large_tutorial import LargeTutorial
from envs.rpg.levels.small_tutorial import SmallTutorial
from envs.rpg.levels.slash_spike import SlashSpike
import json
import numpy as np
import random
import tensorflow as tf
np.random.seed(1)
random.seed(1)
model_save... | 30.831461 | 97 | 0.653426 |
a1035620203a965acaa36f37842d4f5e586660cd | 16,144 | py | Python | RDS/circle3_central_services/token_storage/tests/lib/test_2_token_storage.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/token_storage/tests/lib/test_2_token_storage.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/token_storage/tests/lib/test_2_token_storage.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import unittest
import pytest
from lib.Storage import Storage
from RDS import Token, OAuth2Token, User, LoginService, OAuth2Service, Util
from lib.Exceptions.StorageException import (
UserExistsAlreadyError,
UserHasTokenAlreadyError,
UserNotExistsError,
)
from RDS.ServiceException import (
ServiceNotEx... | 37.457077 | 87 | 0.579286 |
b820b1c606e6a2cb29de80253c10073661d546a3 | 9,231 | py | Python | wz/backend/interface_template_fields.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/backend/interface_template_fields.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/backend/interface_template_fields.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
backend/interface_template_fields.py - last updated 2021-05-22
Controller/dispatcher for the template-filler module.
==============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in comp... | 37.677551 | 78 | 0.573936 |
c5131f90d418026cde9ec65d15c9fa1a69478a75 | 6,034 | py | Python | oneflow/python/framework/local_blob.py | caishenghang/oneflow | db239cc9f98e551823bf6ce2d4395bd5c339b1c5 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/framework/local_blob.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/framework/local_blob.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... | 31.925926 | 114 | 0.668876 |
c5232a4d920d5c1791cb0ad922e8bc20c21d5189 | 180 | py | Python | exercises/pt/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"docs = list(nlp.pipe(TEXTS))" in __solution__
), "Você está usando nlp.pipe envolvido em uma lista (list)?"
__msg__.good("Bom trabalho!")
| 30 | 65 | 0.627778 |
c548c530afdc4e3d2859ad0c7fcd997ddf2e643f | 294 | py | Python | exercises/de/solution_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/de/solution_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/de/solution_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("de")
doc = nlp("Ich habe eine Katze")
# Schlage den Hash für das Wort "Katze" nach
katze_hash = nlp.vocab.strings["Katze"]
print(katze_hash)
# Schlage katze_hash nach, um den String zu erhalten
katze_string = nlp.vocab.strings[katze_hash]
print(katze_string)
| 22.615385 | 52 | 0.755102 |
b8e16f929bbe355b7be5c0f425ce37c137ec3151 | 198 | py | Python | turngen/ai_base.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | turngen/ai_base.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | turngen/ai_base.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | from turn import Turn
class ai_base:
# color is 0 for white or 1 for black
def __init__(self, player):
self.player = player
def calculateTurn(self, board):
return Turn(0,0,1,1,True)
| 16.5 | 38 | 0.691919 |
626d9d546eff99796b7917e2bf088b26e0bd4636 | 1,541 | py | Python | source/cloudsync.py | marctrommen/bloggenerator | 5b4fed4cd12a899829261d492328dfc39a78153d | [
"MIT"
] | null | null | null | source/cloudsync.py | marctrommen/bloggenerator | 5b4fed4cd12a899829261d492328dfc39a78153d | [
"MIT"
] | null | null | null | source/cloudsync.py | marctrommen/bloggenerator | 5b4fed4cd12a899829261d492328dfc39a78153d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import filecmp
import subprocess
import os
import shutil
class CloudSync(object):
def __init__(self):
self.__cloud_mountpoint = '/media/marco/gmx'
def __mount_cloud(self):
command = ['mount', self.__cloud_mountpoint]
error_code = -1
with subprocess.Popen(... | 22.661765 | 74 | 0.707982 |
b23874081a22d246c0909a594345b7af818fd9b2 | 2,050 | py | Python | tools/pythonpkg/tests/fast/arrow/test_arrow_replacement_scan.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/arrow/test_arrow_replacement_scan.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/arrow/test_arrow_replacement_scan.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
import pytest
import os
import pandas as pd
try:
import pyarrow.parquet as pq
import pyarrow.dataset as ds
can_run = True
except:
can_run = False
class TestArrowReplacementScan(object):
def test_arrow_table_replacement_scan(self, duckdb_cursor):
if not can_run:
ret... | 37.962963 | 111 | 0.677073 |
b27d485d469b532a016ac931b3c92df6632581ed | 123 | py | Python | group3-module1-tobechukwu/Tasks/Python Image resize/hello.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | group3-module1-tobechukwu/Tasks/Python Image resize/hello.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | group3-module1-tobechukwu/Tasks/Python Image resize/hello.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | from PIL import Image
img = Image.open("img_resize.jpg")
re_img = img.resize((700,300))
re_img.show()
#img.show()
| 15.375 | 35 | 0.658537 |
a74123f1653a55720b5e0e3853a156d6a77cb057 | 420 | py | Python | Project Euler Qusetions 51 - 60/Project Euler Question 53.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 51 - 60/Project Euler Question 53.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 51 - 60/Project Euler Question 53.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 53
#Combinatoric selections
def factorial(x):
if x > 1:
return x * factorial(x - 1)
else:
return 1
comb_list = []
for x in range(1, 101):
for y in range(1, 101):
if y > x:
break
combinations = int(factorial(x) / (factorial(y) * factorial... | 21 | 76 | 0.566667 |
a7ae8f8227992cf8efc320728d75748c7ccf1b57 | 1,777 | py | Python | stphohapp/views.py | itechtian/stphoh | 5a778deece3a690e0ec92c799b0b87ba26f1892c | [
"MIT"
] | null | null | null | stphohapp/views.py | itechtian/stphoh | 5a778deece3a690e0ec92c799b0b87ba26f1892c | [
"MIT"
] | null | null | null | stphohapp/views.py | itechtian/stphoh | 5a778deece3a690e0ec92c799b0b87ba26f1892c | [
"MIT"
] | null | null | null | from django.shortcuts import render, reverse
from django.http import HttpResponseRedirect
from .models import Patient, Result
def admin_view(request):
context = {'Patient':Patient.objects.all()}
return render(request, "adminbase.html", context)
def hiv_test(request):
if request.method == "POST":
f... | 37.020833 | 107 | 0.683174 |
a7b5a5aa0086bf94663363f1507118c810efe76d | 2,446 | py | Python | server/weather/RestWeatherSource.py | EveryOtherUsernameWasAlreadyTaken/BIS | e132ce42dcc74e634231398dfecb08834d478cba | [
"MIT"
] | 3 | 2019-07-09T08:51:20.000Z | 2019-09-16T17:27:54.000Z | server/weather/RestWeatherSource.py | thomasw-mitutoyo-ctl/BIS | 08525cc12164902dfe968ae41beb6de0cd5bc411 | [
"MIT"
] | 24 | 2019-06-17T12:33:35.000Z | 2020-03-27T08:17:35.000Z | server/weather/RestWeatherSource.py | EveryOtherUsernameWasAlreadyTaken/BIS | e132ce42dcc74e634231398dfecb08834d478cba | [
"MIT"
] | 1 | 2020-03-24T17:54:07.000Z | 2020-03-24T17:54:07.000Z | import logging
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from WeatherSource import WeatherSource
log = logging.getLogger(__name__)
class RestWeatherSource(WeatherSource):
"""
This WeatherSource serves a simple HTTP server which accepts simple GET requests. When a GET request arrived
t... | 35.970588 | 112 | 0.605478 |
a7be27c27fecb3715f48a3e9f5c0137614000958 | 3,898 | py | Python | tests/test_ausschreibungslos.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_ausschreibungslos.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_ausschreibungslos.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import pytest # type:ignore[import]
from bo4e.com.ausschreibungslos import Ausschreibungslos, AusschreibungslosSchema
from bo4e.enum.preismodell import Preismodell
from bo4e.enum.rechnungslegung import Rechnungslegung
from bo4e.enum.sparte import Sparte
from bo4e.enum.vertragsform import Vertragsform
from tests.seria... | 41.031579 | 104 | 0.655721 |
3ba582fb1c60a969e56afd0b5185358be55c3ea3 | 4,550 | py | Python | scripts/dataset_statistics.py | yokuyuki/Enrichr | ed8e4b5639b73a740f2d1e99b068049b114955ca | [
"Apache-2.0"
] | 1 | 2017-09-19T01:36:47.000Z | 2017-09-19T01:36:47.000Z | scripts/dataset_statistics.py | yokuyuki/Enrichr | ed8e4b5639b73a740f2d1e99b068049b114955ca | [
"Apache-2.0"
] | 3 | 2015-05-09T06:19:08.000Z | 2016-11-03T06:15:03.000Z | scripts/dataset_statistics.py | yokuyuki/Enrichr | ed8e4b5639b73a740f2d1e99b068049b114955ca | [
"Apache-2.0"
] | null | null | null | import json
import os
gmt_lookup = dict()
gmt_lookup['BioCarta.gmt'] = ('BioCarta', 'http://pid.nci.nih.gov/download.shtml')
gmt_lookup['Cancer_Cell_Line_Encyclopedia.gmt'] = ('Cancer Cell Line Encyclopedia', 'http://www.broadinstitute.org/ccle/data/browseData')
gmt_lookup['ChEA.gmt'] = ('ChEA', 'http://amp.phar... | 77.118644 | 150 | 0.732308 |
5a551b8b3524c83268270b2b2bb3e85255659053 | 6,175 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/icx/test_icx_logging.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/icx/test_icx_logging.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/icx/test_icx_logging.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright: (c) 2019, Ansible Project
# 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
import json
from ansible_collections.community.general.tests.unit.compat.mock import patch
from an... | 41.166667 | 132 | 0.636599 |
ce49bc415deed892a71cf036b2fcc9e9e8866a9e | 2,974 | py | Python | experiments/nets/Research/case04/sumoenv.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | 4 | 2020-10-11T01:30:13.000Z | 2021-04-27T16:03:41.000Z | experiments/nets/Research/case04/sumoenv.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | experiments/nets/Research/case04/sumoenv.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | import os
import sys
import traci
import numpy as np
class SumoEnv:
place_len = 7.5
place_offset = 8.50
lane_len = 10
lane_ids = ['-gneE0_0', '-gneE0_1', '-gneE1_0', '-gneE1_1', '-gneE2_0', '-gneE2_1', '-gneE3_0', '-gneE3_1']
def __init__(self, label='default', gui_f=False):
self.label = ... | 32.681319 | 111 | 0.549092 |
0c8c3ee7e181a0905622a2e6245a44e031a14663 | 2,377 | py | Python | pycsw/pycsw/core/formats/fmt_json.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 118 | 2015-01-07T00:24:09.000Z | 2022-03-19T15:35:43.000Z | pycsw/pycsw/core/formats/fmt_json.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 319 | 2015-01-06T23:51:46.000Z | 2022-03-20T11:22:57.000Z | pycsw/pycsw/core/formats/fmt_json.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 113 | 2015-01-07T00:42:23.000Z | 2022-02-19T18:05:08.000Z | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
# Copyright (c) 2017 Ricardo Garcia Silva
#
# Permission is hereby granted, f... | 33.957143 | 78 | 0.671435 |
0b7ceb2cccaccabf04b4842293aa7cdbe1be8244 | 6,654 | py | Python | checks/load_in_browser.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | checks/load_in_browser.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | checks/load_in_browser.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
Collects information by loading pages in a browser.
Information includes:
- whether the document width adapts well to viewports as little as 360 pixels wide
- whether javascript errors or errors from missing resources occur
- what CSS font-family properties are in use
- what cookies are set during loading the pag... | 35.582888 | 156 | 0.581755 |
0bbfec64a1343471f7dadb8a14b31ce2058aa0ad | 1,401 | py | Python | torch/fx/experimental/fx2trt/converters/maxpool.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | torch/fx/experimental/fx2trt/converters/maxpool.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | torch/fx/experimental/fx2trt/converters/maxpool.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | import torch
import tensorrt as trt
from torch.fx.experimental.fx2trt.converter_registry import tensorrt_converter
from .converter_utils import mark_as_int8_layer, extend_mod_attr_to_tuple
def common_maxpool(network, mod, dimension, input_val, layer_name):
kernel_size = extend_mod_attr_to_tuple(mod, "kernel_size"... | 35.923077 | 99 | 0.747323 |
b2f937927ed6b42dc28c2ea20854db281f7c64e3 | 6,078 | py | Python | src/config_db/tests/test_processing_block.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/config_db/tests/test_processing_block.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/config_db/tests/test_processing_block.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | """High-level API tests on processing blocks."""
import os
import pytest
from ska_sdp_config import config, entity, backend
# pylint: disable=missing-docstring,redefined-outer-name
PREFIX = "/__test_pb"
WORKFLOW = {
'id': 'test_rt_workflow',
'version': '0.0.1',
'type': 'realtime'
}
# pylint: disable=... | 30.542714 | 78 | 0.634913 |
65083a601c220863de10788eeab61c1a10edd19d | 791 | py | Python | THC/2021/crypto/Rsa_internal_attacker/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | THC/2021/crypto/Rsa_internal_attacker/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | THC/2021/crypto/Rsa_internal_attacker/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from Crypto.Util.number import getPrime, inverse, bytes_to_long
import random
from math import gcd
def init():
p = getPrime(1024)
q = getPrime(1024)
return p, q
def new_user(p, q):
phi = (p - 1) * (q - 1)
while True:
e = random.randint(2, 100000)
if gcd(e, p... | 20.815789 | 63 | 0.561315 |
041c268d8b5bc4823437c97b7ba8c2541ac8e1e8 | 1,638 | py | Python | scripts/fabsp/vim.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/vim.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/vim.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*
from os import environ
from _internal_utils import exec_bash, lines, pf
from fabric.api import cd, settings, sudo
if not environ.get("VIM"):
environ["VIM"] = "8.1.0630"
def depend_debian():
"""
apt-get install -y libncurses5-dev libncursesw5-dev
"""
... | 21.84 | 98 | 0.612943 |
0443b0eb724be8c1428c443397d11e4a2b9ffec6 | 582 | py | Python | admin-tutorial/AdminActions/actions/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | admin-tutorial/AdminActions/actions/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | admin-tutorial/AdminActions/actions/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.contrib import admin
from .models import Article
# Register your models here.
def make_published(modeladmin, request, queryset):
queryset.update(status='p') # queryset 是一个集合对象, update 可以批量对集合做更新操作.
make_published.short_description = "Mark selected stories as published"
class Ar... | 30.631579 | 92 | 0.668385 |
4a1982e3f5eb9d2a758adeed5e499a650df907ef | 645 | py | Python | profiles/util.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | profiles/util.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | profiles/util.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User, AnonymousUser
def user_authenticated(user):
"""
Checks if a user is authenticated.
:param user: User to check
:return: True, if the useris verified and accepted general terms and conditions as well as the privacy policy;
False otherwise.
"""
if ... | 30.714286 | 114 | 0.669767 |
4f8bb60b2f154c13d32c76dd341c90acef2b72e3 | 2,166 | py | Python | research/hpc/deepbsde/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/deepbsde/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/deepbsde/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.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... | 48.133333 | 109 | 0.740074 |
4f9a77c08c39fe4fdecd29ebfc1afd8ffadc5731 | 3,771 | py | Python | website/apps/fileupload/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | 1 | 2017-03-14T08:08:31.000Z | 2017-03-14T08:08:31.000Z | website/apps/fileupload/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | website/apps/fileupload/models.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | # encoding: utf-8
import os
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from django_extensions.db.fields import *
from django.db.models.signals import post_delete, pre_save
from django.disp... | 32.791304 | 137 | 0.656325 |
8c19af40a9282fa2530c691e3187ae478de40130 | 3,009 | py | Python | pocketthrone/entities/unit.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | 4 | 2016-06-05T16:48:04.000Z | 2020-03-23T20:06:06.000Z | pocketthrone/entities/unit.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | pocketthrone/entities/unit.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | from pocketthrone.entities.enum import UnitType, UnitCategory, SkillLevel
from pocketthrone.entities.weapon import Weapon
# Unit class for std-units and heroes
class Unit:
# system properties
_id = -1
basename = None
_instanciated = False
_possible_moves = []
# engine properties
name = ""
name_de = ""
image_... | 21.340426 | 75 | 0.695248 |
50b2593959249682c0de283b6178725d2aa3d205 | 16,223 | py | Python | suds/properties.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-22T23:34:03.000Z | 2022-03-31T09:31:34.000Z | suds/properties.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 317 | 2018-10-05T23:51:48.000Z | 2022-03-22T17:38:52.000Z | suds/properties.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-10T18:55:00.000Z | 2022-03-28T07:27:04.000Z | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | 29.821691 | 80 | 0.551501 |
e876deef02ebb383ab43fb4de4d2a018fef93267 | 2,265 | py | Python | python/en/archive/dropbox/udacity-ds_and_algos/python_basics/test_zip.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/udacity-ds_and_algos/python_basics/test_zip.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/udacity-ds_and_algos/python_basics/test_zip.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # zip() in Python
# https://www.geeksforgeeks.org/zip-in-python/
# 1. zip() in Python
name = ["Manjeet", "Nikhil","Shambhavi", "Astha"];
roll_no = [4,1,3,2]
marks = [40,50,60,70]
mapped = zip(name,roll_no,marks)
print(mapped)
# <zip object at 0x7f7aaebc28c8>
mapped = set(mapped)
print("The zipped result... | 31.027397 | 105 | 0.642384 |
ad233b78df4ffce0ea8d961a0ed80427b394c655 | 1,218 | py | Python | Packs/CommonScripts/Scripts/ParseWordDoc/ParseWordDoc.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/ParseWordDoc/ParseWordDoc.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/ParseWordDoc/ParseWordDoc.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from docx import Document
from docx.opc.exceptions import PackageNotFoundError
def parse_word_doc(entry_id):
res = []
errEntry = {
"Type": entryTypes["error"],
"ContentsFormat": formats["text"],
... | 30.45 | 100 | 0.65353 |
7e2f029aedae91d03a294725ee7059e1c30971b3 | 1,676 | py | Python | crm/tests/test_forms.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | 1 | 2021-01-23T21:42:10.000Z | 2021-01-23T21:42:10.000Z | crm/tests/test_forms.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | crm/tests/test_forms.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | from django.test import TestCase
from crm.forms import *
from django.contrib.auth.models import User, Permission,Group
from django.test import TestCase, Client
class TestForms(TestCase):
def setUp(self):
self.user = User.objects.create_superuser(username="user1",email="user1@example.de",password="Hallo123... | 29.403509 | 114 | 0.606802 |
7e586d1c64061f10f5ec95ea69ade113ae96fcb4 | 98,000 | py | Python | tests/test_isp.py | MedPhyDO/pygqa | 580b2c6028d2299790a38262b795b8409cbfcc37 | [
"MIT"
] | 3 | 2021-02-25T13:19:52.000Z | 2021-03-03T03:46:46.000Z | tests/test_isp.py | MedPhyDO/app-skeleton | 1161736ccf356c704c6c13b17fa11aca64b17dac | [
"MIT"
] | null | null | null | tests/test_isp.py | MedPhyDO/app-skeleton | 1161736ccf356c704c6c13b17fa11aca64b17dac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Alle in isp befindlichen Klassen und Funktionen prüfen.
Alle Laufzeit Fehlermeldungen sind bei der Testausführung gewollt
Nach der Ausführung steht am Ende OK wenn alle Tests durchgefürt wurden.
Bei Fehlern in den Überprüfungen steht am Ende::
=====================================... | 37.376049 | 329 | 0.518061 |
7ed44f341fa2054528408df6fb4e681538fe6935 | 5,249 | py | Python | src/mitglieder/models.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 1 | 2021-12-20T20:15:26.000Z | 2021-12-20T20:15:26.000Z | src/mitglieder/models.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | null | null | null | src/mitglieder/models.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | null | null | null | from datetime import date
from django.db import models
from django.db.models import Q
from simple_history.models import HistoricalRecords
from aemter.models import Funktion
class Mitglied(models.Model):
"""
Datenbankmodell Mitglied
Felder:
* name: Nachname des Mitglieds. Darf nicht null sein.
* v... | 39.765152 | 137 | 0.701086 |
7eebabc1140cdbc9040d4a64ccc9a499542c1cdd | 5,101 | py | Python | official/cv/xception/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/xception/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/xception/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 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... | 39.542636 | 120 | 0.649873 |
bc11199f000e7d5428e98fb11fb984a97f704c6b | 233 | py | Python | user/drivers/sequencer-linux/linux/gen_bytes.py | losfair/FlatMk-v0 | 6e78666e8982e41688c24828093ea6b73b76ea11 | [
"MIT"
] | 5 | 2020-01-11T22:38:34.000Z | 2021-06-01T13:40:55.000Z | user/drivers/sequencer-linux/linux/gen_bytes.py | losfair/FlatMk-v0 | 6e78666e8982e41688c24828093ea6b73b76ea11 | [
"MIT"
] | null | null | null | user/drivers/sequencer-linux/linux/gen_bytes.py | losfair/FlatMk-v0 | 6e78666e8982e41688c24828093ea6b73b76ea11 | [
"MIT"
] | null | null | null | import sys
with open(sys.argv[1], "rb") as f:
data = f.read()
bstr = []
for b in data:
bstr.append(hex(b))
print("const uint8_t LINUX_INIT_ELF_BYTES[{}] = {};\n".format(len(bstr), "{" + ",".join(bstr) + "}")) | 29.125 | 105 | 0.540773 |
70b3d1c5ee575cb84f905181cfc006bc4ccc3918 | 637 | py | Python | Main.py | PeerPressured/Covid_Genome_Scanner | a9579b9e862e4a46001d6eb7f8ad54aaf9d9dd41 | [
"MIT"
] | null | null | null | Main.py | PeerPressured/Covid_Genome_Scanner | a9579b9e862e4a46001d6eb7f8ad54aaf9d9dd41 | [
"MIT"
] | null | null | null | Main.py | PeerPressured/Covid_Genome_Scanner | a9579b9e862e4a46001d6eb7f8ad54aaf9d9dd41 | [
"MIT"
] | null | null | null | def sequenzenfinder(gen, seq):
copy = gen
displ = 0
indizes = []
while True:
if seq in copy:
index = copy.index(seq)
indizes.append(index+displ)
copy = copy[index+1:]
displ += index+1
else:
return indizes
filename = 'LongCovi... | 24.5 | 67 | 0.613815 |
70f04531610aef6d7f7dd4e81208f71d9f91a43a | 941 | py | Python | src/milk2.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/milk2.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/milk2.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | """
ID: isaiahl1
LANG: PYTHON2
TASK: milk2
"""
import operator
fin = open ('milk2.in', 'r')
fout = open ('milk2.out', 'w')
def main():
"""
3
300 1000
700 1200
1500 2100
:return:
"""
N = int(fin.readline())
ranges = []
for _ in xrange(N):
a, b = map(int, fin.readline().strip().split())
ranges.append( (a... | 17.109091 | 61 | 0.63762 |
387b0102da03f4155797036fdc325784fc4c950e | 860 | py | Python | spo/scripts/custom_scripts/leave_day_calculations.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | null | null | null | spo/scripts/custom_scripts/leave_day_calculations.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/scripts/custom_scripts/leave_day_calculations.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.data import nowdate, getdate
from frappe import _
@frappe.whitelist()
def get_leaves_taken(employee, leave_type):... | 39.090909 | 117 | 0.682558 |
2a4a40af96b3dbe0c7c6d60b31801973b1e4d514 | 702 | py | Python | setup.py | mnes-io/chff | 9f450183ae508a56bf6869f59e7ffce24f56b269 | [
"MIT"
] | null | null | null | setup.py | mnes-io/chff | 9f450183ae508a56bf6869f59e7ffce24f56b269 | [
"MIT"
] | null | null | null | setup.py | mnes-io/chff | 9f450183ae508a56bf6869f59e7ffce24f56b269 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='chff',
version='0.1.5',
install_requires=[
"aiortc",
"nose",
],
description='Overlay Network Reference Implementation',
classifiers=[
'Development Status :: 1 - Planning',
'License :: OSI Approved :: MIT License',
... | 28.08 | 61 | 0.578348 |
2d918125e046e92b5b2fcec1aaec79e936bbddfa | 28,984 | py | Python | test/test_npu/test_distributed.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_distributed.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_distributed.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... | 34.962606 | 99 | 0.5866 |
2dc58389fb563c1c108a32e8f11b2fd0b00e2563 | 8,683 | py | Python | watchlist_app/api/views.py | attachemd/moviedb | c2e3b7bc3c1537c64834c2ee94492122dafdfcd4 | [
"MIT"
] | null | null | null | watchlist_app/api/views.py | attachemd/moviedb | c2e3b7bc3c1537c64834c2ee94492122dafdfcd4 | [
"MIT"
] | null | null | null | watchlist_app/api/views.py | attachemd/moviedb | c2e3b7bc3c1537c64834c2ee94492122dafdfcd4 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
from rest_framework import status, generics, mixins, viewsets
from rest_framework.decorators import api_view
from rest_framework.exceptions import ValidationError
from rest_framework.response import Response
from rest_framework.views import APIView
from watchlist_app.api.... | 30.254355 | 99 | 0.605897 |
932edf00d3009f4f8c524a59f380c5435549a3e4 | 375 | py | Python | NeuralNet/Alex/main.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | 6 | 2017-04-12T14:05:19.000Z | 2021-01-29T11:23:50.000Z | NeuralNet/Alex/main.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | NeuralNet/Alex/main.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | # include data pipe
from modelpipe import pipe
import numpy as np
#create pipe
datapipe = pipe.Pipe(data_path = "../../images/Dataset_1", train_size=0.6)
#load data
datapipe.load_data(flatten=0, print_out=1)
#train model
for i in range(10):
np.random.seed(10)
result = datapipe.run(model_name = "models/model_0"+str(... | 25 | 95 | 0.733333 |
e2124adc78315561fa6c4c434dfb3c2da235befc | 12,429 | py | Python | scripts/experimental_matching.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | null | null | null | scripts/experimental_matching.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | null | null | null | scripts/experimental_matching.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | null | null | null | #%% [markdown]
# # Hemisphere matching
#%% [markdown]
# ## Preliminaries
#%%
from pkg.utils import set_warnings
set_warnings()
import datetime
import pprint
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from graspologic.plot import pairplot
from graspolog... | 30.463235 | 100 | 0.605439 |
35a265077c70045abbf438cc7307e1011e7d9745 | 4,073 | py | Python | MT-LSTM/train.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/train.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/train.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ 训练文件
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/10/31
"""
import pandas as pd
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
import numpy as np
import torch
import sys
import os
abs_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(abs_path)
fro... | 35.72807 | 133 | 0.534741 |
ea4cd17d154bc3605bd6ca146ad0c7082637a748 | 2,187 | py | Python | aoc2020/cli.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/cli.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/cli.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from time import perf_counter
from importlib import import_module
from os.path import dirname, basename, join as join_path
from .errors import NoSolutionError
from .solution_abc import SolutionABC
def get_opts():
ap = ArgumentParser()
ap.add_argument("--test", action="store... | 35.274194 | 119 | 0.600366 |
17fdcf6678bed3d9c6f85756d4e7f97ad803236f | 1,799 | py | Python | venv/Lib/site-packages/pynance/data/lab.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 35 | 2015-03-12T04:16:14.000Z | 2020-12-17T18:10:15.000Z | venv/Lib/site-packages/pynance/data/lab.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 31 | 2015-03-16T21:31:04.000Z | 2021-01-26T00:12:34.000Z | venv/Lib/site-packages/pynance/data/lab.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 18 | 2015-09-30T10:40:26.000Z | 2021-01-25T21:20:44.000Z | """
.. Copyright (c) 2014- Marshall Farrier
license http://opensource.org/licenses/MIT
Data - building labels (:mod:`pynance.data.lab`)
====================================================
.. currentmodule:: pynance.data.lab
These functions are intended to be used in conjunction
with :func:`functools.partial` to ... | 31.561404 | 77 | 0.622012 |
a4aca6cdfc51635e5bb0a033367ae85e9487e710 | 4,904 | py | Python | test/test_npu/test_floor_divide.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_floor_divide.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_floor_divide.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... | 40.528926 | 77 | 0.617659 |
5e0a20530c94cb511f529986c16deb5e62506b21 | 499 | py | Python | Points.py | BogyMitutoyoCTL/Riesen-Tetris-3 | 349d7b6f12c2ddf0b66683c904406a5e8596228d | [
"MIT"
] | 1 | 2019-10-22T14:02:34.000Z | 2019-10-22T14:02:34.000Z | Points.py | BogyMitutoyoCTL/Riesen-Tetris-3 | 349d7b6f12c2ddf0b66683c904406a5e8596228d | [
"MIT"
] | null | null | null | Points.py | BogyMitutoyoCTL/Riesen-Tetris-3 | 349d7b6f12c2ddf0b66683c904406a5e8596228d | [
"MIT"
] | null | null | null | class Points:
def __init__(self):
self.points = 0
def lines(self, i):
if i == 1:
self.points = self.points + 40
if i == 2:
self.points = self.points + 100
if i == 3:
self.points = self.points + 300
if i == 4:
self.points = ... | 22.681818 | 44 | 0.486974 |
52499dc53897fb3902fd3b2dc5e13c8e4c1f0086 | 16,905 | py | Python | wz/ui_modules/tab_grade_editor_term.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui_modules/tab_grade_editor_term.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui_modules/tab_grade_editor_term.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ui/tab_grade_editor_term.py
Last updated: 2021-03-19
Editor for grades – manage grades for school terms.
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in complia... | 35.366109 | 78 | 0.625377 |
2173f0a79dff091b71860dab7d3bacdd5b8d0b20 | 3,601 | py | Python | Algorithms/notes/recursion_practice.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | null | null | null | Algorithms/notes/recursion_practice.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/02_algorithms/Algorithms/notes/recursion_practice.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Algorithms :: Practice - recursion
"""
# %%
def foo1(x=3):
def foo2(y=2):
def foo3(z=1):
return z
return foo3() + y
return foo2() + x
print(foo1())
# %%
def summ(n: int) -> int:
if n == 1:
return n
else:
return n + summ(n - 1)
print(summ(4))
# %... | 22.936306 | 91 | 0.581783 |
1d3ce454d05b00409952f22337450b978253643b | 1,049 | py | Python | marthakarpeter/ex2.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | marthakarpeter/ex2.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | marthakarpeter/ex2.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | # ex1 APPFS Martha Karpeter 367847
import sys
import xml.etree.ElementTree as ET
file = sys.argv[-1]
tree = ET.parse(open(file, "r"))
root = tree.getroot()
def find(tree, node):
found = tree.find(node)
if found == None:
print("No {} in file".format(node))
found = []
return found
csv =... | 28.351351 | 112 | 0.551954 |
d5a0b13c631785f7d23a94a1fef11d921258f702 | 2,105 | py | Python | __init__.py | JoanChirinos/IWasSick | f7ab65407e210a3e20b942596fe9a741207f8beb | [
"MIT"
] | null | null | null | __init__.py | JoanChirinos/IWasSick | f7ab65407e210a3e20b942596fe9a741207f8beb | [
"MIT"
] | null | null | null | __init__.py | JoanChirinos/IWasSick | f7ab65407e210a3e20b942596fe9a741207f8beb | [
"MIT"
] | null | null | null | #! /usr/bin/python3
from flask import (Flask, render_template, redirect, url_for,
session, request, flash)
from util import db
app = Flask(__name__)
app.secret_key = 'DONT LOOK!!!!'
@app.route('/')
def home():
if 'email' in session:
return render_template('logged_in_index.html')
... | 24.476744 | 67 | 0.63943 |
98a2e78a3c24d70f1ba3dd03d0ee0d5b875687e4 | 9,189 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/01_grundlagen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/01_grundlagen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/01_grundlagen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 01_grundlagen.py
# Project: Kapitel_07_Sequenzen_Mengen_und_Generatoren
# Created Date: Tuesday 26.02.2019, 11:02
# Author: Apop85
# -----
# Last Modified: Tuesday 05.03.2019, 15:39
# -----
# Copyright (c) 2019 Apop85
# This software is published under the MIT l... | 117.807692 | 585 | 0.78126 |
63ea9fde35c924cb3488b6987ca9bf50acb51aea | 4,195 | py | Python | nodes/ue02/moveTurtle_distance_LOESUNG.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/ue02/moveTurtle_distance_LOESUNG.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/ue02/moveTurtle_distance_LOESUNG.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python3
# --- moveTurtle_distance_LOESUNG.py ------
# Version vom 16.11.2020 by OJ
# ohne OOP und Klasse
# ----------------------------------
# Starten von ROS und der TurtleSim
# $1 roscore
# $2 roslaunch turtlebot3_gazebo turtlebot3_house.launch
# $3 rosrun rtc moveTurtle_distance_gazebo.py
# (vorher c... | 33.56 | 75 | 0.601907 |
f624b3d43b6d50614f6f8e8a181ccf0f111e7a60 | 2,544 | py | Python | official/nlp/prophetnet/src/utils/eval_score.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/prophetnet/src/utils/eval_score.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/prophetnet/src/utils/eval_score.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 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... | 27.354839 | 78 | 0.610456 |
2ec8c7af211c0b5d149b59315ba8d7953085f12a | 3,231 | py | Python | RFID_auslesen_LCD.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | RFID_auslesen_LCD.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | RFID_auslesen_LCD.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
import time
import RPi.GPIO as GPIO
import MFRC522
import signal
import busio
import board as board1
import adafruit_character_lcd.character_lcd_i2c as character_lcd
import Database
from Database import Database
import ast
# Definiere LCD Zeilen und Spaltenanzahl.
lcd_co... | 28.095652 | 88 | 0.60848 |
2ef2f2004c51175ade2e82b408fd8dd4522ad343 | 682 | py | Python | code/begin/Cookie.py | redxyb/Flask | 4ee226501f16eb0fa5cb585dc6bf780005fa8a28 | [
"MIT"
] | null | null | null | code/begin/Cookie.py | redxyb/Flask | 4ee226501f16eb0fa5cb585dc6bf780005fa8a28 | [
"MIT"
] | null | null | null | code/begin/Cookie.py | redxyb/Flask | 4ee226501f16eb0fa5cb585dc6bf780005fa8a28 | [
"MIT"
] | null | null | null | '''
Author: xyb
Date: 2020-08-10 18:06:52
LastEditTime: 2020-08-10 18:34:28
'''
from flask import Flask, make_response, redirect, request
app = Flask(__name__)
#设置cookie
@app.route('/set_cookie')
def set_cookie():
resp = make_response('set_cookie ok')
resp.set_cookie('username', 'xyb', max_age=3600) #max_ag... | 18.944444 | 66 | 0.68915 |
2ef97251288ee2925580a4ac7956e57e50d63431 | 736 | py | Python | Problems/Dynamic Programming/Easy/PascalTriangle/test_pascal_triangle.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Easy/PascalTriangle/test_pascal_triangle.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Easy/PascalTriangle/test_pascal_triangle.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from pascal_triangle import generate, getRow
class Test(TestCase):
def test_generate(self):
self.assertTrue(generate(1) == [[1]])
self.assertTrue(generate(2) == [[1], [1, 1]])
self.assertTrue(generate(3) == [[1], [1, 1], [1, 2, 1]])
self.assertTrue(gene... | 40.888889 | 95 | 0.53125 |
25ccf02f07ff391e152d0dc6435f9657af7dcbb0 | 289 | py | Python | etc code/make_movie1.py | gusghrlrl101/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 11 | 2019-06-17T02:59:01.000Z | 2021-05-24T14:10:04.000Z | etc code/make_movie1.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | null | null | null | etc code/make_movie1.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 3 | 2019-06-17T02:59:32.000Z | 2019-07-03T04:31:30.000Z | import cv2
import os
from glob import glob
fourcc = cv2.VideoWriter_fourcc(*'DIVX')
out = cv2.VideoWriter('result1.avi', fourcc, 24.0, (1280, 720))
img_paths = sorted(glob('*[0-9].png'))
for ind, img_path in enumerate(img_paths):
img = cv2.imread(img_path)
out.write(img)
out.release()
| 24.083333 | 63 | 0.719723 |
e2a35d584959ae99843bafb3656bd6fd7fb6b40f | 2,783 | py | Python | research/cv/gan/src/param_parse.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/gan/src/param_parse.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/gan/src/param_parse.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... | 59.212766 | 114 | 0.699605 |
39521d5ee9e97573f6ceb47868c517bb312c6928 | 330 | py | Python | pusta1/config.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | pusta1/config.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | pusta1/config.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | app_name = "pusta1"
prefix_url = "pusta1"
static_files = {
'js': {
'pusta1/js/': ['main.js', ]
},
'css': {
'pusta1/css/': ['main.css', ]
},
'html': {
'pusta1/html/': ['index.html', ]
}
}
permissions = {
"edit": "Editing actualy nothing.",
"sample1": "sample1longve... | 18.333333 | 40 | 0.487879 |
201b911da6e44fbbfb75076d67137a743cb199f1 | 874 | py | Python | setup.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | 3 | 2018-05-10T13:51:42.000Z | 2020-07-05T16:43:45.000Z | setup.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | null | null | null | setup.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | 1 | 2020-04-22T09:06:17.000Z | 2020-04-22T09:06:17.000Z | from setuptools import setup, find_packages
setup(
name="tradingbot",
version="0.1a0",
packages=['tradingbot'],
install_requires=[
'trading212api'
],
zip_safe=False,
author="Federico Lolli",
author_email="federico123579@gmail.com",
description="Package to invest Trading212",... | 30.137931 | 59 | 0.615561 |
b3b3247b69dd6d2c3fb39bdc65a4e36c66e47ade | 5,831 | py | Python | publ/cli.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 6 | 2018-03-29T02:07:44.000Z | 2018-09-26T00:17:31.000Z | publ/cli.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 82 | 2018-04-01T08:53:59.000Z | 2018-09-28T23:45:05.000Z | publ/cli.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | null | null | null | """ CLI utilities for Publ """
# pylint:disable=too-many-arguments
import itertools
import logging
import os.path
import re
import time
import arrow
import click
import slugify
from flask.cli import AppGroup, with_appcontext
from pony import orm
from . import queries
from .config import config
LOGGER = logging.getL... | 33.705202 | 99 | 0.624936 |
923e246774c40f0baba2357271d7034cba423a4b | 4,442 | py | Python | mumath/context/chemistry.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/context/chemistry.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/context/chemistry.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | def normal(): return dict(mathvariant="normal")
_ELEMENTS = [
(1, r"H", "Helium"), # ^1H
(1, r"D", "Deuterium"), # ^2H
(1, r"T", "Tritium"), # ^3H
(2, r"He", "Helium"),
(3, r"Li", "Lithium"),
(4, r"Be", "Beryllium"),
(5, r"B", "Boron"),
(6, r"C", "Carbon"),
(7, r"N", "Nitrogen"),... | 28.844156 | 76 | 0.463755 |
5b94b615ceff8d7df48ff33224494a96bc063d37 | 1,326 | py | Python | Chrome_Dinosaur_Game.py | kapiljaingit02/Hacktoberfest2020 | a9f496400d709f00b53e2309f6a1378121a1daca | [
"MIT"
] | null | null | null | Chrome_Dinosaur_Game.py | kapiljaingit02/Hacktoberfest2020 | a9f496400d709f00b53e2309f6a1378121a1daca | [
"MIT"
] | null | null | null | Chrome_Dinosaur_Game.py | kapiljaingit02/Hacktoberfest2020 | a9f496400d709f00b53e2309f6a1378121a1daca | [
"MIT"
] | null | null | null | import pyautogui # pip install pyautogui
from PIL import Image, ImageGrab # pip install pillow
# from numpy import asarray
import time
def hit(key):
pyautogui.keyDown(key)
return
def isCollide(data):
# Draw the rectangle for birds
for i in range(725, 825):
for j in range(280, 328):... | 27.625 | 92 | 0.500754 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.