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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d57aea2a52385c60d40b2a025655e8a392ffeb91 | 1,003 | py | Python | calib/record_depth_and_joints.py | wjchen84/rapprentice | 9232a6a21e2c80f00854912f07dcdc725b0be95a | [
"BSD-2-Clause"
] | 23 | 2015-08-25T19:40:18.000Z | 2020-12-27T09:23:06.000Z | calib/record_depth_and_joints.py | wjchen84/rapprentice | 9232a6a21e2c80f00854912f07dcdc725b0be95a | [
"BSD-2-Clause"
] | null | null | null | calib/record_depth_and_joints.py | wjchen84/rapprentice | 9232a6a21e2c80f00854912f07dcdc725b0be95a | [
"BSD-2-Clause"
] | 8 | 2016-05-18T20:13:06.000Z | 2020-11-03T16:09:50.000Z | import cloudprocpy
import rospy
from rapprentice.PR2 import TopicListener
import sensor_msgs.msg as sm
import numpy as np
rospy.init_node("record_d_and_j", disable_signals = True)
grabber = cloudprocpy.CloudGrabber()
grabber.startRGBD()
joint_listener = TopicListener("/joint_states", sm.JointState)
depth_images =... | 22.795455 | 119 | 0.66999 |
d57b533dd9912574522c07062519fd24ef01b7b7 | 2,222 | py | Python | venv/Lib/site-packages/pyrogram/raw/base/file_hash.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/raw/base/file_hash.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/raw/base/file_hash.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 37.033333 | 93 | 0.635464 |
d57b8a9c9e0a65dfae53498a78e030b3ffd459a9 | 2,338 | py | Python | axonius_api_client/cli/grp_tools/cmd_system_status.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 11 | 2020-01-31T00:28:26.000Z | 2022-03-25T20:27:08.000Z | axonius_api_client/cli/grp_tools/cmd_system_status.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 83 | 2020-01-22T12:52:38.000Z | 2022-02-07T16:20:18.000Z | axonius_api_client/cli/grp_tools/cmd_system_status.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 16 | 2019-08-23T17:44:31.000Z | 2022-01-06T00:57:34.000Z | # -*- coding: utf-8 -*-
"""Command line interface for Axonius API Client."""
import datetime
import time
import click
from ...api import Signup
from ...tools import dt_now
from ..context import CONTEXT_SETTINGS
from ..options import URL, add_options
OPTIONS = [
URL,
click.option(
"--wait/--no-wait",
... | 26.269663 | 71 | 0.564157 |
d57b912e290e30ff0c099c93fe1df22cfbb041c6 | 653 | py | Python | enrico/ExtractFits.py | mireianievas/enrico | 2bd8949e388df7f1065629c299de8fde2ded5274 | [
"BSD-3-Clause"
] | 14 | 2017-03-17T05:37:14.000Z | 2021-04-05T22:26:29.000Z | enrico/ExtractFits.py | mireianievas/enrico | 2bd8949e388df7f1065629c299de8fde2ded5274 | [
"BSD-3-Clause"
] | 87 | 2015-01-07T14:24:06.000Z | 2022-02-10T11:41:32.000Z | enrico/ExtractFits.py | gammapy/enrico | 995383cc0edf493f232998e2bd253be270a4a671 | [
"BSD-3-Clause"
] | 20 | 2015-02-18T19:01:34.000Z | 2020-06-14T21:27:32.000Z | #!/usr/bin/env python
from enrico.RunGTlike import Analysis
import sys
from enrico import utils
from enrico import Loggin
from enrico.config import get_config
if __name__ == '__main__':
mes = Loggin.Message()
try:
infile = sys.argv[1]
except:
print(('Usage: '+sys.argv[0]+' <config file nam... | 28.391304 | 80 | 0.63706 |
d57b9c16e163efdb4f6c69905229c06b3ddc5224 | 3,845 | py | Python | tests/test_provider_iwarapter_pingaccess.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | tests/test_provider_iwarapter_pingaccess.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | tests/test_provider_iwarapter_pingaccess.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # tests/test_provider_iwarapter_pingaccess.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:24:33 UTC)
def test_provider_import():
import terrascript.provider.iwarapter.pingaccess
def test_resource_import():
from terrascript.resource.iwarapter.pingaccess import (
pingaccess_access_t... | 33.434783 | 88 | 0.801821 |
d57be3ddf8b3fd700ae1bef92376c09cf7332fd2 | 1,347 | py | Python | alien.py | zark3in/alien-invasion | 1fd389ebf59d10f40833b739fc2a1bd06f84e26d | [
"MIT"
] | null | null | null | alien.py | zark3in/alien-invasion | 1fd389ebf59d10f40833b739fc2a1bd06f84e26d | [
"MIT"
] | null | null | null | alien.py | zark3in/alien-invasion | 1fd389ebf59d10f40833b739fc2a1bd06f84e26d | [
"MIT"
] | null | null | null | import pygame
from pygame.sprite import Sprite
class Alien(Sprite):
"""A class to represent a single alien in the fleet."""
def __init__(self, ai_settings, screen):
"""Initialize the alien, and set its starting position."""
super(Alien, self).__init__()
self.screen = screen
sel... | 32.853659 | 66 | 0.602821 |
d57bf67799bfbd3e746451578b8bbd69cf69d371 | 5,527 | py | Python | leetcode_python/Array/lemonade-change.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/lemonade-change.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/lemonade-change.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
860. Lemonade Change
Easy
At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each custo... | 30.202186 | 349 | 0.485254 |
d57c25104aa227c0ab74427b83bdfd26a9a9bed3 | 985 | py | Python | python/setup.py | databricks/spark-package-cmd-tool | 74a6fceb9a60426ff46207789652e4b43bfb5a69 | [
"Apache-2.0"
] | 22 | 2015-03-07T21:29:34.000Z | 2020-05-28T01:17:29.000Z | python/setup.py | databricks/spark-package-cmd-tool | 74a6fceb9a60426ff46207789652e4b43bfb5a69 | [
"Apache-2.0"
] | 15 | 2015-07-18T05:13:31.000Z | 2018-09-21T02:29:24.000Z | python/setup.py | databricks/spark-package-cmd-tool | 74a6fceb9a60426ff46207789652e4b43bfb5a69 | [
"Apache-2.0"
] | 12 | 2015-06-19T20:11:05.000Z | 2019-10-23T11:42:58.000Z | from setuptools import setup
from os import listdir, path
resource_files = listdir(path.join('spark_package', 'resources'))
resource_files = [f for f in resource_files if not path.isdir(f) and 'license_temps' not in f]
setup(
name='spark-package',
version="0.4.1",
description="A command line tool for crea... | 44.772727 | 126 | 0.722843 |
d57c54d31a3e2efb75928268fa62472cbe5e6140 | 1,582 | py | Python | mac-py27-venv-designateclient/osc/plugin.py | naototty/python-conohadns-client | 04f360450d2e1a6020d2870272d8125cb112fa01 | [
"Apache-2.0"
] | null | null | null | mac-py27-venv-designateclient/osc/plugin.py | naototty/python-conohadns-client | 04f360450d2e1a6020d2870272d8125cb112fa01 | [
"Apache-2.0"
] | null | null | null | mac-py27-venv-designateclient/osc/plugin.py | naototty/python-conohadns-client | 04f360450d2e1a6020d2870272d8125cb112fa01 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hp.com>
#
# 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/lice... | 31.64 | 77 | 0.714286 |
d57c5acad001a68c8074c319ca50c08cd613d797 | 24,632 | py | Python | hive/indexer/community.py | hidraco/hivemind | 92649f676d498b990f56879ba73f589e2057ab91 | [
"MIT"
] | 78 | 2017-03-09T15:33:08.000Z | 2022-03-30T06:01:19.000Z | hive/indexer/community.py | hidraco/hivemind | 92649f676d498b990f56879ba73f589e2057ab91 | [
"MIT"
] | 193 | 2017-04-25T19:39:20.000Z | 2021-06-29T01:53:53.000Z | hive/indexer/community.py | hidraco/hivemind | 92649f676d498b990f56879ba73f589e2057ab91 | [
"MIT"
] | 68 | 2017-05-07T17:31:08.000Z | 2021-08-23T01:17:00.000Z | """[WIP] Process community ops."""
#pylint: disable=too-many-lines
import logging
import re
from enum import IntEnum
import ujson as json
from hive.db.adapter import Db
from hive.indexer.accounts import Accounts
from hive.indexer.notify import Notify
from hive.db.db_state import DbState
log = logging.getLogger(__na... | 39.537721 | 91 | 0.564144 |
d57c811bc9b6d118ebd3c101d8e44514b48162e5 | 36,024 | py | Python | ramses_rf/protocol/command.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 24 | 2019-12-12T20:54:39.000Z | 2021-03-25T15:40:26.000Z | ramses_rf/protocol/command.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 9 | 2020-10-21T23:01:06.000Z | 2021-04-22T09:59:50.000Z | ramses_rf/protocol/command.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 - a RAMSES-II protocol decoder & analyser.
Construct a command (packet that is to be sent).
"""
import asyncio
import functools
import json
import logging
from datetime import datetime as dt
from datetime import timedelta as td
from types import SimpleName... | 34.571977 | 89 | 0.598906 |
d57c879b5a6a33f1b305f26d70967e08ed64f805 | 34 | py | Python | assignment2/util/fancy.py | nouhadziri/Information-Retreival | 664f26307ede1810d253fbf0e00c499dd32998ab | [
"MIT"
] | 1 | 2022-03-24T12:09:14.000Z | 2022-03-24T12:09:14.000Z | ops/util/fancy.py | nouhadziri/Information-Retreival | 664f26307ede1810d253fbf0e00c499dd32998ab | [
"MIT"
] | null | null | null | ops/util/fancy.py | nouhadziri/Information-Retreival | 664f26307ede1810d253fbf0e00c499dd32998ab | [
"MIT"
] | null | null | null |
RED = '\033[0;31m'
NC = '\033[0m' | 11.333333 | 18 | 0.5 |
d57c9033670aaeacc1e7b564c77b75e0541b4ba5 | 34,451 | py | Python | azure/multiapi/storagev2/filedatalake/v2019_12_12/_path_client.py | xolve/azure-multiapi-storage-python | 47509479427c879f18c554e451e838453d47c2bd | [
"MIT"
] | 3 | 2019-02-21T20:46:26.000Z | 2021-06-22T15:35:52.000Z | azure/multiapi/storagev2/filedatalake/v2019_12_12/_path_client.py | xolve/azure-multiapi-storage-python | 47509479427c879f18c554e451e838453d47c2bd | [
"MIT"
] | 11 | 2017-10-05T18:20:40.000Z | 2020-10-10T09:20:19.000Z | azure/multiapi/storagev2/filedatalake/v2019_12_12/_path_client.py | xolve/azure-multiapi-storage-python | 47509479427c879f18c554e451e838453d47c2bd | [
"MIT"
] | 15 | 2017-10-02T18:48:20.000Z | 2022-03-03T14:03:49.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
try:
... | 53.001538 | 120 | 0.653189 |
d57ca66b3a8475726b44efd6bed983e5f24832b8 | 756 | py | Python | easy/Intersection of Two Linked Lists/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | 8 | 2021-08-21T19:10:04.000Z | 2022-03-11T14:30:02.000Z | easy/Intersection of Two Linked Lists/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | null | null | null | easy/Intersection of Two Linked Lists/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: Find length of both list, advance longer list with extra length and advance both simultaneously.
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def getLen(self, a):
tm... | 29.076923 | 108 | 0.560847 |
d57cbb897a71f2b4aebe5bf4d03b0a71fd63323c | 11,877 | py | Python | cm4/openstack/OpenstackCM.py | swsachith/cm | d99837917f0dafe60c25829cf78ae77bbe02bd85 | [
"Apache-2.0"
] | null | null | null | cm4/openstack/OpenstackCM.py | swsachith/cm | d99837917f0dafe60c25829cf78ae77bbe02bd85 | [
"Apache-2.0"
] | null | null | null | cm4/openstack/OpenstackCM.py | swsachith/cm | d99837917f0dafe60c25829cf78ae77bbe02bd85 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Modified on Tue Nov 15 2018
@author: Kimball Wu
@author: Rui
"""
import os
import subprocess
import pprint
from cm4.abstractclass.CloudManagerABC import CloudManagerABC
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from cm4.configuration.conf... | 32.629121 | 129 | 0.578597 |
d57d020325ac0e79a9ccfe60fcfd10914cc0cfcc | 143 | py | Python | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-ogoj01 | 7d5ae9cc2698d8203e0f223d36b1c5dd75f6ab8d | [
"Apache-2.0"
] | null | null | null | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-ogoj01 | 7d5ae9cc2698d8203e0f223d36b1c5dd75f6ab8d | [
"Apache-2.0"
] | null | null | null | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-ogoj01 | 7d5ae9cc2698d8203e0f223d36b1c5dd75f6ab8d | [
"Apache-2.0"
] | null | null | null | # noinspection PyShadowingBuiltins,PyUnusedLocal
def compute(value1: int, value2: int) -> int:
return int(value1 + value2)
| 23.833333 | 48 | 0.671329 |
d57d1f280a9fd9f56e2be0815805bfec46613760 | 162 | py | Python | savu/plugins/corrections/base_correction_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/corrections/base_correction_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/corrections/base_correction_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | from savu.plugins.plugin_tools import PluginTools
class BaseCorrectionTools(PluginTools):
"""A base class for dark and flat field correction plugins.
""" | 32.4 | 63 | 0.771605 |
d57d38833831f90fc633d626e0dc2a7f60a8f751 | 5,867 | py | Python | tuna/parts/tests/testxysolution.py | russellnakamura/thetuna | 0e445baf780fb65e1d92fe1344ebdf21bf81573c | [
"MIT"
] | null | null | null | tuna/parts/tests/testxysolution.py | russellnakamura/thetuna | 0e445baf780fb65e1d92fe1344ebdf21bf81573c | [
"MIT"
] | null | null | null | tuna/parts/tests/testxysolution.py | russellnakamura/thetuna | 0e445baf780fb65e1d92fe1344ebdf21bf81573c | [
"MIT"
] | null | null | null |
# python standard library
import unittest
import random
# third-party
import numpy
from mock import MagicMock
# this package
from optimization.parts.xysolution import XYSolution
from optimization.parts.xysolution import XYSolutionGenerator
class TestXYSolution(unittest.TestCase):
def setUp(self):
self.... | 31.042328 | 82 | 0.585478 |
d57d39570de8bc6710bf2265c75f1e84b83c9c96 | 1,701 | py | Python | src/tests/test_auth.py | andela/andela-societies-backend | b8382f308449a08e5c7bda46c6deabe597cc2e25 | [
"MIT"
] | 1 | 2018-09-13T16:33:20.000Z | 2018-09-13T16:33:20.000Z | src/tests/test_auth.py | jonathankamau/andela-societies-backend | b8382f308449a08e5c7bda46c6deabe597cc2e25 | [
"MIT"
] | 6 | 2019-03-11T17:50:27.000Z | 2019-08-26T11:00:40.000Z | src/tests/test_auth.py | jonathankamau/andela-societies-backend | b8382f308449a08e5c7bda46c6deabe597cc2e25 | [
"MIT"
] | 9 | 2019-01-09T12:23:12.000Z | 2021-05-28T04:58:31.000Z | """Authorization Test Suite."""
from .base_test import BaseTestCase
class AuthTestCase(BaseTestCase):
"""Test authentication functionality."""
def test_invalid_token(self):
"""Test response message if token is invalid."""
invalid_token = {"Authorization": "WQ!DFTTEwqsds$4"}
response =... | 34.714286 | 76 | 0.637272 |
d57d650e00c27ad34ea2606c0257f39a03171aff | 40,610 | py | Python | utest/controller/test_commands.py | chandrapola/RIDE | 08e01b98026b618359e47689cb5e65a0a67795f5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | utest/controller/test_commands.py | chandrapola/RIDE | 08e01b98026b618359e47689cb5e65a0a67795f5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | utest/controller/test_commands.py | chandrapola/RIDE | 08e01b98026b618359e47689cb5e65a0a67795f5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | 43.340448 | 109 | 0.56331 |
d57d68782c4b1a38dc7ed2facc9f31a9c5ab2807 | 929 | py | Python | setup.py | Weilbyte/pfp_lgbt.py | f7f5fa6a2e7686bfafc8ced54f615e33aa7f05c8 | [
"MIT"
] | null | null | null | setup.py | Weilbyte/pfp_lgbt.py | f7f5fa6a2e7686bfafc8ced54f615e33aa7f05c8 | [
"MIT"
] | 1 | 2021-07-04T02:45:09.000Z | 2021-07-04T02:45:09.000Z | setup.py | Weilbyte/pfp_lgbt.py | f7f5fa6a2e7686bfafc8ced54f615e33aa7f05c8 | [
"MIT"
] | 1 | 2021-06-30T14:57:15.000Z | 2021-06-30T14:57:15.000Z | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='pfp_lgbt',
version='1.0.2',
author='Weilbyte',
description='Python API Wrapper for https://pfp.lgbt/',
long_description=long_description,
long_description_content_type='text/markdown',... | 32.034483 | 71 | 0.628633 |
d57d827cdd037d4adaa67712463bfc4a78ad45f5 | 6,975 | py | Python | python/ray/profiling.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 2 | 2019-10-08T13:31:08.000Z | 2019-10-22T18:34:52.000Z | python/ray/profiling.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 1 | 2018-12-26T01:09:50.000Z | 2018-12-26T01:09:50.000Z | python/ray/profiling.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 6 | 2019-03-12T05:37:35.000Z | 2020-03-09T12:25:17.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import time
import threading
import traceback
import ray
LOG_POINT = 0
LOG_SPAN_START = 1
LOG_SPAN_END = 2
class _NullLogSpan(object):
"""A log span context manager that does nothing"""
... | 33.214286 | 79 | 0.623226 |
d57d85656f83630eed6e91156d24712aa8fe533f | 15,486 | py | Python | doc/test/test-data-provider/weibo_spider/parser/page_parser.py | baijunhan/data-flow | 7cba999c49dd38a4d4afe9f9076cda80b3c6ea7c | [
"Apache-2.0"
] | 1 | 2021-01-16T16:21:20.000Z | 2021-01-16T16:21:20.000Z | doc/test/test-data-provider/weibo_spider/parser/page_parser.py | baijunhan/data-flow | 7cba999c49dd38a4d4afe9f9076cda80b3c6ea7c | [
"Apache-2.0"
] | 6 | 2021-08-31T21:49:48.000Z | 2022-03-02T10:13:08.000Z | doc/test/test-data-provider/weibo_spider/parser/page_parser.py | baijunhan/data-flow | 7cba999c49dd38a4d4afe9f9076cda80b3c6ea7c | [
"Apache-2.0"
] | null | null | null | import logging
import re
import sys
from datetime import datetime, timedelta
from .. import datetime_util
from ..weibo import Weibo
from .comment_parser import CommentParser
from .mblog_picAll_parser import MblogPicAllParser
from .parser import Parser
from .util import handle_garbled, handle_html, to_video_download_ur... | 40.860158 | 105 | 0.491282 |
d57db728b861ffd1420a7e5328f54f6596d5dbc5 | 1,052 | py | Python | VillageMerger/components/classtools.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | 1 | 2015-04-23T11:43:26.000Z | 2015-04-23T11:43:26.000Z | VillageMerger/components/classtools.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | VillageMerger/components/classtools.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | # file classtools.py(new)
"Assorted class utilities and tools"
class AttrDisplay:
"""
Provides an inheritable display overload method that show instances with
their class name and a name=value pair for each attribute stored on the
instance itself(but not attributes inherited from its classes). Can be
... | 28.432432 | 76 | 0.609316 |
d57dcad28b675e9af036dab5b01ad0abe2352b13 | 528 | py | Python | tests/test_pydent/test_models/models/conftest.py | aquariumbio/trident | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 5 | 2019-01-21T11:12:05.000Z | 2020-03-05T20:52:14.000Z | tests/test_pydent/test_models/models/conftest.py | aquariumbio/pydent | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 28 | 2020-11-18T02:07:09.000Z | 2021-06-08T15:49:41.000Z | tests/test_pydent/test_models/models/conftest.py | aquariumbio/trident | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 2 | 2021-02-27T19:23:45.000Z | 2021-09-14T10:29:07.000Z | import json
import os
import pytest
here = os.path.abspath(os.path.dirname(__file__))
@pytest.fixture(scope="function")
def example_plan(fake_session):
with open(os.path.join(here, "plan_example.json"), "r") as f:
plan_data = json.load(f)
return fake_session.Plan.load(plan_data)
@pytest.fixture(sc... | 24 | 67 | 0.704545 |
d57dde10701b1829183ea19d278fd167b476b5db | 12,258 | py | Python | apischema/utils.py | kevinheavey/apischema | 6307a67c4545d1e16e1ee49bd44d9e0fd155820d | [
"MIT"
] | null | null | null | apischema/utils.py | kevinheavey/apischema | 6307a67c4545d1e16e1ee49bd44d9e0fd155820d | [
"MIT"
] | null | null | null | apischema/utils.py | kevinheavey/apischema | 6307a67c4545d1e16e1ee49bd44d9e0fd155820d | [
"MIT"
] | null | null | null | import collections.abc
import inspect
import re
import sys
import warnings
from contextlib import contextmanager, suppress
from dataclasses import dataclass, is_dataclass
from enum import Enum
from functools import wraps
from types import MappingProxyType
from typing import (
AbstractSet,
Any,
Awaitable,
... | 27.361607 | 90 | 0.646761 |
d57df444f8397d9fd6ea99d15b61fd90b96163c0 | 20 | py | Python | btd6_memory_info/generated/Assets/Scripts/Unity/Map/Triggers/triggers.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/Map/Triggers/triggers.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/Map/Triggers/triggers.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Triggers: pass | 20 | 20 | 0.85 |
d57e0b9828de120c618106a6da488460c3048d0f | 43 | py | Python | test/integration/dss/__init__.py | DataBiosphere/data-store-cli | d83776ac68d3c6c86de1714487803bbdf705fddf | [
"MIT"
] | null | null | null | test/integration/dss/__init__.py | DataBiosphere/data-store-cli | d83776ac68d3c6c86de1714487803bbdf705fddf | [
"MIT"
] | 41 | 2020-01-13T22:19:19.000Z | 2020-03-16T23:11:37.000Z | test/integration/dss/__init__.py | DataBiosphere/data-store-cli | d83776ac68d3c6c86de1714487803bbdf705fddf | [
"MIT"
] | null | null | null | TEST_BUCKET_NAME = "ucsc-cgp-dss-cli-test"
| 21.5 | 42 | 0.767442 |
d57e116f944519f2cfd78be2280ff73f5cac0f41 | 44,052 | py | Python | optics/fourier.py | indranilsinharoy/iutils | 1b102029306fa2947d69d8ca80d976d143f3d068 | [
"MIT"
] | null | null | null | optics/fourier.py | indranilsinharoy/iutils | 1b102029306fa2947d69d8ca80d976d143f3d068 | [
"MIT"
] | null | null | null | optics/fourier.py | indranilsinharoy/iutils | 1b102029306fa2947d69d8ca80d976d143f3d068 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------------------
# Name: foptics.py
# Purpose: Fourier Optics Utility Functions
#
# Author: Indranil Sinharoy
#
# Created: 09/22/2012
# Last Modified: 03/27/2017
# Copyright: (c) Indranil Si... | 35.554479 | 104 | 0.622582 |
d57e134540cd75d0e4091b9e01ff74f7e0038fdb | 3,484 | py | Python | test/base_test_context.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | test/base_test_context.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | test/base_test_context.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="base_test_context.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of... | 44.666667 | 110 | 0.666762 |
d57e24b28d98c05ed245df0082dbfe4ca3b540ed | 1,879 | py | Python | gargoyle/migrations/0001_initial.py | Raekkeri/gargoyle | 98153b3666264fddadd0f8e628acf5059e0e845e | [
"Apache-2.0"
] | 177 | 2015-01-01T03:51:01.000Z | 2021-05-28T14:01:31.000Z | gargoyle/migrations/0001_initial.py | Raekkeri/gargoyle | 98153b3666264fddadd0f8e628acf5059e0e845e | [
"Apache-2.0"
] | 23 | 2015-01-29T05:34:45.000Z | 2016-09-03T00:22:53.000Z | gargoyle/migrations/0001_initial.py | Raekkeri/gargoyle | 98153b3666264fddadd0f8e628acf5059e0e845e | [
"Apache-2.0"
] | 24 | 2015-01-12T14:07:18.000Z | 2022-01-09T04:53:56.000Z | # encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.utils.timezone import now as timezone_aware_now
except ImportError:
from datetime import datetime
timezone_aware_now = datetime.now
class Migration(SchemaMigration):
def forwar... | 39.978723 | 112 | 0.616817 |
d57e442a427f61627119c0fce80a6fb35adfa2f7 | 3,054 | py | Python | mtbparser/snv_parser.py | qbicsoftware/qbic-centraxx-mtb-wf | e8b96e34b27e457ea7def2927fe44017fa173ba7 | [
"MIT"
] | null | null | null | mtbparser/snv_parser.py | qbicsoftware/qbic-centraxx-mtb-wf | e8b96e34b27e457ea7def2927fe44017fa173ba7 | [
"MIT"
] | 1 | 2017-12-28T15:02:13.000Z | 2017-12-28T15:02:13.000Z | mtbparser/snv_parser.py | qbicsoftware/qbic-centraxx-mtb-wf | e8b96e34b27e457ea7def2927fe44017fa173ba7 | [
"MIT"
] | null | null | null | from .mtbparser_exception import MTBParserException
from .snv_item import SNVItem
class SnvParser:
"""
A parser class for somatic SNVs and small indels
as part of the Molecular Tumor Board data
provisioning in tumor diagnostics.
Please check the documentation of this module in order
to find out... | 39.153846 | 112 | 0.621807 |
d57e65eb4eec6dbd034e0b3804597081e521758b | 21,343 | py | Python | volttrontesting/platform/dbutils/test_mysqlfuncts.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | volttrontesting/platform/dbutils/test_mysqlfuncts.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | 4 | 2021-05-28T19:12:54.000Z | 2022-02-18T03:07:40.000Z | volttrontesting/platform/dbutils/test_mysqlfuncts.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | 3 | 2021-06-12T19:49:56.000Z | 2022-02-12T20:14:38.000Z | import datetime
import itertools
import os
import logging
import pytest
from time import time, sleep
try:
import mysql.connector
except ImportError:
pytest.skip(
"Required imports for testing are not installed; thus, not running tests. "
"Install imports with: python bootstrap.py --mysql",
... | 33.931638 | 115 | 0.654032 |
d57e73c5ce447a17ed3b79007662186e02a13557 | 5,503 | py | Python | oauth.py | nprapps/idp-georgia | 316eba6195b7f410567a7e11eb4811ff7cba54cc | [
"Unlicense"
] | 1 | 2017-04-15T01:48:27.000Z | 2017-04-15T01:48:27.000Z | oauth.py | nprapps/idp-georgia | 316eba6195b7f410567a7e11eb4811ff7cba54cc | [
"Unlicense"
] | 153 | 2017-04-14T18:06:26.000Z | 2017-06-02T13:08:09.000Z | oauth.py | nprapps/idp-georgia | 316eba6195b7f410567a7e11eb4811ff7cba54cc | [
"Unlicense"
] | 1 | 2021-02-18T11:15:52.000Z | 2021-02-18T11:15:52.000Z | import app_config
import codecs
import os
from app_config import authomatic
from authomatic.adapters import WerkzeugAdapter
from exceptions import KeyError
from flask import Blueprint, make_response, redirect, render_template, url_for
from functools import wraps
from render_utils import make_context
# Via: https://de... | 32.181287 | 122 | 0.68072 |
d57e9a29e0e12fef4e973ef8e276582acbc781b1 | 1,906 | py | Python | pyVmomi/set_note_R.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 3 | 2019-12-07T17:14:39.000Z | 2022-03-31T06:41:51.000Z | pyVmomi/set_note_R.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 10 | 2019-12-08T06:37:55.000Z | 2022-02-10T11:41:09.000Z | pyVmomi/set_note_R.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 9 | 2020-06-28T01:08:35.000Z | 2020-07-26T03:51:47.000Z | #!/usr/bin/env python
# Copyright 2014 Michael Rice
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 29.78125 | 74 | 0.659496 |
d57ec7fb46f6c71c2d9bb7e4ab91d54049505927 | 2,545 | py | Python | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_search_counters.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_search_counters.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_search_counters.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 32.628205 | 104 | 0.630648 |
d57ecdb72f23a66a333aa35a0e2f96eac70e2010 | 868 | py | Python | master/fresh-samples-master/fresh-samples-master/python_samples/add_note.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | master/fresh-samples-master/fresh-samples-master/python_samples/add_note.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | master/fresh-samples-master/fresh-samples-master/python_samples/add_note.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | ## This script requires "requests": http://docs.python-requests.org/
## To install: pip install requests
import json
import requests
FRESHDESK_ENDPOINT = "https://DOMAIN.freshdesk.com" # check if you have configured https, modify accordingly
FRESHDESK_KEY = "FRESHDESK_API_KEY"
headers = {"Content-Type": "application... | 27.125 | 108 | 0.703917 |
d57ed9e9711f648164d8a8d0e4ff0fb3d5e902c1 | 1,767 | py | Python | netlas/helpers.py | netlas-io/netlas-python | cb33beccccc8b7bafb9fe32aaa21c3d8feb21b0c | [
"MIT"
] | 4 | 2021-06-22T12:22:22.000Z | 2022-03-21T15:55:03.000Z | netlas/helpers.py | netlas-io/netlas-python | cb33beccccc8b7bafb9fe32aaa21c3d8feb21b0c | [
"MIT"
] | null | null | null | netlas/helpers.py | netlas-io/netlas-python | cb33beccccc8b7bafb9fe32aaa21c3d8feb21b0c | [
"MIT"
] | null | null | null | import yaml
import json
import pygments
import orjson
import appdirs
import os
from requests import Request
from pygments.lexers.data import YamlLexer
from pygments.formatters.terminal import TerminalFormatter
from netlas.exception import APIError
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
O... | 27.609375 | 94 | 0.60498 |
d57ee93e15ee8b5b35c5214ae354ca59b353425b | 72 | py | Python | spikebit/__init__.py | NRC-Lund/spikebit | b086bb78b7a0da224e4f8db2b83582f121d51cd6 | [
"MIT"
] | 6 | 2018-04-02T09:25:22.000Z | 2020-08-01T08:34:09.000Z | spikebit/__init__.py | NRC-Lund/spikebit | b086bb78b7a0da224e4f8db2b83582f121d51cd6 | [
"MIT"
] | null | null | null | spikebit/__init__.py | NRC-Lund/spikebit | b086bb78b7a0da224e4f8db2b83582f121d51cd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: bengt
"""
| 9 | 23 | 0.513889 |
d57f0de1b4c573eb4028712ac6c5aa930baae5f6 | 1,554 | py | Python | python/tests/test_client_serde.py | venkat-nidrive/konduit-serving | f0b829ec13e1fc3f675cfc6dbd85dec26f14defe | [
"Apache-2.0"
] | null | null | null | python/tests/test_client_serde.py | venkat-nidrive/konduit-serving | f0b829ec13e1fc3f675cfc6dbd85dec26f14defe | [
"Apache-2.0"
] | null | null | null | python/tests/test_client_serde.py | venkat-nidrive/konduit-serving | f0b829ec13e1fc3f675cfc6dbd85dec26f14defe | [
"Apache-2.0"
] | null | null | null | from konduit import *
from konduit.client import Client
from konduit.json_utils import config_to_dict_with_type
import json
import random
import numpy as np
import pytest
@pytest.mark.unit
def test_multipart_encode():
input_names = ["IteratorGetNext:0", "IteratorGetNext:1", "IteratorGetNext:4"]
output_names ... | 28.254545 | 83 | 0.715573 |
d57f3857c1b1d72cf5a18748f0c33b90a3be9974 | 6,308 | py | Python | tests/test_settings_dict.py | evandroforks/sublime_lib | 7d013cd85dbcc10b66e8c81a07160b2dd55f3138 | [
"MIT"
] | 49 | 2018-04-11T01:18:02.000Z | 2021-09-17T14:34:56.000Z | tests/test_settings_dict.py | evandrocoan/sublime_lib | 7d013cd85dbcc10b66e8c81a07160b2dd55f3138 | [
"MIT"
] | 115 | 2018-04-03T18:53:17.000Z | 2021-12-07T09:36:33.000Z | tests/test_settings_dict.py | evandrocoan/sublime_lib | 7d013cd85dbcc10b66e8c81a07160b2dd55f3138 | [
"MIT"
] | 5 | 2018-11-26T12:07:47.000Z | 2020-03-27T12:31:55.000Z | import sublime
from sublime_lib import SettingsDict
from unittest import TestCase
from collections import ChainMap
class TestSettingsDict(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
self.settings = self.view.settings()
self.fancy = SettingsDict(self.setting... | 30.621359 | 81 | 0.630628 |
d57f43ba28a3dc73f1aecb0b08b0fc44320e0f58 | 1,225 | py | Python | src/blackbench/utils.py | ichard26/blackperf | 1e4e36b8de4ba351a95f4948866620bada64cf53 | [
"MIT"
] | 3 | 2021-04-28T03:59:03.000Z | 2021-06-26T02:12:30.000Z | src/blackbench/utils.py | ichard26/blackperf | 1e4e36b8de4ba351a95f4948866620bada64cf53 | [
"MIT"
] | 6 | 2021-06-14T22:46:31.000Z | 2021-08-14T22:46:25.000Z | src/blackbench/utils.py | ichard26/blackperf | 1e4e36b8de4ba351a95f4948866620bada64cf53 | [
"MIT"
] | 2 | 2021-09-18T15:23:21.000Z | 2022-02-01T13:02:33.000Z | import os
from contextlib import contextmanager
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, Dict, Generator, List
import click
def log(msg: str, **kwargs: Any) -> None:
click.secho(f"[*] {msg}", **kwargs)
def warn(msg: str, **kwargs: Any) -> None:
_kwargs: Dict[... | 26.630435 | 68 | 0.62449 |
d57f6164172f6f15a8481db49148cc7ab42ace13 | 12,110 | py | Python | builder_utils.py | xiangyangkan/faster-bert-as-service | dbd56ae0ab8ae73f90c01445016c2629b12ad7d5 | [
"Apache-2.0"
] | 10 | 2021-11-05T07:40:51.000Z | 2022-03-14T02:39:44.000Z | builder_utils.py | xiangyangkan/faster-bert-as-service | dbd56ae0ab8ae73f90c01445016c2629b12ad7d5 | [
"Apache-2.0"
] | 1 | 2022-03-02T07:19:15.000Z | 2022-03-02T11:18:07.000Z | builder_utils.py | xiangyangkan/faster-bert-as-service | dbd56ae0ab8ae73f90c01445016c2629b12ad7d5 | [
"Apache-2.0"
] | null | null | null | import re
import pickle
import numpy as np
import onnx
import torch
import tensorrt as trt
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except ImportError as err:
sys.stderr.write("""Error: Failed to import tensorflow module ({})\n""".format(err))
sys.exit()
TRT_LOGGER = trt.Logge... | 40.501672 | 143 | 0.583567 |
d57f78eff98ccd2d612722e2b56729cd1688fb97 | 523 | py | Python | geektime/69_sqtr.py | mnxzyw/py-algorithms | fa404b455d7fd551ac3a38704bda6353da2529c0 | [
"Apache-2.0"
] | null | null | null | geektime/69_sqtr.py | mnxzyw/py-algorithms | fa404b455d7fd551ac3a38704bda6353da2529c0 | [
"Apache-2.0"
] | null | null | null | geektime/69_sqtr.py | mnxzyw/py-algorithms | fa404b455d7fd551ac3a38704bda6353da2529c0 | [
"Apache-2.0"
] | null | null | null | class Solution:
def mySqrt(self, x: int) -> int:
if x <= 1:
return x
left, right = 0, x
rsp = -1
while left <= right:
m = (left + right) // 2
if m * m == x:
rsp = m
break
elif m * m > x:
r... | 21.791667 | 36 | 0.353728 |
d57f919ad617f6332e73fac2eab03a137f70491c | 2,725 | py | Python | examples/retrieval/evaluation/dense/evaluate_sbert.py | tstadel/beir | 3abb52f9465d91a92d61b35b95b371cfbcd3a248 | [
"Apache-2.0"
] | null | null | null | examples/retrieval/evaluation/dense/evaluate_sbert.py | tstadel/beir | 3abb52f9465d91a92d61b35b95b371cfbcd3a248 | [
"Apache-2.0"
] | null | null | null | examples/retrieval/evaluation/dense/evaluate_sbert.py | tstadel/beir | 3abb52f9465d91a92d61b35b95b371cfbcd3a248 | [
"Apache-2.0"
] | null | null | null | from beir import util, LoggingHandler
from beir.retrieval import models
from beir.datasets.data_loader import GenericDataLoader
from beir.retrieval.evaluation import EvaluateRetrieval
from beir.retrieval.search.dense import DenseRetrievalExactSearch as DRES
import logging
import pathlib, os
import random
#### Just so... | 43.253968 | 119 | 0.735413 |
d57fb615b8698b1b794fb6bf00cbc9dc1185a2fd | 7,856 | py | Python | examples/nips17_adversarial_competition/eval_infra/code/eval_lib/cloud_client.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 29 | 2018-03-10T04:33:25.000Z | 2022-03-18T13:03:37.000Z | examples/nips17_adversarial_competition/eval_infra/code/eval_lib/cloud_client.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 2 | 2019-07-22T20:59:01.000Z | 2019-11-17T07:00:00.000Z | examples/nips17_adversarial_competition/eval_infra/code/eval_lib/cloud_client.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 20 | 2018-03-14T14:01:55.000Z | 2021-09-17T19:19:56.000Z | """Helper classes and wrappers to access Google Cloud.
Google Cloud API is encapsulated with these wrappers, so it's easier to
test the code with help of fake (declared in testing/fake_cloud_client.py).
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
i... | 31.934959 | 79 | 0.701884 |
d57fd1505ca81f7a2e0ef9dacf5960a699a332e3 | 6,556 | py | Python | aparse/_lib.py | jkulhanek/aparse | 03fb46cd52e2a7a3dc80831737d9a5ddc9971251 | [
"MIT"
] | null | null | null | aparse/_lib.py | jkulhanek/aparse | 03fb46cd52e2a7a3dc80831737d9a5ddc9971251 | [
"MIT"
] | null | null | null | aparse/_lib.py | jkulhanek/aparse | 03fb46cd52e2a7a3dc80831737d9a5ddc9971251 | [
"MIT"
] | null | null | null | import sys
from typing import List, Dict, Any, Tuple
import dataclasses
from .core import Parameter, ParameterWithPath, Handler, Runtime, DefaultFactory, _empty
from .utils import merge_parameter_trees, consolidate_parameter_tree
from .utils import ignore_parameters
handlers: List[Handler] = []
def register_handler... | 38.116279 | 113 | 0.635296 |
d57fefd7c4b4053586c218dd1014cb9b6ffe31fb | 2,370 | py | Python | tests/rbac/test/assertions.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | null | null | null | tests/rbac/test/assertions.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | null | null | null | tests/rbac/test/assertions.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | 1 | 2018-12-07T10:55:08.000Z | 2018-12-07T10:55:08.000Z | # Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 ... | 35.909091 | 79 | 0.710127 |
d580d5c02ff94243f335b6e548eabeee8833bc4d | 812 | bzl | Python | macros.bzl | wix-playground/rules_maven_third_party | ff0b486df194779d7d8e6c9102cd12138e3305c3 | [
"Apache-2.0"
] | null | null | null | macros.bzl | wix-playground/rules_maven_third_party | ff0b486df194779d7d8e6c9102cd12138e3305c3 | [
"Apache-2.0"
] | null | null | null | macros.bzl | wix-playground/rules_maven_third_party | ff0b486df194779d7d8e6c9102cd12138e3305c3 | [
"Apache-2.0"
] | null | null | null | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def resources(
name = "resources",
resources = None,
resource_extra_strip_prefix = None,
runtime_deps = [],
testonly = False,
tags = [],
visibility = None):
if resources == None:
res... | 30.074074 | 71 | 0.605911 |
d580de41697e35ea7a1df72b9327093e96e9cea3 | 12,679 | py | Python | tools/tcam-capture/tcam_capture/Settings.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 241 | 2015-02-20T09:10:41.000Z | 2022-03-18T08:53:26.000Z | tools/tcam-capture/tcam_capture/Settings.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 435 | 2015-01-19T10:18:01.000Z | 2022-03-28T08:03:08.000Z | tools/tcam-capture/tcam_capture/Settings.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 141 | 2015-01-03T17:54:08.000Z | 2022-02-09T09:55:15.000Z | # Copyright 2017 The Imaging Source Europe GmbH
#
# 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 ... | 46.273723 | 97 | 0.591214 |
d580e3bbbd4b94c30827afa12657a1ef185f08df | 572 | py | Python | nicr_rgb_d_orientation_data_set/version.py | TUI-NICR/NICR-RGB-D-Orientation-Data-Set | 413a34feb9ab31d95544078bdcec1efcf6257733 | [
"BSD-3-Clause"
] | 3 | 2019-09-06T23:14:17.000Z | 2021-02-27T14:18:49.000Z | nicr_rgb_d_orientation_data_set/version.py | TUI-NICR/NICR-RGB-D-Orientation-Data-Set | 413a34feb9ab31d95544078bdcec1efcf6257733 | [
"BSD-3-Clause"
] | null | null | null | nicr_rgb_d_orientation_data_set/version.py | TUI-NICR/NICR-RGB-D-Orientation-Data-Set | 413a34feb9ab31d95544078bdcec1efcf6257733 | [
"BSD-3-Clause"
] | 2 | 2019-09-06T23:37:51.000Z | 2020-12-03T11:53:29.000Z | # -*- coding: utf-8 -*-
"""
.. codeauthor:: Daniel Seichter <daniel.seichter@tu-ilmenau.de>
"""
_VERSION_MAJOR = 0
_VERSION_MINOR = 1
_VERSION_MICRO = 0
_VERSION_SUFFIX = ""
def _get_version(with_suffix=False): # pragma no cover
"""Private function to determine version"""
if with_suffix:
return (_... | 23.833333 | 65 | 0.645105 |
d580e831aa87db9f2bafeef09cd6b92891e3408d | 6,172 | py | Python | theano_models/SdA/pretrain_SdA.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | theano_models/SdA/pretrain_SdA.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | theano_models/SdA/pretrain_SdA.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | """
This script pre-trains a stacked de-noising auto-encoder.
The SdA model is either recovered from a given pickle file, or is initialized.
It is based on Stacked de-noising Autoencoder models from the Bengio lab.
See http://deeplearning.net/tutorial/SdA.html#sda
"""
import cPickle
import gzip
import os
i... | 39.819355 | 166 | 0.643227 |
d580f04c5fbe643b315cd1202caa864f35d7f8c5 | 2,749 | py | Python | tensorflow/contrib/tensorboard/plugins/trace/trace_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/contrib/tensorboard/plugins/trace/trace_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/tensorboard/plugins/trace/trace_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 28.635417 | 80 | 0.706075 |
d58110d7b83068407dc2a8fa85ae998db51bb326 | 11,991 | py | Python | tests/test_preprocessor.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | tests/test_preprocessor.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | tests/test_preprocessor.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | import argparse
import pathlib
import shutil
import sys
import os
import unittest
from pprint import pprint
PROJECT_ROOT = os.path.join(os.path.dirname(__file__), '..')
sys.path.insert(0, PROJECT_ROOT)
# from TimeSeriesD3MWrappers.primitives.classification_knn import Kanine
from d3m import container as container_mod... | 48.546559 | 117 | 0.670586 |
d581166895df2d221922c6fd45459e9ea8b52dae | 14,207 | py | Python | Example_2D.py | AlbertoBarbado/unsupervised-outlier-transparency | d80637cd0a9f70a3ff5f327952b4bd6377826707 | [
"Apache-2.0"
] | 5 | 2019-04-18T22:05:26.000Z | 2022-01-09T02:05:06.000Z | Example_2D.py | AlbertoBarbado/unsupervised-outlier-transparency | d80637cd0a9f70a3ff5f327952b4bd6377826707 | [
"Apache-2.0"
] | 1 | 2022-01-08T11:57:40.000Z | 2022-01-08T11:57:40.000Z | Example_2D.py | AlbertoBarbado/unsupervised-outlier-transparency | d80637cd0a9f70a3ff5f327952b4bd6377826707 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
# Rule Extraction for Unsupervised Outlier Detection
Example of usage of a library that wrapping an unsupervised outlier detection algorithm (OneClassSVM) of scikit-learn
it can infer rules that are comprehensible for human beings, so the'll be able to easily understand why an specific data... | 32.886574 | 153 | 0.611178 |
d581330f3e5e8ccafc078b862046d230d3a4a119 | 493 | py | Python | nightshift/bot.py | BookOps-CAT/NightShift | dc106b55cee3ec60c790f71f20e0754506385d59 | [
"MIT"
] | null | null | null | nightshift/bot.py | BookOps-CAT/NightShift | dc106b55cee3ec60c790f71f20e0754506385d59 | [
"MIT"
] | 17 | 2020-12-07T04:43:48.000Z | 2022-03-30T12:44:41.000Z | nightshift/bot.py | BookOps-CAT/NightShift | dc106b55cee3ec60c790f71f20e0754506385d59 | [
"MIT"
] | null | null | null | """
Launches NightShift application
"""
import logging
import logging.config
import loggly.handlers
from nightshift.config.logging_conf import log_conf
# from nightshift.manager import process_resources
conf = log_conf()
logging.config.dictConfig(conf)
logger = logging.getLogger("nightshift")
def run():
logge... | 17.607143 | 51 | 0.744422 |
d58158139ad514a93ce08afae4541b77299cc193 | 931 | py | Python | lib/LinkedList.py | ramics/finger-exercises | 364b26b939113d95bd8fcd482cc2fc9121621fe8 | [
"CC0-1.0"
] | null | null | null | lib/LinkedList.py | ramics/finger-exercises | 364b26b939113d95bd8fcd482cc2fc9121621fe8 | [
"CC0-1.0"
] | null | null | null | lib/LinkedList.py | ramics/finger-exercises | 364b26b939113d95bd8fcd482cc2fc9121621fe8 | [
"CC0-1.0"
] | null | null | null | import Functions
class LinkedList:
"""
Incomplete definition of a linked list.
"""
class Node:
"""
A linked list node.
"""
def __init__(self, value, next_node = None):
self.value = value
self.next = next_node
def __str__(self):
... | 18.254902 | 69 | 0.534909 |
d5816c859caf7028371d92ce6024b0185fff02f2 | 2,272 | py | Python | help_functions.py | ilias1111/messenger-history | 8e3632553827e2ff627f3e3924c752c2c62d7645 | [
"MIT"
] | 1 | 2020-03-24T10:56:41.000Z | 2020-03-24T10:56:41.000Z | help_functions.py | ilias1111/messenger-history | 8e3632553827e2ff627f3e3924c752c2c62d7645 | [
"MIT"
] | 5 | 2020-03-31T11:22:30.000Z | 2022-03-12T00:17:49.000Z | help_functions.py | ilias1111/messenger-history | 8e3632553827e2ff627f3e3924c752c2c62d7645 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import emojis
import emoji
import collections
import streamlit as st
def emoji_category(x):
try:
return (emojis.db.get_emoji_by_code(x))[3]
except:
return "Misc"
def test():
st.write("dsadasdasdasda")
def string_enc(x):
""" Fixing a string's c... | 24.170213 | 78 | 0.604313 |
d5818cc794df3785356214d681935430a930bd02 | 24,465 | py | Python | implementations/gpu_pathfinder_array_v3.py | LunaDilangalen/gpu-pathfinding | ba34c44595a6ede0c3c47bc60bb2a34355fc4891 | [
"MIT"
] | null | null | null | implementations/gpu_pathfinder_array_v3.py | LunaDilangalen/gpu-pathfinding | ba34c44595a6ede0c3c47bc60bb2a34355fc4891 | [
"MIT"
] | 4 | 2021-06-08T22:56:00.000Z | 2022-03-12T00:53:10.000Z | implementations/gpu_pathfinder_array_v3.py | LunaDilangalen/gpu-pathfinding | ba34c44595a6ede0c3c47bc60bb2a34355fc4891 | [
"MIT"
] | null | null | null | from random import randint, seed
import argparse
import cv2 as cv
import sys
import os
import math
import numpy as np
import cupy as cp
import heapq
from timeit import default_timer as timer
from numba import cuda, int32, typeof
from skimage.util.shape import view_as_windows
scale_factor = 2 # scales to a power of 2... | 34.95 | 159 | 0.607153 |
d58198faf353aab68430d2fa153a18de359112de | 22,234 | py | Python | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.268503 | 118 | 0.706665 |
d581a5422c69a90fbc4da4905d7518464b003034 | 2,665 | py | Python | tensormonk/layers/feature_fusion.py | Tensor46/TensorMONK | 67617d3fdf8fde072ba9cab42de7d67c79b17494 | [
"MIT"
] | 29 | 2018-07-06T23:57:23.000Z | 2022-03-08T20:38:57.000Z | tensormonk/layers/feature_fusion.py | sparupat/TensorMONK | 7a2699a28299a89b186e0eb17ed6e9feaea5429e | [
"MIT"
] | 3 | 2018-12-14T22:21:26.000Z | 2020-06-19T02:13:34.000Z | tensormonk/layers/feature_fusion.py | sparupat/TensorMONK | 7a2699a28299a89b186e0eb17ed6e9feaea5429e | [
"MIT"
] | 8 | 2018-07-06T23:58:03.000Z | 2021-04-12T01:35:54.000Z | """ TensorMONK :: layers :: FeatureFusion """
__all__ = ["FeatureFusion"]
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..activations.activations import maxout
class FeatureFusion(nn.Module):
r""" To fuse features from same/different scales, all features must have
same depth!
... | 37.535211 | 79 | 0.580863 |
d581fd4ea9b43ae2c16ce5a33fb10b2f13c949c6 | 5,484 | py | Python | examples/single_qubit_blackbox_exp.py | superplay1/c3 | 5540458a13c1bb05c5e528f65056ec33f1fb9a69 | [
"Apache-2.0"
] | 1 | 2021-04-13T12:52:14.000Z | 2021-04-13T12:52:14.000Z | examples/single_qubit_blackbox_exp.py | marcorossignolo/c3 | 2b41aac7f9df227a423f7cacdaa943731c7e40e7 | [
"Apache-2.0"
] | null | null | null | examples/single_qubit_blackbox_exp.py | marcorossignolo/c3 | 2b41aac7f9df227a423f7cacdaa943731c7e40e7 | [
"Apache-2.0"
] | null | null | null | import copy
import numpy as np
from c3.system.model import Model as Mdl
from c3.c3objs import Quantity as Qty
from c3.parametermap import ParameterMap as PMap
from c3.experiment import Experiment as Exp
from c3.generator.generator import Generator as Gnr
import c3.signal.gates as gates
import c3.system.chip as chip
imp... | 31.159091 | 87 | 0.568928 |
d58238b250ef28e81381018aac9a93d5e6106619 | 3,690 | py | Python | xas/energy_calibration.py | NSLS-II-ISS/xas | b89c71e0cb6f59e783d6122da27898a1ccc1ed8d | [
"BSD-3-Clause"
] | 2 | 2019-03-22T05:35:40.000Z | 2019-06-11T19:32:47.000Z | xas/energy_calibration.py | NSLS-II-ISS/xas | b89c71e0cb6f59e783d6122da27898a1ccc1ed8d | [
"BSD-3-Clause"
] | 1 | 2019-07-08T17:33:32.000Z | 2021-01-13T15:44:11.000Z | xas/energy_calibration.py | NSLS-II-ISS/xas | b89c71e0cb6f59e783d6122da27898a1ccc1ed8d | [
"BSD-3-Clause"
] | 1 | 2019-12-05T18:29:13.000Z | 2019-12-05T18:29:13.000Z | import numpy as np
from .file_io import load_binned_df_from_file
# from isstools.xasproject.xasproject import XASDataSet
from xas.xasproject import XASDataSet
# from xas.trajectory import read_trajectory_limits
from lmfit import Parameters, minimize
import time as ttime
import xraydb
from xas import xray
def get_foil_... | 35.825243 | 110 | 0.657182 |
d582684a939ac886541357e48d2f9ec595ea5864 | 7,288 | py | Python | Multi-Task-Learning-PyTorch-master/utils/config.py | nikola3794/edge-evaluation-PASCAL-MT-tmp | d3bc7164608a20eb6351c1d41219213927ae6239 | [
"MIT"
] | null | null | null | Multi-Task-Learning-PyTorch-master/utils/config.py | nikola3794/edge-evaluation-PASCAL-MT-tmp | d3bc7164608a20eb6351c1d41219213927ae6239 | [
"MIT"
] | null | null | null | Multi-Task-Learning-PyTorch-master/utils/config.py | nikola3794/edge-evaluation-PASCAL-MT-tmp | d3bc7164608a20eb6351c1d41219213927ae6239 | [
"MIT"
] | null | null | null | # This code is referenced from
# https://github.com/facebookresearch/astmt/
#
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# License: Attribution-NonCommercial 4.0 International
import os
import cv2
import yaml
from easydict import EasyDict as edict
from utils.utils import mkdir_if_mi... | 36.808081 | 109 | 0.636663 |
d58289e957f9a9c16fdf4280232217b11ec07fd5 | 16,787 | py | Python | fairseq/criterions/aligned_bert_loss.py | ijauregiCMCRC/fairseq-bert-loss | 73d01aae200471d08ed7fc35ce9226352faee3ef | [
"MIT"
] | 1 | 2021-08-18T07:01:28.000Z | 2021-08-18T07:01:28.000Z | fairseq/criterions/aligned_bert_loss.py | ijauregiCMCRC/fairseq-bert-loss | 73d01aae200471d08ed7fc35ce9226352faee3ef | [
"MIT"
] | null | null | null | fairseq/criterions/aligned_bert_loss.py | ijauregiCMCRC/fairseq-bert-loss | 73d01aae200471d08ed7fc35ce9226352faee3ef | [
"MIT"
] | 2 | 2021-08-19T08:24:57.000Z | 2022-03-31T05:10:35.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
from torch.nn import CosineEmbeddingLoss, CosineSimilarity
from torch.nn.functional import gumbel_softmax
from torch.... | 45.991781 | 119 | 0.620242 |
d582b1a4b1f83c5d2dad950b0bc5b4411cf6ba05 | 9,560 | py | Python | txweb2/auth/wrapper.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txweb2/auth/wrapper.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txweb2/auth/wrapper.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | # -*- test-case-name: txweb2.test.test_httpauth -*-
##
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# Copyright (c) 2010-2015 Apple Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),... | 37.198444 | 80 | 0.613912 |
d582bdd1282d3c65b450fed6684dd1993743e63f | 2,272 | py | Python | money_after_each_turn.py | johntelforduk/monopoly-simulation | b6e35a46e68955695f7b6ee3e45b0d97f76829ca | [
"MIT"
] | 2 | 2020-09-23T00:06:42.000Z | 2021-04-20T15:35:27.000Z | money_after_each_turn.py | johntelforduk/monopoly-simulation | b6e35a46e68955695f7b6ee3e45b0d97f76829ca | [
"MIT"
] | null | null | null | money_after_each_turn.py | johntelforduk/monopoly-simulation | b6e35a46e68955695f7b6ee3e45b0d97f76829ca | [
"MIT"
] | null | null | null | # Work out how much money players have after each turn (1 player, no deed buying or house buying).
import matplotlib.pyplot as pyplot # For drawing bar chart.
import numpy as np
from statistics import mean
import sys # For parsing parms.... | 37.245902 | 114 | 0.698944 |
d58306099a0ff7ee95f9aec54ad428eb826cfdee | 1,258 | py | Python | python-code/vtk-learning/05-lights.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 13 | 2018-09-07T02:29:07.000Z | 2021-06-18T08:40:09.000Z | python-code/vtk-learning/05-lights.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | null | null | null | python-code/vtk-learning/05-lights.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 4 | 2019-06-20T00:09:39.000Z | 2021-07-15T10:14:36.000Z | #coding:utf-8
import vtk
cone = vtk.vtkConeSource()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(cone.GetOutputPort())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.SetPosition(0, 0, 0)
actor.GetProperty().SetColor(0.8, 0.6, 0.1)
actor.GetProperty().SetAmbient(0.1)
actor.GetProperty().SetDiffuse... | 24.192308 | 47 | 0.77345 |
d5833b9ab0edcc6c7194c65a0ed1c1dadfd38d46 | 2,573 | py | Python | StringCalculator/python/test_string_calculator.py | tgdraugr/CodingKatas | c9caf7b8cde0ccb50fe74b4dbef3d1b8b8698a8e | [
"MIT"
] | null | null | null | StringCalculator/python/test_string_calculator.py | tgdraugr/CodingKatas | c9caf7b8cde0ccb50fe74b4dbef3d1b8b8698a8e | [
"MIT"
] | null | null | null | StringCalculator/python/test_string_calculator.py | tgdraugr/CodingKatas | c9caf7b8cde0ccb50fe74b4dbef3d1b8b8698a8e | [
"MIT"
] | null | null | null | """ String Calculator tests """
import unittest
import string_calculator as calc
class FirstStepTests(unittest.TestCase):
def test_empty_string_input(self):
self.assertEqual(0, calc.add(""))
self.assertEqual(0, calc.add(" "))
def test_one_string_input(self):
self.assertEqual(1, calc.a... | 33.415584 | 84 | 0.640109 |
d583408a006486fb5fe717e7c0dd82d92ff93cbb | 233 | py | Python | thenewboston/utils/messages.py | rajat4665/thenewboston-python | df842c793fe7bfd8731fd8746abf25747c9e569e | [
"MIT"
] | 3 | 2021-02-06T14:56:09.000Z | 2022-03-12T01:17:56.000Z | thenewboston/utils/messages.py | rajat4665/thenewboston-python | df842c793fe7bfd8731fd8746abf25747c9e569e | [
"MIT"
] | 3 | 2021-03-30T14:03:41.000Z | 2021-09-22T19:30:31.000Z | thenewboston/utils/messages.py | rajat4665/thenewboston-python | df842c793fe7bfd8731fd8746abf25747c9e569e | [
"MIT"
] | null | null | null | from hashlib import sha3_256 as sha3
from thenewboston.utils.tools import sort_and_encode
def get_message_hash(*, message):
"""
Return has of given message
"""
return sha3(sort_and_encode(message)).digest().hex()
| 19.416667 | 56 | 0.72103 |
d5837c49d98ea27d3affd72c735267d6589127ef | 7,285 | py | Python | src/python/ch06/sec04.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | src/python/ch06/sec04.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | src/python/ch06/sec04.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : 526614962@qq.com
@site : https://zhuyuanxiang.github.io
---------------------------
@Software : PyCharm
@Project : Dive-into-Deep-Learning
@File : sec0202.py
@Version : v0.1
@Time : 2020-12-27 9:25
@License ... | 36.064356 | 143 | 0.578723 |
d58381529f29c4564af5c4ab57f5c4999f7d2bea | 30,325 | py | Python | lib/codegen/meta/cdsl/typevar.py | brson/cretonne | 9384d3d7363246245b2ffd1a09938e4028f620a2 | [
"Apache-2.0"
] | null | null | null | lib/codegen/meta/cdsl/typevar.py | brson/cretonne | 9384d3d7363246245b2ffd1a09938e4028f620a2 | [
"Apache-2.0"
] | null | null | null | lib/codegen/meta/cdsl/typevar.py | brson/cretonne | 9384d3d7363246245b2ffd1a09938e4028f620a2 | [
"Apache-2.0"
] | null | null | null | """
Type variables for Parametric polymorphism.
Cretonne instructions and instruction transformations can be specified to be
polymorphic by using type variables.
"""
from __future__ import absolute_import
import math
from . import types, is_power_of_two
from copy import copy
try:
from typing import Tuple, Union, ... | 33.434399 | 79 | 0.552415 |
d58398cce1d17cee07840070922d9574b59f9d2d | 7,717 | py | Python | markov-hypothesis-testing/experiment_script/Ohio_simu_testing.py | QianLabUSC/cognitively-enhanced-decision-framework | 1797ddd41edcbfbfafca5b599ff7ab70f5fdc37f | [
"MIT"
] | 10 | 2020-06-11T03:52:50.000Z | 2022-03-12T00:53:33.000Z | experiment_script/Ohio_simu_testing.py | callmespring/TestMDP | a87db29eb786a48a48c0660fe7b2e365aa6b51a8 | [
"MIT"
] | 3 | 2021-06-28T15:35:21.000Z | 2021-07-01T06:02:57.000Z | markov-hypothesis-testing/experiment_script/Ohio_simu_testing.py | QianLabUSC/cognitively-enhanced-decision-framework | 1797ddd41edcbfbfafca5b599ff7ab70f5fdc37f | [
"MIT"
] | 2 | 2021-02-14T20:05:44.000Z | 2021-02-18T10:27:17.000Z | # -*- coding: utf-8 -*-
import os, sys
package_path = os.path.dirname(os.path.abspath(os.getcwd()))
sys.path.insert(0, package_path + "/test_func")
from _core_test_fun import *
sys.path.insert(0, package_path + "/experiment_func")
from _DGP_Ohio import *
os.environ["OMP_NUM_THREADS"] = "1"
#########################... | 45.934524 | 144 | 0.521187 |
d583ce82575d2cf089d7f72239497c745089fe06 | 3,373 | py | Python | pcdsdevices/dc_devices.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pcdsdevices/dc_devices.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pcdsdevices/dc_devices.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | """
Standard classes for L2SI DC power devices.
"""
import logging
from ophyd import Device, EpicsSignal, EpicsSignalRO
from ophyd import FormattedComponent as FCpt
from .interface import BaseInterface
logger = logging.getLogger(__name__)
class ICTChannel(Device):
"""
Class to define a particular channel o... | 32.12381 | 78 | 0.603617 |
d583d8927fd0e4fdb9c9fdbfffd502978fc2fdf1 | 148 | py | Python | ogscm/common.py | ufz/ogs-container-maker | 97a8e9ecd574ca35d65e2a1e58b187892631ac7f | [
"BSD-3-Clause"
] | 4 | 2019-03-27T08:47:58.000Z | 2020-02-05T13:11:13.000Z | ogscm/common.py | ufz/ogs-container-maker | 97a8e9ecd574ca35d65e2a1e58b187892631ac7f | [
"BSD-3-Clause"
] | 2 | 2019-03-22T08:39:28.000Z | 2022-02-28T10:38:35.000Z | ogscm/common.py | ufz/ogs-container-maker | 97a8e9ecd574ca35d65e2a1e58b187892631ac7f | [
"BSD-3-Clause"
] | null | null | null | from enum import Enum
class package_manager(Enum):
"""Supported container types"""
OFF = 0
EASYBUILD = 3
GUIX = 4
SYSTEM = 5
| 13.454545 | 35 | 0.614865 |
d58402273f6a2e172539fee9e8789291decba0b0 | 1,887 | py | Python | nova/tests/unit/virt/vmwareapi/test_read_write_util.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/tests/unit/virt/vmwareapi/test_read_write_util.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/vmwareapi/test_read_write_util.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright 2013 IBM Corp.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 41.933333 | 78 | 0.581346 |
d584302a25330f820d98b47bd7fbe5ab95fe592e | 4,076 | py | Python | test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_multiapi_service_client.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_multiapi_service_client.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_multiapi_service_client.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.458333 | 126 | 0.687684 |
d58454ad479c697da5612071c1924182b6c32395 | 1,528 | py | Python | tests/test_voronoi_site.py | bjmorgan/siteid | 22504f264763afab5a4fb7c888bd3962d0133cd9 | [
"MIT"
] | 5 | 2019-07-29T16:27:04.000Z | 2021-11-17T08:45:12.000Z | tests/test_voronoi_site.py | bjmorgan/siteid | 22504f264763afab5a4fb7c888bd3962d0133cd9 | [
"MIT"
] | null | null | null | tests/test_voronoi_site.py | bjmorgan/siteid | 22504f264763afab5a4fb7c888bd3962d0133cd9 | [
"MIT"
] | 1 | 2021-08-09T03:01:10.000Z | 2021-08-09T03:01:10.000Z | import unittest
from site_analysis.voronoi_site import VoronoiSite
from unittest.mock import patch, MagicMock, Mock
import numpy as np
class VoronoiSiteTestCase(unittest.TestCase):
def test_voronoi_site_is_initialised(self):
frac_coords = np.array([0.1, 0.2, 0.3])
site = VoronoiSite(frac_coords=fr... | 39.179487 | 85 | 0.672775 |
d5847ff9745fc551bd922b4786a9dc041e696e41 | 711 | py | Python | src/aiohttp_micro/__main__.py | clayman083/aiohttp-micro | 0d183f11a03beb0a51357eb4ad6134ce01e347a4 | [
"MIT"
] | 1 | 2019-11-04T12:15:39.000Z | 2019-11-04T12:15:39.000Z | src/aiohttp_micro/__main__.py | clayman74/aiohttp-micro | 0d183f11a03beb0a51357eb4ad6134ce01e347a4 | [
"MIT"
] | null | null | null | src/aiohttp_micro/__main__.py | clayman74/aiohttp-micro | 0d183f11a03beb0a51357eb4ad6134ce01e347a4 | [
"MIT"
] | 1 | 2021-11-16T15:24:44.000Z | 2021-11-16T15:24:44.000Z | import asyncio
import click
import uvloop # type: ignore
from config import EnvValueProvider, load
from aiohttp_micro import AppConfig
from aiohttp_micro.app import init
from aiohttp_micro.cli.server import server
@click.group()
@click.option("--debug", default=False, is_flag=True)
@click.pass_context
def cli(ctx,... | 20.911765 | 53 | 0.699015 |
d58489eb68b6b949a4276520605c62b7c2825558 | 3,751 | py | Python | tensorflow/contrib/autograph/utils/tensor_list_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/autograph/utils/tensor_list_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/autograph/utils/tensor_list_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.788136 | 80 | 0.657425 |
d585055c777fb995e5fef45e952ef3d9d56a0705 | 6,813 | py | Python | siliconcompiler/pdks/freepdk45.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | siliconcompiler/pdks/freepdk45.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | siliconcompiler/pdks/freepdk45.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null |
import os
import sys
import re
import siliconcompiler
############################################################################
# DOCS
############################################################################
def make_docs():
'''
The freepdk45 PDK is a virtual PDK derived from the work done at
NCS... | 40.313609 | 94 | 0.552767 |
d5850a8fd1480097cbe7d62d004061f33fc1f785 | 843 | py | Python | campy/io/base64helper.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | campy/io/base64helper.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | campy/io/base64helper.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3 -tt
"""
File: base64.h
--------------
This file defines a set of functions for encoding and decoding binary data
in the base64 format. See:
http://en.wikipedia.org/wiki/Base64
It is a lightweight wrapper around the builtin base64 library that ships with
Python.
"""
import base64 as _base64
... | 28.1 | 114 | 0.720047 |
d5850aa189a3df0357f39cf8da8cae8eb091e13c | 10,926 | py | Python | Lib/site-packages/kivy/core/video/video_ffpyplayer.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 9 | 2016-09-03T07:20:01.000Z | 2020-05-21T14:44:48.000Z | Lib/site-packages/kivy/core/video/video_ffpyplayer.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 1 | 2017-05-30T20:45:15.000Z | 2017-05-30T20:45:15.000Z | Lib/site-packages/kivy/core/video/video_ffpyplayer.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 4 | 2016-09-10T15:27:54.000Z | 2020-03-27T22:05:31.000Z | '''
FFmpeg based video abstraction
==============================
To use, you need to install ffpyplayer and have a compiled ffmpeg shared
library.
https://github.com/matham/ffpyplayer
The docs there describe how to set this up. But briefly, first you need to
compile ffmpeg using the shared flags while disabling... | 32.614925 | 79 | 0.581183 |
d58546d5b5c2c04f65ff65a343b27ea48ca8f428 | 2,032 | py | Python | scripts/create_nyu_depth_split.py | moabarar/nemar | 0333edeb1582d8530c8c39d6d0b0150a30cc214f | [
"BSD-3-Clause"
] | 107 | 2020-06-17T06:36:10.000Z | 2022-03-07T10:01:06.000Z | scripts/create_nyu_depth_split.py | moabarar/nemar | 0333edeb1582d8530c8c39d6d0b0150a30cc214f | [
"BSD-3-Clause"
] | 6 | 2020-07-27T11:59:07.000Z | 2021-08-31T15:57:35.000Z | scripts/create_nyu_depth_split.py | moabarar/nemar | 0333edeb1582d8530c8c39d6d0b0150a30cc214f | [
"BSD-3-Clause"
] | 18 | 2020-07-07T15:02:18.000Z | 2022-03-07T01:25:40.000Z | from sklearn.model_selection import train_test_split
import h5py
import numpy as np
import joblib
from PIL import Image
import os
from tqdm import tqdm
dataset_path = '../datasets/nyu_depth'
print('Loading mat file')
file_path = '../datasets/nyu_depth/nyu_depth_v2_labeled.mat'
with h5py.File(file_path, 'r') as f:
... | 36.945455 | 98 | 0.699803 |
d5855427a2e69d4217651c14605ffb705f36824a | 320 | py | Python | src/lexico/analysis_error.py | thrnkk/compiler | 15e1ec1848ef432c1dfdf8b1f9ae79641bd253ca | [
"MIT"
] | 1 | 2021-10-05T13:12:09.000Z | 2021-10-05T13:12:09.000Z | src/lexico/analysis_error.py | thrnkk/compiler | 15e1ec1848ef432c1dfdf8b1f9ae79641bd253ca | [
"MIT"
] | null | null | null | src/lexico/analysis_error.py | thrnkk/compiler | 15e1ec1848ef432c1dfdf8b1f9ae79641bd253ca | [
"MIT"
] | null | null | null | class AnalysisError(Exception):
def __init__(self, msg, position = -1):
self.msg = msg
self.position = position
super().__init__(msg)
def getPosition(self):
return self.position
def __str__(self):
return 'Erro na linha ' + str(self.position) + " - " + self.msg
| 20 | 72 | 0.590625 |
d5856667ffe8a2b39b554962d0f1764f1685f0e6 | 2,803 | py | Python | examples/plot_sandwich.py | Spraitazz/metric-learn | 137880d9c6ce9a2b81a8af24c07d80e528f657cd | [
"MIT"
] | 547 | 2019-08-01T23:21:30.000Z | 2022-03-31T10:23:04.000Z | examples/plot_sandwich.py | Spraitazz/metric-learn | 137880d9c6ce9a2b81a8af24c07d80e528f657cd | [
"MIT"
] | 104 | 2019-08-02T10:15:53.000Z | 2022-03-29T20:33:55.000Z | examples/plot_sandwich.py | Spraitazz/metric-learn | 137880d9c6ce9a2b81a8af24c07d80e528f657cd | [
"MIT"
] | 69 | 2019-08-12T16:22:57.000Z | 2022-03-10T15:10:02.000Z | # -*- coding: utf-8 -*-
"""
Sandwich demo
=============
Sandwich demo based on code from http://nbviewer.ipython.org/6576096
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import pairwise_distances
from sklearn.neighbors import NearestNeighbors
from metric_learn import (LMNN, ITML_S... | 28.313131 | 76 | 0.672851 |
d5859fe931eae735aa636ae9806270de2e729250 | 9,264 | py | Python | imodels/experimental/bartpy/samplers/unconstrainedtree/likihoodratio.py | csinva/interpretability-implementations-demos | 0223114225d0e077007b1ad49f63b64f3ff5ee15 | [
"MIT"
] | 102 | 2019-07-16T13:45:35.000Z | 2020-09-14T19:12:49.000Z | imodels/experimental/bartpy/samplers/unconstrainedtree/likihoodratio.py | csinva/interpretability-workshop | db201be7723179a1f5ab20b242419a604edc9186 | [
"MIT"
] | 2 | 2020-01-03T20:47:14.000Z | 2020-01-03T21:17:39.000Z | imodels/experimental/bartpy/samplers/unconstrainedtree/likihoodratio.py | csinva/interpretability-workshop | db201be7723179a1f5ab20b242419a604edc9186 | [
"MIT"
] | 8 | 2019-08-09T08:40:34.000Z | 2020-09-06T17:51:10.000Z | from typing import List
import numpy as np
from ...model import Model
from ...mutation import TreeMutation, GrowMutation, PruneMutation
from ...node import LeafNode, TreeNode
from ...samplers.treemutation import TreeMutationLikihoodRatio
from ...sigma import Sigma
from ...tree import Tree
def log_grow_ratio(combine... | 44.970874 | 118 | 0.724093 |
d585ae5d9ab5bee196b7eb38106aed273600967c | 12,217 | py | Python | pyseir/load_data.py | ConsultingMD/covid-data-model | f3d23f98eccca1ce33c7a11ab546e9aab5d0aa4d | [
"MIT"
] | 155 | 2020-03-18T13:23:42.000Z | 2022-03-19T23:57:10.000Z | pyseir/load_data.py | ConsultingMD/covid-data-model | f3d23f98eccca1ce33c7a11ab546e9aab5d0aa4d | [
"MIT"
] | 418 | 2020-03-20T02:22:01.000Z | 2022-03-31T23:05:08.000Z | pyseir/load_data.py | ConsultingMD/covid-data-model | f3d23f98eccca1ce33c7a11ab546e9aab5d0aa4d | [
"MIT"
] | 63 | 2020-03-19T07:04:23.000Z | 2022-02-25T13:51:26.000Z | import os
import logging
import urllib.request
from typing import Tuple
import requests
import re
import io
import us
import zipfile
import json
from datetime import datetime
from functools import lru_cache
import pandas as pd
import numpy as np
from covidactnow.datapublic.common_fields import CommonFields
from libs... | 34.414085 | 147 | 0.680282 |
d58601ccbed2dc27a37086104d27b31ff9ac68a2 | 165 | py | Python | demo.py | EmreCan99/DNA-process-lib | eba681c5656a69aedd5c8f1635a4e695389326ab | [
"MIT"
] | null | null | null | demo.py | EmreCan99/DNA-process-lib | eba681c5656a69aedd5c8f1635a4e695389326ab | [
"MIT"
] | null | null | null | demo.py | EmreCan99/DNA-process-lib | eba681c5656a69aedd5c8f1635a4e695389326ab | [
"MIT"
] | null | null | null | lis = []
# while lis:
# print("a")
lis.append("a")
lis[0] += "a"
lis.append("")
lis[0] += "b"
# for i in range(len(lis)):
# print(len(lis))
print(lis)
| 11.785714 | 30 | 0.49697 |
d586289fb31a1ac9ed0021278a1cfc40869918da | 122 | py | Python | HW_1/Ex1.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | HW_1/Ex1.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | HW_1/Ex1.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | bees_speed = 2 # 2 blocks per second
t = 10 # seconds
work_done = bees_speed * t
print("Total work done: ",work_done)
| 24.4 | 37 | 0.688525 |
d5867002b116d4d29b6eca42022c744de10ab643 | 4,230 | py | Python | app/controllers/admin/volunteers.py | BCStudentSoftwareDevTeam/celts | b14f3aea8fb3777d9e04feafbbb0f23f02ad5cf5 | [
"BSD-3-Clause"
] | null | null | null | app/controllers/admin/volunteers.py | BCStudentSoftwareDevTeam/celts | b14f3aea8fb3777d9e04feafbbb0f23f02ad5cf5 | [
"BSD-3-Clause"
] | 147 | 2021-06-11T18:27:53.000Z | 2022-03-22T18:50:35.000Z | app/controllers/admin/volunteers.py | BCStudentSoftwareDevTeam/celts | b14f3aea8fb3777d9e04feafbbb0f23f02ad5cf5 | [
"BSD-3-Clause"
] | 2 | 2021-09-16T18:46:21.000Z | 2021-11-10T19:10:17.000Z | from flask import request, render_template, redirect, url_for, request, flash, abort, g, json, jsonify
from datetime import datetime
from peewee import DoesNotExist
from app.controllers.admin import admin_bp
from app.models.event import Event
from app.models.user import User
from app.models.eventParticipant import Eve... | 37.105263 | 127 | 0.720804 |
d5867811698d5fe91ffc91cf03935fc7d7e03b0c | 8,887 | py | Python | oscar/lib/python2.7/site-packages/django/core/management/commands/dumpdata.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/core/management/commands/dumpdata.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/core/management/commands/dumpdata.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | import warnings
from collections import OrderedDict
from django.apps import apps
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import parse_apps_and_model_labels
from django.db import DEFAULT_DB_ALIAS, router
class Pr... | 45.341837 | 102 | 0.552492 |
d5867f02fa302fb91eb2612e3b9d3b361c6ef0c7 | 4,369 | py | Python | python_modules/dagster/dagster/core/storage/runs/migration.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/storage/runs/migration.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/storage/runs/migration.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from contextlib import ExitStack
from tqdm import tqdm
from dagster import check
from ..pipeline_run import PipelineRunStatus
from ..runs.base import RunStorage
from ..runs.schema import RunsTable
from ..tags import PARTITION_NAME_TAG, PARTITION_SET_TAG
RUN_PARTITIONS = "run_partitions"
RUN_START_END = "run_start_e... | 30.985816 | 113 | 0.675212 |
d5868a8617783e517bd0580e9c7b9d1c2520b677 | 1,100 | py | Python | app/core/migrations/0002_auto_20210529_1341.py | naokiyama/django-app-api | c8cb363834cd11720e97b7e7c0dc607069afc909 | [
"MIT"
] | null | null | null | app/core/migrations/0002_auto_20210529_1341.py | naokiyama/django-app-api | c8cb363834cd11720e97b7e7c0dc607069afc909 | [
"MIT"
] | null | null | null | app/core/migrations/0002_auto_20210529_1341.py | naokiyama/django-app-api | c8cb363834cd11720e97b7e7c0dc607069afc909 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-05-29 13:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('core', '0001_initial'),
]
operations = [
migrations.RenameField(
mode... | 36.666667 | 256 | 0.638182 |
d58694dd2ed2c520996af206f7240a47a918c3ec | 6,568 | py | Python | modules/tools/map_gen/map_gen_single_lane.py | DavidSplit/apollo-3.0 | 9f82838e857e4c9146952946cbc34b9f35098deb | [
"Apache-2.0"
] | 6 | 2019-10-11T07:57:49.000Z | 2022-02-23T15:23:41.000Z | modules/tools/map_gen/map_gen_single_lane.py | DavidSplit/apollo-3.0 | 9f82838e857e4c9146952946cbc34b9f35098deb | [
"Apache-2.0"
] | null | null | null | modules/tools/map_gen/map_gen_single_lane.py | DavidSplit/apollo-3.0 | 9f82838e857e4c9146952946cbc34b9f35098deb | [
"Apache-2.0"
] | 12 | 2019-10-11T07:57:49.000Z | 2022-03-16T05:13:00.000Z | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
# Modifications Copyright (c) 2018 LG Electronics, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... | 31.883495 | 79 | 0.635505 |
d5869abf8f6cc5f978769f2f01043244b6a590a5 | 1,589 | py | Python | tests/utilities/deconstruct_test.py | alysivji/sivtools | 570dba15e9669bc4e20e7dffc60fb2c70443456f | [
"MIT"
] | 6 | 2018-09-14T16:18:00.000Z | 2022-03-27T19:50:31.000Z | tests/utilities/deconstruct_test.py | alysivji/sivtools | 570dba15e9669bc4e20e7dffc60fb2c70443456f | [
"MIT"
] | 11 | 2018-01-31T14:18:54.000Z | 2020-06-09T00:46:45.000Z | tests/utilities/deconstruct_test.py | alysivji/sivtools | 570dba15e9669bc4e20e7dffc60fb2c70443456f | [
"MIT"
] | null | null | null | import pytest
from sivtools.utilities import deconstruct
def test_deconstruct_single_item_dict():
# Arrange
my_dict = {"key1": "value1"}
my_dict_copy = dict(my_dict)
# Act
key1, result = deconstruct(my_dict, "key1")
# Assert
assert key1 == "value1"
assert result == {}
assert my_... | 24.446154 | 68 | 0.633732 |
d586a2959012b2a2c2c3015d8c16e486674a29ca | 9,270 | py | Python | nova/tests/unit/api/openstack/compute/test_fixed_ips.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/test_fixed_ips.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/test_fixed_ips.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2020-07-24T01:18:44.000Z | 2020-07-24T01:18:44.000Z | # Copyright 2012 IBM Corp.
#
# 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 t... | 37.08 | 78 | 0.587379 |
d586b4de94a99e87585e0c753ae906668c31fe39 | 2,025 | py | Python | toscatranslator/common/exception.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | null | null | null | toscatranslator/common/exception.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | null | null | null | toscatranslator/common/exception.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | null | null | null | from toscaparser.common.exception import TOSCAException
from toscaparser.utils.gettextutils import _
class UnsupportedRequirementError(TOSCAException):
msg_fmt = _('Requirement "%(what)s" is not supported.')
class UnavailableNodeFilterError (TOSCAException):
msg_fmt = _('The "%(what)s" requirement support "... | 32.66129 | 111 | 0.746667 |
d586d3f96212e44eb6e6315399274761ea0a075a | 355 | py | Python | PerformanceImprovementPoC/LearnParallelProgramming/multiprocessing_simple.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | null | null | null | PerformanceImprovementPoC/LearnParallelProgramming/multiprocessing_simple.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | 28 | 2021-06-20T17:39:00.000Z | 2021-09-04T15:03:41.000Z | PerformanceImprovementPoC/LearnParallelProgramming/multiprocessing_simple.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | null | null | null | import multiprocessing
def worker(num):
# * thread worker function
print(f"worker: {num}")
return
if __name__ == "__main__":
jobs = []
for i in range(5):
p = multiprocessing.Process(target=worker, args=(i,))
jobs.append(p)
p.start()
#! apparently the multiprocessing sequ... | 19.722222 | 72 | 0.625352 |
d5870f3697e3a4ab481d8c0e9f6ba2940544a980 | 1,612 | py | Python | utils.py | yl-1993/ConvDeltaOrthogonal-Init | c8ae2a1d582e64bf9649f97e8e92b12733f8b2eb | [
"MIT"
] | 6 | 2018-09-07T20:38:45.000Z | 2021-05-06T03:45:19.000Z | utils.py | yl-1993/ConvDeltaOrthogonal-Init | c8ae2a1d582e64bf9649f97e8e92b12733f8b2eb | [
"MIT"
] | 1 | 2018-09-07T14:30:21.000Z | 2019-04-18T07:02:42.000Z | utils.py | yl-1993/ConvDeltaOrthogonal-Init | c8ae2a1d582e64bf9649f97e8e92b12733f8b2eb | [
"MIT"
] | 2 | 2020-07-10T01:35:31.000Z | 2021-12-20T10:10:39.000Z | import numpy as np
import torch
import os
import io
import pickle
from PIL import Image
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self, length):
self.length = length
self.reset()
def reset(self):
self.history = []
self... | 27.322034 | 73 | 0.593672 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.