hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3f4de4faa1e841e8a6ac1f41b6fa33129d80bab6 | 7,981 | py | Python | client/BaseClient.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 1 | 2016-11-29T15:15:55.000Z | 2016-11-29T15:15:55.000Z | client/BaseClient.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | null | null | null | client/BaseClient.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | null | null | null |
# Copyright 2016 Battelle Energy Alliance, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 36.610092 | 113 | 0.638266 |
1fb63a4d2035d9755e4d9c146f37c5c500eb3612 | 11,939 | py | Python | chives/timelord/timelord_state.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | 7 | 2021-12-26T11:05:19.000Z | 2022-02-24T10:42:45.000Z | chives/timelord/timelord_state.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | 8 | 2021-12-14T17:27:29.000Z | 2022-03-29T18:18:22.000Z | chives/timelord/timelord_state.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | 1 | 2021-12-09T23:51:12.000Z | 2021-12-09T23:51:12.000Z | import logging
from typing import List, Optional, Tuple, Union
from chives.consensus.constants import ConsensusConstants
from chives.protocols import timelord_protocol
from chives.timelord.iters_from_block import iters_from_block
from chives.timelord.types import Chain, StateType
from chives.types.blockchain_format.cl... | 49.953975 | 119 | 0.675936 |
1823538da1cf1495ce12b6a984ce5e1965a9a432 | 8,751 | py | Python | tensorflow_datasets/audio/speech_command.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/audio/speech_command.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/audio/speech_command.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | null | null | null | """Speech Command Dataset"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import hashlib
import os
import tensorflow_datasets as tfds
import tensorflow as tf
from tensorflow.python.ops import io_ops
from tensorflow.python.util import compat
_CI... | 39.958904 | 109 | 0.54828 |
914c51511d63720b9c03f5716252b0303b340b23 | 27 | py | Python | password_organizer/cli_menu/__init__.py | gbataille/password-organizer | 62a9a23a32637197d354f5d438cd0917d781cb52 | [
"MIT"
] | null | null | null | password_organizer/cli_menu/__init__.py | gbataille/password-organizer | 62a9a23a32637197d354f5d438cd0917d781cb52 | [
"MIT"
] | null | null | null | password_organizer/cli_menu/__init__.py | gbataille/password-organizer | 62a9a23a32637197d354f5d438cd0917d781cb52 | [
"MIT"
] | null | null | null | from .prompt import prompt
| 13.5 | 26 | 0.814815 |
d55d8e8dfa593335b98a02e1922e331500e1e648 | 12,525 | py | Python | test/backend/test_api/test_user.py | bnbwebexpertise/linkr | 657bdd3b5c77b67702b9398da000e19d3f5bb875 | [
"MIT"
] | 124 | 2016-12-23T02:14:45.000Z | 2021-11-20T15:25:20.000Z | test/backend/test_api/test_user.py | bnbwebexpertise/linkr | 657bdd3b5c77b67702b9398da000e19d3f5bb875 | [
"MIT"
] | 24 | 2017-05-29T10:15:15.000Z | 2019-05-23T13:30:58.000Z | test/backend/test_api/test_user.py | bnbwebexpertise/linkr | 657bdd3b5c77b67702b9398da000e19d3f5bb875 | [
"MIT"
] | 19 | 2017-05-15T13:19:07.000Z | 2021-05-14T02:35:05.000Z | import linkr # flake8: noqa: F401
import mock
import util.recaptcha
import util.response
from test.backend.factory import UserFactory
from test.backend.test_case import LinkrTestCase
from test.backend.test_case import mock_config_options
from uri.auth import *
from uri.user import *
class TestUser(LinkrTestCase):
... | 39.140625 | 91 | 0.628743 |
6ecd0607220c8509865235b714612bd0ff40a74b | 565 | py | Python | test.py | bhavnesh2211/Ngo-Scraper | 256b1166ff7564e0799437d19e86fec0fd549d9f | [
"MIT"
] | 6 | 2019-03-03T06:08:24.000Z | 2019-03-03T07:21:06.000Z | test.py | bhavnesh2211/Ngo-Scraper | 256b1166ff7564e0799437d19e86fec0fd549d9f | [
"MIT"
] | null | null | null | test.py | bhavnesh2211/Ngo-Scraper | 256b1166ff7564e0799437d19e86fec0fd549d9f | [
"MIT"
] | null | null | null | # import requests
from pprint import pprint
from bs4 import BeautifulSoup
url = requests.get("https://www.giveindia.org/certified-indian-ngos")
soup = BeautifulSoup(url.text, "html.parser")
dictionary = {}
trs = soup.find("table", class_="table table-bordered")
tr =trs.find("tbody")
tds = tr.find_all("tr")
place = []... | 24.565217 | 69 | 0.693805 |
49ede2c6c4fb02e55b0e63bb25c826b1fbb676f5 | 2,563 | py | Python | oase_documents/conf.py | Masa-Yasuno/oase | 90f3cee73c0d9b3153808a4a72bd19984a4873f9 | [
"Apache-2.0"
] | 9 | 2020-03-25T07:51:47.000Z | 2022-02-07T00:07:28.000Z | oase_documents/conf.py | Masa-Yasuno/oase | 90f3cee73c0d9b3153808a4a72bd19984a4873f9 | [
"Apache-2.0"
] | 1,164 | 2021-01-28T23:16:11.000Z | 2022-03-28T07:23:10.000Z | oase_documents/conf.py | Masa-Yasuno/oase | 90f3cee73c0d9b3153808a4a72bd19984a4873f9 | [
"Apache-2.0"
] | 25 | 2020-03-17T06:48:30.000Z | 2022-02-15T15:13:44.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 32.858974 | 79 | 0.690987 |
a3d136c8d51204a6bc688a035dddf58fe956ae69 | 12,996 | py | Python | tensorflow/python/kernel_tests/sparse_concat_op_test.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 5 | 2018-07-04T22:14:02.000Z | 2018-07-04T22:21:43.000Z | tensorflow/python/kernel_tests/sparse_concat_op_test.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | null | null | null | tensorflow/python/kernel_tests/sparse_concat_op_test.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 1 | 2018-11-30T01:35:01.000Z | 2018-11-30T01:35:01.000Z | # Copyright 2015 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 applica... | 37.889213 | 80 | 0.577024 |
3a28a7b1ca2d427757b20b4a249b7a0c474bce73 | 2,461 | py | Python | src/sot_talos_balance/talos/parameter_server_conf.py | olivier-stasse/sot-talos-balance | 8749650fc5f512a04c349f447a0cfb0d9e0e1e05 | [
"BSD-2-Clause"
] | null | null | null | src/sot_talos_balance/talos/parameter_server_conf.py | olivier-stasse/sot-talos-balance | 8749650fc5f512a04c349f447a0cfb0d9e0e1e05 | [
"BSD-2-Clause"
] | null | null | null | src/sot_talos_balance/talos/parameter_server_conf.py | olivier-stasse/sot-talos-balance | 8749650fc5f512a04c349f447a0cfb0d9e0e1e05 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 9 13:55:16 2015
@author: adelpret
"""
import numpy as np
from rospkg import RosPack
rospack = RosPack()
NJ = 32
model_path = [rospack.get_path('talos_data') + "/../"]
urdfFileName = rospack.get_path('talos_data') + "/urdf/talos_reduced.urdf"
ImuJointName = "imu_joint"
... | 24.366337 | 118 | 0.534742 |
c6ad39cbef12c71f9faaff964537fb5b7755af85 | 3,958 | py | Python | arxiv/canonical/domain/tests/test_file.py | arXiv/arxiv-canonical | a758ed88a568f23a834288aed4dcf7039c1340cf | [
"MIT"
] | 5 | 2019-05-26T22:52:54.000Z | 2021-11-05T12:27:11.000Z | arxiv/canonical/domain/tests/test_file.py | arXiv/arxiv-canonical | a758ed88a568f23a834288aed4dcf7039c1340cf | [
"MIT"
] | 31 | 2019-06-24T13:51:25.000Z | 2021-11-12T22:27:10.000Z | arxiv/canonical/domain/tests/test_file.py | arXiv/arxiv-canonical | a758ed88a568f23a834288aed4dcf7039c1340cf | [
"MIT"
] | 4 | 2019-01-10T22:01:54.000Z | 2021-11-05T12:26:58.000Z | """Tests for :mod:`arxiv.canonical.domain`."""
from datetime import datetime
from unittest import TestCase
from ..file import URI, Key, CanonicalFile, ContentType
class TestURIForFile(TestCase):
"""URI can refer to a local file."""
def test_file_uri(self):
"""URI is initialized with an absolute pat... | 35.981818 | 75 | 0.635422 |
f31db364baeb7cfddf28dd231e1de3c4d1e739aa | 3,871 | py | Python | ververica_api_sdk/models/deployment_template.py | justlikemikezz/ververica-api-sdk | 0eee284b4433f74b35fd2f41d149e619624aaed3 | [
"RSA-MD"
] | null | null | null | ververica_api_sdk/models/deployment_template.py | justlikemikezz/ververica-api-sdk | 0eee284b4433f74b35fd2f41d149e619624aaed3 | [
"RSA-MD"
] | null | null | null | ververica_api_sdk/models/deployment_template.py | justlikemikezz/ververica-api-sdk | 0eee284b4433f74b35fd2f41d149e619624aaed3 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
Application Manager API
Application Manager APIs to control Apache Flink jobs # noqa: E501
OpenAPI spec version: 2.0.1
Contact: platform@ververica.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
cl... | 27.260563 | 80 | 0.573754 |
5699962ee64a4f0bcf35f7097aea7a1def34fa7f | 8,731 | py | Python | rpython/memory/gc/inspector.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 333 | 2015-08-08T18:03:38.000Z | 2022-03-22T18:13:12.000Z | rpython/memory/gc/inspector.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 7 | 2020-02-16T16:49:05.000Z | 2021-11-26T09:00:56.000Z | rpython/memory/gc/inspector.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | """
Utility RPython functions to inspect objects in the GC.
"""
from rpython.rtyper.lltypesystem import lltype, llmemory, rffi, llgroup
from rpython.rtyper.lltypesystem.lloperation import llop
from rpython.rlib.objectmodel import free_non_gc_object
from rpython.rlib import rposix, rgc, jit
from rpython.memory.support ... | 30.211073 | 79 | 0.61631 |
e0920cef2c5cb6367aab424bf631f76086e8edac | 696 | py | Python | Room/myface_regonition/call_cam.py | 39xdgy/Self_study | c60f840c140bed95d042c678e0174c8c1e4b3a10 | [
"Apache-2.0"
] | null | null | null | Room/myface_regonition/call_cam.py | 39xdgy/Self_study | c60f840c140bed95d042c678e0174c8c1e4b3a10 | [
"Apache-2.0"
] | null | null | null | Room/myface_regonition/call_cam.py | 39xdgy/Self_study | c60f840c140bed95d042c678e0174c8c1e4b3a10 | [
"Apache-2.0"
] | null | null | null | import cv2
import os
global frame
cv2.namedWindow("preview")
vc = cv2.VideoCapture(1)
if vc.isOpened():
rval, frame = vc.read()
else:
rval = False
first_pic = True
count = 0
while rval:
cv2.imshow("Preview", frame)
rval, frame = vc.read()
##print(frame)
##encode = face.face_encoding... | 15.130435 | 41 | 0.564655 |
0ffed790f87483e5c764e09442d02171141409ba | 7,299 | py | Python | ansible/modules/cloud/amazon/route53_zone.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/cloud/amazon/route53_zone.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/cloud/amazon/route53_zone.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
# 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 published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | 30.668067 | 97 | 0.640773 |
275ac3def39609eb692fac6337dec796a7685e8f | 2,833 | py | Python | test/test_list_handler.py | milonoir/yaml_rulz | ee8e3f4d2892aa636832970dddc044d0ca86c691 | [
"MIT"
] | 1 | 2017-07-14T16:43:10.000Z | 2017-07-14T16:43:10.000Z | test/test_list_handler.py | milonoir/yaml_rulz | ee8e3f4d2892aa636832970dddc044d0ca86c691 | [
"MIT"
] | 4 | 2016-09-13T15:14:51.000Z | 2017-05-22T10:57:20.000Z | test/test_list_handler.py | milonoir/yaml_rulz | ee8e3f4d2892aa636832970dddc044d0ca86c691 | [
"MIT"
] | null | null | null | from unittest import TestCase
from yaml_rulz.list_handler import ListHandler
TEST_FLAT_YML_LIST_TYPES = {
"ericsson:shelf:0:id": "@ num",
"ericsson:shelf:0:management:address": "@ ipv4",
"ericsson:shelf:0:management:username": "username",
"ericsson:shelf:0:management:password": "password",
"erics... | 34.975309 | 75 | 0.616661 |
a3be5bcb15803349aa3dfd699497890281793f16 | 3,400 | py | Python | Library/Utilities/fftw++-2.05/mpi/testtranspose.py | stevend12/SolutioCpp | 6fa8a12207cd1e7e806a8ef5de93dc137c33856e | [
"Apache-2.0"
] | 9 | 2017-06-27T14:04:46.000Z | 2022-02-17T17:38:03.000Z | Library/Utilities/fftw++-2.05/mpi/testtranspose.py | stevend12/SolutioCpp | 6fa8a12207cd1e7e806a8ef5de93dc137c33856e | [
"Apache-2.0"
] | null | null | null | Library/Utilities/fftw++-2.05/mpi/testtranspose.py | stevend12/SolutioCpp | 6fa8a12207cd1e7e806a8ef5de93dc137c33856e | [
"Apache-2.0"
] | 3 | 2017-06-23T20:10:44.000Z | 2021-01-13T10:09:46.000Z | #!/usr/bin/python -u
import sys # so that we can return a value at the end.
import random # for randum number generators
import time
import getopt
import os.path
from testutils import *
from math import sqrt
def main(argv):
retval = 0
Print("MPI transpose unit test")
usage = "Usage:\n"\
"... | 29.565217 | 79 | 0.436176 |
03c01f7d5fbe4f53de2e76abcf3ea3504a61f3b5 | 292 | py | Python | Level2/stock_price.py | chae-heechan/Programmers_Python_Algorithm_Study | c61af0b1b97d790e2332581eb0b7da42c3e510fa | [
"MIT"
] | null | null | null | Level2/stock_price.py | chae-heechan/Programmers_Python_Algorithm_Study | c61af0b1b97d790e2332581eb0b7da42c3e510fa | [
"MIT"
] | null | null | null | Level2/stock_price.py | chae-heechan/Programmers_Python_Algorithm_Study | c61af0b1b97d790e2332581eb0b7da42c3e510fa | [
"MIT"
] | null | null | null | def solution(prices):
result = [0 for i in range(len(prices))]
for index1 in range(len(prices)):
for index2 in range(index1+1, len(prices)):
result[index1] += 1
if prices[index1] > prices[index2]: # 떨어졌을 경우
break
return result
| 26.545455 | 60 | 0.558219 |
79020e3b97923b38276d349876f359df32550754 | 1,623 | py | Python | classes/jogwidget.py | comgram/gerbil_gui | bacec0047bc2de6bf95b1734af6845896a04aeff | [
"MIT"
] | 21 | 2017-03-17T16:34:33.000Z | 2022-03-12T14:52:40.000Z | classes/jogwidget.py | comgram/gerbil_gui | bacec0047bc2de6bf95b1734af6845896a04aeff | [
"MIT"
] | null | null | null | classes/jogwidget.py | comgram/gerbil_gui | bacec0047bc2de6bf95b1734af6845896a04aeff | [
"MIT"
] | 7 | 2019-06-08T19:45:23.000Z | 2022-01-04T02:44:41.000Z | from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget
class JogWidget(QWidget):
def __init__(self, parent, callback):
super(JogWidget, self).__init__(parent)
self.parent = parent
self.callback = callback
self.wx_current = 0
self.wy_current = 0
... | 30.622642 | 89 | 0.585952 |
17a3d3fcf237bfcb0498630f42cf6eaaccf19d38 | 395 | py | Python | src/condicional/reajuste.py | PedroAugustoDev/Algoritmos-em-Python | aae67133c249ca67a597431b3fc6d46d80a54a7e | [
"MIT"
] | 1 | 2022-03-08T03:40:44.000Z | 2022-03-08T03:40:44.000Z | src/condicional/reajuste.py | PedroAugustoDev/Algoritmos-em-Python | aae67133c249ca67a597431b3fc6d46d80a54a7e | [
"MIT"
] | null | null | null | src/condicional/reajuste.py | PedroAugustoDev/Algoritmos-em-Python | aae67133c249ca67a597431b3fc6d46d80a54a7e | [
"MIT"
] | null | null | null | '''
Autor: Pedro Augusto Lourenço Siqueira
Objetivo: Implementação de um algoritmo para
reajuste do salário, acresentando 5, 10, 15%
de acordo com o salário.
Nível: Básico
'''
SA = float(input('Digite seu salário atual: '))
NA = 0
if SA < 500: NA = SA + SA * .15
elif SA >= 500 and SA < 1000: NA = SA + SA... | 21.944444 | 48 | 0.640506 |
0b79db7e380909ed269e0abddd6e27ab67de5b6b | 19,736 | py | Python | release/stubs.min/System/__init___parts/Uri.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/__init___parts/Uri.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/__init___parts/Uri.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class Uri(object,ISerializable):
"""
Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.
Uri(uriString: str)
Uri(uriString: str,dontEscape: bool)
Uri(baseUri: Uri,relativeUri: str,dontEscape: bool)
Uri(uriString: str,uriKind: UriKind... | 22.452787 | 215 | 0.686563 |
5c3dbbe50c241f4d1bd4947f4c8db36e04c191ed | 272 | py | Python | mysite/photos/models.py | ThatChocolateGuy/python-face-recognition | 07bb0613cdb5a484baf0cc9f034683dce19c9ee7 | [
"MIT"
] | 1 | 2019-08-11T03:47:06.000Z | 2019-08-11T03:47:06.000Z | mysite/photos/models.py | ThatChocolateGuy/python-face-recognition | 07bb0613cdb5a484baf0cc9f034683dce19c9ee7 | [
"MIT"
] | 14 | 2019-02-10T08:20:59.000Z | 2020-03-05T16:24:08.000Z | mysite/photos/models.py | ThatChocolateGuy/python-face-recognition | 07bb0613cdb5a484baf0cc9f034683dce19c9ee7 | [
"MIT"
] | 1 | 2019-11-18T02:18:40.000Z | 2019-11-18T02:18:40.000Z | from __future__ import unicode_literals
from django.db import models
class Photo(models.Model):
title = models.CharField(max_length=255, blank=True)
file = models.FileField(upload_to='photos/')
uploaded_at = models.DateTimeField(auto_now_add=True)
| 27.2 | 58 | 0.746324 |
fb315a1c1ed2be97b883932991ddd9ed8b3d1951 | 1,367 | py | Python | Python3/06_ZigZag_Conversion.py | yangjiahao106/LeetCode | c30ba0ef06f444951f7ab8eee495ac43613d7f4f | [
"RSA-MD"
] | 1 | 2018-04-28T09:07:11.000Z | 2018-04-28T09:07:11.000Z | Python3/06_ZigZag_Conversion.py | yangjiahao106/LeetCode | c30ba0ef06f444951f7ab8eee495ac43613d7f4f | [
"RSA-MD"
] | 1 | 2018-02-24T16:26:30.000Z | 2018-02-24T16:26:44.000Z | Python3/06_ZigZag_Conversion.py | yangjiahao106/LeetCode | c30ba0ef06f444951f7ab8eee495ac43613d7f4f | [
"RSA-MD"
] | null | null | null | #! python3
# __author__ = "YangJiaHao"
# date: 2018/1/28
class Solution:
def convert(self, s, numRows):
"""
:type s: str
:type numRows: int
:rtype: str
"""
length = len(s)
if length <= 2 or numRows == 1:
return s
strs = []
lag = 2 *... | 23.568966 | 54 | 0.400146 |
5dfaec3ad0f83b1ab123dec999cedcef20d12e1d | 3,310 | py | Python | contrib/scripts/kick_users.py | zauguin/synapse | ea00f18135ce30e8415526ce68585ea90da5b856 | [
"Apache-2.0"
] | 2 | 2021-05-14T19:05:03.000Z | 2021-05-26T23:00:43.000Z | contrib/scripts/kick_users.py | zauguin/synapse | ea00f18135ce30e8415526ce68585ea90da5b856 | [
"Apache-2.0"
] | null | null | null | contrib/scripts/kick_users.py | zauguin/synapse | ea00f18135ce30e8415526ce68585ea90da5b856 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from argparse import ArgumentParser
import json
import requests
import sys
import urllib
def _mkurl(template, kws):
for key in kws:
template = template.replace(key, kws[key])
return template
def main(hs, room_id, access_token, user_id_prefix, why):
if not why:
why = "... | 35.212766 | 101 | 0.567069 |
75416306b74d62c8de9e3e1c78f2585911608495 | 1,104 | py | Python | app/Http/insertTunggakanPemerintah.py | demsyimanm/retribusiBaru | f58ce5b2e3bba1a1f93d8ecd6e7fb23c820b58f0 | [
"MIT"
] | null | null | null | app/Http/insertTunggakanPemerintah.py | demsyimanm/retribusiBaru | f58ce5b2e3bba1a1f93d8ecd6e7fb23c820b58f0 | [
"MIT"
] | null | null | null | app/Http/insertTunggakanPemerintah.py | demsyimanm/retribusiBaru | f58ce5b2e3bba1a1f93d8ecd6e7fb23c820b58f0 | [
"MIT"
] | null | null | null | import csv
import MySQLdb
with open('../../public/upload/03 201510 nunggak pemerintah ada periode tagih.txt', 'rb') as csvfile:
i = 0
db_tunggak = MySQLdb.connect("10.151.63.12", "retribusi", "retribusi", "retribusi")
cursor_tunggak = db_tunggak.cursor()
spamreader = csv.reader(csvfile, delimiter='... | 25.090909 | 114 | 0.57337 |
e26f6e3aa4806d98298f5b97014db478639446bc | 12,118 | py | Python | python_modules/libraries/dagster-airflow/dagster_airflow_tests/test_dagster_pipeline_factory/test_dependency_structure_translation.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 1 | 2021-01-31T19:16:29.000Z | 2021-01-31T19:16:29.000Z | python_modules/libraries/dagster-airflow/dagster_airflow_tests/test_dagster_pipeline_factory/test_dependency_structure_translation.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airflow/dagster_airflow_tests/test_dagster_pipeline_factory/test_dependency_structure_translation.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 1 | 2021-12-08T18:13:19.000Z | 2021-12-08T18:13:19.000Z | # pylint: disable=pointless-statement
from airflow.models.dag import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.utils.dates import days_ago
from airflow.utils.helpers import chain
from dagster.core.snap import PipelineSnapshot
from dagster.serdes import serialize_pp
from dagster_airflo... | 26.116379 | 91 | 0.662073 |
cadd4924d825b19c9754bae16e62d042017510bc | 5,742 | py | Python | sdk/python/pulumi_aws/glacier/vault_lock.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/glacier/vault_lock.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/glacier/vault_lock.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class VaultLock(pulumi.CustomResource... | 67.552941 | 569 | 0.72675 |
95f168e6e88a3d0ef041b8c84cb43cdd7179f7a0 | 128,389 | py | Python | test/functional/tests.py | IPVL/swift-kilo | fe4cdb597f70e40c667b001b446546d75a7a5ab0 | [
"Apache-2.0"
] | null | null | null | test/functional/tests.py | IPVL/swift-kilo | fe4cdb597f70e40c667b001b446546d75a7a5ab0 | [
"Apache-2.0"
] | null | null | null | test/functional/tests.py | IPVL/swift-kilo | fe4cdb597f70e40c667b001b446546d75a7a5ab0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python -u
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 ap... | 39.238692 | 79 | 0.57702 |
a7313f2731f83bb28c7efde4ca98825e8c573959 | 1,387 | py | Python | src/app/parser_xml.py | ralphribeiro/facilita-DOU | e695ac0f58369d61fad2723bd5e52ecd80d0b33f | [
"MIT"
] | null | null | null | src/app/parser_xml.py | ralphribeiro/facilita-DOU | e695ac0f58369d61fad2723bd5e52ecd80d0b33f | [
"MIT"
] | null | null | null | src/app/parser_xml.py | ralphribeiro/facilita-DOU | e695ac0f58369d61fad2723bd5e52ecd80d0b33f | [
"MIT"
] | null | null | null | import re
from dataclasses import dataclass
import logging
from os import listdir
from os.path import join as osjoin
from xml.etree.ElementTree import parse
@dataclass(frozen=True)
class ItemXml:
url: str
identifica: str
data: str
texto: str
TAG_RE = re.compile(r'<[^>]+>')
def remove_tags(text):
... | 22.015873 | 66 | 0.638068 |
b4d44a37bd7e6e0e023ef3d099dd3166aeb48d70 | 5,973 | py | Python | qmla/exploration_strategies/nv_centre_spin_characterisation/experiment_vary_num_qubits.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | qmla/exploration_strategies/nv_centre_spin_characterisation/experiment_vary_num_qubits.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | qmla/exploration_strategies/nv_centre_spin_characterisation/experiment_vary_num_qubits.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | import random
import sys
import os
import itertools
import pickle
from qmla.exploration_strategies.nv_centre_spin_characterisation import nv_centre_full_access
import qmla.shared_functionality.qinfer_model_interface
import qmla.shared_functionality.probe_set_generation
import qmla.shared_functionality.experiment_de... | 35.553571 | 140 | 0.609911 |
4cfe8138884e6ed0f94dce19081520eec05adccd | 1,853 | py | Python | apps/log_extract/migrations/0016_tasks_ex_data.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 75 | 2021-07-14T09:32:36.000Z | 2022-03-31T15:26:53.000Z | apps/log_extract/migrations/0016_tasks_ex_data.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 561 | 2021-07-14T07:45:47.000Z | 2022-03-31T11:41:28.000Z | apps/log_extract/migrations/0016_tasks_ex_data.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 41 | 2021-07-14T07:39:50.000Z | 2022-03-25T09:22:18.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... | 46.325 | 111 | 0.727469 |
7eb2ee109a14e58ff7bb57a9264da21ef01071ae | 14,879 | py | Python | sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_async.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_async.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_async.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import asyncio
import hashlib
import os
import logging
import json
from azure.core.exceptions import ResourceNotFoundError
from devtools_testutils import ResourceGroupP... | 41.10221 | 119 | 0.671618 |
2b580f9ab3954b6f127ad6309f3e44c9bea888cc | 2,662 | py | Python | gelweb/gel2mdt/templatetags/gel2mdt_extras.py | moka-guys/GeL2MDT | 09bf25b8452e2e887dbf74b1cd4771d234c6166c | [
"MIT"
] | null | null | null | gelweb/gel2mdt/templatetags/gel2mdt_extras.py | moka-guys/GeL2MDT | 09bf25b8452e2e887dbf74b1cd4771d234c6166c | [
"MIT"
] | 1 | 2020-02-06T13:17:40.000Z | 2020-02-06T13:17:40.000Z | gelweb/gel2mdt/templatetags/gel2mdt_extras.py | byronmews/GeL2MDT | 1449831f0d7c570b71e7f46fb4dd1fcb805b0325 | [
"MIT"
] | null | null | null | """Copyright (c) 2018 Great Ormond Street Hospital for Children NHS Foundation
Trust & Birmingham Women's and Children's NHS Foundation Trust
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software withou... | 34.128205 | 103 | 0.729902 |
0a30b48c6476b3d83b51a91797cceb992c158408 | 1,039 | py | Python | silver/models/__init__.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 222 | 2017-01-15T10:30:57.000Z | 2022-03-08T20:34:46.000Z | silver/models/__init__.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 141 | 2017-01-11T10:56:49.000Z | 2021-10-12T11:51:00.000Z | silver/models/__init__.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 76 | 2017-01-10T13:50:27.000Z | 2022-03-25T21:37:00.000Z | # Copyright (c) 2016 Presslabs SRL
#
# 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 writ... | 47.227273 | 94 | 0.810395 |
4c197ac3ddbc04ebcd93b28da7c0e704e7c5ce6d | 2,197 | py | Python | astroquery/alma/tests/test_alma_utils.py | jfoster17/astroquery | 807eade21e63f773cf7df8833799afa5eac8b79d | [
"BSD-3-Clause"
] | 1 | 2021-03-20T00:07:01.000Z | 2021-03-20T00:07:01.000Z | astroquery/alma/tests/test_alma_utils.py | jfoster17/astroquery | 807eade21e63f773cf7df8833799afa5eac8b79d | [
"BSD-3-Clause"
] | null | null | null | astroquery/alma/tests/test_alma_utils.py | jfoster17/astroquery | 807eade21e63f773cf7df8833799afa5eac8b79d | [
"BSD-3-Clause"
] | 1 | 2021-03-20T00:07:05.000Z | 2021-03-20T00:07:05.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy import wcs
from astropy import units as u
from pyregion.parser_helper import Shape
from astropy.tests.helper import pytest, remote_data
from .. import utils
def test_pyregion_subset():
header = dict(naxis=2, crpix1=15,... | 43.078431 | 92 | 0.667274 |
5976963293517ef6fc5e5c15f50c33dc4cc3f183 | 25,111 | py | Python | RecoLuminosity/LumiDB/python/lumidbDDL.py | DBAnthony/cmssw | 6406d33feab56ab2af79b00b533f62b5368ac33e | [
"Apache-2.0"
] | 1 | 2020-08-12T08:37:04.000Z | 2020-08-12T08:37:04.000Z | RecoLuminosity/LumiDB/python/lumidbDDL.py | DBAnthony/cmssw | 6406d33feab56ab2af79b00b533f62b5368ac33e | [
"Apache-2.0"
] | null | null | null | RecoLuminosity/LumiDB/python/lumidbDDL.py | DBAnthony/cmssw | 6406d33feab56ab2af79b00b533f62b5368ac33e | [
"Apache-2.0"
] | 1 | 2019-03-19T13:44:54.000Z | 2019-03-19T13:44:54.000Z | from __future__ import print_function
import coral
from RecoLuminosity.LumiDB import nameDealer,dbUtil
#=======================================================
#
# CREATE
#
#=======================================================
def createTables(schema):
'''
create new tables if not exist
revisions,revis... | 48.854086 | 185 | 0.638445 |
e0b7c6d3468597491587b190221cbf6ee808efd5 | 132 | py | Python | example/example/backends.py | gbozee/django-simple-social-login | 65c3a6578b334d3b83807d480148ea44739f7c08 | [
"MIT"
] | 3 | 2017-10-31T05:34:52.000Z | 2018-10-17T06:18:25.000Z | example/example/backends.py | gbozee/django-simple-social-login | 65c3a6578b334d3b83807d480148ea44739f7c08 | [
"MIT"
] | 4 | 2020-02-11T21:48:09.000Z | 2021-06-10T17:32:45.000Z | example/example/backends.py | gbozee/django-simple-social-login | 65c3a6578b334d3b83807d480148ea44739f7c08 | [
"MIT"
] | 3 | 2018-05-07T09:49:11.000Z | 2019-12-14T04:51:07.000Z | class MyBackend(object):
def authenticate(self, request, email=None):
# Check the token and return a user.
pass | 33 | 48 | 0.651515 |
1afda91c668470e066cc27c338b3395e5db4c66e | 504 | py | Python | flask_core/middleware/FilterMiddleware.py | secedu/flask-core | 3d8def8280613825f070d150372f9513f7727b69 | [
"Apache-2.0"
] | 3 | 2019-03-07T05:33:21.000Z | 2019-04-22T22:29:34.000Z | flask_core/middleware/FilterMiddleware.py | secedu/flask-core | 3d8def8280613825f070d150372f9513f7727b69 | [
"Apache-2.0"
] | 23 | 2019-03-10T15:03:14.000Z | 2019-05-16T11:15:22.000Z | flask_core/middleware/FilterMiddleware.py | secedu/flask-core | 3d8def8280613825f070d150372f9513f7727b69 | [
"Apache-2.0"
] | 3 | 2019-03-07T05:33:05.000Z | 2021-02-17T16:39:18.000Z | #!/usr/bin/env python3
class FilterMiddleware(object):
def __init__(self, wsgi_app):
self.wsgi_app = wsgi_app
self.blacklist = ["sqlmap", "dirbuster"]
def __call__(self, environ, start_response):
try:
if any((x for x in self.blacklist if x in environ["HTTP_USER_AGENT"].low... | 29.647059 | 91 | 0.593254 |
3b3d348ae8ff778061b1bcb70950fb0365316749 | 8,610 | py | Python | rgw/v2/tests/nfs_ganesha/test_on_nfs_io.py | viduship/ceph-qe-scripts | 886619fa6600c24cbf989d65868951b9c3decd72 | [
"MIT"
] | 6 | 2019-04-12T17:45:44.000Z | 2021-09-14T19:59:05.000Z | rgw/v2/tests/nfs_ganesha/test_on_nfs_io.py | viduship/ceph-qe-scripts | 886619fa6600c24cbf989d65868951b9c3decd72 | [
"MIT"
] | 111 | 2019-12-10T10:41:08.000Z | 2022-03-31T11:42:30.000Z | rgw/v2/tests/nfs_ganesha/test_on_nfs_io.py | viduship/ceph-qe-scripts | 886619fa6600c24cbf989d65868951b9c3decd72 | [
"MIT"
] | 23 | 2019-05-30T19:48:25.000Z | 2022-03-24T17:07:19.000Z | import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, "../../../..")))
import argparse
import logging
import shutil
import time
import traceback
import v2.utils.utils as utils
import yaml
from v2.lib.exceptions import TestExecError
from v2.lib.nfs_ganesha.nfslib import DoIO
from v2.lib.nfs_ganes... | 43.484848 | 91 | 0.565273 |
f8098d69fe9e992fc0a4c6c819f048f03d79395d | 22,663 | py | Python | tms_ss/tms_ss_ibs/src/ibs.py | robotpilot/ros_tms | 3d6b6579e89aa9cb216cd3cb6157fabc553c18f1 | [
"BSD-3-Clause"
] | 54 | 2015-01-06T06:58:28.000Z | 2021-05-02T07:49:37.000Z | tms_ss/tms_ss_ibs/src/ibs.py | robotpilot/ros_tms | 3d6b6579e89aa9cb216cd3cb6157fabc553c18f1 | [
"BSD-3-Clause"
] | 114 | 2015-01-07T06:42:21.000Z | 2022-02-12T05:54:04.000Z | tms_ss/tms_ss_ibs/src/ibs.py | robotpilot/ros_tms | 3d6b6579e89aa9cb216cd3cb6157fabc553c18f1 | [
"BSD-3-Clause"
] | 24 | 2015-03-27T08:35:59.000Z | 2020-06-08T13:05:31.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# ------------------------------------------------------------------------------
# @file : ibs.py
# @brief : Intelligent Board System
# @author : Akio Shigekane, Pyo
# @version: Ver1.1.1 (since 2012.00.00)
# @date : 2015.2.25
# -----------------------------------------... | 34.812596 | 106 | 0.565989 |
0f137a52d6dc5ea03fb3a06456053365d1e4ed21 | 5,085 | py | Python | tests/benchmark/context/test_images.py | kambiz-aghaiepour/rally | be708bacf0bc898a9538b9b6cb0ba4e1c015c1f2 | [
"Apache-2.0"
] | 1 | 2020-09-09T19:01:41.000Z | 2020-09-09T19:01:41.000Z | tests/benchmark/context/test_images.py | kambiz-aghaiepour/rally | be708bacf0bc898a9538b9b6cb0ba4e1c015c1f2 | [
"Apache-2.0"
] | null | null | null | tests/benchmark/context/test_images.py | kambiz-aghaiepour/rally | be708bacf0bc898a9538b9b6cb0ba4e1c015c1f2 | [
"Apache-2.0"
] | 1 | 2020-09-09T19:01:43.000Z | 2020-09-09T19:01:43.000Z | # 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 agreed to in writing, software
#... | 33.019481 | 79 | 0.549853 |
3c6c02d4afe0732203d8d74effab019986daf0ea | 33,486 | py | Python | utils/trainer.py | guochengqian/KPConv-PyTorch | 4138c12d276b0d9a765d41b93f2b9fd6e5eb2baa | [
"MIT"
] | 2 | 2021-08-04T17:15:04.000Z | 2021-12-06T14:37:46.000Z | utils/trainer.py | guochengqian/KPConv-PyTorch-DeepGCN | 4138c12d276b0d9a765d41b93f2b9fd6e5eb2baa | [
"MIT"
] | null | null | null | utils/trainer.py | guochengqian/KPConv-PyTorch-DeepGCN | 4138c12d276b0d9a765d41b93f2b9fd6e5eb2baa | [
"MIT"
] | null | null | null | #
#
# 0=================================0
# | Kernel Point Convolutions |
# 0=================================0
#
#
# ----------------------------------------------------------------------------------------------------------------------
#
# Class handling the training of any model
#
# --------... | 35.69936 | 120 | 0.48032 |
61154d9feb90b7517b4d2d9c4c451bb6a89af52d | 125 | py | Python | Algorithms/Edge/scale-free.py | Kanavoy/UODS | 2da38b749e721b051aeaa6a7bcb3a921aeb5a09c | [
"MIT"
] | null | null | null | Algorithms/Edge/scale-free.py | Kanavoy/UODS | 2da38b749e721b051aeaa6a7bcb3a921aeb5a09c | [
"MIT"
] | null | null | null | Algorithms/Edge/scale-free.py | Kanavoy/UODS | 2da38b749e721b051aeaa6a7bcb3a921aeb5a09c | [
"MIT"
] | null | null | null | def make_graph(opts):
from networkx import barabasi_albert_graph
return barabasi_albert_graph(opts.graph.n, opts.graph.e) | 41.666667 | 57 | 0.824 |
055f631b74e5b51f9483f6ceb2f8212567d0ded9 | 23,172 | py | Python | modules/gans/dcgan.py | Matesxs/GAN-Playground | 20c8f4bf491fd175883d0d812185b336960329e9 | [
"MIT"
] | 2 | 2020-09-02T21:08:07.000Z | 2021-12-09T23:03:37.000Z | modules/gans/dcgan.py | Matesxs/GAN-Playground | 20c8f4bf491fd175883d0d812185b336960329e9 | [
"MIT"
] | null | null | null | modules/gans/dcgan.py | Matesxs/GAN-Playground | 20c8f4bf491fd175883d0d812185b336960329e9 | [
"MIT"
] | 1 | 2020-12-15T15:32:10.000Z | 2020-12-15T15:32:10.000Z | import os
import numpy as np
from keras.optimizers import Adam, Optimizer
from keras.models import Model
from keras.layers import Input, Dense
from keras.initializers import RandomNormal
from keras.utils import plot_model
from keras.engine.network import Network
import keras.backend as K
from PIL import Image
from cv2 ... | 48.174636 | 402 | 0.726739 |
50b47cc3cad5250e6aa8aee1ccb58867ae764069 | 2,491 | py | Python | luxai2021/game/replay.py | legend-of-zyda/LuxPythonEnvGym | 7d818b5943dad1b7fae3c66b612aae93c743bd0e | [
"MIT"
] | 61 | 2021-08-23T00:13:10.000Z | 2022-03-26T13:11:57.000Z | luxai2021/game/replay.py | legend-of-zyda/LuxPythonEnvGym | 7d818b5943dad1b7fae3c66b612aae93c743bd0e | [
"MIT"
] | 36 | 2021-08-25T03:32:29.000Z | 2021-11-20T05:15:29.000Z | luxai2021/game/replay.py | legend-of-zyda/LuxPythonEnvGym | 7d818b5943dad1b7fae3c66b612aae93c743bd0e | [
"MIT"
] | 28 | 2021-09-03T22:43:18.000Z | 2022-01-24T14:57:18.000Z |
import json
from luxai2021.game.actions import Action
from typing import List
from .constants import Constants
class Replay:
"""
Implements saving of replays. Loosely mirrors '/src/Replay/index.ts'
"""
def __init__(self, game, file:str, stateful:bool=False):
"""
Creates a replay-writer... | 30.378049 | 136 | 0.527499 |
28467c933fbdc44707f1ead8368d88195c05b38f | 257 | py | Python | openks/mm/graph/__init__.py | lzy1203/OpenKS | 6a22fac7550e248e43d5b55ef39b1fe67c4b4b68 | [
"Apache-2.0"
] | null | null | null | openks/mm/graph/__init__.py | lzy1203/OpenKS | 6a22fac7550e248e43d5b55ef39b1fe67c4b4b68 | [
"Apache-2.0"
] | null | null | null | openks/mm/graph/__init__.py | lzy1203/OpenKS | 6a22fac7550e248e43d5b55ef39b1fe67c4b4b68 | [
"Apache-2.0"
] | 2 | 2021-11-18T06:55:55.000Z | 2021-12-29T15:21:07.000Z | from .graph import MMGraph
from .schema import (Entity, Relation, Schema, SchemaSet, load_schema,
load_schemas)
from .schema_impl import (HasEntity, ImageEntity, ImageViewEntity, Interact,
SemanticallySimilar)
| 42.833333 | 76 | 0.673152 |
dea10791c9565960f977930ca1a654816041177e | 6,719 | py | Python | mindspore/explainer/explanation/_attribution/_backprop/modified_relu.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | 2 | 2021-07-08T13:10:42.000Z | 2021-11-08T02:48:57.000Z | mindspore/explainer/explanation/_attribution/_backprop/modified_relu.py | peixinhou/mindspore | fcb2ec2779b753e95c762cf292b23bd81d1f561b | [
"Apache-2.0"
] | null | null | null | mindspore/explainer/explanation/_attribution/_backprop/modified_relu.py | peixinhou/mindspore | fcb2ec2779b753e95c762cf292b23bd81d1f561b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 41.220859 | 119 | 0.659622 |
9130200ba462c9fe12efb79390abe5da8549a5e8 | 7,369 | py | Python | package/scripts/common.py | lijufeng2016/ambari-hue-service | a9c30cb9a78c59a94ec2a2d667c7597c75c3aad7 | [
"Apache-2.0"
] | 17 | 2020-03-10T06:57:20.000Z | 2021-11-27T03:22:04.000Z | package/scripts/common.py | tokings/ambari-hue-service | a9c30cb9a78c59a94ec2a2d667c7597c75c3aad7 | [
"Apache-2.0"
] | null | null | null | package/scripts/common.py | tokings/ambari-hue-service | a9c30cb9a78c59a94ec2a2d667c7597c75c3aad7 | [
"Apache-2.0"
] | 17 | 2020-04-12T02:17:10.000Z | 2021-11-27T03:22:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os, pwd, grp, signal, time
from resource_management import *
from resource_management.core.exceptions import Fail
from resource_management.core.logger import Logger
from resource_management.core.resources.system import Execute, Directory, File
from resource_mana... | 45.770186 | 185 | 0.7214 |
ee5226d75b57931207b0a079895f1d3650ab1949 | 3,529 | py | Python | test/data_processing/test_find_best_worst_lists.py | 0xProject/p2p_incentives | ce69926eb3d003fb2767651df9486556c0e20ab6 | [
"Apache-2.0"
] | 3 | 2020-03-11T19:42:48.000Z | 2021-04-01T21:09:05.000Z | test/data_processing/test_find_best_worst_lists.py | 0xProject/p2p_incentives | ce69926eb3d003fb2767651df9486556c0e20ab6 | [
"Apache-2.0"
] | null | null | null | test/data_processing/test_find_best_worst_lists.py | 0xProject/p2p_incentives | ce69926eb3d003fb2767651df9486556c0e20ab6 | [
"Apache-2.0"
] | null | null | null | """
This module contains unit tests of find_best_worst_lists().
"""
from typing import List, Tuple
import pytest
from data_processing import find_best_worst_lists
from data_types import BestAndWorstLists, InvalidInputError, SpreadingRatio
from .__init__ import RATIO_LIST
# test normal cases
CASES_BEST_WORST_LISTS: ... | 32.376147 | 87 | 0.656277 |
3df1dc2d84ffc08534cc0b90bdd5c95b22ff164e | 13,482 | py | Python | env/env/lib/python3.6/site-packages/dominate/dom_tag.py | Aimee-pacy/NEWS | 2b8afa2af5e5fe5ce5e91c43bcbb7c518606a43f | [
"Unlicense"
] | null | null | null | env/env/lib/python3.6/site-packages/dominate/dom_tag.py | Aimee-pacy/NEWS | 2b8afa2af5e5fe5ce5e91c43bcbb7c518606a43f | [
"Unlicense"
] | null | null | null | env/env/lib/python3.6/site-packages/dominate/dom_tag.py | Aimee-pacy/NEWS | 2b8afa2af5e5fe5ce5e91c43bcbb7c518606a43f | [
"Unlicense"
] | null | null | null | __license__ = '''
This file is part of Dominate.
Dominate is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Dominate is distri... | 27.683778 | 86 | 0.624017 |
0db1e7c2da388460c11e0d76ac177ae888d444b7 | 445 | py | Python | Unlock Pattern/unlock.py | rajitbanerjee/kattis | 3a5dd4c84c07e21f09ef45ebd9c1bad2a0adc6ad | [
"CC0-1.0"
] | 2 | 2021-04-13T12:56:30.000Z | 2022-03-21T16:46:58.000Z | Unlock Pattern/unlock.py | rajitbanerjee/kattis | 3a5dd4c84c07e21f09ef45ebd9c1bad2a0adc6ad | [
"CC0-1.0"
] | null | null | null | Unlock Pattern/unlock.py | rajitbanerjee/kattis | 3a5dd4c84c07e21f09ef45ebd9c1bad2a0adc6ad | [
"CC0-1.0"
] | 1 | 2021-11-14T14:06:46.000Z | 2021-11-14T14:06:46.000Z | """https://open.kattis.com/problems/unlockpattern"""
matrix = [[0] * 3] * 3
points = {}
# compute the distance between two points
def dist(P, Q):
x1, y1 = P
x2, y2 = Q
return ((x1 - x2)**2 + (y1 - y2)**2)**0.5
for i in range(3):
matrix[i] = list(map(int, input().split()))
for j in range(3):
... | 19.347826 | 52 | 0.550562 |
e4620a45e117fc47b18e1d718fcd7a1a9e0a0dbc | 2,048 | py | Python | backend/products/models.py | crowdbotics-apps/royal-cloud-33498 | 4ac1701e6af7db4b3b7393b73fc0af80fc313b3b | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/products/models.py | crowdbotics-apps/royal-cloud-33498 | 4ac1701e6af7db4b3b7393b73fc0af80fc313b3b | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/products/models.py | crowdbotics-apps/royal-cloud-33498 | 4ac1701e6af7db4b3b7393b73fc0af80fc313b3b | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import models
from home.constants import PRODUCT_TYPE, SIZE_VARIANCE
from home.models import UUIDModel
from django.contrib.postgres.fields import ArrayField, JSONField
class Brand(UUIDModel):
"""
A data representation of the brands used by the Admin
"""
name = models.CharField(max_lengt... | 37.236364 | 101 | 0.654785 |
163c253cb88d76dac1eba0789e91effdfa4fc8ce | 2,443 | py | Python | tests/parsers/sqlite_plugins/mac_notificationcenter.py | roshanmaskey/plaso | 637856f578eb4bc81f62b97d7f483f69314e7f47 | [
"Apache-2.0"
] | 1,253 | 2015-01-02T13:58:02.000Z | 2022-03-31T08:43:39.000Z | tests/parsers/sqlite_plugins/mac_notificationcenter.py | roshanmaskey/plaso | 637856f578eb4bc81f62b97d7f483f69314e7f47 | [
"Apache-2.0"
] | 3,388 | 2015-01-02T11:17:58.000Z | 2022-03-30T10:21:45.000Z | tests/parsers/sqlite_plugins/mac_notificationcenter.py | roshanmaskey/plaso | 637856f578eb4bc81f62b97d7f483f69314e7f47 | [
"Apache-2.0"
] | 376 | 2015-01-20T07:04:54.000Z | 2022-03-04T23:53:00.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the MacOS Notification Center plugin."""
import unittest
from plaso.lib import definitions
from plaso.parsers.sqlite_plugins import mac_notificationcenter
from tests.parsers.sqlite_plugins import test_lib
class MacNotificationCenterTest(test_lib.SQLitePlu... | 35.405797 | 75 | 0.695047 |
3d3703414d7d286fc159fb1ec34e80da6f68528e | 43,981 | py | Python | p3/reinforcement/reinforcementTestClasses.py | patrickmcgrory/cs188 | e5c5995ad187e8edfaf5446dd40e84497461ae90 | [
"BSD-3-Clause"
] | 22 | 2016-03-31T23:04:51.000Z | 2021-11-06T08:45:56.000Z | p3/reinforcement/reinforcementTestClasses.py | naderm/cs188 | e5c5995ad187e8edfaf5446dd40e84497461ae90 | [
"BSD-3-Clause"
] | null | null | null | p3/reinforcement/reinforcementTestClasses.py | naderm/cs188 | e5c5995ad187e8edfaf5446dd40e84497461ae90 | [
"BSD-3-Clause"
] | 39 | 2015-04-12T12:07:06.000Z | 2021-12-01T21:55:04.000Z | # reinforcementTestClasses.py
# ---------------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, includin... | 47.49568 | 168 | 0.606512 |
7a0ed20b77169e7e734645c290a85fad606ed59d | 2,424 | py | Python | server/mahjong_portal/sitemap.py | Xelia/mahjong-portal | 1baa2eab57875a64a7f09537d1f43872b577f205 | [
"MIT"
] | null | null | null | server/mahjong_portal/sitemap.py | Xelia/mahjong-portal | 1baa2eab57875a64a7f09537d1f43872b577f205 | [
"MIT"
] | null | null | null | server/mahjong_portal/sitemap.py | Xelia/mahjong-portal | 1baa2eab57875a64a7f09537d1f43872b577f205 | [
"MIT"
] | null | null | null | from django.contrib.sitemaps import Sitemap
from django.urls import reverse
from club.models import Club
from player.models import Player
from rating.models import Rating
from tournament.models import Tournament
class BaseSitemap(Sitemap):
i18n = True
protocol = 'https'
priority = 1
class StaticSitemap... | 22.867925 | 94 | 0.673267 |
f94cdd78930b080aaba8b8b6616753c9bf0d3383 | 6,188 | py | Python | telerivet/scheduledmessage.py | Telerivet/telerivet-python-client | c98eb1ce038ca93b6229d964fdb21e921b59f835 | [
"MIT"
] | 7 | 2015-06-16T08:36:10.000Z | 2020-07-29T04:35:52.000Z | telerivet/scheduledmessage.py | Telerivet/telerivet-python-client | c98eb1ce038ca93b6229d964fdb21e921b59f835 | [
"MIT"
] | 5 | 2017-05-26T08:56:48.000Z | 2020-08-13T01:14:23.000Z | telerivet/scheduledmessage.py | Telerivet/telerivet-python-client | c98eb1ce038ca93b6229d964fdb21e921b59f835 | [
"MIT"
] | 10 | 2015-09-01T17:02:41.000Z | 2019-10-21T15:28:55.000Z |
from .entity import Entity
class ScheduledMessage(Entity):
"""
Represents a scheduled message within Telerivet.
Fields:
- id (string, max 34 characters)
* ID of the scheduled message
* Read-only
- content
* Text content of the scheduled message
... | 37.277108 | 108 | 0.577085 |
3199b4b95cb68f665ae235dca677913cce6ac21f | 1,226 | py | Python | consulting/views.py | redsolution/django-consulting | e651322140b017c84171aae23fc608119d31e674 | [
"Apache-2.0"
] | null | null | null | consulting/views.py | redsolution/django-consulting | e651322140b017c84171aae23fc608119d31e674 | [
"Apache-2.0"
] | null | null | null | consulting/views.py | redsolution/django-consulting | e651322140b017c84171aae23fc608119d31e674 | [
"Apache-2.0"
] | null | null | null | from consulting.forms import AskQuestionForm
from consulting.models import Topic, Question
from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.utils.translation import ugett... | 37.151515 | 86 | 0.754486 |
69d2cfe70d3f23301800233f2196d7280f3eea35 | 2,635 | py | Python | Widen/LC764_Largest_Plus_Sign.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | Widen/LC764_Largest_Plus_Sign.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | Widen/LC764_Largest_Plus_Sign.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | # 764. Largest Plus Sign
# In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given list mines which are 0. What is the largest axis-aligned plus sign of 1s contained in the grid? Return the order of the plus sign. If there is none, return 0.
# An "axis-aligned plus sign of 1s o... | 42.5 | 329 | 0.488425 |
57011bcc0e8243c3f6cbd53aef8a1341e0428142 | 1,962 | py | Python | app/rooms/forms.py | ShinJam/airbnb-clone | 5f79c6ff38d268e41e1b99ba1b1ccca65da746a3 | [
"MIT"
] | null | null | null | app/rooms/forms.py | ShinJam/airbnb-clone | 5f79c6ff38d268e41e1b99ba1b1ccca65da746a3 | [
"MIT"
] | 10 | 2020-03-03T16:15:51.000Z | 2022-02-10T09:25:15.000Z | app/rooms/forms.py | ShinJam/airbnb-clone | 5f79c6ff38d268e41e1b99ba1b1ccca65da746a3 | [
"MIT"
] | null | null | null | from django import forms
from django_countries.fields import CountryField
from . import models
class SearchForm(forms.Form):
city = forms.CharField(initial="Anywhere")
country = CountryField(default="KR").formfield()
room_type = forms.ModelChoiceField(
required=False, empty_label="Any kind", query... | 28.434783 | 86 | 0.601427 |
79f6d2f138e958c92dcc27a6541aebcbfeadf439 | 12,372 | py | Python | neutron/agent/metadata/driver.py | mcadariu/neutron | 35494af5a25efb8b314941ab85b44923654f6acc | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:31.000Z | 2018-07-04T07:59:31.000Z | neutron/agent/metadata/driver.py | ljzjohnson/neutron | d78664321482c15981a09642985a540195e754e3 | [
"Apache-2.0"
] | null | null | null | neutron/agent/metadata/driver.py | ljzjohnson/neutron | d78664321482c15981a09642985a540195e754e3 | [
"Apache-2.0"
] | 1 | 2018-08-28T17:13:16.000Z | 2018-08-28T17:13:16.000Z | # Copyright 2014 OpenStack Foundation.
# 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 req... | 37.377644 | 79 | 0.605884 |
26cfff07d0f1c4447af27da367c2b9466ddb5ed4 | 739 | py | Python | manimlib/utils/sounds.py | adornetejr/manim | e0715ceeff4778d11ef4ac31f8f8f2b56a2187ad | [
"MIT"
] | 48 | 2021-06-28T01:48:01.000Z | 2022-03-31T18:22:32.000Z | manimlib/utils/sounds.py | im-AMS/manim | 19e3c97589181ffd43ef14d9169af4e40e054664 | [
"MIT"
] | 5 | 2021-03-19T11:41:36.000Z | 2022-03-12T00:20:16.000Z | manimlib/utils/sounds.py | im-AMS/manim | 19e3c97589181ffd43ef14d9169af4e40e054664 | [
"MIT"
] | 19 | 2018-10-16T06:52:45.000Z | 2020-11-10T04:52:53.000Z | import os
from manimlib.utils.file_ops import seek_full_path_from_defaults
def play_chord(*nums):
commands = [
"play",
"-n",
"-c1",
"--no-show-progress",
"synth",
] + [
"sin %-" + str(num)
for num in nums
] + [
"fade h 0.5 1 0.5",
">"... | 18.475 | 64 | 0.541272 |
796e9344a41a754f05f5422fc5e895905ec93625 | 36,818 | py | Python | src/ploomber/sources/notebooksource.py | jramirez857/ploomber | 94751fb46d5f0e2c4658463601e08a49f55ba08c | [
"Apache-2.0"
] | null | null | null | src/ploomber/sources/notebooksource.py | jramirez857/ploomber | 94751fb46d5f0e2c4658463601e08a49f55ba08c | [
"Apache-2.0"
] | null | null | null | src/ploomber/sources/notebooksource.py | jramirez857/ploomber | 94751fb46d5f0e2c4658463601e08a49f55ba08c | [
"Apache-2.0"
] | null | null | null | """
On languages and kernels
------------------------
NotebookSource represents source code in a Jupyter notebook format (language
agnostic). Apart from .ipynb, we also support any other extension supported
by jupytext.
Given a notebook, we have to know which language it is written in to extract
upstream/product varia... | 34.538462 | 148 | 0.621299 |
bcba1b93f832006a0bb27f87943c57447ea11e48 | 37,263 | py | Python | google/cloud/video/transcoder_v1beta1/services/transcoder_service/client.py | renovate-bot/python-video-transcoder | 845f1e371cc45040c882b725e12375430260e45a | [
"Apache-2.0"
] | null | null | null | google/cloud/video/transcoder_v1beta1/services/transcoder_service/client.py | renovate-bot/python-video-transcoder | 845f1e371cc45040c882b725e12375430260e45a | [
"Apache-2.0"
] | null | null | null | google/cloud/video/transcoder_v1beta1/services/transcoder_service/client.py | renovate-bot/python-video-transcoder | 845f1e371cc45040c882b725e12375430260e45a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 41.58817 | 106 | 0.614792 |
09c9a46ae0155009031f3c4351b6bb5044d39701 | 3,452 | py | Python | ConSSL/datamodules/fashion_mnist_datamodule.py | SNUHDR2018/ConSSL | c7d406d0224e38895986c8fb7281a189e493c982 | [
"MIT"
] | 78 | 2021-02-02T10:15:44.000Z | 2022-03-27T08:51:46.000Z | ConSSL/datamodules/fashion_mnist_datamodule.py | SNUHDR2018/ConSSL | c7d406d0224e38895986c8fb7281a189e493c982 | [
"MIT"
] | 1 | 2021-01-15T10:21:42.000Z | 2021-01-26T22:41:58.000Z | ConSSL/datamodules/fashion_mnist_datamodule.py | SNUHDR2018/ConSSL | c7d406d0224e38895986c8fb7281a189e493c982 | [
"MIT"
] | 52 | 2021-06-10T00:23:43.000Z | 2021-09-19T10:13:11.000Z | from typing import Any, Callable, Optional, Union
from ConSSL.datamodules.vision_datamodule import VisionDataModule
from ConSSL.utils import _TORCHVISION_AVAILABLE
from ConSSL.utils.warnings import warn_missing_pkg
if _TORCHVISION_AVAILABLE:
from torchvision import transforms as transform_lib
from torchvision... | 31.381818 | 108 | 0.608343 |
162be5a54099ca0ba400683916426caa96229ca3 | 9,693 | py | Python | docs/source/conf.py | ManuelMBaumann/pymor | 9ad226a0a46c7ba30a18bdab27b8bbbfe8f83a31 | [
"Unlicense"
] | null | null | null | docs/source/conf.py | ManuelMBaumann/pymor | 9ad226a0a46c7ba30a18bdab27b8bbbfe8f83a31 | [
"Unlicense"
] | null | null | null | docs/source/conf.py | ManuelMBaumann/pymor | 9ad226a0a46c7ba30a18bdab27b8bbbfe8f83a31 | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2019 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import sys, os, re
os.environ['PYMOR_WITH_SPHINX'] = '1'
# Fix documentation generation for read... | 32.41806 | 112 | 0.603631 |
d111663d5244f499e04005e1ac789ccbda5848a3 | 1,105 | py | Python | day-07/part-1/youyoun.py | evqna/adventofcode-2020 | 526bb9c87057d02bda4de9647932a0e25bdb3a5b | [
"MIT"
] | 12 | 2020-11-30T19:22:18.000Z | 2021-06-21T05:55:58.000Z | day-07/part-1/youyoun.py | evqna/adventofcode-2020 | 526bb9c87057d02bda4de9647932a0e25bdb3a5b | [
"MIT"
] | 13 | 2020-11-30T17:27:22.000Z | 2020-12-22T17:43:13.000Z | day-07/part-1/youyoun.py | evqna/adventofcode-2020 | 526bb9c87057d02bda4de9647932a0e25bdb3a5b | [
"MIT"
] | 3 | 2020-12-01T08:49:40.000Z | 2022-03-26T21:47:38.000Z | from tool.runners.python import SubmissionPy
class YouyounSubmission(SubmissionPy):
def run(self, s):
"""
:param s: input in string format
:return: solution flag
"""
lines = s.splitlines()
contains_sg = set()
bags = {}
for l in lines:
co... | 31.571429 | 112 | 0.489593 |
70acbfbf1eb1da7eb33dedc8f637d79cf8525a38 | 18,330 | py | Python | src/lamplib/src/genny/tasks/auto_tasks.py | MikhailShchatko/genny | 00938dc557ef1ad9b6b2d950447bc0e372e951ef | [
"Apache-2.0"
] | 30 | 2019-01-30T17:21:44.000Z | 2022-01-21T00:05:33.000Z | src/lamplib/src/genny/tasks/auto_tasks.py | MikhailShchatko/genny | 00938dc557ef1ad9b6b2d950447bc0e372e951ef | [
"Apache-2.0"
] | 358 | 2019-01-15T21:51:57.000Z | 2022-03-30T16:10:42.000Z | src/lamplib/src/genny/tasks/auto_tasks.py | MikhailShchatko/genny | 00938dc557ef1ad9b6b2d950447bc0e372e951ef | [
"Apache-2.0"
] | 50 | 2019-01-15T20:01:15.000Z | 2022-03-24T16:19:52.000Z | """
Generates evergreen tasks based on the current state of the repo.
"""
import enum
import glob
import os
import re
from typing import NamedTuple, List, Optional, Set
import yaml
import structlog
from shrub.command import CommandDefinition
from shrub.config import Configuration
from shrub.variant import TaskSpec
f... | 36.082677 | 119 | 0.600709 |
b7121a82b75d8389ab7d6d49f9fa28d39854fb66 | 1,167 | py | Python | ecc/tasks/pohlig-hellman/gen_task.py | kabachook/ecc | 40cfe20bf27bf9f1b7c8e05bfbdbef73e00e2ba6 | [
"MIT"
] | 8 | 2020-01-10T02:44:41.000Z | 2021-12-19T17:29:10.000Z | ecc/tasks/pohlig-hellman/gen_task.py | kabachook/ecc | 40cfe20bf27bf9f1b7c8e05bfbdbef73e00e2ba6 | [
"MIT"
] | null | null | null | ecc/tasks/pohlig-hellman/gen_task.py | kabachook/ecc | 40cfe20bf27bf9f1b7c8e05bfbdbef73e00e2ba6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from argparse import ArgumentParser
import sys
from sage.all import *
parser = ArgumentParser("Generate task on Pohlig-Hellman algo")
parser.add_argument("--p-start", type=int, default=2**128, help="min(p)")
parser.add_argument("--p-stop", type=int, default=2**256, help="max(p)")
if __name__ =... | 27.785714 | 77 | 0.563839 |
8dec13af8042fbd7a297b5ae1656030421a41f8a | 10,164 | py | Python | hw/ip/otbn/dv/otbnsim/sim/wsr.py | GregAC/opentitan | 40b607b776d7b10cfc2899cc0d724d00dc0c91a2 | [
"Apache-2.0"
] | 2 | 2019-11-21T14:05:14.000Z | 2020-07-10T12:40:54.000Z | hw/ip/otbn/dv/otbnsim/sim/wsr.py | GregAC/opentitan | 40b607b776d7b10cfc2899cc0d724d00dc0c91a2 | [
"Apache-2.0"
] | null | null | null | hw/ip/otbn/dv/otbnsim/sim/wsr.py | GregAC/opentitan | 40b607b776d7b10cfc2899cc0d724d00dc0c91a2 | [
"Apache-2.0"
] | null | null | null | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from typing import List, Optional, Sequence
from .trace import Trace
from .ext_regs import TraceExtRegChange, ExtRegChange
class TraceWSR(Trace):
def __init__(self,... | 32.681672 | 100 | 0.585596 |
7912a66cb25fd4c55ec625c8b315217f793ecdd8 | 5,618 | py | Python | saleor/graphql/order/schema.py | 0xfab-ri/saleor | 99f262bcce67fb0b66c2717bcb1a17d56bc69252 | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/order/schema.py | 0xfab-ri/saleor | 99f262bcce67fb0b66c2717bcb1a17d56bc69252 | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/order/schema.py | 0xfab-ri/saleor | 99f262bcce67fb0b66c2717bcb1a17d56bc69252 | [
"CC-BY-4.0"
] | null | null | null | import graphene
from graphql_jwt.decorators import login_required
from ..core.enums import ReportingPeriod
from ..core.fields import FilterInputConnectionField, PrefetchingConnectionField
from ..core.types import FilterInputObjectType, TaxedMoney
from ..decorators import permission_required
from ..descriptions import ... | 35.333333 | 88 | 0.736027 |
ea7b1e9b9c8a84dce442167fcab0afcfbce82d4c | 248 | py | Python | 7/confirmed_users.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | 7/confirmed_users.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | 7/confirmed_users.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | # coding:utf-8
unconfirmed_users = ['liuhanyu', 'luoliuzhou', 'wangyue', 'xiaolizi']
confirmed_users = []
while unconfirmed_users:
user = unconfirmed_users.pop()
confirmed_users.append(user)
print(confirmed_users)
print(unconfirmed_users) | 24.8 | 69 | 0.758065 |
130b68cda8930df59bd73fd45249d1973a85e2f7 | 1,557 | py | Python | examples/AdAccountCampaignsPostMAIA.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | null | null | null | examples/AdAccountCampaignsPostMAIA.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | null | null | null | examples/AdAccountCampaignsPostMAIA.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | 1 | 2018-09-24T14:04:48.000Z | 2018-09-24T14:04:48.000Z | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 37.97561 | 76 | 0.776493 |
9d6cbbe73d9518a1f4480a99b1d5a8324cf74ed5 | 8,956 | py | Python | chia/server/start_service.py | 13thProgression/gold-blockchain | 2a1b19ed9d088315fd717b9b521e21f229522c4b | [
"Apache-2.0"
] | 3 | 2022-02-10T09:42:06.000Z | 2022-03-09T16:39:22.000Z | chia/server/start_service.py | lahyunLee/gold-blockchain | b9f90babeb58c3c0fa384153ca01ae973e19cffd | [
"Apache-2.0"
] | null | null | null | chia/server/start_service.py | lahyunLee/gold-blockchain | b9f90babeb58c3c0fa384153ca01ae973e19cffd | [
"Apache-2.0"
] | 2 | 2022-03-16T14:22:56.000Z | 2022-03-19T11:11:31.000Z | import asyncio
import logging
import logging.config
import os
import signal
from sys import platform
from typing import Any, Callable, List, Optional, Tuple
from chia.daemon.server import service_launch_lock_path, singleton
from chia.server.ssl_context import chia_ssl_ca_paths, private_ssl_ca_paths
try:
import uv... | 35.121569 | 115 | 0.634435 |
e41380b40db25696cf8665919c8c420a7c91dd32 | 857 | py | Python | pokebattle/urls.py | pamella/pokebattle | a90b27d87b12dd079356ad4b5a15a196004e1c5e | [
"MIT"
] | 2 | 2019-02-27T16:11:11.000Z | 2019-12-10T14:01:18.000Z | pokebattle/urls.py | pamella/pokebattle | a90b27d87b12dd079356ad4b5a15a196004e1c5e | [
"MIT"
] | 14 | 2019-02-21T14:36:22.000Z | 2022-02-26T09:49:44.000Z | pokebattle/urls.py | pamella/pokebattle | a90b27d87b12dd079356ad4b5a15a196004e1c5e | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls import include, url # noqa
from django.contrib import admin
from django.views.generic import TemplateView
import django_js_reverse.views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^jsreverse/$', django_js_reverse.views.urls_js, name='js_rev... | 30.607143 | 77 | 0.693116 |
0d01cdf06a2d22089ca250d607cb7b49c0f7501c | 1,465 | py | Python | common/ClusterFactorLinearThetaEffect.py | keccaksasca/keccaksasca | ca83ae2add1e47b14576ffcbe1462bc2f099acf8 | [
"CC0-1.0"
] | 4 | 2020-12-15T17:59:04.000Z | 2022-02-25T02:19:19.000Z | common/ClusterFactorLinearThetaEffect.py | keccaksasca/keccaksasca | ca83ae2add1e47b14576ffcbe1462bc2f099acf8 | [
"CC0-1.0"
] | null | null | null | common/ClusterFactorLinearThetaEffect.py | keccaksasca/keccaksasca | ca83ae2add1e47b14576ffcbe1462bc2f099acf8 | [
"CC0-1.0"
] | null | null | null |
from Node import Node
from ClusterFactorLinear import ClusterFactorLinear
import numpy as np
import settings
# linear factor --> everything that can be written using just XORs (such as theta, parity, etc)
# this variant --> all messages are aligned! --> can be used for computing parity and for theta, but not for thet... | 39.594595 | 137 | 0.655973 |
a7a492f930070524e05488f5f53289199c86268b | 32,571 | py | Python | arelle/plugin/validateUSBestPractices.py | GuoHuiChen/Arelle | 76b3c720e55348fd91b7be091040d2207f85400c | [
"Apache-2.0"
] | 1 | 2018-07-18T04:56:38.000Z | 2018-07-18T04:56:38.000Z | arelle/plugin/validateUSBestPractices.py | GuoHuiChen/Arelle | 76b3c720e55348fd91b7be091040d2207f85400c | [
"Apache-2.0"
] | null | null | null | arelle/plugin/validateUSBestPractices.py | GuoHuiChen/Arelle | 76b3c720e55348fd91b7be091040d2207f85400c | [
"Apache-2.0"
] | null | null | null | from arelle import PluginManager
from arelle.ModelValue import qname
from arelle import Locale, ModelXbrl, XbrlConst
from arelle.FileSource import openFileSource, openFileStream, saveFile
import os, io, re, json, time
from collections import defaultdict
# ((year, ugtNamespace, ugtDocLB, ugtEntryPoint) ...)
ugtDocs = (... | 67.715177 | 186 | 0.579043 |
73dfc8490d8d226f4c34c153850134435cabb10f | 9,391 | py | Python | atari/visualize_reward.py | yilin-wang/tril | fb3f1090d2056c063602c65d8b7d952ea5037872 | [
"MIT"
] | 1 | 2021-10-17T07:00:05.000Z | 2021-10-17T07:00:05.000Z | atari/visualize_reward.py | yilin-wang/tril | fb3f1090d2056c063602c65d8b7d952ea5037872 | [
"MIT"
] | null | null | null | atari/visualize_reward.py | yilin-wang/tril | fb3f1090d2056c063602c65d8b7d952ea5037872 | [
"MIT"
] | null | null | null | import pickle
import gym
import time
import numpy as np
import random
import torch
from run_test import *
import matplotlib.pylab as plt
import argparse
import pickle
parser = argparse.ArgumentParser(description=None)
parser.add_argument('--env_name', default='', help='Select the environment name to run, i.e. pong')
p... | 31.096026 | 117 | 0.659781 |
fd5d9e5a72bb7dbe7f373de6bde73eae88bd6049 | 13,016 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/manageiq/manageiq_alerts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/manageiq/manageiq_alerts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/manageiq/manageiq_alerts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat Inc.
# 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',
... | 37.402299 | 112 | 0.58213 |
b17675be01dd58a00c19b4527ce1dce7c316954a | 3,191 | py | Python | django_pages/comments/__init__.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 3 | 2015-11-24T02:30:48.000Z | 2018-11-01T10:10:24.000Z | django_pages/comments/__init__.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 1 | 2015-04-18T16:37:36.000Z | 2015-04-18T16:37:36.000Z | django_pages/comments/__init__.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 2 | 2015-11-24T02:01:00.000Z | 2019-04-09T15:33:56.000Z | # -*- encoding: utf-8 -*-
import random
from django.utils.html import strip_tags
from .forms import CommentForm
from .models import Comment
def get_client_ip(request):
"""
Returns requester's IP address from HTTP request
@param request: Http Request
@return string
"""
x_forwarded_for = req... | 25.943089 | 91 | 0.619242 |
3d13d9ddea6586cb96e196b825316507eb8539e2 | 2,397 | py | Python | django/codentino/apps/user/models.py | kutver/codentino | 526ce722ad198764b4e7fc5032f1690d59197d03 | [
"MIT"
] | null | null | null | django/codentino/apps/user/models.py | kutver/codentino | 526ce722ad198764b4e7fc5032f1690d59197d03 | [
"MIT"
] | null | null | null | django/codentino/apps/user/models.py | kutver/codentino | 526ce722ad198764b4e7fc5032f1690d59197d03 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser, BaseUserManager
from django.contrib.auth.validators import UnicodeUsernameValidator
from django.db import models
from django.utils.translation import gettext_lazy as _
class UserManager(BaseUserManager):
"""Define a model manager for User model."""
use_in_... | 37.453125 | 94 | 0.67501 |
2e1d21ab9e4497ebdcff0e81e90c9c61ec175875 | 732 | py | Python | src/pyglue/DocStrings/ProcessorMetadata.py | omenos/OpenColorIO | 7316c3be20752278924dd3f213bff297ffb63a14 | [
"BSD-3-Clause"
] | 7 | 2015-07-01T03:19:43.000Z | 2021-03-27T11:02:16.000Z | src/pyglue/DocStrings/ProcessorMetadata.py | dictoon/OpenColorIO | 64adcad300adfd166280d2e7b1fb5c3ce7dca482 | [
"BSD-3-Clause"
] | null | null | null | src/pyglue/DocStrings/ProcessorMetadata.py | dictoon/OpenColorIO | 64adcad300adfd166280d2e7b1fb5c3ce7dca482 | [
"BSD-3-Clause"
] | 2 | 2019-03-05T20:43:59.000Z | 2019-11-11T20:35:55.000Z |
class ProcessorMetadata:
"""
ProcessorMetadata
This contains meta information about the process that generated
this processor. The results of these functions do not
impact the pixel processing.
"""
def __init__(self):
pass
def getFiles(self):
"""
... | 20.914286 | 75 | 0.546448 |
1bcfcaf0e4c8dd55074537796a466709bbd69f2f | 1,032 | py | Python | models/base_lstm.py | Remper/emojinet | c219392d6bce63fe2a0844d0c5bda3b0d48a16c6 | [
"Apache-2.0"
] | null | null | null | models/base_lstm.py | Remper/emojinet | c219392d6bce63fe2a0844d0c5bda3b0d48a16c6 | [
"Apache-2.0"
] | null | null | null | models/base_lstm.py | Remper/emojinet | c219392d6bce63fe2a0844d0c5bda3b0d48a16c6 | [
"Apache-2.0"
] | 1 | 2020-06-21T08:02:28.000Z | 2020-06-21T08:02:28.000Z | from keras import Model
from keras.models import Sequential
from keras.layers import Dense, Dropout, Embedding, Bidirectional, LSTM, regularizers
import numpy as np
from keras.optimizers import Adam
def base_lstm(vocabulary_size: int, embedding_size: int, max_seq_length: int, embedding_matrix: np.array, y_dictionary:... | 41.28 | 135 | 0.657946 |
1e3a4f1c4e7a0d03bb2b1987e4f576b8bf5e1152 | 6,013 | py | Python | userbot/utils/tools.py | ashwinstr/RemixGeng | cb5d2f1ffc6417134fe4eb51c33ca2f46e501d2d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/utils/tools.py | ashwinstr/RemixGeng | cb5d2f1ffc6417134fe4eb51c33ca2f46e501d2d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/utils/tools.py | ashwinstr/RemixGeng | cb5d2f1ffc6417134fe4eb51c33ca2f46e501d2d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2020 Adek Maulana
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
import asyncio
import hashlib
import os.path
import re
import shlex
from os.path import basename
from typing import Optional
from typing... | 31.647368 | 83 | 0.573923 |
0a746f4df5a943b5a173f2ddd546c567e6da0415 | 715 | py | Python | final_project/server.py | PhideasAmbrosianus/xzceb-flask_eng_fr | 00020eabd7961efb0ed788d83b7f55613db66149 | [
"Apache-2.0"
] | null | null | null | final_project/server.py | PhideasAmbrosianus/xzceb-flask_eng_fr | 00020eabd7961efb0ed788d83b7f55613db66149 | [
"Apache-2.0"
] | null | null | null | final_project/server.py | PhideasAmbrosianus/xzceb-flask_eng_fr | 00020eabd7961efb0ed788d83b7f55613db66149 | [
"Apache-2.0"
] | null | null | null | from machinetranslation import translator
from flask import Flask, render_template, request
import json
import machinetranslation as mt
app = Flask("Web Translator")
@app.route("/englishToFrench")
def englishToFrench():
textToTranslate = request.args.get('textToTranslate')
translated_text = mt.english_to_fren... | 27.5 | 59 | 0.762238 |
d0a32e749dcae3e12bbf56f49cb8896aaa10e69e | 143 | py | Python | src/sage/dynamics/cellular_automata/all.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | 1 | 2016-11-04T16:31:48.000Z | 2016-11-04T16:31:48.000Z | src/sage/dynamics/cellular_automata/all.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | src/sage/dynamics/cellular_automata/all.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | from sage.misc.lazy_import import lazy_import
lazy_import("sage.dynamics.cellular_automata.solitons",
["SolitonCellularAutomata"])
| 35.75 | 55 | 0.776224 |
640b79c7b5556aaf8fa91e392eef26e050fb5f25 | 2,286 | py | Python | networking_odl/common/client.py | rgonc/networking-odl | a58af1f67c05b11feb983f44e1de5e0160336bc4 | [
"Apache-2.0"
] | null | null | null | networking_odl/common/client.py | rgonc/networking-odl | a58af1f67c05b11feb983f44e1de5e0160336bc4 | [
"Apache-2.0"
] | null | null | null | networking_odl/common/client.py | rgonc/networking-odl | a58af1f67c05b11feb983f44e1de5e0160336bc4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Red Hat Inc.
# 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... | 35.71875 | 78 | 0.630796 |
b2276035c62cbf957db01a258cf0721dd4321329 | 3,013 | py | Python | sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 38.628205 | 103 | 0.608032 |
ed6dcf96ba82757af12bd4a4c3b4609449f0d796 | 764 | py | Python | src/main.py | SamadiPour/iran-ips | f28d58726395f12edeb254703f87d1a69d84a5d0 | [
"MIT"
] | 33 | 2021-12-05T20:05:21.000Z | 2022-03-24T01:24:36.000Z | src/main.py | SamadiPour/iran-ips | f28d58726395f12edeb254703f87d1a69d84a5d0 | [
"MIT"
] | null | null | null | src/main.py | SamadiPour/iran-ips | f28d58726395f12edeb254703f87d1a69d84a5d0 | [
"MIT"
] | 3 | 2021-12-05T20:10:15.000Z | 2021-12-10T10:35:24.000Z | import ipaddress
import os
from functools import reduce
import create_config
import utils
from get_ips import *
def collect_and_clean(*list_of_ips: Iterable[Iterable[str]]) -> Iterable[ipaddress.IPv4Network]:
ip_set = reduce(lambda x, y: set(x).union(set(y)), list_of_ips)
ip_set = map(utils.convert_to_ip_net... | 25.466667 | 96 | 0.708115 |
64e79c31c202c1e6b137480f9e2fe5796abdcc39 | 1,775 | py | Python | EL/el_agent.py | shibukazu/baby-steps-of-rl-ja | 8cfe51be61473f47d384abcff1e36467da2713f1 | [
"Apache-2.0"
] | null | null | null | EL/el_agent.py | shibukazu/baby-steps-of-rl-ja | 8cfe51be61473f47d384abcff1e36467da2713f1 | [
"Apache-2.0"
] | null | null | null | EL/el_agent.py | shibukazu/baby-steps-of-rl-ja | 8cfe51be61473f47d384abcff1e36467da2713f1 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
class ELAgent():
def __init__(self, epsilon):
self.Q = {}
self.epsilon = epsilon
self.reward_log = []
def policy(self, s, actions):
# Q関数に対するepsilon-greedyで行動する(ような方策とする)
if np.random.random() < self.epsilon:
... | 32.87037 | 74 | 0.512676 |
48ba434195118b18e6cbe4506522c7cc03ccb758 | 10,636 | py | Python | src/finn/custom_op/fpgadataflow/templates.py | daiki98/finn | a68335384c0a8f0a1126714cbad1aa22a3e50e09 | [
"BSD-3-Clause"
] | 1 | 2021-03-12T17:20:09.000Z | 2021-03-12T17:20:09.000Z | src/finn/custom_op/fpgadataflow/templates.py | surangamh/finn | af783db8dc2a1d2e95bd569d39464b935520b6d2 | [
"BSD-3-Clause"
] | null | null | null | src/finn/custom_op/fpgadataflow/templates.py | surangamh/finn | af783db8dc2a1d2e95bd569d39464b935520b6d2 | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa
# Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions... | 25.878345 | 124 | 0.733734 |
33070d014423f921f38d097860ae6a6bd735a7b7 | 13,669 | py | Python | Code/instr_tester/controlhandler.py | DaveSeidel/QB_Nebulae_V2 | 4a0218bb6a05e835e74b126729a1c3cd221fc9b5 | [
"MIT"
] | 40 | 2019-12-30T03:44:36.000Z | 2022-02-07T23:09:42.000Z | Code/instr_tester/controlhandler.py | DaveSeidel/QB_Nebulae_V2 | 4a0218bb6a05e835e74b126729a1c3cd221fc9b5 | [
"MIT"
] | 11 | 2020-03-08T10:22:57.000Z | 2022-03-22T21:18:32.000Z | Code/instr_tester/controlhandler.py | DaveSeidel/QB_Nebulae_V2 | 4a0218bb6a05e835e74b126729a1c3cd221fc9b5 | [
"MIT"
] | 23 | 2020-01-20T11:12:20.000Z | 2022-03-02T20:39:09.000Z | # Import SPI library (for hardware SPI) and MCP3008 library.
#import Adafruit_#GPIO.SPI as SPI
#import RPi.#GPIO as #GPIO
import ctcsound
#import switch as libSwitch
#import shiftregister as libSR
import control
import os
#import settings
import time
#import Adafruit_MCP3008
# Defines for Button/Gate Types
BUTTON_GATE... | 43.951768 | 247 | 0.593021 |
a7f845d53334fcd92c9200ae7221830eb2f82e3c | 5,157 | py | Python | spillway/serializers.py | timgates42/django-spillway | f5700e21e545106005a99ba0804f7d6c88038553 | [
"BSD-3-Clause"
] | 62 | 2015-01-20T22:21:09.000Z | 2019-11-25T12:57:53.000Z | spillway/serializers.py | timgates42/django-spillway | f5700e21e545106005a99ba0804f7d6c88038553 | [
"BSD-3-Clause"
] | 24 | 2015-01-07T00:03:10.000Z | 2021-06-10T17:34:35.000Z | spillway/serializers.py | timgates42/django-spillway | f5700e21e545106005a99ba0804f7d6c88038553 | [
"BSD-3-Clause"
] | 19 | 2015-01-12T18:08:29.000Z | 2020-08-10T17:16:31.000Z | from django.core import exceptions
from django.contrib.gis import geos
from django.contrib.gis.db import models
from django.db.models.fields.files import FieldFile
from rest_framework import serializers
from greenwich.srs import SpatialReference
from spillway import query, collections as sc
from spillway.fields import... | 37.369565 | 78 | 0.647469 |
8de4e2b794176df49179fbc9a4b9e10d48c93dfd | 3,097 | py | Python | haruhi_dl/extractor/tube8.py | haruhi-dl/haruhi-dl | 0526e2add4c263209cad55347efa9a2dfe6c3fa6 | [
"Unlicense"
] | 32 | 2021-01-18T03:52:17.000Z | 2022-02-17T20:43:39.000Z | haruhi_dl/extractor/tube8.py | haruhi-dl/haruhi-dl | 0526e2add4c263209cad55347efa9a2dfe6c3fa6 | [
"Unlicense"
] | 12 | 2021-02-06T08:12:08.000Z | 2021-12-11T23:17:41.000Z | haruhi_dl/extractor/tube8.py | haruhi-dl/haruhi-dl | 0526e2add4c263209cad55347efa9a2dfe6c3fa6 | [
"Unlicense"
] | 6 | 2021-01-29T16:46:31.000Z | 2022-01-20T18:40:03.000Z | from __future__ import unicode_literals
import re
from ..utils import (
int_or_none,
str_to_int,
)
from .keezmovies import KeezMoviesIE
class Tube8IE(KeezMoviesIE):
_VALID_URL = r'https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.tube8... | 35.597701 | 137 | 0.529545 |
d39331e00ce9036e4ee6fe64d3122b6d03e25f01 | 10,543 | py | Python | src/train.py | YuliangXiu/pytorch_pose_proposal_networks | 73bed82ba221c698d63f50cc235d18c5d082170c | [
"MIT"
] | 102 | 2019-02-15T11:40:59.000Z | 2022-01-19T10:48:31.000Z | src/train.py | zoombapup/pytorch_pose_proposal_networks | 73bed82ba221c698d63f50cc235d18c5d082170c | [
"MIT"
] | 11 | 2019-02-15T14:25:17.000Z | 2021-02-21T03:54:33.000Z | src/train.py | zoombapup/pytorch_pose_proposal_networks | 73bed82ba221c698d63f50cc235d18c5d082170c | [
"MIT"
] | 22 | 2019-02-19T07:11:17.000Z | 2021-10-03T03:54:00.000Z | import os
import cv2
from tensorboardX import SummaryWriter
import torch.optim as optim
import torch.utils.data
from src.utils import *
import src.config as cfg
from src.dataset.mpi import MPI
from src.model.model import which_model
train_dset = MPI(cfg.IMG_DIR, cfg.ANNOTATION_PATH, is_train=True)
train_loader = tor... | 42.341365 | 106 | 0.525752 |
5dcdba0f5189202d266aa6e919920e0e75b7309c | 3,222 | py | Python | datasets/Part 3 - Classification/Section 17 - Kernel SVM/my_kernel_svm.py | nylvam/machinelearning-az | 2ff139082b61ace5a94ef86517c84febee3b7ecb | [
"MIT"
] | null | null | null | datasets/Part 3 - Classification/Section 17 - Kernel SVM/my_kernel_svm.py | nylvam/machinelearning-az | 2ff139082b61ace5a94ef86517c84febee3b7ecb | [
"MIT"
] | null | null | null | datasets/Part 3 - Classification/Section 17 - Kernel SVM/my_kernel_svm.py | nylvam/machinelearning-az | 2ff139082b61ace5a94ef86517c84febee3b7ecb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 24 18:56:54 2020
@author: ramonpuga
"""
# Kernel SVM
# Importar las librerias
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importar el dataset
dataset = pd.read_csv('Social_Network_Ads.csv')
# Matriz X con todas las f... | 37.905882 | 105 | 0.687772 |
777baa03dfbf487772a03c781d797aa83f082913 | 3,781 | py | Python | scripts/gen_tree_json.py | pennykamp/bonsai | c7066b7dca3f29e5f944ffb14337b519191972c6 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 25 | 2019-04-05T21:18:16.000Z | 2021-09-03T04:55:19.000Z | scripts/gen_tree_json.py | pennykamp/bonsai | c7066b7dca3f29e5f944ffb14337b519191972c6 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2020-07-03T07:42:09.000Z | 2021-11-19T15:41:11.000Z | scripts/gen_tree_json.py | pennykamp/bonsai | c7066b7dca3f29e5f944ffb14337b519191972c6 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5 | 2019-09-09T01:19:22.000Z | 2021-06-28T19:49:59.000Z | import json
import numpy as np
import networkx as nx
def parse_model(tree_path, bonsai_format=True):
"""return a tree in networkx.DiGraph"""
READ_IS_LEAF = 'is_leaf'
READ_CHILDREN = 'children'
READ_DEPTH = 'depth'
READ_LABELS = 'labels'
READ_FEATURE_DIM = 'feature_dim'
READ_FEATURE_COL = '... | 35.009259 | 87 | 0.526316 |
025834705b31d16cd9d5b40f9d6fae156d884153 | 1,827 | py | Python | generator/setup.py | romulobusatto/google-api-php-client-services | 7f3d938a1e4b364afa633b5ba13a0d3c9bc156bf | [
"Apache-2.0"
] | 709 | 2018-09-13T01:13:59.000Z | 2022-03-31T10:28:41.000Z | generator/setup.py | romulobusatto/google-api-php-client-services | 7f3d938a1e4b364afa633b5ba13a0d3c9bc156bf | [
"Apache-2.0"
] | 188 | 2018-09-14T23:14:15.000Z | 2022-03-29T22:02:40.000Z | generator/setup.py | romulobusatto/google-api-php-client-services | 7f3d938a1e4b364afa633b5ba13a0d3c9bc156bf | [
"Apache-2.0"
] | 194 | 2016-04-16T22:29:22.000Z | 2018-09-03T07:31:55.000Z | #!/usr/bin/python2.7
# Copyright 2010 Google Inc. 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 requi... | 38.0625 | 77 | 0.681445 |
e556e85cb69c29428776c4ffdbac9c3dd1277c23 | 1,435 | py | Python | kfusiontables/kft/utils/check.py | kula1922/kfusiontables | 149ddaddb95319a237bb94525db17b1b3a5ac66f | [
"BSD-3-Clause"
] | 4 | 2016-04-10T10:27:36.000Z | 2018-10-12T13:45:25.000Z | kfusiontables/kft/utils/check.py | kula1922/kfusiontables | 149ddaddb95319a237bb94525db17b1b3a5ac66f | [
"BSD-3-Clause"
] | 2 | 2020-06-05T17:30:32.000Z | 2021-06-01T21:52:49.000Z | kfusiontables/kft/utils/check.py | kula1922/kfusiontables | 149ddaddb95319a237bb94525db17b1b3a5ac66f | [
"BSD-3-Clause"
] | null | null | null | from kfusiontables.kft.exceptions import (
IncorrectParametersNumberException
)
from kfusiontables.models import TableMap
from kfusiontables.kft.utils.convert import (
get_model_from_table_name,
get_model_from_table_id
)
def _fusiontable_table_exist(sender):
"""
Check from sender if fusiontables t... | 26.574074 | 73 | 0.64669 |
92d0b604b0363b3b3c6bb6ad93cd1f56f0ee7504 | 15,460 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_profile_http_compression.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_profile_http_compression.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_profile_http_compression.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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
DOCUMENTATION = r'''
---
module: bigip_profile_http_comp... | 28.682746 | 94 | 0.596119 |
760224087599bfbd0355f9ce4a0a92928490e136 | 3,693 | py | Python | autotest/alg/reproject.py | dtusk/gdal1 | 30dcdc1eccbca2331674f6421f1c5013807da609 | [
"MIT"
] | 3 | 2017-01-12T10:18:56.000Z | 2020-03-21T16:42:55.000Z | autotest/alg/reproject.py | ShinNoNoir/gdal-1.11.5-vs2015 | 5d544e176a4c11f9bcd12a0fe66f97fd157824e6 | [
"MIT"
] | null | null | null | autotest/alg/reproject.py | ShinNoNoir/gdal-1.11.5-vs2015 | 5d544e176a4c11f9bcd12a0fe66f97fd157824e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test ReprojectImage() algorithm.
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
#########################################################... | 29.544 | 110 | 0.619551 |
96b7daeb9dc5c1cf30b724d6aed61ded3b57c196 | 327 | py | Python | models.py | newnativeabq/airquality-dash | 3108887a8195e0c473ba2194ff012637ba8ce1de | [
"MIT"
] | null | null | null | models.py | newnativeabq/airquality-dash | 3108887a8195e0c473ba2194ff012637ba8ce1de | [
"MIT"
] | null | null | null | models.py | newnativeabq/airquality-dash | 3108887a8195e0c473ba2194ff012637ba8ce1de | [
"MIT"
] | null | null | null | """SQLAlchemy models for TwitOff"""
from flask_sqlalchemy import SQLAlchemy
DB = SQLAlchemy()
class Record(DB.Model):
id = DB.Column(DB.Integer, primary_key=True)
datetime = DB.Column(DB.String(25))
value = DB.Column(DB.Float, nullable=False)
def __repr__(self):
return '<Record {}'.format(se... | 23.357143 | 48 | 0.685015 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.