hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f733a7e1c1424f0decd52a9fc3f662cc5c5d53e3 | 896 | py | Python | python/hash_table/1200_minimum_absolute_difference.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 6 | 2019-07-15T13:23:57.000Z | 2020-01-22T03:12:01.000Z | python/hash_table/1200_minimum_absolute_difference.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | null | null | null | python/hash_table/1200_minimum_absolute_difference.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 1 | 2019-07-24T02:15:31.000Z | 2019-07-24T02:15:31.000Z | class Solution(object):
def minimumAbsDifference(self, arr):
"""
:type arr: List[int]
:rtype: List[List[int]]
"""
if len(arr) < 2:
return []
sa = sorted(arr)
min_diff = sa[1] - sa[0]
res = [[sa[0], sa[1]]]
for i in range(1, len(sa) ... | 30.896552 | 75 | 0.4375 |
f733ffc85633950fbe996e09698c90caf6a8e6e8 | 8,278 | py | Python | test_tesseract.py | mlissner/tesseract-performance-testing | f0040987ef9ccbaf65eb786301637fcdb00ef3b5 | [
"MIT"
] | 2 | 2016-08-25T23:36:42.000Z | 2018-03-15T20:51:58.000Z | test_tesseract.py | mlissner/tesseract-performance-testing | f0040987ef9ccbaf65eb786301637fcdb00ef3b5 | [
"MIT"
] | null | null | null | test_tesseract.py | mlissner/tesseract-performance-testing | f0040987ef9ccbaf65eb786301637fcdb00ef3b5 | [
"MIT"
] | null | null | null | import glob
import os
import subprocess
import tempfile
import time
import cStringIO
from wand.color import Color
from wand.image import Image
PATH = './test_assets/*.pdf'
def temp_name():
""" returns a temporary file-name """
tmpfile = tempfile.NamedTemporaryFile(prefix="tess_")
return tmpfile.name
d... | 33.51417 | 76 | 0.553395 |
f734072f1032589ab024016a3f18c4100381457c | 2,995 | py | Python | earlier-2020/graphs-paper1/print_line_chart.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:09:33.000Z | 2018-06-18T12:09:33.000Z | earlier-2020/graphs-paper1/print_line_chart.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | null | null | null | earlier-2020/graphs-paper1/print_line_chart.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:13:21.000Z | 2018-06-18T12:13:21.000Z | import csv
# import matplotlib.pyplot as plt
import pylab as plt
import numpy as np
def show_plot(times, epochs, data):
# line chart Or Scatter chart
plt.figure(figsize=(8, 5))
"""
args:
marker='o' ,'x',
color=
"""
plt.plot(epochs, data, color='red', label='0')
# plt.plot(epochs, d... | 29.362745 | 93 | 0.656427 |
f73409964d099723c4d6f502b21eefcdeb932ced | 1,488 | py | Python | wolk_gateway_module/interface/actuator_status_provider.py | Wolkabout/WolkGatewayModule-SDK-Python | 73cb537822d07cb68b0609022f53171ecf663fa4 | [
"Apache-2.0"
] | null | null | null | wolk_gateway_module/interface/actuator_status_provider.py | Wolkabout/WolkGatewayModule-SDK-Python | 73cb537822d07cb68b0609022f53171ecf663fa4 | [
"Apache-2.0"
] | 2 | 2020-11-16T15:10:36.000Z | 2020-11-20T13:10:13.000Z | wolk_gateway_module/interface/actuator_status_provider.py | Wolkabout/WolkGatewayModule-SDK-Python | 73cb537822d07cb68b0609022f53171ecf663fa4 | [
"Apache-2.0"
] | null | null | null | """Stub method for providing current device actuator status."""
# Copyright 2019 WolkAbout Technology s.r.o.
#
# 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.apach... | 36.292683 | 78 | 0.737231 |
f7340ca89f7353dcd0c8f391724088255d2a8188 | 2,171 | py | Python | pddm/regressors/feedforward_network.py | krishpop/pddm | b1452554a4e318966b8ca3da53978458ac635c5d | [
"Apache-2.0"
] | null | null | null | pddm/regressors/feedforward_network.py | krishpop/pddm | b1452554a4e318966b8ca3da53978458ac635c5d | [
"Apache-2.0"
] | null | null | null | pddm/regressors/feedforward_network.py | krishpop/pddm | b1452554a4e318966b8ca3da53978458ac635c5d | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.926471 | 74 | 0.579917 |
f734112f18de9c64644d82da3c43167201edc406 | 6,823 | py | Python | kafka-utils/tests/bai_kafka_utils/test_fetcher_event.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 6 | 2020-09-29T09:03:04.000Z | 2022-03-14T06:52:25.000Z | kafka-utils/tests/bai_kafka_utils/test_fetcher_event.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | null | null | null | kafka-utils/tests/bai_kafka_utils/test_fetcher_event.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 4 | 2020-10-01T07:49:22.000Z | 2021-06-16T19:44:12.000Z | from bai_kafka_utils.events import (
BenchmarkDoc,
VisitedService,
FetcherBenchmarkEvent,
DownloadableContent,
FetcherPayload,
FileSystemObject,
)
BIG_FETCHER_JSON = """{
"date": "Thu May 02 16:15:42 UTC 2019",
"authenticated": false,
"payload": {
... | 39.668605 | 116 | 0.44863 |
f7341f69b66c89836096882d08cd417fb7779aaf | 22 | py | Python | privatebeta/__init__.py | fitoria/django-privatebeta | ef65130d3856d9444f0acc85c5bb590d09908d15 | [
"BSD-3-Clause"
] | 1 | 2015-11-05T13:42:05.000Z | 2015-11-05T13:42:05.000Z | privatebeta/__init__.py | fitoria/django-privatebeta | ef65130d3856d9444f0acc85c5bb590d09908d15 | [
"BSD-3-Clause"
] | null | null | null | privatebeta/__init__.py | fitoria/django-privatebeta | ef65130d3856d9444f0acc85c5bb590d09908d15 | [
"BSD-3-Clause"
] | null | null | null | # Let the wookie pass. | 22 | 22 | 0.727273 |
f734d0ce5e31881671bde02a0d35ed0eb21415f4 | 2,857 | py | Python | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( arr , l , h ) :
if l >= h :
return
if arr [ l ] > arr [ h ] :
t = arr [ l ]
arr [ l... | 52.907407 | 165 | 0.431222 |
f734d8a1c4282ee4aefbee1bf86ab99face93065 | 930 | py | Python | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from swagger_server.models.inline_response2004 import InlineResponse2004
from . import BaseTestCase
from six import BytesIO
from flask import json
class TestEvidenceController(BaseTestCase):
""" EvidenceController integration test stubs """
def test_ge... | 29.0625 | 108 | 0.611828 |
f734e09b76bc265ceb72504136dbcb9a86e98111 | 5,912 | py | Python | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | 15 | 2017-11-08T10:03:26.000Z | 2021-12-21T07:02:44.000Z | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | 9 | 2020-01-17T15:09:22.000Z | 2022-03-25T19:02:05.000Z | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
##################################################################################
# File: c:\Projects\KENYA ONE PROJECT\CORE\engines\constraint.py #
# Project: c:\Projects\KENYA ONE PROJECT\CORE\engines #
# Created Date: Thur... | 38.894737 | 88 | 0.508965 |
f73518b051d1cc9646ebc5039c4ebb6aa6cbfa1f | 2,550 | py | Python | demo/voice/main.py | fatash89/atom | 12846c8a3f936ae6c83e7e7b1d2dbb896e63fe66 | [
"Apache-2.0"
] | 64 | 2019-04-01T20:32:07.000Z | 2021-11-24T17:12:03.000Z | demo/voice/main.py | elementary-robotics/atom | 36aea078c0e029f03e7b9b4768729a683fb32a88 | [
"Apache-2.0"
] | 291 | 2019-04-01T22:54:31.000Z | 2022-03-31T21:48:47.000Z | demo/voice/main.py | fatash89/atom | 12846c8a3f936ae6c83e7e7b1d2dbb896e63fe66 | [
"Apache-2.0"
] | 5 | 2019-06-27T22:42:54.000Z | 2022-02-01T23:00:37.000Z | # atombot.py
import time
from atom import Element
PUBLISH_FREQUENCY = 100
TIME_FOR_WAVEFORM = 5
if __name__ == "__main__":
element = Element("voice_demo")
# Wait for the record element to start up and launch the VNC.
# this can and should be fixed with a heartbeat!
time.sleep(10)
# Start the... | 30.722892 | 82 | 0.512549 |
f7352703ed42ee6015d5ca30e57234884d399073 | 1,652 | py | Python | test/testAnonymizationExecutor.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 3 | 2020-02-12T01:24:46.000Z | 2020-02-13T00:50:46.000Z | test/testAnonymizationExecutor.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 32 | 2020-02-20T10:20:56.000Z | 2022-02-10T01:42:46.000Z | test/testAnonymizationExecutor.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 1 | 2020-02-22T02:47:19.000Z | 2020-02-22T02:47:19.000Z | #!/usr/bin/env python3
import unittest
import os
import shutil
from src.data.VideoItem import VideoItem
from src.data.MetaDataItem import MetaDataItem
from src.executor.FaceBlurrer import FaceBlurrer
from numpy.testing import assert_array_equal, assert_raises
class TestAnonymizationExecutor(unittest.TestCase):
TE... | 33.04 | 103 | 0.70339 |
f7352a156a29540ef2be6caeb5071e55659eee34 | 6,950 | py | Python | glyco/glucose/util.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | glyco/glucose/util.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | glyco/glucose/util.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import os
import platform
import re
import tempfile
import shutil
import subprocess
import sys
import urllib
import urlparse
# Copied fro... | 30.61674 | 80 | 0.682734 |
f7354da7414334f4bb43360cb78f171a1a3a8177 | 6,266 | py | Python | oscar/apps/search/views.py | makielab/django-oscar | 0a325cd0f04a4278201872b2e163868b72b6fabe | [
"BSD-3-Clause"
] | 1 | 2015-11-07T12:37:50.000Z | 2015-11-07T12:37:50.000Z | oscar/apps/search/views.py | makielab/django-oscar | 0a325cd0f04a4278201872b2e163868b72b6fabe | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/search/views.py | makielab/django-oscar | 0a325cd0f04a4278201872b2e163868b72b6fabe | [
"BSD-3-Clause"
] | null | null | null | import json
from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic.base import View
from django.conf import settings
from django.db.models import get_model
from haystack.query import SearchQuerySet
from haystack import views
from purl import URL
Product = get_model('catalogue', 'Product'... | 36.219653 | 107 | 0.543568 |
f735efd81dd59271b71383463bdf088ddbe47517 | 1,656 | py | Python | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | """Emoji
Available Commands:
.adi"""
import asyncio
from telethon import events
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 15)
input_str = event.pattern_match.group(1)
... | 33.12 | 93 | 0.278986 |
f735f5fbd64d2154b36d035f777107f689429cdb | 611 | py | Python | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 20 | 2015-06-16T17:39:10.000Z | 2022-03-20T22:39:40.000Z | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 29 | 2015-12-29T19:07:22.000Z | 2022-03-22T10:39:02.000Z | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 12 | 2015-08-28T01:22:18.000Z | 2021-09-25T08:17:31.000Z | import copy
#
# Prototype Class
#
class Cookie:
def __init__(self, name):
self.name = name
def clone(self):
return copy.deepcopy(self)
#
# Concrete Prototypes to clone
#
class CoconutCookie(Cookie):
def __init__(self):
Cookie.__init__(self, 'Coconut')
#
# Client Class
#
class... | 16.972222 | 40 | 0.630115 |
f7360b1ff28ca8cb8ff567284e2ce156676903d0 | 134 | py | Python | monkeys-and-frogs-on-fire/server/__main__.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 15 | 2020-04-17T12:02:14.000Z | 2022-03-16T03:01:34.000Z | monkeys-and-frogs-on-fire/server/__main__.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 49 | 2020-04-18T21:14:57.000Z | 2022-01-13T03:05:09.000Z | monkeys-and-frogs-on-fire/server/__main__.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 55 | 2020-04-17T12:01:11.000Z | 2021-12-28T10:14:02.000Z | from server.server import Server
def main():
server = Server(__file__)
server.run()
if __name__ == '__main__':
main()
| 12.181818 | 32 | 0.641791 |
f736559162d2fb353e82402c79261dc665f58d3e | 425 | py | Python | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | 1 | 2021-06-09T09:51:13.000Z | 2021-06-09T09:51:13.000Z | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | null | null | null | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | 1 | 2021-06-15T11:31:44.000Z | 2021-06-15T11:31:44.000Z | """
PyTorch Forecasting package for timeseries forecasting with PyTorch.
"""
from pytorch_forecasting.data import EncoderNormalizer, GroupNormalizer, TimeSeriesDataSet
from pytorch_forecasting.models import Baseline, NBeats, TemporalFusionTransformer
__all__ = [
"TimeSeriesDataSet",
"GroupNormalizer",
"Enc... | 25 | 90 | 0.764706 |
f7366798202eb5b63a293458869820181b482fe2 | 10,620 | py | Python | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 24 | 2019-12-12T20:54:39.000Z | 2021-03-25T15:40:26.000Z | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 9 | 2020-10-21T23:01:06.000Z | 2021-04-22T09:59:50.000Z | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 9 | 2019-12-03T21:05:11.000Z | 2021-04-02T11:41:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""RAMSES RF - Protocol/Transport layer.
Helper functions.
"""
import ctypes
import sys
import time
from datetime import datetime as dt
from typing import Optional, Union
from .const import DEVICE_TYPES, NON_DEVICE_ID, NUL_DEVICE_ID
class FILETIME(ctypes.Structure):... | 34.14791 | 88 | 0.591149 |
f736712970df93b5bef6cd0469bab29486ab504a | 12,232 | py | Python | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | # can't get the output to stop putting extra space after baby name before punctuation.
"""
A Baby class and functions that use/test it.
Authors: Dave Fisher, David Mutchler, Vibha Alangar, Matt Boutell,
Mark Hays, Amanda Stouder, Derek Whitley, their colleagues,
and Seth Mutchler.
""" # DONE: ... | 37.066667 | 86 | 0.563685 |
f73689676c7e34072751132b67e88ebf427c1287 | 842 | py | Python | setup.py | yupingso/randomproto | a36c0e13be893d9fd3a63e3390fc11fc0de250b9 | [
"MIT"
] | 6 | 2019-03-25T03:45:43.000Z | 2019-07-03T06:31:31.000Z | setup.py | yupingso/randomproto | a36c0e13be893d9fd3a63e3390fc11fc0de250b9 | [
"MIT"
] | 1 | 2019-06-03T09:13:44.000Z | 2019-06-03T09:13:44.000Z | setup.py | yupingso/randomproto | a36c0e13be893d9fd3a63e3390fc11fc0de250b9 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name='randomproto',
version='0.0.1',
py_modules=('randomproto',),
install_requires=[
'protobuf>=3.6.0',
],
setup_requires=[
'pytest-runner',
],
tests_require=[
'pytest==4.2.1',
'pytest-cov==2.6.1',
'pytest-mock... | 26.3125 | 64 | 0.608076 |
f73693a4682bea4ed02bdb055520c7339d597c43 | 26,017 | py | Python | openpharmacophore/pharmacophore/dynophore.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 14 | 2021-11-12T10:09:25.000Z | 2022-03-18T08:24:16.000Z | openpharmacophore/pharmacophore/dynophore.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 7 | 2021-11-05T01:37:57.000Z | 2022-01-18T06:03:39.000Z | openpharmacophore/pharmacophore/dynophore.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 3 | 2021-11-05T01:22:47.000Z | 2021-12-12T03:57:09.000Z | # OpenPharmacophore
from openpharmacophore._private_tools.exceptions import InvalidFileFormat, NoLigandsError, OpenPharmacophoreTypeError
from openpharmacophore.pharmacophore.pharmacophoric_point import UniquePharmacophoricPoint
from openpharmacophore import StructuredBasedPharmacophore
from openpharmacophore import Ph... | 41.827974 | 117 | 0.611523 |
f7369619cd01529ee372590cea33f5f73b48f876 | 5,341 | py | Python | spikeforest_analysis/compare_sortings_with_truth.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | spikeforest_analysis/compare_sortings_with_truth.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | spikeforest_analysis/compare_sortings_with_truth.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | import spikeextractors as si
#import spikewidgets as sw
import spiketoolkit as st
import mlprocessors as mlpr
import json
from cairio import client as ca
import numpy as np
from copy import deepcopy
def compare_sortings_with_truth(sortings,compute_resource,num_workers=None):
print('>>>>>> compare sortings with tru... | 39.272059 | 138 | 0.67684 |
f736c82fdd13410b5006180443ed9fb5d2275d3b | 496 | py | Python | examples/cc/h2o_ccsd_t.py | seunghoonlee89/pyscf-ecCC-TCC | 2091566fb83c1474e40bf74f271be2ce4611f60c | [
"Apache-2.0"
] | 2 | 2021-09-17T06:10:17.000Z | 2022-01-22T23:37:22.000Z | examples/cc/h2o_ccsd_t.py | seunghoonlee89/pyscf-ecCC-TCC | 2091566fb83c1474e40bf74f271be2ce4611f60c | [
"Apache-2.0"
] | null | null | null | examples/cc/h2o_ccsd_t.py | seunghoonlee89/pyscf-ecCC-TCC | 2091566fb83c1474e40bf74f271be2ce4611f60c | [
"Apache-2.0"
] | 2 | 2021-09-16T23:37:42.000Z | 2021-10-14T23:00:39.000Z | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
'''
A simple example to run CCSD(T) and UCCSD(T) calculation.
'''
import pyscf
mol = pyscf.M(
atom = 'O -0.26677564 -0.27872083 0.00000000;\
H -0.26677564 0.82127917 0.00000000;\
H -0.266775... | 21.565217 | 63 | 0.574597 |
f7370d3a7ba6b398302266319fded87169772eec | 1,227 | py | Python | marqeta/response_models/address_verification_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 21 | 2019-04-12T09:02:17.000Z | 2022-02-18T11:39:06.000Z | marqeta/response_models/address_verification_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 1 | 2020-07-22T21:27:40.000Z | 2020-07-23T17:38:43.000Z | marqeta/response_models/address_verification_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 10 | 2019-05-08T14:20:37.000Z | 2021-09-20T18:09:26.000Z | from datetime import datetime, date
from marqeta.response_models.avs_information import AvsInformation
from marqeta.response_models.avs_information import AvsInformation
from marqeta.response_models.response import Response
from marqeta.response_models import datetime_object
import json
import re
class AddressVerifica... | 31.461538 | 112 | 0.723716 |
f7371d98ef6f603bc1192d540e496dcf869ac1ed | 4,335 | py | Python | experiments/ashvin/icml2020/hand/adaptive/clamp_easy1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/adaptive/clamp_easy1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/adaptive/clamp_easy1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment, process_args
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
from rlkit.torch.sac.policies im... | 30.528169 | 77 | 0.570934 |
f7376f5ac6518f055d9d50110ef2dee4b566060b | 30,279 | py | Python | truncation_experiments/dnnlib/tflib/network.py | a7b23/CS236G-project | 8bde7d54ca3d22e13703fe72dfb998b38d9cd8b4 | [
"MIT"
] | 2 | 2021-02-23T07:07:32.000Z | 2021-03-11T21:13:26.000Z | truncation_experiments/dnnlib/tflib/network.py | a7b23/CS236G-project | 8bde7d54ca3d22e13703fe72dfb998b38d9cd8b4 | [
"MIT"
] | null | null | null | truncation_experiments/dnnlib/tflib/network.py | a7b23/CS236G-project | 8bde7d54ca3d22e13703fe72dfb998b38d9cd8b4 | [
"MIT"
] | 3 | 2021-02-23T09:02:48.000Z | 2021-02-27T06:14:42.000Z | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain... | 50.889076 | 165 | 0.646719 |
f73777d7ca2d4d80693cb15dd56f511c05f1c49c | 3,163 | py | Python | alipay/aop/api/domain/AlipayUserFamilyShareAuthCheckModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserFamilyShareAuthCheckModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserFamilyShareAuthCheckModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserFamilyShareAuthCheckModel(object):
def __init__(self):
self._resource_id = None
self._scene_id = None
self._target_biz_user_id = None
self._target_user_b... | 31.316832 | 95 | 0.62251 |
f7378301a74dc9cd9e025b71204a6e6ed1b8e4b4 | 4,520 | py | Python | pypayd/interfaces/blockr.py | ser/pypayd-ng | 63d0e09ca5e966177874e6e2e82f6036898a56b0 | [
"MIT"
] | null | null | null | pypayd/interfaces/blockr.py | ser/pypayd-ng | 63d0e09ca5e966177874e6e2e82f6036898a56b0 | [
"MIT"
] | null | null | null | pypayd/interfaces/blockr.py | ser/pypayd-ng | 63d0e09ca5e966177874e6e2e82f6036898a56b0 | [
"MIT"
] | null | null | null | """
blockr.io
"""
import logging
import hashlib
from hashlib import sha256
import requests
from .. import config
from binascii import hexlify, unhexlify
def getUrl(request_string):
return requests.get(request_string).json()
def setHost():
config.BLOCKCHAIN_CONNECT = ('http://tbtc.blockr.io' if config.TESTNET ... | 34.503817 | 103 | 0.562389 |
f737ea22ff2ba4acb8102d13caef6197f4c5f1ca | 6,618 | py | Python | dev/local/data/pipeline.py | vguerra/fastai_docs | 95df902ef5cd08bcd58d5ca64bc8a6ea3f297531 | [
"Apache-2.0"
] | null | null | null | dev/local/data/pipeline.py | vguerra/fastai_docs | 95df902ef5cd08bcd58d5ca64bc8a6ea3f297531 | [
"Apache-2.0"
] | null | null | null | dev/local/data/pipeline.py | vguerra/fastai_docs | 95df902ef5cd08bcd58d5ca64bc8a6ea3f297531 | [
"Apache-2.0"
] | null | null | null | #AUTOGENERATED! DO NOT EDIT! File to edit: dev/03_data_pipeline.ipynb (unless otherwise specified).
__all__ = ['get_func', 'Func', 'Sig', 'compose_tfms', 'batch_to_samples', 'mk_transform', 'Pipeline', 'TfmdBase',
'TfmdList', 'TfmdDS']
#Cell
from ..torch_basics import *
from ..test import *
from .transform... | 39.392857 | 133 | 0.643246 |
f73810b5a713532fd33d2666d1759247bd9d52f6 | 682 | py | Python | 2021/12/solution2.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | 2 | 2020-12-04T09:45:38.000Z | 2020-12-07T14:06:12.000Z | 2021/12/solution2.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | null | null | null | 2021/12/solution2.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | null | null | null | from collections import defaultdict, deque
with open("input.txt") as input_file:
lines = input_file.read().splitlines()
g = defaultdict(set)
for line in lines:
n1, n2 = line.split("-")
g[n1].add(n2)
g[n2].add(n1)
def walk(node, path, return_here):
if node == "end":
yield path
fo... | 28.416667 | 87 | 0.631965 |
f7381de4aebc9051177ffd55accf0b7d97283f70 | 2,547 | py | Python | elementally/tests/test.py | dem1995/elementally | 192990ad53580d62e278def6508c466589f38ecd | [
"X11"
] | null | null | null | elementally/tests/test.py | dem1995/elementally | 192990ad53580d62e278def6508c466589f38ecd | [
"X11"
] | null | null | null | elementally/tests/test.py | dem1995/elementally | 192990ad53580d62e278def6508c466589f38ecd | [
"X11"
] | null | null | null | import elementally as elmy
import unittest
import itertools
pos_array = [1, 2, 3, 4, 5]
pos_array_2 = [5, 4, 3, 2, 1]
neg_array = [-10, -20, -30, -40, -50]
neg_array_2 = [-50, -40, -30, -20, -10]
def odd_generator():
i=1
while(True):
yield i
i+=2
def complex_generator():
i=1
while(True... | 39.184615 | 96 | 0.669415 |
f7381dee751bc8ce42c7f5d24e881d37f73e6d1c | 2,733 | py | Python | cli/iotexetl/rpc/iotex_rpc.py | blockchain-etl/iotex-etl | bd350c3190acac35d17532eff383e05d08011e24 | [
"MIT"
] | 3 | 2020-07-04T13:53:38.000Z | 2020-07-30T15:07:35.000Z | cli/iotexetl/rpc/iotex_rpc.py | blockchain-etl/iotex-etl | bd350c3190acac35d17532eff383e05d08011e24 | [
"MIT"
] | 13 | 2020-07-16T06:07:33.000Z | 2020-08-20T10:35:10.000Z | cli/iotexetl/rpc/iotex_rpc.py | blockchain-etl/iotex-etl | bd350c3190acac35d17532eff383e05d08011e24 | [
"MIT"
] | 1 | 2021-01-20T10:06:20.000Z | 2021-01-20T10:06:20.000Z | # The MIT License (MIT)
#
# Copyright (c) 2020 Evgeny Medvedev, evge.medvedev@gmail.com
#
# 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 restriction, including without limitation the... | 42.046154 | 120 | 0.751921 |
f73842990d3c34bb39b1979920ca99697d282613 | 413 | py | Python | agent/indy_catalyst_agent/storage/tests/test__record.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/storage/tests/test__record.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/storage/tests/test__record.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | import pytest
from indy_catalyst_agent.storage import StorageRecord
class TestStorageRecord:
def test_create(self):
record_type = "TYPE"
record_value = "VALUE"
record = StorageRecord(record_type, record_value)
assert record.type == record_type
assert record.value == recor... | 25.8125 | 57 | 0.680387 |
f7387ae9a9a7f58c3749489a080bb1a0fe1242b5 | 3,377 | py | Python | checkov/common/bridgecrew/image_scanning/image_scanner.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | checkov/common/bridgecrew/image_scanning/image_scanner.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | checkov/common/bridgecrew/image_scanning/image_scanner.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | import logging
import subprocess # nosec
import docker
import json
import os
import time
from checkov.common.bridgecrew.image_scanning.docker_image_scanning_integration import docker_image_scanning_integration
TWISTCLI_FILE_NAME = 'twistcli'
DOCKER_IMAGE_SCAN_RESULT_FILE_NAME = 'docker-image-scan-results.json'
def... | 40.686747 | 274 | 0.687296 |
f738ab779415b269bda9727a7fdc7c85dda2ca86 | 2,925 | py | Python | code_server/run_evaluate.py | Dragon-M-Ren/grad_code | d814b81adaec709d5dffd737f0c350953cc361fd | [
"Apache-2.0"
] | null | null | null | code_server/run_evaluate.py | Dragon-M-Ren/grad_code | d814b81adaec709d5dffd737f0c350953cc361fd | [
"Apache-2.0"
] | null | null | null | code_server/run_evaluate.py | Dragon-M-Ren/grad_code | d814b81adaec709d5dffd737f0c350953cc361fd | [
"Apache-2.0"
] | null | null | null | from evaluate import *
import tensorflow as tf
from utils import *
from model.gcn import GCN
from model.mlp import MLP
from model.firstcheb import FirstCheb
from model.gat import GAT
from model.dcnn import DCNN
from model.spectralcnn import SpectralCNN
from model.chebnet import ChebNet
from model.graphsage import Graph... | 31.117021 | 89 | 0.696068 |
f738af43ce1b3a193391862e705092eb5b0f05da | 2,489 | py | Python | unified/tests/test_xfs.py | LoganCook/reporting-unified | 9d2c7e083c5c400e9120bb8552348e41406a1bc1 | [
"Apache-2.0"
] | null | null | null | unified/tests/test_xfs.py | LoganCook/reporting-unified | 9d2c7e083c5c400e9120bb8552348e41406a1bc1 | [
"Apache-2.0"
] | null | null | null | unified/tests/test_xfs.py | LoganCook/reporting-unified | 9d2c7e083c5c400e9120bb8552348e41406a1bc1 | [
"Apache-2.0"
] | null | null | null | import unittest
from flask import json
from ..apis.xfs import app
from . import client_get, now, now_minus_24hrs
get = client_get(app)
class XFSTestCase(unittest.TestCase):
def test_root_not_allowed(self):
rv = get('/')
self.assertEqual(rv.status_code, 404)
def test_all_top_objects_should_p... | 37.149254 | 115 | 0.593009 |
f739129edf4dad67c2248bd06ec3d471d9ba24b7 | 1,126 | py | Python | almost-triangles/almost-triangles.py | cdstanford/curiosities | 511e55b9dbf2b49db4593be92a0e4fce07888eaf | [
"MIT"
] | 1 | 2022-01-18T06:02:01.000Z | 2022-01-18T06:02:01.000Z | almost-triangles/almost-triangles.py | cdstanford/curiosities | 511e55b9dbf2b49db4593be92a0e4fce07888eaf | [
"MIT"
] | null | null | null | almost-triangles/almost-triangles.py | cdstanford/curiosities | 511e55b9dbf2b49db4593be92a0e4fce07888eaf | [
"MIT"
] | null | null | null | """
A triangle is an "almost right triangle" if one of its angles differs from
90 degrees by at most 15 degrees. A triangle is an "almost isosceles
triangle" if two of its angles differ from each other by at most 15
degrees. Prove that all acute triangles are either almost right or almost
isosceles.
Note: if "at most ... | 28.15 | 79 | 0.626998 |
f73915cd2a13a0f75508d4f48f01ea62bb60222f | 3,177 | py | Python | py_segment/graph.py | RookieHong/python-objectness | 02af4d090502e1a7269b23673709cfea75da09c9 | [
"Apache-2.0"
] | 20 | 2020-09-27T08:41:38.000Z | 2022-03-09T10:31:27.000Z | py_segment/graph.py | RookieHong/python-objectness | 02af4d090502e1a7269b23673709cfea75da09c9 | [
"Apache-2.0"
] | 2 | 2021-12-02T07:48:41.000Z | 2021-12-21T07:14:25.000Z | py_segment/graph.py | RookieHong/python-objectness | 02af4d090502e1a7269b23673709cfea75da09c9 | [
"Apache-2.0"
] | 4 | 2020-11-19T13:38:52.000Z | 2022-03-09T14:40:28.000Z | class Node:
def __init__(self, parent, rank=0, size=1):
self.parent = parent
self.rank = rank
self.size = size
def __repr__(self):
return '(parent=%s, rank=%s, size=%s)' % (self.parent, self.rank, self.size)
class Forest:
def __init__(self, num_nodes):
self.nodes = ... | 31.455446 | 89 | 0.579792 |
f7391612a071aa6a5a6f60058d789289104967d2 | 7,118 | py | Python | jnpy/app/pytdx_loader/engine.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | 5 | 2020-05-19T07:32:39.000Z | 2022-03-14T09:09:48.000Z | jnpy/app/pytdx_loader/engine.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | null | null | null | jnpy/app/pytdx_loader/engine.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | 3 | 2020-04-02T08:30:17.000Z | 2020-05-03T12:12:05.000Z | import time
from typing import Callable
import pandas as pd
from datetime import datetime
from vnpy.event import EventEngine
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.engine import BaseEngine, MainEngine
from vnpy.trader.object import BarData
from vnpy.trader.utility import get_folder_path
... | 31.495575 | 118 | 0.52599 |
f7391676fb3e3868ff818f4de0d1cfe9e941e235 | 9,825 | py | Python | doc/conf.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | 1 | 2021-01-21T11:31:59.000Z | 2021-01-21T11:31:59.000Z | doc/conf.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | doc/conf.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# morphforge documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 23 14:01:08 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | 28.071429 | 94 | 0.688142 |
f739464879003de44eaf68232a6d4a41a29fc14e | 386 | py | Python | medium/Triangle/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | 8 | 2021-08-21T19:10:04.000Z | 2022-03-11T14:30:02.000Z | medium/Triangle/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | null | null | null | medium/Triangle/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | 1 | 2021-08-24T06:29:02.000Z | 2021-08-24T06:29:02.000Z | # Time complexity: O(n)
# Approach: Summing up triangle from bottom to top in minimum way.
class Solution:
def minimumTotal(self, triangle: List[List[int]]) -> int:
n = len(triangle)
for i in range(n-1, 0, -1):
for j in range(0, len(triangle[i])-1):
triangle[i-1][j] += m... | 38.6 | 73 | 0.582902 |
f7398bf1eff15fbb3d9d6bd1f250fd98451b79cc | 20,748 | py | Python | scf/_vhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | scf/_vhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | scf/_vhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import ctypes
import _ctypes
import numpy
import pyscf.lib
from pyscf import gto
from pyscf.gto.moleintor import make_cintopt
libcvhf = pyscf.lib.load_library('libcvhf')
def _fpointer(name):
return ctypes.c_void_p(_ctypes.dlsym(libcvhf._handle, name))
class VHFOpt(object):
de... | 37.05 | 90 | 0.587623 |
f73a2ae3c540a9a90052d279a3881c4aaf86097f | 3,410 | py | Python | kopf/engines/probing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | kopf/engines/probing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | kopf/engines/probing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | import asyncio
import datetime
import logging
import urllib.parse
from typing import MutableMapping, Optional, Tuple
import aiohttp.web
from kopf.reactor import activities, lifecycles, registries
from kopf.structs import callbacks, configuration, handlers, memos
logger = logging.getLogger(__name__)
LOCALHOST: str =... | 35.894737 | 97 | 0.657478 |
f73a36ef236a0195fe5a8771954b392d3e16858c | 22,339 | py | Python | tensor2tensor/models/video/savp.py | shankharaj29/tensor2tensor | b89ba51a6fa9e0c20009cfb57ee8de04f7138392 | [
"Apache-2.0"
] | 2 | 2020-03-02T13:49:11.000Z | 2020-06-18T09:48:35.000Z | tensor2tensor/models/video/savp.py | PedroLelis/tensor2tensor | 5a867d031bd493eeb7d2776e1118d1594ff0a623 | [
"Apache-2.0"
] | 1 | 2019-01-21T10:57:47.000Z | 2019-01-21T10:57:47.000Z | tensor2tensor/models/video/savp.py | PedroLelis/tensor2tensor | 5a867d031bd493eeb7d2776e1118d1594ff0a623 | [
"Apache-2.0"
] | 3 | 2019-02-10T11:12:30.000Z | 2022-02-23T20:43:48.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# 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... | 39.74911 | 113 | 0.696316 |
f73ab2948daa58260ac313e2f31c7dce7b616281 | 6,411 | py | Python | toontown/betaevent/DistributedBetaEvent.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 1 | 2018-06-16T23:06:38.000Z | 2018-06-16T23:06:38.000Z | toontown/betaevent/DistributedBetaEvent.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/betaevent/DistributedBetaEvent.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from panda3d.core import Point3, VBase3, Vec3, Vec4
from toontown.betaevent.DistributedEvent import DistributedEvent
from toontown.betaevent import CogTV
from toontown.hood import ZoneUtil
from direct.fsm import ClassicFSM, State
from direct.interval.IntervalGlobal import *
from toontown.toon import Toon, ToonDNA... | 42.177632 | 130 | 0.610357 |
f73ab6176ab8fe472d5242378c8bc7c181ac542c | 4,666 | py | Python | tests/test_chi_citycouncil.py | danielahuang/city-scrapers | 711d1995f59100793e771068a6f5d9149e773412 | [
"MIT"
] | null | null | null | tests/test_chi_citycouncil.py | danielahuang/city-scrapers | 711d1995f59100793e771068a6f5d9149e773412 | [
"MIT"
] | null | null | null | tests/test_chi_citycouncil.py | danielahuang/city-scrapers | 711d1995f59100793e771068a6f5d9149e773412 | [
"MIT"
] | null | null | null | import json
from datetime import date, time
from urllib.parse import parse_qs
import pytest
from freezegun import freeze_time
from tests.utils import file_response, read_test_file_content
from city_scrapers.constants import CITY_COUNCIL
from city_scrapers.spiders.chi_citycouncil import ChiCityCouncilSpider
INITIAL_R... | 30.496732 | 150 | 0.658594 |
f73ae27acfddb97a5a793e676d74a4d7a58eef84 | 22,342 | py | Python | cartridge/shop/migrations/0016_add_field_product__meta_title.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/migrations/0016_add_field_product__meta_title.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/migrations/0016_add_field_product__meta_title.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import unicode_literals
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product._meta_title'
db.add_column('shop_product', '... | 87.273438 | 197 | 0.561409 |
f73afdcad8e818812662d41e891fdcf0eaf1cc95 | 7,622 | py | Python | src/api/bkuser_core/categories/plugins/ldap/adaptor.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/plugins/ldap/adaptor.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/plugins/ldap/adaptor.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 38.301508 | 119 | 0.66846 |
f73afef58d65deabe13b39d87236bc23035e79be | 1,568 | py | Python | wrappers/python/tests/wallet/test_open_wallet.py | Diiaablo95/indy-sdk | 0ef7321f5902683af928cdc7ea94d522bee33d30 | [
"Apache-2.0"
] | null | null | null | wrappers/python/tests/wallet/test_open_wallet.py | Diiaablo95/indy-sdk | 0ef7321f5902683af928cdc7ea94d522bee33d30 | [
"Apache-2.0"
] | null | null | null | wrappers/python/tests/wallet/test_open_wallet.py | Diiaablo95/indy-sdk | 0ef7321f5902683af928cdc7ea94d522bee33d30 | [
"Apache-2.0"
] | null | null | null | import pytest
from indy import IndyError
from indy import wallet
from indy.error import ErrorCode
@pytest.mark.asyncio
@pytest.mark.parametrize("wallet_config", [None, '{"freshness_time":1000}'])
async def test_open_wallet_works(wallet_config, wallet_handle):
pass
@pytest.mark.asyncio
async def test_open_walle... | 35.636364 | 115 | 0.776148 |
f73b0549a8520f8a1b9f80ee2a9d44368bb49989 | 7,159 | py | Python | soaplib/core/zope2.py | divaliu1408/overfit | 083dcfaa758391092933e19544462cd831e73ef0 | [
"Apache-2.0"
] | null | null | null | soaplib/core/zope2.py | divaliu1408/overfit | 083dcfaa758391092933e19544462cd831e73ef0 | [
"Apache-2.0"
] | null | null | null | soaplib/core/zope2.py | divaliu1408/overfit | 083dcfaa758391092933e19544462cd831e73ef0 | [
"Apache-2.0"
] | null | null | null | """Mix-In Class to Export Decorated Methods using SOAP
This file is not a Zope2 Product nor a Zope3 component. It is a simple
Python module that adds two elements: a hook into the Zope publisher to
intercept SOAP requests, and a mix-in class to your Zope2 folder classes
that make them SOAP-aware, with que... | 36.340102 | 89 | 0.69032 |
f73b2d639d0e65b873732c9f73125c0faa298413 | 1,867 | py | Python | hooks/post_gen_project.py | Everyday-Future/cookiecutter-devops | 316948eed75c95ac5768a1bf1d504807069aaa6a | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | Everyday-Future/cookiecutter-devops | 316948eed75c95ac5768a1bf1d504807069aaa6a | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | Everyday-Future/cookiecutter-devops | 316948eed75c95ac5768a1bf1d504807069aaa6a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import stat
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(filepath):
os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
if __name__ == '__main__':
if 'no' in '{{ cookiecutter.command_line_interface|lower }}':
cli_file = os.path.join('{{ cook... | 38.102041 | 87 | 0.637386 |
f73b366b012fea66ac00ee79b22b61b0d63bffa5 | 541 | py | Python | Courses/Udacity/CS101/Lesson_4_Problem_Set_(Optional)/01-Word_Count/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 1 | 2019-02-13T12:02:26.000Z | 2019-02-13T12:02:26.000Z | Courses/Udacity/CS101/Lesson_4_Problem_Set_(Optional)/01-Word_Count/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 1 | 2018-08-13T15:58:33.000Z | 2018-08-13T15:58:33.000Z | Courses/Udacity/CS101/Lesson_4_Problem_Set_(Optional)/01-Word_Count/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 2 | 2017-08-10T20:01:29.000Z | 2021-07-01T08:39:13.000Z | # Write a procedure, count_words, which takes as input a string
# and returns the number of words in the string. You may consider words
# as strings of characters separated by spaces.
def count_words():
passage =("The number of orderings of the 52 cards in a deck of cards "
"is so great that if every one of the almo... | 33.8125 | 73 | 0.744917 |
f73b6022673fcd9dfb2e398bb51a7bbf33d4bb06 | 2,467 | py | Python | alien_tag.py | sacherjj/python-AlienRFID | aaddd846d46cca533dca43c256890c072e8f5ec5 | [
"MIT"
] | 1 | 2021-03-21T13:52:00.000Z | 2021-03-21T13:52:00.000Z | alien_tag.py | sacherjj/python-AlienRFID | aaddd846d46cca533dca43c256890c072e8f5ec5 | [
"MIT"
] | null | null | null | alien_tag.py | sacherjj/python-AlienRFID | aaddd846d46cca533dca43c256890c072e8f5ec5 | [
"MIT"
] | 2 | 2015-10-12T10:02:50.000Z | 2020-03-09T13:30:12.000Z | __author__ = 'joesacher'
import datetime as dt
class AlienTag(object):
def __init__(self, taglist_entry):
self.disc = 0
self.last = 0
self.last_last = 0
self.id = 0
self.ant = 0
self.count = 0
self.proto = 0
self.rssi = 0
self.freq = 0
# ... | 31.628205 | 165 | 0.565464 |
f73b6f6d7d6955528eef744b500e27d5eca877ef | 1,000 | py | Python | vyperlogix/django/forms/fields.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/django/forms/fields.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/django/forms/fields.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | import sys
from vyperlogix.misc import _utils
from django.utils.datastructures import SortedDict as SortedDictFromList
from vyperlogix.classes.SmartObject import SmartObject
def fields_for_model(model, formfield_callback=lambda f: f.formfield()):
"""
Returns a list of fields for the given Django model class... | 33.333333 | 78 | 0.698 |
f73bbcedcd25303f7209490e28a550849e1245fb | 3,711 | py | Python | supriya/ugens/MulAdd.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/ugens/MulAdd.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/ugens/MulAdd.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | import collections
from supriya import CalculationRate
from supriya.synthdefs import UGen
class MulAdd(UGen):
"""
An Optimized multiplication / addition ugen.
::
>>> source = supriya.ugens.SinOsc.ar()
>>> mul_add = supriya.ugens.MulAdd.new(
... addend=0.5,
... mu... | 28.328244 | 87 | 0.537591 |
f73bcc307906ada8eceee6a21267b925ade3c652 | 13,646 | py | Python | deeppavlov/core/layers/tf_csoftmax_attention.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 3 | 2020-04-16T04:25:10.000Z | 2021-05-07T23:04:43.000Z | deeppavlov/core/layers/tf_csoftmax_attention.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 12 | 2020-01-28T22:14:04.000Z | 2022-02-10T00:10:17.000Z | deeppavlov/core/layers/tf_csoftmax_attention.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 1 | 2021-02-05T13:01:48.000Z | 2021-02-05T13:01:48.000Z | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... | 53.724409 | 184 | 0.708413 |
f73bd9fef40d9af195f1e1eb4ae5b47154f56eb1 | 461 | py | Python | sim/Simulator.py | adhocmaster/pyns | 607feb56baf0900535130195163eac331e131a2e | [
"MIT"
] | 1 | 2021-06-15T06:21:14.000Z | 2021-06-15T06:21:14.000Z | sim/Simulator.py | adhocmaster/pyns | 607feb56baf0900535130195163eac331e131a2e | [
"MIT"
] | null | null | null | sim/Simulator.py | adhocmaster/pyns | 607feb56baf0900535130195163eac331e131a2e | [
"MIT"
] | 1 | 2021-06-15T06:21:18.000Z | 2021-06-15T06:21:18.000Z | from abc import ABC
class Simulator(ABC):
def __init__(self):
self.stats = {}
self.stats['dataInFlight'] = []
self.stats['dataInQueue'] = []
self.stats['packetsInFlight'] = []
self.stats['packetsInQueue'] = []
self.stats['queueSize'] = []
self.stats['packet... | 28.8125 | 44 | 0.553145 |
f73be5427fbe24030a0f1a642b8b36c5bc757baa | 7,447 | py | Python | git/objects/fun.py | yarikoptic/GitPython | 7576b282013249a2b20ccda4acacefd5e625ea39 | [
"BSD-3-Clause"
] | 1 | 2020-10-15T06:16:48.000Z | 2020-10-15T06:16:48.000Z | git/objects/fun.py | yarikoptic/GitPython | 7576b282013249a2b20ccda4acacefd5e625ea39 | [
"BSD-3-Clause"
] | null | null | null | git/objects/fun.py | yarikoptic/GitPython | 7576b282013249a2b20ccda4acacefd5e625ea39 | [
"BSD-3-Clause"
] | null | null | null | """Module with functions which are supposed to be as fast as possible"""
from stat import S_ISDIR
__all__ = ('tree_to_stream', 'tree_entries_from_data', 'traverse_trees_recursive',
'traverse_tree_recursive')
def tree_to_stream(entries, write):
"""Write the give list of entries into ... | 37.235 | 125 | 0.587485 |
f73c21ab8ff31d42eefafa43012f748feffc581f | 20,942 | py | Python | acq4/pyqtgraph/widgets/SpinBox.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/pyqtgraph/widgets/SpinBox.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/pyqtgraph/widgets/SpinBox.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ..Qt import QtGui, QtCore
from ..python2_3 import asUnicode
from ..SignalProxy import SignalProxy
from .. import functions as fn
from math import log
from decimal import Decimal as D ## Use decimal to avoid accumulating floating-point errors
from decimal import *
import weakref
__all__ =... | 39.813688 | 150 | 0.518671 |
f73c24cd61c6f29f2dd100f7e4af4609b7bb9113 | 17,366 | py | Python | XY_Model_propare_state3_chi64_A0.py | StudentsZhouPengfei/Automatically-Differentiable-Quantum-Circuit-for-Many-qubit-State-Preparation | 42d3a77380e78819375c9fb2c5600ddc89a3ae3f | [
"MIT"
] | 3 | 2021-05-10T01:49:59.000Z | 2021-06-13T19:03:40.000Z | XY_Model_propare_state3_chi64_A0.py | StudentsZhouPengfei/Automatically-Differentiable-Quantum-Circuit-for-Many-qubit-State-Preparation | 42d3a77380e78819375c9fb2c5600ddc89a3ae3f | [
"MIT"
] | null | null | null | XY_Model_propare_state3_chi64_A0.py | StudentsZhouPengfei/Automatically-Differentiable-Quantum-Circuit-for-Many-qubit-State-Preparation | 42d3a77380e78819375c9fb2c5600ddc89a3ae3f | [
"MIT"
] | null | null | null | import torch as tc
import numpy as np
import copy
import os,sys
import Circle_Function_Class_A0 as ev
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('Agg')
from torch.optim.lr_scheduler import StepLR
import BasicFunSJR as bfs
from CNNBTN import Paras_VL_CNN_BTN_Collected1chg1
import BasicFu... | 47.190217 | 114 | 0.651273 |
f73c36a9e617dd10e21800879e5f188acdb69937 | 4,355 | py | Python | src/POPULARITY_MODULE/popularity_predictor.py | cristinalunaj/WI-IAT20_PopularityModule | 0a4894e2b889bf31ea1a8beab3025d5dd0b1ed47 | [
"MIT"
] | null | null | null | src/POPULARITY_MODULE/popularity_predictor.py | cristinalunaj/WI-IAT20_PopularityModule | 0a4894e2b889bf31ea1a8beab3025d5dd0b1ed47 | [
"MIT"
] | null | null | null | src/POPULARITY_MODULE/popularity_predictor.py | cristinalunaj/WI-IAT20_PopularityModule | 0a4894e2b889bf31ea1a8beab3025d5dd0b1ed47 | [
"MIT"
] | null | null | null | import pandas as pd
import subprocess, os
import src.utils.loader as loader
def create_test_arff(participant, test_df, aux_path):
arff_text = "@relation summary_features \n\n" \
"@attribute n_faces numeric\n" \
"@attribute avg_confidence_faces numeric\n" \
"@attribut... | 45.364583 | 170 | 0.653961 |
f73cd7659f96363d6da4f7c2bb9631d7abb9b9f3 | 5,938 | py | Python | salt/states/cabal.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | 2 | 2015-08-04T21:54:38.000Z | 2019-04-25T21:47:08.000Z | salt/states/cabal.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | 1 | 2015-09-02T12:49:48.000Z | 2015-09-02T19:22:58.000Z | salt/states/cabal.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Installation of Cabal Packages
==============================
.. versionadded:: 2015.8.0
These states manage the installed packages for Haskell using
cabal. Note that cabal-install must be installed for these states to
be available, so cabal states should include a requisite to a
pkg.insta... | 28.965854 | 78 | 0.573594 |
f73ce815f021946c17d274a89a2a9a2f8ef1867c | 1,388 | py | Python | setup.py | shx2/apegears | 3fa0408a15df3817fd206d1086d7e49e1b60594c | [
"MIT"
] | 5 | 2020-08-31T20:04:04.000Z | 2022-01-15T17:09:42.000Z | setup.py | shx2/apegears | 3fa0408a15df3817fd206d1086d7e49e1b60594c | [
"MIT"
] | 5 | 2020-10-23T02:41:45.000Z | 2020-11-03T02:27:57.000Z | setup.py | shx2/apegears | 3fa0408a15df3817fd206d1086d7e49e1b60594c | [
"MIT"
] | 1 | 2020-10-23T02:48:08.000Z | 2020-10-23T02:48:08.000Z | #!/usr/bin/env python3
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
# Read version i... | 30.173913 | 78 | 0.682277 |
f73cf0e3aa3957672cd28f652a1f0461874ddcc9 | 14,332 | py | Python | policy_gradient.py | rey-allan/rl | 6124bcfe5de8a9a316c41fb75b50a3e9babfc970 | [
"MIT"
] | null | null | null | policy_gradient.py | rey-allan/rl | 6124bcfe5de8a9a316c41fb75b50a3e9babfc970 | [
"MIT"
] | null | null | null | policy_gradient.py | rey-allan/rl | 6124bcfe5de8a9a316c41fb75b50a3e9babfc970 | [
"MIT"
] | null | null | null | """Implementation of different policy gradient methods"""
import argparse
import numpy as np
import plot as plt
import random
from collections import namedtuple
from env import Action, Easy21, State
from tqdm import tqdm
from typing import Callable, List
# For reproducibility
random.seed(0)
np.random.seed(0)
Traject... | 38.840108 | 120 | 0.612824 |
f73d327e2f83cfcb8714c4fa54d314b74ae3fd9f | 432 | py | Python | djangocms_versioning/test_utils/people/models.py | webbyfox/djangocms-versioning | a466ff0f8d109a22ec2f567cace6ef69d332180c | [
"BSD-3-Clause"
] | null | null | null | djangocms_versioning/test_utils/people/models.py | webbyfox/djangocms-versioning | a466ff0f8d109a22ec2f567cace6ef69d332180c | [
"BSD-3-Clause"
] | null | null | null | djangocms_versioning/test_utils/people/models.py | webbyfox/djangocms-versioning | a466ff0f8d109a22ec2f567cace6ef69d332180c | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
class Person(models.Model):
name = models.TextField()
def __str__(self):
return "{} ({})".format(self.name, self.pk)
class PersonContent(models.Model):
person = models.ForeignKey(Person, on_delete=models.CASCADE)
language = models.TextField()
text = models.T... | 20.571429 | 64 | 0.655093 |
f73d453812bcfc25c8bbd44be64d84d895cd81c9 | 76 | py | Python | main.py | sebanie15/simple_clinic | 4dc942b0549ee6397a0e89dd7aa03eb8580b4a5a | [
"MIT"
] | null | null | null | main.py | sebanie15/simple_clinic | 4dc942b0549ee6397a0e89dd7aa03eb8580b4a5a | [
"MIT"
] | null | null | null | main.py | sebanie15/simple_clinic | 4dc942b0549ee6397a0e89dd7aa03eb8580b4a5a | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: sebanie15
"""
| 10.857143 | 23 | 0.539474 |
f73d56274bb5a4e9fa2a9fe2f5ce429d2af7de69 | 2,511 | py | Python | deeppavlov/core/common/log.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 1 | 2019-05-22T08:34:33.000Z | 2019-05-22T08:34:33.000Z | deeppavlov/core/common/log.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | null | null | null | deeppavlov/core/common/log.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 1 | 2019-03-17T13:47:44.000Z | 2019-03-17T13:47:44.000Z | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... | 35.366197 | 114 | 0.683791 |
f73d6cd897ef8812b769f1d9383c8e52951c6300 | 1,705 | py | Python | tests/test_utils.py | nhoffman/uwgroups | fab9cb266d2e0c794370c1bdf62b26610dd33aef | [
"MIT",
"Unlicense"
] | 1 | 2018-11-30T00:43:06.000Z | 2018-11-30T00:43:06.000Z | tests/test_utils.py | nhoffman/uwgroups | fab9cb266d2e0c794370c1bdf62b26610dd33aef | [
"MIT",
"Unlicense"
] | 2 | 2018-08-20T17:00:18.000Z | 2018-08-27T17:30:54.000Z | tests/test_utils.py | nhoffman/uwgroups | fab9cb266d2e0c794370c1bdf62b26610dd33aef | [
"MIT",
"Unlicense"
] | 1 | 2018-08-21T15:06:54.000Z | 2018-08-21T15:06:54.000Z | """
Test utils module.
"""
import logging
from uwgroups.utils import reconcile, grouper
from .__init__ import TestBase
log = logging.getLogger(__name__)
class TestReconcile(TestBase):
def test01(self):
to_add, to_remove = reconcile(
current=set(),
desired=set())
self.as... | 25.073529 | 58 | 0.556012 |
f73d8ed23868ba52f022e4f17ca43ad0a39cd922 | 287 | py | Python | hiicart/gateway/amazon/urls.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | null | null | null | hiicart/gateway/amazon/urls.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | 5 | 2020-10-29T01:05:05.000Z | 2020-10-29T01:05:19.000Z | hiicart/gateway/amazon/urls.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | null | null | null | import hiicart.gateway.amazon.views
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'cbui/?$', 'hiicart.gateway.amazon.views.cbui'),
(r'ipn/?$', 'hiicart.gateway.amazon.views.ipn'),
)
| 28.7 | 88 | 0.515679 |
f73de0cf78faa821e681ebb950cc71213af5e281 | 1,630 | py | Python | pinax/apps/tasks/tests/test_client.py | peiwei/pinax | 34f95b1df4318655fe9bd90dcda8fe824e0c4117 | [
"MIT"
] | 1 | 2019-02-12T04:45:09.000Z | 2019-02-12T04:45:09.000Z | pinax/apps/tasks/tests/test_client.py | alex/pinax | 37e17ee2e2eb0e387d8809c12e55c20194a7118a | [
"MIT"
] | null | null | null | pinax/apps/tasks/tests/test_client.py | alex/pinax | 37e17ee2e2eb0e387d8809c12e55c20194a7118a | [
"MIT"
] | 1 | 2019-02-12T04:45:40.000Z | 2019-02-12T04:45:40.000Z | # coding: utf-8
from django.test import TestCase
rst_markup = """
Sample Header
===============
Blah blah blah
Lower Header
-------------
Blah blah blah
"""
class TestAddForm(TestCase):
fixtures = ["test_tasks.json"]
urls = "tasks.tests.tasks_urls"
def setUp(self):
self.client.login(us... | 24.69697 | 86 | 0.556442 |
f73dfbb3ad628d6d9456e84ab79764156db7292d | 7,508 | py | Python | mtp_noms_ops/apps/settings/views.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | 3 | 2016-12-22T15:56:57.000Z | 2020-03-10T10:37:40.000Z | mtp_noms_ops/apps/settings/views.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | 61 | 2016-06-10T08:37:23.000Z | 2022-01-28T12:41:29.000Z | mtp_noms_ops/apps/settings/views.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | 1 | 2021-04-11T06:13:53.000Z | 2021-04-11T06:13:53.000Z | from urllib.parse import urlencode
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import SuccessURLAllowedHostsMixin
from django.shortcuts import redirect
from django.urls import reverse, reverse_lazy
from django.utils.http import is_safe_url
from django.utils.translation import get... | 39.515789 | 103 | 0.668221 |
f73e12a1c014661754813b808c8c50782a8dc99d | 4,282 | py | Python | colour_datasets/loaders/jakob2019.py | colour-science/colour-datasets | 464c387c17739f08a0cceb5185f6b225872adb6c | [
"BSD-3-Clause"
] | 28 | 2019-06-15T03:07:28.000Z | 2022-03-28T14:11:51.000Z | colour_datasets/loaders/jakob2019.py | JGoldstone/colour-datasets | 8e0b52870c63c0e9b72d8b848720e0c28e0cbfa4 | [
"BSD-3-Clause"
] | 12 | 2020-03-24T17:35:36.000Z | 2021-11-09T08:49:39.000Z | colour_datasets/loaders/jakob2019.py | JGoldstone/colour-datasets | 8e0b52870c63c0e9b72d8b848720e0c28e0cbfa4 | [
"BSD-3-Clause"
] | 8 | 2019-10-27T15:00:52.000Z | 2022-01-26T15:29:38.000Z | # -*- coding: utf-8 -*-
"""
Spectral Upsampling Coefficient Tables - Jakob and Hanika (2019)
================================================================
Defines the objects implementing support for *Jakob and Hanika (2019)*
*Spectral Upsampling Coefficient Tables* dataset loading:
- :class:`colour_datasets.loa... | 27.986928 | 79 | 0.64596 |
f73e20489d20cf4f5c8057aeb413fc2f1f957f89 | 3,355 | py | Python | setup.py | albert118/jaffle | 55da4d75ad3a9ca633af3865cc35b73e3406a4ef | [
"BSD-3-Clause"
] | null | null | null | setup.py | albert118/jaffle | 55da4d75ad3a9ca633af3865cc35b73e3406a4ef | [
"BSD-3-Clause"
] | null | null | null | setup.py | albert118/jaffle | 55da4d75ad3a9ca633af3865cc35b73e3406a4ef | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# flake8: noqa
import os
from setuptools import find_packages, setup
from jaffle import __version__
long_description = '''
Jaffle is an automation tool for Python software development, which does:
- Instantiate Python applications in a Jupyter kernel and allows them to call
each other
- L... | 27.958333 | 110 | 0.653949 |
f73e2b8f54d3b3fc1bcc24ef1b0f9ce11a9ce9c5 | 2,360 | py | Python | city_scrapers/spiders/det_great_lakes_water_authority.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | city_scrapers/spiders/det_great_lakes_water_authority.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | city_scrapers/spiders/det_great_lakes_water_authority.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import scrapy
from ics import Calendar
from city_scrapers.spider import Spider
class DetGreatLakesWaterAuthoritySpider(Spider):
name = 'det_great_lakes_water_authority'
agency_id = 'Great Lakes Water Authority'
timezone = 'America/Detroit'
allowed_domains = ['www.gl... | 38.688525 | 101 | 0.572458 |
f73e2cae7ae81dc17b787e8465ce0f4ee2ea9092 | 9,839 | py | Python | test/dynamics/solvers/test_solver_classes.py | haggaila/qiskit-dynamics | fd20314e2b591c35323782bc429d9f928fdb9a12 | [
"Apache-2.0"
] | 1 | 2022-01-21T01:47:40.000Z | 2022-01-21T01:47:40.000Z | test/dynamics/solvers/test_solver_classes.py | haggaila/qiskit-dynamics | fd20314e2b591c35323782bc429d9f928fdb9a12 | [
"Apache-2.0"
] | null | null | null | test/dynamics/solvers/test_solver_classes.py | haggaila/qiskit-dynamics | fd20314e2b591c35323782bc429d9f928fdb9a12 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 38.584314 | 96 | 0.6087 |
f73e4d16b2cd8fa1026b82af5d125e7099e43365 | 9,695 | py | Python | siteprefs/utils.py | idlesign/django-siteprefs | dbc040b96800a73e35a3d436a5207dd658ce0c58 | [
"BSD-3-Clause"
] | 8 | 2015-01-30T11:57:45.000Z | 2021-11-07T01:21:05.000Z | siteprefs/utils.py | idlesign/django-siteprefs | dbc040b96800a73e35a3d436a5207dd658ce0c58 | [
"BSD-3-Clause"
] | 17 | 2015-03-28T18:26:40.000Z | 2020-06-05T04:35:15.000Z | siteprefs/utils.py | idlesign/django-siteprefs | dbc040b96800a73e35a3d436a5207dd658ce0c58 | [
"BSD-3-Clause"
] | 7 | 2015-03-29T10:06:14.000Z | 2020-05-29T05:22:39.000Z |
import inspect
import os
from collections import OrderedDict
from datetime import datetime
from typing import Any, Callable, Type, Generator, Tuple
from warnings import warn
from django.contrib import admin
from django.db import models
from django.utils.translation import gettext_lazy as _
from etc.toolbox import imp... | 25.580475 | 108 | 0.633213 |
f73e5bfa9700cd4b4cdfe40b8976cb6923234da6 | 4,234 | py | Python | simplejson/tests/test_unicode.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | 20 | 2015-01-26T01:39:44.000Z | 2020-05-30T19:04:14.000Z | lib/simplejson/tests/test_unicode.py | motord/Motorcycle-Diaries | bb5e5e2d4d79573b4231e760d7662db26c03a55e | [
"BSD-3-Clause"
] | 6 | 2015-02-23T06:47:09.000Z | 2015-06-04T20:31:30.000Z | lib/simplejson/tests/test_unicode.py | motord/Motorcycle-Diaries | bb5e5e2d4d79573b4231e760d7662db26c03a55e | [
"BSD-3-Clause"
] | 13 | 2015-01-26T01:39:45.000Z | 2022-03-09T16:45:09.000Z | from unittest import TestCase
import simplejson as json
class TestUnicode(TestCase):
def test_encoding1(self):
encoder = json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
js = en... | 42.34 | 78 | 0.600614 |
f73e7006359c26e3644c0d15ff717fc875f2b778 | 88 | py | Python | helpers/__init__.py | r-luo/QA-Summary | 219dbbd306a85f73c126ad73ef7421c5450afbfc | [
"MIT"
] | null | null | null | helpers/__init__.py | r-luo/QA-Summary | 219dbbd306a85f73c126ad73ef7421c5450afbfc | [
"MIT"
] | null | null | null | helpers/__init__.py | r-luo/QA-Summary | 219dbbd306a85f73c126ad73ef7421c5450afbfc | [
"MIT"
] | null | null | null | from . import utils
from . import data_prep
from . import seq2seq
from . import word2vec | 22 | 23 | 0.784091 |
f73e70ef65fd2d764ecf1cc60292802342d9661f | 5,821 | py | Python | NeuralATT/train.py | INK-USC/shifted-label-distribution | 3cf2b7ced3b2e18234db405f6014f049c4830d71 | [
"Apache-2.0"
] | 37 | 2019-10-29T13:12:41.000Z | 2022-01-20T02:42:28.000Z | NeuralATT/train.py | INK-USC/shifted-label-distribution | 3cf2b7ced3b2e18234db405f6014f049c4830d71 | [
"Apache-2.0"
] | 5 | 2020-07-23T10:32:59.000Z | 2021-09-01T11:37:15.000Z | NeuralATT/train.py | INK-USC/shifted-label-distribution | 3cf2b7ced3b2e18234db405f6014f049c4830d71 | [
"Apache-2.0"
] | 2 | 2020-05-27T06:00:56.000Z | 2021-02-08T10:45:41.000Z | '''
Training script with ramdom splitting dev set
'''
__author__ = 'Maosen'
import torch
from model import Model, Wrapper
import utils
from utils import Dataset
import argparse
import pickle
import numpy as np
from tqdm import tqdm
import logging
import os
import random
torch.backends.cudnn.deterministic = True
def ... | 38.296053 | 109 | 0.716715 |
f73e7218a3eaf4998f4b32f6977df96bbf9d95ba | 70,207 | py | Python | ThirdParty/Twisted/twisted/internet/test/test_tcp.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 1 | 2021-10-13T01:57:14.000Z | 2021-10-13T01:57:14.000Z | ThirdParty/Twisted/twisted/internet/test/test_tcp.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | null | null | null | ThirdParty/Twisted/twisted/internet/test/test_tcp.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 5 | 2015-10-09T04:12:29.000Z | 2021-12-15T16:57:11.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorTCP} and the TCP parts of
L{IReactorSocket}.
"""
from __future__ import division, absolute_import
__metaclass__ = type
import socket, errno
from zope.interface import implementer
from twisted.python.... | 33.543717 | 86 | 0.643169 |
f73e750bba87126ae1daf9bf2beb2f6676d31d68 | 440 | py | Python | test/rules/test_drowning_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-23T12:57:47.000Z | 2020-04-18T17:13:08.000Z | test/rules/test_drowning_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-09T22:10:07.000Z | 2022-02-16T04:57:06.000Z | test/rules/test_drowning_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 11 | 2018-12-11T22:01:13.000Z | 2022-01-07T11:38:02.000Z | from smartva.rules import drowning_adult as drowning
from smartva.data.constants import *
VA = Adult
def test_pass():
row = {
VA.DROWNING: YES,
VA.INJURY_DAYS: 0,
}
assert drowning.logic_rule(row) is True
def test_fail_drowning():
row = {
VA.DROWNING: NO,
}
assert ... | 15.714286 | 52 | 0.647727 |
f73eeadec33885d91247f63d260772f3be335b8a | 543 | py | Python | devices/master/plugins/epg_sat/read_epg_json.py | stko/Schnipsl | 824572c657e48f18950f584b9529661ff5bb8069 | [
"MIT"
] | null | null | null | devices/master/plugins/epg_sat/read_epg_json.py | stko/Schnipsl | 824572c657e48f18950f584b9529661ff5bb8069 | [
"MIT"
] | 29 | 2020-08-30T15:07:50.000Z | 2022-02-19T03:41:26.000Z | devices/master/plugins/epg_sat/read_epg_json.py | wifitvbox/Schnipsl | 553ce8de3dda26fb92297ad76e92f4a363070e4e | [
"MIT"
] | 1 | 2020-12-28T05:46:17.000Z | 2020-12-28T05:46:17.000Z | import sys
import json
from datetime import datetime
lastEnd=0
with open(sys.argv[1]) as json_file:
data = json.load(json_file)
times=sorted(list(data['details']))
for time in times:
p=data['details'][time]
print('{0} {1} {2}-{3}'.format(
datetime.utcfromtimestamp(p['unixTimeBegin']).strftime('%Y-%m-%d %H:%... | 24.681818 | 84 | 0.627993 |
f73f0d91c0a845a03c5aa376fc702205ae303d8d | 15,525 | py | Python | python/dgl/backend/pytorch/tensor.py | m30m/dgl | 2190c39d674f76c65db9ee8da7b43d3021f19c29 | [
"Apache-2.0"
] | null | null | null | python/dgl/backend/pytorch/tensor.py | m30m/dgl | 2190c39d674f76c65db9ee8da7b43d3021f19c29 | [
"Apache-2.0"
] | null | null | null | python/dgl/backend/pytorch/tensor.py | m30m/dgl | 2190c39d674f76c65db9ee8da7b43d3021f19c29 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from distutils.version import LooseVersion
import scipy # Weird bug in new pytorch when import scipy after import torch
import torch as th
import builtins
from torch.utils import dlpack
from ... import ndarray as nd
from ... import kernel as K
from ...function.base import Targe... | 32.753165 | 97 | 0.647923 |
f73f2e392b1048abb55918b907c099ee620e895d | 4,317 | py | Python | hint/01-theo-BTC/02_DQN-5-cations/02_closest-gold/Miner-Testing-CodeSample-Approach1/build/MINER_STATE.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | null | null | null | hint/01-theo-BTC/02_DQN-5-cations/02_closest-gold/Miner-Testing-CodeSample-Approach1/build/MINER_STATE.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | 1 | 2022-02-10T02:27:10.000Z | 2022-02-10T02:27:10.000Z | hint/01/Miner-Testing-CodeSample-Approach1/build/MINER_STATE.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | null | null | null | import json
def str_2_json(str):
return json.loads(str, encoding="utf-8")
class MapInfo:
def __init__(self):
self.max_x = 0
self.max_y = 0
self.golds = []
self.obstacles = []
self.numberOfPlayers = 0
self.maxStep = 0
def init_map(self, gameInfo):
... | 34.261905 | 111 | 0.53602 |
f73f489ea063e8b9e9554048a835bc880960f5fa | 1,953 | py | Python | src/transformersX/models/cutoffbert/__init__.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | 2 | 2021-08-06T05:43:55.000Z | 2022-03-17T22:31:21.000Z | src/transformersX/models/mixupbert/__init__.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | null | null | null | src/transformersX/models/mixupbert/__init__.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 35.509091 | 100 | 0.746544 |
f73f4aaa08bd84d8c1c9f1dc02b6dd9f0812127c | 13,782 | py | Python | nxsdk_modules_ncl/dnn/composable/composable_dnn.py | event-driven-robotics/models | 5e5b6521b8bcab6e3576e177784baaed57fd5280 | [
"BSD-3-Clause"
] | 54 | 2020-03-04T17:37:17.000Z | 2022-02-22T13:16:10.000Z | nxsdk_modules_ncl/dnn/composable/composable_dnn.py | lyes-khacef/models | a8b6e2a83d4842eb99878d3fa53cd92f4c6b3db8 | [
"BSD-3-Clause"
] | 9 | 2020-08-26T13:17:54.000Z | 2021-11-09T09:02:00.000Z | nxsdk_modules_ncl/dnn/composable/composable_dnn.py | lyes-khacef/models | a8b6e2a83d4842eb99878d3fa53cd92f4c6b3db8 | [
"BSD-3-Clause"
] | 26 | 2020-03-18T17:09:34.000Z | 2021-11-22T16:23:14.000Z | #
# Copyright © 2020 Intel Corporation.
#
# This software and the related documents are Intel copyrighted
# materials, and your use of them is governed by the express
# license under which they were provided to you (License). Unless
# the License provides otherwise, you may not use, modify, copy,
# publish, distrib... | 45.787375 | 120 | 0.640473 |
f73f60dc33ae48a27d08b16b6d6d0fc00917447b | 6,397 | py | Python | augly/video/helpers/ffmpeg.py | Adib234/AugLy | 35a6a5de07e64f465b8979e3257218551929e57a | [
"MIT"
] | null | null | null | augly/video/helpers/ffmpeg.py | Adib234/AugLy | 35a6a5de07e64f465b8979e3257218551929e57a | [
"MIT"
] | null | null | null | augly/video/helpers/ffmpeg.py | Adib234/AugLy | 35a6a5de07e64f465b8979e3257218551929e57a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
import io
import math
import os
import shutil
from typing import Any, Dict, Optional, Union
import augly.audio.utils as audutils
import ffmpeg
import numpy as np
from augly.utils import pathmgr, SILENT_AUDIO_PATH
from augly.utils.ffmpeg import ... | 32.308081 | 85 | 0.659997 |
f73f6d3bf17cca6dc52756b61d166c3225f1b7e1 | 1,272 | py | Python | import_faces.py | vignettist/image-import | 7fd8860e3f5cd1011d98d5a2137327e304cbd884 | [
"MIT"
] | null | null | null | import_faces.py | vignettist/image-import | 7fd8860e3f5cd1011d98d5a2137327e304cbd884 | [
"MIT"
] | null | null | null | import_faces.py | vignettist/image-import | 7fd8860e3f5cd1011d98d5a2137327e304cbd884 | [
"MIT"
] | null | null | null | import openface
import cv2
class FaceFinder:
def __init__(self):
self.align = openface.AlignDlib("models/dlib/shape_predictor_68_face_landmarks.dat")
self.net = openface.TorchNeuralNet("models/openface/nn4.small2.v1.t7", 96)
def getFaces(self, imgPath):
bgrImg = cv2.imread(imgPath)
... | 35.333333 | 93 | 0.555031 |
f73f982d51bce455f556a08b6f3c83529ec286cd | 7,733 | py | Python | plugins/opencv/src/opencv/__init__.py | erikolofsson/scrypted | 39016a617464003cac13719a426eefcc2421e51a | [
"MIT"
] | null | null | null | plugins/opencv/src/opencv/__init__.py | erikolofsson/scrypted | 39016a617464003cac13719a426eefcc2421e51a | [
"MIT"
] | null | null | null | plugins/opencv/src/opencv/__init__.py | erikolofsson/scrypted | 39016a617464003cac13719a426eefcc2421e51a | [
"MIT"
] | null | null | null | from __future__ import annotations
from time import sleep
from detect import DetectionSession, DetectPlugin
from typing import Any, List
import numpy as np
import cv2
import imutils
from gi.repository import GLib, Gst
from scrypted_sdk.types import ObjectDetectionModel, ObjectDetectionResult, ObjectsDetected
class Ope... | 38.472637 | 184 | 0.608431 |
f73fae25872282f55556165e302753b5a8c0c263 | 1,032 | py | Python | tests/tf/examples/test_01_getting_started.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | null | null | null | tests/tf/examples/test_01_getting_started.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | null | null | null | tests/tf/examples/test_01_getting_started.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | null | null | null | from testbook import testbook
from tests.conftest import REPO_ROOT
@testbook(REPO_ROOT / "examples/01-Getting-started.ipynb", execute=False)
def test_func(tb):
tb.inject(
"""
from unittest.mock import patch
from merlin.datasets.synthetic import generate_data
mock_train, mock_valid... | 29.485714 | 73 | 0.627907 |
f73fb2a8a307bf6009f2b5f26b6e89cf305daae6 | 3,771 | py | Python | pysimt/utils/filterchain.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 34 | 2020-09-21T10:49:57.000Z | 2022-01-08T04:50:42.000Z | pysimt/utils/filterchain.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 2 | 2021-01-08T03:52:51.000Z | 2021-09-10T07:45:05.000Z | pysimt/utils/filterchain.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 5 | 2021-04-23T09:30:51.000Z | 2022-01-09T08:40:45.000Z | import re
import pathlib
from typing import List, Union
from .resource_mgr import res_mgr
from .io import fopen
class FilterChain:
"""A sequential filter chain to post-process list of tokens. The **available
filters are:**
`c2w`: Stitches back space delimited characters to words.
Necessary for w... | 37.336634 | 86 | 0.563511 |
f73fc1c99f41a3f9d8453faeb6830db314e02382 | 13,650 | py | Python | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/aio/operations/_metastore_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/aio/operations/_metastore_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/aio/operations/_metastore_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 43.196203 | 153 | 0.659487 |
f73fe7eed2cb84dff0a06a8c9956db29b0f9bb02 | 6,481 | py | Python | apps/dot_ext/forms.py | TransparentHealth/bluebutton-web-server | 69b6e649b2e9caf7859a75ea3867bf74c83ca340 | [
"Apache-2.0"
] | 1 | 2020-01-26T16:02:27.000Z | 2020-01-26T16:02:27.000Z | apps/dot_ext/forms.py | TransparentHealth/bluebutton-web-server | 69b6e649b2e9caf7859a75ea3867bf74c83ca340 | [
"Apache-2.0"
] | null | null | null | apps/dot_ext/forms.py | TransparentHealth/bluebutton-web-server | 69b6e649b2e9caf7859a75ea3867bf74c83ca340 | [
"Apache-2.0"
] | 2 | 2018-09-29T18:53:08.000Z | 2020-01-26T16:02:31.000Z | from django.utils.safestring import mark_safe
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from oauth2_provider.forms import AllowForm as DotAllowForm
from oauth2_provider.models import get_application_model
from oauth2_provider.scopes import get_scop... | 39.518293 | 126 | 0.629841 |
f74060c1de71240f9718b12324bf4e301a79653a | 8,680 | py | Python | python/infinoted.py | speedyleion/vobby | 7369afb52184358130dd4143a2a19e4c1dbb7ecf | [
"Unlicense"
] | null | null | null | python/infinoted.py | speedyleion/vobby | 7369afb52184358130dd4143a2a19e4c1dbb7ecf | [
"Unlicense"
] | null | null | null | python/infinoted.py | speedyleion/vobby | 7369afb52184358130dd4143a2a19e4c1dbb7ecf | [
"Unlicense"
] | null | null | null | """
This handles the communication to an infinoted server
"""
from twisted.internet import reactor
from twisted.internet.defer import Deferred
from twisted.names.srvconnect import SRVConnector
from twisted.words.xish import domish
from twisted.words.protocols.jabber import xmlstream, client
from twisted.words.protocol... | 38.070175 | 90 | 0.574539 |
f74063724c532a90b8fe454df280bd34fbbc81f0 | 8,355 | py | Python | third_party/WebKit/Source/devtools/PRESUBMIT.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | third_party/WebKit/Source/devtools/PRESUBMIT.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/WebKit/Source/devtools/PRESUBMIT.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright (C) 2014 Google Inc. 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 and the ... | 50.331325 | 155 | 0.735727 |
f7409aa4a047d52ccbf948a6164682ae33e8686a | 1,025 | py | Python | test_project/test_project/urls.py | mpasternak/django-nginx-http-push-stream | 9689071ca53fe958c9652dafe87316ed097a1ec8 | [
"MIT"
] | 4 | 2019-01-19T15:56:52.000Z | 2020-01-16T08:13:50.000Z | test_project/test_project/urls.py | mpasternak/django-nginx-http-push-stream | 9689071ca53fe958c9652dafe87316ed097a1ec8 | [
"MIT"
] | 3 | 2019-03-01T18:13:12.000Z | 2021-06-10T21:08:35.000Z | test_project/test_project/urls.py | mpasternak/django-nginx-http-push-stream | 9689071ca53fe958c9652dafe87316ed097a1ec8 | [
"MIT"
] | null | null | null | """test_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 36.607143 | 77 | 0.725854 |
f740b71e6b91cf892d29dabb0041c1e46760b9cc | 5,955 | py | Python | leetcode_python/Two_Pointers/linked-list-cycle-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Two_Pointers/linked-list-cycle-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Two_Pointers/linked-list-cycle-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
142. Linked List Cycle II
Medium
Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote t... | 27.068182 | 322 | 0.560705 |
f7410499d1122699b82ce6a7c68b6aaced6ae347 | 578 | py | Python | lab/refactoring/replace_nested_conditional_with_guard_clauses.py | sprajjwal/spd2.3-Testing_and_Architecture | 333e4e191d51eae3f8e84b2aca2f2f63731a22aa | [
"MIT"
] | null | null | null | lab/refactoring/replace_nested_conditional_with_guard_clauses.py | sprajjwal/spd2.3-Testing_and_Architecture | 333e4e191d51eae3f8e84b2aca2f2f63731a22aa | [
"MIT"
] | null | null | null | lab/refactoring/replace_nested_conditional_with_guard_clauses.py | sprajjwal/spd2.3-Testing_and_Architecture | 333e4e191d51eae3f8e84b2aca2f2f63731a22aa | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Replace nested conditional with guard clauses
def extract_position(line):
if line is not None and "x:" in line:
start_index = line.find("x:") + 2
pos = line[start_index:] # from start_index to the end.
else:
pos = None
return pos
if __name__ == "... | 28.9 | 85 | 0.640138 |
f74105373cdd2d7cc2a1c4cfafa7abdd7842398a | 4,119 | py | Python | sunpy/tests/setup_command.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/tests/setup_command.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/tests/setup_command.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This file is designed to be imported and ran only via setup.py, hence it's
dependency on astropy_helpers which will be available in that context.
"""
import os
import copy
from astropy_helpers.commands.test import AstropyTest
class SunPyTest(AstropyTest):
description = 'Run the tests ... | 38.858491 | 96 | 0.53144 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.