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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8b6839e15346d4fa0f503961a394f8aac500f896 | 27,610 | py | Python | grr/lib/aff4_objects/cronjobs_test.py | StanislavParovoy/GRR | 7cdf490f9be2ccc0a8160c9b8ae23b73922049d5 | [
"Apache-2.0"
] | 5 | 2017-03-17T08:25:09.000Z | 2022-02-22T05:28:14.000Z | grr/lib/aff4_objects/cronjobs_test.py | StanislavParovoy/GRR | 7cdf490f9be2ccc0a8160c9b8ae23b73922049d5 | [
"Apache-2.0"
] | null | null | null | grr/lib/aff4_objects/cronjobs_test.py | StanislavParovoy/GRR | 7cdf490f9be2ccc0a8160c9b8ae23b73922049d5 | [
"Apache-2.0"
] | 3 | 2018-12-07T07:04:37.000Z | 2022-02-22T05:28:16.000Z | #!/usr/bin/env python
import random
import time
import mock
from grr.lib import aff4
from grr.lib import flags
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import stats
from grr.lib import test_lib
from grr.lib.aff4_objects import cronjobs
from grr.lib.rdfvalues import cronjobs as rdf_cronjobs
... | 36.862483 | 80 | 0.719124 |
88a73645ae7fca3e18a9cb0b81930fa4d4f0d1a8 | 1,359 | py | Python | chat/views.py | jtkim03/Find-a-QT | a330c95f76bcc148febf39284c07d3ac4f909b4e | [
"BSD-3-Clause"
] | null | null | null | chat/views.py | jtkim03/Find-a-QT | a330c95f76bcc148febf39284c07d3ac4f909b4e | [
"BSD-3-Clause"
] | 9 | 2021-03-30T13:42:35.000Z | 2022-03-12T00:36:19.000Z | chat/views.py | jtkim03/Find-a-QT | a330c95f76bcc148febf39284c07d3ac4f909b4e | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import render
from .models import Room
from django.conf import settings
from django.http import JsonResponse
from twilio.jwt.access_token import AccessToken
from twilio.jwt.access_token.grants import ChatGrant
def token(request):
identity = request.GET.get('identity', request.user.username... | 30.886364 | 76 | 0.711553 |
8a0b97876d23f2e1dc4aedb1930a4cd1eaf7049b | 3,510 | py | Python | source/vsm/vsm/api/v1/ec_profiles.py | ramkrsna/virtual-storage-manager | 78125bfb4dd4d78ff96bc3274c8919003769c545 | [
"Apache-2.0"
] | null | null | null | source/vsm/vsm/api/v1/ec_profiles.py | ramkrsna/virtual-storage-manager | 78125bfb4dd4d78ff96bc3274c8919003769c545 | [
"Apache-2.0"
] | null | null | null | source/vsm/vsm/api/v1/ec_profiles.py | ramkrsna/virtual-storage-manager | 78125bfb4dd4d78ff96bc3274c8919003769c545 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Intel Inc.
# 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
#... | 34.752475 | 95 | 0.692593 |
0e00c58296c0592d9b7c472c8563a8f6a5a8d64b | 2,115 | py | Python | src/Main.py | 425776024/MOEAD | 4ac24e62e8e89698c292cb942004f386005fd71e | [
"Apache-2.0"
] | 91 | 2018-12-05T06:10:23.000Z | 2022-03-19T15:40:49.000Z | src/Main.py | HadwinLing/MOEAD | 4ac24e62e8e89698c292cb942004f386005fd71e | [
"Apache-2.0"
] | 1 | 2020-05-18T14:54:59.000Z | 2020-05-22T11:04:32.000Z | src/Main.py | HadwinLing/MOEAD | 4ac24e62e8e89698c292cb942004f386005fd71e | [
"Apache-2.0"
] | 31 | 2019-02-14T13:00:33.000Z | 2022-02-28T15:04:23.000Z | import time
# import src.problem.DTLZ1 as DTLZ1
import src.problem.KUR as KUR
# import src.problem.SCH as SCH
import src.problem.ZDT1 as ZDT1
import src.problem.ZDT2 as ZDT2
import src.problem.ZDT3 as ZDT3
import src.problem.ZDT4 as ZDT4
from src.utils import Utils
class MOEAD:
# 0表示最小化目标求解,1最大化目标求解。(约定)
pro... | 22.03125 | 83 | 0.591017 |
554cc288467ba557060c05ee6ca9976dc16caa73 | 674 | py | Python | src/__init__.py | wanghy-anl/TEAL | 500f1ac6fa3a308fbee328abc6a165205019df70 | [
"Apache-2.0"
] | 3 | 2020-07-28T21:37:02.000Z | 2021-05-28T22:46:32.000Z | src/__init__.py | wanghy-anl/TEAL | 500f1ac6fa3a308fbee328abc6a165205019df70 | [
"Apache-2.0"
] | 37 | 2020-07-31T15:15:04.000Z | 2022-03-28T17:34:36.000Z | src/__init__.py | wanghy-anl/TEAL | 500f1ac6fa3a308fbee328abc6a165205019df70 | [
"Apache-2.0"
] | 12 | 2020-07-31T14:49:23.000Z | 2022-03-28T22:59:38.000Z | # Copyright 2020, Battelle Energy Alliance, 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 required by a... | 30.636364 | 74 | 0.750742 |
f6905dfa8b5a4fd66f57f8cc0be411d9b4cf5a3e | 458 | py | Python | qcloudsdklive/DescribeLVBOnlineUsersRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdklive/DescribeLVBOnlineUsersRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdklive/DescribeLVBOnlineUsersRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class DescribeLVBOnlineUsersRequest(Request):
def __init__(self):
super(DescribeLVBOnlineUsersRequest, self).__init__(
'live', 'qcloudcliV1', 'DescribeLVBOnlineUsers', 'live.api.qcloud.com')
def get_channelIds(self):
... | 28.625 | 83 | 0.69869 |
d075444f1dab57ddde06538e765b0d611b88dc12 | 1,028 | py | Python | tests/unit/output/test_yaml_out.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-01-21T00:18:25.000Z | 2021-07-11T07:35:26.000Z | tests/unit/output/test_yaml_out.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | tests/unit/output/test_yaml_out.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-01-05T09:50:42.000Z | 2019-08-19T01:43:40.000Z | # -*- coding: utf-8 -*-
'''
unittests for yaml outputter
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.support.mock import patch
# Import Salt Libs
import salt.output... | 26.358974 | 62 | 0.660506 |
61de177d288bc418d34d107adcfa5a1c175c9a57 | 27,259 | py | Python | sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-02-18T01:17:27.000Z | 2022-02-18T01:17:27.000Z | sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import json
import datetime
from typing import Any, List, Union, TYPE_CHECKING, overload, Optional
from azure.core.tracing.decorator_async import distributed_trace_asyn... | 50.761639 | 118 | 0.689607 |
71250914a4ba39ba257dcc00de80f0cf57903ef4 | 1,577 | py | Python | Braid.py | jbzdarkid/Random | d0979ca28ecc408d1fa7f2fa7cca96c80ac57376 | [
"Apache-2.0"
] | 1 | 2017-11-01T10:22:53.000Z | 2017-11-01T10:22:53.000Z | Braid.py | jbzdarkid/Random | d0979ca28ecc408d1fa7f2fa7cca96c80ac57376 | [
"Apache-2.0"
] | 1 | 2018-03-16T17:50:23.000Z | 2018-03-16T17:51:15.000Z | Braid.py | jbzdarkid/Random | d0979ca28ecc408d1fa7f2fa7cca96c80ac57376 | [
"Apache-2.0"
] | 5 | 2015-07-02T17:09:32.000Z | 2017-10-04T07:08:00.000Z | puzzleMaps = [[
[1,1,3,1],
[3,2,0,0],
[1,0,1,3]
],[
[0,1,1,3],
[3,1,2,2],
[2,0,0,2]
],[
[2,1,3,2],
[0,3,0,1],
[2,2,3,1]
],[
[3,0,3,2],
[1,2,0,1],
[1,3,2,0]
],[
[2,2,0,1],
[3,0,0,1],
[3,1,2,0]
]]
for puzzleMap in puzzleMaps:
minRotation = 999
minBuffer = ''
for i in range(4):
for... | 23.537313 | 70 | 0.44071 |
684cde635da7d6c37c60d9495740f0c364304d59 | 1,266 | py | Python | src/neural_network/nonsequential_multi_class/nonsequential_multi_class_cnn.py | ab3llini/ASLRecognizer | 9a98887b13b73bb81bd4d6d8ebbfb13c4ef7e856 | [
"MIT"
] | null | null | null | src/neural_network/nonsequential_multi_class/nonsequential_multi_class_cnn.py | ab3llini/ASLRecognizer | 9a98887b13b73bb81bd4d6d8ebbfb13c4ef7e856 | [
"MIT"
] | null | null | null | src/neural_network/nonsequential_multi_class/nonsequential_multi_class_cnn.py | ab3llini/ASLRecognizer | 9a98887b13b73bb81bd4d6d8ebbfb13c4ef7e856 | [
"MIT"
] | 1 | 2019-04-16T17:20:28.000Z | 2019-04-16T17:20:28.000Z | from src.data.dataset_manager import DatasetManager
from src.neural_network.trainer.KerasModel import Kerasmodel
from src.models import cnn
import keras
if __name__ == '__main__':
# load
load = True
# learning rate
lr = 1e-6
wd = 1e-3 # l2 regularization coefficient
# dataset creation
dat... | 32.461538 | 89 | 0.609795 |
17fad58163a5db5bed534d14382500c5de3df583 | 9,321 | py | Python | spht/jobs.py | consbio/spht | 96ec6a0931851b33eace08720d4d18ab34775a52 | [
"BSD-2-Clause"
] | 1 | 2019-08-04T21:13:41.000Z | 2019-08-04T21:13:41.000Z | spht/jobs.py | consbio/spht | 96ec6a0931851b33eace08720d4d18ab34775a52 | [
"BSD-2-Clause"
] | 23 | 2018-04-12T20:43:15.000Z | 2022-02-10T12:10:53.000Z | spht/jobs.py | consbio/spht | 96ec6a0931851b33eace08720d4d18ab34775a52 | [
"BSD-2-Clause"
] | null | null | null | import asyncio
import math
import os
from asyncio import ensure_future
from base64 import b64encode
from io import BytesIO
from uuid import uuid4
import aiohttp
import mercantile
import numpy
from PIL import Image
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.ti... | 40.176724 | 131 | 0.632657 |
ac6c884e9ecb880db27724e00421d473a9ba365c | 16,983 | py | Python | lemur/sources/service.py | douglasc-nflx/lemur | 5ea0b959289896ce546b257ed7a74c5ecdb3e38d | [
"Apache-2.0"
] | null | null | null | lemur/sources/service.py | douglasc-nflx/lemur | 5ea0b959289896ce546b257ed7a74c5ecdb3e38d | [
"Apache-2.0"
] | 66 | 2021-11-10T17:41:41.000Z | 2022-03-28T16:57:03.000Z | lemur/sources/service.py | douglasc-nflx/lemur | 5ea0b959289896ce546b257ed7a74c5ecdb3e38d | [
"Apache-2.0"
] | null | null | null | """
.. module: lemur.sources.service
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import arrow
from datetime import timedelta
import copy
from flask import current_app
fr... | 36.366167 | 119 | 0.656421 |
cf63c7cf6c0a4c0c697160ffefc97d419289a57d | 3,870 | py | Python | form_image_bbox_editor_ui.py | michalfapso/kdenlive_slideshow_editor | 7f4b7757fa6c9140e57691cce61cb910dc7a36cb | [
"MIT"
] | null | null | null | form_image_bbox_editor_ui.py | michalfapso/kdenlive_slideshow_editor | 7f4b7757fa6c9140e57691cce61cb910dc7a36cb | [
"MIT"
] | null | null | null | form_image_bbox_editor_ui.py | michalfapso/kdenlive_slideshow_editor | 7f4b7757fa6c9140e57691cce61cb910dc7a36cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'form_image_bbox_editor.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_FormImageBboxEditor(object):
def setupUi(self, Form... | 53.75 | 103 | 0.75814 |
ce34d8be0ac0e82f1c79f1e55cd24ad2bb343057 | 3,010 | py | Python | yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py | alexnemes/yardstick_dpdk | a9ed44428d1b3c9e1f728b3d1f809202fceb6734 | [
"Apache-2.0"
] | null | null | null | yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py | alexnemes/yardstick_dpdk | a9ed44428d1b3c9e1f728b3d1f809202fceb6734 | [
"Apache-2.0"
] | null | null | null | yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py | alexnemes/yardstick_dpdk | a9ed44428d1b3c9e1f728b3d1f809202fceb6734 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2016 Juan Qiu and others
# juan_ qiu@tongji.edu.cn
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distributi... | 33.444444 | 78 | 0.647841 |
086e74542e99c7d419aa9b17356ed4a54fc3dd5c | 26,448 | py | Python | cellpose/transforms.py | thccheung/cellpose | 873641ed5b78c3fd8eff7eeb08bf30c0d751e272 | [
"BSD-3-Clause"
] | null | null | null | cellpose/transforms.py | thccheung/cellpose | 873641ed5b78c3fd8eff7eeb08bf30c0d751e272 | [
"BSD-3-Clause"
] | null | null | null | cellpose/transforms.py | thccheung/cellpose | 873641ed5b78c3fd8eff7eeb08bf30c0d751e272 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import warnings
import cv2
import logging
transforms_logger = logging.getLogger(__name__)
from . import dynamics, utils
def _taper_mask(ly=224, lx=224, sig=7.5):
bsize = max(224, max(ly, lx))
xm = np.arange(bsize)
xm = np.abs(xm - xm.mean())
mask = 1/(1 + np.exp((xm - (bsize/2-20))... | 34.617801 | 186 | 0.563975 |
ed86adc1a1b23010051d897271390ab4b4f37d93 | 18,783 | py | Python | python/pipeline/pipeline_server.py | cg82616424/Serving | ce7388491c56fbd032567328883130601cae3f23 | [
"Apache-2.0"
] | 2 | 2021-11-16T02:36:03.000Z | 2022-03-23T11:45:46.000Z | python/pipeline/pipeline_server.py | cg82616424/Serving | ce7388491c56fbd032567328883130601cae3f23 | [
"Apache-2.0"
] | null | null | null | python/pipeline/pipeline_server.py | cg82616424/Serving | ce7388491c56fbd032567328883130601cae3f23 | [
"Apache-2.0"
] | 1 | 2022-03-23T11:42:52.000Z | 2022-03-23T11:42:52.000Z | # Copyright (c) 2020 PaddlePaddle 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 app... | 35.439623 | 80 | 0.547783 |
9e62aece35d117793fd5d5788ce53db06f6cb03a | 11,233 | py | Python | cairis/data/UseCaseDAO.py | D-Dev/cairis | 946815d7ccc7566bb121addb31acf1fa5bc8a702 | [
"Apache-2.0"
] | null | null | null | cairis/data/UseCaseDAO.py | D-Dev/cairis | 946815d7ccc7566bb121addb31acf1fa5bc8a702 | [
"Apache-2.0"
] | null | null | null | cairis/data/UseCaseDAO.py | D-Dev/cairis | 946815d7ccc7566bb121addb31acf1fa5bc8a702 | [
"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... | 35.547468 | 249 | 0.693581 |
60dee4904c1904c513b6c32700e192b28d46b24f | 1,673 | py | Python | src/api/v1/not_for_production.py | MaximVerlinskii/fastapi-project | 52cb92780f54e83c47814967b97b15621d9dd7c7 | [
"MIT"
] | 1 | 2022-03-29T15:11:38.000Z | 2022-03-29T15:11:38.000Z | src/api/v1/not_for_production.py | MaximVerlinskii/fastapi-project | 52cb92780f54e83c47814967b97b15621d9dd7c7 | [
"MIT"
] | null | null | null | src/api/v1/not_for_production.py | MaximVerlinskii/fastapi-project | 52cb92780f54e83c47814967b97b15621d9dd7c7 | [
"MIT"
] | null | null | null | from typing import Optional, Union
from fastapi import APIRouter, Depends, Query, Path
from starlette import status
from starlette.responses import JSONResponse
from src.api.v1.dto import ProductDTO
from src.api.v1.dependencies.database import ProductRepositoryDependencyMarker
from src.api.v1.dependencies.services im... | 37.177778 | 91 | 0.748954 |
88289f9b9e2dde35e4d9b50a35da0a09d8590af6 | 822 | py | Python | setup.py | arykalin/vcert-python | eeda50e641ca306862c8fe3fbca879aa3d10367a | [
"Apache-2.0"
] | 1 | 2018-12-30T16:59:47.000Z | 2018-12-30T16:59:47.000Z | setup.py | arykalin/vcert-python | eeda50e641ca306862c8fe3fbca879aa3d10367a | [
"Apache-2.0"
] | null | null | null | setup.py | arykalin/vcert-python | eeda50e641ca306862c8fe3fbca879aa3d10367a | [
"Apache-2.0"
] | 1 | 2018-12-30T07:20:51.000Z | 2018-12-30T07:20:51.000Z | #!/usr/bin/env python
from setuptools import setup
setup(name='vcert-python',
version='0.0.2',
url="https://github.com/Venafi/vcert-python",
packages=['vcert'],
modules=['vcert'],
install_requires=['requests', 'python-dateutil', 'oscrypto', 'certbuilder', 'csrbuilder', 'certvalidator'],... | 34.25 | 144 | 0.614355 |
43af965e551e9bbb7c4677df13cfe3e5e21bc931 | 330 | py | Python | python_teste/python_aulas/aula_103.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | 1 | 2020-07-27T14:18:08.000Z | 2020-07-27T14:18:08.000Z | python_teste/python_aulas/aula_103.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | null | null | null | python_teste/python_aulas/aula_103.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | null | null | null | def ficha(jogador='<Desconhecido>', gol=0):
print(f'O jogador {jogador} fez {gol} gol(s) no campeonato!')
# Progrmama Principal
j = str(input('Nome do jogador: ')).capitalize()
g = str(input('Número de gols: '))
if g.isnumeric():
g = int(g)
else:
g = 0
if j.strip() == '':
ficha(gol=g)
else:
ficha(... | 20.625 | 65 | 0.593939 |
da4443799a429c86baa0c44e9f3e8701e5b577c6 | 10,368 | py | Python | segmentation/train.py | jimmyyhwu/pose-interpreter-networks | fb5e818873eb935bfae23ad36baaab5daf635b69 | [
"MIT"
] | 110 | 2018-08-06T01:44:24.000Z | 2022-01-08T15:46:24.000Z | segmentation/train.py | phschoepf/pose-interpreter-networks | 7bb3742a52a92b38366c9dbfdfa46ccd27f86b60 | [
"MIT"
] | 32 | 2018-08-23T11:11:56.000Z | 2022-01-09T23:19:06.000Z | segmentation/train.py | phschoepf/pose-interpreter-networks | 7bb3742a52a92b38366c9dbfdfa46ccd27f86b60 | [
"MIT"
] | 37 | 2018-08-06T02:14:54.000Z | 2022-01-15T21:40:46.000Z | import matplotlib
matplotlib.use('Agg')
import argparse
import os
import time
from datetime import datetime
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from munch import Munch
from tensorboardX import SummaryWriter
from torch import nn
import datasets
import models
import transforms
import u... | 43.380753 | 163 | 0.664834 |
74e880fbb852ac48ecde433bcbc0d54de2115b5d | 23,502 | py | Python | bilby/core/sampler/base_sampler.py | tdalford1/bilby_relative_binning | a74123bf8ca5d66cbf07141b971d0ea32b71d9ec | [
"MIT"
] | null | null | null | bilby/core/sampler/base_sampler.py | tdalford1/bilby_relative_binning | a74123bf8ca5d66cbf07141b971d0ea32b71d9ec | [
"MIT"
] | null | null | null | bilby/core/sampler/base_sampler.py | tdalford1/bilby_relative_binning | a74123bf8ca5d66cbf07141b971d0ea32b71d9ec | [
"MIT"
] | 1 | 2021-09-17T10:15:41.000Z | 2021-09-17T10:15:41.000Z | from __future__ import absolute_import
import datetime
import numpy as np
from pandas import DataFrame
from ..utils import logger, command_line_args, Counter
from ..prior import Prior, PriorDict, DeltaFunction, Constraint
from ..result import Result, read_in_result
class Sampler(object):
""" A sampler object to... | 35.609091 | 112 | 0.614756 |
086d1dfeb1ea947d46226db876d94f67ff106c95 | 902 | py | Python | setup.py | freehackquest/libfreehackquest-client-py | a55e32ab00380a1602eb5aa70823bc9b9d508f69 | [
"Apache-2.0"
] | 1 | 2021-01-08T12:54:35.000Z | 2021-01-08T12:54:35.000Z | setup.py | freehackquest/libfreehackquest-client-py | a55e32ab00380a1602eb5aa70823bc9b9d508f69 | [
"Apache-2.0"
] | null | null | null | setup.py | freehackquest/libfreehackquest-client-py | a55e32ab00380a1602eb5aa70823bc9b9d508f69 | [
"Apache-2.0"
] | null | null | null | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='freehackquest-libclient-py',
version='v0.2.40',
install_requires=['websocket-client>=0.56.0', 'requests>=2.21.0'],
keywords=['ctf', 'fhq', 'fhq-server', 'libfreehackquest-client', 'jeopardy', ... | 36.08 | 98 | 0.687361 |
a740b4af1b0a703933cec113dcb4ae791971b3ec | 5,080 | py | Python | h_modes.py | lyd1ng/hf_waveguide_simulation | f2dae95aeecb39e9e7c985a6a494a5c3c3cd61fc | [
"MIT"
] | null | null | null | h_modes.py | lyd1ng/hf_waveguide_simulation | f2dae95aeecb39e9e7c985a6a494a5c3c3cd61fc | [
"MIT"
] | null | null | null | h_modes.py | lyd1ng/hf_waveguide_simulation | f2dae95aeecb39e9e7c985a6a494a5c3c3cd61fc | [
"MIT"
] | null | null | null | from cmath import pi, e, sqrt, sin, cos
from gplot_vector3 import gplot_vector3, cross_product
from drange import drange
j = complex(0, 1)
# Returns the lambda to given omega
def get_lambda_free(omega):
return 299792458.0 / (omega / (2.0 * pi))
# Returns the wavelength within the waveguide
def get_lambda_wg(om... | 37.352941 | 78 | 0.56063 |
4dc910675e7db0705977d1b302b4783ea6853021 | 807 | py | Python | worker/notification/config.py | actumn/jraze | a02ceeaca4373f27f26fea618dda08d69c639f58 | [
"MIT"
] | null | null | null | worker/notification/config.py | actumn/jraze | a02ceeaca4373f27f26fea618dda08d69c639f58 | [
"MIT"
] | null | null | null | worker/notification/config.py | actumn/jraze | a02ceeaca4373f27f26fea618dda08d69c639f58 | [
"MIT"
] | null | null | null | from pathlib import Path
import deserialize
from common.configutil import get_config
class Config:
class NotificationWorker:
@deserialize.default('port', '3306')
class MySQL:
host: str
port: str
user: str
password: str
database: str
... | 19.682927 | 57 | 0.583643 |
1a27942462f8b9229db2e11c391ca8e446e480b8 | 2,891 | py | Python | model.py | arosan966/RL-Collaborate-and-Compete | 64929b859b3f68954d8e53c0a446a2e9cef08567 | [
"MIT"
] | null | null | null | model.py | arosan966/RL-Collaborate-and-Compete | 64929b859b3f68954d8e53c0a446a2e9cef08567 | [
"MIT"
] | null | null | null | model.py | arosan966/RL-Collaborate-and-Compete | 64929b859b3f68954d8e53c0a446a2e9cef08567 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1. / np.sqrt(fan_in)
return (-lim, lim)
class Actor(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, ... | 35.691358 | 89 | 0.613974 |
7ab9754ddc5e3117a241c272dc94f3b69becbe6f | 383 | py | Python | 2021/HANFS/fence-agents/tests/test-multi-apc2.py | BryanWhitehurst/HPCCEA | 54b7e7355b67ba3fdce2e28cc1b0e3b29d2bdefa | [
"MIT"
] | 10 | 2019-08-12T23:00:20.000Z | 2021-08-06T17:06:48.000Z | 2021/HANFS/fence-agents/tests/test-multi-apc2.py | BryanWhitehurst/HPCCEA | 54b7e7355b67ba3fdce2e28cc1b0e3b29d2bdefa | [
"MIT"
] | 5 | 2020-06-18T23:51:58.000Z | 2021-07-28T17:50:34.000Z | 2021/HANFS/fence-agents/tests/test-multi-apc2.py | BryanWhitehurst/HPCCEA | 54b7e7355b67ba3fdce2e28cc1b0e3b29d2bdefa | [
"MIT"
] | 21 | 2019-06-10T21:03:03.000Z | 2021-08-06T17:57:25.000Z | #!/usr/bin/python
from fence_testing import test_action
def main():
DEVICE = "devices.d/multi-apc-v2.cfg"
ACT_STATUS = "actions.d/status.cfg"
ACT_ONOFF = "actions.d/power-on-off.cfg"
ACT_LIST = "actions.d/list.cfg"
test_action(DEVICE, ACT_STATUS, "getopt")
test_action(DEVICE, ACT_ONOFF, "stdin")
test_action(... | 22.529412 | 42 | 0.723238 |
cabde2604556dbb2dfb8a2956b823aaed55ecd6a | 687 | py | Python | software/L1_servo.py | roy-kruemcke/SCUTTLE-SLMP | c181ba451e5fecdbbfb8ac7c4c2d743526112b11 | [
"MIT"
] | null | null | null | software/L1_servo.py | roy-kruemcke/SCUTTLE-SLMP | c181ba451e5fecdbbfb8ac7c4c2d743526112b11 | [
"MIT"
] | null | null | null | software/L1_servo.py | roy-kruemcke/SCUTTLE-SLMP | c181ba451e5fecdbbfb8ac7c4c2d743526112b11 | [
"MIT"
] | null | null | null | # Author: David (dmalawey)
# July 23 2021
#
# This program sets up a servo object and controls the servo
# L1_servo is compatible with raspberry Pi.
# Facing the servo horn, a positive command generates a clockwise turn.
# Servo Basics: lastminuteengineers.com/servo-motor-arduino-tutorial
# Import external programs
f... | 26.423077 | 71 | 0.714702 |
6cc569702b1831b46abffec684cbf506b106a125 | 1,533 | py | Python | imagededup/handlers/search/brute_force_cython.py | agarwalutkarsh554/imagededup | 8cf82f2f59b051d61f90b6366a1f831d97a564be | [
"Apache-2.0"
] | 4,100 | 2019-09-30T14:34:05.000Z | 2022-03-31T15:45:20.000Z | imagededup/handlers/search/brute_force_cython.py | agarwalutkarsh554/imagededup | 8cf82f2f59b051d61f90b6366a1f831d97a564be | [
"Apache-2.0"
] | 112 | 2019-10-01T14:08:35.000Z | 2022-03-25T01:59:19.000Z | imagededup/handlers/search/brute_force_cython.py | agarwalutkarsh554/imagededup | 8cf82f2f59b051d61f90b6366a1f831d97a564be | [
"Apache-2.0"
] | 380 | 2019-10-04T13:02:28.000Z | 2022-03-31T09:41:11.000Z | from typing import Callable, Dict
import brute_force_cython_ext
class BruteForceCython:
"""
Class to perform search using a Brute force.
"""
def __init__(self, hash_dict: Dict, distance_function: Callable) -> None:
"""
Initialize a dictionary for mapping file names and corresponding ... | 34.840909 | 118 | 0.651011 |
1e3ab8021d609f9a841e4ed6059cd4d43be4c0ec | 1,050 | py | Python | get_latest_tag.py | topfreegames/offers | 43c504d2490059b81687add7f127c6bfaaf233db | [
"MIT"
] | 2 | 2019-05-02T08:54:11.000Z | 2020-07-22T20:00:25.000Z | get_latest_tag.py | topfreegames/offers | 43c504d2490059b81687add7f127c6bfaaf233db | [
"MIT"
] | 18 | 2017-03-03T17:05:37.000Z | 2018-05-22T13:55:00.000Z | get_latest_tag.py | topfreegames/offers | 43c504d2490059b81687add7f127c6bfaaf233db | [
"MIT"
] | 1 | 2022-03-26T16:37:37.000Z | 2022-03-26T16:37:37.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Offers
# https://github.com/topfreegames/offers
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright © 2016 Top Free Games <backend@tfgco.com>
import datetime
import json
import urllib.request
def main():
url = "https://re... | 26.923077 | 92 | 0.64381 |
ac0c11c39cd8ba28989080444da4937ade8e0f32 | 15,638 | py | Python | rabbitpy/amqp_queue.py | 77598072/rabbitpy | 5e66a15db95152ebf4cc4efc64334ceedb141ecc | [
"BSD-3-Clause"
] | null | null | null | rabbitpy/amqp_queue.py | 77598072/rabbitpy | 5e66a15db95152ebf4cc4efc64334ceedb141ecc | [
"BSD-3-Clause"
] | null | null | null | rabbitpy/amqp_queue.py | 77598072/rabbitpy | 5e66a15db95152ebf4cc4efc64334ceedb141ecc | [
"BSD-3-Clause"
] | null | null | null | """
The rabbitpy.amqp_queue module contains two classes :py:class:`Queue` and
:py:class:`Consumer`. The :py:class:`Queue` class is an object that is used
create and work with queues on a RabbitMQ server.
To consume messages you can iterate over the Queue object itself if the
defaults for the :py:meth:`Queue.__iter__()... | 38.141463 | 79 | 0.617278 |
8ec399b946426592f2648cf747cfe1cec92c2911 | 6,446 | py | Python | apps/rss_feeds/tasks.py | kzwa/NewsBlur | ec668638117c3155c938bab92e0c6e1acb43008d | [
"MIT"
] | 1 | 2016-10-12T18:35:54.000Z | 2016-10-12T18:35:54.000Z | apps/rss_feeds/tasks.py | kzwa/NewsBlur | ec668638117c3155c938bab92e0c6e1acb43008d | [
"MIT"
] | null | null | null | apps/rss_feeds/tasks.py | kzwa/NewsBlur | ec668638117c3155c938bab92e0c6e1acb43008d | [
"MIT"
] | null | null | null | import datetime
import os
import shutil
import time
from celery.task import Task
from utils import log as logging
from utils import s3_utils as s3
from django.conf import settings
class TaskFeeds(Task):
name = 'task-feeds'
def run(self, **kwargs):
from apps.rss_feeds.models import Feed
... | 32.555556 | 238 | 0.595718 |
ac0bc9848538674dbf9d29badeda0c8b91996571 | 437 | py | Python | lib/MotifFinderMEME/Utils/GenerateReport.py | arwyer/MotifFinderMEME | fc0bb06936cbf1d608cbe29d49bf5c4eebcde015 | [
"MIT"
] | 1 | 2022-01-26T13:29:57.000Z | 2022-01-26T13:29:57.000Z | lib/MotifFinderMEME/Utils/GenerateReport.py | kbasecollaborations/MotifFinderMEME | fc0bb06936cbf1d608cbe29d49bf5c4eebcde015 | [
"MIT"
] | null | null | null | lib/MotifFinderMEME/Utils/GenerateReport.py | kbasecollaborations/MotifFinderMEME | fc0bb06936cbf1d608cbe29d49bf5c4eebcde015 | [
"MIT"
] | 2 | 2019-06-13T17:42:58.000Z | 2019-11-28T03:35:42.000Z | import json
import sys
import os
class GenerateReport:
def __init__(self):
pass
def MakeMotifReport(self, htmlDir,motifSet):
reportPath = '/kb/module/lib/MotifFinderMEME/Utils/Report/*'
CopyCommand = 'cp -r ' + reportPath + ' ' + htmlDir
os.system(CopyCommand)
jsonFName = htmlDir + '... | 25.705882 | 66 | 0.663616 |
38b65a41ed670245c6b2d4b1dc1f9d5ad7a8a9c4 | 666 | py | Python | test/unittests/test_LuRunoff.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_LuRunoff.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_LuRunoff.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Runoff import LuRunoff
class TestLuRunoff(VariableUnitTest):
def test_LuRunoff(self):
z = self.z
np.testing.assert_array_almost_equal(
LuRunoff.LuRunoff_f(z.NYrs, z.DaysMonth, z.InitSnow_0, z.Te... | 41.625 | 116 | 0.636637 |
799c58558d549202c186e3bfe33b0b05efbf08f5 | 2,422 | py | Python | koroba/utils/camera.py | sergevkim/koroba | 91d433f6bc7ecf47c62f7be4ddcdc8b38e5b27b7 | [
"MIT"
] | null | null | null | koroba/utils/camera.py | sergevkim/koroba | 91d433f6bc7ecf47c62f7be4ddcdc8b38e5b27b7 | [
"MIT"
] | 1 | 2021-05-16T07:05:19.000Z | 2021-05-16T07:05:19.000Z | koroba/utils/camera.py | sergevkim/koroba | 91d433f6bc7ecf47c62f7be4ddcdc8b38e5b27b7 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn.functional as F
from torch import Tensor
from koroba.utils import Box
class Camera:
@staticmethod
def check_boxes_in_camera_fov( #TODO projection on 8 points
boxes: Tensor,
camera: Tensor,
):
center_3d = boxes[:, :3].T
... | 28.494118 | 67 | 0.491742 |
042edc5c1b46ac00ae7aa73dc2068e4ef4e87118 | 1,086 | py | Python | samples/logic.py | spielhuus/nukleus | 55d7ae6051720213024fa20c8c9a92110f5566ce | [
"MIT"
] | null | null | null | samples/logic.py | spielhuus/nukleus | 55d7ae6051720213024fa20c8c9a92110f5566ce | [
"MIT"
] | null | null | null | samples/logic.py | spielhuus/nukleus | 55d7ae6051720213024fa20c8c9a92110f5566ce | [
"MIT"
] | null | null | null | import sys
import os
import matplotlib.pyplot as plt
import logging
sys.path.append('src')
sys.path.append('../src')
import nukleus
from nukleus.draw import Draw, Dot, Label, Line, Element
from nukleus import Circuit
from nukleus.Plot import plot
from nukleus.model.Utils import get_pins
from nukleus.Netlist import N... | 32.909091 | 104 | 0.726519 |
76c44b6998d4d82745a60cd6ae18732bdc0c5b82 | 1,014 | py | Python | src/config.py | Noko-Github/Religious_Art_Classification | 0498475633280759bb2514cc5281da45a0c1c62c | [
"MIT"
] | null | null | null | src/config.py | Noko-Github/Religious_Art_Classification | 0498475633280759bb2514cc5281da45a0c1c62c | [
"MIT"
] | null | null | null | src/config.py | Noko-Github/Religious_Art_Classification | 0498475633280759bb2514cc5281da45a0c1c62c | [
"MIT"
] | null | null | null | import pathlib
import logging
import dataclasses
@dataclasses.dataclass
class Cfg:
PROJECT_NAME = "art_classification"
RUN_NAME = "001"
NUM_FOLDS = 5
NUM_CLASS = 13
NUM_EPOCHS = 3
NUM_GPUS = 3
BATCH_SIZE = 8
MODEL_PATH = pathlib.Path(
__file__).parent.parent / "models"
MODE... | 26 | 73 | 0.646943 |
a3f9b2b2110cc143c8ab1353f2efdbf03b914102 | 1,988 | py | Python | class_eventos.py | politecnicomodelopoo2018/ProyectoWeb-Albisetti | 47f6f809202eac8c62eb4064912b194804d6f182 | [
"MIT"
] | null | null | null | class_eventos.py | politecnicomodelopoo2018/ProyectoWeb-Albisetti | 47f6f809202eac8c62eb4064912b194804d6f182 | [
"MIT"
] | null | null | null | class_eventos.py | politecnicomodelopoo2018/ProyectoWeb-Albisetti | 47f6f809202eac8c62eb4064912b194804d6f182 | [
"MIT"
] | 2 | 2018-09-14T11:45:32.000Z | 2018-10-10T11:09:31.000Z | from database import *
class eventos(object):
idEvento = None
nombre_evento = None
dia_evento = None
hora_evento = None
clave = None
idCategoria = None
idInvitado = None
@staticmethod
def cargar(id):
info = Database().run("Select * FROM eventos WHERE idEvento = '%s'" %(i... | 39.76 | 119 | 0.443662 |
47c9ad5f6ac762e49f53fa0b162d88ac8826a5ac | 1,874 | py | Python | doc/examples/plot_brief.py | jeysonmc/scikit-image | d652a9ce9a71a3f6f13cb23ee7c5f25148457b24 | [
"BSD-3-Clause"
] | 3 | 2017-12-15T01:37:10.000Z | 2021-07-23T09:26:48.000Z | doc/examples/plot_brief.py | jeysonmc/scikit-image | d652a9ce9a71a3f6f13cb23ee7c5f25148457b24 | [
"BSD-3-Clause"
] | null | null | null | doc/examples/plot_brief.py | jeysonmc/scikit-image | d652a9ce9a71a3f6f13cb23ee7c5f25148457b24 | [
"BSD-3-Clause"
] | 2 | 2015-04-16T12:14:22.000Z | 2019-08-07T14:03:36.000Z | """
=======================
BRIEF binary descriptor
=======================
This example demonstrates the BRIEF binary description algorithm.
The descriptor consists of relatively few bits and can be computed using
a set of intensity difference tests. The short binary descriptor results
in low memory footprint and ve... | 30.225806 | 79 | 0.765208 |
fb58deb952f2581cfb5a63254809f2cad1ccb215 | 17,478 | py | Python | tools/test_robustness.py | dingmyu/mmdetection | 705dc91ca43ea62f4f69355a81271d5bd81268ca | [
"Apache-2.0"
] | 3 | 2019-11-18T04:45:19.000Z | 2019-11-18T05:06:08.000Z | tools/test_robustness.py | yuyijie1995/mmdetection | 8455dd1a51bb397c25373e61a7457e0e1b9e1808 | [
"Apache-2.0"
] | 1 | 2021-11-10T10:42:33.000Z | 2021-11-10T10:42:33.000Z | tools/test_robustness.py | yuyijie1995/mmdetection | 8455dd1a51bb397c25373e61a7457e0e1b9e1808 | [
"Apache-2.0"
] | 1 | 2020-06-07T11:44:24.000Z | 2020-06-07T11:44:24.000Z | import argparse
import copy
import os
import os.path as osp
import shutil
import tempfile
import mmcv
import numpy as np
import torch
import torch.distributed as dist
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import get_dist_info, init_dist, load_checkpoint
from pycocotools.c... | 36.951374 | 79 | 0.556128 |
aa0299b5c6862909b9c01a0059e593fd063d13b2 | 3,962 | py | Python | tests/unit/test_integer_pivoting.py | katiemcgoldrick/Nashpy | 352747a8970e24a1dcc27f16c68f3eedf62f28fa | [
"MIT"
] | 212 | 2016-11-06T12:44:08.000Z | 2022-03-10T03:05:27.000Z | tests/unit/test_integer_pivoting.py | katiemcgoldrick/Nashpy | 352747a8970e24a1dcc27f16c68f3eedf62f28fa | [
"MIT"
] | 93 | 2016-11-06T12:34:14.000Z | 2022-03-25T10:57:17.000Z | tests/unit/test_integer_pivoting.py | katiemcgoldrick/Nashpy | 352747a8970e24a1dcc27f16c68f3eedf62f28fa | [
"MIT"
] | 51 | 2016-11-06T12:31:22.000Z | 2022-03-29T10:45:53.000Z | """
Tests for the integer pivoting
"""
import unittest
import numpy as np
from hypothesis import given
from hypothesis.extra.numpy import arrays
from nashpy.integer_pivoting.integer_pivoting import (
find_pivot_row,
make_tableau,
non_basic_variables,
pivot_tableau,
)
class TestPolytope(unittest.Test... | 32.743802 | 87 | 0.476779 |
8359233d1daba88e4d854199caa637da2d8dbfdb | 1,102 | py | Python | src/Core_functionality/prediction_tools/regression_families.py | jamesdamillington/Wildfire_Human_Agency_Model | 771d5a89a9f26badcf1fa412a1a7a10b2e981aeb | [
"MIT"
] | 1 | 2021-06-24T16:45:22.000Z | 2021-06-24T16:45:22.000Z | src/Core_functionality/prediction_tools/regression_families.py | jamesdamillington/Wildfire_Human_Agency_Model | 771d5a89a9f26badcf1fa412a1a7a10b2e981aeb | [
"MIT"
] | null | null | null | src/Core_functionality/prediction_tools/regression_families.py | jamesdamillington/Wildfire_Human_Agency_Model | 771d5a89a9f26badcf1fa412a1a7a10b2e981aeb | [
"MIT"
] | 1 | 2021-10-05T08:57:17.000Z | 2021-10-05T08:57:17.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 22 10:41:39 2021
@author: Oli
"""
import numpy as np
import pandas as pd
def regression_link(X, link):
if link == 'identity':
return(X)
elif link == 'log':
return(np.exp... | 16.69697 | 56 | 0.443739 |
7af137e4c2331f7577147a726e6e8a7b1d91404a | 1,194 | py | Python | data_processing.py | kanishchugh/Anime-Recommender | bad2fd4c9b7abba1061d60edd752d84e2ab8a647 | [
"MIT"
] | null | null | null | data_processing.py | kanishchugh/Anime-Recommender | bad2fd4c9b7abba1061d60edd752d84e2ab8a647 | [
"MIT"
] | null | null | null | data_processing.py | kanishchugh/Anime-Recommender | bad2fd4c9b7abba1061d60edd752d84e2ab8a647 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
anime = pd.read_csv('./data/AnimeData.csv')
def PreProcessing(anime):
#Cleaning data
#Deleting null ratings
anime['Weighted_Score'] = anime['Weighted_Score'].apply(lambda x: np.nan if x==0 else x)
anime['Genre'] = anime['Genre'].apply(lambda x: np.nan if x==0 or ... | 39.8 | 129 | 0.59799 |
9b0b0500470e98ec5c9ecad7c2358610cb995030 | 4,178 | py | Python | tests/internal_api/models/device.py | mchalski/deviceconnect | b8c2c8187100278c68227f315a0172930e8374f0 | [
"Apache-2.0"
] | null | null | null | tests/internal_api/models/device.py | mchalski/deviceconnect | b8c2c8187100278c68227f315a0172930e8374f0 | [
"Apache-2.0"
] | null | null | null | tests/internal_api/models/device.py | mchalski/deviceconnect | b8c2c8187100278c68227f315a0172930e8374f0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Northern.tech AS
#
# 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 ag... | 30.057554 | 108 | 0.601723 |
174fe6ac6766ad5195b73f9bd0259d124737d7ba | 3,801 | py | Python | course/receivers.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 284 | 2015-01-09T12:02:28.000Z | 2022-03-27T14:30:46.000Z | course/receivers.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 799 | 2015-02-26T08:49:46.000Z | 2022-03-31T16:09:26.000Z | course/receivers.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 120 | 2015-01-30T18:00:56.000Z | 2022-03-28T06:24:43.000Z | __copyright__ = "Copyright (C) 2016 Dong Zhuang, Andreas Kloeckner"
__license__ = """
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
t... | 34.243243 | 79 | 0.686135 |
bd0de14308c7d5fc56993fa89579e8178893339a | 381 | py | Python | cv_test.py | zhanqxun/cv_fish | f78f4f5bdafb070c179efee8b9276719dfaef1d7 | [
"Apache-2.0"
] | null | null | null | cv_test.py | zhanqxun/cv_fish | f78f4f5bdafb070c179efee8b9276719dfaef1d7 | [
"Apache-2.0"
] | null | null | null | cv_test.py | zhanqxun/cv_fish | f78f4f5bdafb070c179efee8b9276719dfaef1d7 | [
"Apache-2.0"
] | null | null | null | # -*- coding:UTF-8 -*-
from image_grab import grab_wnd
import PIL
import cv2
import numpy
if __name__ == "__main__":
pil_image, rect = grab_wnd("魔兽世界")
opencvImage = cv2.cvtColor(numpy.array(pil_image), cv2.COLOR_RGB2BGR)
cv2.imshow('image', opencvImage)
while True:
k = cv2.waitKey(0)&0xFF
if k... | 21.166667 | 71 | 0.669291 |
861038934c72cc66c57402ff10e6a7de8b8aa3b9 | 289 | py | Python | ex024.py | gabrieleliasdev/python-cev | 45390963b5112a982e673f6a6866da422bf9ae6d | [
"MIT"
] | null | null | null | ex024.py | gabrieleliasdev/python-cev | 45390963b5112a982e673f6a6866da422bf9ae6d | [
"MIT"
] | null | null | null | ex024.py | gabrieleliasdev/python-cev | 45390963b5112a982e673f6a6866da422bf9ae6d | [
"MIT"
] | null | null | null | # Crie um programa que leia o nome de uma cidade e diga se ela começa ou não com o nome "SANTO"
c = str(input(f'\nType the name of a City:\n>>> ')).strip().title()
c1 = c.split(' ')
print('This City {} "Santo" in your name.\n'.format("Santo" in c1 [0]))
# OR
print(c[0:5] == 'Santo')
| 24.083333 | 95 | 0.619377 |
56a1074904b1d4037c4682639e8a7dfb5b1caf04 | 29,966 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py | KarishmaGhiya/azure-sdk-for-python | 1216acf1caa13575d3b8cfa0b401e42eefa9f17f | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py | KarishmaGhiya/azure-sdk-for-python | 1216acf1caa13575d3b8cfa0b401e42eefa9f17f | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py | KarishmaGhiya/azure-sdk-for-python | 1216acf1caa13575d3b8cfa0b401e42eefa9f17f | [
"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.
# --------------------------------------------------------------------... | 48.646104 | 196 | 0.656544 |
b6d4358878a4ea6c55b06c20ea9ef6a0ed920f99 | 4,733 | py | Python | yolox/utils/visualize.py | qq1243196045/YONO | 6f2936918b9099a8f415f1b9e39ef1894e984346 | [
"Apache-2.0"
] | null | null | null | yolox/utils/visualize.py | qq1243196045/YONO | 6f2936918b9099a8f415f1b9e39ef1894e984346 | [
"Apache-2.0"
] | null | null | null | yolox/utils/visualize.py | qq1243196045/YONO | 6f2936918b9099a8f415f1b9e39ef1894e984346 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
import cv2
import numpy as np
__all__ = ["vis","vis_clas"]
def clamp(x,min,max):
if x<min:
return min
elif x>max:
return max
else:
return x
def vis(img, boxes, scores, cls_ids,... | 27.678363 | 92 | 0.481724 |
422a90fed41a453d8282e6d6597d58a5553f396c | 2,876 | py | Python | APIFunctions/_Archive/createDepositInfo.py | cul/archivesspace | 9c088d4495cf1006c7d02ed2850224a9d28b35c1 | [
"MIT"
] | 4 | 2018-12-13T16:18:30.000Z | 2020-02-14T14:01:28.000Z | APIFunctions/_Archive/createDepositInfo.py | cul/archivesspace | 9c088d4495cf1006c7d02ed2850224a9d28b35c1 | [
"MIT"
] | null | null | null | APIFunctions/_Archive/createDepositInfo.py | cul/archivesspace | 9c088d4495cf1006c7d02ed2850224a9d28b35c1 | [
"MIT"
] | 2 | 2019-09-03T19:15:24.000Z | 2020-12-01T20:27:14.000Z | import json
import requests
import secrets
import codecs
import os.path
#call secrets for authentication
baseURL = secrets.baseURL
user = secrets.user
password = secrets.password
#authenticate session
auth = requests.post(baseURL + '/users/'+user+'/login?password='+password).json()
session = auth["session"]
headers =... | 37.350649 | 158 | 0.678025 |
9ceb8ef702eb09fe318149aeed2b683f1e5922b9 | 2,527 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/sale/models/sales_team.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/sale/models/sales_team.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/sale/models/sales_team.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date
from odoo import api, fields, models
class CrmTeam(models.Model):
_inherit = 'crm.team'
use_quotations = fields.Boolean('Quotations', default=True,
help="Check this box to ma... | 40.758065 | 93 | 0.622477 |
c118dfcae17274c65c4dcf5092290b3a95cdd255 | 776 | py | Python | computer_vision/QrBarCode_tutorial/qr_bar_code_01.py | Gabriellgpc/my_personal_projects | 0d23d31dbb61538bac1ff8bf75d5c3cd5701f833 | [
"MIT"
] | null | null | null | computer_vision/QrBarCode_tutorial/qr_bar_code_01.py | Gabriellgpc/my_personal_projects | 0d23d31dbb61538bac1ff8bf75d5c3cd5701f833 | [
"MIT"
] | null | null | null | computer_vision/QrBarCode_tutorial/qr_bar_code_01.py | Gabriellgpc/my_personal_projects | 0d23d31dbb61538bac1ff8bf75d5c3cd5701f833 | [
"MIT"
] | 1 | 2021-04-08T14:44:53.000Z | 2021-04-08T14:44:53.000Z | import cv2
import numpy as np
from pyzbar.pyzbar import decode
video = cv2.VideoCapture('/dev/video0')
assert(video.isOpened() == True)
while True:
ok, img = video.read()
assert(ok == True)
for code in decode(img):
pts = np.array([code.polygon], dtype=np.int32)
pts = pts.reshape... | 25.032258 | 99 | 0.555412 |
1eb7185f4c139bcafc49221c70a8f6493149bc44 | 2,937 | py | Python | Coding/Python_Prgs/MongoDB/musicbrainz.py | Phantom586/My_Codes | 900c4e5e95ab833e4f78f1594e3b25178a74f1a7 | [
"MIT"
] | null | null | null | Coding/Python_Prgs/MongoDB/musicbrainz.py | Phantom586/My_Codes | 900c4e5e95ab833e4f78f1594e3b25178a74f1a7 | [
"MIT"
] | null | null | null | Coding/Python_Prgs/MongoDB/musicbrainz.py | Phantom586/My_Codes | 900c4e5e95ab833e4f78f1594e3b25178a74f1a7 | [
"MIT"
] | null | null | null | """
To experiment with this code freely you will have to run this code locally.
Take a look at the main() function for an example of how to use the code. We
have provided example json output in the other code editor tabs for you to look
at, but you will not be able to run any queries through our UI.
"""
import json
imp... | 31.923913 | 79 | 0.671433 |
5e4d74afadea3c95cf496f671575f891ca0622f2 | 1,389 | py | Python | xlsxwriter/test/comparison/test_chart_combined10.py | eddiechapman/XlsxWriter | c636117ab30e64e4b7b824c9105595c42887c2c9 | [
"BSD-2-Clause-FreeBSD"
] | 2,766 | 2015-01-02T17:36:42.000Z | 2022-03-31T09:23:30.000Z | xlsxwriter/test/comparison/test_chart_combined10.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 683 | 2015-01-03T09:55:02.000Z | 2022-03-31T07:18:15.000Z | xlsxwriter/test/comparison/test_chart_combined10.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 636 | 2015-01-05T01:57:08.000Z | 2022-03-25T18:42:41.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 26.711538 | 79 | 0.576674 |
f23d70137fc2c00195f971cedda459d9f6e09f0e | 1,873 | py | Python | ProgrammingProject2/tasks/task6.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | ProgrammingProject2/tasks/task6.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | ProgrammingProject2/tasks/task6.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import sys
shellcode= (
"\xeb\x29\x5b\x31\xc0\x88\x43\x09\x88\x43\x0c\x88\x43\x47\x89\x5b"
"\x48\x8d\x4b\x0a\x89\x4b\x4c\x8d\x4b\x0d\x89\x4b\x50\x89\x43\x54"
"\x8d\x4b\x48\x31\xd2\x31\xc0\xb0\x0b\xcd\x80\xe8\xd2\xff\xff\xff"
"/bin/bash*"
"-c*"
# You can modify the following command st... | 39.851064 | 74 | 0.597971 |
c05da08d72239fe0f961b868d029ef0c7024a55f | 1,832 | py | Python | download.py | AtlasHale/satellite_plus | 4c308e5234402b9dbb1afdf5b2a29ef46a5be5d9 | [
"MIT"
] | null | null | null | download.py | AtlasHale/satellite_plus | 4c308e5234402b9dbb1afdf5b2a29ef46a5be5d9 | [
"MIT"
] | null | null | null | download.py | AtlasHale/satellite_plus | 4c308e5234402b9dbb1afdf5b2a29ef46a5be5d9 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
from satsearch import Search
import imageio as im
from PIL import Image
import re
# os.environ['SATUTILS_API_URL'] = "https://sat-api.developmentseed.org/"
# search = Search(bbox=[-121.671912, 39.789597, -121.566920, 39.720973],
# datetime='2018-10-30/201... | 31.050847 | 73 | 0.63155 |
dd1ba213f26d32f81c475adb036f82f18ff7787f | 7,526 | py | Python | rnn/model.py | jefflai108/Self-Supervised-Speech-Pretraining-and-Representation-Learning | bb8df008397d5a0360ab7d4b68e91588ed648270 | [
"MIT"
] | 1 | 2021-12-10T06:41:45.000Z | 2021-12-10T06:41:45.000Z | rnn/model.py | jefflai108/Self-Supervised-Speech-Pretraining-and-Representation-Learning | bb8df008397d5a0360ab7d4b68e91588ed648270 | [
"MIT"
] | null | null | null | rnn/model.py | jefflai108/Self-Supervised-Speech-Pretraining-and-Representation-Learning | bb8df008397d5a0360ab7d4b68e91588ed648270 | [
"MIT"
] | 1 | 2022-01-05T06:45:58.000Z | 2022-01-05T06:45:58.000Z | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ rnn/model.py ]
# Synopsis [ implementation of the rnn models, for now including `apc` ]
# Author [ Yu-An Chung ]
# Copyright [ https://github.com/iamyuanchu... | 40.902174 | 99 | 0.642838 |
a4a3b78b2e7277c3d57c66df89df6e7d18765982 | 5,949 | py | Python | src/oci/database_management/models/consumer_group_privilege_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database_management/models/consumer_group_privilege_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database_management/models/consumer_group_privilege_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 36.054545 | 245 | 0.671373 |
94f8bdee85c16e6421e863c98e967995747aec1a | 3,279 | py | Python | randomized_graph_search.py | afuturemodern/aeria | 12f0397f43ea3552c0596a57561f3ac5d52ec67c | [
"BSD-3-Clause"
] | 5 | 2020-07-17T16:01:42.000Z | 2020-07-30T01:45:52.000Z | randomized_graph_search.py | afuturemodern/aeria | 12f0397f43ea3552c0596a57561f3ac5d52ec67c | [
"BSD-3-Clause"
] | null | null | null | randomized_graph_search.py | afuturemodern/aeria | 12f0397f43ea3552c0596a57561f3ac5d52ec67c | [
"BSD-3-Clause"
] | null | null | null | import networkx as nx
import random
import sc_api_calls as scac
import multiprocessing as mp
from cc_mp_classes import Consumer, bookTasks
# A global artist graph used to iterate through the various algorithms.
# Each node is artist id, with edges weighted by activity between then.
artistGraph = nx.MultiDiGraph()
ta... | 30.361111 | 98 | 0.609637 |
9b21fdcdf0d8a8cefe49baf1b7a50d58d069d838 | 3,355 | py | Python | codigos/ising2d.py | gcaccaos/ising2d | 4e290dd2f9817553a59da1c353b8c852933e6c41 | [
"MIT"
] | 1 | 2021-03-08T13:12:21.000Z | 2021-03-08T13:12:21.000Z | codigos/ising2d.py | gcaccaos/modelo-ising-2d | 4e290dd2f9817553a59da1c353b8c852933e6c41 | [
"MIT"
] | null | null | null | codigos/ising2d.py | gcaccaos/modelo-ising-2d | 4e290dd2f9817553a59da1c353b8c852933e6c41 | [
"MIT"
] | 1 | 2021-03-08T13:12:25.000Z | 2021-03-08T13:12:25.000Z | from numpy import exp, zeros
from numpy.random import choice, permutation, uniform
from numba import jit
from ipywidgets import interact
from matplotlib.pyplot import subplots, imshow, axis, show
@jit
def ising_update(spins, i, j, T, J, h):
'''Funcao para aplicar o passo de Monte Carlo do algoritmo de Metropolis.
... | 29.429825 | 166 | 0.598808 |
0f714d148ac557c66bf233b25c1eaba05799b7d7 | 1,400 | py | Python | migrations/versions/a511acc6ec24_add_opset_in_model_details.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 23 | 2022-03-17T12:24:09.000Z | 2022-03-31T09:13:30.000Z | migrations/versions/a511acc6ec24_add_opset_in_model_details.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 18 | 2022-03-21T08:17:44.000Z | 2022-03-30T12:42:30.000Z | migrations/versions/a511acc6ec24_add_opset_in_model_details.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 16 | 2022-03-17T12:24:14.000Z | 2022-03-31T12:15:12.000Z | """Add opSet in model details
Revision ID: a511acc6ec24
Revises: 192b3a65a251
Create Date: 2020-10-02 15:40:20.626043
"""
"""
OpenVINO DL Workbench
Migration: Add opSet in model details
Copyright (c) 2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this fi... | 29.787234 | 109 | 0.742857 |
faffc653d5f09dd35d0b411cc28476c8a454a81b | 44,195 | py | Python | gluon/widget.py | redhumus/localgovmapviewer | d1903832cd18cd29e8fb5cfaed570767f484b66f | [
"BSD-3-Clause"
] | null | null | null | gluon/widget.py | redhumus/localgovmapviewer | d1903832cd18cd29e8fb5cfaed570767f484b66f | [
"BSD-3-Clause"
] | null | null | null | gluon/widget.py | redhumus/localgovmapviewer | d1903832cd18cd29e8fb5cfaed570767f484b66f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The widget is called from web2py.
"""
import datetime
import sys
import cStringIO
import time
import threa... | 34.233153 | 103 | 0.523679 |
0bc7cbe9af4d9b55c835898c7c173d4252355037 | 4,910 | py | Python | airflow/contrib/operators/hipchat_operator.py | Pire66/jedi.bigdata.1 | d0626c92681e6dffae5fe64cb26127c02aeb168f | [
"Apache-2.0"
] | 4 | 2017-06-25T14:09:31.000Z | 2020-11-20T09:51:24.000Z | airflow/contrib/operators/hipchat_operator.py | Pire66/jedi.bigdata.1 | d0626c92681e6dffae5fe64cb26127c02aeb168f | [
"Apache-2.0"
] | 4 | 2020-12-08T05:25:08.000Z | 2021-06-25T15:40:57.000Z | airflow/contrib/operators/hipchat_operator.py | Pire66/jedi.bigdata.1 | d0626c92681e6dffae5fe64cb26127c02aeb168f | [
"Apache-2.0"
] | 2 | 2020-01-27T07:10:07.000Z | 2020-07-22T12:38:41.000Z | # -*- coding: utf-8 -*-
#
# 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
... | 37.769231 | 90 | 0.624236 |
a78dc4118d6ffe6b6353d287729cd54f9c8d931a | 8,354 | py | Python | temboo/core/Library/Amazon/EC2/RegisterImage.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Amazon/EC2/RegisterImage.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Amazon/EC2/RegisterImage.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# RegisterImage
# Registers a new AMI with Amazon EC2.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | 48.289017 | 244 | 0.678717 |
adf96d6b126935c8ad5170c6f80086da0b537f14 | 83 | py | Python | src/zmqros/agent/__init__.py | wallarelvo/zmqros | 68d7f6688d4a4a0832c176828d5c0f918c423f48 | [
"Apache-2.0"
] | 9 | 2018-01-10T01:04:18.000Z | 2020-12-08T03:20:38.000Z | src/zmqros/agent/__init__.py | wallarelvo/zmqros | 68d7f6688d4a4a0832c176828d5c0f918c423f48 | [
"Apache-2.0"
] | null | null | null | src/zmqros/agent/__init__.py | wallarelvo/zmqros | 68d7f6688d4a4a0832c176828d5c0f918c423f48 | [
"Apache-2.0"
] | 1 | 2018-07-11T07:09:11.000Z | 2018-07-11T07:09:11.000Z |
__all__ = ["topics", "log", "run"]
import topics
import log
from main import run
| 11.857143 | 34 | 0.686747 |
e7bbf9a098296cdbc3fb6df6f28010b06b6b4344 | 235 | py | Python | two_factor/gateways/twilio/urls.py | csghormley/django-two-factor-auth | d0ed5674502db5b3bc04ab21b6b30ef682862812 | [
"MIT"
] | null | null | null | two_factor/gateways/twilio/urls.py | csghormley/django-two-factor-auth | d0ed5674502db5b3bc04ab21b6b30ef682862812 | [
"MIT"
] | null | null | null | two_factor/gateways/twilio/urls.py | csghormley/django-two-factor-auth | d0ed5674502db5b3bc04ab21b6b30ef682862812 | [
"MIT"
] | 1 | 2019-12-30T15:38:13.000Z | 2019-12-30T15:38:13.000Z | from django.conf.urls import url
from .views import TwilioCallApp
urlpatterns = [
url(
regex=r'^twilio/inbound/two_factor/(?P<token>\d+)/$',
view=TwilioCallApp.as_view(),
name='twilio_call_app',
),
]
| 18.076923 | 61 | 0.629787 |
d9266a3fe85ba6d5461ff4e12ea4aabe50f3e571 | 343 | py | Python | test/fixtures/test_source_mod/c/__init__.py | sam-centrevilletech/B2_Command_Line_Tool | 9cdef21cc43cb1d45590349754a4c866372ca6e1 | [
"MIT"
] | null | null | null | test/fixtures/test_source_mod/c/__init__.py | sam-centrevilletech/B2_Command_Line_Tool | 9cdef21cc43cb1d45590349754a4c866372ca6e1 | [
"MIT"
] | 2 | 2022-02-24T21:17:18.000Z | 2022-03-16T20:45:45.000Z | test/fixtures/test_source_mod/c/__init__.py | sam-centrevilletech/B2_Command_Line_Tool | 9cdef21cc43cb1d45590349754a4c866372ca6e1 | [
"MIT"
] | null | null | null | ######################################################################
#
# File: test/fixtures/test_source_mod/c/__init__.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
def func... | 24.5 | 70 | 0.422741 |
170263b0000c4f6eee8168620bccbefa0caa194d | 137 | py | Python | content/ko/blog/photo/images/a.py | nrgw/doks-child-theme | 625b0f3f7d0b8ad203e3c61fef21cfbe6b3d45c6 | [
"MIT"
] | null | null | null | content/ko/blog/photo/images/a.py | nrgw/doks-child-theme | 625b0f3f7d0b8ad203e3c61fef21cfbe6b3d45c6 | [
"MIT"
] | null | null | null | content/ko/blog/photo/images/a.py | nrgw/doks-child-theme | 625b0f3f7d0b8ad203e3c61fef21cfbe6b3d45c6 | [
"MIT"
] | null | null | null | import os
for file in sorted(os.listdir()):
if file.split('.')[-1] == 'jpg':
print('<img src=\'images\\{}\'>'.format(file))
| 22.833333 | 54 | 0.540146 |
d61a2ec26fb111598d5018d848345e5938f54895 | 281 | py | Python | .history/chapter01/variable_20201121083549.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | .history/chapter01/variable_20201121083549.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | .history/chapter01/variable_20201121083549.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | # 変数宣言
# 整数型、文字型、浮動小数点型
# int()型、str()型、float()型
# トップス、ボトムス、下着類
1234
# シングルクオート
'エル'
# ダブルクオート
"nerdape"
1.23
4.56
num = 1234
# print()関数
print(num)
# 関数はミニプログラム
# print() python側が用意した関数
strings = 'nerdape'
print(strings)
syosu = 1.23
print(syosu)
| 5.301887 | 24 | 0.604982 |
8942f865913f67f45372ffefa02575856cb79b56 | 2,933 | py | Python | modules/xia2/Wrappers/CCP4/Mtz2various.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | null | null | null | modules/xia2/Wrappers/CCP4/Mtz2various.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | null | null | null | modules/xia2/Wrappers/CCP4/Mtz2various.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
from xia2.Decorators.DecoratorFactory import DecoratorFactory
from xia2.Driver.DriverFactory import DriverFactory
def Mtz2various(DriverType=None):
"""A factory for Mtz2variousWrapper classes."""
DriverInstanc... | 27.933333 | 88 | 0.535629 |
3985433abba0c0f8674b59a8647c5a884b093c27 | 5,168 | py | Python | tests/python/unit/test_training_session.py | dataiku/dss-plugin-timeseries-forecast | 56980fdab629b5eb27ce4c17e7ba2348c2b2cb28 | [
"Apache-2.0"
] | 11 | 2020-12-21T12:49:26.000Z | 2022-03-11T06:29:49.000Z | tests/python/unit/test_training_session.py | dataiku/dss-plugin-timeseries-forecast | 56980fdab629b5eb27ce4c17e7ba2348c2b2cb28 | [
"Apache-2.0"
] | 30 | 2020-12-01T18:17:58.000Z | 2022-03-29T21:43:51.000Z | tests/python/unit/test_training_session.py | dataiku/dss-plugin-timeseries-forecast | 56980fdab629b5eb27ce4c17e7ba2348c2b2cb28 | [
"Apache-2.0"
] | 5 | 2021-02-13T12:18:15.000Z | 2021-09-28T15:55:03.000Z | from gluonts_forecasts.training_session import TrainingSession
from gluonts_forecasts.model_config_registry import ModelConfigRegistry
from dku_constants import TIMESERIES_KEYS, METRICS_DATASET, EVALUATION_METRICS_DESCRIPTIONS, ROW_ORIGIN
from datetime import datetime
import pandas as pd
class TestTrainingSession:
... | 44.93913 | 120 | 0.622291 |
325909c95c2c2ea2f55286bd740f79b416740f18 | 1,535 | py | Python | d13/d13-2.py | panaC/aoc2020 | f56557dace7ffb127dd5cb65aaaa9545be3aa7fb | [
"MIT"
] | null | null | null | d13/d13-2.py | panaC/aoc2020 | f56557dace7ffb127dd5cb65aaaa9545be3aa7fb | [
"MIT"
] | null | null | null | d13/d13-2.py | panaC/aoc2020 | f56557dace7ffb127dd5cb65aaaa9545be3aa7fb | [
"MIT"
] | null | null | null | #! /usr/local/bin/python3
import operator
import sys
import math
from functools import reduce
lns = list(sys.stdin)
bus = list(
filter(
lambda x: x != 0,
map(
lambda x: (int(x[1]), x[0]) if x[1] != 'x' else 0,
enumerate(lns[1].split(',')),
... | 21.619718 | 67 | 0.579805 |
37ca343d3bd05055ec70fc9972ed32ec9e79fff2 | 6,679 | py | Python | bindings/python/ensmallen_graph/datasets/string/kluyveromyceslactis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/kluyveromyceslactis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/kluyveromyceslactis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Kluyveromyces lactis.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-0... | 35.338624 | 223 | 0.701901 |
c18cff2532303f7418757c87e70cbf129025c89e | 1,943 | py | Python | painting_app.py | xingyezn/MyQuickDraw | 82600ab15fcc88d5e6e3c191114c1e9526d8beda | [
"MIT"
] | null | null | null | painting_app.py | xingyezn/MyQuickDraw | 82600ab15fcc88d5e6e3c191114c1e9526d8beda | [
"MIT"
] | null | null | null | painting_app.py | xingyezn/MyQuickDraw | 82600ab15fcc88d5e6e3c191114c1e9526d8beda | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from src.config import *
from src.dataset import CLASSES
import torch
def main():
# Load model
if torch.cuda.is_available():
model = torch.load("trained_models/whole_model_quickdraw")
else:
model = torch.load("trained_models/whole_model_quickdraw", map_locati... | 28.15942 | 109 | 0.536799 |
d9ed37c39b27a4723b658fb6135755b461977050 | 4,315 | py | Python | deprecated/environments/test_quadcopter.py | MinRegret/TigerControl | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 31 | 2019-11-08T06:01:54.000Z | 2021-11-20T04:50:43.000Z | deprecated/environments/test_quadcopter.py | johnhallman/ctsb | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 32 | 2019-06-27T15:05:04.000Z | 2019-08-07T04:23:47.000Z | deprecated/environments/test_quadcopter.py | MinRegret/tigercontrol | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 3 | 2020-09-30T17:06:50.000Z | 2021-04-12T22:39:34.000Z | # Environment class
# Author: John Hallman
import tigercontrol
from tigercontrol.controllers import Controller
import jax
import jax.numpy as np
# run test
def test_quadcopter():
# Controller parameters
CONTROLLER_PARAMETERS = {
'Linear_PID':{'P':np.array([300,300,7000]),'I':np.array([0.04,0.04,4.5])... | 37.850877 | 111 | 0.626419 |
54d5f21f5111c05728888ecc6bf1abed1de52d4c | 19,901 | py | Python | sdk/python/pulumi_azure_native/web/v20210101/kube_environment.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20210101/kube_environment.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20210101/kube_environment.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 43.547046 | 499 | 0.656952 |
e9612389feccd720165facd1c23cbdc5b091e9fb | 5,398 | py | Python | poky-dunfell/meta/lib/oeqa/selftest/cases/runcmd.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | null | null | null | poky-dunfell/meta/lib/oeqa/selftest/cases/runcmd.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | null | null | null | poky-dunfell/meta/lib/oeqa/selftest/cases/runcmd.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | null | null | null | #
# SPDX-License-Identifier: MIT
#
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd
from oeqa.utils import CommandError
import subprocess
import threading
import time
import signal
class MemLogger(object):
def __init__(self):
self.info_msgs = []
self.error_... | 43.886179 | 209 | 0.662097 |
f70da3d54ecbd05f1e5054b3cc945d5b62ae323c | 4,133 | py | Python | homeassistant/components/alarm_control_panel/__init__.py | instantchow/home-assistant | 6797365d4fd74328a0c9e961f652cfb37f48bc7d | [
"MIT"
] | null | null | null | homeassistant/components/alarm_control_panel/__init__.py | instantchow/home-assistant | 6797365d4fd74328a0c9e961f652cfb37f48bc7d | [
"MIT"
] | null | null | null | homeassistant/components/alarm_control_panel/__init__.py | instantchow/home-assistant | 6797365d4fd74328a0c9e961f652cfb37f48bc7d | [
"MIT"
] | null | null | null | """
Component to interface with an alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel/
"""
import logging
import os
from homeassistant.components import verisure
from homeassistant.const import (
ATTR_CODE, ATTR_... | 27.370861 | 74 | 0.681829 |
4b4d1ad2253c1efed9358e840694749cb90fe006 | 7,226 | py | Python | sdk/lusid/models/add_business_days_to_date_request.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | sdk/lusid/models/add_business_days_to_date_request.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | sdk/lusid/models/add_business_days_to_date_request.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.4425
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 31.146552 | 143 | 0.621367 |
2cfd4e9e849c53ff7dacb12317476b4c957f4f6e | 1,272 | py | Python | python/day1.py | Raumzeitkeks/aoc2019 | 35f55dc48befa317736bde742c08e14556e37100 | [
"Unlicense"
] | null | null | null | python/day1.py | Raumzeitkeks/aoc2019 | 35f55dc48befa317736bde742c08e14556e37100 | [
"Unlicense"
] | null | null | null | python/day1.py | Raumzeitkeks/aoc2019 | 35f55dc48befa317736bde742c08e14556e37100 | [
"Unlicense"
] | null | null | null |
### input ###
with open("input/day1.txt") as f:
masses = [int(line) for line in f]
### helper ###
def direct_fuel(mass):
return mass//3 - 2
def indirect_fuel(mass):
total = 0
fuel = direct_fuel(mass)
while fuel > 0:
total += fuel
fuel = direct_fuel(fuel)
return total
###... | 18.705882 | 45 | 0.573113 |
c83562879afc65801d42a0b9a6d1d03c9e5b863d | 272 | py | Python | realpython/classes.py | bozi6/hello-world | 0835bf2dcb1d1aceb2afa194bf991c096b0e9b04 | [
"MIT"
] | null | null | null | realpython/classes.py | bozi6/hello-world | 0835bf2dcb1d1aceb2afa194bf991c096b0e9b04 | [
"MIT"
] | null | null | null | realpython/classes.py | bozi6/hello-world | 0835bf2dcb1d1aceb2afa194bf991c096b0e9b04 | [
"MIT"
] | null | null | null | import datetime
from dataclasses import dataclass
@dataclass
class Product:
id: str
parent: str
title: str
category: str
@dataclass
class Review:
id: str
customer_id: str
stars: int
headline: str
body: str
date: datetime.datetime
| 14.315789 | 33 | 0.672794 |
8eda227f44d394df018ecf474f001895be779a6b | 840 | py | Python | delete_sublist.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | delete_sublist.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | delete_sublist.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# http://ru.stackoverflow.com/questions/495034
# Нужно удалить из списка в вхождения, да не просто по элементам, а прям множество.
# Т.е. если есть список: [0, 1, 2, 3, 1, 5, 3, 7], и например, кортеж, который удаляемых
# элементов (1, 5, 3), ну... | 23.333333 | 88 | 0.575 |
b32bf7c5a9e5bb97947eae743ac4847492443c4a | 736 | py | Python | test/test_add_new.py | EkaterinaPentjuhina/python_training | 43f939cf690a91af9ec0fddfd18f9e3c55cfefb6 | [
"Apache-2.0"
] | 1 | 2020-06-08T17:16:29.000Z | 2020-06-08T17:16:29.000Z | test/test_add_new.py | EkaterinaPentjuhina/python_training | 43f939cf690a91af9ec0fddfd18f9e3c55cfefb6 | [
"Apache-2.0"
] | null | null | null | test/test_add_new.py | EkaterinaPentjuhina/python_training | 43f939cf690a91af9ec0fddfd18f9e3c55cfefb6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contact_properties import Contact
import allure
def test_add_new(app, db, json_contacts, check_ui):
contact = json_contacts
with allure.step('Given a group list'):
old_contacts = db.get_contact_list()
with allure.step('When I add a contact %s to the list' % conta... | 33.454545 | 127 | 0.695652 |
e02ca81034c40537cac4e78e15dc2fb35710a599 | 326 | py | Python | numpy/distutils/tests/gen_ext/tests/test_fib3.py | leifdenby/numpy | 4750c2810c5e0943cbea8e2acc0337c4e66a9bb2 | [
"BSD-3-Clause"
] | 145 | 2017-01-19T23:33:03.000Z | 2021-06-05T05:34:55.000Z | numpy/distutils/tests/gen_ext/tests/test_fib3.py | leifdenby/numpy | 4750c2810c5e0943cbea8e2acc0337c4e66a9bb2 | [
"BSD-3-Clause"
] | 17 | 2017-02-03T20:51:39.000Z | 2020-05-21T11:33:52.000Z | numpy/distutils/tests/gen_ext/tests/test_fib3.py | leifdenby/numpy | 4750c2810c5e0943cbea8e2acc0337c4e66a9bb2 | [
"BSD-3-Clause"
] | 44 | 2017-02-04T19:40:03.000Z | 2020-10-01T19:24:19.000Z | from __future__ import division, absolute_import, print_function
from gen_ext import fib3
from numpy.testing import TestCase, run_module_suite, assert_array_equal
class TestFib3(TestCase):
def test_fib(self):
assert_array_equal(fib3.fib(6), [0, 1, 1, 2, 3, 5])
if __name__ == "__main__":
run_module_su... | 27.166667 | 72 | 0.748466 |
d4855f021264c72a52b5d7470f0df3849af09a0f | 129 | py | Python | pj/app1/urls.py | TrongNghiaRyt/SE347-project-Django-Website | 383632f6f3f51553c3664a9b61a0a72b81981420 | [
"MIT"
] | null | null | null | pj/app1/urls.py | TrongNghiaRyt/SE347-project-Django-Website | 383632f6f3f51553c3664a9b61a0a72b81981420 | [
"MIT"
] | null | null | null | pj/app1/urls.py | TrongNghiaRyt/SE347-project-Django-Website | 383632f6f3f51553c3664a9b61a0a72b81981420 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('about/', views.about),
path('add', views.add),
]
| 16.125 | 32 | 0.651163 |
8568228930860c474bb5b2ea627cf673656ffda7 | 4,317 | py | Python | benchmark/startQiskit_Class1334.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class1334.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class1334.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=50
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 31.977778 | 80 | 0.611767 |
ab66c5ca11c0459f928874ee4fdbd214e45c7bf4 | 655 | py | Python | rottweiler/tests/test_registry.py | TwigWorld/django-rottweiler | 0d716119d45fcd619bbdc8caa2b6fc25914780d2 | [
"MIT"
] | 1 | 2016-03-04T14:25:04.000Z | 2016-03-04T14:25:04.000Z | rottweiler/tests/test_registry.py | TwigWorld/django-rottweiler | 0d716119d45fcd619bbdc8caa2b6fc25914780d2 | [
"MIT"
] | 1 | 2016-06-21T10:19:03.000Z | 2016-06-21T10:19:03.000Z | rottweiler/tests/test_registry.py | TwigWorld/django-rottweiler | 0d716119d45fcd619bbdc8caa2b6fc25914780d2 | [
"MIT"
] | 1 | 2015-01-07T15:35:54.000Z | 2015-01-07T15:35:54.000Z | from django.test import TestCase
from django.contrib.auth.models import User
from rottweiler import registry
from .stubs import ModelStub
def test_permission(self, user):
return True
class TestRegistry(TestCase):
def test_add_object_permission(self):
registry.register('test_permission', test_permis... | 27.291667 | 72 | 0.714504 |
b88e6eecccc77100d0cfc9159da24a36c4bb2ee1 | 2,120 | py | Python | src/grokcore/component/__init__.py | bielbienne/grokcore.component | 575276af7ef7575698c497a21f4ae7732fdc61bd | [
"ZPL-2.1"
] | null | null | null | src/grokcore/component/__init__.py | bielbienne/grokcore.component | 575276af7ef7575698c497a21f4ae7732fdc61bd | [
"ZPL-2.1"
] | null | null | null | src/grokcore/component/__init__.py | bielbienne/grokcore.component | 575276af7ef7575698c497a21f4ae7732fdc61bd | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2006-2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... | 26.835443 | 78 | 0.696698 |
5ce05a710ac0d37cd9fcf0e6f20cff77d7df7f45 | 604 | py | Python | src/extensions/unittest.py | jacobrask/critic | 80d30b517de955316d23109df956a6825cc6aa7e | [
"Apache-2.0"
] | null | null | null | src/extensions/unittest.py | jacobrask/critic | 80d30b517de955316d23109df956a6825cc6aa7e | [
"Apache-2.0"
] | null | null | null | src/extensions/unittest.py | jacobrask/critic | 80d30b517de955316d23109df956a6825cc6aa7e | [
"Apache-2.0"
] | null | null | null | import sys
import os
def independence():
# Simply check that extensions can be imported. This is run in a test
# flagged as "local" since we want extensions to be possible to import in
# standalone unit tests.
#
# Nothing in extensions can actually be used, of course, but that's not a
# proble... | 30.2 | 77 | 0.683775 |
00cfe76d960725453213a256b9a109b3906beb23 | 547 | py | Python | qiskit/test/mock/backends/tenerife/__init__.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 1,456 | 2017-08-05T16:33:05.000Z | 2018-06-05T04:15:35.000Z | qiskit/test/mock/backends/tenerife/__init__.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 365 | 2017-08-04T06:09:16.000Z | 2018-06-05T08:33:37.000Z | qiskit/test/mock/backends/tenerife/__init__.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 463 | 2017-08-05T04:10:01.000Z | 2018-06-05T06:43:21.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 derivative wo... | 34.1875 | 77 | 0.760512 |
106e6e262e3342425e143167e14f2d829b633526 | 2,390 | py | Python | modules/factories/factory_node.py | zeddo123/OpenBook | 051d2d86428f36c6ca0cc22eafeed23581347e17 | [
"WTFPL"
] | 12 | 2019-10-24T13:22:09.000Z | 2020-10-04T20:27:53.000Z | modules/factories/factory_node.py | zeddo123/OpenBook | 051d2d86428f36c6ca0cc22eafeed23581347e17 | [
"WTFPL"
] | null | null | null | modules/factories/factory_node.py | zeddo123/OpenBook | 051d2d86428f36c6ca0cc22eafeed23581347e17 | [
"WTFPL"
] | null | null | null | from twisted.internet.protocol import Factory
from twisted.internet.endpoints import TCP4ServerEndpoint
from twisted.internet.endpoints import TCP4ClientEndpoint, connectProtocol
from twisted.internet import reactor
import sys
sys.path.insert(0, '..')
from modules.utils import uuid_generator
from modules.protocols.pr... | 31.447368 | 83 | 0.75523 |
c1910738b2036559291fdbb0ba095c9221f15098 | 1,044 | py | Python | script.module.urlresolver/lib/urlresolver/plugins/blazefile.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2019-03-05T09:38:10.000Z | 2019-03-05T09:38:10.000Z | script.module.urlresolver/lib/urlresolver/plugins/blazefile.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | null | null | null | script.module.urlresolver/lib/urlresolver/plugins/blazefile.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | """
Kodi urlresolver plugin
Copyright (C) 2016 tknorris
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 later version... | 38.666667 | 73 | 0.708812 |
ba48fc3ad0241caf80d9ea122727c6168c8a3cff | 1,119 | py | Python | src/cc_catalog_airflow/dags/jamendo_workflow.py | sarayourfriend/openverse-catalog | b12ba815de782032f72ffa4f5620cfc8de8c84bd | [
"MIT"
] | null | null | null | src/cc_catalog_airflow/dags/jamendo_workflow.py | sarayourfriend/openverse-catalog | b12ba815de782032f72ffa4f5620cfc8de8c84bd | [
"MIT"
] | null | null | null | src/cc_catalog_airflow/dags/jamendo_workflow.py | sarayourfriend/openverse-catalog | b12ba815de782032f72ffa4f5620cfc8de8c84bd | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.python import PythonOperator
from provider_api_scripts import jamendo
from util.operator_util import get_log_operator
DAG_DEFAULT_ARGS = {
'owner': 'data-eng-admin',
'depends_on_past': False,
'start_date': datetime(2... | 21.941176 | 62 | 0.672922 |
ae94d607771a7ec7ce28da245d83f4198113d5ff | 2,871 | py | Python | bin/amazon/amazon_products_to_trec.py | cvangysel/SERT | 9d2b773c0ad7e794a45bd634c94a8d063ca9bbe5 | [
"MIT"
] | 107 | 2016-04-16T09:22:15.000Z | 2022-03-03T13:49:01.000Z | bin/amazon/amazon_products_to_trec.py | mindis/SERT | 9d2b773c0ad7e794a45bd634c94a8d063ca9bbe5 | [
"MIT"
] | 2 | 2018-07-02T15:06:49.000Z | 2021-01-24T14:44:56.000Z | bin/amazon/amazon_products_to_trec.py | mindis/SERT | 9d2b773c0ad7e794a45bd634c94a8d063ca9bbe5 | [
"MIT"
] | 24 | 2016-07-12T08:35:22.000Z | 2021-10-03T14:54:04.000Z | import sys
from cvangysel import argparse_utils, io_utils, logging_utils, trec_utils
import argparse
import ast
import gzip
import logging
import os
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--loglevel', type=str, default='INFO')
parser.add_argument('--shard_size',
... | 29.295918 | 76 | 0.570881 |
f03ea366cf002b12ba133905a40e1ef9535bb974 | 22,452 | py | Python | python/pyphantomjs/filesystem.py | thulio/phantomjs | c6d4e522364dc3db008b3b7f3fec1a25bf40b4db | [
"BSD-3-Clause"
] | 2 | 2020-02-13T17:02:51.000Z | 2020-11-09T16:15:23.000Z | python/pyphantomjs/filesystem.py | thulio/phantomjs | c6d4e522364dc3db008b3b7f3fec1a25bf40b4db | [
"BSD-3-Clause"
] | null | null | null | python/pyphantomjs/filesystem.py | thulio/phantomjs | c6d4e522364dc3db008b3b7f3fec1a25bf40b4db | [
"BSD-3-Clause"
] | null | null | null | '''
This file is part of the PyPhantomJS project.
Copyright (C) 2011 James Roe <roejames12@hotmail.com>
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
... | 31.622535 | 91 | 0.535765 |
6a4b6b95f6fd246f1e731fd54e0f9d014b0ae2c8 | 4,590 | py | Python | configs/retinanet/uavdt_retinanet_r50_fpn_tail.py | ProjektMetafora/DSHNet | f97aeb73f2201737415062d6db7217760c594ada | [
"Apache-2.0"
] | 38 | 2020-11-03T14:45:49.000Z | 2022-03-19T01:14:49.000Z | configs/retinanet/uavdt_retinanet_r50_fpn_tail.py | ProjektMetafora/DSHNet | f97aeb73f2201737415062d6db7217760c594ada | [
"Apache-2.0"
] | 8 | 2021-02-05T07:30:39.000Z | 2022-03-16T06:45:46.000Z | configs/retinanet/uavdt_retinanet_r50_fpn_tail.py | ProjektMetafora/DSHNet | f97aeb73f2201737415062d6db7217760c594ada | [
"Apache-2.0"
] | 9 | 2020-11-10T16:29:15.000Z | 2021-06-07T08:00:38.000Z | _base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
checkpoint_config = dict(interval=1)
log_config = dict(
interval=500,
hooks=[
dict(type='TextLoggerHook'),
# dict(type='T... | 29.423077 | 77 | 0.588889 |
cb6cfb3dbd8fb9079a9a335dfa108d9d7529fd78 | 717 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/conftest.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/conftest.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/conftest.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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.
# --------------------------------------------------------------------... | 29.875 | 76 | 0.587169 |
6c84036f517238f276728088451b44627f5843a4 | 1,246 | py | Python | build/catkin_generated/generate_cached_setup.py | bowei33/teat | 1ffcecf80acfb8b87679685f5c3d7d7cc5736665 | [
"MIT"
] | null | null | null | build/catkin_generated/generate_cached_setup.py | bowei33/teat | 1ffcecf80acfb8b87679685f5c3d7d7cc5736665 | [
"MIT"
] | null | null | null | build/catkin_generated/generate_cached_setup.py | bowei33/teat | 1ffcecf80acfb8b87679685f5c3d7d7cc5736665 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, ... | 40.193548 | 102 | 0.727929 |
6783de81d1b223eff8c2b2662ef413d801c1200a | 2,654 | py | Python | Sample-repository/main/objects.py | MKupperman/Intro-to-Python | 9cbc121a07164d1f40fe6cd1102913ba7056e4be | [
"MIT"
] | null | null | null | Sample-repository/main/objects.py | MKupperman/Intro-to-Python | 9cbc121a07164d1f40fe6cd1102913ba7056e4be | [
"MIT"
] | null | null | null | Sample-repository/main/objects.py | MKupperman/Intro-to-Python | 9cbc121a07164d1f40fe6cd1102913ba7056e4be | [
"MIT"
] | null | null | null | """
objects.py
We can make an object and use it in the same script
"""
class polynomial(object):
def __init__(self, coef_list):
"""
The __init__ method is called whenever a new instance of an object is created.
All attributes should be created within the __init__ method.
:param co... | 36.356164 | 115 | 0.619819 |
7ae6b6cf35632738eefa52901ddf2f37fce3e625 | 12,974 | py | Python | sympy/assumptions/handlers/order.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | sympy/assumptions/handlers/order.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | sympy/assumptions/handlers/order.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | """
Handlers related to order relations: positive, negative, etc.
"""
from sympy.assumptions import Q, ask
from sympy.core import Add, Basic, Expr, Mul, Pow
from sympy.core.logic import fuzzy_not, fuzzy_and, fuzzy_or
from sympy.core.numbers import E, ImaginaryUnit, NaN
from sympy.functions import Abs, acos, acot, asin... | 29.553531 | 100 | 0.661091 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.