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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6bce280318702d97c2e842f0d2af2d9d24339324 | 6,986 | py | Python | cbm/utils/raster_utils.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | cbm/utils/raster_utils.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | cbm/utils/raster_utils.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import glob
import rasterio
import rasterio.warp
import r... | 30.242424 | 75 | 0.580876 |
2e6314f0f52abf49a5a4bf44874c5a67fc14f8a9 | 2,216 | py | Python | research/nlp/gpt2/download_cnn_dailymail.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/gpt2/download_cnn_dailymail.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/gpt2/download_cnn_dailymail.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... | 36.933333 | 110 | 0.636282 |
51404ffe049492096f570b6f0c3b83d5afc6f6d9 | 8,595 | py | Python | MAIN/STM32F405_C/NORMAL/history/V30/SX1239.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405_C/NORMAL/history/V30/SX1239.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405_C/NORMAL/history/V30/SX1239.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | import gc
from micropython import const
from pyb import Pin, SPI
import time
RF_RECEIVER = const(0)
RF_SYNTHESIZER = const(1)
RF_STANDBY = const(2)
RF_SLEEP = const(3)
RF_STOP = const(0x01)
RF_BUSY ... | 40.928571 | 125 | 0.463525 |
cf963834a34b08970049e2cf049770f765aedc01 | 4,313 | py | Python | zencad/__main__.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/__main__.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/__main__.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding:utf-8
import os
import sys
import time
import psutil
import traceback
import runpy
import signal
import zenframe.argparse
import zenframe.configuration
zenframe.configuration.Configuration.TEMPLATE = """#!/usr/bin/env python3
#coding: utf-8
from zencad import *
m=box(10)
disp(m)
s... | 30.807143 | 92 | 0.69534 |
249f54c312085127a7ba92e2bd9f1cf5d577edd7 | 7,572 | py | Python | Utils/py/ActionSelection/experimental/simulate_variate_until_goal.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/ActionSelection/experimental/simulate_variate_until_goal.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/ActionSelection/experimental/simulate_variate_until_goal.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import math
import numpy as np
import random
import copy
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
from tools import action as a
from tools import Simulation as Sim
from naoth import math2d as m2d
from tools import tools
from tools import field_info as field
from tools import raw_attack... | 37.300493 | 126 | 0.663761 |
701068461810526a85325d5d36dfdcb0e07d0bae | 4,798 | py | Python | Licence 1/I23/TP 1/tp_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I23/TP 1/tp_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I23/TP 1/tp_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | from random import *
lettres = "abcdefghijklmnopqrstuvwxyz"
parentheses = "()"
operateurs = "!+*"
"""
Fonction qui sert à lister les variables de l'expression
rentré en paramètre.
@param String expression
@return La liste triée des variables
"""
def ListerVariables(expression):
variables = []
... | 24.35533 | 92 | 0.606711 |
701850d163f3a55df8a3e82506b4d2f0d9e295f4 | 25 | py | Python | ___Python/Torsten/Python-Kurs/p10_requests/__init__.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Torsten/Python-Kurs/p10_requests/__init__.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Torsten/Python-Kurs/p10_requests/__init__.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import math
FOO = 3.14
| 8.333333 | 12 | 0.64 |
56863df9968b300a9efed9cc0209d040c3dbbecb | 367 | py | Python | sketches/ca01/cell.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/ca01/cell.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/ca01/cell.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # coding=utf-8
class Cell():
def __init__(self, c, r, sz, state = 0):
self.c = c
self.r = r
self.sz = sz
self.state = state
def display(self):
if self.state == 1:
fill(0) # schwarz
else:
fill(255) # weiß
rect(self.sz*... | 20.388889 | 62 | 0.46049 |
3b585e131372299556dae2d34b7facad669ceb27 | 1,847 | py | Python | Packs/Campaign/Scripts/GetCampaignIncidentsIdsAsOptions/GetCampaignIncidentsIdsAsOptions.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Campaign/Scripts/GetCampaignIncidentsIdsAsOptions/GetCampaignIncidentsIdsAsOptions.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Campaign/Scripts/GetCampaignIncidentsIdsAsOptions/GetCampaignIncidentsIdsAsOptions.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
ALL_OPTION = 'All'
NO_CAMPAIGN_INCIDENTS_MSG = 'There is no Campaign Incidents in the Context'
NO_ID_IN_CONTEXT = 'There is no \"id\" key in the incidents'
def get_campaign_incidents():
"""
Get the campaign inciden... | 30.278689 | 108 | 0.665945 |
8dcd48e5fcdbf387118774d7e0effc5f28450ce0 | 936 | py | Python | frappe-bench/apps/erpnext/erpnext/templates/pages/regional/india/update_gstin.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/templates/pages/regional/india/update_gstin.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/templates/pages/regional/india/update_gstin.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
from frappe import _
def get_context(context):
context.no_cache = 1
party = frappe.form_dict.party
context.party_name = party
try:
update_gstin(context)
except frappe.ValidationError:
context.invalid_gstin = 1
party_type = 'Customer'
party_name = frappe.db.get_value('Customer', party)
if n... | 21.767442 | 55 | 0.729701 |
30ddead912b98a6cae884c7eaf100b57aa6c4576 | 277 | py | Python | parse_namespace.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | parse_namespace.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | parse_namespace.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')
root = tree.getroot()
first = list(root)[0]
print(first.attrib)
ET.dump(root)
print('-------')
ns = {'ns':'zte.com'}
cts = tree.findall('ns:country', ns)
for ct in cts:
print(ct.tag)
| 17.3125 | 37 | 0.613718 |
691e3556c9e0c66aa2ff59567645b27a9efb611d | 6,345 | py | Python | research/cv/midas/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/midas/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/midas/postprocess.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... | 37.105263 | 120 | 0.634043 |
692f7eb235bb212e44295705fc66a1b0539ea12d | 5,753 | py | Python | technix/nsga.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | technix/nsga.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | technix/nsga.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
import random
from utils.lib import say
__author__ = "bigfatnoob"
def loo(points):
for i in range(len(points)):
one = points[i]
rest = points[:i] + points[i+1:]
yiel... | 28.339901 | 99 | 0.67669 |
d6c93e197fecbf95c62852acc17611b10a817c5e | 2,237 | py | Python | Algorithms/Dynamic_Programming/the_maximum_subarray.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Dynamic_Programming/the_maximum_subarray.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Dynamic_Programming/the_maximum_subarray.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Maximum subarray
for _ in range(int(input().strip())):
n = int(input().strip())
A = list(map(int, input().strip().split(' ')))
is_minus = True
# https://en.wikipedia.org/wiki/Maximum_subarray_problem
max_ending_here = max_so_far = A[0]
for x in A[1:]:
if x < 0... | 31.069444 | 88 | 0.495306 |
3024d7dd23b55d1f97973c61221222ca4158cb1a | 1,059 | py | Python | WiFiBroot-master/utils/macers.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | WiFiBroot-master/utils/macers.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | WiFiBroot-master/utils/macers.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import sys
import os
import random
class org:
def __init__(self, bssid=''):
self.bssid = bssid
self.org = self.findORG(self.bssid)
def findORG(self, bssid):
file__ = open(os.getcwd()+'/utils/macers.txt', 'r')
for line in file__.readlines():
if line.strip('\n').split(' ~ ')[0].lower() == bssid.lower()[0:... | 25.214286 | 91 | 0.665722 |
0676b27fab9fb353609dc608bbf3d4dabad2557a | 3,045 | py | Python | Packs/FiltersAndTransformers/Scripts/MapRangeValues/MapRangeValues_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/FiltersAndTransformers/Scripts/MapRangeValues/MapRangeValues_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/FiltersAndTransformers/Scripts/MapRangeValues/MapRangeValues_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from MapRangeValues import Replace, RangeReplace, get_replace_list, replace_values
import pytest
data_test_replace_class = [
(1, 1, True),
(1, 4, False),
('a', 'a', True),
('a', 'c', False),
]
@pytest.mark.parametrize('_from, value, should_replace', data_test_replace_class)
def test_replace_class(_fr... | 27.432432 | 105 | 0.536617 |
233fec01a3ba223ad7e138ca621f62f0ad7167e3 | 2,273 | py | Python | Packs/GoogleChronicleBackstory/Scripts/ChronicleDBotScoreWidgetScript/ChronicleDBotScoreWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleDBotScoreWidgetScript/ChronicleDBotScoreWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleDBotScoreWidgetScript/ChronicleDBotScoreWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from unittest.mock import patch
import demistomock as demisto
import ChronicleDBotScoreWidgetScript
DBOT_SCORE = [{'CustomFields': {'chronicledbotscore': 2}}]
def test_main_success(mocker):
"""
When main function is called, get_html_representation should be called.
"""
mocker.patch.object(demis... | 37.262295 | 106 | 0.755389 |
88df95a7774719a133c9f5d05d7079c28e358b1f | 1,477 | py | Python | tests/test_chrome.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | tests/test_chrome.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | tests/test_chrome.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # Copyright (c) 2018-2020 Niko Sandschneider
"""
Module containing all tests for the P2PChrome class.
"""
import logging
import unittest.mock
from easyp2p.p2p_chrome import P2PChrome
from easyp2p.p2p_signals import PlatformFailedError
class P2PChromeTests(unittest.TestCase):
"""Test P2PChrome if Chrome, Chromi... | 31.425532 | 80 | 0.707515 |
aeb3c5f2384e09632046822bc18f9b8b56837f4f | 2,386 | py | Python | simple-tensorflow-demo/4.demos/1.tensorTest.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-tensorflow-demo/4.demos/1.tensorTest.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-tensorflow-demo/4.demos/1.tensorTest.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | """
张量 tensor
"张量"即是多维数组, 用"阶"(D)表示张量的维数
0D -> 0阶张量 -> 标量 scalar -> s = 1
1D -> 1阶张量 -> 矢量 vector -> v = [1, 2, 3]
2D -> 2阶张量 -> 矩阵 matrix -> m = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
nD -> n阶张量 -> 张量 tensor -> t = [[[ ... ]]]
数据类型
tf.float32 tf.int32 ...
神经网络(neural network, NN)实现过程
1. 准备数据, 提取特征
2. 数据输入到NN, 先搭建graph, ... | 23.392157 | 91 | 0.512154 |
aebd891b051705e17dcad9b456c657e6d9aa571f | 626 | py | Python | Crawler/links/PageRank.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | Crawler/links/PageRank.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | Crawler/links/PageRank.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | from .utils import init_graph
def PageRank_one_iter(graph, d):
node_list = graph.nodes
for node in node_list:
node.update_pagerank(d, len(graph.nodes))
graph.normalize_pagerank()
print(graph.get_pagerank_list())
# print()
def PageRank(graph, d, iteration=100):
for i in range(iteratio... | 25.04 | 105 | 0.696486 |
060ba63fd2c3d61507008949190160b18fff0f0e | 3,887 | py | Python | gemtown/users/models.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/users/models.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/users/models.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db.models import Sum
from django.urls import reverse
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from multiselectfield import MultiSelectField
from django.db import models
@python_2... | 34.096491 | 144 | 0.65629 |
31f4542379d9c26e72bebbc1c25a6b2f4f5b48c9 | 2,609 | py | Python | PortScanner/portscanner27.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | PortScanner/portscanner27.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | PortScanner/portscanner27.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python2
#coding:utf-8
import socket
import subprocess
import os
import sys
import requests
import json
import thread
import platform
import time
from datetime import datetime
banner = '''
_nnnn_
dGGGGMMb ,"""""""""""""".
@p~qp~~qMb | Linux World |
... | 25.330097 | 102 | 0.521273 |
118ebb10949b46b7af270728b8f6fa5fa317c992 | 1,974 | py | Python | INBa/2014/MOCHALOV_V_V/task_8_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/MOCHALOV_V_V/task_8_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/MOCHALOV_V_V/task_8_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
# Задача 8. Вариант 15.
#
# Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка. Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. Разработайте систему начисления очков, по кото... | 44.863636 | 357 | 0.660588 |
1197a3df998d88687d523bad03b2c9c60a9994d2 | 2,147 | py | Python | tidy.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 5 | 2015-07-28T17:45:21.000Z | 2019-11-24T15:47:01.000Z | tidy.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-22T15:21:36.000Z | 2020-05-22T15:38:48.000Z | tidy.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-09T21:23:59.000Z | 2020-05-09T21:23:59.000Z | #!/usr/bin/python
import json, os
with open("settings.json") as settings_file:
settings_json = json.loads(settings_file.read())
clang_install_location = settings_json["clang_install_location"]
clang_install_location = os.path.abspath(clang_install_location)
build_location = settings_json["build_locatio... | 61.342857 | 496 | 0.764788 |
e10e4f68dcddffe7d8445f240c1cf08c02ae27af | 11,223 | py | Python | backend/songwriter/parser.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | null | null | null | backend/songwriter/parser.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | 12 | 2017-09-25T20:13:29.000Z | 2020-02-12T00:12:41.000Z | backend/songwriter/parser.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
import codecs
import os
import re
import shutil
import subprocess
import tempfile
from xml.dom import minidom
from songwriter import models
class Lyric(object):
def __init__(self, content=None, refrain=False):
self.content = content
self.refrain = refrain
self.new_... | 33.008824 | 113 | 0.537022 |
010fd1b91f137bf71b092a0afdfacc42f0939540 | 545 | py | Python | pyconuk/migrations/0006_auto_20160826_0741.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | pyconuk/migrations/0006_auto_20160826_0741.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | pyconuk/migrations/0006_auto_20160826_0741.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-26 07:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pyconuk', '0005_auto_20160820_1259'),
]
operations = [
migrations.AlterField(... | 25.952381 | 147 | 0.605505 |
0137901f688fcb6b1b6fcb81ccc4393130073c29 | 953 | py | Python | ip_spider.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | 1 | 2021-05-24T06:16:49.000Z | 2021-05-24T06:16:49.000Z | ip_spider.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | null | null | null | ip_spider.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | null | null | null | import os
import shutil
import urllib.request
import scrapy
from config import RAW_DIRECTORY
class IPSpider(scrapy.Spider):
name = 'ip'
def start_requests(self):
urls = ['http://www.nirsoft.net/countryip/']
for url in urls:
yield scrapy.Request(url=url, callback=self.parse)
... | 30.741935 | 120 | 0.628541 |
6d7a5c57c6af15a43fb3d0d2bf1bfd402583a49c | 102 | py | Python | admin-tutorial/AdminActions/actions_method/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | admin-tutorial/AdminActions/actions_method/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | admin-tutorial/AdminActions/actions_method/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.apps import AppConfig
class ActionsMethodConfig(AppConfig):
name = 'actions_method'
| 17 | 37 | 0.784314 |
11625f0de69fe096cb188016fb7cfb8c71c5a2f9 | 114 | py | Python | Variablen und Operatoren/zuweisung.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Variablen und Operatoren/zuweisung.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Variablen und Operatoren/zuweisung.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | # Werte
a = 5
b = 3
# Berechnung
c = a + b
# Ausgabe
print("Die Aufgabe:", a, "+", b)
print("Das Ergebnis:", c)
| 10.363636 | 32 | 0.552632 |
3a9972e49114b6cad54a9e93c0dbf1b832a12a7a | 8,711 | py | Python | research/cv/vit_base/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/vit_base/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/vit_base/train.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... | 41.089623 | 120 | 0.66307 |
6c30566b6a1357c736d8d67195ccecc4033b56b5 | 1,355 | py | Python | tutorial/gpio-button-example.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | null | null | null | tutorial/gpio-button-example.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | 3 | 2018-11-22T09:49:52.000Z | 2019-05-29T14:43:52.000Z | tutorial/gpio-button-example.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import RPi.GPIO as GPIO
import time
LedPin = 13 # pin11 --- led
BtnPin = 15 # pin12 --- button
Led_status = 1
def setup():
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(LedPin, GPIO.OUT) # Set LedPin's mode is output
GPIO.setup(BtnPin, GPIO.I... | 33.04878 | 134 | 0.649446 |
66861ac79b046f716bda09758be073953cbbed34 | 3,841 | py | Python | ActorCritic/A2C_ver1/A2C_brain.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | 2 | 2021-01-06T09:45:23.000Z | 2021-04-21T09:39:14.000Z | ActorCritic/A2C_ver1/A2C_brain.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | null | null | null | ActorCritic/A2C_ver1/A2C_brain.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
@File : A2C_brain.py
@Time : 2020/12/6
@Author : Yuan Yifu
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import namedtuple
import numpy as np
N_STATES = 4
N_ACTIONS = 2
GAMMA = 0.95
LR = 0.01
class Net(nn.Module):
"""
implements b... | 28.879699 | 84 | 0.613122 |
dd3f5d85465e71350d86fc560c596dc75391f8a1 | 7,543 | py | Python | roboraptorz/client/mqttApp/Map.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | null | null | null | roboraptorz/client/mqttApp/Map.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | null | null | null | roboraptorz/client/mqttApp/Map.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | 1 | 2019-10-22T07:47:51.000Z | 2019-10-22T07:47:51.000Z |
import logging
import queue
from Common import *
logger = logging.getLogger(__name__)
class Point:
def __init__(self):
self.x = 0
self.y = 0
def __init__(self, x, y):
self.x = x
self.y = y
def move(self, roboDirection):
dx = 0
dy = 0
if roboDirec... | 36.439614 | 261 | 0.594326 |
dd73e9349ca7c22abb7c1950db0e5fb367fd5c6c | 1,240 | py | Python | src/multiprocess_guetzli.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | 10 | 2018-01-11T01:15:15.000Z | 2020-06-22T15:03:31.000Z | src/multiprocess_guetzli.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | src/multiprocess_guetzli.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | import argparse
from multiprocessing import Process
import subprocess
import os
def guetzli_dumper(input_file_path, input_q_file_path, input_o_file_path):
command = ["train_bin/Release/guetzli_dumper", input_file_path, input_q_file_path, input_o_file_path]
try:
subprocess.check_call(command)
except:
pass... | 40 | 116 | 0.760484 |
663234b0d4f88c701430c20b1cc2644483256808 | 4,254 | py | Python | 004-C100-Bank/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 004-C100-Bank/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 004-C100-Bank/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | # Bank
# Made by somePythonProgrammer as a WhiteHat project.
# This is an example on how to use classes.
class User:
"""
This class is used to create a user.
"""
def __init__(self):
self.name = input("Please enter your name: ")
while True:
self.pin = input("Please enter you... | 34.032 | 102 | 0.537377 |
9ff69a856d3b067ed268816df5ce0078fa7abc66 | 2,266 | py | Python | src/encoding.py | xbelda/movielens-recommender | 1e1335e2a2b9f57b948916ff415af149938caa33 | [
"MIT"
] | null | null | null | src/encoding.py | xbelda/movielens-recommender | 1e1335e2a2b9f57b948916ff415af149938caa33 | [
"MIT"
] | null | null | null | src/encoding.py | xbelda/movielens-recommender | 1e1335e2a2b9f57b948916ff415af149938caa33 | [
"MIT"
] | null | null | null | from typing import Iterable, Any
class NotFittedError(Exception):
"""Custon exception to signal that the class has not been fitted"""
pass
class LabelEncoder:
"""The LabelEncoder allows for the encoding of categorical variables into
sorted integers.
Args:
handle_unknown (bool): Whether ... | 28.325 | 94 | 0.632392 |
c68d9a91ea9cf7163e49e77bf778d821de23f952 | 2,322 | py | Python | tp2/tests/1-convergence/test.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | tp2/tests/1-convergence/test.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | tp2/tests/1-convergence/test.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Run convergence experiment.
import argparse
import matplotlib.pyplot as plt
import os
import shutil
import subprocess as sp
parser = argparse.ArgumentParser()
parser.add_argument('-s', dest='SEEDS', default=5, type=int,
help='Number of seeds.')
parser.add_argument('-j', d... | 22.764706 | 74 | 0.588717 |
af459f124f29047c44ce1a2d40ebe20d7755eacc | 3,194 | py | Python | autojail/commands/base.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/commands/base.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/commands/base.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | from pathlib import Path
from typing import Optional
import ruamel.yaml
from cleo import Command
from ..model.board import Board
from ..model.config import AutojailConfig
from ..model.jailhouse import JailhouseConfig
from ..model.test import TestConfig
automate_available = False
try:
import automate
automat... | 31.009709 | 112 | 0.627113 |
a58c71bd3ccc1b5063179dd33da7bf6ee04f79cb | 431 | py | Python | packages/watchmen-model/src/watchmen_model/common/storable.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/common/storable.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/common/storable.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from .model import DataModel
from .tuple_ids import UserId
class Storable(DataModel):
pass
class Auditable(Storable):
createdAt: datetime = None
createdBy: UserId = None
lastModifiedAt: datetime = None
lastModifiedBy: UserId = None
class OptimisticLock(Storable):
version: int ... | 17.958333 | 77 | 0.774942 |
a595701abf882f0695153f0a028b9f989ca7be99 | 5,520 | py | Python | Scripts/buildWikiFiles.py | HuttonICS/API | 22d61759a77f2ab3c4e610bb251684c78f71d2e6 | [
"MIT"
] | 40 | 2016-09-13T12:54:11.000Z | 2021-09-05T18:45:38.000Z | Scripts/buildWikiFiles.py | HuttonICS/API | 22d61759a77f2ab3c4e610bb251684c78f71d2e6 | [
"MIT"
] | 351 | 2016-08-10T17:58:38.000Z | 2021-09-15T12:19:48.000Z | Scripts/buildWikiFiles.py | HuttonICS/API | 22d61759a77f2ab3c4e610bb251684c78f71d2e6 | [
"MIT"
] | 32 | 2016-09-09T16:04:01.000Z | 2021-01-21T13:27:40.000Z | #! /usr/bin/env python
import yaml
import glob
import sys
import json
import os
import requests
from time import sleep
def getObject(filename):
fileObj = {}
with open(filename, "r") as stream:
try:
fileObj = yaml.load(stream)
stream.close()
except yaml.YAMLError as exc:
print(exc)
return fileObj
def... | 27.192118 | 144 | 0.605072 |
3c06016765c51addf122501731fb32a9392c3bc1 | 9,690 | py | Python | tekstovni-vmesnik.py | majbc1999/Projekt | f6d2f0d1453d0a2c5ed2cd15dde224a2a690fd94 | [
"MIT"
] | 1 | 2019-11-14T07:43:11.000Z | 2019-11-14T07:43:11.000Z | tekstovni-vmesnik.py | majbc1999/Projekt | f6d2f0d1453d0a2c5ed2cd15dde224a2a690fd94 | [
"MIT"
] | null | null | null | tekstovni-vmesnik.py | majbc1999/Projekt | f6d2f0d1453d0a2c5ed2cd15dde224a2a690fd94 | [
"MIT"
] | null | null | null | # Najprej uvozimo vse potrebno v tekstovni vmesnik, ter pripravimo seznama, ki sta potrebna za delovanje programa.
# -------------------------------------------------------------------------------------------------------------------------------------#
from model import Knjiznica, Knjiga, povprecje
seznam_dejanj = []
... | 39.230769 | 188 | 0.535397 |
3ca458d302e04991890cbe7b74406b5f91187cba | 2,616 | py | Python | plan/serializers.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | plan/serializers.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | plan/serializers.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | 2 | 2020-04-20T07:26:51.000Z | 2020-04-30T11:51:54.000Z | from rest_framework import serializers
from plan.models import RoughRequirement, DetailedRequirement
from plan.models import OfferingCourse, FieldOfStudy, IndicatorFactor
from plan.models import BasisTemplate
class SimpleOfferingCourseSerializer(serializers.ModelSerializer):
class Meta:
model = OfferingCou... | 39.044776 | 106 | 0.752294 |
596467d558ceb145f971a206dc48765d4369ccda | 9,990 | py | Python | .circleci/checklhe/event.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 3 | 2015-06-08T13:09:28.000Z | 2020-09-04T19:59:36.000Z | .circleci/checklhe/event.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 64 | 2015-06-24T15:08:17.000Z | 2022-01-25T04:59:32.000Z | .circleci/checklhe/event.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 19 | 2015-05-04T22:15:41.000Z | 2021-07-06T10:04:40.000Z | import particle
import particletype
import particlecategory
import globalvariables
import usefulstuff
import config
import momentum
import vertex
import color
import ROOT
from math import copysign, acos
class Event:
#############################
# Event setup #
#############################
def __i... | 49.211823 | 188 | 0.573273 |
5979e5313e8e8e88937c47ef48246db2f27ede88 | 911 | py | Python | ___Python/Thomas/pycurs_180625/p02_datenstrukturen/m02_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p02_datenstrukturen/m02_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p02_datenstrukturen/m02_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | # Wörterbuch (Dictionary, Hashtabelle, Hashtable, Hashmap, associative Array)
dic_wb1 = {"Tisch": "table",
"Stuhl": "chair",
"Schreibtisch": "desk"}
for wort in dic_wb1:
print(dic_wb1[wort])
# Aus einem Wörterbuch einen Wert anhand des Schlüssels ermitteln
#print(wbuch["Stuhl"])
deut... | 27.606061 | 84 | 0.679473 |
abb447b7da4c1184011490d2e7b6c6059a1a0321 | 1,977 | py | Python | Packs/FeedIntel471/Integrations/Intel471Malware/Intel471Malware_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedIntel471/Integrations/Intel471Malware/Intel471Malware_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedIntel471/Integrations/Intel471Malware/Intel471Malware_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import Intel471Malware as feed
BUILD_PARAM_DICT_DATA = [
(
{'credentials': {'identifier': 'username', 'password': 'apikey'}, 'insecure': True,
'search_indicator_type': 'ipv4', 'confidence': 'high', 'auto_detect_type': False, 'proxy': True}, # input
{'confidence': 'high'} # ... | 27.458333 | 116 | 0.616591 |
55383dc81e42d6f2ad82897979b00f8eedb9b7fa | 4,936 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/test_account.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/test_account.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/test_account.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from erpnext.stock import get_warehouse_account, get_company_default_inventory_account
class TestAccount(unittest.TestCas... | 40.793388 | 98 | 0.698744 |
55a8257d2fe0e5e35b308da7c5a956460ee0d51d | 3,083 | py | Python | src/onegov/fsi/views/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/views/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/views/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Private, Personal, Secret
from onegov.fsi import FsiApp
from onegov.fsi.collections.attendee import CourseAttendeeCollection
from onegov.fsi import _
from onegov.fsi.forms.course_attendee import CourseAttendeeForm, \
AddExternalAttendeeForm
from onegov.fsi.layouts.course_attendee im... | 26.577586 | 75 | 0.681155 |
ddb1bb4a9bc9d73f4e8a398c2fe2fb295f1aaec7 | 237 | py | Python | python/python_backup/Python_Progs/Hash_SHA-2_file.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/Python_Progs/Hash_SHA-2_file.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/Python_Progs/Hash_SHA-2_file.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import hashlib
def hash_file(filename):
h=hashlib.sha1()
with open(filename,'rb') as file:
chunk=0
while chunk!='b':
chunk=file.read(1024)
h.update(chunk)
return h.hexdigest()
message=hash_file('track1.mp3')
print(message) | 18.230769 | 34 | 0.708861 |
b5f80a24ac2b9cdecd53aa5ed49dc8de4fe054aa | 4,621 | py | Python | Sorting/src/iterative_sorting/notes/cs_27_big0_insertion_sort.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | null | null | null | Sorting/src/iterative_sorting/notes/cs_27_big0_insertion_sort.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/Sorting/src/iterative_sorting/notes/cs_27_big0_insertion_sort.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | # # Returns the secret to beautiful code
# def secret_to_coding_1():
# print ("")
# print ("Beautiful code is both ELEGANT and EFFICIENT")
# print (" ELEGANT: concise, easy to read, easy to understand, easy to maintain, easy to modify")
# print (" EFFICIENT: minimal CPU operations, minimal memory/storage requ... | 25.39011 | 408 | 0.602683 |
1fa64071cda8b01c915ba3e10e23512e5519d301 | 576 | py | Python | prod-pipeline/classification/configs/Configurations.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | 1 | 2020-07-11T04:24:40.000Z | 2020-07-11T04:24:40.000Z | prod-pipeline/classification/configs/Configurations.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | null | null | null | prod-pipeline/classification/configs/Configurations.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | null | null | null | class Configurations:
configs = [
#
# Configurations for production pipeline
#
{#
# basic preprocessing
"textToLowerCase": True,
"textReplaceUmlaut": True,
"textRemoveSpecialCharacters": True,
"textRemoveSingleCharacters": ... | 28.8 | 48 | 0.538194 |
c843095008b00d10b7b923ce58e0461e2a26852f | 7,271 | py | Python | django_project/apps/cms/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | django_project/apps/cms/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | django_project/apps/cms/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.shortcuts import render
from django.views.decorators.http import require_GET,require_POST
from django.views.generic import View
from apps.news.models import NewsCategory,News,Comment
from utils import restful_res
from django.views.decorators.http import require_POST,require_GET
from .forms import WriteNewsF... | 37.479381 | 128 | 0.647366 |
9e55d255a960e4d329d695259f0d5ef773b1f1cd | 1,073 | py | Python | tests/web.adblockplus.org/tests/test_Redirects.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | tests/web.adblockplus.org/tests/test_Redirects.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | tests/web.adblockplus.org/tests/test_Redirects.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | import pytest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from pages.basePage import BasePage
from data.dataRedirects import TEST_DATA_ABPO
from data.dataRedirects import TEST_DATA_DIFFERENT_DOMAIN
import utils.global_functions as gf
@pytest.fixture
def driver():
optio... | 28.236842 | 89 | 0.796831 |
5733d733d9c753b0515c2d98febcee5e55861f33 | 107 | py | Python | python/python_backup/PRAC_PYTHON/20_test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/20_test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/20_test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | j=1
a=1
i=1;
while i>0:
j=a*i
a=a*j
i=i+1
k=0
"""for k in range(10000):
k=k+1"""
print(j) | 9.727273 | 27 | 0.457944 |
fd834cd044fb95d1e4d651512625f99c10500ccc | 2,242 | py | Python | ingress/ambassador/end-to-end/1-parallel/011-websocket/web-basic/wscat.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | ingress/ambassador/end-to-end/1-parallel/011-websocket/web-basic/wscat.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2021-03-26T00:22:50.000Z | 2021-03-26T00:26:07.000Z | ingress/ambassador/end-to-end/1-parallel/011-websocket/web-basic/wscat.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/usr/bin/env python
#
# Simple command line WebSocket client.
#
import argparse
import json
import os
import socket
import sys
import websocket
enable_verbose = False
def vprint(msg):
if enable_verbose:
print("> %s" % msg)
def connect(url, subprotocol):
header = {}
if not subprotocol:
... | 27.679012 | 79 | 0.582516 |
a90578c021d791eb77c8f310b4ca78c8c1e130bb | 1,780 | py | Python | qmk_firmware/lib/python/qmk/cli/json2c.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | qmk_firmware/lib/python/qmk/cli/json2c.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/json2c.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """Generate a keymap.c from a configurator export.
"""
import json
from argcomplete.completers import FilesCompleter
from milc import cli
import qmk.keymap
import qmk.path
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
@cli.argument('-q', '--quiet', arg_only=True, ac... | 36.326531 | 171 | 0.684831 |
477f9ee968572e14e0352cfe3ed7a2e296e14317 | 2,339 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex10_number_palindrome.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex10_number_palindrome.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex10_number_palindrome.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def calc_pow_of_ten(number):
return count_digits(number) - 1
# Funktioniert nur korrekt, wenn die Zahl keine Nullen enthält
def count_digits(number):
count = 0
while number > 0:
number = number // 10
... | 26.885057 | 74 | 0.654553 |
7be1fbddb4eb38ac4f52b434350ebf5205802ded | 1,920 | py | Python | src/prime.py | ahmadnaufalhakim/rsa-algorithm | 40b8a0d0531620221318146dd6c800a592cb4390 | [
"MIT"
] | null | null | null | src/prime.py | ahmadnaufalhakim/rsa-algorithm | 40b8a0d0531620221318146dd6c800a592cb4390 | [
"MIT"
] | null | null | null | src/prime.py | ahmadnaufalhakim/rsa-algorithm | 40b8a0d0531620221318146dd6c800a592cb4390 | [
"MIT"
] | null | null | null | from random import randrange, getrandbits
def is_prime(n: int,
k: int = 128) :
"""
Test if a number 'n' is prime or not using Miller-Rabin primality test
n: the number to test
k: the number of tests to perform on 'n'
Return True if n is prime
"""
if n == 3 :
r... | 22.588235 | 74 | 0.528125 |
cd3ec8e4b54beda30b30200511cfea9a6ab99823 | 30 | py | Python | pages/extensions/url_beautifier/__init__.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 300 | 2015-12-09T20:35:37.000Z | 2019-07-16T06:41:29.000Z | pages/extensions/url_beautifier/__init__.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 2,099 | 2019-07-16T13:24:27.000Z | 2022-03-26T12:31:51.000Z | pages/extensions/url_beautifier/__init__.py | ericandrewlewis/amp.dev | cf8e3d34a5582696ead97563c0809036804ab5c7 | [
"Apache-2.0"
] | 543 | 2019-07-18T09:06:14.000Z | 2022-03-31T02:43:10.000Z | from .url_beautifier import *
| 15 | 29 | 0.8 |
26dbbf52b1fe9d84ecaa36018cfa2a35bbd0f7e9 | 766 | py | Python | hello/hello_ui/hello_tk.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/hello_ui/hello_tk.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/hello_ui/hello_tk.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from tkinter import *
import tkinter.messagebox
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
def createWidgets(self):
self.nameInput = Entry(self)
... | 23.9375 | 73 | 0.622715 |
f88642900cbfac33e9d3fcc84d8e5700b309cfe1 | 527 | py | Python | python/bigger_is_greater.py | higoress/HackerRank | ac13fc378734e70eef08b357bb36c47655d7d0be | [
"MIT"
] | null | null | null | python/bigger_is_greater.py | higoress/HackerRank | ac13fc378734e70eef08b357bb36c47655d7d0be | [
"MIT"
] | null | null | null | python/bigger_is_greater.py | higoress/HackerRank | ac13fc378734e70eef08b357bb36c47655d7d0be | [
"MIT"
] | null | null | null | #also known as next permutation problem
def biggerIsGreater(w):
string = list(w)
for i in range(len(w)-1, 0, -1):
if string[i] > string[i-1]:
pivot = string[i-1]
head = list(string[:i-1])
tail = list(string[i:])
tail.reverse()
for element in ta... | 32.9375 | 53 | 0.489564 |
f89b0a5a25edd02b537be3af8d46bde9f7b0ad9d | 16,967 | py | Python | src/onegov/file/integration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/integration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/integration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import morepath
import os.path
import shlex
import shutil
import subprocess
import yaml
from blinker import ANY
from contextlib import contextmanager
from depot.io.utils import FileIntent
from depot.manager import DepotManager
from depot.middleware import FileServeApp
from more.transaction.main import transaction_twee... | 34.276768 | 79 | 0.668474 |
e433dfa3e4f67db2fdfc68869656c0bb368a1c5b | 3,372 | py | Python | scripts/symbol_ops.py | Laighno/evt | 90b94e831aebb62c6ad19ce59c9089e9f51cfd77 | [
"MIT"
] | 1,411 | 2018-04-23T03:57:30.000Z | 2022-02-13T10:34:22.000Z | scripts/symbol_ops.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 27 | 2018-06-11T10:34:42.000Z | 2019-07-27T08:50:02.000Z | scripts/symbol_ops.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 364 | 2018-06-09T12:11:53.000Z | 2020-12-15T03:26:48.000Z | #!/usr/bin/env python3
import os
import pathlib
import shutil
import subprocess
import time
import click
def green(text):
return click.style(text, fg='green')
@click.group('cli')
def cli():
pass
def export_symbol(file, folder):
filename = os.path.basename(file)
sym_file = '{}.sym'.format(filenam... | 29.840708 | 92 | 0.595492 |
900f723928e3870d047b11b606847333bce3d0ea | 1,855 | py | Python | head/ArcNegFace.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | head/ArcNegFace.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | head/ArcNegFace.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | """
@author: Yaobin Li
@date: 20210219
@contact: cavallyb@gmail.com
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
import math
class ArcNegFace(nn.Module):
"""Implement of Towards Flops-constrained Face Recognition (https://arxiv.org/pdf/1909.00632.pdf):
... | 35 | 102 | 0.598383 |
5f4d12f24c96be1a4d20838f861f00ad029e632e | 16,950 | py | Python | sandbox/lib/autograff_utils.py | colormotor/sandbox | b0f86c33fc3e27e87009508de93e79e14bb6241d | [
"MIT"
] | 2 | 2019-01-23T19:39:17.000Z | 2020-10-26T11:55:44.000Z | sandbox/lib/autograff_utils.py | colormotor/sandbox | b0f86c33fc3e27e87009508de93e79e14bb6241d | [
"MIT"
] | null | null | null | sandbox/lib/autograff_utils.py | colormotor/sandbox | b0f86c33fc3e27e87009508de93e79e14bb6241d | [
"MIT"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... | 39.69555 | 130 | 0.73764 |
3975fae68d75b857237c2512c972f997dad0ee90 | 5,076 | py | Python | taren/episodelist.py | ThirtySomething/TaRen | ef09e8616c45bcb97afcea3ad4844ae6fade7525 | [
"MIT"
] | null | null | null | taren/episodelist.py | ThirtySomething/TaRen | ef09e8616c45bcb97afcea3ad4844ae6fade7525 | [
"MIT"
] | null | null | null | taren/episodelist.py | ThirtySomething/TaRen | ef09e8616c45bcb97afcea3ad4844ae6fade7525 | [
"MIT"
] | null | null | null | '''
******************************************************************************
Copyright 2020 ThirtySomething
******************************************************************************
This file is part of TaRen.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and ... | 40.935484 | 126 | 0.620961 |
f2465c7d7483f23e6bd862c6e5f45fc4e5c9d4c0 | 1,878 | py | Python | createDiagram/create_bridge.py | Ch3ri0ur/PirateDoc | be7ad0a54c00a1f990b6670b6b41a75028946205 | [
"MIT"
] | null | null | null | createDiagram/create_bridge.py | Ch3ri0ur/PirateDoc | be7ad0a54c00a1f990b6670b6b41a75028946205 | [
"MIT"
] | null | null | null | createDiagram/create_bridge.py | Ch3ri0ur/PirateDoc | be7ad0a54c00a1f990b6670b6b41a75028946205 | [
"MIT"
] | null | null | null | import os
os.environ["PATH"] += os.pathsep + "C:\Program Files\Graphviz 2.44.1/bin/"
from diagrams import Cluster, Diagram, Edge
from diagrams.custom import Custom
from diagrams.onprem.analytics import Spark
from diagrams.onprem.compute import Server
from diagrams.onprem.database import PostgreSQL
from diagram... | 38.326531 | 82 | 0.691161 |
8a55400aaa96276519fdcb02b07efa398490b75e | 2,384 | py | Python | head/NPCFace.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | head/NPCFace.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | head/NPCFace.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | """
@author: Hand Du, Jun Wang
@date: 20201019
@contact: jun21wangustc@gmail.com
"""
import math
import torch
import torch.nn.functional as F
from torch.nn import Module, Parameter
class NPCFace(Module):
"""Implementation for "NPCFace: A Negative-Positive Cooperation
Supervision for Training L... | 41.824561 | 98 | 0.603188 |
0a0274a6ea8f444f77f9f18611b892ecf2901b2e | 1,367 | py | Python | Utils/github_workflow_scripts/github_workflow_scripts_tests/run_docs_review_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Utils/github_workflow_scripts/github_workflow_scripts_tests/run_docs_review_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Utils/github_workflow_scripts/github_workflow_scripts_tests/run_docs_review_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from argparse import Namespace
from Utils.github_workflow_scripts.run_docs_review import run_docs_review
class TestsRunDocsReview:
def test_file_name_includes_apostrophe(self, mocker, capsys):
"""
Given:
- A string contains a file name with an apostrophe.
When:
... | 45.566667 | 114 | 0.680322 |
0a253ed3beb248fa47afef870d8cddb794178f49 | 722 | py | Python | Algorithms/2_Implementation/31.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/31.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/31.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/larrys-array/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'larrysArray' function below.
#
# The function is expected to return a STRING.
# The function accepts INTEGER_ARRAY A as parameter.
#
def larrysArray(A):
return "... | 20.628571 | 107 | 0.632964 |
0a5c1405de05477bc2316380011c44a48cb21404 | 12,563 | py | Python | backend/apps/iamstudent/models.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/iamstudent/models.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/iamstudent/models.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | from django.db import models
import uuid
from datetime import datetime
from django.core.exceptions import ValidationError
from apps.mapview.utils import plzs
from django.utils.translation import gettext_lazy as _
from apps.accounts.models import User
from apps.ineedstudent.models import Hospital
def validate_semester(... | 31.805063 | 116 | 0.685903 |
6aa81f79b29bda75ed55ffc1cd415ba9f0d268eb | 4,151 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_7/item_template_attributes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v5_7/item_template_attributes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_7/item_template_attributes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe.exceptions import SQLError
def execute():
"""
Structure History:
1. Item and Item Variant
2. Item... | 33.208 | 106 | 0.747772 |
6ab6bed91f216734e432ecf74f2d668f3a41dbb1 | 13,404 | py | Python | Liquid-job-NeuMF/official/recommendation/data_test.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | 2 | 2021-08-30T14:12:09.000Z | 2022-01-20T02:14:22.000Z | Liquid-job-NeuMF/official/recommendation/data_test.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | Liquid-job-NeuMF/official/recommendation/data_test.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 37.337047 | 81 | 0.638988 |
6ad39f424a48ce510408f9a3ed5555a8d1957fc0 | 11,311 | py | Python | asteroid/dsp/overlap_add.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2020-12-18T02:42:23.000Z | 2020-12-18T02:42:23.000Z | asteroid/dsp/overlap_add.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | asteroid/dsp/overlap_add.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | import torch
from scipy.signal import get_window
from asteroid.losses.pit_wrapper import PITReorder
from torch import nn
class LambdaOverlapAdd(torch.nn.Module):
"""Overlap-add with lambda transform on segments (not scriptable).
Segment input signal, apply lambda function (a neural network for example)
a... | 35.569182 | 95 | 0.590929 |
6ae80e87e17d424209c4d9126935eb9912435c8a | 1,759 | py | Python | Lehrjahr_2/Modul_122/python/DatenMigration.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 5 | 2015-05-19T14:26:53.000Z | 2016-06-24T17:03:03.000Z | Lehrjahr_2/Modul_122/python/DatenMigration.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | null | null | null | Lehrjahr_2/Modul_122/python/DatenMigration.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 6 | 2015-05-26T06:25:05.000Z | 2020-04-30T07:25:30.000Z | #!/usr/bin/python3.4
#
#SCRIPT: DatenMigration.py
#AUTHOR: Severin Kaderli
#PURPOSE: Validates csv file
#USAGE: ./DatenMigration.py
import re
import csv
with open('Data1.csv', newline='') as f:
reader = csv.reader(f, delimiter=';')
rownr = 1
for row in reader:
colnr = 1
for col in row:
if colnr == 1:
#Ad... | 35.18 | 86 | 0.520182 |
6b36e90c86a5c3b2c87788b9fa7e482fa5f358c4 | 844 | py | Python | kvadrat.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | kvadrat.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | kvadrat.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | import typing
def kvadrat(a: float, b: float = 0.0, c: float = 0.0) -> typing.Union[None,float,typing.Tuple[float,float]]:
"""Vypočítá nulové body kvadratické rovnice s pomocí radaných parametrů
Parametry
---------
::
a: float
b: float
c: float
Výstup
------
::... | 27.225806 | 108 | 0.550948 |
d4d37c0bded5a1114c7a83fd45850cd527a609bc | 4,380 | py | Python | ZbjDjChannels/djim/consumers.py | zbjlala/ZbjDjChannels | c4da2339574e2e398bd452eef4d026eab309752c | [
"MIT"
] | null | null | null | ZbjDjChannels/djim/consumers.py | zbjlala/ZbjDjChannels | c4da2339574e2e398bd452eef4d026eab309752c | [
"MIT"
] | null | null | null | ZbjDjChannels/djim/consumers.py | zbjlala/ZbjDjChannels | c4da2339574e2e398bd452eef4d026eab309752c | [
"MIT"
] | null | null | null | import datetime
import json
import socket
import redis as redis
from channels.generic.websocket import AsyncJsonWebsocketConsumer
from djim.models import UserSession, channel, UserList
from djim.serializers import usersession_json, user_list_json
from utils import const, ipHelper
class ChatConsumer(AsyncJsonWebsock... | 34.488189 | 111 | 0.542922 |
9c204d1a7ba65ab1ac8512a226c7dbe954de2825 | 6,348 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/panos_cert_gen_ssh.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/panos_cert_gen_ssh.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/panos_cert_gen_ssh.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | 32.553846 | 122 | 0.65627 |
9c82f35c80ce93d256b19a66549a9840631070f1 | 568 | py | Python | projects/controllers/figures.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/controllers/figures.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/controllers/figures.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Figures controller."""
import platiagro
def list_figures(project_id, experiment_id, operator_id):
"""Lists all figures from object storage as data URI scheme.
Args:
project_id (str): the project uuid.
experiment_id (str): the experiment uuid.
operator_id (s... | 27.047619 | 64 | 0.598592 |
1381181311782cc19afcd56ee3c6bcb2742555dc | 1,829 | py | Python | randgen.py | getYourFlag/randgen | 219b2428d39fd801b34a4e3d66e45e161f804609 | [
"MIT"
] | null | null | null | randgen.py | getYourFlag/randgen | 219b2428d39fd801b34a4e3d66e45e161f804609 | [
"MIT"
] | null | null | null | randgen.py | getYourFlag/randgen | 219b2428d39fd801b34a4e3d66e45e161f804609 | [
"MIT"
] | null | null | null | import random, pyperclip, secrets
def main():
selections = {
"1": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", # Uppercase
"2": "abcdefghijklmnopqrstuvwxyz", # Lowercase
"3": "1234567890", # Numbers
"4": "-_", # Seperators
"5": "!@#$%^&*():<>?/.,[]" # Special Characters
}
whil... | 37.326531 | 109 | 0.601422 |
13c7c03c016433a4bbe60bac1eb3b2a2b8a9f299 | 3,637 | py | Python | Paddle_Industry_Practice_Sample_Library/nlp_projects/event_extraction/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-19T09:58:37.000Z | 2022-03-19T09:58:37.000Z | Paddle_Industry_Practice_Sample_Library/nlp_projects/event_extraction/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | Paddle_Industry_Practice_Sample_Library/nlp_projects/event_extraction/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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.284211 | 146 | 0.729172 |
16964262a2e4fce7db355dc128b0805853bb75b3 | 1,700 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex01_even_odd_ordering_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex01_even_odd_ordering_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex01_even_odd_ordering_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import array
import numpy as np
from ch06_arrays.solutions.ex01_even_odd_ordering import order_even_before_odd, order_even_before_odd_optimized
def main():
# Python array
print("working on pure arrays")
values = ar... | 26.984127 | 111 | 0.639412 |
bc4324c0fd52dea1fd18f330adeb801a6e8ac325 | 1,063 | py | Python | template.py | hwchiu/USACO | e82ffa309b6f1b183faf8c10d7760f479f542f6a | [
"Apache-2.0"
] | null | null | null | template.py | hwchiu/USACO | e82ffa309b6f1b183faf8c10d7760f479f542f6a | [
"Apache-2.0"
] | null | null | null | template.py | hwchiu/USACO | e82ffa309b6f1b183faf8c10d7760f479f542f6a | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python
import sys
import os
if len(sys.argv) <=2:
print "Usage: DirectoryName progName"
sys.exit(0)
#Create directory
newpath = r'src/'+sys.argv[1]
if not os.path.exists(newpath):
os.makedirs(newpath)
#Create c++ file
cppFile = open(newpath+"/"+sys.argv[2]+".cpp",'w')
content="\
/*\n\
ID: hwchiu1\... | 20.442308 | 51 | 0.61524 |
e6f38fac10a813bc9f367d6748f33385a4c63021 | 2,961 | py | Python | frappe-bench/env/lib/python2.7/site-packages/github/tests/Issue134.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/Issue134.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/Issue134.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2014 Vincent Jacques <vincent@vincent-ja... | 56.942308 | 141 | 0.489024 |
f8d60cd9cf0ff67c8f86462b99a601bf789d56c4 | 1,343 | py | Python | wagtail_localize/machine_translators/deepl.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/deepl.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/deepl.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 2 | 2019-09-30T20:23:39.000Z | 2019-10-31T14:09:31.000Z | import requests
from wagtail_localize.strings import StringValue
from .base import BaseMachineTranslator
def language_code(code, is_target=False):
# DeepL supports targeting Brazillian Portuguese but doesn't have this for other languages
if is_target and code in ["pt-pt", "pt-br"]:
return code
... | 31.97619 | 94 | 0.625465 |
f8f5a619c33d2889ef437b9c72e8e709278eb4f4 | 398 | py | Python | peptalk.py | mseabold/peptalk | 1366b53f9f252f4b8d040fd8adbdca62236b6e11 | [
"MIT"
] | null | null | null | peptalk.py | mseabold/peptalk | 1366b53f9f252f4b8d040fd8adbdca62236b6e11 | [
"MIT"
] | null | null | null | peptalk.py | mseabold/peptalk | 1366b53f9f252f4b8d040fd8adbdca62236b6e11 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
import json
import random
app = Flask(__name__)
with open('choices.json', 'r') as choices_file:
choices = json.load(choices_file)
random.seed()
@app.route('/')
def index():
return render_template('index.html')
@app.route('/generate')
def generate():
peptalk = [r... | 18.952381 | 63 | 0.70603 |
5d2b80dd9ead33f62d8d3fb1dfbef4257cc8bd9f | 503 | py | Python | Boot2Root/vulnhub/Pinkys-Palace-v2/scripts/knock.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 21 | 2016-02-06T14:30:01.000Z | 2020-09-11T05:39:17.000Z | Boot2Root/vulnhub/Pinkys-Palace-v2/scripts/knock.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | null | null | null | Boot2Root/vulnhub/Pinkys-Palace-v2/scripts/knock.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 7 | 2017-02-02T16:27:02.000Z | 2021-04-30T17:14:53.000Z | from itertools import permutations
from scapy.all import *
import socket
def SendPkt(ip, port):
ip = IP(src="192.168.1.17", dst=ip)
SYN = TCP(sport=64349, dport=port, flags="S", seq=12345)
send(ip/SYN)
def TestPort(ip, port):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout... | 25.15 | 60 | 0.673956 |
537b4b1790372a1da11ea5af06e0b86dd3f86e29 | 899 | py | Python | app/error_handler.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | 2 | 2019-06-24T08:34:39.000Z | 2019-06-27T12:23:47.000Z | app/error_handler.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | app/error_handler.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | # encoding:utf-8
from app import app
from utils import logger
from flask import jsonify
@app.errorhandler(400)
def error_400(error):
return jsonify(
code=400,
data=None,
message=str(error)
), 400
@app.errorhandler(404)
def error_404(error):
return jsonify(
code=404,
... | 17.627451 | 98 | 0.617353 |
4ae27a3b0970a13cdf364a330821ce91a1351dd0 | 5,032 | py | Python | cnn.py | wmhst7/EmotionAnalysis | e94fbbb5bba4706abcea06f503c9a8da5f60203a | [
"MIT"
] | null | null | null | cnn.py | wmhst7/EmotionAnalysis | e94fbbb5bba4706abcea06f503c9a8da5f60203a | [
"MIT"
] | null | null | null | cnn.py | wmhst7/EmotionAnalysis | e94fbbb5bba4706abcea06f503c9a8da5f60203a | [
"MIT"
] | 2 | 2020-05-29T15:56:13.000Z | 2021-06-03T14:18:39.000Z | import numpy as np
import json, os, sys, random, time
from sklearn.metrics import f1_score, accuracy_score
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as Data
import torch.optim as optim
t0 = time.time()
# 参数
max_len = 500
batch_size = 64
label_size = 8
embed_size, kerne... | 38.412214 | 109 | 0.642091 |
dbdc47e77a7b284cfae52e0ecb871de4db0fdd6d | 375 | py | Python | pacman-termux/test/pacman/tests/remove010.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/remove010.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/remove010.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Remove a package with an unchanged file marked for backup"
p1 = pmpkg("dummy")
p1.files = ["etc/dummy.conf"]
p1.backup = ["etc/dummy.conf"]
self.addpkg2db("local", p1)
self.args = "-R %s" % p1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=dummy")
self.addrule("!FILE_EXIST=etc/dum... | 26.785714 | 78 | 0.717333 |
9175db053b75c4dab0a1002fe5e87b275e5d25ef | 6,801 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/hashtable.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/hashtable.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/hashtable.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | class HashTableEntry:
"""
Linked List hash table key/value pair
"""
def __init__(self, key, value):
self.key = key
self.value = value
self.next = None
# Hash table can't have fewer than this many slots
MIN_CAPACITY = 8
class HashTable:
"""
A hash table that with `capa... | 26.360465 | 101 | 0.567858 |
91dc8ed07dab3b22f0022da79fe5c0505a3c33eb | 2,065 | py | Python | src/data_analysis/combined.py | Qjammer/tfg | e832db3b344d0c422c50e398110cd0b6d5d97a60 | [
"MIT"
] | null | null | null | src/data_analysis/combined.py | Qjammer/tfg | e832db3b344d0c422c50e398110cd0b6d5d97a60 | [
"MIT"
] | null | null | null | src/data_analysis/combined.py | Qjammer/tfg | e832db3b344d0c422c50e398110cd0b6d5d97a60 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import matplotlib.pyplot as plt
import csv
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
fig=plt.figure()
ax2=fig.add_subplot(111,projection='3d')
#ax1=fig.add_subplot(122)
ax2.set_xlabel('x')
ax2.set_ylabel('y')
ax2.set_zlabel('z')
nx=[]
ny=[]
w=[]
with open('data/buckets3.txt','r') as ... | 20.445545 | 130 | 0.658596 |
72fb0d682332d76bb0ececfed59b6c54cf330063 | 3,022 | py | Python | loesungen/chapter03/fractions2.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | loesungen/chapter03/fractions2.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | loesungen/chapter03/fractions2.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | class Fraction:
def __init__(self, numerator, denominator):
self.numerator = numerator
self.denominator = denominator
# Vorzeichen (Minus)
def __neg__(self):
return Fraction(-self.numerator, self.denominator)
# Addition
def __add__(self, other):
if type(other) == i... | 30.836735 | 99 | 0.557247 |
22bfee2a3b3b8e93515c09034eac9339570c5cf5 | 20,180 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/sorcery.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/sorcery.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/sorcery.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015-2016, Vlad Glagolev <scm@vaygr.net>
#
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',... | 31.286822 | 108 | 0.561596 |
fe05b33fc6f895dee6ba8a09f9bcad807cd206fb | 1,467 | py | Python | addition_module/face_lightning/KDF/loss/pkt.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | addition_module/face_lightning/KDF/loss/pkt.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | addition_module/face_lightning/KDF/loss/pkt.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
'''
Adopted from https://github.com/passalis/probabilistic_kt/blob/master/nn/pkt.py
'''
class PKTCosSim(nn.Module):
'''
Learning Deep Representations with Probabilistic Knowledge Transfer
http://openaccess.thecvf.com/content_ECCV_2018/papers/Nikolao... | 34.116279 | 122 | 0.738923 |
6005054089c8309d5c7a9f1f91a5a868cce9b561 | 261 | py | Python | group7-module1-oluwatobi/project 9/resize.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | group7-module1-oluwatobi/project 9/resize.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | group7-module1-oluwatobi/project 9/resize.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | from PIL import Image
# Image.open() can also open other image types
image = Image.open("images/car5.jpg")
# WIDTH and HEIGHT are integers
resized_image = image.resize((round(image.size[0]*0.5), round(image.size[1]*0.5)))
resized_image.save("resized/car5.jpg") | 37.285714 | 82 | 0.743295 |
601ea10476eb4aeaf84a47e25656190af94ad04c | 371 | py | Python | vkapp/bot/handlers.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | 1 | 2017-11-23T13:33:13.000Z | 2017-11-23T13:33:13.000Z | vkapp/bot/handlers.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | null | null | null | vkapp/bot/handlers.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | null | null | null | from vkapp.bot.logic.core.vk_trigger import VKTrigger
from .logic.core.StateMachine import StateMachine
from multiprocessing import Process, Array
def handle_update(update):
uid = update[3]
state_machine = StateMachine()
# p = Process(target=state_machine.fire, args=(VKTrigger, uid, update))
# p.start... | 28.538462 | 75 | 0.746631 |
607ef69096384edbba78d8ce3887773ce991a215 | 1,678 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/create_budget_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/create_budget_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/create_budget_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
from erpnext.accounts.doctype.budget.budget import DuplicateBudgetError
def execute():
frappe.reload_doc("accounts", "doctype", "budget")
frappe.reload_doc("accounts", "doctype", "budget_account")
existing_budgets = frappe.db.sql("""
select
cc.name, cc.company, cc.distribution_id,
budget.acc... | 29.964286 | 101 | 0.733611 |
71804c380e82dd5acce405d09f6e25efb35a0742 | 975 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_06_Funktionen/07_recursive_functions_factorial_of_numbers.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_06_Funktionen/07_recursive_functions_factorial_of_numbers.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_06_Funktionen/07_recursive_functions_factorial_of_numbers.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 07_recursive_functions_factorial_of_numbers.py
# Project: Kapitel_06_Funktionen
# Created Date: Sunday 24.02.2019, 13:33
# Author: Apop85
# -----
# Last Modified: Sunday 24.02.2019, 14:15
# -----
# Copyright (c) 2019 Apop85
# This software is published under the... | 26.351351 | 88 | 0.695385 |
1c3394928c52fedcbcc3da1f0b982b0115c87fd9 | 3,783 | py | Python | helper.py | ypislon/bachelorarbeit | 2e1d07d667d505a79d1adb9363cec5d21dafe832 | [
"MIT"
] | null | null | null | helper.py | ypislon/bachelorarbeit | 2e1d07d667d505a79d1adb9363cec5d21dafe832 | [
"MIT"
] | null | null | null | helper.py | ypislon/bachelorarbeit | 2e1d07d667d505a79d1adb9363cec5d21dafe832 | [
"MIT"
] | null | null | null | from datetime import date, datetime, timedelta
from db_schema import Link
from lxml import html
from io import StringIO
from urllib.parse import urljoin, urlparse
import logging
def parse_articles_url(website):
url_fragment = website.article_page
urls = list()
urls.append(url_fragment)
if "$c$" in url_... | 34.081081 | 102 | 0.564896 |
40c2cf0358da9afd9037707041248fe61034bdd5 | 27,741 | py | Python | frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import json
import frappe.utils
from frappe.utils import cstr, flt, getdate, comma_and, cint
from frappe import _
from frappe.model.utils ... | 33.707169 | 147 | 0.71324 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.