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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79f00a92faa1a87eabe9cc6e6ea592bf3af7795f | 1,354 | py | Python | utils/filters.py | VilhelmPrytz/peering-manager | ae0af02df737dbbe561fabc463e673facaa0619d | [
"Apache-2.0"
] | null | null | null | utils/filters.py | VilhelmPrytz/peering-manager | ae0af02df737dbbe561fabc463e673facaa0619d | [
"Apache-2.0"
] | null | null | null | utils/filters.py | VilhelmPrytz/peering-manager | ae0af02df737dbbe561fabc463e673facaa0619d | [
"Apache-2.0"
] | null | null | null | import django_filters
from django.contrib.auth.models import User
from django.db.models import Q
from .constants import *
from .models import ObjectChange, Tag
class ObjectChangeFilter(django_filters.FilterSet):
q = django_filters.CharFilter(method="search", label="Search")
time = django_filters.DateTimeFro... | 29.434783 | 83 | 0.676514 |
79f00efca1ca5c20ad83dd1a69bd22b42999595d | 1,388 | py | Python | userbot/plugins/mask.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/mask.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/mask.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from uniborg.util import lightning_cmd
@borg.on(lightning_cmd("mask ?(.*)"))
async def _(event):
if event.fwd_from:
return
if not event.reply_to_msg_id:
await event.edit("```Reply to any user message.```"... | 34.7 | 86 | 0.628242 |
79f019f82ffda7883415ecb9c0a5eded72a10a16 | 14,480 | py | Python | venv/lib/python3.7/site-packages/kitchen/text/misc.py | oktayuyar/RobotAppiumProject | 29f7a744f6a15e3aba1f5fe8cd8b93f96c96044e | [
"MIT"
] | 2 | 2017-08-10T16:14:15.000Z | 2021-11-28T10:47:46.000Z | kitchen/kitchen3/kitchen/text/misc.py | crylearner/RobotFrameworkAppiumIntegration | 895b96025dbc04c152b820faf62ba8525dd7af78 | [
"Apache-2.0"
] | 1 | 2021-06-02T00:48:18.000Z | 2021-06-02T00:48:18.000Z | kitchen/kitchen3/kitchen/text/misc.py | crylearner/RobotFrameworkAppiumIntegration | 895b96025dbc04c152b820faf62ba8525dd7af78 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Red Hat, Inc
# Copyright (c) 2010 Seth Vidal
#
# kitchen is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your opt... | 39.241192 | 98 | 0.659807 |
79f030a7a641f5c2fb11a42f33f37688a5a45d98 | 2,880 | py | Python | tests/integration/single_table/test_single_table.py | ZhuofanXie/SDMetrics | a89fa4177b9ff2aa1ee6dfaef0b908581109fe55 | [
"MIT"
] | 1 | 2021-03-12T06:13:11.000Z | 2021-03-12T06:13:11.000Z | tests/integration/single_table/test_single_table.py | ZhuofanXie/SDMetrics | a89fa4177b9ff2aa1ee6dfaef0b908581109fe55 | [
"MIT"
] | null | null | null | tests/integration/single_table/test_single_table.py | ZhuofanXie/SDMetrics | a89fa4177b9ff2aa1ee6dfaef0b908581109fe55 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import pytest
from sdmetrics import compute_metrics
from sdmetrics.demos import load_single_table_demo
from sdmetrics.single_table.base import SingleTableMetric
from sdmetrics.single_table.bayesian_network import BNLikelihood, BNLogLikelihood
from sdmetrics.single_table.detection... | 27.169811 | 98 | 0.643403 |
79f0657d44b4b99a8e210595cd7ac6b55c742db6 | 829 | py | Python | arjuna-samples/arjex/test/pkg/app_procedural/check_02_reusable_functions_gns.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna-samples/arjex/test/pkg/app_procedural/check_02_reusable_functions_gns.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna-samples/arjex/test/pkg/app_procedural/check_02_reusable_functions_gns.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | # This file is a part of Arjuna
# Copyright 2015-2020 Rahul Verma
# Website: www.RahulVerma.net
# 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... | 31.884615 | 74 | 0.764777 |
79f06a7a4d5afd733430267c67a32704387dc1a0 | 2,163 | py | Python | test/common.py | rjloura/python-manta | d140b3cbc8aa7b0e29e496e12e42e22b2aef15ec | [
"MIT"
] | null | null | null | test/common.py | rjloura/python-manta | d140b3cbc8aa7b0e29e496e12e42e22b2aef15ec | [
"MIT"
] | null | null | null | test/common.py | rjloura/python-manta | d140b3cbc8aa7b0e29e496e12e42e22b2aef15ec | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 Joyent, Inc. All rights reserved.
"""Shared code for test case files."""
__all__ = ["stor", "MantaTestCase"]
import sys
import os
from posixpath import join as ujoin
import unittest
import subprocess
from subprocess import PIPE
import manta
#---- exports
def stor(*sub... | 31.347826 | 78 | 0.612113 |
79f08380ac25f9c4dfbf9f10efb1be69a03b8f4a | 2,617 | py | Python | matomat/ui/form.py | omgwtflaserguns/matomatpy | 4f61d658cfe57ac13b9566311aeaeebf3ad53e21 | [
"MIT"
] | null | null | null | matomat/ui/form.py | omgwtflaserguns/matomatpy | 4f61d658cfe57ac13b9566311aeaeebf3ad53e21 | [
"MIT"
] | 8 | 2016-04-13T08:40:55.000Z | 2016-04-13T09:17:20.000Z | matomat/ui/form.py | omgwtflaserguns/matomatpy | 4f61d658cfe57ac13b9566311aeaeebf3ad53e21 | [
"MIT"
] | null | null | null | import abc
import curses
from matomat.models.point import Point
class FormBase(object):
__metaclass__ = abc.ABCMeta
HEADER_POSITION = Point(3, 3)
MENU_POSITION = Point(10, 5)
INPUT_POSITION = Point(10, 5)
menuitems = None
currentItem = 0
def __init__(self, figlet, colors):
self.... | 28.139785 | 107 | 0.567826 |
79f0ae2d14024c0092ad53fcac39d4b872f5e53d | 1,182 | py | Python | Ideas/cricket-umpire-assistance-master/visualization/projectile.py | hsspratt/Nott-Hawkeye1 | 178f4f0fef62e8699f6057d9d50adfd61a851047 | [
"MIT"
] | null | null | null | Ideas/cricket-umpire-assistance-master/visualization/projectile.py | hsspratt/Nott-Hawkeye1 | 178f4f0fef62e8699f6057d9d50adfd61a851047 | [
"MIT"
] | 1 | 2021-11-11T22:15:36.000Z | 2021-11-11T22:15:36.000Z | Ideas/cricket-umpire-assistance-master/visualization/projectile.py | hsspratt/Nott-Hawkeye1 | 178f4f0fef62e8699f6057d9d50adfd61a851047 | [
"MIT"
] | null | null | null | from visual import *
from math import sin,cos
initialHeight = 4.6
initialVelocity = 10
initialVelocity2 = 10
Angle = 65
Angle2 = 75
bounce_effect = -2
# Set up the display window
scene1 = display(title="Projectile motion zach miller", x=0, y=0, width=800, height=600, range=10, background=color.white, center=(10,init... | 24.625 | 151 | 0.703892 |
79f0b38fb16db7c18eb046e9a37c34e79b63717c | 3,672 | py | Python | tests/client_test.py | Vanclief/gemini-python | 8472e32b3db436d4a9ef5c1b9ea376109f23845c | [
"MIT"
] | null | null | null | tests/client_test.py | Vanclief/gemini-python | 8472e32b3db436d4a9ef5c1b9ea376109f23845c | [
"MIT"
] | null | null | null | tests/client_test.py | Vanclief/gemini-python | 8472e32b3db436d4a9ef5c1b9ea376109f23845c | [
"MIT"
] | null | null | null | from geminipy.gemini import Gemini
import httpretty
client = Gemini()
TICKER_URL = 'https://api.gemini.com/v1/pubticker/'
ORDERS_URL = 'https://api.gemini.com/v1/book/'
TRADES_URL = 'https://api.gemini.com/v1/trades/'
SYMBOLS_URL = 'https://api.gemini.com/v1/symbols'
def test_should_have_correct_url():
g = Gemi... | 26.80292 | 72 | 0.558824 |
79f12ebe50d98d38939a69c5516cbffb7f78b915 | 54 | py | Python | scripts/transfer_blend_shape/utils/api/__init__.py | robertjoosten/maya-retarget-blend-shape | 00d5dcfb1f603928c9b1477c4271ab38e1d573d0 | [
"MIT"
] | 6 | 2021-12-18T23:39:26.000Z | 2022-03-24T21:47:39.000Z | scripts/transfer_blend_shape/utils/api/__init__.py | robertjoosten/maya-retarget-blend-shape | 00d5dcfb1f603928c9b1477c4271ab38e1d573d0 | [
"MIT"
] | null | null | null | scripts/transfer_blend_shape/utils/api/__init__.py | robertjoosten/maya-retarget-blend-shape | 00d5dcfb1f603928c9b1477c4271ab38e1d573d0 | [
"MIT"
] | 5 | 2021-12-22T02:51:58.000Z | 2022-03-19T06:52:49.000Z | from transfer_blend_shape.utils.api import conversion
| 27 | 53 | 0.888889 |
79f13c38206d87e68045335d0643ffab04a9095f | 1,747 | py | Python | examples/ex_theory.py | ATLAS-Titan/allocation-modeling | b315aa7ac0cf613ed02c59188ff19e9738f36aca | [
"Apache-2.0"
] | null | null | null | examples/ex_theory.py | ATLAS-Titan/allocation-modeling | b315aa7ac0cf613ed02c59188ff19e9738f36aca | [
"Apache-2.0"
] | null | null | null | examples/ex_theory.py | ATLAS-Titan/allocation-modeling | b315aa7ac0cf613ed02c59188ff19e9738f36aca | [
"Apache-2.0"
] | null | null | null | #
# Copyright European Organization for Nuclear Research (CERN)
# National Research Centre "Kurchatov Institute"
# Rutgers University
#
# 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 ... | 24.957143 | 79 | 0.559817 |
79f16e25c0421d3e0abb8b280e3ee5a4693c2b57 | 117,516 | py | Python | aspire/core/reactor.py | Constructionware/aspireAPI | b558fa2f3971698f2784d8b03e1241f282a1df0b | [
"MIT"
] | 1 | 2022-01-20T04:15:27.000Z | 2022-01-20T04:15:27.000Z | aspire/core/reactor.py | Constructionware/aspire | b558fa2f3971698f2784d8b03e1241f282a1df0b | [
"MIT"
] | null | null | null | aspire/core/reactor.py | Constructionware/aspire | b558fa2f3971698f2784d8b03e1241f282a1df0b | [
"MIT"
] | null | null | null | import asyncio
import enum
import functools
import gzip
import hashlib
import html
import http
import http.cookies
import importlib.util
import inspect
import io
import json
import math
import os
import re
import stat
import sys
import tempfile
import traceback
import typing
from collections import namedtuple
from col... | 34.201397 | 128 | 0.581504 |
79f1826bca3a3b8697b56d2e96f55dd82f80fe35 | 10,542 | py | Python | nni/test/ut/sdk/test_pruners.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 1 | 2022-03-03T06:04:34.000Z | 2022-03-03T06:04:34.000Z | nni/test/ut/sdk/test_pruners.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | null | null | null | nni/test/ut/sdk/test_pruners.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 1 | 2021-06-10T06:40:40.000Z | 2021-06-10T06:40:40.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
import math
import sys
import unittest
from unittest import TestCase, main
from nni.algorithms.compression.pytorch.pruning import LevelPruner, Sl... | 35.14 | 206 | 0.58376 |
79f19e71b25a60f6add62038b4033ea0edd63a9f | 3,882 | py | Python | intersight/models/network_element_list.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/network_element_list.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/network_element_list.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class NetworkElementList(object):
"""
NOTE: This cl... | 25.207792 | 83 | 0.553065 |
79f1c913f772631a21f4eb8966fec68633e23d9a | 1,079 | py | Python | alipay/aop/api/response/AlipayCommerceTransportNotifycenterNotifyuserQueryResponse.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/AlipayCommerceTransportNotifycenterNotifyuserQueryResponse.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/AlipayCommerceTransportNotifycenterNotifyuserQueryResponse.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
from alipay.aop.api.domain.NotifyUserVo import NotifyUserVo
class AlipayCommerceTransportNotifycenterNotifyuserQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayCommer... | 32.69697 | 131 | 0.681186 |
79f1e469b17786fb5f50a348c52523cc72b56d7d | 3,992 | py | Python | alipay/aop/api/request/AlipayOpenMiniAmpeUsersceneQueryRequest.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/request/AlipayOpenMiniAmpeUsersceneQueryRequest.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/request/AlipayOpenMiniAmpeUsersceneQueryRequest.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.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayOpenMiniAmpeUsersceneQueryModel import AlipayOpenMiniAmpeUsersceneQueryModel
class AlipayOpenMiniAmpeUsersceneQueryRequest(obj... | 27.531034 | 148 | 0.646293 |
79f265a7d9bf272346d3b95282896c056f66e8cd | 14,694 | py | Python | alipay/aop/api/request/AlipayOpenAgentCommonSignRequest.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/request/AlipayOpenAgentCommonSignRequest.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/request/AlipayOpenAgentCommonSignRequest.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.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenAgentCommonSignRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
self._alipay_life_name = N... | 34.819905 | 182 | 0.64904 |
79f28effee3bde6ac3ce7eaa18f31eba611c66d4 | 5,864 | py | Python | testing_tool/fuzztool/examples/run_all_examples.py | george1459/ICSE2022_158 | f8bb797fc003f11485d3552f81cc7b8ba8a22b9b | [
"BSD-2-Clause"
] | 1 | 2022-03-07T03:38:09.000Z | 2022-03-07T03:38:09.000Z | testing_tool/fuzztool/examples/run_all_examples.py | george1459/ICSE2022_158 | f8bb797fc003f11485d3552f81cc7b8ba8a22b9b | [
"BSD-2-Clause"
] | null | null | null | testing_tool/fuzztool/examples/run_all_examples.py | george1459/ICSE2022_158 | f8bb797fc003f11485d3552f81cc7b8ba8a22b9b | [
"BSD-2-Clause"
] | 1 | 2022-01-12T05:30:40.000Z | 2022-01-12T05:30:40.000Z | #!/usr/bin/env python
"""
Run all the examples and collect the timings and results.
SUT: Invocation
Area: Examples run
Class: Functional
Type: System test
"""
import argparse
import os.path
import re
import subprocess
import sys
import time
here = os.path.dirname(__file__)
class Result(object):
"""
... | 30.863158 | 98 | 0.582196 |
79f29e15e7c3345544944a14841b9e185766fc46 | 3,949 | py | Python | alipay/aop/api/request/AlipayEbppIndustryJobSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayEbppIndustryJobSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayEbppIndustryJobSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayEbppIndustryJobSyncModel import AlipayEbppIndustryJobSyncModel
class AlipayEbppIndustryJobSyncRequest(object):
def __init... | 27.234483 | 148 | 0.642694 |
79f2d346abb049da1580d296fc7339a3036148b0 | 2,335 | py | Python | django_project/users/views.py | jsolly/blogthedata | 4f9ea581d0ddbcdefcf49b0911082b0b964fe594 | [
"MIT"
] | 1 | 2022-03-22T15:40:18.000Z | 2022-03-22T15:40:18.000Z | django_project/users/views.py | jsolly/blogthedata | 4f9ea581d0ddbcdefcf49b0911082b0b964fe594 | [
"MIT"
] | 16 | 2022-03-22T15:35:35.000Z | 2022-03-30T00:55:14.000Z | django_project/users/views.py | jsolly/blogthedata | 4f9ea581d0ddbcdefcf49b0911082b0b964fe594 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth import views as auth_views
def register_view(request):
if request.method == "P... | 32.887324 | 88 | 0.701071 |
79f2d841285524fa22e8cc435f9acdba016529c7 | 7,217 | py | Python | test_functools.py | EvreySamsungA50/jaraco.functools | 1d0e7648596af45e03eae717572325fb6529dfc7 | [
"MIT"
] | 11 | 2017-05-07T12:01:51.000Z | 2022-02-26T07:32:34.000Z | test_functools.py | EvreySamsungA50/jaraco.functools | 1d0e7648596af45e03eae717572325fb6529dfc7 | [
"MIT"
] | 19 | 2015-12-12T12:32:19.000Z | 2021-12-20T01:23:42.000Z | test_functools.py | EvreySamsungA50/jaraco.functools | 1d0e7648596af45e03eae717572325fb6529dfc7 | [
"MIT"
] | 11 | 2015-12-27T11:55:29.000Z | 2022-02-26T07:32:39.000Z | import os
import itertools
import time
import copy
import random
import functools
import platform
from unittest import mock
import pytest
from jaraco.classes import properties
from jaraco.functools import Throttler, method_cache, retry_call, retry
class TestThrottler:
@pytest.mark.xfail(
os.environ.get(... | 29.337398 | 87 | 0.599834 |
79f2dffc6b09bb0c6f6a4a405e71a65552bca2fb | 11,643 | py | Python | geoapps/simpegPF/EM/Utils/AnalyticUtils.py | RichardScottOZ/geoapps | 5b3c1d4fd11add45992e8b2497312ac014272b69 | [
"MIT"
] | 1 | 2022-02-18T16:24:53.000Z | 2022-02-18T16:24:53.000Z | geoapps/simpegPF/EM/Utils/AnalyticUtils.py | sebhmg/geoapps | 1463ba4ec3c914abdc7403e54eca0ee2bbc3f4f4 | [
"MIT"
] | null | null | null | geoapps/simpegPF/EM/Utils/AnalyticUtils.py | sebhmg/geoapps | 1463ba4ec3c914abdc7403e54eca0ee2bbc3f4f4 | [
"MIT"
] | null | null | null | import numpy as np
from .. import Mesh, Utils
from scipy.special import ellipk, ellipe
from scipy.constants import mu_0
import properties
orientationDict = {
"X": np.r_[1.0, 0.0, 0.0],
"Y": np.r_[0.0, 1.0, 0.0],
"Z": np.r_[0.0, 0.0, 1.0],
}
def MagneticDipoleVectorPotential(
srcLoc, obsLoc, component... | 34.548961 | 129 | 0.538865 |
79f2f5550d76cc233972d7a698a80af64cde79ca | 24,793 | py | Python | TrainingExtensions/tensorflow/test/python/test_quantsim_config_keras.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/tensorflow/test/python/test_quantsim_config_keras.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/tensorflow/test/python/test_quantsim_config_keras.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | # =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | 42.82038 | 112 | 0.590046 |
79f30c155c47583446a4f03f5dcf94c80b74542e | 13,373 | py | Python | tests/test_optimization.py | brendanhasz/dsutils | e780e904f7bf0ec5e14aa7ddb337f01f29779143 | [
"MIT"
] | 1 | 2019-09-14T16:59:34.000Z | 2019-09-14T16:59:34.000Z | tests/test_optimization.py | brendanhasz/dsutils | e780e904f7bf0ec5e14aa7ddb337f01f29779143 | [
"MIT"
] | null | null | null | tests/test_optimization.py | brendanhasz/dsutils | e780e904f7bf0ec5e14aa7ddb337f01f29779143 | [
"MIT"
] | 7 | 2020-01-19T14:40:08.000Z | 2022-01-14T12:50:30.000Z | """Tests optimization
"""
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.datasets import make_regression, make_classification
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
from sklearn.linear_model import LinearRegression, LogisticReg... | 29.651885 | 75 | 0.519106 |
79f315d704c13cfacc21652b48df913c22d8b391 | 575 | py | Python | LC/41.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/41.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/41.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | class Solution(object):
def firstMissingPositive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
nums.append(0)
L=len(nums)
t=0
i=0
for i in xrange(L):
if (0<nums[i]<L) and (nums[i]!=nums[nums[i]]):
t=nums[num... | 26.136364 | 58 | 0.398261 |
79f32bbb7500baa5f2ab88de69a2324ee0c51d10 | 8,329 | py | Python | drafts/models.py | zachtib/MagicWithFriends | 18db849fe282903051820b718a2d7b434360e332 | [
"MIT"
] | null | null | null | drafts/models.py | zachtib/MagicWithFriends | 18db849fe282903051820b718a2d7b434360e332 | [
"MIT"
] | 5 | 2021-02-15T20:52:10.000Z | 2021-07-03T18:19:59.000Z | drafts/models.py | zachtib/MagicWithFriends | 18db849fe282903051820b718a2d7b434360e332 | [
"MIT"
] | null | null | null | import random
import uuid
from typing import Optional, List
from django.contrib.auth.models import User
from django.db import models
from cards.models import Card, Printing
from cubes.models import Cube
class Draft(models.Model):
uuid = models.UUIDField(unique=True, default=uuid.uuid4)
name = models.CharFie... | 33.584677 | 105 | 0.622884 |
79f356207e064ef65468b713c681a667117bb6be | 1,225 | py | Python | Practica4/QuickSort/gb.py | JosueHernandezR/An-lisis-de-Algoritmos | 9953f2d3fee6b4cfe842fdbbea83b46b62fa123f | [
"MIT"
] | 1 | 2021-09-30T20:05:41.000Z | 2021-09-30T20:05:41.000Z | Practica4/QuickSort/gb.py | JosueHernandezR/An-lisis-de-Algoritmos | 9953f2d3fee6b4cfe842fdbbea83b46b62fa123f | [
"MIT"
] | null | null | null | Practica4/QuickSort/gb.py | JosueHernandezR/An-lisis-de-Algoritmos | 9953f2d3fee6b4cfe842fdbbea83b46b62fa123f | [
"MIT"
] | null | null | null | #Análisis de Algoritmos 3CV2
# Alan Romero Lucero
# Josué David Hernández Ramírez
# Práctica 4 Divide y vencerás
"""
MÓDULOS DE VARIABLES GLOBALES
_parameters: Lista que almacena los parámetros de los puntos a trazar
para Partition. Cada elemento es una tupla que almacena la longitud
... | 35 | 77 | 0.706122 |
79f35f7ef001b55540443382623ee5eb0d270ad9 | 1,133 | py | Python | zilencer/management/commands/sync_api_key.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | 1 | 2021-02-13T20:43:29.000Z | 2021-02-13T20:43:29.000Z | zilencer/management/commands/sync_api_key.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | 9 | 2021-02-08T20:22:39.000Z | 2022-02-11T03:40:19.000Z | zilencer/management/commands/sync_api_key.py | tobby2002/zulip | 66e7c455759f9368bae16b9a604cf63f8e3524cd | [
"Apache-2.0"
] | 1 | 2021-04-09T05:50:23.000Z | 2021-04-09T05:50:23.000Z | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from django.core.management.base import BaseCommand
from zerver.models import get_user_profile_by_email, UserProfile
import os
from six.moves.configparser import SafeConfigParser
class Command(BaseCommand):
help =... | 36.548387 | 81 | 0.66549 |
79f36d5bfe280266bdfb1e98bc78b92df1d4cad9 | 2,196 | py | Python | thor/orbits/tests/test_lambert.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | null | null | null | thor/orbits/tests/test_lambert.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | null | null | null | thor/orbits/tests/test_lambert.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | 1 | 2021-07-29T15:20:34.000Z | 2021-07-29T15:20:34.000Z | import numpy as np
from astropy.time import Time
from astropy import units as u
from ...constants import Constants as c
from ...testing import testOrbits
from ..orbits import Orbits
from ..propagate import propagateOrbits
from ..lambert import calcLambert
MU = c.MU
TARGETS = [
"Amor",
"Eros",
"Eugenia",
]... | 25.835294 | 75 | 0.526412 |
79f37cdbbd9daecbcce23a7e9e6e56dee4cc0462 | 1,271 | py | Python | python_modules/libraries/dagster-spark/setup.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-spark/setup.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-spark/setup.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from setuptools import find_packages, setup
def get_version() -> str:
version: Dict[str, str] = {}
with open("dagster_spark/version.py") as fp:
exec(fp.read(), version) # pylint: disable=W0122
return version["__version__"]
if __name__ == "__main__":
ver = get_versi... | 33.447368 | 103 | 0.608183 |
79f3ad09fe31436384f5d34cba0da46eb978bd07 | 4,483 | py | Python | qtim_tools/qtim_stats/image_stats.py | QTIM-Lab/qtim_tools | 92bd15ec7a81c5eda70d11a015f74538f3c41e22 | [
"Apache-2.0"
] | 12 | 2017-03-29T18:17:24.000Z | 2020-03-19T05:28:56.000Z | qtim_tools/qtim_stats/image_stats.py | QTIM-Lab/qtim_tools | 92bd15ec7a81c5eda70d11a015f74538f3c41e22 | [
"Apache-2.0"
] | 7 | 2017-03-08T21:06:01.000Z | 2017-06-21T19:01:58.000Z | qtim_tools/qtim_stats/image_stats.py | QTIM-Lab/qtim_tools | 92bd15ec7a81c5eda70d11a015f74538f3c41e22 | [
"Apache-2.0"
] | 5 | 2017-03-02T09:08:21.000Z | 2019-10-26T05:37:39.000Z | import numpy as np
import os
from qtim_tools.qtim_utilities.format_util import convert_input_2_numpy
from qtim_tools.qtim_utilities.nifti_util import save_numpy_2_nifti
from qtim_tools.test_data.load import load_test_file
from qtim_tools.qtim_utilities.file_util import nifti_splitext, grab_files_recursive
def correla... | 35.299213 | 170 | 0.679233 |
79f3b63a633f246b2dd7e94d5456e9c630eea740 | 12,687 | py | Python | acoustic/LASModel.py | sailist/ASRFrame | 2fd022c3c00af1d5178dee4b367b2269241bc73c | [
"Apache-2.0"
] | 223 | 2019-07-13T06:31:18.000Z | 2022-03-11T08:23:01.000Z | acoustic/LASModel.py | mayite/ASRFrame | 484cf1ee5beec4c39439de683c5b4c1f1ea3a94a | [
"Apache-2.0"
] | 7 | 2019-12-27T08:48:42.000Z | 2021-09-01T09:45:13.000Z | acoustic/LASModel.py | mayite/ASRFrame | 484cf1ee5beec4c39439de683c5b4c1f1ea3a94a | [
"Apache-2.0"
] | 71 | 2019-07-14T13:14:13.000Z | 2022-03-18T06:58:54.000Z | '''
本文件内所有模型涉及LSTM,训练非常慢,目前只在小数据集上拟合过,无法保证其在大数据集上的效果
'''
from keras.models import Model
import os
from util.reader import VoiceLoader,VoiceDatasetList
from util.mapmap import PinyinMapper
from feature.mel_feature import MelFeature5
from keras.layers import Conv1D,Dense, Dropout, Input, Reshape
from keras.layers import ... | 40.663462 | 128 | 0.526444 |
79f3d615bbd96d3455b4f8e6511bc530a805a429 | 5,763 | py | Python | napari/_vispy/vispy_shapes_layer.py | pranathivemuri/napari | 7a7f824b686a276dc6cdc8013d8f437e3c3b03e1 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_shapes_layer.py | pranathivemuri/napari | 7a7f824b686a276dc6cdc8013d8f437e3c3b03e1 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_shapes_layer.py | pranathivemuri/napari | 7a7f824b686a276dc6cdc8013d8f437e3c3b03e1 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from vispy.scene.visuals import Compound, Line, Markers, Mesh, Text
from ..utils.events import disconnect_events
from ..utils.settings import get_settings
from ._text_utils import update_text
from .vispy_base_layer import VispyBaseLayer
class VispyShapesLayer(VispyBaseLayer):
def __init__(self... | 34.716867 | 78 | 0.606455 |
79f3e09157eb5798bb26c6075780490dd6cd25fb | 1,354 | py | Python | bmi.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | bmi.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | bmi.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | import argparse
def calc_bmi(weight, length):
"""Provided/DONE:
Calc BMI give a weight in kg and length in cm, return the BMI
rounded on 2 decimals"""
bmi = int(weight) / ((int(length) / 100) ** 2)
return round(bmi, 2)
def create_parser():
"""TODO:
Create an ArgumentParser addin... | 31.488372 | 106 | 0.65288 |
79f3ebf6f50c0df60fdef6173ba88cf65be61bfd | 2,361 | py | Python | src/gans/gan_loss.py | sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection | ff313150035935c2c81167291ed82b7f13064f05 | [
"MIT"
] | 15 | 2021-04-04T10:46:05.000Z | 2022-02-23T07:45:47.000Z | src/gans/gan_loss.py | sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection | ff313150035935c2c81167291ed82b7f13064f05 | [
"MIT"
] | 1 | 2021-05-10T14:57:24.000Z | 2021-05-14T02:49:23.000Z | src/gans/gan_loss.py | sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection | ff313150035935c2c81167291ed82b7f13064f05 | [
"MIT"
] | 2 | 2021-06-14T14:52:13.000Z | 2021-07-10T10:09:25.000Z | # This script is borrowed from https://github.com/LynnHo/DCGAN-LSGAN-WGAN-GP-DRAGAN-Pytorch
# which is also used by Durall et al. (https://ieeexplore.ieee.org/document/9157579)
import torch
def get_gan_losses_fn():
bce = torch.nn.BCEWithLogitsLoss()
def d_loss_fn(r_logit, f_logit):
r_loss = bce(r_lo... | 27.453488 | 92 | 0.65989 |
79f414139a25afd10cd0fa1756d78df857cff938 | 10,064 | py | Python | tests/unit_tests/test_populations.py | sathiscode/trumania | bcf21c4f9e1ff0fe03fd9cbe2dc367f0df033fbc | [
"Apache-2.0"
] | 97 | 2018-01-15T19:29:31.000Z | 2022-03-11T00:27:34.000Z | tests/unit_tests/test_populations.py | sathiscode/trumania | bcf21c4f9e1ff0fe03fd9cbe2dc367f0df033fbc | [
"Apache-2.0"
] | 10 | 2018-01-15T22:44:55.000Z | 2022-02-18T09:44:10.000Z | tests/unit_tests/test_populations.py | sathiscode/trumania | bcf21c4f9e1ff0fe03fd9cbe2dc367f0df033fbc | [
"Apache-2.0"
] | 33 | 2018-01-15T19:34:23.000Z | 2022-03-05T22:39:33.000Z | import path
import pandas as pd
import os
import pytest
from trumania.core.random_generators import SequencialGenerator
from trumania.core.population import Population
dummy_population = Population(circus=None,
size=10,
ids_gen=SequencialGenerator(max_length... | 33.546667 | 104 | 0.611884 |
79f45376d97accd9bf768f97d858cf6d3e3e6265 | 2,073 | py | Python | pynurbs/geometry/methods/parameterize.py | trelau/pyNURBS | 5dfd082fe368c1140ce485dc64b049b32c267d1f | [
"BSD-3-Clause"
] | 2 | 2019-04-16T20:30:19.000Z | 2019-10-03T07:40:47.000Z | pynurbs/geometry/methods/parameterize.py | trelau/pyNURBS | 5dfd082fe368c1140ce485dc64b049b32c267d1f | [
"BSD-3-Clause"
] | null | null | null | pynurbs/geometry/methods/parameterize.py | trelau/pyNURBS | 5dfd082fe368c1140ce485dc64b049b32c267d1f | [
"BSD-3-Clause"
] | 1 | 2018-09-23T14:28:12.000Z | 2018-09-23T14:28:12.000Z | from __future__ import division
from numpy import zeros, float64, diff, sum, array
from numpy.linalg import norm
from pynurbs.geometry.point import Point
def uniform(pnts, a=0., b=1.):
"""
Generate a uniform parameters.
:param pnts: 1D set of ordered points.
:etype pnts: Points or array_like
:p... | 24.678571 | 58 | 0.577424 |
79f4585e45247eba537eaaac14d0058074c906cb | 3,270 | py | Python | test/webapi/test_websocket.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | null | null | null | test/webapi/test_websocket.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | null | null | null | test/webapi/test_websocket.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | 1 | 2019-02-14T13:49:37.000Z | 2019-02-14T13:49:37.000Z | import unittest
import os
from cate.core.wsmanag import FSWorkspaceManager
from cate.util.monitor import Monitor
from cate.webapi.websocket import WebSocketService
class WebSocketServiceTest(unittest.TestCase):
def setUp(self):
self.service = WebSocketService(FSWorkspaceManager())
@unittest.skipIf(o... | 44.794521 | 105 | 0.668196 |
79f46e47070d392539d494a833385903ca70856e | 26 | py | Python | dalec/__init__.py | webu/dalec | ddc4f3c4627c84c5a70e9052d28f77d6ff8755a7 | [
"BSD-3-Clause"
] | null | null | null | dalec/__init__.py | webu/dalec | ddc4f3c4627c84c5a70e9052d28f77d6ff8755a7 | [
"BSD-3-Clause"
] | null | null | null | dalec/__init__.py | webu/dalec | ddc4f3c4627c84c5a70e9052d28f77d6ff8755a7 | [
"BSD-3-Clause"
] | null | null | null | __version__ = "1.0.0-wip"
| 13 | 25 | 0.653846 |
79f4750fd9e87a75fb67d311bc9c99e769508aea | 4,359 | py | Python | scripts/run_optimal_pricing_m.py | fb1n15/maddpg | ce0fd8028c09dc4f13c5c4ab015c9ad980469443 | [
"MIT"
] | null | null | null | scripts/run_optimal_pricing_m.py | fb1n15/maddpg | ce0fd8028c09dc4f13c5c4ab015c9ad980469443 | [
"MIT"
] | null | null | null | scripts/run_optimal_pricing_m.py | fb1n15/maddpg | ce0fd8028c09dc4f13c5c4ab015c9ad980469443 | [
"MIT"
] | null | null | null | """
Just run optimal pricing in simple situations
"""
# import packages
from tqdm import tqdm
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import json
from importlib import reload
import os
import sys
from other_functions import get_social_welfare
... | 33.022727 | 87 | 0.744666 |
79f4a396584842780ba3c9d666df812c6870f3af | 108,674 | py | Python | src/sardana/macroserver/scan/gscan.py | flyingbot91/sardana | ace126c97bb5303e33e412f73eaaa9a58952b9af | [
"CC-BY-3.0"
] | null | null | null | src/sardana/macroserver/scan/gscan.py | flyingbot91/sardana | ace126c97bb5303e33e412f73eaaa9a58952b9af | [
"CC-BY-3.0"
] | null | null | null | src/sardana/macroserver/scan/gscan.py | flyingbot91/sardana | ace126c97bb5303e33e412f73eaaa9a58952b9af | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 39.232491 | 79 | 0.565848 |
79f4d9b0963bf802af11bf1df98aae97fc749971 | 1,392 | py | Python | py/0202.happy-number.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0202.happy-number.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0202.happy-number.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=202 lang=python3
#
# [202] Happy Number
#
# https://leetcode.com/problems/happy-number/description/
#
# algorithms
# Easy (51.72%)
# Likes: 4403
# Dislikes: 629
# Total Accepted: 731.1K
# Total Submissions: 1.4M
# Testcase Example: '19'
#
# Write an algorithm to determine if a number n is... | 18.56 | 74 | 0.582615 |
79f4ea1f0d54e9ef0cd5be1bbcecb5f1782e569f | 127 | py | Python | batchglm/train/tf/base/external.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/train/tf/base/external.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/train/tf/base/external.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | from batchglm.models.base import _Estimator_Base
import batchglm.utils.stats as stat_utils
from batchglm import pkg_constants
| 25.4 | 48 | 0.866142 |
79f4ee9270d931b3bab97aec25e3a5b00c4712ec | 2,239 | py | Python | src/toil/test/src/systemTest.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 348 | 2018-07-08T03:38:28.000Z | 2022-03-11T18:57:44.000Z | src/toil/test/src/systemTest.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 1,700 | 2018-07-05T18:28:49.000Z | 2022-03-31T14:09:04.000Z | src/toil/test/src/systemTest.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 126 | 2018-07-11T18:59:29.000Z | 2022-01-24T03:14:02.000Z | import errno
import multiprocessing
import os
import tempfile
from functools import partial
from toil.lib.threading import cpu_count
from toil.test import ToilTest, travis_test
class SystemTest(ToilTest):
"""
Test various assumptions about the operating system's behavior
"""
@travis_test
def tes... | 37.316667 | 100 | 0.639125 |
79f4f08231d18dcd2a3290d8bfefaaddfedee940 | 921 | py | Python | utils/utilities.py | theobori/bot-template | 3aba0ed127c435e25b29be163f870f5088a611d8 | [
"MIT"
] | null | null | null | utils/utilities.py | theobori/bot-template | 3aba0ed127c435e25b29be163f870f5088a611d8 | [
"MIT"
] | null | null | null | utils/utilities.py | theobori/bot-template | 3aba0ed127c435e25b29be163f870f5088a611d8 | [
"MIT"
] | null | null | null | """some util features"""
import discord
import pandas as pd
from typing import Tuple
async def basic_message(ctx: object, msg: str, footer: str = None) -> object:
"""
Sends a message and returns the object
"""
embed = discord.Embed(color=0x000000, description=msg)
if (footer):
embed... | 20.466667 | 77 | 0.578719 |
79f5018bd990f309ab17bc9e1094ec99d371cf05 | 39 | py | Python | geoapps/simpegPF/NSEM/__init__.py | RichardScottOZ/geoapps | 5b3c1d4fd11add45992e8b2497312ac014272b69 | [
"MIT"
] | null | null | null | geoapps/simpegPF/NSEM/__init__.py | RichardScottOZ/geoapps | 5b3c1d4fd11add45992e8b2497312ac014272b69 | [
"MIT"
] | null | null | null | geoapps/simpegPF/NSEM/__init__.py | RichardScottOZ/geoapps | 5b3c1d4fd11add45992e8b2497312ac014272b69 | [
"MIT"
] | null | null | null | from geoapps.simpegPF.EM.NSEM import *
| 19.5 | 38 | 0.794872 |
79f512dbcf6bd4d84b98cf69630778734566391c | 8,403 | py | Python | tensorflow/contrib/tensorrt/python/trt_convert.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/tensorrt/python/trt_convert.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/tensorrt/python/trt_convert.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 26 | 2017-04-12T16:25:44.000Z | 2018-10-30T10:10:15.000Z | # Copyright 2018 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... | 40.205742 | 83 | 0.697727 |
79f5379cc92e481b4be9ab56faebea8b14a19e40 | 3,536 | py | Python | photoshop/api/save_options/tif.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 17 | 2019-03-01T12:09:37.000Z | 2020-04-09T14:14:59.000Z | photoshop/api/save_options/tif.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 7 | 2019-04-28T15:20:27.000Z | 2020-04-07T19:14:47.000Z | photoshop/api/save_options/tif.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 3 | 2020-02-28T14:27:11.000Z | 2020-04-01T16:12:40.000Z | # Import local modules
from photoshop.api._core import Photoshop
class TiffSaveOptions(Photoshop):
"""Options for saving a document in TIFF format."""
object_name = "TiffSaveOptions"
def __int__(self):
super().__init__()
@property
def alphaChannels(self):
"""If true, the alpha c... | 27.2 | 78 | 0.651867 |
79f554b20672b8d8f6b01caffff20b7bca95cb55 | 405 | py | Python | tests/MockPost.py | wperkins/usgs | 2a9270a64f1d794af56ebb511d0d86c3ed3f8991 | [
"0BSD"
] | 67 | 2016-11-11T06:09:20.000Z | 2022-03-08T10:56:35.000Z | tests/MockPost.py | wperkins/usgs | 2a9270a64f1d794af56ebb511d0d86c3ed3f8991 | [
"0BSD"
] | 28 | 2017-03-06T02:33:02.000Z | 2022-03-08T22:46:15.000Z | tests/MockPost.py | wperkins/usgs | 2a9270a64f1d794af56ebb511d0d86c3ed3f8991 | [
"0BSD"
] | 32 | 2017-03-22T02:04:37.000Z | 2022-03-31T04:09:15.000Z |
import os
import json
testdir = os.path.dirname(os.path.abspath(__file__))
class MockPost(object):
def __init__(self, filename):
self.filename = filename
def __call__(self, url, payload):
return self
def json(self):
filepath = os.path.join(testdir, 'data', self.filename)
... | 16.2 | 63 | 0.617284 |
79f57cdc24ef498d364f0d14a625b62b1bb1861e | 470 | py | Python | apiv2-python-connlock/connlock/operations.py | databeast/apicore | 2ac982e399d98510fc2bafed0aeb55eb0d2cf9c1 | [
"BSD-3-Clause"
] | null | null | null | apiv2-python-connlock/connlock/operations.py | databeast/apicore | 2ac982e399d98510fc2bafed0aeb55eb0d2cf9c1 | [
"BSD-3-Clause"
] | null | null | null | apiv2-python-connlock/connlock/operations.py | databeast/apicore | 2ac982e399d98510fc2bafed0aeb55eb0d2cf9c1 | [
"BSD-3-Clause"
] | null | null | null | def increment_last_byte(byte_string):
s = bytearray(byte_string)
s[-1] = s[-1] + 1
return bytes(s)
def to_bytes(maybe_bytestring):
"""
Encode string to bytes.
Convenience function to do a simple encode('utf-8') if the input is not
already bytes. Returns the data unmodified if the input is... | 26.111111 | 75 | 0.67234 |
79f59fd13284d892aa8d55729d35d1fddf07c68e | 5,054 | py | Python | crowdsorter/views/votes.py | jacebrowning/crowdsorter | 1c847f1f0284fc810ec1f2dd501acb4dbfa16bbb | [
"MIT"
] | 2 | 2020-05-09T23:46:23.000Z | 2021-03-23T18:40:26.000Z | crowdsorter/views/votes.py | jacebrowning/crowdsorter | 1c847f1f0284fc810ec1f2dd501acb4dbfa16bbb | [
"MIT"
] | 1 | 2020-10-18T17:15:49.000Z | 2020-11-11T18:25:05.000Z | crowdsorter/views/votes.py | jacebrowning/crowdsorter | 1c847f1f0284fc810ec1f2dd501acb4dbfa16bbb | [
"MIT"
] | 1 | 2021-03-23T18:41:16.000Z | 2021-03-23T18:41:16.000Z | import logging
from flask import Blueprint, Markup
from flask import (request, render_template, send_file, redirect, url_for,
flash, abort)
from flask_menu import register_menu
from .. import api
from ._navbar import show_items, activate_items
from ._utils import (call, create_csv, mark_pair_viewe... | 31.5875 | 80 | 0.611793 |
79f5aacfcfed223c58e7257112edca3cbf187092 | 3,975 | py | Python | python/tester.py | cnagda/id-pirated-vid | 95240154494eb94d74aa0f6d45ec160f73328a7f | [
"MIT"
] | 1 | 2020-02-19T10:09:16.000Z | 2020-02-19T10:09:16.000Z | python/tester.py | cnagda/id-pirated-vid | 95240154494eb94d74aa0f6d45ec160f73328a7f | [
"MIT"
] | 10 | 2020-02-25T03:13:52.000Z | 2022-03-12T00:31:32.000Z | python/tester.py | cnagda/id-pirated-vid | 95240154494eb94d74aa0f6d45ec160f73328a7f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import subprocess
import argparse
import glob
import os
import pickle
# NOTE: MUST BE RUN FROM ROOT FOLDER
# Also, for this to work properly for now, DB names can't have underscores
# Attack video naming scheme: NameInDB_kindofattack.*
def main():
python_folder = os.path.abspath(os.path.dir... | 30.113636 | 117 | 0.60478 |
79f5c90a3cae76639482a1f0ce94d5e2e5036fed | 388 | py | Python | satchless/contact/urls.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | 1 | 2015-11-05T05:09:27.000Z | 2015-11-05T05:09:27.000Z | satchless/contact/urls.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | null | null | null | satchless/contact/urls.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | null | null | null | from django.conf.urls.defaults import *
from . import views
urlpatterns = patterns('',
url(r'^$', views.my_contact, name='satchless-contact-my_contact'),
url(r'^address/new/', views.address_edit, name='satchless-contact-address_new'),
url(r'^address/(?P<address_pk>[0-9]+)/edit/',
vi... | 38.8 | 88 | 0.654639 |
79f5d7735f116e247f343f0fa87d9a1c0b031f00 | 2,181 | py | Python | datasets/svhn.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | 9 | 2021-03-30T20:43:26.000Z | 2021-12-28T06:25:17.000Z | datasets/svhn.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | null | null | null | datasets/svhn.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | 2 | 2021-03-31T01:19:48.000Z | 2021-08-02T13:41:32.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 numpy as np
import os
from PIL import Image
import sys
import torchvision
from datasets import base
from platforms.platform import get_... | 33.553846 | 119 | 0.685924 |
79f5e76626d117e826caa929314e2ea3f413258b | 2,613 | py | Python | docs/conf.py | piotrjurkiewicz/flow_stats | cc97a8381275cb9dd23ed0c3432abffaf4198431 | [
"MIT"
] | 9 | 2019-07-08T09:53:22.000Z | 2021-11-19T07:50:11.000Z | docs/conf.py | ElsevierSoftwareX/SOFTX-D-21-00003 | cc97a8381275cb9dd23ed0c3432abffaf4198431 | [
"MIT"
] | 1 | 2021-02-23T16:01:21.000Z | 2021-04-03T02:06:32.000Z | docs/conf.py | ElsevierSoftwareX/SOFTX-D-21-00003 | cc97a8381275cb9dd23ed0c3432abffaf4198431 | [
"MIT"
] | 5 | 2019-09-27T14:52:54.000Z | 2022-01-25T07:58:24.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.84 | 101 | 0.674321 |
79f6047c33425c68b01737ef317dbd424a66ada7 | 4,966 | py | Python | appengine/findit/services/test_failure/test/test_results_service_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | appengine/findit/services/test_failure/test/test_results_service_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | appengine/findit/services/test_failure/test/test_results_service_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import mock
from libs.test_results.gtest_test_results import GtestTestResults
from libs.test_results.blink_web_test_results import BlinkWebTes... | 42.084746 | 80 | 0.618808 |
79f60dacb41eb9ea5e9039a3beca933eae706314 | 5,449 | py | Python | bigml/laminar/preprocess.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:38.000Z | 2021-08-30T20:18:38.000Z | bigml/laminar/preprocess.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | null | null | null | bigml/laminar/preprocess.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:40.000Z | 2021-08-30T20:18:40.000Z | # Copyright 2017-2019 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 26.451456 | 77 | 0.601028 |
79f60ef7dceee8df5dcc5e0d8cd7aa559f66e55b | 14,862 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_is31fl3731.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_is31fl3731.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 7 | 2021-02-19T20:00:08.000Z | 2022-01-14T10:51:12.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_is31fl3731.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: Tony DiCola 2017 for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_is31fl3731`
====================================================
CircuitPython driver for the IS31FL3731 charlieplex IC.
* Author(s): Tony DiCola, Melissa LeBlanc-Williams
Implementation Notes
--------... | 31.02714 | 87 | 0.561903 |
79f619f8468a163c66ae2c15002588be17dbad81 | 669 | py | Python | Main/functions.py | Gitrocha/BR-MarineTraffic | f3422e09ce522e802844c971f9507c2b4d142f5b | [
"MIT"
] | null | null | null | Main/functions.py | Gitrocha/BR-MarineTraffic | f3422e09ce522e802844c971f9507c2b4d142f5b | [
"MIT"
] | null | null | null | Main/functions.py | Gitrocha/BR-MarineTraffic | f3422e09ce522e802844c971f9507c2b4d142f5b | [
"MIT"
] | null | null | null | import os
def find_folders(xpath):
result = []
listdir = os.listdir(xpath)
print('ListDIR', listdir)
'''
for filename in listdir: # loop through all the files and folders
if os.path.isdir(
os.path.join(os.path.abspath("."), filename)): # check whether the current object... | 26.76 | 117 | 0.627803 |
79f66ea6d81b0f489cf009ae18c81845aa709221 | 610 | py | Python | html2pdf_service/tests/test_html2pdf.py | stanwood/stanwood-services | a9a3afcb10c94877b656bbf48994e74560ab0166 | [
"MIT"
] | null | null | null | html2pdf_service/tests/test_html2pdf.py | stanwood/stanwood-services | a9a3afcb10c94877b656bbf48994e74560ab0166 | [
"MIT"
] | 8 | 2019-12-26T17:33:37.000Z | 2022-03-21T22:17:52.000Z | html2pdf_service/tests/test_html2pdf.py | stanwood/stanwood-services | a9a3afcb10c94877b656bbf48994e74560ab0166 | [
"MIT"
] | 1 | 2019-02-14T13:43:36.000Z | 2019-02-14T13:43:36.000Z | from unittest import mock
import pytest
import app
@pytest.fixture
def client():
app.app.config['TESTING'] = True
with app.app.test_client() as client:
yield client
@mock.patch('app.pdfkit')
def test_call_shell_method(pdfkit, client):
pdfkit.from_string.return_value = 'pdf-data'
respons... | 19.677419 | 61 | 0.662295 |
79f679517a87c8dad9e42b3f463a103b5561d8ef | 3,611 | py | Python | tests/test_timeout.py | kesking82/thingflow-python | 4c00deafd1bf425ec90ef2159fc5f3ea2553ade8 | [
"Apache-2.0"
] | 38 | 2017-04-25T12:24:56.000Z | 2021-01-12T17:01:43.000Z | tests/test_timeout.py | kesking82/thingflow-python | 4c00deafd1bf425ec90ef2159fc5f3ea2553ade8 | [
"Apache-2.0"
] | 4 | 2017-08-04T22:39:15.000Z | 2017-08-07T17:36:21.000Z | tests/test_timeout.py | kesking82/thingflow-python | 4c00deafd1bf425ec90ef2159fc5f3ea2553ade8 | [
"Apache-2.0"
] | 14 | 2017-07-31T21:25:29.000Z | 2022-02-06T08:09:07.000Z | # Copyright 2016 by MPI-SWS and Data-Ken Research.
# Licensed under the Apache 2.0 License.
"""Verify that we can set up timeout events
"""
import asyncio
import unittest
from thingflow.base import Scheduler, FunctionFilter
import thingflow.filters.timeout
import thingflow.filters.output
from utils import make_test_out... | 31.675439 | 79 | 0.644974 |
79f6a22ce01154b8bd92e64f2ea24dd38c850911 | 23,486 | py | Python | selim_sef/models/unet.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 27 | 2020-03-04T05:54:48.000Z | 2022-01-05T07:07:44.000Z | selim_sef/models/unet.py | CosmiQ/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 1 | 2020-07-14T10:35:50.000Z | 2020-07-14T10:35:50.000Z | selim_sef/models/unet.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 7 | 2020-03-07T21:42:57.000Z | 2022-01-07T10:49:50.000Z | import os
import sys
from functools import partial
from pretrainedmodels import inceptionresnetv2
from torch.nn import Dropout2d, UpsamplingBilinear2d, Sequential
from torch.nn.functional import bilinear, upsample_bilinear
from torch.utils import model_zoo
from models import resnet
from models.densenet import densene... | 37.220285 | 158 | 0.610321 |
79f6ab1754c1a7821baaa2f931a7063f7784f41c | 5,446 | py | Python | charms/pcscf-operator/tests/test_charm.py | charmed-osm/5g-ims | bb902efa575e2e3cf7b97441fc85ace2e917c39b | [
"Apache-2.0"
] | 1 | 2021-06-10T06:53:34.000Z | 2021-06-10T06:53:34.000Z | charms/pcscf-operator/tests/test_charm.py | charmed-osm/5g-ims | bb902efa575e2e3cf7b97441fc85ace2e917c39b | [
"Apache-2.0"
] | 3 | 2021-08-25T02:30:13.000Z | 2022-02-25T06:08:16.000Z | charms/pcscf-operator/tests/test_charm.py | charmed-osm/5g-ims | bb902efa575e2e3cf7b97441fc85ace2e917c39b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020 Tata Elxsi
#
# Licensed under the Apache License, Version 2.0 (the License); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 37.047619 | 83 | 0.588689 |
79f6b13ac7bd8842b526a9c869b1d20bc68cace6 | 11,252 | py | Python | src/appengine/handlers/cron/fuzzer_weights.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | src/appengine/handlers/cron/fuzzer_weights.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | 1 | 2019-06-07T21:29:28.000Z | 2019-06-07T21:29:28.000Z | src/appengine/handlers/cron/fuzzer_weights.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.900585 | 80 | 0.735069 |
79f711c7a15189d8c3df4ae738396450b19e4aff | 2,651 | py | Python | source/api/controlplane/profile/infrastructure/lambda/WorkflowErrorHandler/lambda_function.py | awslabs/aws-media-replay-engine | 2c217eff42f8e2c56b43e2ecf593f5aaa92c5451 | [
"Apache-2.0"
] | 22 | 2021-11-24T01:23:07.000Z | 2022-03-26T23:24:46.000Z | source/api/controlplane/profile/infrastructure/lambda/WorkflowErrorHandler/lambda_function.py | awslabs/aws-media-replay-engine | 2c217eff42f8e2c56b43e2ecf593f5aaa92c5451 | [
"Apache-2.0"
] | null | null | null | source/api/controlplane/profile/infrastructure/lambda/WorkflowErrorHandler/lambda_function.py | awslabs/aws-media-replay-engine | 2c217eff42f8e2c56b43e2ecf593f5aaa92c5451 | [
"Apache-2.0"
] | 3 | 2021-12-10T09:42:51.000Z | 2022-02-16T02:22:50.000Z | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
##############################################################################
#
# PURPOSE:
# Handle exceptions caught by the AWS Step Function workflow
# and optionally update the execution status of the... | 34.881579 | 164 | 0.593361 |
79f721033c602f86e948d417ca30191bf7d70c0a | 1,913 | py | Python | src/cl_transformer.py | PyeongKim/GNN_scaffold_based_drug_generation | 23a1d057d017d02e0738fa1f999cedb060cdb4c9 | [
"MIT"
] | null | null | null | src/cl_transformer.py | PyeongKim/GNN_scaffold_based_drug_generation | 23a1d057d017d02e0738fa1f999cedb060cdb4c9 | [
"MIT"
] | null | null | null | src/cl_transformer.py | PyeongKim/GNN_scaffold_based_drug_generation | 23a1d057d017d02e0738fa1f999cedb060cdb4c9 | [
"MIT"
] | null | null | null | import torch
from transformers import BertModel, BertTokenizer
import re
import os
import requests
from tqdm.auto import tqdm
def protein_seq_parser(fasta):
reader = open(fasta, "r")
line = reader.readline()
aa_list = []
while line:
aa_frag = line.rstrip()
aa_frag = list(aa... | 34.781818 | 98 | 0.67747 |
79f7216673f86169dacd377f8afe33ab43e8fc32 | 2,330 | py | Python | zk/tests/test_zk.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2020-08-08T02:01:01.000Z | 2020-08-08T02:01:01.000Z | zk/tests/test_zk.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2018-08-15T05:50:17.000Z | 2018-08-15T05:50:17.000Z | zk/tests/test_zk.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2019-03-06T14:30:52.000Z | 2019-03-06T14:30:52.000Z | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
from distutils.version import LooseVersion # pylint: disable=E0611,E0401
import pytest
# project
from datadog_checks.zk import ZookeeperCheck
import conftest
def test_check(aggregator, spin_up_zk, ge... | 34.264706 | 80 | 0.734335 |
79f73d03a5f6690defe2b16ddf1e3451b85f5097 | 2,615 | py | Python | docs/examples/export_bledevice.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 198 | 2016-08-04T05:45:38.000Z | 2022-02-17T08:30:58.000Z | docs/examples/export_bledevice.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 13 | 2018-02-04T14:16:16.000Z | 2020-10-09T02:16:24.000Z | docs/examples/export_bledevice.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 57 | 2016-08-08T04:24:04.000Z | 2022-01-24T08:43:02.000Z | from blesuite.entities.gatt_device import BLEDevice
from blesuite.entities.permissions import Permissions
import blesuite.utils.att_utils as att_utils
import json
# Initialize new BLEDevice object
ble_device = BLEDevice()
# Create a new primary service with starting handle 1, ending handle 6, and UUID 2124
service1 =... | 48.425926 | 151 | 0.735755 |
79f76deaa1dea01cd385d15c7e396f2291f63e26 | 6,280 | py | Python | docs/source/conf.py | jacobmas/btrdb-python | a5a897c3822668c84a456677479a81838e729e15 | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | jacobmas/btrdb-python | a5a897c3822668c84a456677479a81838e729e15 | [
"BSD-3-Clause"
] | 7 | 2021-05-24T17:49:16.000Z | 2022-01-21T13:50:46.000Z | docs/source/conf.py | jacobmas/btrdb-python | a5a897c3822668c84a456677479a81838e729e15 | [
"BSD-3-Clause"
] | 1 | 2021-06-16T14:56:38.000Z | 2021-06-16T14:56:38.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.483568 | 79 | 0.63949 |
79f7a52effca9a9fd8eada62c083dbffe71ecab1 | 1,565 | py | Python | pystrings/length_of_longest_substring/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | pystrings/length_of_longest_substring/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | pystrings/length_of_longest_substring/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | def length_of_longest_substring(s: str) -> int:
"""
The most obvious way to do this would be to go through all possible substrings of the string which would result in
an algorithm with an overall O(n^2) complexity.
But we can solve this problem using a more subtle method that does it with one linear tr... | 43.472222 | 119 | 0.695208 |
79f7afc290b710d6766b82a8554f9df795b7e623 | 54,836 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 68.459426 | 172 | 0.731618 |
79f7b9dfa5c16bb7f772049242245d659497577f | 6,394 | py | Python | homeassistant/components/homematicip_cloud/switch.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/homematicip_cloud/switch.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | homeassistant/components/homematicip_cloud/switch.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Support for HomematicIP Cloud switches."""
import logging
from typing import Any, Dict
from homematicip.aio.device import (
AsyncBrandSwitchMeasuring,
AsyncFullFlushSwitchMeasuring,
AsyncHeatingSwitch2,
AsyncMultiIOBox,
AsyncOpenCollector8Module,
AsyncPlugableSwitch,
AsyncPlugableSwitchM... | 35.325967 | 88 | 0.67579 |
79f7bba8a367a339d0d370cea1d84465b282add9 | 425 | py | Python | 1268.py | gdmanandamohon/leetcode | a691a4e37ee1fdad69c710e3710c5faf8b0a7d76 | [
"MIT"
] | null | null | null | 1268.py | gdmanandamohon/leetcode | a691a4e37ee1fdad69c710e3710c5faf8b0a7d76 | [
"MIT"
] | null | null | null | 1268.py | gdmanandamohon/leetcode | a691a4e37ee1fdad69c710e3710c5faf8b0a7d76 | [
"MIT"
] | null | null | null | '''
@author: l4zyc0d3r
People who are happy makes other happy. I am gonna finish it slowly but definitely.cdt
'''
class Solution:
def suggestedProducts(self, P: List[str], sW: str) -> List[List[str]]:
P.sort()
prfx, ans = '', []
for c in sW:
prfx+=c
i = bisect.bisec... | 30.357143 | 86 | 0.564706 |
79f7d0fefdefaf9cc73691e449f4e54f885a455f | 11,029 | py | Python | otp/namepanel/NameCheck.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | otp/namepanel/NameCheck.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | otp/namepanel/NameCheck.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | import string
from otp.otpbase import OTPLocalizer
from direct.directnotify import DirectNotifyGlobal
from pandac.PandaModules import NSError
from pandac.PandaModules import TextEncoder, TextNode
notify = DirectNotifyGlobal.directNotify.newCategory('NameCheck')
def filterString(str, filter):
result = ''
for ch... | 32.343109 | 108 | 0.539759 |
79f7ffb27918049fe093589bd76c3bf2353d3823 | 11,840 | py | Python | Exercise_02/exercise_2_e_iii.py | lukaszbinden/huji-nlp | 994ce474ae8b5c4df56390456a3411b7be14ef2a | [
"MIT"
] | null | null | null | Exercise_02/exercise_2_e_iii.py | lukaszbinden/huji-nlp | 994ce474ae8b5c4df56390456a3411b7be14ef2a | [
"MIT"
] | null | null | null | Exercise_02/exercise_2_e_iii.py | lukaszbinden/huji-nlp | 994ce474ae8b5c4df56390456a3411b7be14ef2a | [
"MIT"
] | null | null | null | import nltk
import re
from nltk.corpus import brown
from nltk import word_tokenize
from collections import Counter, defaultdict
WORD = 0
TAG = 1
UNKNOWN_TAG = 'NN'
COUNT_CUTOFF = 5
# load new categry
news_sents = brown.tagged_sents(categories='news')
# divide to sets
set_size = round(len(news_sents) * 0.9)
train_set... | 31.742627 | 117 | 0.597128 |
79f8091067e99f826292255c657a818ad2381975 | 3,972 | py | Python | Backends/patches/montepythonlike/3.3.0/bao_correlations/findiff_py23/coefs.py | sebhoof/gambit_1.5 | f9a3f788e3331067c555ae1a030420e903c6fdcd | [
"Unlicense"
] | 2 | 2020-09-08T20:05:27.000Z | 2021-04-26T07:57:56.000Z | Backends/patches/montepythonlike/3.3.0/bao_correlations/findiff_py23/coefs.py | sebhoof/gambit_1.5 | f9a3f788e3331067c555ae1a030420e903c6fdcd | [
"Unlicense"
] | 9 | 2020-10-19T09:56:17.000Z | 2021-05-28T06:12:03.000Z | Backends/patches/montepythonlike/3.3.0/bao_correlations/findiff_py23/coefs.py | sebhoof/gambit_1.5 | f9a3f788e3331067c555ae1a030420e903c6fdcd | [
"Unlicense"
] | 5 | 2020-09-08T02:23:34.000Z | 2021-03-23T08:48:04.000Z | """
This module determines finite difference coefficients for uniform and
non-uniform grids for any desired accuracy order.
"""
import math
import numpy as np
def coefficients(deriv, acc):
"""
Calculates the finite difference coefficients for given derivative order and accuracy order.
Assumes that the un... | 27.205479 | 114 | 0.623867 |
79f81a5cea45a3d1e4457dff5fa14b70119cf290 | 714 | py | Python | Libraries/WindowsInteraction/ReadProcessMemory.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | 1 | 2021-01-10T12:06:26.000Z | 2021-01-10T12:06:26.000Z | Libraries/WindowsInteraction/ReadProcessMemory.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | null | null | null | Libraries/WindowsInteraction/ReadProcessMemory.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | null | null | null | import ctypes, win32ui, win32process, win32api
if __name__ == "__main__":
PROCESS_ALL_ACCESS = 0x1F0FFF
HWND = win32ui.FindWindow(None, "Settings").GetSafeHwnd()
print("Handle Windows: ", HWND)
PID = win32process.GetWindowThreadProcessId(HWND)[1]
print("Process ID: ", PID)
PROCESS = win32api.Op... | 34 | 69 | 0.714286 |
79f82adb6f4b36305d8c6bd1ef459c02477f542b | 616 | py | Python | im_tutorials/data/ons.py | datasciencecampus/im_tutorials | b234069f30e5a2d631a731d51e27b367c59a2d87 | [
"MIT"
] | null | null | null | im_tutorials/data/ons.py | datasciencecampus/im_tutorials | b234069f30e5a2d631a731d51e27b367c59a2d87 | [
"MIT"
] | null | null | null | im_tutorials/data/ons.py | datasciencecampus/im_tutorials | b234069f30e5a2d631a731d51e27b367c59a2d87 | [
"MIT"
] | 1 | 2021-04-10T21:27:52.000Z | 2021-04-10T21:27:52.000Z | import smart_open
import pandas as pd
import pickle
from im_tutorials.data.s3_transfer import load_df_pkl
def patents_10k():
'''patents_10k
Gets a pre-selected sample of 10,000 patents from ONS.
'''
bucket='innovation-mapping-tutorials'
patents_10k_key='ons/ONS_y02_sample_10000.pkl.bz2'
retur... | 26.782609 | 59 | 0.75 |
79f83fdeb7a45bbccdd3b552862a6106bc845d75 | 3,169 | py | Python | salt/states/alternatives.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 1 | 2015-10-06T22:25:22.000Z | 2015-10-06T22:25:22.000Z | salt/states/alternatives.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | salt/states/alternatives.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | '''
Configuration of the alternatives system
========================================
Control the alternatives system
.. code-block:: yaml
hadoop-0.20-conf:
alternatives.install:
- name: hadoop-0.20-conf
- link: /etc/hadoop-0.20/conf
- path: /opt/hadoop/conf
- priority: 30
hadoop-0.2... | 25.97541 | 84 | 0.54118 |
79f84a2647d0b5588437d154a271d0ac8c2bd1ac | 769 | py | Python | test_tensorflow.py | tailtq/TFLite-Retinaface | 93a16087d672f8e0efbf981cc61e5369dedb66f0 | [
"MIT"
] | 2 | 2021-06-01T06:27:39.000Z | 2022-03-18T13:05:03.000Z | test_tensorflow.py | tailtq/TFLite-Retinaface | 93a16087d672f8e0efbf981cc61e5369dedb66f0 | [
"MIT"
] | null | null | null | test_tensorflow.py | tailtq/TFLite-Retinaface | 93a16087d672f8e0efbf981cc61e5369dedb66f0 | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
import tensorflow as tf
import time
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
gpus = tf.config.list_physical_devices('GPU')
print("Devices: ", gpus)
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, False)
img = cv2.imread("imgs/test-img.jpeg")
img = cv2.cvtCo... | 25.633333 | 59 | 0.702211 |
79f86ddc3d7f113f3a9a3ab392e42274df18299b | 1,352 | py | Python | build/kinova_gazebo/catkin_generated/generate_cached_setup.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | build/kinova_gazebo/catkin_generated/generate_cached_setup.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | build/kinova_gazebo/catkin_generated/generate_cached_setup.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... | 43.612903 | 102 | 0.740385 |
79f8814e3e7fb2fbe6d9408dda0543a4ced0c1ad | 32,548 | py | Python | nova/tests/unit/virt/libvirt/test_firewall.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_firewall.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_firewall.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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.... | 45.3947 | 79 | 0.585504 |
79f8a96754975993f7699aec98a7f0adb7d67483 | 107,773 | py | Python | tensorflow/python/keras/callbacks.py | operationcanard/tensorflow | 55e65d43f103a6dac2b4c4d274de7a8352e13528 | [
"Apache-2.0"
] | 3 | 2021-03-15T05:31:57.000Z | 2021-12-14T07:29:31.000Z | tensorflow/python/keras/callbacks.py | operationcanard/tensorflow | 55e65d43f103a6dac2b4c4d274de7a8352e13528 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/callbacks.py | operationcanard/tensorflow | 55e65d43f103a6dac2b4c4d274de7a8352e13528 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.868236 | 104 | 0.679215 |
79f8cf85f0db10bb258dbca879ac6a6ed715dcf4 | 69,380 | py | Python | datadog_checks_base/tests/test_prometheus.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/tests/test_prometheus.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/tests/test_prometheus.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import logging
import os
import mock
import pytest
import requests
from six import iteritems, iterkeys
from six.moves import range
from datadog_checks.checks.prometheus import PrometheusCheck, UnknownFormatError
from ... | 41.199525 | 142 | 0.649496 |
79f8d91694405987b50664e4cbed33c92138dfc3 | 12,934 | py | Python | fedot/core/optimisers/gp_comp/param_free_gp_optimiser.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 358 | 2020-06-11T09:34:53.000Z | 2022-03-31T12:56:22.000Z | fedot/core/optimisers/gp_comp/param_free_gp_optimiser.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 467 | 2020-06-11T13:49:45.000Z | 2022-03-31T14:19:48.000Z | fedot/core/optimisers/gp_comp/param_free_gp_optimiser.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 48 | 2020-07-13T14:50:45.000Z | 2022-03-26T09:37:13.000Z | from copy import deepcopy
from typing import (Any, List, Optional, Tuple)
import numpy as np
from deap import tools
from fedot.core.log import Log
from fedot.core.optimisers.gp_comp.gp_operators import clean_operators_history, duplicates_filtration, \
num_of_parents_in_crossover
from fedot.core.optimisers.gp_comp... | 49.938224 | 119 | 0.666074 |
79f8ec69378f81a87f3c395da3203760bc2f953b | 1,005 | py | Python | webviz_config/generic_plugins/_embed_pdf.py | dotfloat/webviz-config | 2538035c81075b36d23e74642c5d0454c741c142 | [
"MIT"
] | null | null | null | webviz_config/generic_plugins/_embed_pdf.py | dotfloat/webviz-config | 2538035c81075b36d23e74642c5d0454c741c142 | [
"MIT"
] | null | null | null | webviz_config/generic_plugins/_embed_pdf.py | dotfloat/webviz-config | 2538035c81075b36d23e74642c5d0454c741c142 | [
"MIT"
] | null | null | null | from pathlib import Path
import dash_html_components as html
from .. import WebvizPluginABC
from ..webviz_assets import WEBVIZ_ASSETS
class EmbedPdf(WebvizPluginABC):
"""Embeds a given PDF file into the page.
!> Webviz does not scan your PDF for malicious code. Make sure it comes from a trusted source.
---
* ... | 27.916667 | 94 | 0.677612 |
79f8f27ddd4f76e5f4ad6c672414d1b6d6617474 | 2,148 | py | Python | tests/test_downloadResults.py | peterdhansen/nexradaws | 0658efc5ec95d113a9d87fed3feb71b35293bec4 | [
"MIT"
] | 28 | 2018-04-28T19:18:06.000Z | 2021-12-01T00:19:30.000Z | tests/test_downloadResults.py | peterdhansen/nexradaws | 0658efc5ec95d113a9d87fed3feb71b35293bec4 | [
"MIT"
] | 10 | 2017-06-30T19:33:20.000Z | 2021-07-27T22:39:52.000Z | tests/test_downloadResults.py | peterdhansen/nexradaws | 0658efc5ec95d113a9d87fed3feb71b35293bec4 | [
"MIT"
] | 7 | 2018-10-21T17:39:55.000Z | 2021-02-14T01:55:18.000Z | import tempfile
from unittest import TestCase
from datetime import datetime
import shutil
import nexradaws
from nexradaws.resources.localnexradfile import LocalNexradFile
from nexradaws.resources.awsnexradfile import AwsNexradFile
class TestDownloadResults(TestCase):
def setUp(self):
self.query = nexra... | 36.40678 | 76 | 0.703911 |
79f90f3256c68fc082f358f0e9056a4fc14719c4 | 2,530 | py | Python | nvflare/app_common/homomorphic_encryption/he_pt_model_reader_writer.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 155 | 2021-08-05T18:05:09.000Z | 2022-03-27T15:32:56.000Z | nvflare/app_common/homomorphic_encryption/he_pt_model_reader_writer.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 216 | 2021-12-01T06:07:12.000Z | 2022-03-30T23:34:02.000Z | nvflare/app_common/homomorphic_encryption/he_pt_model_reader_writer.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 44 | 2021-11-24T16:03:29.000Z | 2022-03-24T23:28:39.000Z | # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ... | 42.881356 | 115 | 0.643874 |
79f935d8a4ed89b9ab1161b1b373bc8b7279edfe | 430 | py | Python | test/unittests/test_Withdrawal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_Withdrawal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_Withdrawal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.Input.WaterBudget import Withdrawal
class TestWithdrawal(VariableUnitTest):
def test_Withdrawal(self):
z = self.z
np.testing.assert_array_almost_equal(
Withdrawal.Withdrawal_f(z.NYrs, z.StreamWithdrawal, z.Gro... | 33.076923 | 93 | 0.751163 |
79f938043920b77db082bf3862aeb70265495bfb | 836 | py | Python | suspicious_urls_ips/feeds/blocklist.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/blocklist.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/blocklist.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from antivirus.lists_based_engine.update import retrieve_content
from antivirus.lists_based_engine.settings import IP_TYPE
from antivirus.lists_based_engine.s... | 27.866667 | 83 | 0.728469 |
79f95f1f3a06ac364693e85407ea1059961342a3 | 9,644 | py | Python | src/naarad/metrics/procinterrupts_metric.py | richardhsu/naarad | 665f58f76c2412e125f2be2c111ebc7cdf6ff92e | [
"Apache-2.0"
] | 180 | 2015-01-05T13:27:16.000Z | 2021-02-08T04:11:47.000Z | src/naarad/metrics/procinterrupts_metric.py | richardhsu/naarad | 665f58f76c2412e125f2be2c111ebc7cdf6ff92e | [
"Apache-2.0"
] | 58 | 2015-01-07T10:25:17.000Z | 2020-11-05T03:40:23.000Z | src/naarad/metrics/procinterrupts_metric.py | richardhsu/naarad | 665f58f76c2412e125f2be2c111ebc7cdf6ff92e | [
"Apache-2.0"
] | 60 | 2015-01-06T09:23:33.000Z | 2021-02-11T04:29:33.000Z | # coding=utf-8
"""
Copyright 2013 LinkedIn Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | 41.213675 | 144 | 0.621423 |
79f9acdf401953a4bfbbe0cc1f8eaadd251d651e | 16,697 | py | Python | pybk8500/send_cmd.py | justengel/pybk8500 | 6a9748033c783a0081ec391359067dfb9dc83760 | [
"MIT"
] | null | null | null | pybk8500/send_cmd.py | justengel/pybk8500 | 6a9748033c783a0081ec391359067dfb9dc83760 | [
"MIT"
] | null | null | null | pybk8500/send_cmd.py | justengel/pybk8500 | 6a9748033c783a0081ec391359067dfb9dc83760 | [
"MIT"
] | null | null | null | """
Manage communications between the PC and the device.
Requirements:
* pyserial
* continuous_threading
"""
import sys
import time
import serial
import functools
import contextlib
import continuous_threading
from pybk8500.parser import Parser
__all__ = ['CommunicationManager', 'send_msg', 'main']
def pop... | 32.932939 | 119 | 0.593999 |
79f9d4fbb3177760586b8746575619da8401e18c | 1,887 | py | Python | bestfitting/src/layers/scheduler.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | bestfitting/src/layers/scheduler.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | bestfitting/src/layers/scheduler.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | import torch.optim as optim
from layers.scheduler_base import SchedulerBase
class Adam45(SchedulerBase):
def __init__(self, params_list=None):
super(Adam45, self).__init__()
self._lr = 3e-4
self._cur_optimizer = None
self.params_list=params_list
def schedule(self, net, epoch, e... | 30.435484 | 94 | 0.579756 |
79f9e68547a44e3ada7465180a7d3666baa1f802 | 2,018 | py | Python | JDjango/panels/models/ShowAllPipsModel.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | 3 | 2020-12-28T05:09:02.000Z | 2021-06-23T10:02:03.000Z | JDjango/panels/models/ShowAllPipsModel.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | JDjango/panels/models/ShowAllPipsModel.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | import wx.dataview as wxdv
class ShowAllPipsModel(wxdv.DataViewIndexListModel):
def __init__(self, data):
wxdv.DataViewIndexListModel.__init__(self, len(data))
self.data = data
def GetColumnType(self, col):
"""默认全部是字符串类型"""
return "string"
def GetValueByRow(self, row, col)... | 28.027778 | 70 | 0.566402 |
79f9ff00df67184ffab2abd7bdb8a6823826c2e4 | 104 | py | Python | oauth_clients3/urls.py | kverdecia/dj-oauth-clients3 | d66dbb2ffd4dc806661fd53e53638d777eeed5c4 | [
"MIT"
] | null | null | null | oauth_clients3/urls.py | kverdecia/dj-oauth-clients3 | d66dbb2ffd4dc806661fd53e53638d777eeed5c4 | [
"MIT"
] | null | null | null | oauth_clients3/urls.py | kverdecia/dj-oauth-clients3 | d66dbb2ffd4dc806661fd53e53638d777eeed5c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import url
app_name = 'oauth_clients3'
urlpatterns = [
]
| 14.857143 | 32 | 0.673077 |
79fa0004503f5abe403e30311e4b10780b1f3c58 | 3,418 | py | Python | axonius_api_client/tests/tests_pkg/test_logs.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 11 | 2020-01-31T00:28:26.000Z | 2022-03-25T20:27:08.000Z | axonius_api_client/tests/tests_pkg/test_logs.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 83 | 2020-01-22T12:52:38.000Z | 2022-02-07T16:20:18.000Z | axonius_api_client/tests/tests_pkg/test_logs.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 16 | 2019-08-23T17:44:31.000Z | 2022-01-06T00:57:34.000Z | # -*- coding: utf-8 -*-
"""Test suite for axonius_api_client.tools."""
import logging
import pathlib
import time
import pytest
from axonius_api_client.constants.logs import (
LOG_LEVEL_CONSOLE,
LOG_LEVEL_FILE,
LOG_NAME_FILE,
LOG_NAME_STDERR,
LOG_NAME_STDOUT,
)
from axonius_api_client.exceptions im... | 26.913386 | 82 | 0.636337 |
79fa4bde805ab78180fc107034c615bb28205a18 | 3,556 | py | Python | mindspore/common/dump.py | LaiYongqiang/mindspore | 1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e | [
"Apache-2.0"
] | 1 | 2021-11-19T14:21:45.000Z | 2021-11-19T14:21:45.000Z | mindspore/common/dump.py | LaiYongqiang/mindspore | 1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e | [
"Apache-2.0"
] | null | null | null | mindspore/common/dump.py | LaiYongqiang/mindspore | 1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.511111 | 114 | 0.613892 |
79fa5e1208b8f66800ab6c429290567ad59e0b81 | 2,247 | py | Python | test/selenium/src/lib/service/admin_webui_service.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-04T10:55:14.000Z | 2019-01-04T10:55:14.000Z | test/selenium/src/lib/service/admin_webui_service.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/selenium/src/lib/service/admin_webui_service.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Services for create and manipulate objects via admin UI."""
from lib import url
from lib.page import dashboard
from lib.page.modal.create_new_person import CreateNewPersonModal
from lib.utils import selen... | 36.836066 | 78 | 0.76057 |
79fa6b3f95f345f4019df0ac3ebed504f77b2aca | 357 | py | Python | aiocoinbase/utils.py | dikuchan/aiocoinbase | 3492befc3844dc9a401e5634563a318a59d5eb61 | [
"MIT"
] | null | null | null | aiocoinbase/utils.py | dikuchan/aiocoinbase | 3492befc3844dc9a401e5634563a318a59d5eb61 | [
"MIT"
] | 2 | 2022-02-25T15:09:46.000Z | 2022-02-25T18:30:42.000Z | aiocoinbase/utils.py | dikuchan/aiocoinbase | 3492befc3844dc9a401e5634563a318a59d5eb61 | [
"MIT"
] | null | null | null | from datetime import datetime, tzinfo
from enum import Enum
class Method(Enum):
DELETE = "DELETE"
GET = "GET"
POST = "POST"
PUT = "PUT"
def __str__(self) -> str:
return self.value
def now(tz: tzinfo | None = None) -> str:
"""
Get current timestamp in seconds.
"""
return ... | 17.85 | 47 | 0.602241 |
79fa9a197efdfd42f16953a8f9534c4b79708442 | 1,855 | py | Python | stranger/test.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | 1 | 2019-08-05T00:54:27.000Z | 2019-08-05T00:54:27.000Z | stranger/test.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | null | null | null | stranger/test.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | null | null | null | import argparse
import os,sys
import numpy as np
import datetime
from train import get_symbol, data_loader
import mxnet as mx
from mxnet import ndarray as nd
import ipdb
def softmax(x):
exp = np.exp(x)
partition = exp.sum(axis=1,keepdims=True)
return exp / partition
parser = argparse.ArgumentParser(desc... | 27.279412 | 87 | 0.637197 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.