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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d7cb278db4925e0e3d1a7252edbfd20eb8473dc | 729 | py | Python | py/1017. Convert to Base -2.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/1017. Convert to Base -2.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/1017. Convert to Base -2.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/convert-to-base-2/
# Given a number n, return a string consisting of "0"s and "1"s that represents
# its value in base -2 (negative two).
# The returned string must have no leading zeroes, unless the string is "0".
######################################################################... | 29.16 | 80 | 0.434842 |
2d7cc5fe31244f4b675970282eebb3f7fb37f399 | 1,766 | py | Python | Polarity_model/utility.py | hengwei-chan/simpletransformer_keras | 286633d3f2286868ecedb647f9d564c4b21eebf7 | [
"MIT"
] | 13 | 2019-04-04T09:50:25.000Z | 2022-03-23T14:23:15.000Z | Polarity_model/utility.py | hengwei-chan/simpletransformer_keras | 286633d3f2286868ecedb647f9d564c4b21eebf7 | [
"MIT"
] | 1 | 2020-03-30T03:05:13.000Z | 2020-03-30T03:05:13.000Z | Polarity_model/utility.py | hengwei-chan/simpletransformer_keras | 286633d3f2286868ecedb647f9d564c4b21eebf7 | [
"MIT"
] | 3 | 2019-11-10T13:29:07.000Z | 2021-03-26T17:18:34.000Z | import pickle
import numpy as np
def read_data(filename):
"""
Reads data from file with TREC format.
Return seperated X data and y data
"""
X=[]
y=[]
with open(filename,'r') as file:
for line in file:
tokens = line.strip().split(':')
question = " ".join(tokens[1:])
... | 24.527778 | 75 | 0.634768 |
2d7ce0a80c7a6e184822aeaa364d103e2064f822 | 55,484 | py | Python | DPM_GUI.py | suchetsapre/DPM-simulation-gui | d4e204172924dbcd840d8aa42e89087a486b2abe | [
"MIT"
] | null | null | null | DPM_GUI.py | suchetsapre/DPM-simulation-gui | d4e204172924dbcd840d8aa42e89087a486b2abe | [
"MIT"
] | null | null | null | DPM_GUI.py | suchetsapre/DPM-simulation-gui | d4e204172924dbcd840d8aa42e89087a486b2abe | [
"MIT"
] | null | null | null | """
GUI Creator: Suchet Sapre
Last Revision Date: 06/25/20
"""
import math
import numpy as np
from scipy.linalg import expm
from tkinter import *
import matplotlib.pyplot as plt
import csv
import pandas as pd
import os
import time
''' TODO: Convert global variables to class variables '''
t_interval = 45 # nu... | 44.280926 | 207 | 0.561081 |
2d7ce664e0ea02d8c37434cb48ef78171ef5aac0 | 2,581 | py | Python | yardstick/benchmark/scenarios/availability/scenario_general.py | kkltcjk/kklt | 5388eb439616a442dde496ef77ba6b71169369e0 | [
"Apache-2.0"
] | null | null | null | yardstick/benchmark/scenarios/availability/scenario_general.py | kkltcjk/kklt | 5388eb439616a442dde496ef77ba6b71169369e0 | [
"Apache-2.0"
] | null | null | null | yardstick/benchmark/scenarios/availability/scenario_general.py | kkltcjk/kklt | 5388eb439616a442dde496ef77ba6b71169369e0 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2016 Juan Qiu and others
# juan_ qiu@tongji.edu.cn
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distributi... | 37.955882 | 78 | 0.571871 |
2d7d122ad8c77063d4c05842323c238475d99056 | 16,321 | py | Python | src/networks/Resnet50_vanilla.py | knmac/LCDC_release | f977ca1cda972983cac7e33b324f07f2e1463a19 | [
"MIT"
] | 24 | 2019-09-18T09:22:08.000Z | 2022-03-08T06:47:33.000Z | src/networks/Resnet50_vanilla.py | knmac/LCDC_release | f977ca1cda972983cac7e33b324f07f2e1463a19 | [
"MIT"
] | 6 | 2019-09-18T09:21:02.000Z | 2022-02-09T23:31:48.000Z | src/networks/Resnet50_vanilla.py | knmac/LCDC_release | f977ca1cda972983cac7e33b324f07f2e1463a19 | [
"MIT"
] | 4 | 2020-08-06T02:05:36.000Z | 2021-12-12T07:19:17.000Z | import tensorflow as tf
from .network import Network
class Resnet50Vanilla(Network):
def build_graph(self):
""" Build graph for model
"""
n_classes = self.n_classes
# Feature extraction
(self.feed('data')
.conv(7, 7, 64, 2, 2, relu=False, name='conv1')
... | 53.336601 | 92 | 0.578886 |
2d7d25eb60097b573cc5b12788241e4369433ed7 | 2,468 | py | Python | ciphers/rsa_key_generator.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | ciphers/rsa_key_generator.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | ciphers/rsa_key_generator.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | 1 | 2020-06-26T09:46:17.000Z | 2020-06-26T09:46:17.000Z | '''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT... | 32.906667 | 137 | 0.66248 |
2d7d409ae4c123db0bda19d342f0642154bd53c1 | 4,364 | py | Python | flexget/tests/test_rejected_api.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | 1 | 2018-05-02T21:14:50.000Z | 2018-05-02T21:14:50.000Z | flexget/tests/test_rejected_api.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | flexget/tests/test_rejected_api.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from datetime import datetime
from builtins import * # pylint: disable=unused-import, redefined-builtin
from flexget.manager import Session
from flexget.plugins.api.rejected import rejected_entry_object, rejected_entries_list_object
from flexget.plug... | 35.479675 | 117 | 0.646884 |
2d7d748565569165d4ab5ffd243cb5126fc12113 | 5,796 | py | Python | apysc/_display/line_thickness_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | apysc/_display/line_thickness_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | apysc/_display/line_thickness_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | """Class implementation for line thickness interface.
"""
from typing import Dict
from typing import Union
from apysc._animation.animation_line_thickness_interface import \
AnimationLineThicknessInterface
from apysc._type.attr_linking_interface import AttrLinkingInterface
from apysc._type.int import Int
... | 34.094118 | 79 | 0.597999 |
2d7d819c1609056f462e473d4da57f680d4af68b | 1,634 | py | Python | setup.py | Biomapas/B.CfnElasticsearchCloner | e3d1b4406d9a7dc51a30473ac9fa82dc1db3c17d | [
"Apache-2.0"
] | null | null | null | setup.py | Biomapas/B.CfnElasticsearchCloner | e3d1b4406d9a7dc51a30473ac9fa82dc1db3c17d | [
"Apache-2.0"
] | 1 | 2020-11-27T08:58:30.000Z | 2020-11-27T08:58:30.000Z | setup.py | Biomapas/B.CfnElasticsearchCloner | e3d1b4406d9a7dc51a30473ac9fa82dc1db3c17d | [
"Apache-2.0"
] | 3 | 2020-11-26T02:14:40.000Z | 2021-12-10T11:51:56.000Z | from setuptools import find_packages, setup
with open("README.md") as readme_file:
README = readme_file.read()
with open("HISTORY.md") as history_file:
HISTORY = history_file.read()
with open("VERSION") as file:
VERSION = file.read()
VERSION = "".join(VERSION.split())
setup(
name="b_cfn_elastics... | 31.423077 | 98 | 0.620563 |
2d7d849b81912a89d473c4104e92f3bddb00c19a | 2,112 | py | Python | src/steampunk_scanner/commands/account.py | xlab-steampunk/steampunk-scanner-cli | d2206f72b29bf1e1d3c9dcc330413117df4838e9 | [
"Apache-2.0"
] | 3 | 2021-11-04T14:22:48.000Z | 2022-02-03T21:49:03.000Z | src/steampunk_scanner/commands/account.py | xlab-steampunk/steampunk-scanner-cli | d2206f72b29bf1e1d3c9dcc330413117df4838e9 | [
"Apache-2.0"
] | 8 | 2021-11-17T16:41:10.000Z | 2022-03-18T10:29:12.000Z | src/steampunk_scanner/commands/account.py | xlab-steampunk/steampunk-scanner-cli | d2206f72b29bf1e1d3c9dcc330413117df4838e9 | [
"Apache-2.0"
] | 1 | 2022-02-03T22:11:32.000Z | 2022-02-03T22:11:32.000Z | import argparse
from getpass import getpass
from steampunk_scanner import api
def add_parser(subparsers: argparse._SubParsersAction):
"""
Adds a new parser to subparsers
:param subparsers: Subparsers action
"""
parser = subparsers.add_parser(
"account", help="Manage user account", descrip... | 30.608696 | 91 | 0.67803 |
2d7de8c38ba99dfe894eb11726680b15c181c720 | 2,031 | py | Python | tests/test_catserv_api.py | TheDataStation/catalog-service | de7113288cc3e6d5b856656f8b7be4dfdf5de4be | [
"MIT"
] | null | null | null | tests/test_catserv_api.py | TheDataStation/catalog-service | de7113288cc3e6d5b856656f8b7be4dfdf5de4be | [
"MIT"
] | null | null | null | tests/test_catserv_api.py | TheDataStation/catalog-service | de7113288cc3e6d5b856656f8b7be4dfdf5de4be | [
"MIT"
] | null | null | null | import unittest
from ds_catalog_service.backends import NormalizedSQLiteBackend
from ds_catalog_service.backends import CatalogService
import os
import cProfile, pstats
import io
test_db_name = "test_catserv.db"
class TestCatalogService(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.cs =... | 38.320755 | 156 | 0.620876 |
2d7dfa73fc32975397a3a4255fc4f2532186d288 | 871 | py | Python | sahara_plugin_cdh/tests/__init__.py | tellesnobrega/sahara-plugin-cdh | c6a8a3e11b40ee36a8b41069f2cb96c029461b65 | [
"Apache-2.0"
] | null | null | null | sahara_plugin_cdh/tests/__init__.py | tellesnobrega/sahara-plugin-cdh | c6a8a3e11b40ee36a8b41069f2cb96c029461b65 | [
"Apache-2.0"
] | null | null | null | sahara_plugin_cdh/tests/__init__.py | tellesnobrega/sahara-plugin-cdh | c6a8a3e11b40ee36a8b41069f2cb96c029461b65 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 34.84 | 79 | 0.737084 |
2d7dfaa1d1b86116572e6b8e16a7c1417938ebf9 | 5,534 | py | Python | src/server/classes/parsers/lottery_parser.py | LiteralGenie/HvData | e4a8cac99c7443d7c6be41b4586b1d5a01e27a2b | [
"MIT"
] | null | null | null | src/server/classes/parsers/lottery_parser.py | LiteralGenie/HvData | e4a8cac99c7443d7c6be41b4586b1d5a01e27a2b | [
"MIT"
] | null | null | null | src/server/classes/parsers/lottery_parser.py | LiteralGenie/HvData | e4a8cac99c7443d7c6be41b4586b1d5a01e27a2b | [
"MIT"
] | null | null | null | from hvpytils import HvSession
from ..errors import NoResultsError, UnparsablePageError
from ..models.lottery import Lottery, LotteryItem, LotteryType
from ..models.user import User
from .user_parser import UserParser
from bs4 import BeautifulSoup
from urlpath import URL
import logging, re
LOG = logging.getLogger('L... | 35.703226 | 179 | 0.613842 |
2d7e100eaa21fb5c4e0bb9cf86961032ef75f695 | 8,634 | py | Python | helper_tools/kodi_play_satip.py | stko/Schnipsl | 824572c657e48f18950f584b9529661ff5bb8069 | [
"MIT"
] | null | null | null | helper_tools/kodi_play_satip.py | stko/Schnipsl | 824572c657e48f18950f584b9529661ff5bb8069 | [
"MIT"
] | 29 | 2020-08-30T15:07:50.000Z | 2022-02-19T03:41:26.000Z | helper_tools/kodi_play_satip.py | wifitvbox/Schnipsl | 553ce8de3dda26fb92297ad76e92f4a363070e4e | [
"MIT"
] | 1 | 2020-12-28T05:46:17.000Z | 2020-12-28T05:46:17.000Z | import xbmc
import xbmcaddon
import xbmcgui
import sys
import json
import socket
from urlparse import urlparse
import re
import time
import base64
class XBMCPlayer( xbmc.Player ):
def __init__( self, *args, **kwargs ):
super(XBMCPlayer,self).__init__(*args, **kwargs )
self.run_flag=True
def onAVStarted( self... | 28.123779 | 149 | 0.705235 |
2d7e256110af8c90e641c75df0e3ff433544268d | 7,676 | py | Python | scrapfly/scrapy/spider.py | scrapfly/python-scrapfly | ee3112971bc28b6a8e7039711f59da90de7025c2 | [
"BSD-2-Clause"
] | 3 | 2021-05-18T05:06:23.000Z | 2021-12-19T02:57:33.000Z | scrapfly/scrapy/spider.py | scrapfly/python-scrapfly | ee3112971bc28b6a8e7039711f59da90de7025c2 | [
"BSD-2-Clause"
] | 5 | 2021-01-08T04:12:28.000Z | 2021-07-14T07:53:54.000Z | scrapfly/scrapy/spider.py | scrapfly/python-scrapfly | ee3112971bc28b6a8e7039711f59da90de7025c2 | [
"BSD-2-Clause"
] | 1 | 2021-05-18T05:06:30.000Z | 2021-05-18T05:06:30.000Z | import copy
import uuid
import logging
try:
from functools import cached_property
except ImportError:
from ..polyfill.cached_property import cached_property
from os import environ
from typing import Dict, Iterable, Sequence, Union, Optional
import scrapy
from scrapy.crawler import Crawler
from scrapy.spiders... | 36.903846 | 121 | 0.674049 |
2d7e92f9e0623fd0a3973e524aa135aa6a27be6c | 396 | py | Python | surgen/log.py | toumorokoshi/surgen | 9a5028e464c5a27acb4d240fd4340e3485833896 | [
"MIT"
] | 6 | 2017-04-11T16:34:06.000Z | 2019-06-25T15:37:44.000Z | surgen/log.py | toumorokoshi/surgen | 9a5028e464c5a27acb4d240fd4340e3485833896 | [
"MIT"
] | 2 | 2019-06-25T17:23:37.000Z | 2019-06-28T20:00:27.000Z | surgen/log.py | toumorokoshi/surgen | 9a5028e464c5a27acb4d240fd4340e3485833896 | [
"MIT"
] | 3 | 2017-06-22T20:41:54.000Z | 2019-06-25T15:30:00.000Z | import coloredlogs
import logging
def setup_logging(level):
level = logging.getLevelName(level)
root_logger = logging.getLogger()
root_logger.setLevel(level)
handler = logging.StreamHandler()
handler.setLevel(level)
formatter = coloredlogs.ColoredFormatter("%(asctime)s %(levelname)s %(message)... | 28.285714 | 85 | 0.747475 |
2d7e95ade8765fe3b8700f6ee846600f7b56bdf4 | 1,315 | py | Python | test/test_loadlimit.py | arielmakestuff/loadlimit | 70d3d23eecfe7922699098ea4901cc8673d14576 | [
"MIT"
] | null | null | null | test/test_loadlimit.py | arielmakestuff/loadlimit | 70d3d23eecfe7922699098ea4901cc8673d14576 | [
"MIT"
] | 5 | 2016-11-28T16:59:44.000Z | 2017-03-18T17:10:40.000Z | test/test_loadlimit.py | arielmakestuff/loadlimit | 70d3d23eecfe7922699098ea4901cc8673d14576 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# loadlimit/test/test_loadlimit.py
# Copyright (C) 2016 authors and contributors (see AUTHORS file)
#
# This module is released under the MIT License.
"""Example test"""
# ============================================================================
# Imports
# =================================... | 22.672414 | 78 | 0.306464 |
2d7e97cdef1d5e80a673886ca5e56a9fb6d1237d | 308 | py | Python | py_kor/pk_design_patterns/implementation/singleton.py | vladankor/core | ae23a4e47e487e55b0a44c415a45adc2e437f2a4 | [
"MIT"
] | null | null | null | py_kor/pk_design_patterns/implementation/singleton.py | vladankor/core | ae23a4e47e487e55b0a44c415a45adc2e437f2a4 | [
"MIT"
] | null | null | null | py_kor/pk_design_patterns/implementation/singleton.py | vladankor/core | ae23a4e47e487e55b0a44c415a45adc2e437f2a4 | [
"MIT"
] | 1 | 2021-01-30T13:58:22.000Z | 2021-01-30T13:58:22.000Z | from typing import Any
class Singleton(type):
"""
Pattern Singleton metaclass
"""
__instance = None
def __call__(cls, *args, **kwargs) -> Any:
if cls.__instance is None:
cls.__instance = super(Singleton, cls).__call__(*args, **kwargs)
return cls.__instance
| 22 | 76 | 0.62013 |
2d7eb3fa7c066cec372ae9062944b3f790eab385 | 1,280 | py | Python | filesystem/process-zipfile-iteratively-with-temp-folder.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | 1 | 2020-07-21T23:24:25.000Z | 2020-07-21T23:24:25.000Z | filesystem/process-zipfile-iteratively-with-temp-folder.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | 4 | 2021-06-29T00:38:57.000Z | 2022-01-15T00:22:15.000Z | filesystem/process-zipfile-iteratively-with-temp-folder.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | null | null | null |
"""
Purpose:
Date created: 2019-09-18
Contributor(s):
Mark M.
"""
from os import path
import zipfile
import tempfile
import pandas as pd
### Replace with path to zipfile, including extension
full_zip_path = r'C:\path\to\zipfile.zip'
def process_zipfile():
### Using try-except in the event that a file does... | 28.444444 | 85 | 0.601563 |
2d7eb8817f1cd69016a701b01c7feb76dcfc6a76 | 3,661 | py | Python | mitmproxy/tools/web/static_viewer.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | mitmproxy/tools/web/static_viewer.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | mitmproxy/tools/web/static_viewer.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | import json
import os.path
import pathlib
import shutil
import time
from collections.abc import Iterable
from typing import Optional
from mitmproxy import contentviews, http
from mitmproxy import ctx
from mitmproxy import flowfilter
from mitmproxy import io, flow
from mitmproxy import version
from mitmproxy.tools.web.... | 34.214953 | 90 | 0.586725 |
2d7ef353e78a8a4897523de2d6580443f1b110d9 | 8,144 | py | Python | src/scenarios/3/controller.py | nico989/SVMN | a0d1c7edbd7f4be309d4042f4e5d552c3672694c | [
"MIT"
] | 1 | 2022-03-23T13:28:24.000Z | 2022-03-23T13:28:24.000Z | src/scenarios/3/controller.py | nico989/SVMN | a0d1c7edbd7f4be309d4042f4e5d552c3672694c | [
"MIT"
] | null | null | null | src/scenarios/3/controller.py | nico989/SVMN | a0d1c7edbd7f4be309d4042f4e5d552c3672694c | [
"MIT"
] | null | null | null | from ryu.base import app_manager
from ryu.topology import event
from ryu.topology.api import get_switch
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER, CONFIG_DISPATCHER, DEAD_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_0
from ryu.... | 32.446215 | 154 | 0.588409 |
2d7f28b6c02f7e68bb630531b2e0c4d6ef33384c | 1,130 | py | Python | util/configutils.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | 4 | 2019-12-19T17:17:42.000Z | 2021-12-11T23:12:45.000Z | util/configutils.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | 32 | 2020-03-19T15:56:05.000Z | 2021-12-23T12:46:06.000Z | util/configutils.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | null | null | null | from configparser import ConfigParser
from eatb.utils.randomutils import randomword
def set_default_config_if_not_exists(cfg_file, default_cfg):
config = ConfigParser()
config.read(cfg_file)
changed = False
for conf in default_cfg:
section, option, value = conf
if not config.has_secti... | 31.388889 | 115 | 0.629204 |
2d7f34cdf7b33dbd3d763d3692ec6a1243fc623b | 34,989 | py | Python | recognition_results_pb2.py | zuvaai/hocr-to-zuvaocr-converter | b7eafed23a00efd1ee6caa748e2fdb7788aed914 | [
"Apache-2.0"
] | null | null | null | recognition_results_pb2.py | zuvaai/hocr-to-zuvaocr-converter | b7eafed23a00efd1ee6caa748e2fdb7788aed914 | [
"Apache-2.0"
] | null | null | null | recognition_results_pb2.py | zuvaai/hocr-to-zuvaocr-converter | b7eafed23a00efd1ee6caa748e2fdb7788aed914 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: recognition_results.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database ... | 43.73625 | 2,576 | 0.638544 |
2d7f48441584e484ce2382ccfbeec49d8af21063 | 19,332 | py | Python | clifford/tools/g3c/rotor_estimation.py | hugohadfield/clifford | 3e15da3ba429c69a5a5a641f2103d7bcca42617d | [
"BSD-3-Clause"
] | null | null | null | clifford/tools/g3c/rotor_estimation.py | hugohadfield/clifford | 3e15da3ba429c69a5a5a641f2103d7bcca42617d | [
"BSD-3-Clause"
] | null | null | null | clifford/tools/g3c/rotor_estimation.py | hugohadfield/clifford | 3e15da3ba429c69a5a5a641f2103d7bcca42617d | [
"BSD-3-Clause"
] | null | null | null | import random
from scipy import e
import numpy as np
import multiprocessing
from scipy.optimize import minimize
from .rotor_parameterisation import rotorconversion
from . import rotor_between_objects, apply_rotor, square_roots_of_rotor, rotor_between_lines, normalised
from clifford.g3c import *
from clifford.tools im... | 37.320463 | 135 | 0.610801 |
2d7f598e521d5f05112136718b1406bd653d9b4e | 989 | py | Python | test/kokemaenjokilaakso.py | joniok/hybra-medialoader | ebc6df58287b5146917d66de69d807309cea4a8f | [
"MIT"
] | null | null | null | test/kokemaenjokilaakso.py | joniok/hybra-medialoader | ebc6df58287b5146917d66de69d807309cea4a8f | [
"MIT"
] | 14 | 2016-10-14T15:09:42.000Z | 2017-03-01T14:29:29.000Z | test/kokemaenjokilaakso.py | joniok/hybra-medialoader | ebc6df58287b5146917d66de69d807309cea4a8f | [
"MIT"
] | 1 | 2020-11-18T13:06:48.000Z | 2020-11-18T13:06:48.000Z | import sys
import os
import filecmp
import importlib
import datetime
import common
path = os.path.abspath('.')
sys.path.append(path)
domain = 'kokemaenjokilaakso'
url = 'http://www.kokemaenjokilaakso.fi/2016/10/12/tatulle-ja-patulle-suunnitellaan-elamyskohdetta-vammalaan/'
out = 'test/parser_out.txt'
module = import... | 24.121951 | 110 | 0.73913 |
2d7f93b978b8ff7d956ce6639bb6718cd0092f09 | 5,617 | py | Python | sumy/summarizers/text_rank_ner.py | gsandeep1241/TextSummarizer | fc9af3cf3a74114db94a837d5d20c16a08f806be | [
"Apache-2.0"
] | null | null | null | sumy/summarizers/text_rank_ner.py | gsandeep1241/TextSummarizer | fc9af3cf3a74114db94a837d5d20c16a08f806be | [
"Apache-2.0"
] | 5 | 2020-03-24T16:36:34.000Z | 2021-12-13T19:53:21.000Z | sumy/summarizers/text_rank_ner.py | gsandeep1241/TextSummarizer | fc9af3cf3a74114db94a837d5d20c16a08f806be | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
import nltk
from nltk.tag import StanfordNERTagger
import spacy
from sklearn import preprocessing
import math
try:
import numpy
except ImportError:
numpy = None
from ._summarizer i... | 39.27972 | 217 | 0.650881 |
2d7fb2caac934c16b5db8ccb5979e0da1ca7851d | 5,199 | py | Python | src/utils.py | KhalilBR94/PathogenicAaMutation | 112988135e3ba8ba5e8112d2ef28e147ae581d77 | [
"Apache-2.0"
] | null | null | null | src/utils.py | KhalilBR94/PathogenicAaMutation | 112988135e3ba8ba5e8112d2ef28e147ae581d77 | [
"Apache-2.0"
] | null | null | null | src/utils.py | KhalilBR94/PathogenicAaMutation | 112988135e3ba8ba5e8112d2ef28e147ae581d77 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from imblearn.over_sampling import RandomOverSampler
from sklearn.model_selection import train_test_split
from deepchain.models.utils import confusion_matrix_plot, model_evaluation_accuracy, confusion... | 35.367347 | 134 | 0.685516 |
2d7fb4a0ba52f09d8325c6eee53c3e9ef0163daa | 12,930 | py | Python | audioread/gstdec.py | jcsaaddupuy/audioread | 00aa4a41553e5df5f568f38558c3e2d76d34d906 | [
"MIT"
] | null | null | null | audioread/gstdec.py | jcsaaddupuy/audioread | 00aa4a41553e5df5f568f38558c3e2d76d34d906 | [
"MIT"
] | null | null | null | audioread/gstdec.py | jcsaaddupuy/audioread | 00aa4a41553e5df5f568f38558c3e2d76d34d906 | [
"MIT"
] | null | null | null | # This file is part of audioread.
# Copyright 2011, Adrian Sampson.
#
# 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 rights to use, co... | 33.324742 | 77 | 0.621732 |
2d7fc8fe2fd436eaf478d9a2ff3c671548649127 | 19,576 | py | Python | requests/models.py | garnaat/requests | 74a3e933d464e7af12e6d58035ec0d85ac818627 | [
"0BSD"
] | 2 | 2015-07-18T00:31:31.000Z | 2019-11-20T04:16:46.000Z | requests/models.py | garnaat/requests | 74a3e933d464e7af12e6d58035ec0d85ac818627 | [
"0BSD"
] | null | null | null | requests/models.py | garnaat/requests | 74a3e933d464e7af12e6d58035ec0d85ac818627 | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
"""
import urllib
import urllib2
import socket
import zlib
from urllib2 import HTTPError
from urlparse import urlparse, urlunparse, urljoin
from datetime import datetime
from .config import settings
from .monkeys import Request as _Request, HTTPBasicAuthH... | 31.371795 | 134 | 0.576727 |
2d7fd03cb48f1b96fbcf76258e2eccae53a8b47f | 3,619 | py | Python | rhucrl/policy/split_policy.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2021-11-19T11:46:48.000Z | 2021-11-19T11:46:48.000Z | rhucrl/policy/split_policy.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2021-11-22T07:48:03.000Z | 2021-11-22T07:48:03.000Z | rhucrl/policy/split_policy.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2022-03-26T10:18:01.000Z | 2022-03-26T10:18:01.000Z | """Python Script Template."""
from rllib.policy import NNPolicy
from .adversarial_policy import AdversarialPolicy
class SplitPolicy(AdversarialPolicy):
"""Split a policy into protagonist and antagonist policies."""
def __init__(self, hallucinate_protagonist=True, *args, **kwargs):
super().__init__(... | 35.480392 | 83 | 0.648245 |
2d7ff48265668aa43d11def4f9ac3c3f5b877be9 | 1,859 | py | Python | tools/dockerize/webportal/usr/lib/python2.7/site-packages/xstatic/pkg/jquery_tablesorter/__init__.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/xstatic/pkg/jquery_tablesorter/__init__.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/xstatic/pkg/jquery_tablesorter/__init__.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | """
XStatic resource package
See package 'XStatic' for documentation and basic tools.
"""
DISPLAY_NAME = 'JQuery.TableSorter' # official name, upper/lowercase allowed, no spaces
PACKAGE_NAME = 'XStatic-%s' % DISPLAY_NAME # name used for PyPi
NAME = __name__.split('.')[-1] # package name (e.g. 'foo' or 'foo_bar')
... | 37.18 | 87 | 0.697687 |
2d800a90b1003b04d9e8b18547e29edd10f38546 | 26,083 | py | Python | cuhk_seis/phase_convert.py | zijinping/relocation | 7de003ee1ef8587e8fcbeba1edd967cdf4c00637 | [
"MIT"
] | null | null | null | cuhk_seis/phase_convert.py | zijinping/relocation | 7de003ee1ef8587e8fcbeba1edd967cdf4c00637 | [
"MIT"
] | null | null | null | cuhk_seis/phase_convert.py | zijinping/relocation | 7de003ee1ef8587e8fcbeba1edd967cdf4c00637 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# author: Hardy ZI
# history:
# ...
# 2021-03-15 Add CN2fsdn function
#
import re
from obspy import UTCDateTime
import os
import sys
import time
from cuhk_seis.reloc_related import load_DD
import time
from cuhk_seis.utils import WY_para
from tqdm import tqdm
def phs2vel(p... | 37.208274 | 145 | 0.488977 |
2d8015b7d18cc9b537f93ae48c46dc691b142659 | 296 | py | Python | src/infi/pyutils/functors/always.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 1 | 2022-02-12T20:30:55.000Z | 2022-02-12T20:30:55.000Z | src/infi/pyutils/functors/always.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 5 | 2015-11-08T14:50:42.000Z | 2020-06-23T14:42:33.000Z | src/infi/pyutils/functors/always.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 4 | 2015-02-22T09:06:59.000Z | 2022-02-12T20:30:55.000Z | from .functor import Functor
class Always(Functor):
def __init__(self, value):
super(Always, self).__init__()
self._value = value
def __call__(self, *args, **kwargs):
return self._value
def __repr__(self):
return "<Always {0!r}>".format(self._value)
| 24.666667 | 51 | 0.628378 |
2d801feee0ce8c4df19e8bf1f1940f312898b448 | 2,166 | py | Python | defoe/alto/queries/keyword_by_word.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 2 | 2022-02-14T12:10:54.000Z | 2022-02-14T12:35:44.000Z | defoe/alto/queries/keyword_by_word.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 17 | 2022-02-09T21:46:14.000Z | 2022-02-25T14:55:09.000Z | defoe/alto/queries/keyword_by_word.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 1 | 2022-02-14T13:19:08.000Z | 2022-02-14T13:19:08.000Z | """
Counts number of occurrences of keywords and groups by word.
"""
from defoe import query_utils
from operator import add
def do_query(archives, config_file=None, logger=None, context=None):
"""
Counts number of occurrences of keywords and groups by word.
config_file must be the path to a configurati... | 26.740741 | 81 | 0.576177 |
2d8030681a664197cb6fc679e5565d522acaf4a7 | 6,430 | py | Python | PythonProjects/99-CapstoneProject-202020-DavidAndVIbha-SOLUTION/labs/lab1a_drive_system.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/99-CapstoneProject-202020-DavidAndVIbha-SOLUTION/labs/lab1a_drive_system.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/99-CapstoneProject-202020-DavidAndVIbha-SOLUTION/labs/lab1a_drive_system.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | """
Capstone Team Project. Code to run on a ROBOT (NOT a laptop).
This module is for testing STAND-ALONE code running on the ROBOT
(WITHOUT having LAPTOP GUI code running on the LAPTOP at the same time).
In particular, it tests part of the DriveSystem class.
Authors: Your professors (for the framework)
and ... | 45.928571 | 80 | 0.521928 |
2d8032c65f15314a84beba93de39b6f3a4aab9b3 | 3,517 | py | Python | test/vanilla/low-level/Expected/AcceptanceTests/BodyComplexLowLevel/bodycomplexlowlevel/rest/readonlyproperty/_request_builders_py3.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/low-level/Expected/AcceptanceTests/BodyComplexLowLevel/bodycomplexlowlevel/rest/readonlyproperty/_request_builders_py3.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/low-level/Expected/AcceptanceTests/BodyComplexLowLevel/bodycomplexlowlevel/rest/readonlyproperty/_request_builders_py3.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.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 ... | 38.648352 | 110 | 0.649986 |
2d8045343e89521038c2d1719afbc2d39a1b2b7d | 2,966 | py | Python | examples/references/segmentation/pascal_voc2012/code/dataflow/datasets.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | 1 | 2020-06-13T15:22:08.000Z | 2020-06-13T15:22:08.000Z | examples/references/segmentation/pascal_voc2012/code/dataflow/datasets.py | hefv57/ignite | a22a0f5e909ac70d2a1f76a60b6e84b2134f196c | [
"BSD-3-Clause"
] | null | null | null | examples/references/segmentation/pascal_voc2012/code/dataflow/datasets.py | hefv57/ignite | a22a0f5e909ac70d2a1f76a60b6e84b2134f196c | [
"BSD-3-Clause"
] | 1 | 2020-06-13T15:30:46.000Z | 2020-06-13T15:30:46.000Z | from typing import Type, Callable
import numpy as np
import cv2
from PIL import Image
from torch.utils.data import Dataset
from torchvision.datasets.voc import VOCSegmentation
from torchvision.datasets.sbd import SBDataset
class TransformedDataset(Dataset):
def __init__(self, ds: Dataset, transform_fn: Calla... | 32.955556 | 119 | 0.653742 |
2d804e5a3d0cadd36531c698159b7cd667fa8535 | 4,546 | py | Python | yapu/meta/decorator.py | pestrela/yapu | 27acb067b89ef0eeaa3da2234141abf9d811e0ae | [
"MIT"
] | null | null | null | yapu/meta/decorator.py | pestrela/yapu | 27acb067b89ef0eeaa3da2234141abf9d811e0ae | [
"MIT"
] | null | null | null | yapu/meta/decorator.py | pestrela/yapu | 27acb067b89ef0eeaa3da2234141abf9d811e0ae | [
"MIT"
] | null | null | null |
from ..imports.internal import *
#from .trace import *
def decorator_with_arguments(argument):
"""
https://stackoverflow.com/questions/5929107/decorators-with-parameters
"""
def real_decorator(function):
def wrapper(*args, **kwargs):
funny_stuff()
something_wit... | 21.443396 | 141 | 0.649362 |
2d809563982f686ed96613b68966ab243392250d | 5,345 | py | Python | base/pythonvideoannotator/pythonvideoannotator/settings.py | iory/pythonvideoannotator | 099b5f546296f3bfd668a4ee8fc2042c8c7f272f | [
"MIT"
] | null | null | null | base/pythonvideoannotator/pythonvideoannotator/settings.py | iory/pythonvideoannotator | 099b5f546296f3bfd668a4ee8fc2042c8c7f272f | [
"MIT"
] | null | null | null | base/pythonvideoannotator/pythonvideoannotator/settings.py | iory/pythonvideoannotator | 099b5f546296f3bfd668a4ee8fc2042c8c7f272f | [
"MIT"
] | null | null | null | # !/usr/bin/python2
# -*- coding: utf-8 -*-
SETTINGS_PRIORITY = 10
import os
from pyforms_gui.utils.plugins_finder import PluginsFinder
# LOGGING CONFIGURATION #################################
import logging
APP_LOG_HANDLER_LEVEL = logging.INFO
APP_LOG_HANDLER_FILE = 'video-annotator.log'
APP_LOG_HANDLER_... | 48.590909 | 123 | 0.586904 |
2d80a5f875f22695a8ca26b49bf10f3159acd740 | 325 | py | Python | LeetCode/easy - Array/1013. Partition Array Into Three Parts With Equal Sum/.ipynb_checkpoints/solution-checkpoint.py | vincent507cpu/Comprehensive-Algorithm-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | 4 | 2020-06-26T00:45:53.000Z | 2021-04-19T12:23:32.000Z | LeetCode/easy - Array/1013. Partition Array Into Three Parts With Equal Sum/.ipynb_checkpoints/solution-checkpoint.py | vincent507cpu/LeetCode-Comprehensive-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | null | null | null | LeetCode/easy - Array/1013. Partition Array Into Three Parts With Equal Sum/.ipynb_checkpoints/solution-checkpoint.py | vincent507cpu/LeetCode-Comprehensive-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | null | null | null | class Solution:
# my solution
def canThreePartsEqualSum(self, A: List[int]) -> bool:
n = sum(A) // 3
cnt, rest = 0, n
for i in range(len(A)):
rest -= A[i]
if rest == 0:
cnt += 1
rest = n
return cnt ... | 25 | 58 | 0.384615 |
2d80ab2f2f719b0c92d69157612fa1788fa6d553 | 1,066 | py | Python | 1_code/check_answer/question_checker.py | jaimiles23/Multiplication_Medley | 1072dea1a5be0b339211ff39db6a89a90aca64c1 | [
"MIT"
] | null | null | null | 1_code/check_answer/question_checker.py | jaimiles23/Multiplication_Medley | 1072dea1a5be0b339211ff39db6a89a90aca64c1 | [
"MIT"
] | null | null | null | 1_code/check_answer/question_checker.py | jaimiles23/Multiplication_Medley | 1072dea1a5be0b339211ff39db6a89a90aca64c1 | [
"MIT"
] | null | null | null | """/**
* @author [Jai Miles]
* @email [jaimiles23@gmail.com]
* @create date 2020-05-13 22:22:55
* @modify date 2020-06-16 15:58:04
* @desc [
QuestionChecker class. Returns boolean if user answer was correct.
]
*/
"""
##########
# Imports
##########
from logs import log_func_name, logger
from slots.slot_ut... | 24.790698 | 80 | 0.64728 |
2d80b05b2daa24e4b2da2a3e4e48984601c3afa0 | 2,964 | py | Python | gcp/stackdriver_helpers.py | d-v-dlee/code_references | 21d81ac42c7a4f6def58290ceed439915c57e176 | [
"MIT"
] | null | null | null | gcp/stackdriver_helpers.py | d-v-dlee/code_references | 21d81ac42c7a4f6def58290ceed439915c57e176 | [
"MIT"
] | null | null | null | gcp/stackdriver_helpers.py | d-v-dlee/code_references | 21d81ac42c7a4f6def58290ceed439915c57e176 | [
"MIT"
] | null | null | null | from google.cloud import monitoring_v3
import time
import numpy as np
def create_metric(project_name, name, description):
"""
Function for creating a metric to track in stackdriver.
NOTE: should only have to be run once. Needs credentials to GCP project.
inputs
-----
project_name: name of pro... | 36.592593 | 133 | 0.712213 |
2d80c4cf71226ba4f071aec0b626a1951b69c783 | 8,635 | py | Python | src/common_crypto.py | tswast/encrypted-bigquery-client | 35bdf1bbc7ea87a1482a78ad0347f4118bd0bfb1 | [
"Apache-2.0"
] | null | null | null | src/common_crypto.py | tswast/encrypted-bigquery-client | 35bdf1bbc7ea87a1482a78ad0347f4118bd0bfb1 | [
"Apache-2.0"
] | null | null | null | src/common_crypto.py | tswast/encrypted-bigquery-client | 35bdf1bbc7ea87a1482a78ad0347f4118bd0bfb1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Contains generally applicable crypto methods.
AesCbc: class for encrypting and decrypting in cbc mode with pkcs padding.
GetRandBytes: function that returns random bytes.
PRF: a pseudorandom function.
"""
import hashlib
import hmac
im... | 35.101626 | 80 | 0.678054 |
2d80cc335ea820160a0be0731dc0cd48a4988b12 | 5,551 | py | Python | apps/generate.py | gatheluck/FourierBasisDB | 12ac8a8049304df59d4faa3ddb0bb7b2bfda5566 | [
"MIT"
] | null | null | null | apps/generate.py | gatheluck/FourierBasisDB | 12ac8a8049304df59d4faa3ddb0bb7b2bfda5566 | [
"MIT"
] | null | null | null | apps/generate.py | gatheluck/FourierBasisDB | 12ac8a8049304df59d4faa3ddb0bb7b2bfda5566 | [
"MIT"
] | null | null | null | import collections
import os
import random
import sys
import hydra
import numpy as np
import omegaconf
import torch
import torchvision
import tqdm
base = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../")
sys.path.append(base)
from fbdb.utils import val_prep
from submodules.FourierHeatmap.fhmap import f... | 33.642424 | 135 | 0.596829 |
2d80dab3797d9f09a98304da43b88a7fdab46e32 | 3,748 | py | Python | agents/UCB1Bandit.py | okkhoy/minecraft-rl | 24c3b6c108fbeca4101ee6f86714a9ccb0f3947b | [
"MIT"
] | null | null | null | agents/UCB1Bandit.py | okkhoy/minecraft-rl | 24c3b6c108fbeca4101ee6f86714a9ccb0f3947b | [
"MIT"
] | null | null | null | agents/UCB1Bandit.py | okkhoy/minecraft-rl | 24c3b6c108fbeca4101ee6f86714a9ccb0f3947b | [
"MIT"
] | null | null | null | """
Created on May 8, 2017
@author: Akshay Narayan
This code is shared under The MIT License
-----------------------------------------
The MIT License (MIT)
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated document... | 37.48 | 114 | 0.666756 |
2d80e884d1bc45dbc4b4a3ada0ba1a5709d99e62 | 189 | py | Python | Shapely_numpy/source/service.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2019-06-27T12:09:44.000Z | 2019-06-27T12:09:44.000Z | Shapely_numpy/source/service.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Shapely_numpy/source/service.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy
from shapely.geometry import Point
def handler(event, context):
patch = Point(0.0, 0.0).buffer(10.0)
print(patch)
print(patch.area)
return patch.area | 21 | 37 | 0.740741 |
2d81300f0e1497723a3d503efa3fe537d77dc76f | 4,034 | py | Python | tools/engine.py | valeoai/SemanticPalette | a1b02a384c09881d6f1ca1a0c0ebfd87278c3d7d | [
"Apache-2.0"
] | 17 | 2021-07-15T13:22:31.000Z | 2022-02-15T05:37:51.000Z | tools/engine.py | valeoai/SemanticPalette | a1b02a384c09881d6f1ca1a0c0ebfd87278c3d7d | [
"Apache-2.0"
] | null | null | null | tools/engine.py | valeoai/SemanticPalette | a1b02a384c09881d6f1ca1a0c0ebfd87278c3d7d | [
"Apache-2.0"
] | 3 | 2021-07-16T09:25:10.000Z | 2022-01-11T12:36:28.000Z | import os
import numpy as np
import torch
import torch.distributed as dist
from data import create_dataset, create_synthetic_dataset, create_semi_synthetic_dataset
try:
from apex.parallel import DistributedDataParallel, SyncBatchNorm
except ImportError:
raise ImportError("Please install apex from https://www.... | 37.700935 | 121 | 0.589985 |
2d813f2517978af0c6cf7841c03de8809b97c669 | 27 | py | Python | tests/__init__.py | fabaff/past-time | 5b0e8db377f2d51e8a1d1eb83298ac5e07d07f46 | [
"MIT"
] | 1 | 2021-04-02T17:21:29.000Z | 2021-04-02T17:21:29.000Z | tests/__init__.py | fabaff/past-time | 5b0e8db377f2d51e8a1d1eb83298ac5e07d07f46 | [
"MIT"
] | null | null | null | tests/__init__.py | fabaff/past-time | 5b0e8db377f2d51e8a1d1eb83298ac5e07d07f46 | [
"MIT"
] | null | null | null | """Tests for past-time."""
| 13.5 | 26 | 0.592593 |
2d8140d3b3959b477aff2af1abbf08af8c71b24e | 1,488 | py | Python | python-code/opencv-learning/misc/adatptive_threshold.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 13 | 2018-09-07T02:29:07.000Z | 2021-06-18T08:40:09.000Z | python-code/opencv-learning/misc/adatptive_threshold.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | null | null | null | python-code/opencv-learning/misc/adatptive_threshold.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 numpy as np
import cv2
from BoxFilter import boxFilter
import time
def adaptive_threshold(src, maxValue=255, blockSize=7, delta=3, debug=False):
assert(blockSize % 2 == 1 and blockSize > 1)
height, width = src.shape
if debug:
print(width, height)
dst = src.copy()
if ... | 28.075472 | 108 | 0.602823 |
2d814ad70f659bb9b9d4b5703198d955526c5e9b | 9,916 | py | Python | sporco/pgm/bpdn.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 217 | 2016-06-13T16:41:26.000Z | 2022-03-22T06:31:05.000Z | sporco/pgm/bpdn.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 21 | 2016-06-13T23:28:35.000Z | 2022-02-17T23:20:01.000Z | sporco/pgm/bpdn.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 47 | 2016-12-14T13:08:33.000Z | 2021-12-12T01:59:49.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2018-2020 by Brendt Wohlberg <brendt@ieee.org>
# Cristina Garcia-Cardona <cgarciac@lanl.gov>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE... | 26.8 | 75 | 0.555869 |
2d8155da6331a259054e39199e6e5c4f39cfdf2f | 6,055 | py | Python | build_models.py | christianhbye/Very-Accurate-Emulator | 348c4bcdbf83a26beee56be615c300e445d347dc | [
"MIT"
] | 4 | 2021-07-09T14:33:26.000Z | 2022-01-27T01:40:57.000Z | build_models.py | christianhbye/Very-Accurate-Emulator | 348c4bcdbf83a26beee56be615c300e445d347dc | [
"MIT"
] | 6 | 2022-03-12T22:41:10.000Z | 2022-03-24T20:04:01.000Z | build_models.py | christianhbye/Very-Accurate-Emulator | 348c4bcdbf83a26beee56be615c300e445d347dc | [
"MIT"
] | null | null | null | import numpy as np
from tensorflow.keras import backend as K
from tensorflow.keras.losses import mse
from tensorflow.keras.layers import Input, Dense, Lambda
from tensorflow.keras.models import Model
from tensorflow.keras import optimizers
import tensorflow as tf
def sampling(args):
"""
Function that samples ... | 43.561151 | 114 | 0.698101 |
2d8164d88da0df00734aea124dcea7ca86aa0cc6 | 13,070 | py | Python | test.py | VDIGPKU/STR-it | c426bd56f5ce93e2afb928de53bde7237f345b01 | [
"Apache-2.0"
] | 13 | 2022-03-15T03:40:07.000Z | 2022-03-31T11:02:01.000Z | test.py | VDIGPKU/STR_TPSearch | c426bd56f5ce93e2afb928de53bde7237f345b01 | [
"Apache-2.0"
] | null | null | null | test.py | VDIGPKU/STR_TPSearch | c426bd56f5ce93e2afb928de53bde7237f345b01 | [
"Apache-2.0"
] | null | null | null | import os
import time
import string
import argparse
import re
import torch
import torch.backends.cudnn as cudnn
import torch.utils.data
import torch.nn.functional as F
import numpy as np
from nltk.metrics.distance import edit_distance
from utils import CTCLabelConverter, AttnLabelConverter, Averager
from dataset impo... | 47.527273 | 120 | 0.666106 |
2d81722dacec9ae933ded19b85f5b35777969315 | 13,275 | py | Python | mmdet3d/ops/iou3d/iou3d_utils.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | mmdet3d/ops/iou3d/iou3d_utils.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | mmdet3d/ops/iou3d/iou3d_utils.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
from . import iou3d_cuda
from mmdet3d.core.bbox import box_np_ops
try:
from mmdet3d.ops.nms.nms import (
non_max_suppression_cpu,
rotate_non_max_suppression_cpu,
IOU_weighted_rotate_non_max_suppression_cpu,
)
except:
current_dir = Path(__file__).reso... | 37.184874 | 133 | 0.571676 |
2d819c05b2289a3baff9c8280e239fd6cb3bf365 | 787 | py | Python | alipay/aop/api/response/AlipayInsAutoAutoaftermarketOutorderSyncResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayInsAutoAutoaftermarketOutorderSyncResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayInsAutoAutoaftermarketOutorderSyncResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayInsAutoAutoaftermarketOutorderSyncResponse(AlipayResponse):
def __init__(self):
super(AlipayInsAutoAutoaftermarketOutorderSyncResponse, self).__init__()
self._a... | 30.269231 | 121 | 0.740788 |
2d81d17869312d9254c13ca9611bbafb6125a5f1 | 13,442 | py | Python | blurr/text/data/question_answering.py | warner-benjamin/blurr | c946c3c1b6ee92c6305f102b3d13181132ad083b | [
"Apache-2.0"
] | null | null | null | blurr/text/data/question_answering.py | warner-benjamin/blurr | c946c3c1b6ee92c6305f102b3d13181132ad083b | [
"Apache-2.0"
] | 3 | 2022-02-10T03:53:07.000Z | 2022-02-10T04:18:53.000Z | blurr/text/data/question_answering.py | warner-benjamin/blurr | c946c3c1b6ee92c6305f102b3d13181132ad083b | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/14_text-data-question-answering.ipynb (unless otherwise specified).
__all__ = ['QAPreprocessor', 'QATextInput', 'QABatchTokenizeTransform']
# Cell
import ast
from functools import reduce
from datasets import Dataset
from fastcore.all import *
from fastai.data.block imp... | 49.601476 | 203 | 0.671626 |
2d81d87252ff7c03c560414844fc0e88bc335ac5 | 6,620 | py | Python | chessmanager/models/entities/tournament.py | jogubo/oc-chessmanager | 528a0dd6d6829da29422c489f31c4cc5a749dd46 | [
"MIT"
] | null | null | null | chessmanager/models/entities/tournament.py | jogubo/oc-chessmanager | 528a0dd6d6829da29422c489f31c4cc5a749dd46 | [
"MIT"
] | null | null | null | chessmanager/models/entities/tournament.py | jogubo/oc-chessmanager | 528a0dd6d6829da29422c489f31c4cc5a749dd46 | [
"MIT"
] | null | null | null | class Tournament:
def __init__(
self,
name,
description,
location,
players_data,
date,
turns=[],
rounds=4,
time=None,
id=None,
players=None
):
self._name = name
self._location = location
self._players... | 27.355372 | 74 | 0.507402 |
2d821b7b90811771e3cf50daaf964f00f5eab203 | 8,145 | py | Python | src/sentry/db/models/fields/node.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/db/models/fields/node.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/db/models/fields/node.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, print_function
from base64 import b64encode
import collections
import logging
import six
import warnings
from uuid import uuid4
from django.db import models
from django.db.models.signals import post_delete
from sentry import nodestore
from sentry.utils.cache import memoize
fro... | 33.9375 | 87 | 0.613996 |
2d8231c6565370cd4fd3c414fd5023e396b236a8 | 1,951 | py | Python | tests/data.py | jojonas/pyedid | 2382910d968b2fa8de1fab495fbbdfebcdb39f19 | [
"MIT"
] | 5 | 2018-09-29T10:06:17.000Z | 2022-01-21T01:28:03.000Z | tests/data.py | jojonas/pyedid | 2382910d968b2fa8de1fab495fbbdfebcdb39f19 | [
"MIT"
] | 3 | 2018-09-29T10:13:44.000Z | 2020-06-30T18:34:48.000Z | tests/data.py | jojonas/pyedid | 2382910d968b2fa8de1fab495fbbdfebcdb39f19 | [
"MIT"
] | 6 | 2019-03-16T03:45:23.000Z | 2019-12-12T13:04:37.000Z | """
Test data
"""
# from xrandr --verbose
BASE_HEX_EDID = (
"00ffffffffffff000469982401010101"
"1e1b01031e351e78ea9265a655559f28"
"0d5054bfef00714f818081409500a940"
"b300d1c00101023a801871382d40582c"
"4500132b2100001e000000fd00324c1e"
"5311000a202020202020000000fc0056"
"533234380a20202020202... | 31.467742 | 68 | 0.721681 |
2d8232ec4f5e9c5036b28a0cb635f281f8873182 | 234 | py | Python | openstack-dashboard/openstack_dashboard/dashboards/project/laas/panel.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/laas/panel.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/laas/panel.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Laas(horizon.Panel):
name = _("LBaaS")
slug = 'laas'
dashboard.Project.register(Laas)
| 23.4 | 60 | 0.782051 |
2d823a460094f58c2eed6be6a8c3078a7d36ab33 | 36,719 | py | Python | venv/lib/python3.7/site-packages/sqlalchemy/orm/strategy_options.py | Ryan0v0/SoftwareEngineering_Project | 14486717095b33805fb1ea0f25a03152de25b7f4 | [
"MIT"
] | 13 | 2020-03-27T04:37:45.000Z | 2022-03-27T12:50:30.000Z | venv/lib/python3.7/site-packages/sqlalchemy/orm/strategy_options.py | linqiunan/SoftwareEngineering_Project | 14486717095b33805fb1ea0f25a03152de25b7f4 | [
"MIT"
] | 2 | 2020-04-06T17:44:37.000Z | 2021-12-09T03:32:17.000Z | venv/lib/python3.7/site-packages/sqlalchemy/orm/strategy_options.py | linqiunan/SoftwareEngineering_Project | 14486717095b33805fb1ea0f25a03152de25b7f4 | [
"MIT"
] | 3 | 2020-03-27T20:46:01.000Z | 2022-03-05T08:57:40.000Z | # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
"""
from .interfaces import MapperOption, PropComparator
from .. import util
from ..sql.base imp... | 33.169828 | 84 | 0.615322 |
2d823db9f473e15b7f3405c006b8074a397b9120 | 6,566 | py | Python | rackindexer/core.py | fd98279/pyexamples | 1171ebf292e8fdadf656840a66bf005b362e5333 | [
"Apache-2.0"
] | null | null | null | rackindexer/core.py | fd98279/pyexamples | 1171ebf292e8fdadf656840a66bf005b362e5333 | [
"Apache-2.0"
] | null | null | null | rackindexer/core.py | fd98279/pyexamples | 1171ebf292e8fdadf656840a66bf005b362e5333 | [
"Apache-2.0"
] | null | null | null | import itertools,os,re
class word_tracker(object):
"""
Description: Tracks word count for words starting with the same letter
For letters with hot spots (some letters have more words than other
letters: for e.g a vs z we can further enhance this word tracker
logic for letters with hot spots.
Right now all... | 30.682243 | 75 | 0.677734 |
2d82488a3c8047e02fb1b7f9843e1a13a80750a0 | 7,639 | py | Python | posthog/tasks/status_report.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | posthog/tasks/status_report.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | posthog/tasks/status_report.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-09-08T19:45:03.000Z | 2021-09-08T19:45:03.000Z | import json
import logging
import os
from collections import Counter
from typing import Any, Dict, List, Tuple
import posthoganalytics
from django.db import connection
from psycopg2 import sql
from posthog.models import Event, Organization, Person, Team, User
from posthog.models.dashboard import Dashboard
from postho... | 41.516304 | 126 | 0.687786 |
2d8281efd06648c9e3c6187e28fd3ea099616dc2 | 114,731 | py | Python | tests/sparse/test_basic.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | tests/sparse/test_basic.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | tests/sparse/test_basic.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | import time
from itertools import product
import numpy as np
import pytest
from packaging import version
import aesara
import aesara.tensor as at
from aesara import sparse
from aesara.compile.function import function
from aesara.compile.io import In, Out
from aesara.configdefaults import config
from aesara.gradient i... | 34.330042 | 88 | 0.526728 |
2d828755dd6653bf7ba30747652928c7de310e7a | 122 | py | Python | website/projects/admin.py | sai-kamal/personal_website | b3edb2848abcbd3fba92ace00170b09c62fc69e2 | [
"MIT"
] | null | null | null | website/projects/admin.py | sai-kamal/personal_website | b3edb2848abcbd3fba92ace00170b09c62fc69e2 | [
"MIT"
] | null | null | null | website/projects/admin.py | sai-kamal/personal_website | b3edb2848abcbd3fba92ace00170b09c62fc69e2 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Projects
# Register your models here.
admin.site.register(Projects) | 20.333333 | 32 | 0.811475 |
2d828f48c84d1a1e9f6548ff08f0ad46813e2645 | 3,133 | py | Python | pytorch/demo_kaf_convolutional.py | ispamm/kernel-activation-functions | e525f7e82b54508ac262f82c9557ad66be2732f3 | [
"MIT"
] | 63 | 2017-12-05T12:14:47.000Z | 2021-11-14T05:23:52.000Z | pytorch/demo_kaf_convolutional.py | ispamm/kernel-activation-functions | e525f7e82b54508ac262f82c9557ad66be2732f3 | [
"MIT"
] | 1 | 2017-12-17T03:34:06.000Z | 2017-12-17T19:35:27.000Z | pytorch/demo_kaf_convolutional.py | ispamm/kernel-activation-functions | e525f7e82b54508ac262f82c9557ad66be2732f3 | [
"MIT"
] | 13 | 2017-12-18T14:55:53.000Z | 2021-11-14T05:23:53.000Z | # -*- coding: utf-8 -*-
"""
Simple demo using kernel activation functions with convolutional layers on the MNIST dataset.
"""
# Imports from Python libraries
import numpy as np
import tqdm
# PyTorch imports
import torch
import torch.utils.data
from torchvision import datasets, transforms
from torch.nn import Module
... | 29.280374 | 113 | 0.64826 |
2d829e8f48a7fac909c7e2a381f51283bdd7dc8d | 3,866 | py | Python | senpython/compiler.py | 4gboframram/Senpython | 44bf404b61715fd37045ab971b33db4df9916666 | [
"MIT"
] | null | null | null | senpython/compiler.py | 4gboframram/Senpython | 44bf404b61715fd37045ab971b33db4df9916666 | [
"MIT"
] | null | null | null | senpython/compiler.py | 4gboframram/Senpython | 44bf404b61715fd37045ab971b33db4df9916666 | [
"MIT"
] | null | null | null | import os
import re
import lark
from lark.reconstruct import Reconstructor
NL = '\n'
INDENT = '\x01'
DEDENT = '\x02'
IMPORT = '\x03'
class SenpaiCompiler:
senpai_parser = lark.Lark.open(os.path.join(os.path.dirname(__file__), "grammars", "senpai_grammar.lark"),
rel_to=__file__... | 31.688525 | 111 | 0.54449 |
2d82abd2999c8a0b6d6e3768b0a155c4dea6890c | 2,505 | py | Python | floodsystem/station.py | SweetTomato111/flood-warning-system | b33bbc90899b18786227933ebf5f1aa2b91074f6 | [
"MIT"
] | null | null | null | floodsystem/station.py | SweetTomato111/flood-warning-system | b33bbc90899b18786227933ebf5f1aa2b91074f6 | [
"MIT"
] | null | null | null | floodsystem/station.py | SweetTomato111/flood-warning-system | b33bbc90899b18786227933ebf5f1aa2b91074f6 | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
"""This module provides a model for a monitoring station, and tools
for manipulating/modifying station data
"""
class MonitoringStation:
"""This class represents a river level monitoring station"""
def __init__(self, station_id, measure_id... | 32.115385 | 102 | 0.617166 |
2d831a715bf0ebe3548ee5128c67e6ed35e702ef | 7,369 | py | Python | docarray/array/storage/base/getsetdel.py | bobvanluijt/docarray | 300c9cf2d6a20abd97d3d11734ed520058f62eb2 | [
"Apache-2.0"
] | null | null | null | docarray/array/storage/base/getsetdel.py | bobvanluijt/docarray | 300c9cf2d6a20abd97d3d11734ed520058f62eb2 | [
"Apache-2.0"
] | null | null | null | docarray/array/storage/base/getsetdel.py | bobvanluijt/docarray | 300c9cf2d6a20abd97d3d11734ed520058f62eb2 | [
"Apache-2.0"
] | null | null | null | from abc import abstractmethod, ABC
from typing import (
Sequence,
Any,
Iterable,
)
from .... import Document
class BaseGetSetDelMixin(ABC):
"""Provide abstract methods and derived methods for ``__getitem__``, ``__setitem__`` and ``__delitem__``
.. note::
The following methods must be im... | 35.771845 | 108 | 0.612838 |
2d834688a14db2f061b7f37ee329b8abb6c77ccd | 92 | py | Python | fifth_project/fifth_app/apps.py | wakim/django-course | 833534a33e79c6ef4667af5a52823cb5bb3904e9 | [
"MIT"
] | 1 | 2018-07-08T18:10:39.000Z | 2018-07-08T18:10:39.000Z | fifth_project/fifth_app/apps.py | wakim/python-django-bootcamp | 833534a33e79c6ef4667af5a52823cb5bb3904e9 | [
"MIT"
] | null | null | null | fifth_project/fifth_app/apps.py | wakim/python-django-bootcamp | 833534a33e79c6ef4667af5a52823cb5bb3904e9 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class FifthAppConfig(AppConfig):
name = 'fifth_app'
| 15.333333 | 33 | 0.76087 |
2d836973b4824ccd02ae6d5d74e779c2f85e44c1 | 426 | py | Python | src/annt/experimental/__init__.py | tehtechguy/annt | 024baacaf09843e362f80ed42cd65e97e8ac7a6b | [
"MIT"
] | 4 | 2016-01-25T05:53:10.000Z | 2016-01-25T19:04:31.000Z | src/annt/experimental/__init__.py | tehtechguy/annt | 024baacaf09843e362f80ed42cd65e97e8ac7a6b | [
"MIT"
] | null | null | null | src/annt/experimental/__init__.py | tehtechguy/annt | 024baacaf09843e362f80ed42cd65e97e8ac7a6b | [
"MIT"
] | null | null | null | # __init__.py
#
# Author : James Mnatzaganian
# Contact : http://techtorials.me
# Date Created : 04/07/15
#
# Description : Defines the experimental package
# Python Version : 2.7.8
#
# License : MIT License http://opensource.org/licenses/mit-license.php
# Copyright : (c) 2015... | 25.058824 | 78 | 0.643192 |
2d8376aff237054225fbe27c4fbfa4506f8656a1 | 15,223 | py | Python | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/uploads_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/uploads_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/uploads_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: ... | 36.859564 | 114 | 0.631873 |
2d8385e0a182bc537da60d26602b9612a380f321 | 9,553 | py | Python | datasets/stanford.py | chaneyddtt/Coarse-to-fine-3D-Animal | b3f9b1031b5761838c94ca091095636101747fd9 | [
"MIT"
] | 11 | 2021-11-17T03:11:21.000Z | 2022-03-23T06:38:19.000Z | datasets/stanford.py | chaneyddtt/Coarse-to-fine-3D-Animal | b3f9b1031b5761838c94ca091095636101747fd9 | [
"MIT"
] | 3 | 2021-12-07T07:42:33.000Z | 2022-01-07T11:41:17.000Z | datasets/stanford.py | chaneyddtt/Coarse-to-fine-3D-Animal | b3f9b1031b5761838c94ca091095636101747fd9 | [
"MIT"
] | 9 | 2021-11-26T08:57:19.000Z | 2022-03-22T10:29:19.000Z |
from __future__ import division
import torch
from torch.utils.data import Dataset
from torchvision.transforms import Normalize
import numpy as np
import cv2
from os.path import join
import os
import json
from util import config
from datasets.imutils import crop, flip_img, flip_pose, flip_kp, transform, rot_aa
from p... | 38.365462 | 121 | 0.579608 |
2d83c4ebb542104bfb1bd0d7f5e900c8250fa34f | 3,091 | py | Python | test/test_clean.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | test/test_clean.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | test/test_clean.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | """TDD support for a function cleaning cluttered HTML code.
"""
import re
import unittest
CLUTTERED = ''' <P CLASS="western"><A NAME="ScID:17"></A><A NAME="ScID:120"></A><!-- Climb up rope to safety. Back in ship for hyperspace. --><FONT COLOR="#000000"><SPAN STYLE="text-decoration: none"><FONT FACE="m... | 39.126582 | 492 | 0.579101 |
2d83fdbff910db08aa9f9d63e620e657911c2814 | 5,596 | py | Python | rideshare/rideshare_api/tests/test_views.py | RideQuest/ridequest | a2f51d99109f9767c5d2abe7f6fb3f160e5212da | [
"MIT"
] | null | null | null | rideshare/rideshare_api/tests/test_views.py | RideQuest/ridequest | a2f51d99109f9767c5d2abe7f6fb3f160e5212da | [
"MIT"
] | 12 | 2016-04-30T02:36:13.000Z | 2016-04-30T02:39:45.000Z | rideshare/rideshare_api/tests/test_views.py | RideQuest/ridequest | a2f51d99109f9767c5d2abe7f6fb3f160e5212da | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from rideshare_profile.models import Profile, Route
from rest_framework.test import APIClient
from rest_framework.test import APITestCase
from rest_framework.test import force_authenticate
from django.contrib.gis.geos import GEOSGeometry
class TestEndpoints(APITestCase):
... | 46.633333 | 117 | 0.577734 |
2d8445c37b76a932ac917355dcb6a5c1fe237165 | 889 | py | Python | microutil/tests/test_reindex.py | Hekstra-Lab/microutil | ab3b7b51754bf90ef35d6eea1c7b35cece638f0e | [
"BSD-3-Clause"
] | 2 | 2021-07-06T05:31:51.000Z | 2021-10-05T13:29:59.000Z | microutil/tests/test_reindex.py | Hekstra-Lab/microutil | ab3b7b51754bf90ef35d6eea1c7b35cece638f0e | [
"BSD-3-Clause"
] | 16 | 2021-02-08T22:36:42.000Z | 2021-11-01T22:36:02.000Z | microutil/tests/test_reindex.py | Hekstra-Lab/microutil | ab3b7b51754bf90ef35d6eea1c7b35cece638f0e | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import xarray as xr
from microutil.track_utils import reindex
from .utils import load_zarr
input = np.array(
[
[[[0.0, 1.0], [1.0, 3.0]], [[0.0, 1.0], [2.0, 9.0]]],
[[[0.0, 1.0], [1.0, 4.0]], [[1.0, 0.0], [2.0, 8.0]]],
]
)
expected = np.array(
[
[[[0.0, 1.0], ... | 24.027027 | 77 | 0.573678 |
2d8475c4085ad8c11423742adcbf150035d5751e | 1,485 | py | Python | ariadne/models.py | hz-b/ariadne | e6fad3783566ddf07e4e61f670e03a86d3f1dd0f | [
"BSD-3-Clause"
] | 3 | 2021-05-27T06:23:48.000Z | 2021-08-10T18:30:44.000Z | ariadne/models.py | hz-b/ariadne | e6fad3783566ddf07e4e61f670e03a86d3f1dd0f | [
"BSD-3-Clause"
] | 7 | 2021-05-06T03:15:12.000Z | 2021-07-19T16:09:07.000Z | ariadne/models.py | hz-b/ariadne | e6fad3783566ddf07e4e61f670e03a86d3f1dd0f | [
"BSD-3-Clause"
] | 3 | 2021-05-05T19:04:48.000Z | 2021-06-30T17:06:33.000Z | """
Extending and supplementing the models from bluesky-widgets
"""
from bluesky_widgets.models.search import Search
from bluesky_widgets.utils.event import Event
class SearchWithButton(Search):
"""
A Search model with a method to handle a click event.
"""
def __init__(self, *args, **kwargs):
... | 32.282609 | 93 | 0.699663 |
2d84aae3ac4e426e2aaf2b17194cc94685f8778a | 2,212 | py | Python | tests/dataverk/resources/test_remote_resource.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 3 | 2019-09-29T20:48:46.000Z | 2021-03-31T10:16:07.000Z | tests/dataverk/resources/test_remote_resource.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 148 | 2019-02-08T12:30:58.000Z | 2021-03-11T15:31:55.000Z | tests/dataverk/resources/test_remote_resource.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 1 | 2020-11-18T14:10:05.000Z | 2020-11-18T14:10:05.000Z | import unittest
from dataverk.resources.remote_resource import RemoteResource
resource_name_in = "resource"
resource_fmt = "csv"
resource_fmt_zipped = "csv.gz"
resource_url = f"https://remote.storage.location.com/bucket/" \
f"datapackage/resources/{resource_name_in}.{resource_fmt}"
resource_url_zip... | 36.262295 | 114 | 0.710669 |
2d84c543545b7778726474a1cd0e15bec347ce4f | 2,962 | py | Python | hs_core/tests/api/rest/test_move_or_rename_file_or_folder.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_core/tests/api/rest/test_move_or_rename_file_or_folder.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_core/tests/api/rest/test_move_or_rename_file_or_folder.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | import os
import tempfile
from rest_framework import status
from hs_core.hydroshare import resource
from .base import HSRESTTestCase
class TestPublicRenameEndpoint(HSRESTTestCase):
def setUp(self):
super(TestPublicRenameEndpoint, self).setUp()
self.tmp_dir = tempfile.mkdtemp()
# Make ... | 37.025 | 77 | 0.610398 |
2d84d055350ca9a6036f2dadb141f4b517f9096d | 1,459 | py | Python | rhucrl_experiments/hucrl_robustness/launch_all_train.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2021-11-19T11:46:48.000Z | 2021-11-19T11:46:48.000Z | rhucrl_experiments/hucrl_robustness/launch_all_train.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2021-11-22T07:48:03.000Z | 2021-11-22T07:48:03.000Z | rhucrl_experiments/hucrl_robustness/launch_all_train.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2022-03-26T10:18:01.000Z | 2022-03-26T10:18:01.000Z | """Python Script Template."""
import os
from lsf_runner import init_runner, make_commands
from rhucrl_experiments.hucrl_robustness.get_experiments import get_environment
runner = init_runner("TrainKnownModel", wall_time=24 * 60, num_threads=2)
cwd = os.path.dirname(os.path.realpath(__file__))
script = "train_nomina... | 24.316667 | 79 | 0.631254 |
2d84db9f4085a2b063eabd4285db229eaeabfb31 | 824 | py | Python | bridger/markdown/models.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T00:53:23.000Z | 2020-07-16T07:00:33.000Z | bridger/markdown/models.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 76 | 2019-12-05T01:15:57.000Z | 2021-09-07T16:47:27.000Z | bridger/markdown/models.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 1 | 2020-02-05T15:09:47.000Z | 2020-02-05T15:09:47.000Z | import pathlib
import uuid
from django.db import models
from django.dispatch import receiver
class Asset(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
file = models.FileField(upload_to="markdown/assets")
content_type = models.CharField(max_length=10, null=Tr... | 30.518519 | 79 | 0.729369 |
2d84f2336aa5d99e92cb5f3f9407aab62855ea8a | 8,120 | py | Python | Swarm/main.py | Wykleph/Swarm | c0b10c673a555213fdf46dd0648a2c729dd33494 | [
"MIT"
] | 7 | 2018-10-04T01:15:03.000Z | 2018-11-03T01:51:28.000Z | Swarm/main.py | Wykleph/Swarm | c0b10c673a555213fdf46dd0648a2c729dd33494 | [
"MIT"
] | 2 | 2018-10-04T05:47:58.000Z | 2018-10-04T15:48:49.000Z | Swarm/main.py | Wykleph/Swarm | c0b10c673a555213fdf46dd0648a2c729dd33494 | [
"MIT"
] | 1 | 2018-10-04T03:57:46.000Z | 2018-10-04T03:57:46.000Z | import random
from datetime import datetime
from hashlib import md5
import pygame
from bots import AttackBot, DefenseBot, RangedBot, RepairBot
from bots import BuilderBot, KamikazeBot, Swarm, MotherShipBot, Supplies
from game import Display, Settings, Arena, Colors, ShipRoles, Game
from sim import Queue, QueueControl... | 34.40678 | 141 | 0.589778 |
2d84fd27ef3fc470b7ca6dd6b307801bee64f0ee | 7,406 | py | Python | clients/kratos/python/ory_kratos_client/model/plugin_config_args.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/plugin_config_args.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/plugin_config_args.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | """
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... | 40.469945 | 446 | 0.589522 |
2d85080ae3e312de9e1b74ea068afe85f65e4c1e | 831 | py | Python | loam/parts/generic/switch.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 14 | 2017-10-08T09:16:10.000Z | 2021-11-27T19:12:24.000Z | loam/parts/generic/switch.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 7 | 2018-04-12T21:33:49.000Z | 2018-08-21T22:14:20.000Z | loam/parts/generic/switch.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 3 | 2018-07-24T04:55:02.000Z | 2019-12-30T08:12:39.000Z | from magma import Bits, Bit, Out
from loam import Part
class Switch(Part):
name = 'switch'
IO = ["O", Out(Bit)]
def __init__(self, name='switch', board=None):
super(Switch, self).__init__(name, board)
def on(self):
gpio = self.O.getgpio()
gpio.input().on()
Part.on(sel... | 21.868421 | 56 | 0.515042 |
2d850bf2383aa2e82a0ce628c8f6bc9c8e031baf | 5,248 | py | Python | tests/python/relax/test_expr.py | ZihengJiang/relax | 5676ffa4c423adf2b3f1920c5fdaca43369e9855 | [
"Apache-2.0"
] | 1 | 2022-01-14T05:54:59.000Z | 2022-01-14T05:54:59.000Z | tests/python/relax/test_expr.py | ZihengJiang/relax | 5676ffa4c423adf2b3f1920c5fdaca43369e9855 | [
"Apache-2.0"
] | null | null | null | tests/python/relax/test_expr.py | ZihengJiang/relax | 5676ffa4c423adf2b3f1920c5fdaca43369e9855 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 29.649718 | 65 | 0.633384 |
2d85553af55ba42063445a2da2d1586e459e68c9 | 4,681 | py | Python | Chapter07/2linear_regression.py | karim7262/Python-Machine-Learning-By-Example | 1bd2690225c93f637eabc5c78574714a22b4068a | [
"MIT"
] | 106 | 2017-06-20T07:06:26.000Z | 2022-01-28T20:17:57.000Z | Chapter07/2linear_regression.py | karim7262/Python-Machine-Learning-By-Example | 1bd2690225c93f637eabc5c78574714a22b4068a | [
"MIT"
] | 2 | 2017-11-20T03:36:46.000Z | 2019-03-08T07:47:02.000Z | Chapter07/2linear_regression.py | karim7262/Python-Machine-Learning-By-Example | 1bd2690225c93f637eabc5c78574714a22b4068a | [
"MIT"
] | 83 | 2017-07-02T03:09:38.000Z | 2022-03-07T06:45:04.000Z | import numpy as np
# Gradient descent based linear regression from scratch
def compute_prediction(X, weights):
""" Compute the prediction y_hat based on current weights
Args:
X (numpy.ndarray)
weights (numpy.ndarray)
Returns:
numpy.ndarray, y_hat of X under weights
"""
pred... | 30.396104 | 123 | 0.695578 |
2d858725ebda8bbda8ecb46f98e1b48d7654d2d8 | 1,008 | py | Python | tests/test_int_segmenttree.py | greshilov/pysegmenttree | 2ca987f0a03da6777f779ec0d15052b512ef3b1c | [
"MIT"
] | 1 | 2022-01-10T06:09:30.000Z | 2022-01-10T06:09:30.000Z | tests/test_int_segmenttree.py | greshilov/pysegmenttree | 2ca987f0a03da6777f779ec0d15052b512ef3b1c | [
"MIT"
] | 5 | 2021-11-13T12:58:26.000Z | 2021-11-28T00:18:36.000Z | tests/test_int_segmenttree.py | greshilov/pysegmenttree | 2ca987f0a03da6777f779ec0d15052b512ef3b1c | [
"MIT"
] | null | null | null | import pytest
from pysegmenttree import QueryFunction
from pysegmenttree.c_extensions import IntSegmentTree
from pysegmenttree.test_utils import VerifySegmentTree
def test_build():
int_tree = IntSegmentTree([18, 17, 13, 19, 15, 11, 20, 12, 33, 25])
def test_update_wrong_type():
int_tree = IntSegmentTree([1... | 26.526316 | 71 | 0.655754 |
2d85b507103fceea0b3baa85f22cbf849a346754 | 62,146 | py | Python | RobotPy/Python/Lib/subprocess.py | zachlatta/robotpy | a2ab5519481170f236a6efce1ef128e4f812509d | [
"MIT",
"Unlicense"
] | 1 | 2021-09-24T22:49:11.000Z | 2021-09-24T22:49:11.000Z | RobotPy/Python/Lib/subprocess.py | zachlatta/robotpy | a2ab5519481170f236a6efce1ef128e4f812509d | [
"MIT",
"Unlicense"
] | null | null | null | RobotPy/Python/Lib/subprocess.py | zachlatta/robotpy | a2ab5519481170f236a6efce1ef128e4f812509d | [
"MIT",
"Unlicense"
] | null | null | null | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""subprocess - Subpr... | 37.732848 | 128 | 0.543832 |
2d85dfc96399c37579bf13867cd52f03e1ead4d7 | 221 | py | Python | duhportinf/__init__.py | sifive/duhportinf | f7c02b62b594a69a324f44000801754cb50abb42 | [
"Apache-2.0"
] | 3 | 2019-12-06T04:22:19.000Z | 2020-12-03T21:44:53.000Z | duhportinf/__init__.py | sifive/duhportinf | f7c02b62b594a69a324f44000801754cb50abb42 | [
"Apache-2.0"
] | 14 | 2019-05-07T16:16:21.000Z | 2020-11-24T19:26:04.000Z | duhportinf/__init__.py | sifive/duhportinf | f7c02b62b594a69a324f44000801754cb50abb42 | [
"Apache-2.0"
] | 4 | 2019-06-13T19:57:55.000Z | 2021-05-19T05:20:28.000Z | import duhportinf.main_portinf
import duhportinf.main_portbundler
from duhportinf.main_portinf import (
get_bus_defs,
get_bus_matches,
load_bus_defs,
)
from duhportinf.busdef import (
debug_bus_mapping,
)
| 20.090909 | 37 | 0.791855 |
2d85f8c86b8a7e0f005a0124a3aebadd052b00d6 | 2,672 | py | Python | concourse/model/traits/__init__.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 15 | 2018-04-18T13:25:30.000Z | 2022-03-04T09:25:41.000Z | concourse/model/traits/__init__.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 221 | 2018-04-12T06:29:43.000Z | 2022-03-27T03:01:40.000Z | concourse/model/traits/__init__.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 29 | 2018-04-11T14:42:23.000Z | 2021-11-09T16:26:32.000Z | # Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 32.987654 | 96 | 0.703593 |
2d860ecf1c9d34de4d8f59180f00561c55bf3c77 | 12,827 | py | Python | softlearning/utils/serialization.py | limash/softlearning | aaa9d8c5cc3ba4bf459eb5a1a7469b3ae3b4f94f | [
"MIT"
] | 920 | 2018-12-11T16:22:23.000Z | 2022-03-28T08:17:07.000Z | softlearning/utils/serialization.py | limash/softlearning | aaa9d8c5cc3ba4bf459eb5a1a7469b3ae3b4f94f | [
"MIT"
] | 133 | 2018-12-09T08:08:33.000Z | 2022-02-28T12:43:14.000Z | softlearning/utils/serialization.py | limash/softlearning | aaa9d8c5cc3ba4bf459eb5a1a7469b3ae3b4f94f | [
"MIT"
] | 241 | 2018-12-03T21:35:24.000Z | 2022-03-20T06:24:45.000Z | import inspect
import contextlib
_GLOBAL_CUSTOM_OBJECTS = {}
_GLOBAL_CUSTOM_NAMES = {}
OBJECT_UNDEFINED_CONFIG_KEY = 'object was saved without config'
class CustomObjectScope(object):
"""Provides a scope that changes to `_GLOBAL_CUSTOM_OBJECTS` cannot escape.
Code within a `with` statement will be able t... | 36.33711 | 87 | 0.66781 |
2d863189b3e942334035a784ea71864f4f4c2a92 | 453 | py | Python | tests/test_location.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | tests/test_location.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | tests/test_location.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | from touchpoint import Touchpoint
TEST_API_KEY="notneeded"
def test_location_info():
"""Tests an API call to get an location's info"""
t = Touchpoint(api_key=TEST_API_KEY)
location = t.Location(location_id='test-1001', wss_url='', default_order_notes=None, name=None, address=None, phone=None)
resp = ... | 32.357143 | 125 | 0.721854 |
2d864ec997e34ca613720864e66cce49c91a2ccd | 7,761 | py | Python | chaospy/distributions/approximation.py | lblonk/chaospy | 1759a4307c6134b74ce63ff44973195f1e185f94 | [
"MIT"
] | null | null | null | chaospy/distributions/approximation.py | lblonk/chaospy | 1759a4307c6134b74ce63ff44973195f1e185f94 | [
"MIT"
] | null | null | null | chaospy/distributions/approximation.py | lblonk/chaospy | 1759a4307c6134b74ce63ff44973195f1e185f94 | [
"MIT"
] | null | null | null | import logging
from functools import partial
import numpy
import chaospy
from . import evaluation
def approximate_inverse(
distribution,
qloc,
parameters=None,
cache=None,
iterations=300,
tol=1e-5,
seed=None,
):
"""
Calculate the approximation of the i... | 32.609244 | 84 | 0.583559 |
2d865b38947ae8d4df65c8e5fea2bc61652b144c | 21,031 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_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... | 42.920408 | 247 | 0.67662 |
2d866f47a688864e071d5ffcad8f4a71863d9f52 | 8,185 | py | Python | controlSBML/util.py | ModelEngineering/controlSBML | 64587a7b22961a52aaf2b4e4a04fd1a0e3bc7a6b | [
"MIT"
] | null | null | null | controlSBML/util.py | ModelEngineering/controlSBML | 64587a7b22961a52aaf2b4e4a04fd1a0e3bc7a6b | [
"MIT"
] | null | null | null | controlSBML/util.py | ModelEngineering/controlSBML | 64587a7b22961a52aaf2b4e4a04fd1a0e3bc7a6b | [
"MIT"
] | null | null | null | import controlSBML.constants as cn
import controlSBML as ctl
from controlSBML.option_management.option_manager import OptionManager
from controlSBML.option_management.options import Options
from docstring_expander.expander import Expander
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import se... | 27.652027 | 100 | 0.625535 |
2d869a9a2fe114e4d448353e9510fd1d6517a70d | 2,899 | py | Python | corbos_scm/exceptions.py | schaefi/corbos_scm | 74e47cbe0a9f0ab05cb67957aa842a856fcf0c20 | [
"MIT"
] | null | null | null | corbos_scm/exceptions.py | schaefi/corbos_scm | 74e47cbe0a9f0ab05cb67957aa842a856fcf0c20 | [
"MIT"
] | 1 | 2022-01-27T15:25:38.000Z | 2022-01-29T20:28:22.000Z | corbos_scm/exceptions.py | schaefi/corbos_scm | 74e47cbe0a9f0ab05cb67957aa842a856fcf0c20 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Marcus Schäfer
#
# 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 rights
# to use, copy, modify, merge, publish, dist... | 31.51087 | 80 | 0.681269 |
2d869acb2e98ca1d1f0c5061baca5dffc19203d7 | 19,495 | py | Python | salt/states/service.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | 2 | 2015-08-04T21:54:38.000Z | 2019-04-25T21:47:08.000Z | salt/states/service.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | null | null | null | salt/states/service.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Starting or restarting of services and daemons
==============================================
Services are defined as system daemons typically started with system init or
rc scripts. Services can be defined as running or dead.
.. note::
The current status of a service is determined by... | 35 | 86 | 0.58338 |
2d86acc31e2a03904f4be0a6135bbc3d42d016f8 | 4,797 | py | Python | baselines/trpo_rllab/run.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | 2 | 2020-08-01T18:19:05.000Z | 2021-06-30T06:37:23.000Z | baselines/trpo_rllab/run.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | null | null | null | baselines/trpo_rllab/run.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | 5 | 2018-11-24T16:29:39.000Z | 2021-12-10T03:07:07.000Z | #!/usr/bin/env python3
# noinspection PyUnresolvedReferences
'''
This script runs the RLLab implementation of TRPO on various environments.
The environments, in this case, are not wrapped for gym.
'''
# Common imports
import sys, re, os, time, logging
from collections import defaultdict
# RLLab
import rllab
fr... | 35.798507 | 126 | 0.680634 |
2d86af3d0af68d2da64b157d2e230514beced1f0 | 1,045 | py | Python | tests/compat.py | klauer/fuzzysearch | 55fc21e469495bc84fe6f81b0c148e105765182d | [
"MIT"
] | 207 | 2015-09-15T00:24:18.000Z | 2022-03-31T07:42:15.000Z | tests/compat.py | ibr-hin95/fuzzysearch | 54552b8bba23cc4ebffc877e3a3d5f8b16c6222e | [
"MIT"
] | 37 | 2015-02-07T12:16:25.000Z | 2022-03-22T15:18:16.000Z | tests/compat.py | ibr-hin95/fuzzysearch | 54552b8bba23cc4ebffc877e3a3d5f8b16c6222e | [
"MIT"
] | 13 | 2015-01-21T14:35:31.000Z | 2022-01-24T12:14:40.000Z | """Compatibility support of testing tools for different Python versions"""
# The required modules are installed as necessary for different Python
# versions by `tox`. See `tox.ini` for details.
import sys
__all__ = [
'b',
'mock',
'u',
'unittest',
]
# The `unittest2` module is a backport of the new uni... | 25.487805 | 78 | 0.660287 |
2d86b819a1d1c91065c5b8a9637b07456a207c91 | 11,140 | py | Python | metric_learn/constraints.py | Spraitazz/metric-learn | 137880d9c6ce9a2b81a8af24c07d80e528f657cd | [
"MIT"
] | 547 | 2019-08-01T23:21:30.000Z | 2022-03-31T10:23:04.000Z | metric_learn/constraints.py | Spraitazz/metric-learn | 137880d9c6ce9a2b81a8af24c07d80e528f657cd | [
"MIT"
] | 104 | 2019-08-02T10:15:53.000Z | 2022-03-29T20:33:55.000Z | metric_learn/constraints.py | Spraitazz/metric-learn | 137880d9c6ce9a2b81a8af24c07d80e528f657cd | [
"MIT"
] | 69 | 2019-08-12T16:22:57.000Z | 2022-03-10T15:10:02.000Z | """
Helper module for generating different types of constraints
from supervised data labels.
"""
import numpy as np
import warnings
from sklearn.utils import check_random_state
from sklearn.neighbors import NearestNeighbors
__all__ = ['Constraints']
class Constraints(object):
"""
Class to build constraints from ... | 38.413793 | 79 | 0.645871 |
2d86c9f02c0420bdde5d3b5de1835fe126599455 | 1,222 | py | Python | src/gshhg/tests/test_distance.py | fbriol/gshhg | 6a962b0e7a47d1e5b5afa12d19e1a46938889d46 | [
"MIT"
] | 1 | 2021-04-30T18:15:57.000Z | 2021-04-30T18:15:57.000Z | src/gshhg/tests/test_distance.py | fbriol/gshhg | 6a962b0e7a47d1e5b5afa12d19e1a46938889d46 | [
"MIT"
] | null | null | null | src/gshhg/tests/test_distance.py | fbriol/gshhg | 6a962b0e7a47d1e5b5afa12d19e1a46938889d46 | [
"MIT"
] | null | null | null | import pickle
import pytest
from gshhg import Spheroid, Andoyer, Haversine, Thomas, Vincenty
def test_spheroid():
spheroid = Spheroid()
spheroid.a == pytest.approx(6378.137)
spheroid.b == pytest.approx(6356.75231424517949756396)
spheroid.f == pytest.approx(1 / 298.257223563)
spheroid = Spheroid(1... | 26 | 64 | 0.706219 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.