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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8cd06fff1021d679aadedbb9cdf8b12aa472c8c5 | 1,145 | py | Python | benchmarks/benchmarks/ci/esmf_regridder.py | lbdreyer/iris-esmf-regrid | 2456f9b08c9a49cb6cd33555bc5938bdf0edb5be | [
"BSD-3-Clause"
] | null | null | null | benchmarks/benchmarks/ci/esmf_regridder.py | lbdreyer/iris-esmf-regrid | 2456f9b08c9a49cb6cd33555bc5938bdf0edb5be | [
"BSD-3-Clause"
] | null | null | null | benchmarks/benchmarks/ci/esmf_regridder.py | lbdreyer/iris-esmf-regrid | 2456f9b08c9a49cb6cd33555bc5938bdf0edb5be | [
"BSD-3-Clause"
] | null | null | null | """Quick running benchmarks for :mod:`esmf_regrid.esmf_regridder`."""
import numpy as np
def _make_small_grid_args():
"""
Not importing the one in test_GridInfo - if that changes, these benchmarks
would 'invisibly' change too.
"""
small_x = 2
small_y = 3
small_grid_lon = np.array(range(s... | 28.625 | 90 | 0.667249 | """Quick running benchmarks for :mod:`esmf_regrid.esmf_regridder`."""
import numpy as np
from esmf_regrid.esmf_regridder import GridInfo
def _make_small_grid_args():
"""
Not importing the one in test_GridInfo - if that changes, these benchmarks
would 'invisibly' change too.
"""
small_x = 2
... | 0 | 0 | 0 | 381 | 0 | 0 | 0 | 26 | 46 |
9eeabd34fbfb4cf41cabddb89675c09df496a23e | 267 | py | Python | test2.py | rfyiamcool/redis_netlock | ac2f6c4639c3ceb89bd63ff0b1030aa3a4b569be | [
"MIT"
] | 29 | 2015-10-18T12:22:37.000Z | 2020-03-02T13:55:27.000Z | test2.py | zbing3/redis_netlock | d8932aa5beaa05a1b68d1d0ee866e44c4de5362b | [
"MIT"
] | 1 | 2019-01-03T03:16:11.000Z | 2019-01-03T03:16:11.000Z | test2.py | zbing3/redis_netlock | d8932aa5beaa05a1b68d1d0ee866e44c4de5362b | [
"MIT"
] | 15 | 2015-05-13T14:20:33.000Z | 2021-11-19T10:02:04.000Z | from __future__ import with_statement
import redis
import time
from redis_netlock import dist_lock
client = redis.Redis(connection_pool=redis.BlockingConnectionPool(max_connections=15, host='localhost', port=6379))
with dist_lock('test', client):
print 'hello'
| 26.7 | 115 | 0.808989 | from __future__ import with_statement
import redis
import time
from redis_netlock import dist_lock
client = redis.Redis(connection_pool=redis.BlockingConnectionPool(max_connections=15, host='localhost', port=6379))
with dist_lock('test', client):
print 'hello'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
89423f6e7b5c2fdae0a1787d56ef99ae8477cfc3 | 161 | py | Python | arch_texture_utils/py2_utils.py | Fmstrat/FreeCAD-ArchTextures | e3af6198ea5e07848602a3b8ba01ebab2335d6b1 | [
"MIT"
] | 21 | 2018-11-16T05:56:31.000Z | 2021-11-09T13:21:53.000Z | arch_texture_utils/py2_utils.py | Fmstrat/FreeCAD-ArchTextures | e3af6198ea5e07848602a3b8ba01ebab2335d6b1 | [
"MIT"
] | 39 | 2018-10-02T18:16:18.000Z | 2022-02-11T13:45:50.000Z | arch_texture_utils/py2_utils.py | Fmstrat/FreeCAD-ArchTextures | e3af6198ea5e07848602a3b8ba01ebab2335d6b1 | [
"MIT"
] | 10 | 2019-07-15T16:34:51.000Z | 2022-01-25T23:57:03.000Z | import sys
IS_PY_2 = sys.version_info.major < 3 | 17.888889 | 45 | 0.658385 | import sys
IS_PY_2 = sys.version_info.major < 3
def textureFileString(path):
if IS_PY_2:
return path.encode('utf-8', 'strict')
return path | 0 | 0 | 0 | 0 | 0 | 90 | 0 | 0 | 23 |
d5b2732e7b57e793e967c300de1f28a27b6267a8 | 8,132 | py | Python | master/doctest.py | Keno/julia-buildbot | 9bbd4068797ae88d59d5dd2a7c41bdaed64110a9 | [
"MIT"
] | 1 | 2021-06-20T02:46:51.000Z | 2021-06-20T02:46:51.000Z | master/doctest.py | Keno/julia-buildbot | 9bbd4068797ae88d59d5dd2a7c41bdaed64110a9 | [
"MIT"
] | null | null | null | master/doctest.py | Keno/julia-buildbot | 9bbd4068797ae88d59d5dd2a7c41bdaed64110a9 | [
"MIT"
] | null | null | null | julia_doctest_factory = util.BuildFactory()
julia_doctest_factory.useProgress = True
julia_doctest_factory.addSteps([
# Fetch first (allowing failure if no existing clone is present)
steps.ShellCommand(
name="git fetch",
command=["git", "fetch", "--tags", "--all", "--force"],
flunkOnFail... | 40.457711 | 173 | 0.648549 | julia_doctest_factory = util.BuildFactory()
julia_doctest_factory.useProgress = True
julia_doctest_factory.addSteps([
# Fetch first (allowing failure if no existing clone is present)
steps.ShellCommand(
name="git fetch",
command=["git", "fetch", "--tags", "--all", "--force"],
flunkOnFail... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d21fe161adb1584f062b9ff33b8e32468a40c8f9 | 5,077 | py | Python | abqPython_SvM_1_PostProc.py | jtipton2/abaqusSignedvM | 83f0577b6a3eab6d3c86a46ae110a94a7075981c | [
"BSD-3-Clause"
] | 2 | 2022-03-16T13:50:21.000Z | 2022-03-27T15:14:09.000Z | abqPython_SvM_1_PostProc.py | jtipton2/abaqusSignedvM | 83f0577b6a3eab6d3c86a46ae110a94a7075981c | [
"BSD-3-Clause"
] | null | null | null | abqPython_SvM_1_PostProc.py | jtipton2/abaqusSignedvM | 83f0577b6a3eab6d3c86a46ae110a94a7075981c | [
"BSD-3-Clause"
] | 2 | 2021-07-18T03:10:12.000Z | 2022-03-27T15:14:11.000Z | #==============================================================================
# IMPORT NECESSARY MODULES
#==============================================================================
# C:\temp>abaqus viewer -noGUI (this requires a CAE license)
# C:\temp>abaqus python (this does not require a license)
impo... | 38.462121 | 175 | 0.6169 | #==============================================================================
# IMPORT NECESSARY MODULES
#==============================================================================
# C:\temp>abaqus viewer -noGUI (this requires a CAE license)
# C:\temp>abaqus python (this does not require a license)
impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 22 |
6b43484f4107c9b2c312d45538930246a4869bde | 247 | py | Python | server/api/utilities/messages/audit.py | koiic/favorite-things | f34944dfbc78e454c6245b76f036f6dd24d018eb | [
"MIT"
] | null | null | null | server/api/utilities/messages/audit.py | koiic/favorite-things | f34944dfbc78e454c6245b76f036f6dd24d018eb | [
"MIT"
] | 5 | 2020-07-17T10:43:13.000Z | 2022-02-26T12:16:12.000Z | server/api/utilities/messages/audit.py | koiic/favorite-things | f34944dfbc78e454c6245b76f036f6dd24d018eb | [
"MIT"
] | null | null | null | """Module that holds success messages template"""
audit_messages = {
'created': 'created a new {} ',
'retrieved': 'retrieved {} successfully',
'updated': 'updated {} with id {} ',
'deleted': 'deleted favorite things with id {}'
}
| 27.444444 | 51 | 0.623482 | """Module that holds success messages template"""
audit_messages = {
'created': 'created a new {} ',
'retrieved': 'retrieved {} successfully',
'updated': 'updated {} with id {} ',
'deleted': 'deleted favorite things with id {}'
}
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9158dd6c47bc544e8cb7098be66e347b55085742 | 4,561 | py | Python | misc/gen_tar_lists.py | ishine/audio-retrieval | f6df6c737b0c7a42f7053a1794b77bd94cdaf5e7 | [
"Apache-2.0"
] | 20 | 2021-07-23T10:10:16.000Z | 2022-03-21T06:51:52.000Z | misc/gen_tar_lists.py | ishine/audio-retrieval | f6df6c737b0c7a42f7053a1794b77bd94cdaf5e7 | [
"Apache-2.0"
] | 1 | 2021-07-26T01:27:53.000Z | 2021-07-26T10:21:15.000Z | misc/gen_tar_lists.py | ishine/audio-retrieval | f6df6c737b0c7a42f7053a1794b77bd94cdaf5e7 | [
"Apache-2.0"
] | 4 | 2021-08-05T03:19:25.000Z | 2021-11-15T01:38:52.000Z | """
ipy misc/gen_tar_lists.py -- --dataset YouCook2
"""
if __name__ == "__main__":
main()
| 41.844037 | 88 | 0.631879 | """
ipy misc/gen_tar_lists.py -- --dataset YouCook2
"""
import copy
import json
import argparse
from typing import Dict, List, Tuple
from pathlib import Path
import tqdm
from beartype import beartype
from zsvision.zs_utils import load_json_config
from gen_readme import dataset_paths, model_specs2path
@beartype
def g... | 0 | 3,232 | 0 | 0 | 0 | 938 | 0 | 48 | 245 |
a3451cc7ce60b39bb01f95200d4c931fde4669ba | 7,910 | py | Python | napari_j/_tests/bridge_unit_test.py | jaimergp/napari-J | 4aec56a33c843ac9d03181ba31d61eb0fdbb754d | [
"MIT"
] | null | null | null | napari_j/_tests/bridge_unit_test.py | jaimergp/napari-J | 4aec56a33c843ac9d03181ba31d61eb0fdbb754d | [
"MIT"
] | null | null | null | napari_j/_tests/bridge_unit_test.py | jaimergp/napari-J | 4aec56a33c843ac9d03181ba31d61eb0fdbb754d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 23 22:19:32 2022
@author: baecker
"""
import sys
sys.path.append('./napari_j/_tests/surrogate')
if __name__ == '__main__':
from surrogate.surrogate import surrogate
else:
from unittest.mock import Mock
IJMock = Mock()
IJMock.getImage = getImag... | 33.516949 | 82 | 0.688369 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 23 22:19:32 2022
@author: baecker
"""
import sys
sys.path.append('./napari_j/_tests/surrogate')
if __name__ == '__main__':
from surrogate.surrogate import surrogate
else:
from surrogate import surrogate
from unittest.mock import patch
from ... | 0 | 6,591 | 0 | 0 | 0 | 485 | 0 | 20 | 257 |
21d336d016f5523099c115bd8dd6121427aa947b | 2,612 | py | Python | tests/unit_of_work/test_nested_inline_event_processing.py | mpsiva89/protean | 315fa56da3f64178bbbf0edf1995af46d5eb3da7 | [
"BSD-3-Clause"
] | null | null | null | tests/unit_of_work/test_nested_inline_event_processing.py | mpsiva89/protean | 315fa56da3f64178bbbf0edf1995af46d5eb3da7 | [
"BSD-3-Clause"
] | null | null | null | tests/unit_of_work/test_nested_inline_event_processing.py | mpsiva89/protean | 315fa56da3f64178bbbf0edf1995af46d5eb3da7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
published_count = 0
| 24.185185 | 74 | 0.696018 | from __future__ import annotations
from datetime import datetime
from uuid import uuid4
import pytest
from protean import (
BaseCommand,
BaseCommandHandler,
BaseEvent,
BaseEventHandler,
BaseEventSourcedAggregate,
apply,
handle,
)
from protean.fields import DateTime, Identifier, String, Te... | 0 | 1,203 | 0 | 737 | 0 | 0 | 0 | 215 | 393 |
631d2d31c900d92e293cd385d4a89850b668cf87 | 60,579 | py | Python | kmip/tests/integration/services/test_integration.py | oleksiys/PyKMIP | c8f4c8c94d29ae9b16c28654f14e5530b4a32f0a | [
"Apache-2.0"
] | null | null | null | kmip/tests/integration/services/test_integration.py | oleksiys/PyKMIP | c8f4c8c94d29ae9b16c28654f14e5530b4a32f0a | [
"Apache-2.0"
] | null | null | null | kmip/tests/integration/services/test_integration.py | oleksiys/PyKMIP | c8f4c8c94d29ae9b16c28654f14e5530b4a32f0a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 40.493984 | 105 | 0.629624 | # Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 0 | 58,435 | 0 | 0 | 0 | 0 | 0 | 698 | 800 |
05ec6d7cd1458e92c92a31b2f49633413e51d7e9 | 932 | py | Python | imagededuplicator/tests/hash_test.py | ToxicFrazzles/Image-Deduplicator | e23e0ceac7e104fee8fe60a5a20ef6291af54dcb | [
"CC0-1.0"
] | null | null | null | imagededuplicator/tests/hash_test.py | ToxicFrazzles/Image-Deduplicator | e23e0ceac7e104fee8fe60a5a20ef6291af54dcb | [
"CC0-1.0"
] | null | null | null | imagededuplicator/tests/hash_test.py | ToxicFrazzles/Image-Deduplicator | e23e0ceac7e104fee8fe60a5a20ef6291af54dcb | [
"CC0-1.0"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 28.242424 | 61 | 0.536481 | import unittest
from ..hashes import Hash
import random
class HashTestCase(unittest.TestCase):
def test_compute(self):
test_sizes = range(1, 20)
for i in test_sizes:
with self.subTest(size=i):
value = random.getrandbits(i*8)
h = Hash(value, length=i)
... | 0 | 0 | 0 | 803 | 0 | 0 | 0 | -4 | 67 |
577b561527fe81ada4ae3cb04d33bafe78ec303b | 4,466 | py | Python | tools/csv2eml/csv2eml.py | halueda/XstReader | 446269ebc5f9d20917f84144b2819db997ec5375 | [
"MS-PL"
] | null | null | null | tools/csv2eml/csv2eml.py | halueda/XstReader | 446269ebc5f9d20917f84144b2819db997ec5375 | [
"MS-PL"
] | null | null | null | tools/csv2eml/csv2eml.py | halueda/XstReader | 446269ebc5f9d20917f84144b2819db997ec5375 | [
"MS-PL"
] | 1 | 2019-12-03T06:11:43.000Z | 2019-12-03T06:11:43.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
# In[2]:
os.chdir('//172.17.129.234/d/gdrive/ueda-note/Outlooku/recovered')
# In[3]:
#os.getcwd()
# In[26]:
import glob
targets = glob.glob('*.csv')
# In[5]:
#import pandas
#
#
## In[6]:
#
#
#import pandas as pd
#
#
## In[7]:
#
#
#file='01-fami... | 17.377432 | 213 | 0.576579 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
# In[2]:
os.chdir('//172.17.129.234/d/gdrive/ueda-note/Outlookuファイル/recovered')
# In[3]:
#os.getcwd()
# In[26]:
import glob
targets = glob.glob('*.csv')
# In[5]:
#import pandas
#
#
## In[6]:
#
#
#import pandas as pd
#
#
## In[7]:
#
#
#file='01-... | 69 | 0 | 0 | 0 | 0 | 1,180 | 0 | -14 | 90 |
fc665b5805488e0a7fc6c4575e0e17cb2957b16c | 19,193 | py | Python | fbpic/fields/numba_methods.py | kcdodd/fbpic | 267c812c6c99fcfbf3f0e3f1833d1338e22ceb54 | [
"BSD-3-Clause-LBNL"
] | null | null | null | fbpic/fields/numba_methods.py | kcdodd/fbpic | 267c812c6c99fcfbf3f0e3f1833d1338e22ceb54 | [
"BSD-3-Clause-LBNL"
] | null | null | null | fbpic/fields/numba_methods.py | kcdodd/fbpic | 267c812c6c99fcfbf3f0e3f1833d1338e22ceb54 | [
"BSD-3-Clause-LBNL"
] | null | null | null | # Copyright 2016, FBPIC contributors
# Authors: Remi Lehe, Manuel Kirchen
# License: 3-Clause-BSD-LBNL
"""
This file is part of the Fourier-Bessel Particle-In-Cell code (FB-PIC)
It defines the optimized fields methods that use numba on a CPU
"""
from scipy.constants import c
c2 = c**2
# ---------------------------... | 38.852227 | 86 | 0.515657 | # Copyright 2016, FBPIC contributors
# Authors: Remi Lehe, Manuel Kirchen
# License: 3-Clause-BSD-LBNL
"""
This file is part of the Fourier-Bessel Particle-In-Cell code (FB-PIC)
It defines the optimized fields methods that use numba on a CPU
"""
from scipy.constants import c, epsilon_0, mu_0
c2 = c**2
import numba
from... | 0 | 18,272 | 0 | 0 | 0 | 0 | 0 | 42 | 366 |
25cce0ebb2060b9f3cb21da2cf7d211f4f1238d8 | 160 | py | Python | submissions.py | ToiletCommander/hog_contest_2021_cookes | a307289e65d27fa2e60f4b5cdf41bfe4f48ce838 | [
"MIT"
] | null | null | null | submissions.py | ToiletCommander/hog_contest_2021_cookes | a307289e65d27fa2e60f4b5cdf41bfe4f48ce838 | [
"MIT"
] | null | null | null | submissions.py | ToiletCommander/hog_contest_2021_cookes | a307289e65d27fa2e60f4b5cdf41bfe4f48ce838 | [
"MIT"
] | null | null | null | STRATEGY_NAME = "ultimate2"
IS_SUBMIT = False
EPOCH_NUM = 1
SUBMIT_NAME = "CookEs-" + STRATEGY_NAME + "(Version " + str(EPOCH_NUM) + ") github@ToiletCommander" | 40 | 100 | 0.725 | STRATEGY_NAME = "ultimate2"
IS_SUBMIT = False
EPOCH_NUM = 1
SUBMIT_NAME = "🍪CookEs-" + STRATEGY_NAME + "(Version " + str(EPOCH_NUM) + ") github@ToiletCommander" | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c9326bc94d602ff15cabb46c1f5c8bff2f717d3 | 566 | py | Python | src/djanban/apps/boards/migrations/0053_auto_20170311_0158.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 33 | 2017-06-14T18:04:25.000Z | 2021-06-15T07:07:56.000Z | src/djanban/apps/boards/migrations/0053_auto_20170311_0158.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 1 | 2017-05-10T08:45:55.000Z | 2017-05-10T08:45:55.000Z | src/djanban/apps/boards/migrations/0053_auto_20170311_0158.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 8 | 2017-08-27T11:14:25.000Z | 2021-03-03T12:11:16.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-03-11 00:58
from __future__ import unicode_literals
| 26.952381 | 169 | 0.65371 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-03-11 00:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('boards', '0052_auto_20170303_2130'),
]
operations = [
migrations.AddField(
... | 0 | 0 | 0 | 389 | 0 | 0 | 0 | 19 | 46 |
4dcc933c76f3e6529fda4e8cedfe24dbdd881267 | 387 | py | Python | code/strats/selfAwareTitForTat.py | yasirroni/PrisonersDilemmaTournament | ce3de71ff2ccb647aa00129473ff60f985e16e17 | [
"MIT"
] | 23 | 2021-05-20T07:34:33.000Z | 2021-06-20T13:09:04.000Z | code/strats/selfAwareTitForTat.py | yasirroni/PrisonersDilemmaTournament | ce3de71ff2ccb647aa00129473ff60f985e16e17 | [
"MIT"
] | 19 | 2021-05-21T04:10:55.000Z | 2021-06-13T15:17:52.000Z | code/strats/selfAwareTitForTat.py | yasirroni/PrisonersDilemmaTournament | ce3de71ff2ccb647aa00129473ff60f985e16e17 | [
"MIT"
] | 43 | 2021-05-21T02:24:35.000Z | 2021-06-24T21:08:11.000Z | def strategy(history, memory):
"""
If opponent defected, respond with defection. *UNLESS* we defected the turn before.
"""
opponents_last_move = history[1, -1] if history.shape[1] >= 1 else 1
our_second_last_move = history[0, -2] if history.shape[1] >= 2 else 1
choice = 1 if (opponents_last_move... | 43 | 87 | 0.679587 | def strategy(history, memory):
"""
If opponent defected, respond with defection. *UNLESS* we defected the turn before.
"""
opponents_last_move = history[1, -1] if history.shape[1] >= 1 else 1
our_second_last_move = history[0, -2] if history.shape[1] >= 2 else 1
choice = 1 if (opponents_last_move... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0dbd57a94566386d468858582f891aafb3945631 | 2,426 | py | Python | warrior_modules/warrior_selenium/warriorselenium/ClassUtils/WSelenium/verify_operations.py | warriorframework/warriorframework_py3 | fc268c610c429f5a60e5627c2405aa66036487dd | [
"Apache-2.0"
] | 6 | 2018-03-06T04:18:07.000Z | 2020-12-24T06:08:36.000Z | warrior_modules/warrior_selenium/warriorselenium/ClassUtils/WSelenium/verify_operations.py | warriorframework/warriorframework_py3 | fc268c610c429f5a60e5627c2405aa66036487dd | [
"Apache-2.0"
] | 51 | 2018-03-16T04:55:07.000Z | 2021-12-13T20:53:12.000Z | warrior_modules/warrior_selenium/warriorselenium/ClassUtils/WSelenium/verify_operations.py | warriorframework/warriorframework_py3 | fc268c610c429f5a60e5627c2405aa66036487dd | [
"Apache-2.0"
] | 7 | 2018-05-09T22:13:10.000Z | 2021-11-23T11:46:27.000Z | '''
Copyright 2017, Fujitsu Network Communications, 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 w... | 37.90625 | 112 | 0.617065 | '''
Copyright 2017, Fujitsu Network Communications, 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 w... | 0 | 0 | 0 | 1,509 | 0 | 0 | 0 | 90 | 71 |
00c755045901ea5cff139b0b7841307024736599 | 1,261 | py | Python | class_2/step4.py | goosemanjack/python_intro_class | ca4b2390f2b0bb037d94ed4516d98848b7cf97d6 | [
"MIT"
] | null | null | null | class_2/step4.py | goosemanjack/python_intro_class | ca4b2390f2b0bb037d94ed4516d98848b7cf97d6 | [
"MIT"
] | null | null | null | class_2/step4.py | goosemanjack/python_intro_class | ca4b2390f2b0bb037d94ed4516d98848b7cf97d6 | [
"MIT"
] | null | null | null |
begin() | 19.4 | 88 | 0.536875 |
def begin():
name = input("Hello person. What is your name? ")
print("You are very smart, " + name)
print("Now that we know each other, what pronoun should I use when referring to you? ")
# mapped arrays
opts = [[1,2,3], ["He", "She", "They"]]
#if elif
print("Pick a value for your pronoun")
for i in range(l... | 0 | 0 | 0 | 0 | 0 | 1,182 | 0 | 0 | 69 |
5a781916e8e7f39c860885a9db62b960fd80ec97 | 10,177 | py | Python | rsa.py | aishee/RSAGui | 33444c38f6f27e2a15fa05e71f2b014cdc5597c1 | [
"MIT"
] | null | null | null | rsa.py | aishee/RSAGui | 33444c38f6f27e2a15fa05e71f2b014cdc5597c1 | [
"MIT"
] | null | null | null | rsa.py | aishee/RSAGui | 33444c38f6f27e2a15fa05e71f2b014cdc5597c1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""RSA"""
#SPECIFICATION
"""Public key
P and Q are prime number
N = P * Q
M = ( P - 1) * (Q -1)
C = prime number of M, GCD(C,M) = 1
Public key = (N,C)
"""
"""
Private key
We have need U
C * U + M * V = 1
U is ]2,M[
2 < U - K *M < M
PRIVATE KEY = (U,N)
"""
""" ENCRYPTION
1) Take the message
2) ... | 31.122324 | 130 | 0.555861 | #!/usr/bin/env python3
"""RSA"""
import math
import random
from tkinter import *
from tkinter import ttk
#SPECIFICATION
"""Public key
P and Q are prime number
N = P * Q
M = ( P - 1) * (Q -1)
C = prime number of M, GCD(C,M) = 1
Public key = (N,C)
"""
"""
Private key
We have need U
C * U + M * V = 1
U is ]2,M[
2 < U ... | 0 | 0 | 0 | 9,294 | 0 | 0 | 0 | -16 | 155 |
c3335fafab746ab38a9edeb96e06df60608bf78a | 1,870 | py | Python | Helpers/Cube_Helper.py | brianr01/robot-api | 73e6f3da9287fcf22618a6244370105fee164c51 | [
"MIT"
] | null | null | null | Helpers/Cube_Helper.py | brianr01/robot-api | 73e6f3da9287fcf22618a6244370105fee164c51 | [
"MIT"
] | null | null | null | Helpers/Cube_Helper.py | brianr01/robot-api | 73e6f3da9287fcf22618a6244370105fee164c51 | [
"MIT"
] | null | null | null | import sys
sys.path.append(sys.path[0] + '/Helpers')
| 27.910448 | 65 | 0.654545 | from flask import Blueprint
from flask import request
import sys, random, time
sys.path.append(sys.path[0] + '/Helpers')
from Motors_Helper import Motors_Helper
from Virtual_Rubiks_Cube_Helper import Virtual_Rubiks_Cube_Helper
class Cube_Helper:
def __init__(self):
self.virtual_cube = Virtual_Rubiks_Cube_... | 0 | 0 | 0 | 1,619 | 0 | 0 | 0 | 86 | 111 |
c74cf2fe5d06dbb6468c60fc41018bcdeaa00671 | 1,987 | py | Python | venv/lib/python3.8/site-packages/allauth/account/migrations/0001_initial.py | DOY2021/whiskynote | cbee0e15fadfc382302670954b50399f83e5b28c | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/allauth/account/migrations/0001_initial.py | DOY2021/whiskynote | cbee0e15fadfc382302670954b50399f83e5b28c | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/allauth/account/migrations/0001_initial.py | DOY2021/whiskynote | cbee0e15fadfc382302670954b50399f83e5b28c | [
"MIT"
] | 1 | 2022-03-19T15:36:37.000Z | 2022-03-19T15:36:37.000Z | # Generated by Django 3.2.4 on 2021-06-02 11:11
import django.db.models.deletion
| 42.276596 | 156 | 0.612481 | # Generated by Django 3.2.4 on 2021-06-02 11:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 0 | 0 | 0 | 1,778 | 0 | 0 | 0 | 37 | 90 |
7d3dce2d199ee60fd11f456bf0e6149265cba96a | 722 | py | Python | setup.py | TomoyaFujita2016/Python_Package_Sample | 855234e13df7f19054659ddb3849a8248bdb78ab | [
"MIT"
] | null | null | null | setup.py | TomoyaFujita2016/Python_Package_Sample | 855234e13df7f19054659ddb3849a8248bdb78ab | [
"MIT"
] | null | null | null | setup.py | TomoyaFujita2016/Python_Package_Sample | 855234e13df7f19054659ddb3849a8248bdb78ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from glob import glob
from os.path import basename
from os.path import splitext
from setuptools import setup
from setuptools import find_packages
setup(
name="",
use_scm_version=True,
license="",
description="",
author="",
url="",
packages=fi... | 23.290323 | 74 | 0.684211 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from glob import glob
from os.path import basename
from os.path import splitext
from setuptools import setup
from setuptools import find_packages
def _requires_from_file(filename):
return open(filename).read().splitlines()
setup(
name="",
use_scm_version=Tr... | 0 | 0 | 0 | 0 | 0 | 59 | 0 | 0 | 23 |
31ac0c5c4377ce2cb7b404c9150c6b0f438c9497 | 1,829 | py | Python | train_reco.py | mlabarrere/Webcam_recognition | d5c1ae1e44522a7fc6c6f41961b058acb877f904 | [
"Apache-2.0"
] | null | null | null | train_reco.py | mlabarrere/Webcam_recognition | d5c1ae1e44522a7fc6c6f41961b058acb877f904 | [
"Apache-2.0"
] | null | null | null | train_reco.py | mlabarrere/Webcam_recognition | d5c1ae1e44522a7fc6c6f41961b058acb877f904 | [
"Apache-2.0"
] | 2 | 2018-05-11T13:01:11.000Z | 2019-02-20T09:05:38.000Z | import cv2
import os
import numpy as np
import pickle
github_readme = "https://github.com/mlabarrere/webcam-recognition/blob/master/README.md"
dictionary_people = dict()
dir_name = "data"
subject_folder_names = os.listdir(dir_name)
assert subject_folder_names, "You forgot to place a training folder.\nPlease refer t... | 30.483333 | 155 | 0.691635 | import cv2
import os
import numpy as np
import pickle
from src.lib import detect_face
github_readme = "https://github.com/mlabarrere/webcam-recognition/blob/master/README.md"
dictionary_people = dict()
dir_name = "data"
subject_folder_names = os.listdir(dir_name)
assert subject_folder_names, "You forgot to place a ... | 0 | 0 | 0 | 0 | 0 | 890 | 0 | 10 | 45 |
b339437476ada4b91976d4dc3e7e06d58c6d95ae | 1,388 | py | Python | tests/base/job/test_wrapper.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | tests/base/job/test_wrapper.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | tests/base/job/test_wrapper.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) Max-Planck-Institut fr Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
| 36.526316 | 108 | 0.682277 | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import os
import unittest
from pyiron.base.project.generic import Project
from pyiron.base.job.wrapper import job_wrappe... | 2 | 598 | 0 | 435 | 0 | 0 | 0 | 43 | 112 |
7cbcc878799f2c021216affaba11a3ee58089783 | 2,793 | py | Python | custom/icds_reports/utils/aggregation_helpers/distributed/daily_feeding_forms_child_health.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | custom/icds_reports/utils/aggregation_helpers/distributed/daily_feeding_forms_child_health.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | custom/icds_reports/utils/aggregation_helpers/distributed/daily_feeding_forms_child_health.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
| 42.318182 | 111 | 0.686001 | from __future__ import absolute_import
from __future__ import unicode_literals
from dateutil.relativedelta import relativedelta
from custom.icds_reports.const import AGG_DAILY_FEEDING_TABLE
from custom.icds_reports.utils.aggregation_helpers import month_formatter
from custom.icds_reports.utils.aggregation_helpers.dist... | 0 | 0 | 0 | 2,392 | 0 | 0 | 0 | 209 | 112 |
b1b5f2d7c0d7739ed0433df1648e9cf80e57151a | 725 | py | Python | lMechanize/test.py | jieshenboy/jeckstockpick | 39219722a78212fa39eba860b2e945e45df58bff | [
"MIT"
] | 1 | 2018-03-24T10:03:27.000Z | 2018-03-24T10:03:27.000Z | lMechanize/test.py | jieshenboy/jeckstockpick | 39219722a78212fa39eba860b2e945e45df58bff | [
"MIT"
] | null | null | null | lMechanize/test.py | jieshenboy/jeckstockpick | 39219722a78212fa39eba860b2e945e45df58bff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import mechanize
import sys
reload(sys)#pythonstrasciiunicode,utf8
sys.setdefaultencoding('utf8')
br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
br.set_handle_gzip(False)
br.set_handle... | 27.884615 | 153 | 0.753103 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import mechanize
import sys
reload(sys)#python的str默认是ascii编码,和unicode编码冲突,这一部分可以载入utf8
sys.setdefaultencoding('utf8')
br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
br.set_handle_gzip(... | 72 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
92b39b54cb56de3785fff9ab9272d65bc188ecd0 | 2,618 | py | Python | setup.py | zhangzhen273/python-dubbo-rpc | 1f841e9954796c644f2b0dccdf09f00dd1e158af | [
"Apache-2.0"
] | 94 | 2019-06-03T05:11:52.000Z | 2022-01-28T13:31:46.000Z | setup.py | wuwen5/dubbo-python | d86ad6acd30592c2389c6aba4360e0b61b8396dc | [
"Apache-2.0"
] | 9 | 2019-07-23T03:38:05.000Z | 2021-12-08T05:22:03.000Z | setup.py | wuwen5/dubbo-python | d86ad6acd30592c2389c6aba4360e0b61b8396dc | [
"Apache-2.0"
] | 36 | 2015-06-08T07:14:30.000Z | 2022-02-28T11:21:55.000Z | #!/usr/bin/env python
# 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... | 34 | 78 | 0.672269 | #!/usr/bin/env python
# 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c90820bef1889414992a32de7819029f01de481 | 452 | py | Python | histoslide/urls.py | guoqingbao/Patholabelling | b70175ea2255bccd37e5af6649709e3e16fd6596 | [
"Apache-2.0"
] | 1 | 2021-02-25T16:20:50.000Z | 2021-02-25T16:20:50.000Z | histoslide/urls.py | guoqingbao/Patholabelling | b70175ea2255bccd37e5af6649709e3e16fd6596 | [
"Apache-2.0"
] | null | null | null | histoslide/urls.py | guoqingbao/Patholabelling | b70175ea2255bccd37e5af6649709e3e16fd6596 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^(?P<slide_id>\w+)/$', views.slide),
url(r'^(?P<slug>\w+).dzi$', views.dzi),
url(r'^(?P<slug>\w+).dzi.json$', views.properties),
url(r'^(?P<slug>\w+)_files/(?P<level>\d+)/(?P<col>\d+)_(?P<row>\d+)\.(?P<slideformat>jpeg|png)$', ... | 37.666667 | 116 | 0.566372 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^(?P<slide_id>\w+)/$', views.slide),
url(r'^(?P<slug>\w+).dzi$', views.dzi),
url(r'^(?P<slug>\w+).dzi.json$', views.properties),
url(r'^(?P<slug>\w+)_files/(?P<level>\d+)/(?P<col>\d+)_(?P<row>\d+)\.(?P<slideformat>jpeg|png)$', ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
62fd07c259514ff947699f961b7af34edff2e8d0 | 1,878 | py | Python | run.py | DeweiFeng/FlappyBird_AI | e64ec8fd253b29b1be80f1d9a3e467d68339e358 | [
"MIT"
] | null | null | null | run.py | DeweiFeng/FlappyBird_AI | e64ec8fd253b29b1be80f1d9a3e467d68339e358 | [
"MIT"
] | null | null | null | run.py | DeweiFeng/FlappyBird_AI | e64ec8fd253b29b1be80f1d9a3e467d68339e358 | [
"MIT"
] | null | null | null | # pip3 install gym
# pip3 install neat-python
# for gym stuff:
# apt install xvfb ffmpeg xorg-dev libsdl2-dev swig cmake
# pip3 install gym[box2d]
import pygame
clock = pygame.time.Clock()
runs_per_net = 2
# Use the NN network phenotype and the discrete actuator force function.
if __name__ == '__main__':
... | 22.902439 | 73 | 0.651757 | # pip3 install gym
# pip3 install neat-python
# for gym stuff:
# apt install xvfb ffmpeg xorg-dev libsdl2-dev swig cmake
# pip3 install gym[box2d]
import multiprocessing
import os
import pickle
import neat
import numpy as np
import bird
import pygame
clock = pygame.time.Clock()
runs_per_net = 2
# Use the NN n... | 0 | 0 | 0 | 0 | 0 | 1,389 | 0 | -42 | 202 |
0501439158c1314d99e1110b0fcdeb43f0049308 | 381 | py | Python | prime.py | dewhallez/python_bootcamp | f6743502c9424c88bc61f6e28c3fba3b454312bd | [
"MIT"
] | null | null | null | prime.py | dewhallez/python_bootcamp | f6743502c9424c88bc61f6e28c3fba3b454312bd | [
"MIT"
] | null | null | null | prime.py | dewhallez/python_bootcamp | f6743502c9424c88bc61f6e28c3fba3b454312bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Check if number is prime, return TRUE or FALSE
print(is_prime(5))
print(is_prime(12))
print(is_prime(15))
print(is_prime(21))
print(is_prime(32))
print(is_prime(51))
print(is_prime(101))
| 19.05 | 48 | 0.624672 | #!/usr/bin/env python3
# Check if number is prime, return TRUE or FALSE
def is_prime(num):
if num < 2:
return False
for i in range(2, int(num ** 0.5)+1):
if num % i == 0:
return False
return True
print(is_prime(5))
print(is_prime(12))
print(is_prime(15))
print(is_prime(21))
... | 0 | 0 | 0 | 0 | 0 | 144 | 0 | 0 | 23 |
15b8f66b97c4b84ffa2bed6f920d105a8d4624e2 | 449 | py | Python | conference/schedule/migrations/0004_slot_show_end_time.py | djangocon/2017.djangocon.eu | d811a9cd5b24f48f6e224d0dd4abe9173f7f97d7 | [
"BSD-3-Clause"
] | 7 | 2016-11-21T12:53:37.000Z | 2020-03-30T23:22:48.000Z | conference/schedule/migrations/0004_slot_show_end_time.py | djangocon/2017.djangocon.eu | d811a9cd5b24f48f6e224d0dd4abe9173f7f97d7 | [
"BSD-3-Clause"
] | 17 | 2016-11-17T19:25:48.000Z | 2017-04-06T08:43:46.000Z | conference/schedule/migrations/0004_slot_show_end_time.py | FuzzyBrains/DjangoConEurope2017 | d811a9cd5b24f48f6e224d0dd4abe9173f7f97d7 | [
"BSD-3-Clause"
] | 7 | 2016-11-05T11:18:40.000Z | 2016-11-09T17:14:52.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 22.45 | 95 | 0.625835 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schedule', '0003_slot_sprint_days'),
]
operations = [
migrations.AddField(
model_name='slot',
name='... | 0 | 0 | 0 | 319 | 0 | 0 | 0 | 19 | 46 |
e8b3eef1c6622b7b70c026894bc8182281a737f6 | 1,479 | py | Python | old_ref/functions/sqlquery.py | matterholt/APP_CRUD-v1 | 6ed49d144d09881498e9b0689f98f83016fb1e8d | [
"MIT"
] | null | null | null | old_ref/functions/sqlquery.py | matterholt/APP_CRUD-v1 | 6ed49d144d09881498e9b0689f98f83016fb1e8d | [
"MIT"
] | null | null | null | old_ref/functions/sqlquery.py | matterholt/APP_CRUD-v1 | 6ed49d144d09881498e9b0689f98f83016fb1e8d | [
"MIT"
] | null | null | null | # import dependencies
import os
import sqlite3
import pandas as pd
# read the dataset in to panads
data_url = "https://github.com/matterholt/APP_CRUD-v1/blob/master/iris.csv"
headers = ["sepal_length", "sepal_width", "petal_length", "petal_width", "species"]
data_tabel = pd.read_csv(data_url, header=None, names=header... | 21.128571 | 87 | 0.647059 | # import dependencies
import os
import sqlite3
import pandas as pd
# read the dataset in to panads
data_url = "https://github.com/matterholt/APP_CRUD-v1/blob/master/iris.csv"
headers = ["sepal_length", "sepal_width", "petal_length", "petal_width", "species"]
data_tabel = pd.read_csv(data_url, header=None, names=header... | 0 | 0 | 0 | 0 | 0 | 328 | 0 | 0 | 88 |
786971a3decbefaec3429c70a397fb7626137033 | 265 | py | Python | 1_mundo_exercicios/ex014.py | GuilhermeLima182/CursoDePython | 7e72b117142794c38cbb14284d0fa6e1dbee5bf6 | [
"MIT"
] | null | null | null | 1_mundo_exercicios/ex014.py | GuilhermeLima182/CursoDePython | 7e72b117142794c38cbb14284d0fa6e1dbee5bf6 | [
"MIT"
] | null | null | null | 1_mundo_exercicios/ex014.py | GuilhermeLima182/CursoDePython | 7e72b117142794c38cbb14284d0fa6e1dbee5bf6 | [
"MIT"
] | null | null | null | #Faa um programa que leia uma temperatura em graus celsius e converta
#para fahrenheit.
celsius = float(input('Informe a temperatura em C: '))
fahrenheit = (celsius * 9/5) + 32
print('O valor convertido de {}C em fahrenheit {}F'.format(celsius, fahrenheit))
| 37.857143 | 84 | 0.739623 | #Faça um programa que leia uma temperatura em graus celsius e converta
#para fahrenheit.
celsius = float(input('Informe a temperatura em ºC: '))
fahrenheit = (celsius * 9/5) + 32
print('O valor convertido de {}ºC em fahrenheit é {}ºF'.format(celsius, fahrenheit))
| 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aea76d6bf22601a70bd9c39cd8ce242499164997 | 5,584 | py | Python | src/grafanatools/api.py | callumstew/grafanatools | 5d929a4775127658ac40cf208112aabe10948e83 | [
"MIT"
] | null | null | null | src/grafanatools/api.py | callumstew/grafanatools | 5d929a4775127658ac40cf208112aabe10948e83 | [
"MIT"
] | null | null | null | src/grafanatools/api.py | callumstew/grafanatools | 5d929a4775127658ac40cf208112aabe10948e83 | [
"MIT"
] | 1 | 2019-03-14T11:23:51.000Z | 2019-03-14T11:23:51.000Z | """ Module for interacting with Grafana HTTP API
View https://docs.grafana.org/http_api/ for comprehensive
documentation
"""
| 34.68323 | 81 | 0.59957 | """ Module for interacting with Grafana HTTP API
View https://docs.grafana.org/http_api/ for comprehensive
documentation
"""
from typing import Mapping, Optional, Any
from requests import Session, Response
from .generic import update
class BaseApi():
""" Base class for Grafana HTTP API
"""
def __init__(se... | 0 | 0 | 0 | 5,231 | 0 | 0 | 0 | 43 | 181 |
905f1a5ab9b532100ec00e549d5085480090545a | 762 | py | Python | print_test.py | wolftype/pony | be5c09c5e21fb03ad8693e4cea68551690d90c83 | [
"BSD-2-Clause"
] | 1 | 2018-10-14T01:36:48.000Z | 2018-10-14T01:36:48.000Z | print_test.py | wolftype/pony | be5c09c5e21fb03ad8693e4cea68551690d90c83 | [
"BSD-2-Clause"
] | null | null | null | print_test.py | wolftype/pony | be5c09c5e21fb03ad8693e4cea68551690d90c83 | [
"BSD-2-Clause"
] | null | null | null |
p = Print ()
filename = "-i hpgl/p2.hpgl"
num = 50
for i in range (1, num):
#[0,1)
scl = float(i)/float(num)
#reset
args = "-r -l "
#select pen
args += "-sp 8 "
#draw border
args += "-b "
#scale
args += "-sr " + str(scl) + " " + str(scl)+ " "
#line type
if (i % 5 ):
... | 20.052632 | 52 | 0.408136 | from pony import *
p = Print ()
filename = "-i hpgl/p2.hpgl"
num = 50
for i in range (1, num):
#[0,1)
scl = float(i)/float(num)
#reset
args = "-r -l "
#select pen
args += "-sp 8 "
#draw border
args += "-b "
#scale
args += "-sr " + str(scl) + " " + str(scl)+ " "
#line type... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
066ea45248d245f3e0dd2806be6acfa41d32d8b9 | 274 | py | Python | pingparsing/_common.py | xNathan/pingparsing | e334c94336357f0284dbf5d21ceb9f342b48a107 | [
"MIT"
] | 64 | 2016-03-05T08:39:23.000Z | 2022-02-26T15:28:43.000Z | pingparsing/_common.py | xNathan/pingparsing | e334c94336357f0284dbf5d21ceb9f342b48a107 | [
"MIT"
] | 21 | 2016-06-14T03:56:58.000Z | 2021-06-06T03:42:10.000Z | pingparsing/_common.py | xNathan/pingparsing | e334c94336357f0284dbf5d21ceb9f342b48a107 | [
"MIT"
] | 11 | 2017-05-09T12:59:55.000Z | 2021-02-06T14:51:42.000Z | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
| 21.076923 | 63 | 0.656934 | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from typing import Union, cast
def _to_unicode(text: Union[str, bytes]) -> str:
try:
return text.decode("ascii") # type: ignore
except AttributeError:
return cast(str, text)
| 0 | 0 | 0 | 0 | 0 | 146 | 0 | 9 | 46 |
76b850c3fae5c45c1967924d627d3d075a7422bd | 16,927 | py | Python | pysnmp-with-texts/CISCO-WPAN-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/CISCO-WPAN-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/CISCO-WPAN-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-WPAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WPAN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:21:30 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 180.074468 | 1,461 | 0.799905 | #
# PySNMP MIB module CISCO-WPAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WPAN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:21:30 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
62c31a025b936d85b8b363d3c5a90688da1041b3 | 400 | py | Python | rinzler/exceptions/invalid_input_exception.py | feliphebueno/Rinzler | e1fe0621dad80356eeb1224bb83da2ffa0c48baa | [
"MIT"
] | 6 | 2017-08-03T00:49:46.000Z | 2019-03-01T22:38:47.000Z | rinzler/exceptions/invalid_input_exception.py | feliphebueno/Rinzler | e1fe0621dad80356eeb1224bb83da2ffa0c48baa | [
"MIT"
] | 10 | 2018-07-17T18:14:03.000Z | 2022-02-10T06:47:27.000Z | rinzler/exceptions/invalid_input_exception.py | feliphebueno/Rinzler | e1fe0621dad80356eeb1224bb83da2ffa0c48baa | [
"MIT"
] | 1 | 2017-10-03T00:19:49.000Z | 2017-10-03T00:19:49.000Z | """
Exception raised when a body request can not be decode from JSON and/or it's content doesn't match the minimum
specified values by the app
"""
__author__ = "Rinzler<github.com/feliphebueno>"
| 25 | 110 | 0.755 | """
Exception raised when a body request can not be decode from JSON and/or it's content doesn't match the minimum
specified values by the app
"""
from rinzler.exceptions import RinzlerHttpException
__author__ = "Rinzler<github.com/feliphebueno>"
class InvalidInputException(RinzlerHttpException):
"""
Invalid... | 0 | 0 | 0 | 128 | 0 | 0 | 0 | 30 | 45 |
4daef84d172a4c79d4657a7905aca6f3a8b02cc1 | 734 | py | Python | pvcnn/modules/functional/ball_query.py | paschalidoud/pvcnn | 4894ab8de72fee29df952d5a92a22b6211ec15f8 | [
"MIT"
] | null | null | null | pvcnn/modules/functional/ball_query.py | paschalidoud/pvcnn | 4894ab8de72fee29df952d5a92a22b6211ec15f8 | [
"MIT"
] | null | null | null | pvcnn/modules/functional/ball_query.py | paschalidoud/pvcnn | 4894ab8de72fee29df952d5a92a22b6211ec15f8 | [
"MIT"
] | null | null | null |
from .backend import _backend
__all__ = ['ball_query']
def ball_query(centers_coords, points_coords, radius, num_neighbors):
"""
:param centers_coords: coordinates of centers, FloatTensor[B, 3, M]
:param points_coords: coordinates of points, FloatTensor[B, 3, N]
:param radius: float,... | 36.7 | 88 | 0.694823 | from torch.autograd import Function
from .backend import _backend
__all__ = ['ball_query']
def ball_query(centers_coords, points_coords, radius, num_neighbors):
"""
:param centers_coords: coordinates of centers, FloatTensor[B, 3, M]
:param points_coords: coordinates of points, FloatTensor[B,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 22 |
756b8150c7e6908d271f7c2f288748ba946092c7 | 7,716 | py | Python | legacy/purityAndStability_METbins.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | legacy/purityAndStability_METbins.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | legacy/purityAndStability_METbins.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | '''
Created on Aug 1, 2012
@author: Lukasz Kreczko
Email: Lukasz.Kreczko@cern.ch
'''
from ROOT import gROOT
fileTemplate = 'data/correctionFactors/correctionFactors_%s_%s_JSON.txt'
samples = [
'TTJet',
'POWHEG',
'PYTHIA6',
'MCatNLO',
'TTJets-matchingdown',
'TTJets-matc... | 38.58 | 129 | 0.631804 | '''
Created on Aug 1, 2012
@author: Lukasz Kreczko
Email: Lukasz.Kreczko@cern.ch
'''
import FILES
import tools.ROOTFileReader as FileReader
from ROOT import gROOT
import tools.FileUtilities as FileUtils
fileTemplate = 'data/correctionFactors/correctionFactors_%s_%s_JSON.txt'
samples = [
'TTJet',
'PO... | 0 | 0 | 0 | 0 | 0 | 3,722 | 0 | 29 | 136 |
432eaeb5474fead13d8e3d68f38ca05443e58f7d | 1,342 | py | Python | lino_xl/lib/clients/__init__.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | 1 | 2018-01-12T14:09:48.000Z | 2018-01-12T14:09:48.000Z | lino_xl/lib/clients/__init__.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | 1 | 2019-09-10T05:03:47.000Z | 2019-09-10T05:03:47.000Z | lino_xl/lib/clients/__init__.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | null | null | null | # Copyright 2014-2017 Luc Saffre
# License: BSD (see file COPYING for details)
"""See :doc:`/specs/clients`.
.. autosummary::
:toctree:
desktop
"""
| 26.84 | 66 | 0.650522 | # Copyright 2014-2017 Luc Saffre
# License: BSD (see file COPYING for details)
"""See :doc:`/specs/clients`.
.. autosummary::
:toctree:
desktop
"""
from lino.api import ad, _
class Plugin(ad.Plugin):
verbose_name = _("Clients")
needs_plugins = ['lino_xl.lib.contacts']
client_model = 'co... | 0 | 0 | 0 | 1,119 | 0 | 0 | 0 | 5 | 46 |
268e362afe8f361265099cbbeb85a9f3f94f2e44 | 98,423 | py | Python | pysnmp-with-texts/AP553-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/AP553-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/AP553-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module AP553-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AP553-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:22:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23... | 156.475358 | 8,182 | 0.783425 | #
# PySNMP MIB module AP553-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AP553-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:22:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
73517dec824979b17fe087714c5b223894c5cc8f | 26,475 | py | Python | applications/Adversarial-Misspellings/main.py | suryabulusu/neuspell | 82d1a098e841c0d66592a4780691d2a7e494c924 | [
"MIT"
] | 1 | 2021-05-21T09:39:50.000Z | 2021-05-21T09:39:50.000Z | applications/Adversarial-Misspellings/main.py | michael-conrad/neuspell | f1d1a8b4efa7c6aa6e0564ea17db152905f4c7dc | [
"MIT"
] | null | null | null | applications/Adversarial-Misspellings/main.py | michael-conrad/neuspell | f1d1a8b4efa7c6aa6e0564ea17db152905f4c7dc | [
"MIT"
] | null | null | null | # Usage: python3 main.py --mode dev --model bilstm \
# --load tmp/lstm_epochs=4 --num_examples 100
from collections import defaultdict
#from biLstm_with_chars import BiLSTM
# from CNN import CNN
# from RNN_with_char import RNN
import argparse
import sys
import string
from nltk.corpus import stopwords as SW
#import huns... | 37.394068 | 284 | 0.621039 | # Usage: python3 main.py --mode dev --model bilstm \
# --load tmp/lstm_epochs=4 --num_examples 100
from collections import defaultdict
import time
import datetime
import biLstm_with_chars # word + char model biLSTM model
import biLstm_char_only # char only biLSTM model
import biLstm
#from biLstm_with_chars import BiLS... | 0 | 0 | 0 | 0 | 0 | 16,818 | 0 | -32 | 647 |
dbc50f46cfca53dd26c3efa906c66103735b0b0c | 3,708 | py | Python | mayan/apps/ocr/migrations/0009_auto_20210304_0950.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 4 | 2021-09-02T00:16:30.000Z | 2021-09-09T22:25:15.000Z | mayan/apps/ocr/migrations/0009_auto_20210304_0950.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 86 | 2021-09-01T23:53:02.000Z | 2021-09-20T02:25:10.000Z | mayan/apps/ocr/migrations/0009_auto_20210304_0950.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 70 | 2021-09-01T12:54:51.000Z | 2022-02-16T00:53:18.000Z | from django.db import reset_queries
def code_remap_document_version_pages_ocr_content(apps, schema_editor):
"""
The document_page_id field is pointing to the document file page.
This migration will remap that to point it for the corresponding
document version page that is connected to the original doc... | 35.314286 | 118 | 0.598975 | from django.db import migrations, models, reset_queries
import django.db.models.deletion
def code_remap_document_version_pages_ocr_content(apps, schema_editor):
"""
The document_page_id field is pointing to the document file page.
This migration will remap that to point it for the corresponding
docume... | 0 | 0 | 0 | 1,519 | 0 | 0 | 0 | 31 | 45 |
aecc14bf780b6b4d013f71c465ca428201d2af6a | 12,393 | py | Python | prep/Behavior.py | orena1/SpineImagingALM | 372ae843e52c27f2298bc415ef267c18aed995cb | [
"MIT"
] | 2 | 2019-11-30T00:57:07.000Z | 2020-08-26T23:49:15.000Z | prep/Behavior.py | elifesciences-publications/SpineImagingALM | 5f40e5182f298c3beba4956c37d7312f5e8b52b3 | [
"MIT"
] | 10 | 2020-03-24T17:12:03.000Z | 2022-03-11T23:51:43.000Z | prep/Behavior.py | elifesciences-publications/SpineImagingALM | 5f40e5182f298c3beba4956c37d7312f5e8b52b3 | [
"MIT"
] | 2 | 2019-10-23T14:34:50.000Z | 2020-10-21T00:59:10.000Z | # Encoding: utf-8
""" Behavior module for loading data from RT linux behavior controller.
"""
from __future__ import print_function
import matplotlib.pyplot as plt
import logging
import numpy as np
import os
import sys
from prep.Embedding import getExampleVol
from prep.HeaderReader import HeaderReader
... | 40.237013 | 117 | 0.618091 | # Encoding: utf-8
""" Behavior module for loading data from RT linux behavior controller.
"""
from __future__ import print_function
import copy
import matplotlib.pyplot as plt
import logging
import numpy as np
import os
import sys
from prep.Embedding import getExampleVol
from prep.HeaderReader import... | 0 | 0 | 0 | 0 | 0 | 2,751 | 0 | -10 | 50 |
7e74e88ed26d203551f062f492c80c411bf6ae10 | 475 | py | Python | setup.py | HDictus/pyminiCLI | ac4f2771010934a499636ceaffe8532e50cdf07a | [
"MIT"
] | 2 | 2021-01-12T10:17:41.000Z | 2021-12-24T15:45:12.000Z | setup.py | HDictus/pyminiCLI | ac4f2771010934a499636ceaffe8532e50cdf07a | [
"MIT"
] | 2 | 2021-12-16T12:20:35.000Z | 2021-12-24T15:38:33.000Z | setup.py | HDictus/pyminiCLI | ac4f2771010934a499636ceaffe8532e50cdf07a | [
"MIT"
] | null | null | null | from setuptools import setup
with open('README.md', encoding='utf-8') as f:
README = f.read()
setup(
name='pyminiCLI',
version='0.2.1',
packages=['minicli'],
license='MIT',
author='HDIctus',
tests_require=['pytest'],
author_email='h.t.dictus@gmail.com',
description='quick and easy ... | 25 | 57 | 0.673684 | from setuptools import setup
with open('README.md', encoding='utf-8') as f:
README = f.read()
setup(
name='pyminiCLI',
version='0.2.1',
packages=['minicli'],
license='MIT',
author='HDIctus',
tests_require=['pytest'],
author_email='h.t.dictus@gmail.com',
description='quick and easy ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d7b60a50e0c14dd6a025ec76e4aa310d5014fd3 | 26,294 | py | Python | wa/utils/types.py | robF8/workload-automation | 84b5ea8a56fae2388beb861edea21064a2c5fafa | [
"Apache-2.0"
] | 159 | 2016-01-25T11:08:39.000Z | 2022-03-28T05:20:41.000Z | wa/utils/types.py | robF8/workload-automation | 84b5ea8a56fae2388beb861edea21064a2c5fafa | [
"Apache-2.0"
] | 656 | 2016-01-25T11:16:56.000Z | 2022-03-23T16:03:28.000Z | wa/utils/types.py | robF8/workload-automation | 84b5ea8a56fae2388beb861edea21064a2c5fafa | [
"Apache-2.0"
] | 127 | 2015-03-11T16:36:17.000Z | 2022-02-15T02:26:43.000Z | # Copyright 2014-2018 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 30.292627 | 94 | 0.597589 | # Copyright 2014-2018 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 0 | 4,224 | 0 | 13,654 | 0 | 395 | 0 | 144 | 749 |
af08e0ffe35443f4267e87d6151743d082ed0df2 | 168 | py | Python | relay/jobs/decorators.py | yiu31802/ave | e46fc357f9464d5beaf42568a74bb95e6b1b8037 | [
"BSD-3-Clause"
] | 17 | 2016-11-16T08:09:49.000Z | 2021-08-12T06:38:09.000Z | relay/jobs/decorators.py | yiu31802/ave | e46fc357f9464d5beaf42568a74bb95e6b1b8037 | [
"BSD-3-Clause"
] | null | null | null | relay/jobs/decorators.py | yiu31802/ave | e46fc357f9464d5beaf42568a74bb95e6b1b8037 | [
"BSD-3-Clause"
] | 12 | 2016-11-20T15:34:03.000Z | 2020-08-04T00:26:11.000Z | # Copyright (C) 2014 Sony Mobile Communications AB.
# All rights, including trade secret rights, reserved.
| 24 | 54 | 0.708333 | # Copyright (C) 2014 Sony Mobile Communications AB.
# All rights, including trade secret rights, reserved.
def smoke(fn):
setattr(fn, 'smoke', True)
return fn
| 0 | 0 | 0 | 0 | 0 | 38 | 0 | 0 | 23 |
2122d5aa57927aaed73b2d58ff36505c4b4ba9b0 | 1,015 | py | Python | pygita/exceptions.py | TheShubhendra/gita | 955bade9699eba52df4f8598b73965fd685f6a62 | [
"MIT"
] | 2 | 2020-09-08T09:38:18.000Z | 2020-09-08T14:02:20.000Z | pygita/exceptions.py | TheShubhendra/gita | 955bade9699eba52df4f8598b73965fd685f6a62 | [
"MIT"
] | 2 | 2020-09-10T13:44:58.000Z | 2021-02-14T13:21:04.000Z | pygita/exceptions.py | TheShubhendra/gita | 955bade9699eba52df4f8598b73965fd685f6a62 | [
"MIT"
] | 1 | 2020-09-08T14:11:36.000Z | 2020-09-08T14:11:36.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Module of execption classes."""
| 18.125 | 59 | 0.697537 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Module of execption classes."""
class PygitaException(Exception):
"""Base class for exceptions."""
pass
class ServerConnectionError(PygitaException):
"""Unable to connect with server."""
pass
class BadRequestError(PygitaException):
"""Bad Request... | 0 | 0 | 0 | 745 | 0 | 0 | 0 | 0 | 184 |
999c50952c81375eab6cf8a8eec2113e039cc3c8 | 16,240 | py | Python | legacy/builder/app.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | 106 | 2020-04-28T10:24:08.000Z | 2022-03-15T02:30:27.000Z | legacy/builder/app.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | 6,808 | 2020-05-01T04:13:43.000Z | 2021-06-23T08:04:02.000Z | legacy/builder/app.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | 86 | 2020-04-29T09:50:29.000Z | 2022-01-25T05:42:44.000Z | import os
import pathlib
import subprocess
from pathlib import Path
from ruamel.yaml import YAML
yaml = YAML()
allowed = {'name', 'description', 'author', 'url', 'documentation', 'version', 'vendor', 'license', 'avatar',
'platform', 'update', 'keywords'}
required = {'name', 'description'}
sver_regex = r'^(... | 36.008869 | 119 | 0.602094 | import argparse
import json
import os
import pathlib
import re
import shutil
import subprocess
import unicodedata
from datetime import datetime
from pathlib import Path
from ruamel.yaml import YAML
yaml = YAML()
allowed = {'name', 'description', 'author', 'url', 'documentation', 'version', 'vendor', 'license', 'avata... | 0 | 0 | 0 | 0 | 0 | 13,522 | 0 | -31 | 661 |
e8ccbbbcbf5cbf8f59c3f4071a13661ce56fb984 | 2,395 | py | Python | ForgeImporters/forgeimporters/trac/tests/functional/test_trac.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | 113 | 2015-03-25T10:33:37.000Z | 2022-02-16T20:55:06.000Z | ForgeImporters/forgeimporters/trac/tests/functional/test_trac.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | 4 | 2017-08-04T16:19:07.000Z | 2020-06-08T19:01:33.000Z | ForgeImporters/forgeimporters/trac/tests/functional/test_trac.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | 36 | 2015-08-14T16:27:39.000Z | 2022-02-16T20:54:35.000Z | # 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 (t... | 41.293103 | 122 | 0.653027 | # 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 (t... | 0 | 0 | 0 | 1,252 | 0 | 0 | 0 | 59 | 134 |
ba6d51edfc2d52f436a405e353afabcb94284ceb | 1,153 | py | Python | app/__init__.py | tahmidk/wn-customtrans | b1926d5a4239e5f3da95ba67958cae95d9b714af | [
"BSD-3-Clause"
] | 1 | 2020-07-29T22:55:18.000Z | 2020-07-29T22:55:18.000Z | app/__init__.py | tahmidk/wn-customtrans | b1926d5a4239e5f3da95ba67958cae95d9b714af | [
"BSD-3-Clause"
] | 1 | 2021-03-31T19:59:34.000Z | 2021-03-31T19:59:34.000Z | app/__init__.py | tahmidk/wn-customtrans | b1926d5a4239e5f3da95ba67958cae95d9b714af | [
"BSD-3-Clause"
] | null | null | null | #=======================================================================
# Copyright (c) 2020, Tahmid Khan
# All rights reserved.
#
# Licensed under the BSD 3-Clause license found in the LICENSE file
#=======================================================================
from flask import Flask
from flask_wtf.csrf... | 31.162162 | 72 | 0.673027 | #=======================================================================
# Copyright (c) 2020, Tahmid Khan
# All rights reserved.
#
# Licensed under the BSD 3-Clause license found in the LICENSE file
#=======================================================================
from flask import Flask
from flask_wtf.csrf... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
477ba15a71ce3ce39ce852ea35d95162791229c9 | 4,192 | py | Python | anuvaad-etl/anuvaad-extractor/document-processor/gv-document-digitization/config.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | anuvaad-etl/anuvaad-extractor/document-processor/gv-document-digitization/config.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | anuvaad-etl/anuvaad-extractor/document-processor/gv-document-digitization/config.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | #import logging
import os
DEBUG = False
API_URL_PREFIX = "/anuvaad-etl/document-processor/gv-document-digitization"
HOST = '0.0.0.0'
PORT = 5001
BASE_DIR = 'upload'
#BASE_DIR = '/home/naresh/anuvaad/anuvaad-etl/anuvaad-extractor/document-processor/gv-document-digitization/upload'
download_folder = 'upload'
... | 35.226891 | 120 | 0.741889 | #import logging
import os
import time
DEBUG = False
API_URL_PREFIX = "/anuvaad-etl/document-processor/gv-document-digitization"
HOST = '0.0.0.0'
PORT = 5001
BASE_DIR = 'upload'
#BASE_DIR = '/home/naresh/anuvaad/anuvaad-etl/anuvaad-extractor/document-processor/gv-document-digitization/upload'
download_folder ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
3cbf989769cd921a207cc56e8b8bab902cfa84ee | 1,354 | py | Python | plot_worldcat_eng.py | mccalluc/cs-classics | f9756199ff8ab4489c34dc941bf98ac172113ae2 | [
"MIT"
] | null | null | null | plot_worldcat_eng.py | mccalluc/cs-classics | f9756199ff8ab4489c34dc941bf98ac172113ae2 | [
"MIT"
] | null | null | null | plot_worldcat_eng.py | mccalluc/cs-classics | f9756199ff8ab4489c34dc941bf98ac172113ae2 | [
"MIT"
] | null | null | null | import seaborn as sns
import matplotlib.pyplot as plt
import sys
import pandas
from cycler import cycler
if __name__ == '__main__':
dfs = {}
files = sys.argv[1:]
for file in files:
df = pandas.read_csv(file, sep='\t').set_index(['file'])
print(file)
print(df)
every_fifth = ... | 29.434783 | 76 | 0.574594 | import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import sys
import pandas
import re
from cycler import cycler
if __name__ == '__main__':
dfs = {}
files = sys.argv[1:]
for file in files:
df = pandas.read_csv(file, sep='\t').set_index(['file'])
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 45 |
3fb5d86c0329ed69ac96be3aa70700ad9bdefaaf | 25,007 | py | Python | api/tacticalrmm/agents/models.py | meyerje/tacticalrmm | 40a68bafb6ee85de586c23b9c3f7387553188eed | [
"MIT"
] | null | null | null | api/tacticalrmm/agents/models.py | meyerje/tacticalrmm | 40a68bafb6ee85de586c23b9c3f7387553188eed | [
"MIT"
] | null | null | null | api/tacticalrmm/agents/models.py | meyerje/tacticalrmm | 40a68bafb6ee85de586c23b9c3f7387553188eed | [
"MIT"
] | null | null | null | from loguru import logger
from django.conf import settings
logger.configure(**settings.LOG_CONFIG)
RECOVERY_CHOICES = [
("salt", "Salt"),
("mesh", "Mesh"),
("command", "Command"),
]
| 34.731944 | 100 | 0.583277 | import requests
import datetime as dt
import time
import base64
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Hash import SHA3_384
from Crypto.Util.Padding import pad
import validators
import random
import re
import string
from collections import Counter
from loguru import logger
... | 0 | 5,205 | 0 | 18,963 | 0 | 0 | 0 | 81 | 557 |
fbfe85705a9ae51b9f14d0bbfd251e09b903a3bd | 1,784 | py | Python | src/gym-timer/gymtimer.py | coseguera/gym-timer | 6d98f8e25d3329b8ed9a2de0a8e432b9293aa746 | [
"MIT"
] | null | null | null | src/gym-timer/gymtimer.py | coseguera/gym-timer | 6d98f8e25d3329b8ed9a2de0a8e432b9293aa746 | [
"MIT"
] | null | null | null | src/gym-timer/gymtimer.py | coseguera/gym-timer | 6d98f8e25d3329b8ed9a2de0a8e432b9293aa746 | [
"MIT"
] | null | null | null |
# EMOM style
# Tabata style
| 27.875 | 78 | 0.607623 | import time
from gyminput import check_input
from gymdisplay import set_display, set_display_individual
from gymbuzz import beep
def up_timer(max_second, refresh_rate):
start = time.time()
while True:
if check_input():
return False
current = int(time.time() - start)
set_dis... | 0 | 0 | 0 | 0 | 0 | 1,511 | 0 | 41 | 202 |
6188ded3ffa857cd0f8368f3d04cd70d3a1933c2 | 6,410 | py | Python | tests/python/pants_test/backend/python/tasks/test_python_binary_create.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | tests/python/pants_test/backend/python/tasks/test_python_binary_create.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/python/tasks/test_python_binary_create.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
| 34.278075 | 98 | 0.584399 | # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import subprocess
from textwrap import dedent
from colors import blue
from pants.backend.python.tasks.gather_sources import GatherSources
from pants.backend.python.tasks.python... | 0 | 128 | 0 | 5,621 | 0 | 0 | 0 | 283 | 246 |
3c873a8aad87f6ca72e20a3f861bc336c82499dc | 800 | py | Python | optipy/GetVersionsList.py | GoodDay360/OptiPy | d67c8cbe40dc85dc6a313804763b1db2a0b727fa | [
"MIT"
] | 4 | 2021-12-20T08:14:40.000Z | 2021-12-24T13:19:32.000Z | optipy/GetVersionsList.py | GoodDay360/Optifine-API | d67c8cbe40dc85dc6a313804763b1db2a0b727fa | [
"MIT"
] | null | null | null | optipy/GetVersionsList.py | GoodDay360/Optifine-API | d67c8cbe40dc85dc6a313804763b1db2a0b727fa | [
"MIT"
] | 1 | 2022-02-11T01:51:59.000Z | 2022-02-11T01:51:59.000Z | import warnings
# This use to ignore sorting *LooseVersion.
# You can remove it if you want.
warnings.filterwarnings('ignore')
| 38.095238 | 90 | 0.6925 | import requests,json,warnings
from distutils.version import LooseVersion
# This use to ignore sorting *LooseVersion.
# You can remove it if you want.
warnings.filterwarnings('ignore')
def getversionlist():
url = "https://nitroxenon-minecraft-forge-v1.p.rapidapi.com/optifine/versionlist"
headers = {
'x... | 0 | 0 | 0 | 0 | 0 | 592 | 0 | 35 | 45 |
530c6862017458ecef21be038aa7d1801d12b9f9 | 259 | py | Python | org/tact/city.py | purnimasurya/python-personal-archive | d0198f1d35b5a62efb392f134a8341e8063c9df5 | [
"MIT"
] | null | null | null | org/tact/city.py | purnimasurya/python-personal-archive | d0198f1d35b5a62efb392f134a8341e8063c9df5 | [
"MIT"
] | null | null | null | org/tact/city.py | purnimasurya/python-personal-archive | d0198f1d35b5a62efb392f134a8341e8063c9df5 | [
"MIT"
] | null | null | null |
get_friendship_meter('sam', 'purnima') | 25.9 | 44 | 0.640927 | import random as r
def get_friendship_meter(name1, name2):
print('Your Name : ', name1)
print("Your friend Name : ", name2)
meter = r.randint(1, 100)
print("Your friendship meter : ", meter)
get_friendship_meter('sam', 'purnima') | 0 | 0 | 0 | 0 | 0 | 174 | 0 | -3 | 45 |
8ba59c942769832e081b922adf3072d237669628 | 14,852 | py | Python | tests/test_data_loader.py | lzamparo/SeqDemote | 3eaf18e88c9dc6a3d1a69444ecdba9f9b5d9682a | [
"MIT"
] | 1 | 2019-04-16T12:25:09.000Z | 2019-04-16T12:25:09.000Z | tests/test_data_loader.py | lzamparo/SeqDemote | 3eaf18e88c9dc6a3d1a69444ecdba9f9b5d9682a | [
"MIT"
] | null | null | null | tests/test_data_loader.py | lzamparo/SeqDemote | 3eaf18e88c9dc6a3d1a69444ecdba9f9b5d9682a | [
"MIT"
] | null | null | null | import load
from nose.tools import eq_, ok_
from nose import SkipTest
import os
import numpy as np
### Basset DNase data fixtures
path = os.path.expanduser("~/projects/SeqDemote/data/DNase/encode_roadmap_all.h5")
chunk_size = 4096
batch_size = 128
batch_train_shape = (batch_size,4,1,600)
basset_train_size = 3201397... | 39.817694 | 112 | 0.701387 | import load
from utils import dna_io
from nose.tools import eq_, ok_
from nose import SkipTest
import nose, functools
import os
import numpy as np
def expected_failure(test):
@functools.wraps(test)
def inner(*args, **kwargs):
try:
test(*args, **kwargs)
except Exception:
... | 0 | 205 | 0 | 0 | 0 | 4,451 | 0 | 4 | 237 |
71b54a6000a48a4ba77c8b8a9d192cd697ecdb5a | 204 | py | Python | 21-Social_Clone_Project/simplesocial_Practice/groups/admin.py | andy2167565/Django-Bootcamp-Practice | f08d2866382db96060450d4dbd1ffaca7243f623 | [
"MIT"
] | null | null | null | 21-Social_Clone_Project/simplesocial_Practice/groups/admin.py | andy2167565/Django-Bootcamp-Practice | f08d2866382db96060450d4dbd1ffaca7243f623 | [
"MIT"
] | null | null | null | 21-Social_Clone_Project/simplesocial_Practice/groups/admin.py | andy2167565/Django-Bootcamp-Practice | f08d2866382db96060450d4dbd1ffaca7243f623 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
# Register your models here.
admin.site.register(models.Group)
| 22.666667 | 46 | 0.764706 | from django.contrib import admin
from . import models
# Register your models here.
class GroupMemberInline(admin.TabularInline):
model = models.GroupMember
admin.site.register(models.Group)
| 0 | 0 | 0 | 56 | 0 | 0 | 0 | 0 | 23 |
1697e5e0d59f2413269daa35cd57e6e3fdeec042 | 2,082 | py | Python | spotify.py | codybenlewis/Personal-Data-Server | c8d57cb490cf398e11ef173c62ae1f36755e01a2 | [
"Apache-2.0"
] | null | null | null | spotify.py | codybenlewis/Personal-Data-Server | c8d57cb490cf398e11ef173c62ae1f36755e01a2 | [
"Apache-2.0"
] | null | null | null | spotify.py | codybenlewis/Personal-Data-Server | c8d57cb490cf398e11ef173c62ae1f36755e01a2 | [
"Apache-2.0"
] | null | null | null | import spotipy.util as util
| 31.074627 | 168 | 0.60951 | import sys
import spotipy
import spotipy.util as util
import time
import keys
def gettoken():
scope = keys.spotifyscope
token = util.prompt_for_user_token(keys.spotifyusername, scope, client_id=keys.spotifyclientid,client_secret=keys.spotifyclientsecret,redirect_uri=keys.redirecturl)
return token
def re... | 0 | 0 | 0 | 0 | 0 | 1,932 | 0 | -38 | 157 |
7a86d9e1c97956ef8278239ea99a6ef0b03f3a0a | 1,596 | py | Python | unittesting/helpers/temp_directory_test_case.py | evandroforks/UnitTesting | df202cd2d4d466a443e31944cf83c3a87c406f06 | [
"MIT"
] | 1 | 2018-12-08T21:44:48.000Z | 2018-12-08T21:44:48.000Z | unittesting/helpers/temp_directory_test_case.py | evandroforks/UnitTesting | df202cd2d4d466a443e31944cf83c3a87c406f06 | [
"MIT"
] | null | null | null | unittesting/helpers/temp_directory_test_case.py | evandroforks/UnitTesting | df202cd2d4d466a443e31944cf83c3a87c406f06 | [
"MIT"
] | null | null | null | from .. import DeferrableTestCase
| 30.692308 | 85 | 0.614662 | import sublime
import os
import shutil
import tempfile
from .. import DeferrableTestCase
class TempDirectoryTestCase(DeferrableTestCase):
"""Create a temp directory and open it."""
_temp_dir = None
@classmethod
def setUpClass(cls):
"""Create a temp directory for testing."""
cls._temp... | 0 | 1,333 | 0 | 150 | 0 | 0 | 0 | -33 | 111 |
6c4a500a16124687a0a6381a88ed920b1164fd36 | 3,163 | py | Python | tabint/performance.py | KienVu2368/taproc | 47752c367eefb42bf52876c30e9e9e6085029465 | [
"MIT"
] | 3 | 2019-02-07T14:37:08.000Z | 2020-01-23T12:54:46.000Z | tabint/performance.py | KienVu2368/taproc | 47752c367eefb42bf52876c30e9e9e6085029465 | [
"MIT"
] | 5 | 2020-07-25T09:33:19.000Z | 2020-07-25T09:39:15.000Z | tabint/performance.py | KienVu2368/taproc | 47752c367eefb42bf52876c30e9e9e6085029465 | [
"MIT"
] | 2 | 2019-09-16T07:43:10.000Z | 2019-10-31T08:46:38.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/11_performance.ipynb (unless otherwise specified).
__all__ = ['TBPerformace', 'actual_vs_predict', 'ReceiverOperatingCharacteristic', 'PrecisionRecall']
# Cell
# Cell
# Cell
# Cell
# Cell | 34.758242 | 101 | 0.655074 | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/11_performance.ipynb (unless otherwise specified).
__all__ = ['TBPerformace', 'actual_vs_predict', 'ReceiverOperatingCharacteristic', 'PrecisionRecall']
# Cell
import tabint
from .utils import *
from .dataset import *
from .visual import *
from .learner import *
from sk... | 0 | 1,272 | 0 | 1,348 | 0 | 0 | 0 | 7 | 295 |
d5d9c6cf626be2abb1306ad10201ce04d163c3e1 | 967 | py | Python | python_script/smbv3_compress.py | mellven/CVE2020-0796 | c1899088d7c28842142c1cbf081f7640d0244f35 | [
"Apache-2.0"
] | 58 | 2020-03-11T17:00:29.000Z | 2021-01-03T15:58:37.000Z | python_script/smbv3_compress.py | mellven/CVE2020-0796 | c1899088d7c28842142c1cbf081f7640d0244f35 | [
"Apache-2.0"
] | 1 | 2020-04-21T14:19:50.000Z | 2020-04-21T14:19:50.000Z | python_script/smbv3_compress.py | mellven/CVE2020-0796 | c1899088d7c28842142c1cbf081f7640d0244f35 | [
"Apache-2.0"
] | 14 | 2020-03-11T23:45:07.000Z | 2020-12-14T10:44:27.000Z | import struct
import socket
import sys
if len(sys.argv) != 2:
print("Usage: %s IP" % (sys.argv[0]))
exit()
smb_payload ="000000b2fe534d4240000100000000000000210010000000000000000000000000000000fffe00000000000000000000000000000000000000000000000000000000000024000500010000007f000000aa9952d87063ea118a76005056b886b07... | 33.344828 | 343 | 0.752844 | import struct
import socket
import sys
if len(sys.argv) != 2:
print("Usage: %s IP" % (sys.argv[0]))
exit()
smb_payload ="000000b2fe534d4240000100000000000000210010000000000000000000000000000000fffe00000000000000000000000000000000000000000000000000000000000024000500010000007f000000aa9952d87063ea118a76005056b886b07... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f3c239f6f5dbe93d680642c6c279fadb1109e178 | 4,853 | py | Python | GUI/apps/StatisticsApp/VisualizationWindow.py | IlyaKomutkov/SmartMed-1 | b6389cbf9240fa3ba909c0fe7eed6772d8b6b0df | [
"Apache-2.0"
] | 1 | 2021-04-16T18:52:11.000Z | 2021-04-16T18:52:11.000Z | GUI/apps/StatisticsApp/VisualizationWindow.py | IlyaKomutkov/SmartMed-1 | b6389cbf9240fa3ba909c0fe7eed6772d8b6b0df | [
"Apache-2.0"
] | null | null | null | GUI/apps/StatisticsApp/VisualizationWindow.py | IlyaKomutkov/SmartMed-1 | b6389cbf9240fa3ba909c0fe7eed6772d8b6b0df | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'VisualizationWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
| 59.182927 | 190 | 0.724088 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'VisualizationWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import ... | 692 | 0 | 0 | 4,138 | 0 | 0 | 0 | 21 | 46 |
c5ebb028c8df1a6d0a2c929b19e75bc2affaf98a | 312 | py | Python | Server/server.py | moreal/DMS-Backend | c0a3b28972739c58049a296570bb873f32c03eec | [
"MIT"
] | 27 | 2018-01-14T08:07:18.000Z | 2020-01-20T14:21:17.000Z | Server/server.py | moreal/DMS-Backend | c0a3b28972739c58049a296570bb873f32c03eec | [
"MIT"
] | 50 | 2018-02-12T12:51:33.000Z | 2018-08-28T00:48:31.000Z | Server/server.py | moreal/DMS-Backend | c0a3b28972739c58049a296570bb873f32c03eec | [
"MIT"
] | 10 | 2018-03-31T16:30:32.000Z | 2021-03-02T10:30:31.000Z | import os
from app import create_app
from config.production import ProductionConfig
if __name__ == '__main__':
app = create_app(ProductionConfig)
if 'SECRET_KEY' not in os.environ:
print('[WARN] SECRET KEY is not set in the environment variable !!')
app.run(**app.config['RUN_SETTING'])
| 22.285714 | 76 | 0.711538 | import os
from app import create_app
from config.production import ProductionConfig
if __name__ == '__main__':
app = create_app(ProductionConfig)
if 'SECRET_KEY' not in os.environ:
print('[WARN] SECRET KEY is not set in the environment variable !!')
app.run(**app.config['RUN_SETTING'])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c537c027d44eac0122e6c168897cab1dad9d6a1e | 17,375 | py | Python | espaloma/nn/readout/janossy.py | jeherr/espaloma | 1be88601f7d1307df283b6cd71714c3311e59f74 | [
"MIT"
] | 1 | 2020-02-13T01:26:36.000Z | 2020-02-13T01:26:36.000Z | espaloma/nn/readout/janossy.py | jeherr/espaloma | 1be88601f7d1307df283b6cd71714c3311e59f74 | [
"MIT"
] | 5 | 2020-02-17T23:38:58.000Z | 2020-03-04T23:01:06.000Z | espaloma/nn/readout/janossy.py | jeherr/espaloma | 1be88601f7d1307df283b6cd71714c3311e59f74 | [
"MIT"
] | null | null | null | # =============================================================================
# IMPORTS
# =============================================================================
# =============================================================================
# MODULE CLASSES
# =================================================... | 31.590909 | 171 | 0.418417 | # =============================================================================
# IMPORTS
# =============================================================================
import torch
import espaloma as esp
# =============================================================================
# MODULE CLASSES
# ============... | 0 | 0 | 0 | 16,848 | 0 | 0 | 0 | -8 | 182 |
e3f4e8f929a2f7b097047a834218a942ce88b609 | 382 | py | Python | tests/parser/syntax/test_minmax.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | 1 | 2020-07-04T01:47:26.000Z | 2020-07-04T01:47:26.000Z | tests/parser/syntax/test_minmax.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | tests/parser/syntax/test_minmax.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null |
fail_list = [
"""
@public
def foo():
y: int128 = min(7, 0x1234567890123456789012345678901234567890)
"""
]
| 18.190476 | 66 | 0.73822 | import pytest
from pytest import raises
from vyper import compiler
from vyper.exceptions import TypeMismatch
fail_list = [
"""
@public
def foo():
y: int128 = min(7, 0x1234567890123456789012345678901234567890)
"""
]
@pytest.mark.parametrize("bad_code", fail_list)
def test_block_fail(bad_code):
with ... | 0 | 129 | 0 | 0 | 0 | 0 | 0 | 21 | 112 |
1c35cd9adb0c85b88590392345e600e9bf237706 | 9,577 | py | Python | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | """
Super-resolution of CelebA using Generative Adversarial Networks.
The dataset can be downloaded from: https://www.dropbox.com/sh/8oqt9vytwxb3s4r/AADIKlz8PR9zr6Y20qbkunrba/Img/img_align_celeba.zip?dl=0
(if not available there see if options are listed at http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html)
Instrustion ... | 39.904167 | 173 | 0.677874 | """
Super-resolution of CelebA using Generative Adversarial Networks.
The dataset can be downloaded from: https://www.dropbox.com/sh/8oqt9vytwxb3s4r/AADIKlz8PR9zr6Y20qbkunrba/Img/img_align_celeba.zip?dl=0
(if not available there see if options are listed at http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html)
Instrustion ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 200 |
2e00d0144d057bd2a8a8eb374588f42fa1ff99ec | 1,397 | py | Python | alice_images/cli.py | AlekseevAV/alice-images | 28021320d9e6d48e7ef1f878e039b70002382fbc | [
"MIT"
] | null | null | null | alice_images/cli.py | AlekseevAV/alice-images | 28021320d9e6d48e7ef1f878e039b70002382fbc | [
"MIT"
] | null | null | null | alice_images/cli.py | AlekseevAV/alice-images | 28021320d9e6d48e7ef1f878e039b70002382fbc | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
cli()
| 25.4 | 118 | 0.695777 | import click
from . import alice_images_api as api
@click.group()
@click.option('--skill-id', prompt='Skill id', required=True, help='Alice skill id')
@click.option('--oauth-token', prompt='OAuth token', required=True, help='Account OAuth token')
@click.pass_context
def cli(ctx, skill_id, oauth_token):
ctx.ensur... | 0 | 1,186 | 0 | 0 | 0 | 0 | 0 | 7 | 160 |
964e8a35e49797201c71028bf40cb67484104661 | 724 | py | Python | Python/pixelTest.py | 4tronix/PiconPlus | 076c2afe6e5ec68cbff0e43423bdcd021afd761c | [
"MIT"
] | 1 | 2020-05-22T01:48:33.000Z | 2020-05-22T01:48:33.000Z | Python/pixelTest.py | 4tronix/PiconPlus | 076c2afe6e5ec68cbff0e43423bdcd021afd761c | [
"MIT"
] | null | null | null | Python/pixelTest.py | 4tronix/PiconPlus | 076c2afe6e5ec68cbff0e43423bdcd021afd761c | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# Picon Plus Fireled Test
# Flashes Fireleds attached to Fireled Output
# Press Ctrl-C to stop
from __future__ import print_function
from piconplus import PiconPlus
from time import sleep
pp = PiconPlus(0x24)
rev = pp.getRevision()
print ('Board:', rev[1], " Revision:", rev[0])
for i in rang... | 20.111111 | 47 | 0.621547 | #! /usr/bin/env python
# Picon Plus Fireled Test
# Flashes Fireleds attached to Fireled Output
# Press Ctrl-C to stop
from __future__ import print_function
from piconplus import PiconPlus
from time import sleep
pp = PiconPlus(0x24)
rev = pp.getRevision()
print ('Board:', rev[1], " Revision:", rev[0])
for i in rang... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
62fb30ff7a6fec2a361d6780e9e50a7cd3597e97 | 542 | py | Python | modulo_4/bloco_33/dia_2/excecoes.py | Gabriel-Goncalves/trybe-exercises | f652563499a540e2536276e97e94099b45def6c4 | [
"Xnet",
"X11"
] | null | null | null | modulo_4/bloco_33/dia_2/excecoes.py | Gabriel-Goncalves/trybe-exercises | f652563499a540e2536276e97e94099b45def6c4 | [
"Xnet",
"X11"
] | 3 | 2020-10-07T20:40:35.000Z | 2020-10-23T22:58:34.000Z | modulo_4/bloco_33/dia_2/excecoes.py | Gabriel-Goncalves/trybe-exercises | f652563499a540e2536276e97e94099b45def6c4 | [
"Xnet",
"X11"
] | null | null | null | while True:
try:
x = int(input("Please enter a number: "))
break
except ValueError:
print("Oops! That was no valid number. Try again...")
try:
arquivo = open("arquivo.txt", "r")
except OSError:
# ser executado caso haja uma exceo
print("arquivo inexistente")
else:
# s... | 25.809524 | 63 | 0.656827 | while True:
try:
x = int(input("Please enter a number: "))
break
except ValueError:
print("Oops! That was no valid number. Try again...")
try:
arquivo = open("arquivo.txt", "r")
except OSError:
# será executado caso haja uma exceção
print("arquivo inexistente")
else:
... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c18fedf84168ca2571938bd0aa8885432deaab24 | 773 | py | Python | languages/python/topics/regex/P010_ReModule_FindIter.py | lakshmikanth-tesla/DeveloperNotes2Myself | 9a5dad930ddbb99ace46d2d672109e8553aecbc2 | [
"MIT"
] | 2 | 2019-05-25T10:09:00.000Z | 2022-03-11T09:06:23.000Z | languages/python/topics/regex/P010_ReModule_FindIter.py | lakshmikanth-tesla/DeveloperNotes2Myself | 9a5dad930ddbb99ace46d2d672109e8553aecbc2 | [
"MIT"
] | 2 | 2020-03-31T04:30:17.000Z | 2020-10-30T07:54:28.000Z | languages/python/topics/regex/P010_ReModule_FindIter.py | lakshmikanth-tesla/DeveloperNotes2Myself | 9a5dad930ddbb99ace46d2d672109e8553aecbc2 | [
"MIT"
] | 4 | 2019-07-12T13:18:56.000Z | 2021-11-17T08:04:55.000Z | # Description: The re.findall Function
import re
"""
Note
1. The syntax: re.finditer(pattern, string, flags=0)
2. This function returns an iterator yielding MatchObject instances over all non-overlapping matches for the RE pattern
in the string. The string is scanned left-to-right, and matches are returned in the ... | 45.470588 | 119 | 0.72445 | # Description: The re.findall Function
import re
"""
Note
1. The syntax: re.finditer(pattern, string, flags=0)
2. This function returns an iterator yielding MatchObject instances over all non-overlapping matches for the RE pattern
in the string. The string is scanned left-to-right, and matches are returned in the ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abfdc84bb2de8d38cae9adfd44094e3625994fd6 | 1,042 | py | Python | Bugscan_exploits-master/exp_list/exp-1896.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-1896.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-1896.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/python
#-*- encoding:utf-8 -*-
#title:workyi_Talent system SQL injection
#author: xx00
#ref: http://www.wooyun.org/bugs/wooyun-2010-065810
if __name__ == '__main__':
audit(assign('kxmail', 'http://mail.cdzk.org:8888/')[1]) | 40.076923 | 173 | 0.628599 | #!/usr/bin/python
#-*- encoding:utf-8 -*-
#title:workyi_Talent system SQL injection
#author: xx00
#ref: http://www.wooyun.org/bugs/wooyun-2010-065810
def assign(service, arg):
if service == "kxmail":
return True, arg
def audit(arg):
url = arg + 'prog/get_passwd.server.php'
postdata... | 0 | 0 | 0 | 0 | 0 | 714 | 0 | -2 | 77 |
81ab7d7a750e4d5fd91877601881aa572db7f80b | 9,514 | py | Python | twincons/twcParseAlnDatabase.py | sbliven/AlignmentScore | 2bdb143b34d79f0fdb710fd38f5d527a67bb0579 | [
"MIT"
] | null | null | null | twincons/twcParseAlnDatabase.py | sbliven/AlignmentScore | 2bdb143b34d79f0fdb710fd38f5d527a67bb0579 | [
"MIT"
] | null | null | null | twincons/twcParseAlnDatabase.py | sbliven/AlignmentScore | 2bdb143b34d79f0fdb710fd38f5d527a67bb0579 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Crete mafft combination commands from directory with alignments."""
import os, re, sys, itertools, glob
sys.path.append(os.path.dirname(os.path.abspath(__name__)))
def read_parse_doc_file(prosite_path):
'''
Reads the doc file from PROSITE and creates a dictionary of keys PDCs and values a l... | 41.008621 | 123 | 0.729767 | #!/usr/bin/env python3
"""Crete mafft combination commands from directory with alignments."""
import os, re, sys, argparse, itertools, glob
sys.path.append(os.path.dirname(os.path.abspath(__name__)))
def create_and_parse_argument_options(argument_list):
parser = argparse.ArgumentParser(description='Merge alignments f... | 0 | 0 | 0 | 0 | 0 | 2,426 | 0 | 10 | 92 |
ffd90d9edcc5e1ae73756b3e8e97057be8a38abe | 4,443 | py | Python | trimimagetopdf.py | zvezdochiot/python-trimimagetopdf | 829f494ac104578654131bccde9da1047b16092f | [
"Apache-2.0"
] | null | null | null | trimimagetopdf.py | zvezdochiot/python-trimimagetopdf | 829f494ac104578654131bccde9da1047b16092f | [
"Apache-2.0"
] | null | null | null | trimimagetopdf.py | zvezdochiot/python-trimimagetopdf | 829f494ac104578654131bccde9da1047b16092f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 29.039216 | 122 | 0.580464 | #!/usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 0 | 0 | 0 | 0 | 0 | 362 | 0 | 0 | 69 |
fd99b37960524d9a4e45c5e23424f658cd26e9c0 | 1,270 | py | Python | saude/imc.py | Lu939/caucular_imc | 69199f7b5ec855d8341becc6954a7c70e4ac0b9c | [
"MIT"
] | null | null | null | saude/imc.py | Lu939/caucular_imc | 69199f7b5ec855d8341becc6954a7c70e4ac0b9c | [
"MIT"
] | null | null | null | saude/imc.py | Lu939/caucular_imc | 69199f7b5ec855d8341becc6954a7c70e4ac0b9c | [
"MIT"
] | null | null | null | pessoa = dict()
numero_pessoas = abaixo_peso = normal = sobrepeso = obesidade = obesidade_grave = 0
while True:
pessoa['nome'] = str(input('Digite o nome:')).strip().upper()
numero_pessoas += 1
pessoa['peso'] = float(input('Digite o peso:'))
pessoa['altura'] = float(input('Digite a altura'))
pessoa[... | 42.333333 | 114 | 0.595276 | pessoa = dict()
numero_pessoas = abaixo_peso = normal = sobrepeso = obesidade = obesidade_grave = 0
while True:
pessoa['nome'] = str(input('Digite o nome:')).strip().upper()
numero_pessoas += 1
pessoa['peso'] = float(input('Digite o peso:'))
pessoa['altura'] = float(input('Digite a altura'))
pessoa[... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9e166c465dc898d3817b46d9013e0aab960ca510 | 12,062 | py | Python | oldassyrian/search.py | sethbam9/tutorials | c259636682304cb516e9048ca8df5a3ab92c62cc | [
"MIT"
] | 2 | 2019-07-17T18:51:26.000Z | 2019-07-24T19:45:23.000Z | oldassyrian/search.py | sethbam9/tutorials | c259636682304cb516e9048ca8df5a3ab92c62cc | [
"MIT"
] | 3 | 2019-01-16T10:56:50.000Z | 2020-11-16T16:30:48.000Z | oldassyrian/search.py | sethbam9/tutorials | c259636682304cb516e9048ca8df5a3ab92c62cc | [
"MIT"
] | 2 | 2020-12-17T15:41:33.000Z | 2021-11-03T18:23:07.000Z | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# <img align="right" src="images/tf.png" width="128"/>... | 27.476082 | 114 | 0.693666 | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# <img align="right" src="images/tf.png" width="128"/>... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
56033897138ef853bc12056f10459e1efe446441 | 4,581 | py | Python | phenotrex/ml/prediction.py | univieCUBE/PICA2 | 59b72fa1ff00692af2fd4ca59d1514599238e2e5 | [
"MIT"
] | 2 | 2019-10-18T16:05:25.000Z | 2019-10-31T08:49:10.000Z | phenotrex/ml/prediction.py | univieCUBE/PICA2 | 59b72fa1ff00692af2fd4ca59d1514599238e2e5 | [
"MIT"
] | 11 | 2019-08-27T14:26:38.000Z | 2019-10-29T21:23:41.000Z | phenotrex/ml/prediction.py | univieCUBE/PICA2 | 59b72fa1ff00692af2fd4ca59d1514599238e2e5 | [
"MIT"
] | 1 | 2019-10-15T07:27:03.000Z | 2019-10-15T07:27:03.000Z | import os
import pandas as pd
from phenotrex.io.flat import load_genotype_file, DEFAULT_TRAIT_SIGN_MAPPING
from phenotrex.io.serialization import load_classifier
from phenotrex.ml.shap_handler import ShapHandler
try:
from phenotrex.transforms import fastas_to_grs
except ModuleNotFoundError:
from phenotrex.uti... | 44.911765 | 101 | 0.701594 | import os
import pandas as pd
from phenotrex.io.flat import load_genotype_file, DEFAULT_TRAIT_SIGN_MAPPING
from phenotrex.io.serialization import load_classifier
from phenotrex.ml.shap_handler import ShapHandler
try:
from phenotrex.transforms import fastas_to_grs
except ModuleNotFoundError:
from phenotrex.uti... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0dce7bab6304a1350a831dcdc3ebc8503e68c68a | 627 | py | Python | yandex/yandex_SHBR/E/E.py | andrey19972004/algorithms_structures | 77060790211182cf9d9f9c50682a771ffaee9e96 | [
"MIT"
] | null | null | null | yandex/yandex_SHBR/E/E.py | andrey19972004/algorithms_structures | 77060790211182cf9d9f9c50682a771ffaee9e96 | [
"MIT"
] | null | null | null | yandex/yandex_SHBR/E/E.py | andrey19972004/algorithms_structures | 77060790211182cf9d9f9c50682a771ffaee9e96 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 23.222222 | 59 | 0.488038 | import sqlite3
def main():
name = input()
sql_cond_1 = input()
sql_cond_2 = input()
sql_sort_column = input()
conn = sqlite3.connect(name)
cursor = conn.cursor()
sql_command = "SELECT condition " \
"FROM Talks " \
"WHERE {} AND {} " \
... | 0 | 0 | 0 | 0 | 0 | 548 | 0 | -7 | 45 |
d04acef46dd29dff34caa965190df7a3b1b2e151 | 2,535 | py | Python | solver.py | BTrDung/Solving-Peg-Solitaire-by-using-back-tracking | e86c40561769b4838a76d98455174bda9d9c2d5d | [
"MIT"
] | 4 | 2021-04-22T14:02:24.000Z | 2021-04-22T14:11:05.000Z | solver.py | BTrDung/Solving-Peg-Solitaire-by-using-back-tracking | e86c40561769b4838a76d98455174bda9d9c2d5d | [
"MIT"
] | null | null | null | solver.py | BTrDung/Solving-Peg-Solitaire-by-using-back-tracking | e86c40561769b4838a76d98455174bda9d9c2d5d | [
"MIT"
] | 1 | 2021-07-21T06:56:59.000Z | 2021-07-21T06:56:59.000Z |
ans = solveWithBackTracking(7, 7) | 32.922078 | 102 | 0.426036 | import collections
import heapq
import numpy as np
def updateState(state, x, y, x1, y1, x2, y2):
newState = [[j for j in i] for i in state]
newState[x][y] = 0
newState[x + x1][y + y1] = 0
newState[x + x2][y + y2] = 1
return newState
def updateAnswer(ans, x, y, type):
newAns = [i for i i... | 0 | 0 | 0 | 0 | 0 | 2,353 | 0 | -15 | 161 |
649e1e58fb88ce6a713f6ace82938bd4fcb82038 | 4,514 | py | Python | src/fedoidcmsg/utils.py | sklemer1/fedoidcmsg | b5e48de7a2e55c93915df1b274770134e77888c8 | [
"Apache-2.0"
] | 1 | 2018-05-09T20:47:06.000Z | 2018-05-09T20:47:06.000Z | src/fedoidcmsg/utils.py | sklemer1/fedoidcmsg | b5e48de7a2e55c93915df1b274770134e77888c8 | [
"Apache-2.0"
] | null | null | null | src/fedoidcmsg/utils.py | sklemer1/fedoidcmsg | b5e48de7a2e55c93915df1b274770134e77888c8 | [
"Apache-2.0"
] | 1 | 2018-10-04T13:55:58.000Z | 2018-10-04T13:55:58.000Z | import json
from cryptojwt.utils import as_unicode
from cryptojwt.jws.jws import factory
from fedoidcmsg import MetadataStatement
from fedoidcmsg.bundle import jwks_to_keyjar
from oidcmsg.oidc import JsonWebToken
from cryptojwt.jwt import JWT
def self_sign_jwks(keyjar, iss, kid='', lifetime=3600):
"""
Crea... | 27.52439 | 78 | 0.649756 | import json
from cryptojwt.utils import as_unicode
from cryptojwt.jws.utils import alg2keytype
from cryptojwt.jws.jws import JWS
from cryptojwt.jws.jws import factory
from fedoidcmsg import MetadataStatement
from fedoidcmsg.bundle import jwks_to_keyjar
from oidcmsg.oidc import JsonWebToken
from cryptojwt.jwt import ... | 0 | 0 | 0 | 0 | 0 | 742 | 0 | 34 | 113 |
bb407f307d87822f34cefdfea6fb39b5cf550aec | 909 | py | Python | 2017/python/day8.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | 2017/python/day8.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | 2017/python/day8.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | import re
registers = {}
MAX_VAL = 0
instruction_re = re.compile("([a-z]+) (inc|dec) (-*\d+) if ([a-z]+) (.+ -*\d+)")
with open("inputs/day8.txt") as f:
for line in f:
line = line.strip()
(register, command, value, condition_register, condition) = instruction_re.match(line).groups()
expre... | 28.40625 | 103 | 0.627063 | import re
registers = {}
MAX_VAL = 0
def get_register(name):
return registers.get(name, 0)
def update_register(register, value, command):
new_val = None
if command == "inc":
new_val = get_register(register) + int(value)
else:
new_val = get_register(register) - int(value)
glob... | 0 | 0 | 0 | 0 | 0 | 322 | 0 | 0 | 46 |
a073a59f0a69c5833133b2e69d1f568e2233d96f | 511 | py | Python | zenml/tests/preprocessing/test_dates.py | bobbywlindsey/data-science | 8c67abd75a1f70ce37a04aff074cc3416260a296 | [
"MIT"
] | 1 | 2018-07-17T08:23:29.000Z | 2018-07-17T08:23:29.000Z | zenml/tests/preprocessing/test_dates.py | bobbywlindsey/zenml | 8c67abd75a1f70ce37a04aff074cc3416260a296 | [
"MIT"
] | null | null | null | zenml/tests/preprocessing/test_dates.py | bobbywlindsey/zenml | 8c67abd75a1f70ce37a04aff074cc3416260a296 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 31.9375 | 82 | 0.727984 | import unittest
import pandas as pd
from pandas.testing import assert_frame_equal
from zenml.preprocessing import parse_date
from zenml.utils import array_to_series
class TestDates(unittest.TestCase):
def test_parse_date(self):
date_series = array_to_series(['2018-05-10', '1990-04-10'])
result = p... | 0 | 0 | 0 | 274 | 0 | 0 | 0 | 61 | 111 |
264d9f6e1fde805f979209c779de76b3e19fefa7 | 1,261 | py | Python | data/process_data/tafeng.py | easonwhite928/DSNTSP | fb3ad1b20cd6d3adf22f8ecc10a9c79becc08a3d | [
"MIT"
] | 4 | 2020-09-01T09:09:35.000Z | 2021-08-24T02:16:52.000Z | data/process_data/tafeng.py | easonwhite928/DSNTSP | fb3ad1b20cd6d3adf22f8ecc10a9c79becc08a3d | [
"MIT"
] | null | null | null | data/process_data/tafeng.py | easonwhite928/DSNTSP | fb3ad1b20cd6d3adf22f8ecc10a9c79becc08a3d | [
"MIT"
] | 1 | 2020-11-23T15:09:04.000Z | 2020-11-23T15:09:04.000Z |
TA_FENG_PATH = 'data/tafeng/tafeng.csv'
TA_FENG_OUTPUT = 'tafeng'
TA_FENG_USER_COL = 'CUSTOMER_ID'
TA_FENG_TIME_COL = 'TRANSACTION_DT'
TA_FENG_ITEM_COL = 'PRODUCT_ID'
TA_FENG_ITEM_TYPE_COL = 'PRODUCT_SUBCLASS'
TA_FENG_TIME_FORMAT = '%m/%d/%Y'
TA_FENG_MIN_ITEM_CNT = 10
TA_FENG_MIN_USER_ITEM_CNT = 10
TA_FENG_MAX_USER_IT... | 36.028571 | 98 | 0.707375 | import pandas as pd
from data.process_data.process_data import process_data
TA_FENG_PATH = 'data/tafeng/tafeng.csv'
TA_FENG_OUTPUT = 'tafeng'
TA_FENG_USER_COL = 'CUSTOMER_ID'
TA_FENG_TIME_COL = 'TRANSACTION_DT'
TA_FENG_ITEM_COL = 'PRODUCT_ID'
TA_FENG_ITEM_TYPE_COL = 'PRODUCT_SUBCLASS'
TA_FENG_TIME_FORMAT = '%m/%d/%Y'
... | 0 | 0 | 0 | 0 | 0 | 729 | 0 | 32 | 67 |
6ab405a6a234b2eb2ec0493292524e997e580a37 | 15,209 | py | Python | silx/gui/plot/ScatterView.py | linupi/silx | 51bc5cbc696880e7cf13feb3ff2476a5c32422d4 | [
"CC0-1.0",
"MIT"
] | 1 | 2019-11-29T20:45:36.000Z | 2019-11-29T20:45:36.000Z | silx/gui/plot/ScatterView.py | linupi/silx | 51bc5cbc696880e7cf13feb3ff2476a5c32422d4 | [
"CC0-1.0",
"MIT"
] | null | null | null | silx/gui/plot/ScatterView.py | linupi/silx | 51bc5cbc696880e7cf13feb3ff2476a5c32422d4 | [
"CC0-1.0",
"MIT"
] | null | null | null | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2018-2020 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | 37.833333 | 99 | 0.628772 | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2018-2020 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | 0 | 922 | 0 | 12,275 | 0 | 0 | 0 | 140 | 268 |
30b2fcda38e3f910b4f7c7212fb480217de14864 | 301 | py | Python | pytest/mod.py | free31jafar/Zeref | 9cfe9f2e753e6d30d974ced6177080575635e17c | [
"MIT"
] | null | null | null | pytest/mod.py | free31jafar/Zeref | 9cfe9f2e753e6d30d974ced6177080575635e17c | [
"MIT"
] | null | null | null | pytest/mod.py | free31jafar/Zeref | 9cfe9f2e753e6d30d974ced6177080575635e17c | [
"MIT"
] | null | null | null |
__all__ = ["mod"]
| 18.8125 | 69 | 0.671096 | import pytest
from redbot.core import modlog
__all__ = ["mod"]
@pytest.fixture
def mod(config, monkeypatch):
from redbot.core import Config
with monkeypatch.context() as m:
m.setattr(Config, "get_conf", lambda *args, **kwargs: config)
modlog._init()
return modlog
| 0 | 213 | 0 | 0 | 0 | 0 | 0 | 1 | 67 |
91084c0b35623a5cb2cfa5df167df5c11454f34d | 5,008 | py | Python | Source/main.py | albert-espin/random-forest | 43634f54da2f682225f4f60406bb61b98ae2cacd | [
"MIT"
] | null | null | null | Source/main.py | albert-espin/random-forest | 43634f54da2f682225f4f60406bb61b98ae2cacd | [
"MIT"
] | null | null | null | Source/main.py | albert-espin/random-forest | 43634f54da2f682225f4f60406bb61b98ae2cacd | [
"MIT"
] | null | null | null | import math
import os
import numpy as np
# printing modifiers
PRINT_BOLD_COLOR = "\033[1m"
PRINT_DISABLE_COLOR = "\033[0m"
def clear_file(file_name):
"""Clear the contents of a file"""
# clear any previous content in the file
open(file_name, "w").close()
def print_and_write(message, file_name):
... | 38.821705 | 257 | 0.689297 | import math
import os
import numpy as np
from pathlib import Path
from data_functions import *
from random_forest import *
# printing modifiers
PRINT_BOLD_COLOR = "\033[1m"
PRINT_DISABLE_COLOR = "\033[0m"
def clear_file(file_name):
"""Clear the contents of a file"""
# clear any previous content in the f... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 66 |
0af90b19eed8c3b9a0d0ff0972427fa2fd9f877e | 4,091 | py | Python | ops/config.py | sebohe/Meson-plugin | 14a2fec09b8609df59737a510794ad8bc1bd0a93 | [
"Apache-2.0"
] | null | null | null | ops/config.py | sebohe/Meson-plugin | 14a2fec09b8609df59737a510794ad8bc1bd0a93 | [
"Apache-2.0"
] | null | null | null | ops/config.py | sebohe/Meson-plugin | 14a2fec09b8609df59737a510794ad8bc1bd0a93 | [
"Apache-2.0"
] | null | null | null | from os import getenv
from typing import List, Tuple
from subprocess import check_output
CONFIG = {
"REPOS": {
"AUTH": {
"CONTAINER": "hashcloak/authority",
"REPOSITORY": "https://github.com/katzenpost/authority",
"BRANCH": "master",
"GITHASH": "",
... | 33.532787 | 92 | 0.573454 | from os import getenv
from typing import List, Tuple
from subprocess import check_output
CONFIG = {
"REPOS": {
"AUTH": {
"CONTAINER": "hashcloak/authority",
"REPOSITORY": "https://github.com/katzenpost/authority",
"BRANCH": "master",
"GITHASH": "",
... | 0 | 0 | 0 | 0 | 0 | 921 | 0 | 0 | 23 |
a2f2241cf9a62a1ff8cf23af407648a04d5e66e4 | 243 | py | Python | models/user.py | yasheymateen/AirBnB_clone | 865cbef47738371f66b9264635a04b983d7accfd | [
"Unlicense"
] | null | null | null | models/user.py | yasheymateen/AirBnB_clone | 865cbef47738371f66b9264635a04b983d7accfd | [
"Unlicense"
] | null | null | null | models/user.py | yasheymateen/AirBnB_clone | 865cbef47738371f66b9264635a04b983d7accfd | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
""" User class module """
| 17.357143 | 58 | 0.62963 | #!/usr/bin/python3
""" User class module """
from models.base_model import BaseModel
class User(BaseModel):
""" class User which inherits from class BaseModel """
email = ""
password = ""
first_name = ""
last_name = ""
| 0 | 0 | 0 | 133 | 0 | 0 | 0 | 18 | 46 |
125297875b3ed984b47bfb4704904bff1614d212 | 715 | py | Python | filewriter.py | PranavPusarla/watersmrt | 3c8e8fd25f185b2b746feca8d109c7d208703d04 | [
"MIT"
] | 1 | 2019-11-28T04:38:56.000Z | 2019-11-28T04:38:56.000Z | filewriter.py | PranavPusarla/watersmrt | 3c8e8fd25f185b2b746feca8d109c7d208703d04 | [
"MIT"
] | null | null | null | filewriter.py | PranavPusarla/watersmrt | 3c8e8fd25f185b2b746feca8d109c7d208703d04 | [
"MIT"
] | 2 | 2019-11-26T19:41:08.000Z | 2019-11-28T04:36:57.000Z | ##############
## Script listens to serial port and writes contents into a file
import serial # sudo pip install pyserial should work
from datetime import datetime
serial_port = '/dev/cu.usbmodem1411';
baud_rate = 9600; #In arduino, Serial.begin(baud_rate)
write_to_file_path = "week.txt";
output_file = open(write_... | 29.791667 | 81 | 0.674126 | ##############
## Script listens to serial port and writes contents into a file
import serial # sudo pip install pyserial should work
from datetime import datetime
serial_port = '/dev/cu.usbmodem1411';
baud_rate = 9600; #In arduino, Serial.begin(baud_rate)
write_to_file_path = "week.txt";
output_file = open(write_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a22afff50e75c227c23d29ed5b6a86fd81907759 | 12,268 | py | Python | iMeshDashboard/__init__.py | mkinney/Meshtastic-rpi-dashboard | ed3f0228a023f3345a1adc2b2a4b7ce618f9803c | [
"Apache-2.0"
] | 4 | 2021-02-17T12:47:06.000Z | 2021-03-25T22:32:32.000Z | iMeshDashboard/__init__.py | mkinney/Meshtastic-rpi-dashboard | ed3f0228a023f3345a1adc2b2a4b7ce618f9803c | [
"Apache-2.0"
] | 9 | 2021-03-05T10:03:57.000Z | 2021-03-09T11:53:24.000Z | iMeshDashboard/__init__.py | mkinney/Meshtastic-rpi-dashboard | ed3f0228a023f3345a1adc2b2a4b7ce618f9803c | [
"Apache-2.0"
] | 5 | 2021-02-24T16:55:45.000Z | 2021-12-31T15:40:33.000Z | #!/usr/bin/env python3
from flask import Flask
from flask_basicauth import BasicAuth
import paho.mqtt.client as mqtt
import meshtastic
import configparser
from pkg_resources import get_distribution, DistributionNotFound
try:
_dist = get_distribution('iMesh-Dashboard')
except DistributionNotFound:
__version__ =... | 36.620896 | 177 | 0.612406 | #!/usr/bin/env python3
from flask import Flask, render_template, request, send_from_directory, url_for, redirect
from flask_basicauth import BasicAuth
from flask_apscheduler import APScheduler
import requests
import json
import copy
import atexit
import time
import timeago
from datetime import datetime
import paho.mqtt... | 8 | 3,920 | 0 | 0 | 0 | 6,346 | 0 | 94 | 839 |
40f1c260bc51ca5813d613d04c7f14380bda6650 | 12,191 | py | Python | autonormalize/normalize.py | j-grover/autonormalize | 764a652fadf1a7ec544c3447120d11aa29a11435 | [
"BSD-3-Clause"
] | 68 | 2019-08-14T22:01:23.000Z | 2021-03-10T21:33:36.000Z | autonormalize/normalize.py | j-grover/autonormalize | 764a652fadf1a7ec544c3447120d11aa29a11435 | [
"BSD-3-Clause"
] | 26 | 2019-08-15T15:49:19.000Z | 2021-03-08T15:27:22.000Z | autonormalize/normalize.py | j-grover/autonormalize | 764a652fadf1a7ec544c3447120d11aa29a11435 | [
"BSD-3-Clause"
] | 9 | 2019-10-18T00:49:23.000Z | 2021-04-14T05:42:50.000Z | import pandas as pd
from .classes import Dependencies
def normalize(dependencies, df):
"""
Normalizes the dependency relationships in dependencies into new
groups by breaking up all partial and transitive dependencies.
Arguments:
dependencies (Dependencies) : the dependencies to be split up
... | 31.501292 | 113 | 0.623575 | import pandas as pd
from .classes import Dependencies
def normalize(dependencies, df):
"""
Normalizes the dependency relationships in dependencies into new
groups by breaking up all partial and transitive dependencies.
Arguments:
dependencies (Dependencies) : the dependencies to be split up
... | 0 | 0 | 0 | 1,082 | 0 | 0 | 0 | 0 | 23 |
a7d3e6789c82ae27b0afc4ea8c38a7771e6a1749 | 19,173 | py | Python | temporal/stds_import.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | temporal/stds_import.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | temporal/stds_import.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | """
Space time dataset import functions
Usage:
.. code-block:: python
import grass.temporal as tgis
input="/tmp/temp_1950_2012.tar.gz"
output="temp_1950_2012"
directory="/tmp"
title="My new dataset"
descr="May new shiny dataset"
location=None
link=True
exp=True
overr=False
... | 38.117296 | 91 | 0.53132 | """
Space time dataset import functions
Usage:
.. code-block:: python
import grass.temporal as tgis
input="/tmp/temp_1950_2012.tar.gz"
output="temp_1950_2012"
directory="/tmp"
title="My new dataset"
descr="May new shiny dataset"
location=None
link=True
exp=True
overr=False
... | 0 | 0 | 0 | 0 | 0 | 4,025 | 0 | 0 | 92 |
25dccc73c6ef3bd511e9ec9a8385af6f54c50a9d | 185 | py | Python | main/app.py | ultimateshark/Vessel | 88af8bdbbd7a781491ac750be7a06ee8d83ffd8b | [
"MIT"
] | 1 | 2021-01-17T13:51:55.000Z | 2021-01-17T13:51:55.000Z | main/app.py | ultimateshark/Vessel | 88af8bdbbd7a781491ac750be7a06ee8d83ffd8b | [
"MIT"
] | null | null | null | main/app.py | ultimateshark/Vessel | 88af8bdbbd7a781491ac750be7a06ee8d83ffd8b | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__) | 15.416667 | 34 | 0.637838 | from flask import Flask
import os
class Runner:
def __init__():
self.app = Flask(__name__)
self.DEBUG = False
app = Flask(__name__)
def appRunner():
app.run() | 0 | 0 | 0 | 74 | 0 | 9 | 0 | -12 | 68 |
71d0e3ccf924bb848ebbf45332e43e7e38cb1aa9 | 2,532 | py | Python | zdy.py | awesome-archive/squid_proxy_pool | 8f50858ed25bdb7d41fb0d8e25260d7bdea4f420 | [
"MIT"
] | 2 | 2019-09-13T13:43:04.000Z | 2019-11-28T06:44:15.000Z | zdy.py | AaronJny/squid_proxy_pool | 8f50858ed25bdb7d41fb0d8e25260d7bdea4f420 | [
"MIT"
] | null | null | null | zdy.py | AaronJny/squid_proxy_pool | 8f50858ed25bdb7d41fb0d8e25260d7bdea4f420 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# zdy.py
'''
Squid+IP
Author: Nathan
Blog: www.xnathan.com
Github: github.com/xNathan
'''
from gevent import monkey
monkey.patch_all()
import os
import time
import logging
import requests
from gevent.pool import Pool
logger = logging.getLogger(__name__)
logger.setLevel(logging.IN... | 23.886792 | 123 | 0.60782 | #!/usr/bin/env python
# coding: utf-8
# zdy.py
'''
Squid+站大爷搭建代理IP池
Author: Nathan
Blog: www.xnathan.com
Github: github.com/xNathan
'''
from gevent import monkey
monkey.patch_all()
import os
import time
import logging
import requests
from gevent.pool import Pool
logger = logging.getLogger(__name__)
logger.setLevel(lo... | 210 | 0 | 0 | 0 | 0 | 1,104 | 0 | 0 | 69 |
7192e79ea3c7e1ce71f4662aa4b22465a1a200f9 | 7,416 | py | Python | sview/window.py | IvanGavrilin/pyview | 0a39c4b8be7571a7f82f836d92b92c14b3496368 | [
"MIT"
] | null | null | null | sview/window.py | IvanGavrilin/pyview | 0a39c4b8be7571a7f82f836d92b92c14b3496368 | [
"MIT"
] | null | null | null | sview/window.py | IvanGavrilin/pyview | 0a39c4b8be7571a7f82f836d92b92c14b3496368 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2016 Ivan Gavrilin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | 34.333333 | 132 | 0.619337 | # The MIT License (MIT)
#
# Copyright (c) 2016 Ivan Gavrilin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | 0 | 0 | 0 | 5,550 | 0 | 111 | 0 | 23 | 159 |
acf2eeb3e69920dae1fae097481aa66f41b37ce2 | 14,100 | py | Python | TEST/BETAsite/pulse_generator/pulse_generator/gate_operation.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | TEST/BETAsite/pulse_generator/pulse_generator/gate_operation.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | TEST/BETAsite/pulse_generator/pulse_generator/gate_operation.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | # Numpy
#
# Numpy array
# Numpy common math function
# Numpy constant
from numpy import pi
# def set_QubitRegister():
if __name__ == "__main__":
import matplotlib.pyplot as plt
dt = 1.
print("register IQMixerChannel")
mixerInfo = IQMixerChannel()
OPS = QubitOperationSequen... | 33.894231 | 144 | 0.553901 | # Numpy
#
from numpy import linspace, arange
# Numpy array
from numpy import array, append, zeros, ones, where
# Numpy common math function
from numpy import exp, sqrt, arctan2, cos, sin, angle, radians, sign, log, ceil
# Numpy constant
from numpy import pi
from pandas import infer_freq
def gaussianFunc (t, p):
... | 0 | 0 | 0 | 11,049 | 0 | 626 | 0 | 113 | 295 |
445323a6f3c84e075595d2741968b4db038fe0dd | 1,013 | py | Python | test/test_cli.py | Fklearn/stagesepx | e3be63678df15403dca3227c1e7bcc9a54ea2b98 | [
"MIT"
] | 369 | 2019-07-22T22:38:45.000Z | 2022-03-18T14:06:32.000Z | test/test_cli.py | Fklearn/stagesepx | e3be63678df15403dca3227c1e7bcc9a54ea2b98 | [
"MIT"
] | 172 | 2019-07-18T10:35:58.000Z | 2022-03-30T03:44:46.000Z | test/test_cli.py | Fklearn/stagesepx | e3be63678df15403dca3227c1e7bcc9a54ea2b98 | [
"MIT"
] | 104 | 2019-07-23T01:38:55.000Z | 2022-03-15T03:00:10.000Z | import os
PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
VIDEO_PATH = os.path.join(PROJECT_PATH, "demo.mp4")
from test_cutter import test_default as cutter_default
# prepare
cutter_default()
| 24.707317 | 82 | 0.714709 | from loguru import logger
import subprocess
import os
PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
VIDEO_PATH = os.path.join(PROJECT_PATH, "demo.mp4")
from test_cutter import test_default as cutter_default
from test_cutter import RESULT_DIR as CUTTER_RESULT_DIR
# prepare
cutter_default()
def test_cli(... | 0 | 0 | 0 | 0 | 0 | 588 | 0 | 34 | 181 |