hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9fedb6d5196c3878f81f5abc084e8b3fc40d4c55 | 604 | py | Python | LeetCode/DestinationCity.py | SelvorWhim/competitive | b9daaf21920d6f7669dc0c525e903949f4e33b62 | [
"Unlicense"
] | null | null | null | LeetCode/DestinationCity.py | SelvorWhim/competitive | b9daaf21920d6f7669dc0c525e903949f4e33b62 | [
"Unlicense"
] | null | null | null | LeetCode/DestinationCity.py | SelvorWhim/competitive | b9daaf21920d6f7669dc0c525e903949f4e33b62 | [
"Unlicense"
] | null | null | null | # given there's exactly one destination city, just find one that appears in the list but never first in a pair
class Solution:
def destCity(self, paths: List[List[str]]) -> str:
not_destination = set() # cities with outgoing paths
destination_candidate = set()
for from_city, to_city in paths... | 50.333333 | 110 | 0.68543 |
a990b1736071124107488775fce5c90607c36f91 | 9,654 | py | Python | seq2seq/common_seq/util_metrics.py | AndrewWren/decrypt | 09cf541665b827aca590a4ea468a9845b6242655 | [
"CC-BY-4.0"
] | null | null | null | seq2seq/common_seq/util_metrics.py | AndrewWren/decrypt | 09cf541665b827aca590a4ea468a9845b6242655 | [
"CC-BY-4.0"
] | null | null | null | seq2seq/common_seq/util_metrics.py | AndrewWren/decrypt | 09cf541665b827aca590a4ea468a9845b6242655 | [
"CC-BY-4.0"
] | null | null | null | from __future__ import annotations
import logging
from collections import Counter
from typing import Tuple, List, Dict, Set, Callable, Optional, Union, Any
import torch
from .util import ProcessedBatch, PerBatchValStep
log = logging.getLogger(__name__)
# todo: metrics should be callable metaclass function
class M... | 37.274131 | 111 | 0.590532 |
fc93617242d3ddc2bfff01f854f4f32eb88eef7e | 3,236 | py | Python | app/utils/s3.py | livlikwav/GoodPooPee_ML_backend | ead1b3fccbe432c233d9fb6c0a115d526b74b68e | [
"MIT"
] | null | null | null | app/utils/s3.py | livlikwav/GoodPooPee_ML_backend | ead1b3fccbe432c233d9fb6c0a115d526b74b68e | [
"MIT"
] | null | null | null | app/utils/s3.py | livlikwav/GoodPooPee_ML_backend | ead1b3fccbe432c233d9fb6c0a115d526b74b68e | [
"MIT"
] | null | null | null | import logging
import boto3
from botocore.exceptions import ClientError
def upload_fileobj(file_obj, file_name):
"""
Upload a file to an S3 bucket
:param file_obj: File object to upload
:param file_name: S3 object name that will be saved
:return: True if file was uploaded, else False
"""
... | 27.65812 | 110 | 0.640297 |
92b98144c27d6863fedb3def80122cc78accc1c8 | 5,265 | py | Python | onnx/backend/test/case/node/reducesum.py | pchandrasekaran1595/onnx | 10da6f2e919c8515877e227a41cd44e86ae0bb2d | [
"Apache-2.0"
] | 12,820 | 2017-09-07T07:00:24.000Z | 2022-03-31T14:41:57.000Z | onnx/backend/test/case/node/reducesum.py | pchandrasekaran1595/onnx | 10da6f2e919c8515877e227a41cd44e86ae0bb2d | [
"Apache-2.0"
] | 3,213 | 2017-09-07T17:48:17.000Z | 2022-03-31T19:44:57.000Z | onnx/backend/test/case/node/reducesum.py | pchandrasekaran1595/onnx | 10da6f2e919c8515877e227a41cd44e86ae0bb2d | [
"Apache-2.0"
] | 2,922 | 2017-09-07T07:46:00.000Z | 2022-03-31T15:55:24.000Z | # SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class ReduceSum(Base):
@staticm... | 34.638158 | 114 | 0.558405 |
7985fe1c72f57c3a1c95e8d7ac805284cf161f12 | 2,910 | py | Python | disqus/api.py | belimawr/django-disqus | b1e3688b6002654c1f37c1bfce55365e305ff5d6 | [
"BSD-3-Clause"
] | null | null | null | disqus/api.py | belimawr/django-disqus | b1e3688b6002654c1f37c1bfce55365e305ff5d6 | [
"BSD-3-Clause"
] | null | null | null | disqus/api.py | belimawr/django-disqus | b1e3688b6002654c1f37c1bfce55365e305ff5d6 | [
"BSD-3-Clause"
] | null | null | null | from urllib import urlencode
import urllib2
import json
# A custom ProxyHandler for the urllib2 module that will not
# auto-detect proxy settings
proxy_support = urllib2.ProxyHandler({})
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
class DisqusException(Exception):
"""Exception rai... | 33.448276 | 77 | 0.611684 |
34d05fac06bafd0e0fd1b00e6cc5b0c2be9c054d | 1,470 | py | Python | votes/migrations/0001_initial.py | RibeiroFla/djangocity | 1e7ef018dac9b6b55cfeb812a05daf3312587852 | [
"MIT"
] | null | null | null | votes/migrations/0001_initial.py | RibeiroFla/djangocity | 1e7ef018dac9b6b55cfeb812a05daf3312587852 | [
"MIT"
] | null | null | null | votes/migrations/0001_initial.py | RibeiroFla/djangocity | 1e7ef018dac9b6b55cfeb812a05daf3312587852 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-29 20:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Vote',... | 34.186047 | 182 | 0.565306 |
dc71e9622b8bcf754fe753430d414a7242d9284f | 5,482 | py | Python | tests/st/ops/gpu/test_concatv2_op.py | ZephyrChenzf/mindspore | 8f191847cf71e12715ced96bc3575914f980127a | [
"Apache-2.0"
] | 7 | 2020-05-24T03:19:26.000Z | 2020-05-24T03:20:00.000Z | tests/st/ops/gpu/test_concatv2_op.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | tests/st/ops/gpu/test_concatv2_op.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 30.625698 | 110 | 0.607807 |
d5a0dc8c494cda8ebe5c61f1a83c24ccc6aee6f3 | 4,280 | py | Python | network_scan.py | w940853815/network_scan | 5c1caa072362078162cea19a02afe5abca75a38d | [
"MIT"
] | 1 | 2019-01-11T04:21:20.000Z | 2019-01-11T04:21:20.000Z | network_scan.py | w940853815/network_scan | 5c1caa072362078162cea19a02afe5abca75a38d | [
"MIT"
] | null | null | null | network_scan.py | w940853815/network_scan | 5c1caa072362078162cea19a02afe5abca75a38d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf_8 -*-
# Author:ruidong.wang
import multiprocessing
from IPy import IP
import threading
import nmap
import time
import sys
import subprocess
from xml.dom import minidom
def usage():
print
'The script requires root privileges!'
print
'example:python scan.py 192.168.0.1/24'
... | 20.878049 | 111 | 0.684813 |
1093d1e497564af7a1d466bce3ba3c89e6687288 | 10,341 | py | Python | alphapose/utils/writer.py | patharanordev/AlphaPose | 8288406495f753e5f9d86e3edd79b90057cff7df | [
"Apache-2.0"
] | null | null | null | alphapose/utils/writer.py | patharanordev/AlphaPose | 8288406495f753e5f9d86e3edd79b90057cff7df | [
"Apache-2.0"
] | null | null | null | alphapose/utils/writer.py | patharanordev/AlphaPose | 8288406495f753e5f9d86e3edd79b90057cff7df | [
"Apache-2.0"
] | null | null | null | import os
import time
from threading import Thread
from queue import Queue
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
from alphapose.utils.transforms import get_func_heatmap_to_coord
from alphapose.utils.pPose_nms import pose_nms, write_json
from alphapose.utils.data_recorder impor... | 39.926641 | 141 | 0.578184 |
94a0ee26e5a0d425a543d785f3c70c7e601643b1 | 1,346 | py | Python | examples/nas/gaea_pytorch/search/data.py | gh-determined-ai/determined | 9a1ab33a3a356b69681b3351629fef4ab98ddb56 | [
"Apache-2.0"
] | 1,729 | 2020-04-27T17:36:40.000Z | 2022-03-31T05:48:39.000Z | examples/nas/gaea_pytorch/search/data.py | ChrisW09/determined | 5c37bfe9cfcc69174ba29a3f1a115c3e9e3632e0 | [
"Apache-2.0"
] | 1,940 | 2020-04-27T17:34:14.000Z | 2022-03-31T23:02:28.000Z | examples/nas/gaea_pytorch/search/data.py | ChrisW09/determined | 5c37bfe9cfcc69174ba29a3f1a115c3e9e3632e0 | [
"Apache-2.0"
] | 214 | 2020-04-27T19:57:28.000Z | 2022-03-29T08:17:16.000Z | import numpy as np
from torch.utils.data import Dataset
class BilevelDataset(Dataset):
def __init__(
self,
dataset,
):
"""
We will split the data into a train split and a validation split
and return one image from each split as a single observation.
Args:
... | 32.047619 | 72 | 0.621842 |
9097fc5fba65e626c1725a19cc3352fcf2d210d5 | 7,103 | py | Python | Paddle_Industry_Practice_Sample_Library/nlp_projects/event_extraction/ernie_with_crf/data.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-19T09:58:37.000Z | 2022-03-19T09:58:37.000Z | Paddle_Industry_Practice_Sample_Library/nlp_projects/event_extraction/ernie_with_crf/data.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | Paddle_Industry_Practice_Sample_Library/nlp_projects/event_extraction/ernie_with_crf/data.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | # 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 appli... | 40.129944 | 118 | 0.618612 |
2dcaddcdfd3c65728c8544280d312ce68e4be9c4 | 3,177 | py | Python | zerver/lib/bot_config.py | natalietotonchy/zulip | 2aaad502b45da9b3f6039e45efa731df72dd345a | [
"Apache-2.0"
] | null | null | null | zerver/lib/bot_config.py | natalietotonchy/zulip | 2aaad502b45da9b3f6039e45efa731df72dd345a | [
"Apache-2.0"
] | 6 | 2020-09-05T21:07:41.000Z | 2021-12-02T17:56:37.000Z | zerver/lib/bot_config.py | natalietotonchy/zulip | 2aaad502b45da9b3f6039e45efa731df72dd345a | [
"Apache-2.0"
] | 1 | 2021-01-07T23:27:52.000Z | 2021-01-07T23:27:52.000Z | from django.conf import settings
from django.db.models import Sum
from django.db.models.query import F
from django.db.models.functions import Length
from zerver.models import BotConfigData, UserProfile
from typing import Text, List, Dict, Optional
from collections import defaultdict
import os
import configparser
im... | 43.520548 | 109 | 0.672332 |
3af9a3db2c130998a484907678ec55696fd3bf1c | 5,744 | py | Python | docs/_autodoc/source/conf.py | mpynode/node-designer | ec620f1388337bc0a4e5664d80e1ea6ade8b410e | [
"Unlicense"
] | 63 | 2019-03-18T03:44:28.000Z | 2021-12-31T07:51:09.000Z | docs/_autodoc/source/conf.py | mpynode/node-designer | ec620f1388337bc0a4e5664d80e1ea6ade8b410e | [
"Unlicense"
] | 2 | 2019-03-19T10:39:02.000Z | 2020-02-25T06:39:12.000Z | docs/_autodoc/source/conf.py | mpynode/node-designer | ec620f1388337bc0a4e5664d80e1ea6ade8b410e | [
"Unlicense"
] | 19 | 2019-03-18T08:05:05.000Z | 2022-01-11T08:37:45.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.391534 | 108 | 0.651114 |
3bb95deb36801db5e34350afd57579e093b27c5b | 674 | py | Python | src/pretalx/submission/migrations/0005_auto_20170902_0800.py | hrchu/pretalx | cd7e5525f80c7290d9650065b4cf4f085032adfc | [
"Apache-2.0"
] | 418 | 2017-10-05T05:52:49.000Z | 2022-03-24T09:50:06.000Z | src/pretalx/submission/migrations/0005_auto_20170902_0800.py | hrchu/pretalx | cd7e5525f80c7290d9650065b4cf4f085032adfc | [
"Apache-2.0"
] | 1,049 | 2017-09-16T09:34:55.000Z | 2022-03-23T16:13:04.000Z | src/pretalx/submission/migrations/0005_auto_20170902_0800.py | hrchu/pretalx | cd7e5525f80c7290d9650065b4cf4f085032adfc | [
"Apache-2.0"
] | 155 | 2017-10-16T18:32:01.000Z | 2022-03-15T12:48:33.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-02 13:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("submission", "0004_auto_20170902_0535"),
]
operations = [
migrations.AddFie... | 25.923077 | 74 | 0.614243 |
81d5d681df6518e8b806fa931aee503e7400ca40 | 883 | py | Python | demo.py | ovirs/pyvivint | aa8d68fcbdd8928e8ddbc2807a4710c2cd98ed51 | [
"MIT"
] | 3 | 2021-02-19T20:53:37.000Z | 2021-06-11T18:05:56.000Z | demo.py | ovirs/pyvivint | aa8d68fcbdd8928e8ddbc2807a4710c2cd98ed51 | [
"MIT"
] | 10 | 2020-06-18T16:09:08.000Z | 2021-09-03T20:26:44.000Z | demo.py | ovirs/pyvivint | aa8d68fcbdd8928e8ddbc2807a4710c2cd98ed51 | [
"MIT"
] | 2 | 2020-03-08T20:56:14.000Z | 2021-01-17T19:10:30.000Z | import asyncio
import logging
import os
from pyvivint.vivint import Vivint
async def main():
logging.getLogger().setLevel(logging.DEBUG)
logging.info("demo started")
vivint = Vivint(username=os.environ["username"], password=os.environ["password"])
await vivint.connect(load_devices=True, subscribe_f... | 25.970588 | 88 | 0.668177 |
c97c4e242cb05c70f672e0bd7e7dd81d55a92bba | 3,013 | py | Python | openhgnn/dataset/__init__.py | clearhanhui/OpenHGNN | 9c3b7e7a4bc9b3df38ee6dc7154f950340ceec20 | [
"Apache-2.0"
] | null | null | null | openhgnn/dataset/__init__.py | clearhanhui/OpenHGNN | 9c3b7e7a4bc9b3df38ee6dc7154f950340ceec20 | [
"Apache-2.0"
] | null | null | null | openhgnn/dataset/__init__.py | clearhanhui/OpenHGNN | 9c3b7e7a4bc9b3df38ee6dc7154f950340ceec20 | [
"Apache-2.0"
] | null | null | null | import importlib
from .base_dataset import BaseDataset
from .utils import load_acm, load_acm_raw
from .academic_graph import AcademicDataset
from .hgb_dataset import HGBDataset
from .ohgb_dataset import OHGBDataset
DATASET_REGISTRY = {}
def register_dataset(name):
"""
New dataset types can be added to cogdl... | 35.034884 | 122 | 0.649187 |
2dedf4a778d8f65be01d7faae6a2aafadb283373 | 1,474 | py | Python | src/get_dominant_color_test.py | justrypython/utils | bb02520599b7faa1d9bae6bc4a718d27404014cb | [
"MIT"
] | null | null | null | src/get_dominant_color_test.py | justrypython/utils | bb02520599b7faa1d9bae6bc4a718d27404014cb | [
"MIT"
] | null | null | null | src/get_dominant_color_test.py | justrypython/utils | bb02520599b7faa1d9bae6bc4a718d27404014cb | [
"MIT"
] | 1 | 2018-08-31T11:34:00.000Z | 2018-08-31T11:34:00.000Z | #encoding:UTF-8
import os
import cv2
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import unittest
from get_dominant_color import get_dominant_color
class GetDominantColorTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def t... | 28.901961 | 69 | 0.531208 |
4d4e7c6796387f96174680c87b49890e5db347cc | 3,633 | py | Python | src/lib/svnmailer/notifier/stdout.py | m-tmatma/svnmailer | faecefdabd8fbf6d40738a24004772020c244f64 | [
"Apache-2.0"
] | 1 | 2019-07-23T09:27:34.000Z | 2019-07-23T09:27:34.000Z | src/lib/svnmailer/notifier/stdout.py | m-tmatma/svnmailer | faecefdabd8fbf6d40738a24004772020c244f64 | [
"Apache-2.0"
] | null | null | null | src/lib/svnmailer/notifier/stdout.py | m-tmatma/svnmailer | faecefdabd8fbf6d40738a24004772020c244f64 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0201
# pylint-version = 0.7.0
#
# Copyright 2004-2005 André Malo or his licensors, as applicable
#
# 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... | 28.606299 | 74 | 0.609414 |
bc5c1cbba039470a38363b9d856a76bd7c21f440 | 790 | py | Python | profiles_project/profiles_api/migrations/0002_profilefeeditem.py | NicolefAvella/profiles-rest-api | 01b0459a083bd988198edd56b790df65e3bbc8d8 | [
"MIT"
] | 2 | 2019-07-28T17:15:38.000Z | 2019-07-28T17:15:39.000Z | profiles_project/profiles_api/migrations/0002_profilefeeditem.py | NicolefAvella/profiles-rest-api | 01b0459a083bd988198edd56b790df65e3bbc8d8 | [
"MIT"
] | 7 | 2019-12-04T23:46:57.000Z | 2022-02-10T08:01:55.000Z | profiles_project/profiles_api/migrations/0002_profilefeeditem.py | NicolefAvella/profiles-rest-api | 01b0459a083bd988198edd56b790df65e3bbc8d8 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-07-21 22:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 31.6 | 126 | 0.632911 |
d653440870a44bdc433fa49efc7a616e28af1600 | 4,339 | py | Python | ansible/roles/common/files/gather_data.py | hgahhja56465/vps-comparison | 3d6a8de01f440fb096ce356da5293d1f737c2235 | [
"MIT"
] | 1,513 | 2017-03-24T08:27:56.000Z | 2022-03-24T13:45:07.000Z | ansible/roles/common/files/gather_data.py | karm21/vps-comparison | 2fb7ff632348ab43357be6d4da1dca678d20d20d | [
"MIT"
] | 35 | 2017-04-21T15:17:39.000Z | 2021-11-09T01:19:28.000Z | ansible/roles/common/files/gather_data.py | karm21/vps-comparison | 2fb7ff632348ab43357be6d4da1dca678d20d20d | [
"MIT"
] | 96 | 2017-05-02T12:55:11.000Z | 2022-02-26T15:44:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Gather data from logs.
Gather data from the logs following certain criteria given by a json
file and finally putting the data in org-mode tables in a output file.
"""
__author__ = "joe di castro <joe@joedicastro.com>"
__license__ = "MIT"
__date__ = "2017-04-16"
__v... | 31.671533 | 76 | 0.580088 |
ac722b0f25e6b09ab0fe6156690f4f8d70d002da | 291 | py | Python | conrad/__init__.py | Saif807380/conrad | 3a2946cea1b85ec8d1681b28a97130033b7de61e | [
"Apache-2.0"
] | null | null | null | conrad/__init__.py | Saif807380/conrad | 3a2946cea1b85ec8d1681b28a97130033b7de61e | [
"Apache-2.0"
] | null | null | null | conrad/__init__.py | Saif807380/conrad | 3a2946cea1b85ec8d1681b28a97130033b7de61e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from .__version__ import __version__
USER_HOME = os.path.expanduser("~")
CONRAD_HOME = os.path.join(USER_HOME, ".conrad")
SQL_ALCHEMY_CONN = "sqlite:///{}/conrad.db".format(CONRAD_HOME)
if not os.path.exists(CONRAD_HOME):
os.makedirs(CONRAD_HOME)
| 19.4 | 63 | 0.71134 |
4df960e096e1c0d8e1386bb457796fb934ff6028 | 843 | py | Python | onnx_tf/handlers/backend/compress.py | golunovas/onnx-tensorflow | b6340b3e66aa08af1ea4382e98257c2098177371 | [
"Apache-2.0"
] | 18 | 2020-02-03T07:14:40.000Z | 2021-12-20T18:45:43.000Z | onnx_tf/handlers/backend/compress.py | golunovas/onnx-tensorflow | b6340b3e66aa08af1ea4382e98257c2098177371 | [
"Apache-2.0"
] | 11 | 2020-01-28T23:16:25.000Z | 2022-02-10T01:04:56.000Z | onnx_tf/handlers/backend/compress.py | golunovas/onnx-tensorflow | b6340b3e66aa08af1ea4382e98257c2098177371 | [
"Apache-2.0"
] | 2 | 2020-08-20T08:15:09.000Z | 2021-02-23T07:30:40.000Z | import copy
import tensorflow as tf
from onnx_tf.handlers.backend_handler import BackendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_func
@onnx_op("Compress")
@tf_func(tf.gather)
class Compress(BackendHandler):
@classmethod
def version_9(cls, node, **kwargs):
... | 29.068966 | 79 | 0.72242 |
963e6e2121cdb296b58fd78733c721e76cc4046e | 588 | py | Python | test/algorithms/pan_tompkins/pan_tompkins.py | Jeilef/qrs_compare | 092132e6febc9aa5557e0e70bced5febfac2a235 | [
"MIT"
] | 1 | 2021-03-10T15:12:10.000Z | 2021-03-10T15:12:10.000Z | test/algorithms/pan_tompkins/pan_tompkins.py | Jeilef/qrs_compare | 092132e6febc9aa5557e0e70bced5febfac2a235 | [
"MIT"
] | 6 | 2021-03-31T20:11:06.000Z | 2022-01-13T03:24:32.000Z | test/algorithms/pan_tompkins/pan_tompkins.py | Jeilef/qrs_compare | 092132e6febc9aa5557e0e70bced5febfac2a235 | [
"MIT"
] | null | null | null | import wfdb
from ecgdetectors import Detectors
import numpy as np
DATA_PATH = "/data/"
SAVE_PATH = "/pred/"
with open(DATA_PATH + "RECORDS", 'r') as f:
records = f.readlines()
records = list(map(lambda r: r.strip("\n"), records))
for record in records:
sig, fields = wfdb.rdsamp(DATA_PATH + record, channe... | 30.947368 | 101 | 0.663265 |
b28733fa8dfcb8f99002c9ef6fe99829b15a5378 | 767 | py | Python | tests/sources/test_git.py | paul-duffy/runway | a0c22eb7ca7b55df5317bdda92c08c4bb39569d2 | [
"Apache-2.0"
] | 1 | 2020-02-25T21:08:00.000Z | 2020-02-25T21:08:00.000Z | tests/sources/test_git.py | paul-duffy/runway | a0c22eb7ca7b55df5317bdda92c08c4bb39569d2 | [
"Apache-2.0"
] | 2 | 2020-01-07T15:00:55.000Z | 2020-01-07T15:03:25.000Z | tests/sources/test_git.py | voodooGQ/runway | 8a744f33b39f1342022f1b57db996bb843e4556c | [
"Apache-2.0"
] | null | null | null | """Tests for the Source type object."""
import logging
import unittest
from runway.sources.git import Git
LOGGER = logging.getLogger('runway')
class GitTester(unittest.TestCase):
"""Tests for the Source type object."""
def test_fetch_returns_directory_string(self):
"""Ensure a directory string is r... | 29.5 | 80 | 0.638853 |
83754c383c9d8616fa873063f2aefba1b4b85aa1 | 508 | py | Python | dataloader/create_data_loader.py | WiktorSa/Music-Generation-with-LSTM-and-.wav-files | 37b713b5e6193788a7710cc0fac4134efb74fa62 | [
"MIT"
] | 1 | 2022-03-09T20:13:57.000Z | 2022-03-09T20:13:57.000Z | dataloader/create_data_loader.py | WiktorSa/Music-Generation-with-LSTM-and-.wav-files | 37b713b5e6193788a7710cc0fac4134efb74fa62 | [
"MIT"
] | 1 | 2021-10-01T16:20:06.000Z | 2021-10-01T17:25:30.000Z | dataloader/create_data_loader.py | WiktorSa/Music-Generation-with-LSTM-and-.wav-files | 37b713b5e6193788a7710cc0fac4134efb74fa62 | [
"MIT"
] | null | null | null | import numpy as np
from torch.utils.data import DataLoader
from dataloader.music_dataset import MusicDataset
def get_data_loader(x: np.ndarray, y: np.ndarray, batch_size: int) -> DataLoader:
"""
Generate a DataLoader from a given data
:param x: input sequences
:param y: output sequences
:param ba... | 26.736842 | 81 | 0.722441 |
dc0fb85d6048962505d1d207ae590940d69f52e6 | 1,593 | py | Python | youtube_dl/extractor/abc.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 1 | 2015-02-19T13:13:47.000Z | 2015-02-19T13:13:47.000Z | youtube_dl/extractor/abc.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 2 | 2019-05-20T12:46:30.000Z | 2020-11-07T12:50:32.000Z | youtube_dl/extractor/abc.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 5 | 2020-10-25T09:18:58.000Z | 2021-05-23T22:57:55.000Z | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
class ABCIE(InfoExtractor):
IE_NAME = 'abc.net.au'
_VALID_URL = r'http://www\.abc\.net\.au/news/[^/]+/[^/]+/(?P<id>\d+)'
_TEST = {
'url': 'http://www.abc.net.au/news/2014-11-05/australia-to-staff-ebo... | 33.1875 | 121 | 0.576899 |
57c497172971a932961f4b31b4b5097da30ff147 | 631 | py | Python | desktop/core/ext-py/greenlet-0.3.1/tests/test_leaks.py | digideskio/hortonworks-sandbox | dd8e95c91faee3daa094707baeb94c3953b41efa | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | desktop/core/ext-py/greenlet-0.3.1/tests/test_leaks.py | digideskio/hortonworks-sandbox | dd8e95c91faee3daa094707baeb94c3953b41efa | [
"Apache-2.0"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | desktop/core/ext-py/greenlet-0.3.1/tests/test_leaks.py | hortonworks/hortonworks-sandbox | dd8e95c91faee3daa094707baeb94c3953b41efa | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | import unittest
import sys
import greenlet
class ArgRefcountTests(unittest.TestCase):
def test_arg_refs(self):
args = ('a', 'b', 'c')
g = greenlet.greenlet(
lambda *args: greenlet.getcurrent().parent.switch(*args))
for i in range(100):
g.switch(*args)
self.a... | 28.681818 | 75 | 0.600634 |
d279288ab730ce511643ca0579cda872da2295d4 | 8,551 | py | Python | tests/test_utility.py | TriPed-Robot/trip_kinematics | 1c20aaa40ce892bc3ec23d605925add4039f4744 | [
"MIT"
] | 13 | 2021-11-30T16:49:16.000Z | 2022-03-24T12:35:17.000Z | tests/test_utility.py | TriPed-Robot/trip_kinematics | 1c20aaa40ce892bc3ec23d605925add4039f4744 | [
"MIT"
] | 8 | 2021-11-18T16:38:48.000Z | 2022-03-24T15:46:02.000Z | tests/test_utility.py | TriPed-Robot/TriP | 1c20aaa40ce892bc3ec23d605925add4039f4744 | [
"MIT"
] | 4 | 2021-12-13T14:49:33.000Z | 2022-03-15T14:39:28.000Z | import unittest
import numpy as np
from trip_kinematics.Utility import Rotation as R
class TestStates(unittest.TestCase):
"""Correct results were generated using scipy.spatial.transform.Rotation.
"""
def test_from_euler_to_quat(self):
from_euler_cases = [
([1, 2, 3],
... | 58.972414 | 101 | 0.565782 |
bca113bcb774a4a6a02e75af5620d999ac826203 | 1,207 | py | Python | setup.py | migacollabs/factsbeach | ff7d6e4ddaa7f876ceef880e29f9eb43ce120768 | [
"MIT"
] | null | null | null | setup.py | migacollabs/factsbeach | ff7d6e4ddaa7f876ceef880e29f9eb43ce120768 | [
"MIT"
] | null | null | null | setup.py | migacollabs/factsbeach | ff7d6e4ddaa7f876ceef880e29f9eb43ce120768 | [
"MIT"
] | null | null | null | import os
import factsbeach
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = []
with open('requirements.txt') as f:
requires = f.read().splitlin... | 28.069767 | 63 | 0.584093 |
1557b865384d362d705d70213d7bca369bdfea8e | 597 | py | Python | chap04/char_picture_grid.py | asadmoosvi/automate-the-boring-stuff-solutions | 36c9fdf6706db64338e075a3367c4493bb62960f | [
"MIT"
] | null | null | null | chap04/char_picture_grid.py | asadmoosvi/automate-the-boring-stuff-solutions | 36c9fdf6706db64338e075a3367c4493bb62960f | [
"MIT"
] | null | null | null | chap04/char_picture_grid.py | asadmoosvi/automate-the-boring-stuff-solutions | 36c9fdf6706db64338e075a3367c4493bb62960f | [
"MIT"
] | null | null | null | import sys
def main() -> int:
grid = [
['.', '.', '.', '.', '.', '.'],
['.', 'O', 'O', '.', '.', '.'],
['O', 'O', 'O', 'O', '.', '.'],
['O', 'O', 'O', 'O', 'O', '.'],
['.', 'O', 'O', 'O', 'O', 'O'],
['O', 'O', 'O', 'O', 'O', '.'],
['O', 'O', 'O', 'O', '.', '.... | 23.88 | 39 | 0.237856 |
203ef7479ad245207ef9c53ebed31d910c04bbe3 | 249 | py | Python | beyondtheadmin/utils/model_utils.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | 1 | 2021-11-27T06:40:34.000Z | 2021-11-27T06:40:34.000Z | beyondtheadmin/utils/model_utils.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | 2 | 2021-05-13T04:50:50.000Z | 2022-02-28T21:06:24.000Z | beyondtheadmin/utils/model_utils.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
from model_utils.models import TimeStampedModel
class UUIDModel(TimeStampedModel):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
class Meta:
abstract = True
| 19.153846 | 79 | 0.759036 |
f9de16f754ed056beb75e06042c9836513257e9a | 7,073 | py | Python | sdk/python/pulumi_azure/network/public_ip_prefix.py | davidobrien1985/pulumi-azure | 811beeea473bd798d77354521266a87a2fac5888 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/network/public_ip_prefix.py | davidobrien1985/pulumi-azure | 811beeea473bd798d77354521266a87a2fac5888 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/network/public_ip_prefix.py | davidobrien1985/pulumi-azure | 811beeea473bd798d77354521266a87a2fac5888 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Public... | 53.992366 | 255 | 0.689806 |
90858584433a2c8afbc52c03a8ad508f73506461 | 321 | py | Python | dataent/patches/v10_0/enable_chat_by_default_within_system_settings.py | dataent/dataent | c41bd5942ffe5513f4d921c4c0595c84bbc422b4 | [
"MIT"
] | null | null | null | dataent/patches/v10_0/enable_chat_by_default_within_system_settings.py | dataent/dataent | c41bd5942ffe5513f4d921c4c0595c84bbc422b4 | [
"MIT"
] | 6 | 2020-03-24T17:15:56.000Z | 2022-02-10T18:41:31.000Z | dataent/patches/v10_0/enable_chat_by_default_within_system_settings.py | dataent/dataent | c41bd5942ffe5513f4d921c4c0595c84bbc422b4 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import dataent
def execute():
dataent.reload_doctype('System Settings')
doc = dataent.get_single('System Settings')
doc.enable_chat = 1
# Changes prescribed by Nabin Hait (nabin@epaas.xyz)
doc.flags.ignore_mandatory = True
doc.flags.ignore_permissions = True
doc.save(... | 24.692308 | 53 | 0.775701 |
bedf33b41e91389e1709d0e3f79f3bfae03ddea1 | 259 | py | Python | cakechat/utils/offense_detector/config.py | timmoti/cakechat | 97f14e3f12c92edb30ed385fe93e7e3944bcd298 | [
"Apache-2.0"
] | 1 | 2018-05-15T09:18:19.000Z | 2018-05-15T09:18:19.000Z | cakechat/utils/offense_detector/config.py | hooram/cakechat | 92b0957329738b9480f36f62d63876ed758208c5 | [
"Apache-2.0"
] | 64 | 2019-07-05T06:06:43.000Z | 2021-08-02T05:22:31.000Z | cakechat/utils/offense_detector/config.py | timmoti/cakechat | 97f14e3f12c92edb30ed385fe93e7e3944bcd298 | [
"Apache-2.0"
] | 1 | 2018-10-14T04:14:41.000Z | 2018-10-14T04:14:41.000Z | import os
import pkg_resources
import cakechat.utils.offense_detector
OFFENSIVE_PHRASES_PATH = pkg_resources.resource_filename(cakechat.utils.offense_detector.__name__,
'/data/offensive_phrases.csv')
| 32.375 | 98 | 0.675676 |
af5edd6bab292ed29114635a4854e2ed27c78bed | 4,351 | py | Python | spyder/preferences/tests/conftest.py | scottwedge/spyder | e1afd4c78a4572a0ac1992dc2d134dfaf4b4d804 | [
"MIT"
] | null | null | null | spyder/preferences/tests/conftest.py | scottwedge/spyder | e1afd4c78a4572a0ac1992dc2d134dfaf4b4d804 | [
"MIT"
] | null | null | null | spyder/preferences/tests/conftest.py | scottwedge/spyder | e1afd4c78a4572a0ac1992dc2d134dfaf4b4d804 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright © Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# ----------------------------------------------------------------------------
"""
Testing utilities to be used with pytest.
"... | 31.992647 | 78 | 0.614571 |
7fc9863e61e72c88543df3fc3bdcd5df1d3becc8 | 19,381 | py | Python | src/auspex/qubit/optimizer.py | BBN-Q/Auspex | e9763e1907546ad49210415a6b8c2f6d9999f31a | [
"Apache-2.0"
] | 30 | 2016-11-13T18:22:21.000Z | 2021-12-21T21:51:46.000Z | src/auspex/qubit/optimizer.py | BBN-Q/Auspex | e9763e1907546ad49210415a6b8c2f6d9999f31a | [
"Apache-2.0"
] | 237 | 2016-12-01T18:40:44.000Z | 2021-04-29T16:07:06.000Z | src/auspex/qubit/optimizer.py | BBN-Q/Auspex | e9763e1907546ad49210415a6b8c2f6d9999f31a | [
"Apache-2.0"
] | 12 | 2016-11-13T18:22:42.000Z | 2021-03-20T03:23:18.000Z | # Copyright 2020 Raytheon BBN Technologies
#
# 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
try:
from QGL import *
from QGL import co... | 38.60757 | 106 | 0.582787 |
4cbadc040fd6b3791c255c42d7821fa29d3c4381 | 5,721 | py | Python | trapy/trial.py | niklasmichel/trapy | 4e95edef0b0271e683b128cc66d6ce78546f63a4 | [
"MIT"
] | 2 | 2020-05-26T12:59:09.000Z | 2020-06-15T18:40:28.000Z | trapy/trial.py | niklasmichel/trapy | 4e95edef0b0271e683b128cc66d6ce78546f63a4 | [
"MIT"
] | null | null | null | trapy/trial.py | niklasmichel/trapy | 4e95edef0b0271e683b128cc66d6ce78546f63a4 | [
"MIT"
] | null | null | null | import ntpath
import pandas as pd
import numpy as np
from sklearn import metrics
import math
class Trial:
"""Class to hold all relevant info of a single tape response assay trial."""
def __init__(self, path_to_file):
self.path_to_file = path_to_file
self.trial_name = ntpath.basename(path_to_fi... | 35.534161 | 115 | 0.652508 |
440b2874535071346c0ec1820f20b17d13cee0b9 | 989 | py | Python | datahub/search/export_country_history/models.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 6 | 2019-12-02T16:11:24.000Z | 2022-03-18T10:02:02.000Z | datahub/search/export_country_history/models.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 1,696 | 2019-10-31T14:08:37.000Z | 2022-03-29T12:35:57.000Z | datahub/search/export_country_history/models.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 9 | 2019-11-22T12:42:03.000Z | 2021-09-03T14:25:05.000Z | from elasticsearch_dsl import Date, Keyword
from datahub.search import dict_utils, fields
from datahub.search.models import BaseESModel
class ExportCountryHistory(BaseESModel):
"""Elasticsearch representation of CompanyExportCountryHistory model."""
id = Keyword()
history_date = Date(index=False)
hi... | 30.90625 | 80 | 0.714863 |
d8f881ab74317917e39cc848696466dedba77ae2 | 4,351 | py | Python | ultracart/models/item_auto_order_step_grandfather_pricing.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | 1 | 2018-03-15T16:56:23.000Z | 2018-03-15T16:56:23.000Z | ultracart/models/item_auto_order_step_grandfather_pricing.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | ultracart/models/item_auto_order_step_grandfather_pricing.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ItemAutoOrderStepGrandfa... | 29.80137 | 114 | 0.605608 |
e24d974f24319b60d8aac1813514d321bac45770 | 617 | py | Python | tests/test_core/test_end2end_vis.py | xyzhu8/mmocr | f62b4513f5411bde9f24e1902b1cb1945340022a | [
"Apache-2.0"
] | 206 | 2021-07-30T09:04:08.000Z | 2022-03-22T00:57:44.000Z | tests/test_core/test_end2end_vis.py | zezeze97/image2latex | c745667cd1af91dbff2385dcf2f2b80b9a40adb6 | [
"Apache-2.0"
] | 39 | 2021-08-05T07:16:46.000Z | 2022-03-14T13:23:48.000Z | tests/test_core/test_end2end_vis.py | zezeze97/image2latex | c745667cd1af91dbff2385dcf2f2b80b9a40adb6 | [
"Apache-2.0"
] | 61 | 2021-07-30T07:51:41.000Z | 2022-03-30T14:40:02.000Z | import numpy as np
from mmocr.core import det_recog_show_result
def test_det_recog_show_result():
img = np.ones((100, 100, 3), dtype=np.uint8) * 255
det_recog_res = {
'result': [{
'box': [51, 88, 51, 62, 85, 62, 85, 88],
'box_score': 0.9417,
'text': 'hell',
... | 24.68 | 55 | 0.585089 |
ffb47a81338e0522e2b2361d40c14e0479cfd756 | 11,237 | py | Python | tests/defer_regress/tests.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | 1 | 2015-06-14T07:55:29.000Z | 2015-06-14T07:55:29.000Z | tests/defer_regress/tests.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | null | null | null | tests/defer_regress/tests.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.backends.db import SessionStore
from django.db.models import Count
from django.db.models.loading import cache
from django.test import TestCase
from django.tes... | 43.05364 | 97 | 0.647059 |
6e966ee60f1742e46fe8a3660fc5f0696a9e4fa7 | 4,426 | py | Python | tests/test_bwa_indexer.py | Multiscale-Genomics/mg-process-fastq | 50c7115c0c1a6af48dc34f275e469d1b9eb02999 | [
"Apache-2.0"
] | 2 | 2017-07-31T11:45:46.000Z | 2017-08-09T09:32:35.000Z | tests/test_bwa_indexer.py | Multiscale-Genomics/mg-process-fastq | 50c7115c0c1a6af48dc34f275e469d1b9eb02999 | [
"Apache-2.0"
] | 28 | 2016-11-17T11:12:32.000Z | 2018-11-02T14:09:13.000Z | tests/test_bwa_indexer.py | Multiscale-Genomics/mg-process-fastq | 50c7115c0c1a6af48dc34f275e469d1b9eb02999 | [
"Apache-2.0"
] | 4 | 2017-02-12T17:47:21.000Z | 2018-05-29T08:16:27.000Z | """
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | 28.012658 | 98 | 0.669227 |
b8a7ea5368937f41f885ae2b0757033fcc67edcd | 2,809 | py | Python | versions/-D/cytron.py | passemblage/I-python-Public | 4bc8c5ef3f2b0c0528d564010b9677fd537d3005 | [
"MIT"
] | 3 | 2021-07-15T22:30:34.000Z | 2021-08-23T14:36:22.000Z | versions/-D/cytron.py | passemblage/I-python-Public | 4bc8c5ef3f2b0c0528d564010b9677fd537d3005 | [
"MIT"
] | null | null | null | versions/-D/cytron.py | passemblage/I-python-Public | 4bc8c5ef3f2b0c0528d564010b9677fd537d3005 | [
"MIT"
] | null | null | null | import os, sys
from urllib.request import urlopen
from _thread import start_new_thread
global cy_path_v, version, console_o
version = "cytron 4"
console_o = 0
cy_path_v = os.path.dirname(sys.argv[0])
def cy_console_print():
if console_o == 0:
start_new_thread(console,())
def cy_version():
return(ve... | 27.009615 | 63 | 0.513706 |
c09599218a0658a5b8633db08700e6e67ff63236 | 431 | py | Python | python/aoc2020-day01.py | daniel5gh/AdventOfCode2021 | b3b39bc21ba3f2449228391b84ebbb174b062b54 | [
"MIT"
] | null | null | null | python/aoc2020-day01.py | daniel5gh/AdventOfCode2021 | b3b39bc21ba3f2449228391b84ebbb174b062b54 | [
"MIT"
] | null | null | null | python/aoc2020-day01.py | daniel5gh/AdventOfCode2021 | b3b39bc21ba3f2449228391b84ebbb174b062b54 | [
"MIT"
] | null | null | null | import itertools
import common
__author__ = 'Daniël'
input = list(map(int, common.read_input('01', 2020)))
def part1():
for x, y in itertools.permutations(input, r=2):
if x+y == 2020:
print(x*y)
break
def part2():
for x, y, z in itertools.permutations(input, r=3):
i... | 16.576923 | 54 | 0.549884 |
797841946f9c26071c8fafc603b113502d16eed8 | 1,760 | py | Python | folium/plugins/scroll_zoom_toggler.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | 1 | 2022-03-11T00:37:00.000Z | 2022-03-11T00:37:00.000Z | folium/plugins/scroll_zoom_toggler.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | null | null | null | folium/plugins/scroll_zoom_toggler.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | null | null | null | from branca.element import MacroElement
from jinja2 import Template
class ScrollZoomToggler(MacroElement):
"""Creates a button for enabling/disabling scroll on the Map."""
_template = Template("""
{% macro header(this,kwargs) %}
<style>
#{{ this.get_name() }} {
... | 33.207547 | 99 | 0.471023 |
684daf03017af21543fe896b7dfae6de6f5fea23 | 1,119 | py | Python | examples/ch02/snippets_py/02_02selfcheck.py | edson-gomes/Intro-to-Python | 00a2f549916616b0f2036401573e35d66317f998 | [
"MIT"
] | null | null | null | examples/ch02/snippets_py/02_02selfcheck.py | edson-gomes/Intro-to-Python | 00a2f549916616b0f2036401573e35d66317f998 | [
"MIT"
] | null | null | null | examples/ch02/snippets_py/02_02selfcheck.py | edson-gomes/Intro-to-Python | 00a2f549916616b0f2036401573e35d66317f998 | [
"MIT"
] | null | null | null | # Section 2.2 Self Check snippets
total = 10.7 + 12.2 + 0.2
total
##########################################################################
# (C) Copyright 2019 by Deitel & Associates, Inc. and #
# Pearson Education, Inc. All Rights Reserved. #
# ... | 53.285714 | 74 | 0.529044 |
2e5f180ac0a0847bb1b77960381bee814b572960 | 3,807 | py | Python | refinery/units/pattern/urlguards.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | refinery/units/pattern/urlguards.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | refinery/units/pattern/urlguards.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import re
from base64 import urlsafe_b64decode
from functools import wraps
from html import unescape
from urllib.parse import unquote, urlparse, parse_qs
from .. import Unit
from ...lib.decorators import unicoded
def unguard(pattern, flags=re.IGNORECASE):
def decorator(method):
@w... | 31.991597 | 128 | 0.532178 |
06f441c803acd8b9a688a5faa7b02d00294e41b1 | 2,598 | py | Python | Protocols/vc_protocols_for_myokit.py | sjk0709/Electrophysiology | d7d9eb9e8ee787ed9b3d675afb85456b3f340357 | [
"MIT"
] | null | null | null | Protocols/vc_protocols_for_myokit.py | sjk0709/Electrophysiology | d7d9eb9e8ee787ed9b3d675afb85456b3f340357 | [
"MIT"
] | 5 | 2022-02-15T00:07:02.000Z | 2022-03-28T02:42:50.000Z | Protocols/vc_protocols_for_myokit.py | hannania7/Electrophysiology | b5a8643e21f4204a96e82d81671a6d52948fab48 | [
"MIT"
] | null | null | null | """Contains protocols to act in silico to probe cellular mechanics."""
import bisect
from typing import List, Union
import random
from math import floor
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import myokit
import protocol_lib
def leak_staircase(model, return_capmask=False):
# My 't... | 30.564706 | 78 | 0.529638 |
b0aa68fcabe9b2447cb0ab285ccaf36fcdc4d259 | 3,268 | py | Python | blog_project/settings.py | masonrybits/blog-api | e60a344c460bbc162d8e54b28e1adedbe2a9f490 | [
"MIT"
] | null | null | null | blog_project/settings.py | masonrybits/blog-api | e60a344c460bbc162d8e54b28e1adedbe2a9f490 | [
"MIT"
] | 3 | 2020-06-05T20:53:02.000Z | 2021-04-08T19:21:26.000Z | blog_project/settings.py | masonrybits/blog-api | e60a344c460bbc162d8e54b28e1adedbe2a9f490 | [
"MIT"
] | null | null | null | """
Django settings for blog_project project.
Generated by 'django-admin startproject' using Django 3.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import ... | 25.53125 | 91 | 0.696144 |
0a32e23b5389e30ae89ae88a6caace225892c880 | 1,969 | py | Python | contrib/opencensus-ext-sqlalchemy/setup.py | m2p-consulting/opencensus-python | 0aa552510aee63b01d497c728b66f75a5eef4de9 | [
"Apache-2.0"
] | null | null | null | contrib/opencensus-ext-sqlalchemy/setup.py | m2p-consulting/opencensus-python | 0aa552510aee63b01d497c728b66f75a5eef4de9 | [
"Apache-2.0"
] | null | null | null | contrib/opencensus-ext-sqlalchemy/setup.py | m2p-consulting/opencensus-python | 0aa552510aee63b01d497c728b66f75a5eef4de9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 37.865385 | 130 | 0.678009 |
c65cf7af142bcb405ca8a640cd7e1a10f110861c | 746 | py | Python | malcolm/parts/pandabox/pandaboxgrouppart.py | dls-controls/github-publish-test | 25f6ce1af28eff9930f65e4f2c9fb0474e0b570c | [
"Apache-2.0"
] | null | null | null | malcolm/parts/pandabox/pandaboxgrouppart.py | dls-controls/github-publish-test | 25f6ce1af28eff9930f65e4f2c9fb0474e0b570c | [
"Apache-2.0"
] | null | null | null | malcolm/parts/pandabox/pandaboxgrouppart.py | dls-controls/github-publish-test | 25f6ce1af28eff9930f65e4f2c9fb0474e0b570c | [
"Apache-2.0"
] | null | null | null | from malcolm.core import Part, Attribute
from malcolm.core.vmetas import ChoiceMeta
class PandABoxGroupPart(Part):
"""This will normally be instantiated by the PandABox assembly, not created
in yaml"""
def __init__(self, process, attr_name):
super(PandABoxGroupPart, self).__init__(process)
... | 33.909091 | 79 | 0.646113 |
1302a83171acc024193bd5e6ab4980aaf63f6ef0 | 4,653 | py | Python | api/urlparser.py | dpgd/utils | bb5d8477f5ea449d1c0072149aaec63456780394 | [
"Apache-2.0"
] | null | null | null | api/urlparser.py | dpgd/utils | bb5d8477f5ea449d1c0072149aaec63456780394 | [
"Apache-2.0"
] | null | null | null | api/urlparser.py | dpgd/utils | bb5d8477f5ea449d1c0072149aaec63456780394 | [
"Apache-2.0"
] | null | null | null | import re
from fieldsvalidator import FieldsValidator
class URLParser(object):
def get_query(self, request, *args, **kwargs):
parameters = self.check_url(request, self.model)
error = FieldsValidator.validation_parameter(
parameters["filter"]["query_data"],
self.model)
... | 36.928571 | 79 | 0.521599 |
24d278d19884af0384ddfa7962ce9ca81904c3e7 | 10,454 | py | Python | tests/unit/utils/schedule_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/schedule_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/schedule_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import python libs
from __future__ import absolute_import
import os
import copy
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON
fr... | 36.425087 | 111 | 0.609814 |
3241e5d0969469dd3cfc353531c3323b5eaa0ac8 | 678 | py | Python | manage.py | OmerCS8/PythonDjangoTutorial | 1f929690c36a7f95c90c13dda0379c08a436ccb1 | [
"MIT"
] | null | null | null | manage.py | OmerCS8/PythonDjangoTutorial | 1f929690c36a7f95c90c13dda0379c08a436ccb1 | [
"MIT"
] | null | null | null | manage.py | OmerCS8/PythonDjangoTutorial | 1f929690c36a7f95c90c13dda0379c08a436ccb1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'python_django_tutorial.settings')
try:
from django.core.management import execute_from_command_line
... | 29.478261 | 86 | 0.685841 |
9f4bf1c462bfb1305bee360c6879658e7afcbab7 | 10,380 | py | Python | tests/unit/ssg-module/test_build_yaml.py | deperrone/content | caaff27f01a1d6c15da461f9fafe26090e8fdd18 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/ssg-module/test_build_yaml.py | deperrone/content | caaff27f01a1d6c15da461f9fafe26090e8fdd18 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/ssg-module/test_build_yaml.py | deperrone/content | caaff27f01a1d6c15da461f9fafe26090e8fdd18 | [
"BSD-3-Clause"
] | null | null | null | import os
import tempfile
import yaml
import pytest
import xml.etree.ElementTree as ET
from ssg.build_cpe import ProductCPEs
import ssg.build_yaml
from ssg.constants import cpe_language_namespace
from ssg.yaml import open_raw
PROJECT_ROOT = os.path.join(os.path.dirname(__file__), "..", "..", "..", )
DATADIR = os.pa... | 39.467681 | 219 | 0.679191 |
61ef12db2f10f37a071d78ac5bb98d70656246d9 | 616 | py | Python | dubhe_sdk/param/predict_param.py | hathawayhh/dubhe-sdk | 5f450e9a6857ce9c39980bc22e9df347a9a7531c | [
"MIT"
] | 1 | 2022-02-22T02:12:56.000Z | 2022-02-22T02:12:56.000Z | dubhe_sdk/param/predict_param.py | hathawayhh/dubhe-sdk | 5f450e9a6857ce9c39980bc22e9df347a9a7531c | [
"MIT"
] | null | null | null | dubhe_sdk/param/predict_param.py | hathawayhh/dubhe-sdk | 5f450e9a6857ce9c39980bc22e9df347a9a7531c | [
"MIT"
] | null | null | null | from dubhe_sdk.param.base_param import BaseParam
from dubhe_sdk.config import *
class PredictParam(BaseParam):
# 请求类型:1.离线预测 2.离线评估 3.在线推理
req_type = 2
# 实例ID
instance_id = INSTANCE_ID
# 多个数据集路径
data_paths = []
# 模型文件路径
model_path = model_path
# 依赖其他模型路径
rely_model_data = RELY_... | 22.814815 | 55 | 0.641234 |
2c25edef33b462d1ac2abfd39a32c60e0005fd0f | 1,172 | py | Python | tfx/v1/extensions/google_cloud_ai_platform/experimental/__init__.py | TimoKerr/tfx | 10d13d57eeac21514fed73118cb43464dada67f1 | [
"Apache-2.0"
] | 1 | 2021-05-10T10:41:06.000Z | 2021-05-10T10:41:06.000Z | tfx/v1/extensions/google_cloud_ai_platform/experimental/__init__.py | TimoKerr/tfx | 10d13d57eeac21514fed73118cb43464dada67f1 | [
"Apache-2.0"
] | null | null | null | tfx/v1/extensions/google_cloud_ai_platform/experimental/__init__.py | TimoKerr/tfx | 10d13d57eeac21514fed73118cb43464dada67f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 55.809524 | 125 | 0.826792 |
9dd9328b810dac3452911083a7edd9eb263b7b62 | 1,524 | py | Python | netbox/ipam/constants.py | TheFlyingCorpse/netbox | a226f06b1beb575011d783b202d76cb74d3b1f79 | [
"Apache-2.0"
] | 4,994 | 2019-07-01T13:15:44.000Z | 2022-03-31T19:55:45.000Z | netbox/ipam/constants.py | emersonfelipesp/netbox | fecca5ad83fb6b48a2f15982dfd3242653f105f9 | [
"Apache-2.0"
] | 4,045 | 2019-07-01T14:24:09.000Z | 2022-03-31T16:07:39.000Z | netbox/ipam/constants.py | emersonfelipesp/netbox | fecca5ad83fb6b48a2f15982dfd3242653f105f9 | [
"Apache-2.0"
] | 1,225 | 2019-07-01T15:34:03.000Z | 2022-03-31T16:47:09.000Z | from django.db.models import Q
from .choices import IPAddressRoleChoices
# BGP ASN bounds
BGP_ASN_MIN = 1
BGP_ASN_MAX = 2**32 - 1
#
# VRFs
#
# Per RFC 4364 section 4.2, a route distinguisher may be encoded as one of the following:
# * Type 0 (16-bit AS number : 32-bit integer)
# * Type 1 (32-bit IPv4 address :... | 20.32 | 98 | 0.733596 |
aea7e11df882890e59e3c8ddd11b84ddd3bfcd00 | 10,481 | py | Python | docs/source/conf.py | jduan/dropwizard | 79e73d87dd104c3160c65dadca572e7c775694a0 | [
"Apache-2.0"
] | 2 | 2020-04-21T04:12:41.000Z | 2020-04-21T04:12:44.000Z | docs/source/conf.py | jduan/dropwizard | 79e73d87dd104c3160c65dadca572e7c775694a0 | [
"Apache-2.0"
] | 247 | 2021-01-20T06:57:10.000Z | 2022-03-29T16:09:50.000Z | docs/source/conf.py | jduan/dropwizard | 79e73d87dd104c3160c65dadca572e7c775694a0 | [
"Apache-2.0"
] | 2 | 2021-06-21T08:38:12.000Z | 2021-06-21T08:42:04.000Z | # -*- coding: utf-8 -*-
#
# Dropwizard documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 13 11:29:49 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | 30.556851 | 80 | 0.700029 |
36e9ea1022907cafb96f600948422a8bdd092fb1 | 7,821 | py | Python | wilds/datasets/yelp_dataset.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 355 | 2020-12-12T03:29:28.000Z | 2022-03-31T22:47:29.000Z | wilds/datasets/yelp_dataset.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 34 | 2020-12-24T11:50:51.000Z | 2022-03-18T00:06:38.000Z | wilds/datasets/yelp_dataset.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 87 | 2020-12-16T08:13:21.000Z | 2022-03-24T17:00:17.000Z | import os, csv
import torch
import pandas as pd
import numpy as np
from wilds.datasets.wilds_dataset import WILDSDataset
from wilds.common.utils import map_to_id_array
from wilds.common.metrics.all_metrics import Accuracy
from wilds.common.grouper import CombinatorialGrouper
NOT_IN_DATASET = -1
class YelpD... | 45.736842 | 152 | 0.606828 |
130c8b5e3cd8c6b5893a8eef3787191e641a5a9e | 917 | py | Python | onnx/backend/test/case/node/swish.py | HemaSowjanyaMamidi/onnx | a396446b776ef491e5f814ffa5b1f19dc2917e23 | [
"Apache-2.0"
] | null | null | null | onnx/backend/test/case/node/swish.py | HemaSowjanyaMamidi/onnx | a396446b776ef491e5f814ffa5b1f19dc2917e23 | [
"Apache-2.0"
] | null | null | null | onnx/backend/test/case/node/swish.py | HemaSowjanyaMamidi/onnx | a396446b776ef491e5f814ffa5b1f19dc2917e23 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class Swish(Base):
@staticmetho... | 26.970588 | 101 | 0.585605 |
9e5fe192233275fd10b04b86c6d080e3f8de8171 | 15,158 | py | Python | prody/dynamics/nma.py | grandevelia/ProDy | 7c725640a94c16543423c0756388998cb86a97ae | [
"MIT"
] | 210 | 2015-01-26T08:17:56.000Z | 2022-03-30T01:40:34.000Z | prody/dynamics/nma.py | grandevelia/ProDy | 7c725640a94c16543423c0756388998cb86a97ae | [
"MIT"
] | 555 | 2015-01-05T21:51:54.000Z | 2022-03-31T16:51:41.000Z | prody/dynamics/nma.py | grandevelia/ProDy | 7c725640a94c16543423c0756388998cb86a97ae | [
"MIT"
] | 99 | 2015-02-09T18:00:39.000Z | 2022-03-07T12:52:51.000Z | # -*- coding: utf-8 -*-
"""This module defines a class handling normal mode analysis data."""
import numpy as np
from .mode import Mode
from .modeset import ModeSet
from prody import PY2K, LOGGER
from prody.utilities import isListLike
if PY2K:
range = xrange
__all__ = ['NMA', 'MaskedNMA']
class NMA(object):
... | 32.251064 | 136 | 0.54684 |
3ea6e65561ec74b0f1a6ec48f0ae85613cd613c3 | 871 | py | Python | gpaw/setup/siteconfig-mahti-mt.py | mlouhivu/build-recipes | 7d031ab7b499a3190771e197742e36e8ebc78456 | [
"MIT"
] | 2 | 2019-07-25T11:55:02.000Z | 2020-01-22T10:32:34.000Z | gpaw/setup/siteconfig-mahti-mt.py | mlouhivu/build-recipes | 7d031ab7b499a3190771e197742e36e8ebc78456 | [
"MIT"
] | null | null | null | gpaw/setup/siteconfig-mahti-mt.py | mlouhivu/build-recipes | 7d031ab7b499a3190771e197742e36e8ebc78456 | [
"MIT"
] | 1 | 2020-05-28T11:35:10.000Z | 2020-05-28T11:35:10.000Z | # Custom GPAW setup for Mahti (Bull Sequana XH2000)
import os
parallel_python_interpreter = True
# compiler and linker
compiler = os.environ['CC']
mpicompiler = 'mpicc'
mpilinker = 'mpicc'
extra_compile_args = ['-std=c99', '-O3', '-fopenmp', '-fopenmp-simd',
'-march=native', '-mtune=native', '-ma... | 24.885714 | 69 | 0.67279 |
18ecc29f3bb5b671fc78e1451a21f2635694244f | 807 | py | Python | migrations/versions/f044b3b6edc5_adds_subscription_tables_visibility.py | manuchis/goodplaceindex | 6e83f2f9b87aaf4f0ccfd7186405f8d527e6b26b | [
"MIT"
] | 1 | 2019-06-12T10:45:25.000Z | 2019-06-12T10:45:25.000Z | migrations/versions/f044b3b6edc5_adds_subscription_tables_visibility.py | manuchis/goodplaceindex | 6e83f2f9b87aaf4f0ccfd7186405f8d527e6b26b | [
"MIT"
] | null | null | null | migrations/versions/f044b3b6edc5_adds_subscription_tables_visibility.py | manuchis/goodplaceindex | 6e83f2f9b87aaf4f0ccfd7186405f8d527e6b26b | [
"MIT"
] | null | null | null | """adds subscription tables visibility
Revision ID: f044b3b6edc5
Revises: 85ba1a1011c9
Create Date: 2019-04-16 16:07:42.902720
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f044b3b6edc5'
down_revision = '85ba1a1011c9'
branch_labels = None
depends_on = None
... | 26.032258 | 83 | 0.698885 |
79b476781fb717c43e7f7925ed56afc12484ab4d | 1,017 | py | Python | unittest/scripts/auto/py_shell/scripts/shell_cli_integration_norecord.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 119 | 2016-04-14T14:16:22.000Z | 2022-03-08T20:24:38.000Z | unittest/scripts/auto/py_shell/scripts/shell_cli_integration_norecord.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 9 | 2017-04-26T20:48:42.000Z | 2021-09-07T01:52:44.000Z | unittest/scripts/auto/py_shell/scripts/shell_cli_integration_norecord.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 51 | 2016-07-20T05:06:48.000Z | 2022-03-09T01:20:53.000Z | #@ utils CLI calls
rc = testutil.call_mysqlsh(["--", "util", "check-for-server-upgrade"], "", ["MYSQLSH_TERM_COLOR_MODE=nocolor"])
rc = testutil.call_mysqlsh(["--", "util", "check-for-server-upgrade", "--outputFormat=whatever"], "", ["MYSQLSH_TERM_COLOR_MODE=nocolor"])
rc = testutil.call_mysqlsh(["--", "util", "check-f... | 59.823529 | 138 | 0.679449 |
c84a41955d0b078ab2b9d918c975be20685a3d88 | 1,775 | py | Python | csp/extensions/__init__.py | dannyrohde/django-csp | 34a858d4f058341c097702c9a1e7ba46ebfbbf3e | [
"BSD-3-Clause"
] | 385 | 2015-01-22T21:33:12.000Z | 2022-03-29T12:51:06.000Z | csp/extensions/__init__.py | dannyrohde/django-csp | 34a858d4f058341c097702c9a1e7ba46ebfbbf3e | [
"BSD-3-Clause"
] | 115 | 2015-10-19T08:25:35.000Z | 2021-12-16T10:45:58.000Z | csp/extensions/__init__.py | dannyrohde/django-csp | 34a858d4f058341c097702c9a1e7ba46ebfbbf3e | [
"BSD-3-Clause"
] | 79 | 2015-03-31T11:43:17.000Z | 2022-03-05T03:59:57.000Z | from __future__ import absolute_import
from jinja2 import nodes
from jinja2.ext import Extension
from csp.utils import SCRIPT_ATTRS, build_script_tag
class NoncedScript(Extension):
# a set of names that trigger the extension.
tags = set(['script'])
def parse(self, parser):
# the first token is ... | 37.765957 | 76 | 0.651831 |
9c302af06746fd6098b1024c6ee0353e604bdc1b | 2,340 | py | Python | trainer/craft/data/imgproc.py | ishine/EasyOCR | ab7cebb64482e5e50ee7a37fa50398b8cb7481c7 | [
"Apache-2.0"
] | 56 | 2020-03-15T01:43:40.000Z | 2020-04-15T01:42:53.000Z | trainer/craft/data/imgproc.py | ishine/EasyOCR | ab7cebb64482e5e50ee7a37fa50398b8cb7481c7 | [
"Apache-2.0"
] | 3 | 2020-03-19T02:45:17.000Z | 2020-03-29T23:19:11.000Z | trainer/craft/data/imgproc.py | ishine/EasyOCR | ab7cebb64482e5e50ee7a37fa50398b8cb7481c7 | [
"Apache-2.0"
] | 13 | 2020-03-16T09:35:03.000Z | 2020-04-11T07:45:37.000Z | """
Copyright (c) 2019-present NAVER Corp.
MIT License
"""
# -*- coding: utf-8 -*-
import numpy as np
import cv2
from skimage import io
def loadImage(img_file):
img = io.imread(img_file) # RGB order
if img.shape[0] == 2:
img = img[0]
if len(img.shape) == 2:
img = cv2.cvtColor(img, cv2... | 25.434783 | 77 | 0.620513 |
f64e398f342a45b7d1670ad335ef32ed8ac0f2a5 | 1,223 | py | Python | coursesical/__main__.py | cdfmlr/coursesical | d027db60dca6bcf543a74d3a6dd635fd8d1ee5ba | [
"MIT"
] | 2 | 2021-03-19T02:23:24.000Z | 2021-12-22T15:01:46.000Z | coursesical/__main__.py | cdfmlr/coursesical | d027db60dca6bcf543a74d3a6dd635fd8d1ee5ba | [
"MIT"
] | null | null | null | coursesical/__main__.py | cdfmlr/coursesical | d027db60dca6bcf543a74d3a6dd635fd8d1ee5ba | [
"MIT"
] | null | null | null | from coursesical.main import *
import argparse
import json
def cmd():
description = "coursesical: courses to ical."
parser = argparse.ArgumentParser(description=description)
parser.add_argument("-s", "--sid", action="store", required=True,
help="学号(教务账号)")
parser.add_argument... | 34.942857 | 94 | 0.59444 |
99eb4bc7f8a0f12bb4a023635d44ce58b8d6d442 | 393 | py | Python | ecomsite/asgi.py | whroberts1411/Shop | 630f905bee9cd4c0c041882cc5b3d9b65497c109 | [
"MIT"
] | null | null | null | ecomsite/asgi.py | whroberts1411/Shop | 630f905bee9cd4c0c041882cc5b3d9b65497c109 | [
"MIT"
] | null | null | null | ecomsite/asgi.py | whroberts1411/Shop | 630f905bee9cd4c0c041882cc5b3d9b65497c109 | [
"MIT"
] | null | null | null | """
ASGI config for ecomsite project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
1eabc52810b3011ec6677dedb695692c04d2e09f | 3,132 | py | Python | utils/softnet.py | rezer0dai/rewheeler | 548e5784999657199f1bc51d5a8b94d12cb27fce | [
"MIT"
] | null | null | null | utils/softnet.py | rezer0dai/rewheeler | 548e5784999657199f1bc51d5a8b94d12cb27fce | [
"MIT"
] | 1 | 2019-07-04T15:24:00.000Z | 2019-07-04T15:24:00.000Z | utils/softnet.py | rezer0dai/rewheeler | 548e5784999657199f1bc51d5a8b94d12cb27fce | [
"MIT"
] | null | null | null | import os
import torch
import numpy as np
def filter_dict(full_dict, blacklist):
sheeps = list(filter(
lambda k: any(b in k for b in blacklist),
full_dict.keys()))
for sheep in sheeps:
full_dict.pop(sheep)
return full_dict
class SoftUpdateNetwork:
def __init__(self, model_path,... | 35.590909 | 123 | 0.634419 |
99623328739521e2ef352e5a73d1c0e09b81e293 | 770 | py | Python | boston301/boston311site/boston311site/urls.py | guangyangai/analyzeboston | 3680f80144d929493098f094a41b80cb742b9275 | [
"MIT"
] | null | null | null | boston301/boston311site/boston311site/urls.py | guangyangai/analyzeboston | 3680f80144d929493098f094a41b80cb742b9275 | [
"MIT"
] | null | null | null | boston301/boston311site/boston311site/urls.py | guangyangai/analyzeboston | 3680f80144d929493098f094a41b80cb742b9275 | [
"MIT"
] | null | null | null | """boston311site URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | 35 | 79 | 0.706494 |
8ed2080264405a69b861ac88cf0667d3584d34bb | 2,487 | py | Python | examples/simulated_data_example.py | tblume1992/BetaBoost | a8b517dfab99dc818ef9bc70d89059dd28f54958 | [
"MIT"
] | 2 | 2021-09-02T16:50:37.000Z | 2021-10-19T14:13:00.000Z | examples/simulated_data_example.py | Chowlett2/BetaBoost | a8b517dfab99dc818ef9bc70d89059dd28f54958 | [
"MIT"
] | 1 | 2021-10-29T19:11:24.000Z | 2021-10-29T20:43:02.000Z | examples/simulated_data_example.py | Chowlett2/BetaBoost | a8b517dfab99dc818ef9bc70d89059dd28f54958 | [
"MIT"
] | 2 | 2021-10-20T15:44:05.000Z | 2021-11-20T04:37:24.000Z | import numpy as np
import xgboost as xgb
import matplotlib.pyplot as plt
xgb.__version__
def generate_data():
y = np.random.gamma(2, 4, OBS)
X = np.random.normal(5, 2, [OBS, FEATURES])
return X, y
max_iter = 300
eta_base = 0.2
eta_min = 0.1
eta_decay = np.linspace(eta_base, eta_min, max_iter).tolist()
OB... | 28.261364 | 96 | 0.667471 |
2d11b46920c9c5dd2c2b92b919206ac1b78583c1 | 7,318 | py | Python | glycan_profiling/serialize/hypothesis/glycan.py | mstim/glycresoft | 1d305c42c7e6cba60326d8246e4a485596a53513 | [
"Apache-2.0"
] | 4 | 2019-04-26T15:47:57.000Z | 2021-04-20T22:53:58.000Z | glycan_profiling/serialize/hypothesis/glycan.py | mstim/glycresoft | 1d305c42c7e6cba60326d8246e4a485596a53513 | [
"Apache-2.0"
] | 8 | 2017-11-22T19:20:20.000Z | 2022-02-14T01:49:58.000Z | glycan_profiling/serialize/hypothesis/glycan.py | mstim/glycresoft | 1d305c42c7e6cba60326d8246e4a485596a53513 | [
"Apache-2.0"
] | 3 | 2017-11-21T18:05:28.000Z | 2021-09-23T18:38:33.000Z | from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.hybrid import hybrid_method
from sqlalchemy.orm import relationship, backref, object_session
from sqlalchemy import (
Column, Numeric, Integer, String, ForeignKey,
Table, Index)
from glycan_profiling.serialize.base import (Base)
from gl... | 31.817391 | 111 | 0.706341 |
bf51a576286206ce9d81a02b6b4774e52136065c | 1,235 | py | Python | setup.py | south-coast-science/scs_host_bbe | 5e376ee8abccc7035f5c8eda9a8ab70c0fe2a311 | [
"MIT"
] | 1 | 2021-11-30T07:10:56.000Z | 2021-11-30T07:10:56.000Z | setup.py | south-coast-science/scs_host_bbe | 5e376ee8abccc7035f5c8eda9a8ab70c0fe2a311 | [
"MIT"
] | null | null | null | setup.py | south-coast-science/scs_host_bbe | 5e376ee8abccc7035f5c8eda9a8ab70c0fe2a311 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('requirements.txt') as req_txt:
required = [line for line in req_txt.read().splitlines() if line]
try:
import pypandoc
from os import path
here = path.abspath(path.dirname(__file__))
long_description = pypandoc.convert(path.join(here, 'README.... | 30.875 | 77 | 0.646964 |
919716f49a8b9aecf332c3d29f4688abdb27ba97 | 13,069 | py | Python | rest_framework/request.py | michaelBenin/django-rest-framework | 91d0545361021eecc86ba06223208c06d2520aa5 | [
"Unlicense"
] | 1 | 2015-11-07T12:37:44.000Z | 2015-11-07T12:37:44.000Z | rest_framework/request.py | michaelBenin/django-rest-framework | 91d0545361021eecc86ba06223208c06d2520aa5 | [
"Unlicense"
] | null | null | null | rest_framework/request.py | michaelBenin/django-rest-framework | 91d0545361021eecc86ba06223208c06d2520aa5 | [
"Unlicense"
] | null | null | null | """
The Request class is used as a wrapper around the standard request object.
The wrapped request then offers a richer API, in particular :
- content automatically parsed according to `Content-Type` header,
and available as `request.DATA`
- full support of PUT method, including support for file uploads... | 33.510256 | 96 | 0.633637 |
ac2345b146b97787bc3877d1b8d68e472a075543 | 319 | py | Python | Python/factorial.py | chernyshov-dev/ideal-octo-waffle | c50f29795352766752dbbbcd46693ff54f23369b | [
"WTFPL"
] | 3 | 2021-08-29T15:22:08.000Z | 2021-08-29T17:12:01.000Z | Python/factorial.py | chernyshov-dev/ideal-octo-waffle | c50f29795352766752dbbbcd46693ff54f23369b | [
"WTFPL"
] | 11 | 2021-09-07T19:24:15.000Z | 2022-01-13T19:51:25.000Z | Python/factorial.py | chernyshov-dev/university-practice-heap | c50f29795352766752dbbbcd46693ff54f23369b | [
"WTFPL"
] | null | null | null | import math
a = int(input('Введите число: '))
def fac (a):
factorial = 1
if a == 0:
return 1
for i in range(2,a+1):
factorial *= i
return factorial
print('Вычисления с помощью функции ->',fac(a))
print('Вычисление с помощью модуль math ->', math.factorial(a))
| 17.722222 | 64 | 0.561129 |
63339629c459d36a82a8a24e3f11e80f57371dd9 | 1,655 | py | Python | setup.py | btclib-org/btclib_libsecp256k1 | b7bdd0df121c9c674edc88a55ea6cadad75dafef | [
"MIT"
] | null | null | null | setup.py | btclib-org/btclib_libsecp256k1 | b7bdd0df121c9c674edc88a55ea6cadad75dafef | [
"MIT"
] | null | null | null | setup.py | btclib-org/btclib_libsecp256k1 | b7bdd0df121c9c674edc88a55ea6cadad75dafef | [
"MIT"
] | null | null | null | import sys
from setuptools import find_packages, setup
sdist = "sdist" in sys.argv
setup(
name="btclib_libsecp256k1",
version="0.0.2",
url="https://btclib.org",
project_urls={
"Download": "https://github.com/btclib-org/btclib_libsecp256k1/releases",
# "Documentation": "https://btclib.... | 36.777778 | 83 | 0.644713 |
36e4dd70a0b673b7a4dab862ad588be60cb7f37d | 8,297 | py | Python | docs/conf.py | wcooley/python-py2neo_compat | 470706a831eda3ab53b473071611aaac267048e8 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | wcooley/python-py2neo_compat | 470706a831eda3ab53b473071611aaac267048e8 | [
"Apache-2.0"
] | 1 | 2021-03-25T21:51:49.000Z | 2021-03-25T21:51:49.000Z | docs/conf.py | wcooley/python-py2neo_compat | 470706a831eda3ab53b473071611aaac267048e8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# py2neo_compat documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this... | 30.503676 | 76 | 0.716042 |
97dfd3463447702bac5b03c85d47092c974da7ca | 833 | py | Python | examples/frameworks/click/click_multi_cmd.py | Hollowfier/clearml | cf9671c2539c05dac40c00ef707193b1ca6b9cab | [
"Apache-2.0"
] | null | null | null | examples/frameworks/click/click_multi_cmd.py | Hollowfier/clearml | cf9671c2539c05dac40c00ef707193b1ca6b9cab | [
"Apache-2.0"
] | null | null | null | examples/frameworks/click/click_multi_cmd.py | Hollowfier/clearml | cf9671c2539c05dac40c00ef707193b1ca6b9cab | [
"Apache-2.0"
] | null | null | null | import click
from clearml import Task
@click.group()
def cli():
task = Task.init(project_name='examples', task_name='click multi command')
print('done')
@cli.command('hello', help='test help')
@click.option('--count', default=1, help='Number of greetings.')
@click.option('--name', prompt='Your name', help='... | 23.8 | 78 | 0.655462 |
8132184cdde56d44d6b2afb159b69df1451b4e00 | 16,429 | py | Python | python/dlbs/logparser.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | null | null | null | python/dlbs/logparser.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | null | null | null | python/dlbs/logparser.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | null | null | null | # (c) Copyright [2017] Hewlett Packard Enterprise Development LP
#
# 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 appli... | 44.765668 | 183 | 0.63187 |
017d2cb59aedfb7cb560e06f30dfaf2068dcf95b | 3,664 | py | Python | pagapp/admin_panel/forms.py | eugeneandrienko/PyArtistsGallery | b75114955859d45d9dfb5c901213f25a6e09f488 | [
"MIT"
] | null | null | null | pagapp/admin_panel/forms.py | eugeneandrienko/PyArtistsGallery | b75114955859d45d9dfb5c901213f25a6e09f488 | [
"MIT"
] | null | null | null | pagapp/admin_panel/forms.py | eugeneandrienko/PyArtistsGallery | b75114955859d45d9dfb5c901213f25a6e09f488 | [
"MIT"
] | null | null | null | """Set of forms which using in admin panel.
List of forms:
ChangePasswordForm -- providing form for password change.
AddAlbumForm -- providing form for adding new album.
UploadForm -- providing form for uploading new pictures.
CommonSettingsForm -- providing form for changing common settings.
"""
import re
from flas... | 31.86087 | 79 | 0.650382 |
49ff9e1b0e866d4dc417618a393ce89ae118d250 | 6,658 | py | Python | openstackclient/network/v2/network_meter_rule.py | tanmayks1999/python-openstackclient | 6a40910c3a4c0e00c3dcd0a9223772b6f03c4002 | [
"Apache-2.0"
] | 1 | 2018-04-23T20:59:31.000Z | 2018-04-23T20:59:31.000Z | openstackclient/network/v2/network_meter_rule.py | adgeese/python-openstackclient | 06263bd5852aad9cd03a76f50140fbbb2d0751ba | [
"Apache-2.0"
] | null | null | null | openstackclient/network/v2/network_meter_rule.py | adgeese/python-openstackclient | 06263bd5852aad9cd03a76f50140fbbb2d0751ba | [
"Apache-2.0"
] | 1 | 2020-07-21T02:18:23.000Z | 2020-07-21T02:18:23.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | 32.637255 | 79 | 0.608591 |
899ec927625f0064252498bd657d0e81561bcf31 | 243 | py | Python | ntv/__init__.py | aitoehigie/ntv | cc5449be002ac0f720b1b5ac76fe0286242f5e63 | [
"MIT"
] | null | null | null | ntv/__init__.py | aitoehigie/ntv | cc5449be002ac0f720b1b5ac76fe0286242f5e63 | [
"MIT"
] | null | null | null | ntv/__init__.py | aitoehigie/ntv | cc5449be002ac0f720b1b5ac76fe0286242f5e63 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from .__version__ import __version__
__title__ = "Nairaland Terminal Viewer"
__author__ = "Ehigie (pystar) Aito"
__license__ = "The MIT License (MIT)"
__copyright__ = "(c) 2018 Ehigie (pystar) Aito"
| 22.090909 | 47 | 0.769547 |
4b2c1681f16b493b750a9dce0807465ba22799fc | 11,392 | py | Python | gp_tracking.py | kamilprusko/gnome-pomodoro-tracking | 2b65f2180e5392fc9161cae259fbcf7f24a704f5 | [
"MIT"
] | null | null | null | gp_tracking.py | kamilprusko/gnome-pomodoro-tracking | 2b65f2180e5392fc9161cae259fbcf7f24a704f5 | [
"MIT"
] | null | null | null | gp_tracking.py | kamilprusko/gnome-pomodoro-tracking | 2b65f2180e5392fc9161cae259fbcf7f24a704f5 | [
"MIT"
] | null | null | null | import os
import argparse
import configparser
import sys
from datetime import datetime, timedelta
import logging
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
class GPTracking:
def __init__(self, gptconfig, dirpath, dirhome):
self.gptconfig = gptconfig
self.dirpath = os.path.dirname(os.path.realpath(_... | 36.867314 | 142 | 0.529933 |
e9148f0aed4ccc3ce7fd813d445b9b90fdbb4555 | 7,034 | py | Python | tools/dataset_converter/coco_annotation.py | sherry30/YOLO4-trained-on-TGRS-HRRSD | e7bc7d350e541aefebea2b98264ca39196ebd329 | [
"MIT"
] | null | null | null | tools/dataset_converter/coco_annotation.py | sherry30/YOLO4-trained-on-TGRS-HRRSD | e7bc7d350e541aefebea2b98264ca39196ebd329 | [
"MIT"
] | null | null | null | tools/dataset_converter/coco_annotation.py | sherry30/YOLO4-trained-on-TGRS-HRRSD | e7bc7d350e541aefebea2b98264ca39196ebd329 | [
"MIT"
] | 2 | 2021-12-30T09:04:13.000Z | 2021-12-30T09:04:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, argparse
import json
import numpy as np
from tqdm import tqdm
from collections import defaultdict, OrderedDict
sets=[('instances_train2017', 'train2017'), ('instances_val2017', 'val2017')]
class_count = {}
parser = argparse.ArgumentParser(description='convert... | 39.516854 | 173 | 0.624111 |
7b0d640c72fac4871bbd605bdf7b0b172141c1a0 | 2,618 | py | Python | src/schemathesis/specs/openapi/converter.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 563 | 2019-08-26T05:22:12.000Z | 2020-09-02T11:54:17.000Z | src/schemathesis/specs/openapi/converter.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 651 | 2019-08-23T09:16:35.000Z | 2020-09-02T08:30:10.000Z | src/schemathesis/specs/openapi/converter.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 43 | 2019-09-10T09:25:17.000Z | 2020-07-06T10:00:38.000Z | from copy import deepcopy
from itertools import chain
from typing import Any, Callable, Dict, List
from ...utils import traverse_schema
def to_json_schema(
schema: Dict[str, Any], *, nullable_name: str, copy: bool = True, is_response_schema: bool = False
) -> Dict[str, Any]:
"""Convert Open API parameters to... | 36.361111 | 122 | 0.668831 |
dc3f5bd1d406fd6e74617cf705f4681b6e285917 | 2,159 | gyp | Python | node_modules/i2c-bus/binding.gyp | Keisukeogu/node-red-contrib-grovepi-ir | 26c71c8d676552b5aa0d78dc84cc90269133831e | [
"Apache-2.0"
] | 5 | 2020-01-28T01:30:49.000Z | 2021-09-22T07:05:07.000Z | node_modules/i2c-bus/binding.gyp | Keisukeogu/node-red-contrib-grovepi-ir | 26c71c8d676552b5aa0d78dc84cc90269133831e | [
"Apache-2.0"
] | 5 | 2019-02-03T16:08:41.000Z | 2021-05-05T17:28:59.000Z | node_modules/i2c-bus/binding.gyp | Keisukeogu/node-red-contrib-grovepi-ir | 26c71c8d676552b5aa0d78dc84cc90269133831e | [
"Apache-2.0"
] | 2 | 2020-01-28T01:32:12.000Z | 2020-06-11T05:19:00.000Z | {
"targets": [{
"target_name": "i2c",
"include_dirs" : [
"<!(node -e \"require('nan')\")"
],
"conditions": [
["OS == \"linux\"", {
"cflags": [
"-Wno-unused-local-typedefs"
],
"sources": [
"./src/i2c.cc"
]
}],
["OS == \"win\"", ... | 30.408451 | 149 | 0.463177 |
a4b5c5f40ebdc5927d31ebb136b4e5e925a6ad29 | 411 | py | Python | survey/migrations/0011_last_used_id.py | ONSdigital/alpha-eq-author | fe9f95695e88e9840d5cbf9e530286210adf0469 | [
"MIT"
] | 1 | 2016-02-03T12:31:01.000Z | 2016-02-03T12:31:01.000Z | survey/migrations/0011_last_used_id.py | ONSdigital/alpha-eq-author | fe9f95695e88e9840d5cbf9e530286210adf0469 | [
"MIT"
] | null | null | null | survey/migrations/0011_last_used_id.py | ONSdigital/alpha-eq-author | fe9f95695e88e9840d5cbf9e530286210adf0469 | [
"MIT"
] | 1 | 2021-04-11T08:23:45.000Z | 2021-04-11T08:23:45.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('survey', '0010_lock_questionnaire'),
]
operations = [
migrations.AddField(
model_name='questionnaire',
... | 20.55 | 49 | 0.613139 |
2a927bc32ffc1b7d5a2300a040855f6a7183ba8d | 40,477 | py | Python | test/unit/agent/collectors/nginx/accesslog/overall.py | empiricompany/nginx-amplify-agent | 2ea46f037ef158e5d4f56f2532010c72c5f8842c | [
"BSD-2-Clause"
] | 1 | 2021-06-20T06:03:54.000Z | 2021-06-20T06:03:54.000Z | test/unit/agent/collectors/nginx/accesslog/overall.py | SammyEnigma/nginx-amplify-agent | 81c4002c156809039933234abeb292edee3ac492 | [
"BSD-2-Clause"
] | null | null | null | test/unit/agent/collectors/nginx/accesslog/overall.py | SammyEnigma/nginx-amplify-agent | 81c4002c156809039933234abeb292edee3ac492 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from hamcrest import *
from amplify.agent.collectors.nginx.accesslog import NginxAccessLogsCollector
from test.base import NginxCollectorTestCase
__author__ = "Mike Belov"
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
__license__ = ""
__maintainer__ = "Mike Belov"
__email__ ... | 48.359618 | 133 | 0.543815 |
3fb503d8731fc8b06a9893fb69386df8a7d82966 | 2,601 | py | Python | tools/mo/unit_tests/mo/middle/PoolV2ToAttributedPool_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/unit_tests/mo/middle/PoolV2ToAttributedPool_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/unit_tests/mo/middle/PoolV2ToAttributedPool_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from openvino.tools.mo.middle.PoolV2ToAttributedPool import PoolV2ToAttributedPool
from openvino.tools.mo.utils.ir_engine.compare_graphs import compare_graphs
from openvino.tools.mo.utils.shape import int64_array
from un... | 47.290909 | 101 | 0.481353 |
198de06f1bba0ab153ecef6d97316b4a012fd5dc | 805 | py | Python | sncosmo/tests/test_plotting.py | jpierel14/sncosmo | dea2c4ad71a4e004d2fd5d55ec4264523a4b21bc | [
"BSD-3-Clause"
] | null | null | null | sncosmo/tests/test_plotting.py | jpierel14/sncosmo | dea2c4ad71a4e004d2fd5d55ec4264523a4b21bc | [
"BSD-3-Clause"
] | null | null | null | sncosmo/tests/test_plotting.py | jpierel14/sncosmo | dea2c4ad71a4e004d2fd5d55ec4264523a4b21bc | [
"BSD-3-Clause"
] | 2 | 2017-03-30T22:16:05.000Z | 2019-06-12T15:53:03.000Z | # Licensed under a 3-clause BSD style license - see LICENSES
import numpy as np
import pytest
import sncosmo
try:
from matplotlib.figure import Figure
HAS_MATPLOTLIB = True
except ImportError:
HAS_MATPLOTLIB = False
@pytest.mark.skipif('not HAS_MATPLOTLIB')
class TestPlotLC:
def setup_class(self):
... | 28.75 | 79 | 0.681988 |
e427213640da5cb60e89d01fcaf1e8b19ac0b347 | 1,367 | py | Python | appinit_auth/lib/permissions_apis/applications/list.py | lost-osiris/webplatform-auth | 855ce5a70f55d7c897ee03c109f4ede36500826b | [
"MIT"
] | null | null | null | appinit_auth/lib/permissions_apis/applications/list.py | lost-osiris/webplatform-auth | 855ce5a70f55d7c897ee03c109f4ede36500826b | [
"MIT"
] | null | null | null | appinit_auth/lib/permissions_apis/applications/list.py | lost-osiris/webplatform-auth | 855ce5a70f55d7c897ee03c109f4ede36500826b | [
"MIT"
] | null | null | null | from lib.imports.default import *
import lib.permissions.users.get as get_user
def call(**kwargs):
manager = Manager()
db = manager.db("appinit")
uid = manager.get_user_uid()
user = get_user.call(uid=uid)
user_permissions = user["permissions_obj"]
cursor = db.permissions.aggregate([
{
... | 23.568966 | 90 | 0.590344 |
0aa775780037bb3449dcf3e971cfa6fb94456f37 | 544 | py | Python | community_library/delivery_management/migrations/0008_alter_request_book.py | kiruthihan10/Community-Library | d2f68e27e14586e7a2bafab42024e1e9c57834f1 | [
"MIT"
] | null | null | null | community_library/delivery_management/migrations/0008_alter_request_book.py | kiruthihan10/Community-Library | d2f68e27e14586e7a2bafab42024e1e9c57834f1 | [
"MIT"
] | null | null | null | community_library/delivery_management/migrations/0008_alter_request_book.py | kiruthihan10/Community-Library | d2f68e27e14586e7a2bafab42024e1e9c57834f1 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2022-03-30 16:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('book_management', '0003_auto_20220330_1827'),
('delivery_management', '0007_auto_20220330_2144'),
]
operati... | 25.904762 | 108 | 0.654412 |
3c90b4c7680ff5729bf08ef6347fc4499dfa90bf | 6,990 | py | Python | nncf/experimental/onnx/graph/onnx_graph.py | vuiseng9/nncf_pytorch | c2b1f069c867327203629201aecae3b7815e7895 | [
"Apache-2.0"
] | null | null | null | nncf/experimental/onnx/graph/onnx_graph.py | vuiseng9/nncf_pytorch | c2b1f069c867327203629201aecae3b7815e7895 | [
"Apache-2.0"
] | null | null | null | nncf/experimental/onnx/graph/onnx_graph.py | vuiseng9/nncf_pytorch | c2b1f069c867327203629201aecae3b7815e7895 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2022 Intel Corporation
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 writin... | 38.406593 | 98 | 0.624034 |
256c81c7928f225eb0c883e9f28cf4f000b721b8 | 2,188 | py | Python | attendance_api/app/config.py | qangelot/projet_Nantes | 6cd63aec0acc5de77683832dd20f66ec3aa9e3eb | [
"MIT"
] | null | null | null | attendance_api/app/config.py | qangelot/projet_Nantes | 6cd63aec0acc5de77683832dd20f66ec3aa9e3eb | [
"MIT"
] | null | null | null | attendance_api/app/config.py | qangelot/projet_Nantes | 6cd63aec0acc5de77683832dd20f66ec3aa9e3eb | [
"MIT"
] | null | null | null | import logging
import sys
from types import FrameType
from typing import List, cast
from loguru import logger
from pydantic import AnyHttpUrl, BaseSettings
class LoggingSettings(BaseSettings):
# logging level of the app (CRITICAL, ERROR, WARNING, INFO, DEBUG)
LOGGING_LEVEL: int = logging.INFO
class Settin... | 30.816901 | 105 | 0.675046 |
44e52e0762268ea5ebc9401a16c018789eae753c | 122 | py | Python | Chapter 7/modules/dirlister.py | carloocchiena/blackhat_python_book_code | ce181b084e9416dff4c6fba8f4fe7976e6216ba8 | [
"MIT"
] | 36 | 2021-11-16T07:59:39.000Z | 2022-03-20T21:23:35.000Z | Chapter 7/modules/dirlister.py | carloocchiena/blackhat_python_book_code | ce181b084e9416dff4c6fba8f4fe7976e6216ba8 | [
"MIT"
] | null | null | null | Chapter 7/modules/dirlister.py | carloocchiena/blackhat_python_book_code | ce181b084e9416dff4c6fba8f4fe7976e6216ba8 | [
"MIT"
] | 5 | 2022-01-16T22:59:05.000Z | 2022-02-16T17:23:00.000Z | import os
def run():
print("[*] In dirlister module.")
files = os.listdir(".")
return str(files)
| 15.25 | 38 | 0.52459 |
6b20a1996ac559ec98933e157d51fbfb8fd24b64 | 192 | py | Python | sender.py | Kiwifuit/Webhook-Sender | ad9f30969efb903183df75f9c8a6b973f96058ff | [
"MIT"
] | null | null | null | sender.py | Kiwifuit/Webhook-Sender | ad9f30969efb903183df75f9c8a6b973f96058ff | [
"MIT"
] | null | null | null | sender.py | Kiwifuit/Webhook-Sender | ad9f30969efb903183df75f9c8a6b973f96058ff | [
"MIT"
] | null | null | null | import requests
url = input("Enter discord Webhook link:\n")
while True:
message = input("Enter message:\n")
data = {
"content": message
}
requests.post(url, data=data) | 24 | 44 | 0.630208 |
b292b189345f962add2d942fed4a6f2886d01da7 | 18,428 | py | Python | modules/templates/BRCMS/Evac/dissemination.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | 1 | 2021-11-08T16:38:22.000Z | 2021-11-08T16:38:22.000Z | modules/templates/BRCMS/Evac/dissemination.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | null | null | null | modules/templates/BRCMS/Evac/dissemination.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Sahana Eden Dissemination Model
@copyright: 2009-2021 (c) Sahana Software Foundation
@license: MIT
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... | 37.531568 | 114 | 0.414695 |
e2b291dfadd809ce0db8a2ea5d2829301dd98e34 | 1,609 | py | Python | aries_cloudagent/transport/outbound/ws.py | brianorwhatever/aries-cloudagent-python | 9eb97df5956ed1156e6de353d87455b8df952483 | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/transport/outbound/ws.py | brianorwhatever/aries-cloudagent-python | 9eb97df5956ed1156e6de353d87455b8df952483 | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/transport/outbound/ws.py | brianorwhatever/aries-cloudagent-python | 9eb97df5956ed1156e6de353d87455b8df952483 | [
"Apache-2.0"
] | null | null | null | """Websockets outbound transport."""
import logging
from typing import Union
from aiohttp import ClientSession, DummyCookieJar
from ...core.profile import Profile
from .base import BaseOutboundTransport
class WsTransport(BaseOutboundTransport):
"""Websockets outbound transport class."""
schemes = ("ws", ... | 28.732143 | 84 | 0.63207 |
75df5cc684975e0de7d6baec25132be525c66e92 | 843 | py | Python | app_utilities/data.py | alessandrolamberti/style_transfer | cb71f91aa17f528c6f3ef5ad53e9bf0c9280f707 | [
"Apache-2.0"
] | 1 | 2021-06-04T09:35:58.000Z | 2021-06-04T09:35:58.000Z | app_utilities/data.py | lamb-does-code/style_transfer | cb71f91aa17f528c6f3ef5ad53e9bf0c9280f707 | [
"Apache-2.0"
] | null | null | null | app_utilities/data.py | lamb-does-code/style_transfer | cb71f91aa17f528c6f3ef5ad53e9bf0c9280f707 | [
"Apache-2.0"
] | null | null | null | import os
style_name = ['Munch', 'Monet', 'Monet_2', 'Picasso','Van Gogh', 'Turner', 'Afremov', 'Space', 'Space_2', 'Escher']
style_file = ['munch.jpg','monet.jpg', 'monet2.jpg', 'picasso.jpg', 'vangogh.jpg','turner.jpg', 'afremov.jpg', 'space.jpg', 'pillars.jpg', 'escher.jpg']
style_path = 'style/'
style_dict = {n... | 46.833333 | 160 | 0.688019 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.