hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
67679f71ef919aae1d798cf464014c5cc22d19a4 | 1,997 | py | Python | data/transcoder_evaluation_gfg/python/MAXIMUM_TRIPLET_SUM_ARRAY_2.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/MAXIMUM_TRIPLET_SUM_ARRAY_2.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/MAXIMUM_TRIPLET_SUM_ARRAY_2.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( arr , n ) :
maxA = - 100000000
maxB = - 100000000
maxC = - 100000000
for i in range ( 0 , n ) :
... | 46.44186 | 220 | 0.457687 |
1b5fc09b49458bd98582a37e02eea4b4155dbf0e | 1,333 | py | Python | f5_agent_auditor/options.py | f5devcentral/f5-agent-auditor | dce6358346bc6832c050164f27babaf5d54228cd | [
"Apache-2.0"
] | null | null | null | f5_agent_auditor/options.py | f5devcentral/f5-agent-auditor | dce6358346bc6832c050164f27babaf5d54228cd | [
"Apache-2.0"
] | null | null | null | f5_agent_auditor/options.py | f5devcentral/f5-agent-auditor | dce6358346bc6832c050164f27babaf5d54228cd | [
"Apache-2.0"
] | 1 | 2021-07-14T02:22:10.000Z | 2021-07-14T02:22:10.000Z | # -*- coding: utf-8 -*-
#
# 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, softwa... | 28.361702 | 74 | 0.714179 |
38d6b36c682bf03998ebacee2099a12e3edf6512 | 10,058 | py | Python | 3-Crossed_Wires.py | minhoryang/advent-of-code-2019 | f5b468ce583a14548346f8e415d6b05589ec564f | [
"MIT"
] | null | null | null | 3-Crossed_Wires.py | minhoryang/advent-of-code-2019 | f5b468ce583a14548346f8e415d6b05589ec564f | [
"MIT"
] | null | null | null | 3-Crossed_Wires.py | minhoryang/advent-of-code-2019 | f5b468ce583a14548346f8e415d6b05589ec564f | [
"MIT"
] | null | null | null | line1 = ['R999', 'D586', 'L462', 'D725', 'L236', 'U938', 'R366', 'D306', 'R263', 'D355', 'R354', 'D332', 'L599', 'U48', 'R829', 'U210', 'R697', 'D534', 'L19', 'U991', 'L110', 'U981', 'L954', 'U323', 'R851', 'U290', 'R76', 'D513', 'R844', 'D780', 'L257', 'D24', 'L586', 'U865', 'L341', 'U572', 'L122', 'D304', 'R398', 'D6... | 94.886792 | 2,384 | 0.491151 |
a58046960ca54e2a6b0218d8d088e432bb54b136 | 3,408 | py | Python | test/resttest/comments.py | informatics-isi-edu/ermrest | 1a4002c94c46b43089f704a65a6d2be8730396fd | [
"Apache-2.0"
] | 4 | 2015-04-27T21:25:54.000Z | 2022-01-15T18:56:37.000Z | test/resttest/comments.py | informatics-isi-edu/ermrest | 1a4002c94c46b43089f704a65a6d2be8730396fd | [
"Apache-2.0"
] | 215 | 2015-05-06T23:59:19.000Z | 2022-02-07T23:37:56.000Z | test/resttest/comments.py | informatics-isi-edu/ermrest | 1a4002c94c46b43089f704a65a6d2be8730396fd | [
"Apache-2.0"
] | 8 | 2015-08-26T19:23:39.000Z | 2018-06-13T00:18:52.000Z |
import unittest
import common
import basics
_S = 'comments'
_T2b = basics._T2b
_defs = basics.defs(_S)
_table_defs = _defs['schemas'][_S]['tables']
def setUpModule():
r = common.primary_session.get('schema/%s' % _S)
if r.status_code == 404:
# idempotent because unittest can re-enter module several t... | 40.094118 | 141 | 0.575704 |
fc78e95dc653c3abc49425c5a966c38605f1c080 | 2,373 | py | Python | tests/integration/compare_test.py | numenta/cortipy | 908fc461c8116b0dfb4d66bbd91fa68b1d05d642 | [
"MIT"
] | 8 | 2015-05-13T22:04:23.000Z | 2018-01-24T19:38:06.000Z | tests/integration/compare_test.py | numenta/cortipy | 908fc461c8116b0dfb4d66bbd91fa68b1d05d642 | [
"MIT"
] | 25 | 2015-04-30T19:02:16.000Z | 2016-02-25T22:50:03.000Z | tests/integration/compare_test.py | numenta/cortipy | 908fc461c8116b0dfb4d66bbd91fa68b1d05d642 | [
"MIT"
] | 16 | 2015-04-30T15:51:33.000Z | 2018-08-25T05:10:53.000Z | # The MIT License (MIT)
#
# Copyright (c) 2015 Numenta, Inc.
#
# 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... | 35.954545 | 79 | 0.726507 |
1b452296748877444304f1af1613984754254bf8 | 2,135 | py | Python | ptsites/sites/hd-space.py | czahoi/flexget_qbittorrent_mod | c001d9ece050136bbff5876697b12079a841af3e | [
"MIT"
] | null | null | null | ptsites/sites/hd-space.py | czahoi/flexget_qbittorrent_mod | c001d9ece050136bbff5876697b12079a841af3e | [
"MIT"
] | null | null | null | ptsites/sites/hd-space.py | czahoi/flexget_qbittorrent_mod | c001d9ece050136bbff5876697b12079a841af3e | [
"MIT"
] | null | null | null | from ..schema.xbtit import XBTIT
from ..utils import net_utils
from ..utils.value_hanlder import handle_infinite
class MainClass(XBTIT):
URL = 'https://hd-space.org/'
SUCCEED_REGEX = 'Welcome back .*?</span> '
USER_CLASSES = {
'uploaded': [2199023255552],
'share_ratio': [4.25]
}
@... | 36.186441 | 300 | 0.43185 |
358f8bf1afe781cfae54e0bb5eb051ba80dc16cb | 6,890 | py | Python | core/migrations/0053_remove_wagtail_personalisation.py | uktrade/great-cms | f13fa335ddcb925bc33a5fa096fe73ef7bdd351a | [
"MIT"
] | 10 | 2020-04-30T12:04:35.000Z | 2021-07-21T12:48:55.000Z | core/migrations/0053_remove_wagtail_personalisation.py | uktrade/great-cms | f13fa335ddcb925bc33a5fa096fe73ef7bdd351a | [
"MIT"
] | 1,461 | 2020-01-23T18:20:26.000Z | 2022-03-31T08:05:56.000Z | core/migrations/0053_remove_wagtail_personalisation.py | uktrade/great-cms | f13fa335ddcb925bc33a5fa096fe73ef7bdd351a | [
"MIT"
] | 3 | 2020-04-07T20:11:36.000Z | 2020-10-16T16:22:59.000Z | # Generated by Django 2.2.18 on 2021-02-02 12:36
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
import core.blocks
class Migration(migrations.Migration):
dependencies = [
('core', '0052_update_meta_options_for_snippets'),
]
o... | 42.530864 | 110 | 0.367925 |
7cc6452ca6df8872233f200da00a75234ebc4e53 | 1,653 | py | Python | marshpy/fields/path_field.py | an-otter-world/marshpy | 42aed8e5f316358792356c7e550f844a08bf206e | [
"WTFPL"
] | null | null | null | marshpy/fields/path_field.py | an-otter-world/marshpy | 42aed8e5f316358792356c7e550f844a08bf206e | [
"WTFPL"
] | 16 | 2021-03-26T08:32:29.000Z | 2021-03-27T10:37:24.000Z | marshpy/fields/path_field.py | an-otter-world/marshpy | 42aed8e5f316358792356c7e550f844a08bf206e | [
"WTFPL"
] | null | null | null | """Path field class & utilities."""
from gettext import gettext as _
from pathlib import Path
from typing import Any
from typing import Optional
from marshpy.core.constants import UNDEFINED
from marshpy.core.errors import ErrorCode
from marshpy.core.interfaces import ILoadingContext
from marshpy.core.validation import... | 30.611111 | 79 | 0.626134 |
6923d1dece74e68b3979bdd00b798b38f6412719 | 813 | py | Python | lists_and_dicts.py | acroooo/intermediate-python | e2cf1d5c397cc94fd5ce38085802d099b3633c6c | [
"MIT"
] | null | null | null | lists_and_dicts.py | acroooo/intermediate-python | e2cf1d5c397cc94fd5ce38085802d099b3633c6c | [
"MIT"
] | null | null | null | lists_and_dicts.py | acroooo/intermediate-python | e2cf1d5c397cc94fd5ce38085802d099b3633c6c | [
"MIT"
] | null | null | null | def run():
my_list = [1, 'Hi', True, 4.5]
my_dict = {
"first_name": "Hernan",
"last_name": "Chamorro",
}
super_list = [
{ "first_name": "Hernan", "last_name": "Chamorro",},
{ "first_name": "Gustavo", "last_name": "Ramon",},
{ "first_name": "Bruno", "last_name": "... | 29.035714 | 76 | 0.494465 |
416dca22e0655e26460b2735ef811a814b83981e | 703 | py | Python | src/ggrc/contributions.py | sbilly/ggrc-core | 59a6825c6a8e15e42ebdb9e08d079cefd1800120 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/contributions.py | sbilly/ggrc-core | 59a6825c6a8e15e42ebdb9e08d079cefd1800120 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/contributions.py | sbilly/ggrc-core | 59a6825c6a8e15e42ebdb9e08d079cefd1800120 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Lists of ggrc contributions."""
from ggrc.notifications import common
from ggrc.notifications import notification_handlers
from ggrc.notifications import data_handlers
CONTRIBUTED_CRON_JOBS = [
com... | 26.037037 | 78 | 0.775249 |
b0ce6bfbdd5c904a44a206094523a4f8298cdb36 | 698 | py | Python | api_restful/__init__.py | zhanghe06/bearing_project | 78a20fc321f72d3ae05c7ab7e52e01d02904e3fc | [
"MIT"
] | 1 | 2020-06-21T04:08:26.000Z | 2020-06-21T04:08:26.000Z | api_restful/__init__.py | zhanghe06/bearing_project | 78a20fc321f72d3ae05c7ab7e52e01d02904e3fc | [
"MIT"
] | 13 | 2019-10-18T17:19:32.000Z | 2022-01-13T00:44:43.000Z | api_restful/__init__.py | zhanghe06/bearing_project | 78a20fc321f72d3ae05c7ab7e52e01d02904e3fc | [
"MIT"
] | 5 | 2019-02-07T03:15:16.000Z | 2021-09-04T14:06:28.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
@author: zhanghe
@software: PyCharm
@file: __init__.py
@time: 2020-02-28 21:01
"""
from flask import Flask
from logging.config import dictConfig
from api_restful.apis import api_bearing
from api_restful.blueprints import bp_bearing
from config import current_config
# from... | 19.388889 | 72 | 0.797994 |
9caceeffa47b7892783b2074d1b678aa7ec6202a | 359 | py | Python | pybook/ch13/WirteDemo.py | YanhaoXu/python-learning | 856687a71635a2ca67dab49d396c238f128e5ec0 | [
"MIT"
] | 2 | 2021-12-06T13:29:48.000Z | 2022-01-20T11:39:45.000Z | pybook/ch13/WirteDemo.py | YanhaoXu/python-learning | 856687a71635a2ca67dab49d396c238f128e5ec0 | [
"MIT"
] | null | null | null | pybook/ch13/WirteDemo.py | YanhaoXu/python-learning | 856687a71635a2ca67dab49d396c238f128e5ec0 | [
"MIT"
] | null | null | null | from pybook.ch13.FIleTestConst import TEST_PATH
def main():
# Open file the output
outfile = open(TEST_PATH + "Presidents.txt", "w")
# Write data to the file
outfile.write("Bill Clinton\n")
outfile.write("George Bush\n")
outfile.write("Barack Obama")
outfile.close() # Close the output f... | 21.117647 | 53 | 0.671309 |
f2935611bc2ce80e397bdcbced78980c0ba606cc | 3,343 | py | Python | tests/test_initializers.py | OliverZijia/tensorlayer2 | 01113b53e84a3bbb298b9c35ebd53254e487350f | [
"Apache-2.0"
] | null | null | null | tests/test_initializers.py | OliverZijia/tensorlayer2 | 01113b53e84a3bbb298b9c35ebd53254e487350f | [
"Apache-2.0"
] | null | null | null | tests/test_initializers.py | OliverZijia/tensorlayer2 | 01113b53e84a3bbb298b9c35ebd53254e487350f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
import tensorlayer as tl
import numpy as np
from tests.utils import CustomTestCase
class Test_Leaky_ReLUs(CustomTestCase):
@classmethod
def setUpClass(cls):
cls... | 35.946237 | 114 | 0.608436 |
2865698e096f995fee16fe0884ef4253ec40b3e3 | 522 | py | Python | Notebook_surface/spyder_test.py | Jaknil/Anaconda-python | de80d7360c36c2abeb5ac922211e815a0e9e57ca | [
"MIT"
] | null | null | null | Notebook_surface/spyder_test.py | Jaknil/Anaconda-python | de80d7360c36c2abeb5ac922211e815a0e9e57ca | [
"MIT"
] | null | null | null | Notebook_surface/spyder_test.py | Jaknil/Anaconda-python | de80d7360c36c2abeb5ac922211e815a0e9e57ca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
mpl.rcParams['legend.fontsize'] = 10
res = 100 # Line segments
#%%
fig = plt.figure()
ax = fig.gca(projection='3d')
theta... | 18.642857 | 46 | 0.662835 |
0e6d8448dc4a5d25b58266a9a1e2d6f7fc20c35f | 703 | py | Python | clmm/__init__.py | nicolahunfeld/CLMM | a431649713e56b907a7366bdf21693c30851dee7 | [
"BSD-3-Clause"
] | null | null | null | clmm/__init__.py | nicolahunfeld/CLMM | a431649713e56b907a7366bdf21693c30851dee7 | [
"BSD-3-Clause"
] | null | null | null | clmm/__init__.py | nicolahunfeld/CLMM | a431649713e56b907a7366bdf21693c30851dee7 | [
"BSD-3-Clause"
] | null | null | null | """ CLMM is a cluster mass modeling code. """
from .gcdata import GCData
from .galaxycluster import GalaxyCluster
from .dataops import compute_tangential_and_cross_components, make_radial_profile
from .utils import compute_radial_averages, make_bins, convert_units
from .theory import (
compute_reduced_shear_from_co... | 43.9375 | 90 | 0.846373 |
67193ce3222280f4a7e817879df26bac3cadb4d5 | 166 | py | Python | backend/venv/lib/python3.6/site-packages/tatsu/g2e/__main__.py | HalmonLui/square-hackathon | 62d5be7a229f9e39e27a546c164facd779d28aa4 | [
"MIT"
] | 3 | 2020-06-13T02:47:29.000Z | 2020-06-20T17:34:15.000Z | backend/venv/lib/python3.6/site-packages/tatsu/g2e/__main__.py | HalmonLui/square-hackathon | 62d5be7a229f9e39e27a546c164facd779d28aa4 | [
"MIT"
] | 2 | 2020-06-14T20:29:26.000Z | 2020-06-14T20:29:34.000Z | backend/venv/lib/python3.6/site-packages/tatsu/g2e/__main__.py | HalmonLui/square-hackathon | 62d5be7a229f9e39e27a546c164facd779d28aa4 | [
"MIT"
] | 1 | 2020-09-04T01:45:39.000Z | 2020-09-04T01:45:39.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from . import main
if __name__ == '__main__':
main()
| 20.75 | 82 | 0.716867 |
028ec1ff77df315fc950da5dfc6867640b62c16d | 3,891 | py | Python | pymatgen/io/abinitio/tests/test_abiobjects.py | NadezhdaBzhilyanskaya/pymatgen | fae11a8142d457a649fa84ff9781eb2b39334bdc | [
"MIT"
] | 1 | 2022-02-28T04:24:46.000Z | 2022-02-28T04:24:46.000Z | pymatgen/io/abinitio/tests/test_abiobjects.py | NadezhdaBzhilyanskaya/pymatgen | fae11a8142d457a649fa84ff9781eb2b39334bdc | [
"MIT"
] | null | null | null | pymatgen/io/abinitio/tests/test_abiobjects.py | NadezhdaBzhilyanskaya/pymatgen | fae11a8142d457a649fa84ff9781eb2b39334bdc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import division, print_function
import os
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.structure import Structure
from pymatgen.core.units import Ha_to_eV
from pymatgen.io.abinitio.abiobjects import *
test_dir = os.path.join(os.path.dirname(__file__), "..", ... | 26.469388 | 74 | 0.653559 |
b445c7a240a183904d3d03ac359dae79963d2bde | 6,483 | py | Python | TheNetwork/whisper_detector.py | llmaayanll/TheImageWhisperer | 6525663aaeab5b9dfc454b69d1b17041f4003ec7 | [
"MIT"
] | null | null | null | TheNetwork/whisper_detector.py | llmaayanll/TheImageWhisperer | 6525663aaeab5b9dfc454b69d1b17041f4003ec7 | [
"MIT"
] | null | null | null | TheNetwork/whisper_detector.py | llmaayanll/TheImageWhisperer | 6525663aaeab5b9dfc454b69d1b17041f4003ec7 | [
"MIT"
] | null | null | null |
from __future__ import print_function
import keras
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
import numpy as np
import os
import json
from TheNetwork.veggie import VeGGieModel
class WhisperDetector(object):
""""""
def __init__(self, max_num_pics_per_category=None, ... | 42.372549 | 109 | 0.641678 |
36f9e614e5f5cfa7041a7da8060d6e22ec1c943a | 1,468 | py | Python | src/rdbms/setup.py | southworkscom/azure-cli-extensions | 543252eb78107a98e22dcf9fdb64ab1e5887bf9f | [
"MIT"
] | null | null | null | src/rdbms/setup.py | southworkscom/azure-cli-extensions | 543252eb78107a98e22dcf9fdb64ab1e5887bf9f | [
"MIT"
] | null | null | null | src/rdbms/setup.py | southworkscom/azure-cli-extensions | 543252eb78107a98e22dcf9fdb64ab1e5887bf9f | [
"MIT"
] | 1 | 2018-03-20T23:36:57.000Z | 2018-03-20T23:36:57.000Z | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 34.952381 | 99 | 0.604905 |
0665626d6f957b29cb715cf3994ce2ec2ad3ceb0 | 63 | py | Python | braingraphgeo/__init__.py | scott-trinkle/braingraphgeo | 990c4956acf8fe56f9bdb8871c265c4ea28da9a9 | [
"MIT"
] | null | null | null | braingraphgeo/__init__.py | scott-trinkle/braingraphgeo | 990c4956acf8fe56f9bdb8871c265c4ea28da9a9 | [
"MIT"
] | null | null | null | braingraphgeo/__init__.py | scott-trinkle/braingraphgeo | 990c4956acf8fe56f9bdb8871c265c4ea28da9a9 | [
"MIT"
] | null | null | null | from . import utils
from . import vis
from . import surrogates
| 15.75 | 24 | 0.761905 |
aa86ddc2d5e1404a2366a590ef65ee6a4a1f8b93 | 3,423 | py | Python | _fpl_process.py | leoleolam/fpl_analytics | ef06e9dd929d2eed17e5481b61f1921e3092371d | [
"MIT"
] | 2 | 2019-02-16T18:38:03.000Z | 2021-09-24T16:30:10.000Z | _fpl_process.py | leoleolam/fpl_analytics | ef06e9dd929d2eed17e5481b61f1921e3092371d | [
"MIT"
] | null | null | null | _fpl_process.py | leoleolam/fpl_analytics | ef06e9dd929d2eed17e5481b61f1921e3092371d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
fpl_analytics._fpl_data
This contains all utils for fpl data process
"""
import pandas as pd
from collections import defaultdict
def get_player_id(fpl_data, name):
"""
get player id from the first, second or web name
"""
return {i:fpl_data["elements"][i]["first_nam... | 30.026316 | 76 | 0.566754 |
860a3d13b69b3111148a6a5b637df62dbe91b5e8 | 1,733 | py | Python | scprojects/migrations/0016_auto_20200123_1721.py | shescoding/projects-platform-backend | b5ebce71e2377970283da0f8f3ddd7dae201c80e | [
"MIT"
] | 2 | 2020-10-11T07:51:49.000Z | 2021-05-12T15:04:38.000Z | scprojects/migrations/0016_auto_20200123_1721.py | shescoding/projects-platform-backend | b5ebce71e2377970283da0f8f3ddd7dae201c80e | [
"MIT"
] | 20 | 2019-08-25T22:18:25.000Z | 2022-02-10T09:04:47.000Z | scprojects/migrations/0016_auto_20200123_1721.py | shescoding/projects-platform-backend | b5ebce71e2377970283da0f8f3ddd7dae201c80e | [
"MIT"
] | 2 | 2020-09-26T22:27:58.000Z | 2020-10-01T17:33:43.000Z | # Generated by Django 2.2.6 on 2020-01-23 17:21
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('scprojects', '0015_project_lead'),
]
operations ... | 30.946429 | 70 | 0.587421 |
4cb9b9575c3b5a173e3d8f6278db1e96d0ac5a27 | 498 | py | Python | rpi/helper.py | GeorgeShao/HomeNode | 259295ff8715ebe4348d5098d32fb6bbc60a8a7a | [
"MIT"
] | null | null | null | rpi/helper.py | GeorgeShao/HomeNode | 259295ff8715ebe4348d5098d32fb6bbc60a8a7a | [
"MIT"
] | null | null | null | rpi/helper.py | GeorgeShao/HomeNode | 259295ff8715ebe4348d5098d32fb6bbc60a8a7a | [
"MIT"
] | null | null | null | """
Helper file for random functions
"""
def format_serial_data(data_string):
data_list = data_string.strip().replace('\n','').replace('\r','/').replace('\\','').split('/')
data_dict = {}
for index, value in enumerate(data_list):
if index % 2 == 0 and index + 1 < len(data_list):
... | 38.307692 | 102 | 0.546185 |
16d1cab34aebbde17303856576113eb5e3a47f3f | 258 | py | Python | Networking/Packets/Incoming/BuyResultPacket.py | henriquelino/pyrelay | b448cca3accc9a566616b756a03958ba096a5ebf | [
"MIT"
] | 26 | 2020-07-24T05:47:02.000Z | 2022-03-31T16:03:13.000Z | Networking/Packets/Incoming/BuyResultPacket.py | henriquelino/pyrelay | b448cca3accc9a566616b756a03958ba096a5ebf | [
"MIT"
] | 17 | 2020-07-27T08:11:19.000Z | 2022-03-29T05:26:16.000Z | Networking/Packets/Incoming/BuyResultPacket.py | henriquelino/pyrelay | b448cca3accc9a566616b756a03958ba096a5ebf | [
"MIT"
] | 16 | 2021-01-20T14:30:37.000Z | 2022-03-18T05:31:51.000Z | class BuyResultPacket:
def __init__(self):
self.type = "BUYRESULT"
self.result = 0
self.resultString = ""
def read(self, reader):
self.result = reader.readInt32()
self.resultString = reader.readStr()
| 25.8 | 45 | 0.581395 |
f4ecda7c082bcfe8f3fabaee2dfad28342f7c446 | 896 | py | Python | Python/climbingStairs.py | dianeyeo/LeetCode | b814831e7a4296a4e95785b75ea5c540a3fca63d | [
"MIT"
] | null | null | null | Python/climbingStairs.py | dianeyeo/LeetCode | b814831e7a4296a4e95785b75ea5c540a3fca63d | [
"MIT"
] | null | null | null | Python/climbingStairs.py | dianeyeo/LeetCode | b814831e7a4296a4e95785b75ea5c540a3fca63d | [
"MIT"
] | null | null | null | """
https://leetcode.com/problems/climbing-stairs/
Difficulty: Easy
You are climbing a staircase. It takes n steps to reach the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Example 1:
Input: n = 2
Output: 2
Explanation: There are two ways to climb to the top.... | 24.216216 | 96 | 0.618304 |
752107d49f9d1fb5b3b701b760135b110516d36e | 2,296 | py | Python | py/examples/header.py | orlandoojr1/wave | e86d0c87c6c67e510fb4e1fa571982ca0a09f33c | [
"Apache-2.0"
] | 1 | 2022-03-02T21:54:36.000Z | 2022-03-02T21:54:36.000Z | py/examples/header.py | orlandoojr1/wave | e86d0c87c6c67e510fb4e1fa571982ca0a09f33c | [
"Apache-2.0"
] | null | null | null | py/examples/header.py | orlandoojr1/wave | e86d0c87c6c67e510fb4e1fa571982ca0a09f33c | [
"Apache-2.0"
] | null | null | null | # Header
# Use a header card to display a page #header.
# ---
from h2o_wave import site, ui
image = 'https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?auto=compress&h=750&w=1260'
commands = [
ui.command(name='profile', label='Profile', icon='Contact'),
ui.command(name='preferences', label='Prefe... | 35.323077 | 103 | 0.598432 |
161e7f199ddc24a0ec1c2c2acc07b3343b47d558 | 13,889 | py | Python | notebooks/src/code/data/base.py | verdimrc/amazon-textract-transformer-pipeline | f3ae99ec3b8808d9edf7bc5ac003494cf1548293 | [
"MIT-0"
] | 22 | 2021-11-10T17:16:10.000Z | 2022-03-31T19:39:50.000Z | notebooks/src/code/data/base.py | verdimrc/amazon-textract-transformer-pipeline | f3ae99ec3b8808d9edf7bc5ac003494cf1548293 | [
"MIT-0"
] | 4 | 2021-11-03T03:45:51.000Z | 2022-01-28T03:30:57.000Z | notebooks/src/code/data/base.py | verdimrc/amazon-textract-transformer-pipeline | f3ae99ec3b8808d9edf7bc5ac003494cf1548293 | [
"MIT-0"
] | 4 | 2021-12-14T22:41:40.000Z | 2022-02-04T15:30:10.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""Base/common task data utilities for Amazon Textract + LayoutLM
This module defines utilities common across the different task types (e.g. MLM, NER)
"""
# Python Built-Ins:
from dataclasses import dataclass
import j... | 44.94822 | 100 | 0.614947 |
fd77ad4c2c32403dcb0f798fe9ead6ba293ba928 | 1,280 | py | Python | setup.py | fgregg/centered-potts | 8140d17dc908370aeeef01165c720861aab01c4f | [
"MIT"
] | 1 | 2017-05-02T10:40:15.000Z | 2017-05-02T10:40:15.000Z | setup.py | fgregg/pseudolikelihood | 8140d17dc908370aeeef01165c720861aab01c4f | [
"MIT"
] | 1 | 2016-10-06T22:06:38.000Z | 2016-10-29T14:23:01.000Z | setup.py | fgregg/centered-potts | 8140d17dc908370aeeef01165c720861aab01c4f | [
"MIT"
] | 1 | 2019-02-12T02:13:23.000Z | 2019-02-12T02:13:23.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError :
raise ImportError("setuptools module required, please go to https://pypi.python.org/pypi/setuptools and follow the instructions for installing setuptools")
setup(
name='pseudolikelihood',
url='https://gith... | 38.787879 | 159 | 0.653125 |
9005e528d095892a0674a73bae3e4886c682c0f3 | 937 | py | Python | src/SnapSearch/error.py | liuyu81/SnapSearch-Client-Python | 41857806c2b26f0537de2dcc23a145107a4ecd04 | [
"MIT"
] | null | null | null | src/SnapSearch/error.py | liuyu81/SnapSearch-Client-Python | 41857806c2b26f0537de2dcc23a145107a4ecd04 | [
"MIT"
] | null | null | null | src/SnapSearch/error.py | liuyu81/SnapSearch-Client-Python | 41857806c2b26f0537de2dcc23a145107a4ecd04 | [
"MIT"
] | 1 | 2018-03-04T20:24:14.000Z | 2018-03-04T20:24:14.000Z | # -*- coding: utf-8 -*-
"""
SnapSearch.error
~~~~~~~~~~~~~~~~
:copyright: 2014 by `SnapSearch <https://snapsearch.io/>`_
:license: MIT, see LICENSE for more details.
:author: `LIU Yu <liuyu@opencps.net>`_
:date: 2014/03/08
"""
class SnapSearchError(Exception):
"""
Common base class f... | 21.295455 | 62 | 0.621131 |
b61b35930c17bb80f2c7918b376f37f9465a28ee | 16 | py | Python | nutcracker/tests/__init__.py | FXIhub/nutcracker | 6725166fb3ac1e3ead717e5a57a76238e10a9049 | [
"BSD-2-Clause"
] | 3 | 2017-04-30T18:00:19.000Z | 2017-07-10T09:25:08.000Z | nutcracker/tests/__init__.py | FXIhub/nutcracker | 6725166fb3ac1e3ead717e5a57a76238e10a9049 | [
"BSD-2-Clause"
] | null | null | null | nutcracker/tests/__init__.py | FXIhub/nutcracker | 6725166fb3ac1e3ead717e5a57a76238e10a9049 | [
"BSD-2-Clause"
] | 1 | 2020-12-17T20:03:10.000Z | 2020-12-17T20:03:10.000Z | import test_all
| 8 | 15 | 0.875 |
93cfe8ee3acd6f9808d4467df1b81e4165c51e9e | 2,268 | py | Python | pushCube.py | nclslbrn/blender_script | 19f8809826e9cfdc79422d815614f0834fa95930 | [
"MIT"
] | 2 | 2019-11-29T23:44:05.000Z | 2019-11-30T11:16:28.000Z | pushCube.py | nclslbrn/blender_script | 19f8809826e9cfdc79422d815614f0834fa95930 | [
"MIT"
] | null | null | null | pushCube.py | nclslbrn/blender_script | 19f8809826e9cfdc79422d815614f0834fa95930 | [
"MIT"
] | null | null | null | import bpy
import os
import sys
import bmesh # noqa
dir = os.path.dirname(bpy.data.filepath)
print(dir)
if dir not in sys.path:
sys.path.append(dir)
from functions.cleanScene import cleanScene # noqa: E731
from classes.Pool import Pool # noqa: E731
D = bpy.data
C = bpy.context
# Delete everythings in the sce... | 22.909091 | 61 | 0.541887 |
69e3c694af947c49135bc8343511b0d30e289759 | 24,587 | py | Python | bindings/java/c_generator.py | nirbheek/openwebrtc | 838d6eedf2b4e53224a60f3da8529e6cc621359f | [
"BSD-2-Clause"
] | null | null | null | bindings/java/c_generator.py | nirbheek/openwebrtc | 838d6eedf2b4e53224a60f3da8529e6cc621359f | [
"BSD-2-Clause"
] | null | null | null | bindings/java/c_generator.py | nirbheek/openwebrtc | 838d6eedf2b4e53224a60f3da8529e6cc621359f | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014, Ericsson AB. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the fol... | 35.07418 | 156 | 0.591288 |
f7ce2354a30ac2c192f9ee8b0bd81398ee83201c | 1,913 | py | Python | apps/department/models.py | xiaozhi-12121/Django_web | 4d54b205542c52b8bd8309eaedc16fcdee405273 | [
"Apache-2.0"
] | null | null | null | apps/department/models.py | xiaozhi-12121/Django_web | 4d54b205542c52b8bd8309eaedc16fcdee405273 | [
"Apache-2.0"
] | 2 | 2020-05-12T01:15:38.000Z | 2020-05-12T01:15:38.000Z | apps/department/models.py | xiaozhi-12121/Django_web | 4d54b205542c52b8bd8309eaedc16fcdee405273 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# __author__ : stray_camel
# __description__ : 用户部门管理等
# __REFERENCES__ :
# __date__: 2020/09/28 09
from django.db import models
from django.conf import settings
from datetime import datetime
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
class Department... | 38.26 | 79 | 0.701516 |
d7cc12445229b4aab2cf21a1859676a492396478 | 7,723 | py | Python | scripts/smile.py | hummat/occupancy_networks | c7b89d58f3839fb56df53c37288d22c33529aeac | [
"MIT"
] | null | null | null | scripts/smile.py | hummat/occupancy_networks | c7b89d58f3839fb56df53c37288d22c33529aeac | [
"MIT"
] | null | null | null | scripts/smile.py | hummat/occupancy_networks | c7b89d58f3839fb56df53c37288d22c33529aeac | [
"MIT"
] | null | null | null | import os
import numpy as np
import torch
import trimesh
from im2mesh import config
from im2mesh.utils import binvox_rw, voxels
from im2mesh.checkpoints import CheckpointIO
from im2mesh.utils.visualize import visualize_pointcloud, visualize_voxels
def load_binvox(file_path: str):
with open(file_path, "rb") as f... | 39.403061 | 131 | 0.633692 |
a805c1bdda7c9aa19dd33076a8bc50217ba0950e | 567 | py | Python | zvt/recorders/sina/money_flow_recorder.py | ringwraith/zvt | ff5844ff7991132bbf38d464f29f461dba5efa14 | [
"MIT"
] | 1 | 2019-08-24T02:26:51.000Z | 2019-08-24T02:26:51.000Z | zvt/recorders/sina/money_flow_recorder.py | ringwraith/zvt | ff5844ff7991132bbf38d464f29f461dba5efa14 | [
"MIT"
] | null | null | null | zvt/recorders/sina/money_flow_recorder.py | ringwraith/zvt | ff5844ff7991132bbf38d464f29f461dba5efa14 | [
"MIT"
] | 1 | 2020-05-16T09:42:02.000Z | 2020-05-16T09:42:02.000Z | # -*- coding: utf-8 -*-
from zvt.recorders.recorder import TimeSeriesDataRecorder
class MoneyFlowRecorder(TimeSeriesDataRecorder):
url = 'http://vip.stock.finance.sina.com.cn/quotes_service/api/json_v2.php/MoneyFlow.ssl_bkzj_zjlrqs?page=1&num=1000&sort=opendate&asc=0&bankuai=0%2Fnew_jrhy'
'http://vip.stock.financ... | 70.875 | 162 | 0.797178 |
8268f65c5fc0ff1344f218b5fa17ee701150edbb | 1,072 | py | Python | checkin.py | Andyvon230/glados_checkin_1426593702_qq_com | 37e0c47aab198be2284927d9ee381fe684c17cbf | [
"MIT"
] | null | null | null | checkin.py | Andyvon230/glados_checkin_1426593702_qq_com | 37e0c47aab198be2284927d9ee381fe684c17cbf | [
"MIT"
] | null | null | null | checkin.py | Andyvon230/glados_checkin_1426593702_qq_com | 37e0c47aab198be2284927d9ee381fe684c17cbf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import requests
import os
result = b'success\n'
# url
url = "https://glados.rocks/api/user/checkin"
# cookie
cookie = os.environ["COOKIE"]
payload = "{\"token\":\"glados_network\"}"
headers = {
'authority': 'glados.rocks',
'accept': 'application/json, text/plain,... | 28.972973 | 140 | 0.634328 |
54562e62dd3611d8d7d7adb9d186c063fde646ac | 8,459 | py | Python | software/scripts/epixHRGen1FD.py | ejangelico/cryo-on-epix-hr-dev | 354bf205a67d3c43b4e815823dd78cec85d3b672 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-05-24T22:01:54.000Z | 2021-05-24T22:01:54.000Z | software/scripts/epixHRGen1FD.py | ejangelico/cryo-on-epix-hr-dev | 354bf205a67d3c43b4e815823dd78cec85d3b672 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-02-25T20:27:36.000Z | 2021-03-31T17:55:08.000Z | software/scripts/epixHRGen1FD.py | ejangelico/cryo-on-epix-hr-dev | 354bf205a67d3c43b4e815823dd78cec85d3b672 | [
"BSD-3-Clause-LBNL"
] | 4 | 2020-10-21T21:39:37.000Z | 2021-07-24T02:19:34.000Z | #!/usr/bin/env python3
#-----------------------------------------------------------------------------
# Title : ePix 10ka board instance
#-----------------------------------------------------------------------------
# File : epix10kaDAQ.py evolved from evalBoard.py
# Author : Ryan Herbst, rherbst@slac.st... | 35.099585 | 224 | 0.623005 |
eddfdb42e7b9d1f96056c8395b79635da0778079 | 1,606 | py | Python | utils.py | yjs1224/TextSteganalysis | 3b391f67c37cf2dea964639d201ea5f65fdcf9ba | [
"MIT"
] | 6 | 2021-12-17T13:39:04.000Z | 2022-03-09T09:12:39.000Z | utils.py | yjs1224/TextSteganalysis | 3b391f67c37cf2dea964639d201ea5f65fdcf9ba | [
"MIT"
] | 1 | 2022-01-17T09:52:49.000Z | 2022-01-22T14:05:10.000Z | utils.py | yjs1224/TextSteganalysis | 3b391f67c37cf2dea964639d201ea5f65fdcf9ba | [
"MIT"
] | null | null | null | import json
import sklearn.metrics as metrics
class MyDict(dict):
__setattr__ = dict.__setitem__
# def __setattr__(self, key, value):
# try:
# self[key] = value
# except:
# raise AttributeError(key)
# __getattr__ = dict.__getitem__
def __getattr__(self, item):
... | 33.458333 | 118 | 0.627646 |
d720407a42faf44bd067444a1b3406b9fc5ee4ad | 375 | py | Python | lahja/tools/benchmark/utils/config.py | vaporydev/lahja | 10fb6276d2312629cdbc7367fa3a0057656b540b | [
"MIT"
] | null | null | null | lahja/tools/benchmark/utils/config.py | vaporydev/lahja | 10fb6276d2312629cdbc7367fa3a0057656b540b | [
"MIT"
] | null | null | null | lahja/tools/benchmark/utils/config.py | vaporydev/lahja | 10fb6276d2312629cdbc7367fa3a0057656b540b | [
"MIT"
] | null | null | null | from typing import (
Tuple,
)
from lahja import (
ConnectionConfig,
)
def create_consumer_endpoint_configs(num_processes: int) -> Tuple[ConnectionConfig, ...]:
return tuple(
ConnectionConfig.from_name(create_consumer_endpoint_name(i)) for i in range(num_processes)
)
def create_consumer_endp... | 20.833333 | 98 | 0.725333 |
00c95f43de77f3d87521365358907b478be7f2df | 573 | py | Python | tests/test_bigdict.py | zpz/bigdict | 1cd32885aa0ce908ca824411f7662fa2439af1bd | [
"MIT"
] | 3 | 2021-07-23T03:15:19.000Z | 2021-09-12T06:03:45.000Z | tests/test_bigdict.py | zpz/bigdict | 1cd32885aa0ce908ca824411f7662fa2439af1bd | [
"MIT"
] | 5 | 2021-07-08T06:48:28.000Z | 2021-07-19T03:47:21.000Z | tests/test_bigdict.py | zpz/bigdict | 1cd32885aa0ce908ca824411f7662fa2439af1bd | [
"MIT"
] | null | null | null | from uuid import uuid4
from bigdict import Bigdict
def test_bigdict():
bd = Bigdict.new()
print(bd)
bd['a'] = 3
bd['b'] = 4
bd[9] = [1, 2, 'a']
bd[('a', 3)] = {'a': 3, 'b': 4}
uid = str(uuid4())
bd['uid'] = uid
assert len(bd) == 5
bd2 = bd.view()
assert bd2['a'] == 3
... | 17.90625 | 44 | 0.462478 |
e6a1ea49bd8370f359c7943e51249dae61a11c3f | 1,371 | py | Python | chouette_iot/metrics/plugins/__init__.py | akatashev/chouette-iot | bab56df266fffbc9d1332eebb8f2f5cafac7ba6a | [
"Apache-2.0"
] | 1 | 2020-06-10T10:13:53.000Z | 2020-06-10T10:13:53.000Z | chouette_iot/metrics/plugins/__init__.py | akatashev/chouette-iot | bab56df266fffbc9d1332eebb8f2f5cafac7ba6a | [
"Apache-2.0"
] | null | null | null | chouette_iot/metrics/plugins/__init__.py | akatashev/chouette-iot | bab56df266fffbc9d1332eebb8f2f5cafac7ba6a | [
"Apache-2.0"
] | null | null | null | """
chouette.metrics.plugins
"""
# pylint: disable=too-few-public-methods
from typing import Dict, Optional, Type
from pykka import ActorRef # type: ignore
from ._collector_plugin import CollectorPluginActor
from ._docker_collector import DockerCollectorPlugin
from ._dramatiq_collector import DramatiqCollectorPlugin... | 28.5625 | 76 | 0.708242 |
24cfa13c25be758965b8305c2e91840bed929b07 | 7,366 | py | Python | run_details/generate_run.py | sealuzh/docker-ecosystem-paper | 5c8b253062796baf5d154bc6f9660a7d05d3dad5 | [
"Apache-2.0"
] | 5 | 2017-05-19T15:41:46.000Z | 2021-08-03T16:52:56.000Z | run_details/generate_run.py | sealuzh/docker-ecosystem-paper | 5c8b253062796baf5d154bc6f9660a7d05d3dad5 | [
"Apache-2.0"
] | 1 | 2019-11-18T09:26:23.000Z | 2019-11-18T09:26:23.000Z | run_details/generate_run.py | sealuzh/docker-ecosystem-paper | 5c8b253062796baf5d154bc6f9660a7d05d3dad5 | [
"Apache-2.0"
] | 1 | 2017-05-20T13:54:14.000Z | 2017-05-20T13:54:14.000Z | #!/usr/bin/python
# Do not judge a man by the quality of his research code…
# while his intentions were good, his will broke under the
# time pressure of the conference submission deadline.
# ...And now stop complaining and enjoy the perils of reproducibility. (J.C.)
import psycopg2
import sys
def main():
... | 34.420561 | 290 | 0.631686 |
546053bf19bbf17c5f3f43fdfa3c7d3a0af93a4b | 20,773 | py | Python | src/popoto/models/base.py | tomcounsell/popoto | fc36d625a35393cd6f96afee6b13e849fe9cd242 | [
"MIT"
] | 5 | 2021-11-21T01:36:02.000Z | 2022-01-28T23:16:51.000Z | src/popoto/models/base.py | tomcounsell/popoto | fc36d625a35393cd6f96afee6b13e849fe9cd242 | [
"MIT"
] | 1 | 2021-12-29T13:20:17.000Z | 2021-12-29T13:20:17.000Z | src/popoto/models/base.py | tomcounsell/popoto | fc36d625a35393cd6f96afee6b13e849fe9cd242 | [
"MIT"
] | null | null | null | import logging
import redis
from .encoding import encode_popoto_model_obj
from .db_key import DB_key
from .query import Query
from ..fields.field import Field, VALID_FIELD_TYPES
from ..fields.key_field_mixin import KeyFieldMixin
from ..fields.sorted_field_mixin import SortedFieldMixin
from ..fields.geo_field import G... | 40.811395 | 132 | 0.595051 |
5b45468fc5c36bb349ea054fdcf6af5d32223e46 | 599 | py | Python | jccli/errors.py | zaro0508/jccli | 1de9a7f493d14bbbe6f3d201eb1aa989cdeec5bb | [
"Apache-2.0"
] | null | null | null | jccli/errors.py | zaro0508/jccli | 1de9a7f493d14bbbe6f3d201eb1aa989cdeec5bb | [
"Apache-2.0"
] | null | null | null | jccli/errors.py | zaro0508/jccli | 1de9a7f493d14bbbe6f3d201eb1aa989cdeec5bb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
.. currentmodule:: jccli.errors.py
.. moduleauthor:: zaro0508 <zaro0508@gmail.com>
Exceptions
"""
class JcCliError(Exception):
"""
Base class for all JC CLI errors
"""
class SystemUserNotFoundError(JcCliError):
"""
Jumpcloud system user is not found
"""
class Gr... | 17.114286 | 47 | 0.649416 |
2d5d4645026898f173e67af899229420c00e39f2 | 6,785 | py | Python | config-dump.py | Bond-o/config-dump | f472034850c0138a798a422fc3b32e8b68b57b0f | [
"MIT"
] | null | null | null | config-dump.py | Bond-o/config-dump | f472034850c0138a798a422fc3b32e8b68b57b0f | [
"MIT"
] | null | null | null | config-dump.py | Bond-o/config-dump | f472034850c0138a798a422fc3b32e8b68b57b0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
__author__ = "Mike Bond"
__copyright__ = "Copyright (c) 2021"
__license__ = "MIT"
__originalDate__ = "20210805"
__modifiedDate__ = "20210805"
__version__ = "0.1"
__maintainer__ = "Mike Bond"
__status__ = "Beta"
"""
config-dump.py executes the snmpset binary and passes Cisco SNMP OID to download... | 37.905028 | 122 | 0.572587 |
d87a8062481fbda6380f5c5a7e7cb4de861a28e9 | 1,327 | py | Python | src/11/implementing_remote_procedure_call/jsonrpcserver.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 14 | 2017-05-20T04:06:46.000Z | 2022-01-23T06:48:45.000Z | src/11/implementing_remote_procedure_call/jsonrpcserver.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | src/11/implementing_remote_procedure_call/jsonrpcserver.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 15 | 2017-03-29T17:57:33.000Z | 2021-08-24T02:20:08.000Z | # rpcserver.py
import json
class RPCHandler:
def __init__(self):
self._functions = { }
def register_function(self, func):
self._functions[func.__name__] = func
def handle_connection(self, connection):
try:
while True:
# Receive a message
... | 26.019608 | 71 | 0.610399 |
71eaab5839846340e576f1a337c25f9b0a34a8aa | 2,090 | py | Python | tempest/api/object_storage/test_account_services_negative.py | NetApp/tempest | dd86b1517ec5ac16c26975ed0ce0d8b7ddcac6cc | [
"Apache-2.0"
] | null | null | null | tempest/api/object_storage/test_account_services_negative.py | NetApp/tempest | dd86b1517ec5ac16c26975ed0ce0d8b7ddcac6cc | [
"Apache-2.0"
] | null | null | null | tempest/api/object_storage/test_account_services_negative.py | NetApp/tempest | dd86b1517ec5ac16c26975ed0ce0d8b7ddcac6cc | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Joe H. Rahme <joe.hakim.rahme@enovance.com>
#
# 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://... | 38.703704 | 78 | 0.677033 |
49336efae7ad8ab0ed8d9f0b0ab614569ef39185 | 3,883 | py | Python | dot_weechat/python/unhighlight.py | benmezger/new-dotfiles | 5aa41015bd017d0e4cc39edf374ca73e8c25b8cb | [
"MIT"
] | 68 | 2016-09-28T12:51:20.000Z | 2022-02-25T15:33:16.000Z | dot_weechat/python/unhighlight.py | benmezger/new-dotfiles | 5aa41015bd017d0e4cc39edf374ca73e8c25b8cb | [
"MIT"
] | null | null | null | dot_weechat/python/unhighlight.py | benmezger/new-dotfiles | 5aa41015bd017d0e4cc39edf374ca73e8c25b8cb | [
"MIT"
] | 2 | 2016-09-28T12:51:28.000Z | 2022-01-11T10:26:44.000Z | #
# Copyright (C) 2016 Andrew Rodgers-Schatz <me@andrew.rs>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This p... | 35.3 | 153 | 0.733969 |
99e52c94b940ce17fd297684c6337b12ad2027f6 | 290 | py | Python | tests/node/test_serialization.py | Vernacular-ai/lute | b943c441d7fce6f7431eb413e13577260276b469 | [
"MIT"
] | 1 | 2021-06-27T01:54:36.000Z | 2021-06-27T01:54:36.000Z | tests/node/test_serialization.py | Vernacular-ai/lute | b943c441d7fce6f7431eb413e13577260276b469 | [
"MIT"
] | null | null | null | tests/node/test_serialization.py | Vernacular-ai/lute | b943c441d7fce6f7431eb413e13577260276b469 | [
"MIT"
] | 1 | 2021-06-27T02:12:34.000Z | 2021-06-27T02:12:34.000Z | import json
from lute.node import Constant
def test_serialization():
class Dummy:
pass
c = Constant({1: Dummy()})
c.value
try:
json.dumps(Dummy())
except TypeError as e:
message = str(e)
assert json.loads(c.dumps())["value"] == message
| 15.263158 | 52 | 0.589655 |
1c19905c43ffd32faac78173baf9d4a7c0d79cc5 | 3,146 | py | Python | Works/L4_BabyNames/milestone1.py | jackchienchen/StanCode-SC101 | 7a5b9256b128e58482ca37d8f5ab76483be971be | [
"MIT"
] | 2 | 2022-01-26T10:18:23.000Z | 2022-01-26T10:18:24.000Z | Works/L4_BabyNames/milestone1.py | jackchienchen/StanCode-SC101 | 7a5b9256b128e58482ca37d8f5ab76483be971be | [
"MIT"
] | null | null | null | Works/L4_BabyNames/milestone1.py | jackchienchen/StanCode-SC101 | 7a5b9256b128e58482ca37d8f5ab76483be971be | [
"MIT"
] | null | null | null | """
File: milestone1.py
Name: Jack Chen
-----------------------
This file tests the milestone 1 for
our babyname.py project
"""
import sys
def add_data_for_name(name_data, year, rank, name):
"""
Adds the given year and rank to the associated name in the name_data dict.
Input:
name_data (dict): d... | 32.43299 | 107 | 0.511443 |
1cbdd1d75a0efccd90f6ce4900364c4221310479 | 1,733 | py | Python | Incident-Response/Tools/cyphon/cyphon/monitors/views.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/cyphon/cyphon/monitors/views.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/cyphon/cyphon/monitors/views.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | # -*- coding: utf-8 -*-
# Copyright 2017-2019 ControlScan, Inc.
#
# This file is part of Cyphon Engine.
#
# Cyphon Engine is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# Cyphon En... | 32.092593 | 71 | 0.722447 |
4df2692e155faba8efad711cd87cac362e45ff36 | 12,813 | py | Python | test/transaction/test_canoser.py | Xing-Huang/libra-client | bf74bc66b98a279476d751b637b1f84da84a51fe | [
"MIT"
] | null | null | null | test/transaction/test_canoser.py | Xing-Huang/libra-client | bf74bc66b98a279476d751b637b1f84da84a51fe | [
"MIT"
] | null | null | null | test/transaction/test_canoser.py | Xing-Huang/libra-client | bf74bc66b98a279476d751b637b1f84da84a51fe | [
"MIT"
] | null | null | null | from libra.transaction import *
from libra.access_path import AccessPath
from canoser import *
#import pdb
def test_access_path_canonical_serialization_example():
account_address = [
0x9a, 0x1a, 0xd0, 0x97, 0x42, 0xd1, 0xff, 0xc6, 0x2e, 0x65, 0x9e, 0x9a, 0x77, 0x97, 0x80,
0x8b, 0x20, 0x6f, ... | 48.350943 | 98 | 0.609225 |
aef9edf9444ef7915b8251bf21fbfde9b9ce9770 | 3,421 | py | Python | neural_networks/discrete_soft_actor_critic.py | FedePeralta/ASVs_Deep_Reinforcement_Learning_with_CNNs | 23b9b181499a4b06f2ca2951c002359c1959e727 | [
"MIT"
] | 4 | 2021-03-22T12:42:55.000Z | 2021-12-13T03:03:52.000Z | neural_networks/discrete_soft_actor_critic.py | FedePeralta/ASVs_Deep_Reinforcement_Learning_with_CNNs | 23b9b181499a4b06f2ca2951c002359c1959e727 | [
"MIT"
] | null | null | null | neural_networks/discrete_soft_actor_critic.py | FedePeralta/ASVs_Deep_Reinforcement_Learning_with_CNNs | 23b9b181499a4b06f2ca2951c002359c1959e727 | [
"MIT"
] | 1 | 2021-03-22T12:48:21.000Z | 2021-03-22T12:48:21.000Z | from abc import ABC
import torch as T
import torch.nn as nn
import torch.nn.functional as F
class Convolutional_ActorNetwork(nn.Module, ABC):
"""
Convolutional Neural Network for the actor.
The Output corresponds with a Softmax layer representing
the probability of select an action a -> P(a|s) = pi(s,... | 29.491379 | 109 | 0.602163 |
a57e66e4cb223af8552dd8db599986960e14c875 | 1,064 | py | Python | cart/views.py | dipikamarathe/project2 | 78f5ecf4dcd568ab82436ab87ec64e0676039aab | [
"MIT"
] | null | null | null | cart/views.py | dipikamarathe/project2 | 78f5ecf4dcd568ab82436ab87ec64e0676039aab | [
"MIT"
] | 28 | 2020-10-26T16:51:38.000Z | 2022-01-13T03:32:54.000Z | cart/views.py | dipikamarathe/project2 | 78f5ecf4dcd568ab82436ab87ec64e0676039aab | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.http import require_POST
from shop.models import Product
from .cart import Cart
from .forms import CartAddProductForm
@require_POST
def cart_add(request, product_id):
cart = Cart(request)
product = get_object_or_404(... | 31.294118 | 115 | 0.711466 |
996d925dfe9d3a28280a747dac8ad15a742f43bc | 1,248 | py | Python | unit_test.py | gpwork4u/Facebooker | 4a78c9575d5f36a402d7e489b69058d4e1692ce4 | [
"MIT"
] | 26 | 2020-05-29T02:41:05.000Z | 2022-03-25T17:27:32.000Z | unit_test.py | gpwork4u/Facebooker | 4a78c9575d5f36a402d7e489b69058d4e1692ce4 | [
"MIT"
] | 7 | 2020-05-28T06:09:22.000Z | 2021-10-02T05:22:38.000Z | unit_test.py | gpwork4u/Facebooker | 4a78c9575d5f36a402d7e489b69058d4e1692ce4 | [
"MIT"
] | 9 | 2020-05-28T05:40:25.000Z | 2022-02-13T21:48:01.000Z | from Facebooker import facebook
from test_constant import *
import unittest
class FBUnitTest(unittest.TestCase):
fb = facebook.API()
def __init__(self, *args):
self.fb.login(EMAIL,
PASSWORD)
super().__init__(*args)
def test_login(self):
self.assertTrue(self.... | 30.439024 | 71 | 0.694712 |
91dca4f65187b544b704a30207422e1d0f0362f0 | 5,183 | py | Python | kubernetes_asyncio/client/models/v1_resource_requirements.py | opsani/kubernetes_asyncio | 55283bf6f3690e5c0a0c589cd752221511e2be51 | [
"Apache-2.0"
] | 196 | 2018-05-23T16:55:41.000Z | 2022-03-31T10:09:40.000Z | kubernetes_asyncio/client/models/v1_resource_requirements.py | tomplus/kubernetes_asyncio | e8c8686ec11be3a5295ae9d5d8728299492a61f8 | [
"Apache-2.0"
] | 164 | 2018-05-20T20:39:03.000Z | 2022-03-29T22:57:04.000Z | kubernetes_asyncio/client/models/v1_resource_requirements.py | opsani/kubernetes_asyncio | 55283bf6f3690e5c0a0c589cd752221511e2be51 | [
"Apache-2.0"
] | 41 | 2018-06-08T00:39:53.000Z | 2022-01-12T18:19:06.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.18.20
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 34.324503 | 328 | 0.628593 |
692cb5888e783753383b7aca2809910c23812fa1 | 6,122 | py | Python | bcbio/variation/realign.py | arvados/bcbio-nextgen | 2a5cfa8c3a1d540bb2f2e66f51835042195cbc87 | [
"MIT"
] | 3 | 2015-11-18T07:17:54.000Z | 2021-04-28T13:58:37.000Z | bcbio/variation/realign.py | yong27/bcbio-nextgen | 9320479d8f21677b61ed1274b4da23d569c686ae | [
"MIT"
] | null | null | null | bcbio/variation/realign.py | yong27/bcbio-nextgen | 9320479d8f21677b61ed1274b4da23d569c686ae | [
"MIT"
] | null | null | null | """Perform realignment of BAM files around indels using the GATK toolkit.
"""
import os
import shutil
from contextlib import closing
import pysam
from bcbio import bam, broad
from bcbio.bam import ref
from bcbio.log import logger
from bcbio.utils import file_exists
from bcbio.distributed.transaction import file_trans... | 42.513889 | 89 | 0.579222 |
9a5101c7e3e60bc47a68ef24e9d88e27c1456dc2 | 6,999 | py | Python | pos_tagging/probe_train4.py | ecacikgoz97/Probing | 5df8f9fedeffdd2c6f9328b6ff47e36adca49dbb | [
"MIT"
] | null | null | null | pos_tagging/probe_train4.py | ecacikgoz97/Probing | 5df8f9fedeffdd2c6f9328b6ff47e36adca49dbb | [
"MIT"
] | null | null | null | pos_tagging/probe_train4.py | ecacikgoz97/Probing | 5df8f9fedeffdd2c6f9328b6ff47e36adca49dbb | [
"MIT"
] | null | null | null | # -----------------------------------------------------------
# Date: 2021/12/19
# Author: Muge Kural
# Description: Trainer of surface form pos tagging probe, saves the results under ./results directory.
# -----------------------------------------------------------
import sys, argparse, random, torch, js... | 39.542373 | 119 | 0.66781 |
f05bb19d99e2d1c6132a3e99f6cb2134d451f693 | 6,086 | py | Python | qa/rpc-tests/proxy_test.py | LordSoylent/dextro-1 | 71514bc58170e65168e72925af85c3479bec873b | [
"MIT"
] | 14 | 2018-04-27T06:47:08.000Z | 2021-06-29T21:39:38.000Z | qa/rpc-tests/proxy_test.py | LordSoylent/dextro-1 | 71514bc58170e65168e72925af85c3479bec873b | [
"MIT"
] | 4 | 2018-05-21T13:14:59.000Z | 2019-06-15T22:59:08.000Z | qa/rpc-tests/proxy_test.py | LordSoylent/dextro-1 | 71514bc58170e65168e72925af85c3479bec873b | [
"MIT"
] | 24 | 2018-04-22T04:12:40.000Z | 2020-12-08T19:26:43.000Z | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Conf... | 41.684932 | 145 | 0.652317 |
34cc15f8bce373649ab99a47c02d283759e0918f | 461 | py | Python | plotly/validators/ohlc/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/ohlc/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/ohlc/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name='token', parent_name='ohlc.stream', **kwargs
):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | 25.611111 | 70 | 0.598698 |
6f1d47cbac07337a28b9b63a7ee97db69afa22aa | 1,355 | py | Python | contratospr/contracts/search.py | jycordero/contratospr-api | 6778b02b42305aa7ce65c956a0d89029ddd857a4 | [
"Apache-2.0"
] | 15 | 2019-02-26T12:40:18.000Z | 2020-01-24T00:58:00.000Z | contratospr/contracts/search.py | jycordero/contratospr-api | 6778b02b42305aa7ce65c956a0d89029ddd857a4 | [
"Apache-2.0"
] | 52 | 2019-02-13T03:54:34.000Z | 2020-01-20T16:39:56.000Z | contratospr/contracts/search.py | jycordero/contratospr-api | 6778b02b42305aa7ce65c956a0d89029ddd857a4 | [
"Apache-2.0"
] | 6 | 2019-02-18T13:59:55.000Z | 2019-11-30T23:36:43.000Z | from django.contrib.postgres.fields import JSONField
from django.contrib.postgres.search import SearchQuery
from django.db.models.functions import Cast
from ..utils.search import SearchVector
from .models import Contract
search_vector = (
SearchVector(Cast("document__pages", JSONField()))
+ SearchVector("cont... | 26.568627 | 72 | 0.690037 |
fc27781cf09b811e761f8faae0664c359a7b6a96 | 92,725 | py | Python | ghostwriter/reporting/views.py | unashamedgeek/Ghostwriter | a1d221d60526d16d91864e00b2dd8bcce9f326e2 | [
"BSD-3-Clause"
] | null | null | null | ghostwriter/reporting/views.py | unashamedgeek/Ghostwriter | a1d221d60526d16d91864e00b2dd8bcce9f326e2 | [
"BSD-3-Clause"
] | null | null | null | ghostwriter/reporting/views.py | unashamedgeek/Ghostwriter | a1d221d60526d16d91864e00b2dd8bcce9f326e2 | [
"BSD-3-Clause"
] | null | null | null | """This contains all of the views used by the Reporting application."""
# Standard Libraries
import io
import json
import logging
import logging.config
import os
import zipfile
from asgiref.sync import async_to_sync
from datetime import datetime
from socket import gaierror
# Django Imports
from django.conf import set... | 35.229863 | 152 | 0.578291 |
b1c1365ed5886f806cb635c2bc0c991980ceb205 | 11,362 | py | Python | bnpy/ioutil/ModelReader.py | co2meal/-bnpy-dev | 74f69afde6c9dac8de4c074842df53ae87a15ac1 | [
"BSD-3-Clause"
] | null | null | null | bnpy/ioutil/ModelReader.py | co2meal/-bnpy-dev | 74f69afde6c9dac8de4c074842df53ae87a15ac1 | [
"BSD-3-Clause"
] | null | null | null | bnpy/ioutil/ModelReader.py | co2meal/-bnpy-dev | 74f69afde6c9dac8de4c074842df53ae87a15ac1 | [
"BSD-3-Clause"
] | null | null | null | '''
ModelReader.py
Load bnpy models from disk
See Also
-------
ModelWriter.py : save bnpy models to disk.
'''
import numpy as np
import scipy.io
import os
import glob
from ModelWriter import makePrefixForLap
from bnpy.allocmodel import AllocModelConstructorsByName
from bnpy.obsmodel import ObsModelConstructorsByName... | 34.017964 | 78 | 0.617321 |
fb24c6fb6c0180add67d9e0b3bd1850752dafa7d | 18,370 | py | Python | old/determined-xd/model_grid.py | rtu715/NAS-Bench-360 | d075006848c664371855c34082b0a00cda62be67 | [
"MIT"
] | 10 | 2021-06-15T17:48:34.000Z | 2022-02-23T18:34:28.000Z | old/determined-xd/model_grid.py | rtu715/NAS-Bench-360 | d075006848c664371855c34082b0a00cda62be67 | [
"MIT"
] | 1 | 2021-11-12T15:12:38.000Z | 2021-11-12T19:38:00.000Z | old/determined-xd/model_grid.py | rtu715/NAS-Bench-360 | d075006848c664371855c34082b0a00cda62be67 | [
"MIT"
] | 1 | 2021-11-15T04:07:17.000Z | 2021-11-15T04:07:17.000Z |
import tempfile
from typing import Any, Dict, Sequence, Tuple, Union, cast
from functools import partial, reduce
import operator
import boto3
import os
import json
import numpy as np
import torch
import torchvision
from torch import nn
from torchvision import transforms
import torch.nn.functional as F
from determi... | 39.085106 | 167 | 0.566304 |
dcc43b5406c4cf234cc14dcbc3b846b2ca1fa52f | 59,609 | py | Python | src/qibo/abstractions/gates.py | daxkoh/qibo | 5b98a7442cd314f095adf6217fef03308fb13ece | [
"Apache-2.0"
] | null | null | null | src/qibo/abstractions/gates.py | daxkoh/qibo | 5b98a7442cd314f095adf6217fef03308fb13ece | [
"Apache-2.0"
] | null | null | null | src/qibo/abstractions/gates.py | daxkoh/qibo | 5b98a7442cd314f095adf6217fef03308fb13ece | [
"Apache-2.0"
] | 1 | 2022-03-28T17:52:46.000Z | 2022-03-28T17:52:46.000Z | # -*- coding: utf-8 -*-
# @authors: S. Carrazza and A. Garcia
import math
from abc import abstractmethod
from qibo.config import raise_error, EINSUM_CHARS
from typing import Dict, List, Optional, Tuple
from qibo.abstractions.abstract_gates import Gate, Channel, SpecialGate, ParametrizedGate
QASM_GATES = {"h": "H", "x"... | 35.084756 | 199 | 0.567834 |
08bf7ad6d99fbc2e56b9562e402bbe75f20d499f | 4,634 | py | Python | pos_orders_history_return/models/pos_order.py | ShaheenHossain/itpp-labs_pos-addons | 8c5047af10447eb3d137c84111127fae1a8970b6 | [
"MIT"
] | null | null | null | pos_orders_history_return/models/pos_order.py | ShaheenHossain/itpp-labs_pos-addons | 8c5047af10447eb3d137c84111127fae1a8970b6 | [
"MIT"
] | null | null | null | pos_orders_history_return/models/pos_order.py | ShaheenHossain/itpp-labs_pos-addons | 8c5047af10447eb3d137c84111127fae1a8970b6 | [
"MIT"
] | 4 | 2020-08-25T01:49:14.000Z | 2021-04-04T10:29:04.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
# License MIT (https://opensource.org/licenses/MIT).
import logging
import psycopg2
from odoo import _, api, fields, models, tools
from odoo.tools import float_is_zero
_logger = logging.getLogger(__name__)
class ... | 41.375 | 88 | 0.554596 |
dbd14afeeaac7a4701ee03615e03bd69f9454a73 | 3,735 | py | Python | timm/data/lmdb_loader.py | lusinlu/pytorch-image-models | 7c85407bda63dd29217ee36948a0e16d20927f48 | [
"Apache-2.0"
] | 1 | 2020-06-24T07:56:21.000Z | 2020-06-24T07:56:21.000Z | timm/data/lmdb_loader.py | lusinlu/pytorch-image-models | 7c85407bda63dd29217ee36948a0e16d20927f48 | [
"Apache-2.0"
] | null | null | null | timm/data/lmdb_loader.py | lusinlu/pytorch-image-models | 7c85407bda63dd29217ee36948a0e16d20927f48 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import six
import string
import argparse
import lmdb
import pickle
import msgpack
import tqdm
from PIL import Image
import torch
import torch.utils.data as data
from torch.utils.data import DataLoader
from torchvision.transforms import transforms
from torchvision.datasets import ImageFolder
from ... | 29.88 | 88 | 0.636948 |
9cc3d2f74e6fc16d20c9c59555224db3e06d7468 | 4,692 | py | Python | Classification_emotion.py | brendaspears/Intelligent-System-Final-Project | 897f098e2dc6ebbf0b60de20d37092444d52c579 | [
"MIT"
] | null | null | null | Classification_emotion.py | brendaspears/Intelligent-System-Final-Project | 897f098e2dc6ebbf0b60de20d37092444d52c579 | [
"MIT"
] | null | null | null | Classification_emotion.py | brendaspears/Intelligent-System-Final-Project | 897f098e2dc6ebbf0b60de20d37092444d52c579 | [
"MIT"
] | null | null | null | from __future__ import print_function
import keras
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense,Dropout,Activation,Flatten,BatchNormalization
from keras.layers import Conv2D,MaxPooling2D
import os
num_classes = 5
img_rows,img_cols = 48,48
b... | 22.666667 | 119 | 0.680733 |
294c66a9f83a6444f3a7cfdc87e65ff75f718c20 | 3,341 | py | Python | main.py | yE-os/lenovo_auto_signin | 10b26a29cc43c56a9cec6ad8ecb6a730769acf9c | [
"Apache-2.0"
] | 2 | 2021-04-04T05:31:20.000Z | 2021-04-05T23:36:01.000Z | main.py | yE-os/lenovo_auto_signin | 10b26a29cc43c56a9cec6ad8ecb6a730769acf9c | [
"Apache-2.0"
] | null | null | null | main.py | yE-os/lenovo_auto_signin | 10b26a29cc43c56a9cec6ad8ecb6a730769acf9c | [
"Apache-2.0"
] | null | null | null | import os
import requests
from bs4 import BeautifulSoup
import json
USERNAME = '17607096003'
PASSWORD = 'yyl19980316'
WID = 'wwbbcdca597778242d'
SECRET = 'sqYysdzza56QTzdJBTTRhRlOUjdrGThLT8mCMqom5lU'
ID = '1000002'
HEADER_GET = {
"user-agent": "Mozilla/5.0 (Linux; Android 11; Mi 10 Build/RKQ1.200826.002; wv) Appl... | 39.77381 | 550 | 0.676743 |
9c9210d6548dc4680abd7c7085a692c5373c4c46 | 4,617 | py | Python | src/compas_igs/ui/Rhino/IGS/dev/IGS_unified_diagram_cmd.py | BlockResearchGroup/compas-IGS | b40698466b91c867600b94ae2530b19d336ad1b0 | [
"MIT"
] | 1 | 2021-11-03T23:22:37.000Z | 2021-11-03T23:22:37.000Z | src/compas_igs/ui/Rhino/IGS/dev/IGS_unified_diagram_cmd.py | BlockResearchGroup/compas-IGS | b40698466b91c867600b94ae2530b19d336ad1b0 | [
"MIT"
] | 1 | 2021-11-10T03:27:58.000Z | 2021-11-17T13:51:17.000Z | src/compas_igs/ui/Rhino/IGS/dev/IGS_unified_diagram_cmd.py | BlockResearchGroup/compas-IGS | b40698466b91c867600b94ae2530b19d336ad1b0 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas
from compas.geometry import centroid_points
from compas.geometry import subtract_vectors
from compas.geometry import scale_vector
from compas.geometry import distance_point_point_xy
import scrip... | 33.948529 | 147 | 0.610136 |
d4c4ef0f4b28aaf8b854c1a983be675041943305 | 1,444 | py | Python | setup.py | stweil/sbb_ner | 319c29fc96667937f85d2cba111902386c95ba23 | [
"Apache-2.0"
] | 9 | 2019-08-27T16:13:17.000Z | 2021-06-18T06:58:25.000Z | setup.py | stweil/sbb_ner | 319c29fc96667937f85d2cba111902386c95ba23 | [
"Apache-2.0"
] | 2 | 2020-01-13T12:50:37.000Z | 2022-01-28T10:51:06.000Z | setup.py | stweil/sbb_ner | 319c29fc96667937f85d2cba111902386c95ba23 | [
"Apache-2.0"
] | 1 | 2019-09-07T20:40:09.000Z | 2019-09-07T20:40:09.000Z | from io import open
from setuptools import find_packages, setup
with open('requirements.txt') as fp:
install_requires = fp.read()
setup(
name="qurator-sbb-ner",
version="0.0.1",
author="The Qurator Team",
author_email="qurator@sbb.spk-berlin.de",
description="Qurator",
long_description=ope... | 37.025641 | 90 | 0.653047 |
c92f6741082316ef813f51e11ee2273268685838 | 8,559 | py | Python | ros/src/waypoint_updater/waypoint_updater.py | anonymint/udacity-self-driving-p13-capstone | 16ae005bd985dd7ef9dbd1e35047f91f0c3bdaef | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | anonymint/udacity-self-driving-p13-capstone | 16ae005bd985dd7ef9dbd1e35047f91f0c3bdaef | [
"MIT"
] | 3 | 2018-08-20T03:42:38.000Z | 2018-08-21T14:11:41.000Z | ros/src/waypoint_updater/waypoint_updater.py | anonymint/udacity-self-driving-p13-capstone | 16ae005bd985dd7ef9dbd1e35047f91f0c3bdaef | [
"MIT"
] | 3 | 2018-08-15T11:58:43.000Z | 2018-08-24T04:32:58.000Z | #!/usr/bin/env python
"""
This node will publish waypoints from the car's current position to some `x` distance ahead.
As mentioned in the doc, you should ideally first implement a version which does not care
about traffic lights or obstacles.
Once you have created dbw_node, you will update this node to use the statu... | 36.576923 | 109 | 0.644234 |
63af11c7d7b62ff2ce77e12daf355833f85f46e9 | 7,649 | py | Python | tests/modules/test_processing.py | geomatikzh/openadms-node | aedfdc0b20e5e2cd668090f97a6bbb0b9c59d658 | [
"BSD-2-Clause"
] | null | null | null | tests/modules/test_processing.py | geomatikzh/openadms-node | aedfdc0b20e5e2cd668090f97a6bbb0b9c59d658 | [
"BSD-2-Clause"
] | null | null | null | tests/modules/test_processing.py | geomatikzh/openadms-node | aedfdc0b20e5e2cd668090f97a6bbb0b9c59d658 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3.6
"""Tests the classes of the processing modules."""
__author__ = 'Philipp Engel'
__copyright__ = 'Copyright (c) 2017 Hochschule Neubrandenburg'
__license__ = 'BSD-2-Clause'
from typing import List
import pytest
from testfixtures import LogCapture
from core.observation import Observation
fr... | 34.768182 | 78 | 0.599425 |
f4c01d21c61a514047eaff9d29806222f40f5052 | 1,587 | py | Python | lib/rotaryencoder.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | lib/rotaryencoder.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 7 | 2021-02-19T20:00:08.000Z | 2022-01-14T10:51:12.000Z | lib/rotaryencoder.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z |
import time
import board
from digitalio import DigitalInOut, Direction, Pull
ROTARY_NO_MOTION = 0
ROTARY_CCW = 1
ROTARY_CW = 2
class RotaryEncoder:
def timeInMillis(self):
return int(time.monotonic() * 1000)
def __init__(self, aPin=board.GP12, bPin=board.GP10, bluePin=board.GP14):
... | 33.765957 | 77 | 0.604915 |
9f58c1ef62d38d358f3768f3c4eaccaaf713ee28 | 636 | py | Python | {{cookiecutter.profile_name}}/lsf_status.py | iromeo/generic-enhanced | c4b6d3972346197551228030352f554e521fa82b | [
"MIT"
] | null | null | null | {{cookiecutter.profile_name}}/lsf_status.py | iromeo/generic-enhanced | c4b6d3972346197551228030352f554e521fa82b | [
"MIT"
] | null | null | null | {{cookiecutter.profile_name}}/lsf_status.py | iromeo/generic-enhanced | c4b6d3972346197551228030352f554e521fa82b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import subprocess
jobid = sys.argv[1]
# print("Checking status for Job ID <" + jobid + ">...", file=sys.stderr)
out = subprocess.run(
# fix output format using -o because user's columns order could be custom
['bjobs', '-noheader', '-o', 'stat:', jobid],
stdout=subprocess... | 22.714286 | 77 | 0.602201 |
72b9db5ea31fa1e37a4b9f8139106e1f4c7110cf | 61,370 | py | Python | test/test_site_api.py | pdeardorff-r7/vm-console-client-python | 4bee83aa4db2b328ba6894cebac55743f922ce5a | [
"MIT"
] | null | null | null | test/test_site_api.py | pdeardorff-r7/vm-console-client-python | 4bee83aa4db2b328ba6894cebac55743f922ce5a | [
"MIT"
] | null | null | null | test/test_site_api.py | pdeardorff-r7/vm-console-client-python | 4bee83aa4db2b328ba6894cebac55743f922ce5a | [
"MIT"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 103.142857 | 48,043 | 0.511748 |
184a031b397e07a4967ebc22e6ecfb412ccd1bbd | 47,359 | py | Python | pirates/leveleditor/worldData/anvil_island_area_barbossa_cave.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 3 | 2021-02-25T06:38:13.000Z | 2022-03-22T07:00:15.000Z | pirates/leveleditor/worldData/anvil_island_area_barbossa_cave.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | null | null | null | pirates/leveleditor/worldData/anvil_island_area_barbossa_cave.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 1 | 2021-02-25T06:38:17.000Z | 2021-02-25T06:38:17.000Z | # uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.leveleditor.worldData.anvil_island_area_barbossa_cave
from pandac.PandaModules import Point3, VBase3, Vec4, Vec3
objectStruct = ... | 6,765.571429 | 46,900 | 0.651703 |
d22140d153ace32084ba418234769152e33d218a | 1,881 | py | Python | main4.py | Ethan-source/E01b-Smiles | 053c5b5a7ad6f2d51c68e307e932f75efdb70c09 | [
"MIT"
] | null | null | null | main4.py | Ethan-source/E01b-Smiles | 053c5b5a7ad6f2d51c68e307e932f75efdb70c09 | [
"MIT"
] | null | null | null | main4.py | Ethan-source/E01b-Smiles | 053c5b5a7ad6f2d51c68e307e932f75efdb70c09 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import utils, open_color, arcade
utils.check_version((3,7))
# Open the window. Set the window title and dimensions (width and height)
arcade.open_window(800, 600, "Smiley Face Example")
arcade.set_background_color(open_color.white)
# Start the render process. This must be done before any draw... | 38.387755 | 89 | 0.645401 |
aee840259fc24cdc0c4d341d475eb641a20dc226 | 2,429 | py | Python | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/OpenLiveShiftRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/OpenLiveShiftRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/OpenLiveShiftRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.824324 | 74 | 0.758748 |
dd7f961e0e016e3cc6e342d51710107de24e8c77 | 1,537 | py | Python | vendor/Adafruit_Python_DHT/Adafruit_Python_DHT_RPi/Master.py | hvos234/raspberrypi.home.website | 72376beb55167da4b5fadda51992724451166129 | [
"BSD-3-Clause"
] | null | null | null | vendor/Adafruit_Python_DHT/Adafruit_Python_DHT_RPi/Master.py | hvos234/raspberrypi.home.website | 72376beb55167da4b5fadda51992724451166129 | [
"BSD-3-Clause"
] | null | null | null | vendor/Adafruit_Python_DHT/Adafruit_Python_DHT_RPi/Master.py | hvos234/raspberrypi.home.website | 72376beb55167da4b5fadda51992724451166129 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
print 'Number of arguments:', len(sys.argv), 'arguments.'
print 'Argument List:', str(sys.argv)
# first [0] argument is master
try:
fr = sys.argv[1]
except IndexError:
print "err;no from"
sys.exit(0)
try:
to = sys.argv[2]
except Ind... | 24.396825 | 79 | 0.659727 |
e5759a591250bd790f4694038cfc3a9a4c4d0940 | 4,208 | py | Python | examples/plot_regression.py | lapaill/braindecode | d5d6e34baef1c8df092e77d1f3e757b53d0e69ea | [
"BSD-3-Clause"
] | 301 | 2020-01-15T16:40:59.000Z | 2022-03-31T05:28:00.000Z | examples/plot_regression.py | Mrswolf/braindecode | d1781c465239c45eccbf5f92e7d7a627ff985e16 | [
"BSD-3-Clause"
] | 325 | 2020-01-12T21:36:55.000Z | 2022-03-21T11:59:01.000Z | examples/plot_regression.py | Mrswolf/braindecode | d1781c465239c45eccbf5f92e7d7a627ff985e16 | [
"BSD-3-Clause"
] | 98 | 2020-01-12T21:22:42.000Z | 2022-03-24T14:36:08.000Z | """
Regression example on fake data
===============================
"""
# Authors: Lukas Gemein <l.gemein@gmail.com>
#
# License: BSD-3
import numpy as np
import pandas as pd
import torch
from skorch.callbacks import LRScheduler
from skorch.helper import predefined_split
from braindecode import EEGRegressor
from brai... | 29.843972 | 84 | 0.714354 |
6aac0d0f66d98d03d26eb51412ead3383666f8d9 | 2,883 | py | Python | ljungbox.py | SeptumCapital/TimeSeries_Notebooks_Collections | 93e22fe817a40513d06c2d1ade98bdbab7151612 | [
"MIT"
] | 32 | 2019-11-03T06:04:29.000Z | 2022-03-28T21:57:25.000Z | ljungbox.py | quantsense/TimeSeries_Notebooks_Collections | fbc93689af056a007ac0366925d55cec5096da29 | [
"MIT"
] | null | null | null | ljungbox.py | quantsense/TimeSeries_Notebooks_Collections | fbc93689af056a007ac0366925d55cec5096da29 | [
"MIT"
] | 20 | 2019-11-03T06:15:20.000Z | 2022-02-20T06:50:37.000Z |
import numpy as np
import scipy.stats
def sac(x, k=1):
"""
Sample autocorrelation (As used in statistics with normalization)
http://en.wikipedia.org/wiki/Autocorrelation
Parameters
----------
x : 1d numpy array
Signal
k : int or list of ints
Lags to calculate sample auto... | 22.700787 | 81 | 0.540062 |
e1c50626f4231b147f570d0cf9dd643073447030 | 3,628 | py | Python | tests/openwisp2/sample_users/tests.py | ShreeshaRelysys/openwisp-users | af5f95e89656cbf3dd32f2392ba6d0f1b2c4df96 | [
"BSD-3-Clause"
] | 1 | 2020-09-06T18:24:06.000Z | 2020-09-06T18:24:06.000Z | tests/openwisp2/sample_users/tests.py | ShreeshaRelysys/openwisp-users | af5f95e89656cbf3dd32f2392ba6d0f1b2c4df96 | [
"BSD-3-Clause"
] | 1 | 2022-01-24T16:44:03.000Z | 2022-01-24T16:44:03.000Z | tests/openwisp2/sample_users/tests.py | ShreeshaRelysys/openwisp-users | af5f95e89656cbf3dd32f2392ba6d0f1b2c4df96 | [
"BSD-3-Clause"
] | null | null | null | from openwisp_users.tests.test_admin import (
TestBasicUsersIntegration as BaseTestBasicUsersIntegration,
)
from openwisp_users.tests.test_admin import (
TestMultitenantAdmin as BaseTestMultitenantAdmin,
)
from openwisp_users.tests.test_admin import TestUsersAdmin as BaseTestUsersAdmin
from openwisp_users.tests... | 30.233333 | 87 | 0.724366 |
a4195392761ccf823292c9d2d9b2c7ee62ee8047 | 38,712 | py | Python | pySuStaIn/ZscoreSustain.py | ElsevierSoftwareX/SOFTX-D-21-00098 | 225e083eff46277016104ad0191b79115b9de478 | [
"MIT"
] | 1 | 2022-03-21T18:36:52.000Z | 2022-03-21T18:36:52.000Z | pySuStaIn/ZscoreSustain.py | ElsevierSoftwareX/SOFTX-D-21-00098 | 225e083eff46277016104ad0191b79115b9de478 | [
"MIT"
] | null | null | null | pySuStaIn/ZscoreSustain.py | ElsevierSoftwareX/SOFTX-D-21-00098 | 225e083eff46277016104ad0191b79115b9de478 | [
"MIT"
] | null | null | null | ###
# pySuStaIn: a Python implementation of the Subtype and Stage Inference (SuStaIn) algorithm
#
# If you use pySuStaIn, please cite the following core papers:
# 1. The original SuStaIn paper: https://doi.org/10.1038/s41467-018-05892-0
# 2. The pySuStaIn software paper: https://doi.org/10.1101/2021.06.09.447713
#
... | 53.916435 | 217 | 0.535725 |
d7cd7de94d6bdf7c759ce0366f5c364dde3a12f5 | 4,365 | py | Python | project/lib/i18n.py | feilaoda/FlickBoard | 21e6364117e336f4eb60d83f496d9fc1cb2784ae | [
"MIT"
] | 2 | 2016-07-21T08:52:30.000Z | 2017-06-15T06:31:30.000Z | project/lib/i18n.py | feilaoda/FlickBoard | 21e6364117e336f4eb60d83f496d9fc1cb2784ae | [
"MIT"
] | null | null | null | project/lib/i18n.py | feilaoda/FlickBoard | 21e6364117e336f4eb60d83f496d9fc1cb2784ae | [
"MIT"
] | null | null | null |
from lib.config import Config
from lib.cache import SimpleCache
import gettext
#from lib.app.geoip import GeoIP
class TranslationMixin(object):
"""Translation mixin class for support i18n by using methods from gettext library."""
def get_lang_by_sid(self, sid):
"""
Return user language c... | 33.576923 | 150 | 0.520733 |
a1571c4b35cdf6d8acfc67e1718d9c4dcbc9a31b | 6,041 | py | Python | test_imp_rewriter.py | cshorler/py3_import_rewriter | 57d3b4121fc7c245fa2442c276b466a1b5896344 | [
"Python-2.0"
] | null | null | null | test_imp_rewriter.py | cshorler/py3_import_rewriter | 57d3b4121fc7c245fa2442c276b466a1b5896344 | [
"Python-2.0"
] | null | null | null | test_imp_rewriter.py | cshorler/py3_import_rewriter | 57d3b4121fc7c245fa2442c276b466a1b5896344 | [
"Python-2.0"
] | null | null | null | #
# Copyright (c) 2018 - Chris HORLER
# License: Python Software Foundation V2 [https://opensource.org/licenses/Python-2.0]
#
import ast
import unittest
from itertools import zip_longest
import imp_rewriter
class ImportRewriterTests(unittest.TestCase):
def ast_eq(self, node1, node2, msg=None):
"""https:/... | 51.632479 | 116 | 0.651879 |
3130e052758b750ec66b4e9377b3e35f7e13f1f3 | 507 | py | Python | app/model/entity/estado.py | UniversidadeDeVassouras/labproghiper-2020.1-JoaoMarcosGomes-p1 | 89c4af4ef99c12edb7fec30ade6eba0b47412856 | [
"Apache-2.0"
] | null | null | null | app/model/entity/estado.py | UniversidadeDeVassouras/labproghiper-2020.1-JoaoMarcosGomes-p1 | 89c4af4ef99c12edb7fec30ade6eba0b47412856 | [
"Apache-2.0"
] | null | null | null | app/model/entity/estado.py | UniversidadeDeVassouras/labproghiper-2020.1-JoaoMarcosGomes-p1 | 89c4af4ef99c12edb7fec30ade6eba0b47412856 | [
"Apache-2.0"
] | null | null | null | class Estado:
def __init__(self, id, nome, sigla, iconeEstado, listaNoticias):
self._id = id
self._nome = nome
self._sigla = sigla
self._iconeEstado = iconeEstado
self._listaNoticias = listaNoticias
def getId(self):
return self._id
def getNome(self):
... | 28.166667 | 68 | 0.631164 |
6712b0c1992f2e64bd0747fa79bc19611460e17b | 309 | py | Python | libnd4j/include/graph/generated/nd4j/graph/UIEventSubtype.py | mjlorenzo305/deeplearning4j | a1fcc5f19f0f637e83252b00982b3f12b401f679 | [
"Apache-2.0"
] | 13,006 | 2015-02-13T18:35:31.000Z | 2022-03-18T12:11:44.000Z | libnd4j/include/graph/generated/nd4j/graph/UIEventSubtype.py | pxiuqin/deeplearning4j | e11ddf3c24d355b43d36431687b807c8561aaae4 | [
"Apache-2.0"
] | 5,319 | 2015-02-13T08:21:46.000Z | 2019-06-12T14:56:50.000Z | libnd4j/include/graph/generated/nd4j/graph/UIEventSubtype.py | pxiuqin/deeplearning4j | e11ddf3c24d355b43d36431687b807c8561aaae4 | [
"Apache-2.0"
] | 4,719 | 2015-02-13T22:48:55.000Z | 2022-03-22T07:25:36.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: graph
class UIEventSubtype(object):
NONE = 0
EVALUATION = 1
LOSS = 2
LEARNING_RATE = 3
TUNING_METRIC = 4
PERFORMANCE = 5
PROFILING = 6
FEATURE_LABEL = 7
PREDICTION = 8
USER_CUSTOM = 9
| 18.176471 | 68 | 0.660194 |
1041ae63887f91aa36973f8cde9f756e689327f9 | 9,383 | py | Python | examples/ui.py | Slater-Victoroff/pyjaco | 89c4e3c46399c5023b0e160005d855a01241c58a | [
"MIT"
] | 38 | 2015-01-01T18:08:59.000Z | 2022-02-18T08:57:27.000Z | examples/ui.py | dusty-phillips/pyjaco | 066895ae38d1828498e529c1875cb88df6cbc54d | [
"MIT"
] | 1 | 2020-07-15T13:30:32.000Z | 2020-07-15T13:30:32.000Z | examples/ui.py | Slater-Victoroff/pyjaco | 89c4e3c46399c5023b0e160005d855a01241c58a | [
"MIT"
] | 12 | 2016-03-07T09:30:49.000Z | 2021-09-05T20:38:47.000Z | import inspect
import pyjaco
from pyjaco.decorator import JSVar
@JSVar("items")
def get_toolbar():
items = [
{"text":'File', "menu": [
{"text": 'Open...'},
{"text": 'Save...'},
'-',
{"text": 'Close'}
]},
{"text"... | 30.267742 | 217 | 0.496217 |
6cd946b1e06bd7961e17e15bdae4beb6950578aa | 1,346 | py | Python | examples/compensated-temperature.py | iohe/bme280-python | d59fb744ef64a2c74fa24ea67ee8cda9f48d7b3b | [
"MIT"
] | 44 | 2019-06-25T00:03:30.000Z | 2022-03-25T03:04:44.000Z | examples/compensated-temperature.py | iohe/bme280-python | d59fb744ef64a2c74fa24ea67ee8cda9f48d7b3b | [
"MIT"
] | 17 | 2019-07-24T10:57:06.000Z | 2022-02-13T10:28:22.000Z | examples/compensated-temperature.py | iohe/bme280-python | d59fb744ef64a2c74fa24ea67ee8cda9f48d7b3b | [
"MIT"
] | 18 | 2019-07-02T12:02:03.000Z | 2021-11-12T07:40:34.000Z | #!/usr/bin/env python
import time
from bme280 import BME280
from subprocess import PIPE, Popen
try:
from smbus2 import SMBus
except ImportError:
from smbus import SMBus
print("""compensated-temperature.py - Use the CPU temperature to compensate temperature
readings from the BME280 sensor. Method adapted from... | 27.469388 | 98 | 0.726597 |
f881d9dba639cc00c4ad1626a8bfd92e7a0e3b1e | 946 | py | Python | hesiod/cfg/cfgparser.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | 19 | 2020-12-11T15:40:55.000Z | 2022-01-17T16:55:13.000Z | hesiod/cfg/cfgparser.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | null | null | null | hesiod/cfg/cfgparser.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Dict, List
CFG_T = Dict[str, Any]
class ConfigParser(ABC):
@staticmethod
@abstractmethod
def get_managed_extensions() -> List[str]:
"""Get the file extensions managed by the parser.
Returns:
... | 24.25641 | 70 | 0.613108 |
ff2b2dac98f6bd2f3067a75c60815ad64324a8e4 | 8,461 | py | Python | premise/utils.py | tngTUDOR/premise | f3ab48b590afaefe6ef431846561e934cac35de9 | [
"BSD-3-Clause"
] | null | null | null | premise/utils.py | tngTUDOR/premise | f3ab48b590afaefe6ef431846561e934cac35de9 | [
"BSD-3-Clause"
] | null | null | null | premise/utils.py | tngTUDOR/premise | f3ab48b590afaefe6ef431846561e934cac35de9 | [
"BSD-3-Clause"
] | null | null | null | from . import DATA_DIR
import csv
import pandas as pd
from .export import *
import numpy as np
from wurst import searching as ws
CO2_FUELS = DATA_DIR / "fuel_co2_emission_factor.txt"
LHV_FUELS = DATA_DIR / "fuels_lower_heating_value.txt"
CLINKER_RATIO_ECOINVENT_36 = DATA_DIR / "cement" / "clinker_ratio_ecoinvent_36.cs... | 38.811927 | 176 | 0.636686 |
1f69aa963cadc64c8f585a48e7a84a427e986649 | 6,486 | py | Python | meta_agents/algos/trpo.py | zhanpenghe/meta_agents | b3b4df70bab1ebe621d48eebb4c886b85c1d8323 | [
"MIT"
] | 3 | 2020-09-26T16:17:52.000Z | 2021-04-23T08:56:04.000Z | meta_agents/algos/trpo.py | zhanpenghe/meta_agents | b3b4df70bab1ebe621d48eebb4c886b85c1d8323 | [
"MIT"
] | 1 | 2019-09-03T19:57:40.000Z | 2019-09-03T19:57:40.000Z | meta_agents/algos/trpo.py | zhanpenghe/meta_agents | b3b4df70bab1ebe621d48eebb4c886b85c1d8323 | [
"MIT"
] | 1 | 2020-12-09T03:06:48.000Z | 2020-12-09T03:06:48.000Z | from collections import OrderedDict
from dowel import logger, tabular
from garage.np.algos import BatchPolopt
import torch
from torch.distributions.kl import kl_divergence
from torch.nn.utils.convert_parameters import (vector_to_parameters,
parameters_to_vector)
from met... | 35.637363 | 89 | 0.63984 |
8ea785cdecb2c63662a52ae6e5188cf60b5a24da | 21,604 | py | Python | weaver/processes/wps3_process.py | crim-ca/weaver | 107fec5e19f20b77061b9405a764da911d2db8a2 | [
"Apache-2.0"
] | 16 | 2019-03-18T12:23:05.000Z | 2022-02-25T00:39:11.000Z | weaver/processes/wps3_process.py | crim-ca/weaver | 107fec5e19f20b77061b9405a764da911d2db8a2 | [
"Apache-2.0"
] | 346 | 2019-03-06T21:05:04.000Z | 2022-03-31T13:38:37.000Z | weaver/processes/wps3_process.py | crim-ca/weaver | 107fec5e19f20b77061b9405a764da911d2db8a2 | [
"Apache-2.0"
] | 5 | 2019-03-15T01:38:28.000Z | 2021-11-11T15:38:43.000Z | import logging
import warnings
from copy import deepcopy
from time import sleep
from typing import TYPE_CHECKING
from pyramid.httpexceptions import (
HTTPConflict,
HTTPForbidden,
HTTPInternalServerError,
HTTPNotFound,
HTTPOk,
HTTPUnauthorized
)
from pyramid.settings import asbool
from weaver i... | 51.808153 | 120 | 0.625162 |
452809f16a5391640b496831a5805e9ac2f05de3 | 57,966 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_batch.py | cicovica/azure-sdk-for-python | cd8bed878f8a11d081358bf67400fb01031582b6 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_batch.py | cicovica/azure-sdk-for-python | cd8bed878f8a11d081358bf67400fb01031582b6 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_batch.py | cicovica/azure-sdk-for-python | cd8bed878f8a11d081358bf67400fb01031582b6 | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
import platform
from azure.core.exceptions import HttpRespon... | 52.553037 | 154 | 0.686747 |
73f902ac5e7eebc7b61c5dcbe4195003f461b6b3 | 9,190 | py | Python | ga_printer.py | Tb7386/GA_Post-it_thermal_printer | 8dabf33c337a96c7d40d0ba7e41eb884f14fb8b9 | [
"MIT"
] | null | null | null | ga_printer.py | Tb7386/GA_Post-it_thermal_printer | 8dabf33c337a96c7d40d0ba7e41eb884f14fb8b9 | [
"MIT"
] | null | null | null | ga_printer.py | Tb7386/GA_Post-it_thermal_printer | 8dabf33c337a96c7d40d0ba7e41eb884f14fb8b9 | [
"MIT"
] | null | null | null | #Composition de la trame
# | Header | Longueur de données | ?? | DATA | CRC8 | Fin de ligne |
# | 51:78:XX:00 | 05 | 00 | 82:7f:7f:7e:82 | 60 | ff |
# Header XX :
# - bf ou a3 : Ecriture de 384 points en RAW
# - a1 : Avancer le papier de DATA (ex: 01:00 avance de 1dp... | 39.106383 | 146 | 0.484657 |
eaa780f42e408d1f104844df15583f70812f3421 | 2,648 | py | Python | vcr/baselines/random-baseline/random_baseline.py | rlebras/mosaic-leaderboard-1 | d36713ba59a6a28f6f5db5b09e40149a3349c78f | [
"Apache-2.0"
] | 18 | 2019-07-12T09:06:40.000Z | 2022-02-10T07:50:11.000Z | vcr/baselines/random-baseline/random_baseline.py | rlebras/mosaic-leaderboard-1 | d36713ba59a6a28f6f5db5b09e40149a3349c78f | [
"Apache-2.0"
] | 4 | 2019-08-30T21:39:04.000Z | 2020-03-13T19:19:51.000Z | vcr/baselines/random-baseline/random_baseline.py | rlebras/mosaic-leaderboard-1 | d36713ba59a6a28f6f5db5b09e40149a3349c78f | [
"Apache-2.0"
] | 5 | 2019-08-05T18:47:36.000Z | 2021-01-24T05:06:11.000Z | import argparse
import json
import os
from typing import List
import numpy as np
# Parse the input file from JSONL to a list of dictionaries.
def read_jsonl_lines(input_file: str) -> List[dict]:
with open(input_file) as f:
lines = f.readlines()
return [json.loads(l.strip()) for l in lines]
def ... | 34.842105 | 100 | 0.658988 |
cd08f2cdb5fcb184ed2fc4cd84d621c3fa58a8ea | 2,031 | py | Python | easy_user_input/easy_user_input.py | generic-user1/easy-user-input | ea293ac97848b036a3d48fb4e4ab8d9dece30553 | [
"MIT"
] | null | null | null | easy_user_input/easy_user_input.py | generic-user1/easy-user-input | ea293ac97848b036a3d48fb4e4ab8d9dece30553 | [
"MIT"
] | null | null | null | easy_user_input/easy_user_input.py | generic-user1/easy-user-input | ea293ac97848b036a3d48fb4e4ab8d9dece30553 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#easy_user_input.easy_user_input - shortcut for easy_user_input.eui
#this module maps every function from the 'easy_user_input.eui'
#onto itself, allowing backwards compatibility with code using the longer name
#without having to maintain multiple copies of the same file.
#NOTE 1: this is a te... | 44.152174 | 132 | 0.760709 |
cbfaafa5135febe520f8efd6f9a0c0a7ddb708ab | 1,780 | py | Python | instaclone/models.py | Lenus254/InstaClone | b008974bee486cd8ed5cc66e2dd67426f7545064 | [
"MIT"
] | null | null | null | instaclone/models.py | Lenus254/InstaClone | b008974bee486cd8ed5cc66e2dd67426f7545064 | [
"MIT"
] | null | null | null | instaclone/models.py | Lenus254/InstaClone | b008974bee486cd8ed5cc66e2dd67426f7545064 | [
"MIT"
] | null | null | null | from email.mime import image
from django.db import models
from django.contrib.auth.models import User
from cloudinary.models import CloudinaryField
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_pic = CloudinaryField('image',default=... | 27.8125 | 82 | 0.666854 |
12d0cb1226bd4fe8fcb1d36efe79ad4a545d8197 | 15,861 | py | Python | runway/commands/base.py | GarisonLotus/runway | c371d952dc2500d4686f9f1359487d494c2136cd | [
"Apache-2.0"
] | null | null | null | runway/commands/base.py | GarisonLotus/runway | c371d952dc2500d4686f9f1359487d494c2136cd | [
"Apache-2.0"
] | null | null | null | runway/commands/base.py | GarisonLotus/runway | c371d952dc2500d4686f9f1359487d494c2136cd | [
"Apache-2.0"
] | null | null | null | """runway base module."""
from __future__ import print_function
from subprocess import check_call, check_output
import glob
import logging
import os
import shutil
import sys
import cfn_flip
import yaml
# from stacker.util import parse_cloudformation_template
# parse_cloudformation_template wraps yaml_parse; it woul... | 40.669231 | 147 | 0.535149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.