hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
775865625a49195ef2ad910de91bcf02170a00c3 | 22,678 | py | Python | models/common/distributed_executor.py | skydooms/tpu | 4553e1ed26763769768b9ba6744431908f7e37c0 | [
"Apache-2.0"
] | null | null | null | models/common/distributed_executor.py | skydooms/tpu | 4553e1ed26763769768b9ba6744431908f7e37c0 | [
"Apache-2.0"
] | null | null | null | models/common/distributed_executor.py | skydooms/tpu | 4553e1ed26763769768b9ba6744431908f7e37c0 | [
"Apache-2.0"
] | 1 | 2020-01-30T21:12:05.000Z | 2020-01-30T21:12:05.000Z | # Copyright 2019 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... | 36.695793 | 102 | 0.661654 |
36720d90a5cec8e4350d34241c628abe41b60fd5 | 3,522 | py | Python | lnbits/core/views/generic.py | eillarra/lnbits | d8da88aefa43d443abf4dffadeb5ce41c0aac77b | [
"MIT"
] | null | null | null | lnbits/core/views/generic.py | eillarra/lnbits | d8da88aefa43d443abf4dffadeb5ce41c0aac77b | [
"MIT"
] | null | null | null | lnbits/core/views/generic.py | eillarra/lnbits | d8da88aefa43d443abf4dffadeb5ce41c0aac77b | [
"MIT"
] | null | null | null | from quart import g, abort, redirect, request, render_template, send_from_directory, url_for
from http import HTTPStatus
from os import path
from lnbits.core import core_app
from lnbits.decorators import check_user_exists, validate_uuids
from lnbits.settings import LNBITS_ALLOWED_USERS, SERVICE_FEE
from ..crud import... | 34.871287 | 103 | 0.720613 |
3f23f6dd72f78e19bba580660d6fe75cd625da4c | 5,681 | py | Python | opencga-client/src/main/python/pyOpenCGA/pyopencga/rest_clients/clinical_client.py | fizquierdo/opencga | 9e307624bbcabe227e307686f1b5b83e5941f34d | [
"Apache-2.0"
] | null | null | null | opencga-client/src/main/python/pyOpenCGA/pyopencga/rest_clients/clinical_client.py | fizquierdo/opencga | 9e307624bbcabe227e307686f1b5b83e5941f34d | [
"Apache-2.0"
] | null | null | null | opencga-client/src/main/python/pyOpenCGA/pyopencga/rest_clients/clinical_client.py | fizquierdo/opencga | 9e307624bbcabe227e307686f1b5b83e5941f34d | [
"Apache-2.0"
] | null | null | null | from pyopencga.rest_clients._parent_rest_clients import _ParentRestClient, _ParentBasicCRUDClient, _ParentAclRestClient
class Interpretations(_ParentRestClient):
"""
This class contains the Interpretations client with methods for the
Analysis - Clinical webservices
"""
def __init__(self, configur... | 38.646259 | 131 | 0.670128 |
fe4f36d24580777043b16d7c33f47df7c988c236 | 2,062 | py | Python | demos/test_slippage_analysis.py | vedb/data_analysis | b46f58ba424680353d3abd0014a7d0a339bf6e6c | [
"MIT"
] | null | null | null | demos/test_slippage_analysis.py | vedb/data_analysis | b46f58ba424680353d3abd0014a7d0a339bf6e6c | [
"MIT"
] | null | null | null | demos/test_slippage_analysis.py | vedb/data_analysis | b46f58ba424680353d3abd0014a7d0a339bf6e6c | [
"MIT"
] | null | null | null | import os
import sys
import glob
import yaml
from data_analysis import scene
# Directory for the recording sessions
parameters_fpath = "/home/kamran/Code/data_analysis/config/visualization_parameters.yaml"
sessions_fpath = "/home/kamran/Code/data_analysis/config/slippage_sessions_list.yaml"
def parse_pipeline_parameter... | 42.958333 | 172 | 0.70805 |
8caa6c3f82e6961ac39ea2d5e2979e35d2fc5d65 | 1,566 | py | Python | M3_feature_zone/retipy/test/test_tortuosity.py | rmaphoh/AutoMorph | 0c82ce322c6cd8bd80f06bbd85c5c2542e534cb8 | [
"Apache-2.0"
] | 1 | 2022-01-28T00:56:23.000Z | 2022-01-28T00:56:23.000Z | M3_feature_zone/retipy/test/test_tortuosity.py | rmaphoh/AutoMorph | 0c82ce322c6cd8bd80f06bbd85c5c2542e534cb8 | [
"Apache-2.0"
] | null | null | null | M3_feature_zone/retipy/test/test_tortuosity.py | rmaphoh/AutoMorph | 0c82ce322c6cd8bd80f06bbd85c5c2542e534cb8 | [
"Apache-2.0"
] | null | null | null | # Retipy - Retinal Image Processing on Python
# Copyright (C) 2017 Alejandro Valdes
#
# This program 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, either version 3 of the License, or
# (at your option) any ... | 38.195122 | 83 | 0.724777 |
83e80e5136316423808327a2c515d908d1f3ee6c | 190 | py | Python | textattack/attack_results/successful_attack_result.py | StatNLP/discretezoo | 565552b894a5c9632ac7b949d61a6f71123031e4 | [
"MIT"
] | null | null | null | textattack/attack_results/successful_attack_result.py | StatNLP/discretezoo | 565552b894a5c9632ac7b949d61a6f71123031e4 | [
"MIT"
] | null | null | null | textattack/attack_results/successful_attack_result.py | StatNLP/discretezoo | 565552b894a5c9632ac7b949d61a6f71123031e4 | [
"MIT"
] | 1 | 2022-03-25T16:45:12.000Z | 2022-03-25T16:45:12.000Z | """
Successful Attack Result
==========================
"""
from .attack_result import AttackResult
class SuccessfulAttackResult(AttackResult):
"""The result of a successful attack."""
| 17.272727 | 43 | 0.652632 |
d238a2d9174069bb6daccc36724009e623221de4 | 6,225 | py | Python | gym_decomp/scaii/__init__.py | UserAB1236872/gym_decomp | 1c3722b3ae81932659cc03e77c3ee8a61882ca76 | [
"BSD-3-Clause"
] | null | null | null | gym_decomp/scaii/__init__.py | UserAB1236872/gym_decomp | 1c3722b3ae81932659cc03e77c3ee8a61882ca76 | [
"BSD-3-Clause"
] | 3 | 2021-05-21T15:20:20.000Z | 2022-02-10T00:05:31.000Z | gym_decomp/scaii/__init__.py | UserAB1236872/gym_decomp | 1c3722b3ae81932659cc03e77c3ee8a61882ca76 | [
"BSD-3-Clause"
] | null | null | null | """
Wrappers for SCAII scenarios, primarily four towers derivatives.
"""
import os
from pathlib import Path
import logging
import gym
from gym import spaces
import gym_decomp.scaii.bootstrap as scaii_bootstrap
scaii_bootstrap.check_setup()
from scaii.env.sky_rts.env.scenarios.city_attack import CityAttack
from scai... | 29.927885 | 98 | 0.606104 |
4466bbf3fe0ac74d725316518ce82dd8d850e136 | 4,672 | py | Python | heat/tests/engine/test_plugin_manager.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 1 | 2015-12-18T21:46:55.000Z | 2015-12-18T21:46:55.000Z | heat/tests/engine/test_plugin_manager.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | heat/tests/engine/test_plugin_manager.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 3 | 2018-07-19T17:43:37.000Z | 2019-11-15T22:13:30.000Z | #
# 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, software
# ... | 32.671329 | 79 | 0.681721 |
9dc6817f742c8ea0e581b747dbb3035513e8dc12 | 3,669 | py | Python | insta/settings.py | Roseoketch/Insta-Photo | f9416d106b03124b16244cc688a05785a6a0d13c | [
"MIT"
] | 1 | 2021-06-23T12:46:12.000Z | 2021-06-23T12:46:12.000Z | insta/settings.py | Roseoketch/Insta-Photo | f9416d106b03124b16244cc688a05785a6a0d13c | [
"MIT"
] | null | null | null | insta/settings.py | Roseoketch/Insta-Photo | f9416d106b03124b16244cc688a05785a6a0d13c | [
"MIT"
] | null | null | null | """
Django settings for insta project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
fro... | 26.586957 | 91 | 0.704007 |
4f6555354bd37fffe0d413b417a6261aa85cf351 | 947 | py | Python | server_scripts/get_odb.py | det-lab/exhttpd | e9e6ff8271f45a1068d0b5c5a1669b8dc035fbf6 | [
"MIT"
] | null | null | null | server_scripts/get_odb.py | det-lab/exhttpd | e9e6ff8271f45a1068d0b5c5a1669b8dc035fbf6 | [
"MIT"
] | null | null | null | server_scripts/get_odb.py | det-lab/exhttpd | e9e6ff8271f45a1068d0b5c5a1669b8dc035fbf6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import traceback
from subprocess import Popen, PIPE, call
#
# This script copies new Midas datafiles into a CDMS series-number structure
#
def getodb(odbkey):
command = "odbedit -c 'ls -l \""+ odbkey +"\"'"
p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE)
stdout, stderr = ... | 21.044444 | 76 | 0.620908 |
a8b20e65a1195138ba4824546a726c6b3ffd7155 | 8,730 | py | Python | examples/docs/source/conf.py | jlin27/elastic | 6900760fb0799381487cd5cd2c50c8449e5ea831 | [
"BSD-3-Clause"
] | null | null | null | examples/docs/source/conf.py | jlin27/elastic | 6900760fb0799381487cd5cd2c50c8449e5ea831 | [
"BSD-3-Clause"
] | null | null | null | examples/docs/source/conf.py | jlin27/elastic | 6900760fb0799381487cd5cd2c50c8449e5ea831 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PyTorch documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 23 13:31:47 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | 32.819549 | 79 | 0.659221 |
5361ca669776afedec101f5316d676374c20ffc7 | 1,129 | py | Python | sandbox/urls.py | itbabu/django-oscar-paypal | 0004fcb416b73529396c746940d5bf2cf8ded6c2 | [
"BSD-3-Clause"
] | 1 | 2018-05-17T20:16:34.000Z | 2018-05-17T20:16:34.000Z | sandbox/urls.py | itbabu/django-oscar-paypal | 0004fcb416b73529396c746940d5bf2cf8ded6c2 | [
"BSD-3-Clause"
] | null | null | null | sandbox/urls.py | itbabu/django-oscar-paypal | 0004fcb416b73529396c746940d5bf2cf8ded6c2 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf import settings
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls.static import static
from apps.app import application
from payp... | 35.28125 | 73 | 0.749336 |
e80928b75ebd2f1ffe12a1178f78c1c40506a4cd | 140 | py | Python | siteApp/views.py | ledroid/gitDjango | cef6096a3e309bfc94b2b8586cf96de07abc36b0 | [
"MIT"
] | null | null | null | siteApp/views.py | ledroid/gitDjango | cef6096a3e309bfc94b2b8586cf96de07abc36b0 | [
"MIT"
] | null | null | null | siteApp/views.py | ledroid/gitDjango | cef6096a3e309bfc94b2b8586cf96de07abc36b0 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
def post_list(request):
return render(request, 'site/post_list.html', {}) | 28 | 53 | 0.75 |
8b3e0249012c1ff0ee2582b7f427bf8c14aea1f7 | 8,078 | py | Python | src/googleanalytics/account.py | pc/python-googleanalytics | 9389cbf0b76f2066365dc4142ccbb02148de1580 | [
"BSD-3-Clause"
] | 2 | 2016-05-09T13:24:10.000Z | 2022-02-04T13:25:59.000Z | src/googleanalytics/account.py | pc/python-googleanalytics | 9389cbf0b76f2066365dc4142ccbb02148de1580 | [
"BSD-3-Clause"
] | null | null | null | src/googleanalytics/account.py | pc/python-googleanalytics | 9389cbf0b76f2066365dc4142ccbb02148de1580 | [
"BSD-3-Clause"
] | null | null | null | from googleanalytics.exception import GoogleAnalyticsClientError
from googleanalytics.data import DataPoint, DataSet
import pprint
import urllib
filter_operators = ['==', '!=', '>', '<', '>=', '<=', '=~', '!~', '=@', '!@']
data_converters = {
'integer': int,
}
class Account:
def __init__(self, connection=None, ti... | 34.818966 | 100 | 0.599158 |
f06a7b92fab2f51b6588f5490ef47cbd96a916ec | 175 | py | Python | forgery_data/forgery/__init__.py | stamaimer/ForgeryData | b3bfde1d2c44db9074b440a38fd04987ee7cdae5 | [
"Unlicense"
] | null | null | null | forgery_data/forgery/__init__.py | stamaimer/ForgeryData | b3bfde1d2c44db9074b440a38fd04987ee7cdae5 | [
"Unlicense"
] | null | null | null | forgery_data/forgery/__init__.py | stamaimer/ForgeryData | b3bfde1d2c44db9074b440a38fd04987ee7cdae5 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
forgery_data.forgery
~~~~~~~~~~~~~~~~~~~~
stamaimer 08/29/16
"""
from basic import ForgeryData
from zh_cn import ForgeryDataZH_CN | 12.5 | 34 | 0.577143 |
e93ed63777149d03bdb7cab62a1823e9a6e22e4e | 22 | py | Python | alertaclient/version.py | gapitio/python-alerta-client | 943a624c2136e952c92fbdfaa80e61b73d949275 | [
"Apache-2.0"
] | null | null | null | alertaclient/version.py | gapitio/python-alerta-client | 943a624c2136e952c92fbdfaa80e61b73d949275 | [
"Apache-2.0"
] | null | null | null | alertaclient/version.py | gapitio/python-alerta-client | 943a624c2136e952c92fbdfaa80e61b73d949275 | [
"Apache-2.0"
] | null | null | null | __version__ = '8.3.0'
| 11 | 21 | 0.636364 |
a12fd4c1c3d751cb56313497332fa70e18bf5ee5 | 3,170 | py | Python | sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 1 | 2019-04-05T18:17:43.000Z | 2019-04-05T18:17:43.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 ... | 48.769231 | 173 | 0.697792 |
b5b40d20a4defa0611d6933af04983eb08527c6d | 3,333 | py | Python | hubspot/crm/companies/models/filter_group.py | Ronfer/hubspot-api-python | 1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4 | [
"Apache-2.0"
] | 117 | 2020-04-06T08:22:53.000Z | 2022-03-18T03:41:29.000Z | hubspot/crm/companies/models/filter_group.py | Ronfer/hubspot-api-python | 1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4 | [
"Apache-2.0"
] | 62 | 2020-04-06T16:21:06.000Z | 2022-03-17T16:50:44.000Z | hubspot/crm/companies/models/filter_group.py | Ronfer/hubspot-api-python | 1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4 | [
"Apache-2.0"
] | 45 | 2020-04-06T16:13:52.000Z | 2022-03-30T21:33:17.000Z | # coding: utf-8
"""
Companies
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hub... | 30.027027 | 139 | 0.612061 |
a2629b9aff3254fe51d171dfb7fc84759ceb4fcc | 7,055 | py | Python | TCP_FTP/server/main.py | AlterFrozen/Python-NetworkProgramming | 6779966486c39805e6e6ead1514f4ad3ac083400 | [
"MIT"
] | 1 | 2021-11-26T11:36:21.000Z | 2021-11-26T11:36:21.000Z | TCP_FTP/server/main.py | AlterFrozen/Python-NetworkProgramming | 6779966486c39805e6e6ead1514f4ad3ac083400 | [
"MIT"
] | null | null | null | TCP_FTP/server/main.py | AlterFrozen/Python-NetworkProgramming | 6779966486c39805e6e6ead1514f4ad3ac083400 | [
"MIT"
] | null | null | null | '''Server入口'''
from socket import *
from users import authenticate
from FrozenToolKit import FrozenFile
import settings
import protocol
import json
import os
class Server:
'''FTP Server'''
def __init__(self):
#Server
self.socket = None
self.MAX_RECV = 4096 #单次最大接收字节
self.buffer_... | 43.549383 | 140 | 0.521332 |
b579f4995a459cfaf98de3acfba2cd8bfa520eee | 4,830 | py | Python | lewis_emulators/kynctm3k/device.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T16:49:13.000Z | 2021-02-19T10:41:44.000Z | lewis_emulators/kynctm3k/device.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 9 | 2019-03-22T15:35:15.000Z | 2021-07-28T11:05:43.000Z | lewis_emulators/kynctm3k/device.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T17:02:44.000Z | 2020-10-21T17:02:44.000Z | from collections import OrderedDict
from .states import DefaultState
from lewis.devices import StateMachineDevice
from lewis.core.logging import has_log
import random
import six
def truncate_if_set(f):
"""
Truncates the decorated function's string output if truncated_output is True
"""
@six.wraps... | 26.98324 | 139 | 0.60766 |
ace5a9ddc20fa8d89861e066745f237d88f549fa | 118 | py | Python | tests/func/utils/predicates.py | Joacchim/BookMyComics | 21ed9c4ebfd7de46220f5638c7b4a0af60b4201a | [
"Apache-2.0"
] | null | null | null | tests/func/utils/predicates.py | Joacchim/BookMyComics | 21ed9c4ebfd7de46220f5638c7b4a0af60b4201a | [
"Apache-2.0"
] | 64 | 2018-09-05T13:36:55.000Z | 2020-08-16T19:56:20.000Z | tests/func/utils/predicates.py | BookMyComics-Developers/BookMyComics | e2639f5dff91176c84a6bb8c3b4d72f559b5f3ff | [
"Apache-2.0"
] | 1 | 2018-09-05T11:14:59.000Z | 2018-09-05T11:14:59.000Z | def with_next_page(self):
return self.has_next_page()
def with_prev_page(self):
return self.has_prev_page()
| 16.857143 | 31 | 0.745763 |
0579e26612757d17cced76393b1206b9651fa693 | 57,728 | py | Python | tensorflow/python/distribute/coordinator/cluster_coordinator.py | jay-jang/tensorflow | 6c3b7f4c3e89718c1812e9132a3546cb0dc8f53c | [
"Apache-2.0"
] | 5 | 2021-04-01T15:14:48.000Z | 2021-04-02T02:56:07.000Z | tensorflow/python/distribute/coordinator/cluster_coordinator.py | jay-jang/tensorflow | 6c3b7f4c3e89718c1812e9132a3546cb0dc8f53c | [
"Apache-2.0"
] | 2 | 2021-01-26T13:15:46.000Z | 2021-01-26T16:46:46.000Z | tensorflow/python/distribute/coordinator/cluster_coordinator.py | jay-jang/tensorflow | 6c3b7f4c3e89718c1812e9132a3546cb0dc8f53c | [
"Apache-2.0"
] | 3 | 2021-01-26T11:51:18.000Z | 2021-01-26T12:13:40.000Z | # Lint as: python3
# Copyright 2020 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 requ... | 40.539326 | 115 | 0.722076 |
9ec79c3fa47ed896a76ce7b01e1b0af8d8cfaeb4 | 10,053 | py | Python | setup.py | chryswoods/python_pack_and_doc | 6d63d4e91dd93abf8f618d75c161ab65f943dadd | [
"Apache-2.0"
] | 5 | 2020-09-23T14:04:39.000Z | 2020-10-02T14:01:16.000Z | setup.py | chryswoods/python_pack_and_doc | 6d63d4e91dd93abf8f618d75c161ab65f943dadd | [
"Apache-2.0"
] | null | null | null | setup.py | chryswoods/python_pack_and_doc | 6d63d4e91dd93abf8f618d75c161ab65f943dadd | [
"Apache-2.0"
] | 1 | 2020-09-25T16:25:24.000Z | 2020-09-25T16:25:24.000Z | # Package setup copied from
# https://github.com/FedericoStra/cython-package-example
# Thanks - this was really helpful :-)
import os
import versioneer
from setuptools import setup, Extension
import distutils.sysconfig
import distutils.ccompiler
import multiprocessing
from glob import glob
import platform
import tempf... | 32.221154 | 125 | 0.570079 |
89255e6b6464647030c7ccf719b77b416efb5af8 | 561 | py | Python | grace_dl/torch/communicator/allreduce.py | aoranwu/grace | 1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e | [
"BSD-2-Clause"
] | 88 | 2020-05-07T15:36:10.000Z | 2022-03-13T06:13:31.000Z | grace_dl/torch/communicator/allreduce.py | aoranwu/grace | 1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e | [
"BSD-2-Clause"
] | 21 | 2020-05-25T08:37:03.000Z | 2022-03-30T10:08:14.000Z | grace_dl/torch/communicator/allreduce.py | aoranwu/grace | 1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e | [
"BSD-2-Clause"
] | 33 | 2020-05-07T23:11:39.000Z | 2022-03-25T03:33:49.000Z | from grace_dl.torch import Communicator
from horovod.torch import allreduce_async_, synchronize
class Allreduce(Communicator):
def async_send(self, tensors_compressed, name):
handles = []
for i, tensor_compressed in enumerate(tensors_compressed):
handles.append(allreduce_asyn... | 35.0625 | 104 | 0.700535 |
2d6b3683807f28dfbf2594f08c41d1ce2b5d1a2c | 1,025 | py | Python | packaging/setup/plugins/ovirt-engine-common/core/__init__.py | SunOfShine/ovirt-engine | 7684597e2d38ff854e629e5cbcbb9f21888cb498 | [
"Apache-2.0"
] | 1 | 2021-02-02T05:38:35.000Z | 2021-02-02T05:38:35.000Z | packaging/setup/plugins/ovirt-engine-common/core/__init__.py | SunOfShine/ovirt-engine | 7684597e2d38ff854e629e5cbcbb9f21888cb498 | [
"Apache-2.0"
] | null | null | null | packaging/setup/plugins/ovirt-engine-common/core/__init__.py | SunOfShine/ovirt-engine | 7684597e2d38ff854e629e5cbcbb9f21888cb498 | [
"Apache-2.0"
] | null | null | null | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013 Red Hat, 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 r... | 25.625 | 74 | 0.750244 |
5c12feb8293c9ed8700db67b2ccc39405366ba73 | 2,342 | py | Python | src/arch/x86/isa/insts/simd64/integer/data_transfer/__init__.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 765 | 2015-01-14T16:17:04.000Z | 2022-03-28T07:46:28.000Z | src/arch/x86/isa/insts/simd64/integer/data_transfer/__init__.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 148 | 2018-07-20T00:58:36.000Z | 2021-11-16T01:52:33.000Z | src/arch/x86/isa/insts/simd64/integer/data_transfer/__init__.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 807 | 2015-01-06T09:55:38.000Z | 2022-03-30T10:23:36.000Z | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | 50.913043 | 72 | 0.779249 |
3f01943283f1ee2839fe01160da8706f9c049ad4 | 5,164 | py | Python | fluids/assets/shape.py | BerkeleyAutomation/FLUIDS | 728da0d0fec5028ca4506aa9cc8e37a5b072e7a9 | [
"MIT"
] | 26 | 2017-12-28T18:15:36.000Z | 2022-01-21T13:00:27.000Z | fluids/assets/shape.py | BerkeleyAutomation/FLUIDS | 728da0d0fec5028ca4506aa9cc8e37a5b072e7a9 | [
"MIT"
] | 61 | 2018-01-30T05:18:42.000Z | 2021-05-19T15:00:05.000Z | fluids/assets/shape.py | BerkeleyAutomation/FLUIDS | 728da0d0fec5028ca4506aa9cc8e37a5b072e7a9 | [
"MIT"
] | 14 | 2017-12-11T04:59:21.000Z | 2021-05-19T12:21:31.000Z | import numpy as np
import pygame
import shapely.geometry
from fluids.utils import rotation_array
class Shape(object):
def __init__(self, x=0, y=0,
xdim=0, ydim=0,
points=[],
mass=0,
type=None,
angle=0, angle_deg=0,
... | 38.251852 | 88 | 0.535438 |
931152dbe808a1cff5c34a49067b653328f064b6 | 16,483 | py | Python | custom_components/openhasp/light.py | HASwitchPlate/hasp-lvgl-custom-component | 46985e4685e6fc65645f1b88c72908ad700fd7f3 | [
"MIT"
] | 19 | 2021-04-02T13:45:04.000Z | 2022-03-07T12:49:19.000Z | custom_components/openhasp/light.py | HASwitchPlate/hasp-lvgl-custom-component | 46985e4685e6fc65645f1b88c72908ad700fd7f3 | [
"MIT"
] | 43 | 2021-04-03T23:35:56.000Z | 2022-03-15T20:39:57.000Z | custom_components/openhasp/light.py | HASwitchPlate/hasp-lvgl-custom-component | 46985e4685e6fc65645f1b88c72908ad700fd7f3 | [
"MIT"
] | 8 | 2021-04-18T12:07:23.000Z | 2022-01-10T00:49:15.000Z | """Support for HASP LVGL moodlights."""
import json
import logging
from typing import Callable
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
LightEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const... | 30.867041 | 87 | 0.571013 |
a3ee73d85b1c95881146a7ad2abeb2062b8a5f03 | 8,023 | py | Python | nettoyage_df_secteurs_activites.py | Projet-energie/Projet-Energie | c138339937300c5d4571345185a1fd72ea59de9f | [
"MIT"
] | null | null | null | nettoyage_df_secteurs_activites.py | Projet-energie/Projet-Energie | c138339937300c5d4571345185a1fd72ea59de9f | [
"MIT"
] | null | null | null | nettoyage_df_secteurs_activites.py | Projet-energie/Projet-Energie | c138339937300c5d4571345185a1fd72ea59de9f | [
"MIT"
] | null | null | null | #Ouverture du fichier
import pandas as pd
df=pd.read_csv('conso-elec-gaz-annuelle-par-secteur-dactivite-agregee-departement.csv',sep=';')
df.head(50)
#les valeurs uniques de la variable année
df["Année"].unique()
#Les valeurs de la variable filière
df["Filière"].value_counts()
#df.info()
#Suppression de la valeur g... | 35.188596 | 236 | 0.683659 |
e1268f731978277513993f7a195968a942416b55 | 727 | py | Python | tests/project/conftest.py | Exef/brownie | f111d299974f11e451b0acd790e12b40986659e4 | [
"MIT"
] | 1 | 2019-10-03T08:31:21.000Z | 2019-10-03T08:31:21.000Z | tests/project/conftest.py | Exef/brownie | f111d299974f11e451b0acd790e12b40986659e4 | [
"MIT"
] | null | null | null | tests/project/conftest.py | Exef/brownie | f111d299974f11e451b0acd790e12b40986659e4 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import pytest
test_source = """
pragma solidity ^0.5.0;
library Bar {
function baz(uint a, uint b) external pure returns (uint) {
return a + b;
}
}
contract Foo {
address payable owner;
function baz(uint a, uint b) external view returns (uint) {
return Bar.baz(a,... | 17.309524 | 76 | 0.642366 |
771635cbceb9eba6e53579defdd0878046cc803d | 3,841 | py | Python | src/hotels/postgres_upload_data.py | bee-travels/data-generator | a27d446daa24b93b5c0ecba9e1b3a8228815023e | [
"Apache-2.0"
] | 2 | 2021-06-23T03:52:09.000Z | 2021-07-26T06:14:15.000Z | src/hotels/postgres_upload_data.py | bee-travels/data-generator | a27d446daa24b93b5c0ecba9e1b3a8228815023e | [
"Apache-2.0"
] | 1 | 2020-04-16T17:28:50.000Z | 2020-04-16T17:28:50.000Z | src/hotels/postgres_upload_data.py | bee-travels/data-generator | a27d446daa24b93b5c0ecba9e1b3a8228815023e | [
"Apache-2.0"
] | 2 | 2021-07-26T06:59:04.000Z | 2022-01-14T06:58:04.000Z | import psycopg2
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
import sys
import json
import os
import logging
import utils
def get_connection():
try:
if "DATABASE_CERT" in os.environ:
with open("./cert.pem",'w') as cert_file:
cert_file.write(os.environ["DATABASE_CE... | 35.564815 | 206 | 0.60479 |
0edb8b568d8a989b0598955c11c562ae093a4ff6 | 2,527 | py | Python | CIM15/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerAsymetrical.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 58 | 2015-04-22T10:41:03.000Z | 2022-03-29T16:04:34.000Z | CIM15/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerAsymetrical.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 12 | 2015-08-26T03:57:23.000Z | 2020-12-11T20:14:42.000Z | CIM15/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerAsymetrical.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 35 | 2015-01-10T12:21:03.000Z | 2020-09-09T08:18:16.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | 57.431818 | 342 | 0.764939 |
b8f87e5766ca227ea2b05a40f0e262895cab53de | 642 | py | Python | source/pic2card/tests/base_test_class.py | sivasakthiv/AdaptiveCards | dfa4bfef70c1111e1a5cc8eed90b2f1e8d76f75c | [
"MIT"
] | null | null | null | source/pic2card/tests/base_test_class.py | sivasakthiv/AdaptiveCards | dfa4bfef70c1111e1a5cc8eed90b2f1e8d76f75c | [
"MIT"
] | null | null | null | source/pic2card/tests/base_test_class.py | sivasakthiv/AdaptiveCards | dfa4bfef70c1111e1a5cc8eed90b2f1e8d76f75c | [
"MIT"
] | 1 | 2022-02-03T04:53:52.000Z | 2022-02-03T04:53:52.000Z | import os
import unittest
from tests.utils import (
img_to_base64,
headers,
payload_empty_dict_data,
payload_data_some_string,
generate_base64,
)
from app.api import app
class BaseAPITest(unittest.TestCase):
"""Base test class """
def setUp(self):
"""Define test variables and init... | 25.68 | 62 | 0.683801 |
2c1c404597136ec31687708b3b83ff5a846a70af | 12,273 | py | Python | train.py | gicheonkang/sglkt-visdial | b2927e8bc8e45c2d2a2a76fbf75a15f8ecb78b88 | [
"MIT"
] | 9 | 2021-08-30T16:43:46.000Z | 2022-03-19T12:22:08.000Z | train.py | gicheonkang/sglkt-visdial | b2927e8bc8e45c2d2a2a76fbf75a15f8ecb78b88 | [
"MIT"
] | null | null | null | train.py | gicheonkang/sglkt-visdial | b2927e8bc8e45c2d2a2a76fbf75a15f8ecb78b88 | [
"MIT"
] | 4 | 2021-09-01T01:33:17.000Z | 2021-10-12T05:33:20.000Z | """
This code is modified from batra-mlp-lab's repository.
https://github.com/batra-mlp-lab/visdial-challenge-starter-pytorch
"""
import os
import argparse
import itertools
import torch
import numpy as np
from torch import nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from tqdm import tqdm
... | 35.368876 | 96 | 0.602298 |
731ce7ffb72817521b1a46f425e6eba662b85015 | 4,650 | py | Python | Mission3.py | magicbycalvin/StochasticTargetMonitoring | bb5fc71b34149c6af40b6f25f0401cfec9f2a9ef | [
"MIT"
] | 1 | 2020-03-10T19:34:38.000Z | 2020-03-10T19:34:38.000Z | Mission3.py | magicbycalvin/StochasticTargetMonitoring | bb5fc71b34149c6af40b6f25f0401cfec9f2a9ef | [
"MIT"
] | null | null | null | Mission3.py | magicbycalvin/StochasticTargetMonitoring | bb5fc71b34149c6af40b6f25f0401cfec9f2a9ef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 20 15:23:08 2020
@author: ckielasjensen
"""
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
import numpy as np
from agent import Agent
from parameters import Parameters
from target import Target
def plot1():
fig, ax = p... | 27.514793 | 79 | 0.573118 |
6cd66feddc8e8c0431fdc005a7608d418ef0c924 | 6,690 | py | Python | 36-ratios/model/loss/yolo_loss.py | Yu-Nie/YOLOV3 | 09db1d551d293dcfa7a638fd6693920840d28a74 | [
"MIT"
] | null | null | null | 36-ratios/model/loss/yolo_loss.py | Yu-Nie/YOLOV3 | 09db1d551d293dcfa7a638fd6693920840d28a74 | [
"MIT"
] | null | null | null | 36-ratios/model/loss/yolo_loss.py | Yu-Nie/YOLOV3 | 09db1d551d293dcfa7a638fd6693920840d28a74 | [
"MIT"
] | null | null | null | import sys
sys.path.append("../utils")
import torch
import torch.nn as nn
from utils import tools
import config.yolov3_config_voc as cfg
class FocalLoss(nn.Module):
def __init__(self, gamma=2.0, alpha=1.0, reduction="mean"):
super(FocalLoss, self).__init__()
self.__gamma = gamma
self.__al... | 44.899329 | 131 | 0.595067 |
be14cafe9b1cb5cd2221f97fd590e7f6077ae3df | 77 | py | Python | __init__.py | cclauss/saxo | 862846d05f39a90d91e037a0adcc5b2ac0510a30 | [
"Apache-2.0"
] | 24 | 2015-01-20T17:25:17.000Z | 2021-11-11T15:35:45.000Z | __init__.py | cclauss/saxo | 862846d05f39a90d91e037a0adcc5b2ac0510a30 | [
"Apache-2.0"
] | 44 | 2015-01-01T16:46:49.000Z | 2021-05-20T08:13:38.000Z | __init__.py | cclauss/saxo | 862846d05f39a90d91e037a0adcc5b2ac0510a30 | [
"Apache-2.0"
] | 12 | 2015-04-26T19:41:34.000Z | 2020-10-22T08:35:46.000Z | # http://inamidst.com/saxo/
# Created by Sean B. Palmer
from .core import *
| 15.4 | 27 | 0.688312 |
9e8d15b5bb5a89f97295dd615a356668341ef9a3 | 4,777 | py | Python | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_functions_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 680 | 2016-12-03T14:38:28.000Z | 2022-02-16T04:06:45.000Z | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_functions_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 38 | 2016-11-17T08:43:51.000Z | 2019-11-12T12:27:04.000Z | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_functions_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 250 | 2016-12-05T10:37:17.000Z | 2022-03-18T21:26:55.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.125 | 85 | 0.634917 |
a3c6d5213486cf5cd99c9a33ff40e0d436ff216b | 2,908 | py | Python | test/test_day10.py | daniel-stockhausen/adventofcode2021 | e21969a9bf6fe3e9d520cf36dc34de02e24dd0d2 | [
"MIT"
] | null | null | null | test/test_day10.py | daniel-stockhausen/adventofcode2021 | e21969a9bf6fe3e9d520cf36dc34de02e24dd0d2 | [
"MIT"
] | null | null | null | test/test_day10.py | daniel-stockhausen/adventofcode2021 | e21969a9bf6fe3e9d520cf36dc34de02e24dd0d2 | [
"MIT"
] | null | null | null | import os
import unittest
from aoc.day10.day10 import calc_completion_string_middle_score, calc_file_error_score, \
calc_missing_tokens_for_incomplete_line, get_example_data, get_input_data, score_line_completion, score_line_error
class TestDay10(unittest.TestCase):
def test_score_line_error(self):
s... | 48.466667 | 118 | 0.567744 |
878735a430844be26b70f0caccbf7ced0c3391a1 | 4,901 | py | Python | modin/core/io/sql/sql_dispatcher.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/io/sql/sql_dispatcher.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/io/sql/sql_dispatcher.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 43.371681 | 129 | 0.653948 |
81c87abf084f119ac770d956e76994173ce899d2 | 107 | py | Python | zpipe/stages/__init__.py | jheo4/zpipe | 8cc3ac38b0f999ae4c1a29e63818457c4b7d6cf6 | [
"MIT"
] | 1 | 2020-06-28T02:31:08.000Z | 2020-06-28T02:31:08.000Z | zpipe/stages/__init__.py | jheo4/zpipe | 8cc3ac38b0f999ae4c1a29e63818457c4b7d6cf6 | [
"MIT"
] | 6 | 2020-06-28T01:52:45.000Z | 2020-07-10T03:55:41.000Z | zpipe/stages/__init__.py | jheo4/zpipe | 8cc3ac38b0f999ae4c1a29e63818457c4b7d6cf6 | [
"MIT"
] | null | null | null | from .stage import Stage
from .nonworker_stage import NonWorkerStage
from .worker_stage import WorkerStage
| 26.75 | 43 | 0.859813 |
9eb8696d76e193fc4161ab13c49b3db436e0e80c | 11,385 | py | Python | pump_mbf.py | couchbaselabs/couchbase-cli | 596f3564d08881af83f93910ac3d2c53a82b1d64 | [
"Apache-2.0"
] | null | null | null | pump_mbf.py | couchbaselabs/couchbase-cli | 596f3564d08881af83f93910ac3d2c53a82b1d64 | [
"Apache-2.0"
] | null | null | null | pump_mbf.py | couchbaselabs/couchbase-cli | 596f3564d08881af83f93910ac3d2c53a82b1d64 | [
"Apache-2.0"
] | 1 | 2018-08-23T11:14:28.000Z | 2018-08-23T11:14:28.000Z | #!/usr/bin/env python
import glob
import logging
import os
import sys
import socket
import couchbaseConstants
from cbcollections import defaultdict
from pump import EndPoint, Source, Batch
try:
import ctypes
except ImportError:
cb_path = '/opt/couchbase/lib/python'
while cb_path in sys.path:
sys.p... | 35.247678 | 96 | 0.52253 |
86e1f399a838fc5b3e09dc590b49a710233e9dbf | 4,879 | py | Python | s2e/source/s2e/guest/windows/scripts/gendriver.py | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 55 | 2019-12-20T03:25:14.000Z | 2022-01-16T07:19:47.000Z | s2e/source/s2e/guest/windows/scripts/gendriver.py | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 2 | 2020-11-02T08:01:00.000Z | 2022-03-27T02:59:18.000Z | s2e/source/s2e/guest/windows/scripts/gendriver.py | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 11 | 2020-08-06T03:59:45.000Z | 2022-02-25T02:31:59.000Z | #!/usr/bin/env python
# Copyright (C) 2014-2017, Cyberhaven
# Copyright (C) 2017, Dependable Systems Laboratory, EPFL
#
# 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, i... | 46.028302 | 93 | 0.733962 |
bef3385209058f3b46984840f49389184a3dbf58 | 2,594 | py | Python | tests/_tests_scripts/z_mvp_mnist_unet.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | tests/_tests_scripts/z_mvp_mnist_unet.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | tests/_tests_scripts/z_mvp_mnist_unet.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
import os
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.datasets import MNIST
from catalyst import dl
from catalyst.utils import metrics
class ClassifyUnet(nn.Module):
def __init__... | 25.94 | 78 | 0.544719 |
15ccfa26470577bd1a02d164b6d10a3b0bcd4619 | 529 | py | Python | algorithms/square_root_bisection_search.py | ivanlmj/SnakeEggs | 540843dcf6fba4b3fe0d6d57dd19654f33cccb74 | [
"MIT"
] | 1 | 2019-05-20T18:19:45.000Z | 2019-05-20T18:19:45.000Z | algorithms/square_root_bisection_search.py | ivanlmj/SnakeEggs | 540843dcf6fba4b3fe0d6d57dd19654f33cccb74 | [
"MIT"
] | null | null | null | algorithms/square_root_bisection_search.py | ivanlmj/SnakeEggs | 540843dcf6fba4b3fe0d6d57dd19654f33cccb74 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
x = 25
epsilon = 0.01
numGuesses = 0
low = 1.0
high = x
ans = (high + low) / 2.0
while abs(ans**2 - x) >= epsilon:
print("\nlow: {0:<9} high: {1:<9} ans: (high+low)/2 == {2}".format(low,high,ans))
numGuesses += 1
if ans**2 < x:
print("R:",ans, "squared is LESS than", x)
... | 21.16 | 89 | 0.536862 |
f47766116d79209748a3ef241f58dbfb7c21786e | 767 | py | Python | KaSaAn/__init__.py | hmedina/KaSaAn | 83e4e31ff0e0062762aacfbc65bbdd290808bb51 | [
"MIT"
] | 1 | 2020-05-11T14:31:54.000Z | 2020-05-11T14:31:54.000Z | KaSaAn/__init__.py | hmedina/KaSaAn | 83e4e31ff0e0062762aacfbc65bbdd290808bb51 | [
"MIT"
] | 4 | 2017-08-31T11:16:08.000Z | 2020-07-10T22:31:45.000Z | KaSaAn/__init__.py | hmedina/KaSaAn | 83e4e31ff0e0062762aacfbc65bbdd290808bb51 | [
"MIT"
] | 2 | 2018-02-06T20:53:26.000Z | 2019-05-11T18:05:38.000Z | #!/usr/bin/env python3
"""
Tools and utilities for analyzing Kappa objects. The `scripts` submodule contains command line utilities (installed via
SetupTools EntryPoints under the namespace `kappa_[object type]`), for which the functions are located under
`functions`. A low-level API is provided under `core`.
To view ... | 47.9375 | 119 | 0.783572 |
70ebcb3a3ff1b184b32c7ef4e6401ca24f6a5174 | 39,222 | py | Python | sdks/python/apache_beam/typehints/typehints_test.py | VaclavPlajt/beam | 247a62ff1d4368f1e7c2ade6bed5dec71d8d2bcc | [
"Apache-2.0"
] | 2 | 2018-07-27T08:48:24.000Z | 2018-10-22T06:31:04.000Z | sdks/python/apache_beam/typehints/typehints_test.py | VaclavPlajt/beam | 247a62ff1d4368f1e7c2ade6bed5dec71d8d2bcc | [
"Apache-2.0"
] | 2 | 2018-05-21T10:35:40.000Z | 2018-05-21T10:46:10.000Z | sdks/python/apache_beam/typehints/typehints_test.py | VaclavPlajt/beam | 247a62ff1d4368f1e7c2ade6bed5dec71d8d2bcc | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 36.828169 | 80 | 0.661516 |
c3cb73ad92a3202df9cc009027753a74865d09f3 | 422 | py | Python | yocto/poky/bitbake/lib/prserv/__init__.py | jxtxinbing/ops-build | 9008de2d8e100f3f868c66765742bca9fa98f3f9 | [
"Apache-2.0"
] | 53 | 2018-02-28T08:51:32.000Z | 2022-02-28T06:49:23.000Z | yocto/poky/bitbake/lib/prserv/__init__.py | jxtxinbing/ops-build | 9008de2d8e100f3f868c66765742bca9fa98f3f9 | [
"Apache-2.0"
] | 415 | 2016-12-20T17:20:45.000Z | 2018-09-23T07:59:23.000Z | yocto/poky/bitbake/lib/prserv/__init__.py | jxtxinbing/ops-build | 9008de2d8e100f3f868c66765742bca9fa98f3f9 | [
"Apache-2.0"
] | 51 | 2018-02-21T04:46:08.000Z | 2022-03-02T04:20:41.000Z | __version__ = "1.0.0"
import os, time
import sys,logging
def init_logger(logfile, loglevel):
numeric_level = getattr(logging, loglevel.upper(), None)
if not isinstance(numeric_level, int):
raise ValueError('Invalid log level: %s' % loglevel)
FORMAT = '%(asctime)-15s %(message)s'
logging.basicC... | 28.133333 | 77 | 0.718009 |
51ab05956190712029bc353213938bdc078213dd | 5,633 | py | Python | examples/add_two_numbers.py | sarah-almaghrabi/keras-attention-mechanism | e516874803ca62fc718e36e808e3eff6e208fb92 | [
"Apache-2.0"
] | null | null | null | examples/add_two_numbers.py | sarah-almaghrabi/keras-attention-mechanism | e516874803ca62fc718e36e808e3eff6e208fb92 | [
"Apache-2.0"
] | null | null | null | examples/add_two_numbers.py | sarah-almaghrabi/keras-attention-mechanism | e516874803ca62fc718e36e808e3eff6e208fb92 | [
"Apache-2.0"
] | null | null | null | import os
import shutil
import sys
from pathlib import Path
import matplotlib.pyplot as plt
import numpy
import numpy as np
from keract import get_activations
from tensorflow.keras import Input
from tensorflow.keras.callbacks import Callback
from tensorflow.keras.layers import Dense, Dropout, LSTM, Flatten, Conv1D
fro... | 39.391608 | 118 | 0.657199 |
d0d878e306a5537e00d1a477c4478c41d34efc6f | 3,074 | py | Python | src/obj.py | APPIAN-PET/PyPA | 316c9675e6049443dd06556b046c79e5a82e5d3e | [
"MIT"
] | 26 | 2017-10-20T22:45:19.000Z | 2022-02-10T14:41:28.000Z | src/obj.py | APPIAN-PET/PyPA | 316c9675e6049443dd06556b046c79e5a82e5d3e | [
"MIT"
] | 15 | 2019-02-06T16:30:23.000Z | 2021-09-17T05:17:15.000Z | src/obj.py | APPIAN-PET/PyPA | 316c9675e6049443dd06556b046c79e5a82e5d3e | [
"MIT"
] | 15 | 2017-09-14T21:30:30.000Z | 2021-11-05T13:29:04.000Z | import nipype.interfaces.io as nio
import nipype.interfaces.utility as niu
import nipype.algorithms.misc as misc
from nipype.interfaces.utility import Function
from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath,
BaseInterface, OutputMultiPath, BaseInterfac... | 37.036145 | 102 | 0.699414 |
49e482b5770e1f81f898d107c7944df2dbf6fd5b | 575 | py | Python | conf/logger.py | yc19890920/dble_fastapi_blog | dd9b8984d849df893d4fea270e8b75ac12d01241 | [
"Apache-2.0"
] | null | null | null | conf/logger.py | yc19890920/dble_fastapi_blog | dd9b8984d849df893d4fea270e8b75ac12d01241 | [
"Apache-2.0"
] | 2 | 2021-03-31T19:56:46.000Z | 2021-04-30T21:19:15.000Z | conf/logger.py | yc19890920/dble_fastapi_blog | dd9b8984d849df893d4fea270e8b75ac12d01241 | [
"Apache-2.0"
] | null | null | null | """
@Author: YangCheng
@contact: 1248644045@qq.com
@Software: Y.C
@Time: 2020/7/21 15:29
"""
import logging
from .settings import LOGGER_CONSOLE_LEVEL
class Logger:
@staticmethod
def get_logger(name):
_handler = logging.StreamHandler()
log_format = '%(asctime)s %(threadName)-10s %(proc... | 26.136364 | 118 | 0.669565 |
b0f0c7f0ff866e2844df7145800946fc1a82ca4b | 4,634 | py | Python | edward2/tensorflow/program_transformations.py | miksu/edward2 | 973acdb23701f320ebaee8a56fc44d4414acfa4e | [
"Apache-2.0"
] | 1 | 2022-01-05T12:26:05.000Z | 2022-01-05T12:26:05.000Z | edward2/tensorflow/program_transformations.py | kthakore/edward2 | 6fd50d4b9351616c3cd8b5e9224d118ba48c935f | [
"Apache-2.0"
] | null | null | null | edward2/tensorflow/program_transformations.py | kthakore/edward2 | 6fd50d4b9351616c3cd8b5e9224d118ba48c935f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Edward2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.106061 | 79 | 0.703064 |
0d4c8447a8b8e17efd9074a8a01abac98acd1c98 | 17,365 | py | Python | tensorflow_data_validation/utils/mutual_information_util_test.py | rtg0795/data-validation | 16e57d7d5f1aeb4b7b9b897c5021abf006261bbd | [
"Apache-2.0"
] | 621 | 2018-09-10T19:27:18.000Z | 2022-03-31T06:43:24.000Z | tensorflow_data_validation/utils/mutual_information_util_test.py | rtg0795/data-validation | 16e57d7d5f1aeb4b7b9b897c5021abf006261bbd | [
"Apache-2.0"
] | 157 | 2018-09-10T08:53:18.000Z | 2022-03-31T14:07:51.000Z | tensorflow_data_validation/utils/mutual_information_util_test.py | rtg0795/data-validation | 16e57d7d5f1aeb4b7b9b897c5021abf006261bbd | [
"Apache-2.0"
] | 141 | 2018-09-10T06:38:13.000Z | 2022-03-31T07:27:16.000Z | # Copyright 2021 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, ... | 39.198646 | 80 | 0.564238 |
ea5d4f230c5db2fdfec9389d9b99c87b250bd27a | 6,292 | py | Python | infrastructure-provisioning/src/general/lib/os/redhat/common_lib.py | karthisuku/incubator-dlab | 09d2d7bfce94d82c5b02f533782051537fbac551 | [
"Apache-2.0"
] | 1 | 2021-04-07T00:37:00.000Z | 2021-04-07T00:37:00.000Z | infrastructure-provisioning/src/general/lib/os/redhat/common_lib.py | karthisuku/incubator-dlab | 09d2d7bfce94d82c5b02f533782051537fbac551 | [
"Apache-2.0"
] | null | null | null | infrastructure-provisioning/src/general/lib/os/redhat/common_lib.py | karthisuku/incubator-dlab | 09d2d7bfce94d82c5b02f533782051537fbac551 | [
"Apache-2.0"
] | 1 | 2021-07-15T13:36:25.000Z | 2021-07-15T13:36:25.000Z | #!/usr/bin/python
# *****************************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The A... | 44 | 122 | 0.572473 |
d7c44da2d28d1915f78b00c09d13922f7139003b | 335 | py | Python | Learnpy/Python/scripts/timenextsecond.py | firstoney/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | 1 | 2019-11-29T14:39:36.000Z | 2019-11-29T14:39:36.000Z | Learnpy/Python/scripts/timenextsecond.py | JackyYuanjie/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | null | null | null | Learnpy/Python/scripts/timenextsecond.py | JackyYuanjie/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | 1 | 2020-01-09T07:29:17.000Z | 2020-01-09T07:29:17.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
timestr = input("请以'时:分:秒'格式进行输入:")
timeList = timestr.split(":")
h = int(timeList[0])
m = int(timeList[1])
s = int(timeList[2])
s += 1
if s == 60:
m += 1
s = 0
if m == 60:
h += 1
m = 0
if h == 24:
h = 0
print("{}:{}:{}".... | 13.958333 | 35 | 0.441791 |
ac385470285ee96c772ebe86f5598a80fc462be3 | 19,824 | py | Python | tests/integration/test_push_updates.py | FilipSchad/packit | d57da48c649ed9e0212b6a7ca5fc6428c217bc71 | [
"MIT"
] | null | null | null | tests/integration/test_push_updates.py | FilipSchad/packit | d57da48c649ed9e0212b6a7ca5fc6428c217bc71 | [
"MIT"
] | null | null | null | tests/integration/test_push_updates.py | FilipSchad/packit | d57da48c649ed9e0212b6a7ca5fc6428c217bc71 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2019 Red Hat, Inc.
# 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,... | 46.754717 | 100 | 0.292776 |
148fbf90badcad5fec8b6e8aaad709791e9d568d | 305 | py | Python | python/uri_1021.py | tainahemmanuele/uri_iniciante | afacf6682d77465efcada7f3e2c3126143497ed9 | [
"MIT"
] | null | null | null | python/uri_1021.py | tainahemmanuele/uri_iniciante | afacf6682d77465efcada7f3e2c3126143497ed9 | [
"MIT"
] | null | null | null | python/uri_1021.py | tainahemmanuele/uri_iniciante | afacf6682d77465efcada7f3e2c3126143497ed9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import math
a, b, c= raw_input().split()
a = float(a)
b = float(b)
c = float(c)
d = (b*b)-(4*a*c)
if (a==0 or d<0):
print ("Impossivel calcular")
else:
x1= (-b+ math.sqrt(d))/(2*a)
x2= (-b-math.sqrt(d))/(2*a)
print ("R1 = %.5f" %x1)
print ("R2 = %.5f" %x2)
| 16.052632 | 33 | 0.488525 |
8bf3020344e7601dc1dde21797cf9d7663c71756 | 95 | py | Python | Python2/lonely-integer.py | LaughDonor/hackerrank | 07fc0e596b2b456aa72a3cd66036d718253777f0 | [
"Apache-2.0"
] | null | null | null | Python2/lonely-integer.py | LaughDonor/hackerrank | 07fc0e596b2b456aa72a3cd66036d718253777f0 | [
"Apache-2.0"
] | null | null | null | Python2/lonely-integer.py | LaughDonor/hackerrank | 07fc0e596b2b456aa72a3cd66036d718253777f0 | [
"Apache-2.0"
] | null | null | null | from collections import Counter
input()
print Counter(raw_input().split()).most_common()[-1][0] | 31.666667 | 55 | 0.757895 |
72b2f2c3bbd92b7f4c6c26d938799e09efba3ebc | 13,012 | py | Python | etl/transform/relation.py | akudan/purr | ca6a57217a2cd83fb267d06e8a77657e213f73ce | [
"MIT"
] | 4 | 2019-11-14T18:15:42.000Z | 2022-03-22T22:23:35.000Z | etl/transform/relation.py | akudan/purr | ca6a57217a2cd83fb267d06e8a77657e213f73ce | [
"MIT"
] | 1 | 2020-01-17T22:33:53.000Z | 2020-01-29T21:53:51.000Z | etl/transform/relation.py | akudan/purr | ca6a57217a2cd83fb267d06e8a77657e213f73ce | [
"MIT"
] | 1 | 2021-07-07T19:31:26.000Z | 2021-07-07T19:31:26.000Z | from etl.load import table, row, constraint
from etl.transform import type_checker
from etl.transform import unnester
def init_values(attrs):
"""
Sets value for every column to None
"""
for k, v in attrs.items():
attrs[k]["value"] = None
return attrs
def set_values(attr_details, doc, _ex... | 35.455041 | 82 | 0.538503 |
a540f1ff619ed3133058580d1a1da053fde29f50 | 91 | py | Python | busspottingbackend/spotting/apps.py | bmsleight/busspottingapp | 603a31eca9551852c1bdd917233b767d7fb776d7 | [
"MIT"
] | null | null | null | busspottingbackend/spotting/apps.py | bmsleight/busspottingapp | 603a31eca9551852c1bdd917233b767d7fb776d7 | [
"MIT"
] | null | null | null | busspottingbackend/spotting/apps.py | bmsleight/busspottingapp | 603a31eca9551852c1bdd917233b767d7fb776d7 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class SpottingConfig(AppConfig):
name = 'spotting'
| 15.166667 | 33 | 0.758242 |
8d939c4a1583d04095ffe426cc07e269eb03b971 | 2,288 | py | Python | train.py | fmisser/mlflow-example | 0a2699ad3c18987f73e3506efdf7b970c4bcfd2c | [
"Apache-2.0"
] | null | null | null | train.py | fmisser/mlflow-example | 0a2699ad3c18987f73e3506efdf7b970c4bcfd2c | [
"Apache-2.0"
] | null | null | null | train.py | fmisser/mlflow-example | 0a2699ad3c18987f73e3506efdf7b970c4bcfd2c | [
"Apache-2.0"
] | null | null | null | # The data set used in this example is from http://archive.ics.uci.edu/ml/datasets/Wine+Quality
# P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis.
# Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009.
import os
import warnings
i... | 33.15942 | 135 | 0.676573 |
23564ff3974c7e1fcc87fdef42ed2424afcf6109 | 21,771 | py | Python | GPy/testing/plotting_tests.py | mclaughlin6464/GPy | d006325ace0d82bcdde05ab384eac1d6a9c21c71 | [
"BSD-3-Clause"
] | 1 | 2021-07-19T13:02:39.000Z | 2021-07-19T13:02:39.000Z | GPy/testing/plotting_tests.py | mclaughlin6464/GPy | d006325ace0d82bcdde05ab384eac1d6a9c21c71 | [
"BSD-3-Clause"
] | null | null | null | GPy/testing/plotting_tests.py | mclaughlin6464/GPy | d006325ace0d82bcdde05ab384eac1d6a9c21c71 | [
"BSD-3-Clause"
] | null | null | null | #===============================================================================
# Copyright (c) 2015, Max Zwiessele
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source... | 42.688235 | 202 | 0.594231 |
8eb7081ca1edeb9c34310ac266b87748f90c7670 | 2,546 | py | Python | src/arch/x86/isa/insts/simd64/integer/__init__.py | qianlong4526888/haha | 01baf923693873c11ae072ce4dde3d8f1d7b6239 | [
"BSD-3-Clause"
] | 135 | 2016-10-21T03:31:49.000Z | 2022-03-25T01:22:20.000Z | src/arch/x86/isa/insts/simd64/integer/__init__.py | qianlong4526888/haha | 01baf923693873c11ae072ce4dde3d8f1d7b6239 | [
"BSD-3-Clause"
] | 35 | 2017-03-10T17:57:46.000Z | 2022-02-18T17:34:16.000Z | src/arch/x86/isa/insts/simd64/integer/__init__.py | qianlong4526888/haha | 01baf923693873c11ae072ce4dde3d8f1d7b6239 | [
"BSD-3-Clause"
] | 48 | 2016-12-08T12:03:13.000Z | 2022-02-16T09:16:13.000Z | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | 47.148148 | 72 | 0.752946 |
ee3aedd1e3298af3794542fe3e5245e32c98219d | 1,576 | py | Python | gatewayconfig/processors/diagnostics_processor.py | ganey/hm-config | b24dce9d9b10367010d163400b0a1bc8a482b252 | [
"MIT"
] | null | null | null | gatewayconfig/processors/diagnostics_processor.py | ganey/hm-config | b24dce9d9b10367010d163400b0a1bc8a482b252 | [
"MIT"
] | null | null | null | gatewayconfig/processors/diagnostics_processor.py | ganey/hm-config | b24dce9d9b10367010d163400b0a1bc8a482b252 | [
"MIT"
] | null | null | null | import json
import requests
from time import sleep
from gatewayconfig.logger import get_logger
from gatewayconfig.gatewayconfig_shared_state import GatewayconfigSharedState
logger = get_logger(__name__)
DIAGNOSTICS_REFRESH_SECONDS = 60
class DiagnosticsProcessor:
def __init__(self, diagnostics_json_url, shared_... | 33.531915 | 88 | 0.714467 |
9c4f93982cf9e328004ec8449e9b4b5ba99687dc | 1,242 | py | Python | bot_plugins/zhihu_daily.py | UtopiaXC/Utopia-Bot-For-QQ | 87281f509e20c2d5d25367614d5202f6e53cea50 | [
"MIT"
] | 5 | 2021-03-25T15:18:18.000Z | 2021-03-31T02:29:28.000Z | bot_plugins/zhihu_daily.py | UtopiaXC/Utopia-Bot-For-QQ | 87281f509e20c2d5d25367614d5202f6e53cea50 | [
"MIT"
] | null | null | null | bot_plugins/zhihu_daily.py | UtopiaXC/Utopia-Bot-For-QQ | 87281f509e20c2d5d25367614d5202f6e53cea50 | [
"MIT"
] | null | null | null | import asyncio
import random
import time
from nonebot.command import CommandSession
from nonebot.experimental.plugin import on_command
from aiocqhttp.message import MessageSegment # aiocqhttp 是 nonebot 的自带依赖
import requests
import json
__plugin_name__ = 'daily'
__plugin_usage__ = '用法: 对我说 "daily",我会回复随机一条知乎今日日报'
@... | 34.5 | 105 | 0.628019 |
28d72aefe0fadab55700194957aab9cf00aae605 | 1,924 | py | Python | homeassistant/components/auth/client.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 2 | 2018-02-14T07:29:46.000Z | 2018-02-20T08:15:51.000Z | homeassistant/components/auth/client.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:43:17.000Z | 2022-03-12T01:01:30.000Z | homeassistant/components/auth/client.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 1 | 2020-04-12T17:17:42.000Z | 2020-04-12T17:17:42.000Z | """Helpers to resolve client ID/secret."""
import base64
from functools import wraps
import hmac
import aiohttp.hdrs
def verify_client(method):
"""Decorator to verify client id/secret on requests."""
@wraps(method)
async def wrapper(view, request, *args, **kwargs):
"""Verify client id/secret befo... | 30.0625 | 78 | 0.644491 |
2a9400aa3477c80b252f7df9520b9095f7903d17 | 2,302 | py | Python | src/run_video.py | PartitionChoi/SSJointTracker_mod | 28aa6642a5ff74ab2a3abc6e5bd53b4a457585e5 | [
"Apache-2.0"
] | null | null | null | src/run_video.py | PartitionChoi/SSJointTracker_mod | 28aa6642a5ff74ab2a3abc6e5bd53b4a457585e5 | [
"Apache-2.0"
] | null | null | null | src/run_video.py | PartitionChoi/SSJointTracker_mod | 28aa6642a5ff74ab2a3abc6e5bd53b4a457585e5 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import time
import cv2
import numpy as np
from estimator import TfPoseEstimator
from networks import get_graph_path, model_wh
logger = logging.getLogger('TfPoseEstimator-Video')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.F... | 35.96875 | 118 | 0.652911 |
00788346e9785ab5ef59a72c494786341d4f8426 | 1,604 | py | Python | app/tasks.py | tinkerNamedFerro/5head.biz | 413da41f03e3b3f0ea0d86c0b56a8203867c7c3b | [
"MIT"
] | null | null | null | app/tasks.py | tinkerNamedFerro/5head.biz | 413da41f03e3b3f0ea0d86c0b56a8203867c7c3b | [
"MIT"
] | null | null | null | app/tasks.py | tinkerNamedFerro/5head.biz | 413da41f03e3b3f0ea0d86c0b56a8203867c7c3b | [
"MIT"
] | null | null | null | import os
import time
from celery import Celery
from celery.schedules import crontab
from datetime import datetime
from .dash.biz_insights import data_parsing
from .dash.biz_insights import getThreads
CELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'redis://localhost:6379'),
CELERY_RESULT_BACKEND = os.enviro... | 28.642857 | 206 | 0.692643 |
12ff2a9789410a10299974aaa8bef141ea107fb0 | 552 | py | Python | docker/demo9/main.py | aloa04/practice | 0f11874a597450a70f3c6f01fe64b6aa9e9d5b9f | [
"Apache-2.0"
] | null | null | null | docker/demo9/main.py | aloa04/practice | 0f11874a597450a70f3c6f01fe64b6aa9e9d5b9f | [
"Apache-2.0"
] | null | null | null | docker/demo9/main.py | aloa04/practice | 0f11874a597450a70f3c6f01fe64b6aa9e9d5b9f | [
"Apache-2.0"
] | null | null | null | from flask import Flask,request,abort
app = Flask(__name__)
usuarios=[1,2,3,4,5]
@app.route('/')
def index():
return 'Este es el ejercicio 3 y no te estas equivocando!'
@app.route('/users/<user_id>', methods = ['GET', 'POST', 'DELETE'])
def getuser(user_id):
if request.method == 'GET':
return "Lo ti... | 24 | 67 | 0.626812 |
c23c407dc687935b9b9d5d3c1e3ad82fc4bb7ef6 | 3,497 | py | Python | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/express_route_link.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/express_route_link.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/express_route_link.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"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 ... | 40.195402 | 85 | 0.631398 |
d66f4e1061e782f7cdbf1452c6b692ced550f168 | 6,581 | py | Python | streamlit_app.py | konvica/read-presonal-data | e3cfe0565c39f8226c91ac6e5d20c737da38283b | [
"MIT"
] | null | null | null | streamlit_app.py | konvica/read-presonal-data | e3cfe0565c39f8226c91ac6e5d20c737da38283b | [
"MIT"
] | null | null | null | streamlit_app.py | konvica/read-presonal-data | e3cfe0565c39f8226c91ac6e5d20c737da38283b | [
"MIT"
] | null | null | null | import io
import logging
import os
import cv2 as cv
import en_core_web_lg
import fitz
import numpy as np
import streamlit as st
from PIL import Image
from presidio_analyzer import AnalyzerEngine
from presidio_image_redactor import ImageAnalyzerEngine
SCORE_THRESHOLD = 0.5
def local_css(file_name):
with open(fil... | 32.579208 | 111 | 0.618447 |
2b79e058778226be0e1389bfb854952403efa106 | 6,435 | py | Python | feedreader/test_utils.py | fundor333/django-feedreader | 791eefb22720000723e4da293e97aeae2f4513b0 | [
"BSD-3-Clause"
] | 76 | 2015-02-12T01:07:18.000Z | 2022-02-20T13:53:36.000Z | feedreader/test_utils.py | fundor333/django-feedreader | 791eefb22720000723e4da293e97aeae2f4513b0 | [
"BSD-3-Clause"
] | 24 | 2015-02-22T16:20:08.000Z | 2021-09-25T08:37:29.000Z | feedreader/test_utils.py | fundor333/django-feedreader | 791eefb22720000723e4da293e97aeae2f4513b0 | [
"BSD-3-Clause"
] | 33 | 2015-03-31T15:51:29.000Z | 2022-02-20T13:46:59.000Z | """Feedreader Utils Unit Test."""
from datetime import datetime
from io import StringIO
from django.test import TestCase
from .models import Feed
from .utils import poll_feed
from unittest.mock import Mock, patch
import pytz
class PollFeedTest(TestCase):
"""
Test polling feeds.
"""
def setUp(self)... | 42.615894 | 98 | 0.623465 |
489b063a02c675a50c7e745eaf9da5a5f7f318c5 | 5,098 | py | Python | slash2/utils/tsuite2/tsuite_browser/tsuite_browser/api.py | zhihui-slash2/slash2-next | d174a735f9860d2d9e31c47548bda67257400804 | [
"0BSD"
] | null | null | null | slash2/utils/tsuite2/tsuite_browser/tsuite_browser/api.py | zhihui-slash2/slash2-next | d174a735f9860d2d9e31c47548bda67257400804 | [
"0BSD"
] | null | null | null | slash2/utils/tsuite2/tsuite_browser/tsuite_browser/api.py | zhihui-slash2/slash2-next | d174a735f9860d2d9e31c47548bda67257400804 | [
"0BSD"
] | null | null | null | from flask.ext.pymongo import PyMongo
class API(object):
def __init__(self, app):
self.app = app
self.mongo = PyMongo(app)
def _error(self, errid, msg):
"""Returns a generic error response."""
return {
"err": errid,
"err_msg": msg
}
def ge... | 31.276074 | 154 | 0.518831 |
c503b1c975f6dd156bc635359f5bdfb3018fc1b1 | 1,068 | py | Python | app/core/models.py | klimentru1986/drf-api | 8227ddc2833d0b79857d36c0832b7ca06c9a9046 | [
"MIT"
] | null | null | null | app/core/models.py | klimentru1986/drf-api | 8227ddc2833d0b79857d36c0832b7ca06c9a9046 | [
"MIT"
] | null | null | null | app/core/models.py | klimentru1986/drf-api | 8227ddc2833d0b79857d36c0832b7ca06c9a9046 | [
"MIT"
] | null | null | null | from django.contrib.auth.base_user import BaseUserManager
from django.db import models
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser, \
PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **kwargs):
if not email:
raise... | 30.514286 | 75 | 0.701311 |
a54f7ffa7651b8b8fa1da2de9b8d125082d1ca27 | 66,704 | py | Python | python3/diff_match_patch.py | 0xVK/diff-match-patch | 139df59d7f592652a01ff879c1c2498874e716f7 | [
"Apache-2.0"
] | 1 | 2017-02-21T19:03:28.000Z | 2017-02-21T19:03:28.000Z | python3/diff_match_patch.py | 0xVK/diff-match-patch | 139df59d7f592652a01ff879c1c2498874e716f7 | [
"Apache-2.0"
] | null | null | null | python3/diff_match_patch.py | 0xVK/diff-match-patch | 139df59d7f592652a01ff879c1c2498874e716f7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import re
import math
import sys
import time
import urllib.parse
class diff_match_patch:
"""Class containing the diff, match and patch methods.
Also contains the behaviour settings.
"""
def __init__(self):
"""Inits a diff_match_patch object with default settings.
Redefine these in ... | 35.144362 | 80 | 0.602962 |
93de84a5b45e31fa7adc00a1ea01364609fbf5c9 | 2,789 | py | Python | tests/conftest.py | Arax1/JobFunnel | 461aca3fd8d5c07fc4a57bf82d8bdc08a775e82b | [
"MIT"
] | null | null | null | tests/conftest.py | Arax1/JobFunnel | 461aca3fd8d5c07fc4a57bf82d8bdc08a775e82b | [
"MIT"
] | 1 | 2021-05-05T01:39:59.000Z | 2021-05-05T01:39:59.000Z | tests/conftest.py | Arax1/JobFunnel | 461aca3fd8d5c07fc4a57bf82d8bdc08a775e82b | [
"MIT"
] | null | null | null | import pytest
import sys
from unittest.mock import patch
from jobfunnel.config.parser import parse_config
from jobfunnel.tools.tools import config_factory
@pytest.fixture()
def configure_options():
def setup(options: list):
"""Assigns the options to argv(as if JobFunnel were called from the command line... | 40.42029 | 204 | 0.634995 |
6b015c7b8d5009e7101db5d3b399d2e31f165e64 | 4,320 | py | Python | kinow_client/models/product_price_prices.py | kinow-io/kinow-python-sdk | 4c1699a3c78048b84287bd049a669651a5b4e2d5 | [
"Apache-2.0"
] | 1 | 2019-06-26T14:24:54.000Z | 2019-06-26T14:24:54.000Z | kinow_client/models/product_price_prices.py | kinow-io/kinow-python-sdk | 4c1699a3c78048b84287bd049a669651a5b4e2d5 | [
"Apache-2.0"
] | null | null | null | kinow_client/models/product_price_prices.py | kinow-io/kinow-python-sdk | 4c1699a3c78048b84287bd049a669651a5b4e2d5 | [
"Apache-2.0"
] | 1 | 2018-02-01T10:08:40.000Z | 2018-02-01T10:08:40.000Z | # coding: utf-8
"""
Kinow API
Client API for Kinow back-office
OpenAPI spec version: 1.4.18
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ProductPricePrices(object):
"""
NO... | 26.832298 | 78 | 0.536111 |
d016eb25dd2b0d8a744f19effd5c41e76d8e5f60 | 8,360 | py | Python | main.py | jensen8786/snap-it-find-it | 2abbaa3bc63f94699b302a3f06e10d2bc64124d7 | [
"MIT"
] | null | null | null | main.py | jensen8786/snap-it-find-it | 2abbaa3bc63f94699b302a3f06e10d2bc64124d7 | [
"MIT"
] | null | null | null | main.py | jensen8786/snap-it-find-it | 2abbaa3bc63f94699b302a3f06e10d2bc64124d7 | [
"MIT"
] | null | null | null | import cv2
import pandas as pd
from io import BytesIO, StringIO
from PIL import Image
import math
import os.path
import image_search #this is to search similar image from extracted features
import object_detection_background_removal #this is using detectron
import logging
from telegram import ReplyKeyboardMarkup, Reply... | 37.321429 | 149 | 0.599641 |
4c54b20ea8da4db716770c70d8938a493b6da61e | 1,750 | py | Python | test_db/test_odd.py | robertchase/spindrift | e1ee59fd6822558cc47738d3221815064117457c | [
"MIT"
] | 1 | 2020-09-21T19:51:22.000Z | 2020-09-21T19:51:22.000Z | test_db/test_odd.py | robertchase/spindrift | e1ee59fd6822558cc47738d3221815064117457c | [
"MIT"
] | null | null | null | test_db/test_odd.py | robertchase/spindrift | e1ee59fd6822558cc47738d3221815064117457c | [
"MIT"
] | null | null | null | import pytest
import test_db.models as models
ROOTNAME = 'whatever'
@pytest.fixture
def data(sync):
root = models.OddKeysRoot(name=ROOTNAME).save(sync)
models.OddKeysNode(oddkeysroot=root, name=models.NODE1).save(sync)
models.OddKeysNode(oddkeysroot=root, name=models.NODE2).save(sync)
def test_simple... | 25.735294 | 70 | 0.700571 |
07166f7dce2d289b3cc7e12ee9f49aeb8f247780 | 404 | py | Python | MUNDO1/Ex018_Trigon.py | KayDeVC/Python-CeV | ad65b5d35987475479795fa752f6bd1f79c9953a | [
"MIT"
] | null | null | null | MUNDO1/Ex018_Trigon.py | KayDeVC/Python-CeV | ad65b5d35987475479795fa752f6bd1f79c9953a | [
"MIT"
] | null | null | null | MUNDO1/Ex018_Trigon.py | KayDeVC/Python-CeV | ad65b5d35987475479795fa752f6bd1f79c9953a | [
"MIT"
] | null | null | null | import math
print('@.@ T R I G O N O M Ê T R I A @.@')
ang = float(input('Diga o valor do ângulo:'))
sen = math.sin(math.radians(ang))
print('O SENO do ângulo {} é igual á: {:.2f}.'.format(ang, sen))
cos = math.cos(math.radians(ang))
print('O COSENO do ângulo {} é igual á: {:.2f}.'.format(ang, cos))
tan = math.tan(math... | 40.4 | 68 | 0.628713 |
c2399d7659e1e40900721ea830efa4ba8f79d4d6 | 4,200 | py | Python | scripts/format_pubs.py | James11222/James_CV | 5887c0ab6a9a8981db25bf30fcbed0b91f54ad30 | [
"CC-BY-4.0"
] | null | null | null | scripts/format_pubs.py | James11222/James_CV | 5887c0ab6a9a8981db25bf30fcbed0b91f54ad30 | [
"CC-BY-4.0"
] | null | null | null | scripts/format_pubs.py | James11222/James_CV | 5887c0ab6a9a8981db25bf30fcbed0b91f54ad30 | [
"CC-BY-4.0"
] | null | null | null | """
Heavily inspired by dfm/cv/scripts/render.py
"""
import ads
from datetime import date
from operator import itemgetter
import json
import importlib.util
import os
here = os.path.abspath('')
spec = importlib.util.spec_from_file_location(
"utf8totex", os.path.join(here, "utf8totex.py")
)
utf8totex = importlib.ut... | 29.577465 | 83 | 0.526429 |
ec7411b5f172a7ac6a100a0190bcbdabbad66c0e | 2,703 | py | Python | lib/surface/functions/remove_invoker_policy_binding.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/functions/remove_invoker_policy_binding.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/functions/remove_invoker_policy_binding.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2021 Google LLC. 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 requir... | 31.8 | 89 | 0.749168 |
c3ff1ba364c0b884e2e0740da54e94878190d931 | 1,332 | py | Python | tests/test_doubles/sandbox_test.py | Avvir/pyne | 864885a8fb632b72c00af164f150b1daa38a346f | [
"MIT"
] | 4 | 2018-08-10T20:05:10.000Z | 2019-07-24T15:29:32.000Z | tests/test_doubles/sandbox_test.py | Avvir/pyne | 864885a8fb632b72c00af164f150b1daa38a346f | [
"MIT"
] | 6 | 2018-09-25T20:15:51.000Z | 2021-12-22T17:09:52.000Z | tests/test_doubles/sandbox_test.py | Avvir/pyne | 864885a8fb632b72c00af164f150b1daa38a346f | [
"MIT"
] | null | null | null | from pynetest.test_doubles.sandbox import Sandbox
from tests.test_helpers.some_class import SomeClass
def test__sandbox_spies():
sandbox = Sandbox()
some_class_instance = SomeClass()
sandbox.spy(some_class_instance.some_method)
assert len(sandbox._spies) == 1
def test__sandbox_restore():
sandbox... | 29.6 | 75 | 0.759009 |
fd5e18196e6fb1f54cc150d8a89b49a14e9213a1 | 142 | py | Python | src/tess_atlas/cfg.py | dfm/tess-atlas | 0831d15b65ce2ac345dd3f7a4eac8a14883dcccc | [
"MIT"
] | 10 | 2019-03-26T19:47:03.000Z | 2021-12-15T11:44:31.000Z | src/tess_atlas/cfg.py | dfm/tess-atlas | 0831d15b65ce2ac345dd3f7a4eac8a14883dcccc | [
"MIT"
] | 98 | 2019-03-27T16:12:02.000Z | 2022-03-15T21:32:09.000Z | src/tess_atlas/cfg.py | dfm/tess-atlas | 0831d15b65ce2ac345dd3f7a4eac8a14883dcccc | [
"MIT"
] | 7 | 2019-03-26T19:47:11.000Z | 2020-10-07T03:26:21.000Z | c = get_config()
c.NbConvertApp.export_format = "html"
c.Exporter.preprocessors = [
"nbconvert.preprocessors.ExtractOutputPreprocessor"
]
| 23.666667 | 55 | 0.774648 |
e31da3a86918824ec976191bba52d10614a25517 | 261 | py | Python | config/my_config.py | GeorgeManakanatas/PPDM | 9e6af80681db497447197cac14b26b99e588f231 | [
"MIT",
"Unlicense"
] | 3 | 2016-11-18T07:24:39.000Z | 2019-07-06T07:45:15.000Z | config/my_config.py | GeorgeManakanatas/PPDM | 9e6af80681db497447197cac14b26b99e588f231 | [
"MIT",
"Unlicense"
] | 2 | 2017-02-14T15:24:34.000Z | 2019-11-25T19:18:05.000Z | config/my_config.py | GeorgeManakanatas/PPDM | 9e6af80681db497447197cac14b26b99e588f231 | [
"MIT",
"Unlicense"
] | 3 | 2017-12-19T07:04:24.000Z | 2021-08-20T15:42:13.000Z | import json
def config_file():
'''
Reads configuration file and saves in global variable
'''
global config_values
# read configuration file
with open('config/config.json', 'r') as conf:
config_values = json.load(conf)
return | 23.727273 | 57 | 0.659004 |
d379be349165ff30c2713ed809be80027cf9d342 | 2,036 | py | Python | kargo/contrib/aws_inventory/kargo-aws-inventory.py | sameerawickramasekara/k8s-on-openstack | aca59b30220568a9b90f371291587d63a37e8429 | [
"Apache-2.0"
] | null | null | null | kargo/contrib/aws_inventory/kargo-aws-inventory.py | sameerawickramasekara/k8s-on-openstack | aca59b30220568a9b90f371291587d63a37e8429 | [
"Apache-2.0"
] | 2 | 2018-02-19T12:27:11.000Z | 2018-02-21T18:57:14.000Z | kargo/contrib/aws_inventory/kargo-aws-inventory.py | sameerawickramasekara/k8s-on-openstack | aca59b30220568a9b90f371291587d63a37e8429 | [
"Apache-2.0"
] | 4 | 2018-02-09T11:31:50.000Z | 2018-02-21T12:38:51.000Z | #!/usr/bin/env python
import boto3
import os
import argparse
import json
class SearchEC2Tags(object):
def __init__(self):
self.parse_args()
if self.args.list:
self.search_tags()
if self.args.host:
data = {}
print json.dumps(data, indent=2)
def parse_args(self):
##Check if VPC_... | 32.83871 | 151 | 0.642927 |
83f0694680cbfaec06031dcda77e31d31c75b164 | 2,032 | py | Python | applications/collect_ppmi_volumes_direct_reg_seg_mjff_20210401.py | stnava/superiq | a13befe5f525bbef02cd095031952db62c5d054e | [
"Apache-2.0"
] | null | null | null | applications/collect_ppmi_volumes_direct_reg_seg_mjff_20210401.py | stnava/superiq | a13befe5f525bbef02cd095031952db62c5d054e | [
"Apache-2.0"
] | null | null | null | applications/collect_ppmi_volumes_direct_reg_seg_mjff_20210401.py | stnava/superiq | a13befe5f525bbef02cd095031952db62c5d054e | [
"Apache-2.0"
] | null | null | null | from superiq import VolumeData
from superiq.pipeline_utils import *
import boto3
import pandas as pd
from datetime import datetime
def collect_brain_age(bucket, version):
prefix = f"superres-pipeline-{version}/"
objects = list_images(bucket, prefix)
brain_age = [i for i in objects if i.endswith('brain_age.csv')]
d... | 35.034483 | 102 | 0.744587 |
41cb241d377fe959bcf3a0dacb7cc1de9ea1a93b | 2,967 | py | Python | tests/components/sonos/test_switch.py | NikoM87/core | 7403ba1e81579b4ab83da24e570d4afe864e6312 | [
"Apache-2.0"
] | 2 | 2020-07-24T07:40:10.000Z | 2020-09-20T18:02:12.000Z | tests/components/sonos/test_switch.py | NikoM87/core | 7403ba1e81579b4ab83da24e570d4afe864e6312 | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | tests/components/sonos/test_switch.py | kmdm/home-assistant | 4007430d7262ef035bb80affea13657fdc993b1d | [
"Apache-2.0"
] | null | null | null | """Tests for the Sonos Alarm switch platform."""
from homeassistant.components.sonos import DOMAIN
from homeassistant.components.sonos.switch import (
ATTR_DURATION,
ATTR_ID,
ATTR_INCLUDE_LINKED_ZONES,
ATTR_PLAY_MODE,
ATTR_RECURRENCE,
ATTR_VOLUME,
)
from homeassistant.const import ATTR_TIME, STA... | 38.038462 | 88 | 0.782272 |
555bfaa44be639e849d7d2478c32b54e5b4426f6 | 383 | py | Python | src/UnderGUI/__init__.py | underwatergrasshopper/PyUnderGUI | 9a3107bbcf04168eb131a6dae5d50ff35b00ea7f | [
"MIT"
] | null | null | null | src/UnderGUI/__init__.py | underwatergrasshopper/PyUnderGUI | 9a3107bbcf04168eb131a6dae5d50ff35b00ea7f | [
"MIT"
] | null | null | null | src/UnderGUI/__init__.py | underwatergrasshopper/PyUnderGUI | 9a3107bbcf04168eb131a6dae5d50ff35b00ea7f | [
"MIT"
] | null | null | null | from .Exceptions import *
from .Commons import *
from .Utility import *
from .Color import *
from .GlyphCodeBlocks import *
from .FontFetcher import *
from .Font import *
from .TextDrawer import *
from .FramedText import *
def print_heyo():
... | 22.529412 | 32 | 0.558747 |
ae6865ad79384db5403610dedfb774413c0be80e | 27,925 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_security_groups_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_security_groups_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_security_groups_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 ... | 49.955277 | 211 | 0.669329 |
30c97f3462168acdec7bbb1f631aa2a91cc7163a | 16,024 | py | Python | tests/shakelib/sites_test.py | ynthdhj/shakemap | 2771b8aee6b22f065cc80632c894a0ba77829619 | [
"CC0-1.0"
] | null | null | null | tests/shakelib/sites_test.py | ynthdhj/shakemap | 2771b8aee6b22f065cc80632c894a0ba77829619 | [
"CC0-1.0"
] | null | null | null | tests/shakelib/sites_test.py | ynthdhj/shakemap | 2771b8aee6b22f065cc80632c894a0ba77829619 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# stdlib imports
import sys
import os.path
import numpy as np
import pytest
# local imports
from shakelib.sites import Sites
import shakelib.sites as sites
homedir = os.path.dirname(os.path.abspath(__file__)) # where is this script?
shakedir = os.path.abspath(os.path.join(homedir, '..', '..')... | 47.690476 | 88 | 0.536757 |
3c6ec2b2820b866ccc303071c6960fd3f84b28ca | 12,613 | py | Python | tests/test_phoenix_channel_subscription.py | chadfurman/gql | ca4021df2cd7ee9b5057ebddb7bf0408e45a1dba | [
"MIT"
] | 2 | 2021-08-22T16:12:15.000Z | 2021-11-09T11:58:42.000Z | tests/test_phoenix_channel_subscription.py | chadfurman/gql | ca4021df2cd7ee9b5057ebddb7bf0408e45a1dba | [
"MIT"
] | null | null | null | tests/test_phoenix_channel_subscription.py | chadfurman/gql | ca4021df2cd7ee9b5057ebddb7bf0408e45a1dba | [
"MIT"
] | null | null | null | import asyncio
import json
import sys
import pytest
from parse import search
from gql import Client, gql
# Marking all tests in this file with the websockets marker
pytestmark = pytest.mark.websockets
test_channel = "test_channel"
test_subscription_id = "test_subscription"
# A server should send this after receivi... | 31.690955 | 86 | 0.602157 |
cff6141467332bb1acfe1d3cc7b7f01c5560a439 | 496 | py | Python | variation/tokenizers/coding_dna_deletion.py | cancervariants/variant-normalization | e89a9f8366a659c82b2042aeb7effe339851bfb4 | [
"MIT"
] | 1 | 2022-01-19T18:17:49.000Z | 2022-01-19T18:17:49.000Z | variation/tokenizers/coding_dna_deletion.py | cancervariants/variation-normalization | 9c8fbab1562591ae9445d82ddd15df29f1ea1f5a | [
"MIT"
] | 99 | 2021-06-07T12:50:34.000Z | 2022-03-23T13:38:29.000Z | variation/tokenizers/coding_dna_deletion.py | cancervariants/variant-normalization | e89a9f8366a659c82b2042aeb7effe339851bfb4 | [
"MIT"
] | null | null | null | """A module for Coding DNA Deletion Tokenization."""
from variation.schemas.token_response_schema import CodingDNADeletionToken
from variation.tokenizers.deletion_base import DeletionBase
class CodingDNADeletion(DeletionBase):
"""Class for tokenizing Deletion at the coding dna reference sequence."""
def retu... | 38.153846 | 77 | 0.745968 |
507728e576fac03d9b561932cbf42a352c94f536 | 7,815 | py | Python | training/ModelsGaussianProcessRegression.py | grimmlab/evars-gpr | 8587f39edaba3b753c62fbd09ec6a78476a3612e | [
"MIT"
] | 3 | 2021-07-13T21:45:54.000Z | 2022-01-27T07:54:58.000Z | training/ModelsGaussianProcessRegression.py | grimmlab/evars-gpr | 8587f39edaba3b753c62fbd09ec6a78476a3612e | [
"MIT"
] | null | null | null | training/ModelsGaussianProcessRegression.py | grimmlab/evars-gpr | 8587f39edaba3b753c62fbd09ec6a78476a3612e | [
"MIT"
] | 1 | 2021-09-22T18:25:03.000Z | 2021-09-22T18:25:03.000Z | import sklearn.gaussian_process
import pandas as pd
import numpy as np
import copy
from training import ModelsBaseClass
class GaussianProcessRegression(ModelsBaseClass.BaseModel):
"""Class containing Gaussian Process Regression Model"""
def __init__(self, target_column: str, seasonal_periods: int, kernel=Non... | 51.754967 | 120 | 0.550736 |
b289002544a36080e565b1302d97d35e4f067ff4 | 2,470 | py | Python | pythran/tests/rosetta/permutation_rank.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 1,647 | 2015-01-13T01:45:38.000Z | 2022-03-28T01:23:41.000Z | pythran/tests/rosetta/permutation_rank.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 1,116 | 2015-01-01T09:52:05.000Z | 2022-03-18T21:06:40.000Z | pythran/tests/rosetta/permutation_rank.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 180 | 2015-02-12T02:47:28.000Z | 2022-03-14T10:28:18.000Z | #from http://rosettacode.org/wiki/Permutations/Rank_of_a_permutation#Python
#pythran export test()
#runas test()
from math import factorial as fact
from random import randrange
def identity_perm(n):
return list(range(n))
def unranker1(n, r, pi):
while n > 0:
n1, (rdivn, rmodn) = n-1, divmod(r, n)
... | 27.444444 | 81 | 0.554251 |
0b3c9d5655359ad0e151206ba5e056932d290a9d | 209,347 | py | Python | test_gm.py | wadeguthrie/combat-accountant | e6a2140baafe71191cf68e01390b1f91446e17aa | [
"Apache-2.0"
] | null | null | null | test_gm.py | wadeguthrie/combat-accountant | e6a2140baafe71191cf68e01390b1f91446e17aa | [
"Apache-2.0"
] | 58 | 2019-10-16T21:48:37.000Z | 2021-09-08T22:33:22.000Z | test_gm.py | wadeguthrie/combat-accountant | e6a2140baafe71191cf68e01390b1f91446e17aa | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
import argparse
import copy
import curses
import pprint
import random
import unittest
import ca # combat accountant
import ca_fighter
import ca_gurps_ruleset
import ca_timers
'''
FWIW, I realize that many of the Mocks in here are actually Fakes.
'''
# TODO: test options
# TODO: there should be... | 40.143241 | 91 | 0.52038 |
7f1e17518075a9abc7bc3c5cbb5967f5b7bdba2a | 1,653 | py | Python | kas-structure.py | clarinsi/kas-struct | ba1083cbbb19836b8f9ff4a6a4ffeed56e62a52a | [
"Apache-2.0"
] | null | null | null | kas-structure.py | clarinsi/kas-struct | ba1083cbbb19836b8f9ff4a6a4ffeed56e62a52a | [
"Apache-2.0"
] | null | null | null | kas-structure.py | clarinsi/kas-struct | ba1083cbbb19836b8f9ff4a6a4ffeed56e62a52a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#-*-encoding:utf-8-*-
import re
import sys
import pickle
import numpy as np
import pycrfsuite
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report, confusion_matrix
from collections import Counter
from train_main import extract,enforce_constraints
impo... | 26.238095 | 269 | 0.724743 |
3ee0332ffb0b0cb77ae418265f4bbf19199ae3ac | 2,242 | py | Python | dice_rolling_simulator.py | RamPrasath008/Demo | 3d4ee06249cf5697c72bae4e2732e814dde97dec | [
"MIT"
] | 2 | 2018-08-11T21:54:07.000Z | 2018-08-11T21:54:13.000Z | dice_rolling_simulator.py | rajasree-r/Python | 3d4ee06249cf5697c72bae4e2732e814dde97dec | [
"MIT"
] | null | null | null | dice_rolling_simulator.py | rajasree-r/Python | 3d4ee06249cf5697c72bae4e2732e814dde97dec | [
"MIT"
] | 1 | 2018-09-20T23:41:31.000Z | 2018-09-20T23:41:31.000Z | #Made on May 27th, 2017
#Made by SlimxShadyx
#Editted by CaptMcTavish, June 17th, 2017
#Comments edits by SlimxShadyx, August 11th, 2017
#Dice Rolling Simulator
import random
global user_exit_checker
user_exit_checker="exit"
#Our start function (What the user will first see when starting the program)
def start():
... | 25.770115 | 118 | 0.672168 |
86d6b1696f13a9b7ce83a612a2558d6f2e4ac233 | 791 | py | Python | api-gateway/tests/test_get_scans.py | Niweera/DNSTool-Middleware-API | 0e83d9f62fb65d9223b86a7876b3f30b2771befb | [
"Apache-2.0"
] | null | null | null | api-gateway/tests/test_get_scans.py | Niweera/DNSTool-Middleware-API | 0e83d9f62fb65d9223b86a7876b3f30b2771befb | [
"Apache-2.0"
] | 9 | 2021-06-12T05:39:59.000Z | 2021-08-14T09:20:00.000Z | api-gateway/tests/test_get_scans.py | Niweera/DNSTool-Middleware-API | 0e83d9f62fb65d9223b86a7876b3f30b2771befb | [
"Apache-2.0"
] | 2 | 2021-05-22T15:33:50.000Z | 2021-08-28T08:51:25.000Z | from typing import Dict, Any
from unittest import TestCase
from server import app
from flask.testing import FlaskClient
from werkzeug.test import TestResponse
from tests.test_firebaser import get_id_token
class TestScansController(TestCase):
def setUp(self) -> None:
self.app: FlaskClient = app.test_client... | 32.958333 | 75 | 0.687737 |
5ad8a5a4c2fbb84cc9ceefaff9d9848c65e78ef7 | 2,047 | py | Python | analytical/templatetags/crazy_egg.py | likecodeingloveproblems/django-analytical | e73cc8b87565381370e9825fdfa036935512bc42 | [
"MIT"
] | null | null | null | analytical/templatetags/crazy_egg.py | likecodeingloveproblems/django-analytical | e73cc8b87565381370e9825fdfa036935512bc42 | [
"MIT"
] | null | null | null | analytical/templatetags/crazy_egg.py | likecodeingloveproblems/django-analytical | e73cc8b87565381370e9825fdfa036935512bc42 | [
"MIT"
] | null | null | null | """
Crazy Egg template tags and filters.
"""
import re
from django.template import Library, Node, TemplateSyntaxError
from analytical.utils import is_internal_ip, disable_html, get_required_setting
ACCOUNT_NUMBER_RE = re.compile(r'^\d+$')
SETUP_CODE = '<script type="text/javascript" src="{placeholder_url}">' \
... | 30.552239 | 79 | 0.614558 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.