hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9af2e86d2d19ba95d7c121bcc98c92fbd274e537 | 804 | py | Python | util/typecheck.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | 22 | 2021-06-15T00:01:27.000Z | 2022-03-15T11:22:25.000Z | util/typecheck.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | null | null | null | util/typecheck.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | 2 | 2021-11-30T08:56:03.000Z | 2022-01-24T10:46:39.000Z | """Type checking at runtime."""
from collections.abc import Iterable
check = True
def checkinstance(*args):
"""Performs type checking.
The first argument is the name of the function. The remaining
arguments come in pairs v, T, and it is checked that v has type T.
"""
if not check:
retur... | 26.8 | 91 | 0.567164 |
1c0f5b1ac93f2add170ec633e481a245ce5284f2 | 1,770 | py | Python | chapter14/search_mindrecord.py | mindspore-ai/book | d25e0f3948e882054dee68403bebd052e097e976 | [
"Apache-2.0",
"CC-BY-4.0"
] | 165 | 2020-03-28T07:05:18.000Z | 2021-08-05T01:04:42.000Z | chapter14/search_mindrecord.py | mindspore-ai/book | d25e0f3948e882054dee68403bebd052e097e976 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | chapter14/search_mindrecord.py | mindspore-ai/book | d25e0f3948e882054dee68403bebd052e097e976 | [
"Apache-2.0",
"CC-BY-4.0"
] | 5 | 2020-06-05T02:52:00.000Z | 2020-10-26T06:29:00.000Z | # 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... | 32.777778 | 78 | 0.677401 |
3d16d98404d6355a61101c1c6e9c4345315b6e60 | 469 | py | Python | larcv/core/DataFormat/test/test_pca.py | kvtsang/larcv2 | b2804b3390ea4d9f8bdf2c3ab5c82216fa532adf | [
"MIT"
] | 14 | 2017-10-19T15:08:29.000Z | 2021-03-31T21:21:07.000Z | larcv/core/DataFormat/test/test_pca.py | kvtsang/larcv2 | b2804b3390ea4d9f8bdf2c3ab5c82216fa532adf | [
"MIT"
] | 32 | 2017-10-25T22:54:06.000Z | 2019-10-01T13:57:15.000Z | larcv/core/DataFormat/test/test_pca.py | kvtsang/larcv2 | b2804b3390ea4d9f8bdf2c3ab5c82216fa532adf | [
"MIT"
] | 16 | 2017-12-07T12:04:40.000Z | 2021-11-15T00:53:31.000Z | from larcv import larcv
import numpy as np
npts = 10
example = np.repeat(np.arange(npts, dtype=np.float32)[:, None], 3, axis=1)
#voxel_set = larcv.as_tensor3d(example)
voxel_set = larcv.VoxelSet()
meta = larcv.Voxel3DMeta()
meta.set(0, 0, 0, npts, npts, npts, npts, npts, npts)
for pt in example:
voxel_set.add(larc... | 29.3125 | 74 | 0.69936 |
9dc8cc2e59e31ddb6ee67f88350209f2fbe358ff | 26 | py | Python | aries_cloudagent/wallet/tests/__init__.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 247 | 2019-07-02T21:10:21.000Z | 2022-03-30T13:55:33.000Z | aries_cloudagent/wallet/tests/__init__.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 1,462 | 2019-07-02T20:57:30.000Z | 2022-03-31T23:13:35.000Z | aries_cloudagent/wallet/tests/__init__.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 377 | 2019-06-20T21:01:31.000Z | 2022-03-30T08:27:53.000Z | """
Wallet test suite
"""
| 6.5 | 17 | 0.576923 |
71fa63d4c8574d43aa4e9c54b0314b1e977adb94 | 67 | py | Python | src/tess_sip/__init__.py | icweaver/TESS-SIP | 6ead09dbc00abd0ab19b8d4043683c2383afb5c9 | [
"MIT"
] | 11 | 2020-11-30T19:14:19.000Z | 2022-02-14T14:45:14.000Z | src/tess_sip/__init__.py | icweaver/TESS-SIP | 6ead09dbc00abd0ab19b8d4043683c2383afb5c9 | [
"MIT"
] | 7 | 2020-12-17T14:41:44.000Z | 2021-08-17T19:34:58.000Z | src/tess_sip/__init__.py | icweaver/TESS-SIP | 6ead09dbc00abd0ab19b8d4043683c2383afb5c9 | [
"MIT"
] | 6 | 2021-01-14T04:26:39.000Z | 2021-07-13T22:13:00.000Z | from .tess_sip import SIP
__version__ = "1.1.0"
__all__ = ["SIP"]
| 13.4 | 25 | 0.671642 |
a6063bc403f05699efeeabd5e09a8f9835a3030c | 1,241 | py | Python | test/proj4/proj-regression-EPSG-3857-19.py | dvuckovic/magics-test | bd8baf97b0db986f6adf63700d3cf77bbcbad2f2 | [
"Apache-2.0"
] | 7 | 2019-03-19T09:32:41.000Z | 2022-02-07T13:20:33.000Z | test/proj4/proj-regression-EPSG-3857-19.py | dvuckovic/magics-test | bd8baf97b0db986f6adf63700d3cf77bbcbad2f2 | [
"Apache-2.0"
] | 2 | 2021-03-30T05:37:20.000Z | 2021-08-17T13:58:04.000Z | test/proj4/proj-regression-EPSG-3857-19.py | dvuckovic/magics-test | bd8baf97b0db986f6adf63700d3cf77bbcbad2f2 | [
"Apache-2.0"
] | 5 | 2019-03-19T10:43:46.000Z | 2021-09-09T14:28:39.000Z | from Magics.macro import *
import os
def plot_area(epsg, llx, lly, urx, ury):
img = os.path.basename(__file__).split('.')[0]
title = "Projection {} : [{:.2f}, {:.2f}, {:.2f}, {:.2f}]".format(epsg, llx, lly, urx, ury)
#Setting output
png = output(
output_formats = ['png'],
output_name ... | 28.860465 | 101 | 0.630137 |
1ff41658de24405ccc9dcd593864696139f2b9c5 | 4,556 | py | Python | mysite/gui/nodes.py | GatlinCruz/Capstone | 447a4fea6b9dff6b89f2e4bd82ea1b7dd5175666 | [
"MIT"
] | 1 | 2021-05-13T22:17:41.000Z | 2021-05-13T22:17:41.000Z | mysite/gui/nodes.py | GatlinCruz/Capstone | 447a4fea6b9dff6b89f2e4bd82ea1b7dd5175666 | [
"MIT"
] | null | null | null | mysite/gui/nodes.py | GatlinCruz/Capstone | 447a4fea6b9dff6b89f2e4bd82ea1b7dd5175666 | [
"MIT"
] | 1 | 2021-05-14T04:33:24.000Z | 2021-05-14T04:33:24.000Z | """
This file contains classes for nodes in the network
__author__ Cade Tipton
__author__ Gatlin Cruz
__version__ 4/27/21
"""
class Host:
def __init__(self, name, ip):
"""
Creates a new Host object
:param name: The name of the host
:param ip: The ip of the host
:return: Non... | 24.494624 | 112 | 0.536655 |
c86033c4a60b8854b7933b793acf0cd88e9a40b4 | 5,881 | py | Python | source/deepsecurity/models/port_list.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:09.000Z | 2021-10-30T16:40:09.000Z | source/deepsecurity/models/port_list.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-07-28T20:19:03.000Z | 2021-07-28T20:19:03.000Z | source/deepsecurity/models/port_list.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:02.000Z | 2021-10-30T16:40:02.000Z | # coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | 28.970443 | 311 | 0.543445 |
ef7985a0eebda08b6bbbcef54fd5aa8b84715adc | 22,308 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bastion_hosts_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bastion_hosts_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bastion_hosts_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.181425 | 193 | 0.663125 |
98e6adcef40899caf6c02252b50b9a6a96cd12ec | 550 | py | Python | Jumpscale/tools/perftesttools/NodeHost.py | threefoldtech/jumpscale_core9 | f366bea61bf2e6112c4afb5a4979ec00b843e58a | [
"Apache-2.0"
] | null | null | null | Jumpscale/tools/perftesttools/NodeHost.py | threefoldtech/jumpscale_core9 | f366bea61bf2e6112c4afb5a4979ec00b843e58a | [
"Apache-2.0"
] | 162 | 2018-07-31T14:40:33.000Z | 2019-04-03T06:31:20.000Z | Jumpscale/tools/perftesttools/NodeHost.py | threefoldtech/jumpscale_core9 | f366bea61bf2e6112c4afb5a4979ec00b843e58a | [
"Apache-2.0"
] | 2 | 2018-07-31T12:42:02.000Z | 2018-11-21T09:40:22.000Z | from jumpscale import j
# import sys
# import time
#
# import os
# import psutil
from .NodeBase import NodeBase
class NodeHost(NodeBase):
def __init__(self, ipaddr, sshport=22, name=""):
"""
is host running the hypervisor
"""
NodeBase.__init__(self, ipaddr=ipaddr, sshport=sshport... | 22 | 87 | 0.650909 |
1639c4134685f000997e372d849b0fd6487b06cd | 2,360 | py | Python | dataproc/list_clusters.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 3 | 2021-01-24T23:42:57.000Z | 2021-02-17T12:02:12.000Z | dataproc/list_clusters.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 320 | 2020-11-08T21:02:43.000Z | 2022-02-10T10:43:29.000Z | dataproc/list_clusters.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 2 | 2019-11-04T18:25:20.000Z | 2019-11-05T14:35:28.000Z | #!/usr/bin/env python
# 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
# di... | 36.875 | 77 | 0.70678 |
02ca9db72bb196c11e874507afd2599e944904ff | 265 | py | Python | tests/artificial/transf_Difference/trend_Lag1Trend/cycle_7/ar_/test_artificial_1024_Difference_Lag1Trend_7__0.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Difference/trend_Lag1Trend/cycle_7/ar_/test_artificial_1024_Difference_Lag1Trend_7__0.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Difference/trend_Lag1Trend/cycle_7/ar_/test_artificial_1024_Difference_Lag1Trend_7__0.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 7, transform = "Difference", sigma = 0.0, exog_count = 0, ar_order = 0); | 37.857143 | 165 | 0.732075 |
69f891add9cc5faa9bcc3b0fb3fb67de87cd7426 | 34,817 | py | Python | pysnmp-with-texts/MICOM-RSI-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/MICOM-RSI-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/MICOM-RSI-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module MICOM-RSI-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MICOM-RSI-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:12:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 197.823864 | 3,017 | 0.770601 |
2be27a2842d6576c8935cd4cb6a57326f42b9702 | 21,227 | py | Python | physionet-django/project/modelcomponents/activeproject.py | rguo123/physionet-build | 09a7467052df11711fa23a9180dfeb5dcfe6a836 | [
"BSD-3-Clause"
] | 36 | 2019-02-14T18:10:39.000Z | 2022-01-21T12:48:52.000Z | physionet-django/project/modelcomponents/activeproject.py | rguo123/physionet-build | 09a7467052df11711fa23a9180dfeb5dcfe6a836 | [
"BSD-3-Clause"
] | 1,051 | 2019-01-31T18:03:14.000Z | 2022-03-31T20:53:04.000Z | physionet-django/project/modelcomponents/activeproject.py | rguo123/physionet-build | 09a7467052df11711fa23a9180dfeb5dcfe6a836 | [
"BSD-3-Clause"
] | 13 | 2019-03-26T11:02:32.000Z | 2022-03-17T11:39:49.000Z | from datetime import timedelta
from html import unescape
import logging
import os
import shutil
from background_task import background
from django.conf import settings
from django.db import models, transaction
from django.forms.utils import ErrorList
from django.urls import reverse
from django.utils import timezone
fr... | 37.83779 | 142 | 0.62053 |
2ac14a12a22a1e30ceec2b61e4cebad722830799 | 1,039 | py | Python | combine_npz.py | kromond/stylegan2-ada-pytorch | 7f15d01fd700e909548ab3b3c8b4e7d09c590bcc | [
"BSD-Source-Code"
] | 168 | 2021-02-01T17:01:45.000Z | 2022-03-26T03:06:36.000Z | combine_npz.py | kromond/stylegan2-ada-pytorch | 7f15d01fd700e909548ab3b3c8b4e7d09c590bcc | [
"BSD-Source-Code"
] | 21 | 2021-03-16T20:46:40.000Z | 2022-02-18T22:38:30.000Z | combine_npz.py | kromond/stylegan2-ada-pytorch | 7f15d01fd700e909548ab3b3c8b4e7d09c590bcc | [
"BSD-Source-Code"
] | 85 | 2021-02-04T11:03:01.000Z | 2022-03-30T09:33:43.000Z | import os
import numpy as np
import torch
import click
import PIL.Image
import dnnlib
import legacy
#----------------------------------------------------------------------------
@click.command()
@click.pass_context
@click.option('--npzs', help='comma separated .npz files', type=str, required=True, metavar='FILE')
@cl... | 25.341463 | 105 | 0.526468 |
04d175bdcaa5d75fe4b131be41ed22dd02487567 | 808 | py | Python | investigations/check_desi0_dataset.py | nam8/Barry | 5deb15d71d620079aa46ced73e23b1da8b9c4e57 | [
"MIT"
] | 13 | 2019-07-29T20:39:20.000Z | 2021-09-26T09:20:52.000Z | investigations/check_desi0_dataset.py | nam8/Barry | 5deb15d71d620079aa46ced73e23b1da8b9c4e57 | [
"MIT"
] | 1 | 2021-02-11T10:54:58.000Z | 2021-02-11T10:54:58.000Z | investigations/check_desi0_dataset.py | nam8/Barry | 5deb15d71d620079aa46ced73e23b1da8b9c4e57 | [
"MIT"
] | 7 | 2019-08-26T04:54:00.000Z | 2022-01-20T14:47:47.000Z | import logging
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG, format="[%(levelname)7s |%(funcName)20s] %(message)s")
logging.getLogger("matplotlib").setLevel(logging.ERROR)
from barry.datasets.dataset_power_spectrum import PowerSpectrum_DESIMockChallenge0_Z01
from barry.models i... | 38.47619 | 105 | 0.75 |
f35cb7a7bbd180e145516fdcfb303fe13c5c27fd | 7,166 | py | Python | mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata_pb2.py | nishantg96/HandTrack-MP | bcbf584e0a47d301923f54d0187324ae7423c6d4 | [
"Apache-2.0"
] | null | null | null | mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata_pb2.py | nishantg96/HandTrack-MP | bcbf584e0a47d301923f54d0187324ae7423c6d4 | [
"Apache-2.0"
] | null | null | null | mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata_pb2.py | nishantg96/HandTrack-MP | bcbf584e0a47d301923f54d0187324ae7423c6d4 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/modules/face_geometry/protos/geometry_pipeline_metadata.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descripto... | 42.654762 | 866 | 0.794725 |
4c6b2db108eb618b1a7464c3d239f8d7978c24d7 | 7,364 | py | Python | monai/utils/deprecated.py | madil90/MONAI | 2f1c7a5d1b47c8dd21681dbe1b67213aa3278cd7 | [
"Apache-2.0"
] | 1 | 2021-08-20T01:54:26.000Z | 2021-08-20T01:54:26.000Z | monai/utils/deprecated.py | madil90/MONAI | 2f1c7a5d1b47c8dd21681dbe1b67213aa3278cd7 | [
"Apache-2.0"
] | null | null | null | monai/utils/deprecated.py | madil90/MONAI | 2f1c7a5d1b47c8dd21681dbe1b67213aa3278cd7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 38.757895 | 117 | 0.676534 |
1d64899c584fbcd09b8db0a30ba1f931dc57ab9f | 6,906 | py | Python | main.py | JobQiu/PrototypicalNetwork | b46c34f8847946c4cd41774f4c8ee87c3486474c | [
"Apache-2.0"
] | null | null | null | main.py | JobQiu/PrototypicalNetwork | b46c34f8847946c4cd41774f4c8ee87c3486474c | [
"Apache-2.0"
] | null | null | null | main.py | JobQiu/PrototypicalNetwork | b46c34f8847946c4cd41774f4c8ee87c3486474c | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import os
from configs.config import MiniImageNetConfig
from data_loader.data_generator import DataGenerator, CompressedImageNetDataGenerator
from models.example_model import ExampleModel, PrototypicalNetwork
from trainers.example_trainer import ExampleTrainer, ProtoNetTrainer
from utils.config... | 30.557522 | 117 | 0.669852 |
291c4d7da8355eb2587d73f8f4437a5214e8e58d | 38 | py | Python | foiamachine/local/lib/python2.7/encodings/cp1255.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | 3 | 2021-08-07T04:01:55.000Z | 2021-08-07T05:12:11.000Z | foiamachine/local/lib/python2.7/encodings/cp1255.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | null | null | null | foiamachine/local/lib/python2.7/encodings/cp1255.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | 1 | 2021-08-05T22:51:14.000Z | 2021-08-05T22:51:14.000Z | /usr/lib/python2.7/encodings/cp1255.py | 38 | 38 | 0.815789 |
0bdc15bcfa8f114d042e4bae5c3754b0722e2979 | 19,554 | py | Python | toontown/toonbase/ToonBase.py | Max-Rodriguez/toontown-online | cdb5d11fc9a7bae6171d4f3f52b5550fac7bc106 | [
"BSD-3-Clause"
] | 1 | 2022-03-25T18:20:49.000Z | 2022-03-25T18:20:49.000Z | toontown/toonbase/ToonBase.py | Max-Rodriguez/toontown-online | cdb5d11fc9a7bae6171d4f3f52b5550fac7bc106 | [
"BSD-3-Clause"
] | null | null | null | toontown/toonbase/ToonBase.py | Max-Rodriguez/toontown-online | cdb5d11fc9a7bae6171d4f3f52b5550fac7bc106 | [
"BSD-3-Clause"
] | null | null | null | from otp.otpbase import OTPBase
from otp.otpbase import OTPLauncherGlobals
from otp.otpbase import OTPGlobals
from otp.settings.Settings import Settings
from direct.showbase.PythonUtil import *
from . import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
from . import ToontownLoader
from direct.gui ... | 49.130653 | 265 | 0.661808 |
2f48c921f7cf9a5b9ce739e512d4df017919744b | 5,766 | py | Python | src/aleph/storage.py | olethanh/pyaleph | 3a64fb89c54e74187679872d559fb00be0dfde43 | [
"MIT"
] | null | null | null | src/aleph/storage.py | olethanh/pyaleph | 3a64fb89c54e74187679872d559fb00be0dfde43 | [
"MIT"
] | null | null | null | src/aleph/storage.py | olethanh/pyaleph | 3a64fb89c54e74187679872d559fb00be0dfde43 | [
"MIT"
] | null | null | null | """ Storage module for Aleph.
Basically manages the IPFS storage.
"""
import asyncio
import json
import logging
from hashlib import sha256
from aleph.services.filestore import get_value, set_value
from aleph.services.ipfs.storage import add_bytes as add_ipfs_bytes
from aleph.services.ipfs.storage import add_file as i... | 38.697987 | 93 | 0.627818 |
845dcc1b9f7a5b67bbab895ab652b7e57ffb4f24 | 10,252 | py | Python | qa/rpc-tests/listtransactions.py | cryptoanzu/anzucoin | 43417ed5e96be249745f1a93e20be18ccb46da2b | [
"MIT"
] | null | null | null | qa/rpc-tests/listtransactions.py | cryptoanzu/anzucoin | 43417ed5e96be249745f1a93e20be18ccb46da2b | [
"MIT"
] | null | null | null | qa/rpc-tests/listtransactions.py | cryptoanzu/anzucoin | 43417ed5e96be249745f1a93e20be18ccb46da2b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework.test_framework import BitcoinTestFramework
from ... | 49.76699 | 113 | 0.598712 |
c325b644e2f9a594a880516d59d97b1bd653a303 | 2,165 | py | Python | plansys2_executor/launch/executor_launch.py | RTI-BDI/ros2_planning_system | d115b6950ff6fb87ae728af930456f50736b9d8d | [
"Apache-2.0"
] | null | null | null | plansys2_executor/launch/executor_launch.py | RTI-BDI/ros2_planning_system | d115b6950ff6fb87ae728af930456f50736b9d8d | [
"Apache-2.0"
] | null | null | null | plansys2_executor/launch/executor_launch.py | RTI-BDI/ros2_planning_system | d115b6950ff6fb87ae728af930456f50736b9d8d | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Intelligent Robotics Lab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 32.313433 | 90 | 0.72933 |
fc0bd17b63a3c5351244954121624bc88330649e | 253 | py | Python | poop/hfdp/command/remote/ceiling_fan_on_command.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | 37 | 2020-12-27T00:13:07.000Z | 2022-01-31T19:30:18.000Z | poop/hfdp/command/remote/ceiling_fan_on_command.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | null | null | null | poop/hfdp/command/remote/ceiling_fan_on_command.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | 7 | 2020-12-26T22:33:47.000Z | 2021-11-07T01:29:59.000Z | from poop.hfdp.command.remote.ceiling_fan import CeilingFan
class CeilingFanOnCommand:
def __init__(self, ceiling_fan: CeilingFan) -> None:
self.__ceiling_fan = ceiling_fan
def execute(self) -> None:
self.__ceiling_fan.high()
| 25.3 | 59 | 0.72332 |
df07738b26b2596ea3313666f8a725139de65fbc | 240 | py | Python | Python/Algorithms/1337.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | 2 | 2021-01-15T17:22:54.000Z | 2021-05-16T19:58:02.000Z | Python/Algorithms/1337.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | Python/Algorithms/1337.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | class Solution:
def kWeakestRows(self, mat, k: int):
# sort by sum of rows and return row indices as attached by enumerate
return [i for i, _ in sorted(
enumerate(mat), key=lambda x: sum(x[1]))[:k]
]
| 34.285714 | 77 | 0.591667 |
748dff34986e341b263f3691ce1d683672bcc274 | 143 | py | Python | knx_stack/decode/usb_hid/report_body/usb_protocol_header/bus_access_server_feature/device_feature_info/__init__.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | 2 | 2021-07-28T07:42:28.000Z | 2022-01-25T18:56:05.000Z | knx_stack/decode/usb_hid/report_body/usb_protocol_header/bus_access_server_feature/device_feature_info/__init__.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | 6 | 2021-07-25T21:36:01.000Z | 2022-02-20T21:11:31.000Z | knx_stack/decode/usb_hid/report_body/usb_protocol_header/bus_access_server_feature/device_feature_info/__init__.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | null | null | null | from knx_stack.decode.usb_hid.report_body.usb_protocol_header.bus_access_server_feature.device_feature_info import (
feature_identifier,
)
| 35.75 | 116 | 0.867133 |
2a4b2d11890e0ca8a2058262372e8fafa5545832 | 18,567 | py | Python | armin_analysis/fit_integrator_model.py | arminbahl/mutant_zebrafish_behavior | 17bee04b35c23b0f93fcecac9758e6ba19872be1 | [
"MIT"
] | null | null | null | armin_analysis/fit_integrator_model.py | arminbahl/mutant_zebrafish_behavior | 17bee04b35c23b0f93fcecac9758e6ba19872be1 | [
"MIT"
] | null | null | null | armin_analysis/fit_integrator_model.py | arminbahl/mutant_zebrafish_behavior | 17bee04b35c23b0f93fcecac9758e6ba19872be1 | [
"MIT"
] | null | null | null | from pathlib import Path
import numpy as np
import autograd.numpy as anp
from numba import jit
import random
import pandas as pd
from get_fish_info import get_fish_info
from pymoo.model.problem import Problem
from pymoo.algorithms.nsga2 import NSGA2
from pymoo.factory import get_sampling, get_crossover, get_mutation
fr... | 50.591281 | 154 | 0.611084 |
d93c0ac401326d46617e072b1f8ae803dfb33b0a | 37,137 | py | Python | _texttable.py | zxx1819/- | 1c04ce5f6b8bdd0ccf592ad02b50b8f901c28cbb | [
"MIT"
] | null | null | null | _texttable.py | zxx1819/- | 1c04ce5f6b8bdd0ccf592ad02b50b8f901c28cbb | [
"MIT"
] | null | null | null | _texttable.py | zxx1819/- | 1c04ce5f6b8bdd0ccf592ad02b50b8f901c28cbb | [
"MIT"
] | null | null | null | """
Google's clitable.py is inherently integrated to Linux:
This is a workaround for that (basically include modified clitable code without anything
that is Linux-specific).
_clitable.py is identical to Google's as of 2017-12-17
_texttable.py is identical to Google's as of 2017-12-17
_terminal.py is a highly stripped... | 33.128457 | 89 | 0.57541 |
56afe8841f6756f37f300d81109986e68e6b808c | 229 | py | Python | registrobrepp/domain/nshostatt.py | ivcmartello/registrobrepp | dece39a451bcdb964d337df6aa7bd418a60c1a85 | [
"MIT"
] | null | null | null | registrobrepp/domain/nshostatt.py | ivcmartello/registrobrepp | dece39a451bcdb964d337df6aa7bd418a60c1a85 | [
"MIT"
] | null | null | null | registrobrepp/domain/nshostatt.py | ivcmartello/registrobrepp | dece39a451bcdb964d337df6aa7bd418a60c1a85 | [
"MIT"
] | null | null | null | from eppy.xmldict import XmlDictObject
class NsHostAtt(XmlDictObject):
def __init__(self, hostsattr: list):
dct = {
'hostAttr': hostsattr,
}
super(NsHostAtt, self).__init__(initdict=dct)
| 22.9 | 53 | 0.637555 |
08c5c2bbd1f73754e665374038fac7a53f892414 | 4,627 | py | Python | infrastructure/constructs/batch_job_queue.py | adisbladis/geostore | 79439c06b33414e1e26b3aa4b93a72fd7cbbae83 | [
"MIT"
] | 25 | 2021-05-19T08:05:07.000Z | 2022-03-14T02:48:58.000Z | infrastructure/constructs/batch_job_queue.py | adisbladis/geostore | 79439c06b33414e1e26b3aa4b93a72fd7cbbae83 | [
"MIT"
] | 311 | 2021-05-17T23:04:56.000Z | 2022-03-31T10:41:44.000Z | infrastructure/constructs/batch_job_queue.py | adisbladis/geostore | 79439c06b33414e1e26b3aa4b93a72fd7cbbae83 | [
"MIT"
] | 1 | 2022-01-03T05:38:32.000Z | 2022-01-03T05:38:32.000Z | import textwrap
from aws_cdk import aws_batch, aws_dynamodb, aws_ec2, aws_iam
from aws_cdk.core import Construct, Fn
from geostore.environment import PRODUCTION_ENVIRONMENT_NAME
APPLICATION_NAME_TAG_NAME = "ApplicationName"
APPLICATION_NAME = "geostore"
class BatchJobQueue(Construct):
def __init__(
sel... | 35.320611 | 100 | 0.610979 |
8bf23614362c87649d81555fb80491f23d0a7945 | 268 | py | Python | mirari/mirari/taskapp.py | gcastellan0s/mirariapp | 24a9db06d10f96c894d817ef7ccfeec2a25788b7 | [
"MIT"
] | null | null | null | mirari/mirari/taskapp.py | gcastellan0s/mirariapp | 24a9db06d10f96c894d817ef7ccfeec2a25788b7 | [
"MIT"
] | 18 | 2019-12-27T19:58:20.000Z | 2022-02-27T08:17:49.000Z | mirari/mirari/taskapp.py | gcastellan0s/mirariapp | 24a9db06d10f96c894d817ef7ccfeec2a25788b7 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from celery import shared_task
from django.apps import apps
@shared_task
def send_mail_task(app=None, model=None, pk=None):
apps.get_model(app, model).objects.get(pk=pk).send_mail()
return 'send_mail_task OK' | 33.5 | 58 | 0.813433 |
d33d1b6d098b6ca17298937f51fc4b8a4391c950 | 946 | py | Python | 01-Zaman_Bukme_Filtresi/ZamanBukmeFiltresi.py | gokdumano/Python | 69705688607364e2702f19cba3a9a31416b18666 | [
"Unlicense"
] | null | null | null | 01-Zaman_Bukme_Filtresi/ZamanBukmeFiltresi.py | gokdumano/Python | 69705688607364e2702f19cba3a9a31416b18666 | [
"Unlicense"
] | null | null | null | 01-Zaman_Bukme_Filtresi/ZamanBukmeFiltresi.py | gokdumano/Python | 69705688607364e2702f19cba3a9a31416b18666 | [
"Unlicense"
] | null | null | null | import cv2 as cv
import numpy as np
IPCAM = ...
VIDEO = cv.VideoCapture(IPCAM)
ONLINE, FRAME = VIDEO.read()
if ONLINE:
imW = int(VIDEO.get(cv.CAP_PROP_FRAME_WIDTH))
imH = int(VIDEO.get(cv.CAP_PROP_FRAME_HEIGHT))
FPS = int(VIDEO.get(cv.CAP_PROP_FPS))
ONESECOND = 1000
WAIT ... | 28.666667 | 65 | 0.609937 |
a0664d29a96d24cae5c953cd6be505f4742bbcb3 | 5,260 | py | Python | cwru/utils/dataopenset.py | diagnosisda/dxda | a27071c56a106d32c18a77521a9384dec9663cb8 | [
"Apache-2.0"
] | 6 | 2019-12-10T14:04:24.000Z | 2021-12-14T11:59:47.000Z | cwru/utils/dataopenset.py | diagnosisda/dxda | a27071c56a106d32c18a77521a9384dec9663cb8 | [
"Apache-2.0"
] | 1 | 2019-12-13T20:07:54.000Z | 2019-12-13T20:15:24.000Z | cwru/utils/dataopenset.py | diagnosisda/dxda | a27071c56a106d32c18a77521a9384dec9663cb8 | [
"Apache-2.0"
] | 7 | 2019-12-10T09:05:13.000Z | 2022-02-22T07:18:33.000Z | # ETH Zurich, IBI-CIMS, Qin Wang (wang@qin.ee)
# Utils for PHM datasets
import numpy as np
import tensorflow as tf
#import matplotlib.pyplot as plt
from scipy.io import loadmat
from glob import glob
def get_cwru_list(load, dir="./data/cwru/", mode="all"):
""" Get file a list of cwru files for each condition unde... | 40.775194 | 111 | 0.591635 |
4e712e984914dbb533126b52c2d28575e807cdd4 | 884 | py | Python | chapter11-iface-abc/tombola_runner.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | 1 | 2019-11-23T05:57:02.000Z | 2019-11-23T05:57:02.000Z | chapter11-iface-abc/tombola_runner.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | null | null | null | chapter11-iface-abc/tombola_runner.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | 1 | 2019-11-23T05:57:43.000Z | 2019-11-23T05:57:43.000Z | # -*- coding: utf-8 -*-
"""
tombola_runner.py
Tombola子类的测试运行程序
"""
import doctest
from tombola import Tombola
import bingo
import lotto
import tombolist
import drum # 要测试的模块
TEST_FILE = 'tombola_tests.rst'
TEST_MSG = '{0:16} {1.attempted:2} tests, {1.failed:2} failed - {2}'
def main(argv):
verbose = '-v' in ... | 21.560976 | 68 | 0.66629 |
4272752368164524ca3095b8f18b9e7f4e3ba31b | 422 | py | Python | src/waldur_slurm/migrations/0023_drop_spl.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 26 | 2017-10-18T13:49:58.000Z | 2021-09-19T04:44:09.000Z | src/waldur_slurm/migrations/0023_drop_spl.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 14 | 2018-12-10T14:14:51.000Z | 2021-06-07T10:33:39.000Z | src/waldur_slurm/migrations/0023_drop_spl.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 32 | 2017-09-24T03:10:45.000Z | 2021-10-16T16:41:09.000Z | from django.db import migrations
from waldur_core.core.migration_utils import build_spl_migrations
class Migration(migrations.Migration):
dependencies = [
('structure', '0021_project_backend_id'),
('waldur_slurm', '0022_allocation_user_usage_mandatory_fields'),
]
operations = build_spl_... | 26.375 | 83 | 0.727488 |
b5d963ec37af27ec1c948dde95c0127129aa627f | 550 | py | Python | Chapter07/crash_course_qt_for_python/hello_connect_simple.py | HowToBeCalculated/Hands-On-Blockchain-for-Python-Developers | f9634259dd3dc509f36a5ccf3a5182c0d2ec79c4 | [
"MIT"
] | 62 | 2019-03-18T04:41:41.000Z | 2022-03-31T05:03:13.000Z | Chapter07/crash_course_qt_for_python/hello_connect_simple.py | HowToBeCalculated/Hands-On-Blockchain-for-Python-Developers | f9634259dd3dc509f36a5ccf3a5182c0d2ec79c4 | [
"MIT"
] | 2 | 2020-06-14T21:56:03.000Z | 2022-01-07T05:32:01.000Z | Chapter07/crash_course_qt_for_python/hello_connect_simple.py | HowToBeCalculated/Hands-On-Blockchain-for-Python-Developers | f9634259dd3dc509f36a5ccf3a5182c0d2ec79c4 | [
"MIT"
] | 42 | 2019-02-22T03:10:36.000Z | 2022-02-20T04:47:04.000Z | import sys
from PySide2.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton, QLabel
from PySide2 import QtCore
app = QApplication(sys.argv)
hello_button = QPushButton("Hello")
world_label = QLabel("Sun")
layout = QVBoxLayout()
layout.addWidget(hello_button)
layout.addWidget(world_label)
def set_text_in... | 22 | 85 | 0.785455 |
9e3b0396850919ca7ccb3ae2e4d4444ed90cb797 | 4,077 | py | Python | naive_stringify.py | alanamarzoev/structured-realm | 23f54711c18a209fc6a0f1c030a74d140c4e23f3 | [
"Apache-2.0"
] | 1 | 2021-07-27T02:45:34.000Z | 2021-07-27T02:45:34.000Z | naive_stringify.py | alanamarzoev/structured-realm | 23f54711c18a209fc6a0f1c030a74d140c4e23f3 | [
"Apache-2.0"
] | null | null | null | naive_stringify.py | alanamarzoev/structured-realm | 23f54711c18a209fc6a0f1c030a74d140c4e23f3 | [
"Apache-2.0"
] | null | null | null | import tensorflow.compat.v1 as tf
tf.enable_eager_execution()
import tensorflow_hub as hub
import json
import pandas as pd
from absl import app
from absl import flags
import abc
from concurrent import futures
import time
import os
import bert
from bert import tokenization
from absl import logging
from language.re... | 32.879032 | 172 | 0.600442 |
a55a07a88dd2b2c1a06252838a1c63193541047b | 965 | py | Python | statisitc.py | LeeJiangWei/sensors-positioning | 7e2421190755aa73a32c9e8e2ce82c294ce5d435 | [
"WTFPL"
] | null | null | null | statisitc.py | LeeJiangWei/sensors-positioning | 7e2421190755aa73a32c9e8e2ce82c294ce5d435 | [
"WTFPL"
] | null | null | null | statisitc.py | LeeJiangWei/sensors-positioning | 7e2421190755aa73a32c9e8e2ce82c294ce5d435 | [
"WTFPL"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
def plot_fitness_history(file: str, real_file: str):
history = np.load(file)
real_history = np.load(real_file)
x = np.arange(0, len(history))
rx = np.arange(0, len(real_history)) * 20
plt.plot(x, history, label=file)
plt.plot(rx, real_history,... | 30.15625 | 103 | 0.676684 |
da89dce1a882b17b3f3945b6c5878f193a141fec | 4,088 | py | Python | day14.py | coocos/advent-of-code-2018 | fc238ccc0903d9f1f272b2c59b8069d4223c7c8a | [
"MIT"
] | null | null | null | day14.py | coocos/advent-of-code-2018 | fc238ccc0903d9f1f272b2c59b8069d4223c7c8a | [
"MIT"
] | null | null | null | day14.py | coocos/advent-of-code-2018 | fc238ccc0903d9f1f272b2c59b8069d4223c7c8a | [
"MIT"
] | null | null | null | from typing import Optional
class Node:
"""
Simple linked list with append and move operations
"""
def __init__(self, value: int) -> None:
self.value = value
self.next: Optional['Node'] = None
def append(self, node: 'Node') -> 'Node':
"""
Appends to the end of the ... | 29.2 | 79 | 0.58635 |
c0cbe0ab668f5e7cb067272051dcafcec54d6e55 | 6,813 | py | Python | Lib/site-packages/nltk/tag/__init__.py | gamroder/TEST | 6da6ba96c6ff19b0db4ac44429d3de5623f24ff7 | [
"bzip2-1.0.6"
] | 7 | 2020-11-29T02:33:23.000Z | 2021-06-28T04:45:31.000Z | env/lib/python3.7/site-packages/nltk/tag/__init__.py | Victorpc98/CE888-Project | 99c20adc78eb53ac4d3c87543ef8da1ef4d10adc | [
"MIT"
] | 6 | 2020-09-05T01:40:23.000Z | 2022-03-12T00:40:58.000Z | env/lib/python3.7/site-packages/nltk/tag/__init__.py | Victorpc98/CE888-Project | 99c20adc78eb53ac4d3c87543ef8da1ef4d10adc | [
"MIT"
] | 3 | 2020-09-24T18:26:36.000Z | 2021-06-30T10:55:26.000Z | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Taggers
#
# Copyright (C) 2001-2019 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com> (minor additions)
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
NLTK Taggers
This package contains cla... | 37.640884 | 107 | 0.644356 |
39fed0299ea0db3bb937ff899f0abacfbf90b521 | 207 | py | Python | meta_features/__init__.py | mostafaelaraby/generalization-gap-features-tensorflow | efec157d790a43a3fdeed81f3bf521023f6a83af | [
"Apache-2.0"
] | null | null | null | meta_features/__init__.py | mostafaelaraby/generalization-gap-features-tensorflow | efec157d790a43a3fdeed81f3bf521023f6a83af | [
"Apache-2.0"
] | null | null | null | meta_features/__init__.py | mostafaelaraby/generalization-gap-features-tensorflow | efec157d790a43a3fdeed81f3bf521023f6a83af | [
"Apache-2.0"
] | null | null | null | from .margin_distribution import MarginDistribution
from .weights import Weights
from .spectral_margin import SpectralMargin
Enabled_Features = [
MarginDistribution,
Weights,
SpectralMargin,
]
| 18.818182 | 51 | 0.797101 |
87bcab42119713ff3e6582bb9cf7b19e39f7ff4d | 78 | py | Python | lib/vehicles/__init__.py | jkjung-avt/py-faster-rcnn | 4f9d6a5164844f651e41d431512cfac0c570fae9 | [
"BSD-2-Clause"
] | 2 | 2018-05-29T01:58:26.000Z | 2020-04-28T09:21:17.000Z | lib/vehicles/__init__.py | jkjung-avt/py-faster-rcnn | 4f9d6a5164844f651e41d431512cfac0c570fae9 | [
"BSD-2-Clause"
] | null | null | null | lib/vehicles/__init__.py | jkjung-avt/py-faster-rcnn | 4f9d6a5164844f651e41d431512cfac0c570fae9 | [
"BSD-2-Clause"
] | 2 | 2019-03-06T00:59:58.000Z | 2019-04-07T03:32:03.000Z | # For vehicle detection, illegal parking detection and traffic counting, etc.
| 39 | 77 | 0.807692 |
efddaf2b2acd59562108f2bdbb15cd6c6eec4ffd | 1,244 | py | Python | app/tests/test_regressions_tests.py | FundingCircle/DjanGoat | 013c7367294682955daf9eba205270bd2f9725cd | [
"MIT"
] | 1 | 2019-05-07T09:49:25.000Z | 2019-05-07T09:49:25.000Z | app/tests/test_regressions_tests.py | FundingCircle/DjanGoat | 013c7367294682955daf9eba205270bd2f9725cd | [
"MIT"
] | null | null | null | app/tests/test_regressions_tests.py | FundingCircle/DjanGoat | 013c7367294682955daf9eba205270bd2f9725cd | [
"MIT"
] | null | null | null |
from django.test import TestCase, RequestFactory, Client
from app.tests.mixins import AuthRouteTestingWithKwargs
from app.views import user_retirement_views
class PassingWrongArgumentRegressionTests(TestCase, AuthRouteTestingWithKwargs):
def setUp(self):
AuthRouteTestingWithKwargs.__init__(self)
... | 31.897436 | 82 | 0.643891 |
9046505b1b9ae9bd750b9a1828e9dbbaabe4b2af | 2,741 | py | Python | rhea/models/elink/_easic.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | 1 | 2022-03-16T23:56:09.000Z | 2022-03-16T23:56:09.000Z | rhea/models/elink/_easic.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | null | null | null | rhea/models/elink/_easic.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
from myhdl import *
from rhea.cores.elink import ELink
from rhea.cores.elink import EMeshPacket
from rhea.models import FIFO
def elink_asic_model(elink):
""" Model a simple ELink device (something like Epiphany)
:param elink: Interface to the external ELink enabled d... | 31.147727 | 78 | 0.529734 |
3302ae171567e147f697340731ad8a79988028b7 | 10,359 | py | Python | python/dgl/_ffi/ndarray.py | mori97/dgl | 646d1ab186b3280b99267e106da6b0b8ad12a8ba | [
"Apache-2.0"
] | 1 | 2019-01-28T06:36:05.000Z | 2019-01-28T06:36:05.000Z | python/dgl/_ffi/ndarray.py | tbmihailov/dgl | ed1948b5555106dee133cef91ed9ecfd3bd4310d | [
"Apache-2.0"
] | null | null | null | python/dgl/_ffi/ndarray.py | tbmihailov/dgl | ed1948b5555106dee133cef91ed9ecfd3bd4310d | [
"Apache-2.0"
] | 1 | 2022-02-03T09:45:53.000Z | 2022-02-03T09:45:53.000Z | # pylint: disable=invalid-name, unused-import
"""Runtime NDArray api"""
from __future__ import absolute_import
import sys
import ctypes
import numpy as np
from .base import _LIB, check_call, c_array, string_types, _FFI_MODE, c_str
from .runtime_ctypes import DGLType, DGLContext, DGLArray, DGLArrayHandle
from .runtime_... | 30.026087 | 96 | 0.621392 |
b4576c6b83d51be701543a5a125e36249eaf8321 | 8,073 | py | Python | examples/mujoco/train_ppo_batch_gym.py | xinyuewang1/chainerrl | 49425d09cb0749968f4e364e281670e752a46791 | [
"MIT"
] | null | null | null | examples/mujoco/train_ppo_batch_gym.py | xinyuewang1/chainerrl | 49425d09cb0749968f4e364e281670e752a46791 | [
"MIT"
] | null | null | null | examples/mujoco/train_ppo_batch_gym.py | xinyuewang1/chainerrl | 49425d09cb0749968f4e364e281670e752a46791 | [
"MIT"
] | null | null | null | """An example of training PPO against OpenAI Gym Envs.
This script is an example of training a PPO agent against OpenAI Gym envs.
Both discrete and continuous action spaces are supported.
To solve CartPole-v0, run:
python train_ppo_gym.py --env CartPole-v0
"""
from __future__ import division
from __future__ impor... | 37.901408 | 91 | 0.651802 |
1fb5026a87f17398a143b5409f8fb0e3774c88d0 | 269 | py | Python | filter_demo/book/views.py | gaohj/2001django | 0da7227acb37b7cdb3a9595bd96e0e1afd63e760 | [
"Apache-2.0"
] | null | null | null | filter_demo/book/views.py | gaohj/2001django | 0da7227acb37b7cdb3a9595bd96e0e1afd63e760 | [
"Apache-2.0"
] | null | null | null | filter_demo/book/views.py | gaohj/2001django | 0da7227acb37b7cdb3a9595bd96e0e1afd63e760 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from datetime import datetime
# Create your views here.
def index(request):
context = {
'times':datetime(year=2020,month=7,day=15,hour=16,minute=30,second=10)
}
return render(request,'index.html',context=context) | 29.888889 | 78 | 0.72119 |
fa2bb51c6bfa85d102bee245b278ded69dd7615b | 1,436 | py | Python | transformation.py | msqz/CarND-Advanced-Lane-Lines | 84c1034ae7fbecbb7b88b53b351cd31dcb98f39a | [
"MIT"
] | null | null | null | transformation.py | msqz/CarND-Advanced-Lane-Lines | 84c1034ae7fbecbb7b88b53b351cd31dcb98f39a | [
"MIT"
] | null | null | null | transformation.py | msqz/CarND-Advanced-Lane-Lines | 84c1034ae7fbecbb7b88b53b351cd31dcb98f39a | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import glob
import helpers
warping_from = np.float32([[200, 720], [604, 450], [696, 450], [1120, 720]])
warping_to = np.float32([[200, 720], [200, 0], [1120, 0], [1120, 720]])
def calibrate():
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
objp = np.z... | 31.217391 | 78 | 0.610028 |
38f01e171464aac8afc96a6238c3b8708fa1912f | 8,920 | py | Python | Attendance_System_U_FR/main.py | Mr-Parveen/AttendanceSystem_Using_Face_Recognition | 163594b18a31353c9972b6fff237bf8c0acac96f | [
"MIT"
] | null | null | null | Attendance_System_U_FR/main.py | Mr-Parveen/AttendanceSystem_Using_Face_Recognition | 163594b18a31353c9972b6fff237bf8c0acac96f | [
"MIT"
] | null | null | null | Attendance_System_U_FR/main.py | Mr-Parveen/AttendanceSystem_Using_Face_Recognition | 163594b18a31353c9972b6fff237bf8c0acac96f | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import cv2
from PIL import Image,ImageTk
import captureWin
import attendance
root = Tk()
root.title("Attendance System")
root.geometry("550x300") # width x height
root.minsize(550, 300)
root.maxsize(550, 300)
# ================= frame ====... | 39.122807 | 145 | 0.561323 |
537d1a2f169f0ea0bbc0f199b1751b1dcbaa964a | 8,159 | py | Python | docs/conf.py | alixedi/django_popcorn | fbe643d7f0edae723a9ca587d8e336d3be2425e5 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | alixedi/django_popcorn | fbe643d7f0edae723a9ca587d8e336d3be2425e5 | [
"BSD-3-Clause"
] | 1 | 2016-03-13T19:34:35.000Z | 2016-03-13T19:34:35.000Z | docs/conf.py | alixedi/django_popcorn | fbe643d7f0edae723a9ca587d8e336d3be2425e5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# complexity 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
# autogenerated file.
#
# ... | 32.122047 | 80 | 0.719328 |
b1c44555be6d8c8ab786f1ee0b3f0f7723aeafad | 16,945 | py | Python | msgraph-cli-extensions/beta/teams_beta/azext_teams_beta/vendored_sdks/teams/aio/operations/_teams_schedule_time_cards_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/beta/teams_beta/azext_teams_beta/vendored_sdks/teams/aio/operations/_teams_schedule_time_cards_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/beta/teams_beta/azext_teams_beta/vendored_sdks/teams/aio/operations/_teams_schedule_time_cards_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.069444 | 170 | 0.683919 |
c360d9571622baff91384539e189b59f51e786e5 | 773 | py | Python | tests/gis_tests/rasterapp/models.py | JBKahn/django | 32265361279b3316f5bce8efa71f2049409461e3 | [
"PSF-2.0",
"BSD-3-Clause"
] | 3 | 2018-01-29T14:16:02.000Z | 2019-02-05T21:33:05.000Z | tests/gis_tests/rasterapp/models.py | djk2/django | 6b00af50146335485d8414c42efec7d8dd5397fc | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2019-05-06T15:32:21.000Z | 2019-05-06T15:32:21.000Z | tests/gis_tests/rasterapp/models.py | djk2/django | 6b00af50146335485d8414c42efec7d8dd5397fc | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2019-12-05T17:24:36.000Z | 2021-11-22T21:21:32.000Z | from django.contrib.gis.db import models
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
class RasterModel(models.Model):
rast = models.RasterField('A Verbose Raster Name', null=True, srid=4326, spatial_index=True, blank=True)
rastprojected = models.RasterField('A Projected Raster Table',... | 32.208333 | 112 | 0.667529 |
5625371b05d7d39012fd2d61213679faab7413ba | 1,229 | py | Python | common/data/achievements.py | ggoshanov/vas3k.club | cfcb6375823d9f811d22c8a8e018604868d211e1 | [
"MIT"
] | null | null | null | common/data/achievements.py | ggoshanov/vas3k.club | cfcb6375823d9f811d22c8a8e018604868d211e1 | [
"MIT"
] | null | null | null | common/data/achievements.py | ggoshanov/vas3k.club | cfcb6375823d9f811d22c8a8e018604868d211e1 | [
"MIT"
] | null | null | null | ACHIEVEMENTS = [
("old", {
"name": "Олды тут",
"description": "Участник Клуба с момента его основания. "
"Входил в первую тысячу активных пользователей. "
"Видел, как Си-лучи мерцают во тьме близ врат Тангейзера. "
"Штурмовые кораб... | 38.40625 | 113 | 0.534581 |
09fe24ba3c75fd33acfbde96d46af0ca01859db4 | 4,696 | py | Python | src/bin/hub.py | veleritas/mychem.info | bb22357d4cbbc3c4865da224bf998f2cbc59f8f2 | [
"Apache-2.0"
] | 1 | 2021-05-09T04:51:28.000Z | 2021-05-09T04:51:28.000Z | src/bin/hub.py | veleritas/mychem.info | bb22357d4cbbc3c4865da224bf998f2cbc59f8f2 | [
"Apache-2.0"
] | null | null | null | src/bin/hub.py | veleritas/mychem.info | bb22357d4cbbc3c4865da224bf998f2cbc59f8f2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import asyncio, asyncssh, sys
import concurrent.futures
from functools import partial
from collections import OrderedDict
import config, biothings
biothings.config_for_app(config)
import logging
# shut some mouths...
logging.getLogger("elasticsearch").setLevel(logging.ERROR)
logging.getLogger("... | 37.269841 | 232 | 0.734668 |
36ae57a64eb5154a2059dce63886f36eabb33e35 | 6,395 | py | Python | ruts/basic_stats.py | SergeyShk/ruTS | 6af376ab606ed539a37f0c87c833ec4820e30fec | [
"MIT"
] | 72 | 2019-12-22T09:45:33.000Z | 2022-03-29T11:39:57.000Z | ruts/basic_stats.py | SergeyShk/ruTS | 6af376ab606ed539a37f0c87c833ec4820e30fec | [
"MIT"
] | 6 | 2020-01-09T13:37:28.000Z | 2022-03-12T01:06:01.000Z | ruts/basic_stats.py | SergeyShk/ruTS | 6af376ab606ed539a37f0c87c833ec4820e30fec | [
"MIT"
] | 16 | 2019-12-29T13:01:37.000Z | 2021-08-30T12:34:37.000Z | from typing import Dict, Union
from collections import Counter
from spacy.tokens import Doc
from .constants import BASIC_STATS_DESC, COMPLEX_SYL_FACTOR, PUNCTUATIONS, RU_LETTERS, SPACES
from .extractors import SentsExtractor, WordsExtractor
from .utils import count_syllables
class BasicStats(object):
"""
К... | 43.209459 | 98 | 0.65864 |
a2b8739980d159d38f603ef3c71335eb35d60bde | 14,547 | py | Python | mqbench/deploy/deploy_onnx_qnn.py | a1trl9/MQBench | 279c5a9e6e48778fe2913ba708b53ab9c2b0520c | [
"Apache-2.0"
] | 51 | 2021-08-20T01:28:50.000Z | 2021-09-22T05:34:39.000Z | mqbench/deploy/deploy_onnx_qnn.py | a1trl9/MQBench | 279c5a9e6e48778fe2913ba708b53ab9c2b0520c | [
"Apache-2.0"
] | 7 | 2021-08-24T09:46:31.000Z | 2021-09-22T05:43:06.000Z | mqbench/deploy/deploy_onnx_qnn.py | a1trl9/MQBench | 279c5a9e6e48778fe2913ba708b53ab9c2b0520c | [
"Apache-2.0"
] | 6 | 2021-08-20T09:18:48.000Z | 2021-09-19T04:35:13.000Z | import onnx
import numpy as np
from mqbench.utils.logger import logger
from .common import ONNXGraph
FAKE_QUANTIZE_OP = ['FakeQuantizeLearnablePerchannelAffine', 'FixedPerChannelAffine', 'FakeQuantizeDSQPerchannel',
'LearnablePerTensorAffine', 'FixedPerTensorAffine', 'FakeQuantizeDSQPertensor']
... | 52.139785 | 115 | 0.599161 |
12c2816996e93c4bc2aa4cb16a98fa51ab3f217f | 1,348 | py | Python | openstack_dashboard/test/unit/test_themes.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"Apache-2.0"
] | 930 | 2015-01-04T08:06:03.000Z | 2022-03-13T18:47:13.000Z | openstack_dashboard/test/unit/test_themes.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"Apache-2.0"
] | 26 | 2015-02-23T16:37:31.000Z | 2020-07-02T08:37:41.000Z | openstack_dashboard/test/unit/test_themes.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"Apache-2.0"
] | 1,040 | 2015-01-01T18:48:28.000Z | 2022-03-19T08:35:18.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
# distributed under t... | 38.514286 | 75 | 0.746291 |
baabc7da85158a96ed765e4e329451ce818145cd | 5,551 | py | Python | objectModel/Python/cdm/storage/remote.py | aaron-emde/CDM | 9472e9c7694821ac4a9bbe608557d2e65aabc73e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | objectModel/Python/cdm/storage/remote.py | aaron-emde/CDM | 9472e9c7694821ac4a9bbe608557d2e65aabc73e | [
"CC-BY-4.0",
"MIT"
] | 3 | 2021-05-11T23:57:12.000Z | 2021-08-04T05:03:05.000Z | objectModel/Python/cdm/storage/remote.py | aaron-emde/CDM | 9472e9c7694821ac4a9bbe608557d2e65aabc73e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | # ----------------------------------------------------------------------
# Copyright (c) Microsoft Corporation.
# All rights reserved.
# ----------------------------------------------------------------------
import datetime
import json
from typing import Dict, List, Optional
import uuid
from cdm.storage.network impo... | 32.461988 | 133 | 0.61016 |
751bd8b2decc6f89023a92c52110591541f1da1a | 18,149 | py | Python | cipher/JPEGImageCipher.py | JaySon-Huang/SecertPhotos | e741cc26c19a5b249d45cc70959ac6817196cb8a | [
"MIT"
] | null | null | null | cipher/JPEGImageCipher.py | JaySon-Huang/SecertPhotos | e741cc26c19a5b249d45cc70959ac6817196cb8a | [
"MIT"
] | 3 | 2015-05-19T08:43:46.000Z | 2015-06-10T17:55:28.000Z | cipher/JPEGImageCipher.py | JaySon-Huang/SecertPhotos | e741cc26c19a5b249d45cc70959ac6817196cb8a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#encoding=utf-8
'''
定义一个类似`接口`的存在
'''
import math
from pyjpegtbx.constants import DCTSIZE2
from .utils import exgcd, multiplicative_inver, pow_mod
class Base_JPEGImageCipher(object):
def encrypt(self, image):
'''返回一个加密之后的JPEGImage对象
'''
raise NotImplementedError
... | 32.878623 | 84 | 0.53193 |
be3a96e89314ba50b8a40027faac834b4eadddf3 | 1,330 | py | Python | tutorials/warp_affine.py | shaunster0/kornia | 71acf455ee36f2050b7be5ea993b6db773f502eb | [
"ECL-2.0",
"Apache-2.0"
] | 51 | 2019-10-11T18:47:30.000Z | 2021-05-03T06:42:37.000Z | tutorials/warp_affine.py | shaunster0/kornia | 71acf455ee36f2050b7be5ea993b6db773f502eb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tutorials/warp_affine.py | shaunster0/kornia | 71acf455ee36f2050b7be5ea993b6db773f502eb | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2019-10-11T19:59:05.000Z | 2020-07-10T02:28:52.000Z | """
Rotate image using warp affine transform
========================================
"""
import cv2
import matplotlib.pyplot as plt
import numpy as np
import torch
import kornia
# read the image with OpenCV
img: np.ndarray = cv2.imread('./data/bennett_aden.png')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# conve... | 24.181818 | 77 | 0.692481 |
791f01ba40835e5cfd107af8e2ec492cccffcf27 | 25,934 | py | Python | src/zenml/steps/base_step.py | SKRohit/zenml | ba84f56d8fc6043cdcb59832ab47bc8261e25d12 | [
"Apache-2.0"
] | null | null | null | src/zenml/steps/base_step.py | SKRohit/zenml | ba84f56d8fc6043cdcb59832ab47bc8261e25d12 | [
"Apache-2.0"
] | null | null | null | src/zenml/steps/base_step.py | SKRohit/zenml | ba84f56d8fc6043cdcb59832ab47bc8261e25d12 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) ZenML GmbH 2021. 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... | 41.099842 | 94 | 0.601643 |
246b064170d49ac3529272d00f14f17e74083dbc | 3,818 | py | Python | faceNet/faceNet.py | EscVM/Virtual_Security_Assistant | e0be2eec2599aaf6d74a0201fe62394d3e0e8dc6 | [
"MIT"
] | 13 | 2019-12-23T00:16:54.000Z | 2022-01-27T07:03:02.000Z | faceNet/faceNet.py | EscVM/Virtual_Security_Assistant | e0be2eec2599aaf6d74a0201fe62394d3e0e8dc6 | [
"MIT"
] | null | null | null | faceNet/faceNet.py | EscVM/Virtual_Security_Assistant | e0be2eec2599aaf6d74a0201fe62394d3e0e8dc6 | [
"MIT"
] | 4 | 2020-12-19T05:28:29.000Z | 2022-01-30T05:36:26.000Z | #--------------------------
#Date: 19/12/2019
#Place: Turin, PIC4SeR
#Author: Fra, Vitto
#Project: faceAssistant
#---------------------------
##################################################################
# Networks adapted from https://github.com/davidsandberg/facenet #
###########################################... | 37.067961 | 99 | 0.537454 |
0b921a0907113e5872238f4ed66061b3edb2b9c7 | 14,254 | py | Python | aleph/views/serializers.py | Rosencrantz/aleph | 47ac45fa72607e1ab16c7c30690013a7d00be116 | [
"MIT"
] | 2 | 2021-10-31T01:04:47.000Z | 2021-11-08T09:43:29.000Z | aleph/views/serializers.py | Rosencrantz/aleph | 47ac45fa72607e1ab16c7c30690013a7d00be116 | [
"MIT"
] | 319 | 2021-04-30T01:09:57.000Z | 2022-03-30T01:15:19.000Z | aleph/views/serializers.py | Rosencrantz/aleph | 47ac45fa72607e1ab16c7c30690013a7d00be116 | [
"MIT"
] | null | null | null | import logging
from pprint import pprint, pformat # noqa
from flask import request
from pantomime.types import PDF, CSV
from banal import ensure_list
from followthemoney import model
from followthemoney.types import registry
from followthemoney.helpers import entity_filename
from aleph.core import url_for
from aleph.... | 37.21671 | 88 | 0.605374 |
1e5ba2c5098841a772e25dfbd0d351c8f914b4c4 | 1,005 | py | Python | data_augmentation_scripts/remove_apply_exif.py | team8/outdoor-blind-navigation | 78b99fe1a193161c4b809990c71940fbed719785 | [
"MIT"
] | 6 | 2021-05-18T16:46:04.000Z | 2022-01-08T02:49:27.000Z | data_augmentation_scripts/remove_apply_exif.py | aoberai/outdoor-blind-navigation | 78b99fe1a193161c4b809990c71940fbed719785 | [
"MIT"
] | 15 | 2021-05-19T23:40:50.000Z | 2021-07-06T08:24:40.000Z | data_augmentation_scripts/remove_apply_exif.py | aoberai/outdoor-blind-navigation | 78b99fe1a193161c4b809990c71940fbed719785 | [
"MIT"
] | 4 | 2021-05-26T02:10:43.000Z | 2021-09-04T17:59:51.000Z | import os
import PIL
import PIL.Image
import PIL.ExifTags
import cv2
import numpy as np
folders = ["Left of Sidewalk", "Right of Sidewalk", "Middle of Sidewalk"]
def rotate(img_name):
img = PIL.Image.open(img_name)
if img is None:
return
exif = {
PIL.ExifTags.TAGS[k]: v
f... | 26.447368 | 73 | 0.614925 |
384204c18ea4b11a5ed221a7130e8330330d9683 | 1,872 | py | Python | ecom/models.py | mohammedrafathali/maxfashions | 3afe0c4a4530d839a347434cffc7509e422e197a | [
"MIT"
] | null | null | null | ecom/models.py | mohammedrafathali/maxfashions | 3afe0c4a4530d839a347434cffc7509e422e197a | [
"MIT"
] | null | null | null | ecom/models.py | mohammedrafathali/maxfashions | 3afe0c4a4530d839a347434cffc7509e422e197a | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Customer(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_pic = models.ImageField(
upload_to='profile_pic/CustomerProfilePic/', null=True, blank=True)
address... | 31.2 | 79 | 0.692842 |
6ae15d9fbedc619a66d6609a9a3bdf80270996b9 | 490 | py | Python | smnsr/__init__.py | rciszek/SMNSR | b151d78e93b16bca1372eb36798f5921920ef1ce | [
"MIT"
] | null | null | null | smnsr/__init__.py | rciszek/SMNSR | b151d78e93b16bca1372eb36798f5921920ef1ce | [
"MIT"
] | null | null | null | smnsr/__init__.py | rciszek/SMNSR | b151d78e93b16bca1372eb36798f5921920ef1ce | [
"MIT"
] | null | null | null | import logging.config
import yaml
import os
path = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + "logging.yaml"
env_key = "LOG_CFG"
value = os.getenv(env_key, None)
if value:
path = value
if os.path.exists(path):
with open(path, "rt") as f:
config = yaml.safe_load(f.read())
logging.... | 23.333333 | 81 | 0.712245 |
456d77d4080f0accbb78911ae4ce72c7078e8400 | 674 | py | Python | test_project/hotels/migrations/0004_auto_20171228_0314.py | squallcs12/django-modelduplication | 85aeb9768287cc9b0b768a4710c93dc8c6be4e28 | [
"MIT"
] | null | null | null | test_project/hotels/migrations/0004_auto_20171228_0314.py | squallcs12/django-modelduplication | 85aeb9768287cc9b0b768a4710c93dc8c6be4e28 | [
"MIT"
] | 3 | 2020-02-11T21:29:29.000Z | 2021-06-10T17:28:10.000Z | test_project/hotels/migrations/0004_auto_20171228_0314.py | squallcs12/django-modelduplication | 85aeb9768287cc9b0b768a4710c93dc8c6be4e28 | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2017-12-28 03:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hotels', '0003_booking_roomitem'),
]
operations = [
migrations.CreateModel(
name='Feature',
fields=[
(... | 25.923077 | 114 | 0.565282 |
77bd4b2d5fc7a9c09844a604b925aa9c9cff9497 | 18,215 | py | Python | src/zeit/content/volume/volume.py | ZeitOnline/zeit.content.volume | f5aec3e0720be5ecfbee79f4b9ce785c11ff714d | [
"BSD-3-Clause"
] | 1 | 2019-05-16T19:17:45.000Z | 2019-05-16T19:17:45.000Z | src/zeit/content/volume/volume.py | ZeitOnline/zeit.content.volume | f5aec3e0720be5ecfbee79f4b9ce785c11ff714d | [
"BSD-3-Clause"
] | 12 | 2016-08-18T08:03:03.000Z | 2019-02-27T13:57:19.000Z | src/zeit/content/volume/volume.py | ZeitOnline/zeit.content.volume | f5aec3e0720be5ecfbee79f4b9ce785c11ff714d | [
"BSD-3-Clause"
] | null | null | null | import datetime
import itertools
import logging
import requests
from zeit.cms.i18n import MessageFactory as _
import grokcore.component as grok
import lxml.objectify
import zeit.cms.content.dav
import zeit.cms.content.xmlsupport
import zeit.cms.interfaces
import zeit.cms.type
import zeit.content.cp.interfaces
import ze... | 39.857768 | 79 | 0.618062 |
3a80cc52a1f3c6aa313bb6f670687b7a0c1c4108 | 812 | py | Python | packages/machine-p2020rdb-pca/example/p2020-util.py | macdaliot/echronos | 00a4e7d90143d58d47b548e10f0a1f3b2976db8d | [
"MIT"
] | null | null | null | packages/machine-p2020rdb-pca/example/p2020-util.py | macdaliot/echronos | 00a4e7d90143d58d47b548e10f0a1f3b2976db8d | [
"MIT"
] | null | null | null | packages/machine-p2020rdb-pca/example/p2020-util.py | macdaliot/echronos | 00a4e7d90143d58d47b548e10f0a1f3b2976db8d | [
"MIT"
] | null | null | null | #
# eChronos Real-Time Operating System
# Copyright (c) 2017, Commonwealth Scientific and Industrial Research
# Organisation (CSIRO) ABN 41 687 119 230.
#
# All rights reserved. CSIRO is willing to grant you a licence to the eChronos
# real-time operating system under the terms of the CSIRO_BSD_MIT license. See
# the f... | 28 | 78 | 0.692118 |
7f391b82fd2afdec5888673437e5be45b2edea83 | 3,540 | py | Python | fandogh_cli/volume_commands.py | MXareie/fandogh-cli | 89b5a8b276d19ec1b32f74c6b32ba1ec6bcde4e0 | [
"MIT"
] | 2 | 2020-05-03T10:31:12.000Z | 2021-07-27T09:38:47.000Z | fandogh_cli/volume_commands.py | MXareie/fandogh-cli | 89b5a8b276d19ec1b32f74c6b32ba1ec6bcde4e0 | [
"MIT"
] | null | null | null | fandogh_cli/volume_commands.py | MXareie/fandogh-cli | 89b5a8b276d19ec1b32f74c6b32ba1ec6bcde4e0 | [
"MIT"
] | null | null | null | import click
from fandogh_cli.utils import format_text, TextStyle
from .presenter import present
from .base_commands import FandoghCommand
from .fandogh_client import create_volume_claim, delete_volume_claim, list_volumes
'''
This class is for volume commands
all cli commands related to volume CRUD and etc
... | 27.874016 | 106 | 0.651977 |
f1d5b79160b584c1438915b8792954710dd763f6 | 9,057 | py | Python | old/Python/simulate/simulate_original.py | conelul/Computer-Science-2021 | d5ad20643a293bb7e0e24259bb2ef43192ccb002 | [
"MIT"
] | null | null | null | old/Python/simulate/simulate_original.py | conelul/Computer-Science-2021 | d5ad20643a293bb7e0e24259bb2ef43192ccb002 | [
"MIT"
] | null | null | null | old/Python/simulate/simulate_original.py | conelul/Computer-Science-2021 | d5ad20643a293bb7e0e24259bb2ef43192ccb002 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Simulate (a Simon clone)
# By Al Sweigart al@inventwithpython.com
# http://inventwithpython.com/pygame
# Released under a "Simplified BSD" license
import random, sys, time, os, pygame
from pygame.locals import *
FPS = 60
WINDOWWIDTH = 1080
WINDOWHEIGHT = 720
FLASHSPEED = 500 # in milliseconds... | 35.517647 | 139 | 0.612786 |
7955e327c9f7060d3eb18383e4c3ea47f7df4c02 | 6,081 | py | Python | teabag_app.py | alma-frankenstein/Other-projects | ec9972125310c3cdeb353e317a94d1baca287b3a | [
"MIT"
] | null | null | null | teabag_app.py | alma-frankenstein/Other-projects | ec9972125310c3cdeb353e317a94d1baca287b3a | [
"MIT"
] | null | null | null | teabag_app.py | alma-frankenstein/Other-projects | ec9972125310c3cdeb353e317a94d1baca287b3a | [
"MIT"
] | null | null | null | # teabag app
from flask import Flask, render_template
import random as r
import os
app = Flask(__name__)
partsOfSpeech = {'nouns1': ['an aura', 'an accomplishment', 'the love', 'the life', 'the soul'],
'nouns2': ['respect', 'compassion', 'kindness', 'love', 'life', 'knowledge', 'strength',
... | 81.08 | 190 | 0.651866 |
457085e2e44ddc4e450f03a8c55c5925f4651b8f | 326 | py | Python | core/mixins.py | RENCI-NRIG/notary-service | f8b3ed91f9ea4e36ba007a3eaac7373905475a37 | [
"MIT"
] | 8 | 2019-05-27T23:00:18.000Z | 2022-03-01T11:10:39.000Z | core/mixins.py | RENCI-NRIG/notary-service | 5d519d925d011004aefd6a4acdfc8565f5b76a94 | [
"MIT"
] | 52 | 2018-10-12T18:59:43.000Z | 2022-03-28T21:16:35.000Z | core/mixins.py | RENCI-NRIG/notary-service | 5d519d925d011004aefd6a4acdfc8565f5b76a94 | [
"MIT"
] | 1 | 2020-04-30T19:34:54.000Z | 2020-04-30T19:34:54.000Z | from core import models
class AuditModelMixin(models.BaseTimestampModel,
models.BaseTrackingModel):
"""
Mixin that provides created_by, created, modified_by, modified fields
Includes
- BaseTimestampModel
- BaseTrackingModel
"""
class Meta:
abstract =... | 20.375 | 73 | 0.644172 |
2a3ffc5acffe0f67d1c341951679a742ead2f7c8 | 789 | py | Python | allink_core/core_apps/allink_seo_accordion/models.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | 5 | 2017-03-13T08:49:45.000Z | 2022-03-05T20:05:56.000Z | allink_core/core_apps/allink_seo_accordion/models.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | 28 | 2019-10-21T08:32:18.000Z | 2022-02-10T13:16:38.000Z | allink_core/core_apps/allink_seo_accordion/models.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from cms.models.pluginmodel import CMSPlugin
@python_2_unicode_compatible
class AllinkSEOAccordionContainerPlugin(CMSPlugin):
"""
A Container-Plugin for SEO Accordion content
"""
is_seo... | 23.909091 | 108 | 0.695817 |
fc83aeb6fc22e1d498da90643a5d81b71b5cc83e | 2,591 | py | Python | manimpp/mobject/mobject_update_utils.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | manimpp/mobject/mobject_update_utils.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | manimpp/mobject/mobject_update_utils.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | import inspect
import numpy as np
from manimpp.constants import DEGREES
from manimpp.constants import RIGHT
from manimpp.mobject.mobject import Mobject
def assert_is_mobject_method(method):
assert(inspect.ismethod(method))
mobject = method.__self__
assert(isinstance(mobject, Mobject))
def always(method... | 25.653465 | 66 | 0.663064 |
66ad149aa1ae1e6878f5572da5e15938282f95e2 | 2,536 | py | Python | apps/order/models.py | jakejie/ShopPro | f0cec134ae77f4449f15a0219123d6a6bce2aad2 | [
"Apache-2.0"
] | 1 | 2019-04-20T16:58:02.000Z | 2019-04-20T16:58:02.000Z | apps/order/models.py | jakejie/ShopPro | f0cec134ae77f4449f15a0219123d6a6bce2aad2 | [
"Apache-2.0"
] | 6 | 2020-06-05T19:57:58.000Z | 2021-09-08T00:49:17.000Z | apps/order/models.py | jakejie/ShopPro | f0cec134ae77f4449f15a0219123d6a6bce2aad2 | [
"Apache-2.0"
] | 1 | 2021-09-10T18:29:28.000Z | 2021-09-10T18:29:28.000Z | from django.db import models
from datetime import datetime
# 支付方式
PAY_METHOD = {
1: "货到付款",
2: "微信支付",
3: "支付宝",
4: "银联卡支付",
}
# 订单管理
class OrderList(models.Model):
user = models.ForeignKey("user.UserProfile", verbose_name="用户", on_delete=models.CASCADE)
order = models.CharField(verbose_name=... | 33.368421 | 107 | 0.68336 |
9cf4597841076171f728b43e8d693a936674f4bc | 183 | py | Python | packages/leon/bye.py | madstk1/leon | 9ba59ff717316c6f0cd57c0960f04d66cda99667 | [
"MIT"
] | 9,211 | 2019-02-10T12:32:07.000Z | 2022-03-31T07:53:55.000Z | packages/leon/bye.py | madstk1/leon | 9ba59ff717316c6f0cd57c0960f04d66cda99667 | [
"MIT"
] | 316 | 2019-02-11T03:31:05.000Z | 2022-03-26T04:21:52.000Z | packages/leon/bye.py | madstk1/leon | 9ba59ff717316c6f0cd57c0960f04d66cda99667 | [
"MIT"
] | 895 | 2019-02-10T16:37:57.000Z | 2022-03-31T08:19:30.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
def run(string, entities):
"""Leon says good bye"""
return utils.output('end', 'good_bye', utils.translate('good_bye'))
| 18.3 | 68 | 0.661202 |
620169c0bf632c1647fff0c24b3088d029fce515 | 113,540 | py | Python | synapse/models/inet.py | vertexproject/synapse | 9712e2aee63914441c59ce6cfc060fe06a2e5920 | [
"Apache-2.0"
] | 216 | 2017-01-17T18:52:50.000Z | 2022-03-31T18:44:49.000Z | synapse/models/inet.py | vertexproject/synapse | 9712e2aee63914441c59ce6cfc060fe06a2e5920 | [
"Apache-2.0"
] | 2,189 | 2017-01-17T22:31:48.000Z | 2022-03-31T20:41:45.000Z | synapse/models/inet.py | vertexproject/synapse | 9712e2aee63914441c59ce6cfc060fe06a2e5920 | [
"Apache-2.0"
] | 44 | 2017-01-17T16:50:57.000Z | 2022-03-16T18:35:52.000Z | import socket
import hashlib
import logging
import ipaddress
import email.utils
import idna
import regex
import unicodedata
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.chop as s_chop
import synapse.lib.layer as s_layer
import synapse.lib.types as s_types
import synapse.lib.scrape ... | 42.302534 | 138 | 0.364039 |
0b9379e1b4069286eaf2d5acbbeb6eb6dc2ed57f | 383 | py | Python | sourceFiles/ex48_SomaImparesMultiplosDeTres.py | mcleber/Aulas_Python | bd224b593fcf907d54c8a2b92eb3afa88d327171 | [
"MIT"
] | null | null | null | sourceFiles/ex48_SomaImparesMultiplosDeTres.py | mcleber/Aulas_Python | bd224b593fcf907d54c8a2b92eb3afa88d327171 | [
"MIT"
] | null | null | null | sourceFiles/ex48_SomaImparesMultiplosDeTres.py | mcleber/Aulas_Python | bd224b593fcf907d54c8a2b92eb3afa88d327171 | [
"MIT"
] | null | null | null | '''
Faça um programa que calcule a soma entre todos os números ímpares que
são multiplos de três e que se encontram no intervalo de 1 até 500.
'''
soma = 0 # acumulador
cont = 0 # contador
for c in range(1, 501, 2):
if c % 3 == 0:
cont = cont + 1
soma += c # soma = soma + c
print('A soma... | 29.461538 | 75 | 0.613577 |
f4296f17fe6501f0e6b9390708cbf1764290e9a4 | 307 | py | Python | worldcup18/utils.py | tadeoos/worldcup | c167251c7a6131253a1ea1914a0e6e418e9f32a7 | [
"MIT"
] | 2 | 2018-06-16T04:05:39.000Z | 2018-06-18T12:20:37.000Z | worldcup18/utils.py | tadeoos/worldcup | c167251c7a6131253a1ea1914a0e6e418e9f32a7 | [
"MIT"
] | null | null | null | worldcup18/utils.py | tadeoos/worldcup | c167251c7a6131253a1ea1914a0e6e418e9f32a7 | [
"MIT"
] | null | null | null | # - *- coding: utf- 8 - *-
from __future__ import absolute_import
import dateutil.parser
from tzlocal import get_localzone
def iso_to_datetime(s):
return dateutil.parser.parse(s)
def get_nice_date(date):
return iso_to_datetime(date).astimezone(get_localzone()).strftime("%A, %d. %B %Y %I:%M%p")
| 23.615385 | 94 | 0.726384 |
4b641ef241e121e33b749c4463117e1c6b615701 | 10,686 | py | Python | tests/core/ssl/test_ssl.py | grayfallstown/equality-blockchain | 019425b703f6b013e441481ac43389a80415f2f1 | [
"Apache-2.0"
] | 10 | 2021-07-04T15:14:12.000Z | 2021-10-17T14:52:56.000Z | tests/core/ssl/test_ssl.py | grayfallstown/equality-blockchain | 019425b703f6b013e441481ac43389a80415f2f1 | [
"Apache-2.0"
] | 11 | 2021-07-04T19:31:36.000Z | 2022-01-11T02:46:23.000Z | tests/core/ssl/test_ssl.py | grayfallstown/equality-blockchain | 019425b703f6b013e441481ac43389a80415f2f1 | [
"Apache-2.0"
] | 11 | 2021-07-04T21:49:17.000Z | 2021-10-04T17:45:38.000Z | import asyncio
import aiohttp
import pytest
from equality.protocols.shared_protocol import protocol_version
from equality.server.outbound_message import NodeType
from equality.server.server import EqualityServer, ssl_context_for_client
from equality.server.ws_connection import WSEqualityConnection
from equality.ssl.c... | 40.942529 | 126 | 0.692588 |
04c10e0304c1e27d052f0c89051c3ca4135480f6 | 18,165 | py | Python | openquake/hazardlib/gsim/bradley_2013.py | gfzriesgos/shakyground-lfs | 2caf67cc32e6800286eded2df1efb05973ccf41b | [
"BSD-3-Clause"
] | 1 | 2019-08-01T00:28:24.000Z | 2019-08-01T00:28:24.000Z | openquake/hazardlib/gsim/bradley_2013.py | gfzriesgos/shakyground-lfs | 2caf67cc32e6800286eded2df1efb05973ccf41b | [
"BSD-3-Clause"
] | 4 | 2018-08-31T14:14:35.000Z | 2021-10-11T12:53:13.000Z | openquake/hazardlib/gsim/bradley_2013.py | gfzriesgos/shakyground-lfs | 2caf67cc32e6800286eded2df1efb05973ccf41b | [
"BSD-3-Clause"
] | 3 | 2018-08-31T14:11:00.000Z | 2019-07-17T10:06:02.000Z | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | 55.045455 | 272 | 0.613047 |
320e8de89c10f0bccfbb8a67d626d4ab73dbf422 | 8,648 | py | Python | sorl/thumbnail/engines/pil_engine.py | ixc/sorl-thumbnail | d12a23492390234eed8a951a294ebc34f36dfd26 | [
"BSD-3-Clause"
] | null | null | null | sorl/thumbnail/engines/pil_engine.py | ixc/sorl-thumbnail | d12a23492390234eed8a951a294ebc34f36dfd26 | [
"BSD-3-Clause"
] | null | null | null | sorl/thumbnail/engines/pil_engine.py | ixc/sorl-thumbnail | d12a23492390234eed8a951a294ebc34f36dfd26 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division
import math
from sorl.thumbnail.engines.base import EngineBase
from sorl.thumbnail.compat import BufferIO
try:
from PIL import Image, ImageFile, ImageDraw, ImageChops, ImageFilter
except ImportError:
import Image, ImageFile, ImageDraw, ImageChops
def round_corner(radius, fill... | 35.588477 | 108 | 0.584644 |
700e1599bbf4b0bddfd1d0af752b2b73f3f533e9 | 777 | py | Python | app/tool_results/read_stats/tests/test_module.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/tool_results/read_stats/tests/test_module.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/tool_results/read_stats/tests/test_module.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | """Test suite for Read Stats tool result model."""
from app.tool_results.read_stats import ReadStatsToolResult
from app.tool_results.tool_result_test_utils.tool_result_base_test import BaseToolResultTest
from .factory import create_values
class TestReadStatsModel(BaseToolResultTest):
"""Test suite for ReadStats... | 37 | 92 | 0.754183 |
02726594f2761c15601904dfbf00d9ba30c38338 | 4,585 | py | Python | dev_interactive.py | bacarbland/dev_interactive | 030e76828deb269cc5f0b5303aee60ae82ec58de | [
"MIT"
] | null | null | null | dev_interactive.py | bacarbland/dev_interactive | 030e76828deb269cc5f0b5303aee60ae82ec58de | [
"MIT"
] | 2 | 2021-05-13T20:27:10.000Z | 2021-05-15T02:23:56.000Z | dev_interactive.py | bacarbland/dev_interactive | 030e76828deb269cc5f0b5303aee60ae82ec58de | [
"MIT"
] | null | null | null | import signal, subprocess, sys, time
'''
The objective is to make easier the development and debugging for interactive competitive programming problems.
To run it, the command is like the default interactive_runner.
I only know how to run programs with unbuffered stdout, stdin, stderr in Python.
1. python dev_interac... | 35.820313 | 115 | 0.631189 |
86841533682de4c82c111b9bb0d2624d18dadee8 | 6,157 | py | Python | datacoco_cloud/s3_to_s3_interaction.py | Phil-Ocone/datacoco-cloud | 182ba322a599a7436bbd0d834ed30c83cd82e01f | [
"MIT"
] | 1 | 2020-03-19T17:53:02.000Z | 2020-03-19T17:53:02.000Z | datacoco_cloud/s3_to_s3_interaction.py | Phil-Ocone/datacoco-cloud | 182ba322a599a7436bbd0d834ed30c83cd82e01f | [
"MIT"
] | 1 | 2021-03-25T12:56:31.000Z | 2021-03-25T13:02:24.000Z | datacoco_cloud/s3_to_s3_interaction.py | Phil-Ocone/datacoco-cloud | 182ba322a599a7436bbd0d834ed30c83cd82e01f | [
"MIT"
] | 2 | 2020-11-06T06:57:10.000Z | 2022-02-03T16:00:37.000Z | #!/usr/bin/env python
import boto3
import os
from datacoco_cloud import UNIT_TEST_KEY
import logging
class S3toS3Interaction(object):
"""
Class to simplify S3 to S3 Interactions using boto3
"""
def __init__(
self,
source_aws_key: str,
source_aws_secret: str,
target_aws... | 35.182857 | 118 | 0.450544 |
9155067295d5685c507942467d702f1866a8376e | 5,823 | py | Python | digsby/src/tests/testencodings.py | ifwe/digsby | f5fe00244744aa131e07f09348d10563f3d8fa99 | [
"Python-2.0"
] | 35 | 2015-08-15T14:32:38.000Z | 2021-12-09T16:21:26.000Z | digsby/src/tests/testencodings.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 4 | 2015-09-12T10:42:57.000Z | 2017-02-27T04:05:51.000Z | digsby/src/tests/testencodings.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 15 | 2015-07-10T23:58:07.000Z | 2022-01-23T22:16:33.000Z | import util.auxencodings
from timeit import Timer
def main():
print Timer("assert s.encode('xml').decode('xml') == s",
'from __main__ import s').timeit(50)
s = '''<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title><style>body,td,a,p,.h{font... | 342.529412 | 4,191 | 0.693972 |
43bda11954f16aad7f313c15e78fa36a458dee1a | 2,647 | py | Python | setup.py | redwardstern/python-pgm | dd2ffb36f97b0d6805db9c239e53a72f5fb0047f | [
"BSD-2-Clause"
] | null | null | null | setup.py | redwardstern/python-pgm | dd2ffb36f97b0d6805db9c239e53a72f5fb0047f | [
"BSD-2-Clause"
] | null | null | null | setup.py | redwardstern/python-pgm | dd2ffb36f97b0d6805db9c239e53a72f5fb0047f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
fro... | 32.679012 | 96 | 0.599547 |
6a709de9c289f552622f1e6d62c84814fdb722a5 | 4,493 | py | Python | tests/tensorflow/quantization/test_statistics.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 136 | 2020-06-01T14:03:31.000Z | 2020-10-28T06:10:50.000Z | tests/tensorflow/quantization/test_statistics.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 133 | 2020-05-26T13:48:04.000Z | 2020-10-28T05:25:55.000Z | tests/tensorflow/quantization/test_statistics.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 36 | 2020-05-28T08:18:39.000Z | 2020-10-27T14:46:58.000Z | """
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... | 35.944 | 102 | 0.655909 |
1efec286341ae44e0c97fcb8157cdc7319760c0a | 23,090 | py | Python | panoptic_mapping_utils/src/flat_dataset/flat_semantic_labelling.py | YuePanEdward/panoptic_mapping | 85212ed5e98b6552a75363117f7676a7676ac27f | [
"BSD-3-Clause"
] | 101 | 2021-10-19T13:05:32.000Z | 2022-03-31T13:04:07.000Z | panoptic_mapping_utils/src/flat_dataset/flat_semantic_labelling.py | YuePanEdward/panoptic_mapping | 85212ed5e98b6552a75363117f7676a7676ac27f | [
"BSD-3-Clause"
] | 4 | 2021-12-13T14:40:41.000Z | 2022-03-25T17:16:28.000Z | panoptic_mapping_utils/src/flat_dataset/flat_semantic_labelling.py | YuePanEdward/panoptic_mapping | 85212ed5e98b6552a75363117f7676a7676ac27f | [
"BSD-3-Clause"
] | 16 | 2021-12-21T10:36:34.000Z | 2022-03-22T05:40:00.000Z | #!/usr/bin/env python3
import csv
import airsim
import numpy as np
import imageio
def get_ir_ids(ir_correction_file):
# Read infrared label mapping (because airsims infrared values are screwed)
mesh_ids = []
ir_ids = [] # These match in count and order.
with open(ir_correction_file) as csvfile:
... | 40.156522 | 80 | 0.632655 |
b29305712fc2dd320ca526395c92ecac7de67926 | 1,527 | py | Python | static_res/info/prepare_resources.py | rrozek/common-objects | 614d25b4283485ebdedd512d7a0985ab9611a8a7 | [
"MIT"
] | null | null | null | static_res/info/prepare_resources.py | rrozek/common-objects | 614d25b4283485ebdedd512d7a0985ab9611a8a7 | [
"MIT"
] | null | null | null | static_res/info/prepare_resources.py | rrozek/common-objects | 614d25b4283485ebdedd512d7a0985ab9611a8a7 | [
"MIT"
] | null | null | null |
import glob
import sys
import hashlib
import os
import json
root_dir = os.path.abspath(sys.argv[1])
work_dir = os.path.join(root_dir, "res/")
result_dir = os.path.join(root_dir, "info")
print ("root: " + root_dir)
print ("work: " + work_dir)
print ("result: " + result_dir)
def hash_bytestr_iter(bytesiter, hashe... | 31.163265 | 128 | 0.680419 |
0bcd5ca2bcd13552fc7eaaefbae797adf5f0f1ea | 25,766 | py | Python | optuna/multi_objective/samplers/_motpe.py | srijan-deepsource/optuna | 2a83adf1e5104a4cde2f8f275788dc1aaf246097 | [
"MIT"
] | 1 | 2021-10-09T16:06:45.000Z | 2021-10-09T16:06:45.000Z | optuna/multi_objective/samplers/_motpe.py | srijan-deepsource/optuna | 2a83adf1e5104a4cde2f8f275788dc1aaf246097 | [
"MIT"
] | 2 | 2020-11-09T13:56:48.000Z | 2021-02-10T08:20:31.000Z | optuna/multi_objective/samplers/_motpe.py | crcrpar/optuna | d25c7ee8e103575207978ec09a14ad9a4fefa53d | [
"MIT"
] | 1 | 2020-12-25T03:27:49.000Z | 2020-12-25T03:27:49.000Z | import math
from typing import Any
from typing import Callable
from typing import cast
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import numpy as np
import optuna
from optuna import distributions
from optuna import multi_objective
from... | 40.259375 | 99 | 0.645308 |
9eaee0eb4acf1d9ea9dd71ca7263509237fbd3b9 | 3,042 | py | Python | tfcgp/ga.py | d9w/TFCGP | 641d968d6b4d46a91acb6a5d3e00d3aaa5bc227e | [
"Apache-2.0"
] | 3 | 2019-05-29T07:27:04.000Z | 2021-06-23T03:36:20.000Z | tfcgp/ga.py | d9w/TFCGP | 641d968d6b4d46a91acb6a5d3e00d3aaa5bc227e | [
"Apache-2.0"
] | null | null | null | tfcgp/ga.py | d9w/TFCGP | 641d968d6b4d46a91acb6a5d3e00d3aaa5bc227e | [
"Apache-2.0"
] | null | null | null | from tfcgp.problem import Problem
from tfcgp.chromosome import Chromosome
import numpy as np
import os
class GA:
def __init__(self, problem, config, logname='test', root_dir='.'):
self.config = config
self.problem = problem
self.max_fit = 0.0
self.population = []
for i in r... | 36.650602 | 84 | 0.574951 |
487df6b081936a292ef50ddbcf4f3d96b9cf151f | 82 | py | Python | Python-Fundamentals-June-2019/03_lists/09_sort_numbers.py | marinakolova/Python-Courses | eb95c782307be561b5026c5adafaa001b04caf4f | [
"MIT"
] | null | null | null | Python-Fundamentals-June-2019/03_lists/09_sort_numbers.py | marinakolova/Python-Courses | eb95c782307be561b5026c5adafaa001b04caf4f | [
"MIT"
] | null | null | null | Python-Fundamentals-June-2019/03_lists/09_sort_numbers.py | marinakolova/Python-Courses | eb95c782307be561b5026c5adafaa001b04caf4f | [
"MIT"
] | null | null | null | print(' <= '.join([str(n) for n in sorted([int(n) for n in input().split(' ')])])) | 82 | 82 | 0.54878 |
26bd303fad54d5d379c3b7a9de332f1cbc596526 | 650 | py | Python | opencensus/trace/ext/mysql/__init__.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | null | null | null | opencensus/trace/ext/mysql/__init__.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | 1 | 2021-06-10T23:59:36.000Z | 2021-06-10T23:59:36.000Z | opencensus/trace/ext/mysql/__init__.py | bshaffer/opencensus-python | c624558c6829982d3464a5df29b48952f1fe23bc | [
"Apache-2.0"
] | 1 | 2019-09-01T06:00:13.000Z | 2019-09-01T06:00:13.000Z | # Copyright 2017, 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... | 36.111111 | 74 | 0.763077 |
ccfa5c0d0be7112453e707fc3f4dcbc9c0d2fa75 | 127 | py | Python | regularexpression/password regular ex.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | regularexpression/password regular ex.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | regularexpression/password regular ex.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | import re
str="pooja.sahoo123@"
a=re.search(r"(^[A-Za-z0-9.@]{8})",str)
if(a):
print("valid")
else:
print("not valid")
| 15.875 | 39 | 0.582677 |
f2b9d40e29e46e525303714ee67f97a953240129 | 2,875 | py | Python | Events/dukes_archives_constants.py | grimrhapsody/StJudeSouls | c6123ceff260faa76997c1eba3c5832d75d52ece | [
"MIT"
] | null | null | null | Events/dukes_archives_constants.py | grimrhapsody/StJudeSouls | c6123ceff260faa76997c1eba3c5832d75d52ece | [
"MIT"
] | null | null | null | Events/dukes_archives_constants.py | grimrhapsody/StJudeSouls | c6123ceff260faa76997c1eba3c5832d75d52ece | [
"MIT"
] | null | null | null | import soulstruct.emevd.ds_types as dt
"""
Mimics info:
- They have special effect 5421 when they are closed and waiting to eat you.
- Warp player to Mimic model point 100 and force animation 7521.
- Issue Mimic AI command 10 (slot 0), replan, wait 0.1 seconds, and revert to command -1 (slot 0).
- Thi... | 23.185484 | 102 | 0.688696 |
1edb62d78a8b27de5a20e8d7187cd7b0aea6bcde | 23,040 | py | Python | cheapglk/casemap.py | matthewturk/zvm | d9ac7935a047cba05eaaf15384ff6f14e9aa1307 | [
"BSD-3-Clause"
] | 27 | 2016-01-02T09:00:54.000Z | 2022-02-05T20:28:28.000Z | cheapglk/casemap.py | agentcox/glknode | 1f87f3bc9bd66d6d14a7b15e330c06cff91cfcf1 | [
"MIT"
] | 3 | 2019-08-26T13:18:59.000Z | 2021-04-11T15:58:07.000Z | cheapglk/casemap.py | agentcox/glknode | 1f87f3bc9bd66d6d14a7b15e330c06cff91cfcf1 | [
"MIT"
] | 11 | 2016-06-19T08:59:40.000Z | 2021-04-11T10:54:41.000Z | #!/usr/bin/python
# Moderately dumb script to generate the Glk library tables for Unicode
# case-mapping and normalization.
#
# python casemap.py /path/to/unicode/directory > cgunigen.c
# or
# python casemap.py --js /path/to/unicode/directory > unicodemap.js
#
# The argument should be a directory which contains Unic... | 30.275953 | 136 | 0.51888 |
9dc01ad9a365fb00096f1aa4f89e4292f6933acc | 4,436 | py | Python | cogs/misc.py | bdon-htb/richard_bot | e5b9271a60ccf4e95844d637e82b51e76c3470ae | [
"MIT"
] | null | null | null | cogs/misc.py | bdon-htb/richard_bot | e5b9271a60ccf4e95844d637e82b51e76c3470ae | [
"MIT"
] | null | null | null | cogs/misc.py | bdon-htb/richard_bot | e5b9271a60ccf4e95844d637e82b51e76c3470ae | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import random
# Custom imports
import cfg
class Misc(commands.Cog):
"""A class containing miscellaneous command implementations.
"""
def __init__(self, client):
self.client = client
async def _clear(self, ctx, n, is_valid):
"""Removes n... | 34.929134 | 148 | 0.580027 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.