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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e06e8e4707b7068234de170aaed8e24c681f12c0 | 13,701 | py | Python | projects/controllers/components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/controllers/components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/controllers/components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Components controller."""
import re
from datetime import datetime
from json import dumps, loads
from os.path import join
from pkgutil import get_data
from minio.error import ResponseError
from sqlalchemy import func
from sqlalchemy.exc import InvalidRequestError, IntegrityError, ProgrammingE... | 36.536 | 109 | 0.680826 |
168d5a9285df14523c58d930d430c30b6cc381b0 | 105 | py | Python | scripts/hello_world_apickham.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_apickham.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_apickham.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | # AUTHOR: Andrew Pickham
# LANGUAGE: Python
# GITHUB: https://github.com/apickham
print("Hello, World!") | 21 | 37 | 0.72381 |
bca22c01bb45daf7fc048ea91234e81aebbdef1b | 8,636 | py | Python | research/hpc/pfnn/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/pfnn/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/pfnn/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... | 43.18 | 111 | 0.655975 |
d5d689c171290516f068de134e98cffdc4f23247 | 4,928 | py | Python | rasa/core/channels/webexteams.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 5 | 2020-08-28T06:44:31.000Z | 2021-03-14T18:46:01.000Z | rasa/core/channels/webexteams.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 187 | 2020-02-25T16:07:06.000Z | 2022-03-01T13:42:41.000Z | rasa/core/channels/webexteams.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 1 | 2020-07-01T12:07:55.000Z | 2020-07-01T12:07:55.000Z | import logging
from sanic import Blueprint, response
from sanic.request import Request
from typing import Text, Optional, Dict, Any, Callable, Awaitable
from sanic.response import HTTPResponse
from webexteamssdk import WebexTeamsAPI, Webhook
from rasa.core.channels.channel import InputChannel
from rasa.core.channels.... | 35.453237 | 86 | 0.632914 |
e671cab5720414ae482245321bde3fc9e04d2587 | 3,391 | py | Python | test/test_npu/test_network_ops/test_meshgrid.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_meshgrid.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_meshgrid.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... | 42.3875 | 104 | 0.634621 |
fc6105f44e8f5da065740e2baa03305c3a8ec0ed | 1,458 | py | Python | Micropython_ESP8266/text2display.py | arkahu/Stuff | 6b5955444a4c538ce194764c28389e7043ab5cdd | [
"MIT"
] | null | null | null | Micropython_ESP8266/text2display.py | arkahu/Stuff | 6b5955444a4c538ce194764c28389e7043ab5cdd | [
"MIT"
] | null | null | null | Micropython_ESP8266/text2display.py | arkahu/Stuff | 6b5955444a4c538ce194764c28389e7043ab5cdd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ESP8266 code for controlling Adafruit 320x240 TFT FeatherWing.
Fonts are read from fontlibrary file.
"""
import fontlib_rot as flib
import machine, ili9341, rgb
spi = machine.SPI(1, baudrate=32000000)
display = ili9341.ILI9341(spi, cs=machine.Pin(0), dc=machine.Pin(15))
def reset():
... | 25.137931 | 69 | 0.548697 |
54f248f2ada2aa4f15812efd9dced0b198f45754 | 1,607 | py | Python | data-structures/ds-slinklst/python3/linked_list.py | NuclearCactus/FOSSALGO | eb66f3bdcd6c42c66e8fc7110a32ac021596ca66 | [
"MIT"
] | 59 | 2018-09-11T17:40:25.000Z | 2022-03-03T14:40:39.000Z | data-structures/ds-slinklst/python3/linked_list.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 468 | 2018-08-28T17:04:29.000Z | 2021-12-03T15:16:34.000Z | data-structures/ds-slinklst/python3/linked_list.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 253 | 2018-08-28T17:08:51.000Z | 2021-11-01T12:30:39.000Z | class Node:
def __init__(self, d, n=None):
self.data = d
self.next = n # developed the Constructor to the Node
class LinkedList:
def __init__(self, r=None):
"""Initializing the Linked list."""
self.root = r
self.size = 0
self.item = 0
def add(self, item):
... | 20.602564 | 62 | 0.511512 |
54f31771f267d904a14aebb980d0bb5c04170461 | 1,392 | py | Python | AccessPoint03/AccessPoint/tests_get.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | AccessPoint03/AccessPoint/tests_get.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | 5 | 2021-03-30T13:53:38.000Z | 2021-09-22T19:18:06.000Z | AccessPoint03/AccessPoint/tests_get.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | from django.test import TestCase
# Create your tests here.
from django.test import TestCase
import requests
import time
import datetime
import pandas as pd
import numpy as np
from pandas import DataFrame
from itertools import cycle, islice
#url = ('http://127.0.0.1:8000/AccessPoint03/AccessPoint/')
... | 28.408163 | 99 | 0.680316 |
db956a4240ded018f53f7654635696d7743ec73d | 1,148 | py | Python | wagtail_localize/machine_translators/google.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 6 | 2019-09-10T19:53:55.000Z | 2019-11-14T16:57:07.000Z | wagtail_localize/machine_translators/google.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 17 | 2019-07-11T11:17:37.000Z | 2019-11-19T16:40:31.000Z | wagtail_localize/machine_translators/google.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 2 | 2019-09-30T20:23:39.000Z | 2019-10-31T14:09:31.000Z | from google.cloud import translate
from wagtail_localize.strings import StringValue
from .base import BaseMachineTranslator
class GoogleCloudTranslator(BaseMachineTranslator):
display_name = "Google Translate"
def translate(self, source_locale, target_locale, strings):
client = translate.Translatio... | 34.787879 | 74 | 0.666376 |
5350104ed40fe7e7f842a5a28c4f562201e42f8c | 543 | py | Python | Algorithms/Implementation/grading_students.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/grading_students.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/grading_students.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
def solve(grades):
result = []
for g in grades:
c = g % 10 - 5
if g < 38:
result.append(g)
elif c == -2 or c == 3:
result.append(g + 2)
elif c == -1 or c == 4:
result.append(g + 1)
else:
result.appen... | 20.111111 | 35 | 0.508287 |
5352b14704bf34a8b6c0cc684ff382bc8cc20ad6 | 3,764 | py | Python | voc.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | voc.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | voc.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
# for DB usage
import sqlite3
logging.basicConfig(filename='log.txt',level=logging.DEBUG)
#Voc
def make_tabel_voc():
try:
con = sqlite3.connect('game.db')
con.execute('''CREATE TABLE IF NOT EXISTS voc (
id INTEGER PRIMARY KEY,
quest... | 33.017544 | 220 | 0.61238 |
72e4f3b0843e885b95a042422b2e226e7d16c9c4 | 1,440 | py | Python | Packs/ApiModules/Scripts/CrowdStrikeApiModule/CrowdStrikeApiModule_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ApiModules/Scripts/CrowdStrikeApiModule/CrowdStrikeApiModule_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ApiModules/Scripts/CrowdStrikeApiModule/CrowdStrikeApiModule_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CrowdStrikeApiModule import CrowdStrikeClient
from TestsInput.http_responses import MULTI_ERRORS_HTTP_RESPONSE, NO_ERRORS_HTTP_RESPONSE
from TestsInput.context import MULTIPLE_ERRORS_RESULT
import pytest
class ResMocker:
def __init__(self, http_response):
self.http_response = http_response
se... | 30 | 94 | 0.672222 |
72e9579bb3407b4fe89d7cff905274276f0e86cd | 9,333 | py | Python | lib/pymysql/_auth.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | 3 | 2020-07-21T06:30:10.000Z | 2021-01-21T21:32:21.000Z | lib/pymysql/_auth.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | 5 | 2021-03-19T12:10:03.000Z | 2022-03-02T15:03:31.000Z | lib/pymysql/_auth.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | """
Implements auth methods
"""
from ._compat import PY2
from .err import OperationalError
from .util import byte2int, int2byte
try:
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric impo... | 28.716923 | 122 | 0.650488 |
f46fbeb82a0a1c02bf6605d1a5b23adeb1a60984 | 15,044 | py | Python | tests/test_modeling_encoder_decoder.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | 1 | 2022-01-31T17:29:02.000Z | 2022-01-31T17:29:02.000Z | tests/test_modeling_encoder_decoder.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | null | null | null | tests/test_modeling_encoder_decoder.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 HuggingFace Inc. team.
#
# 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... | 41.67313 | 124 | 0.685655 |
431f5b129b9158d03482691e1deb3adbdd1efccf | 5,231 | py | Python | CS305/assignment5/dns_resolver.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS305/assignment5/dns_resolver.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS305/assignment5/dns_resolver.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | from socket import socket, AF_INET, SOCK_DGRAM
import time
SERVER_ADDR = '0.0.0.0'
SERVER_PORT = 5300
# Upsteam Address, use 114 DNS
UPSTREAM_ADDR = '114.114.114.114'
UPSTREAM_PORT = 53
# Duration to cleanup caches
CACHE_TTL = 1800
caches = []
# Query without EDNS
class SimplifiedQuery(object):
def __init__(s... | 31.512048 | 80 | 0.590327 |
4a5e09c39f0765618830cc20b270e0d1f17b6c8b | 133 | py | Python | users/admin.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | users/admin.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | users/admin.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Profile, UserPhoto
admin.site.register(Profile)
admin.site.register(UserPhoto)
| 22.166667 | 38 | 0.827068 |
4a7719228825339976bbabd6a5e6f5e3bf511fb5 | 993 | py | Python | Packs/XSOARContentUpdateNotifications/Scripts/CollectPacksData/CollectPacksData.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/XSOARContentUpdateNotifications/Scripts/CollectPacksData/CollectPacksData.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/XSOARContentUpdateNotifications/Scripts/CollectPacksData/CollectPacksData.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
def get_packs_data_from_context():
"""Fetched packs' data from context and formats it to an installable object.
"""
instance_context = demisto.context()
context_packs_data = instance_context.get('ContentData')
... | 25.461538 | 80 | 0.581067 |
4a8a91556b80878786a416394cfaf4b15df674f2 | 172 | py | Python | lib/python/qmk/errors.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | lib/python/qmk/errors.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/errors.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | class NoSuchKeyboardError(Exception):
"""Raised when we can't find a keyboard/keymap directory.
"""
def __init__(self, message):
self.message = message
| 28.666667 | 61 | 0.680233 |
43b592cbb44c9b8199670753a6da404969107491 | 1,925 | py | Python | utils/plotter.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | utils/plotter.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | utils/plotter.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from utils.lib import mkdir
def plot_pareto(generations, colors, markers, labels, x_la... | 33.189655 | 101 | 0.64 |
43e0aa76ea75028a34048f14e52e192b5ea6c82f | 619 | py | Python | dask_controller/distributed_single.py | ncgr/Dask_Interpro | 9aabd13dc0d49d6d5092901bbf4b62fefc9f0c43 | [
"MIT"
] | null | null | null | dask_controller/distributed_single.py | ncgr/Dask_Interpro | 9aabd13dc0d49d6d5092901bbf4b62fefc9f0c43 | [
"MIT"
] | null | null | null | dask_controller/distributed_single.py | ncgr/Dask_Interpro | 9aabd13dc0d49d6d5092901bbf4b62fefc9f0c43 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os, sys
import subprocess
from dask.distributed import Client
from time import sleep
class distributed_single:
'''import to run distributed single against the existing task scheduler'''
def __init__(self, **kwargs):
'''find scheduler and return object'''
self.addr... | 29.47619 | 78 | 0.649435 |
602794f351a5fc84ac3ccc3ccf59780525489deb | 1,847 | py | Python | src/universal_build/_utilities.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 17 | 2020-11-20T15:58:02.000Z | 2022-02-06T19:18:20.000Z | src/universal_build/_utilities.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 3 | 2021-02-17T13:47:44.000Z | 2021-10-14T13:53:15.000Z | src/universal_build/_utilities.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 6 | 2020-11-23T09:51:26.000Z | 2022-02-11T13:46:57.000Z | class DashInsensitiveDict(dict):
@classmethod
def _k(cls, key): # type: ignore
return key.lower().strip().replace("-", "_")
def __init__(self, *args, **kwargs): # type: ignore
super(DashInsensitiveDict, self).__init__(*args, **kwargs)
self._convert_keys()
def __getitem__(self... | 38.479167 | 84 | 0.636167 |
60550f27df41ce806f99827a459efbd30de80c44 | 861 | py | Python | elements/python/11/4/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/11/4/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/11/4/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import heapq
import random
def largest(X, k):
"""
Return the k largest elements from X.
"""
# maintain a min-heap of size k containing the largest elements so far
h = []
for x in X:
if len(h) < k:
heapq.heappush(h, x)
elif x > h[0]:
heapq.heapreplace(h, ... | 16.882353 | 74 | 0.518002 |
880833d42ab37375bc56b9e6444ef86fc1bef7bb | 1,631 | py | Python | src/timeseries/annotated_timeseries.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/timeseries/annotated_timeseries.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/timeseries/annotated_timeseries.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | # annotated time series
# Import Data
df = pd.read_csv('https://github.com/selva86/datasets/raw/master/AirPassengers.csv')
# Get the Peaks and Troughs
data = df['traffic'].values
doublediff = np.diff(np.sign(np.diff(data)))
peak_locations = np.where(doublediff == -2)[0] + 1
doublediff2 = np.diff(np.sign(np.diff(-1*d... | 38.833333 | 143 | 0.716738 |
718fda7215c433625975308247c7f94110ad2d28 | 1,577 | py | Python | leetcode/361-Bomb-Enemy/BombEnemy_TLE.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/361-Bomb-Enemy/BombEnemy_TLE.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/361-Bomb-Enemy/BombEnemy_TLE.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def maxKilledEnemies(self, grid):
"""
:type grid: List[List[str]]
:rtype: int
"""
if not grid or not grid[0]:
return 0
nkills = [[[0, 0] for _ in grid[0]] for _ in grid]
# for row
for i in range(len(grid)):
... | 32.854167 | 58 | 0.355105 |
e0fdf0278643528449128282133c92761afcbb69 | 1,977 | py | Python | test/test_npu/test_network_ops/test_empty_strided.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_empty_strided.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_empty_strided.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... | 43.933333 | 102 | 0.698027 |
1cbed5739e1c59491a4467b70630493296ab1b2a | 1,346 | py | Python | top/clearlight/io/python_program/json_oper/number_writer.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/io/python_program/json_oper/number_writer.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/io/python_program/json_oper/number_writer.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import json
def number_writer():
numbers = [2, 3, 5, 2, 1, 4]
filename = 'numbers.json'
with open(filename, 'w') as f_obj:
json.dump(numbers, f_obj)
def number_reader():
filename = 'numbers.json'
with open(filename) as f_obj:
numbers = json.load(f_obj)
print(numbers)
def ... | 23.614035 | 77 | 0.592868 |
c74cc29c22fd1388569f34de0b68134967fdbee3 | 4,048 | py | Python | lab5/complex.py | Jialu-Huang/python | 45713c34ecc3608e6387a0569efdbd32a6c67cad | [
"MIT"
] | null | null | null | lab5/complex.py | Jialu-Huang/python | 45713c34ecc3608e6387a0569efdbd32a6c67cad | [
"MIT"
] | null | null | null | lab5/complex.py | Jialu-Huang/python | 45713c34ecc3608e6387a0569efdbd32a6c67cad | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Project: Self-customed complex number object and roots object
File Name: complex.py
Author: Jialu Huang
Course - Sec#: ME 599_030
Instructor: William Smart
Date: Feb 10, 2019
"""
from clear_console import clean_the_console
"""
Name: Complex
Description: Generate a object to store, print, and c... | 31.625 | 115 | 0.536808 |
c771e4b1e1a525ee879549b5e1d57ca2fde77777 | 529 | py | Python | xml_validator.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | xml_validator.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | xml_validator.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null |
import sys
from xml.sax.handler import ContentHandler
from xml.sax import make_parser
def parseFile(fileName):
parser = make_parser()
parser.setContentHandler(ContentHandler())
parser.parse(fileName)
if __name__ == '__main__':
args = sys.argv
try:
filename = args[1]
except Exception:... | 23 | 54 | 0.62949 |
40cd9f79e86e2ac912cf0961b0e775a5f4b1d170 | 1,442 | py | Python | top/clearlight/base/runoob/regular_practice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/runoob/regular_practice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/runoob/regular_practice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import re
# re.match: 从字符串的起始位置匹配一个模式, 如果不是起始位置匹配成功的话, match()就返回none
print()
'''
语法:
re.match(pattern, string, flags=0)
pattern: 匹配的正则表达式
string: 要匹配的字符串
flags: 标志位, 用于控制正则表达式的匹配方式, 如:是否区分大小写,多行匹配等
获取匹配表达式:
groups(): 返回一个包含所有小组字符串的元组, 从1到所含的小组号
re.search 扫描整个字符串并返回第一个成功的匹配。
函数语法:
re.search(pattern, string, flags=... | 23.258065 | 64 | 0.669209 |
40fc3745ef6616f83584a4d581bc035006c2406b | 3,488 | py | Python | ryu/cmd/manager.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/cmd/manager.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/cmd/manager.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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... | 30.330435 | 78 | 0.669438 |
2952cb8eae629caf7b9899bc3b8eab92269ffe9a | 3,421 | py | Python | notebooks/02_Fairing/src/kaniko/tfjob_spec_provider.py | kerstinpittl/kubeflow-workshop | 22a0acbad8881b3049788b82c82fe2379a1f424b | [
"Apache-2.0"
] | 92 | 2019-10-09T23:28:40.000Z | 2022-03-19T10:52:30.000Z | notebooks/02_Fairing/src/kaniko/tfjob_spec_provider.py | kerstinpittl/kubeflow-workshop | 22a0acbad8881b3049788b82c82fe2379a1f424b | [
"Apache-2.0"
] | 72 | 2019-10-14T17:55:42.000Z | 2021-07-26T18:16:06.000Z | notebooks/02_Fairing/src/kaniko/tfjob_spec_provider.py | kerstinpittl/kubeflow-workshop | 22a0acbad8881b3049788b82c82fe2379a1f424b | [
"Apache-2.0"
] | 51 | 2019-09-23T22:46:48.000Z | 2022-01-25T09:54:52.000Z | def tfj_spec(train_name, num_ps, num_workers, model_dir, export_path, train_steps, batch_size, learning_rate, image, AWS_REGION):
train_spec = f"""apiVersion: kubeflow.org/v1
kind: TFJob
metadata:
name: {train_name}
spec:
tfReplicaSpecs:
Ps:
replicas: {num_ps}
template:
metadata:
... | 30.008772 | 129 | 0.491669 |
46273f6e0a7f23d11228951f2d35c0dddf1f9ffe | 499 | py | Python | oldp/apps/cases/management/commands/assign_topics.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/cases/management/commands/assign_topics.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/cases/management/commands/assign_topics.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | from django.core.management import BaseCommand
class Command(BaseCommand):
"""
Topic sources:
- References: Law book
"""
help = 'Assign topics to cases'
def __init__(self):
super(Command, self).__init__()
def add_arguments(self, parser):
parser.add_argument('--limit', t... | 23.761905 | 104 | 0.645291 |
31bd0de4512e1c73ee44af7b3bbec7e48a305927 | 35,523 | py | Python | fcos_core/modeling/rpn/fcos/loss.py | HaoGood/MMMC | 24dd4ce830efc7a8dc580735903c2a776b6a1a7b | [
"Apache-2.0"
] | 3 | 2022-01-12T11:22:38.000Z | 2022-01-27T02:28:30.000Z | fcos_core/modeling/rpn/fcos/loss.py | HaoGood/MMMC | 24dd4ce830efc7a8dc580735903c2a776b6a1a7b | [
"Apache-2.0"
] | null | null | null | fcos_core/modeling/rpn/fcos/loss.py | HaoGood/MMMC | 24dd4ce830efc7a8dc580735903c2a776b6a1a7b | [
"Apache-2.0"
] | 1 | 2022-01-23T02:45:03.000Z | 2022-01-23T02:45:03.000Z | """
This file contains specific functions for computing losses of FCOS
file
"""
import logging
import torch
from torch.nn import functional as F
from torch import nn
import os
from ..utils import concat_box_prediction_layers
from fcos_core.layers import IOULoss
from fcos_core.layers import SigmoidFocalLoss
from fcos_c... | 46.435294 | 122 | 0.610506 |
8274303f5a9c274e7ecd0784a204e93f57b6988e | 469 | py | Python | SoSe-21/Uebung-6/EA-2_Sort-Numbers.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-6/EA-2_Sort-Numbers.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-6/EA-2_Sort-Numbers.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
nummernliste = []
abbruchbedingung = False
while not abbruchbedingung:
try:
zahl = int(input("Bitte geben Sie eine natürliche Zahl ein: "))
nummernliste.append(zahl)
except:
abbruchbedingung = True
nummernliste.sort()
print(nummernliste)
print("Die Liste hat:", len(nummernliste), "Elem... | 29.3125 | 90 | 0.701493 |
f20dca9ee52875b3192f92f8f7712ccd23a9f372 | 1,834 | py | Python | crawler/spiders/ohhgears_spider.py | abel3t/web_crawler | c1eb570743299676489f279b5df1b8d18d94a782 | [
"MIT"
] | 2 | 2021-03-23T00:52:24.000Z | 2021-09-07T03:42:40.000Z | crawler/spiders/ohhgears_spider.py | abel3t/web_crawler | c1eb570743299676489f279b5df1b8d18d94a782 | [
"MIT"
] | null | null | null | crawler/spiders/ohhgears_spider.py | abel3t/web_crawler | c1eb570743299676489f279b5df1b8d18d94a782 | [
"MIT"
] | null | null | null | import scrapy
import os
basedir = os.path.dirname(os.path.realpath('__file__'))
class OhhgearsSpider(scrapy.Spider):
name = 'ohhgears'
base_url = 'https://ohhgears.com/?page=%s'
start_urls = [base_url % 1]
download_delay = 5
def parse(self, response):
self.log('Visited ' + response.url)
... | 40.755556 | 129 | 0.591058 |
1eea4192f3f80008d8c377755081b5e041bffafa | 609 | py | Python | doc/for_dev/scikit-image/setup_pyx.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/for_dev/scikit-image/setup_pyx.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/for_dev/scikit-image/setup_pyx.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from distutils.core import setup, Extension
from pathlib import Path
import numpy as np
from Cython.Build import cythonize
path_here = Path(__file__).parent.absolute()
include_dirs = [np.get_include()]
pyx_files = (path_here / "pyx").glob("*.pyx")
extensions = []
for pyx_file in pyx_files:
name = pyx_file.name.s... | 24.36 | 76 | 0.704433 |
6ff38f1020b50d9688d4e2299025947a8bfc621f | 10,675 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/test/py/tests/test_env.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/test/py/tests/test_env.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/test/py/tests/test_env.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2015 Stephen Warren
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
# Test operation of shell commands relating to environment variables.
import pytest
import u_boot_utils
# FIXME: This might be useful for other tests;
# perhaps refactor it into ... | 31.489676 | 80 | 0.672881 |
82ecc526d1db7a335cd9d0b2a16f800a1a12690a | 475 | py | Python | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_spl06.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_spl06.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_spl06.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | """
Testing spl06 python driver
The below i2c configuration is needed in your board.json.
"spl06": {
"type": "I2C",
"port": 1,
"addrWidth": 7,
"freq": 400000,
"mode": "master",
"devAddr": 119
}
"""
from spl06 import SPL06
print("Testing spl06 ...")
spl06Dev = SPL06()
spl06Dev.open("spl06")
spl06Dev.init(... | 15.322581 | 57 | 0.661053 |
d20f3707544ccaff8060e7bc89a257ec29d13fd7 | 23,073 | py | Python | proyecto-teo-v2/parser a mano.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | proyecto-teo-v2/parser a mano.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | proyecto-teo-v2/parser a mano.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | import ply.lex as lex
tipos = {
'int': 'INT',
'float': 'FLOAT',
'char': 'CHAR',
'scanf' : 'LECTURA',
'printf':'ESCRITURA',
}
tokens = [
'NUMERO',
'OPERADORES',
'IDENTIFICADOR',
'COMA',
# 'DATATYPE',
'SEMICOLON',
'IGUAL',
'LPAREN',
'RPAREN',
'BBLOCK',
'EBLOCK',
... | 32.405899 | 102 | 0.633511 |
d22e14431f71871529dbbf9cedb2ccb79f92fe79 | 2,086 | py | Python | apps/projects/serializer.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/projects/serializer.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/projects/serializer.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from apps.projects.models import Experiment, Project, Datarow, Value
def project_serialize(project_id):
#get all experiments from that project into a nested list of dictionaries to post to the selected webservice
experiment_objects = list(Experiment.objects.filter(project=project_id))
for experiment_object... | 52.15 | 117 | 0.657239 |
fbc793652a7f87eae615249c459bbbaccc7ef92d | 381 | py | Python | shaun/settings.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | shaun/settings.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | shaun/settings.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | # Settings
import py5
# General
WIDTH = 640
HEIGHT = 480
NO_SHEEPS = 40
FPS = 5 # 60 for fast motion, 5 for slow motion
# Colors
WHITE = py5.color(255)
BROWN = py5.color(102, 51, 0)
RED = py5.color(250, 0, 0)
GREEN = py5.color(0, 102, 0)
YELLOW = py5.color(250, 204, 0)
BLUE = py5.color(0, 250, 250)
PURPLE = py5.colo... | 19.05 | 47 | 0.669291 |
83f6c9481a8ff8e6c10c4b8672cd4e25a52daf55 | 39,743 | py | Python | research/cvtmodel/regnet/src/regnet_y_32gf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/regnet/src/regnet_y_32gf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/regnet/src/regnet_y_32gf.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... | 60.676336 | 119 | 0.507058 |
83fe971a8d659af64c87cb49a1fa40f20f1ffb1f | 243 | py | Python | tmp/cython_multitype_example.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | tmp/cython_multitype_example.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | tmp/cython_multitype_example.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from transonic import boost, Type
import numpy as np
T = Type(int, float)
T2 = Type(float, complex)
@boost
def func(m : T, n : T2):
return np.add(1,n)
@boost
def func1(m : T, n : float = 2):
t : int = 5.5
return np.add(1,n) + t
| 16.2 | 33 | 0.600823 |
f769c61e855dcfab79ed99378a8d659b2aafd3b4 | 7,485 | py | Python | hotspot/code/localization.py | FudanYuan/faultLocalization | 5133ee5af48f7d4c8ba05ef9a545139a38f417da | [
"Apache-2.0"
] | 13 | 2019-03-13T06:07:18.000Z | 2022-02-22T03:34:35.000Z | hotspot/code/localization.py | FudanYuan/faultLocalization | 5133ee5af48f7d4c8ba05ef9a545139a38f417da | [
"Apache-2.0"
] | null | null | null | hotspot/code/localization.py | FudanYuan/faultLocalization | 5133ee5af48f7d4c8ba05ef9a545139a38f417da | [
"Apache-2.0"
] | 4 | 2019-03-13T06:07:32.000Z | 2019-06-11T11:35:52.000Z | ## coding: utf-8
import pandas as pd
import numpy as np
import time
import math
from tqdm import tqdm
import matplotlib.pyplot as plt
from package.utils import KPIPoint
from package.utils import KPISet
from package.utils import Transformer
from package.HotSpot import HotSpot
def valid():
#### 加载数据集
# kSet_pre... | 31.317992 | 115 | 0.602806 |
f7887fc537cbed09ba74508e74a0c6a06b4fe1dd | 54 | py | Python | hyperts/wrappers/__init__.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | hyperts/wrappers/__init__.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | hyperts/wrappers/__init__.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | from . import stats_wrappers
from . import dl_wrappers | 27 | 28 | 0.833333 |
e3f582db9f52c7965c8385e8f4e034771b0a9f42 | 5,260 | py | Python | Packs/IdentityRecordedFuture/Integrations/IdentityRecordedFuture/IdentityRecordedFuture_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/IdentityRecordedFuture/Integrations/IdentityRecordedFuture/IdentityRecordedFuture_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/IdentityRecordedFuture/Integrations/IdentityRecordedFuture/IdentityRecordedFuture_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from freezegun import freeze_time
import io
import os
import unittest
import json
from pathlib import Path
from unittest.mock import patch, Mock
from IdentityRecordedFuture import Actions, Client, period_to_date
import vcr as vcrpy
CASSETTES = Path(__file__).parent / "test_data"
DATETIME_STR_VALUE = "2021-12-08T12:10... | 31.686747 | 91 | 0.660837 |
5448663e906ec1d9c48161c31f3d40aa692c2a29 | 332 | py | Python | python/python_backup/PRAC_PYTHON/nm.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/nm.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/nm.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def insertion_sort():
a=[]
n=input("enter range:")
for i in range(0,n,1):
k=input("value:")
a.insert(i,k)
for i in a:
print (i)
temp=a[i]
ptr=i-1
while (ptr>=0) and a[ptr]>temp:
a[ptr+1]=a[ptr]
ptr=ptr-1
a[ptr]=temp
for i in a:
... | 19.529412 | 42 | 0.448795 |
3fb7c7b4405f7c287e3de1841ecdd70d5b592388 | 7,128 | py | Python | test/test_npu/test_network_ops/test_l1_loss_backward.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_l1_loss_backward.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_l1_loss_backward.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... | 48.821918 | 89 | 0.510382 |
b20f1f59a15e97a6e9079fb8e5834694b35e10d2 | 5,787 | py | Python | Backend/migrations/alembic/versions/30bea01e7bac_create_cases_per_county_and_day_.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/migrations/alembic/versions/30bea01e7bac_create_cases_per_county_and_day_.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/migrations/alembic/versions/30bea01e7bac_create_cases_per_county_and_day_.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """create cases_per_county_and_day_risklayer materialized view
Revision ID: 30bea01e7bac
Revises: a9ca657b90f5
Create Date: 2020-11-26 15:27:18.363834
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '30bea01e7bac'
down_revision = 'a9ca657b90f5'
branch_labels = None
depends_on = None
... | 49.461538 | 132 | 0.460169 |
b7ba93e898dccb31e27e3c302868d8289f64d14a | 29,873 | py | Python | Packs/GSuiteAdmin/Integrations/GSuiteAdmin/GSuiteAdmin_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GSuiteAdmin/Integrations/GSuiteAdmin/GSuiteAdmin_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GSuiteAdmin/Integrations/GSuiteAdmin/GSuiteAdmin_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
from unittest.mock import patch
import pytest
import demistomock as demisto
from GSuiteAdmin import MESSAGES, GSuiteClient, OUTPUT_PREFIX, HR_MESSAGES
with open('test_data/service_account_json.txt') as f:
TEST_JSON = f.read()
MOCKER_HTTP_METHOD = 'GSuiteApiModule.GSuiteClient.http_request'
@pytest.... | 33.716704 | 120 | 0.736518 |
67e1fe4b246aa6f1738f5eadeb4184f8fe1f9568 | 8,330 | py | Python | SDM630-auslesen/influx.py | jjk4/jjk1-s-Codeschnipsel | 5c40870172f1630b7bbc345fa94fc8ac7ae98710 | [
"Unlicense"
] | null | null | null | SDM630-auslesen/influx.py | jjk4/jjk1-s-Codeschnipsel | 5c40870172f1630b7bbc345fa94fc8ac7ae98710 | [
"Unlicense"
] | null | null | null | SDM630-auslesen/influx.py | jjk4/jjk1-s-Codeschnipsel | 5c40870172f1630b7bbc345fa94fc8ac7ae98710 | [
"Unlicense"
] | null | null | null | import minimalmodbus
from influxdb import InfluxDBClient
client = InfluxDBClient(host="192.168.178.198", port=8086)
client.switch_database("solaranzeige")
instrument = minimalmodbus.Instrument("/dev/ttyUSB0", 1) # port name, slave address (in decimal)
input_register = {
"Spannung_L1": {
"port": 0, "digit... | 42.938144 | 152 | 0.514766 |
2209af4b9f7f34b921ff60a88463ed2112e8558e | 9,286 | py | Python | src/main/python/ble_temperature_sensor/sensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/ble_temperature_sensor/sensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/ble_temperature_sensor/sensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
from numpy.core import _string_helpers
import string
sys.path.append('..')
sys.path.append('lib')
import logging
import ble_temperature_sensor
from abc import abstractmethod
import struct
class Sensor:
name: string = None
id: string = None
address: string = None
typ... | 39.347458 | 114 | 0.475555 |
3f021c420a8184d64ae66b7a8a3946ffe3d7c91b | 4,931 | py | Python | hoomd/md/test-py/test_cite.py | XT-Lee/asap | 03c3e3616d51298fa42bd7696c84ecf3ff29089f | [
"BSD-3-Clause"
] | 2 | 2020-03-30T14:38:50.000Z | 2020-06-02T05:53:41.000Z | hoomd/md/test-py/test_cite.py | XT-Lee/asap | 03c3e3616d51298fa42bd7696c84ecf3ff29089f | [
"BSD-3-Clause"
] | null | null | null | hoomd/md/test-py/test_cite.py | XT-Lee/asap | 03c3e3616d51298fa42bd7696c84ecf3ff29089f | [
"BSD-3-Clause"
] | 1 | 2020-05-20T07:00:08.000Z | 2020-05-20T07:00:08.000Z | # -*- coding: iso-8859-1 -*-
# Maintainer: mphoward
from hoomd import *
import hoomd
from hoomd import md
context.initialize();
import unittest
import os
import tempfile
## Automatic citation generation tests
class cite_tests (unittest.TestCase):
def setUp(self):
print
init.create_lattice(lattice.... | 37.356061 | 113 | 0.642466 |
18999be61604f21e615a22f8588bb702fd640678 | 452 | py | Python | 2-resources/python-data-generation/generate-random-people-data-json.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/python-data-generation/generate-random-people-data-json.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/python-data-generation/generate-random-people-data-json.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | from faker import Factory
import random
import time
fake = Factory.create()
years = ["2005", "2006", "2007", "2008", "2009"]
destfile = "people-data-2009_" + time.strftime("%s") + '.json'
for x in xrange(5500000):
fo = open(destfile, "a")
fo.write("{\"yr\": \"" + str(random.choice(years)) + "\", \"name\": \"... | 32.285714 | 190 | 0.544248 |
18c37043b3606dad101ee066df16905ecb7c7dcc | 5,666 | py | Python | python/oneflow/framework/attr_util.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/framework/attr_util.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/framework/attr_util.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... | 44.614173 | 88 | 0.709848 |
e1562c8de08a89228ca01eaf9f3e8409333b913d | 481 | py | Python | site/public/courses/SPD-2.31/exercises/composing-methods-refactor/introduce_explaining_variable3.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/SPD-2.31/exercises/composing-methods-refactor/introduce_explaining_variable3.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/SPD-2.31/exercises/composing-methods-refactor/introduce_explaining_variable3.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Extract Variable (alias introduce explaining variable)
WELL_DONE = 900000
MEDIUM = 600000
COOKED_CONSTANT = 0.05
def is_cookeding_criteria_satisfied(time, temperature, pressure, desired_state):
if desired_state == 'well-done' and time * temperature * pressure * COOKED_CONSTANT >= WELL_DO... | 40.083333 | 103 | 0.721414 |
83692b0eda77de0e9226317b1b194505cd8d54e5 | 139 | py | Python | Packs/Digital_Defense_FrontlineVM/Integrations/Digital_Defense_FrontlineVM/.vulture_whitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Digital_Defense_FrontlineVM/Integrations/Digital_Defense_FrontlineVM/.vulture_whitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Digital_Defense_FrontlineVM/Integrations/Digital_Defense_FrontlineVM/.vulture_whitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | # flake8: noqa
frame # unused variable (Digital_Defense_FrontlineVM.py:71)
signum # unused variable (Digital_Defense_FrontlineVM.py:71)
| 27.8 | 61 | 0.798561 |
3d0e01123019c712487cc324f49a0c8f413f0f1c | 551 | py | Python | backend/alembic/versions/d46929cd6ff2_version_1_0.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/alembic/versions/d46929cd6ff2_version_1_0.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/alembic/versions/d46929cd6ff2_version_1_0.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | """version 1.0
Revision ID: d46929cd6ff2
Revises: 5365d581e37c
Create Date: 2021-11-27 15:02:42.166001
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "d46929cd6ff2"
down_revision = "5365d581e37c"
branch_labels = None
depends_on = None
def upgrade():
# ##... | 19 | 65 | 0.684211 |
a1b89a69e0210ba3372215e1976bab5304c62e10 | 1,284 | py | Python | ParsingAndScraping/megogo/parser.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T13:06:11.000Z | 2021-06-23T13:06:11.000Z | ParsingAndScraping/megogo/parser.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T21:21:52.000Z | 2021-06-23T21:21:52.000Z | ParsingAndScraping/megogo/parser.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T19:14:19.000Z | 2021-06-28T19:14:19.000Z | import re
import requests
from ParsingAndScraping.megogo.scrapper import scrap_megogo
from ParsingAndScraping.assistants import digits
from ParsingAndScraping.assistants import empty_string_cleaner
from bs4 import BeautifulSoup
def megogo_parser(film_name):
subscription_price = '397'
hd_price = ''
sd_pric... | 32.923077 | 79 | 0.665109 |
c53e359a8e828dcd496ab1b8e52097596e1b2177 | 6,239 | py | Python | face_sdk/models/network_def/mobilev3_pfld.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | face_sdk/models/network_def/mobilev3_pfld.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | face_sdk/models/network_def/mobilev3_pfld.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | # derive from:
# https://github.com/Hsintao/pfld_106_face_landmarks/blob/master/models/mobilev3_pfld.py
import torch
import torch.nn as nn
import torch.nn.functional as F
def conv_bn(inp, oup, kernel_size, stride, padding=1, conv_layer=nn.Conv2d, norm_layer=nn.BatchNorm2d, nlin_layer=nn.ReLU):
return nn... | 31.831633 | 124 | 0.550088 |
3da1974af468ec2ffb801c8737d562030d6c75ef | 602 | py | Python | leetcode/125-Valid-Palindrome/ValidPalindrome_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-04-07T15:08:53.000Z | 2016-04-07T15:08:53.000Z | leetcode/125-Valid-Palindrome/ValidPalindrome_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/125-Valid-Palindrome/ValidPalindrome_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {string} s
# @return {boolean}
def isPalindrome(self, s):
p = 0
num = len(s)
q = num - 1
while p < q:
if s[p].isalnum() and s[q].isalnum():
if s[p].lower() != s[q].lower():
return False
... | 25.083333 | 57 | 0.343854 |
3dd86a2480231d60724ef73592ffc73ce804e6db | 229 | py | Python | exercises/pt/solution_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Carregue o modelo en_core_web_md
nlp = spacy.load("en_core_web_md")
# Processe um texto
doc = nlp("Two bananas in pyjamas")
# Imprima o vetor para "bananas"
bananas_vector = doc[1].vector
print(bananas_vector)
| 19.083333 | 35 | 0.755459 |
9aa2cee17cff00e830d86b366f49a56261994fe9 | 1,980 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/workflow_expense_claim.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/workflow_expense_claim.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/workflow_expense_claim.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.a_row_exists("Expense Claim"):
frappe.reload_doc("hr", "doctype", "expense_claim")
frappe.reload_doc("hr", "doctype", "vehicle_... | 30 | 86 | 0.637879 |
9ac808f6ae7dae6ba0c6377b0530487a0527f2e7 | 1,562 | py | Python | insertion_sort.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | insertion_sort.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | insertion_sort.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | import unittest
def insertion_sort(seq):
'''
A função ordena uma lista usando o metodo insertion sort, a função faz 2 loops, o primeiro loop é a lista como um todo,
e o segundo é a troca de dos elementos, no primeiro ele pega a lista toda apartir do segundo elemento e entra no segundo loop, ai ele faz as c... | 36.325581 | 186 | 0.632522 |
62338631929f545e4849d7f7a92d15f9f89713b6 | 7,803 | py | Python | rasa/utils/train_utils.py | techBeck03/rasa | 72fef6e7742f5ccb8614c75b6410dff68f137554 | [
"Apache-2.0"
] | 2 | 2020-02-27T16:41:52.000Z | 2020-02-27T16:41:57.000Z | rasa/utils/train_utils.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 56 | 2020-06-09T00:16:14.000Z | 2020-11-16T00:25:20.000Z | rasa/utils/train_utils.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 3 | 2019-02-27T10:13:16.000Z | 2019-07-26T08:33:45.000Z | import numpy as np
import logging
import scipy.sparse
from typing import Optional, Text, Dict, Any, Union, List
from rasa.core.constants import DIALOGUE
from rasa.nlu.constants import TEXT
from rasa.nlu.tokenizers.tokenizer import Token
import rasa.utils.io as io_utils
from rasa.utils.tensorflow.constants import (
... | 32.924051 | 88 | 0.680764 |
65dd3417cb250aeabce477827fe7276752423f0f | 1,081 | py | Python | 04.DFS_BFS/HG/B7576.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 04.DFS_BFS/HG/B7576.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 04.DFS_BFS/HG/B7576.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | import sys
from collections import deque
M, N = map(int, sys.stdin.readline().split())
tomato = []
isClear = False
q = deque()
for i in range(N):
tmp = list(map(int, sys.stdin.readline().split()))
tomato.append(tmp)
for j in range(len(tmp)):
if tmp[j] == 1:
q.append((i, j, 0))
def ppr... | 18.637931 | 54 | 0.456059 |
0298032e92dc2c40e5dd147b91a4fa9b76140990 | 4,832 | py | Python | ODAW/tf/tagfilter/services/web/project/__init__.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | ODAW/tf/tagfilter/services/web/project/__init__.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | ODAW/tf/tagfilter/services/web/project/__init__.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | import os
from time import sleep
from flask import Flask, render_template, request, redirect
from flask_sqlalchemy import SQLAlchemy
from project.stdout import log
from project.twitter_stream import Extractor
from project.utils import gen_hash
# Flask main file. It generate html page and read input data
# Global v... | 30.2 | 93 | 0.519868 |
b280c6bd2f2806547a76d8402db5aea20084805b | 4,178 | py | Python | src/server/app/endpoints/auth/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/auth/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/auth/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, redirect, url_for, request, current_app as app
from flask_oidc import OpenIDConnect
from oauth2client.client import OAuth2Credentials
from .custom_oidc_socket import logoutSession
from ...db.settings import db, oidc
from ...models.Statistic import Statistic
import json
... | 34.528926 | 181 | 0.695787 |
b2932c01318d4938fbcf5ba1122130e0098a885d | 559 | py | Python | test.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 5 | 2020-08-17T08:37:16.000Z | 2021-06-07T05:02:05.000Z | test.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | null | null | null | test.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 1 | 2021-06-07T05:02:10.000Z | 2021-06-07T05:02:10.000Z | from XiaoHS import xhs_search as xs
import CralwerSet.connect_mysql as connect_mysql
r = connect_mysql.Redis()
xs.write_key(r)
# ConnectionHandler got an error : java.net.ConnectException: failed to connect to /192.168.1.102 (port 8888) after 30000ms: connect failed: ENETUNREACH (Network is unreachable)
# 手机淘宝<->2... | 43 | 177 | 0.801431 |
b298c55138e14962b4f9352a8a4cdc2de155e165 | 156 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/61a1/src/01_bignum.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/61a1/src/01_bignum.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/61a1/src/01_bignum.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Print out 2 to the 65536 power
# (try doing the same thing in the JS console and see what it outputs)
# YOUR CODE HERE
request = 2**65536
print(request)
| 22.285714 | 70 | 0.730769 |
b2a980e4f215ba1a401de70dc2e484b6f1e40479 | 428 | py | Python | server/run.py | gustavodsf/rdx_hack | 3b504bf8181495fdd1c3a06f963970469f6655f1 | [
"MIT"
] | null | null | null | server/run.py | gustavodsf/rdx_hack | 3b504bf8181495fdd1c3a06f963970469f6655f1 | [
"MIT"
] | null | null | null | server/run.py | gustavodsf/rdx_hack | 3b504bf8181495fdd1c3a06f963970469f6655f1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Start our application."""
from flask import g
from flask_babel import Babel
from api.src.config.create_app import create_app
app = create_app()
babel = Babel(app)
app.run(**app.config.get_namespace('RUN_'))
@babel.timezoneselector
def get_timezone():
"""Set the user... | 20.380952 | 48 | 0.684579 |
ac19fe6e97ea6b7f657f1455af7ad7d8163354bf | 3,376 | py | Python | official/cv/cnnctc/src/util.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/cnnctc/src/util.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/cnnctc/src/util.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... | 32.776699 | 132 | 0.55391 |
f00e17a6a8d7ffe181e2ea2d5b5f882d4e651db3 | 2,049 | py | Python | pvs_suban/migrations/0006_auto_20210620_1758.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | pvs_suban/migrations/0006_auto_20210620_1758.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | pvs_suban/migrations/0006_auto_20210620_1758.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-20 17:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pvs_suban', '0005_invoice'),
]
operations = [
migrations.AddField(
model_name='invoice',
... | 36.589286 | 171 | 0.581259 |
d7bceaf17790e83a15b98d00f1062e09360e0cf1 | 9,153 | py | Python | ProbeShot/MetadataAnalyzer.py | cherrytrees-kpu/sturdy-journey | ce87562bde81ec55235d8f65e8ec9d5e13b50bcc | [
"MIT"
] | null | null | null | ProbeShot/MetadataAnalyzer.py | cherrytrees-kpu/sturdy-journey | ce87562bde81ec55235d8f65e8ec9d5e13b50bcc | [
"MIT"
] | null | null | null | ProbeShot/MetadataAnalyzer.py | cherrytrees-kpu/sturdy-journey | ce87562bde81ec55235d8f65e8ec9d5e13b50bcc | [
"MIT"
] | null | null | null | import argparse
import pathlib
import json
import pandas
# data.loc[data['acc'].isin(accs)]
def import_assays(assay_path):
"""
Import assays into list
Parameters:
assay_path - pathlib.Path - path to assay.xlsx file
Output:
list:
[0] - assay1
[1] - assay2
...
[x] - assayx
... | 44.004808 | 148 | 0.686769 |
d7c5ef65a9cc4e2172856fb6e6489e19d4588b38 | 8,837 | py | Python | code/sensors/pipeline.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/sensors/pipeline.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/sensors/pipeline.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | from utils.functions import current_time_millis, overrides, get_class_name, deprecated
from threading import Thread
import logging
import numpy as np
from config.config import *
class Pipeline(object):
""" Base object for all pipelines"""
def __init__(self):
self.execute_callbacks = []
self._... | 29.754209 | 119 | 0.636981 |
4f762eb4cf2887ddcfc76521807f056d5de5726a | 7,969 | py | Python | official/nlp/textcnn/infer/sdk/predata.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/textcnn/infer/sdk/predata.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/textcnn/infer/sdk/predata.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 agree... | 36.388128 | 92 | 0.485883 |
4f7bc728964515cb4024824c0257dee5399a72e4 | 25,821 | py | Python | paddlenlp/transformers/skep/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/skep/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/skep/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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... | 43.17893 | 127 | 0.603966 |
d71280fd5d0cb22efd312e7866b35803b403351d | 5,899 | py | Python | examples/wide_and_deep/train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | examples/wide_and_deep/train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | examples/wide_and_deep/train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | from paddle.distributed.fleet.utils.ps_util import DistributedInfer
import paddle.distributed.fleet as fleet
import numpy as np
from model import WideDeepModel
from reader import WideDeepDataset
import paddle
paddle.enable_static()
def distributed_training(exe, train_model, train_data_path="./data", batch_size=10, e... | 47.192 | 211 | 0.548229 |
d730f9ec21dee4b31b97ac4e687c0130e975c91a | 48,886 | py | Python | Packs/AzureFirewall/Integrations/AzureFirewall/AzureFirewall_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/AzureFirewall/Integrations/AzureFirewall/AzureFirewall_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/AzureFirewall/Integrations/AzureFirewall/AzureFirewall_test.py | henry-sue-pa/content | 043c6badfb4f9c80673cad9242fdea72efe301f7 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import copy
import pytest
from unittest.mock import Mock
from CommonServerPython import *
SUBSCRIPTION_ID = "sub_id"
RESOURCE_GROUP_NAME = "group_name"
BASE_URL = f'https://management.azure.com/subscriptions/{SUBSCRIPTION_ID}' \
f'/resourceGroups/{RESOURCE_GROUP_NAME}/providers/Microsoft.Network'
CLIENT_ID... | 37.034848 | 120 | 0.720656 |
d7468fc2e74a4c784beb3a8c8ec19c752a92c0ad | 1,407 | py | Python | year_3/databases_sem2/lab2/wikimanager/category.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/databases_sem2/lab2/wikimanager/category.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/databases_sem2/lab2/wikimanager/category.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | import urllib.request
from lxml import etree
wiki_req_path = 'https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmlimit=600&format=xml&cmtype={0}'
def get_category_item(category_url):
request = urllib.request.Request(category_url, headers={'User-Agent': 'Lab2/1.0'})
url = urllib.request.u... | 33.5 | 120 | 0.731343 |
d77830fdb9720fae5eb8e05f473505e4ed0785c5 | 7,403 | py | Python | contrib/0.挖宝行动/awebone-多种猴子识别/monkey_classification.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | contrib/0.挖宝行动/awebone-多种猴子识别/monkey_classification.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | contrib/0.挖宝行动/awebone-多种猴子识别/monkey_classification.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | # from modelarts.session import Session
# session = Session()
# bucket_path="ai-awe-001/wabao/data.zip"
# session.download_data(bucket_path=bucket_path,path='./data.zip')
import os
import cv2
import glob
import h5py
import shutil
import imgaug as aug
import numpy as np
import pandas as pd
import seaborn as sns
imp... | 32.469298 | 111 | 0.693503 |
ad3d34f33addcb03d292333d88160d23be3c3b97 | 3,274 | py | Python | src/onegov/swissvotes/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.converters import extended_date_converter
from onegov.core.i18n import SiteLocale
from onegov.file import FileCollection
from onegov.swissvotes.app import SwissvotesApp
from onegov.swissvotes.collections import SwissVoteCollection
from onegov.swissvotes.collections import TranslatablePageCollection
fro... | 24.616541 | 68 | 0.714417 |
bc383c98a605bb6b535314e98a83b80ed5dc805b | 329 | py | Python | skimind/kernel/pdfManag/cat.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/pdfManag/cat.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/pdfManag/cat.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | import data_extractor
import os
cwd = os.getcwd()
filename = os.path.join(cwd, "samples")
filename = os.path.join(filename, "long-list.pdf")
#C:\Users\RMB PC\Downloads\AI\skimind_site\skimind\kernel\pdfManag\samples\long-list.pdf
print(os.path.exists(filename))
datas = data_extractor.pdf_process(filename)
print(le... | 23.5 | 88 | 0.768997 |
2a3a947a900fcee410b07934de37ebf04a4922e5 | 10,255 | py | Python | official/cv/yolov4/ascend310_quant_infer/acc.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/yolov4/ascend310_quant_infer/acc.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/yolov4/ascend310_quant_infer/acc.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... | 44.202586 | 119 | 0.564115 |
2a860dda1a3b2a29bda924fd0c2a5c159cb2ef77 | 1,441 | py | Python | bigbench/bbseqio/run_example.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/bbseqio/run_example.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/bbseqio/run_example.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 32.022222 | 79 | 0.730743 |
aa5d6798db0821ac43c5631dace6899fa929fde0 | 1,297 | py | Python | research/cv/resnet50_adv_pruning/mindpsore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/resnet50_adv_pruning/mindpsore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/resnet50_adv_pruning/mindpsore_hub_conf.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... | 37.057143 | 102 | 0.666153 |
2ad9b54f572855e9aa7f1577ccd6781fff37930c | 651 | py | Python | Fortgeschrittenenpraktikum/Protokolle/V14_Tomographie/Daten/Spektrum.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2019-03-07T08:55:36.000Z | 2019-04-22T18:13:03.000Z | Fortgeschrittenenpraktikum/Protokolle/V14_Tomographie/Daten/Spektrum.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | null | null | null | Fortgeschrittenenpraktikum/Protokolle/V14_Tomographie/Daten/Spektrum.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2017-10-27T13:26:43.000Z | 2018-01-13T09:12:24.000Z | import numpy as np
from scipy.stats import sem
from uncertainties import ufloat
import uncertainties.unumpy as unp
import matplotlib.pyplot as plt
import scipy.constants as sc
from scipy.optimize import curve_fit
from numpy.linalg import inv
Werte = np.genfromtxt('Messungen.txt', unpack=True)
Fehler = np.sqrt(Werte)
F... | 29.590909 | 113 | 0.743472 |
2d92d5d3d76e634a7feecf470695282a76607fd1 | 2,499 | py | Python | MainProject/account/models.py | DarishkaAMS/Django_Projects-Django_Food_Delivery_App | 2a1014c05ca628ba6bd9aefd2aae307e9d95c5c2 | [
"MIT"
] | null | null | null | MainProject/account/models.py | DarishkaAMS/Django_Projects-Django_Food_Delivery_App | 2a1014c05ca628ba6bd9aefd2aae307e9d95c5c2 | [
"MIT"
] | null | null | null | MainProject/account/models.py | DarishkaAMS/Django_Projects-Django_Food_Delivery_App | 2a1014c05ca628ba6bd9aefd2aae307e9d95c5c2 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
# Create your models here.
class MyAccountManager(BaseUserManager):
def create_user(self, email, username, password=None):
if not username:
raise ValueError("All guests must have an username... | 33.32 | 126 | 0.695878 |
2d9d3702ac6da592895bd0e6b3fb37aad410d251 | 1,875 | py | Python | graph_network/graph_network_run.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | graph_network/graph_network_run.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | graph_network/graph_network_run.py | stevezheng23/graph_network_tf | b48a43453c2731f253bfe5a61e0b6339f4fc9f99 | [
"Apache-2.0"
] | null | null | null | import argparse
import os.path
import time
import numpy as np
import tensorflow as tf
from tensorflow.python import debug as tf_debug
from util.default_util import *
from util.param_util import *
from util.debug_logger import *
from util.train_logger import *
from util.eval_logger import *
from util.summary_writer i... | 29.296875 | 78 | 0.6864 |
935cc2e540ff558d14e25bcf3569ff9af0a85005 | 239 | py | Python | scripts/thumb.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | scripts/thumb.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | scripts/thumb.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | import os
import sys
import subprocess
import platform
from benwaonline.util import make_thumbnail
if __name__ == '__main__':
img = sys.argv[1]
thumb_path = sys.argv[2]
make_thumbnail(img, thumb_path)
exit(0)
| 18.384615 | 44 | 0.690377 |
ea33db061d3b433171070d7f168a7b7bd8f44297 | 461 | py | Python | stack.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | 2 | 2017-12-22T20:03:30.000Z | 2017-12-24T20:55:38.000Z | stack.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | null | null | null | stack.py | GShamian/ExamInf | 81f521d0b137eee0a4c7f53443303f419e7c33ef | [
"MIT"
] | null | null | null | class Stack():
def __init__(self):
self.arr = []
self.len = len(self.arr)
def push(self, n):
self.arr = [n] + self.arr
def pop(self):
k = self.arr[0]
self.arr = self.arr[1:]
return k
def print(self):
for i in self.arr:
... | 17.730769 | 34 | 0.45987 |
ea734a0bc25097316fe2d182fdf8a4b426ab1df9 | 1,197 | py | Python | spider/master_HKProtest.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/master_HKProtest.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/master_HKProtest.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
# 获得爬取推文所需信息
# import json
from Config_2019 import getMongoClient, closeMongoClient
def get_task():
client = getMongoClient()
db = client['2019HongKong_protest']
event_list = list(db.event_list.find())
stime, etime, locations, triggers = '','','',''
print('2019HongKong_protes... | 34.2 | 114 | 0.606516 |
eaa11e579a19c80e68518f73e28b69857481ea48 | 425 | py | Python | exercises/es/solution_04_11_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/solution_04_11_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/solution_04_11_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | TRAINING_DATA = [
(
"Reddit hizo una alianza con Patreon para ayudar a los creadores",
{"entities": [(0, 6, "WEBSITE"), (28, 35, "WEBSITE")]},
),
("PewDiePie rompe el record de YouTube", {"entities": [(29, 36, "WEBSITE")]}),
(
"El fundador de Reddit, Alexis Ohanian, regaló dos ti... | 32.692308 | 82 | 0.562353 |
57f90caed710b0b37b4fdeab94e8345545d13e0f | 1,203 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/63d1/recursive_count_th/count_th.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63d1/recursive_count_th/count_th.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63d1/recursive_count_th/count_th.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | '''
Your function should take in a single parameter (a string `word`)
Your function should return a count of how many occurences of ***"th"*** occur within `word`. Case matters.
Your function must utilize recursion. It cannot contain any loops.
'''
def count_th(word):
# recursive function
def count_recur(word, ... | 38.806452 | 182 | 0.66251 |
52a8f1270b870c5dad570eae1af24435263e65dd | 2,328 | py | Python | gpt3/04-temperature.py | sixvo-labs/Sapir | 07ba6fe1c83e2d5fbf139f1601a28df6b6740483 | [
"MIT"
] | null | null | null | gpt3/04-temperature.py | sixvo-labs/Sapir | 07ba6fe1c83e2d5fbf139f1601a28df6b6740483 | [
"MIT"
] | null | null | null | gpt3/04-temperature.py | sixvo-labs/Sapir | 07ba6fe1c83e2d5fbf139f1601a28df6b6740483 | [
"MIT"
] | null | null | null | #temperature.py
"""
Q&A
temperature=0,
"""
"""
Grammar correction
temperature=0,
"""
"""
Summarize for a 2nd grader
temperature=0.7,
"""
"""
Natural language to OpenAI API
temperature=0,
"""
"""
Text to command
temperature=0,
"""
"""
English to other languages
temperature=0,
"""
"""
Natural language to Str... | 11.64 | 37 | 0.648625 |
5e090f0da9e4128ccee1b5033b70a40ddd3362cd | 180 | py | Python | Algorithms/DynamticProgramming/SamAndSubString.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/DynamticProgramming/SamAndSubString.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/DynamticProgramming/SamAndSubString.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
N = raw_input()
l = len(N)
mod = 10**9 + 7
r = 0
f = 1
for i in xrange(l-1, -1, -1):
r += (int(N[i]) * f * (i+1)) % mod
f = (f*10 + 1) % mod
print r % mod
| 12.857143 | 38 | 0.45 |
eaf31cb16ef674c22b0a4600c5c1a82b35c4b3e4 | 8,968 | py | Python | venv/lib/python3.7/site-packages/twilio/rest/bulkexports/v1/export/job.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 4 | 2020-11-13T02:31:25.000Z | 2020-12-24T22:04:30.000Z | venv/lib/python3.7/site-packages/twilio/rest/bulkexports/v1/export/job.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 7 | 2020-06-03T19:08:42.000Z | 2021-09-22T19:08:32.000Z | bot/lib/python3.7/site-packages/twilio/rest/bulkexports/v1/export/job.py | carlosrh18/DavinciBot | d73a6b7f68d7bab25d134d3f85c6b63a86c206c5 | [
"MIT"
] | 1 | 2020-06-03T19:22:39.000Z | 2020-06-03T19:22:39.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... | 29.116883 | 175 | 0.611619 |
dc53b1e3bf83c916f59c3cd5a427f6d88ccf16c4 | 4,103 | py | Python | tests/components/test_classifiers.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/components/test_classifiers.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/components/test_classifiers.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | from os import environ, path, remove
from requests import get
from pytest import fixture
from papermill import execute_notebook
from .utils import creates_iris_metadata, creates_titanic_metadata, \
creates_mock_dataset, delete_mock_dataset
from projects.controllers.utils import uuid_alpha
EXPERIMENT_ID = str(uui... | 35.678261 | 107 | 0.7631 |
877038b56f5b158549b8f99f51954773a39e6daa | 527 | py | Python | Packs/XSOARContentUpdateNotifications/Scripts/FormatContentData/FormatContentData.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/XSOARContentUpdateNotifications/Scripts/FormatContentData/FormatContentData.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/XSOARContentUpdateNotifications/Scripts/FormatContentData/FormatContentData.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
args = demisto.args()
value = args.get('value', '')
try:
value = json.loads(value)
except Exception as err:
return_error(err)
returned_data = str()
if value:
for v in value:
description = v.get('changelog',... | 27.736842 | 115 | 0.660342 |
5e85727df378b63bce61576ce460a5e09a50c2a1 | 369 | py | Python | pacman-arch/test/pacman/tests/sync132.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/sync132.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/sync132.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Sysupgrade with a replacement for a local package out of date"
sp1 = pmpkg("pkg1")
sp1.replaces = ["pkg2"]
sp2 = pmpkg("pkg2", "2.0-1")
for p in sp1, sp2:
self.addpkg2db("sync", p)
lp = pmpkg("pkg2")
self.addpkg2db("local", lp)
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("... | 19.421053 | 82 | 0.685637 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.