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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38434605be53df8d410c2ceb630dcd9aeca4066f | 4,711 | py | Python | docker_squash/squash.py | AvihayTsayeg/docker-squash | 3e1383bffc2bfc26c4030402a2d44f2a20c1299e | [
"MIT"
] | null | null | null | docker_squash/squash.py | AvihayTsayeg/docker-squash | 3e1383bffc2bfc26c4030402a2d44f2a20c1299e | [
"MIT"
] | null | null | null | docker_squash/squash.py | AvihayTsayeg/docker-squash | 3e1383bffc2bfc26c4030402a2d44f2a20c1299e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import uuid
from distutils.version import StrictVersion
from docker_squash.v1_image import V1Image
from docker_squash.v2_image import V2Image
from docker_squash.lib import common
from docker_squash.errors import SquashError
from docker_squash.version import version
class Squash(ob... | 37.991935 | 173 | 0.632987 |
38434b3185bf0fbc33b7e9dd8352f1e1f87aa0c6 | 5,259 | py | Python | zoo/src/main/python/zoo/ner/trainer/trainer.py | Impavidity/pinfrastructure | b5577fe1e140e0b360aec2834349ba87647eb000 | [
"MIT"
] | 10 | 2017-12-04T03:50:50.000Z | 2020-09-25T07:24:32.000Z | zoo/src/main/python/zoo/ner/trainer/trainer.py | Impavidity/pinfrastructure | b5577fe1e140e0b360aec2834349ba87647eb000 | [
"MIT"
] | 8 | 2018-07-14T09:45:38.000Z | 2018-09-17T20:56:52.000Z | zoo/src/main/python/zoo/ner/trainer/trainer.py | Impavidity/pinfrastructure | b5577fe1e140e0b360aec2834349ba87647eb000 | [
"MIT"
] | 1 | 2017-11-24T18:31:53.000Z | 2017-11-24T18:31:53.000Z | from __future__ import division
import json
import os
import subprocess
from pbase.ptext.field import Field, NestedField
from pbase.ptext.attribute import Attribute
from pbase.papp.argument import Argument
from pbase.papp.trainer import Trainer
from zoo.ner.model.ner_tensorflow import NERModel
pid = os.getpid()
cl... | 41.085938 | 127 | 0.698612 |
384367e4d34f4b2461558ae472e6e43ecce5e1d9 | 625 | py | Python | cms/test_utils/project/nonroot_urls.py | pbs/django-cms | f230e63f98fafb75beb3956328021f8976564c96 | [
"BSD-3-Clause"
] | null | null | null | cms/test_utils/project/nonroot_urls.py | pbs/django-cms | f230e63f98fafb75beb3956328021f8976564c96 | [
"BSD-3-Clause"
] | 9 | 2015-06-25T10:31:12.000Z | 2022-03-12T00:41:22.000Z | cms/test_utils/project/nonroot_urls.py | pbs/django-cms | f230e63f98fafb75beb3956328021f8976564c96 | [
"BSD-3-Clause"
] | 1 | 2017-08-22T07:00:30.000Z | 2017-08-22T07:00:30.000Z | from django.conf import settings
from django.conf.urls import handler500, handler404, patterns, include, \
url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'),... | 41.666667 | 132 | 0.6848 |
38436f47b3e1da5a9509d3a21a096a41335397d6 | 2,058 | py | Python | alipay/aop/api/domain/PromotePageData.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/domain/PromotePageData.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/domain/PromotePageData.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.constant.ParamConstants import *
from alipay.aop.api.domain.PromotePagePropertyInstance import PromotePagePropertyInstance
class PromotePageData(object):
def __init__(self):
self._biz_no = None
self._property_list = No... | 30.264706 | 95 | 0.587949 |
384379de4fbcddcd769d59aaf3c02ddf7547a35a | 1,145 | py | Python | Visualization/image_stretch.py | monocilindro/qgis-earthengine-examples | 82aea8926d34ed3f4ad4a4a345ddbd225819d28f | [
"MIT"
] | 646 | 2019-12-03T06:09:03.000Z | 2022-03-28T03:37:08.000Z | Visualization/image_stretch.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 10 | 2019-12-30T03:42:44.000Z | 2021-05-22T07:34:07.000Z | Visualization/image_stretch.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 219 | 2019-12-06T02:20:53.000Z | 2022-03-30T15:14:27.000Z | import ee
from ee_plugin import Map
# Load a Landsat 8 raw image.
image = ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20140318')
# Define a RasterSymbolizer element with '_enhance_' for a placeholder.
template_sld = \
'<RasterSymbolizer>' + \
'<ContrastEnhancement><_enhance_/></ContrastEnhancement>' + \
'<Cha... | 35.78125 | 84 | 0.664629 |
384382f1f9c74b5bf0223465fcb9e9eb5217b549 | 1,081 | py | Python | 300_Longest-Increasing-Subsequence.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | 3 | 2018-07-05T05:51:10.000Z | 2019-05-04T08:35:44.000Z | 300_Longest-Increasing-Subsequence.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | null | null | null | 300_Longest-Increasing-Subsequence.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | null | null | null | # Method I: O(n^2)
class Solution:
def lengthOfLIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
if len(nums) == 1:
return 1
dp = [1 for _ in range(len(nums))]
for i in range(1, l... | 24.022222 | 47 | 0.370028 |
38438bd39379aa8fddc6a6e6b5dad1c8cbc07be9 | 7,957 | py | Python | src/optim/DeepSAD_trainer.py | abelrguezr/Deep-SAD-PyTorch | 268ca21570a4a8dadc331a9dbf26ccade36ae5d9 | [
"MIT"
] | null | null | null | src/optim/DeepSAD_trainer.py | abelrguezr/Deep-SAD-PyTorch | 268ca21570a4a8dadc331a9dbf26ccade36ae5d9 | [
"MIT"
] | null | null | null | src/optim/DeepSAD_trainer.py | abelrguezr/Deep-SAD-PyTorch | 268ca21570a4a8dadc331a9dbf26ccade36ae5d9 | [
"MIT"
] | null | null | null | from base.base_trainer import BaseTrainer
from base.base_dataset import BaseADDataset
from base.base_net import BaseNet
from torch.utils.data.dataloader import DataLoader
from sklearn.metrics import roc_auc_score, precision_recall_curve, auc
from torch.utils.tensorboard import SummaryWriter
import logging
import time
i... | 35.522321 | 113 | 0.54053 |
3843bafdd3bfe62c83e406bc52f522067c51afff | 227 | py | Python | graph/mime_types.py | koolspin/rosetta | 89fe48d99c92e67df3c52dac9839b608e202cd3d | [
"MIT"
] | null | null | null | graph/mime_types.py | koolspin/rosetta | 89fe48d99c92e67df3c52dac9839b608e202cd3d | [
"MIT"
] | null | null | null | graph/mime_types.py | koolspin/rosetta | 89fe48d99c92e67df3c52dac9839b608e202cd3d | [
"MIT"
] | null | null | null | class MimeTypes:
ALL = '*/*'
TEXT = 'text/plain'
JSON = 'application/json'
BINARY = 'application/octet-stream'
CSV = 'text/csv'
HTML = 'text/html'
PDF = 'application/pdf'
XML = 'application/xml'
| 22.7 | 39 | 0.585903 |
3843bc0ccd76409daab88c5122dd5b3df09762f2 | 8,252 | py | Python | test/conftest.py | cstockton/py-emit | 3c240afb4a6159aa3a9a5930c0f6a606d41370b1 | [
"MIT"
] | null | null | null | test/conftest.py | cstockton/py-emit | 3c240afb4a6159aa3a9a5930c0f6a606d41370b1 | [
"MIT"
] | null | null | null | test/conftest.py | cstockton/py-emit | 3c240afb4a6159aa3a9a5930c0f6a606d41370b1 | [
"MIT"
] | 3 | 2017-08-29T22:59:25.000Z | 2020-02-21T19:13:41.000Z | import pytest
import py # needed by pytest, I use it for term width
import logging
import os
from datetime import datetime
from emit.globals import log
from emit import transports, adapters, emitters, event
_root_dir = os.path.abspath(
os.path.dirname(os.path.realpath(__file__)) + os.sep + '../emit/')
_log_conta... | 34.099174 | 98 | 0.644692 |
3843c1b485425baf4b6eba310cf719ea773c973c | 14,319 | py | Python | homeassistant/components/group.py | mweinelt/home-assistant | cc0d0a38d7f24885e5146bd0826fa8ba3e2b39a1 | [
"MIT"
] | null | null | null | homeassistant/components/group.py | mweinelt/home-assistant | cc0d0a38d7f24885e5146bd0826fa8ba3e2b39a1 | [
"MIT"
] | null | null | null | homeassistant/components/group.py | mweinelt/home-assistant | cc0d0a38d7f24885e5146bd0826fa8ba3e2b39a1 | [
"MIT"
] | null | null | null | """
Provides functionality to group entities.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/group/
"""
import asyncio
import logging
import os
import voluptuous as vol
from homeassistant import config as conf_util, core as ha
from homeassistant.const... | 30.401274 | 79 | 0.638103 |
3843d2be729536da108d17a62d4ea2edddb7d166 | 47,469 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_03_01/aio/operations/_web_site_management_client_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_03_01/aio/operations/_web_site_management_client_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_03_01/aio/operations/_web_site_management_client_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 44.951705 | 691 | 0.672797 |
3844071d71bbcd5afba9fd35f52f4ca5c9f9af0a | 8,560 | py | Python | qiskit/extensions/unitary.py | nkanazawa1989/qiskit-terra | 88267be7228e5d09533e4e2d8bbccfcafa6f2e8c | [
"Apache-2.0"
] | 1 | 2019-06-04T12:23:36.000Z | 2019-06-04T12:23:36.000Z | qiskit/extensions/unitary.py | nkanazawa1989/qiskit-terra | 88267be7228e5d09533e4e2d8bbccfcafa6f2e8c | [
"Apache-2.0"
] | 35 | 2019-03-07T02:09:22.000Z | 2022-03-22T19:55:15.000Z | qiskit/extensions/unitary.py | nkanazawa1989/qiskit-terra | 88267be7228e5d09533e4e2d8bbccfcafa6f2e8c | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 39.813953 | 94 | 0.636332 |
3844165ed179cf0ca4776a2b5c4f963da4d4f4b9 | 8,799 | py | Python | plugins/dbnd-spark/src/dbnd_spark/spark.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | plugins/dbnd-spark/src/dbnd_spark/spark.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | plugins/dbnd-spark/src/dbnd_spark/spark.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | import logging
import subprocess
import typing
from typing import Union
import more_itertools
from dbnd._core.cli.cmd_execute import get_dbnd_version, get_python_version
from dbnd._core.constants import TaskType
from dbnd._core.errors import DatabandBuildError, DatabandConfigError
from dbnd._core.errors.friendly_err... | 35.055777 | 113 | 0.681782 |
38441b7ebf6428a3ec25af0716e1c4299ffae2c3 | 80 | py | Python | datadog_checks_dev/datadog_checks/dev/tooling/templates/check/{check_name}/tests/conftest.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_dev/datadog_checks/dev/tooling/templates/check/{check_name}/tests/conftest.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_dev/datadog_checks/dev/tooling/templates/check/{check_name}/tests/conftest.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | {license_header}import pytest
@pytest.fixture
def instance():
return {{}}
| 11.428571 | 29 | 0.7 |
384453ecc306dd69e4af0591941b357219039ae0 | 2,393 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | # 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 ... | 39.229508 | 107 | 0.652737 |
3844766ea7e53ee077f0bbc2033e44709d230324 | 917 | py | Python | nova/tests/unit/monkey_patch_example/example_a.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 571 | 2015-01-01T17:47:26.000Z | 2022-03-23T07:46:36.000Z | nova/tests/unit/monkey_patch_example/example_a.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 37 | 2015-01-22T23:27:04.000Z | 2021-02-05T16:38:48.000Z | nova/tests/unit/monkey_patch_example/example_a.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 841 | 2015-01-04T17:17:11.000Z | 2022-03-31T12:06:51.000Z | # Copyright 2011 OpenStack Foundation
# 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 requ... | 32.75 | 78 | 0.718648 |
38447a00b6432b8742b8fe15667040c9cb99d7b7 | 744 | py | Python | Python/ex036.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | 1 | 2021-02-16T17:36:53.000Z | 2021-02-16T17:36:53.000Z | Python/ex036.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | null | null | null | Python/ex036.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | null | null | null | emprestimo = float(input('Qual o valor da casa que deseja comprar R$ '))
salario = float(input('Qual o valor do seu salário R$ '))
anos = int(input('Em quantos anos pretende pagar a casa ? '))
prestacao = emprestimo / (anos * 12)
# pega a visao, a prestação é o valor da casa / pela quantidade de anos * 12, que sao quan... | 62 | 141 | 0.715054 |
3844886090a8488a6719713125826f7d9d0fb4c0 | 16,547 | py | Python | ch07/code/gdal_merge.py | MatthiasWunsch/python-geospatial-analysis-cookbook | 88946ca6242283c9110488c64ac44057a53e2831 | [
"MIT"
] | 98 | 2015-06-14T08:42:21.000Z | 2022-03-09T16:48:43.000Z | ch07/code/gdal_merge.py | MatthiasWunsch/python-geospatial-analysis-cookbook | 88946ca6242283c9110488c64ac44057a53e2831 | [
"MIT"
] | 6 | 2015-12-23T09:56:33.000Z | 2022-02-13T20:06:05.000Z | ch07/code/gdal_merge.py | MatthiasWunsch/python-geospatial-analysis-cookbook | 88946ca6242283c9110488c64ac44057a53e2831 | [
"MIT"
] | 43 | 2015-08-24T13:13:32.000Z | 2022-03-14T20:55:15.000Z | #!/usr/bin/env python
###############################################################################
# $Id: gdal_merge.py 27044 2014-03-16 23:41:27Z rouault $
#
# Project: InSAR Peppers
# Purpose: Module to extract data from many rasters into one output.
# Author: Frank Warmerdam, warmerdam@pobox.com
#
###########... | 32.381605 | 178 | 0.537801 |
3844a47eec936f1949b409cefc387bc157497696 | 6,054 | py | Python | web/backend/Other/BackendUtils.py | mrkirby153/GearBot | a61d936c12e906c7bcfaa840a585ee25ffc06138 | [
"MIT"
] | null | null | null | web/backend/Other/BackendUtils.py | mrkirby153/GearBot | a61d936c12e906c7bcfaa840a585ee25ffc06138 | [
"MIT"
] | null | null | null | web/backend/Other/BackendUtils.py | mrkirby153/GearBot | a61d936c12e906c7bcfaa840a585ee25ffc06138 | [
"MIT"
] | null | null | null | import json
import urllib
from time import time
from secrets import token_urlsafe
import aioredis
from tornado import escape
from tornado.httpclient import HTTPRequest, HTTPClientError, AsyncHTTPClient
API_LOCATION = "https://discordapp.com/api/"
CLIENT_ID = None
REDIRECT_URI = None
CLIENT_URL = None
TESTING_USERID ... | 34.011236 | 120 | 0.665015 |
3844ac662c7faad662264891b5c258d7066855b1 | 3,661 | py | Python | tests/layers/interaction_test.py | limingdata/DeepCTR | 9569a171f2d1aa400e15175c09fea49cdd7ab5b7 | [
"MIT"
] | 2 | 2019-04-10T09:39:33.000Z | 2019-04-10T09:39:35.000Z | tests/layers/interaction_test.py | xy0210/DeepCTR | 9569a171f2d1aa400e15175c09fea49cdd7ab5b7 | [
"MIT"
] | null | null | null | tests/layers/interaction_test.py | xy0210/DeepCTR | 9569a171f2d1aa400e15175c09fea49cdd7ab5b7 | [
"MIT"
] | null | null | null | import pytest
from tensorflow.python.keras.layers import PReLU
from tensorflow.python.keras.utils import CustomObjectScope
from deepctr import layers
from tests.utils import layer_test
BATCH_SIZE = 4
FIELD_SIZE = 3
EMBEDDING_SIZE = 8
SEQ_LENGTH = 10
@pytest.mark.parametrize(
'layer_num,l2_reg',
[(layer_n... | 29.764228 | 98 | 0.663753 |
3844d35e13117b1f599a85a387571e6082af588e | 6,513 | py | Python | setup.py | flowswitch/pyftdi | bb57ed01bcd35680e271aa96fc27b962527f336a | [
"BSD-3-Clause"
] | null | null | null | setup.py | flowswitch/pyftdi | bb57ed01bcd35680e271aa96fc27b962527f336a | [
"BSD-3-Clause"
] | null | null | null | setup.py | flowswitch/pyftdi | bb57ed01bcd35680e271aa96fc27b962527f336a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2021 Emmanuel Blot <emmanuel.blot@free.fr>
# Copyright (c) 2010-2016 Neotion
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#pylint: disable-msg=unused-variable
#pylint: disable-msg=missing-docstring
#pylint: disable-msg=broad-excep... | 32.402985 | 78 | 0.588976 |
3844d49822f84ca0bfa5ce34b4cc0ffe520706fc | 19,425 | py | Python | armi/reactor/tests/test_composites.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/reactor/tests/test_composites.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/reactor/tests/test_composites.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, 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 writi... | 34.259259 | 119 | 0.627593 |
3844f00cd92fe56b9ecffa5c8f617b1fc55ca3b2 | 5,320 | py | Python | backend/model/db_user.py | deti/boss | bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869 | [
"Apache-2.0"
] | 7 | 2018-05-20T08:56:08.000Z | 2022-03-11T15:50:54.000Z | backend/model/db_user.py | deti/boss | bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869 | [
"Apache-2.0"
] | 2 | 2021-06-08T21:12:51.000Z | 2022-01-13T01:25:27.000Z | backend/model/db_user.py | deti/boss | bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869 | [
"Apache-2.0"
] | 5 | 2016-10-09T14:52:09.000Z | 2020-12-25T01:04:35.000Z | """
Manage user access to mysql
Usage:
db_user create [options]
db_user create_test [options]
db_user drop [options]
db_user drop_test [options]
db_user dropdb [options]
db_user dropdb_test [options]
Options:
-h --help Show this screen.
-u --user=USER Username wi... | 35.704698 | 115 | 0.596992 |
38451767f17ebe5b886191248b4b7f92c954f648 | 30,491 | py | Python | tf_verify/onnx_translator.py | Neelanjana314/eran | 4465000ac85781f2e3663683432c7525e94dc59a | [
"Apache-2.0"
] | 6 | 2022-03-03T23:50:02.000Z | 2022-03-29T05:58:47.000Z | tf_verify/onnx_translator.py | Neelanjana314/eran | 4465000ac85781f2e3663683432c7525e94dc59a | [
"Apache-2.0"
] | null | null | null | tf_verify/onnx_translator.py | Neelanjana314/eran | 4465000ac85781f2e3663683432c7525e94dc59a | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 ETH Zurich, Secure, Reliable, and Intelligent Systems Lab
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 requi... | 35.956368 | 218 | 0.699452 |
38454f96e2a27246009c8737290c958d079f6910 | 20,222 | py | Python | rllib/policy/torch_policy.py | hahaxun/ray | 754d7b1f0d6a147315a96dfc9f410504472b28d5 | [
"Apache-2.0"
] | null | null | null | rllib/policy/torch_policy.py | hahaxun/ray | 754d7b1f0d6a147315a96dfc9f410504472b28d5 | [
"Apache-2.0"
] | null | null | null | rllib/policy/torch_policy.py | hahaxun/ray | 754d7b1f0d6a147315a96dfc9f410504472b28d5 | [
"Apache-2.0"
] | null | null | null | import functools
import numpy as np
import time
from ray.rllib.models.torch.torch_action_dist import TorchDistributionWrapper
from ray.rllib.policy.policy import Policy, LEARNER_STATS_KEY
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.policy.rnn_sequencing import pad_batch_to_sequences_of_same_si... | 41.018256 | 79 | 0.594996 |
3845674a463ee8e19a798e2ded046d855e16ee40 | 65 | py | Python | src/scripts/__init__.py | Softyy/dash-cli | 906c82e1d18ea1ba059e78ed198a3e7d62853605 | [
"MIT"
] | null | null | null | src/scripts/__init__.py | Softyy/dash-cli | 906c82e1d18ea1ba059e78ed198a3e7d62853605 | [
"MIT"
] | null | null | null | src/scripts/__init__.py | Softyy/dash-cli | 906c82e1d18ea1ba059e78ed198a3e7d62853605 | [
"MIT"
] | null | null | null | from .create import *
from .update import *
from .run import *
| 10.833333 | 21 | 0.692308 |
38456b3241ead5a1e5a29fba2fc963354a5deda7 | 16,682 | py | Python | lciafmt/recipe.py | tngTUDOR/LCIAformatter | 64a31796085951e90290d4ac3f62db9ab06e77b2 | [
"MIT"
] | null | null | null | lciafmt/recipe.py | tngTUDOR/LCIAformatter | 64a31796085951e90290d4ac3f62db9ab06e77b2 | [
"MIT"
] | null | null | null | lciafmt/recipe.py | tngTUDOR/LCIAformatter | 64a31796085951e90290d4ac3f62db9ab06e77b2 | [
"MIT"
] | null | null | null | # recipe.py (lciafmt)
# !/usr/bin/env python3
# coding=utf-8
"""
This module contains functions needed to compile LCIA methods from the
ReCiPe model
"""
import pandas as pd
import openpyxl
import lciafmt.cache as cache
import lciafmt.df as dfutil
import lciafmt.xls as xls
from .util import datapath, aggregate_factor... | 39.159624 | 111 | 0.591056 |
384570dc39b5bccb1d87b4f5fc7a9bda99f2b6a7 | 2,593 | py | Python | fluids/vectorized.py | volpatto/fluids | 693268d0fd7c9e2f276ebdf14353cb9d7dbac195 | [
"MIT"
] | null | null | null | fluids/vectorized.py | volpatto/fluids | 693268d0fd7c9e2f276ebdf14353cb9d7dbac195 | [
"MIT"
] | null | null | null | fluids/vectorized.py | volpatto/fluids | 693268d0fd7c9e2f276ebdf14353cb9d7dbac195 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2017, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... | 33.675325 | 80 | 0.748168 |
3845813cee961635e12025aac6ab9341fb1a9689 | 827 | py | Python | Anchors/showAllAccents.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | 2 | 2021-02-12T20:36:29.000Z | 2021-11-03T08:04:01.000Z | Anchors/showAllAccents.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | null | null | null | Anchors/showAllAccents.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | null | null | null | # MenuTitle: Show All Accents
# -*- coding: utf-8 -*-
__doc__ = """
Opens a new tab listing all accents in the whole font and the glyphs that use them as a component.
"""
accents = {}
for g in Glyphs.font.glyphs:
for l in g.layers:
try:
if '_' in [x[0] for x in l.anchors.keys()]:
... | 25.84375 | 98 | 0.556227 |
3845bb09fcb048a4aa00f79d4b1827c02e3011f4 | 442 | py | Python | bleet/tests.py | ntoll/facebaaak | 9a1a555f36bfa358d83ceebfd10da8e0146f3f2f | [
"MIT"
] | null | null | null | bleet/tests.py | ntoll/facebaaak | 9a1a555f36bfa358d83ceebfd10da8e0146f3f2f | [
"MIT"
] | null | null | null | bleet/tests.py | ntoll/facebaaak | 9a1a555f36bfa358d83ceebfd10da8e0146f3f2f | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth.models import User
from .models import Bleet
class BleetModelTests(TestCase):
def test_create_bleet(self):
user = User.objects.create_user(username="test_user", password="12345")
b = Bleet()
b.content = "Hello, world!"
b.us... | 27.625 | 79 | 0.656109 |
3845ddae73d59ff19cb85f88fe18251c860e782d | 1,018 | py | Python | savu/plugins/visualisation/ortho_slice_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/visualisation/ortho_slice_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/visualisation/ortho_slice_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | from savu.plugins.plugin_tools import PluginTools
class OrthoSliceTools(PluginTools):
"""A plugin to extract slices in each direction of a 3D reconstructed
volume.
"""
def define_parameters(self):
"""
xy_slices:
visibility: basic
dtype: int
descriptio... | 26.789474 | 73 | 0.533399 |
384602c0a2cc7e70f14702e37faeda3b690e1964 | 351 | py | Python | python/ABC/161/b.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | python/ABC/161/b.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | python/ABC/161/b.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
def main():
N, M = map(int, input().split())
A = list(map(int, input().split()))
sum_A = sum(A)
cnt = 0
for i in range(N):
if A[i] >= sum_A / (4 * M):
cnt += 1
if cnt >= M:
print("Yes")
else:
print("No")
if __na... | 14.625 | 39 | 0.464387 |
38460a5d266be95e6106069129cbac8b6b4d613b | 2,215 | py | Python | aws_xray_sdk/ext/django/conf.py | yoyowallet/aws-xray-sdk-python | e082f8939d972577f62bd16cf83edb92bd3bd4d6 | [
"Apache-2.0"
] | null | null | null | aws_xray_sdk/ext/django/conf.py | yoyowallet/aws-xray-sdk-python | e082f8939d972577f62bd16cf83edb92bd3bd4d6 | [
"Apache-2.0"
] | 2 | 2018-11-07T16:49:02.000Z | 2018-11-12T17:16:32.000Z | aws_xray_sdk/ext/django/conf.py | yoyowallet/aws-xray-sdk-python | e082f8939d972577f62bd16cf83edb92bd3bd4d6 | [
"Apache-2.0"
] | null | null | null | import os
from django.conf import settings as django_settings
from django.test.signals import setting_changed
DEFAULTS = {
'AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1:2000',
'AUTO_INSTRUMENT': True,
'AWS_XRAY_CONTEXT_MISSING': 'RUNTIME_ERROR',
'PLUGINS': (),
'SAMPLING': True,
'SAMPLING_RULES': None,... | 27.345679 | 78 | 0.648758 |
38466f2b198539c6fa24dc3257003be43d4dd157 | 69,005 | py | Python | vistrails/core/modules/basic_modules.py | MaritimeResearchInstituteNetherlands/VisTrails | 9b42ca9b3550b599467b0c7dfa56f57bbd97a4f2 | [
"BSD-3-Clause"
] | 83 | 2015-01-05T14:50:50.000Z | 2021-09-17T19:45:26.000Z | vistrails/core/modules/basic_modules.py | VizierDB/Vistrails | 895f7204fbf56a9cdf3f46afae72969c2fc64a24 | [
"BSD-3-Clause"
] | 254 | 2015-01-02T20:39:19.000Z | 2018-11-28T17:16:44.000Z | vistrails/core/modules/basic_modules.py | VizierDB/Vistrails | 895f7204fbf56a9cdf3f46afae72969c2fc64a24 | [
"BSD-3-Clause"
] | 40 | 2015-04-17T16:46:36.000Z | 2021-09-28T22:43:24.000Z | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | 36.318421 | 94 | 0.536265 |
3846727a6609562d847f7eeeb1afe6b4139f2b8c | 356 | py | Python | core/tests/__init__.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | 1 | 2020-07-18T02:14:51.000Z | 2020-07-18T02:14:51.000Z | core/tests/__init__.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | null | null | null | core/tests/__init__.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | 1 | 2020-02-22T18:21:04.000Z | 2020-02-22T18:21:04.000Z | from core.tests.visits import *
from core.tests.front_desk_events import *
from core.tests.participants import *
from core.tests.users import *
from core.tests.groups import *
from core.tests.services import *
from core.tests.programs import *
from core.tests.queue import *
from core.tests.program_availability import ... | 32.363636 | 46 | 0.800562 |
384677effc16c36d918ad6b2683cc8e3422cd81a | 19,311 | py | Python | falkon/mmv_ops/fmm.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | null | null | null | falkon/mmv_ops/fmm.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | null | null | null | falkon/mmv_ops/fmm.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | null | null | null | from contextlib import ExitStack
from dataclasses import dataclass
from typing import Union, Optional
import torch
import torch.cuda as tcd
import falkon
from falkon.mmv_ops.utils import *
from falkon.options import BaseOptions
from falkon.sparse.sparse_tensor import SparseTensor
from falkon.utils.device_copy import ... | 42.913333 | 108 | 0.546373 |
38468452d466bc2a304edba11cf8aea354c986de | 11,189 | py | Python | lib/python2.7/site-packages/pygments/lexers/_postgres_builtins.py | drpaneas/linuxed.gr | 95676e9f18a234092656c61b73b9e6633f2e39ec | [
"MIT"
] | 1 | 2015-12-31T10:24:25.000Z | 2015-12-31T10:24:25.000Z | lib/python2.7/site-packages/pygments/lexers/_postgres_builtins.py | drpaneas/linuxed.gr | 95676e9f18a234092656c61b73b9e6633f2e39ec | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/pygments/lexers/_postgres_builtins.py | drpaneas/linuxed.gr | 95676e9f18a234092656c61b73b9e6633f2e39ec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pygments.lexers._postgres_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Self-updating data files for PostgreSQL lexer.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Autogenerated: please edit them if you... | 18.017713 | 82 | 0.485477 |
38469b3df6729898c1c3c5a503d824d6b77fe499 | 4,468 | py | Python | utils.py | fedhere/SESNCfAlib | 441b77c168a61d7c8e3cd842fce7f6748c31c896 | [
"MIT"
] | null | null | null | utils.py | fedhere/SESNCfAlib | 441b77c168a61d7c8e3cd842fce7f6748c31c896 | [
"MIT"
] | null | null | null | utils.py | fedhere/SESNCfAlib | 441b77c168a61d7c8e3cd842fce7f6748c31c896 | [
"MIT"
] | null | null | null | import sys,os,glob, inspect
#,re,numpy,math,pyfits,glob,shutil,glob
import optparse
import scipy as sp
import numpy as np
import pprint, pickle
import pylab as pl
from numpy import nanmean,nanmedian,nanstd
LN10x2p5=5.75646273249
def is_empty(any_structure, verbose=False):
if any_structure:
if verbose: prin... | 34.635659 | 112 | 0.501791 |
3846e049ae2ebef750531576a8ee44a25a166d04 | 2,443 | py | Python | testapp/models.py | matheusmatos/django-rest-models | 18da71bd921064279b03129aac38d3fbb9e29ae2 | [
"BSD-2-Clause"
] | 61 | 2016-12-05T09:09:49.000Z | 2022-03-09T13:23:06.000Z | testapp/models.py | matheusmatos/django-rest-models | 18da71bd921064279b03129aac38d3fbb9e29ae2 | [
"BSD-2-Clause"
] | 51 | 2016-12-07T10:19:52.000Z | 2022-03-11T23:35:23.000Z | testapp/models.py | matheusmatos/django-rest-models | 18da71bd921064279b03129aac38d3fbb9e29ae2 | [
"BSD-2-Clause"
] | 18 | 2017-03-11T18:07:17.000Z | 2022-03-09T13:14:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.conf import settings
from django.db import models
from django.db.models import CASCADE
from rest_models.storage import RestApiStorage
if settings.DATABASES['default']['ENGINE'] == 'dja... | 25.989362 | 105 | 0.704052 |
38470136752becd10884528750dce5364d3bcdf2 | 381 | py | Python | src/schemathesis/hooks.py | chr1st1ank/schemathesis | f2e160d56c1fdce9eac7fee5875b209c8944f54a | [
"MIT"
] | 1 | 2020-05-22T19:48:35.000Z | 2020-05-22T19:48:35.000Z | src/enhancedSchemathesis/hooks.py | arvindjangra1996/schemathesis | 2132cd26e057b19f3f7600ccaa6e8a515a194481 | [
"MIT"
] | null | null | null | src/enhancedSchemathesis/hooks.py | arvindjangra1996/schemathesis | 2132cd26e057b19f3f7600ccaa6e8a515a194481 | [
"MIT"
] | null | null | null | from typing import Optional
from .constants import HookLocation
from .types import Hook
GLOBAL_HOOKS = {}
def register(place: str, hook: Hook) -> None:
key = HookLocation[place]
GLOBAL_HOOKS[key] = hook
def get_hook(place: str) -> Optional[Hook]:
key = HookLocation[place]
return GLOBAL_HOOKS.get(k... | 18.142857 | 45 | 0.706037 |
3847037dc4e6dbfccdaa841aea8a26756c461354 | 1,519 | py | Python | web-logs-pkg/weblogs/data/app.py | nishantsethi/web-logs | c83a66902382e35767e71182236aed206fa1a252 | [
"MIT"
] | 8 | 2020-09-23T19:00:32.000Z | 2021-03-15T07:00:03.000Z | web-logs-pkg/weblogs/data/app.py | nishantsethi/web-logs | c83a66902382e35767e71182236aed206fa1a252 | [
"MIT"
] | 9 | 2020-09-17T17:02:51.000Z | 2020-12-28T16:12:18.000Z | web-logs-pkg/weblogs/data/app.py | nishantsethi/web-logs | c83a66902382e35767e71182236aed206fa1a252 | [
"MIT"
] | 1 | 2020-10-06T13:34:04.000Z | 2020-10-06T13:34:04.000Z | from time import sleep
from flask import Flask, render_template, request
from math import sqrt
from pathlib import Path
import json
import os
app = Flask(__name__)
path_json = open("json_path.txt", "r")
json_path = path_json.read()
data_json = json.load(open(json_path))
logs_list = data_json['logs'] #List with ... | 25.316667 | 101 | 0.64187 |
3847314692439b94b23ddde5c73416d93df396fc | 3,043 | py | Python | action/calculate_coordinates.py | akyruu/blender-cartography-addon | 4f34b029d9b6a72619227ab3ceaed9393506934e | [
"Apache-2.0"
] | null | null | null | action/calculate_coordinates.py | akyruu/blender-cartography-addon | 4f34b029d9b6a72619227ab3ceaed9393506934e | [
"Apache-2.0"
] | null | null | null | action/calculate_coordinates.py | akyruu/blender-cartography-addon | 4f34b029d9b6a72619227ab3ceaed9393506934e | [
"Apache-2.0"
] | null | null | null | import logging
import os
import shutil
from pathlib import Path
from mathutils import Vector
import utils
from reading import CartographyCsvReader, CartographyFile, CartographyFileSide, CartographyTsvReader
from writing import CartographyCsvWriter, CartographyTsvWriter
# VARIABLES ===================================... | 33.811111 | 100 | 0.66349 |
38474ed6a2858f7f9982b7f4c72c7bd419412e67 | 2,908 | py | Python | gopatch/patchman/urls.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | 1 | 2020-01-15T11:04:16.000Z | 2020-01-15T11:04:16.000Z | gopatch/patchman/urls.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | 2 | 2021-03-31T19:36:19.000Z | 2021-06-10T22:29:26.000Z | gopatch/patchman/urls.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | null | null | null | # Copyright 2012 VPAC, http://www.vpac.org
# Copyright 2013-2016 Marcus Furlong <furlongm@gmail.com>
#
# This file is part of patchman
#
# Patchman is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 onl... | 42.764706 | 91 | 0.770289 |
384760ecf938440de6d9993eca6eb3cecbedbdbf | 3,353 | py | Python | pyhanko_tests/samples.py | ooguz/pyHanko | f1490d9ecaa74ce600e464a27807290d486acc6f | [
"MIT"
] | null | null | null | pyhanko_tests/samples.py | ooguz/pyHanko | f1490d9ecaa74ce600e464a27807290d486acc6f | [
"MIT"
] | null | null | null | pyhanko_tests/samples.py | ooguz/pyHanko | f1490d9ecaa74ce600e464a27807290d486acc6f | [
"MIT"
] | null | null | null | from pyhanko.pdf_utils.crypt import SimpleEnvelopeKeyDecrypter
def read_all(fname):
with open(fname, 'rb') as f:
return f.read()
CRYPTO_DATA_DIR = 'pyhanko_tests/data/crypto'
TESTING_CA_DIR = CRYPTO_DATA_DIR + '/testing-ca'
ECC_TESTING_CA_DIR = CRYPTO_DATA_DIR + '/testing-ca-ecdsa'
PDF_DATA_DIR = 'pyhan... | 39.447059 | 98 | 0.737847 |
3847c4d78a9e6e0106a0ee264fbf5ebf562fce0c | 4,922 | py | Python | synapse/tests/test_gene.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | null | null | null | synapse/tests/test_gene.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | 4 | 2017-10-03T21:50:40.000Z | 2017-11-20T15:49:38.000Z | synapse/tests/test_gene.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | null | null | null | from synapse.tests.common import *
import synapse.gene as s_gene
class GeneTest(SynTest):
def test_gene_eval(self):
def baz(x):
return x + 20
syms = {'foo:bar': 10, 'foo:baz': baz, 'foo:faz': 'woot'}
self.eq(s_gene.eval('foo:bar & 1', syms=syms), 0)
self.eq(s_gene.e... | 35.157143 | 101 | 0.556887 |
3847c9b81dcfbfc5ca3c7028242526e5509b9242 | 7,041 | py | Python | pylib/flash/cc_rules.py | xkmato/py77 | 9c44d8f8924f47a7331c29fd0287a4bb9416d316 | [
"MIT"
] | null | null | null | pylib/flash/cc_rules.py | xkmato/py77 | 9c44d8f8924f47a7331c29fd0287a4bb9416d316 | [
"MIT"
] | null | null | null | pylib/flash/cc_rules.py | xkmato/py77 | 9c44d8f8924f47a7331c29fd0287a4bb9416d316 | [
"MIT"
] | 2 | 2018-07-16T19:14:11.000Z | 2020-10-15T08:48:32.000Z |
"""Manages different functions related to cc rules parsing."""
__author__ = 'pramodg@room77.com (Pramod Gupta)'
__copyright__ = 'Copyright 2012 Room77, Inc.'
import itertools
import os
import shutil
import time
from pylib.base.term_color import TermColor
from pylib.base.exec_utils import ExecUtils
from pylib.file.f... | 40.234286 | 94 | 0.568953 |
3847cc7c26ab0edd2feff56fbbb46e754641c257 | 2,187 | py | Python | src/utils.py | Pegayus/CoVerD | 725eba82c55ffafa8f3c7b8f46515ac4087f3f24 | [
"Apache-2.0"
] | null | null | null | src/utils.py | Pegayus/CoVerD | 725eba82c55ffafa8f3c7b8f46515ac4087f3f24 | [
"Apache-2.0"
] | null | null | null | src/utils.py | Pegayus/CoVerD | 725eba82c55ffafa8f3c7b8f46515ac4087f3f24 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pickle
def load_ddata(path, num):
"""
Load data for defender.
Input:
- path: path to pickled file
- num: number of (source,target) pairs
Return: graph, target nodes, community assignment, source nodes
"""
with open(path, "rb") as f:
data = pic... | 29.554054 | 73 | 0.616369 |
3848132c4583eeae1c7ba42e7c5ea5bf2e8d898b | 3,789 | py | Python | mws/apis/orders.py | innotrade24/python-amazon-mws1 | 7e387b076bcab489cf024624fefaa0dd3b1bcb2a | [
"Unlicense"
] | 1 | 2018-06-29T06:13:02.000Z | 2018-06-29T06:13:02.000Z | mws/apis/orders.py | innotrade24/python-amazon-mws1 | 7e387b076bcab489cf024624fefaa0dd3b1bcb2a | [
"Unlicense"
] | null | null | null | mws/apis/orders.py | innotrade24/python-amazon-mws1 | 7e387b076bcab489cf024624fefaa0dd3b1bcb2a | [
"Unlicense"
] | null | null | null | """
Amazon Orders API
"""
from __future__ import absolute_import
from ..mws import MWS
from .. import utils
from ..decorators import next_token_action
class Orders(MWS):
"""
Amazon Orders API
Docs:
http://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_Overview.html
"""
URI ... | 34.761468 | 110 | 0.646873 |
384816c03630a34f535f33aa5b77a49d21ad97e2 | 3,128 | py | Python | cbrain/data_generator.py | GunnarBehrens/CBRAIN-CAM | 1b59b5b4731ada7c077c181b543339412d25e5c3 | [
"MIT"
] | 66 | 2018-05-25T18:36:27.000Z | 2022-03-20T15:39:54.000Z | cbrain/data_generator.py | GunnarBehrens/CBRAIN-CAM | 1b59b5b4731ada7c077c181b543339412d25e5c3 | [
"MIT"
] | 17 | 2019-01-08T12:41:47.000Z | 2021-09-05T01:22:04.000Z | cbrain/data_generator.py | GunnarBehrens/CBRAIN-CAM | 1b59b5b4731ada7c077c181b543339412d25e5c3 | [
"MIT"
] | 48 | 2018-04-04T22:42:12.000Z | 2021-03-06T06:21:39.000Z | """
Data generator class.
Created on 2019-01-28-10-39
Author: Stephan Rasp, raspstephan@gmail.com
"""
from .imports import *
from .utils import *
from .normalization import *
class DataGenerator(tf.keras.utils.Sequence):
"""
https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly
Data... | 35.545455 | 98 | 0.661765 |
384825c6f0cad32992b894e1d6a2a99ea731bb4d | 744 | py | Python | tools/reorder_const.py | lalitb/cpp_client_telemetry | 728b656c6cfaca7cc1f2dd418372d210219a49e8 | [
"Apache-2.0"
] | 30 | 2021-01-12T07:42:00.000Z | 2022-03-02T05:18:58.000Z | tools/reorder_const.py | lalitb/cpp_client_telemetry | 728b656c6cfaca7cc1f2dd418372d210219a49e8 | [
"Apache-2.0"
] | 173 | 2021-01-06T22:44:50.000Z | 2022-03-30T11:20:53.000Z | tools/reorder_const.py | lalitb/cpp_client_telemetry | 728b656c6cfaca7cc1f2dd418372d210219a49e8 | [
"Apache-2.0"
] | 29 | 2021-01-25T10:10:16.000Z | 2022-02-21T12:35:16.000Z | import glob
import os.path
import re
for filename in glob.iglob('**/*.[ch]pp', recursive=True):
if not os.path.isfile(filename):
continue
with open(filename, 'r', encoding='utf-8') as f:
content = f.read()
changed = content
for m in re.finditer(r'(\n *|[()[\]<>{},:;][ \n]*|static )cons... | 33.818182 | 126 | 0.521505 |
384869f212b69ec91f681bd7106d35400c686656 | 1,142 | py | Python | LanguageDeck/models/decks.py | zama201bc/LanguageCards | a05da26e80ebd39b18138ac9ccff4094ef6fc1ff | [
"BSD-2-Clause"
] | null | null | null | LanguageDeck/models/decks.py | zama201bc/LanguageCards | a05da26e80ebd39b18138ac9ccff4094ef6fc1ff | [
"BSD-2-Clause"
] | null | null | null | LanguageDeck/models/decks.py | zama201bc/LanguageCards | a05da26e80ebd39b18138ac9ccff4094ef6fc1ff | [
"BSD-2-Clause"
] | null | null | null | import sqlalchemy
import sqlalchemy.orm
from LanguageDeck.models import associations as assoc
from LanguageDeck.models import Base, Cards
import datetime
# Deck object: is a collection of Cards
class Deck(Base):
__tablename__ = "decks"
id = sqlalchemy.Column("id", sqlalchemy.Integer, primary_key=True)
nam... | 51.909091 | 116 | 0.773205 |
3848895faac306de610706ebc64f6fab459e1ad9 | 3,534 | py | Python | baictl/drivers/aws/add_permission_to_aws_auth_configmap.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 6 | 2020-09-29T09:03:04.000Z | 2022-03-14T06:52:25.000Z | baictl/drivers/aws/add_permission_to_aws_auth_configmap.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | null | null | null | baictl/drivers/aws/add_permission_to_aws_auth_configmap.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 4 | 2020-10-01T07:49:22.000Z | 2021-06-16T19:44:12.000Z | """
A script to manipulate the `aws-auth` configmap that is created by EKS.
See the docs for more info: https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html
"""
import sys
import tempfile
from typing import List
import subprocess
from ruamel import yaml
from argparse import ArgumentParser
class AwsA... | 35.69697 | 105 | 0.663554 |
3848aded3f2c6247c5f0e8518e7030cf98596926 | 1,030 | py | Python | 48/save5_passed.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | 48/save5_passed.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | 48/save5_passed.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | import os
import urllib.request
LOG = os.path.join('/tmp', 'safari.logs')
PY_BOOK, OTHER_BOOK = '🐍', '.'
urllib.request.urlretrieve('http://bit.ly/2BLsCYc', LOG)
def create_chart():
with open(LOG) as f:
content = f.readlines()
dates = [line.split()[0] for line in content]
dates = sorted(... | 28.611111 | 60 | 0.571845 |
3848cc75356fb2fc1b2f2261715b8e26c0d32621 | 3,794 | py | Python | draalcore/auth/sites/google_oauth2.py | jojanper/draalcore | 3d3f5a53efe32c721c34d7e48267328a4e9e8402 | [
"MIT"
] | 1 | 2017-04-25T10:54:55.000Z | 2017-04-25T10:54:55.000Z | draalcore/auth/sites/google_oauth2.py | jojanper/draalcore | 3d3f5a53efe32c721c34d7e48267328a4e9e8402 | [
"MIT"
] | 1 | 2022-02-10T06:48:36.000Z | 2022-02-10T06:48:36.000Z | draalcore/auth/sites/google_oauth2.py | jojanper/draalcore | 3d3f5a53efe32c721c34d7e48267328a4e9e8402 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Google OAuth2 interface."""
# System imports
import base64
import httplib2
import logging
from django.conf import settings
from googleapiclient.discovery import build
from oauth2client.contrib import xsrfutil
from oauth2client.client import flow_from_clientsecrets
# Pr... | 37.564356 | 116 | 0.701898 |
3848ef7a5d19d40af89d0502302770e56aed95d4 | 1,133 | py | Python | kb_learning/ac_reps/lstd.py | gregorgebhardt/kb_learning | 41e18c1238e0ea891d48aff63588366dae64e4c8 | [
"BSD-3-Clause"
] | null | null | null | kb_learning/ac_reps/lstd.py | gregorgebhardt/kb_learning | 41e18c1238e0ea891d48aff63588366dae64e4c8 | [
"BSD-3-Clause"
] | null | null | null | kb_learning/ac_reps/lstd.py | gregorgebhardt/kb_learning | 41e18c1238e0ea891d48aff63588366dae64e4c8 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from ..tools import np_chunks
class LeastSquaresTemporalDifference:
def __init__(self):
self.discount_factor = 0.98
self.lstd_regularization_factor = 1e-8
self.lstd_projection_regularization_factor = 1e-6
def learn_q_function(self, phi, phi_next, rewards):
"... | 39.068966 | 108 | 0.664607 |
3848f187eaedf61b2bd585004d5c9e23b0478b9c | 5,073 | py | Python | data/recall.py | BXuan694/SOLO-pytorch | aef0ac47ce6989f6633fe4f71070bd6944c39abb | [
"Apache-2.0"
] | 2 | 2022-03-19T12:58:58.000Z | 2022-03-19T15:01:02.000Z | data/recall.py | BXuan694/SOLO-pytorch | aef0ac47ce6989f6633fe4f71070bd6944c39abb | [
"Apache-2.0"
] | 1 | 2022-03-19T15:06:25.000Z | 2022-03-23T01:48:58.000Z | data/recall.py | BXuan694/SOLO-pytorch | aef0ac47ce6989f6633fe4f71070bd6944c39abb | [
"Apache-2.0"
] | null | null | null | import numpy as np
from terminaltables import AsciiTable
def bbox_overlaps(bboxes1, bboxes2, mode='iou'):
"""Calculate the ious between each bbox of bboxes1 and bboxes2.
Args:
bboxes1(ndarray): shape (n, 4)
bboxes2(ndarray): shape (k, 4)
mode(str): iou (intersection over union) or iof ... | 33.596026 | 78 | 0.586832 |
38491207e7d4a6212db92a721cc2b41be8e6a48d | 1,136 | py | Python | splitaudio.py | myl989/tscb | 80b36db79b7aba12d0415427d07689c267404691 | [
"BSD-2-Clause"
] | 1 | 2020-12-27T23:01:36.000Z | 2020-12-27T23:01:36.000Z | splitaudio.py | myl989/tscb | 80b36db79b7aba12d0415427d07689c267404691 | [
"BSD-2-Clause"
] | null | null | null | splitaudio.py | myl989/tscb | 80b36db79b7aba12d0415427d07689c267404691 | [
"BSD-2-Clause"
] | null | null | null | from pydub import AudioSegment
import math
class SplitWavAudio():
def __init__(self, folder, filename):
self.folder = folder
self.filename = filename
self.filepath = folder + '/' + filename
self.audio = AudioSegment.from_wav(self.filepath)
def get_duration(self):
... | 36.645161 | 76 | 0.598592 |
384929f689811ded188385ec8615fe7746d289d6 | 451 | py | Python | redes neuronales/A.py | AntiDesert5/Ingenieria-en-Computacion-UAEM | 02b5713ccd3752566d50d0d16fc7719a00d382f4 | [
"MIT"
] | 1 | 2021-08-16T19:44:08.000Z | 2021-08-16T19:44:08.000Z | redes neuronales/A.py | AntiDesert5/Ingenieria-en-Computacion-UAEM | 02b5713ccd3752566d50d0d16fc7719a00d382f4 | [
"MIT"
] | null | null | null | redes neuronales/A.py | AntiDesert5/Ingenieria-en-Computacion-UAEM | 02b5713ccd3752566d50d0d16fc7719a00d382f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 25 19:23:48 2019
@author: Valenzuela
"""
import numpy as np
import matplotlib.pyplot as plt
B = 10 * np.random.random((10, 2))
pr = 10 * np.random.random((1, 1))
l = np.sqrt(np.sum(np.power(np.subtract(B, pr), 2.0), axis=1))
indexmin = np.argmin(l)
distmin = l[indexmi... | 18.04 | 62 | 0.629712 |
38493317fd440bf17969d735669558ab35587522 | 26,391 | py | Python | ThirdParty/Twisted/twisted/conch/test/test_filetransfer.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 7 | 2015-04-28T13:26:11.000Z | 2020-02-09T17:01:04.000Z | ThirdParty/Twisted/twisted/conch/test/test_filetransfer.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | null | null | null | ThirdParty/Twisted/twisted/conch/test/test_filetransfer.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 5 | 2015-10-09T04:12:29.000Z | 2021-12-15T16:57:11.000Z | # -*- test-case-name: twisted.conch.test.test_filetransfer -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE file for details.
import os
import re
import struct
import sys
from twisted.trial import unittest
try:
from twisted.conch import unix
unix # shut up pyflakes
except ImportError:... | 34.453003 | 97 | 0.591603 |
384939dd082c81758e4d210c166eda0b1c0d1a26 | 5,310 | py | Python | ads/__init__.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | 20 | 2022-02-22T19:07:09.000Z | 2022-03-16T17:21:42.000Z | ads/__init__.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | ads/__init__.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*--
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
from __future__ import print_function, division, absolute_import
import os
import logging
import sys
import ... | 27.230769 | 111 | 0.706968 |
38494d73d6907b65c0d8a7f21ac061802bf89b26 | 5,481 | py | Python | wfcli/wfapi.py | dariosky/wfcli | 87a9ed30dbd456f801135a55099f0541b0614ccb | [
"MIT"
] | 1 | 2017-10-09T05:59:27.000Z | 2017-10-09T05:59:27.000Z | wfcli/wfapi.py | dariosky/wfcli | 87a9ed30dbd456f801135a55099f0541b0614ccb | [
"MIT"
] | 1 | 2017-09-28T01:22:50.000Z | 2018-02-26T20:21:45.000Z | wfcli/wfapi.py | dariosky/wfcli | 87a9ed30dbd456f801135a55099f0541b0614ccb | [
"MIT"
] | null | null | null | import logging
import os
import xmlrpc.client
logger = logging.getLogger('webfaction.api')
class WebFactionAPI:
def __init__(self,
machine_name=None, # not required if you have only one machine
username=None, password=None,
):
super().__init__()
... | 35.134615 | 99 | 0.54844 |
38495638cac8d619d9ad7a924da5e839ccdf6962 | 22,493 | py | Python | plastering/inferencers/relational_inference/Data.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | plastering/inferencers/relational_inference/Data.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | plastering/inferencers/relational_inference/Data.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | import pandas as pd
import random
import os
import numpy as np
from plastering.inferencers.relational_inference.util import logging, logging_result
# Data
def set_up_logging(config, args):
if not os.path.exists(config.log):
os.mkdir(config.log)
if args.log == '':
log_path = config.log + 'no_n... | 34.235921 | 119 | 0.54288 |
3849b2f00f4f45e7e09fcf69a7c8a87da06b9980 | 635 | py | Python | runme.py | kais-siala/rmnd-lca | db00e65e520b59e7e85268cbefb5fef593139715 | [
"BSD-3-Clause"
] | null | null | null | runme.py | kais-siala/rmnd-lca | db00e65e520b59e7e85268cbefb5fef593139715 | [
"BSD-3-Clause"
] | null | null | null | runme.py | kais-siala/rmnd-lca | db00e65e520b59e7e85268cbefb5fef593139715 | [
"BSD-3-Clause"
] | null | null | null | import brightway2 as bw
from premise import *
# Call brightway2
bw.projects.set_current('H2')
print("Existing databases in the project:")
print(bw.databases)
# Extract the ecoinvent database, clean it, add additional inventories
ndb = NewDatabase(scenario = 'SSP2-Base',
year = 2030,
source_db = 'e... | 24.423077 | 91 | 0.716535 |
3849ccafecab533857e9565a747a015b1e67220d | 11,968 | py | Python | tgas_blender_ortho.py | kevinjardine/gaia-tgas | 58cec102b25c1a3e5ff12e82577e5c5c7e2a2c48 | [
"Unlicense"
] | null | null | null | tgas_blender_ortho.py | kevinjardine/gaia-tgas | 58cec102b25c1a3e5ff12e82577e5c5c7e2a2c48 | [
"Unlicense"
] | null | null | null | tgas_blender_ortho.py | kevinjardine/gaia-tgas | 58cec102b25c1a3e5ff12e82577e5c5c7e2a2c48 | [
"Unlicense"
] | null | null | null | import bpy
from math import pi, radians
from mathutils import Vector
import sys
import os
#config
rootDir = 'd:/projects/astronomy/tgas/'
convertPath = '"c:/Program Files/ImageMagick-6.9.6-Q16/convert.exe"'
#code
def create_light(id,location,angle):
"""
Add a mesh light for cycles
"""
# Add new pla... | 68.781609 | 6,260 | 0.729529 |
3849d2c78f2461368c2c9b61bea57ee3792cb58d | 2,762 | py | Python | salt/states/influxdb_database.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 2 | 2017-09-17T21:10:35.000Z | 2019-08-26T03:00:12.000Z | salt/states/influxdb_database.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/states/influxdb_database.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 3 | 2021-02-23T08:12:48.000Z | 2021-02-23T08:13:13.000Z | # -*- coding: utf-8 -*-
'''
Management of InfluxDB databases
================================
(compatible with InfluxDB version 0.5+)
.. versionadded:: Helium
'''
def present(name, user=None, password=None, host=None, port=None):
'''
Ensure that the named database is present
name
The name of t... | 26.304762 | 79 | 0.55105 |
384a0d70f8747bfebd1a6a35cc3a52b41ed1b140 | 1,755 | py | Python | wmi_check/tests/test_wmi_check.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 4 | 2021-06-21T19:21:49.000Z | 2021-06-23T21:21:55.000Z | wmi_check/tests/test_wmi_check.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 33 | 2020-02-05T16:18:32.000Z | 2022-03-21T14:08:04.000Z | wmi_check/tests/test_wmi_check.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 7 | 2020-03-10T13:21:39.000Z | 2021-03-11T07:16:44.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import copy
import logging
from . import common
log = logging.getLogger(__file__)
def test_basic_check(mock_proc_sampler, aggregator, check):
instance = copy.deepcopy(common.INSTANCE)
instance['tags'] = ["o... | 27.421875 | 90 | 0.725926 |
384a2dbd6a6e226b4742ac814e606798673495a6 | 9,435 | py | Python | top_module.py | rubenheyrman/zigzag | 1dc6a8b12951aac5936fa164e707c0c7ae94a412 | [
"BSD-3-Clause"
] | 34 | 2020-08-11T14:38:29.000Z | 2022-03-30T10:32:34.000Z | top_module.py | rubenheyrman/zigzag | 1dc6a8b12951aac5936fa164e707c0c7ae94a412 | [
"BSD-3-Clause"
] | 9 | 2020-11-16T19:19:48.000Z | 2022-03-31T18:29:24.000Z | top_module.py | rubenheyrman/zigzag | 1dc6a8b12951aac5936fa164e707c0c7ae94a412 | [
"BSD-3-Clause"
] | 18 | 2020-08-24T07:26:51.000Z | 2022-01-06T00:59:11.000Z | import output_funcs as of
import classes as cls
import importlib.machinery
from copy import deepcopy
import sys
import msg
from msg import mem_scheme_fit_check
import argparse
import input_funcs
import time
from multiprocessing import Process, Value, Manager
from datetime import datetime
import evaluate
from classes.mu... | 54.224138 | 125 | 0.622893 |
384aaa839bacae7ad07341b1ed1c53574be2462c | 1,716 | py | Python | alipay/aop/api/response/MybankCreditLoantradePayerBillrepayConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/MybankCreditLoantradePayerBillrepayConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/MybankCreditLoantradePayerBillrepayConsultResponse.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.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.CreditPayBillDetailVO import CreditPayBillDetailVO
class MybankCreditLoantradePayerBillrepayConsultResponse(AlipayResponse):
def __init__(self):
super(My... | 32.377358 | 123 | 0.674825 |
384ab862fff7413055226322bfa781ea95b893dc | 498 | py | Python | filter_overlapping_results.py | RSLancs/Extracting_plant_names_and_collocates_from_historical_texts | c8d6746978786ca4b83dc550114700530077c543 | [
"Apache-2.0"
] | null | null | null | filter_overlapping_results.py | RSLancs/Extracting_plant_names_and_collocates_from_historical_texts | c8d6746978786ca4b83dc550114700530077c543 | [
"Apache-2.0"
] | null | null | null | filter_overlapping_results.py | RSLancs/Extracting_plant_names_and_collocates_from_historical_texts | c8d6746978786ca4b83dc550114700530077c543 | [
"Apache-2.0"
] | null | null | null | ##Python27
from pprint import pprint
import pandas as pd
df2 = pd.read_csv('./data/raw_collocate_results_15.01.19.csv')
#pprint(df2[0:4])
# remove loverlapping location matches - keep longest match
my_df2 = df2.groupby('index', as_index=False).apply(lambda x: x[x.spc_acc.str.len() == x.spc_acc.str.len... | 29.294118 | 115 | 0.722892 |
384abb92986aa2e8a46bd7374f8bddfcf767bd46 | 4,858 | py | Python | kitsu/client.py | MrArkon/kitsu.py | 06435f83c72f5256c3c9bc82c8622f3eafac0e8d | [
"MIT"
] | 7 | 2021-09-05T06:13:04.000Z | 2022-01-06T10:47:40.000Z | kitsu/client.py | MrArkon/kitsu.py | 06435f83c72f5256c3c9bc82c8622f3eafac0e8d | [
"MIT"
] | null | null | null | kitsu/client.py | MrArkon/kitsu.py | 06435f83c72f5256c3c9bc82c8622f3eafac0e8d | [
"MIT"
] | 1 | 2021-12-05T13:27:56.000Z | 2021-12-05T13:27:56.000Z | """
MIT License
Copyright (c) 2021-present MrArkon
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, publis... | 34.94964 | 110 | 0.632771 |
384abc5ac24bdcba0bec012cc2e4161567678280 | 2,741 | py | Python | antarest/study/storage/rawstudy/model/filesystem/root/input/input.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 2 | 2020-09-30T11:40:22.000Z | 2020-11-09T09:06:30.000Z | antarest/study/storage/rawstudy/model/filesystem/root/input/input.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 542 | 2021-01-11T13:23:47.000Z | 2022-03-31T15:38:10.000Z | antarest/study/storage/rawstudy/model/filesystem/root/input/input.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 1 | 2020-10-01T12:18:15.000Z | 2020-10-01T12:18:15.000Z | from antarest.study.storage.rawstudy.model.filesystem.config.model import (
FileStudyTreeConfig,
)
from antarest.study.storage.rawstudy.model.filesystem.folder_node import (
FolderNode,
)
from antarest.study.storage.rawstudy.model.filesystem.inode import TREE
from antarest.study.storage.rawstudy.model.filesyste... | 38.069444 | 110 | 0.693543 |
384ac50c44c4613dee7bd9be2525cb01556f6251 | 4,911 | py | Python | openstack_notifiler/event.py | armstrong-liu/eayunstack-notifier | fc4867593da8bfe210ad39de6fab0c914e1c22d5 | [
"Apache-2.0"
] | null | null | null | openstack_notifiler/event.py | armstrong-liu/eayunstack-notifier | fc4867593da8bfe210ad39de6fab0c914e1c22d5 | [
"Apache-2.0"
] | null | null | null | openstack_notifiler/event.py | armstrong-liu/eayunstack-notifier | fc4867593da8bfe210ad39de6fab0c914e1c22d5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import fnmatch
import logging
import yaml
import jsonpath_rw
from openstack_notifier.config import CONF
from openstack_notifier.common.log import logger
logger.setLevel(logging.INFO)
FILE_PATH = CONF.get('event', 'definitions_cfg_file')
def setup_events():
if FILE_PATH is n... | 34.104167 | 75 | 0.577479 |
384ad70cdb5e610704a6cd9d582faabc8b852ca8 | 367 | py | Python | catalyst/dl/callbacks/metrics/__init__.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 2 | 2021-02-22T12:15:41.000Z | 2021-05-02T15:22:24.000Z | catalyst/dl/callbacks/metrics/__init__.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/dl/callbacks/metrics/__init__.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 1 | 2018-12-21T15:56:21.000Z | 2018-12-21T15:56:21.000Z | # flake8: noqa
from .accuracy import AccuracyCallback, MapKCallback
from .auc import AUCCallback
from .dice import DiceCallback, MulticlassDiceMetricCallback
from .f1_score import F1ScoreCallback
from .iou import (
ClasswiseIouCallback,
ClasswiseJaccardCallback,
IouCallback,
JaccardCallback,
)
from .pp... | 26.214286 | 60 | 0.817439 |
384adea12d1d1d81e89ea81e7616aaf19f4d5c60 | 5,063 | py | Python | safeopt/tests/test_gps.py | adrianpaeckel/SafeOpt | a6d5057f671f3c49f7d3fccd2ff69a3fa7598bd6 | [
"MIT"
] | 107 | 2015-09-04T15:12:14.000Z | 2022-03-18T09:03:55.000Z | gosafeopt/tests/test_gps.py | Data-Science-in-Mechanical-Engineering/Contextual-GoSafe | c7d05a866cec0993609838ac2c5adc14ac3754ab | [
"MIT"
] | 5 | 2019-12-25T02:48:51.000Z | 2021-11-26T10:52:44.000Z | gosafeopt/tests/test_gps.py | Data-Science-in-Mechanical-Engineering/Contextual-GoSafe | c7d05a866cec0993609838ac2c5adc14ac3754ab | [
"MIT"
] | 48 | 2015-09-04T00:08:01.000Z | 2022-01-24T14:15:23.000Z | from __future__ import division
import mock
import pytest
import numpy as np
import GPy
from numpy.testing import assert_allclose
from safeopt.gp_opt import GaussianProcessOptimization
class TestGPOptimization(object):
@pytest.fixture
def gps(self):
kernel1 = GPy.kern.RBF(1, variance=2)
k... | 35.405594 | 77 | 0.458621 |
384ae2ee16b29673b33fb0a7d222e6ec99d9aeb9 | 810 | py | Python | Lib/site-packages/wx-3.0-msw/wx/py/PyFilling.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 5 | 2019-03-11T14:30:31.000Z | 2021-12-04T14:11:54.000Z | Lib/site-packages/wx-3.0-msw/wx/py/PyFilling.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | Lib/site-packages/wx-3.0-msw/wx/py/PyFilling.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | #!/usr/bin/env python
"""PyFilling is a python namespace inspection application."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id$"
__revision__ = "$Revision$"[11:-2]
# We use this object to get more introspection when run standalone.
app = None
import filling
# These are imported just to... | 21.891892 | 67 | 0.706173 |
384b4ec84fddb1a96d6b52efcc7924d45d28cba3 | 51 | py | Python | pyramid_apispec/__init__.py | jellonek/pyramid_apispec | eca5f716c38473564fbd199a6ad3dbec9900a88a | [
"BSD-3-Clause"
] | null | null | null | pyramid_apispec/__init__.py | jellonek/pyramid_apispec | eca5f716c38473564fbd199a6ad3dbec9900a88a | [
"BSD-3-Clause"
] | null | null | null | pyramid_apispec/__init__.py | jellonek/pyramid_apispec | eca5f716c38473564fbd199a6ad3dbec9900a88a | [
"BSD-3-Clause"
] | null | null | null | __version__ = {"major": 0, "minor": 1, "patch": 2}
| 25.5 | 50 | 0.568627 |
384b5f3cf9f41630ad11889d678f7223cb851b75 | 126 | py | Python | terrascript/data/mumoshu/eksctl.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/data/mumoshu/eksctl.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/data/mumoshu/eksctl.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/data/mumoshu/eksctl.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:15:43 UTC)
__all__ = []
| 21 | 73 | 0.746032 |
384bc3d074ffc1423dc6a803efa3e91693f7a417 | 4,293 | py | Python | homeassistant/components/sense/binary_sensor.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 1 | 2021-09-29T20:33:32.000Z | 2021-09-29T20:33:32.000Z | homeassistant/components/sense/binary_sensor.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:31:36.000Z | 2022-03-12T01:00:03.000Z | homeassistant/components/sense/binary_sensor.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Support for monitoring a Sense energy sensor device."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.const import ATTR_ATTRIBUTION, DEVICE_CLASS_POWER
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_conn... | 30.884892 | 87 | 0.667831 |
384bc969d3e81009da71d0324cc037b956d2a86e | 4,256 | py | Python | karapace/config.py | pgsql-io/karapace | e12d7c6b69d76f2aa8d3e39f6bc5447cdbb612cf | [
"Apache-2.0"
] | null | null | null | karapace/config.py | pgsql-io/karapace | e12d7c6b69d76f2aa8d3e39f6bc5447cdbb612cf | [
"Apache-2.0"
] | null | null | null | karapace/config.py | pgsql-io/karapace | e12d7c6b69d76f2aa8d3e39f6bc5447cdbb612cf | [
"Apache-2.0"
] | null | null | null | """
karapace - configuration validation
Copyright (c) 2019 Aiven Ltd
See LICENSE for details
"""
from pathlib import Path
from typing import Dict, IO, List, Union
import json
import os
import socket
import ssl
Config = Dict[str, Union[str, int, bool, List[str]]]
DEFAULTS = {
"advertised_hostname": socket.gethos... | 33.25 | 111 | 0.676927 |
384bd2e83a6f38f3285de05b3e70b7aa05f6b66a | 2,973 | py | Python | homeassistant/components/ads/light.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/ads/light.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | homeassistant/components/ads/light.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Support for ADS light sources."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
Light,
)
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import (
C... | 30.649485 | 85 | 0.683821 |
384bd373c13ad96e53ac4553033fcc6873975369 | 902 | py | Python | clients/client/python/test/test_inline_response503.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_inline_response503.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_inline_response503.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.71
Contact: support@ory.sh
Generated by: htt... | 24.378378 | 194 | 0.7051 |
384bd952f55b72ea8bd11f4133dea433f3c826b3 | 1,446 | py | Python | leetcode_python/Dynamic_Programming/delete-and-earn.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Dynamic_Programming/delete-and-earn.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Dynamic_Programming/delete-and-earn.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V1
# http://bookshadow.com/weblog/2017/12/03/leetcode-delete-and-earn/
import collections
class Solution(object):
def deleteAndEarn(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
cnt = collections.Counter(nums)
maxn = max(nums + [0])
dp = [0] *... | 26.777778 | 78 | 0.511065 |
384bfa1920aa3ba76f0397fb3719969a9319c3a6 | 5,397 | py | Python | asynq/generator.py | JelleZijlstra/asynq | e69469b7c3af62439c82434202a349c43da4159d | [
"Apache-2.0"
] | null | null | null | asynq/generator.py | JelleZijlstra/asynq | e69469b7c3af62439c82434202a349c43da4159d | [
"Apache-2.0"
] | null | null | null | asynq/generator.py | JelleZijlstra/asynq | e69469b7c3af62439c82434202a349c43da4159d | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Quora, 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 writing, so... | 31.561404 | 100 | 0.647211 |
384c48d7a56023d81385307f896efe85ce14b8f6 | 3,128 | py | Python | premade_modules/2.79/2.79/bpy/path.py | echantry/fake-bpy-module | 004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7 | [
"MIT"
] | null | null | null | premade_modules/2.79/2.79/bpy/path.py | echantry/fake-bpy-module | 004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7 | [
"MIT"
] | null | null | null | premade_modules/2.79/2.79/bpy/path.py | echantry/fake-bpy-module | 004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7 | [
"MIT"
] | null | null | null | def abspath(path, start=None, library=None):
'''Returns the absolute path relative to the current blend file using the “//” prefix.
:param start: Relative to this path, when not set the current filename is used.
:type start: string or bytes
:param library: The library this path is from. This is only ... | 26.735043 | 221 | 0.689578 |
384c72d0c989355efaf624869de43fcc6acf2b51 | 770 | py | Python | tests/test_trends.py | TheSnoozer/LiuAlgoTrader | 5ad4e46db126698399d338c4488aa4983385c2d8 | [
"MIT"
] | 1 | 2020-12-01T02:39:52.000Z | 2020-12-01T02:39:52.000Z | tests/test_trends.py | ajmal017/LiuAlgoTrader | 85924391c139fdca84d6bd98494385405d3b799f | [
"MIT"
] | null | null | null | tests/test_trends.py | ajmal017/LiuAlgoTrader | 85924391c139fdca84d6bd98494385405d3b799f | [
"MIT"
] | null | null | null | from datetime import datetime
import hypothesis.strategies as st
import pandas as pd
import pytz
from hypothesis import given, settings
from hypothesis.extra.pandas import indexes, series
from liualgotrader.fincalcs.trends import SeriesTrendType, get_series_trend
@settings(max_examples=200)
@given(
series(
... | 24.0625 | 78 | 0.649351 |
384c79a3bc0eb74936ee1217ff39a382c73b0a34 | 12,632 | py | Python | rptools/rpreport/rp_report.py | niraito/rptools | 5c631c6cc4cd8cb497ccf573891235b36dfde65f | [
"MIT"
] | 4 | 2021-01-14T14:52:55.000Z | 2022-01-28T09:31:59.000Z | rptools/rpreport/rp_report.py | niraito/rptools | 5c631c6cc4cd8cb497ccf573891235b36dfde65f | [
"MIT"
] | 5 | 2021-01-18T09:24:48.000Z | 2021-12-17T06:47:07.000Z | rptools/rpreport/rp_report.py | niraito/rptools | 5c631c6cc4cd8cb497ccf573891235b36dfde65f | [
"MIT"
] | 2 | 2021-09-14T07:02:20.000Z | 2022-01-31T16:59:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""rp_report.py: Parse SBML files and generate a web page with relevant pathways data."""
__author__ = 'Olivier TELLE - INRAE'
__license__ = 'MIT'
import os
import sys
import json
import logging
import tarfile
import tempfile
import fnmatch
from shutil import copyfile
fr... | 41.14658 | 132 | 0.612255 |
384c85e61f5bdfe5c4be14f5eb3741b211343e01 | 10,070 | py | Python | JSS - Data Analysis/Threats.py | easy-software-ufal/exceptionhunter | e75bac00e45017e0c00c552bef100a93402a957a | [
"Apache-2.0"
] | null | null | null | JSS - Data Analysis/Threats.py | easy-software-ufal/exceptionhunter | e75bac00e45017e0c00c552bef100a93402a957a | [
"Apache-2.0"
] | null | null | null | JSS - Data Analysis/Threats.py | easy-software-ufal/exceptionhunter | e75bac00e45017e0c00c552bef100a93402a957a | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import pandas as pd
from matplotlib.ticker import (MultipleLocator)
from pymongo import MongoClient
from main import Util
SHOW_FIGURE = False
df_T = ""
RQ_NUMBER = "threats"
OUTPUT_PATH = "RQS/" + RQ_NUMB... | 41.61157 | 228 | 0.678153 |
384ca713130c7fbd5119608781a3642622d17349 | 6,899 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_daemon_set_condition.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_daemon_set_condition.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_daemon_set_condition.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1bet... | 30.126638 | 124 | 0.604001 |
384cdca73ad3d3419b20f7104420fef28afdeef0 | 1,565 | py | Python | hw_asr/model/baseline_model.py | no-brainer/asr-homework | 5fafd51ea2ca90da54dad335dd8fd3c44f6f97b5 | [
"MIT"
] | null | null | null | hw_asr/model/baseline_model.py | no-brainer/asr-homework | 5fafd51ea2ca90da54dad335dd8fd3c44f6f97b5 | [
"MIT"
] | null | null | null | hw_asr/model/baseline_model.py | no-brainer/asr-homework | 5fafd51ea2ca90da54dad335dd8fd3c44f6f97b5 | [
"MIT"
] | null | null | null | from torch import nn
from torch.nn import Sequential
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from hw_asr.base import BaseModel
class BaselineModel(BaseModel):
def __init__(self, n_feats, n_class, rnn_dim, rnn_layers, hidden_dim, hidden_layers, *args, **kwargs):
super().__... | 35.568182 | 106 | 0.646645 |
384d57966db2435066853f2fd395f17d58939ffa | 841 | py | Python | NintbotForDiscord/Permissions/__init__.py | nint8835/NintbotForDiscordV2 | 65f6aa896c116fd3b554b7b324734caf54ad608e | [
"MIT"
] | null | null | null | NintbotForDiscord/Permissions/__init__.py | nint8835/NintbotForDiscordV2 | 65f6aa896c116fd3b554b7b324734caf54ad608e | [
"MIT"
] | null | null | null | NintbotForDiscord/Permissions/__init__.py | nint8835/NintbotForDiscordV2 | 65f6aa896c116fd3b554b7b324734caf54ad608e | [
"MIT"
] | null | null | null | from typing import List
import discord
class Permission(object):
# noinspection PyMethodMayBeStatic
def has_permission(self, user: discord.User, channel: discord.Channel):
return True
class PermissionGroup(Permission):
def __init__(self, *args: List[Permission]):
self.permissions = arg... | 27.129032 | 87 | 0.736029 |
384da36652af35967b753216d331c5202c2f8af0 | 16,454 | py | Python | tempest/scenario/midokura/manager.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/scenario/midokura/manager.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/scenario/midokura/manager.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Midokura SARL.
# 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 b... | 40.527094 | 79 | 0.557251 |
384df8c1e6340418c5f873ab33995debca307a8f | 5,336 | py | Python | python_ws/her/testo.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | 2 | 2019-02-28T01:47:23.000Z | 2021-04-10T14:37:46.000Z | python_ws/her/testo.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | null | null | null | python_ws/her/testo.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_srvs.srv import Empty
from gazebo_msgs.msg import ODEPhysics
from gazebo_msgs.srv import SetPhysicsProperties, SetPhysicsPropertiesRequest
from std_msgs.msg import Float64
from geometry_msgs.msg import Vector3
class GazeboConnection():
def __init__(self, start_init_ph... | 36.547945 | 115 | 0.672414 |
384e1eb71a1237629dc228a2206d03793a6a85e9 | 791 | py | Python | ecreceive_start.py | metno/ecmwf-dissemination | cd1c4861afc3c2a5e6403593d4cf80dc7aa60b63 | [
"Apache-2.0"
] | null | null | null | ecreceive_start.py | metno/ecmwf-dissemination | cd1c4861afc3c2a5e6403593d4cf80dc7aa60b63 | [
"Apache-2.0"
] | null | null | null | ecreceive_start.py | metno/ecmwf-dissemination | cd1c4861afc3c2a5e6403593d4cf80dc7aa60b63 | [
"Apache-2.0"
] | 1 | 2018-03-07T12:33:07.000Z | 2018-03-07T12:33:07.000Z | #!/usr/bin/env python3
"""
ecreceive start script
=======================
Copyright 2021 MET Norway
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
Unle... | 27.275862 | 72 | 0.738306 |
384e34b2f02c5fc5a7c569f5405fe17a4ec824ad | 993 | py | Python | users/signals.py | ntoll/facebaaak | 9a1a555f36bfa358d83ceebfd10da8e0146f3f2f | [
"MIT"
] | null | null | null | users/signals.py | ntoll/facebaaak | 9a1a555f36bfa358d83ceebfd10da8e0146f3f2f | [
"MIT"
] | null | null | null | users/signals.py | ntoll/facebaaak | 9a1a555f36bfa358d83ceebfd10da8e0146f3f2f | [
"MIT"
] | null | null | null | from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from .models import Profile
@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
"""
Handles t... | 29.205882 | 76 | 0.721047 |
384e5a34152cf5a5e70d10a1f400f0b843fa599f | 276 | py | Python | lang/python/testFileLock.py | liuyang1/test | a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417 | [
"MIT"
] | 8 | 2015-06-07T13:25:48.000Z | 2022-03-22T23:14:50.000Z | lang/python/testFileLock.py | liuyang1/test | a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417 | [
"MIT"
] | 30 | 2016-01-29T01:36:41.000Z | 2018-09-19T07:01:22.000Z | lang/python/testFileLock.py | liuyang1/test | a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417 | [
"MIT"
] | null | null | null | #! /bin/python
import fcntl
import time
filename='test.txt'
fp = open(filename,'w')
print 'open %s write mode'%(filename)
fcntl.flock(fp,fcntl.LOCK_EX) ##阻塞执行,也就是如果该文件被锁定,则程序阻塞在此
print 'file %s locking...'%(filename)
time.sleep(20)
fcntl.flock(fp,fcntl.LOCK_UN)
fp.close()
| 19.714286 | 56 | 0.724638 |
384e86229bb886bd2bd85c134703c9661c7966e5 | 7,874 | py | Python | google/cloud/pubsublite_v1/services/cursor_service/transports/base.py | LaudateCorpus1/python-pubsublite | f0d65ca7b1efec9eae2dda1481c4bfe978eaa2dd | [
"Apache-2.0"
] | null | null | null | google/cloud/pubsublite_v1/services/cursor_service/transports/base.py | LaudateCorpus1/python-pubsublite | f0d65ca7b1efec9eae2dda1481c4bfe978eaa2dd | [
"Apache-2.0"
] | null | null | null | google/cloud/pubsublite_v1/services/cursor_service/transports/base.py | LaudateCorpus1/python-pubsublite | f0d65ca7b1efec9eae2dda1481c4bfe978eaa2dd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 37.495238 | 101 | 0.618364 |
384e94c4bd737092b2cfb53ed482cdbbd8923ec8 | 586 | py | Python | preprocess/rgb2gray.py | m4ln/image_processing_scripts | 3274e01869be9c7a845a4bb76aa02b3cf0023b50 | [
"BSD-3-Clause"
] | null | null | null | preprocess/rgb2gray.py | m4ln/image_processing_scripts | 3274e01869be9c7a845a4bb76aa02b3cf0023b50 | [
"BSD-3-Clause"
] | null | null | null | preprocess/rgb2gray.py | m4ln/image_processing_scripts | 3274e01869be9c7a845a4bb76aa02b3cf0023b50 | [
"BSD-3-Clause"
] | null | null | null | import cv2
import config
def rgb2gray(path_to_image):
"""
converts rgb to grayscale image
Args:
path_to_image: path to rgb image to be converted to grayscale
Returns:
grayscale image
"""
img_rgb = cv2.imread(path_to_image)
r, g, b = img_rgb[:, :, 0], img_rgb[:, :, 1], i... | 18.903226 | 69 | 0.612628 |
384ea9e6ac1a2cf87a35beabbd085d6f4d609f06 | 3,841 | py | Python | services/traction/api/db/repositories/present_credentials.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 12 | 2022-01-29T20:30:03.000Z | 2022-03-29T11:46:14.000Z | services/traction/api/db/repositories/present_credentials.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 38 | 2021-11-22T17:52:50.000Z | 2022-03-31T17:52:00.000Z | services/traction/api/db/repositories/present_credentials.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 9 | 2021-11-22T18:05:48.000Z | 2022-03-29T11:25:08.000Z | from typing import List, Type
from uuid import UUID
from pydantic import parse_obj_as
from sqlalchemy import select
from api.db.errors import DoesNotExist
from api.db.models.present_credential import (
PresentCredentialCreate,
PresentCredentialUpdate,
PresentCredentialRead,
PresentCredential,
)
from ap... | 33.692982 | 85 | 0.635251 |
384eb89306656ca22174491dde2b11cd048c837d | 6,633 | py | Python | saf/linear/henrickapproximator.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | saf/linear/henrickapproximator.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | saf/linear/henrickapproximator.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | import logging
import numpy as np
from .fluxapproximatorlf import FluxApproximatorLF
from .fluxapproximatorllf import FluxApproximatorLLF
from .nearshockapproximator import (NearShockApproximator,
NearShockFifthOrderApproximator)
from .upwind5 import Upwind5
try:
# Try to use ... | 36.048913 | 81 | 0.608774 |
384eba20f1a49fd565b51657329437144ae33a66 | 4,883 | py | Python | conv/kernels.py | kekeblom/sghmc_dgp | 19c5850516121a826c0f3c8a009a250889ff0ba0 | [
"MIT"
] | null | null | null | conv/kernels.py | kekeblom/sghmc_dgp | 19c5850516121a826c0f3c8a009a250889ff0ba0 | [
"MIT"
] | null | null | null | conv/kernels.py | kekeblom/sghmc_dgp | 19c5850516121a826c0f3c8a009a250889ff0ba0 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from sklearn import cluster
float_type = tf.float64
class AdditivePatchKernel(object):
"""This conv kernel sums over each patch assuming the output is produced independently from each patch.
K(x, x') = \sum_{i} w_i k(x[i], x'[i])
"""
def __init__(self, ba... | 37.852713 | 107 | 0.63506 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.