hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7958432ffa8b6002827c38fb885c0031e54a57ea | 4,563 | py | Python | toolsws/backends/gridengine.py | diegodlh/operations-software-tools-webservice | c5e3aaaaa852c9c0dafc580774c27c247657913f | [
"Apache-2.0"
] | 8 | 2016-04-12T18:05:40.000Z | 2020-11-23T18:51:47.000Z | toolsws/backends/gridengine.py | diegodlh/operations-software-tools-webservice | c5e3aaaaa852c9c0dafc580774c27c247657913f | [
"Apache-2.0"
] | null | null | null | toolsws/backends/gridengine.py | diegodlh/operations-software-tools-webservice | c5e3aaaaa852c9c0dafc580774c27c247657913f | [
"Apache-2.0"
] | 3 | 2018-08-30T15:01:46.000Z | 2022-02-27T16:16:53.000Z | import os
import re
import subprocess
import xml.etree.ElementTree as ET
from toolsws.utils import wait_for
from toolsws.wstypes import GenericWebService
from toolsws.wstypes import JSWebService
from toolsws.wstypes import LighttpdPlainWebService
from toolsws.wstypes import LighttpdWebService
from toolsws.wstypes impo... | 33.306569 | 79 | 0.584046 |
795843449e1155055ac6a9286b9b10c290847472 | 303 | py | Python | django_actionable_messages/elements.py | utsurius/django-actionable-messages | 5b190bce74afcbe7fc41039f8cf87b04173208e6 | [
"MIT"
] | null | null | null | django_actionable_messages/elements.py | utsurius/django-actionable-messages | 5b190bce74afcbe7fc41039f8cf87b04173208e6 | [
"MIT"
] | null | null | null | django_actionable_messages/elements.py | utsurius/django-actionable-messages | 5b190bce74afcbe7fc41039f8cf87b04173208e6 | [
"MIT"
] | null | null | null | from typing import Union
from django_actionable_messages.mixins import CardElement
class Header(CardElement):
def __init__(self, name: str, value: Union[str, int], **kwargs):
self._data = {
"name": name,
"value": value
}
super().__init__(**kwargs)
| 23.307692 | 68 | 0.613861 |
795844a4e1cf49cf35d22c5b34499ad59f45e14b | 3,498 | py | Python | discrimination/youtube-nokey.py | panosprotopapas/Swisscom-Discrimination-Project | e84fd68326ef17f55785d8ee42dd94653430a110 | [
"Apache-2.0"
] | null | null | null | discrimination/youtube-nokey.py | panosprotopapas/Swisscom-Discrimination-Project | e84fd68326ef17f55785d8ee42dd94653430a110 | [
"Apache-2.0"
] | null | null | null | discrimination/youtube-nokey.py | panosprotopapas/Swisscom-Discrimination-Project | e84fd68326ef17f55785d8ee42dd94653430a110 | [
"Apache-2.0"
] | null | null | null | ################################
################################
###### PACKAGES ########
################################
################################
import re
import os
import json
import pymongo
import discrimination
import googleapiclient.discovery
import pickle
################################
####... | 30.155172 | 133 | 0.492281 |
795844e877fb56ab0dfb19afb3649f9c1ca65f57 | 4,479 | py | Python | NAS/cifar100/models/resnet.py | TiffanyTseng54/SimpleCVReproduction | 52754eb924c6c094af0b8089a1bd7af0be7ec1a3 | [
"Apache-2.0"
] | 1 | 2022-03-03T06:04:34.000Z | 2022-03-03T06:04:34.000Z | NAS/cifar100/models/resnet.py | TiffanyTseng54/SimpleCVReproduction | 52754eb924c6c094af0b8089a1bd7af0be7ec1a3 | [
"Apache-2.0"
] | null | null | null | NAS/cifar100/models/resnet.py | TiffanyTseng54/SimpleCVReproduction | 52754eb924c6c094af0b8089a1bd7af0be7ec1a3 | [
"Apache-2.0"
] | null | null | null | '''ResNet in PyTorch.
For Pre-activation ResNet, see 'preact_resnet.py'.
Reference:
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Deep Residual Learning for Image Recognition. arXiv:1512.03385
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ['ResNet18', "ResNet34", "Re... | 33.177778 | 83 | 0.606832 |
795844fad40837b94c865d1da49250475681ab54 | 4,204 | py | Python | python/tvm/relay/op/image/_image.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/op/image/_image.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/op/image/_image.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.743802 | 100 | 0.725737 |
795846ca7df89602de9b3a5f0e85ac6c09825572 | 275 | py | Python | pharos/utils.py | Yiling-J/pharos | a6dd80bd7c0475d78e6490735e3e5fd6eebc28c5 | [
"BSD-3-Clause"
] | 1 | 2021-12-03T16:28:41.000Z | 2021-12-03T16:28:41.000Z | pharos/utils.py | Yiling-J/pharos | a6dd80bd7c0475d78e6490735e3e5fd6eebc28c5 | [
"BSD-3-Clause"
] | 14 | 2021-04-08T14:16:27.000Z | 2021-05-24T15:15:11.000Z | pharos/utils.py | Yiling-J/pharos | a6dd80bd7c0475d78e6490735e3e5fd6eebc28c5 | [
"BSD-3-Clause"
] | null | null | null | from collections import UserDict
class ReadOnlyDict(UserDict):
def __init__(self, data):
self.data = data
def __setitem__(self, key, value):
raise TypeError("readonly dict")
def __delitem__(self, key):
raise TypeError("readonly dict")
| 21.153846 | 40 | 0.669091 |
795847d6c54a5ad5ad34335eed6c4d2c798c5692 | 2,450 | py | Python | ppma/imagenet/validate.py | lmk123568/Paddle_Model_Analysis | d03a82591512fcad065fc69abfdbfb0835099c2d | [
"MIT"
] | 13 | 2021-07-03T05:26:56.000Z | 2022-03-19T01:34:11.000Z | ppma/imagenet/validate.py | lmk123568/Paddle_Model_Analysis | d03a82591512fcad065fc69abfdbfb0835099c2d | [
"MIT"
] | 1 | 2021-11-18T07:07:03.000Z | 2021-11-23T01:50:01.000Z | ppma/imagenet/validate.py | lmk123568/Paddle_Model_Analysis | d03a82591512fcad065fc69abfdbfb0835099c2d | [
"MIT"
] | 1 | 2022-03-19T01:34:15.000Z | 2022-03-19T01:34:15.000Z | import time
import numpy as np
import paddle
import paddle.nn.functional as F
import paddle.vision.transforms as T
from paddle.io import DataLoader, Dataset
from PIL import Image
from .utils import AverageMeter, get_val_transforms
class ImageNet2012Dataset(Dataset):
def __init__(self, data, image_siz... | 29.878049 | 149 | 0.577959 |
795847e9f66e2184df61be843d0b068be088d9f6 | 18,163 | py | Python | tests/unit/states/test_glusterfs.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | tests/unit/states/test_glusterfs.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/unit/states/test_glusterfs.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.suppo... | 43.452153 | 116 | 0.525134 |
795848d35b17eaa427e2bcfc499d125a5d204ae8 | 335 | py | Python | notifyme/app.py | djbelyak/NotifyMeBot | 773a8686f910216933de5d7403c8ba8e9cdbd991 | [
"MIT"
] | null | null | null | notifyme/app.py | djbelyak/NotifyMeBot | 773a8686f910216933de5d7403c8ba8e9cdbd991 | [
"MIT"
] | 5 | 2018-03-19T17:08:47.000Z | 2018-03-27T17:08:49.000Z | notifyme/app.py | djbelyak/NotifyMeBot | 773a8686f910216933de5d7403c8ba8e9cdbd991 | [
"MIT"
] | null | null | null | ''' This package contains a main logic of application. '''
import subprocess
class App():
def __init__(self, command, notificator):
self.command = command
self.notificator = notificator
def run(self):
subprocess.run(self.command)
self.notificator.notify(' '.join(self.command) ... | 25.769231 | 69 | 0.659701 |
795848dd33ba2b5b13e5c38433b75ea21eb272aa | 5,775 | py | Python | betty/cropper/dssim.py | theonion/betty-cropper | bb0e570c1eb0ddb2f39d109f996edd1d417d1fe4 | [
"MIT"
] | 14 | 2015-01-13T21:24:30.000Z | 2020-12-18T23:39:35.000Z | betty/cropper/dssim.py | theonion/betty-cropper | bb0e570c1eb0ddb2f39d109f996edd1d417d1fe4 | [
"MIT"
] | 39 | 2015-06-08T20:56:35.000Z | 2017-06-09T03:20:08.000Z | betty/cropper/dssim.py | theonion/betty-cropper | bb0e570c1eb0ddb2f39d109f996edd1d417d1fe4 | [
"MIT"
] | 5 | 2015-12-04T20:22:08.000Z | 2018-03-05T19:17:43.000Z | try:
import numpy as np
import scipy.ndimage
except ImportError:
pass
from betty.conf.app import settings
import io
import math
from PIL import Image
MIN_UNIQUE_COLORS = 4096
COLOR_DENSITY_RATIO = 0.11
QUALITY_IN_MIN = 82
ERROR_THRESHOLD = 1.3
ERROR_THRESHOLD_INACCURACY = 0.01
def compute_ssim(im1,... | 28.308824 | 95 | 0.621645 |
795849400df552db11fa03d1c5ecf66c7da7b7e9 | 942 | py | Python | alipay/aop/api/response/AlipayPassTemplateUpdateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayPassTemplateUpdateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayPassTemplateUpdateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayPassTemplateUpdateResponse(AlipayResponse):
def __init__(self):
super(AlipayPassTemplateUpdateResponse, self).__init__()
self._result = None
self._succe... | 26.166667 | 105 | 0.669851 |
795849843f4e04701658af972435b1f3cf483484 | 81,225 | py | Python | tensorflow/python/debug/cli/analyzer_cli_test.py | MathMachado/tensorflow | 56afda20b15f234c23e8393f7e337e7dd2659c2d | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/python/debug/cli/analyzer_cli_test.py | MathMachado/tensorflow | 56afda20b15f234c23e8393f7e337e7dd2659c2d | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/python/debug/cli/analyzer_cli_test.py | MathMachado/tensorflow | 56afda20b15f234c23e8393f7e337e7dd2659c2d | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.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... | 38.495261 | 80 | 0.636233 |
795849e52b781b0f9ffc1b2d5e07513fdd8b9588 | 3,787 | py | Python | ravendb/infrastructure/orders.py | ravendb/RavenDB-Python-Client | 6286b459b501e755fe8e8591a48acf8616605ccd | [
"MIT"
] | 8 | 2016-10-08T17:45:44.000Z | 2018-05-29T12:16:43.000Z | ravendb/infrastructure/orders.py | ravendb/RavenDB-Python-Client | 6286b459b501e755fe8e8591a48acf8616605ccd | [
"MIT"
] | 5 | 2017-02-12T15:50:53.000Z | 2017-09-18T12:25:01.000Z | ravendb/infrastructure/orders.py | ravendb/RavenDB-Python-Client | 6286b459b501e755fe8e8591a48acf8616605ccd | [
"MIT"
] | 8 | 2016-07-03T07:59:12.000Z | 2017-09-18T11:22:23.000Z | import datetime
from typing import List
class Contact:
def __init__(self, name: str = None, title: str = None):
self.name = name
self.title = title
class Address:
def __init__(
self,
line1: str = None,
line2: str = None,
city: str = None,
region: str =... | 26.117241 | 60 | 0.565091 |
79584afe8f772ca9476c9585560b2b8ef465c58c | 19,787 | py | Python | slam/surface_profiling.py | JulienLefevreMars/slam | 484ee9bb052e4107ef4edbbd876fe5cd6305c8fc | [
"MIT"
] | 6 | 2019-06-07T16:01:06.000Z | 2020-12-04T12:43:54.000Z | slam/surface_profiling.py | JulienLefevreMars/slam | 484ee9bb052e4107ef4edbbd876fe5cd6305c8fc | [
"MIT"
] | 25 | 2020-06-22T20:42:06.000Z | 2021-01-01T09:52:22.000Z | slam/surface_profiling.py | JulienLefevreMars/slam | 484ee9bb052e4107ef4edbbd876fe5cd6305c8fc | [
"MIT"
] | 17 | 2019-09-10T13:19:03.000Z | 2021-12-14T15:53:49.000Z | import numpy as np
from scipy.spatial.distance import cdist
import trimesh
import trimesh.intersections
import trimesh.triangles
import slam.geodesics
import slam.utils as utils
def cortical_surface_profiling(mesh, rot_angle, r_step, max_samples):
"""
Surface profiling for a given cortical surface.
NOTE:... | 34.472125 | 80 | 0.644211 |
79584b29898b30b30bf18050f26b065f7b273c76 | 1,672 | py | Python | config.py | Mohllal/flasky | 324256dd43826961a85f7432b7af8b692727372e | [
"MIT"
] | null | null | null | config.py | Mohllal/flasky | 324256dd43826961a85f7432b7af8b692727372e | [
"MIT"
] | 4 | 2020-03-24T16:39:58.000Z | 2022-03-08T21:09:29.000Z | config.py | Mohllal/flasky | 324256dd43826961a85f7432b7af8b692727372e | [
"MIT"
] | 2 | 2020-03-26T02:27:48.000Z | 2020-12-29T09:40:01.000Z | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'secretkey'
MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.googlemail.com')
MAIL_PORT = int(os.environ.get('MAIL_PORT', '587'))
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS', 'tr... | 32.153846 | 81 | 0.703349 |
79584d27bf5293812d00f9c67add595f63890376 | 1,642 | py | Python | ur_robot_driver/tests/utils/ur_msg.py | UniversalRobots/Universal_Robots_Isaac_Driver | 7a0dae53b40437ad5b84906175003e21ebfdc3fe | [
"Apache-2.0"
] | 16 | 2020-09-23T13:27:14.000Z | 2022-01-21T14:58:33.000Z | ur_robot_driver/tests/utils/ur_msg.py | UniversalRobots/Universal_Robots_Isaac_Driver | 7a0dae53b40437ad5b84906175003e21ebfdc3fe | [
"Apache-2.0"
] | 3 | 2021-06-10T08:02:46.000Z | 2022-01-27T10:41:16.000Z | ur_robot_driver/tests/utils/ur_msg.py | UniversalRobots/Universal_Robots_Isaac_Driver | 7a0dae53b40437ad5b84906175003e21ebfdc3fe | [
"Apache-2.0"
] | 3 | 2021-02-24T01:53:48.000Z | 2021-06-03T15:51:08.000Z | import glob
import capnp
from packages.pyalice import Message
def create_ur_msg_dictornary():
"""Load all the capnp'n'proto schemata in the ur_msg folder. The function will glob through all the
files with "*.capnp" extension name."""
capnp_dict = {}
ur_capnp_files = glob.glob("packages/universal_robots... | 35.695652 | 103 | 0.694275 |
79584dc63464947f796395884e01cb066802e51c | 2,947 | py | Python | sicp_1.1.1/scheme.py | cellularmitosis/scheme_interpreters | bd4bbdd114b8a0a5ca0584184788181ae62556b4 | [
"MIT"
] | null | null | null | sicp_1.1.1/scheme.py | cellularmitosis/scheme_interpreters | bd4bbdd114b8a0a5ca0584184788181ae62556b4 | [
"MIT"
] | null | null | null | sicp_1.1.1/scheme.py | cellularmitosis/scheme_interpreters | bd4bbdd114b8a0a5ca0584184788181ae62556b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# a scheme interpreter which can handle SICP through section 1.1.1 and exercise 1.1.1.
import sys
def main():
for combination in tokenize_combinations(read_source_file(), 0):
print evaluate(combination)
def read_source_file():
source_fname = sys.argv[1]
with open(source_fname, "r") as fd... | 23.388889 | 86 | 0.685443 |
79584eec7b09f60978e12bfbaa4180149d42e1a7 | 4,959 | py | Python | backend/api/issues/routes.py | accorvin/backlog-ballot | 8428701dfd66bf86a8bd97a795d9fa198f79ee81 | [
"MIT"
] | null | null | null | backend/api/issues/routes.py | accorvin/backlog-ballot | 8428701dfd66bf86a8bd97a795d9fa198f79ee81 | [
"MIT"
] | null | null | null | backend/api/issues/routes.py | accorvin/backlog-ballot | 8428701dfd66bf86a8bd97a795d9fa198f79ee81 | [
"MIT"
] | null | null | null | import traceback
from api import db
from api.models import Issue
from api.issues import bp
from flask import current_app, jsonify, request
def _get_all_issues(page=1, issues_per_page=15):
issues = Issue.query.order_by(Issue.created.desc())
paginate_issues = issues.paginate(page, issues_per_page, False)
i... | 29.517857 | 76 | 0.623916 |
79584f49448ea81f6103162677e2d5eb9c2c867f | 2,127 | py | Python | wikimedia_thumbor/app.py | wikimedia/operations-software-thumbor-plugins | b30f1594e05118a1d2ed77a886d270866206d08a | [
"MIT"
] | null | null | null | wikimedia_thumbor/app.py | wikimedia/operations-software-thumbor-plugins | b30f1594e05118a1d2ed77a886d270866206d08a | [
"MIT"
] | null | null | null | wikimedia_thumbor/app.py | wikimedia/operations-software-thumbor-plugins | b30f1594e05118a1d2ed77a886d270866206d08a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2016 Wikimedia Foundation
import manhole
import os.path
import tempfile
import thumbor.engines
from thumbor.utils import logger, which
from thumbor.handlers import ContextHan... | 31.279412 | 68 | 0.633756 |
79584f5d9bef30d92dbd270119a021be67510abb | 319 | py | Python | profiles/forms.py | Shirhussain/Find-my-match | f11f64ebb0f2145d8cd9a352bd2c29bf30c85088 | [
"MIT"
] | null | null | null | profiles/forms.py | Shirhussain/Find-my-match | f11f64ebb0f2145d8cd9a352bd2c29bf30c85088 | [
"MIT"
] | null | null | null | profiles/forms.py | Shirhussain/Find-my-match | f11f64ebb0f2145d8cd9a352bd2c29bf30c85088 | [
"MIT"
] | null | null | null | from django import forms
from .models import UserJob, Profile
class UserJobForm(forms.ModelForm):
class Meta:
model = UserJob
fields = ['position', 'location', 'employer_name']
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
fields = ['picture', 'location']
| 21.266667 | 58 | 0.655172 |
79584f5e238b406decb8f83e2695ebc50bba880a | 1,467 | py | Python | src/azure-cli/azure/cli/command_modules/acr/credential.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/acr/credential.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/acr/credential.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.84375 | 114 | 0.694615 |
7958507854ee529598362cf7963e91147f0a8d3e | 590 | py | Python | Session_1/Problem_1/plot_energies.py | jcartus/FHI-AIMS_Tutorials | d91c6865b3192e2e56f4572593255d52fd6191d8 | [
"MIT"
] | null | null | null | Session_1/Problem_1/plot_energies.py | jcartus/FHI-AIMS_Tutorials | d91c6865b3192e2e56f4572593255d52fd6191d8 | [
"MIT"
] | null | null | null | Session_1/Problem_1/plot_energies.py | jcartus/FHI-AIMS_Tutorials | d91c6865b3192e2e56f4572593255d52fd6191d8 | [
"MIT"
] | null | null | null | """This script plots the hydrogen energies with different basis sets. """
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("seaborn")
def fetch_data():
return np.loadtxt(
fname="energies.csv",
delimiter=";",
skiprows=1
)
def plot(data):
plt.plot(data[:, 0], data[:... | 19.666667 | 73 | 0.586441 |
7958508a64e801fdad7d5e90992ebfdf5cad4a94 | 8,556 | py | Python | venv/Lib/site-packages/player/layout_impl.py | mandamg/Exercicios-de-Python-do-Curso-em-Video | 3f818c11c3c10213bebc1dfb6a740adee468ea3a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/player/layout_impl.py | mandamg/Exercicios-de-Python-do-Curso-em-Video | 3f818c11c3c10213bebc1dfb6a740adee468ea3a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/player/layout_impl.py | mandamg/Exercicios-de-Python-do-Curso-em-Video | 3f818c11c3c10213bebc1dfb6a740adee468ea3a | [
"MIT"
] | null | null | null | """ layout implementation """
import sys
import json
import logging
import random
import venusian
from collections import namedtuple
from collections import OrderedDict
from zope.interface import providedBy, Interface
from pyramid.compat import text_, string_types
from pyramid.config.views import DefaultViewMapper
from... | 30.776978 | 93 | 0.618396 |
79585102c02e68d0c12fc3f22297f6bac8ceb047 | 1,608 | py | Python | python_modules/libraries/dagster-azure/setup.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-azure/setup.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-azure/setup.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from setuptools import find_packages, setup
def get_version() -> str:
version: Dict[str, str] = {}
with open("dagster_azure/version.py", encoding="utf8") as fp:
exec(fp.read(), version) # pylint: disable=W0122
return version["__version__"]
if __name__ == "__main__":
... | 35.733333 | 103 | 0.598259 |
7958525f058e04e212af78f58fe9702d105a0e86 | 5,245 | py | Python | my_site/settings.py | a1401358759/my_site | 9ed227f825f1c25c903a10271ea429fba1e1ee73 | [
"MIT"
] | 50 | 2019-02-19T09:57:07.000Z | 2021-11-09T12:02:14.000Z | my_site/settings.py | a1401358759/my_site | 9ed227f825f1c25c903a10271ea429fba1e1ee73 | [
"MIT"
] | 17 | 2019-12-13T07:09:53.000Z | 2021-12-11T03:57:58.000Z | my_site/settings.py | a1401358759/my_site | 9ed227f825f1c25c903a10271ea429fba1e1ee73 | [
"MIT"
] | 11 | 2019-02-19T09:58:08.000Z | 2021-03-28T13:22:20.000Z | """
Django settings for my_site project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
fr... | 28.977901 | 99 | 0.682555 |
79585311fc6bb6f0adae7eb7844cadffacb1cf89 | 393 | py | Python | climbing-stairs/climbing-stairs.py | rams1996/Dynamic-Programming | 61e7b7d1576202215b5d0159372830c356f8dea8 | [
"MIT"
] | null | null | null | climbing-stairs/climbing-stairs.py | rams1996/Dynamic-Programming | 61e7b7d1576202215b5d0159372830c356f8dea8 | [
"MIT"
] | null | null | null | climbing-stairs/climbing-stairs.py | rams1996/Dynamic-Programming | 61e7b7d1576202215b5d0159372830c356f8dea8 | [
"MIT"
] | null | null | null | class Solution:
def climbStairs(self, n: int) -> int:
dp={}
def dfs(total,c):
if total in dp:
return dp[total]
if total==n:
return 1
if total>n:
return 0
a=dfs(total+1,c+1)
b=dfs(total+2,c+1)
... | 24.5625 | 41 | 0.402036 |
7958532390422ce3c5cac766ca8aa3c95b54fe73 | 955 | py | Python | thornode_client/test/test_liquidity_provider.py | hoodieonwho/thorchain-python-client | fccfd66552e16bdab1dbb90b68022475c7a9693d | [
"MIT"
] | null | null | null | thornode_client/test/test_liquidity_provider.py | hoodieonwho/thorchain-python-client | fccfd66552e16bdab1dbb90b68022475c7a9693d | [
"MIT"
] | null | null | null | thornode_client/test/test_liquidity_provider.py | hoodieonwho/thorchain-python-client | fccfd66552e16bdab1dbb90b68022475c7a9693d | [
"MIT"
] | null | null | null | # coding: utf-8
"""
THORChain API
This documentation outlines the API for THORChain. NOTE: This document is a **work in progress**. # noqa: E501
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest... | 23.292683 | 116 | 0.712042 |
795854137411597bb41fb26a7e11d953a58699b0 | 2,190 | py | Python | ai/common/env_runner.py | alexgorin/gymai | 2f32fcc8cbd3cce5ba43afe2293776b9e7f5ffa3 | [
"MIT"
] | null | null | null | ai/common/env_runner.py | alexgorin/gymai | 2f32fcc8cbd3cce5ba43afe2293776b9e7f5ffa3 | [
"MIT"
] | null | null | null | ai/common/env_runner.py | alexgorin/gymai | 2f32fcc8cbd3cce5ba43afe2293776b9e7f5ffa3 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import List, Tuple
import gym
from ai.common.agent import Agent
@dataclass
class EnvRunner:
env: gym.Env
agent: Agent
render: bool = False
episode_reward_history: List[Tuple[int, float]] = field(default_factory=list, init=False)
def run(self,... | 35.322581 | 118 | 0.648402 |
795854524a66e8ea45fa1a27c0efd0a40190535a | 1,557 | py | Python | reference_parsing/model_dev/BER_error_calculation.py | ScholarIndex/LinkedBooks | 0cae008427ed1eb34a882e9d85f24b42b3ee3a28 | [
"MIT"
] | null | null | null | reference_parsing/model_dev/BER_error_calculation.py | ScholarIndex/LinkedBooks | 0cae008427ed1eb34a882e9d85f24b42b3ee3a28 | [
"MIT"
] | 6 | 2020-03-20T18:10:01.000Z | 2021-09-29T17:31:17.000Z | reference_parsing/model_dev/BER_error_calculation.py | ScholarIndex/LinkedBooks | 0cae008427ed1eb34a882e9d85f24b42b3ee3a28 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Balanced Error Rate error functions
"""
__author__ = """Giovanni Colavizza"""
import numpy as np
def BER(yn, ynhat):
"""
Implementation of Balanced Error Rate
:param yn: ground truth
:param ynhat: predicted values
:return: error score
"""
y = list()
for z ... | 25.52459 | 108 | 0.567116 |
795854f0c0a0c3d6057255d60e176be6e8ad8bde | 12,789 | py | Python | conda_build/inspect_pkg.py | isuruf/conda-build | 9f163925f5d03a46e921162892bf4c6bc86b1072 | [
"BSD-3-Clause"
] | null | null | null | conda_build/inspect_pkg.py | isuruf/conda-build | 9f163925f5d03a46e921162892bf4c6bc86b1072 | [
"BSD-3-Clause"
] | 1 | 2019-10-08T15:03:56.000Z | 2019-10-08T15:03:56.000Z | conda_build/inspect_pkg.py | awwad/conda-build | b0be80283ec2e3ef7e49b5da923b1438e74e27b5 | [
"BSD-3-Clause"
] | null | null | null | # (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
from collections import defaultdict
i... | 37.949555 | 100 | 0.570412 |
7958553ac4e5bd69c83f78c91705554bafebb2a3 | 1,750 | py | Python | mesonui/mesonuilib/mesonbuild/wrap.py | michaelbadcrumble/meson-ui | e2db2b87872d87c101001b87fe48c5172bb8d5ff | [
"Apache-2.0"
] | 24 | 2019-10-14T21:17:27.000Z | 2020-05-28T11:35:14.000Z | mesonui/mesonuilib/mesonbuild/wrap.py | michaelbrockus/meson-ui | e2db2b87872d87c101001b87fe48c5172bb8d5ff | [
"Apache-2.0"
] | 52 | 2019-11-30T18:35:25.000Z | 2020-04-25T22:09:35.000Z | mesonui/mesonuilib/mesonbuild/wrap.py | michaelbadcrumble/meson-ui | e2db2b87872d87c101001b87fe48c5172bb8d5ff | [
"Apache-2.0"
] | 2 | 2019-10-15T01:11:18.000Z | 2019-11-03T06:36:08.000Z | #!/usr/bin/env python3
#
# author : Michael Brockus.
# contact: <mailto:michaelbrockus@gmail.com>
# license: Apache 2.0 :http://www.apache.org/licenses/LICENSE-2.0
#
# copyright 2020 The Meson-UI development team
#
import subprocess
class MesonWrap:
def __init__(self):
super().__init__()
def updat... | 38.043478 | 108 | 0.661143 |
7958559017215d4078254ce79ccacd1397480721 | 370 | py | Python | multiple-languages/python/ros-cdk-ram-1.0.3/src/ros_cdk_ram/_jsii/__init__.py | aliyun/Resource-Orchestration-Service-Cloud-Development-K | 2b81e135002ed81cb72f7d07be7ff497ea39e2e1 | [
"Apache-2.0"
] | 15 | 2020-11-10T02:00:28.000Z | 2022-02-07T19:28:10.000Z | multiple-languages/python/ros-cdk-ram-1.0.3/src/ros_cdk_ram/_jsii/__init__.py | aliyun/Resource-Orchestration-Service-Cloud-Development-K | 2b81e135002ed81cb72f7d07be7ff497ea39e2e1 | [
"Apache-2.0"
] | 23 | 2021-02-02T04:37:02.000Z | 2022-03-31T06:41:06.000Z | multiple-languages/python/ros-cdk-ram-1.0.3/src/ros_cdk_ram/_jsii/__init__.py | aliyun/Resource-Orchestration-Service-Cloud-Development-K | 2b81e135002ed81cb72f7d07be7ff497ea39e2e1 | [
"Apache-2.0"
] | 4 | 2021-01-13T05:48:43.000Z | 2022-03-15T11:26:48.000Z | import abc
import builtins
import datetime
import enum
import typing
import jsii
import publication
import typing_extensions
import constructs._jsii
import ros_cdk_core._jsii
__jsii_assembly__ = jsii.JSIIAssembly.load(
"@alicloud/ros-cdk-ram", "1.0.3", __name__[0:-6], "ros-cdk-ram@1.0.3.jsii.tgz"
)
__all__ = [
... | 16.086957 | 82 | 0.759459 |
795858ae611463a52d07be350e64de140fa839c6 | 4,503 | py | Python | autoencoder/trainer.py | Silver-L/keras_projects | 92124dc2ec4adc4c0509d0ee0655ebd39b8ba937 | [
"MIT"
] | null | null | null | autoencoder/trainer.py | Silver-L/keras_projects | 92124dc2ec4adc4c0509d0ee0655ebd39b8ba937 | [
"MIT"
] | null | null | null | autoencoder/trainer.py | Silver-L/keras_projects | 92124dc2ec4adc4c0509d0ee0655ebd39b8ba937 | [
"MIT"
] | null | null | null | """
* @Trainer
* @Author: Zhihui Lu
* @Date: 2018/07/21
"""
import os
import numpy as np
import argparse
import dataIO as io
from random import randint
import matplotlib.pyplot as plt
import pickle
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
from keras.optimizers import A... | 33.355556 | 120 | 0.650899 |
79585aa28af20826d157fe3d13a487a9c0e17d4e | 1,374 | py | Python | CTCI Solutions/arrays/checkPermutation.py | kamwithak/competitiveProgramming | ab4433568081900212a8a987d7bf8cb78d2698d1 | [
"MIT"
] | null | null | null | CTCI Solutions/arrays/checkPermutation.py | kamwithak/competitiveProgramming | ab4433568081900212a8a987d7bf8cb78d2698d1 | [
"MIT"
] | 1 | 2020-07-19T15:40:25.000Z | 2020-07-19T15:40:25.000Z | CTCI Solutions/arrays/checkPermutation.py | kamwithak/competitiveProgramming | ab4433568081900212a8a987d7bf8cb78d2698d1 | [
"MIT"
] | null | null | null | '''
PROBLEM STATEMENT:
Check Permutation:
Given two strings, write a method to decide if one is a permutation of the other.
'''
'''
ANS:
We can either sort the strings individually, and compare if the resulting strings are equivalent
Although not optimal, it is clean and easy to understand.
Or, we can co... | 26.423077 | 97 | 0.596798 |
79585b15689f5bb3e964ca74debf043aaa55e681 | 1,389 | py | Python | two_factor_authentication/models.py | Parveen3300/Reans | 6dfce046b01099284a8c945a04600ed83e5099a4 | [
"Apache-2.0"
] | null | null | null | two_factor_authentication/models.py | Parveen3300/Reans | 6dfce046b01099284a8c945a04600ed83e5099a4 | [
"Apache-2.0"
] | null | null | null | two_factor_authentication/models.py | Parveen3300/Reans | 6dfce046b01099284a8c945a04600ed83e5099a4 | [
"Apache-2.0"
] | null | null | null | from django.db import models
# Create your models here.
# import Customer Models
from customer.models import CustomerProfile
class OTP(models.Model):
"""OTP
mobile and email otp authentication module
"""
otp = models.PositiveIntegerField()
is_verified = models.BooleanField(default=False)
au... | 31.568182 | 78 | 0.562275 |
79585b22be64eb9cc61e1e079cbc653221cdc844 | 7,344 | py | Python | tests/test_create_glb.py | IBM/cis-integration | fbf1f5c2df57b846499856ca927d2de15b4b375c | [
"Apache-2.0"
] | 4 | 2021-08-04T16:58:18.000Z | 2022-02-16T03:28:46.000Z | tests/test_create_glb.py | IBM/cis-integration | fbf1f5c2df57b846499856ca927d2de15b4b375c | [
"Apache-2.0"
] | 16 | 2021-07-13T13:50:31.000Z | 2021-08-13T15:31:32.000Z | tests/test_create_glb.py | IBM/cis-integration | fbf1f5c2df57b846499856ca927d2de15b4b375c | [
"Apache-2.0"
] | null | null | null | from _pytest.monkeypatch import resolve
import pytest
import os
from dotenv import load_dotenv
from pathlib import Path
from requests.models import Response
from src.ce.create_glb import GLB
from ibm_cloud_sdk_core.detailed_response import DetailedResponse
from ibm_cloud_networking_services import GlobalLoadBalancerPoo... | 40.131148 | 189 | 0.706836 |
79585b421ee1d5d3bfa07877e33bec8f3b26aed9 | 19 | py | Python | grappelli/__init__.py | sistemasbuho/django-grappelli | 1ccd6a2b1fe0dc92034005533f02052ceb270a2d | [
"BSD-3-Clause"
] | 1 | 2017-10-24T03:26:48.000Z | 2017-10-24T03:26:48.000Z | grappelli/__init__.py | sistemasbuho/django-grappelli | 1ccd6a2b1fe0dc92034005533f02052ceb270a2d | [
"BSD-3-Clause"
] | 1 | 2018-12-23T01:42:55.000Z | 2018-12-23T11:09:52.000Z | grappelli/__init__.py | sistemasbuho/django-grappelli | 1ccd6a2b1fe0dc92034005533f02052ceb270a2d | [
"BSD-3-Clause"
] | 1 | 2018-12-11T22:44:44.000Z | 2018-12-11T22:44:44.000Z | VERSION = '2.10.1'
| 9.5 | 18 | 0.578947 |
79585bade038761c22b1329362aa1e10466fdc94 | 34,221 | py | Python | logscraper/tests/test_logsender.py | openstack/ci-log-processing | 1990b7c08f337035ce1136a4e091050bd7bd37ea | [
"Apache-2.0"
] | null | null | null | logscraper/tests/test_logsender.py | openstack/ci-log-processing | 1990b7c08f337035ce1136a4e091050bd7bd37ea | [
"Apache-2.0"
] | null | null | null | logscraper/tests/test_logsender.py | openstack/ci-log-processing | 1990b7c08f337035ce1136a4e091050bd7bd37ea | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (C) 2022 Red Hat
#
# 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... | 42.616438 | 79 | 0.602028 |
79585c01bda232f81e868ce0914f10776f98b381 | 1,397 | py | Python | setup.py | EFS-OpenSource/calibration-framework | 7b306e4bbe6361d411b209759b7ba3d016bd0d17 | [
"Apache-2.0"
] | 2 | 2021-09-01T13:21:22.000Z | 2022-03-23T07:13:12.000Z | setup.py | EFS-OpenSource/calibration-framework | 7b306e4bbe6361d411b209759b7ba3d016bd0d17 | [
"Apache-2.0"
] | null | null | null | setup.py | EFS-OpenSource/calibration-framework | 7b306e4bbe6361d411b209759b7ba3d016bd0d17 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019-2021 Ruhr West University of Applied Sciences, Bottrop, Germany
# AND Elektronische Fahrwerksysteme GmbH, Gaimersheim Germany
#
# This Source Code Form is subject to the terms of the Apache License 2.0
# If a copy of the APL2 was not distributed with this
# file, You can obtain one at https://www.a... | 43.65625 | 203 | 0.697208 |
79585d2b07f316e82ca019ead48f6bbd5d6a34bc | 68,901 | py | Python | nova/virt/ironic/driver.py | andymcc/nova | f77f6d33f6b10ec6ce7bc2aa8aa99366e682059e | [
"Apache-2.0"
] | null | null | null | nova/virt/ironic/driver.py | andymcc/nova | f77f6d33f6b10ec6ce7bc2aa8aa99366e682059e | [
"Apache-2.0"
] | null | null | null | nova/virt/ironic/driver.py | andymcc/nova | f77f6d33f6b10ec6ce7bc2aa8aa99366e682059e | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Red Hat, Inc.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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://ww... | 44.054348 | 96 | 0.59616 |
79585d52e8413293c5cb00325344e420b534f4ee | 2,287 | py | Python | clicktocall/app.py | Here4Reentry/baltimore-ringdown | e4f18cfa457dadad4089a2f4dc10d00b54ce580f | [
"MIT"
] | null | null | null | clicktocall/app.py | Here4Reentry/baltimore-ringdown | e4f18cfa457dadad4089a2f4dc10d00b54ce580f | [
"MIT"
] | null | null | null | clicktocall/app.py | Here4Reentry/baltimore-ringdown | e4f18cfa457dadad4089a2f4dc10d00b54ce580f | [
"MIT"
] | null | null | null | from flask import Flask
from flask import jsonify
from flask import render_template
from flask import request
from flask import url_for
from twilio import twiml
from twilio.rest import TwilioRestClient
# Declare and configure application
app = Flask(__name__, static_url_path='/static')
app.config.from_pyfile('local_s... | 32.671429 | 130 | 0.629209 |
79585d6326e9646ea43472ed0e111023799aa21f | 1,401 | py | Python | tasks/attestation.py | faasm/experiment-sgx | e5633b7314676606df7f5e1f5244532eb2173c72 | [
"Apache-2.0"
] | null | null | null | tasks/attestation.py | faasm/experiment-sgx | e5633b7314676606df7f5e1f5244532eb2173c72 | [
"Apache-2.0"
] | 7 | 2021-09-24T08:45:51.000Z | 2022-03-10T07:51:18.000Z | tasks/attestation.py | faasm/experiment-sgx | e5633b7314676606df7f5e1f5244532eb2173c72 | [
"Apache-2.0"
] | 1 | 2021-09-29T05:30:01.000Z | 2021-09-29T05:30:01.000Z | from invoke import task
from subprocess import run
from tasks.util.env import (
AZURE_ATTESTATION_PROVIDER_NAME,
AZURE_RESOURCE_GROUP,
AZURE_SGX_LOCATION,
)
def run_az_cmd(cmd):
_cmd = "az {}".format(cmd)
print(_cmd)
run(_cmd, shell=True, check=True)
@task
def set_up(ctx):
"""
Set up... | 20.304348 | 75 | 0.640971 |
79585e019d0028e3854779db1311f3e80898c69e | 11,416 | py | Python | varnish/test_varnish.py | skwp/integrations-core | dc4d1bdb369916a574cc8aa43603ae23eecb8de1 | [
"BSD-3-Clause"
] | 1 | 2021-06-17T20:22:35.000Z | 2021-06-17T20:22:35.000Z | varnish/test_varnish.py | skwp/integrations-core | dc4d1bdb369916a574cc8aa43603ae23eecb8de1 | [
"BSD-3-Clause"
] | null | null | null | varnish/test_varnish.py | skwp/integrations-core | dc4d1bdb369916a574cc8aa43603ae23eecb8de1 | [
"BSD-3-Clause"
] | 1 | 2019-10-25T18:59:54.000Z | 2019-10-25T18:59:54.000Z | # stdlib
import os
import re
import subprocess
import mock
from distutils.version import LooseVersion # pylint: disable=E0611,E0401
# 3p
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
# project
from tests.checks.common import AgentCheckTest, Fixtures
# This is a small extract of metrics ... | 46.595918 | 112 | 0.670725 |
79585ec67849a88e85c198280a94b42449d532e5 | 3,101 | py | Python | applications/classification/predict_multiclass_svm.py | ShankarNara/shogun | 8ab196de16b8d8917e5c84770924c8d0f5a3d17c | [
"BSD-3-Clause"
] | 2,753 | 2015-01-02T11:34:13.000Z | 2022-03-25T07:04:27.000Z | applications/classification/predict_multiclass_svm.py | ShankarNara/shogun | 8ab196de16b8d8917e5c84770924c8d0f5a3d17c | [
"BSD-3-Clause"
] | 2,404 | 2015-01-02T19:31:41.000Z | 2022-03-09T10:58:22.000Z | applications/classification/predict_multiclass_svm.py | ShankarNara/shogun | 8ab196de16b8d8917e5c84770924c8d0f5a3d17c | [
"BSD-3-Clause"
] | 1,156 | 2015-01-03T01:57:21.000Z | 2022-03-26T01:06:28.000Z | #!/usr/bin/env python
# Copyright (c) The Shogun Machine Learning Toolbox
# Written (w) 2014 Daniel Pyrathon
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source... | 40.802632 | 82 | 0.767494 |
795860b3d353cf25604abb28fb8f186854acde73 | 5,530 | py | Python | tests/providers/google/cloud/sensors/test_pubsub.py | elgalu/apache-airflow | f74da5025d9f635bc49e631883fc1537cd16b620 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 7 | 2018-11-19T12:05:13.000Z | 2020-01-17T08:30:38.000Z | tests/providers/google/cloud/sensors/test_pubsub.py | elgalu/apache-airflow | f74da5025d9f635bc49e631883fc1537cd16b620 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/providers/google/cloud/sensors/test_pubsub.py | elgalu/apache-airflow | f74da5025d9f635bc49e631883fc1537cd16b620 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 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... | 35 | 108 | 0.670524 |
79586125eaf4f4c389d5ba8ab9c6c610fdf08e88 | 1,620 | py | Python | chainer0/datasets/_mnist_helper.py | koki0702/chainer0 | 02a2a63fb1dc68d9f4bdc7b84c3fca66e4ba5df1 | [
"MIT"
] | null | null | null | chainer0/datasets/_mnist_helper.py | koki0702/chainer0 | 02a2a63fb1dc68d9f4bdc7b84c3fca66e4ba5df1 | [
"MIT"
] | null | null | null | chainer0/datasets/_mnist_helper.py | koki0702/chainer0 | 02a2a63fb1dc68d9f4bdc7b84c3fca66e4ba5df1 | [
"MIT"
] | null | null | null | import gzip
import struct
import numpy
import six
from chainer0.datasets import download
from chainer0.datasets import tuple_dataset
def make_npz(path, urls):
x_url, y_url = urls
x_path = download.cached_download(x_url)
y_path = download.cached_download(y_url)
with gzip.open(x_path, 'rb') as fx... | 29.454545 | 76 | 0.578395 |
795861342af4fdd8e2baf13e844d445c311e361f | 1,831 | py | Python | p3orm/utils.py | rafalstapinski/porm | 5dfd797d846b156dbadec769c68f8295bd5ba8de | [
"MIT"
] | 4 | 2022-02-21T05:28:41.000Z | 2022-02-23T01:02:48.000Z | p3orm/utils.py | rafalstapinski/p3orm | 5dfd797d846b156dbadec769c68f8295bd5ba8de | [
"MIT"
] | null | null | null | p3orm/utils.py | rafalstapinski/p3orm | 5dfd797d846b156dbadec769c68f8295bd5ba8de | [
"MIT"
] | null | null | null | from typing import Any, Dict, List, Optional, Tuple, Type, Union, get_args, get_origin
import asyncpg
from pypika.queries import QueryBuilder
from pypika.terms import BasicCriterion, ContainsCriterion, Criterion, Equality, NullValue, Parameter, RangeCriterion
def record_to_kwargs(record: asyncpg.Record) -> Dict[str,... | 39.804348 | 117 | 0.725287 |
795861959f3def76331479c7021bd3052d77cacb | 8,123 | py | Python | keylime/ca_impl_cfssl.py | mrcdb/keylime | b7c944584ae69e32f440bac376dffe0a0a335858 | [
"BSD-2-Clause"
] | null | null | null | keylime/ca_impl_cfssl.py | mrcdb/keylime | b7c944584ae69e32f440bac376dffe0a0a335858 | [
"BSD-2-Clause"
] | null | null | null | keylime/ca_impl_cfssl.py | mrcdb/keylime | b7c944584ae69e32f440bac376dffe0a0a335858 | [
"BSD-2-Clause"
] | null | null | null | '''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclusions or recommendation... | 34.862661 | 141 | 0.586483 |
795861f9149e7a17e6f3b9fe31d0bfdde0e5566f | 4,131 | py | Python | openGaussBase/testcase/CONNECTORS/PYTHON/PYOG/Opengauss_Function_Connect_Python_Case0017.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/CONNECTORS/PYTHON/PYOG/Opengauss_Function_Connect_Python_Case0017.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/CONNECTORS/PYTHON/PYOG/Opengauss_Function_Connect_Python_Case0017.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 34.140496 | 84 | 0.593561 |
795862a173b6d3e10e597b2b8d0d40c6a370b915 | 7,143 | py | Python | ic_shop/api/v1/urls.py | hellohufan/beautyServer | 8a5109881b7065fd742f0a330b142248a7cdcef6 | [
"BSD-2-Clause"
] | null | null | null | ic_shop/api/v1/urls.py | hellohufan/beautyServer | 8a5109881b7065fd742f0a330b142248a7cdcef6 | [
"BSD-2-Clause"
] | 5 | 2020-06-06T01:11:25.000Z | 2021-09-08T02:02:34.000Z | ic_shop/api/v1/urls.py | hellohufan/beautyServer | 8a5109881b7065fd742f0a330b142248a7cdcef6 | [
"BSD-2-Clause"
] | null | null | null | from django.conf.urls import url, include
from rest_framework.documentation import include_docs_urls
from ic_shop.api.v1 import apiViews
from ic_shop.api.v1 import authentication as jwt_auth
from rest_framework_nested import routers
router = routers.DefaultRouter()
from django.conf.urls import url, include
# from re... | 31.606195 | 125 | 0.754865 |
795862fdef3d8b70c30af0da6f626d2054393c3b | 2,199 | py | Python | gnosis/xml/pickle/test/test_rawp_mx.py | LehmRob/od-conv | 1ffed758f27e906a1e36f5d137180a1808a82c0a | [
"MIT"
] | 3 | 2018-09-29T14:14:28.000Z | 2022-01-05T03:45:50.000Z | library/CanFestival/objdictgen/gnosis/xml/pickle/test/test_rawp_mx.py | Lembed/STM32duino-gcc-Projects | 67829e9cd1388601daf9815b0561da557e0b9f82 | [
"MIT"
] | 1 | 2017-06-17T08:15:28.000Z | 2017-06-17T08:15:28.000Z | library/CanFestival/objdictgen/gnosis/xml/pickle/test/test_rawp_mx.py | Lembed/STM32duino-gcc-Projects | 67829e9cd1388601daf9815b0561da557e0b9f82 | [
"MIT"
] | 1 | 2019-12-08T15:11:55.000Z | 2019-12-08T15:11:55.000Z | "Test rawpickles by turning off mxDateTime extension --fpm"
import mx.DateTime as date
import UserList, UserDict
from types import *
import gnosis.xml.pickle as xml_pickle
import gnosis.xml.pickle.ext as xml_pickle_ext
from gnosis.xml.pickle.util import setParanoia
from gnosis.xml.pickle.ext._mutate import __disable_... | 23.147368 | 62 | 0.654843 |
7958640595c1e26be4f639631f379b02aa372079 | 16,103 | py | Python | tests/test_ciftify_clean_image.py | helloTC/ciftify | ca6b83c8d40cd384de54269d7c62281552b91e21 | [
"MIT"
] | 84 | 2016-09-19T16:34:37.000Z | 2022-03-31T05:47:05.000Z | tests/test_ciftify_clean_image.py | helloTC/ciftify | ca6b83c8d40cd384de54269d7c62281552b91e21 | [
"MIT"
] | 108 | 2016-09-11T15:18:31.000Z | 2022-03-06T07:03:12.000Z | tests/test_ciftify_clean_image.py | helloTC/ciftify | ca6b83c8d40cd384de54269d7c62281552b91e21 | [
"MIT"
] | 296 | 2016-09-15T17:18:26.000Z | 2022-01-17T18:16:11.000Z | #!/usr/bin/env python3
import os
import unittest
import copy
import logging
import shutil
import random
import importlib
import pandas as pd
import json
import pytest
from unittest.mock import patch
from nibabel import Nifti1Image
import numpy as np
import nilearn.image
import ciftify.bin.ciftify_clean_img as ciftif... | 41.825974 | 97 | 0.643048 |
795864a2e7b5e845dd42716f60ed9e83e5706ef0 | 1,722 | py | Python | 18-placeBlockFromArgs.py | hashbangstudio/Python-Minecraft-Examples | 5e4632022a99a7ccc130972d4e8da9d09572492d | [
"BSD-3-Clause"
] | 4 | 2016-06-07T15:30:52.000Z | 2020-04-13T15:16:28.000Z | 18-placeBlockFromArgs.py | hashbangstudio/Python-Minecraft-Examples | 5e4632022a99a7ccc130972d4e8da9d09572492d | [
"BSD-3-Clause"
] | null | null | null | 18-placeBlockFromArgs.py | hashbangstudio/Python-Minecraft-Examples | 5e4632022a99a7ccc130972d4e8da9d09572492d | [
"BSD-3-Clause"
] | 3 | 2016-11-27T22:27:16.000Z | 2021-12-12T14:53:11.000Z | #!/usr/bin/env python
#import the needed modules
from mcpi.minecraft import *
from mcpi.block import *
import sys
if __name__ == "__main__":
# Create a connection to the Minecraft game
mc = Minecraft.create()
# Get the player position
playerPosition = mc.player.getTilePos()
# Set coordinates (p... | 35.142857 | 94 | 0.639373 |
7958655bc653551045f19c8d435d785d50ec5f58 | 2,127 | py | Python | test_frame/test_delay_task/test_delay_push.py | DJMIN/funboost | 7570ca2909bb0b44a1080f5f98aa96c86d3da9d4 | [
"Apache-2.0"
] | 120 | 2021-12-26T03:27:12.000Z | 2022-03-31T16:20:44.000Z | test_frame/test_delay_task/test_delay_push.py | mooti-barry/funboost | 2cd9530e2c4e5a52fc921070d243d402adbc3a0e | [
"Apache-2.0"
] | 18 | 2021-12-31T06:26:37.000Z | 2022-03-31T16:16:33.000Z | test_frame/test_delay_task/test_delay_push.py | mooti-barry/funboost | 2cd9530e2c4e5a52fc921070d243d402adbc3a0e | [
"Apache-2.0"
] | 27 | 2021-12-26T16:12:31.000Z | 2022-03-26T17:43:08.000Z | # 需要用publish,而不是push,这个前面已经说明了,如果要传函数入参本身以外的参数到中间件,需要用publish。
# 不然框架分不清哪些是函数入参,哪些是控制参数。如果无法理解就,就好好想想琢磨下celery的 apply_async 和 delay的关系。
from test_frame.test_delay_task.test_delay_consume import f
import datetime
import time
from funboost import PriorityConsumingControlConfig
"""
测试发布延时任务,不是发布后马上就执行函数。
countdown 和 eta... | 44.3125 | 93 | 0.788905 |
79586582cf1f25e4b7ca098699616f2214c037e6 | 2,713 | py | Python | src/models/imageModel.py | RecicladoraSanMiguel/recsm_odoo_image_manager | 1a4459377c3c274353cb6b5dd18f8bff11542e71 | [
"MIT"
] | null | null | null | src/models/imageModel.py | RecicladoraSanMiguel/recsm_odoo_image_manager | 1a4459377c3c274353cb6b5dd18f8bff11542e71 | [
"MIT"
] | 2 | 2022-01-13T01:45:44.000Z | 2022-03-12T00:03:11.000Z | src/models/imageModel.py | RecicladoraSanMiguel/recsm-python-NetIMmanager | 1a4459377c3c274353cb6b5dd18f8bff11542e71 | [
"MIT"
] | null | null | null | from PIL import Image, ImageDraw, ImageFont
from io import BytesIO
from datetime import datetime
from pytz import timezone
from ..config import constants
import base64
import os
class ImageModel:
def __init__(self):
self._font = font = ImageFont.truetype(os.path.join(os.path.dirname(__file__), '../asse... | 30.144444 | 126 | 0.626613 |
795865d303ce71a95975b7962a3fd957ad5b984c | 2,699 | py | Python | gambolputty/modifier/Permutate.py | lukebeer/GambolPutty | d642433bb2a6a54be6b4cfaa12a507994af8445a | [
"Apache-2.0"
] | null | null | null | gambolputty/modifier/Permutate.py | lukebeer/GambolPutty | d642433bb2a6a54be6b4cfaa12a507994af8445a | [
"Apache-2.0"
] | null | null | null | gambolputty/modifier/Permutate.py | lukebeer/GambolPutty | d642433bb2a6a54be6b4cfaa12a507994af8445a | [
"Apache-2.0"
] | 1 | 2019-12-03T11:36:32.000Z | 2019-12-03T11:36:32.000Z | # -*- coding: utf-8 -*-
import Utils
import itertools
import BaseThreadedModule
import Decorators
import Utils
import sys
@Decorators.ModuleDocstringParser
class Permutate(BaseThreadedModule.BaseThreadedModule):
"""
Creates successive len('target_fields') length permutations of elements in 'source_field'.
... | 38.557143 | 123 | 0.602816 |
7958661434bca383fa6db1b9a561b74ab0600ee2 | 4,344 | py | Python | symbols.py | beefoo/alt-mta | 7301ee479f5a118be36ff081329b743ee6c7fa47 | [
"MIT"
] | null | null | null | symbols.py | beefoo/alt-mta | 7301ee479f5a118be36ff081329b743ee6c7fa47 | [
"MIT"
] | null | null | null | symbols.py | beefoo/alt-mta | 7301ee479f5a118be36ff081329b743ee6c7fa47 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# python symbols.py -symbol data/symbol_dot_express.png
# Image source: http://web.mta.info/maps/images/subway_map_Jul18_2700x3314.jpg
# Template matching: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_template_matching/py_template_matching.html
import argparse
import cv2
im... | 41.371429 | 128 | 0.646179 |
7958671f5704866f591222b110be5ec60282ee7e | 8,602 | py | Python | venv/lib/python3.8/site-packages/mpl_toolkits/axes_grid1/axes_size.py | willBear/willBear-Fundamental_Analysis | bc67eb1e69dcf6765c0b77314d37f7f165a7318f | [
"MIT"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | venv/lib/python3.8/site-packages/mpl_toolkits/axes_grid1/axes_size.py | willBear/willBear-Fundamental_Analysis | bc67eb1e69dcf6765c0b77314d37f7f165a7318f | [
"MIT"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | venv/lib/python3.8/site-packages/mpl_toolkits/axes_grid1/axes_size.py | willBear/willBear-Fundamental_Analysis | bc67eb1e69dcf6765c0b77314d37f7f165a7318f | [
"MIT"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | """
Provides classes of simple units that will be used with AxesDivider
class (or others) to determine the size of each axes. The unit
classes define `get_size` method that returns a tuple of two floats,
meaning relative and absolute sizes, respectively.
Note that this class is nothing more than a simple tuple of two
... | 27.394904 | 78 | 0.612532 |
7958675e6794dab5ef9addf67dd6e9c684f263dc | 922 | py | Python | SoftLayer/CLI/sshkey/list.py | ko101/softlayer-python | f4cc9fa2eb01d97c0e890907ef6735390f1a5b10 | [
"MIT"
] | null | null | null | SoftLayer/CLI/sshkey/list.py | ko101/softlayer-python | f4cc9fa2eb01d97c0e890907ef6735390f1a5b10 | [
"MIT"
] | null | null | null | SoftLayer/CLI/sshkey/list.py | ko101/softlayer-python | f4cc9fa2eb01d97c0e890907ef6735390f1a5b10 | [
"MIT"
] | null | null | null | """List SSH keys."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
@click.option('--sortby',
help='Column to sort by',
type=clic... | 26.342857 | 69 | 0.5282 |
79586820519d43d9d1ea9a482be2bcfb51559331 | 2,118 | py | Python | tests/test_diffeq/test_perturbed/test_step/test_perturbedstepsolution.py | treid5/probnum | fabb51243d0952fbd35e542aeb5c2dc9a449ec81 | [
"MIT"
] | 1 | 2021-04-16T14:45:26.000Z | 2021-04-16T14:45:26.000Z | tests/test_diffeq/test_perturbed/test_step/test_perturbedstepsolution.py | pitmonticone/probnum | 1fed705b2443a14d08419e16f98f6ef815ae9ffa | [
"MIT"
] | 42 | 2021-03-08T07:20:40.000Z | 2022-03-28T05:04:48.000Z | tests/test_diffeq/test_perturbed/test_step/test_perturbedstepsolution.py | pitmonticone/probnum | 1fed705b2443a14d08419e16f98f6ef815ae9ffa | [
"MIT"
] | null | null | null | import numpy as np
import pytest
from scipy.integrate._ivp import rk
import probnum.problems.zoo.diffeq as diffeq_zoo
from probnum import diffeq, randvars
@pytest.fixture
def steprule():
return diffeq.stepsize.AdaptiveSteps(0.1, atol=1e-4, rtol=1e-4)
@pytest.fixture
def perturbed_solution(steprule):
y0 = n... | 27.868421 | 80 | 0.688857 |
795868e2eef7e91ca094f39631a2a8ec1f6d28ee | 3,623 | py | Python | stac_fastapi/sqlalchemy/tests/conftest.py | AsgerPetersen/stac-fastapi | 27e134589107654920c2f1dba54773c8c85d4e1a | [
"MIT"
] | 1 | 2021-07-08T23:20:42.000Z | 2021-07-08T23:20:42.000Z | stac_fastapi/sqlalchemy/tests/conftest.py | nmandery/stac-fastapi | 8cce4fb449d6bdb36a788e959bce6012cd6f83e6 | [
"MIT"
] | null | null | null | stac_fastapi/sqlalchemy/tests/conftest.py | nmandery/stac-fastapi | 8cce4fb449d6bdb36a788e959bce6012cd6f83e6 | [
"MIT"
] | null | null | null | import json
import os
from typing import Callable, Dict
import pytest
from starlette.testclient import TestClient
from stac_fastapi.api.app import StacApi
from stac_fastapi.extensions.core import (
ContextExtension,
FieldsExtension,
QueryExtension,
SortExtension,
TransactionExtension,
)
from stac_... | 27.656489 | 86 | 0.706321 |
79586c3621875081cf9785fd15d9a320f78287a6 | 580 | py | Python | File-Segregator.py | sandeep3119/pythonEveryday | 7014bce290d079cc2f300ee6114fe9e84c294f94 | [
"MIT"
] | 1 | 2021-09-20T14:57:43.000Z | 2021-09-20T14:57:43.000Z | File-Segregator.py | sandeep3119/pythonEveryday | 7014bce290d079cc2f300ee6114fe9e84c294f94 | [
"MIT"
] | null | null | null | File-Segregator.py | sandeep3119/pythonEveryday | 7014bce290d079cc2f300ee6114fe9e84c294f94 | [
"MIT"
] | null | null | null | import os
import shutil
import argparse
def main(TARGET_DIR):
os.chdir(TARGET_DIR)
data = os.listdir(".")
for file_ in data:
dir_name=file_.split(".")[-1]
os.makedirs(dir_name,exist_ok=True)
if (os.path.isfile(file_) and file_!='script.py') :
src_file_path=file_
... | 26.363636 | 63 | 0.658621 |
79586ca424243daed1f3af46e426e62988f83102 | 925 | py | Python | benchmarks/Evolution/both/evo_tests/test_cases/test_processing.py | nuprl/retic_performance | 621211c2f40251ce5364c33e72e4067e34a32013 | [
"MIT"
] | 3 | 2018-08-03T02:41:29.000Z | 2021-03-19T03:18:47.000Z | benchmarks/Evolution/both/evo_tests/test_cases/test_processing.py | nuprl/retic_performance | 621211c2f40251ce5364c33e72e4067e34a32013 | [
"MIT"
] | 3 | 2018-02-04T17:53:56.000Z | 2018-11-10T17:06:57.000Z | benchmarks/Evolution/both/evo_tests/test_cases/test_processing.py | nuprl/retic_performance | 621211c2f40251ce5364c33e72e4067e34a32013 | [
"MIT"
] | 1 | 2018-08-04T00:14:12.000Z | 2018-08-04T00:14:12.000Z | import unittest
from evo_tests.examples import ExampleLOC, ExampleLOTC, ExampleConfigurations, ExampleDealers
from evo_json.convert_py_json.convert_trait import convert_from_pj_loc
from evo_json.process_json.process_configuration import convert_config_to_dealer, convert_dealer_to_config
class TestConvert(unittest.Test... | 33.035714 | 106 | 0.783784 |
79586ddf1e6230334836d814ac7e9e14f7b89540 | 1,911 | py | Python | project/01__get_TraderJoe_data.py | bsegot/housing-search-Chicago | d1a3029a4351d0db45c7f73f432d89ccdb469269 | [
"MIT"
] | 1 | 2021-12-29T17:43:34.000Z | 2021-12-29T17:43:34.000Z | project/01__get_TraderJoe_data.py | bsegot/housing-search-Chicago | d1a3029a4351d0db45c7f73f432d89ccdb469269 | [
"MIT"
] | 2 | 2020-01-26T16:02:33.000Z | 2020-02-08T22:06:09.000Z | project/01__get_TraderJoe_data.py | bsegot/housing-search-Chicago | d1a3029a4351d0db45c7f73f432d89ccdb469269 | [
"MIT"
] | 1 | 2020-02-08T16:24:24.000Z | 2020-02-08T16:24:24.000Z | import pandas as pd
from arcgis.gis import GIS
from arcgis.geocoding import geocode
# Read data from CSV files
csv1_path = "data_sets/illinois_ZIP.csv"
# Read in zipCode data
prop_df = pd.read_csv(csv1_path)
prop_df = pd.DataFrame(prop_df)
# Only view zip codes in Cook County
prop_df = prop_df[prop_df['County'] == "... | 30.822581 | 85 | 0.675563 |
79586eb5a1ab6a73e30b7c7537a5ae8b1602c944 | 5,516 | py | Python | src/azure-cli/azure/cli/command_modules/acr/run.py | shinilm/azure-cli | 7c5f44151010b4b64d822f8cbe3e725f3525a448 | [
"MIT"
] | 1 | 2019-06-21T05:07:38.000Z | 2019-06-21T05:07:38.000Z | src/azure-cli/azure/cli/command_modules/acr/run.py | shinilm/azure-cli | 7c5f44151010b4b64d822f8cbe3e725f3525a448 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/acr/run.py | shinilm/azure-cli | 7c5f44151010b4b64d822f8cbe3e725f3525a448 | [
"MIT"
] | 1 | 2019-06-21T05:08:09.000Z | 2019-06-21T05:08:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 36.529801 | 100 | 0.6376 |
79586ee103a7f951122d0c5b505b6c89a464c45e | 1,162 | py | Python | orbit_transfer/configs/model/classification.py | sinzlab/orbit_transfer | 812d89af5c7ab26d9ea26766a4250ae023bb20b8 | [
"MIT"
] | null | null | null | orbit_transfer/configs/model/classification.py | sinzlab/orbit_transfer | 812d89af5c7ab26d9ea26766a4250ae023bb20b8 | [
"MIT"
] | null | null | null | orbit_transfer/configs/model/classification.py | sinzlab/orbit_transfer | 812d89af5c7ab26d9ea26766a4250ae023bb20b8 | [
"MIT"
] | null | null | null | from typing import Dict, Tuple
from nntransfer.configs.model.base import ModelConfig
class ClassificationModel(ModelConfig):
fn = "orbit_transfer.models.classification_model_builder"
def __init__(self, **kwargs):
self.load_kwargs(**kwargs)
self.type: str = "resnet50"
self.core_type: ... | 34.176471 | 71 | 0.657487 |
79586ef1b4c1fb6a5f5cc2f23bbf0e40a62d1f71 | 2,211 | py | Python | mailchimp3/entities/reportgoogleanalytics.py | nizamarusada/python-mailchimp | e67ba19848d1975d2b142fab960633fc3df8dff4 | [
"MIT"
] | 311 | 2015-11-27T07:15:42.000Z | 2019-03-06T15:55:40.000Z | mailchimp3/entities/reportgoogleanalytics.py | nizamarusada/python-mailchimp | e67ba19848d1975d2b142fab960633fc3df8dff4 | [
"MIT"
] | 144 | 2016-01-25T21:29:33.000Z | 2019-02-24T13:36:16.000Z | mailchimp3/entities/reportgoogleanalytics.py | nizamarusada/python-mailchimp | e67ba19848d1975d2b142fab960633fc3df8dff4 | [
"MIT"
] | 105 | 2015-10-21T14:34:38.000Z | 2019-03-01T21:34:44.000Z | # coding=utf-8
"""
The Google Analytics API endpoint
Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/reports/google-analytics/
Schema: https://api.mailchimp.com/schema/3.0/Reports/GoogleAnalytics/Collection.json
"""
from __future__ import unicode_literals
from mailchimp3.baseapi import... | 35.095238 | 117 | 0.660787 |
79586fca6eed3fae558450921ec9b87a4a442562 | 6,193 | py | Python | src/sphinx_inline_tabs/_impl.py | christopherpickering/sphinx-inline-tabs | 8a36b887dfc4a14d781ab7acf50cb5e4cb737353 | [
"MIT"
] | 39 | 2020-10-14T13:55:49.000Z | 2022-01-30T10:28:33.000Z | src/sphinx_inline_tabs/_impl.py | christopherpickering/sphinx-inline-tabs | 8a36b887dfc4a14d781ab7acf50cb5e4cb737353 | [
"MIT"
] | 27 | 2020-10-14T21:41:31.000Z | 2022-03-12T22:12:47.000Z | src/sphinx_inline_tabs/_impl.py | christopherpickering/sphinx-inline-tabs | 8a36b887dfc4a14d781ab7acf50cb5e4cb737353 | [
"MIT"
] | 9 | 2020-11-15T01:17:53.000Z | 2021-12-16T14:34:13.000Z | """The actual implementation."""
import itertools
from typing import List, Literal
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.transforms.post_transforms import SphinxPostTransform
from sphinx.util.docutils import SphinxDirective
from sphinx.util.nodes import NodeMatcher
class... | 31.92268 | 84 | 0.600678 |
79586ff0799dc07d4160257366b5adfdde156420 | 3,526 | py | Python | pettingzoo/utils/wrappers/base.py | cclauss/PettingZoo | 4051996567fdec24f63203dc4445cc79405c01db | [
"Apache-2.0"
] | 1 | 2021-09-26T06:44:53.000Z | 2021-09-26T06:44:53.000Z | pettingzoo/utils/wrappers/base.py | cclauss/PettingZoo | 4051996567fdec24f63203dc4445cc79405c01db | [
"Apache-2.0"
] | null | null | null | pettingzoo/utils/wrappers/base.py | cclauss/PettingZoo | 4051996567fdec24f63203dc4445cc79405c01db | [
"Apache-2.0"
] | null | null | null | import warnings
from pettingzoo.utils.env import AECEnv
class BaseWrapper(AECEnv):
'''
Creates a wrapper around `env` parameter. Extend this class
to create a useful wrapper.
'''
def __init__(self, env):
super().__init__()
self.env = env
# try to access these parameters ... | 30.66087 | 166 | 0.646058 |
7958720c45b2c8a25190168e4117d39d898152ab | 3,499 | py | Python | WEEKS/CD_Sata-Structures/_MISC/misc-examples/island_count.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/island_count.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/island_count.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | """
Remember these steps to solve almost any graphs problem:
- Translate the problem into terminology you've learned this week
- Build your graph
- Traverse your graph
ISLANDS MATRIX CHALLENGE!
--------------------------
Write a function that takes a 2D binary array and returns the number of 1 islands.
An island con... | 27.124031 | 136 | 0.50986 |
795872d7ca9f70d6364d5f1c090c85806dd950fc | 884 | py | Python | app.py | evanscottgray/cst_server | cdbc6d2358a41071b173f501ee7991763218e2aa | [
"MIT"
] | null | null | null | app.py | evanscottgray/cst_server | cdbc6d2358a41071b173f501ee7991763218e2aa | [
"MIT"
] | null | null | null | app.py | evanscottgray/cst_server | cdbc6d2358a41071b173f501ee7991763218e2aa | [
"MIT"
] | null | null | null | from flask import Flask
from flask import abort, request, jsonify
from flask.ext.cors import CORS
import subprocess
import utils
import os.path
app = Flask(__name__)
cors = CORS(app)
def get_token():
cmd = app.config.get('token_command')
p = subprocess.Popen([cmd], stdout=subprocess.PIPE)
s = p.communica... | 23.891892 | 67 | 0.658371 |
7958755627afc3e2b9162042e3ac700fff2f23bd | 2,637 | py | Python | tests/basics/ListContractions.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | null | null | null | tests/basics/ListContractions.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | 1 | 2019-03-01T11:33:40.000Z | 2019-03-01T11:33:40.000Z | tests/basics/ListContractions.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | 1 | 2019-03-26T16:56:21.000Z | 2019-03-26T16:56:21.000Z | # Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 28.053191 | 84 | 0.648085 |
795876ccfa5729c343d421be5d4c81a76e685f24 | 518 | py | Python | utils.py | maxcrous/magnify_motion | 70a3a61f67beacf249ba7023a4760c056be6c54a | [
"MIT"
] | 3 | 2021-12-01T13:55:14.000Z | 2022-01-19T14:37:40.000Z | utils.py | maxcrous/magnify_motion | 70a3a61f67beacf249ba7023a4760c056be6c54a | [
"MIT"
] | null | null | null | utils.py | maxcrous/magnify_motion | 70a3a61f67beacf249ba7023a4760c056be6c54a | [
"MIT"
] | 3 | 2021-01-05T03:07:10.000Z | 2021-12-01T13:10:40.000Z | import matplotlib.pyplot as plt
import skvideo.io
def plot_slice(vid, output_path):
""" Save a spatiotemporal slice of a video to disk. """
frames, height, width, channels = vid.shape
patch_seq = vid[:, :, width//2, :]
plt.imshow(patch_seq.swapaxes(0, 1))
plt.savefig(output_path)
def get_fps(vid... | 25.9 | 59 | 0.656371 |
795876defcb9d6d4e3156e6e80c5a60e53503bf4 | 31,943 | py | Python | tests/wallet/rpc/test_wallet_rpc.py | Hydrangea-Network/hydrangea-blockchain | d15662329958dbdaa9cbd99733ba729f0e74ce54 | [
"Apache-2.0"
] | 1 | 2022-03-15T06:41:49.000Z | 2022-03-15T06:41:49.000Z | tests/wallet/rpc/test_wallet_rpc.py | Hydrangea-Network/hydrangea-blockchain | d15662329958dbdaa9cbd99733ba729f0e74ce54 | [
"Apache-2.0"
] | null | null | null | tests/wallet/rpc/test_wallet_rpc.py | Hydrangea-Network/hydrangea-blockchain | d15662329958dbdaa9cbd99733ba729f0e74ce54 | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
from operator import attrgetter
from typing import Dict, Optional
import pytest
from blspy import G2Element
from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from chia.consensus.coinbase import create_puzzlehash_for_pk
from chia.rpc.full_node_rp... | 46.906021 | 120 | 0.630091 |
79587701a1d9486c63469d8d89087654c3744497 | 3,120 | py | Python | docs/examples/data_access/sqlalchemy/sqlalchemy_example/test_authorization.py | connec/oso | a12d94206807b69beb6fe7a9070b9afcacdfc845 | [
"Apache-2.0"
] | 2,167 | 2020-07-28T15:49:48.000Z | 2022-03-31T06:11:28.000Z | docs/examples/data_access/sqlalchemy/sqlalchemy_example/test_authorization.py | connec/oso | a12d94206807b69beb6fe7a9070b9afcacdfc845 | [
"Apache-2.0"
] | 1,060 | 2020-07-25T18:37:07.000Z | 2022-03-30T05:49:44.000Z | docs/examples/data_access/sqlalchemy/sqlalchemy_example/test_authorization.py | connec/oso | a12d94206807b69beb6fe7a9070b9afcacdfc845 | [
"Apache-2.0"
] | 118 | 2020-08-05T19:27:14.000Z | 2022-03-31T16:37:39.000Z | from pathlib import Path
import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from oso import Oso
from sqlalchemy_oso.session import scoped_session
from sqlalchemy_oso.auth import register_models
from .models import Post, User, Model
POLICY_FILE = Path(__file__).absolute().parent /... | 30.291262 | 90 | 0.664744 |
7958775c4147d26b973e02ea2f723f9988e9dbbb | 322 | py | Python | src/encoders/__init__.py | ligerfotis/semantic-code-search_gpt2_tf | 5eff2ceda0789ee265ad08b742f0d728884e3df8 | [
"MIT"
] | 1 | 2020-09-12T04:03:12.000Z | 2020-09-12T04:03:12.000Z | src/encoders/__init__.py | ligerfotis/semantic-code-search_gpt2_tf | 5eff2ceda0789ee265ad08b742f0d728884e3df8 | [
"MIT"
] | 1 | 2022-03-03T17:41:25.000Z | 2022-03-16T01:11:02.000Z | src/encoders/__init__.py | ligerfotis/semantic-code-search_gpt2_tf | 5eff2ceda0789ee265ad08b742f0d728884e3df8 | [
"MIT"
] | 1 | 2021-12-07T06:55:41.000Z | 2021-12-07T06:55:41.000Z | from .encoder import Encoder, QueryType
from .nbow_seq_encoder import NBoWEncoder
from .rnn_seq_encoder import RNNEncoder
from .self_att_encoder import SelfAttentionEncoder
from .conv_seq_encoder import ConvolutionSeqEncoder
from .conv_self_att_encoder import ConvSelfAttentionEncoder
from .gpt2_encoder import GPT2Encod... | 46 | 59 | 0.888199 |
79587783ba909c3c7e4094600f3f046a64c6614b | 1,245 | py | Python | Browser/keywords/__init__.py | emanlove/robotframework-browser | 8d9dae4301fe263bc0f7682de58a6bf299211382 | [
"Apache-2.0"
] | 1 | 2021-09-02T02:09:01.000Z | 2021-09-02T02:09:01.000Z | Browser/keywords/__init__.py | emanlove/robotframework-browser | 8d9dae4301fe263bc0f7682de58a6bf299211382 | [
"Apache-2.0"
] | 228 | 2020-12-18T07:15:41.000Z | 2022-03-25T13:11:56.000Z | Browser/keywords/__init__.py | emanlove/robotframework-browser | 8d9dae4301fe263bc0f7682de58a6bf299211382 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020- Robot Framework Foundation
#
# 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... | 29.642857 | 74 | 0.753414 |
79587910d23a66bec071df9ca3c49218c0fa64cf | 8,194 | py | Python | neutron/agent/l3/ha.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | neutron/agent/l3/ha.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | neutron/agent/l3/ha.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 41.383838 | 78 | 0.667684 |
79587986a92c0b8d4b4a40573ce4d95310569dcf | 9,716 | py | Python | multiagent/scenarios/food_collect.py | debajit15kgp/multiagent-envs | cc5bd1a1015636a07d8e703ee57067b315dde596 | [
"MIT"
] | null | null | null | multiagent/scenarios/food_collect.py | debajit15kgp/multiagent-envs | cc5bd1a1015636a07d8e703ee57067b315dde596 | [
"MIT"
] | null | null | null | multiagent/scenarios/food_collect.py | debajit15kgp/multiagent-envs | cc5bd1a1015636a07d8e703ee57067b315dde596 | [
"MIT"
] | null | null | null | import numpy as np
from multiagent.core import World, Agent, Landmark
from multiagent.scenario import BaseScenario
import os
SIGHT = 100
ALPHA = 1
def softmax_dis(x):
x = np.asarray(x)
dis_min = np.min(x)
return dis_min
class Scenario(BaseScenario):
def __init__(self, n_good, n_adv, n_landmarks, n... | 36.118959 | 151 | 0.558254 |
79587a52ef1bfb321da77e381af034d9ef7b57e5 | 483 | py | Python | month03.2/django/day05/mysitel3/oto/models.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | 1 | 2021-02-02T02:17:37.000Z | 2021-02-02T02:17:37.000Z | month03.2/django/day05/mysitel3/oto/models.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | month03.2/django/day05/mysitel3/oto/models.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | from django.db import models
# Create your models here.
class Author(models.Model):
name=models.CharField('姓名',max_length=20)
def __str__(self):
return self.name
class Meta:
verbose_name_plural='作者'
class Wife(models.Model):
name=models.CharField('姓名',max_length=20)
author=models.... | 24.15 | 82 | 0.693582 |
79587c106fe6a3b4fd76960ce09a5b1519cbb0cf | 8,391 | py | Python | Training_BigDL_Zoo/4.3-Training-InclusiveClassifier-TFPark.py | jenniew/SparkDLTrigger | 893cb06357a32d12f4a1ce24ec91d8e8ac47fd0b | [
"Apache-2.0"
] | null | null | null | Training_BigDL_Zoo/4.3-Training-InclusiveClassifier-TFPark.py | jenniew/SparkDLTrigger | 893cb06357a32d12f4a1ce24ec91d8e8ac47fd0b | [
"Apache-2.0"
] | null | null | null | Training_BigDL_Zoo/4.3-Training-InclusiveClassifier-TFPark.py | jenniew/SparkDLTrigger | 893cb06357a32d12f4a1ce24ec91d8e8ac47fd0b | [
"Apache-2.0"
] | null | null | null |
# coding: utf-8
# Now we will train the Inclusive classifier, a combination of the Particle-sequence classifier with the High Level Features.
#
# To run this notebook we used the following configuration:
# * *Software stack*: LCG 94 (it has spark 2.3.1)
# * *Platform*: centos7-gcc7
# * *Spark cluster*: Hadalytic
# ... | 24.825444 | 232 | 0.690978 |
79587dec57730be24ebf60f67a20c57c2b0d57f5 | 1,716 | py | Python | tests/test_cryptocurrencychart.py | gdoermann/cryptocurrencychart | 713dae89304c86599f4a14a6dbd40f2e21c77048 | [
"MIT"
] | 1 | 2021-04-16T19:25:46.000Z | 2021-04-16T19:25:46.000Z | tests/test_cryptocurrencychart.py | gdoermann/cryptocurrencychart | 713dae89304c86599f4a14a6dbd40f2e21c77048 | [
"MIT"
] | null | null | null | tests/test_cryptocurrencychart.py | gdoermann/cryptocurrencychart | 713dae89304c86599f4a14a6dbd40f2e21c77048 | [
"MIT"
] | 1 | 2020-11-12T12:14:22.000Z | 2020-11-12T12:14:22.000Z | import datetime
import unittest
from cryptocurrencychart.api import CryptoCurrencyChartApi
class TestApi(unittest.TestCase):
def setUp(self) -> None:
self.reset()
def reset(self):
self.api = CryptoCurrencyChartApi()
def test_api_connection(self):
currencies = self.api.get_base_cu... | 37.304348 | 107 | 0.666084 |
79587efbf86ed08d4264578ffa7b6e668d9c1e64 | 1,410 | py | Python | hierarc/Util/likelihood_util.py | aymgal/hierArc | a52cb6f2ad1d7a8cbd08c215ef7d5189fa329269 | [
"BSD-3-Clause"
] | 5 | 2020-07-08T00:53:04.000Z | 2021-08-03T08:20:31.000Z | hierarc/Util/likelihood_util.py | aymgal/hierArc | a52cb6f2ad1d7a8cbd08c215ef7d5189fa329269 | [
"BSD-3-Clause"
] | 4 | 2020-03-30T22:12:57.000Z | 2021-04-03T06:20:52.000Z | hierarc/Util/likelihood_util.py | aymgal/hierArc | a52cb6f2ad1d7a8cbd08c215ef7d5189fa329269 | [
"BSD-3-Clause"
] | 5 | 2020-03-30T21:20:08.000Z | 2021-03-03T17:08:42.000Z | import numpy as np
from scipy.stats import truncnorm
def log_likelihood_cov(data, model, cov_error):
"""
log likelihood of the data given a model
:param data: data vector
:param model: model vector
:param cov_error: inverse covariance matrix
:return: log likelihood
"""
delta = data - ... | 32.790698 | 117 | 0.710638 |
79587f2e00169e479a909240bbf29dedda4b25db | 8,328 | py | Python | joblib/externals/loky/backend/semaphore_tracker.py | cclauss/joblib | 902fb6bbcf75c461d1b6703e5a01605fc592f214 | [
"BSD-3-Clause"
] | 1 | 2019-07-16T10:25:24.000Z | 2019-07-16T10:25:24.000Z | joblib/externals/loky/backend/semaphore_tracker.py | cclauss/joblib | 902fb6bbcf75c461d1b6703e5a01605fc592f214 | [
"BSD-3-Clause"
] | 1 | 2020-02-17T00:13:09.000Z | 2020-02-17T00:13:09.000Z | joblib/externals/loky/backend/semaphore_tracker.py | jdanbrown/joblib | e205833ed42f0f1c72d69d96f4c266734cea9d95 | [
"BSD-3-Clause"
] | 1 | 2019-03-25T09:56:23.000Z | 2019-03-25T09:56:23.000Z | ###############################################################################
# Server process to keep track of unlinked semaphores and clean them.
#
# author: Thomas Moreau
#
# adapted from multiprocessing/semaphore_tracker.py (17/02/2017)
# * include custom spawnv_passfds to start the process
# * use custom unli... | 35.139241 | 87 | 0.537104 |
79587f6fd4e1d7353c768b5e7b8ec6e958857925 | 8,749 | py | Python | python/cloudtik/core/_private/parameter.py | haojinIntel/cloudtik-1 | 8687c7e8c9b362a30674aea571ef0d736ec42c49 | [
"Apache-2.0"
] | null | null | null | python/cloudtik/core/_private/parameter.py | haojinIntel/cloudtik-1 | 8687c7e8c9b362a30674aea571ef0d736ec42c49 | [
"Apache-2.0"
] | null | null | null | python/cloudtik/core/_private/parameter.py | haojinIntel/cloudtik-1 | 8687c7e8c9b362a30674aea571ef0d736ec42c49 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import cloudtik.core._private.constants as constants
logger = logging.getLogger(__name__)
class StartParams:
"""A class used to store the start-up parameters used.
Attributes:
external_addresses (str): The address of external Redis server to
connect to, in forma... | 42.887255 | 83 | 0.603269 |
79588030f634d7f5f47cea4b465555d2396164f8 | 18,611 | py | Python | modules/util.py | shovelingpig/SAFA | 35cd638ab299e58ba303bf64874287abdbcf9fd6 | [
"RSA-MD"
] | 1 | 2021-12-16T13:38:21.000Z | 2021-12-16T13:38:21.000Z | modules/util.py | shovelingpig/SAFA | 35cd638ab299e58ba303bf64874287abdbcf9fd6 | [
"RSA-MD"
] | null | null | null | modules/util.py | shovelingpig/SAFA | 35cd638ab299e58ba303bf64874287abdbcf9fd6 | [
"RSA-MD"
] | null | null | null | import math
from torch import nn
import torch.nn.functional as F
import torch
import torchvision.models as models
def kp2gaussian(kp, spatial_size, kp_variance):
"""
Transform a keypoint into gaussian like representation
"""
mean = kp['value']
coordinate_grid = make_coordinate_grid(spatial_size, ... | 36.420744 | 116 | 0.593305 |
795880ec1d91501ee3c866f24bfe2a5da7ac3772 | 393 | py | Python | Alphabetic Patterns/alphabeticpattern103.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | null | null | null | Alphabetic Patterns/alphabeticpattern103.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 471 | 2022-01-15T07:07:18.000Z | 2022-02-28T16:01:42.000Z | Alphabetic Patterns/alphabeticpattern103.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 2 | 2022-01-17T09:43:16.000Z | 2022-01-29T15:15:47.000Z | height = int(input())
for i in range(1,height+1):
for j in range(1,height*2+1):
if(j == height-i+1 or j == height+i-1):
c = chr(j+64)
print(c,end=" ")
else:
print(end=" ")
print()
# Sample Input :- 5
# Output :-
# E
# D F ... | 17.863636 | 47 | 0.343511 |
7958825c6ebbc6e58cf52382d838a7ea695da876 | 1,363 | py | Python | azure-mgmt-media/azure/mgmt/media/models/list_container_sas_input.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-media/azure/mgmt/media/models/list_container_sas_input.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | azure-mgmt-media/azure/mgmt/media/models/list_container_sas_input.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.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 ... | 37.861111 | 82 | 0.624358 |
79588358ddfa5476db2fca6a876680731bce13ed | 10,527 | py | Python | scripts/aux/opts.py | Druidos/cv | 90cdbf212d7cc8c5cbd2fbbcc770d18a89771037 | [
"Apache-2.0"
] | 2 | 2019-12-29T22:42:36.000Z | 2020-09-15T15:53:36.000Z | scripts/aux/opts.py | Druidos/cv | 90cdbf212d7cc8c5cbd2fbbcc770d18a89771037 | [
"Apache-2.0"
] | 7 | 2019-11-08T09:27:46.000Z | 2020-11-17T10:00:51.000Z | scripts/aux/opts.py | Druidos/cv | 90cdbf212d7cc8c5cbd2fbbcc770d18a89771037 | [
"Apache-2.0"
] | 2 | 2019-10-11T07:25:17.000Z | 2020-01-21T16:15:18.000Z | #
# CV is a framework for continuous verification.
#
# Copyright (c) 2018-2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 21.885655 | 81 | 0.566353 |
7958835d4c53b813fd5ef4cb9b4befe4a7dfe0f8 | 7,736 | py | Python | linedrawer.py | q1qgames/pixray | 8bd73869af7979068aa7ff8402f5b3ab2b791255 | [
"MIT"
] | 468 | 2021-11-23T08:05:15.000Z | 2022-03-30T13:16:43.000Z | linedrawer.py | q1qgames/pixray | 8bd73869af7979068aa7ff8402f5b3ab2b791255 | [
"MIT"
] | 53 | 2021-11-26T22:46:36.000Z | 2022-03-28T16:47:02.000Z | linedrawer.py | q1qgames/pixray | 8bd73869af7979068aa7ff8402f5b3ab2b791255 | [
"MIT"
] | 67 | 2021-11-24T11:34:05.000Z | 2022-03-28T15:17:45.000Z | # this is derived from ClipDraw code
# CLIPDraw: Exploring Text-to-Drawing Synthesis through Language-Image Encoders
# Kevin Frans, L.B. Soros, Olaf Witkowski
# https://arxiv.org/abs/2106.14843
from DrawingInterface import DrawingInterface
import pydiffvg
import torch
import skimage
import skimage.io
import random
im... | 39.070707 | 152 | 0.624741 |
795883a0e14a9e7abc8063225b34732ddf3494fa | 393 | py | Python | egs/grand_challenge/inference.py | HongYun0901/ESPnet | 44f78734034991fed4f42359f4d15f15504680bd | [
"Apache-2.0"
] | 1 | 2021-12-22T06:04:44.000Z | 2021-12-22T06:04:44.000Z | egs/grand_challenge/inference.py | hongyuntw/ESPnet | 44f78734034991fed4f42359f4d15f15504680bd | [
"Apache-2.0"
] | null | null | null | egs/grand_challenge/inference.py | hongyuntw/ESPnet | 44f78734034991fed4f42359f4d15f15504680bd | [
"Apache-2.0"
] | null | null | null | import json
import matplotlib.pyplot as plt
import kaldiio
root = "/home/nlp/ASR/espnet/egs/FSW"
with open(root + "/dump/test/deltafalse/data.json", "r") as f:
test_json = json.load(f)["utts"]
key, info = list(test_json.items())[10]
fbank = kaldiio.load_mat(info["input"][0]["feat"])
# plot the speech feature
plt... | 28.071429 | 62 | 0.671756 |
7958840b50a855cc7287a88dc98c83ab6d64dad8 | 1,550 | py | Python | src/twisted/python/test/modules_helpers.py | apjanke/twisted | 22f949f7ce187513f0c218b73186c8a73baa00b4 | [
"Unlicense",
"MIT"
] | 1 | 2021-01-03T01:54:14.000Z | 2021-01-03T01:54:14.000Z | src/twisted/python/test/modules_helpers.py | zerospam/twisted | e23b5e2040a4d643bc6a43785621358569886a0d | [
"MIT",
"Unlicense"
] | null | null | null | src/twisted/python/test/modules_helpers.py | zerospam/twisted | e23b5e2040a4d643bc6a43785621358569886a0d | [
"MIT",
"Unlicense"
] | null | null | null | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Facilities for helping test code which interacts with Python's module system
to load code.
"""
import sys
from twisted.python.filepath import FilePath
class TwistedModulesMixin:
"""
A mixin for C{twisted.trial.unittest.Synchronous... | 27.192982 | 80 | 0.637419 |
795884adcf7f7098bb8940f07630d9159dc74406 | 63,366 | py | Python | ssg/build_yaml.py | heryxpc/content | 5293788149707ae46d8e217ac106398e2c996493 | [
"BSD-3-Clause"
] | null | null | null | ssg/build_yaml.py | heryxpc/content | 5293788149707ae46d8e217ac106398e2c996493 | [
"BSD-3-Clause"
] | null | null | null | ssg/build_yaml.py | heryxpc/content | 5293788149707ae46d8e217ac106398e2c996493 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import os
import os.path
from collections import defaultdict
from copy import deepcopy
import datetime
import re
import sys
from xml.sax.saxutils import escape
import yaml
from .build_cpe import CPEDoesNotExist
from .constants import XCCDF_... | 39.877911 | 116 | 0.60048 |
795884cd113ce101c43bde4e65c504fac805e745 | 501 | py | Python | tracker/templatetags/serializers.py | paul-serafimescu/growth-tracker | 972dd1de534225a9be2e763045db560f420a844c | [
"MIT"
] | 1 | 2021-07-28T04:21:12.000Z | 2021-07-28T04:21:12.000Z | tracker/templatetags/serializers.py | paul-serafimescu/growth-tracker | 972dd1de534225a9be2e763045db560f420a844c | [
"MIT"
] | null | null | null | tracker/templatetags/serializers.py | paul-serafimescu/growth-tracker | 972dd1de534225a9be2e763045db560f420a844c | [
"MIT"
] | null | null | null | from django import template
from django.db import models
from typing import Any, Union
register = template.Library()
@register.filter
def serialize(value: Union[models.Model, list]) -> Union[dict[str, Any], list[dict[str, Any]]]:
if isinstance(value, models.Model):
try:
return value.serialize()
except... | 27.833333 | 95 | 0.708583 |
79588554671c30285cba20742448afd53f99b37e | 6,152 | py | Python | labml_nn/transformers/gmlp/__init__.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 1 | 2021-09-17T18:16:17.000Z | 2021-09-17T18:16:17.000Z | labml_nn/transformers/gmlp/__init__.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | null | null | null | labml_nn/transformers/gmlp/__init__.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 2 | 2021-06-16T05:56:35.000Z | 2021-10-19T07:33:44.000Z | """
---
title: Pay Attention to MLPs (gMLP)
summary: >
This is an annotated implementation/tutorial of Pay Attention to MLPs (gMLP) in PyTorch.
---
# Pay Attention to MLPs (gMLP)
This is a [PyTorch](https://pytorch.org) implementation of the paper
[Pay Attention to MLPs](https://papers.labml.ai/paper/2105.08050).
... | 38.45 | 131 | 0.607445 |
795885f8302dbf41ef04e37b87abdd0d4bf12727 | 5,047 | py | Python | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/compiler/tests/slice_ops_test.py | BonexGu/Blik2D | 8e0592787e5c8e8a28682d0e1826b8223eae5983 | [
"MIT"
] | 13 | 2017-02-22T02:20:06.000Z | 2018-06-06T04:18:03.000Z | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/compiler/tests/slice_ops_test.py | BonexGu/Blik2D | 8e0592787e5c8e8a28682d0e1826b8223eae5983 | [
"MIT"
] | null | null | null | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/compiler/tests/slice_ops_test.py | BonexGu/Blik2D | 8e0592787e5c8e8a28682d0e1826b8223eae5983 | [
"MIT"
] | 1 | 2019-10-17T10:58:23.000Z | 2019-10-17T10:58:23.000Z | # Copyright 2017 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.293706 | 80 | 0.477908 |
7958863b44f3ac219413c002bd17dc882609d001 | 1,327 | py | Python | cafeData/reviews/ReceiptReviewCrawling.py | yuueuni/cafein | 29a4074301c0575d9f0432e9219dbe77d0121e0b | [
"MIT"
] | null | null | null | cafeData/reviews/ReceiptReviewCrawling.py | yuueuni/cafein | 29a4074301c0575d9f0432e9219dbe77d0121e0b | [
"MIT"
] | null | null | null | cafeData/reviews/ReceiptReviewCrawling.py | yuueuni/cafein | 29a4074301c0575d9f0432e9219dbe77d0121e0b | [
"MIT"
] | null | null | null | from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
import unicodedata
emoji_pattern = re.compile("["
u"\U0001F600-\U0001F64F" # emoticons
u"\U0001F300-\U0001F5FF" # symbols & pictographs
u"\U0001F680-\U0001F6FF" # transport & map symbols
u"\U0001F1E0-\U0001F1F... | 45.758621 | 193 | 0.598342 |
795886472569e9fa37b33ef1b73417d2821db034 | 7,215 | py | Python | src/spaceone/inventory/scheduler/inventory_scheduler.py | whdalsrnt/inventory | 5d1cfb3a9cb72156c48a0118b80e6ed2d67e8028 | [
"Apache-2.0"
] | 9 | 2020-06-04T23:01:38.000Z | 2021-06-03T03:38:59.000Z | src/spaceone/inventory/scheduler/inventory_scheduler.py | whdalsrnt/inventory | 5d1cfb3a9cb72156c48a0118b80e6ed2d67e8028 | [
"Apache-2.0"
] | 10 | 2020-08-20T01:34:30.000Z | 2022-03-14T04:59:48.000Z | src/spaceone/inventory/scheduler/inventory_scheduler.py | whdalsrnt/inventory | 5d1cfb3a9cb72156c48a0118b80e6ed2d67e8028 | [
"Apache-2.0"
] | 9 | 2020-06-08T22:03:02.000Z | 2021-12-06T06:12:30.000Z | import consul
import datetime
import logging
import time
from spaceone.core import config
from spaceone.core.locator import Locator
from spaceone.core.scheduler import HourlyScheduler, IntervalScheduler
from spaceone.core.auth.jwt.jwt_util import JWTUtil
__all__ = ['InventoryHourlyScheduler']
_LOGGER = logging.getLo... | 32.647059 | 104 | 0.535412 |
7958869699bb0560114ba66dde3e6a9159a11a0a | 1,959 | py | Python | api/src/opentrons/protocol_engine/execution/movement.py | Axel-Jacobsen/opentrons | c543d95c25003f2e784560efaa6a91f051d4cd33 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocol_engine/execution/movement.py | Axel-Jacobsen/opentrons | c543d95c25003f2e784560efaa6a91f051d4cd33 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocol_engine/execution/movement.py | Axel-Jacobsen/opentrons | c543d95c25003f2e784560efaa6a91f051d4cd33 | [
"Apache-2.0"
] | null | null | null | """Movement command handling."""
from opentrons.hardware_control.api import API as HardwareAPI
from ..state import StateView
from ..command_models import BasePipettingRequest, MoveToWellResult
class MovementHandler:
"""Implementation logic for gantry movement."""
_state: StateView
_hardware: HardwareAPI... | 31.095238 | 79 | 0.646248 |
795886db96780b0ca19411765e61ff38739ba219 | 1,002 | py | Python | src/models/utils.py | qihongl/demo-advantage-actor-critic | 00cfa770d872412da5a604f320d41dcfd30bc020 | [
"MIT"
] | 2 | 2021-05-16T14:13:35.000Z | 2022-02-10T07:05:33.000Z | src/models/utils.py | qihongl/demo-advantage-actor-critic | 00cfa770d872412da5a604f320d41dcfd30bc020 | [
"MIT"
] | null | null | null | src/models/utils.py | qihongl/demo-advantage-actor-critic | 00cfa770d872412da5a604f320d41dcfd30bc020 | [
"MIT"
] | 1 | 2021-06-01T14:13:42.000Z | 2021-06-01T14:13:42.000Z | import torch
def ortho_init(agent):
for name, wts in agent.named_parameters():
if 'weight' in name:
torch.nn.init.orthogonal_(wts)
elif 'bias' in name:
torch.nn.init.constant_(wts, 0)
def softmax(z, beta):
"""helper function, softmax with beta
Parameters
----... | 20.875 | 70 | 0.588822 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.