hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 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 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d46b3e6bd18c2456b69e5e39f37c88329572a0b2 | 16,233 | py | Python | arfpe/localize_exceptions.py | yixin-09/ARFPE | 8760b519f2b240d7880f16b2b903c5b060dd34d4 | [
"MIT"
] | 1 | 2021-06-02T02:39:34.000Z | 2021-06-02T02:39:34.000Z | arfpe/localize_exceptions.py | yixin-09/ARFPE | 8760b519f2b240d7880f16b2b903c5b060dd34d4 | [
"MIT"
] | null | null | null | arfpe/localize_exceptions.py | yixin-09/ARFPE | 8760b519f2b240d7880f16b2b903c5b060dd34d4 | [
"MIT"
] | null | null | null | import signal
signal.signal(signal.SIGALRM, handler)
NoConvergence = mp.NoConvergence
# flag 0 not need to repair 0 f
# flag 1 may need to repair 1 inf/nan f
# flag 2,3 overflow handle 2 inf inf 3 inf nan
# flag 4 domain error handle 4 nan nan
if __name__ == "__main__":
cal_exceptions()
| 30.116883 | 97 | 0.519744 | import basic_func as bf
from gen_drivfunc import *
from fpexception_detection import FPexcption_detector_whole
from fpexception_detection import get_testing_point
from math_lib import rfl
from plot_domain import plot_2vfunc_domain
from plot_domain import plot_1func_domain
from mpmath import *
import itertools
import nu... | 0 | 0 | 0 | 22 | 0 | 15,101 | 0 | 102 | 699 |
e6ab8bead5af415bf70651f3100284aa3bc4feec | 306 | py | Python | src/media/element.py | sffjunkie/media | 819912d776aa1440b533e7de0e9befb27f135ecc | [
"Apache-2.0"
] | null | null | null | src/media/element.py | sffjunkie/media | 819912d776aa1440b533e7de0e9befb27f135ecc | [
"Apache-2.0"
] | null | null | null | src/media/element.py | sffjunkie/media | 819912d776aa1440b533e7de0e9befb27f135ecc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Simon Kennedy <sffjunkie+code@gmail.com>
from collections import namedtuple
__all__ = ['Element']
_Element = namedtuple('Element', "title reader writer key log")
| 27.818182 | 65 | 0.738562 | # Copyright (c) 2015 Simon Kennedy <sffjunkie+code@gmail.com>
from collections import namedtuple
__all__ = ['Element']
_Element = namedtuple('Element', "title reader writer key log")
def Element(title, reader=None, writer=None, key=None, log=True):
return _Element(title, reader, writer, key, log)
| 0 | 0 | 0 | 0 | 0 | 97 | 0 | 0 | 23 |
422e8e1bfdb262270d10d40463304bfd76f2fbee | 1,912 | py | Python | client/UIfile/chooseserver.no.py | xutongxin1/UnitAi-project | 226ccc7d73096fd3582a55bf76593756d8033892 | [
"MIT"
] | 5 | 2019-03-23T09:21:14.000Z | 2019-10-18T11:31:10.000Z | client/UIfile/chooseserver.no.py | xutongxin1/UnitAi-project | 226ccc7d73096fd3582a55bf76593756d8033892 | [
"MIT"
] | null | null | null | client/UIfile/chooseserver.no.py | xutongxin1/UnitAi-project | 226ccc7d73096fd3582a55bf76593756d8033892 | [
"MIT"
] | 2 | 2020-01-12T06:03:44.000Z | 2020-01-17T00:23:20.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'chooseserver.no.ui'
#
# Created by: PyQt5 UI code generator 5.13.1
#
# WARNING! All changes made in this file will be lost!
| 39.020408 | 73 | 0.66318 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'chooseserver.no.ui'
#
# Created by: PyQt5 UI code generator 5.13.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog... | 57 | 0 | 0 | 1,621 | 0 | 0 | 0 | 21 | 46 |
8e40c6b17a617f18c4af241232f51410d9518006 | 5,360 | py | Python | 1_basic_models/2_logistic_regression/train_mul.py | eubchain/tfdistributedtestcase | a81f99e051537fcd860de28587f0ab2bd9b1b5d4 | [
"MIT"
] | 6 | 2018-07-30T08:47:25.000Z | 2019-01-13T16:17:31.000Z | 1_basic_models/2_logistic_regression/train_mul.py | eubchain/tfdistributedtestcase | a81f99e051537fcd860de28587f0ab2bd9b1b5d4 | [
"MIT"
] | null | null | null | 1_basic_models/2_logistic_regression/train_mul.py | eubchain/tfdistributedtestcase | a81f99e051537fcd860de28587f0ab2bd9b1b5d4 | [
"MIT"
] | 2 | 2018-11-28T09:37:26.000Z | 2018-11-29T02:51:20.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 6 12:02:05 2018
@author: eub_hmy
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import tensorflow as tf
if __name__ == '__main__':
parser = argparse.ArgumentParser()
p... | 31.529412 | 110 | 0.584328 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 6 12:02:05 2018
@author: eub_hmy
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os.path
import sys
import time
import tensorflow as tf
import pandas as pd
import numpy as np
from s... | 0 | 0 | 0 | 0 | 0 | 3,288 | 0 | 1 | 155 |
9eba321c0b82c5b907ce3ddd97d401fc4347af6f | 14,586 | py | Python | pysnmp-with-texts/FA-EXT-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/FA-EXT-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/FA-EXT-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 FA-EXT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FA-EXT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:11:49 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | 111.343511 | 1,203 | 0.777321 | #
# PySNMP MIB module FA-EXT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FA-EXT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:11:49 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | 0 | 0 | 0 | 770 | 0 | 0 | 0 | 0 | 67 |
0a999005e044b4fd06bea86861d41cb6317f5fef | 29,957 | py | Python | research/object_detection/exporter_test.py | Zhangxu0501/models | 7c8ca1647926226556e05fdd6535a35abe3100eb | [
"Apache-2.0"
] | 3,326 | 2018-01-26T22:42:25.000Z | 2022-02-16T13:16:39.000Z | research/object_detection/exporter_test.py | wzy1510300a28/models | 42a3da72313b8814ef0ced8f425af90b57313b9f | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | research/object_detection/exporter_test.py | wzy1510300a28/models | 42a3da72313b8814ef0ced8f425af90b57313b9f | [
"Apache-2.0"
] | 2,580 | 2017-05-14T14:33:41.000Z | 2022-03-31T15:04:14.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 49.515702 | 80 | 0.673198 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 28,710 | 0 | 0 | 0 | 80 | 241 |
43d9be562b85f69da1f783c9b7eee32fc6351ce2 | 878 | py | Python | pane/reader_pane.py | ddmms/JournalManagementSystem | caed0464bdb8649cba8f4d1696690fb57952b66f | [
"Apache-2.0"
] | null | null | null | pane/reader_pane.py | ddmms/JournalManagementSystem | caed0464bdb8649cba8f4d1696690fb57952b66f | [
"Apache-2.0"
] | null | null | null | pane/reader_pane.py | ddmms/JournalManagementSystem | caed0464bdb8649cba8f4d1696690fb57952b66f | [
"Apache-2.0"
] | null | null | null | import sys
if __name__ == "__main__":
app = QApplication(sys.argv)
window = ReaderPane()
window.show()
sys.exit(app.exec_())
| 22.512821 | 45 | 0.677677 | from PyQt5.Qt import *
from UI.reader_interface import Ui_MainWindow
import sys
class ReaderPane(Ui_MainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("期刊管理系统")
self.mode = "reader"
self.setupUi(self)
self.retranslateUi(self)
def log_out(self):
... | 18 | 0 | 0 | 634 | 0 | 0 | 0 | 25 | 67 |
10aea4a51cd3f3d84a77572f0197b4a8121a3db8 | 4,090 | py | Python | com/vmware/vapi/provider/filter.py | sumitrsystems/Vmware | 7705d9979bee71f02c71d63890616409044cba08 | [
"MIT"
] | null | null | null | com/vmware/vapi/provider/filter.py | sumitrsystems/Vmware | 7705d9979bee71f02c71d63890616409044cba08 | [
"MIT"
] | null | null | null | com/vmware/vapi/provider/filter.py | sumitrsystems/Vmware | 7705d9979bee71f02c71d63890616409044cba08 | [
"MIT"
] | null | null | null | """
API Provider filter
"""
__author__ = 'VMware, Inc.'
__copyright__ = 'Copyright 2015, 2017 VMware, Inc. All rights reserved. -- VMware Confidential' # pylint: disable=line-too-long
from vmware.vapi.lib.log import get_vapi_logger
logger = get_vapi_logger(__name__)
| 38.584906 | 129 | 0.682885 | """
API Provider filter
"""
__author__ = 'VMware, Inc.'
__copyright__ = 'Copyright 2015, 2017 VMware, Inc. All rights reserved. -- VMware Confidential' # pylint: disable=line-too-long
import abc
import six
from vmware.vapi.core import ApiProvider
from vmware.vapi.data.serializers.introspection import (
convert... | 0 | 3,566 | 0 | 0 | 0 | 0 | 0 | 117 | 135 |
72a794e2f400b9940054a471ba93b1bf4b828fd0 | 3,998 | py | Python | WaveBlocksND/Interface/EnergiesWavefunction.py | raoulbq/WaveBlocksND | 225b5dd9b1af1998bd40b5f6467ee959292b6a83 | [
"BSD-3-Clause"
] | 3 | 2016-09-01T21:13:54.000Z | 2020-03-23T15:45:32.000Z | WaveBlocksND/Interface/EnergiesWavefunction.py | raoulbq/WaveBlocksND | 225b5dd9b1af1998bd40b5f6467ee959292b6a83 | [
"BSD-3-Clause"
] | null | null | null | WaveBlocksND/Interface/EnergiesWavefunction.py | raoulbq/WaveBlocksND | 225b5dd9b1af1998bd40b5f6467ee959292b6a83 | [
"BSD-3-Clause"
] | 6 | 2016-03-16T15:22:01.000Z | 2021-03-13T14:06:54.000Z | """The WaveBlocks Project
Compute the kinetic and potential energies of a wavefunction.
@author: R. Bourquin
@copyright: Copyright (C) 2012, 2016 R. Bourquin
@license: Modified BSD License
"""
from numpy import zeros
from WaveBlocksND import BlockFactory
from WaveBlocksND import KineticOperator
from WaveBlocksND im... | 33.596639 | 82 | 0.650075 | """The WaveBlocks Project
Compute the kinetic and potential energies of a wavefunction.
@author: R. Bourquin
@copyright: Copyright (C) 2012, 2016 R. Bourquin
@license: Modified BSD License
"""
from numpy import zeros
from WaveBlocksND import BlockFactory
from WaveBlocksND import KineticOperator
from WaveBlocksND im... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
88be7ca8e683cde69ec490542e2e34689e718497 | 526 | py | Python | main.py | Truta446/tibia-crawler | b08f8ee7c4c9d5cd772d939b396938ebac68266e | [
"MIT"
] | null | null | null | main.py | Truta446/tibia-crawler | b08f8ee7c4c9d5cd772d939b396938ebac68266e | [
"MIT"
] | null | null | null | main.py | Truta446/tibia-crawler | b08f8ee7c4c9d5cd772d939b396938ebac68266e | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main() | 26.3 | 70 | 0.71673 | import argparse
from importlib import import_module
def main():
module = _importModule()
parsed = _getFlag()
return module.Character(parsed.name)
def _importModule():
return import_module("tibia")
def _getFlag():
parser = argparse.ArgumentParser(description="Chamado Crawler")
subparser = pars... | 0 | 0 | 0 | 0 | 0 | 367 | 0 | 8 | 113 |
8eba5dac7af060048aa386fd729dad3519619fe6 | 41,528 | py | Python | dim.py | zmwangx/dim | 899f777eb892fc9d3d5a116bd54f6840b3923b33 | [
"WTFPL"
] | 7 | 2018-10-16T22:27:54.000Z | 2022-02-28T02:34:44.000Z | dim.py | zmwangx/dim | 899f777eb892fc9d3d5a116bd54f6840b3923b33 | [
"WTFPL"
] | null | null | null | dim.py | zmwangx/dim | 899f777eb892fc9d3d5a116bd54f6840b3923b33 | [
"WTFPL"
] | 1 | 2020-09-11T21:39:04.000Z | 2020-09-11T21:39:04.000Z | """
:mod:`dim` is an HTML parser and simple DOM implementation with CSS
selector support.
:mod:`dim`
- is a single module;
- has no dependency outside `PSL <https://docs.python.org/3/library/>`_;
- is not crazy long;
- supports Python 3.6 and forward,
so the file could be directly embedded in any Python 3.4+ applica... | 33.707792 | 91 | 0.564149 | """
:mod:`dim` is an HTML parser and simple DOM implementation with CSS
selector support.
:mod:`dim`
- is a single module;
- has no dependency outside `PSL <https://docs.python.org/3/library/>`_;
- is not crazy long;
- supports Python 3.6 and forward,
so the file could be directly embedded in any Python 3.4+ applica... | 0 | 9,434 | 0 | 28,295 | 0 | 0 | 0 | 144 | 363 |
abcfacef7496538b1858c2631383079cdf3a039a | 3,654 | py | Python | projects/migrations/0011_auto_20180925_1227.py | CobwebOrg/cobweb-django | 14241326860620dbaa64f7eefc6d4b393f80d23c | [
"MIT"
] | 7 | 2017-09-14T18:52:58.000Z | 2020-05-18T21:01:20.000Z | projects/migrations/0011_auto_20180925_1227.py | CobwebOrg/cobweb-django | 14241326860620dbaa64f7eefc6d4b393f80d23c | [
"MIT"
] | 151 | 2017-09-14T18:46:02.000Z | 2022-02-10T09:18:44.000Z | projects/migrations/0011_auto_20180925_1227.py | CobwebOrg/cobweb-django | 14241326860620dbaa64f7eefc6d4b393f80d23c | [
"MIT"
] | 1 | 2017-10-29T19:37:29.000Z | 2017-10-29T19:37:29.000Z | # Generated by Django 2.1.1 on 2018-09-25 19:27
forward_map = {
'Daily': "daily",
'Weekly': "weekly",
'Monthly': "monthly",
}
reverse_map = {v: k for k, v in forward_map.items()}
| 37.285714 | 261 | 0.593596 | # Generated by Django 2.1.1 on 2018-09-25 19:27
import itertools
from django.db import migrations, models
forward_map = {
'Daily': "daily",
'Weekly': "weekly",
'Monthly': "monthly",
}
reverse_map = {v: k for k, v in forward_map.items()}
def migrate_data_forward(apps, schema_editor):
instances = ite... | 0 | 0 | 0 | 2,592 | 0 | 739 | 0 | 14 | 114 |
4c2a2d97017ac28bdc292954f6578d55154df15b | 570 | py | Python | task_assignment/migrations/0003_auto_20201117_1929.py | resourceidea/resourceideaapi | 4cc7db98f981d8f2011c1995e23e8a8655e31f75 | [
"MIT"
] | 1 | 2020-05-30T22:27:59.000Z | 2020-05-30T22:27:59.000Z | task_assignment/migrations/0003_auto_20201117_1929.py | resourceidea/resourceideaapi | 4cc7db98f981d8f2011c1995e23e8a8655e31f75 | [
"MIT"
] | 15 | 2020-02-11T21:53:08.000Z | 2021-11-02T21:20:03.000Z | task_assignment/migrations/0003_auto_20201117_1929.py | resourceidea/resourceideaapi | 4cc7db98f981d8f2011c1995e23e8a8655e31f75 | [
"MIT"
] | 1 | 2020-08-27T10:57:47.000Z | 2020-08-27T10:57:47.000Z | # Generated by Django 3.1.3 on 2020-11-17 19:29
| 30 | 194 | 0.596491 | # Generated by Django 3.1.3 on 2020-11-17 19:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('task_assignment', '0002_taskassignment_engagement'),
]
operations = [
migrations.AlterField(
model_name='taskassign... | 0 | 0 | 0 | 450 | 0 | 0 | 0 | 19 | 50 |
1aefd89580fd01e530de03fa9ef48356f341c8fd | 2,111 | py | Python | app/token_test_very.py | jarryliu/queue-sim | b21c39ab1a73b57ca4b1e2045ace0878afde3ee5 | [
"MIT"
] | null | null | null | app/token_test_very.py | jarryliu/queue-sim | b21c39ab1a73b57ca4b1e2045ace0878afde3ee5 | [
"MIT"
] | null | null | null | app/token_test_very.py | jarryliu/queue-sim | b21c39ab1a73b57ca4b1e2045ace0878afde3ee5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from queue import Queue
from fixjob import FixJob
from tokenbucket import TokenBucket
import logging, sys
import numpy as np
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
### one token bucket
numJob = 1
testDuration = 500.0
bRate = 1000.0
bucketSize = 20.0
distrNameA = "bst1"
pRate = 9... | 25.433735 | 90 | 0.657035 | #!/usr/bin/python
from scheduler import Scheduler
from queue import Queue
from fixjob import FixJob
from tokenbucket import TokenBucket
from server import Server
import logging, sys
import numpy as np
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
### one token bucket
numJob = 1
testDuration = 500.0
bRa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 45 |
a994e9a75a5f37fe1146d458441a725bac15aca9 | 4,991 | py | Python | scripts/hummingbird_gt_eval_baseline.py | GOMTAE/Hummingbird_PPO | e25646587b050d507febd20d9b11ef86c321d7e0 | [
"MIT"
] | null | null | null | scripts/hummingbird_gt_eval_baseline.py | GOMTAE/Hummingbird_PPO | e25646587b050d507febd20d9b11ef86c321d7e0 | [
"MIT"
] | null | null | null | scripts/hummingbird_gt_eval_baseline.py | GOMTAE/Hummingbird_PPO | e25646587b050d507febd20d9b11ef86c321d7e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# ROS packages required
import rospy
# Dependencies required
import gym
import os
# from stable_baselines.common.policies import MlpPolicy, MlpLstmPolicy, MlpLnLstmPolicy
# from stable_baselines.common.vec_env import DummyVecEnv
# from stable_baselines import A2C, ACKTR, DDPG, PPO1, PPO2, SAC, TR... | 54.25 | 125 | 0.791425 | #!/usr/bin/env python
# ROS packages required
import rospy
import rospkg
# Dependencies required
import gym
import os
import numpy as np
import pandas as pd
import time
# from stable_baselines.common.policies import MlpPolicy, MlpLstmPolicy, MlpLnLstmPolicy
# from stable_baselines.common.vec_env import DummyVecEnv
# f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 188 | 221 |
d93847f6ef3af83244a97a9210f3dd648304dbad | 188 | py | Python | allauth/socialaccount/providers/openstreetmap_provider/urls.py | Fuzzwah/django-allauth | 071cbef1388bb61a563d3e41197bd5b7c26664d2 | [
"MIT"
] | null | null | null | allauth/socialaccount/providers/openstreetmap_provider/urls.py | Fuzzwah/django-allauth | 071cbef1388bb61a563d3e41197bd5b7c26664d2 | [
"MIT"
] | null | null | null | allauth/socialaccount/providers/openstreetmap_provider/urls.py | Fuzzwah/django-allauth | 071cbef1388bb61a563d3e41197bd5b7c26664d2 | [
"MIT"
] | null | null | null | from allauth.socialaccount.providers.oauth_provider.urls import default_urlpatterns
from .provider import OpenStreetMapProvider
urlpatterns = default_urlpatterns(OpenStreetMapProvider)
| 26.857143 | 83 | 0.882979 | from allauth.socialaccount.providers.oauth_provider.urls import default_urlpatterns
from .provider import OpenStreetMapProvider
urlpatterns = default_urlpatterns(OpenStreetMapProvider)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
18eb6d976ec53b622aad01ece05a68e4c90f0b6b | 1,309 | py | Python | tests/test_pdf_argus.py | ryuwd/zfit-physics | 595eb68add00ab367aed5885c48eb78d15dbda0e | [
"BSD-3-Clause"
] | null | null | null | tests/test_pdf_argus.py | ryuwd/zfit-physics | 595eb68add00ab367aed5885c48eb78d15dbda0e | [
"BSD-3-Clause"
] | null | null | null | tests/test_pdf_argus.py | ryuwd/zfit-physics | 595eb68add00ab367aed5885c48eb78d15dbda0e | [
"BSD-3-Clause"
] | null | null | null | """Example test for a pdf or function"""
import zfit_physics as zphys
# Important, do the imports below
from zfit.core.testing import tester
# specify globals here. Do NOT add any TensorFlow but just pure python
param1_true = 0.3
param2_true = 1.2
# register the pdf here and provide sets of working parameter confi... | 31.166667 | 91 | 0.70741 | """Example test for a pdf or function"""
import numpy as np
import pytest
import tensorflow as tf
import zfit
import zfit_physics as zphys
# Important, do the imports below
from zfit.core.testing import tester
# specify globals here. Do NOT add any TensorFlow but just pure python
param1_true = 0.3
param2_true = 1.2
... | 0 | 0 | 0 | 0 | 0 | 775 | 0 | -19 | 135 |
ab32d8c50972507fc693927cba054c42c855b55a | 865 | py | Python | 2019/day15/day15p2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | null | null | null | 2019/day15/day15p2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | 2 | 2019-12-01T20:03:18.000Z | 2021-05-11T22:41:00.000Z | 2019/day15/day15p2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | null | null | null | file = open('./map')
m = [[c for c in line[:-1]] for line in file]
start = findStart()
dist = 0
paths = {
start: []
}
queue = [start, None]
while queue:
loc = queue.pop(0)
if not loc:
if (len(queue) == 0 or not queue[0]):
break
dist += 1
queue.append(None)
co... | 20.116279 | 66 | 0.473988 | file = open('./map')
m = [[c for c in line[:-1]] for line in file]
def findStart():
for y in range(len(m)):
for x in range(len(m[y])):
if m[y][x] == 'O':
return (y, x)
start = findStart()
dist = 0
paths = {
start: []
}
queue = [start, None]
while queue:
loc = queue.... | 0 | 0 | 0 | 0 | 0 | 119 | 0 | 0 | 23 |
1f08fa9ec314c1ab38545e061e2c627705f2f624 | 141 | py | Python | config.py | Jackqu/keypoints | f0cbc9616c595e1f2b5a36d726cdb4790cfb7df9 | [
"MIT"
] | 111 | 2018-01-18T08:35:53.000Z | 2022-02-28T19:05:25.000Z | config.py | Jackqu/keypoints | f0cbc9616c595e1f2b5a36d726cdb4790cfb7df9 | [
"MIT"
] | 7 | 2018-04-28T10:06:25.000Z | 2021-09-16T13:31:30.000Z | config.py | Jackqu/keypoints | f0cbc9616c595e1f2b5a36d726cdb4790cfb7df9 | [
"MIT"
] | 28 | 2018-03-28T05:29:26.000Z | 2022-03-29T20:36:47.000Z |
NUM_CLASSES = 14
IMG_HEIGHT = 353
IMG_WIDTH = 257
IMG_SMALL_HEIGHT = 120
IMG_SMALL_WIDTH = 96
RADIUS = 25
epochs = 10
batch_size = 64 | 11.75 | 22 | 0.723404 |
NUM_CLASSES = 14
IMG_HEIGHT = 353
IMG_WIDTH = 257
IMG_SMALL_HEIGHT = 120
IMG_SMALL_WIDTH = 96
RADIUS = 25
epochs = 10
batch_size = 64 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bca9d203e6c0118420fb7bee7c4662f7c19c4a71 | 1,420 | py | Python | API/app.py | hoops92/MyDish-DS | e6a7c7214a3614febc78e0ba973439d976cad1c0 | [
"MIT"
] | null | null | null | API/app.py | hoops92/MyDish-DS | e6a7c7214a3614febc78e0ba973439d976cad1c0 | [
"MIT"
] | null | null | null | API/app.py | hoops92/MyDish-DS | e6a7c7214a3614febc78e0ba973439d976cad1c0 | [
"MIT"
] | null | null | null | import os
from flask import Flask
from flask_cors import CORS
from flask_caching import Cache
from decouple import config
# setting up for local testing, wnat to be able to log the database
"""
We want to be able to test locally and log information for debugging
"""
# Local sqlite3 database
local_db_name = 'test.sql... | 28.979592 | 74 | 0.661268 | import os
from flask import Flask, json, jsonify, request
from flask_cors import CORS
from flask_caching import Cache
from decouple import config
import logging
# setting up for local testing, wnat to be able to log the database
"""
We want to be able to test locally and log information for debugging
"""
# Local sql... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 22 |
57b7cada042045057489fa6c29279ae9ba54f57f | 16,560 | py | Python | wokkel/test/test_xmppim.py | dustin/wokkel | 2dae171b77adb790fda54e5f66e4bfc40c3b28ac | [
"MIT"
] | 1 | 2015-11-04T10:33:54.000Z | 2015-11-04T10:33:54.000Z | wokkel/test/test_xmppim.py | dustin/wokkel | 2dae171b77adb790fda54e5f66e4bfc40c3b28ac | [
"MIT"
] | null | null | null | wokkel/test/test_xmppim.py | dustin/wokkel | 2dae171b77adb790fda54e5f66e4bfc40c3b28ac | [
"MIT"
] | null | null | null | # Copyright (c) 2003-2009 Ralph Meijer
# See LICENSE for details
"""
Tests for L{wokkel.xmppim}.
"""
NS_XML = 'http://www.w3.org/XML/1998/namespace'
NS_ROSTER = 'jabber:iq:roster'
| 33.865031 | 80 | 0.601027 | # Copyright (c) 2003-2009 Ralph Meijer
# See LICENSE for details
"""
Tests for L{wokkel.xmppim}.
"""
from twisted.internet import defer
from twisted.trial import unittest
from twisted.words.protocols.jabber.jid import JID
from twisted.words.protocols.jabber.xmlstream import toResponse
from twisted.words.xish import d... | 0 | 0 | 0 | 15,926 | 0 | 0 | 0 | 177 | 270 |
4d3b4899389408db330a5f97848edb14f5d87298 | 2,177 | py | Python | server/views/Mail/mail_config.py | gan-qi/auto-report-server | 788896a0b902244c6f2ddb9766d77f0836d15a31 | [
"MIT"
] | null | null | null | server/views/Mail/mail_config.py | gan-qi/auto-report-server | 788896a0b902244c6f2ddb9766d77f0836d15a31 | [
"MIT"
] | null | null | null | server/views/Mail/mail_config.py | gan-qi/auto-report-server | 788896a0b902244c6f2ddb9766d77f0836d15a31 | [
"MIT"
] | null | null | null | from server import api
api.add_resource(MailConfigClass, '/mailconfig')
| 28.272727 | 76 | 0.468075 | from server import api, db
from flask_restful import Resource
from flask import request, g
from server.models import MailConfig
class MailConfigClass(Resource):
"""邮箱设置,接受前端发来的邮箱信息放到数据库
"""
def option(self):
return {
'code': 20000
}
def get(self):
"""获取邮箱设置
... | 117 | 0 | 0 | 1,935 | 0 | 0 | 0 | 39 | 89 |
d0f30f7247554a65f9b9ef7e72b9c2a4f47e7e48 | 272 | py | Python | chef.py | LukaIgnjatovic/freeCodeCamp.org---Learn-Python---Full-Course-for-Beginners | 6e4fc54203da15921bd6562c1fa7a915b45b4ad1 | [
"MIT"
] | 12 | 2018-11-05T10:52:19.000Z | 2022-03-08T07:12:44.000Z | chef.py | LukaIgnjatovic/freeCodeCamp.org---Learn-Python---Full-Course-for-Beginners | 6e4fc54203da15921bd6562c1fa7a915b45b4ad1 | [
"MIT"
] | null | null | null | chef.py | LukaIgnjatovic/freeCodeCamp.org---Learn-Python---Full-Course-for-Beginners | 6e4fc54203da15921bd6562c1fa7a915b45b4ad1 | [
"MIT"
] | 17 | 2019-01-13T08:09:45.000Z | 2022-03-14T22:51:44.000Z | # "Chef" class is defined with 3 functions.
| 22.666667 | 43 | 0.636029 | # "Chef" class is defined with 3 functions.
class Chef:
def make_chicken(self):
print("The chef makes a chicken.")
def make_salad(self):
print("The chef makes a salad.")
def make_special_dish(self):
print("The chef makes BBQ ribs.")
| 0 | 0 | 0 | 206 | 0 | 0 | 0 | 0 | 22 |
91d44195f45f45dbdd55a2d82d7522fefaba269d | 686 | py | Python | max_ai/nodes/cmd1.py | mat-heim/max_ros | e01e4f5b2db96d94865d80452d41b8dcf1412232 | [
"Apache-2.0"
] | null | null | null | max_ai/nodes/cmd1.py | mat-heim/max_ros | e01e4f5b2db96d94865d80452d41b8dcf1412232 | [
"Apache-2.0"
] | null | null | null | max_ai/nodes/cmd1.py | mat-heim/max_ros | e01e4f5b2db96d94865d80452d41b8dcf1412232 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sqlite3
import os
# import time
dir = os.path.dirname(os.path.abspath(__file__))
RM = sqlite3.connect(dir + '/data/robbie_memory.db')
if __name__ == '__main__':
st = TerminalInput()
| 24.5 | 82 | 0.604956 | #!/usr/bin/env python
from nlp import NlpClass
import sqlite3
import os
# import time
from datetime import datetime
dir = os.path.dirname(os.path.abspath(__file__))
RM = sqlite3.connect(dir + '/data/robbie_memory.db')
class TerminalInput:
def __init__(self):
a = NlpClass()
debug = True
... | 0 | 0 | 0 | 389 | 0 | 0 | 0 | 11 | 68 |
fb468cac07d94d44b17a43a3dfe4feaf910c3c49 | 2,495 | py | Python | examples/navierstokes/convergence/liddrivencavity2dRe100_30/scripts/order_convergence.py | barbagroup/petibm-examples | 794de3613967c14750c750aed386602c988cff05 | [
"BSD-3-Clause"
] | 2 | 2020-08-08T13:37:32.000Z | 2021-12-01T03:22:32.000Z | examples/navierstokes/convergence/liddrivencavity2dRe100_30/scripts/order_convergence.py | barbagroup/petibm-examples | 794de3613967c14750c750aed386602c988cff05 | [
"BSD-3-Clause"
] | null | null | null | examples/navierstokes/convergence/liddrivencavity2dRe100_30/scripts/order_convergence.py | barbagroup/petibm-examples | 794de3613967c14750c750aed386602c988cff05 | [
"BSD-3-Clause"
] | 2 | 2019-12-22T08:49:01.000Z | 2021-12-01T03:22:44.000Z | """Compute the observed order of convergence for the velocity and pressure."""
import numpy
import pathlib
import petibmpy
def observed_order_convergence(fields, grids, grid_ref, ratio):
"""Compute the observed order of convergence.
Parameters
----------
fields : tuple of numpy.ndarray objects
... | 34.178082 | 79 | 0.670541 | """Compute the observed order of convergence for the velocity and pressure."""
import numpy
import pathlib
import petibmpy
def observed_order_convergence(fields, grids, grid_ref, ratio):
"""Compute the observed order of convergence.
Parameters
----------
fields : tuple of numpy.ndarray objects
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0d0bbaa0b10a0cda93dd365c9f9a310823d37682 | 3,840 | py | Python | virtual/lib/python3.7/site-packages/l/project.py | candycrushpro/pitch-project | 8f850153fa3debcd858c5a58e7296d7cbda3918b | [
"MIT"
] | null | null | null | virtual/lib/python3.7/site-packages/l/project.py | candycrushpro/pitch-project | 8f850153fa3debcd858c5a58e7296d7cbda3918b | [
"MIT"
] | null | null | null | virtual/lib/python3.7/site-packages/l/project.py | candycrushpro/pitch-project | 8f850153fa3debcd858c5a58e7296d7cbda3918b | [
"MIT"
] | null | null | null |
# TODO: Really betterpath should have a separate interface for like,
# file systems, or listable things.
for attribute in [
"basename",
"changed",
"createDirectory",
"exists",
"getAccessTime",
"getContent",
"getModificationTime",
"getStatusChangeTime",
"getsize",
"is... | 26.666667 | 79 | 0.621094 | import errno
import os
import subprocess
from bp import abstract, generic
from bp.filepath import FilePath
from characteristic import Attribute, attributes
from zope.interface import implementer
def from_path(path):
git_dir = path.child(".git")
if git_dir.isdir():
return GitPath(git_dir=git_dir, path... | 0 | 2,192 | 0 | 0 | 0 | 749 | 0 | 41 | 246 |
d3bd3cf751b1a7d5708bf0b721922a9d0c969f7a | 1,210 | py | Python | tests/test_main.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 13 | 2017-02-01T13:25:34.000Z | 2022-01-26T01:30:39.000Z | tests/test_main.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 9 | 2017-07-26T18:05:32.000Z | 2021-12-05T14:16:34.000Z | tests/test_main.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 21 | 2017-07-26T17:09:40.000Z | 2022-03-27T22:37:22.000Z | """Test methods in __main__."""
| 28.809524 | 66 | 0.657025 | """Test methods in __main__."""
from unittest.mock import patch, PropertyMock
from homeassistant import __main__ as main
@patch('sys.exit')
def test_validate_python(mock_exit):
"""Test validate Python version method."""
with patch('sys.version_info',
new_callable=PropertyMock(return_value=(2, ... | 0 | 1,064 | 0 | 0 | 0 | 0 | 0 | 45 | 68 |
ed174d67719326e48b3e7fcaef1218c9469caa7b | 2,420 | py | Python | src/pytest_print/__init__.py | pytest-dev/pytest-print | 0866aa32927fcace66480913d9d740d45c92fdac | [
"MIT"
] | 40 | 2018-08-23T08:44:30.000Z | 2022-02-03T12:09:13.000Z | src/pytest_print/__init__.py | pytest-dev/pytest-print | 0866aa32927fcace66480913d9d740d45c92fdac | [
"MIT"
] | 6 | 2018-08-23T09:26:36.000Z | 2021-08-03T10:10:32.000Z | src/pytest_print/__init__.py | pytest-dev/pytest-print | 0866aa32927fcace66480913d9d740d45c92fdac | [
"MIT"
] | 5 | 2018-11-14T20:30:17.000Z | 2021-08-03T05:56:31.000Z |
from .version import __version__
def no_op(msg: str) -> None: # noqa: U100
"""Do nothing"""
__all__ = [
"__version__",
]
| 31.428571 | 110 | 0.683471 | from datetime import datetime
from typing import Callable, Optional
import pytest
from _pytest.config.argparsing import Parser
from _pytest.fixtures import SubRequest
from _pytest.terminal import TerminalReporter
from .version import __version__
def pytest_addoption(parser: Parser) -> None:
group = parser.getgr... | 0 | 478 | 0 | 474 | 0 | 999 | 0 | 81 | 248 |
55f92793a22bd3a2267c7fffd32a635f6f8059f0 | 547 | py | Python | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-dwh/db/__init__.py | sandrobonazzola/ovirt-dwh | f1c930df2274085eff324d20ddc526860a5d6f75 | [
"Apache-2.0"
] | 5 | 2016-01-23T06:05:16.000Z | 2022-02-05T13:58:47.000Z | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-dwh/db/__init__.py | sandrobonazzola/ovirt-dwh | f1c930df2274085eff324d20ddc526860a5d6f75 | [
"Apache-2.0"
] | 17 | 2022-01-03T16:56:32.000Z | 2022-03-30T12:56:04.000Z | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-dwh/db/__init__.py | sandrobonazzola/ovirt-dwh | f1c930df2274085eff324d20ddc526860a5d6f75 | [
"Apache-2.0"
] | 22 | 2015-01-04T06:28:08.000Z | 2022-02-14T07:42:25.000Z | #
# ovirt-engine-setup -- ovirt engine setup
#
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
#
# vim: expandtab tabstop=4 shiftwidth=4
| 18.233333 | 45 | 0.758684 | #
# ovirt-engine-setup -- ovirt engine setup
#
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
#
from otopi import util
from . import connection
from . import engine_connection
from . import dbmsupgrade
from . import schema
from . import vacuum
@util.export
def createPlugins(context):
connec... | 0 | 214 | 0 | 0 | 0 | 0 | 0 | 16 | 157 |
5600876fcd2306f2741007deb9e93dbb2d82b505 | 516 | py | Python | manage.py | michael-muga/MyBlog | d4821d16279ce063aef29d3cc39bdf9643f9a893 | [
"MIT"
] | null | null | null | manage.py | michael-muga/MyBlog | d4821d16279ce063aef29d3cc39bdf9643f9a893 | [
"MIT"
] | null | null | null | manage.py | michael-muga/MyBlog | d4821d16279ce063aef29d3cc39bdf9643f9a893 | [
"MIT"
] | null | null | null | from app import create_app, db
from app.models import User
from flask_script import Manager, Server
from flask_migrate import Migrate, MigrateCommand
#creating app instance
app= create_app('production')
manager= Manager(app)
manager.add_command('server',Server)
migrate = Migrate(app,db)
manager.add_command('db',M... | 24.571429 | 49 | 0.76938 | from app import create_app,db
from app.models import User
from flask_script import Manager,Server
from flask_migrate import Migrate,MigrateCommand
from app.models import User, Blog, Comment, Quote
#creating app instance
app= create_app('production')
manager= Manager(app)
manager.add_command('server',Server)
migr... | 0 | 66 | 0 | 0 | 0 | 0 | 0 | 26 | 44 |
8943582321b54c449e92f79f4ebf0696a907b98d | 9,766 | py | Python | lib/model/interface_disc.py | Flyhigh2017/cs230_project | 93b9fa4452224b02dd336c69beab27d27a9e1579 | [
"MIT"
] | null | null | null | lib/model/interface_disc.py | Flyhigh2017/cs230_project | 93b9fa4452224b02dd336c69beab27d27a9e1579 | [
"MIT"
] | null | null | null | lib/model/interface_disc.py | Flyhigh2017/cs230_project | 93b9fa4452224b02dd336c69beab27d27a9e1579 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ impor... | 34.631206 | 132 | 0.64571 | # --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ impor... | 0 | 0 | 0 | 0 | 0 | 2,464 | 0 | 43 | 226 |
15a8d9d82682eaada8124b0a8aa712cde5d41ac3 | 8,908 | py | Python | Sketchbots/sw/labqueue/support/imaging.py | rlugojr/ChromeWebLab | 60f964b3f283c15704b7a04b7bb50cb15791e2e4 | [
"Apache-2.0"
] | 306 | 2015-01-09T14:03:44.000Z | 2017-09-16T13:03:35.000Z | Sketchbots/sw/labqueue/support/imaging.py | rlugojr/ChromeWebLab | 60f964b3f283c15704b7a04b7bb50cb15791e2e4 | [
"Apache-2.0"
] | 90 | 2019-03-26T05:36:00.000Z | 2021-07-28T05:30:16.000Z | Sketchbots/sw/labqueue/support/imaging.py | rlugojr/ChromeWebLab | 60f964b3f283c15704b7a04b7bb50cb15791e2e4 | [
"Apache-2.0"
] | 119 | 2015-01-26T15:04:33.000Z | 2017-09-13T09:30:53.000Z | # Copyright 2013 Google Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 38.396552 | 302 | 0.661652 | # Copyright 2013 Google Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -7 | 22 |
6a8bec8f64b142433ee0c87fe869fc80aad24942 | 14,784 | py | Python | apps/cifar10/cifar10_train.py | AwakerMhy/moment_neural_network | 0889f9c0ca045605ff1e88035a7bb4698d9a9d1c | [
"MIT"
] | 1 | 2021-03-02T13:46:14.000Z | 2021-03-02T13:46:14.000Z | apps/cifar10/cifar10_train.py | AwakerMhy/moment_neural_network | 0889f9c0ca045605ff1e88035a7bb4698d9a9d1c | [
"MIT"
] | null | null | null | apps/cifar10/cifar10_train.py | AwakerMhy/moment_neural_network | 0889f9c0ca045605ff1e88035a7bb4698d9a9d1c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import torchvision.transforms as transforms
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter('runs/cifar10_experiment_1')
if __name__ == "__main__":
test = Train_Cifar10_Model()
test.test_model()
| 36.684864 | 118 | 0.547551 | # -*- coding: utf-8 -*-
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
from Mnn_Core.mnn_pytorch import *
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter('runs/cifar10_experiment_1')
class Mnn_Classic(torch.nn.Module):
"""Some Information about Net""... | 12 | 0 | 0 | 14,328 | 0 | 0 | 0 | 10 | 159 |
c471b84933da4ef5831111a3071096d0a46c2389 | 2,030 | py | Python | userbot/utils/git_api.py | HitaloSama/PaperplaneMinimal | 5cf45ca4ae90ad4a52ee6d6dc679053a69fbed32 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 9 | 2020-06-11T18:47:48.000Z | 2021-11-08T18:05:37.000Z | userbot/utils/git_api.py | HitaloSama/PaperplaneMinimal | 5cf45ca4ae90ad4a52ee6d6dc679053a69fbed32 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 3 | 2020-08-28T18:37:46.000Z | 2020-09-25T15:32:29.000Z | userbot/utils/git_api.py | HitaloSama/PaperplaneMinimal | 5cf45ca4ae90ad4a52ee6d6dc679053a69fbed32 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2020-06-14T02:08:41.000Z | 2020-12-15T13:25:15.000Z | # Copyright 2020 nunopenim @github
#
# Licensed under the PEL (Penim Enterprises License), v1.0
#
# You may not use this file or any of the content within it, unless in
# compliance with the PE License
"""
used to get github api information
for github module
"""
VERSION = "1.1.0"
APIURL = "http://api.github.com/repos/... | 18.454545 | 70 | 0.679803 | # Copyright 2020 nunopenim @github
#
# Licensed under the PEL (Penim Enterprises License), v1.0
#
# You may not use this file or any of the content within it, unless in
# compliance with the PE License
"""
used to get github api information
for github module
"""
import json
import urllib.request as url
VERSION = "1.1... | 0 | 0 | 0 | 0 | 0 | 1,242 | 0 | -3 | 390 |
aa40ed7131c116cb4901c177d85fea163da84b4f | 14,035 | py | Python | torchbiggraph/operators.py | stillmatic/PyTorch-BigGraph | d7d6576281faa54ec5850e204ffc07b1268fdb04 | [
"BSD-3-Clause"
] | 3,189 | 2019-04-01T23:25:40.000Z | 2022-03-29T10:26:22.000Z | torchbiggraph/operators.py | KonstantinKlepikov/PyTorch-BigGraph | db9d1478211dcf74a24b88dae1348588c5f645fb | [
"BSD-3-Clause"
] | 238 | 2019-04-02T07:19:55.000Z | 2022-03-22T11:03:06.000Z | torchbiggraph/operators.py | KonstantinKlepikov/PyTorch-BigGraph | db9d1478211dcf74a24b88dae1348588c5f645fb | [
"BSD-3-Clause"
] | 457 | 2019-04-01T23:50:09.000Z | 2022-03-28T14:48:12.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE.txt file in the root directory of this source tree.
import torch.nn as nn
from torchbiggraph.plugin import PluginRegistry
OPERATORS = P... | 39.313725 | 88 | 0.678803 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE.txt file in the root directory of this source tree.
from abc import ABC, abstractmethod
from typing import Dict, List, NamedTuple, Option... | 0 | 10,511 | 0 | 2,074 | 0 | 440 | 0 | 121 | 457 |
e38ac759da7b0376eef33a8032c272eb47b30f0e | 1,359 | py | Python | purchase/admin.py | rajeshr188/one | 05f580a019dfda7dc45db2b49f526926914799ca | [
"MIT"
] | null | null | null | purchase/admin.py | rajeshr188/one | 05f580a019dfda7dc45db2b49f526926914799ca | [
"MIT"
] | 10 | 2020-02-11T23:31:15.000Z | 2022-03-11T23:34:34.000Z | purchase/admin.py | rajeshr188/one | 05f580a019dfda7dc45db2b49f526926914799ca | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Invoice, InvoiceItem, Payment
admin.site.register(Invoice, InvoiceAdmin)
admin.site.register(InvoiceItem, InvoiceItemAdmin)
admin.site.register(Payment, PaymentAdmin)
| 27.18 | 116 | 0.693157 | from django.contrib import admin
from django import forms
from .models import Invoice, InvoiceItem, Payment
class InvoiceAdminForm(forms.ModelForm):
class Meta:
model = Invoice
fields = '__all__'
class InvoiceAdmin(admin.ModelAdmin):
form = InvoiceAdminForm
list_display = ['slug', 'creat... | 0 | 0 | 0 | 966 | 0 | 0 | 0 | 3 | 160 |
a8963e370013a12fd378aa5d0c0f8696d3ca16bd | 879 | py | Python | input/get_input.py | mesielepush/Demi | c108d52c8e44949bc8bb67c0aef733a8772015f0 | [
"MIT"
] | null | null | null | input/get_input.py | mesielepush/Demi | c108d52c8e44949bc8bb67c0aef733a8772015f0 | [
"MIT"
] | null | null | null | input/get_input.py | mesielepush/Demi | c108d52c8e44949bc8bb67c0aef733a8772015f0 | [
"MIT"
] | null | null | null | import os
base_accounts_dir = os.path.join(os.path.abspath('TweetSuite'),'accounts')
base_accounts = [account for account in os.listdir(base_accounts_dir) if account != 'vault']
accounts_dir = os.path.abspath('accounts')
getInput(base_accounts) | 32.555556 | 96 | 0.614334 | import os
import pandas as pd
import joblib
base_accounts_dir = os.path.join(os.path.abspath('TweetSuite'),'accounts')
base_accounts = [account for account in os.listdir(base_accounts_dir) if account != 'vault']
accounts_dir = os.path.abspath('accounts')
def getInput(base_accounts):
for account in base_acco... | 0 | 0 | 0 | 0 | 0 | 571 | 0 | -10 | 67 |
a869cf5fceb7b1eb3ee0126a1b8d83f5d914c1c7 | 469 | py | Python | test/test_hcunit_fail.py | codedsk/hubcheck | 2ff506eb56ba00f035300862f8848e4168452a17 | [
"MIT"
] | 1 | 2016-02-13T13:42:23.000Z | 2016-02-13T13:42:23.000Z | test/test_hcunit_fail.py | codedsk/hubcheck | 2ff506eb56ba00f035300862f8848e4168452a17 | [
"MIT"
] | null | null | null | test/test_hcunit_fail.py | codedsk/hubcheck | 2ff506eb56ba00f035300862f8848e4168452a17 | [
"MIT"
] | null | null | null | import unittest
import pytest
import sys
pytestmark = [ pytest.mark.fail]
if __name__ == '__main__':
# unittest.main(verbosity=0)
tr = unittest.TextTestRunner(stream=sys.stdout,verbosity=0)
unittest.main(testRunner=tr,exit=False)
| 18.76 | 69 | 0.686567 | import unittest
import pytest
import sys
import hubcheck
pytestmark = [ pytest.mark.fail]
class hcunit_failure(hubcheck.testcase.TestCase):
def test_failure(self):
"""
a test that will fail
"""
self.assertFalse(True,"this is an example of a test failure")
if __name__ == '__mai... | 0 | 0 | 0 | 182 | 0 | 0 | 0 | -6 | 46 |
1c49fb62426836b9756f2971c833979c6b552fae | 2,657 | py | Python | tests/test_cdtw.py | dizcza/cdtw-python | a83fffd6fc222a1691f07421fd4dbf46dc19e0aa | [
"MIT"
] | null | null | null | tests/test_cdtw.py | dizcza/cdtw-python | a83fffd6fc222a1691f07421fd4dbf46dc19e0aa | [
"MIT"
] | null | null | null | tests/test_cdtw.py | dizcza/cdtw-python | a83fffd6fc222a1691f07421fd4dbf46dc19e0aa | [
"MIT"
] | null | null | null | import unittest
try:
DTAIDISTANCE_INSTALLED = True
except ImportError:
DTAIDISTANCE_INSTALLED = False
if __name__ == '__main__':
unittest.main()
| 33.2125 | 78 | 0.596161 | import unittest
import math
import numpy as np
from cdtw.dtw import *
from numpy.testing import assert_array_equal, assert_array_almost_equal
try:
import dtaidistance
DTAIDISTANCE_INSTALLED = True
except ImportError:
DTAIDISTANCE_INSTALLED = False
class TestCDTW(unittest.TestCase):
def test_empty(s... | 0 | 716 | 0 | 1,606 | 0 | 0 | 0 | 36 | 138 |
79b5dbd16445a2100f888cc4a828e85f56c7c609 | 15,108 | py | Python | okcupyd/details.py | sphericalcow/okcupyd | ae0a99d248c515eea9a6d21a9c89f51e299b33f5 | [
"MIT"
] | null | null | null | okcupyd/details.py | sphericalcow/okcupyd | ae0a99d248c515eea9a6d21a9c89f51e299b33f5 | [
"MIT"
] | null | null | null | okcupyd/details.py | sphericalcow/okcupyd | ae0a99d248c515eea9a6d21a9c89f51e299b33f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import inspect
import logging
log = logging.getLogger(__name__)
for id_name, detail in Details.name_detail_pairs():
if detail.id_name is None:
detail.id_name = id_name
is_declarative_detail = lambda x: (isinstance(x, type) and
issubclass(... | 36.938875 | 155 | 0.51668 | # -*- coding: utf-8 -*-
import inspect
import logging
import re
from six import string_types
from . import helpers
from . import magicnumbers
from . import util
from .magicnumbers import maps, language_map
from .xpath import xpb
log = logging.getLogger(__name__)
class Detail(object):
"""Represent a detail bel... | 0 | 8,837 | 0 | 5,370 | 0 | 0 | 0 | 21 | 225 |
7c5874f2c4499dce85163728826381b6e68c8416 | 7,654 | py | Python | env/lib/python3.9/site-packages/spline/components/bash.py | AdnanKhan27/nicstestbed | d3136e23fda8bd09706eb55d9a8c44ff0ad90730 | [
"MIT"
] | 30 | 2017-12-05T11:12:06.000Z | 2021-11-06T18:27:58.000Z | env/lib/python3.9/site-packages/spline/components/bash.py | AdnanKhan27/nicstestbed | d3136e23fda8bd09706eb55d9a8c44ff0ad90730 | [
"MIT"
] | 112 | 2017-10-15T12:13:38.000Z | 2021-01-12T22:29:58.000Z | env/lib/python3.9/site-packages/spline/components/bash.py | AdnanKhan27/nicstestbed | d3136e23fda8bd09706eb55d9a8c44ff0ad90730 | [
"MIT"
] | 6 | 2018-08-12T17:01:52.000Z | 2021-08-17T06:05:24.000Z | """Executing a bash script."""
# Copyright (c) 2017 Thomas Lehmann
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy,... | 37.336585 | 106 | 0.605304 | """Executing a bash script."""
# Copyright (c) 2017 Thomas Lehmann
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy,... | 0 | 629 | 0 | 5,599 | 0 | 0 | 0 | 4 | 254 |
06f76399a4d1b48754d402871a82545a21ae40c5 | 4,565 | py | Python | lab4.py | UnstoppableGuy/Optimization-and-control-methods | 1c690023aeb11c575e9737b407fb7c848aa3a2a8 | [
"MIT"
] | null | null | null | lab4.py | UnstoppableGuy/Optimization-and-control-methods | 1c690023aeb11c575e9737b407fb7c848aa3a2a8 | [
"MIT"
] | null | null | null | lab4.py | UnstoppableGuy/Optimization-and-control-methods | 1c690023aeb11c575e9737b407fb7c848aa3a2a8 | [
"MIT"
] | null | null | null | import numpy as np
# from lab4 import first_and_second_step_simplex_method
def double_simplex(c, b, a_matrix, j_vector):
"""reates an optimal unfeasible plan and then converts
it to a feasible one without violating optimality.
Args:
c (np.array): vector of values
b (np.array): vector of v... | 26.540698 | 77 | 0.500767 | import sys
import numpy as np
from lab1 import input_matrix, input_vector
# from lab4 import first_and_second_step_simplex_method
def double_simplex(c, b, a_matrix, j_vector):
"""Сreates an optimal unfeasible plan and then converts
it to a feasible one without violating optimality.
Args:
c (np.a... | 228 | 0 | 0 | 0 | 0 | 795 | 0 | 11 | 91 |
72c6c0ad298834b4519f5b56809e20963f45a9f1 | 46 | py | Python | raw_input.py | Lana-Pa/Getting-Started-with-Python | c4822755a579b6723cc966412bd06496870d118b | [
"Apache-2.0"
] | null | null | null | raw_input.py | Lana-Pa/Getting-Started-with-Python | c4822755a579b6723cc966412bd06496870d118b | [
"Apache-2.0"
] | null | null | null | raw_input.py | Lana-Pa/Getting-Started-with-Python | c4822755a579b6723cc966412bd06496870d118b | [
"Apache-2.0"
] | null | null | null | name = raw_input("Enter")
print"Hello " + name | 23 | 25 | 0.695652 | name = raw_input("Enter")
print"Hello " + name | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
93436186b71e85441eb5cb8c2426ffbf75b102a4 | 373 | py | Python | my_module/metadata.py | SurekaStoeckigt/Mac | f9f8be4b331cb19ff36ec640650687b6da7693bd | [
"MIT"
] | 1 | 2015-11-27T14:29:04.000Z | 2015-11-27T14:29:04.000Z | my_module/metadata.py | SurekaStoeckigt/Mac | f9f8be4b331cb19ff36ec640650687b6da7693bd | [
"MIT"
] | null | null | null | my_module/metadata.py | SurekaStoeckigt/Mac | f9f8be4b331cb19ff36ec640650687b6da7693bd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Project metadata
Information describing the project.
"""
# The package name, which is also the "UNIX name" for the project.
package = 'airport challenge'
project = "Airport Challenge in Python"
project_no_spaces = project.replace(' ', '')
version = '0.1'
description = 'Just some experimenta... | 24.866667 | 66 | 0.707775 | # -*- coding: utf-8 -*-
"""Project metadata
Information describing the project.
"""
# The package name, which is also the "UNIX name" for the project.
package = 'airport challenge'
project = "Airport Challenge in Python"
project_no_spaces = project.replace(' ', '')
version = '0.1'
description = 'Just some experimenta... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f45dc59f60c2f5ae1b6440a570f3de2f51094880 | 24,327 | py | Python | synthesize_with_latent_space.py | noetits/ophelia | 49f4b1495bbe6c768806cf3f1b0415f73e06008c | [
"Apache-2.0"
] | 26 | 2020-05-18T15:49:55.000Z | 2022-03-30T16:38:56.000Z | synthesize_with_latent_space.py | noetits/ophelia | 49f4b1495bbe6c768806cf3f1b0415f73e06008c | [
"Apache-2.0"
] | null | null | null | synthesize_with_latent_space.py | noetits/ophelia | 49f4b1495bbe6c768806cf3f1b0415f73e06008c | [
"Apache-2.0"
] | 8 | 2020-08-27T03:37:00.000Z | 2022-02-19T08:03:04.000Z | import pandas as pd
import numpy as np
# from scipy.io.wavfile import write
import logging
logging.getLogger('matplotlib.font_manager').disabled = True
import numpy as np
def mi_regression_feat_embed(X, feat_df):
'''
X corresponds to latent embeddings
feat_df is y, i.e. the acoustic features
We wan... | 40.209917 | 191 | 0.66272 | from utils import *
from data_load import load_data
import pandas as pd
import sys
import os
import glob
from argparse import ArgumentParser
import imp
import numpy as np
from utils import spectrogram2wav
# from scipy.io.wavfile import write
import soundfile as sf
import tqdm
from concurrent.futures import Process... | 0 | 0 | 0 | 0 | 0 | 21,139 | 0 | 135 | 883 |
e3f1a10563e3ed55f959f158fa486ba1b174905f | 3,160 | py | Python | scripts/network_analysis/generate_all_paths.py | mwinding/connectome_analysis | dbc747290891805863c9481921d8080dc2043d21 | [
"MIT"
] | null | null | null | scripts/network_analysis/generate_all_paths.py | mwinding/connectome_analysis | dbc747290891805863c9481921d8080dc2043d21 | [
"MIT"
] | 2 | 2022-02-10T11:03:49.000Z | 2022-02-10T11:04:08.000Z | scripts/network_analysis/generate_all_paths.py | mwinding/connectome_analysis | dbc747290891805863c9481921d8080dc2043d21 | [
"MIT"
] | null | null | null | # %%
#
import pandas as pd
from joblib import Parallel, delayed
from tqdm import tqdm
from pymaid_creds import url, name, password, token
import pymaid
import connectome_tools.celltype as ct
import connectome_tools.process_graph as pg
import connectome_tools.process_matrix as pm
rm = pymaid.CatmaidInstance(url, tok... | 42.702703 | 209 | 0.811076 | # %%
#
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import networkx as nx
from joblib import Parallel, delayed
from tqdm import tqdm
from pymaid_creds import url, name, password, token
import pymaid
import connectome_tools.cluster_analysis as clust
import connectome_too... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 110 |
47980dd92978c73d705c0a44b70d6343faa77b36 | 2,338 | py | Python | src/recording_script_generator_tests/test_app_preparation.py | stefantaubert/recording-script-generator | 01cdcd4b85ed7f245f4bb8535d870c04472746c9 | [
"MIT"
] | null | null | null | src/recording_script_generator_tests/test_app_preparation.py | stefantaubert/recording-script-generator | 01cdcd4b85ed7f245f4bb8535d870c04472746c9 | [
"MIT"
] | null | null | null | src/recording_script_generator_tests/test_app_preparation.py | stefantaubert/recording-script-generator | 01cdcd4b85ed7f245f4bb8535d870c04472746c9 | [
"MIT"
] | null | null | null | # from pathlib import Path
# from text_utils.ipa2symb import IPAExtractionSettings
# from text_utils.language import Language
# from text_utils.text import EngToIpaMode
# def test_add_corpus_from_text_file(tmp_path: Path):
# base_dir = tmp_path / "base_dir"
# text_path = tmp_path / "input.txt"
# text_path.writ... | 26.568182 | 77 | 0.662532 | # from pathlib import Path
# from text_utils.ipa2symb import IPAExtractionSettings
# from text_utils.language import Language
# from text_utils.text import EngToIpaMode
# def test_add_corpus_from_text_file(tmp_path: Path):
# base_dir = tmp_path / "base_dir"
# text_path = tmp_path / "input.txt"
# text_path.writ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a88cb734e8a4d1522640c81ae06996fd2293fe55 | 240 | py | Python | 9-C/ozljeda.py | ugoertz/l19contest | f157944074b493fe20166e3bc68899b64fe25400 | [
"CC0-1.0"
] | null | null | null | 9-C/ozljeda.py | ugoertz/l19contest | f157944074b493fe20166e3bc68899b64fe25400 | [
"CC0-1.0"
] | null | null | null | 9-C/ozljeda.py | ugoertz/l19contest | f157944074b493fe20166e3bc68899b64fe25400 | [
"CC0-1.0"
] | null | null | null | K = int(input())
a = input().split()
d = [0]
for x in a:
d.append(d[-1] ^ int(x)) # d[i] == a_1 ^ ... ^ a_i
Q = int(input())
for i in range(Q):
l, r = [int(x) for x in input().split()]
print(d[r % (K+1)] ^ d[(l-1) % (K+1)])
| 18.461538 | 55 | 0.445833 | K = int(input())
a = input().split()
d = [0]
for x in a:
d.append(d[-1] ^ int(x)) # d[i] == a_1 ^ ... ^ a_i
Q = int(input())
for i in range(Q):
l, r = [int(x) for x in input().split()]
print(d[r % (K+1)] ^ d[(l-1) % (K+1)])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58e9299903bc4d2a2b66c9a1b04f64faa9b45616 | 1,756 | py | Python | model/model.py | SohamChattopadhyayEE/RRCNN | 3bcd84bb44b68dea1d8e4dbd25923c8d4e7953ed | [
"MIT"
] | 2 | 2021-12-01T05:46:09.000Z | 2022-02-09T15:24:48.000Z | model/model.py | SohamChattopadhyayEE/RRCNN | 3bcd84bb44b68dea1d8e4dbd25923c8d4e7953ed | [
"MIT"
] | null | null | null | model/model.py | SohamChattopadhyayEE/RRCNN | 3bcd84bb44b68dea1d8e4dbd25923c8d4e7953ed | [
"MIT"
] | null | null | null | import torch.nn as nn
### Model : RRCNN-C ###
| 27.015385 | 94 | 0.588269 | import torch
import torch.nn as nn
### Model : RRCNN-C ###
class ResBlock(nn.Module):
def __init__(self, num_ft = 64, kernel_size = 3, stride = 1, padding = 1):
super(ResBlock, self).__init__()
m = []
for i in range(2):
m.append(nn.Conv1d(num_ft, num_ft, kernel_size, stride, padding))
... | 0 | 0 | 0 | 1,642 | 0 | 0 | 0 | -9 | 72 |
e1fcece13431aeff08ed9df71b6ebbbcaefc607f | 3,355 | py | Python | ailib/mdp/environment/environment.py | jeremiedecock/pyai | 5ac032b487670d258ecb3d5fa85a416c76c9871b | [
"MIT"
] | 2 | 2018-05-09T01:54:38.000Z | 2019-08-27T23:18:58.000Z | ailib/mdp/environment/environment.py | jeremiedecock/pyai | 5ac032b487670d258ecb3d5fa85a416c76c9871b | [
"MIT"
] | null | null | null | ailib/mdp/environment/environment.py | jeremiedecock/pyai | 5ac032b487670d258ecb3d5fa85a416c76c9871b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014,2015,2016,2017 Jeremie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, ... | 36.868132 | 89 | 0.70462 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014,2015,2016,2017 Jeremie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, ... | 0 | 0 | 0 | 2,044 | 0 | 0 | 0 | 14 | 45 |
85c7ad160e7e636600cc847da169e8f4264d444b | 56 | py | Python | past_archive/boj/2438(makestar).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null | past_archive/boj/2438(makestar).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null | past_archive/boj/2438(makestar).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null |
a=int(input())
for i in range(1,a+1):
print(i*'*') | 11.2 | 22 | 0.517857 |
a=int(input())
for i in range(1,a+1):
print(i*'*') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
03e222b7e10a6ab5d6b633abb4f2d30ab2e044cc | 6,320 | py | Python | Server/SpotifakeServer_TrackHandler.py | BrunoLujan/Spotifake-DESER | a811444af0a1326659dd27949c6a1c66c7cd66a1 | [
"Apache-2.0"
] | null | null | null | Server/SpotifakeServer_TrackHandler.py | BrunoLujan/Spotifake-DESER | a811444af0a1326659dd27949c6a1c66c7cd66a1 | [
"Apache-2.0"
] | null | null | null | Server/SpotifakeServer_TrackHandler.py | BrunoLujan/Spotifake-DESER | a811444af0a1326659dd27949c6a1c66c7cd66a1 | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.append("../")
sys.path.append("gen-py") | 41.578947 | 128 | 0.671203 | import sys
import os
import thriftpy
sys.path.append("../")
sys.path.append("gen-py")
from SpotifakeServices import TrackService
from SpotifakeServices.ttypes import *
from SpotifakeManagement.ttypes import *
from SQLConnection.sqlServer_track import SqlServerTrackManagement
class SpotifakeServerTrackHandler(TrackServ... | 0 | 0 | 0 | 6,021 | 0 | 0 | 0 | 84 | 156 |
f61f403e0167f05e3a18dc9f92e6651a3bbdaa15 | 2,551 | py | Python | front-parent/python/zip-test.py | jufeng98/b2c-master | 5db75cea023c0f775a56b2a872e75e8f2fe4639f | [
"Unlicense"
] | null | null | null | front-parent/python/zip-test.py | jufeng98/b2c-master | 5db75cea023c0f775a56b2a872e75e8f2fe4639f | [
"Unlicense"
] | null | null | null | front-parent/python/zip-test.py | jufeng98/b2c-master | 5db75cea023c0f775a56b2a872e75e8f2fe4639f | [
"Unlicense"
] | null | null | null | import zipfile
try:
with zipfile.ZipFile("data/hfpy_ch5_data.zip") as zipFile:
print(zipFile.namelist())
players = []
for name in zipFile.namelist():
fileContent = zipFile.read(name).decode('utf-8')
fileContent = sanitize(fileContent)
players.append(sor... | 28.988636 | 86 | 0.573893 | import zipfile
def sanitize(time):
return time.replace("-", ".").replace(":", ".")
try:
with zipfile.ZipFile("data/hfpy_ch5_data.zip") as zipFile:
print(zipFile.namelist())
players = []
for name in zipFile.namelist():
fileContent = zipFile.read(name).decode('utf-8')
... | 24 | 0 | 0 | 320 | 0 | 50 | 0 | 0 | 69 |
652211eac50ca7220594f6ac3e7cd5e4c7b797b6 | 671 | py | Python | nrf-rust-bootloaders/nrf52840-blinky-app/signatures/pyopenssl_keys/raw_signature_extract.py | nihalpasham/nrf-secureboot-test | f020df3e0240556571876e535d44ee3616cfe2ab | [
"Apache-2.0"
] | null | null | null | nrf-rust-bootloaders/nrf52840-blinky-app/signatures/pyopenssl_keys/raw_signature_extract.py | nihalpasham/nrf-secureboot-test | f020df3e0240556571876e535d44ee3616cfe2ab | [
"Apache-2.0"
] | null | null | null | nrf-rust-bootloaders/nrf52840-blinky-app/signatures/pyopenssl_keys/raw_signature_extract.py | nihalpasham/nrf-secureboot-test | f020df3e0240556571876e535d44ee3616cfe2ab | [
"Apache-2.0"
] | null | null | null | # Extract the raw 32 byte values of 'r and s' from OpenSSL's DER formatted signature. bytelen('r + s') == 64
from asn1crypto.core import Sequence
import binascii
raw64byte_sig = ''
with open("REAL_DERformat_openssl_gen_sig.bin", "rb") as f:
signature = f.read()
# parse the ASN.1 sequence from this signature
seq = ... | 35.315789 | 109 | 0.724292 | # Extract the raw 32 byte values of 'r and s' from OpenSSL's DER formatted signature. bytelen('r + s') == 64
from asn1crypto.core import Sequence
import binascii
raw64byte_sig = ''
with open("REAL_DERformat_openssl_gen_sig.bin", "rb") as f:
signature = f.read()
# parse the ASN.1 sequence from this signature
seq = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a8eb81d1e70e2a1e281eb22566f4d417e0f4494c | 800 | py | Python | hierarchy_astar_uavs/hierarchy_astar_uavs/grid_search_astar.py | jn89b/hierarchy_astar_uavs | 4714260fc1b1d8c431a5ef2f259503918b90b2ed | [
"MIT"
] | null | null | null | hierarchy_astar_uavs/hierarchy_astar_uavs/grid_search_astar.py | jn89b/hierarchy_astar_uavs | 4714260fc1b1d8c431a5ef2f259503918b90b2ed | [
"MIT"
] | null | null | null | hierarchy_astar_uavs/hierarchy_astar_uavs/grid_search_astar.py | jn89b/hierarchy_astar_uavs | 4714260fc1b1d8c431a5ef2f259503918b90b2ed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Do grid search only for uavs
should save the configurations of the uavs from hiearchy search
send this configuration to the Astar
"""
from __future__ import print_function
import pickle
def load_pkl_map(pkl_file_name):
"""returns the annotated map from a pkl file"""
with open(map... | 22.857143 | 63 | 0.73625 | # -*- coding: utf-8 -*-
"""
Do grid search only for uavs
should save the configurations of the uavs from hiearchy search
send this configuration to the Astar
"""
from __future__ import print_function
import numpy as np
import math as m
import random
from Astar import Astar, AstarGraph, AstarLowLevel
import itertool... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 221 |
243aa2e3cfe9a344e489882a124e7c3032fb2945 | 466 | py | Python | Python/math/Squares_in_2n_Chessboard.py | yashsahay2014/NeoAlgo | 4f1e5bdd6d9d899fa354de94740e0aecf5ecd2be | [
"MIT"
] | 897 | 2020-06-25T00:12:52.000Z | 2022-03-24T00:49:31.000Z | Python/math/Squares_in_2n_Chessboard.py | adarshnjena/NeoAlgo | 77a92858d2bf970054ef31c2f55a6d79917a786a | [
"MIT"
] | 5,707 | 2020-06-24T17:53:28.000Z | 2022-01-22T05:03:15.000Z | Python/math/Squares_in_2n_Chessboard.py | adarshnjena/NeoAlgo | 77a92858d2bf970054ef31c2f55a6d79917a786a | [
"MIT"
] | 1,817 | 2020-06-25T03:51:05.000Z | 2022-03-29T05:14:07.000Z | #Find total number of Squares in a N*N cheesboard.
#taking input
num = int(input("Enter the number :"))
obj = Solution()
print("The square : ")
print(obj.squares(num))
'''
Time complexity : O(N)
Space complexity : O(1)
Input :
Enter the number : 1
Output :
The square is : 1
''' | 17.259259 | 50 | 0.585837 | #Find total number of Squares in a N*N cheesboard.
class Solution:
# using mathematical logic
def squares(self, N):
sum=0
for i in range(1,N+1):
s=i*i
sum+=s
return sum
#taking input
num = int(input("Enter the number :"))
obj = Solution()
print("The squ... | 0 | 0 | 0 | 161 | 0 | 0 | 0 | 0 | 23 |
c9579a0aadf1385931d1d9db24aac5d3531e8a9d | 3,660 | py | Python | nlplr/utils/context_preview/marker.py | jwiltfang/nlp-labeling-repair | 5ba490cb5931d36e30807ff81ce56287876cd67c | [
"MIT"
] | 1 | 2021-11-17T11:25:36.000Z | 2021-11-17T11:25:36.000Z | nlplr/utils/context_preview/marker.py | jwiltfang/nlp-labeling-repair | 5ba490cb5931d36e30807ff81ce56287876cd67c | [
"MIT"
] | null | null | null | nlplr/utils/context_preview/marker.py | jwiltfang/nlp-labeling-repair | 5ba490cb5931d36e30807ff81ce56287876cd67c | [
"MIT"
] | null | null | null |
import logging
logger = logging.getLogger(__name__)
| 40.666667 | 119 | 0.605191 | import fitz
from typing import Dict, List
import logging
logger = logging.getLogger(__name__)
class Marker:
def __init__(self):
self.doc = None
self.rect_size_add = (-20, -10, 20, 10)
self.point_move = (20, 10)
self.stroke_color = (0, 0, 1)
self.fill_color_correct = (0, 1... | 0 | 709 | 0 | 2,832 | 0 | 0 | 0 | -2 | 67 |
dd6b3de66e11cb0ef4026b7ac64027ff9e5b4605 | 2,010 | py | Python | bind/libevt/python_api/test_abi.py | ZizhouJia/evt_python_api | 4c0a62a80a1d6383e0bd7610ddec261acf437f21 | [
"MIT"
] | null | null | null | bind/libevt/python_api/test_abi.py | ZizhouJia/evt_python_api | 4c0a62a80a1d6383e0bd7610ddec261acf437f21 | [
"MIT"
] | null | null | null | bind/libevt/python_api/test_abi.py | ZizhouJia/evt_python_api | 4c0a62a80a1d6383e0bd7610ddec261acf437f21 | [
"MIT"
] | null | null | null | #encoding=utf-8
import evt_abi
abi=evt_abi.evt_abi()
j=r'''
{
"name": "test",
"issuer": "EVT8MGU4aKiVzqMtWi9zLpu8KuTHZWjQQrX475ycSxEkLd6aBpraX",
"issue": {
"name": "issue",
"threshold": 1,
"authorizers": [{
"ref": "[A] EVT8MGU4aKiVzqMtWi9zLpu8KuTHZWjQQrX475ycSxEkLd6aBpraX",
"weight": 1
... | 25.125 | 472 | 0.688557 | #encoding=utf-8
import evt_abi
abi=evt_abi.evt_abi()
j=r'''
{
"name": "test",
"issuer": "EVT8MGU4aKiVzqMtWi9zLpu8KuTHZWjQQrX475ycSxEkLd6aBpraX",
"issue": {
"name": "issue",
"threshold": 1,
"authorizers": [{
"ref": "[A] EVT8MGU4aKiVzqMtWi9zLpu8KuTHZWjQQrX475ycSxEkLd6aBpraX",
"weight": 1
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
949cb3326f5275a2def522326a1a985a254afcbf | 425 | py | Python | csv/demo2.py | silianpan/seal-spider-demo | 23bf013d08f9edaf23823bc3787f579bccd0ec3a | [
"Apache-2.0"
] | null | null | null | csv/demo2.py | silianpan/seal-spider-demo | 23bf013d08f9edaf23823bc3787f579bccd0ec3a | [
"Apache-2.0"
] | 3 | 2021-09-08T01:11:16.000Z | 2022-03-02T15:14:03.000Z | csv/demo2.py | silianpan/seal-spider-demo | 23bf013d08f9edaf23823bc3787f579bccd0ec3a | [
"Apache-2.0"
] | 1 | 2019-08-04T09:57:29.000Z | 2019-08-04T09:57:29.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-06-13 14:52
# @Author : liupan
# @Site :
# @File : demo2.py
# @Software: PyCharm
import csv
with open('data.csv', 'w') as csvfile:
writer = csv.writer(csvfile, delimiter=' ')
writer.writerow(['id', 'name', 'age'])
writer.writerow(['10... | 26.5625 | 47 | 0.581176 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-06-13 14:52
# @Author : liupan
# @Site :
# @File : demo2.py
# @Software: PyCharm
import csv
with open('data.csv', 'w') as csvfile:
writer = csv.writer(csvfile, delimiter=' ')
writer.writerow(['id', 'name', 'age'])
writer.writerow(['10... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
985f2d5897f8575d465cd87d1c72d449ce7781df | 15,150 | py | Python | plugins/dbnd-spark/src/dbnd_spark/spark_targets/spark_histograms.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | plugins/dbnd-spark/src/dbnd_spark/spark_targets/spark_histograms.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | plugins/dbnd-spark/src/dbnd_spark/spark_targets/spark_histograms.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import logging
import typing
if typing.TYPE_CHECKING:
logger = logging.getLogger(__name__)
| 38.35443 | 126 | 0.624224 | from __future__ import absolute_import
import logging
import os
import time
import typing
from collections import defaultdict
import pyspark.sql as spark
from pyspark import Row
from pyspark.sql.functions import (
approx_count_distinct,
col,
count,
countDistinct,
desc,
floor,
isnull,
... | 0 | 236 | 0 | 14,127 | 0 | 0 | 0 | 349 | 303 |
89e251a803d3710ca5b759f9fb1825b2f3546560 | 2,133 | py | Python | setup.py | cinserra/S3 | eefc12265bd7824204dc5cbbd648e3ff8b291273 | [
"MIT"
] | 3 | 2017-07-24T17:35:20.000Z | 2019-11-05T15:40:45.000Z | setup.py | cinserra/S3 | eefc12265bd7824204dc5cbbd648e3ff8b291273 | [
"MIT"
] | 1 | 2018-10-24T10:46:26.000Z | 2018-10-24T10:46:26.000Z | setup.py | cinserra/S3 | eefc12265bd7824204dc5cbbd648e3ff8b291273 | [
"MIT"
] | 1 | 2021-04-12T13:03:05.000Z | 2021-04-12T13:03:05.000Z | from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
from os import sys
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
from imp import find_module
try: find_module('numpy')
except: sys.exit('### Error: python module numpy not found')
try: find_mod... | 34.403226 | 105 | 0.612283 | from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
from os import sys, path
import os,shutil,re
from glob import glob
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
from imp import find_module
try: find_module('numpy')
except: sys.exit('### Error: py... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 44 |
0a323a22d051482bd90ad5a9925048faf4178e69 | 6,075 | py | Python | bullet/panda_gripper.py | tjdalsckd/OMG-Planner | 6e40ccddb55e751de6127ea869e0265a76c1c93a | [
"MIT"
] | 52 | 2020-10-07T01:53:31.000Z | 2022-03-04T20:43:37.000Z | bullet/panda_gripper.py | tjdalsckd/OMG-Planner | 6e40ccddb55e751de6127ea869e0265a76c1c93a | [
"MIT"
] | 14 | 2020-11-08T09:28:17.000Z | 2021-11-12T01:17:27.000Z | bullet/panda_gripper.py | tjdalsckd/OMG-Planner | 6e40ccddb55e751de6127ea869e0265a76c1c93a | [
"MIT"
] | 12 | 2020-10-07T02:10:04.000Z | 2022-03-10T15:38:04.000Z | # --------------------------------------------------------
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
# adapted from https://github.com/bryandlee/franka_pybullet/tree/ac86319a0b2f6c863ba3c7ee3d52f4f51b2be3bd
if __name__ == "__main__":
rob... | 30.375 | 105 | 0.533992 | # --------------------------------------------------------
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
import pybullet as p
import os
import IPython
# adapted from https://github.com/bryandlee/franka_pybullet/tree/ac86319a0b2f6c863ba3c7ee3d52f4... | 0 | 0 | 0 | 5,663 | 0 | 0 | 0 | -20 | 89 |
e754165a29918520b0eae8907e662670afcba8d2 | 4,536 | py | Python | showtime.py | bduge/Showtime | fea78128d84d9631a46bf2ac00592edee5b57810 | [
"MIT"
] | null | null | null | showtime.py | bduge/Showtime | fea78128d84d9631a46bf2ac00592edee5b57810 | [
"MIT"
] | null | null | null | showtime.py | bduge/Showtime | fea78128d84d9631a46bf2ac00592edee5b57810 | [
"MIT"
] | null | null | null | from pandas import DataFrame
import urllib.error
import urllib.request
from bs4 import BeautifulSoup
# initializes variables used for beautifulsoup
valid = False
postcode = input("Please enter your postal code so we may show you relevant showtime information (no spaces): ")
imdb = "https://www.imdb.com/showtimes/locat... | 32.633094 | 120 | 0.6444 | from pandas import DataFrame
import urllib.error
import urllib.request
from bs4 import BeautifulSoup
# initializes variables used for beautifulsoup
valid = False
postcode = input("Please enter your postal code so we may show you relevant showtime information (no spaces): ")
imdb = "https://www.imdb.com/showtimes/locat... | 0 | 0 | 0 | 0 | 0 | 303 | 0 | 0 | 69 |
9389b24f98a0417d2bf736ba7ef8fac80af73aff | 1,001 | py | Python | test/test_crom.py | smlt/tars | 540d37cfa566ef6c656b234b8c3ce7430f2ebb59 | [
"MIT"
] | null | null | null | test/test_crom.py | smlt/tars | 540d37cfa566ef6c656b234b8c3ce7430f2ebb59 | [
"MIT"
] | null | null | null | test/test_crom.py | smlt/tars | 540d37cfa566ef6c656b234b8c3ce7430f2ebb59 | [
"MIT"
] | null | null | null | from tars.helpers.api import CromAPI
def test_crom_api():
"""Simple test cases for the Crom API wrapper."""
api = CromAPI("en")
# Honestly, the tag list seems like the only thing that I'm reasonably guaranteeing
# won't be screwed with in the future.
scp_5000 = api.get_one_page_meta("scp-5000")
... | 33.366667 | 87 | 0.686314 | from tars.helpers.api import CromAPI
def test_crom_api():
"""Simple test cases for the Crom API wrapper."""
api = CromAPI("en")
# Honestly, the tag list seems like the only thing that I'm reasonably guaranteeing
# won't be screwed with in the future.
scp_5000 = api.get_one_page_meta("scp-5000")
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec4c7e3d3e632ae0322eb3ffed63378d84e975cd | 22 | py | Python | Util/crop.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | Util/crop.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | Util/crop.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | # crop_width | 22 | 22 | 0.909091 | # 沿每个维度按crop_width裁剪数组 | 30 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3838e0e6ff36b16d6849505d4a65b649d6d1d919 | 4,642 | py | Python | tests/registries/test_requires_finalizer.py | tavaresrodrigo/kopf | 97e1c7a926705a79dabce2931e96a924252b61df | [
"MIT"
] | 855 | 2020-08-19T09:40:38.000Z | 2022-03-31T19:13:29.000Z | tests/registries/test_requires_finalizer.py | tavaresrodrigo/kopf | 97e1c7a926705a79dabce2931e96a924252b61df | [
"MIT"
] | 715 | 2019-12-23T14:17:35.000Z | 2022-03-30T20:54:45.000Z | tests/registries/test_requires_finalizer.py | tavaresrodrigo/kopf | 97e1c7a926705a79dabce2931e96a924252b61df | [
"MIT"
] | 97 | 2019-04-25T09:32:54.000Z | 2022-03-30T10:15:30.000Z |
OBJECT_BODY = {
'apiVersion': 'group/version',
'kind': 'singular',
'metadata': {
'name': 'test',
'labels': {
'key': 'value',
},
'annotations': {
'key': 'value',
}
}
}
| 31.578231 | 76 | 0.699914 | import pytest
import kopf
from kopf._core.intents.filters import PRESENT
OBJECT_BODY = {
'apiVersion': 'group/version',
'kind': 'singular',
'metadata': {
'name': 'test',
'labels': {
'key': 'value',
},
'annotations': {
'key': 'value',
}
}
... | 0 | 3,881 | 0 | 0 | 0 | 271 | 0 | 7 | 228 |
439d923f4977a7ed626f2ab2ed070915a4c9d9e6 | 2,370 | py | Python | openstack/tests/functional/vpc/v1/public_ip.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 43 | 2018-12-19T08:39:15.000Z | 2021-07-21T02:45:43.000Z | openstack/tests/functional/vpc/v1/public_ip.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 11 | 2019-03-17T13:28:56.000Z | 2020-09-23T23:57:50.000Z | openstack/tests/functional/vpc/v1/public_ip.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 47 | 2018-12-19T05:14:25.000Z | 2022-03-19T15:28:30.000Z | # -*- coding:utf-8 -*-
# Copyright 2018 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... | 25.76087 | 87 | 0.683966 | # -*- coding:utf-8 -*-
# Copyright 2018 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... | 0 | 0 | 0 | 0 | 0 | 889 | 0 | 0 | 138 |
09b56129d950870a6bb2195c853f7aec6d571ead | 12,356 | py | Python | notebooks/scripts/transform_xml_to_json.py | cclauss/discovery-starter-kit | 9a7672d50bc5570ed80de04d14065994cd8aa906 | [
"MIT"
] | 27 | 2017-05-23T17:35:14.000Z | 2020-05-01T09:05:10.000Z | notebooks/scripts/transform_xml_to_json.py | cclauss/discovery-starter-kit | 9a7672d50bc5570ed80de04d14065994cd8aa906 | [
"MIT"
] | 14 | 2017-06-07T03:03:00.000Z | 2019-07-19T19:14:04.000Z | notebooks/scripts/transform_xml_to_json.py | cclauss/discovery-starter-kit | 9a7672d50bc5570ed80de04d14065994cd8aa906 | [
"MIT"
] | 39 | 2017-06-22T11:23:03.000Z | 2021-02-18T04:29:07.000Z | import xml.etree.ElementTree
import json
import sys
import os
import hashlib
from collections import defaultdict
if '__file__' in globals():
sys.path.insert(0, os.path.join(os.path.abspath(__file__), 'scripts'))
else:
sys.path.insert(0, os.path.join(os.path.abspath(os.getcwd()), 'scripts'))
from discovery_set... | 34.805634 | 79 | 0.598576 | import xml.etree.ElementTree
import json
import sys
import os
import hashlib
from collections import defaultdict
from bs4 import BeautifulSoup
if '__file__' in globals():
sys.path.insert(0, os.path.join(os.path.abspath(__file__), 'scripts'))
else:
sys.path.insert(0, os.path.join(os.path.abspath(os.getcwd()), '... | 0 | 0 | 0 | 0 | 0 | 5,426 | 0 | 8 | 206 |
dab60e82da1671208d29430a2a2f98886cbb5204 | 4,380 | py | Python | PeopleCounter.py | SiddiqMohammed/Rain-Room-OpenCV | a77062c1a1450ada65d1fc126125b2f7d5bf97a6 | [
"MIT"
] | null | null | null | PeopleCounter.py | SiddiqMohammed/Rain-Room-OpenCV | a77062c1a1450ada65d1fc126125b2f7d5bf97a6 | [
"MIT"
] | null | null | null | PeopleCounter.py | SiddiqMohammed/Rain-Room-OpenCV | a77062c1a1450ada65d1fc126125b2f7d5bf97a6 | [
"MIT"
] | null | null | null | import numpy as np
import cv2 as cv
try:
log = open('log.txt',"w")
except:
print( "No se puede abrir el archivo log")
#Contadores de entrada y salida
cnt_up = 0
cnt_down = 0
#Fuente de video
#cap = cv.VideoCapture(0)
cap = cv.VideoCapture('Test Files/videos/TestVideo.avi')
#Imprime las propiedades de cap... | 24.886364 | 98 | 0.598402 | import numpy as np
import cv2 as cv
try:
log = open('log.txt',"w")
except:
print( "No se puede abrir el archivo log")
#Contadores de entrada y salida
cnt_up = 0
cnt_down = 0
#Fuente de video
#cap = cv.VideoCapture(0)
cap = cv.VideoCapture('Test Files/videos/TestVideo.avi')
#Imprime las propiedades de cap... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e96277acf15ea7d0cc031a3c4a9c4b0b9fc64235 | 1,344 | py | Python | tests/test_settings.py | stevearc/pyramid_duh | af14b185533d00b69dfdb8ab1cab6f1d1d8d4647 | [
"MIT"
] | 5 | 2015-12-15T09:27:16.000Z | 2017-12-12T12:56:04.000Z | tests/test_settings.py | stevearc/pyramid_duh | af14b185533d00b69dfdb8ab1cab6f1d1d8d4647 | [
"MIT"
] | null | null | null | tests/test_settings.py | stevearc/pyramid_duh | af14b185533d00b69dfdb8ab1cab6f1d1d8d4647 | [
"MIT"
] | null | null | null | """ Tests for settings utils """
try:
import unittest2 as unittest # pylint: disable=F0401
except ImportError:
| 23.172414 | 73 | 0.501488 | """ Tests for settings utils """
from pyramid_duh.settings import asdict
try:
import unittest2 as unittest # pylint: disable=F0401
except ImportError:
import unittest
class TestAsDict(unittest.TestCase):
""" Tests for asdict """
def test_default(self):
""" If provided value is a dict, ret... | 0 | 0 | 0 | 1,142 | 0 | 0 | 0 | 12 | 71 |
010b3ad09f83a6f90ac2fe5b45458643fe4959c1 | 916 | py | Python | sqds/admin.py | abey79/sqds | acab1d9c6d4a010fff9d8e89a5fdd9d94def7c89 | [
"MIT"
] | null | null | null | sqds/admin.py | abey79/sqds | acab1d9c6d4a010fff9d8e89a5fdd9d94def7c89 | [
"MIT"
] | null | null | null | sqds/admin.py | abey79/sqds | acab1d9c6d4a010fff9d8e89a5fdd9d94def7c89 | [
"MIT"
] | null | null | null |
# noinspection PyMethodMayBeStatic,PyUnusedLocal
| 19.913043 | 55 | 0.747817 | from django.contrib import admin
from .models import Unit, Skill, Gear, Guild, Category
# noinspection PyMethodMayBeStatic,PyUnusedLocal
class ReadOnlyMixin:
def has_add_permission(self, request):
return False
def has_change_permission(self, request, obj=None):
return False
def has_dele... | 0 | 326 | 0 | 284 | 0 | 0 | 0 | 44 | 205 |
1a582f50553344cd344c92b87265938fe47aec68 | 873 | py | Python | doc/examples/writing_benchmarks/pure_numpy.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/writing_benchmarks/pure_numpy.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/writing_benchmarks/pure_numpy.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
def laplace_numpy(image):
"""Laplace operator in NumPy for 2D images."""
laplacian = (
image[:-2, 1:-1]
+ image[2:, 1:-1]
+ image[1:-1, :-2]
+ image[1:-1, 2:]
- 4 * image[1:-1, 1:-1]
)
thresh = np.abs(laplacian) > 0.05
return thresh
def ... | 24.942857 | 50 | 0.408935 | import numpy as np
def laplace_numpy(image):
"""Laplace operator in NumPy for 2D images."""
laplacian = (
image[:-2, 1:-1]
+ image[2:, 1:-1]
+ image[1:-1, :-2]
+ image[1:-1, 2:]
- 4 * image[1:-1, 1:-1]
)
thresh = np.abs(laplacian) > 0.05
return thresh
def ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abfe504ef814e12dd43ea1555a6151e24ceed233 | 960 | py | Python | ev3dev/fonts/__init__.py | gorozcoh/ev3dev-lang-python | 3b2597398bc0bb0b9fe0ec88322837dbbc749e04 | [
"MIT"
] | null | null | null | ev3dev/fonts/__init__.py | gorozcoh/ev3dev-lang-python | 3b2597398bc0bb0b9fe0ec88322837dbbc749e04 | [
"MIT"
] | null | null | null | ev3dev/fonts/__init__.py | gorozcoh/ev3dev-lang-python | 3b2597398bc0bb0b9fe0ec88322837dbbc749e04 | [
"MIT"
] | null | null | null | import pkg_resources
import os.path
from PIL import ImageFont
def available():
"""
Returns list of available font names.
"""
names = []
for f in pkg_resources.resource_listdir('ev3dev.fonts', ''):
name, ext = os.path.splitext(os.path.basename(f))
if ext == '.pil':
names.... | 33.103448 | 89 | 0.652083 | import pkg_resources
import os.path
from PIL import ImageFont
def available():
"""
Returns list of available font names.
"""
names = []
for f in pkg_resources.resource_listdir('ev3dev.fonts', ''):
name, ext = os.path.splitext(os.path.basename(f))
if ext == '.pil':
names.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
833d0647d15a1de5ddeb8293e544d9462e453c19 | 38,785 | py | Python | justpy/tailwind.py | bnaard/justpy | 19d49257d9be45f713ac23a1d1eabc0ef5c727b7 | [
"Apache-2.0"
] | 855 | 2020-02-08T16:33:34.000Z | 2022-03-30T18:03:19.000Z | justpy/tailwind.py | bnaard/justpy | 19d49257d9be45f713ac23a1d1eabc0ef5c727b7 | [
"Apache-2.0"
] | 289 | 2020-02-10T21:23:57.000Z | 2022-03-25T18:29:06.000Z | justpy/tailwind.py | bnaard/justpy | 19d49257d9be45f713ac23a1d1eabc0ef5c727b7 | [
"Apache-2.0"
] | 88 | 2020-02-10T18:52:57.000Z | 2022-03-30T05:16:34.000Z | # https://tailwindcss.com
| 89.366359 | 169 | 0.454454 | # https://tailwindcss.com
class Tailwind:
# TODO: Customization - https://tailwindcss.com/docs/configuration
pseudo_classes = ['hover', 'focus', 'active', 'group-hover', 'focus-within',
'first', 'last', 'odd', 'even', 'disabled', 'visited',
'sm', 'md', 'lg', 'xl', '... | 0 | 138 | 0 | 38,595 | 0 | 0 | 0 | 0 | 23 |
afb045246c03689676286648d41b4087ca091d9b | 776 | py | Python | BettingRestAPI/csgo_api/migrations/0004_auto_20200616_1606.py | PatrickKoss/BettingPrediction | 8082bb89d00d28ade774a445a1645dc07ac86127 | [
"MIT"
] | null | null | null | BettingRestAPI/csgo_api/migrations/0004_auto_20200616_1606.py | PatrickKoss/BettingPrediction | 8082bb89d00d28ade774a445a1645dc07ac86127 | [
"MIT"
] | null | null | null | BettingRestAPI/csgo_api/migrations/0004_auto_20200616_1606.py | PatrickKoss/BettingPrediction | 8082bb89d00d28ade774a445a1645dc07ac86127 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-06-16 14:06
| 26.758621 | 82 | 0.585052 | # Generated by Django 3.0.2 on 2020-06-16 14:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('csgo_api', '0003_matchresult'),
]
operations = [
migrations.AddField(
model_name='match',
name='mode',
f... | 0 | 0 | 0 | 662 | 0 | 0 | 0 | 19 | 46 |
3976a2b86f0da08d18bae2e23750f9dbfd07df4f | 1,095 | py | Python | test/fixtures/after/nodes_with_global_param.launch.py | aws-robotics/ros2-launch-file-migrator | 36cfc5ed3bdc6ba4ed64cabb1ceef23c3dc33502 | [
"Apache-2.0"
] | 24 | 2019-12-19T16:00:48.000Z | 2021-12-26T12:06:48.000Z | test/fixtures/after/nodes_with_global_param.launch.py | aws-robotics/ros2-launch-file-migrator | 36cfc5ed3bdc6ba4ed64cabb1ceef23c3dc33502 | [
"Apache-2.0"
] | 2 | 2020-07-07T09:11:26.000Z | 2022-01-21T15:35:45.000Z | test/fixtures/after/nodes_with_global_param.launch.py | aws-robotics/ros2-launch-file-migrator | 36cfc5ed3bdc6ba4ed64cabb1ceef23c3dc33502 | [
"Apache-2.0"
] | 11 | 2020-07-07T09:24:58.000Z | 2021-10-30T02:54:57.000Z |
if __name__ == '__main__':
generate_launch_description()
| 26.071429 | 92 | 0.550685 | import os
import sys
import launch
import launch_ros.actions
def generate_launch_description():
ld = launch.LaunchDescription([
launch.actions.DeclareLaunchArgument(
name='use_sim_time',
default_value='true'
),
launch_ros.actions.Node(
package='python_l... | 0 | 0 | 0 | 0 | 0 | 946 | 0 | -27 | 112 |
9103fff44b143b91e4d817b027ea2bcadaecc18c | 12,232 | py | Python | functions/slack/blocks.py | harvard-dce/zoom-ingester | ef5c8910e35e84d33f1c612cfb4643309c52040d | [
"Apache-2.0"
] | null | null | null | functions/slack/blocks.py | harvard-dce/zoom-ingester | ef5c8910e35e84d33f1c612cfb4643309c52040d | [
"Apache-2.0"
] | null | null | null | functions/slack/blocks.py | harvard-dce/zoom-ingester | ef5c8910e35e84d33f1c612cfb4643309c52040d | [
"Apache-2.0"
] | null | null | null | from os import getenv as env
import logging
logger = logging.getLogger()
STACK_NAME = env("STACK_NAME")
PRETTY_TIMESTAMP_FORMAT = "%A, %B %d, %Y at %-I:%M%p"
SHORT_TIMESTAMP_FORMAT = "%m/%d/%y %-I:%M%p"
LOCAL_TIME_ZONE = env("LOCAL_TIME_ZONE")
OC_CLUSTER_NAME = env("OC_CLUSTER_NAME")
# Slack places an upper limit o... | 28.579439 | 124 | 0.557472 | from os import getenv as env
from urllib.parse import quote
from datetime import datetime
from pytz import timezone
import json
from utils import (
TIMESTAMP_FORMAT,
retrieve_schedule,
schedule_days,
schedule_match,
PipelineStatus,
ZoomStatus,
)
import logging
logger = logging.getLogger()
ST... | 0 | 0 | 0 | 0 | 0 | 11,106 | 0 | 131 | 409 |
80cd76881a2897a7c1ed288e554e384c605b5f3f | 513 | py | Python | data/waseem_split.py | mbevila/contextualizing-hate-speech-models-with-explanations | 1ebf0f412da85789378a5980989616f0cf28e4c7 | [
"MIT"
] | null | null | null | data/waseem_split.py | mbevila/contextualizing-hate-speech-models-with-explanations | 1ebf0f412da85789378a5980989616f0cf28e4c7 | [
"MIT"
] | null | null | null | data/waseem_split.py | mbevila/contextualizing-hate-speech-models-with-explanations | 1ebf0f412da85789378a5980989616f0cf28e4c7 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
from argparse import ArgumentParser
import fileinput
parser = ArgumentParser()
parser.add_argument('--kind', choices=['sexism', 'racism'])
args = parser.parse_args()
print('doc_id\ttext\tis_hate')
for i, line in enumerate(fileinput.input('-')):
line = ... | 24.428571 | 63 | 0.580897 |
if __name__ == '__main__':
from argparse import ArgumentParser
import fileinput
parser = ArgumentParser()
parser.add_argument('--kind', choices=['sexism', 'racism'])
args = parser.parse_args()
print('doc_id\ttext\tis_hate')
for i, line in enumerate(fileinput.input('-')):
line = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
802ef265660e2c5b22d357edf57453d1060efda3 | 2,810 | py | Python | app/api_dap2/dap2.py | NCEI-NOAAGov/zarrdap | 5cff730a62d53ba9e6fb59b2925c1efeb883a6bf | [
"NetCDF"
] | 17 | 2022-02-24T22:06:02.000Z | 2022-03-20T13:25:05.000Z | app/api_dap2/dap2.py | NCEI-NOAAGov/zarrdap | 5cff730a62d53ba9e6fb59b2925c1efeb883a6bf | [
"NetCDF"
] | null | null | null | app/api_dap2/dap2.py | NCEI-NOAAGov/zarrdap | 5cff730a62d53ba9e6fb59b2925c1efeb883a6bf | [
"NetCDF"
] | 3 | 2022-02-24T22:06:09.000Z | 2022-03-20T13:26:04.000Z | from fastapi import APIRouter
import s3fs
router = APIRouter()
s3 = s3fs.S3FileSystem(anon=False, client_kwargs={"region_name": "us-east-1"})
HEADERS = {
"XDODS-Server": "opendap/3.7",
"Accept-Ranges": "bytes",
"Connection": "close"
}
| 37.972973 | 106 | 0.702491 | from fastapi import APIRouter, Query, Response, Request
from fastapi.encoders import jsonable_encoder
from fastapi.responses import JSONResponse
import json
from pydantic import BaseModel
import s3fs
from typing import Optional, TypedDict
from .backend import *
router = APIRouter()
s3 = s3fs.S3FileSystem(anon=False, ... | 0 | 2,053 | 0 | 144 | 0 | 0 | 0 | 88 | 271 |
656fc8d586311c4463d81e3bc91f7c2f2c3dc609 | 5,942 | py | Python | src/PlateRecognition.py | rohanabhishek/License-Plate-Recognition | 8a03e46f3026209a8588483dc978fb67508e5232 | [
"BSD-3-Clause"
] | null | null | null | src/PlateRecognition.py | rohanabhishek/License-Plate-Recognition | 8a03e46f3026209a8588483dc978fb67508e5232 | [
"BSD-3-Clause"
] | null | null | null | src/PlateRecognition.py | rohanabhishek/License-Plate-Recognition | 8a03e46f3026209a8588483dc978fb67508e5232 | [
"BSD-3-Clause"
] | 1 | 2020-07-21T10:25:26.000Z | 2020-07-21T10:25:26.000Z | import sys
import numpy as np
import matplotlib.pyplot as plt
from skimage import measure
from skimage.measure import regionprops
import matplotlib.patches as patches
from skimage.color import rgb2gray
from skimage.io import imread
from skimage.filters import threshold_otsu
from PIL import Image
plate_like_objects = ... | 34.546512 | 160 | 0.683608 | import sys
import cv2
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import resize
from skimage import measure
from skimage.measure import regionprops
import matplotlib.patches as patches
from skimage.color import rgb2gray
from skimage.io import imread
from skimage.filters import threshold_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 112 |
87cd4f9c50ca4bd5548353f5ba0c0cf7fe38746a | 29,795 | py | Python | mripy/paraproc.py | herrlich10/mripy | df9a8e57a21163579af49c59a9dcd2da279cb9fa | [
"MIT"
] | 3 | 2020-08-05T10:18:59.000Z | 2022-01-19T08:28:16.000Z | mripy/paraproc.py | herrlich10/mripy | df9a8e57a21163579af49c59a9dcd2da279cb9fa | [
"MIT"
] | null | null | null | mripy/paraproc.py | herrlich10/mripy | df9a8e57a21163579af49c59a9dcd2da279cb9fa | [
"MIT"
] | 4 | 2020-08-19T05:06:16.000Z | 2021-02-03T09:53:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 herrlich10@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | 48.211974 | 185 | 0.606209 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 herrlich10@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | 0 | 3,245 | 0 | 19,069 | 0 | 764 | 0 | 68 | 188 |
1030908208c568a2e99fa01559e8eec5cf51ef22 | 308 | py | Python | home/urls.py | nicolasmontenegro/emprenred | 906ea24e8b6357b109e24c140fd92fc24bb33e79 | [
"Apache-2.0"
] | null | null | null | home/urls.py | nicolasmontenegro/emprenred | 906ea24e8b6357b109e24c140fd92fc24bb33e79 | [
"Apache-2.0"
] | null | null | null | home/urls.py | nicolasmontenegro/emprenred | 906ea24e8b6357b109e24c140fd92fc24bb33e79 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
url(r'^login/$', auth_views.login, {'template_name': 'auth/login.html'}, name='login'),
url(r'^logout/$', auth_views.logout, name='logout'),
url(r'^$', views.home, name='Home'),
] | 30.8 | 88 | 0.691558 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
url(r'^login/$', auth_views.login, {'template_name': 'auth/login.html'}, name='login'),
url(r'^logout/$', auth_views.logout, name='logout'),
url(r'^$', views.home, name='Home'),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bbf49e60c7e2598d524afa3c9e6b498a5951e4b3 | 1,551 | py | Python | karma.py | bayerj/karma | 5a8415caa6c3d86f46ae098ee8430de6fd6a49a8 | [
"BSD-3-Clause"
] | null | null | null | karma.py | bayerj/karma | 5a8415caa6c3d86f46ae098ee8430de6fd6a49a8 | [
"BSD-3-Clause"
] | null | null | null | karma.py | bayerj/karma | 5a8415caa6c3d86f46ae098ee8430de6fd6a49a8 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
| 22.478261 | 63 | 0.589942 | # -*- coding: utf-8 -*-
import random
import numpy as np
class Agent(object):
def __init__(self, n_state, n_action):
self.n_state = n_state
self.n_action = n_action
def action(self, state, reward=None):
pass
def reset(self):
pass
class Environment(object):
def ... | 0 | 0 | 0 | 1,074 | 321 | 0 | 0 | -11 | 138 |
43ab02130e03e9dc87fd6fc4f94260796d9b565e | 585 | pyw | Python | Chapter20/callMouseTrack.pyw | PacktPublishing/Python-GUI-Programming-A-Complete-Reference-Guide | f5202087be74e14deca3f85a537cde3d83bd9d1c | [
"MIT"
] | 26 | 2019-06-18T06:41:12.000Z | 2022-01-09T18:12:00.000Z | Chapter20/callMouseTrack.pyw | PacktPublishing/Python-GUI-Programming-A-Complete-Reference-Guide | f5202087be74e14deca3f85a537cde3d83bd9d1c | [
"MIT"
] | null | null | null | Chapter20/callMouseTrack.pyw | PacktPublishing/Python-GUI-Programming-A-Complete-Reference-Guide | f5202087be74e14deca3f85a537cde3d83bd9d1c | [
"MIT"
] | 27 | 2019-06-19T19:24:01.000Z | 2021-09-13T03:29:06.000Z | import sys
from PyQt5.QtWidgets import QApplication
if __name__=="__main__":
app = QApplication(sys.argv)
w = MyForm()
w.show()
sys.exit(app.exec_())
| 24.375 | 49 | 0.565812 | import sys
from PyQt5.QtWidgets import QDialog, QApplication
from demoMousetrack import *
class MyForm(QDialog):
def __init__(self):
super().__init__()
self.ui = Ui_Dialog()
self.setMouseTracking(True)
self.ui.setupUi(self)
self.show()
def mouseMoveEvent(self... | 0 | 0 | 0 | 353 | 0 | 0 | 0 | 16 | 45 |
eeb2e819675cf031ab141018d28b7dfb5cdc7186 | 284 | py | Python | 2.py | Polar1ty/euler_problems | bc1cd917d95d1b63b80a0b182dbd5e9f90a95d90 | [
"MIT"
] | 2 | 2020-06-09T10:35:12.000Z | 2020-06-09T11:32:16.000Z | 2.py | Polar1ty/euler_problems | bc1cd917d95d1b63b80a0b182dbd5e9f90a95d90 | [
"MIT"
] | null | null | null | 2.py | Polar1ty/euler_problems | bc1cd917d95d1b63b80a0b182dbd5e9f90a95d90 | [
"MIT"
] | null | null | null | fibo = [1, 2]
fibo_2 = []
i = 0
while True:
a = fibo[-2] + fibo[-1]
fibo.append(a)
i += 1
if a > 4000000:
del fibo[-1]
break
print(fibo)
for c in fibo:
print(c)
if c % 2 == 0:
fibo_2.append(c)
print(sum(fibo_2)) | 13.52381 | 28 | 0.447183 | fibo = [1, 2]
fibo_2 = []
i = 0
while True:
a = fibo[-2] + fibo[-1]
fibo.append(a)
i += 1
if a > 4000000:
del fibo[-1]
break
print(fibo)
for c in fibo:
print(c)
if c % 2 == 0:
fibo_2.append(c)
print(sum(fibo_2)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
828b1aa2142a892b015173a02cca8deed0099c9a | 2,586 | py | Python | app/__init__.py | isabella232/rva-screening | 99f03a6863c41f159ca12a60c7e34652f4a2e3c3 | [
"BSD-3-Clause"
] | 12 | 2015-06-07T01:21:29.000Z | 2020-06-27T00:19:31.000Z | app/__init__.py | codeforamerica/rva-screening | 99f03a6863c41f159ca12a60c7e34652f4a2e3c3 | [
"BSD-3-Clause"
] | 197 | 2015-03-20T20:54:17.000Z | 2015-11-17T18:06:02.000Z | app/__init__.py | isabella232/rva-screening | 99f03a6863c41f159ca12a60c7e34652f4a2e3c3 | [
"BSD-3-Clause"
] | 11 | 2015-09-03T20:00:45.000Z | 2021-04-16T10:12:50.000Z | from flask.ext.babel import Babel
from flask.ext.bcrypt import Bcrypt
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy
from flask_mail import Mail
from flask_s3 import FlaskS3
db = SQLAlchemy()
bcrypt = Bcrypt()
babel = Babel()
login_manager = LoginManager()
s3 = FlaskS3()
mai... | 27.806452 | 69 | 0.708043 | import sys
import logging
from flask import Flask, render_template
from flask.ext.babel import Babel
from flask.ext.bcrypt import Bcrypt
from flask.ext.login import LoginManager
from flask.ext.security import Security, SQLAlchemyUserDatastore
from flask.ext.sqlalchemy import SQLAlchemy
from flask_mail import Mail
from ... | 0 | 553 | 0 | 0 | 0 | 1,425 | 0 | 52 | 225 |
4ff426f8f33d19e6007ab46e883b7e50c434cee3 | 574 | py | Python | herencia.py | codeneomatrix/curso-python | bfe7d8b1d05989b1d64e67b01ba30465df531224 | [
"MIT"
] | 5 | 2015-07-22T17:10:09.000Z | 2019-12-18T03:15:28.000Z | herencia.py | Jorgehadad/curso-python | bfe7d8b1d05989b1d64e67b01ba30465df531224 | [
"MIT"
] | null | null | null | herencia.py | Jorgehadad/curso-python | bfe7d8b1d05989b1d64e67b01ba30465df531224 | [
"MIT"
] | 3 | 2015-10-09T02:24:51.000Z | 2020-05-30T18:33:47.000Z |
Cocodrilo1 = Cocodrilo(1)
Cocodrilo1.desplazar() | 17.393939 | 43 | 0.724739 | class Terrestre:
def __init__(self, velocidadcaminar):
super(Acuatico, self).__init__()
self.velocidadcaminar = velocidadcaminar
def caminar(self):
print "estoy caminando"
def desplazar(self):
print "el animal anda"
class Acuatico(object):
def __init__(self, velocidaddenado):
super(Acuatico, sel... | 0 | 0 | 0 | 447 | 0 | 0 | 0 | 0 | 68 |
4cede8ed210c068375c400648372cbc0568941de | 4,017 | py | Python | graph/compute_strongly_connected_components.py | anhtumai/data-structure-and-algorithms-collection | 6eac2a8dfec9a89a9e9f800d2a23d37bf6d82d31 | [
"MIT"
] | 1 | 2021-12-14T14:51:31.000Z | 2021-12-14T14:51:31.000Z | graph/compute_strongly_connected_components.py | anhtumai/data-structure-and-algorithms-collection | 6eac2a8dfec9a89a9e9f800d2a23d37bf6d82d31 | [
"MIT"
] | null | null | null | graph/compute_strongly_connected_components.py | anhtumai/data-structure-and-algorithms-collection | 6eac2a8dfec9a89a9e9f800d2a23d37bf6d82d31 | [
"MIT"
] | 1 | 2021-12-14T14:50:46.000Z | 2021-12-14T14:50:46.000Z | """
Compute Strongly Connected Components
Given a graph, calculate number of strongest connected components
In a subgraph, if we can reach from every vertex to every other vertex,
then it is called SCC.
Example:
>> graph1 = {0: [1], 1: [2], 2: [0, 3], 3: [4], 4: [5, 7], 5: [6], 6: [4, 7]} ... | 28.899281 | 191 | 0.577545 | """
Compute Strongly Connected Components
Given a graph, calculate number of strongest connected components
In a subgraph, if we can reach from every vertex to every other vertex,
then it is called SCC.
Example:
>> graph1 = {0: [1], 1: [2], 2: [0, 3], 3: [4], 4: [5, 7], 5: [6], 6: [4, 7]} ... | 0 | 0 | 0 | 0 | 452 | 485 | 0 | 11 | 77 |
68bc992486a70731d5c46bea85008fbfe6b16f19 | 696 | py | Python | pyshop/utils.py | njarvis/pyshop | 6165a78be19d190b7a6a73efea27378997a22fd7 | [
"MIT"
] | 3 | 2018-02-26T04:56:30.000Z | 2018-03-14T12:50:42.000Z | pyshop/utils.py | njarvis/pyshop | 6165a78be19d190b7a6a73efea27378997a22fd7 | [
"MIT"
] | 1 | 2018-03-14T12:51:21.000Z | 2018-03-14T13:42:43.000Z | pyshop/utils.py | njarvis/pyshop | 6165a78be19d190b7a6a73efea27378997a22fd7 | [
"MIT"
] | null | null | null | def running_threads():
""" Currently running threads
:returns: list of running thread information
:rtype: list of str
"""
import threading
threads = []
main_thread = threading.current_thread()
for t in threading.enumerate():
if t is main_thread:
continue
th... | 22.451613 | 78 | 0.635057 | def running_threads():
""" Currently running threads
:returns: list of running thread information
:rtype: list of str
"""
import threading
threads = []
main_thread = threading.current_thread()
for t in threading.enumerate():
if t is main_thread:
continue
th... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
76391c85d55c465b478fd3f0a8a495ff7f31d914 | 91 | py | Python | rest_registration/__init__.py | pragex/django-rest-registration | 2750b3e6d33cde15ba46d5c5b4cb683973f7b914 | [
"MIT"
] | null | null | null | rest_registration/__init__.py | pragex/django-rest-registration | 2750b3e6d33cde15ba46d5c5b4cb683973f7b914 | [
"MIT"
] | null | null | null | rest_registration/__init__.py | pragex/django-rest-registration | 2750b3e6d33cde15ba46d5c5b4cb683973f7b914 | [
"MIT"
] | null | null | null | __version__ = "0.5.1"
default_app_config = 'rest_registration.apps.RestRegistrationConfig'
| 30.333333 | 68 | 0.824176 | __version__ = "0.5.1"
default_app_config = 'rest_registration.apps.RestRegistrationConfig'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e15495dabf3e05e8368f6c219125453b62b4aae8 | 1,567 | py | Python | examples/basic_gibbs_sampling_via_mlm.py | gdhy9064/bert4keras | 1fae3605dae94b60b225cc4863bff85b8fbb00ac | [
"Apache-2.0"
] | 4,478 | 2019-08-26T03:53:18.000Z | 2022-03-31T12:33:41.000Z | examples/basic_gibbs_sampling_via_mlm.py | gdhy9064/bert4keras | 1fae3605dae94b60b225cc4863bff85b8fbb00ac | [
"Apache-2.0"
] | 436 | 2019-09-04T07:33:03.000Z | 2022-03-30T00:13:27.000Z | examples/basic_gibbs_sampling_via_mlm.py | gdhy9064/bert4keras | 1fae3605dae94b60b225cc4863bff85b8fbb00ac | [
"Apache-2.0"
] | 923 | 2019-08-26T10:46:21.000Z | 2022-03-30T08:23:03.000Z | #! -*- coding: utf-8 -*-
# : MLMGibbs
from tqdm import tqdm
import numpy as np
from bert4keras.models import build_transformer_model
from bert4keras.tokenizers import Tokenizer
from bert4keras.snippets import to_array
config_path = '/root/kg/bert/chinese_L-12_H-768_A-12/bert_config.json'
checkpoint_path = '/root/kg/b... | 33.340426 | 75 | 0.733886 | #! -*- coding: utf-8 -*-
# 测试代码可用性: 结合MLM的Gibbs采样
from tqdm import tqdm
import numpy as np
from bert4keras.models import build_transformer_model
from bert4keras.tokenizers import Tokenizer
from bert4keras.snippets import to_array
config_path = '/root/kg/bert/chinese_L-12_H-768_A-12/bert_config.json'
checkpoint_path =... | 228 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
05499e9c72f1e109cc912946bae295fc03f5e194 | 1,692 | py | Python | tensorflow_impl/rsrcs/aggregators/condense.py | sahareslami/Garfield | b620816fe88b2cb2cef4a889342e6b1ad32a0395 | [
"MIT"
] | 8 | 2021-02-03T15:13:44.000Z | 2022-02-24T18:47:13.000Z | tensorflow_impl/rsrcs/aggregators/condense.py | sahareslami/Garfield | b620816fe88b2cb2cef4a889342e6b1ad32a0395 | [
"MIT"
] | 2 | 2021-09-13T14:36:10.000Z | 2022-01-26T16:33:16.000Z | tensorflow_impl/rsrcs/aggregators/condense.py | sahareslami/Garfield | b620816fe88b2cb2cef4a889342e6b1ad32a0395 | [
"MIT"
] | 8 | 2020-12-12T12:53:53.000Z | 2021-11-30T05:58:08.000Z | # coding: utf-8
###
# @file condense.py
# @author Sbastien Rouault <sebastien.rouault@alumni.epfl.ch>
#
# @section LICENSE
#
# Copyright 2020 cole Polytechnique Fdrale de Lausanne (EPFL).
# All rights reserved.
#
# @section DESCRIPTION
#
# Condense parameter vector aggregation random function.
###
from . ... | 31.924528 | 147 | 0.61643 | # coding: utf-8
###
# @file condense.py
# @author Sébastien Rouault <sebastien.rouault@alumni.epfl.ch>
#
# @section LICENSE
#
# Copyright © 2020 École Polytechnique Fédérale de Lausanne (EPFL).
# All rights reserved.
#
# @section DESCRIPTION
#
# Condense parameter vector aggregation random function.
###
i... | 14 | 0 | 0 | 1,008 | 0 | 0 | 0 | -1 | 69 |
c7d095a0943cdbd6682947597aefddda3b26859c | 5,221 | py | Python | bathy_datasets/storage.py | ausseabed/bathy-datasets | 4f1b0a61f19c1140f4ba842318908a9250508c45 | [
"Apache-2.0"
] | null | null | null | bathy_datasets/storage.py | ausseabed/bathy-datasets | 4f1b0a61f19c1140f4ba842318908a9250508c45 | [
"Apache-2.0"
] | null | null | null | bathy_datasets/storage.py | ausseabed/bathy-datasets | 4f1b0a61f19c1140f4ba842318908a9250508c45 | [
"Apache-2.0"
] | null | null | null | import numpy
import tiledb
def mbes_domain(tri=False):
"""Set array domain."""
index_filters = tiledb.FilterList([tiledb.ZstdFilter(level=16)])
xdim = tiledb.Dim(
"longitude",
domain=(None, None),
tile=1000,
dtype=numpy.float64,
filters=index_filters,
)
ydi... | 29.331461 | 103 | 0.559854 | import numpy
import tiledb
def mbes_domain(tri=False):
"""Set array domain."""
index_filters = tiledb.FilterList([tiledb.ZstdFilter(level=16)])
xdim = tiledb.Dim(
"longitude",
domain=(None, None),
tile=1000,
dtype=numpy.float64,
filters=index_filters,
)
ydi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a6e9ec3d46f7c0674cbb330e807de2fad88975a1 | 1,265 | py | Python | bot.py | Zinan100/ADV-GUARDIAN-GROOT | 714973b532d9e3abf120bee3027920a83f5cff62 | [
"MIT"
] | null | null | null | bot.py | Zinan100/ADV-GUARDIAN-GROOT | 714973b532d9e3abf120bee3027920a83f5cff62 | [
"MIT"
] | null | null | null | bot.py | Zinan100/ADV-GUARDIAN-GROOT | 714973b532d9e3abf120bee3027920a83f5cff62 | [
"MIT"
] | null | null | null | import os
import logging
import logging.config
logging.config.fileConfig('logging.conf')
logging.getLogger().setLevel(logging.INFO)
logging.getLogger("pyrogram").setLevel(logging.ERROR)
FORCE_SUB = os.environ.get("FORCE_SUB", None)
bot = TG()
bot.run()
| 24.326923 | 72 | 0.61502 | import os
import logging
import logging.config
from pyrogram import Client
from config import API_ID, API_HASH, BOT_TOKEN
logging.config.fileConfig('logging.conf')
logging.getLogger().setLevel(logging.INFO)
logging.getLogger("pyrogram").setLevel(logging.ERROR)
FORCE_SUB = os.environ.get("FORCE_SUB", None)
class TG(... | 8 | 0 | 597 | 297 | 0 | 0 | 0 | 31 | 67 |
ecdbc7aa746d7c4a0ee4a1e72f254411b6ef19f2 | 777 | py | Python | setup.py | ousttrue/cywrap | 397ad9e65926c1c8fa4a0096b732cf1640250e4a | [
"MIT"
] | null | null | null | setup.py | ousttrue/cywrap | 397ad9e65926c1c8fa4a0096b732cf1640250e4a | [
"MIT"
] | null | null | null | setup.py | ousttrue/cywrap | 397ad9e65926c1c8fa4a0096b732cf1640250e4a | [
"MIT"
] | null | null | null | import setuptools
import pathlib
HERE = pathlib.Path(__file__).parent
SRC_CLANG = HERE / 'src/clang'
SRC_CLANG_BASE_URL = 'https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-13.0.0/clang/bindings/python/clang/'
if not SRC_CLANG.exists():
SRC_CLANG.mkdir(parents=True)
http_get(SRC_CLANG_BASE_... | 35.318182 | 119 | 0.707851 | from os import path
import setuptools
import pathlib
HERE = pathlib.Path(__file__).parent
SRC_CLANG = HERE / 'src/clang'
SRC_CLANG_BASE_URL = 'https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-13.0.0/clang/bindings/python/clang/'
if not SRC_CLANG.exists():
SRC_CLANG.mkdir(parents=True)
def... | 0 | 0 | 0 | 0 | 0 | 231 | 0 | -2 | 52 |
3140766f70f723e72b2c955c8c9a2d3d4b9959cb | 3,028 | py | Python | examples/Untitled-1.py | PDot5/CarND-Advanced-Lane-Lines | 60ef0a6105b0aa2a31ed59c96783dabdaa308286 | [
"MIT"
] | null | null | null | examples/Untitled-1.py | PDot5/CarND-Advanced-Lane-Lines | 60ef0a6105b0aa2a31ed59c96783dabdaa308286 | [
"MIT"
] | null | null | null | examples/Untitled-1.py | PDot5/CarND-Advanced-Lane-Lines | 60ef0a6105b0aa2a31ed59c96783dabdaa308286 | [
"MIT"
] | null | null | null | #%% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting
import os
try:
os.chdir(os.path.join(os.getcwd(), 'examples'))
print(os.getcwd())
except:
pass
#%% [markdown]
# ## Advanced Lane Finding Project
#
# The goals ... | 30.585859 | 156 | 0.688243 | #%% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting
import os
try:
os.chdir(os.path.join(os.getcwd(), 'examples'))
print(os.getcwd())
except:
pass
#%% [markdown]
# ## Advanced Lane Finding Project
#
# The goals ... | 0 | 0 | 0 | 0 | 0 | 878 | 0 | 0 | 23 |
6530caa9cfd841a0a636033c364af522e2ba4ee1 | 73 | py | Python | _teaching/2019Spring/decks/recurse.py | drewyoungren/drewyoungren.github.io | 38ed4e7e053f4a79320bdf5423f1d42eb0ce618b | [
"MIT"
] | null | null | null | _teaching/2019Spring/decks/recurse.py | drewyoungren/drewyoungren.github.io | 38ed4e7e053f4a79320bdf5423f1d42eb0ce618b | [
"MIT"
] | 2 | 2020-02-26T18:01:37.000Z | 2021-09-27T21:28:24.000Z | _teaching/2018Fall/decks/recurse.py | drewyoungren/drewyoungren.github.io | 38ed4e7e053f4a79320bdf5423f1d42eb0ce618b | [
"MIT"
] | 1 | 2018-04-17T03:25:55.000Z | 2018-04-17T03:25:55.000Z |
if __name__ == "__main__":
go_deep() | 14.6 | 26 | 0.657534 | def go_deep():
return go_deep()
if __name__ == "__main__":
go_deep() | 0 | 0 | 0 | 0 | 0 | 12 | 0 | 0 | 22 |
0a522774b992cfe8784e49f852022ccb56803f83 | 2,182 | py | Python | rkqc/tools/gui/core/BaseItemButtonClose.py | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 158 | 2016-07-21T10:45:05.000Z | 2022-03-25T00:56:20.000Z | rkqc/tools/gui/core/BaseItemButtonClose.py | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 35 | 2016-07-25T01:23:07.000Z | 2021-09-27T16:05:50.000Z | rkqc/tools/gui/core/BaseItemButtonClose.py | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 62 | 2016-08-29T17:28:11.000Z | 2021-12-29T17:55:58.000Z | # RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org)
# Copyright (C) 2009-2011 The RevKit Developers <revkit@informatik.uni-bremen.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... | 40.407407 | 107 | 0.705775 | # RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org)
# Copyright (C) 2009-2011 The RevKit Developers <revkit@informatik.uni-bremen.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... | 0 | 0 | 0 | 1,257 | 0 | 0 | 0 | 26 | 113 |
4376e45a0796d26a44aadb03775e48744810c547 | 30,807 | py | Python | gnocchi/storage/__init__.py | openvdro/gnocchi | 8099dfc2a30ddf305d9f904de0106e4dd5e56147 | [
"Apache-2.0"
] | null | null | null | gnocchi/storage/__init__.py | openvdro/gnocchi | 8099dfc2a30ddf305d9f904de0106e4dd5e56147 | [
"Apache-2.0"
] | null | null | null | gnocchi/storage/__init__.py | openvdro/gnocchi | 8099dfc2a30ddf305d9f904de0106e4dd5e56147 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright 2016-2018 Red Hat, Inc.
# Copyright 2014-2015 eNovance
#
# 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/LICENS... | 42.728155 | 90 | 0.577856 | # -*- encoding: utf-8 -*-
#
# Copyright © 2016-2018 Red Hat, Inc.
# Copyright © 2014-2015 eNovance
#
# 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/LICE... | 10 | 2,228 | 0 | 27,321 | 0 | 0 | 0 | -16 | 294 |
3a36e8f725021dd81d87951dfae88b36531c391e | 14,620 | py | Python | src/raritan/rpc/luaservice/__init__.py | vhirtzel/apc_reboot | 06ab4ef72029b09339a04266970d1546004c9dbe | [
"MIT"
] | 1 | 2021-04-29T23:04:17.000Z | 2021-04-29T23:04:17.000Z | raritan/rpc/luaservice/__init__.py | vhirtzel/desktop_reboot | 553795c1727dedf4532dc97922201df3e9e2ad1e | [
"MIT"
] | null | null | null | raritan/rpc/luaservice/__init__.py | vhirtzel/desktop_reboot | 553795c1727dedf4532dc97922201df3e9e2ad1e | [
"MIT"
] | 2 | 2020-06-20T16:21:23.000Z | 2021-09-28T19:04:44.000Z | # SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This is an auto-generated file.
#
# Section generated by IdlC from "LuaService.idl"
#
import raritan.rpc
# structure
# structure
# structure
# interface
| 33.151927 | 192 | 0.618468 | # SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This is an auto-generated file.
#
# Section generated by IdlC from "LuaService.idl"
#
import raritan.rpc
from raritan.rpc import Interface, Structure, ValueObject, Enumeration, typecheck, DecodeException
import raritan.rp... | 0 | 6,740 | 0 | 7,406 | 0 | 0 | 0 | 85 | 132 |