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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dbac8b15d5543ed521b5fb0994d6f5126f07164a | 1,646 | py | Python | python/fancontrol/communicate/bridgehead.py | Bengt/FanControl | 6b3958230e5eacf175e84d9a5927d74cd3f6b83a | [
"MIT"
] | 9 | 2015-11-25T13:39:22.000Z | 2018-10-16T21:09:10.000Z | python/fancontrol/communicate/bridgehead.py | Bengt/FanControl | 6b3958230e5eacf175e84d9a5927d74cd3f6b83a | [
"MIT"
] | 6 | 2019-07-04T13:45:08.000Z | 2022-01-15T18:30:10.000Z | python/fancontrol/communicate/bridgehead.py | Bengt/FanControl | 6b3958230e5eacf175e84d9a5927d74cd3f6b83a | [
"MIT"
] | 3 | 2020-08-12T13:31:50.000Z | 2021-06-16T22:12:20.000Z | """Python side of the Python to Arduino bridge."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
| 25.323077 | 72 | 0.650668 | """Python side of the Python to Arduino bridge."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from contextlib import contextmanager
from multiprocessing import Process, Queue
import serial
from serial.serialutil import SerialException
from communicat... | 0 | 766 | 0 | 0 | 0 | 430 | 0 | 104 | 182 |
86c6f4b4564dbd2cb53a3a53b39395137a044e02 | 4,784 | py | Python | tests/advection_1d_example1/setplot.py | navravi/amrclaw | 727d98d243c521267c927f6fe107ba6f1155597b | [
"BSD-3-Clause"
] | 16 | 2015-05-27T08:16:09.000Z | 2022-01-21T06:36:24.000Z | tests/advection_1d_example1/setplot.py | navravi/amrclaw | 727d98d243c521267c927f6fe107ba6f1155597b | [
"BSD-3-Clause"
] | 107 | 2015-01-02T19:51:43.000Z | 2021-11-24T03:35:32.000Z | tests/advection_1d_example1/setplot.py | BrisaDavis/amrclaw | c5cacdf00f1959e160ea5616cdf6ea7b6cd374f3 | [
"BSD-3-Clause"
] | 28 | 2015-01-10T00:03:56.000Z | 2022-02-11T23:52:34.000Z |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
from clawpack.clawutil.data import ClawData
from numpy import linspace
probdata = ClawData()
probdata.read('setprob.d... | 33.690141 | 78 | 0.585911 |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
from clawpack.clawutil.data import ClawData
from numpy import linspace
probdata = ClawData()
probdata.read('setprob.d... | 0 | 0 | 0 | 0 | 0 | 737 | 0 | 0 | 57 |
11476c731d6dc233cfffda896300fc1a39f67790 | 1,420 | py | Python | venus_dashboard/api/venus_rest_api.py | openstack/venus-dashboard | 8c53ac83eaf80326c91cb92c34bbb43e04938e1c | [
"Apache-2.0"
] | null | null | null | venus_dashboard/api/venus_rest_api.py | openstack/venus-dashboard | 8c53ac83eaf80326c91cb92c34bbb43e04938e1c | [
"Apache-2.0"
] | null | null | null | venus_dashboard/api/venus_rest_api.py | openstack/venus-dashboard | 8c53ac83eaf80326c91cb92c34bbb43e04938e1c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Inspur
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 31.555556 | 77 | 0.734507 | # Copyright 2021 Inspur
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 0 | 560 | 0 | 0 | 0 | 0 | 0 | 80 | 157 |
87c2f3196cb8b542c3ea1904a5e4897abde3e8d4 | 2,642 | py | Python | tests/test_Results.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | tests/test_Results.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | tests/test_Results.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | import unittest
suite = unittest.TestLoader().loadTestsFromTestCase(ResultsTestCase)
if __name__ == '__main__':
unittest.main()
| 34.311688 | 81 | 0.584406 | import os
import unittest
import numpy
import moments
import time
class ResultsTestCase(unittest.TestCase):
def setUp(self):
self.startTime = time.time()
def tearDown(self):
t = time.time() - self.startTime
print("%s: %.3f seconds" % (self.id(), t))
def test_1d_ic(self):
... | 0 | 0 | 0 | 2,434 | 0 | 0 | 0 | -38 | 111 |
21fbf3af94d58f4ea44cb8d9142572c8f309aaa2 | 10,555 | py | Python | CLI.py | KaiGH/Topological | 3ed3f581ec7cd70e60a0542d9e4d406954d69994 | [
"MIT"
] | null | null | null | CLI.py | KaiGH/Topological | 3ed3f581ec7cd70e60a0542d9e4d406954d69994 | [
"MIT"
] | 3 | 2021-06-08T21:04:07.000Z | 2022-01-13T02:21:35.000Z | CLI.py | KaiGH/Topological | 3ed3f581ec7cd70e60a0542d9e4d406954d69994 | [
"MIT"
] | 1 | 2020-04-20T09:35:48.000Z | 2020-04-20T09:35:48.000Z |
#Opening the Yaml File to Print out the Contents
#Name all Nodes
#Generates all Numbers Attached to Waypoints, Finds the Next Unused Number
#Editing Existing Node Data in the Yaml File
#Deleting Nodes
#Adding Path Data in the Yaml File
#Deleting Existing Node
#Adding a New Node to The Yaml File
cli_input()
#... | 38.381818 | 153 | 0.594221 | import yaml
import copy
import os.path
from PIL import Image as PILImage,ImageTk
from tkinter import Canvas, Tk, NW, mainloop
#Opening the Yaml File to Print out the Contents
def readYaml(filename):
with open(filename) as fileReader:
node_coords = yaml.load(fileReader, Loader=yaml.FullLoader)
retu... | 0 | 0 | 0 | 0 | 0 | 9,385 | 0 | 16 | 482 |
0b992b72737dd28dc8a1f6a65f359823d248a7f1 | 213 | py | Python | erlei/__init__.py | Thunsir/erlei | cf3342047f3dcf9a66cbe46f3d4fc66ee6fdc415 | [
"MIT"
] | null | null | null | erlei/__init__.py | Thunsir/erlei | cf3342047f3dcf9a66cbe46f3d4fc66ee6fdc415 | [
"MIT"
] | null | null | null | erlei/__init__.py | Thunsir/erlei | cf3342047f3dcf9a66cbe46f3d4fc66ee6fdc415 | [
"MIT"
] | null | null | null | from erlei.underscore import underscore as _
from erlei.underscore import uunderscore as __
from erlei.pipe import pipe
__all__ = [
'_',
'__',
'pipe'
]
__version__ = "1.0.0"
name = "erlei" | 17.75 | 47 | 0.647887 | from erlei.underscore import underscore as _
from erlei.underscore import uunderscore as __
from erlei.pipe import pipe
__all__ = [
'_',
'__',
'pipe'
]
__version__ = "1.0.0"
name = "erlei" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3d50d70c313ef21a98f930c294464892c9d21390 | 18,920 | py | Python | scrub_test.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 44 | 2017-07-13T14:20:42.000Z | 2022-03-27T23:55:27.000Z | scrub_test.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 64 | 2017-07-26T16:06:01.000Z | 2022-03-17T22:57:03.000Z | scrub_test.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 105 | 2017-07-13T14:28:14.000Z | 2022-03-23T04:22:46.000Z | import pytest
import logging
since = pytest.mark.since
logger = logging.getLogger(__name__)
KEYSPACE = 'ks'
| 39.915612 | 145 | 0.643288 | import glob
import os
import re
import subprocess
import time
import uuid
import pytest
import parse
import logging
from ccmlib import common
from dtest import Tester, create_ks, create_cf
from tools.assertions import assert_length_equal, assert_stderr_clean
since = pytest.mark.since
logger = logging.getLogger(__nam... | 0 | 6,632 | 0 | 11,874 | 0 | 0 | 0 | 10 | 291 |
99038a0c1a568c0d86b4e12351346ffc45eb7e5a | 39,768 | py | Python | anibot/plugins/anilist.py | JesterZilla/ani_bot | dc27fac49344b90d5e3c6ad8536c0d5b7f330491 | [
"MIT"
] | null | null | null | anibot/plugins/anilist.py | JesterZilla/ani_bot | dc27fac49344b90d5e3c6ad8536c0d5b7f330491 | [
"MIT"
] | null | null | null | anibot/plugins/anilist.py | JesterZilla/ani_bot | dc27fac49344b90d5e3c6ad8536c0d5b7f330491 | [
"MIT"
] | null | null | null | # base code was taken from @DeletedUser420's Userge-Plugins repo
# originally authored by Phyco-Ninja (https://github.com/Phyco-Ninja) (@PhycoNinja13b)
# I've just tweaked his file a bit (maybe a lot)
# But i sticked to the format he used which looked cool
""" Search for Anime related Info using Anilist API """
... | 44.884876 | 173 | 0.625126 | # base code was taken from @DeletedUser420's Userge-Plugins repo
# originally authored by Phyco-Ninja (https://github.com/Phyco-Ninja) (@PhycoNinja13b)
# I've just tweaked his file a bit (maybe a lot)
# But i sticked to the format he used which looked cool
""" Search for Anime related Info using Anilist API """
... | 27 | 36,222 | 1,034 | 0 | 0 | 0 | 0 | 458 | 981 |
ecf8768578d2a78e53f17e9ef619b0ab0e5e3ea4 | 1,062 | py | Python | troposphere/validators/backup.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | troposphere/validators/backup.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | troposphere/validators/backup.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
import re
from .. import If
from . import exactly_one, json_checker
def validate_json_checker(x):
"""
Property: BackupVault.AccessPolicy
"""
return json_checker(x)
def backup_vault_n... | 21.24 | 75 | 0.635593 | # Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
import re
from .. import If
from . import exactly_one, json_checker
def validate_json_checker(x):
"""
Property: BackupVault.AccessPolicy
"""
return json_checker(x)
def backup_vault_n... | 0 | 0 | 0 | 0 | 0 | 162 | 0 | 0 | 27 |
eabbf93816a67807884b41951de89e98b11591e8 | 17,008 | py | Python | anpy/dossier_like_senapy.py | MalcolmMielle/anpy | b0eac68ed860d8a909a065c1d500ddc3f442bee7 | [
"MIT"
] | 11 | 2016-04-02T18:06:15.000Z | 2022-03-04T10:18:57.000Z | anpy/dossier_like_senapy.py | MalcolmMielle/anpy | b0eac68ed860d8a909a065c1d500ddc3f442bee7 | [
"MIT"
] | 24 | 2016-09-11T19:34:02.000Z | 2020-11-23T15:58:27.000Z | anpy/dossier_like_senapy.py | MalcolmMielle/anpy | b0eac68ed860d8a909a065c1d500ddc3f442bee7 | [
"MIT"
] | 6 | 2016-05-31T12:25:50.000Z | 2021-10-03T09:24:18.000Z | # re-write of the dosleg parser to have
# the same output as senapy
import sys
import re
from urllib.parse import urljoin
from bs4 import BeautifulSoup
from lawfactory_utils.urls import clean_url, parse_national_assembly_url
def find_promulgation_date(line):
"""
>>> find_promulgation_date("Loi n 2010-383 ... | 41.082126 | 143 | 0.589017 | # re-write of the dosleg parser to have
# the same output as senapy
import sys
import re
from urllib.parse import urljoin
import dateparser
from bs4 import BeautifulSoup
from lawfactory_utils.urls import clean_url, download, parse_national_assembly_url, AN_OLD_URL_TEMPLATE
from anpy.dossier_from_opendata import par... | 92 | 0 | 0 | 0 | 0 | 2,605 | 0 | 68 | 307 |
36cc9c5877f104f392dcd87ca1669bb6327d254d | 12,978 | py | Python | ppp_questionparsing_ml_standalone/dataset.py | ProjetPP/PPP-QuestionParsing-ML-Standalone | 486dea1ae7a42baf8ccc361051c7368850040923 | [
"MIT"
] | 2 | 2015-06-08T16:14:26.000Z | 2015-08-16T03:16:33.000Z | ppp_questionparsing_ml_standalone/dataset.py | ProjetPP/PPP-QuestionParsing-ML-Standalone | 486dea1ae7a42baf8ccc361051c7368850040923 | [
"MIT"
] | null | null | null | ppp_questionparsing_ml_standalone/dataset.py | ProjetPP/PPP-QuestionParsing-ML-Standalone | 486dea1ae7a42baf8ccc361051c7368850040923 | [
"MIT"
] | null | null | null | import os
from . import config, preprocessing
def create_dataset(training_set_distribution=0.98):
"""Function called when bootstraping to train the parser."""
w_size = config.get_windows_size()
en_dict = preprocessing.Dictionary(config.get_data('embeddings-scaled.EMBEDDING_SIZE=25.txt'))
filename... | 36.764873 | 120 | 0.594776 | import os
import re
import numpy
import itertools
from . import config, dataset_generation, preprocessing
class FormatSentence:
"""
Take a sentence, annotated or not, and generate the vectors associated
"""
sentence = ''
words = []
__size_vector = 26+11
__dictionary = None
__vectoriz... | 0 | 812 | 0 | 11,072 | 0 | 0 | 0 | -6 | 112 |
d269d7c9e9945897023ca15d2c5a37ca8f38a0c9 | 16,712 | py | Python | builders/layers/transformer.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | 9 | 2021-08-18T17:49:42.000Z | 2022-02-22T02:15:07.000Z | builders/layers/transformer.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | null | null | null | builders/layers/transformer.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | 1 | 2021-10-02T19:53:03.000Z | 2021-10-02T19:53:03.000Z | # -*- coding: utf-8 -*-
"""
builders/layers/transformer.py
Created on 01/05/19
@author: Tu Bui tb00083@surrey.ac.uk
"""
| 37.470852 | 113 | 0.607528 | # -*- coding: utf-8 -*-
"""
builders/layers/transformer.py
Created on 01/05/19
@author: Tu Bui tb00083@surrey.ac.uk
"""
import tensorflow as tf
from tensorflow.keras import backend as K
from ..utils import scaled_dot_product_attention, positional_encoding
class SelfAttnV1(tf.keras.layers.Layer):
"""
Keras at... | 0 | 0 | 0 | 15,964 | 0 | 227 | 0 | 70 | 320 |
0b9a19a42a79cbf5a45774709ce2367d39565864 | 357 | py | Python | 09_list_explained.py | SourceLastBenchCoder/Python_Programming | 4c4281252ab657cbb781f98fe5c945738a2c618e | [
"MIT"
] | null | null | null | 09_list_explained.py | SourceLastBenchCoder/Python_Programming | 4c4281252ab657cbb781f98fe5c945738a2c618e | [
"MIT"
] | null | null | null | 09_list_explained.py | SourceLastBenchCoder/Python_Programming | 4c4281252ab657cbb781f98fe5c945738a2c618e | [
"MIT"
] | null | null | null | names = ['appu','chakrapani','upadhyaya',23,'TRUE']
for name in names:
print(name)
print(names[0])
print(names[2:4])
names.insert(2,"Shraddha")
print(names)
names.append("Shreshta")
print(names)
names.append("Shreshta")
print(names)
names[2]="Updated"
print(names)
names.remove("Updated")
print(names)
rec =... | 13.222222 | 51 | 0.697479 | names = ['appu','chakrapani','upadhyaya',23,'TRUE']
for name in names:
print(name)
print(names[0])
print(names[2:4])
names.insert(2,"Shraddha")
print(names)
names.append("Shreshta")
print(names)
names.append("Shreshta")
print(names)
names[2]="Updated"
print(names)
names.remove("Updated")
print(names)
rec =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
459724158dea735d7f9efb61757a228a40c8333c | 835 | py | Python | machine-learning/QiWei-Python-Chinese/class/class_04.py | yw-fang/MLreadingnotes | 3522497e6fb97427c54f4267d9c410064818c357 | [
"Apache-2.0"
] | 2 | 2020-07-09T22:21:57.000Z | 2021-03-20T15:30:31.000Z | machine-learning/QiWei-Python-Chinese/class/class_04.py | yw-fang/MLreadingnotes | 3522497e6fb97427c54f4267d9c410064818c357 | [
"Apache-2.0"
] | 37 | 2018-04-17T06:40:54.000Z | 2022-03-22T09:06:01.000Z | machine-learning/QiWei-Python-Chinese/class/class_04.py | yw-fang/MLreadingnotes | 3522497e6fb97427c54f4267d9c410064818c357 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Yue-Wen FANG'
__maintainer__ = "Yue-Wen FANG"
__email__ = 'fyuewen@gmail.com'
__license__ = 'Apache License 2.0'
__creation_date__= 'Dec. 26, 2018'
"""
single inheritance
"""
if __name__ == '__main__':
cang = Girl()
cang.listheight()
cang.spea... | 17.765957 | 50 | 0.598802 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Yue-Wen FANG'
__maintainer__ = "Yue-Wen FANG"
__email__ = 'fyuewen@gmail.com'
__license__ = 'Apache License 2.0'
__creation_date__= 'Dec. 26, 2018'
"""
single inheritance
"""
class Person:
"""
define a CLASS Person with three methods
"""
de... | 0 | 0 | 0 | 441 | 0 | 0 | 0 | 0 | 46 |
1fb8865710a6705d96dc909a10f714a1c5599ad0 | 5,515 | py | Python | app.py | capital-one-hackathon/backend | f4f216aa77fe8b6930c3c0f47107f806b7b86e5b | [
"MIT"
] | null | null | null | app.py | capital-one-hackathon/backend | f4f216aa77fe8b6930c3c0f47107f806b7b86e5b | [
"MIT"
] | null | null | null | app.py | capital-one-hackathon/backend | f4f216aa77fe8b6930c3c0f47107f806b7b86e5b | [
"MIT"
] | 4 | 2017-11-11T03:37:13.000Z | 2017-11-11T20:33:50.000Z | '''
assumptions:
- credit one, the leading provider of identity management is a division of capital one (e.g. https://capitalone.com/creditone)
- user already has an account with capital one (they've been verified id, passport, credit, ...)
- participating banks, institutions, ... realize credit one the leading
... | 35.352564 | 128 | 0.670354 | '''
assumptions:
- credit one, the leading provider of identity management is a division of capital one (e.g. https://capitalone.com/creditone)
- user already has an account with capital one (they've been verified id, passport, credit, ...)
- participating banks, institutions, ... realize credit one the leading
... | 0 | 2,914 | 0 | 0 | 0 | 247 | 0 | 76 | 202 |
e6415236b516d96c6728083dc50dfa22c5db9eac | 3,085 | py | Python | nlptk/mining/utils.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | nlptk/mining/utils.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | nlptk/mining/utils.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null |
#train_pos, test_pos = create_sample(pos, 0.75)
#train_neg, test_neg = create_sample(neg, 0.75)
#train = train_pos + train_neg
#test = test_pos + test_neg
| 27.061404 | 76 | 0.552026 |
import os,sys
import heapq
from chardet.universaldetector import UniversalDetector
def _sort(obj, typ):
if typ == 1:
res = sorted(obj.items(),key=lambda t:t[1])
elif typ == -1:
res = sorted(obj.items(),key=lambda t:-t[1])
else:
res = obj
return res
def _top(obj, n):
... | 12 | 0 | 0 | 629 | 0 | 2,002 | 0 | 17 | 246 |
065954435ffd5f98916a35a166bed91e3ab91eff | 1,126 | py | Python | day8/main.py | VincentBeltman/aoc2020 | 8ea0d5279d4a259687e17f80ec970edae423535e | [
"MIT"
] | null | null | null | day8/main.py | VincentBeltman/aoc2020 | 8ea0d5279d4a259687e17f80ec970edae423535e | [
"MIT"
] | null | null | null | day8/main.py | VincentBeltman/aoc2020 | 8ea0d5279d4a259687e17f80ec970edae423535e | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
with open("test2.txt") as file:
lines = file.read().splitlines()
part2(lines)
| 29.631579 | 93 | 0.637655 | from Interpreter import Interpreter, InfiniteLoopException
def part1(raw_instructions):
interpreter = Interpreter(raw_instructions)
try:
interpreter.run()
except InfiniteLoopException:
print(interpreter.get_accumulator())
def part2(raw_instructions):
interpreter = Interpreter(raw_ins... | 0 | 0 | 0 | 0 | 0 | 891 | 0 | 37 | 68 |
0bb160d2061c1c462a560298dd0f11f5b0ea92c7 | 1,591 | py | Python | ml_params_trax/tests/test_mnist.py | SamuelMarks/ml-params-trax | fea0abb21fdead2a4bb5d1fbaee2638b8a29807d | [
"Apache-2.0",
"MIT"
] | null | null | null | ml_params_trax/tests/test_mnist.py | SamuelMarks/ml-params-trax | fea0abb21fdead2a4bb5d1fbaee2638b8a29807d | [
"Apache-2.0",
"MIT"
] | null | null | null | ml_params_trax/tests/test_mnist.py | SamuelMarks/ml-params-trax | fea0abb21fdead2a4bb5d1fbaee2638b8a29807d | [
"Apache-2.0",
"MIT"
] | null | null | null | from unittest import main as unittest_main
if __name__ == '__main__':
unittest_main()
| 36.159091 | 91 | 0.61785 | from os import path
from shutil import rmtree
from tempfile import mkdtemp
from unittest import TestCase, main as unittest_main
from trax import layers as tl
from trax.optimizers import adafactor
from ml_params_trax.example_model import get_model
from ml_params_trax.ml_params_impl import TraxTrainer
class TestMnist... | 0 | 260 | 0 | 955 | 0 | 0 | 0 | 104 | 179 |
84793e6d0c75545a5ca778d1ce00b3f65ecb1d7b | 1,213 | py | Python | uranium/tests/packages/test_versions.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 21 | 2016-01-14T04:06:08.000Z | 2021-03-23T01:43:48.000Z | uranium/tests/packages/test_versions.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 45 | 2015-02-09T06:02:01.000Z | 2018-07-22T19:16:01.000Z | uranium/tests/packages/test_versions.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 10 | 2015-02-07T20:56:22.000Z | 2018-07-20T03:18:07.000Z | from packaging.specifiers import SpecifierSet
def test_versions_coerce_lowercase(versions):
"""
coerce package names to lowercase
"""
versions["SQLAlchemy"] = "==1.0.11"
assert versions["sqlalchemy"] == "==1.0.11"
def test_versions_coerce_lowercase_update(versions):
"""
coerce package n... | 24.26 | 69 | 0.660346 | import pytest
from uranium.packages.versions import Versions
from packaging.specifiers import SpecifierSet
@pytest.fixture
def versions():
return Versions()
def test_versions_coerce_lowercase(versions):
"""
coerce package names to lowercase
"""
versions["SQLAlchemy"] = "==1.0.11"
assert vers... | 0 | 32 | 0 | 0 | 0 | 0 | 0 | 17 | 67 |
fe8cc15985e8d9d023d31aa826a4e609e4534419 | 644 | py | Python | 02/02_P18.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | 02/02_P18.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | 02/02_P18.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | a1,b1,c1=input().split()
a2,b2,c2=input().split()
a1=int(a1)
a2=int(a2)
b1=int(b1)
b2=int(b2)
c1=int(c1)
c2=int(c2)
if a1==0 and a2==0:
a1==1
a2==1
if b1==0 and b2==0:
b1=1
b2=1
if a1==0 and b2==0:
a1=1
b2=1
if a2==0 and b1==0:
a2=1
b1=1
if c1==0 and c2==0:
c1=1
c2=1
if ((a1%a2==... | 20.125 | 82 | 0.490683 | a1,b1,c1=input().split()
a2,b2,c2=input().split()
a1=int(a1)
a2=int(a2)
b1=int(b1)
b2=int(b2)
c1=int(c1)
c2=int(c2)
if a1==0 and a2==0:
a1==1
a2==1
if b1==0 and b2==0:
b1=1
b2=1
if a1==0 and b2==0:
a1=1
b2=1
if a2==0 and b1==0:
a2=1
b1=1
if c1==0 and c2==0:
c1=1
c2=1
if ((a1%a2==... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2ff465f0b1871d0f8560f4d14094226e7fd78bd | 25,922 | py | Python | landlab/components/diffusion/diffusion.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 257 | 2015-01-13T16:01:21.000Z | 2022-03-29T22:37:43.000Z | landlab/components/diffusion/diffusion.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 1,222 | 2015-02-05T21:36:53.000Z | 2022-03-31T17:53:49.000Z | landlab/components/diffusion/diffusion.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 274 | 2015-02-11T19:56:08.000Z | 2022-03-28T23:31:07.000Z | #! /usr/env/python
"""Component that models 2D diffusion using an explicit finite-volume method.
Created July 2013 GT Last updated March 2016 DEJH with LL v1.0 component
style
"""
_ALPHA = 0.15 # time-step stability factor
# ^0.25 not restrictive enough at meter scales w S~1 (possible cases)
| 43.566387 | 88 | 0.582594 | #! /usr/env/python
"""Component that models 2D diffusion using an explicit finite-volume method.
Created July 2013 GT Last updated March 2016 DEJH with LL v1.0 component
style
"""
import numpy as np
from landlab import Component, FieldError, LinkStatus, NodeStatus, RasterModelGrid
_ALPHA = 0.15 # time-step stabil... | 0 | 394 | 0 | 25,103 | 0 | 0 | 0 | 58 | 69 |
512dd636ab44969285076c91daa0fce50cec85f2 | 1,663 | py | Python | test_settings.py | nanuxbe/django-allowedsites | 16630b23d9faeb86b708dd45619ffe8823d5229a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | test_settings.py | nanuxbe/django-allowedsites | 16630b23d9faeb86b708dd45619ffe8823d5229a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | test_settings.py | nanuxbe/django-allowedsites | 16630b23d9faeb86b708dd45619ffe8823d5229a | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-05-16T23:13:48.000Z | 2020-05-16T23:13:48.000Z | # -*- coding: utf-8 -*-
import logging
import os
try:
logging.getLogger('allowedsites').addHandler(logging.NullHandler())
except AttributeError: # < Python 2.7
pass
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = (
'djan... | 22.780822 | 71 | 0.6362 | # -*- coding: utf-8 -*-
import logging
import os
try:
logging.getLogger('allowedsites').addHandler(logging.NullHandler())
except AttributeError: # < Python 2.7
pass
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = (
'djan... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6448da6c8c4ba31f2fc5625731bdeb52d43281a9 | 77 | py | Python | info.py | UOSupermileage/uosm-web | 71bbfa7e94f3622678fd7c15ea9475c0bb7c726e | [
"MIT"
] | 2 | 2021-09-13T04:38:29.000Z | 2021-11-05T18:32:09.000Z | info.py | UOSupermileage/uosm-web | 71bbfa7e94f3622678fd7c15ea9475c0bb7c726e | [
"MIT"
] | null | null | null | info.py | UOSupermileage/uosm-web | 71bbfa7e94f3622678fd7c15ea9475c0bb7c726e | [
"MIT"
] | null | null | null | # This file is present to facilitate semantic releases.
__version__ = "0.2.0" | 38.5 | 55 | 0.766234 | # This file is present to facilitate semantic releases.
__version__ = "0.2.0" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed818da9f51923bd83c7489413957e2dcf590351 | 1,182 | py | Python | aws-services/api-gateway/poc-02/create_jwt.py | nicc777/aws-notes | 78a0b055ea987cf6e8509404fcdb57b7795e0e8d | [
"MIT"
] | null | null | null | aws-services/api-gateway/poc-02/create_jwt.py | nicc777/aws-notes | 78a0b055ea987cf6e8509404fcdb57b7795e0e8d | [
"MIT"
] | null | null | null | aws-services/api-gateway/poc-02/create_jwt.py | nicc777/aws-notes | 78a0b055ea987cf6e8509404fcdb57b7795e0e8d | [
"MIT"
] | null | null | null | import jwt
import uuid
import json
import os
API_ID = os.getenv('AWS_APIGW_ID', 'unknown')
AWS_REGION = os.getenv('AWS_REGION', 'us-east-1')
SECRET = 'cvb973246g(*&^89gbn(^&$%VC*67i876bnf9nm(*)&^%B*)(bfmj99087wq6onIOIKG(*765'
TTL = 60
now = get_utc_timestamp()
payload = {
'iss': 'test-issuer',
'sub': '3f... | 28.142857 | 253 | 0.600677 | import jwt
from datetime import datetime
import uuid
import json
import os
API_ID = os.getenv('AWS_APIGW_ID', 'unknown')
AWS_REGION = os.getenv('AWS_REGION', 'us-east-1')
def get_utc_timestamp(with_decimal: bool=False):
epoch = datetime(1970,1,1,0,0,0)
now = datetime.utcnow()
timestamp = (now - epoch... | 0 | 0 | 0 | 0 | 0 | 216 | 0 | 8 | 46 |
49ca68a62eb39c26a95af99f127f310820766df5 | 2,610 | py | Python | chia/consensus/block_rewards.py | Hydrangea-Network/hydrangea-blockchain | d15662329958dbdaa9cbd99733ba729f0e74ce54 | [
"Apache-2.0"
] | 1 | 2022-03-15T06:41:49.000Z | 2022-03-15T06:41:49.000Z | chia/consensus/block_rewards.py | Hydrangea-Network/hydrangea-blockchain | d15662329958dbdaa9cbd99733ba729f0e74ce54 | [
"Apache-2.0"
] | null | null | null | chia/consensus/block_rewards.py | Hydrangea-Network/hydrangea-blockchain | d15662329958dbdaa9cbd99733ba729f0e74ce54 | [
"Apache-2.0"
] | null | null | null | from chia.util.ints import uint32, uint64
# 1 Hydrangea coin = 1,000,000,000,000 = 1 trillion mojo.
_mojo_per_hydrangea = 1000000000000
_prefarm = 21000000
_blocks_per_year = 1681920 # 32 * 6 * 24 * 365
_block_reward = 125 # 125 Hydrangea are awarded per block
_farmer_fraction = (10 / _block_reward)
_pool_fraction = ... | 40.153846 | 112 | 0.722222 | from chia.util.ints import uint32, uint64
# 1 Hydrangea coin = 1,000,000,000,000 = 1 trillion mojo.
_mojo_per_hydrangea = 1000000000000
_prefarm = 21000000
_blocks_per_year = 1681920 # 32 * 6 * 24 * 365
_block_reward = 125 # 125 Hydrangea are awarded per block
_farmer_fraction = (10 / _block_reward)
_pool_fraction = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ebfd65f6fb8d2ff5aa8cdd7113bbee83516b0083 | 2,788 | py | Python | test/test_shares_api.py | Apteco/apteco-api | 7440c98ab10ea6d8a5997187f6fc739ce1c75d2b | [
"Apache-2.0"
] | 2 | 2020-05-21T14:24:16.000Z | 2020-12-03T19:56:34.000Z | test/test_shares_api.py | Apteco/apteco-api | 7440c98ab10ea6d8a5997187f6fc739ce1c75d2b | [
"Apache-2.0"
] | null | null | null | test/test_shares_api.py | Apteco/apteco-api | 7440c98ab10ea6d8a5997187f6fc739ce1c75d2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Apteco API
An API to allow access to Apteco Marketing Suite resources # noqa: E501
The version of the OpenAPI document: v2
Contact: support@apteco.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
if __name__ == ... | 26.552381 | 105 | 0.66571 | # coding: utf-8
"""
Apteco API
An API to allow access to Apteco Marketing Suite resources # noqa: E501
The version of the OpenAPI document: v2
Contact: support@apteco.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import apteco_api... | 0 | 0 | 0 | 2,291 | 0 | 0 | 0 | 41 | 104 |
805b9cf9b9b343695f7dccb427a2dd1e49a092eb | 3,986 | py | Python | genre_api/tests/song_test.py | Pikipoo/genre-api | f944ec409f8e2c65b758e7f5d859f5d50ed8f397 | [
"MIT"
] | 1 | 2020-04-03T19:48:52.000Z | 2020-04-03T19:48:52.000Z | genre_api/tests/song_test.py | Pikipoo/genre-api | f944ec409f8e2c65b758e7f5d859f5d50ed8f397 | [
"MIT"
] | null | null | null | genre_api/tests/song_test.py | Pikipoo/genre-api | f944ec409f8e2c65b758e7f5d859f5d50ed8f397 | [
"MIT"
] | null | null | null | from genre_api.models.genre import Genre
from genre_api.models.singer import Singer
from genre_api.models.song import Song
from genre_api.models.playlist import Playlist
from genre_api.models.song_to_playlist import SongToPlaylist
MODELS = [Genre, Singer, Song, Playlist, SongToPlaylist]
| 26.751678 | 72 | 0.49423 | import unittest
import pytest
import json
from peewee import SqliteDatabase
from genre_api.models.genre import Genre
from genre_api.models.singer import Singer
from genre_api.models.song import Song
from genre_api.models.playlist import Playlist
from genre_api.models.song_to_playlist import SongToPlaylist
MODELS = [Ge... | 0 | 3,597 | 0 | 0 | 0 | 0 | 0 | -12 | 111 |
152616dafd5478dd6aff5f6cf699ff56470bbcab | 3,556 | py | Python | 13-graphparsing/biaffine_parser.py | MysteryVaibhav/nn4nlp-code | ff32018e2d6353621509aa0ad193b388f4d81c82 | [
"Apache-2.0"
] | 82 | 2017-10-25T22:42:12.000Z | 2020-01-27T00:26:39.000Z | 13-graphparsing/biaffine_parser.py | MysteryVaibhav/nn4nlp-code | ff32018e2d6353621509aa0ad193b388f4d81c82 | [
"Apache-2.0"
] | null | null | null | 13-graphparsing/biaffine_parser.py | MysteryVaibhav/nn4nlp-code | ff32018e2d6353621509aa0ad193b388f4d81c82 | [
"Apache-2.0"
] | 14 | 2017-10-26T17:50:54.000Z | 2018-12-14T09:39:15.000Z | from __future__ import print_function
import time
import random
start = time.time()
from collections import defaultdict
from biaffine import DeepBiaffineAttentionDecoder
import dynet as dy
# format of files: each line is "word1/tag2 word2/tag2 ..."
train_file = "../data/parsing/graph/ptb_train.txt"
test_file = "../... | 34.192308 | 121 | 0.646513 | from __future__ import print_function
import time
import random
start = time.time()
from collections import Counter, defaultdict
from biaffine import DeepBiaffineAttentionDecoder
import dynet as dy
import numpy as np
# format of files: each line is "word1/tag2 word2/tag2 ..."
train_file = "../data/parsing/graph/ptb... | 0 | 0 | 0 | 0 | 478 | 993 | 0 | 6 | 91 |
f0a9d0b8fd99baf66eba4fb262a1db52e7d6e713 | 18,310 | py | Python | eval/multi_bin/network-facing/binary_dependency_graph/plugins/semantic.py | cpbscholten/karonte | b989f7dfe9dbe002dd0dc4c4e5b0293dde61ae72 | [
"BSD-2-Clause"
] | 294 | 2019-11-14T13:14:55.000Z | 2022-03-22T08:28:56.000Z | eval/multi_bin/network-facing/binary_dependency_graph/plugins/semantic.py | cpbscholten/karonte | b989f7dfe9dbe002dd0dc4c4e5b0293dde61ae72 | [
"BSD-2-Clause"
] | 17 | 2019-12-23T09:32:00.000Z | 2022-03-17T20:00:13.000Z | eval/multi_bin/network-facing/binary_dependency_graph/plugins/semantic.py | cpbscholten/karonte | b989f7dfe9dbe002dd0dc4c4e5b0293dde61ae72 | [
"BSD-2-Clause"
] | 50 | 2019-11-25T02:27:04.000Z | 2021-12-10T04:46:26.000Z |
INDEXING_OPS = ('add', 'sub')
CMP_FUNCTIONS = ('strcmp', 'strncmp', 'memcmp')
LIB_KEYWORD = 'lib' | 42.482599 | 128 | 0.534626 | import angr
from __init__ import Plugin
from binary_dependency_graph.utils import *
from binary_dependency_graph.bdp_enum import *
from taint_analysis.utils import *
import itertools
INDEXING_OPS = ('add', 'sub')
CMP_FUNCTIONS = ('strcmp', 'strncmp', 'memcmp')
LIB_KEYWORD = 'lib'
class Semantic(Plugin):
def __in... | 0 | 60 | 0 | 17,946 | 0 | 0 | 0 | 51 | 155 |
a1c0d060a4c329624d300f8155e045acd786260f | 9,602 | py | Python | src/ImageLibrary/open_cv.py | oeick/robotframework-imagelibrary | 5c304374be82bbeb8f26256fecf20a4707fd116f | [
"Apache-2.0"
] | null | null | null | src/ImageLibrary/open_cv.py | oeick/robotframework-imagelibrary | 5c304374be82bbeb8f26256fecf20a4707fd116f | [
"Apache-2.0"
] | null | null | null | src/ImageLibrary/open_cv.py | oeick/robotframework-imagelibrary | 5c304374be82bbeb8f26256fecf20a4707fd116f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
try:
except ImportError:
pass #for stand-alone usage | 37.217054 | 117 | 0.586232 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import cv2
from ImageLibrary import imutils
from PIL import Image
from future.utils import iterkeys, itervalues
try:
from SlotBot import errors
except ImportError:
pass #for stand-alone usage
import numpy as np
from robot... | 0 | 0 | 0 | 9,208 | 0 | 0 | 0 | 43 | 206 |
a1f7ea1eae88a117ca54859734d643cf3a2372a4 | 2,501 | py | Python | phase1/consumer-to-SQL.py | malbt/Kafka3-Data | 47e30a300b1ce2d21356e24f6a5ba847d20b8a8c | [
"MIT"
] | null | null | null | phase1/consumer-to-SQL.py | malbt/Kafka3-Data | 47e30a300b1ce2d21356e24f6a5ba847d20b8a8c | [
"MIT"
] | null | null | null | phase1/consumer-to-SQL.py | malbt/Kafka3-Data | 47e30a300b1ce2d21356e24f6a5ba847d20b8a8c | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
drop_tbl_transaction()
create_tbl_transaction()
c = XactionConsumer()
c.handleMessages()
| 36.246377 | 92 | 0.59976 | from kafka import KafkaConsumer, TopicPartition, conn
from json import loads
from sqlalchemy import create_engine
class XactionConsumer:
def __init__(self):
self.consumer = KafkaConsumer('bank-customer-events',
bootstrap_servers=['localhost:9092'],
... | 0 | 0 | 0 | 1,665 | 0 | 516 | 0 | 48 | 135 |
a31e201279f3aaf8363166dcf5f063c14c88f726 | 1,576 | py | Python | src/app/__init__.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | 3 | 2020-05-25T19:36:11.000Z | 2021-09-15T09:05:57.000Z | src/app/__init__.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | 1 | 2021-04-30T21:11:44.000Z | 2021-04-30T21:11:44.000Z | src/app/__init__.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
db = SQLAlchemy()
| 28.142857 | 84 | 0.715736 | from flask import Flask, render_template, jsonify
from flask_sqlalchemy import SQLAlchemy
from src.config import DevelopmentConfig
from flask_migrate import Migrate
import logging
from logging.handlers import RotatingFileHandler
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file... | 0 | 0 | 0 | 0 | 0 | 1,165 | 0 | 79 | 134 |
995daf4b421dfae3e6653d3eaea64ac95bc08e15 | 334 | py | Python | RFC_downloader.py | tejajrk/learning_python | f53df3a15378f2c5d217092c7026c1c3cb06c327 | [
"Apache-2.0"
] | null | null | null | RFC_downloader.py | tejajrk/learning_python | f53df3a15378f2c5d217092c7026c1c3cb06c327 | [
"Apache-2.0"
] | null | null | null | RFC_downloader.py | tejajrk/learning_python | f53df3a15378f2c5d217092c7026c1c3cb06c327 | [
"Apache-2.0"
] | null | null | null | import sys, urllib.request
try:
rfc_number = int(sys.argv[1])
except (IndexError, ValueError):
print('Must supply an RFC number as first argument')
sys.exit(2)
template = 'http://www.ietf.org/rfc/rfc{}.txt'
url = template.format(rfc_number)
rfc_raw = urllib.request.urlopen(url).read()
rfc = rfc_raw.decod... | 25.692308 | 56 | 0.709581 | import sys, urllib.request
try:
rfc_number = int(sys.argv[1])
except (IndexError, ValueError):
print('Must supply an RFC number as first argument')
sys.exit(2)
template = 'http://www.ietf.org/rfc/rfc{}.txt'
url = template.format(rfc_number)
rfc_raw = urllib.request.urlopen(url).read()
rfc = rfc_raw.decod... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
341d5b3ee12cb87598893e3d3b3d2299eb1c30ee | 17,771 | py | Python | source/cfa.py | tehybel/DSol-decompiler | 773e8f137f2489973b250d37354b7c3b20cf8c51 | [
"MIT"
] | 5 | 2018-08-13T15:04:12.000Z | 2021-12-30T15:35:35.000Z | source/cfa.py | tehybel/DSol-decompiler | 773e8f137f2489973b250d37354b7c3b20cf8c51 | [
"MIT"
] | null | null | null | source/cfa.py | tehybel/DSol-decompiler | 773e8f137f2489973b250d37354b7c3b20cf8c51 | [
"MIT"
] | 1 | 2019-03-13T09:34:30.000Z | 2019-03-13T09:34:30.000Z |
MAX_ITERATIONS = 20
##############################################################################
######################## conditional structuring #############################
##############################################################################
"""
Constraints:
- if the header is inside a loop,... | 27.985827 | 78 | 0.693827 | import hlir
import expr
import utils
import numbering
import draw
MAX_ITERATIONS = 20
class Loop:
def __init__(self, h, f, nodes):
assert (isinstance(h, hlir.BasicBlock))
assert (f is None or isinstance(f, hlir.BasicBlock))
for n in nodes:
assert (isinstance(n, hlir.BasicBlock))
self.header_node = h
s... | 0 | 0 | 0 | 15,882 | 0 | 286 | 0 | -44 | 272 |
9b00c8cbcf303be4a593a65e04c653e66f8bfae6 | 1,341 | py | Python | utils/permissions.py | Akkihi/Custom-Commands-Bot | 974013211783eb46501c6fec79a5298cee36b260 | [
"MIT"
] | 1 | 2021-03-31T12:36:33.000Z | 2021-03-31T12:36:33.000Z | utils/permissions.py | Akkihi/Custom-Commands-Bot | 974013211783eb46501c6fec79a5298cee36b260 | [
"MIT"
] | null | null | null | utils/permissions.py | Akkihi/Custom-Commands-Bot | 974013211783eb46501c6fec79a5298cee36b260 | [
"MIT"
] | null | null | null |
# -
# user_tarif chat_tarif
#
| 34.384615 | 96 | 0.692767 | from datetime import datetime
from typing import Union
import config
import models
# Старый вариант премиума где дата окончания находится в таблице пользователей - удалить
def has_premium(db_user_or_chat: Union[models.User, models.Chat]) -> bool:
premium_to = db_user_or_chat.premium_to
if premium_to.year > d... | 332 | 0 | 0 | 0 | 0 | 984 | 0 | -5 | 133 |
e14a2c96dec349b44b4eb74c06c1f6d5f66d9937 | 1,921 | py | Python | profiles/migrations/0021_add_address_and_phone.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 32 | 2016-03-25T01:03:13.000Z | 2022-01-15T19:35:42.000Z | profiles/migrations/0021_add_address_and_phone.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 4,858 | 2016-03-03T13:48:30.000Z | 2022-03-29T22:09:51.000Z | profiles/migrations/0021_add_address_and_phone.py | umarmughal824/micromasters | ea92d3bcea9be4601150fc497302ddacc1161622 | [
"BSD-3-Clause"
] | 20 | 2016-08-18T22:07:44.000Z | 2021-11-15T13:35:35.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-02 19:35
from __future__ import unicode_literals
| 31.491803 | 73 | 0.571057 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-02 19:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0020_about_me_field'),
]
operations = [
migrations.AddField(
... | 0 | 0 | 0 | 1,742 | 0 | 0 | 0 | 19 | 46 |
bc74c26c18cf7fabb7290dad9ea206b06724c216 | 912 | py | Python | module1/task4.py | teslaistra/PythonTasksForITAM | 0fc5c7b0ff11ae7c364187e2fffbee935ecbaaf2 | [
"MIT"
] | 1 | 2022-01-10T07:21:39.000Z | 2022-01-10T07:21:39.000Z | module1/task4.py | teslaistra/PythonTasksForITAM | 0fc5c7b0ff11ae7c364187e2fffbee935ecbaaf2 | [
"MIT"
] | null | null | null | module1/task4.py | teslaistra/PythonTasksForITAM | 0fc5c7b0ff11ae7c364187e2fffbee935ecbaaf2 | [
"MIT"
] | null | null | null |
# Depeche Mode
# round(a, b)
# a, , b
# round https://docs.python.org/3/search.html?q=round
violator_songs_list = [
['World in My Eyes', 4.86],
['Sweetest Perfection', 4.43],
['Personal Jesus', 4.56],
['Halo', 4.9],
['Waiting for the Night', 6.07],
['Enjoy the ... | 35.076923 | 108 | 0.692982 |
# Есть список песен группы Depeche Mode со временем звучания с точностью до долей минут
# Точность указывается в функции round(a, b)
# где a, это число которое надо округлить, а b количество знаков после запятой
# более подробно про функцию round смотрите в документации https://docs.python.org/3/search.html?q=round
v... | 690 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c5924e0b85cfa3c5247ec98d6988bcc8eef21a43 | 251 | py | Python | 1 - Beginner/1079.py | andrematte/uri-submissions | 796e7fee56650d9e882880318d6e7734038be2dc | [
"MIT"
] | 1 | 2020-09-09T12:48:09.000Z | 2020-09-09T12:48:09.000Z | 1 - Beginner/1079.py | andrematte/uri-submissions | 796e7fee56650d9e882880318d6e7734038be2dc | [
"MIT"
] | null | null | null | 1 - Beginner/1079.py | andrematte/uri-submissions | 796e7fee56650d9e882880318d6e7734038be2dc | [
"MIT"
] | null | null | null | # Uri Online Judge 1079
N = int(input())
for i in range(0,N):
Numbers = input()
num1 = float(Numbers.split()[0])
num2 = float(Numbers.split()[1])
num3 = float(Numbers.split()[2])
print(((2*num1+3*num2+5*num3)/10).__round__(1)) | 19.307692 | 51 | 0.59761 | # Uri Online Judge 1079
N = int(input())
for i in range(0,N):
Numbers = input()
num1 = float(Numbers.split()[0])
num2 = float(Numbers.split()[1])
num3 = float(Numbers.split()[2])
print(((2*num1+3*num2+5*num3)/10).__round__(1)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4aa813ee790ff621085725fa4ee4c2c3ddc7cbae | 201 | py | Python | Practice.py | Vayne-Lover/Python | 79cfe3d6971a7901d420ba5a7f52bf4c68f6a1c1 | [
"Apache-2.0"
] | 1 | 2016-07-14T06:16:58.000Z | 2016-07-14T06:16:58.000Z | Practice.py | Vayne-Lover/Python | 79cfe3d6971a7901d420ba5a7f52bf4c68f6a1c1 | [
"Apache-2.0"
] | null | null | null | Practice.py | Vayne-Lover/Python | 79cfe3d6971a7901d420ba5a7f52bf4c68f6a1c1 | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python
print 2**3
print pow(2,3)
print abs(-10)
print round(1.536,2)
print 1/2
print 1.0//2.0
print 0xAF
print 010
import cmath
print cmath.sqrt(-1)
import math
print math.floor(32.8)
| 14.357143 | 23 | 0.721393 | #!/usr/local/bin/python
print 2**3
print pow(2,3)
print abs(-10)
print round(1.536,2)
print 1/2
print 1.0//2.0
print 0xAF
print 010
import cmath
print cmath.sqrt(-1)
import math
print math.floor(32.8)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7d76aebb33bbf2a21290cb6ae854a56b3ae91cf2 | 22,111 | py | Python | tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/qat/modules/conv_fused.py | bluetiger9/Vitis-AI | a7728733bbcfc292ff3afa46b9c8b03e94b740b3 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/qat/modules/conv_fused.py | wangyifan778/Vitis-AI | f61061eef7550d98bf02a171604c9a9f283a7c47 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/qat/modules/conv_fused.py | wangyifan778/Vitis-AI | f61061eef7550d98bf02a171604c9a9f283a7c47 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2019 Xilinx 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 to in writing, ... | 34.174652 | 116 | 0.646601 | # Copyright 2019 Xilinx 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 to in writing, ... | 6 | 1,557 | 0 | 18,348 | 0 | 168 | 0 | 51 | 408 |
3f7b59a974d5a756d2a4c521e054760c95265a80 | 19,981 | py | Python | analyticlab/measure/basemeasure.py | xingrongtech/analyticlab | 2827591db9b31ff38299712ed6c404ff30583f6f | [
"MIT"
] | 13 | 2018-05-11T02:45:11.000Z | 2021-07-17T22:19:04.000Z | analyticlab/measure/basemeasure.py | xingrongtech/analyticlab | 2827591db9b31ff38299712ed6c404ff30583f6f | [
"MIT"
] | null | null | null | analyticlab/measure/basemeasure.py | xingrongtech/analyticlab | 2827591db9b31ff38299712ed6c404ff30583f6f | [
"MIT"
] | 2 | 2019-10-17T11:43:11.000Z | 2019-11-27T10:54:28.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 6 20:04:16 2018
@author: xingrongtech
"""
from sympy import Symbol
from quantities.quantity import Quantity
from . import ACategory, BCategory, measure
from .ins import Ins
from ..amath import sqrt
from ..num import Num
from ..numitem import NumItem
from ..lsym import L... | 44.205752 | 218 | 0.523998 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 6 20:04:16 2018
@author: xingrongtech
"""
from sympy import Symbol
from quantities.quantity import Quantity
from . import ACategory, BCategory, measure
from .ins import Ins
from ..amath import sqrt
from ..num import Num
from ..numitem import NumItem
from ..lsym import ... | 4,481 | 0 | 0 | 158 | 0 | 59 | 0 | 0 | 85 |
7cb66bf77b707c01050b0a0426ab956551aff770 | 3,022 | py | Python | exam/test_bert_polarity.py | fabiorodp/IN5550_Neural_Methods_in_Natural_Language_Processing | 4d3b2ed56b56e016413ae1544e19ad2a2c0ef047 | [
"MIT"
] | null | null | null | exam/test_bert_polarity.py | fabiorodp/IN5550_Neural_Methods_in_Natural_Language_Processing | 4d3b2ed56b56e016413ae1544e19ad2a2c0ef047 | [
"MIT"
] | null | null | null | exam/test_bert_polarity.py | fabiorodp/IN5550_Neural_Methods_in_Natural_Language_Processing | 4d3b2ed56b56e016413ae1544e19ad2a2c0ef047 | [
"MIT"
] | null | null | null | # Author: Fabio Rodrigues Pereira
# E-mail: fabior@uio.no
# Author: Per Morten Halvorsen
# E-mail: pmhalvor@uio.no
# Author: Eivind Grnlie Guren
# E-mail: eivindgg@ifi.uio.no
try:
from exam.utils.preprocessing import OurDataset, pad_b
from exam.utils.models import Transformer, TransformerMTL
except:
fro... | 25.394958 | 71 | 0.703839 | # Author: Fabio Rodrigues Pereira
# E-mail: fabior@uio.no
# Author: Per Morten Halvorsen
# E-mail: pmhalvor@uio.no
# Author: Eivind Grønlie Guren
# E-mail: eivindgg@ifi.uio.no
try:
from exam.utils.preprocessing import OurDataset, pad_b
from exam.utils.models import Transformer, TransformerMTL
except:
fr... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 0 |
2b1be95ae9c0baf03b1fa88672e107128b152781 | 924 | py | Python | main.py | jammiess/greenery | e7bc31cb4acfd6070d5b9ef1c8c7b4792421f78b | [
"MIT"
] | null | null | null | main.py | jammiess/greenery | e7bc31cb4acfd6070d5b9ef1c8c7b4792421f78b | [
"MIT"
] | null | null | null | main.py | jammiess/greenery | e7bc31cb4acfd6070d5b9ef1c8c7b4792421f78b | [
"MIT"
] | 1 | 2020-05-01T01:30:06.000Z | 2020-05-01T01:30:06.000Z | import sys
from greenery.lego import lego, parse
from greenery.fsm import FSM
regexes = list(sys.argv[1:])
if len(regexes) == 0:
from ast import literal_eval
while True:
reg = input("regex|")
if not reg:
break
if reg[0] in '\'"' or reg[:2] in ('r"',"r'"):
reg = ... | 33 | 98 | 0.606061 | import sys
from greenery.lego import lego, parse
from greenery.fsm import FSM
regexes = list(sys.argv[1:])
if len(regexes) == 0:
from ast import literal_eval
while True:
reg = input("regex|")
if not reg:
break
if reg[0] in '\'"' or reg[:2] in ('r"',"r'"):
reg = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
31a1982897e934cd84d8d73882047adc5046e1e0 | 8,330 | py | Python | configs/sweeps/gpa_p-p.py | ThaddaeusWiedemer/mmdetection | 3e9894111eebe9a3ca31936ff6413be264fe4bc2 | [
"Apache-2.0"
] | null | null | null | configs/sweeps/gpa_p-p.py | ThaddaeusWiedemer/mmdetection | 3e9894111eebe9a3ca31936ff6413be264fe4bc2 | [
"Apache-2.0"
] | null | null | null | configs/sweeps/gpa_p-p.py | ThaddaeusWiedemer/mmdetection | 3e9894111eebe9a3ca31936ff6413be264fe4bc2 | [
"Apache-2.0"
] | null | null | null | # model
model = dict(
type='TwoStageDetectorDA', # use adaptive model
# pretrained='open-mmlab://detectron2/resnet50_caffe', # only for backbone, overwritten by `load_from=...`
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, ... | 44.545455 | 117 | 0.52377 | # model
model = dict(
type='TwoStageDetectorDA', # use adaptive model
# pretrained='open-mmlab://detectron2/resnet50_caffe', # only for backbone, overwritten by `load_from=...`
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a09c8161d88c158484b3ec790bea324dd8671a7 | 2,192 | py | Python | dali/test/python/test_backend_impl.py | npanpaliya/DALI | dc13d3b9d1a2fe67931b05a2861e81cd50da4d2b | [
"ECL-2.0",
"Apache-2.0"
] | 11 | 2021-03-16T05:09:16.000Z | 2022-03-29T12:48:44.000Z | dali/test/python/test_backend_impl.py | npanpaliya/DALI | dc13d3b9d1a2fe67931b05a2861e81cd50da4d2b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/test/python/test_backend_impl.py | npanpaliya/DALI | dc13d3b9d1a2fe67931b05a2861e81cd50da4d2b | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2021-05-08T16:51:55.000Z | 2021-07-22T09:02:44.000Z | # Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | 37.152542 | 74 | 0.715785 | # Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | 0 | 0 | 0 | 0 | 0 | 1,016 | 0 | 54 | 182 |
5494ca9cfd479cf5f2f2a263b6c2c13398854cd1 | 44,042 | py | Python | app/libs/opasDocuments.py | nrshapiro/openpubarchive | f6d3b7da6cd23e51b32e16e17ccb55b8511d32a6 | [
"Apache-2.0"
] | 1 | 2019-04-01T14:45:33.000Z | 2019-04-01T14:45:33.000Z | app/libs/opasDocuments.py | nrshapiro/openpubarchive | f6d3b7da6cd23e51b32e16e17ccb55b8511d32a6 | [
"Apache-2.0"
] | 46 | 2019-05-14T14:16:15.000Z | 2020-08-06T03:45:12.000Z | app/libs/opasDocuments.py | nrshapiro/openpubarchive | f6d3b7da6cd23e51b32e16e17ccb55b8511d32a6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
Classes to manage the VolumeNumbers, PageNumbers, and PageRanges, as would be found in books and journals.
Contains classes:
VolumeNumber - Class to encapsulate journal and book volume numbers, as their own data type.
PageNumber - Class to encapsulate pagenumbers for journal and bo... | 33.722818 | 156 | 0.478407 | # -*- coding: UTF-8 -*-
"""
Classes to manage the VolumeNumbers, PageNumbers, and PageRanges, as would be found in books and journals.
Contains classes:
VolumeNumber - Class to encapsulate journal and book volume numbers, as their own data type.
PageNumber - Class to encapsulate pagenumbers for journal and bo... | 0 | 0 | 0 | 39,443 | 0 | 0 | 0 | 0 | 92 |
b901df73e4f63f7a5ee0fb4641bb87250bc5bf0e | 529 | py | Python | sorting_algos/quicksort/test_quicksort.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 1 | 2021-04-02T12:12:20.000Z | 2021-04-02T12:12:20.000Z | sorting_algos/quicksort/test_quicksort.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 2 | 2018-03-21T17:34:34.000Z | 2018-03-26T16:46:07.000Z | sorting_algos/quicksort/test_quicksort.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 2 | 2018-08-29T18:59:59.000Z | 2019-04-12T21:16:14.000Z | from quicksort import quicksort
def test_quicksort():
"""Test quicksort algorithm with odd-numbered list."""
list = [13, 28, 5]
assert quicksort(list, 0, len(list) - 1) == [5, 13, 28]
def test_quicksort_even():
"""Test quicksort algorithm with even-numbered list."""
list = [13, 28, 5, 40]
as... | 26.45 | 63 | 0.620038 | from quicksort import quicksort
def test_quicksort():
"""Test quicksort algorithm with odd-numbered list."""
list = [13, 28, 5]
assert quicksort(list, 0, len(list) - 1) == [5, 13, 28]
def test_quicksort_even():
"""Test quicksort algorithm with even-numbered list."""
list = [13, 28, 5, 40]
as... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
611cfb953e2666db7d4e75e89df2c4fde31f6554 | 8,483 | py | Python | src/tipsextension/azext_tipsextension/vendored_sdks/oscp/controlplane/models/_models_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | null | null | null | src/tipsextension/azext_tipsextension/vendored_sdks/oscp/controlplane/models/_models_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | null | null | null | src/tipsextension/azext_tipsextension/vendored_sdks/oscp/controlplane/models/_models_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.2.1, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# ------------------------------------------... | 31.652985 | 99 | 0.590593 | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.2.1, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# ------------------------------------------... | 0 | 0 | 0 | 7,916 | 0 | 0 | 0 | 24 | 184 |
6f03d28e7bc1ac22f1a791900a5650a2e948b026 | 2,881 | py | Python | app/model/diff.py | LiberLife/UTAU_Diff | 3726a88df705171d0596845e95c8e69a7e2898d7 | [
"WTFPL"
] | null | null | null | app/model/diff.py | LiberLife/UTAU_Diff | 3726a88df705171d0596845e95c8e69a7e2898d7 | [
"WTFPL"
] | null | null | null | app/model/diff.py | LiberLife/UTAU_Diff | 3726a88df705171d0596845e95c8e69a7e2898d7 | [
"WTFPL"
] | null | null | null | # -*- coding: utf-8 -*-
| 33.894118 | 131 | 0.693509 | # -*- coding: utf-8 -*-
import re
class Diff:
__data = None
__snapshot_data = None
def __init__(self, data, snapshot_data):
self.__data = data
self.__snapshot_data = snapshot_data
def diff(self):
# Clynp
is_equal_count = self.__is_equal_count()
is_equal_length = False
is_equal_lyri... | 0 | 0 | 0 | 2,821 | 0 | 0 | 0 | -12 | 46 |
8dc713dc0626e41a1dde9085017079198735c557 | 796 | py | Python | part-1/render.py | HenrYxZ/raytracing-para-todos | 36864d099f5aaff0e9133bcbcdd24a32bb5f0685 | [
"MIT"
] | 1 | 2021-10-02T19:59:25.000Z | 2021-10-02T19:59:25.000Z | part-1/render.py | sombra-studio/raytracing-para-todos | 6aef785702efdd3a26cff0d43e6f2e4edafda1d1 | [
"MIT"
] | null | null | null | part-1/render.py | sombra-studio/raytracing-para-todos | 6aef785702efdd3a26cff0d43e6f2e4edafda1d1 | [
"MIT"
] | null | null | null | # local modules
RGB_CHANNELS = 3
MAX_COLOR = 255
| 30.615385 | 72 | 0.591709 | import numpy as np
# local modules
from ray import Ray
from raytrace import raytrace
import utils
RGB_CHANNELS = 3
MAX_COLOR = 255
def render(sphere, light, camera, height, width):
output = np.zeros([height, width, RGB_CHANNELS], dtype=np.uint8)
for j in range(height):
for i in range(width):
... | 0 | 0 | 0 | 0 | 0 | 639 | 0 | -6 | 111 |
b94f7b0a353c4c3c698a927d8718bb5b490872cb | 11,367 | py | Python | tensorflow/contrib/mpi_collectives/__init__.py | acharal/tensorflow | c5d99169bea3f5d1e3cef973690d2ec7fdbac80f | [
"Apache-2.0"
] | 3 | 2017-10-27T05:37:59.000Z | 2018-05-25T02:46:40.000Z | tensorflow/contrib/mpi_collectives/__init__.py | acharal/tensorflow | c5d99169bea3f5d1e3cef973690d2ec7fdbac80f | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/mpi_collectives/__init__.py | acharal/tensorflow | c5d99169bea3f5d1e3cef973690d2ec7fdbac80f | [
"Apache-2.0"
] | 2 | 2021-01-04T21:15:02.000Z | 2021-10-15T10:45:47.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... | 41.485401 | 81 | 0.741445 | # 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 | 4,524 | 0 | 0 | 0 | 120 | 112 |
81f24198cc2e94df293cb67b3710f6b7689ebc7d | 2,905 | py | Python | aoc2021/day13/solution.py | jschmidtnj/competitive | cb16f285f1022d9d16e654b755d89a1b0e53deeb | [
"MIT"
] | null | null | null | aoc2021/day13/solution.py | jschmidtnj/competitive | cb16f285f1022d9d16e654b755d89a1b0e53deeb | [
"MIT"
] | null | null | null | aoc2021/day13/solution.py | jschmidtnj/competitive | cb16f285f1022d9d16e654b755d89a1b0e53deeb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
print(part_1())
print(part_2())
| 31.923077 | 64 | 0.443029 | #!/usr/bin/env python3
import matplotlib.pyplot as plt
from typing import List, Tuple, Set
def part_1() -> int:
dots: Set[Tuple[int, int]] = set()
folds: List[Tuple[str, int]] = []
fold_separator = 'fold along '
with open('input.txt', 'r') as f:
for line in f:
line = line.strip()
... | 0 | 0 | 0 | 0 | 0 | 2,698 | 0 | 24 | 91 |
13465cf598ae3503d45e145cb142f3683f2461ca | 6,428 | py | Python | src/datafinder/persistence/adapters/webdav_/principal_search/adapter.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 9 | 2016-05-25T06:12:52.000Z | 2021-04-30T07:22:48.000Z | src/datafinder/persistence/adapters/webdav_/principal_search/adapter.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 6 | 2016-03-29T13:38:18.000Z | 2017-01-18T15:57:42.000Z | src/datafinder/persistence/adapters/webdav_/principal_search/adapter.py | schlauch/DataFinder | 958fda4f3064f9f6b2034da396a20ac9d9abd52f | [
"BSD-3-Clause"
] | 7 | 2016-06-15T12:01:22.000Z | 2022-03-05T08:50:25.000Z | # $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
#
... | 46.57971 | 128 | 0.712819 | # $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
#
... | 0 | 1,232 | 0 | 2,929 | 0 | 0 | 0 | 253 | 214 |
61ee5b1d913d98cf0e1ff1d2fc387ac571f7c76f | 125 | py | Python | rigol.py | mbA2D/validation-tools | ecb8510caf6d0a76866cba6a7e18b4acfa1c57d0 | [
"MIT"
] | null | null | null | rigol.py | mbA2D/validation-tools | ecb8510caf6d0a76866cba6a7e18b4acfa1c57d0 | [
"MIT"
] | null | null | null | rigol.py | mbA2D/validation-tools | ecb8510caf6d0a76866cba6a7e18b4acfa1c57d0 | [
"MIT"
] | 1 | 2020-11-11T20:08:56.000Z | 2020-11-11T20:08:56.000Z | from ds1054z import DS1054Z
scope = DS1054Z('USB0::6833::1230::DS1ZA182511136::0::INSTR')
print("Connected to: ", scope.idn) | 31.25 | 61 | 0.736 | from ds1054z import DS1054Z
scope = DS1054Z('USB0::6833::1230::DS1ZA182511136::0::INSTR')
print("Connected to: ", scope.idn) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ecd2fe7df0b9136ae67d35ec5ffae541697f7e5d | 160 | py | Python | pygitdb/__init__.py | reclamador/pygitdb | 0c5ea79471152d890c5a45b23029aadcb83c89e4 | [
"MIT"
] | null | null | null | pygitdb/__init__.py | reclamador/pygitdb | 0c5ea79471152d890c5a45b23029aadcb83c89e4 | [
"MIT"
] | null | null | null | pygitdb/__init__.py | reclamador/pygitdb | 0c5ea79471152d890c5a45b23029aadcb83c89e4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for PyGitDB."""
__author__ = """Jorge Arevalo"""
__email__ = 'jorge.arevalo@reclamador.es'
__version__ = '0.1.0'
| 20 | 41 | 0.65 | # -*- coding: utf-8 -*-
"""Top-level package for PyGitDB."""
__author__ = """Jorge Arevalo"""
__email__ = 'jorge.arevalo@reclamador.es'
__version__ = '0.1.0'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e1b973894c4e58f547788a9e003d4dabadc2777a | 964 | py | Python | setup.py | Ktakuya332C/tracker | 371b493f97c64698e94050bb26df5af109714811 | [
"MIT"
] | null | null | null | setup.py | Ktakuya332C/tracker | 371b493f97c64698e94050bb26df5af109714811 | [
"MIT"
] | null | null | null | setup.py | Ktakuya332C/tracker | 371b493f97c64698e94050bb26df5af109714811 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
c_src_files = [
"tracker/src/tracker.cc",
"tracker/src/tracker_helper.cc",
"tracker/src/math_... | 25.368421 | 69 | 0.721992 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
c_src_files = [
"tracker/src/tracker.cc",
"tracker/src/tracker_helper.cc",
"tracker/src/math_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f947801ad12f27d7b8bbcaafd1f69f89ca3c3cd2 | 281 | py | Python | improvisers/__init__.py | mvcisback/improvisers | d7ccc9c560fbe939a24a7ad61f1d12a7c31157ae | [
"MIT"
] | null | null | null | improvisers/__init__.py | mvcisback/improvisers | d7ccc9c560fbe939a24a7ad61f1d12a7c31157ae | [
"MIT"
] | null | null | null | improvisers/__init__.py | mvcisback/improvisers | d7ccc9c560fbe939a24a7ad61f1d12a7c31157ae | [
"MIT"
] | null | null | null | """Library for synthesizing Entropic Reactive Control Improvisers for
stochastic games."""
# flake8: noqa
| 28.1 | 69 | 0.811388 | """Library for synthesizing Entropic Reactive Control Improvisers for
stochastic games."""
# flake8: noqa
from improvisers.game_graph import *
from improvisers.implicit import *
from improvisers.explicit import *
from improvisers.tabular import *
from improvisers.policy import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 64 | 110 |
d76d7738a9249ad5b2b98d610f51e50d387118db | 2,412 | py | Python | easygo/easyControl.py | shinkansan/2019-UGRP-DPoom | eedee93b47e068f22bf420140d869a43f7551876 | [
"Apache-2.0"
] | 33 | 2020-07-16T06:31:38.000Z | 2022-03-23T18:34:58.000Z | easygo/easyControl.py | shinkansan/2019-UGRP-DPoom | eedee93b47e068f22bf420140d869a43f7551876 | [
"Apache-2.0"
] | 5 | 2020-08-27T08:06:21.000Z | 2022-02-23T12:34:09.000Z | easygo/easyControl.py | shinkansan/2019-UGRP-DPoom | eedee93b47e068f22bf420140d869a43f7551876 | [
"Apache-2.0"
] | 10 | 2020-08-05T15:05:58.000Z | 2021-11-19T10:20:44.000Z | '''
Easy Control Beta
Speed Default 5
w
a s d
e : speed up 0.1
c : speed down 0.2
x : speed default 5
'''
import rospy
rospy.init_node('robot_easygo', anonymous=False)
import keyCap
main()
| 29.414634 | 79 | 0.424129 | '''
Easy Control Beta
Speed Default 5
w
a s d
e : speed up 0.1
c : speed down 0.2
x : speed default 5
'''
import rospy
rospy.init_node('robot_easygo', anonymous=False)
import math
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Imu
from std_msgs.msg import Float32
from tf.tran... | 0 | 0 | 0 | 0 | 0 | 1,955 | 0 | 30 | 209 |
8dd01c3d323676b652abb28772eb648e2596715b | 8,498 | py | Python | modules.py | MadScotty/DrDragonbot | fb33ae994004068ef5e3e53c40edc884f54407d4 | [
"MIT"
] | null | null | null | modules.py | MadScotty/DrDragonbot | fb33ae994004068ef5e3e53c40edc884f54407d4 | [
"MIT"
] | null | null | null | modules.py | MadScotty/DrDragonbot | fb33ae994004068ef5e3e53c40edc884f54407d4 | [
"MIT"
] | null | null | null | '''
Dr. Dragonbot by MadScotty
BEGIN LICENSE
By existing on the same mortal coil as the author of this software you hereby
allow the author, henceforth known as Dr. Awesomeweiner, to sleep on your couch,
watch your television, and use your microwave. By reading this license you agree
that Lord Satan isn't as bad a... | 41.05314 | 164 | 0.62803 | '''
Dr. Dragonbot by MadScotty
BEGIN LICENSE
By existing on the same mortal coil as the author of this software you hereby
allow the author, henceforth known as Dr. Awesomeweiner, to sleep on your couch,
watch your television, and use your microwave. By reading this license you agree
that Lord Satan isn't as bad a... | 0 | 0 | 7,171 | 0 | 0 | 0 | 0 | -15 | 177 |
a15226381c8efb16901379135585a2cafeb63e87 | 4,540 | py | Python | beanie/odm/utils/encoder.py | mikeckennedy/beanie | 3a3b52f7c4fcb07d51f5afb6b88f56161526c963 | [
"Apache-2.0"
] | null | null | null | beanie/odm/utils/encoder.py | mikeckennedy/beanie | 3a3b52f7c4fcb07d51f5afb6b88f56161526c963 | [
"Apache-2.0"
] | null | null | null | beanie/odm/utils/encoder.py | mikeckennedy/beanie | 3a3b52f7c4fcb07d51f5afb6b88f56161526c963 | [
"Apache-2.0"
] | null | null | null |
bson_encoder = Encoder()
| 34.923077 | 80 | 0.522907 | from collections import defaultdict
from datetime import datetime
from types import GeneratorType
from typing import (
AbstractSet,
Any,
Callable,
Dict,
List,
Mapping,
Tuple,
Union,
)
from uuid import UUID
from bson import ObjectId, DBRef
from pydantic import BaseModel
... | 0 | 0 | 0 | 4,093 | 0 | 0 | 0 | 179 | 236 |
70981da75929d11479a94e162bea6a0d4f071684 | 1,377 | py | Python | py_lets_be_quickly_rational/exceptions.py | tmcnitt/py_lets_be_quickly_rational | 229a780e7de0cc961cc658b58c16f9a63388826a | [
"MIT"
] | null | null | null | py_lets_be_quickly_rational/exceptions.py | tmcnitt/py_lets_be_quickly_rational | 229a780e7de0cc961cc658b58c16f9a63388826a | [
"MIT"
] | null | null | null | py_lets_be_quickly_rational/exceptions.py | tmcnitt/py_lets_be_quickly_rational | 229a780e7de0cc961cc658b58c16f9a63388826a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == "__main__":
try:
raise BelowIntrinsicException
except VolatilityValueException as e:
if not isinstance(e, BelowIntrinsicException):
raise Exception("Should be BelowIntrinsicException")
try:
raise AboveMaximumException
excep... | 34.425 | 117 | 0.681917 | # -*- coding: utf-8 -*-
from py_lets_be_quickly_rational import constants
class VolatilityValueException(Exception):
def __init__(self):
Exception.__init__(self, "Volatility value out of range.")
self.value = None
def __init__(self, message, value):
Exception.__init__(self, message)
... | 0 | 0 | 0 | 788 | 0 | 0 | 0 | 28 | 92 |
9da2baf339128c287348b769924983716d8838ac | 327 | py | Python | src/168. Excel Sheet Column Title.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/168. Excel Sheet Column Title.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/168. Excel Sheet Column Title.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null |
print Solution().convertToTitle(701) | 14.863636 | 36 | 0.486239 | class Solution(object):
def convertToTitle(self, n):
"""
:type n: int
:rtype: str
"""
a = 26; b = 0; d = 1
while n > (b+a):
b += a
a *= 26
d += 1
n = n - b - 1
s = ''
for dd in xrange(d, 0, -1):
m, n = divmod(n, 26**(dd-1))
s = s + chr(65+m)
return s
print Solution().convertToTit... | 0 | 0 | 0 | 268 | 0 | 0 | 0 | 0 | 22 |
7c82a6f5cd16b04878d49c0729590e822e636781 | 8,721 | py | Python | jc/cli.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | jc/cli.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | jc/cli.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""jc - JSON CLI output utility
JC cli module
"""
import sys
import os
import shlex
import importlib
import textwrap
import jc.utils
__version__ = info.version
parsers = [
'arp',
'blkid',
'crontab',
'crontab-u',
'csv',
'df',
'dig',
'du',
'env',
'free',
... | 26.669725 | 172 | 0.534342 | #!/usr/bin/env python3
"""jc - JSON CLI output utility
JC cli module
"""
import sys
import os
import shlex
import importlib
import textwrap
import signal
import json
import jc.utils
class info():
version = '1.8.0'
description = 'jc cli output JSON conversion tool'
author = 'Kelly Brazil'
author_email ... | 0 | 0 | 0 | 143 | 0 | 2,054 | 0 | -18 | 113 |
232a7a8b1d9b38da059e902798d4d48ce851ee28 | 126 | py | Python | main.py | mohit-raj/Role-Based-Access-Control | 5780ff96567050aee7d865335c75e6f300d5ac05 | [
"MIT"
] | null | null | null | main.py | mohit-raj/Role-Based-Access-Control | 5780ff96567050aee7d865335c75e6f300d5ac05 | [
"MIT"
] | 1 | 2021-04-12T17:41:17.000Z | 2021-04-12T17:41:17.000Z | main.py | mohit-raj/Role-Based-Access-Control | 5780ff96567050aee7d865335c75e6f300d5ac05 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 11.454545 | 32 | 0.619048 | from pyauth.system import System
def main():
system = System()
system.run()
if __name__ == '__main__':
main()
| 0 | 0 | 0 | 0 | 0 | 29 | 0 | 11 | 45 |
c9204b81effe7e9e712063a8dca440dcefa0e84b | 4,168 | py | Python | catkin_ws_src/src/imu/src/imu_test.py | Ethancao123/InnoBot | 02e0321cd5e353187659a2ac61c5f3cf6d326c7a | [
"MIT"
] | 1 | 2022-02-02T20:36:00.000Z | 2022-02-02T20:36:00.000Z | catkin_ws_src/src/imu/src/imu_test.py | Ethancao123/InnoBot | 02e0321cd5e353187659a2ac61c5f3cf6d326c7a | [
"MIT"
] | null | null | null | catkin_ws_src/src/imu/src/imu_test.py | Ethancao123/InnoBot | 02e0321cd5e353187659a2ac61c5f3cf6d326c7a | [
"MIT"
] | 1 | 2022-02-02T20:36:04.000Z | 2022-02-02T20:36:04.000Z | #!/usr/bin/env python
######################################################
# Copyright (c) 2020 Maker Portal LLC
# Author: Joshua Hrisko
######################################################
#
# This code reads data from the MPU9250/MPU9265 board
# (MPU6050 - accel/gyro, AK8963 - mag) to verify its
# correct wiring ... | 32.310078 | 109 | 0.550144 | #!/usr/bin/env python
######################################################
# Copyright (c) 2020 Maker Portal LLC
# Author: Joshua Hrisko
######################################################
#
# This code reads data from the MPU9250/MPU9265 board
# (MPU6050 - accel/gyro, AK8963 - mag) to verify its
# correct wiring ... | 0 | 0 | 0 | 0 | 0 | 2,969 | 0 | 5 | 96 |
f17c63db367dc65fe04b71259099955000ca8baa | 3,924 | py | Python | addons/weko/tests/test_model.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 11 | 2018-12-11T16:39:40.000Z | 2022-02-26T09:51:32.000Z | addons/weko/tests/test_model.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 52 | 2018-04-13T05:03:21.000Z | 2022-03-22T02:56:19.000Z | addons/weko/tests/test_model.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 16 | 2018-07-09T01:44:51.000Z | 2021-06-30T01:57:16.000Z | import pytest
pytestmark = pytest.mark.django_db
| 34.421053 | 93 | 0.679409 | import mock
from nose.tools import * # noqa
import pytest
import unittest
from tests.base import get_default_metaschema
from osf_tests.factories import ProjectFactory, DraftRegistrationFactory
from framework.auth import Auth
from addons.base.tests.models import (
OAuthAddonNodeSettingsTestSuiteMixin,
OAuthAd... | 0 | 372 | 0 | 2,919 | 0 | 0 | 0 | 307 | 276 |
8fc149ebcc80a4b11261442b2be9e9769b019842 | 2,689 | py | Python | src/vektonn/dtos.py | vektonn/vektonn-client-python | 61cd186cc207f4e9dd4651323186870c76b1d207 | [
"Apache-2.0"
] | 13 | 2021-11-22T06:41:37.000Z | 2021-12-07T08:23:23.000Z | src/vektonn/dtos.py | vektonn/vektonn-client-python | 61cd186cc207f4e9dd4651323186870c76b1d207 | [
"Apache-2.0"
] | 2 | 2021-12-07T11:34:25.000Z | 2022-02-25T08:28:04.000Z | src/vektonn/dtos.py | vektonn/vektonn-client-python | 61cd186cc207f4e9dd4651323186870c76b1d207 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from typing import TypeVar
TVektonnModel = TypeVar('TVektonnModel', bound='VektonnBaseModel')
| 25.367925 | 101 | 0.703979 | from __future__ import annotations
from datetime import datetime
from typing import List, Optional, Type, TypeVar, Dict, Any
from uuid import UUID
import orjson
from pydantic import BaseModel
from vektonn.utils import camel_case_pydantic_alias_generator, orjson_dumps
TVektonnModel = TypeVar('TVektonnModel', bound='... | 0 | 432 | 0 | 1,654 | 0 | 0 | 0 | 96 | 366 |
b43812681e7afddde7d671ceb79ba449cc091766 | 7,909 | py | Python | publications/cli.py | Alzpeta/publications-api | 6332c1329b22ff4f494085f042e893a8a94e33df | [
"MIT"
] | null | null | null | publications/cli.py | Alzpeta/publications-api | 6332c1329b22ff4f494085f042e893a8a94e33df | [
"MIT"
] | 13 | 2021-01-21T14:35:29.000Z | 2021-09-01T07:53:27.000Z | publications/cli.py | Alzpeta/publications-api | 6332c1329b22ff4f494085f042e893a8a94e33df | [
"MIT"
] | 4 | 2021-02-23T18:17:35.000Z | 2021-07-23T14:54:13.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CESNET.
#
# CESNET OA Publication Repository is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Publications API cli commands."""
| 35.78733 | 110 | 0.658111 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CESNET.
#
# CESNET OA Publication Repository is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Publications API cli commands."""
import json
import os
import subprocess
import tempfile
i... | 0 | 6,235 | 0 | 0 | 0 | 0 | 0 | 625 | 779 |
92a8b329ea2d9cae7919788e933be78afe11a260 | 34 | py | Python | xoto3/utils/__init__.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 16 | 2020-05-23T15:23:38.000Z | 2022-03-18T19:28:37.000Z | xoto3/utils/__init__.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 9 | 2020-08-19T23:08:36.000Z | 2021-10-06T17:16:35.000Z | xoto3/utils/__init__.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 2 | 2020-12-12T08:23:53.000Z | 2021-09-03T20:25:54.000Z | """Non-boto3 related utilities"""
| 17 | 33 | 0.705882 | """Non-boto3 related utilities"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ac88f4f2f464a022eb5c8a464f51f6318bf024d | 7,668 | py | Python | data_construction/pos_backtranslation/nlpaug_bt_filter.py | launchnlp/cliff_summ | 813a71f9ab8f379af9b47a784b34d6216e6c2b27 | [
"Apache-2.0"
] | 14 | 2021-09-22T10:43:02.000Z | 2022-03-22T04:54:50.000Z | data_construction/pos_backtranslation/nlpaug_bt_filter.py | launchnlp/cliff_summ | 813a71f9ab8f379af9b47a784b34d6216e6c2b27 | [
"Apache-2.0"
] | 10 | 2021-10-08T22:08:30.000Z | 2022-03-30T23:45:30.000Z | data_construction/pos_backtranslation/nlpaug_bt_filter.py | launchnlp/cliff_summ | 813a71f9ab8f379af9b47a784b34d6216e6c2b27 | [
"Apache-2.0"
] | 3 | 2021-09-22T15:32:40.000Z | 2021-11-17T11:29:55.000Z | import spacy
import re
nlp = spacy.load('en_core_web_sm')
QUOTE_RE = re.compile(r'".+?"')
OTHER_QUOTE_RE = re.compile(r"'.+?'")
demonym_map = {}
with open('demonyms.txt') as f:
for line in f:
country, d1, d2 = line.strip().split('\t')
d1 = d1.split(', ')
d2 = d2.split(', ')
val ... | 33.929204 | 172 | 0.557121 | import argparse
import spacy
import re
import countryinfo
from concurrent.futures import ProcessPoolExecutor
nlp = spacy.load('en_core_web_sm')
QUOTE_RE = re.compile(r'".+?"')
OTHER_QUOTE_RE = re.compile(r"'.+?'")
demonym_map = {}
with open('demonyms.txt') as f:
for line in f:
country, d1, d2 = line.st... | 0 | 0 | 0 | 0 | 0 | 7,033 | 0 | 20 | 135 |
389b11fbf6fe51e5fd6dc73d4a8e36a65c11a037 | 7,149 | py | Python | home.py | nick2jain/FlaskWebAppwithMysql | 45ce7c9620f53977a30c36c035e7ed61daa2096a | [
"MIT"
] | null | null | null | home.py | nick2jain/FlaskWebAppwithMysql | 45ce7c9620f53977a30c36c035e7ed61daa2096a | [
"MIT"
] | null | null | null | home.py | nick2jain/FlaskWebAppwithMysql | 45ce7c9620f53977a30c36c035e7ed61daa2096a | [
"MIT"
] | null | null | null | from flask import Flask
from wtforms import BooleanField
WTF_CSRF_ENABLED = False
app = Flask(__name__)
app.secret_key = 'adbmssecretkey'
if __name__ == "__main__":
app.run() | 29.541322 | 349 | 0.675899 | from flask import Flask, render_template, redirect, url_for, request, flash,json,jsonify
from flask_wtf import Form
from wtforms import StringField, BooleanField
from wtforms.validators import DataRequired
from wtforms import BooleanField, TextField, PasswordField, validators
from wtforms.validators import Requi... | 0 | 5,758 | 0 | 0 | 0 | 329 | 0 | 183 | 652 |
b1a0d44d6ba39e4528e09e9b0b4504bf703ba8bf | 273 | py | Python | tests/settings.py | melvinkcx/django-model-field-meta | 27ba8928bd90eeb3340cccafcc4c99f32a2e1c5e | [
"MIT"
] | 8 | 2019-11-07T08:23:22.000Z | 2022-02-20T12:59:03.000Z | tests/settings.py | melvinkcx/django-model-field-meta | 27ba8928bd90eeb3340cccafcc4c99f32a2e1c5e | [
"MIT"
] | 7 | 2019-11-19T01:14:03.000Z | 2021-06-09T18:41:49.000Z | tests/settings.py | melvinkcx/django-model-field-meta | 27ba8928bd90eeb3340cccafcc4c99f32a2e1c5e | [
"MIT"
] | 1 | 2020-12-07T02:59:43.000Z | 2020-12-07T02:59:43.000Z | import tempfile
TEMP_DIR = tempfile.TemporaryDirectory().name
INSTALLED_APPS = (
'model_field_meta',
'tests',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': TEMP_DIR,
}
}
SECRET_KEY = 'THIS IS A SECRET KEY'
| 15.166667 | 47 | 0.622711 | import tempfile
TEMP_DIR = tempfile.TemporaryDirectory().name
INSTALLED_APPS = (
'model_field_meta',
'tests',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': TEMP_DIR,
}
}
SECRET_KEY = 'THIS IS A SECRET KEY'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b376925557595a81efbf48b2eb5e2ebdee401215 | 373 | py | Python | JH/0127/2446.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | 3 | 2022-01-24T03:06:32.000Z | 2022-01-30T08:43:58.000Z | JH/0127/2446.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | null | null | null | JH/0127/2446.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | 2 | 2022-01-24T02:27:40.000Z | 2022-01-30T08:57:03.000Z | n = int(input())
s = 2*n -1
s2 = 3
for i in range(n): # (i)
print(' '*i + '*'*s, end='')
s -= 2
print()
for i in range(n-2, -1, -1):
print(' '*i + '*'*s2, end='')
s2 += 2
print()
##
n = int(input())
for i in range(n):
print(" " * i + "*" * ((n - i) * 2 - 1))
for i in range(n - 2, -1, -1... | 20.722222 | 44 | 0.380697 | n = int(input())
s = 2*n -1
s2 = 3
for i in range(n): # 공백 (i)
print(' '*i + '*'*s, end='')
s -= 2
print()
for i in range(n-2, -1, -1):
print(' '*i + '*'*s2, end='')
s2 += 2
print()
## 다른 풀이
n = int(input())
for i in range(n):
print(" " * i + "*" * ((n - i) * 2 - 1))
for i in range(n - 2, ... | 18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5ee3d373a5264ff530a2e6735881b96194d4737f | 3,406 | py | Python | ncrf_summary.py | makovalab-psu/NoiseCancellingRepeatFinder | b24732ae73a4cef431277664ad4193a0638758c1 | [
"MIT"
] | 16 | 2019-03-30T05:15:53.000Z | 2022-01-28T15:20:06.000Z | ncrf_summary.py | makovalab-psu/NoiseCancellingRepeatFinder | b24732ae73a4cef431277664ad4193a0638758c1 | [
"MIT"
] | 8 | 2019-04-04T19:46:08.000Z | 2020-11-18T15:11:53.000Z | ncrf_summary.py | makovalab-psu/NoiseCancellingRepeatFinder | b24732ae73a4cef431277664ad4193a0638758c1 | [
"MIT"
] | 6 | 2019-10-05T05:16:00.000Z | 2021-01-28T10:07:49.000Z | #!/usr/bin/env python
"""
Convert the output of Noise Cancelling Repeat Finder to a summary, a
tab-delimited table with one line of stats per alignment.
"""
if __name__ == "__main__": main()
| 30.684685 | 85 | 0.589548 | #!/usr/bin/env python
"""
Convert the output of Noise Cancelling Repeat Finder to a summary, a
tab-delimited table with one line of stats per alignment.
"""
from sys import argv,stdin,stdout,stderr,exit
from os import path as os_path
from ncrf_parse import alignments,parse_noise_rate
def usage(s=None)... | 0 | 0 | 0 | 0 | 0 | 3,021 | 0 | 77 | 113 |
01967dfdbd71a6c1ecbc18495631560ff8e86008 | 2,452 | py | Python | Ver1.0/CommentCheck.py | Unigmos/CommentCheck | 39c3f530fc72d5429b3dbcb6570dac53fab7a06a | [
"MIT"
] | null | null | null | Ver1.0/CommentCheck.py | Unigmos/CommentCheck | 39c3f530fc72d5429b3dbcb6570dac53fab7a06a | [
"MIT"
] | null | null | null | Ver1.0/CommentCheck.py | Unigmos/CommentCheck | 39c3f530fc72d5429b3dbcb6570dac53fab7a06a | [
"MIT"
] | null | null | null | import os
import glob
import matplotlib.pyplot as matplot
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4, portrait
file_count = 0
total_count = 0
comment_count = 0
use_files = []
png_name = "circle.png"
pdf_name = "circle.pdf"
#
for files in glob.glob("*/**/*"):
name, ... | 31.844156 | 96 | 0.636623 | import os
import glob
import matplotlib.pyplot as matplot
import japanize_matplotlib
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4, portrait
file_count = 0
total_count = 0
comment_count = 0
use_files = []
png_name = "circle.png"
pdf_name = "circle.pdf"
#下の階層用
for files in... | 144 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
a61716653a98f1b1b148d32323ba061daceaf395 | 4,348 | py | Python | tests/contrib/hooks/test_gcp_transfer_hook.py | RSEnergyGroup/incubator-airflow | e947c6c034238ede29a6c8f51307458d3e40c1b5 | [
"Apache-2.0"
] | 1 | 2020-08-29T15:44:13.000Z | 2020-08-29T15:44:13.000Z | tests/contrib/hooks/test_gcp_transfer_hook.py | RSEnergyGroup/incubator-airflow | e947c6c034238ede29a6c8f51307458d3e40c1b5 | [
"Apache-2.0"
] | 1 | 2018-11-01T16:17:07.000Z | 2018-11-01T16:17:07.000Z | tests/contrib/hooks/test_gcp_transfer_hook.py | RSEnergyGroup/incubator-airflow | e947c6c034238ede29a6c8f51307458d3e40c1b5 | [
"Apache-2.0"
] | 6 | 2020-06-09T02:16:58.000Z | 2021-12-27T15:46:32.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 38.821429 | 103 | 0.634315 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 0 | 2,283 | 0 | 854 | 0 | 0 | 0 | 112 | 156 |
c8e3b5ccd5b484d5a043d8fa47f35682b6064095 | 5,940 | py | Python | acoustic_simulation/acoustic_simulation.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | acoustic_simulation/acoustic_simulation.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | acoustic_simulation/acoustic_simulation.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | # AP Ruymgaart
# Finite difference 2D wave equation
import sys, numpy as np, matplotlib.pyplot as plt
fft2, fftshift, ifft2 = np.fft.fft2, np.fft.fftshift, np.fft.ifft2
if __name__ == '__main__':
IC, source, name = 'none', 'none', 'none'
simsel, nrSteps, c, dt, W, mod = 1, 1000, 343.0, 0.000001, 0.2, 100
plot,... | 32.108108 | 115 | 0.513805 | # AP Ruymgaart
# Finite difference 2D wave equation
import copy, sys, numpy as np, matplotlib.pyplot as plt
from draw_boundaries import *
from tensorFiles import *
from pde_findiff_functions import *
fft2, fftshift, ifft2 = np.fft.fft2, np.fft.fftshift, np.fft.ifft2
def waveEquationUnext(U,Ulast,S,B,a1,a2):
Un = np... | 0 | 0 | 0 | 0 | 0 | 655 | 0 | 32 | 183 |
7982a58206e7956d930f4a91c9c940f828400e72 | 1,277 | py | Python | multiprocessing/10_processing_image_multiprocessing.py | BenedictusAryo/python_threading | 8133315ed59b2ad927dfe748f63a1f41dda3d0bc | [
"MIT"
] | 1 | 2021-02-01T10:14:22.000Z | 2021-02-01T10:14:22.000Z | multiprocessing/10_processing_image_multiprocessing.py | BenedictusAryo/python_threading | 8133315ed59b2ad927dfe748f63a1f41dda3d0bc | [
"MIT"
] | null | null | null | multiprocessing/10_processing_image_multiprocessing.py | BenedictusAryo/python_threading | 8133315ed59b2ad927dfe748f63a1f41dda3d0bc | [
"MIT"
] | null | null | null | # 10 Processing Images Multiprocessing
import time
import concurrent.futures
img_names = [
'photo-1516117172878-fd2c41f4a759.jpg',
'photo-1532009324734-20a7a5813719.jpg',
'photo-1524429656589-6633a470097c.jpg',
'photo-1530224264768-7ff8c1789d79.jpg',
'photo-1564135624576-c5c88640f235.jpg',
'ph... | 28.377778 | 62 | 0.728269 | # 10 Processing Images Multiprocessing
import time
import concurrent.futures
from PIL import Image, ImageFilter
img_names = [
'photo-1516117172878-fd2c41f4a759.jpg',
'photo-1532009324734-20a7a5813719.jpg',
'photo-1524429656589-6633a470097c.jpg',
'photo-1530224264768-7ff8c1789d79.jpg',
'photo-15641... | 0 | 0 | 0 | 0 | 0 | 193 | 0 | 13 | 45 |
8f391b8e1a9f168d7177a009698f2a706ee77926 | 7,541 | py | Python | docs/source/conf.py | a-n-rose/Python-Sound-Tool | 4cb9ab7b55da9808da8dec3bc33759a7615ad4ed | [
"RSA-MD"
] | 52 | 2019-10-13T07:43:51.000Z | 2022-01-13T19:58:01.000Z | docs/source/0.1.0a3/conf.py | a-n-rose/Python-Sound-Tool | 4cb9ab7b55da9808da8dec3bc33759a7615ad4ed | [
"RSA-MD"
] | 7 | 2019-10-13T08:40:58.000Z | 2021-04-09T13:18:13.000Z | docs/source/0.1.0a3/conf.py | a-n-rose/Python-Sound-Tool | 4cb9ab7b55da9808da8dec3bc33759a7615ad4ed | [
"RSA-MD"
] | 4 | 2019-10-13T07:43:44.000Z | 2021-04-13T12:16:17.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 30.530364 | 85 | 0.64567 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f48d1a489bf958d947b110ff7b2c865e11e0a63d | 4,054 | py | Python | tile.py | neeraj-kumar/nkpylib | 8a30be64b77eae33f828b409cfb7214717448678 | [
"BSD-3-Clause"
] | null | null | null | tile.py | neeraj-kumar/nkpylib | 8a30be64b77eae33f828b409cfb7214717448678 | [
"BSD-3-Clause"
] | null | null | null | tile.py | neeraj-kumar/nkpylib | 8a30be64b77eae33f828b409cfb7214717448678 | [
"BSD-3-Clause"
] | null | null | null | """Simple code to tile images.
Licensed under the 3-clause BSD License:
Copyright (c) 2011-2014, Neeraj Kumar (neerajkumar.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of ... | 41.793814 | 136 | 0.662309 | """Simple code to tile images.
Licensed under the 3-clause BSD License:
Copyright (c) 2011-2014, Neeraj Kumar (neerajkumar.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 |
547b6191e1667c08aa4365b0a40ff7b05995ffca | 2,231 | py | Python | websites/migrations/0011_auto_20200623_1401.py | tsukasa-renato/personal-project-django-system | e36c8218640175346f712beb5a1cba602d877fa9 | [
"MIT"
] | null | null | null | websites/migrations/0011_auto_20200623_1401.py | tsukasa-renato/personal-project-django-system | e36c8218640175346f712beb5a1cba602d877fa9 | [
"MIT"
] | 5 | 2021-04-08T19:21:07.000Z | 2021-09-22T19:14:37.000Z | websites/migrations/0011_auto_20200623_1401.py | tsukasarenato/simple-web-application | ae845973e2d74606777ef90353a2db7875e4e077 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-06-23 17:02
| 37.183333 | 155 | 0.562528 | # Generated by Django 3.0.7 on 2020-06-23 17:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('websites', '0010_auto_20200622_1352'),
]
operations = [
migrations.CreateModel(
name='SocialMed... | 0 | 0 | 0 | 2,084 | 0 | 0 | 0 | 30 | 68 |
d3f1f311cccf15504c43cdaec95ac5abbc6dd239 | 8,587 | py | Python | torch_client.py | zenghui9977/AFL | 769d78be94ce8f80d376aceb2de9dc5a9d20a807 | [
"MIT"
] | null | null | null | torch_client.py | zenghui9977/AFL | 769d78be94ce8f80d376aceb2de9dc5a9d20a807 | [
"MIT"
] | null | null | null | torch_client.py | zenghui9977/AFL | 769d78be94ce8f80d376aceb2de9dc5a9d20a807 | [
"MIT"
] | null | null | null | import socket
import time
import struct
from control_algorithm.adaptive_tau import ControlAlgAdaptiveTauClient, ControlAlgAdaptiveTauServer
from data_reader.data_reader import get_data, get_data_train_samples
from models.get_model import get_model
from util.sampling import MinibatchSampling
from util.utils import send... | 43.588832 | 147 | 0.59986 | import socket
import time
import struct
from control_algorithm.adaptive_tau import ControlAlgAdaptiveTauClient, ControlAlgAdaptiveTauServer
from data_reader.data_reader import get_data, get_data_train_samples
from models.get_model import get_model
from util.sampling import MinibatchSampling
from util.utils import send... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
101574ba513f5571a80080b2e02be9da5bbee8ac | 1,628 | py | Python | run/pascal/vis.py | Lixy1997/Group-WSSS | 0afcc3a21c3bec69fbc5b6d1d4ee84ffd405d253 | [
"MIT"
] | 80 | 2020-12-08T11:53:12.000Z | 2022-03-30T18:40:07.000Z | run/pascal/vis.py | tfzhou/Group-WSSS | 4aa5cd87065e7f582d37b8fb4e8e1459bfbe95ad | [
"MIT"
] | 13 | 2021-01-04T14:55:00.000Z | 2022-03-31T08:07:33.000Z | run/pascal/vis.py | tfzhou/Group-WSSS | 4aa5cd87065e7f582d37b8fb4e8e1459bfbe95ad | [
"MIT"
] | 15 | 2020-12-08T15:32:22.000Z | 2021-12-28T18:38:31.000Z | import numpy as np
import cv2
import os
from os.path import exists
if __name__ == '__main__':
train_lst = 'data/VOCdevkit/VOC2012/ImageSets/Segmentation/train_cls.txt'
root_folder = 'data/VOCdevkit/VOC2012'
im_lst, label_lst = load_dataset(train_lst)
atten_path = 'feat_1'
save_path = '... | 29.071429 | 77 | 0.598894 | import numpy as np
import cv2
import logging
import os
from os.path import exists
import imageio
import torch
import matplotlib.pyplot as plt
def load_dataset(test_lst):
logging.info('Beginning loading dataset...')
im_lst = []
label_lst = []
with open(test_lst) as f:
test_names = f.readl... | 0 | 0 | 0 | 0 | 0 | 488 | 0 | -13 | 115 |
bbf366ac87d81d9e97c498927cc73c12f41d625d | 542 | py | Python | abc/abc186/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/abc186/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/abc186/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
N = ni()
ans = 0
for i in range(1, N + 1):
a = base_10_to_n(i, 8)
if '7' in str(a) or '7' in str(i):
conti... | 18.689655 | 53 | 0.584871 | import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
def base_10_to_n(x, n):
res = []
while x:
res.appen... | 0 | 0 | 0 | 0 | 0 | 117 | 0 | 11 | 67 |
43d5836664af6cb8ecfa1a1e1fb37119901cb3cb | 9,334 | py | Python | src/ui/main_interface.py | WanglinLi595/Fatigue_Detection | ac889a01e3f82711714d16be732aa3aa6a34cdba | [
"BSD-3-Clause"
] | 1 | 2021-07-03T13:58:20.000Z | 2021-07-03T13:58:20.000Z | src/ui/main_interface.py | WanglinLi595/Fatigue_Detection | ac889a01e3f82711714d16be732aa3aa6a34cdba | [
"BSD-3-Clause"
] | null | null | null | src/ui/main_interface.py | WanglinLi595/Fatigue_Detection | ac889a01e3f82711714d16be732aa3aa6a34cdba | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
'''
@:
@: V1_0
@: LiWanglin
@: Do not edit
@: LiWanglin
@: Do not Edit
'''
| 35.762452 | 149 | 0.549389 | #!/usr/bin/env python
# coding=utf-8
'''
@描述:
@版本: V1_0
@作者: LiWanglin
@创建时间: Do not edit
@最后编辑人: LiWanglin
@最后编辑时间: Do not Edit
'''
from PyQt5.QtWidgets import QMainWindow, QMessageBox
from PyQt5.QtCore import QTimer, pyqtSlot, QEvent
from PyQt5.QtGui import QPixmap, QImage, QPainter
from PyQt5.QtChart import QCha... | 2,085 | 1,597 | 0 | 6,468 | 0 | 0 | 0 | 183 | 244 |
0d825814cbb907af4fdd457d2721aab1ca140414 | 54,129 | py | Python | landlab/grid/voronoi.py | laijingtao/landlab | 871151bff814e672b4f09f091b6347367758c764 | [
"MIT"
] | 1 | 2015-08-17T19:29:50.000Z | 2015-08-17T19:29:50.000Z | landlab/grid/voronoi.py | laijingtao/landlab | 871151bff814e672b4f09f091b6347367758c764 | [
"MIT"
] | null | null | null | landlab/grid/voronoi.py | laijingtao/landlab | 871151bff814e672b4f09f091b6347367758c764 | [
"MIT"
] | 2 | 2017-07-03T20:21:13.000Z | 2018-09-06T23:58:19.000Z | #! /usr/env/python
"""
Python implementation of VoronoiDelaunayGrid, a class used to create and manage
unstructured, irregular grids for 2D numerical models.
Getting Information about a Grid
--------------------------------
The following attributes, properties, and methods provide data about the grid,
its geometry, an... | 41.669746 | 89 | 0.662307 | #! /usr/env/python
"""
Python implementation of VoronoiDelaunayGrid, a class used to create and manage
unstructured, irregular grids for 2D numerical models.
Getting Information about a Grid
--------------------------------
The following attributes, properties, and methods provide data about the grid,
its geometry, an... | 0 | 12,991 | 0 | 18,611 | 0 | 0 | 0 | 309 | 135 |
0b933257a2982cf11b0757d8040ecfdac5e8decc | 3,627 | py | Python | scripts/parse_card235.py | SymbioticLab/Salus | b2a194e7e4654b51dbd8d8fc1577fb1e9915ca6f | [
"Apache-2.0"
] | 104 | 2019-02-12T20:41:07.000Z | 2022-03-07T16:58:47.000Z | scripts/parse_card235.py | SymbioticLab/Salus | b2a194e7e4654b51dbd8d8fc1577fb1e9915ca6f | [
"Apache-2.0"
] | 9 | 2019-08-24T03:23:21.000Z | 2021-06-06T17:59:07.000Z | scripts/parse_card235.py | SymbioticLab/Salus | b2a194e7e4654b51dbd8d8fc1577fb1e9915ca6f | [
"Apache-2.0"
] | 18 | 2019-03-04T07:45:41.000Z | 2021-09-15T22:13:07.000Z | #!/usr/bin/env python3
#
# Copyright 2019 Peifeng Yu <peifeng@umich.edu>
#
# This file is part of Salus
# (see https://github.com/SymbioticLab/Salus).
#
# 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 L... | 28.785714 | 86 | 0.624759 | #!/usr/bin/env python3
#
# Copyright 2019 Peifeng Yu <peifeng@umich.edu>
#
# This file is part of Salus
# (see https://github.com/SymbioticLab/Salus).
#
# 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 L... | 0 | 0 | 0 | 0 | 0 | 2,045 | 0 | 37 | 292 |
e50f20dab49a70b3abb2d5e6d9503f7f847ec218 | 231 | py | Python | source/b64_moudle.py | ttttmr/better-ctf-tools | 3ae08e6364e36c27df8012d4764aecd2cdb0b760 | [
"MIT"
] | 28 | 2017-10-02T09:21:27.000Z | 2022-02-03T11:40:48.000Z | source/b64_moudle.py | haikouxuege/better-ctf-tools | 3ae08e6364e36c27df8012d4764aecd2cdb0b760 | [
"MIT"
] | null | null | null | source/b64_moudle.py | haikouxuege/better-ctf-tools | 3ae08e6364e36c27df8012d4764aecd2cdb0b760 | [
"MIT"
] | 9 | 2017-10-18T13:33:23.000Z | 2021-08-07T12:08:34.000Z | # _*_ coding:UTF-8 _*_
# b64 decode and encode
| 15.4 | 41 | 0.675325 | # _*_ coding:UTF-8 _*_
# b64 decode and encode
import base64
def b64encode(string):
a = base64.b64encode(string.encode())
return a.decode()
def b64decode(string):
a = base64.b64decode(string).decode()
return a
| 0 | 0 | 0 | 0 | 0 | 121 | 0 | -8 | 69 |
576c47b5a9d9e81115dc048d1036ed819f8925bc | 63 | py | Python | trade_remedies_caseworker/govuk_template/__init__.py | uktrade/trade-remedies-caseworker | fece9fde3cb241d96cbc1aaf7188d976f8621600 | [
"MIT"
] | 1 | 2020-08-27T09:53:00.000Z | 2020-08-27T09:53:00.000Z | trade_remedies_caseworker/govuk_template/__init__.py | uktrade/trade-remedies-caseworker | fece9fde3cb241d96cbc1aaf7188d976f8621600 | [
"MIT"
] | 7 | 2020-10-14T16:23:42.000Z | 2021-09-24T14:18:47.000Z | trade_remedies_caseworker/govuk_template/__init__.py | uktrade/trade-remedies-caseworker | fece9fde3cb241d96cbc1aaf7188d976f8621600 | [
"MIT"
] | null | null | null | default_app_config = "govuk_template.apps.GovukTemplateConfig"
| 31.5 | 62 | 0.873016 | default_app_config = "govuk_template.apps.GovukTemplateConfig"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
79ba5d018070aca247e03abdf76a84d384774aeb | 256 | py | Python | ssdp/__init__.py | vintozver/ssdp | ab3199068e3af93d95b00dcd79fbb444aa4ba13b | [
"MIT"
] | null | null | null | ssdp/__init__.py | vintozver/ssdp | ab3199068e3af93d95b00dcd79fbb444aa4ba13b | [
"MIT"
] | null | null | null | ssdp/__init__.py | vintozver/ssdp | ab3199068e3af93d95b00dcd79fbb444aa4ba13b | [
"MIT"
] | null | null | null | """Python library for Simple Service Discovery Protocol (SSDP)."""
import ssdp.asyncio as asyncio
import ssdp.entity as entity
import ssdp.network as network
__all__ = entity.__all__ + asyncio.__all__
| 25.6 | 66 | 0.785156 | """Python library for Simple Service Discovery Protocol (SSDP)."""
import ssdp.asyncio as asyncio
import ssdp.entity as entity
import ssdp.network as network
from ssdp.asyncio import *
from ssdp.entity import *
__all__ = entity.__all__ + asyncio.__all__
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 44 |
b0776cb3cb4b82d9cbcfc89f98fcd091867432ec | 1,319 | py | Python | codingame.com/3_puzzle.py | dccstcc/NAI_PJATK_2020 | 293bc963b44aa42a50ec52c327983867c6c5a9ed | [
"MIT"
] | null | null | null | codingame.com/3_puzzle.py | dccstcc/NAI_PJATK_2020 | 293bc963b44aa42a50ec52c327983867c6c5a9ed | [
"MIT"
] | null | null | null | codingame.com/3_puzzle.py | dccstcc/NAI_PJATK_2020 | 293bc963b44aa42a50ec52c327983867c6c5a9ed | [
"MIT"
] | null | null | null | """
author: Dominik Stec,
index: s12623,
email: s12623@pja.edu.pl
source link:
https://www.codingame.com/ide/puzzle/defibrillators
"""
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
lon = input()
lat = input()
n = int(input(... | 21.622951 | 68 | 0.605762 | """
author: Dominik Stec,
index: s12623,
email: s12623@pja.edu.pl
source link:
https://www.codingame.com/ide/puzzle/defibrillators
"""
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
lon = input()
lat = input()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 25 |
086df94acc8b51aadc9bb2bdf3d5ff71b328c5b1 | 12,262 | py | Python | test/gui2.py | ColsonZhang/Serial_GUI | 31e681e89c9624e535638384580560ac7b3475eb | [
"MIT"
] | 2 | 2020-12-27T15:40:45.000Z | 2021-01-27T14:11:09.000Z | test/gui2.py | ColsonZhang/Serial_GUI | 31e681e89c9624e535638384580560ac7b3475eb | [
"MIT"
] | null | null | null | test/gui2.py | ColsonZhang/Serial_GUI | 31e681e89c9624e535638384580560ac7b3475eb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\pyqt_file\untitled_2.ui'
#
# Created: Sat Apr 15 09:51:16 2017
# by: PyQt5 UI code generator 5.4
#
# WARNING! All changes made in this file will be lost!
import sys
import serial
from PyQt5 import QtWidgets
if __name__ == '__main__... | 46.097744 | 81 | 0.657478 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\pyqt_file\untitled_2.ui'
#
# Created: Sat Apr 15 09:51:16 2017
# by: PyQt5 UI code generator 5.4
#
# WARNING! All changes made in this file will be lost!
import sys
import serial
import threading
import binascii
from PyQt5 import Qt... | 243 | 0 | 0 | 11,569 | 0 | 0 | 0 | 13 | 90 |
44c44cff0fbc63aaee0c59bbc320ee15fa4c4c8a | 871 | py | Python | mllaunchpad/logutil.py | bobplatte/mllaunchpad | 4be60428b8091c3fb37e5cac01fdddef1b50180b | [
"Apache-2.0"
] | null | null | null | mllaunchpad/logutil.py | bobplatte/mllaunchpad | 4be60428b8091c3fb37e5cac01fdddef1b50180b | [
"Apache-2.0"
] | null | null | null | mllaunchpad/logutil.py | bobplatte/mllaunchpad | 4be60428b8091c3fb37e5cac01fdddef1b50180b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Stdlib imports
import logging
import os
# Third-party imports
LOG_CONF_FILENAME_DEFAULT = ""
LOG_CONF_FILENAME_ENV = os.environ.get(
"LAUNCHPAD_LOG", LOG_CONF_FILENAME_DEFAULT
)
| 22.921053 | 74 | 0.665901 | # -*- coding: utf-8 -*-
# Stdlib imports
import logging
import logging.config
import os
# Third-party imports
import yaml
LOG_CONF_FILENAME_DEFAULT = ""
LOG_CONF_FILENAME_ENV = os.environ.get(
"LAUNCHPAD_LOG", LOG_CONF_FILENAME_DEFAULT
)
def init_logging(filename=LOG_CONF_FILENAME_ENV):
if filename == "":... | 0 | 0 | 0 | 0 | 0 | 601 | 0 | -10 | 67 |
bf5b01a76cf5d79c1acb2d164355c77598026b43 | 1,030 | py | Python | setup.py | theeko74/daemon | be209fdbabd976e64c80d175eead5203b8c9923f | [
"MIT"
] | null | null | null | setup.py | theeko74/daemon | be209fdbabd976e64c80d175eead5203b8c9923f | [
"MIT"
] | null | null | null | setup.py | theeko74/daemon | be209fdbabd976e64c80d175eead5203b8c9923f | [
"MIT"
] | null | null | null | """
A setuptools based setup module.
"""
from setuptools import setup, find_packages
import daemon
setup(
name='daemon',
version=daemon.__version__,
description="Daemon class to transform any python script into a daemon",
long_description=open('README.md').read(),
license='MIT',
author='Sylvai... | 29.428571 | 76 | 0.636893 | """
A setuptools based setup module.
"""
from setuptools import setup, find_packages
import daemon
setup(
name='daemon',
version=daemon.__version__,
description="Daemon class to transform any python script into a daemon",
long_description=open('README.md').read(),
license='MIT',
author='Sylvai... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3078d25f91449ca19ecab95edc2c9b10dae48401 | 5,055 | py | Python | paasta_tools/paastaapi/models/marathon_dashboard_item.py | rohangulati/paasta | 4539e39159424bfbdeddcb243ca337bcd1eb1a06 | [
"Apache-2.0"
] | null | null | null | paasta_tools/paastaapi/models/marathon_dashboard_item.py | rohangulati/paasta | 4539e39159424bfbdeddcb243ca337bcd1eb1a06 | [
"Apache-2.0"
] | null | null | null | paasta_tools/paastaapi/models/marathon_dashboard_item.py | rohangulati/paasta | 4539e39159424bfbdeddcb243ca337bcd1eb1a06 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Paasta API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
| 28.240223 | 124 | 0.589911 | # coding: utf-8
"""
Paasta API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from... | 0 | 1,646 | 0 | 3,006 | 0 | 0 | 0 | 10 | 128 |
1e8cc03a56a2bbe29f368a839094293824daaa7d | 5,282 | py | Python | main.py | kuanyi-ng/two_bit_predictor_simulation | 9eb0d14b5b7799dabd10856aa369ff1f8ddd3c56 | [
"MIT"
] | null | null | null | main.py | kuanyi-ng/two_bit_predictor_simulation | 9eb0d14b5b7799dabd10856aa369ff1f8ddd3c56 | [
"MIT"
] | null | null | null | main.py | kuanyi-ng/two_bit_predictor_simulation | 9eb0d14b5b7799dabd10856aa369ff1f8ddd3c56 | [
"MIT"
] | null | null | null | """
Purpose:
Simulate 2-bit Predictor and measure it's hit rate.
"""
if __name__ == "__main__":
predictor_with_branch_result = TwoBitPredictorByBranchResult()
predictor_with_prediction_result = TwoBitPredictorByPredictionResult()
branch_history = get_branch_history(history_size=5)
# NOTE: Change her... | 37.197183 | 113 | 0.689322 | """
Purpose:
Simulate 2-bit Predictor and measure it's hit rate.
"""
from enum import Enum
from random import randint
from typing import List
class BranchResult(Enum):
JUMP = True
NO_JUMP = False
class PredictionResult(Enum):
CORRECT = True
INCORRECT = False
class TwoBitPredictorState(Enum):
STR... | 0 | 0 | 0 | 3,239 | 0 | 928 | 0 | 7 | 251 |
272381edf858a6e89ac90d5764258418f087605a | 4,260 | py | Python | src/coco_emnlp/lm/lm_train.py | kepei1106/ARAML | de87ead8d592098b0df8ff68d75c9e8ab9a2061e | [
"Apache-2.0"
] | 37 | 2019-08-21T12:56:24.000Z | 2020-12-10T09:24:02.000Z | src/coco_emnlp/lm/lm_train.py | kepei1106/ARAML | de87ead8d592098b0df8ff68d75c9e8ab9a2061e | [
"Apache-2.0"
] | 2 | 2019-09-15T09:09:42.000Z | 2020-04-26T09:49:36.000Z | src/coco_emnlp/lm/lm_train.py | kepei1106/ARAML | de87ead8d592098b0df8ff68d75c9e8ab9a2061e | [
"Apache-2.0"
] | 2 | 2019-12-17T09:02:52.000Z | 2020-09-29T07:31:23.000Z | import sys
import time
import random
sys.path.append("..")
random.seed(time.time())
# Evaluation on development set
# Infer the sampling probability based on language model
# Create language model
# Pre-train the forward/backward language model
# Output the probability based on the language model
| 43.030303 | 142 | 0.662441 | import numpy as np
import tensorflow as tf
import sys
import time
import random
import os
sys.path.append("..")
from lm_model import lm_model
random.seed(time.time())
# Evaluation on development set
def evaluate(model, sess, data_dev, batch_size, config):
loss, acc = np.zeros((1, )), np.zeros((1, ))
st, ed,... | 0 | 0 | 0 | 0 | 0 | 3,759 | 0 | -5 | 199 |
b8612ccc05b14d0abef2998af894ebb1dc75a158 | 2,210 | py | Python | swagger_server/models/settle_bill.py | BlockChainProj/Server | d0ecc25146c9cc987861b9b3fd0473e975865bb7 | [
"MIT"
] | null | null | null | swagger_server/models/settle_bill.py | BlockChainProj/Server | d0ecc25146c9cc987861b9b3fd0473e975865bb7 | [
"MIT"
] | null | null | null | swagger_server/models/settle_bill.py | BlockChainProj/Server | d0ecc25146c9cc987861b9b3fd0473e975865bb7 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
| 24.285714 | 80 | 0.59819 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class SettleBill(Model):
"""NOTE: This class is auto generated by the swagger ... | 0 | 1,071 | 0 | 879 | 0 | 0 | 0 | 62 | 141 |
289b38fd2d3757ebcc0227822a92e53bddc9520b | 117 | py | Python | projectB/projectBapp/admin.py | cs-fullstack-2019-fall/django-models3-cw-b-chrisawill | acffb9e1ce08c0dc1384c00458dcaa9ff674c305 | [
"Apache-2.0"
] | null | null | null | projectB/projectBapp/admin.py | cs-fullstack-2019-fall/django-models3-cw-b-chrisawill | acffb9e1ce08c0dc1384c00458dcaa9ff674c305 | [
"Apache-2.0"
] | null | null | null | projectB/projectBapp/admin.py | cs-fullstack-2019-fall/django-models3-cw-b-chrisawill | acffb9e1ce08c0dc1384c00458dcaa9ff674c305 | [
"Apache-2.0"
] | null | null | null |
# Register your models here.
from django.contrib import admin
from .models import Books
admin.site.register(Books) | 16.714286 | 32 | 0.794872 |
# Register your models here.
from django.contrib import admin
from .models import Books
admin.site.register(Books) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
71745ed44c74c8acb5b0a377b1d1d6b6a48891f2 | 387 | py | Python | outpost24hiabclient/__init__.py | schubergphilis/outpost24hiabclient | 9c2ce2070e6df1a651e8b1fc5d4cce7a8129cba0 | [
"MIT"
] | null | null | null | outpost24hiabclient/__init__.py | schubergphilis/outpost24hiabclient | 9c2ce2070e6df1a651e8b1fc5d4cce7a8129cba0 | [
"MIT"
] | null | null | null | outpost24hiabclient/__init__.py | schubergphilis/outpost24hiabclient | 9c2ce2070e6df1a651e8b1fc5d4cce7a8129cba0 | [
"MIT"
] | null | null | null | from .exceptions.exceptions import AuthFailed
from .services.user_service import UserService
from .services.target_service import (TargetService, TargetsTreeBuilder)
from .services.scanner_service import ScannerService
from .clients.hiabclient import HiabClient
assert AuthFailed
assert ScannerService
assert UserServi... | 32.25 | 72 | 0.878553 | from .exceptions.exceptions import AuthFailed
from .services.user_service import UserService
from .services.target_service import (TargetService, TargetsTreeBuilder)
from .services.scanner_service import ScannerService
from .clients.hiabclient import HiabClient
assert AuthFailed
assert ScannerService
assert UserServi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |