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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5cb3e6e52ca89fa90353fac02a5369388e46d219 | 126 | py | Python | spider/got/manager/__init__.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/got/manager/__init__.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/got/manager/__init__.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | from TweetCriteria import TweetCriteria
from TweetManager import TweetManager,getTweet
from DialogManager import DialogManager | 42 | 46 | 0.904762 |
7a62378e24c3ab53d837d13c4a76242aa6d80674 | 200 | py | Python | data_models/__init__.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | null | null | null | data_models/__init__.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | null | null | null | data_models/__init__.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | 2 | 2020-03-22T11:38:54.000Z | 2020-03-24T11:11:56.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from .user_profile import UserProfile
from .user_profile import PersonalData
__all__ = ["UserProfile"]
| 22.222222 | 59 | 0.79 |
890510ed6cac4850ac18b355fb0b8f338f95d824 | 12,730 | py | Python | Packs/BmcHelixRemedyForce/Scripts/BMCHelixRemedyforceCreateServiceRequest/BMCHelixRemedyforceCreateServiceRequest.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/BmcHelixRemedyForce/Scripts/BMCHelixRemedyforceCreateServiceRequest/BMCHelixRemedyforceCreateServiceRequest.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/BmcHelixRemedyForce/Scripts/BMCHelixRemedyforceCreateServiceRequest/BMCHelixRemedyforceCreateServiceRequest.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
import json
from typing import Dict, Any
DEFAULT_ARGS = [
"category_id",
"client_id",
"queue_id",
"staff_id",
"status_id",
"urgency_id",
"service_request_definition_id",
"service_req... | 36.475645 | 114 | 0.661665 |
8f3f102b5c103cc9af60d529817d9d842e868ef7 | 426 | py | Python | p01/src/getJob.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/src/getJob.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/src/getJob.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from psql import DeploymentDB
import json
import sys
def getJob(type):
query = """
SELECT *
FROM deployments
WHERE type = %s
and state_summary = 'new'
LIMIT 1
"""
db = DeploymentDB()
result = db.execute(query, [type,] )
db.disconnect()
print(jso... | 12.909091 | 40 | 0.589202 |
85342cda445fcf45ac1541a9d3e00e193cce7765 | 2,111 | py | Python | nz_django/day7/context_professor_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day7/context_professor_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day7/context_professor_demo/front/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,redirect,reverse
from .models import User
from django.views import View
from .forms import SignupForm,SigninForm
from django.contrib import messages
def index(request):
# users = []
# for x in range(0,51):
# user = User(username='用户名:%s'%x,password='password:%s'% x,te... | 33.507937 | 95 | 0.616296 |
8560aeb7dbbe269b44c9435d61c871d9fd38cf08 | 1,082 | py | Python | src/test/tests/databases/flash.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/flash.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/databases/flash.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: flash.py
#
# Tests: FLASH data
#
# Programmer: Mark C. Miller
# Date: March6, 2007
#
# Modifications:
#
# Hank Childs and Randy Hudson, Sun Mar 2 15:38:05 PST 2008
# Reflect new ... | 23.521739 | 78 | 0.595194 |
bb3555121b21f25d909e4c6958c0fbd182fe111a | 200 | py | Python | backend/api/urls.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/api/urls.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/api/urls.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | from django.urls import path
from rest_framework.authtoken.views import obtain_auth_token
from .views import api_home
urlpatterns = [
path("auth/", obtain_auth_token),
path("", api_home),
]
| 20 | 60 | 0.75 |
2482f5f7bcc710e2c42d4a64d938986813c45dda | 1,219 | py | Python | SleekSecurity/layers/plugins/fingerprint/framework/horde.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/framework/horde.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/framework/horde.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name: Wascan - Web Application Scanner
# @repo: https://github.com/m4ll0k/Wascan
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'LICENSE.txt
from re import search,I
def horde(headers,content):
_ = False
for header in headers:
_ |= search(r"webma... | 55.409091 | 182 | 0.648072 |
8ed699694e1951c0cebf0c65769a2086bf427810 | 1,017 | py | Python | 2018-bofa-derbycon8/Password Cracking/files/decrypt_this.py | mubix/ctf | 24dd1f4441ade30b66073eba12e0c81281017d3e | [
"MIT"
] | 13 | 2018-10-19T14:59:59.000Z | 2019-08-12T14:52:37.000Z | 2018-bofa-derbycon8/Password Cracking/files/decrypt_this.py | mubix/ctf | 24dd1f4441ade30b66073eba12e0c81281017d3e | [
"MIT"
] | 3 | 2018-10-20T02:11:58.000Z | 2018-10-30T05:10:34.000Z | 2018-bofa-derbycon8/Password Cracking/files/decrypt_this.py | mubix/ctf | 24dd1f4441ade30b66073eba12e0c81281017d3e | [
"MIT"
] | 5 | 2018-10-19T22:15:25.000Z | 2020-07-10T17:16:29.000Z | import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key):
self.blockSize = 32
self.key = hashlib.md5(key.encode()).digest()
def encrypt(self, raw):
raw = self.padding(raw)
iv = Random.new().read(AES... | 29.911765 | 124 | 0.660767 |
79434a7c3f5ee83be36a065d57619d0bcfc0d42f | 543 | py | Python | Topics/Sorting/Bubble-Sort/bubble-sort.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Topics/Sorting/Bubble-Sort/bubble-sort.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Topics/Sorting/Bubble-Sort/bubble-sort.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def bubble_sort(a: list):
"""Optimized Bubble sort that return sorted list with O(n^2) complexity"""
a, n = a.copy(), len(a)
for _ in range(n):
is_swap = False
for i in range(1, n):
if a[i-1] > a[i]:
is_swap = True
a[i-1], a[i] = a[i], a[i-1]
... | 25.857143 | 78 | 0.521179 |
797bd17645d75222a55e1713d9725b592bd24ff2 | 1,286 | py | Python | listings/chapter08/neural-network-keras-mnist.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter08/neural-network-keras-mnist.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter08/neural-network-keras-mnist.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
# Kategorien,
categories = 10
# Daten laden
(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()
# Feature-Skalierung
x_train = x_train.astype("float32") / 255
x_test = x_test.astype("float32") / 255
# Daten in di... | 27.956522 | 87 | 0.708398 |
692dba18a13647e3793b3605ccc62c8bf13fd72d | 4,992 | py | Python | test/test_npu/test_network_ops/test_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 39.307087 | 83 | 0.67528 |
c6397e22cb640117bc9094b52febc09b448272a4 | 1,584 | py | Python | src/tools/data/hdfs_export/spark_examples/NumNodesBlocks.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/tools/data/hdfs_export/spark_examples/NumNodesBlocks.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/tools/data/hdfs_export/spark_examples/NumNodesBlocks.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | import sys
from pyspark import SparkContext
from pyspark import SparkConf
#
# This is the basic logic necessary to decode hdfs_export's keys
#
KeyDigits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%#"
def AsciiKeyToIndex(key, keybase=None):
if key is None:
return 0
kb = 0
if ke... | 30.461538 | 118 | 0.679293 |
ba7fc2c4c28f453ef4be0c6f31d63de308a9e6fc | 384 | py | Python | Cracking_the_Coding_Interview/sort_bubble_sort.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Cracking_the_Coding_Interview/sort_bubble_sort.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Cracking_the_Coding_Interview/sort_bubble_sort.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
n = int(input().strip())
a = list(map(int, input().strip().split(' ')))
swap_cnt = 0
for i in range(len(a)):
for j in range(len(a) - 1):
if a[j] > a[j + 1]:
a[j], a[j + 1] = a[j + 1], a[j]
swap_cnt += 1
print('Array is sorted in %d swaps.' % swap_c... | 24 | 48 | 0.526042 |
cee63a2fea4480ca30545fc214b36f2b07b4a1ce | 2,143 | pyde | Python | sketches/fire3/fire3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/fire3/fire3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/fire3/fire3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from random import randint
empty = 0
tree = 1
burning = 20
a = 40
g = 1
nRows = 280
nCols = 160
w = h = 2
grid = []
newgrid = []
def setup():
global trees, fire
size(560, 320)
background(210, 180, 140)
for x in range(nRows):
grid.append([])
newgrid.append([])
for y in range(... | 27.126582 | 101 | 0.442371 |
cc7152d96b325a79f6e33ffec7de7b63bc684db0 | 149 | py | Python | Contests/Sum square difference.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/Sum square difference.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/Sum square difference.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | a = int(input("Enter max digits to count up to:"))
b = 0
c = 0
for i in range(1, a + 1):
b += i**2
c += i
print("Answer is " + str(c**2 - b)) | 21.285714 | 50 | 0.510067 |
ae90b2b1e338a4e77892b43630510c59dee3ef9d | 1,055 | py | Python | setup.py | lueck/learn-python-lego-de | db44b1c2cd4048f229fa5096655ccf3ab2fe34ec | [
"MIT"
] | null | null | null | setup.py | lueck/learn-python-lego-de | db44b1c2cd4048f229fa5096655ccf3ab2fe34ec | [
"MIT"
] | null | null | null | setup.py | lueck/learn-python-lego-de | db44b1c2cd4048f229fa5096655ccf3ab2fe34ec | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="learn-python-lego-de",
version="0.0.1",
author="Christian Lück",
author_email="clueck@wwu.de",
description="Flattening the learning curve for python starters playing with... | 30.142857 | 92 | 0.61327 |
ae9aa2099fe174aee83b6d20eba4d708c7fc3439 | 447 | py | Python | p01/tests/test_config.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/tests/test_config.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/tests/test_config.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | import unittest
from cifastapi.config import safeget,getConfig,getVersion
class ConfigTest(unittest.TestCase):
def test_version(self):
version = getVersion()
self.assertTrue(version)
def test_config_01(self):
value = getConfig("user.1")
self.assertTrue(value)
def test_saf... | 22.35 | 57 | 0.655481 |
887dfa69d7da2aa0804bd8ef3e758a1c524420af | 5,416 | py | Python | ENV/tensorforce-master/mazerunner/generator.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | ENV/tensorforce-master/mazerunner/generator.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | ENV/tensorforce-master/mazerunner/generator.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | 1 | 2019-11-29T12:28:33.000Z | 2019-11-29T12:28:33.000Z | #import time
from random import randint
import cocos
import cocos.tiles as ti
import os
script_dir = os.path.dirname(__file__)
HORIZONTAL = 0
VERTICAL = 1
class Generator():
"""
Generator
Maze map generation
"""
def map(self, width, height):
"""
Creates and returns a new random... | 32.238095 | 128 | 0.519756 |
31ff86c250a6c3980a5c1df379adac58aa58603d | 7,425 | py | Python | pelican/plugins/myst/reader.py | noirbizarre/pelican-myst | c2c7b44803ebc33e70d915c35b692df14597469b | [
"MIT"
] | null | null | null | pelican/plugins/myst/reader.py | noirbizarre/pelican-myst | c2c7b44803ebc33e70d915c35b692df14597469b | [
"MIT"
] | 21 | 2021-12-21T16:47:35.000Z | 2022-03-29T04:34:59.000Z | pelican/plugins/myst/reader.py | noirbizarre/pelican-myst | c2c7b44803ebc33e70d915c35b692df14597469b | [
"MIT"
] | null | null | null | import collections
from functools import cached_property
import logging
import re
from typing import Any, MutableMapping, Optional, Sequence
from markdown_it import MarkdownIt
from markdown_it.renderer import RendererHTML
from markdown_it.token import Token
from markdown_it.utils import OptionsDict
from mdit_py_plugin... | 33.90411 | 100 | 0.64404 |
4e4d25a38ae8ef13c089ea35e07b33a3f1d6029b | 3,187 | py | Python | Course_2/Week_01/1_BFS.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | Course_2/Week_01/1_BFS.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | 1 | 2020-07-16T08:03:22.000Z | 2020-07-16T08:09:34.000Z | Course_2/Week_01/1_BFS.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
import codecs
from collections import defaultdict
class Vertex(object):
def __init__(self, value):
self.value = value
def __eq__(self, other):
return self.value == other.value
def __str__(self):
return str(self.value)
def __hash__(self):
#vital part, this will make the vertex be the on... | 23.962406 | 89 | 0.666457 |
4e88ce6e0ab8985f2462878d62fb826bc3ec3cdc | 1,371 | py | Python | python/oneflow/compatible/single_client/summary/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/summary/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/summary/__init__.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... | 36.078947 | 83 | 0.803793 |
09738b7442b04d616a2b075d28dec279e89caf31 | 56 | py | Python | python_lessons/freecodecamp_python/004_while_loop.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/freecodecamp_python/004_while_loop.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/freecodecamp_python/004_while_loop.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | n = 0
while True:
if n== 3:
break
print(n)
n += 1
| 8 | 11 | 0.5 |
09a13a9e7410635273e2875601ca1598b3af9a96 | 225 | py | Python | apps/hygiene/admin.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | apps/hygiene/admin.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | apps/hygiene/admin.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | from django.contrib import admin
from apps.hygiene import models
admin.site.register(models.CheckDay)
admin.site.register(models.CheckLocation)
admin.site.register(models.CheckItem)
admin.site.register(models.CheckDayItem)
| 25 | 41 | 0.84 |
fed0a2a9c5254501c15502e1c37f88d5bc2c8349 | 1,279 | py | Python | official/cv/cnn_direction_model/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/cnn_direction_model/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/cnn_direction_model/mindspore_hub_conf.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... | 42.633333 | 101 | 0.679437 |
e93b7ca9e5a2b087af77f86ba884266ca60838de | 566 | py | Python | tmp/cython_class.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | tmp/cython_class.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | tmp/cython_class.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from transonic import boost
@boost
class MyClass:
a : int
def __init__(self, a):
self.a = a
@boost
def method(self, b : int):
return self.a + b
@boost
def method2(self, b : int):
return self.a + b
@boost
class MyClass2:
a : int
def __init__(self, a):
... | 16.171429 | 31 | 0.5053 |
a31623e410376574fcc5efa6790eed5cc8fab909 | 1,337 | py | Python | PythonTest/life_game.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | null | null | null | PythonTest/life_game.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | 1 | 2017-11-03T06:59:55.000Z | 2017-11-04T02:10:14.000Z | PythonTest/life_game.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | null | null | null | from random import randint
from tkinter import *
# ステージサイズ.
COLS, ROWS = [30, 20]
CW = 20 # セルの描画サイズ.
data = [] # ステージデータ.
# ステージをランダムに初期化.
for y in range(0, ROWS):
data.append([(randint(0, 9) == 0) for x in range(0, COLS)])
# ルールの実装.
def check(x, y):
# 周囲の生存セルを数える.
count = 0
table = [(-1, -1), ... | 20.257576 | 80 | 0.557966 |
6e1b1bf5b1230094d15e45fb6d84feb978bf7dd4 | 2,361 | py | Python | src/measure_performance.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | 10 | 2018-01-11T01:15:15.000Z | 2020-06-22T15:03:31.000Z | src/measure_performance.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | src/measure_performance.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
import argparse
from datetime import datetime
import json
def main(validation_dir, save_dir):
max_limit = 50 # change 1 ~ 1000
image_files = sorted(os.listdir(validation_dir))[:max_limit]
scores = []
elapsed = []
score_dict = {}
for image_file in image_files:
command = "bin... | 34.217391 | 107 | 0.64676 |
280cfe1698df565200acde5c6623bfbdef1eea61 | 1,097 | py | Python | Project Euler Qusetions 71 - 80/Project Euler Question 75.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 71 - 80/Project Euler Question 75.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 71 - 80/Project Euler Question 75.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 75
#Given that L is the length of the wire,
#for how many values of L ≤ 1,500,000 can exactly one integer sided right angle triangle be formed?
import math
def pythag(x, y):
max_length = x
tri_per_length = y
counter = 0
py_dict = dict()
m_range = int(math.sqrt(max_length) ... | 30.472222 | 99 | 0.495898 |
2842c44c47c32a377c7038b68c2a9d606a715a85 | 1,298 | py | Python | InterviewBit_problems/Sorting/Hotel Booking/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | InterviewBit_problems/Sorting/Hotel Booking/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | InterviewBit_problems/Sorting/Hotel Booking/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | '''
- A hotel manager has to process N advance bookings of rooms for the next season.
His hotel has C rooms. Bookings contain a list A of arrival date and a list B of departure date.
He wants to find out whether there are enough rooms in the hotel to satisfy the demand.
- Creating a function hotel which will take 3 ... | 46.357143 | 116 | 0.665639 |
dd9201532fefa7a05c621a87c1eaecc05a97eebc | 315 | py | Python | Application/upd.py | FangcatChina/FCUOS | 81000ed76621af8ba3f32f58155759669bd46894 | [
"Apache-2.0"
] | null | null | null | Application/upd.py | FangcatChina/FCUOS | 81000ed76621af8ba3f32f58155759669bd46894 | [
"Apache-2.0"
] | null | null | null | Application/upd.py | FangcatChina/FCUOS | 81000ed76621af8ba3f32f58155759669bd46894 | [
"Apache-2.0"
] | null | null | null | import easygui as eg
from requests import get
from bs4 import BeautifulSoup as bs
res = get('http://fcnemo.gitee.io/FCUOSWebService/versionPatch.pinf')
contont = list(eval(bs(res.text,'html.parser').text).values())
msg = contont[0]+'\n作者:'+contont[1]+'\n推送时间:'+contont[2]+'\n更新网址:'+contont[-1]
eg.msgbox(msg,'升级') | 39.375 | 78 | 0.720635 |
b0ac0d75657d55e27da6551f67dcbe162b54bc62 | 629 | py | Python | packages/watchmen-model/src/watchmen_model/pipeline_kernel/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/pipeline_kernel/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/pipeline_kernel/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .pipeline_monitor_log import MonitorAlarmAction, MonitorCopyToMemoryAction, MonitorDeleteAction, \
MonitorLogAction, MonitorLogActionId, MonitorLogStage, MonitorLogStatus, MonitorLogUnit, MonitorReadAction, \
MonitorWriteAction, MonitorWriteToExternalAction, PipelineMonitorLog, PipelineMonitorLogCriteria, \
Pip... | 69.888889 | 110 | 0.895072 |
b0f0658146dff367eb5fede1d91aad9d8cf36571 | 2,274 | py | Python | controller/controller.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | 1 | 2021-06-15T08:59:02.000Z | 2021-06-15T08:59:02.000Z | controller/controller.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | controller/controller.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null |
# controller
import conf
import tick
import manctrl
import autoctrl
import output
import logging
import sys
import time
from singleton import Singleton
if conf.PLATFORM == 'pc':
import pbutton_pc as pbutton
else: # PLATFORM == 'rpi'
import pbutton_rpi as pbutton
import gpio
gpio.init()
import mcp2301... | 27.39759 | 80 | 0.632366 |
af1aea49a0076a92eda4a4f6559194979371c62b | 4,660 | py | Python | main.py | credital/USL | b86aae2ed14e82710e9ccae52b1627da9a458ddf | [
"MIT"
] | null | null | null | main.py | credital/USL | b86aae2ed14e82710e9ccae52b1627da9a458ddf | [
"MIT"
] | null | null | null | main.py | credital/USL | b86aae2ed14e82710e9ccae52b1627da9a458ddf | [
"MIT"
] | null | null | null | from time import sleep
from json import *
from requests import get
from colorama import Fore, init
from ctypes import windll
from datetime import datetime
from re import findall
from uuid import uuid4
from hashlib import sha1
import threading
def output(content):
print("{c_red}{time} {c_white}| {conten... | 38.196721 | 169 | 0.571674 |
a575c4edb56c9707ed2238cd3eb0ab000e48f521 | 1,664 | py | Python | src/server/app/endpoints/landing_page/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/landing_page/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/landing_page/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from ...db.settings import db, oidc, mongoclient
from flask import Flask, Blueprint, render_template, abort, g, request
from ...models.Statistic import Statistic
import time
import json
from flask_jwt_extended import (create_access_token, create_refresh_token, jwt_required, jwt_refresh_token_required, get_jwt_identi... | 28.689655 | 176 | 0.713942 |
3c359a6b8241a917f934c7eb7e7238f6c19dcb05 | 623 | py | Python | 024-C142-FlaskMockup2/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 024-C142-FlaskMockup2/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 024-C142-FlaskMockup2/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | from flask import Flask, request, jsonify
import contentbased_filtering as cbf
import demographic_filtering as df
app = Flask(__name__)
@app.route('/')
def index():
return jsonify({
"status": "success",
"data": cbf.df.to_dict('records')
})
@app.route('/popular')
def popular():
return jso... | 19.46875 | 46 | 0.613162 |
3c79b344c466e3a1c4b5cbe67462926728a94810 | 4,943 | py | Python | extraction/links_in_context/filter_records.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | extraction/links_in_context/filter_records.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | extraction/links_in_context/filter_records.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | from aut.udfs import extract_domain
from pyspark.sql import DataFrame, SparkSession
from pyspark.sql.functions import collect_list, mean, explode, when, col, arrays_zip
from pyspark.sql.types import (
StructType,
StructField,
StringType,
ArrayType,
DoubleType,
)
from links_in_context.extract_linkco... | 32.953333 | 87 | 0.578394 |
557fc30c3b1dfb19cd1bc3b41007a5e989d25b5d | 107 | py | Python | examples/myqueryset/prefetch_related_/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/myqueryset/prefetch_related_/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/myqueryset/prefetch_related_/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 PrefetchRelatedConfig(AppConfig):
name = 'prefetch_related_'
| 17.833333 | 39 | 0.794393 |
e99c49f7384b5bbbfb5b9c841fcb9a40d8f8386b | 2,589 | py | Python | mvp/trainer/helper_functions.py | googleinterns/step258-2020 | 49e7af1a381e076ee884f55857a7af2f72add74d | [
"Apache-2.0"
] | 2 | 2020-08-28T15:17:40.000Z | 2022-01-21T14:03:21.000Z | mvp/trainer/helper_functions.py | googleinterns/step258-2020 | 49e7af1a381e076ee884f55857a7af2f72add74d | [
"Apache-2.0"
] | 1 | 2021-01-27T18:22:46.000Z | 2021-01-27T20:58:55.000Z | mvp/trainer/helper_functions.py | googleinterns/step258-2020 | 49e7af1a381e076ee884f55857a7af2f72add74d | [
"Apache-2.0"
] | 4 | 2020-07-28T12:13:11.000Z | 2021-01-27T16:29:29.000Z | """Helper functions for interatcing with Magenta DDSP internals.
"""
import json
import os
from absl import logging
from ddsp.training import train_util
import tensorflow.compat.v2 as tf
from google.cloud import storage
def get_strategy(tpu='', gpus=None):
"""Chooses a distribution strategy.
AI Platform auto... | 35.958333 | 101 | 0.695635 |
ddac376075a9c5a7ceebbf83792f2fea899529f6 | 317 | py | Python | src/onegov/pdf/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pdf/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pdf/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from pdftotext import PDF
def extract_pdf_info(content):
""" Extracts the number of pages and text from a PDF.
Requires poppler.
"""
try:
content.seek(0)
except Exception:
pass
pages = PDF(content)
return len(pages), '\n'.join(pages).strip(' \t\r\n').replace('\0', '')
| 19.8125 | 74 | 0.602524 |
fb089dd3f9d1f3145348009fdadedee3d7fba3bd | 1,544 | py | Python | code/motor/movement.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/motor/movement.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/motor/movement.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | import time
try:
import brickpi3
BP = brickpi3.BrickPi3()
except Exception:
print("WARNING: Could not import module brickpi3 (not running on a raspberry pi?). Movement module will not "
"be available.")
brickpi3, BP = None, None
import sys
DEFAULT_SPEED = 100
state = 'stop'
def forward(sp... | 18.829268 | 113 | 0.601036 |
9b8c671c3c99c63981e3cbbd4701266879a6e23b | 3,134 | py | Python | backend/migrations/versions/aeb8bd988709_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/aeb8bd988709_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/aeb8bd988709_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | """empty message
Revision ID: aeb8bd988709
Revises:
Create Date: 2018-07-11 17:51:13.860658
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'aeb8bd988709'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | 37.309524 | 72 | 0.671027 |
fd60538e1fc4118595162f10cc7fcfd14d09d9c4 | 339 | pyde | Python | sketches/xmaspenguin/xmaspenguin.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/xmaspenguin/xmaspenguin.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/xmaspenguin/xmaspenguin.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from penguin import Penguin
pingus = Penguin(0, 16)
def setup():
frameRate(30)
size(640, 64)
pingus.loadPics()
pingus.dx = 1
pingus.dir = 1
def draw():
background(0, 153, 204)
pingus.move()
if pingus.x >= 640 - 32:
pingus.dir = -1
if pingus.x <= 0:
pingus.dir = 1
... | 17.842105 | 28 | 0.566372 |
1f51b5c0faf894bbc3c9fef42b9a4c04c97b8e45 | 14,510 | py | Python | wz/ui/wz_communicate.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui/wz_communicate.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui/wz_communicate.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ui/wz_communicate.py
Last updated: 2021-05-23
Manage communication with the back-end.
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Licen... | 37.109974 | 77 | 0.574845 |
1f5a19e280ac17006b02ac9ec140b8628e4ef1cd | 953 | py | Python | solution/dynamic_programming_2/11985/main.py | gkgg123/baekjoon | 4ff8a1238a5809e4958258b5f2eeab7b22105ce9 | [
"MIT"
] | 2,236 | 2019-08-05T00:36:59.000Z | 2022-03-31T16:03:53.000Z | solution/dynamic_programming_2/11985/main.py | juy4556/baekjoon | bc0b0a0ebaa45a5bbd32751f84c458a9cfdd9f92 | [
"MIT"
] | 225 | 2020-12-17T10:20:45.000Z | 2022-01-05T17:44:16.000Z | solution/dynamic_programming_2/11985/main.py | juy4556/baekjoon | bc0b0a0ebaa45a5bbd32751f84c458a9cfdd9f92 | [
"MIT"
] | 602 | 2019-08-05T00:46:25.000Z | 2022-03-31T13:38:23.000Z | # Authored by : chj3748
# Co-authored by : -
# Link : http://boj.kr/f293bc24e6e347dba7b5aa08836171fe
import sys
def input():
return sys.stdin.readline().rstrip()
N, M, K = map(int, input().split())
oranges = []
inf = float('inf')
dp = [inf] * N
dp[0] = K
for idx in range(N):
oranges.append(int(input()))
i... | 27.228571 | 77 | 0.504722 |
1f5e293d926446f31886f458b226f468623b1406 | 5,878 | py | Python | tests/shared/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/shared/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/shared/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.custom import json
import os
import shutil
import dectate
import morepath
import textwrap
from io import BytesIO
from onegov.core.utils import Bunch, scan_morepath_modules, module_path
from PIL import Image
from random import randint
from uuid import uuid4
from base64 import b64decode, b64encode
de... | 29.39 | 79 | 0.620279 |
8d3301f90932d541af26ed673c570667847cccf3 | 3,029 | py | Python | easyp2p/platforms/estateguru.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/platforms/estateguru.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/platforms/estateguru.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # Copyright (c) 2018-2020 Niko Sandschneider
"""
Download and parse Estateguru statement.
"""
from easyp2p.p2p_parser import P2PParser
from easyp2p.p2p_session import P2PSession
from easyp2p.platforms.base_platform import BasePlatform
class Estateguru(BasePlatform):
"""
Contains methods for downloading/p... | 31.552083 | 77 | 0.630571 |
8d5c78deef4152207b2a25690f3f9ccb4593553f | 32 | py | Python | tests/01-empty-test.py | keawe-software/Umbrella | eee5aded0bb8ef09583dcf320802e0ae0e41041f | [
"Apache-2.0"
] | null | null | null | tests/01-empty-test.py | keawe-software/Umbrella | eee5aded0bb8ef09583dcf320802e0ae0e41041f | [
"Apache-2.0"
] | null | null | null | tests/01-empty-test.py | keawe-software/Umbrella | eee5aded0bb8ef09583dcf320802e0ae0e41041f | [
"Apache-2.0"
] | 1 | 2021-06-04T17:30:40.000Z | 2021-06-04T17:30:40.000Z | #!/usr/bin/python
print('.done') | 16 | 17 | 0.65625 |
f5717147c45d1cfbb22e88e88ab697645219aa56 | 848 | py | Python | packages/watchmen-model/src/watchmen_model/chart/chart_settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/chart/chart_settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/chart/chart_settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Any
from pydantic import BaseModel
from .chart_basic_structure import ChartTruncation, ChartTruncationHolder
from .chart_basic_style import ChartBorder
from .chart_enums import PredefinedChartColorSeries
from .chart_types import ChartColor
class ChartSettings(ChartTruncationHolder, BaseModel):
b... | 29.241379 | 77 | 0.794811 |
e344fd2016711ac145f1686969e4ac36b12ae503 | 260 | py | Python | HackerRank/HackerRank-Python/Strings/Capitalize!.py | tareqmahmud/Competitive-Programming | ad5e53300d70280bccbd5046ca01278fb246f314 | [
"MIT"
] | 2 | 2020-11-19T19:03:28.000Z | 2021-01-04T19:52:11.000Z | HackerRank-Python/Strings/Capitalize!.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | HackerRank-Python/Strings/Capitalize!.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | def capitalize(string):
list_words = string.split(" ")
for index in range(len(list_words)):
if list_words[index].strip() != "":
list_words[index] = list_words[index][0].upper() + list_words[index][1:]
return " ".join(list_words) | 43.333333 | 84 | 0.623077 |
8b67c6628c7de37ec4cec52b45f50a32a576b62d | 66 | py | Python | src/python3_learn_video/assert.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/assert.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/assert.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | # 断言
# 当这个关键字后边的条件为假的时候,程序自动崩溃并抛出AssertionError的异常
assert 3 > 4
| 11 | 45 | 0.787879 |
47624f397e43b1ce7e153df01f9ae40d97826a11 | 1,067 | py | Python | begin-python/cp12/chapter12.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | 3 | 2021-08-04T07:59:48.000Z | 2022-03-26T23:58:17.000Z | begin-python/cp12/chapter12.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | begin-python/cp12/chapter12.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*-
# ## 图形用户界面
import wx
def load(event):
file = open(filename.GetValue())
contents.SetValue(file.read())
file.close()
def save(event):
file = open(filename.GetValue(), 'w')
file.write(contents.GetValue())
file.close()
app = wx.App()
win = wx.Frame(None, title =... | 25.404762 | 97 | 0.678538 |
ef82b04729fc7fb302bdd8b312df024d86f30cd3 | 8,069 | py | Python | 2019/finals/reversing-gpurtl/synth/blif.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2019/finals/reversing-gpurtl/synth/blif.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2019/finals/reversing-gpurtl/synth/blif.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | # Copyright 2019 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, sof... | 23.593567 | 87 | 0.599703 |
ef18482e386ceeda5d9673ce6b854fc4e0963496 | 408 | py | Python | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/client_list.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/client_list.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/client_list.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z |
class ClientList:
def __init__(self):
self.clients = {}
def add(self, hashk, client):
self.clients.update({hashk: client})
def rem(self, hashk):
del self.clients[hashk]
def send_to(self, hashk, msg):
client = self.clients.get(hashk)
client.send(msg)
def ... | 21.473684 | 44 | 0.583333 |
08f62e0825b254c3ce6c010769a06aa902dfe46d | 1,357 | py | Python | scripts/gh_parse_issue.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 1 | 2022-02-05T16:40:13.000Z | 2022-02-05T16:40:13.000Z | scripts/gh_parse_issue.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 31 | 2021-06-17T11:59:33.000Z | 2022-03-19T07:05:18.000Z | scripts/gh_parse_issue.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | null | null | null | import json
import os
import click
from spotify_gender_ex import gh_issue
from spotify_gender_ex.genderex import GenderEx
from spotify_gender_ex.replacement_table import ReplacementTable
@click.command()
@click.argument('replacement_table', type=click.Path(True))
def run(replacement_table):
event_json = os.envi... | 29.5 | 104 | 0.726603 |
39fc5577a52da967856674d13abd4d8741388e2a | 2,706 | py | Python | Algorithms/Constructive/KMP.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Constructive/KMP.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Constructive/KMP.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
first, second = None, None
string = ''
num_array = map(int, raw_input().split())
for i in xrange(26):
num = num_array[i]
if num != 0:
if first == None:
first = (chr(97+i), num)
elif second == None:
second = (chr(97+i), num)
temp = (chr(97+i), nu... | 26.792079 | 126 | 0.528086 |
26a53bbfa096de1f07615bf7f273f125a232f8da | 374 | py | Python | my_music_app/my_music_app/web/migrations/0004_alter_album_options.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | my_music_app/my_music_app/web/migrations/0004_alter_album_options.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | my_music_app/my_music_app/web/migrations/0004_alter_album_options.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-27 09:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('web', '0003_rename_artists_album_artist'),
]
operations = [
migrations.AlterModelOptions(
name='album',
options={'ordering':... | 20.777778 | 68 | 0.59893 |
3e2e82422520315f4b415854728169f6f1550830 | 392 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/test_late.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/test_late.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/test_late.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import numpy.random
import late_heuristic
bphase = numpy.random.random(210)
bphase[47] = 0
bphase[127] = 0
bphase[197] = 0
bphase[60] += 2.0
bphase[120] += 1.0
info = late_heuristic.info_histogram(60, bphase, 0.05)
print info
numpy.savetxt("late-test-input.txt", bphase)
numpy.savetxt("late-te... | 16.333333 | 54 | 0.719388 |
5fa92e3419c68c003d746659e91c8105815d7ca6 | 6,987 | py | Python | models/syntaxsql/modules/keyword_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | models/syntaxsql/modules/keyword_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | models/syntaxsql/modules/keyword_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | import os
import torch
import numpy as np
import torch.nn as nn
from torch.autograd import Variable
from commons.utils import run_lstm, seq_conditional_weighted_num, SIZE_CHECK
from models.syntaxsql.net_utils import to_batch_seq
class KeyWordPredictor(nn.Module):
'''Predict if the next token is (SQL key words):
... | 39.925714 | 140 | 0.614856 |
845baed157ac95c9b908526f3a3dd3f636201343 | 1,796 | py | Python | Licence 2/I32/Projet-Camping/database.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I32/Projet-Camping/database.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I32/Projet-Camping/database.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | import pgdb
def connect():
hostname = 'localhost'
username = 'axelcoezard'
password = '1234'
database = 'Camping'
conn = pgdb.connect(host=hostname, port=5432, user=username,
password=password, database=database)
return conn
def disconnect(conn):
conn.close()
de... | 25.657143 | 100 | 0.555122 |
4b94b174dd9206d041b26476f14365da2f6733b6 | 2,796 | py | Python | research/cv/ssd_inceptionv2/src/ssd_inception_v2.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ssd_inceptionv2/src/ssd_inception_v2.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ssd_inceptionv2/src/ssd_inception_v2.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... | 39.942857 | 90 | 0.668455 |
d9b9f7418643a1c42472df62e50b93cbca07ead8 | 3,771 | py | Python | tests/test_trainer_distributed.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 12 | 2021-06-05T03:51:23.000Z | 2022-03-05T05:09:41.000Z | tests/test_trainer_distributed.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 1 | 2021-10-20T02:25:36.000Z | 2021-10-20T02:25:36.000Z | tests/test_trainer_distributed.py | suliuzh/transformers | f34372a9ff99f6bc8619ac83dc07f7afe6b92141 | [
"Apache-2.0"
] | 2 | 2021-03-27T16:46:26.000Z | 2021-12-24T00:33:28.000Z | # This test is meant to be run in torch.distributed,
# on a machine with multiple GPUs, in the following way:
#
# python -m torch.distributed.launch --nproc_per_node 2 ./tests/test_trainer_distributed.py
#
# Replace 2 with the number of GPUs you have.
#
# You can also run it as a standalone file to test identical beh... | 31.425 | 97 | 0.641474 |
8a27c0c0dd53fd40f1097c64858ce17e9313e722 | 15 | py | Python | ___Python/RomanS/20180625_001/p01_kennenlernen/m01_kennenlernen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/RomanS/20180625_001/p01_kennenlernen/m01_kennenlernen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/RomanS/20180625_001/p01_kennenlernen/m01_kennenlernen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | print("Test")
| 7.5 | 14 | 0.6 |
8a873aad0b2c77e873a04a250d2ff0c922044295 | 720 | py | Python | 2_Data_Structures/week1_basic_data_structures/stack_with_max/stack_with_max_naive.py | AnthonyRChao/UCSD-Data-Structures-and-Algorithms-Specialization | 877d7f1d7f3d3d9d6a0c6cda2421ec130b64da3d | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Data Structures & Algorithms/Algorithm Toolbox/week1_basic_data_structures/4_stack_with_max/stack_with_max_naive.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 39 | 2020-04-30T02:28:35.000Z | 2022-02-13T21:30:02.000Z | Data Structures & Algorithms/Algorithm Toolbox/week1_basic_data_structures/4_stack_with_max/stack_with_max_naive.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #python3
import sys
class StackWithMax():
def __init__(self):
self.__stack = []
def Push(self, a):
self.__stack.append(a)
def Pop(self):
assert(len(self.__stack))
self.__stack.pop()
def Max(self):
assert(len(self.__stack))
return max(self.__stack)
if... | 20.571429 | 44 | 0.533333 |
8ab477a1546d1133a6242bd2aa6e202108f544df | 9,927 | py | Python | cowCrack-main/sapi.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | cowCrack-main/sapi.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | cowCrack-main/sapi.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #JANGAN DIPERJUAL BELIKAN!
#RECODE? BOLEH! JANGAN UBAH BOT FOLLOW SAMA KOMEN
#AUTHOR: MUHAMMAD LATIF HARKAT
#WA: 083870396203
#FB: Muhammad Latif Harkat
#SC VERSION: 1.5 OFFICIAL
#OPEN SOURCE TEAM
import requests as req,json,time,os
from concurrent.futures import ThreadPoolExecutor as Bool
from bs4 import BeautifulSo... | 47.956522 | 429 | 0.51919 |
6acf4e62d83f30e151bc07178c3742ecfc627bf2 | 1,192 | py | Python | Imaginary/2021/crypto/Reversing_Some_Algorithms/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Imaginary/2021/crypto/Reversing_Some_Algorithms/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Imaginary/2021/crypto/Reversing_Some_Algorithms/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from random import randint
import sys
def f(x, y):
if y == 0:
return 1
if y == 1:
return x
return (f((x*x)%n, y//2)*x**(y&1))%n
def main():
flag = input("Enter flag: ")
flagnum = 0
for c in flag:
flagnum += ord(c)
flagnum <<= 8
flagnu... | 37.25 | 320 | 0.745805 |
7c52493f309f29963e6169fcaa52b9d043fbf6df | 934 | py | Python | pythonProj/FZPython/run.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/run.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/run.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | from flask import Flask, url_for, request,abort,Response
from flask_restful import Resource, Api
from routes import *
app = Flask(__name__)
api = Api(app)
api.add_resource(UserRouter, '/api/users/<uid>') #
api.add_resource(SymbolRouter, '/api/symbols/<_id>','/api/symbols/', '/api/symbolgroups/<symbolgroup_id>/symb... | 42.454545 | 122 | 0.743041 |
7cb80db0c25b2573aed03cdf70785bad95c34969 | 258 | py | Python | ciphey/basemods/Decoders/__init__.py | Marnick39/Ciphey | fc854ecf37b688832f25cdec094bcada739bfae3 | [
"MIT"
] | 2 | 2020-09-28T23:27:22.000Z | 2021-09-09T17:24:26.000Z | ciphey/basemods/Decoders/__init__.py | drpacket/Ciphey | b46e00c611ee4b5f5795e967a50b05a63cbb5ef0 | [
"MIT"
] | null | null | null | ciphey/basemods/Decoders/__init__.py | drpacket/Ciphey | b46e00c611ee4b5f5795e967a50b05a63cbb5ef0 | [
"MIT"
] | 1 | 2020-09-29T17:48:23.000Z | 2020-09-29T17:48:23.000Z | from . import (
morse,
bases,
unicode,
reverse,
octal,
binary,
hexadecimal,
atbash,
galactic,
base62,
base58,
base58_ripple,
base91,
leet,
decimal,
base69,
baudot,
multi_tap,
url,
)
| 11.727273 | 18 | 0.527132 |
86269c8cb5fec51c97c54bec9bd71774c1374246 | 475 | py | Python | display/__init__.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/__init__.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/__init__.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from ._audio_menu_view import AudioMenuView
from ._audio_file_menu_view import AudioFileMenuView
from ._button_lights import ButtonLights
from ._display import Display
from ._dmx_buzzer_menu_view import DmxBuzzerMenuView
from ._dmx_menu_view import DmxMenuView
from ._general_menu_view import GeneralMenuView
from ._info... | 39.583333 | 55 | 0.884211 |
8627d6e2ae5a8fb70b98b0f8250043afc4816552 | 1,949 | py | Python | python/oneflow/compatible/single_client/test/ops/test_two_node_boxing.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_two_node_boxing.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_two_node_boxing.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... | 35.436364 | 85 | 0.714726 |
86666db21a815ec409f48ea2d79b30f300fcf85a | 7,438 | py | Python | Packs/Thycotic/Integrations/Thycotic/test_data/context.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Thycotic/Integrations/Thycotic/test_data/context.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Thycotic/Integrations/Thycotic/test_data/context.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | GET_PASSWORD_BY_ID_CONTEXT = {
'Thycotic.Secret.Password(val.secret_password && val.secret_password == obj.secret_password)': {
"Thycotic": {
"Secret": {
"Password": "test00111"
}
}
}
}
GET_USERNAME_BY_ID_CONTENT = {
'Thycotic.Secret.Username(val.secr... | 31.786325 | 112 | 0.51331 |
ed40270d0d9d2b0ecc3a7f8485ac73090903895a | 3,787 | py | Python | Packs/MicrosoftGraphUser/Integrations/MicrosoftGraphUser/MicrosoftGraphUser_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MicrosoftGraphUser/Integrations/MicrosoftGraphUser/MicrosoftGraphUser_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MicrosoftGraphUser/Integrations/MicrosoftGraphUser/MicrosoftGraphUser_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z |
users_list_mock = [
{
'id': '08779ba7-f3ed-4344-b9d7-98b9911ea8a8',
'displayName': 'Test User',
'jobTitle': "Magician",
'mobilePhone': None,
'mail': None
},
{
'id': '670edadc-0197-45b0-90e6-ee061e25ab73',
'displayName': 'Test1',
'jobTitle': 'T... | 33.513274 | 111 | 0.648006 |
131a413de6d353d58c8aef929e460518a4f251f5 | 1,388 | py | Python | tests/test_deeplearning2020.py | akuechle/deeplearning2020 | 678dc0a4b231866c6d96a55640c33971a92a23db | [
"MIT"
] | 1 | 2020-03-22T17:06:04.000Z | 2020-03-22T17:06:04.000Z | tests/test_deeplearning2020.py | akuechle/deeplearning2020 | 678dc0a4b231866c6d96a55640c33971a92a23db | [
"MIT"
] | null | null | null | tests/test_deeplearning2020.py | akuechle/deeplearning2020 | 678dc0a4b231866c6d96a55640c33971a92a23db | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `deeplearning2020` package."""
import unittest.mock
from deeplearning2020 import Submission
def test_construction() -> None:
with unittest.mock.patch(
"kerasltisubmission.LTIProvider", autospec=True
) as mocked_provider:
mock_provid... | 32.27907 | 84 | 0.679395 |
b9d117b4eda18877634ffba853dff203fc7cde52 | 955 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Dictionaries and Hashmaps/Frequency Queries/frequency_queries2.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Dictionaries and Hashmaps/Frequency Queries/frequency_queries2.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Dictionaries and Hashmaps/Frequency Queries/frequency_queries2.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
from collections import Counter
# Complete the freqQuery function below.
def freqQuery(queries):
counter = Counter()
freq = Counter()
for op, data in queries:
value = counter[data]
if op == 1:
freq[value] =... | 21.222222 | 64 | 0.544503 |
e012f68871f177145e37a213c58f300f81b94b1c | 1,460 | py | Python | Vorlesungsbeispiele/UA_TrafficLight/tools/pyUANamespace/logger.py | zmanjiyani/PLT_MRT_ARM-RPi2 | da77ab8ddf652a12ae6a6647c993daa2f94b39fb | [
"MIT"
] | 4 | 2015-11-11T14:02:17.000Z | 2021-11-29T16:07:38.000Z | Vorlesungsbeispiele/UA_TrafficLight/tools/pyUANamespace/logger.py | zmanjiyani/PLT_MRT_ARM-RPi2 | da77ab8ddf652a12ae6a6647c993daa2f94b39fb | [
"MIT"
] | 6 | 2019-04-20T14:48:58.000Z | 2020-08-26T15:13:02.000Z | Vorlesungsbeispiele/UA_TrafficLight/tools/pyUANamespace/logger.py | zmanjiyani/PLT_MRT_ARM-RPi2 | da77ab8ddf652a12ae6a6647c993daa2f94b39fb | [
"MIT"
] | 9 | 2016-01-10T15:14:28.000Z | 2021-10-13T22:45:19.000Z | #!/usr/bin/env/python
# -*- coding: utf-8 -*-
###
### Author: Chris Iatrou (ichrispa@core-vector.net)
### Version: rev 13
###
### This program was created for educational purposes and has been
### contributed to the open62541 project by the author. All licensing
### terms for this source is inherited by the terms and... | 31.06383 | 110 | 0.664384 |
1662ddc76675c713ec62c27826086cdd817285cc | 1,698 | py | Python | Trees/BinarySearchTree.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Trees/BinarySearchTree.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Trees/BinarySearchTree.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | from Trees.Tree import Tree
from Trees.TreeNode import TreeNode
from Trees.BinaryTree import BinaryTree
class BinarySearchTree(Tree):
def __init__(self, root=None):
super().__init__(root)
def create_bst(self):
return TreeNode(35, TreeNode(20, TreeNode(15, TreeNode(10), TreeNode(18)), TreeNode... | 26.952381 | 139 | 0.579505 |
16d8b110e3f8741b9f56e6fb8ce2126009d7784c | 7,898 | py | Python | research/cv/ICNet/Res50V1_PRE/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ICNet/Res50V1_PRE/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ICNet/Res50V1_PRE/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... | 41.78836 | 100 | 0.673715 |
bce567d992d2f387af7ec7c9ec2922945f3a9cd8 | 9,312 | py | Python | tests/test_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 1 | 2020-09-12T17:27:21.000Z | 2020-09-12T17:27:21.000Z | tests/test_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 52 | 2020-10-03T11:58:14.000Z | 2022-02-01T13:17:52.000Z | tests/test_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | import asyncio
import sys
import tempfile
import os
from pathlib import Path
from typing import Text, Dict
from unittest.mock import Mock
import pytest
from _pytest.capture import CaptureFixture
from _pytest.monkeypatch import MonkeyPatch
import rasa.model
import rasa.core
import rasa.shared.importers.autoconfig as a... | 28.829721 | 88 | 0.705112 |
e66c396e357943afb6a5d75ae5af9d08684e7a50 | 918 | py | Python | Python-BlueEdTech-main/projeto-poo/casa.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | 3 | 2021-05-30T20:01:06.000Z | 2021-07-07T00:46:37.000Z | Python-BlueEdTech-main/projeto-poo/casa.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | Python-BlueEdTech-main/projeto-poo/casa.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | from math import floor
class Casa:
def __init__(self):
self.comida = 5
self.preparar_aula = False
def consumo(self):
if self.comida > 0:
self.comida -= 1
else:
self.comida = 0
def mercado(self, dinheiro):
preco_alimento = 20
qtt_ali... | 27 | 67 | 0.570806 |
e6933a6a2258346c4f03eb46eb62702850fbc269 | 2,522 | py | Python | research/cv/fairmot/src/utils/logger.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/fairmot/src/utils/logger.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/fairmot/src/utils/logger.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... | 31.924051 | 78 | 0.563442 |
e6af48bdff12afc47eefc45dc36f5d28160858f7 | 1,368 | py | Python | pacman-termux/test/pacman/tests/ignore004.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/ignore004.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/ignore004.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Sync with ignore causing top-level to be ignored"
packageA1 = pmpkg("packageA1")
packageA1.depends = ["packageA2=1.0-1", "packageA3=1.0-1"];
self.addpkg2db("local", packageA1)
packageA2 = pmpkg("packageA2")
packageA2.depends = ["packageA4=1.0-1", "packageA5=1.0-1"];
self.addpkg2db("local", package... | 29.106383 | 69 | 0.724415 |
fc9fcfb5ebb1fbf4cea1299d98774c0a338163a0 | 171 | py | Python | gestionPlanificacion_y_Desarrollo_Proyectos_Nuevos/apps.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T01:20:45.000Z | 2021-01-09T01:20:45.000Z | gestionPlanificacion_y_Desarrollo_Proyectos_Nuevos/apps.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T00:53:55.000Z | 2021-01-09T00:53:55.000Z | gestionPlanificacion_y_Desarrollo_Proyectos_Nuevos/apps.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-07T23:57:28.000Z | 2021-01-07T23:57:28.000Z | from django.apps import AppConfig
class GestionplanificacionYDesarrolloProyectosNuevosConfig(AppConfig):
name = 'gestionPlanificacion_y_Desarrollo_Proyectos_Nuevos'
| 28.5 | 70 | 0.871345 |
5d7e8d764b9bc7c2f67f40f65df184672b423546 | 11,577 | py | Python | tests/test_settings_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | tests/test_settings_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | tests/test_settings_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Niko Sandschneider
"""Module containing all tests for the settings window of easyp2p."""
from datetime import date
import os
import unittest.mock
from PyQt5.QtWidgets import QDialogButtonBox, QMessageBox
from easyp2p.p2p_settings import Settings
from easyp2p.ui.set... | 49.686695 | 79 | 0.706573 |
5db0391f5f7b08392a0ce072f335aa100c5b7b7c | 563 | wsgi | Python | app.wsgi | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | 4 | 2015-07-09T21:14:22.000Z | 2019-07-02T21:53:50.000Z | app.wsgi | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | null | null | null | app.wsgi | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | null | null | null | # Copyright 2014 John Reese
# Licensed under the MIT license
import os
from os import path
import sys
cwd = path.abspath(path.dirname(__file__))
sys.path.insert(0, cwd)
libpath = path.join(cwd, "lib")
libs = ["flask",
"jinja2",
"werkzeug",
"python-memcached-1.48",
]
for lib in libs:
... | 18.16129 | 47 | 0.657194 |
5d0b40a38305c618e3ca3db7390a0cd805d70258 | 2,436 | py | Python | src/visitpy/visit_flow/flow/tests/test_filters_pyocl_compile.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/flow/tests/test_filters_pyocl_compile.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/flow/tests/test_filters_pyocl_compile.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: test_filters_pyocl_compile.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 3/24/2... | 30.074074 | 73 | 0.607964 |
53f3dc55d27f6b734cb8b70da7ead132cb5914c7 | 2,208 | py | Python | parse.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | 1 | 2021-05-24T06:16:49.000Z | 2021-05-24T06:16:49.000Z | parse.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | null | null | null | parse.py | florenthemmi/ips-by-country | 2f63ec2108ceaae97221de52654753c545733d84 | [
"MIT"
] | null | null | null | import argparse
import csv
import operator
import os
import pickle
import time
from config import CIDR_MAX_SUBNETS, COUNTRIES, MARKDOWN_DIRECTORY, PICKLE_DIRECTORY, PICKLE_FILENAME, RAW_DIRECTORY
from utils import IPRange
def build_markdown(ips_by_country):
sorted_countries = sorted({key: COUNTRIES[key] for key i... | 35.612903 | 121 | 0.560236 |
54ff114b29e63b5f1ac0a6912fdb85a61fb0191a | 10,889 | py | Python | lale/lib/sklearn/isolation_forest.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 265 | 2019-08-06T14:45:43.000Z | 2022-03-30T23:57:48.000Z | lale/lib/sklearn/isolation_forest.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 467 | 2019-08-08T02:01:21.000Z | 2022-03-25T16:12:00.000Z | lale/lib/sklearn/isolation_forest.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 81 | 2019-08-07T19:59:31.000Z | 2022-03-31T09:11:58.000Z | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 39.596364 | 185 | 0.475893 |
4ae59b80ae3dee4517e5eb1371f9f0923c1c37b7 | 9,494 | py | Python | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/data.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-12T06:52:43.000Z | 2022-01-12T06:52:43.000Z | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/data.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/data.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... | 43.351598 | 155 | 0.653149 |
ab3f552341c3c43f6f26d9460db3a822ea7661c5 | 3,985 | py | Python | test/test_npu/test_network_ops/test_binary_cross_entropy.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_binary_cross_entropy.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_binary_cross_entropy.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/licen... | 42.849462 | 108 | 0.657716 |
beaa4c96ab35b44b67ad6ecbf4d2d7479f2ec273 | 785 | py | Python | foundation/erpnext_foundation/doctype/portal_event/portal_event.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 1 | 2018-08-21T04:55:52.000Z | 2018-08-21T04:55:52.000Z | foundation/erpnext_foundation/doctype/portal_event/portal_event.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 5 | 2018-08-21T04:46:18.000Z | 2018-08-28T08:58:05.000Z | foundation/erpnext_foundation/doctype/portal_event/portal_event.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, EOSSF and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
class PortalEvent(WebsiteGenerator):
_website = dict(
page_title_field = 'event... | 27.068966 | 70 | 0.738854 |
22ab6aec5f5abda228e7e53ab50fcbe157667c7f | 815 | py | Python | 988-smallest-string-starting-from-leaf/988-smallest-string-starting-from-leaf.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 988-smallest-string-starting-from-leaf/988-smallest-string-starting-from-leaf.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 988-smallest-string-starting-from-leaf/988-smallest-string-starting-from-leaf.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def smallestFromLeaf(self, root: Optional[TreeNode]) -> str:
output=[]
digit2alphabet = dict... | 40.75 | 87 | 0.585276 |
4a35438b5bc6c446625dbb51b9913dd7e4ae459b | 7,796 | py | Python | paddlenlp/transformers/ernie_doc/tokenizer.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/ernie_doc/tokenizer.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/ernie_doc/tokenizer.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... | 40.185567 | 109 | 0.594279 |
78f9145501c7113993af5539b1efbc9b391d71d3 | 271 | py | Python | exercises/fr/exc_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # Importe spacy et crée l'objet nlp français
import ____
nlp = ____
# Traite le texte
doc = ____("La forêt est peuplée de loups gris et renards roux.")
# Sélectionne le premier token
first_token = doc[____]
# Affiche le texte du premier token
print(first_token.____)
| 19.357143 | 65 | 0.752768 |
60aa7cf3822c7d3588236f19825e73e2f6631401 | 23 | py | Python | python/python_backup/PRAC_PYTHON/a.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/a.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/a.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | a=10
b=20
print a,b
| 5.75 | 10 | 0.565217 |
71e46edf619917a1adeada98dbeeb501334839c3 | 1,500 | py | Python | utils/file_utils.py | kkahloots/Generative-Models-03 | 5399fb8a504543b0a4196a81b182ead79ee247df | [
"MIT"
] | null | null | null | utils/file_utils.py | kkahloots/Generative-Models-03 | 5399fb8a504543b0a4196a81b182ead79ee247df | [
"MIT"
] | null | null | null | utils/file_utils.py | kkahloots/Generative-Models-03 | 5399fb8a504543b0a4196a81b182ead79ee247df | [
"MIT"
] | null | null | null | import os
import sys
import json
import numpy as np
def _save_args(args, exp_name, log_dir):
print('Saving Model Arguments ...')
my_file = log_dir + '/' + exp_name + '.json'
with open(my_file, 'w') as fp:
json.dump(args, fp)
def _load_args(exp_name, log_dir):
my_file = log_dir + ... | 25.423729 | 78 | 0.538667 |
e0eddf012e16d8563df4b28db1d66ed57ba57c9f | 14,699 | py | Python | official/cv/nasnet/modelarts/train_start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/nasnet/modelarts/train_start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/nasnet/modelarts/train_start.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.814024 | 109 | 0.667256 |
e0f2585168913b158b23a546bece0399e7d91e40 | 1,250 | py | Python | users.py | theFox6/HPIMysterybot | 187341ff8fca4a683cc052c813f9cf1fe71117db | [
"MIT"
] | null | null | null | users.py | theFox6/HPIMysterybot | 187341ff8fca4a683cc052c813f9cf1fe71117db | [
"MIT"
] | null | null | null | users.py | theFox6/HPIMysterybot | 187341ff8fca4a683cc052c813f9cf1fe71117db | [
"MIT"
] | null | null | null | import time
all = {}
highscores = []
def create(id, name):
all[id] = {
'name': name,
'fails' : 0
}
def migrateUser(oldID, newID):
all[newID] = all[oldID]
del all[oldID]
def add_fail(chat_id):
if not all[chat_id]:
create(chat_id,'unnamed')
all[chat_id]['fails'] += 1
d... | 29.069767 | 146 | 0.5784 |
1ca5e47b6ce90f6ec65b9167a1069191285b77bf | 25,394 | py | Python | Packs/FireEyeEX/Integrations/FireEyeEX/FireEyeEX_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/FireEyeEX/Integrations/FireEyeEX/FireEyeEX_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/FireEyeEX/Integrations/FireEyeEX/FireEyeEX_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import io
import pytest
from freezegun import freeze_time
from FireEyeEX import *
from test_data.result_constants import QUARANTINED_EMAILS_CONTEXT, GET_ALERTS_CONTEXT, GET_ALERTS_DETAILS_CONTEXT, \
GET_ARTIFACTS_METADATA_CONTEXT, ALLOWEDLIST, BLOCKEDLIST
def util_load_json(path):
with io.open(path, mode='r... | 40.760835 | 118 | 0.678979 |
c7a8fa6e796dca1100b8aab32c6b0ae96932022f | 3,990 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/panos_check.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/panos_check.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/panos_check.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... | 26.959459 | 93 | 0.657644 |
29424ed7981d5bf4c9152bc57fc67ff6dabd0342 | 286 | py | Python | backend/apps/iamstudent/migrations/0006_merge_20200330_0313.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/iamstudent/migrations/0006_merge_20200330_0313.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/iamstudent/migrations/0006_merge_20200330_0313.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-30 03:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('iamstudent', '0005_student_einwilligung_agb'),
('iamstudent', '0005_merge_20200330_0221'),
]
operations = [
]
| 19.066667 | 56 | 0.664336 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.