hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 11
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 251 | 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 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 251 | 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 3 251 | 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.05M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.04M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
072d38a7e1316c182e6d46a18839cb0047e95249 | 3,965 | py | Python | notes/OOBall/OOBall/main-demo.py | KRHS-GameProgramming-2015/Manpac | 959bf7f5195a4edb528fbbf25b8896fcb28d5327 | [
"BSD-2-Clause"
] | null | null | null | notes/OOBall/OOBall/main-demo.py | KRHS-GameProgramming-2015/Manpac | 959bf7f5195a4edb528fbbf25b8896fcb28d5327 | [
"BSD-2-Clause"
] | 3 | 2016-01-19T17:26:16.000Z | 2016-02-10T16:59:25.000Z | notes/OOBall/main-demo.py | KRHS-GameProgramming-2015/Manpac | 959bf7f5195a4edb528fbbf25b8896fcb28d5327 | [
"BSD-2-Clause"
] | null | null | null | import pygame_sdl2
pygame_sdl2.import_as_pygame()
import pygame
import os
import random
import math
from Ball import Ball
def save_state(balls):
"""
Saves the game state.
"""
stateString = ""
with open("state.txt", "w") as f:
for ball in balls:
stateString += "{} {} {} {} {}".f... | 28.941606 | 89 | 0.49256 |
072ddb9bbab8925228b0922af5e12f46301684b7 | 6,408 | py | Python | sprt.py | vdbergh/pentanomial | d046e74acde3f961c7afd22fc4f82fa5aeb4c0fd | [
"MIT"
] | 3 | 2020-02-05T12:39:59.000Z | 2021-01-04T15:41:40.000Z | sprt.py | vdbergh/pentanomial | d046e74acde3f961c7afd22fc4f82fa5aeb4c0fd | [
"MIT"
] | 2 | 2020-02-17T20:09:56.000Z | 2021-11-21T12:47:33.000Z | sprt.py | vdbergh/pentanomial | d046e74acde3f961c7afd22fc4f82fa5aeb4c0fd | [
"MIT"
] | null | null | null | from __future__ import division
import math, copy
import argparse
from brownian import Brownian
import scipy
import LLRcalc
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--alpha", help="probability of a false positve", type=float, default=0.05
)
parser.ad... | 33.726316 | 85 | 0.523096 |
072e395e8cbf167e556a1f0e76894f388e49246e | 17,956 | py | Python | tools/hci_throughput/hci.py | t3zeng/mynewt-nimble | e910132947d6b3cd61ef4732867382634178aa08 | [
"Apache-2.0"
] | null | null | null | tools/hci_throughput/hci.py | t3zeng/mynewt-nimble | e910132947d6b3cd61ef4732867382634178aa08 | [
"Apache-2.0"
] | null | null | null | tools/hci_throughput/hci.py | t3zeng/mynewt-nimble | e910132947d6b3cd61ef4732867382634178aa08 | [
"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... | 29.630363 | 80 | 0.695868 |
072e3ac42c4ae28edac6abdd5c5b9e36d1f69c84 | 1,253 | py | Python | examples/dataproc/query.py | populationgenomics/analysis-runner | f42bedb1dc430a813350fb4b5514bcc7b845f0fc | [
"MIT"
] | null | null | null | examples/dataproc/query.py | populationgenomics/analysis-runner | f42bedb1dc430a813350fb4b5514bcc7b845f0fc | [
"MIT"
] | 51 | 2021-01-26T07:09:54.000Z | 2022-03-29T03:44:01.000Z | examples/dataproc/query.py | populationgenomics/analysis-runner | f42bedb1dc430a813350fb4b5514bcc7b845f0fc | [
"MIT"
] | 2 | 2021-12-07T17:12:07.000Z | 2022-03-23T00:50:44.000Z | """Simple Hail query example."""
import click
import hail as hl
from bokeh.io.export import get_screenshot_as_png
from analysis_runner import output_path
GNOMAD_HGDP_1KG_MT = (
'gs://gcp-public-data--gnomad/release/3.1/mt/genomes/'
'gnomad.genomes.v3.1.hgdp_1kg_subset_dense.mt'
)
if __name__ == '__main__'... | 30.560976 | 81 | 0.695132 |
072e6fc797520341c47d9f0dd007069870cb1147 | 17,420 | py | Python | ptpip/ptpip.py | darkarnium/ptpip | c54eed4d7509ecfc6973a00496a9e80fb7473fa2 | [
"Apache-2.0"
] | null | null | null | ptpip/ptpip.py | darkarnium/ptpip | c54eed4d7509ecfc6973a00496a9e80fb7473fa2 | [
"Apache-2.0"
] | null | null | null | ptpip/ptpip.py | darkarnium/ptpip | c54eed4d7509ecfc6973a00496a9e80fb7473fa2 | [
"Apache-2.0"
] | null | null | null | import uuid
import time
import socket
import struct
| 34.701195 | 99 | 0.644259 |
072e9a202d69d5d6154bfb44a978d712661a1d52 | 869 | py | Python | examples/morpho.py | jaideep-seth/PyOpenWorm | c36baeda9590334ba810296934973da34f0eab78 | [
"MIT"
] | null | null | null | examples/morpho.py | jaideep-seth/PyOpenWorm | c36baeda9590334ba810296934973da34f0eab78 | [
"MIT"
] | null | null | null | examples/morpho.py | jaideep-seth/PyOpenWorm | c36baeda9590334ba810296934973da34f0eab78 | [
"MIT"
] | null | null | null | """
How to load morphologies of certain cells from the database.
"""
#this is an expected failure right now, as morphology is not implemented
from __future__ import absolute_import
from __future__ import print_function
import PyOpenWorm as P
from PyOpenWorm.context import Context
from PyOpenWorm.worm import Worm
from ... | 34.76 | 118 | 0.749137 |
072eb9a21b6f104ebeda43ae8b0c58030a13066f | 18,159 | py | Python | corehq/apps/app_manager/tests/test_form_workflow.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/app_manager/tests/test_form_workflow.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/app_manager/tests/test_form_workflow.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
from django.test import SimpleTestCase
from corehq.apps.app_manager.const import (
AUTO_SELECT_RAW,
AUTO_SELECT_CASE,
WORKFLOW_FORM,
WORKFLOW_MODULE,
WORKFLOW_PREVIOUS,
WORKFLOW_ROOT,
WORKFLOW_PARENT_MODULE,
)
fr... | 43.546763 | 151 | 0.654937 |
072f5247503c271ee10d989b45781d7bce312d75 | 19,888 | py | Python | tensorflow/python/compiler/tensorrt/model_tests/model_handler.py | sboshin/tensorflow | 77689016fb4c1373abeca36360f7b2dd9434c547 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/compiler/tensorrt/model_tests/model_handler.py | sboshin/tensorflow | 77689016fb4c1373abeca36360f7b2dd9434c547 | [
"Apache-2.0"
] | 88 | 2020-11-24T08:18:10.000Z | 2022-03-25T20:28:30.000Z | tensorflow/python/compiler/tensorrt/model_tests/model_handler.py | sboshin/tensorflow | 77689016fb4c1373abeca36360f7b2dd9434c547 | [
"Apache-2.0"
] | 1 | 2020-12-18T08:51:32.000Z | 2020-12-18T08:51:32.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.026769 | 86 | 0.71611 |
07301aa37090337e8a2394da6cc20cd279418591 | 34 | py | Python | Python/Python Evaluation/solution.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | Python/Python Evaluation/solution.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | Python/Python Evaluation/solution.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | eval(input("Enter a expression ")) | 34 | 34 | 0.735294 |
073032049203bfdc6f84f748cd2128bbc2872806 | 2,959 | py | Python | kpca_iris.py | syamkakarla98/Kernel-PCA-Using-Different-Kernels-With-Classification | 03302843bff9b0d87e2983bed1f37bc329e716c1 | [
"MIT"
] | 10 | 2018-07-12T11:46:21.000Z | 2021-03-13T06:47:01.000Z | kpca_iris.py | syamkakarla98/Kernel-PCA-Using-Different-Kernels-With-Classification | 03302843bff9b0d87e2983bed1f37bc329e716c1 | [
"MIT"
] | null | null | null | kpca_iris.py | syamkakarla98/Kernel-PCA-Using-Different-Kernels-With-Classification | 03302843bff9b0d87e2983bed1f37bc329e716c1 | [
"MIT"
] | 9 | 2018-09-19T11:57:44.000Z | 2021-03-13T06:47:04.000Z | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# load dataset into Pandas DataFrame
df = pd.read_csv("D:\Python_programs\ML\Iris Data\KPCA\iris.csv")
#df.to_csv('iris.csv')
from sklearn.preprocessing import StandardScaler
features = ['sepal length', 'sepal width', 'petal length', 'petal width... | 34.406977 | 78 | 0.584657 |
0730aed278d58141b67cbd8f8213146b99199686 | 13,377 | py | Python | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_extractor_config.py | felaray/Recognizers-Text | f514fd61c8d472ed92565261162712409f655312 | [
"MIT"
] | null | null | null | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_extractor_config.py | felaray/Recognizers-Text | f514fd61c8d472ed92565261162712409f655312 | [
"MIT"
] | 6 | 2021-12-20T17:13:35.000Z | 2022-03-29T08:54:11.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_extractor_config.py | felaray/Recognizers-Text | f514fd61c8d472ed92565261162712409f655312 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import List, Pattern
from recognizers_text.utilities import RegExpUtility
from recognizers_number.number import BaseNumberParser
from recognizers_number.number.italian.extractors import ItalianIntegerExtractor,... | 38.329513 | 120 | 0.729984 |
0730d1a99c54c1eeab8095b4f4102da12e701b30 | 4,704 | py | Python | pydbrepo/drivers/sqlite.py | danteay/pydbrepo | 665ad5fe64a00697128f9943e0fc831ae485f136 | [
"MIT"
] | 2 | 2021-09-03T10:54:01.000Z | 2022-01-08T18:48:20.000Z | pydbrepo/drivers/sqlite.py | danteay/pydbrepo | 665ad5fe64a00697128f9943e0fc831ae485f136 | [
"MIT"
] | null | null | null | pydbrepo/drivers/sqlite.py | danteay/pydbrepo | 665ad5fe64a00697128f9943e0fc831ae485f136 | [
"MIT"
] | 1 | 2021-12-28T17:34:40.000Z | 2021-12-28T17:34:40.000Z | """SQLite Driver implementation."""
# pylint: disable=R0201
import os
import sqlite3
from typing import Any, AnyStr, List, NoReturn, Optional, Tuple
from pydbrepo.drivers.driver import Driver
| 28.682927 | 99 | 0.605655 |
07311f534338364dbf730b4dc400d2a729b73016 | 3,036 | py | Python | Modules/BatchNormND.py | EmilPi/PuzzleLib | 31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9 | [
"Apache-2.0"
] | 52 | 2020-02-28T20:40:15.000Z | 2021-08-25T05:35:17.000Z | Modules/BatchNormND.py | EmilPi/PuzzleLib | 31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9 | [
"Apache-2.0"
] | 2 | 2021-02-14T15:57:03.000Z | 2021-10-05T12:21:34.000Z | Modules/BatchNormND.py | EmilPi/PuzzleLib | 31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9 | [
"Apache-2.0"
] | 8 | 2020-02-28T20:40:11.000Z | 2020-07-09T13:27:23.000Z | import numpy as np
from PuzzleLib import Config
from PuzzleLib.Backend import gpuarray, Blas
from PuzzleLib.Backend.Dnn import batchNormNd, batchNormNdBackward
from PuzzleLib.Variable import Variable
from PuzzleLib.Modules.Module import ModuleError, Module
| 27.351351 | 111 | 0.706522 |
07315bfc850bee7d8e4dccfb243802584bf7ccf6 | 38 | py | Python | python/testData/editing/enterInIncompleteTupleLiteral.after.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/editing/enterInIncompleteTupleLiteral.after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/editing/enterInIncompleteTupleLiteral.after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | xs = ('foo', 'bar',
'baz'<caret> | 19 | 19 | 0.421053 |
0731748ca4b74185c74c8c4352a8260f73831cf9 | 6,038 | py | Python | model/server/server.py | waltzofpearls/reckon | 533e47fd05f685024083ce7a823e9c26c35dd824 | [
"MIT"
] | 8 | 2019-09-01T12:57:38.000Z | 2022-03-25T21:54:19.000Z | model/server/server.py | waltzofpearls/reckon | 533e47fd05f685024083ce7a823e9c26c35dd824 | [
"MIT"
] | 3 | 2021-08-12T13:18:42.000Z | 2022-03-12T00:59:15.000Z | model/server/server.py | waltzofpearls/reckon | 533e47fd05f685024083ce7a823e9c26c35dd824 | [
"MIT"
] | 2 | 2021-12-22T06:56:56.000Z | 2022-03-25T21:58:19.000Z | from concurrent import futures
from forecaster.prophet import Forecaster as ProphetForecaster
from multiprocessing import Event, Process, cpu_count
from pythonjsonlogger import jsonlogger
import contextlib
import grpc
import logging
import model.api.forecast_pb2_grpc as grpc_lib
import os
import signal
import socket
im... | 41.07483 | 101 | 0.625704 |
0732a0a35499cb2f8dd3e3317232410829321054 | 191 | py | Python | test/test_setupcall.py | jhgoebbert/jupyter-libertem-proxy | 2f966744c08c14c534030c2623fe4a3a8590dabe | [
"BSD-3-Clause"
] | null | null | null | test/test_setupcall.py | jhgoebbert/jupyter-libertem-proxy | 2f966744c08c14c534030c2623fe4a3a8590dabe | [
"BSD-3-Clause"
] | null | null | null | test/test_setupcall.py | jhgoebbert/jupyter-libertem-proxy | 2f966744c08c14c534030c2623fe4a3a8590dabe | [
"BSD-3-Clause"
] | null | null | null | def test_setupcall():
"""
Test the call of the setup function
"""
import jupyter_libertem_proxy as jx
print("\nRunning test_setupcall...")
print(jx.setup_libertem())
| 21.222222 | 40 | 0.659686 |
0733497e7a5accdfb3af9d8db6169c656322604e | 14,221 | py | Python | launchpad/launch/worker_manager.py | LaudateCorpus1/launchpad | 6068bbaff9da6d9d520c01314ef920d0d4978afc | [
"Apache-2.0"
] | null | null | null | launchpad/launch/worker_manager.py | LaudateCorpus1/launchpad | 6068bbaff9da6d9d520c01314ef920d0d4978afc | [
"Apache-2.0"
] | 1 | 2021-10-05T16:06:38.000Z | 2021-10-05T16:06:38.000Z | launchpad/launch/worker_manager.py | LaudateCorpus1/launchpad | 6068bbaff9da6d9d520c01314ef920d0d4978afc | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 33.779097 | 81 | 0.660713 |
07340b73d70dfdc6b284b1403d39e1bbdf13bf8f | 1,054 | py | Python | mmdeploy/backend/tensorrt/init_plugins.py | hanrui1sensetime/mmdeploy | f2594c624b67910e55e24418832bd96685425b2f | [
"Apache-2.0"
] | 1 | 2021-12-30T06:29:46.000Z | 2021-12-30T06:29:46.000Z | mmdeploy/backend/tensorrt/init_plugins.py | wwjwy/mmdeploy | c6fccd0121618c8c4dc07f49823c377003475040 | [
"Apache-2.0"
] | null | null | null | mmdeploy/backend/tensorrt/init_plugins.py | wwjwy/mmdeploy | c6fccd0121618c8c4dc07f49823c377003475040 | [
"Apache-2.0"
] | 1 | 2022-02-10T04:31:10.000Z | 2022-02-10T04:31:10.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import ctypes
import glob
import logging
import os
def get_ops_path() -> str:
"""Get path of the TensorRT plugin library.
Returns:
str: A path of the TensorRT plugin library.
"""
wildcard = os.path.abspath(
os.path.join(
os.p... | 26.35 | 77 | 0.642315 |
0734297119899a9bd812848f57a6fbe4c63a3822 | 16,800 | py | Python | reagent/test/world_model/test_seq2reward.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | reagent/test/world_model/test_seq2reward.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | reagent/test/world_model/test_seq2reward.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import os
import random
import unittest
from typing import Optional
import numpy as np
import pytorch_lightning as pl
import torch
import torch.nn as nn
from parameterized import parameterized
from reagent.co... | 35.66879 | 88 | 0.65619 |
0734fb5dd4a56bdb2ef242b87aea0bcbb002a5dc | 142,160 | py | Python | models_SHOT_convex/syn30m03hfsg.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_SHOT_convex/syn30m03hfsg.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_SHOT_convex/syn30m03hfsg.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 01/15/21 11:37:33
#
# Equation counts
# Total E G L N X C B
# 1486 571 111 804 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 36.090378 | 120 | 0.639913 |
07354a91e0ab5c683999d760204ed42f5952201f | 15,695 | py | Python | backend/tests/test_resources.py | sartography/star-drive | c0f33378d42913c3e677e07f74eb46d7b2b82a0a | [
"MIT"
] | null | null | null | backend/tests/test_resources.py | sartography/star-drive | c0f33378d42913c3e677e07f74eb46d7b2b82a0a | [
"MIT"
] | 368 | 2018-12-18T14:43:20.000Z | 2022-03-02T02:54:18.000Z | backend/tests/test_resources.py | sartography/star-drive | c0f33378d42913c3e677e07f74eb46d7b2b82a0a | [
"MIT"
] | 2 | 2019-10-02T03:06:06.000Z | 2020-10-05T16:53:48.000Z | import unittest
from flask import json
from tests.base_test import BaseTest
from app import db, elastic_index
from app.model.resource import Resource
from app.model.resource_category import ResourceCategory
from app.model.resource_change_log import ResourceChangeLog
from app.model.user import Role
| 47.274096 | 135 | 0.649761 |
0735c43eb0b2d2d58ca5e330e9b0ab738257e5f2 | 18,432 | py | Python | kolibri/core/auth/management/commands/sync.py | reubenjacob/kolibri | 028bb2ad63e438c832ff657d37f7b05c3400f2da | [
"MIT"
] | null | null | null | kolibri/core/auth/management/commands/sync.py | reubenjacob/kolibri | 028bb2ad63e438c832ff657d37f7b05c3400f2da | [
"MIT"
] | 8 | 2021-05-21T15:31:24.000Z | 2022-02-24T15:02:14.000Z | kolibri/core/auth/management/commands/sync.py | kuboginichimaru/kolibri | 18b398f62baa1c60f8456f7f9c6d6c9447068f69 | [
"MIT"
] | 1 | 2019-10-05T11:14:40.000Z | 2019-10-05T11:14:40.000Z | import json
import logging
import math
import re
from contextlib import contextmanager
from django.core.management import call_command
from django.core.management.base import CommandError
from morango.models import Filter
from morango.models import InstanceIDModel
from morango.models import ScopeDefinition
from morang... | 34.711864 | 138 | 0.598307 |
0735ef32022db6fd8f2cae3cf86a392fe7526086 | 5,787 | py | Python | warp.py | RezaFirouzii/fum-delta-vision | 0a8ad1d434006a9aee0a12c1f021c0bca0bc87e2 | [
"MIT"
] | null | null | null | warp.py | RezaFirouzii/fum-delta-vision | 0a8ad1d434006a9aee0a12c1f021c0bca0bc87e2 | [
"MIT"
] | null | null | null | warp.py | RezaFirouzii/fum-delta-vision | 0a8ad1d434006a9aee0a12c1f021c0bca0bc87e2 | [
"MIT"
] | null | null | null | import math
import imageio
import cv2 as cv
import numpy as np
import transformer
D1 = 105
D2 = 175
D3 = 275
if __name__ == "__main__":
cap = cv.VideoCapture('samples/delta.mp4')
if not cap.isOpened():
raise IOError("Video was not opened!")
mse = 0
count = 0
reader = imageio.get_reader(... | 35.286585 | 122 | 0.556247 |
0736759453528b8e50d3977ed9f783e1f7d2c291 | 2,318 | py | Python | sdssobstools/boss_data.py | sdss/ObserverTools | 7f9949341edc91a79dac69d79e24af09e8558ffa | [
"BSD-3-Clause"
] | null | null | null | sdssobstools/boss_data.py | sdss/ObserverTools | 7f9949341edc91a79dac69d79e24af09e8558ffa | [
"BSD-3-Clause"
] | null | null | null | sdssobstools/boss_data.py | sdss/ObserverTools | 7f9949341edc91a79dac69d79e24af09e8558ffa | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
A tool to grab a single BOSS image and pull a few items from its header. It is
used in bin/sloan_log.py, but it could be used directly as well.
"""
import argparse
from pathlib import Path
from astropy.time import Time
import fitsio
if __name__ == '__main__':
main()
| 34.088235 | 78 | 0.603538 |
0736f9344c10dda2615d756c67d64d15dd48a036 | 955 | py | Python | capitulo-08/ex13b.py | bryan-lima/exercicios-livro-introd-prog-python-3ed | b6bc26dced9728510865704a80cb0d97f81f756b | [
"MIT"
] | 3 | 2021-11-09T17:54:10.000Z | 2022-01-30T22:32:25.000Z | capitulo-08/ex13b.py | bryan-lima/exercicios-livro-introd-prog-python-3ed | b6bc26dced9728510865704a80cb0d97f81f756b | [
"MIT"
] | null | null | null | capitulo-08/ex13b.py | bryan-lima/exercicios-livro-introd-prog-python-3ed | b6bc26dced9728510865704a80cb0d97f81f756b | [
"MIT"
] | null | null | null | # Altere o Programa 8.20 de forma que o usurio tenha trs chances de acertar o nmero
# O programa termina se o usurio acertar ou errar trs vezes
# Programa 8.20 do livro, pgina 184
# Programa 8.20 - Adivinhando o nmero
#
# import random
#
# n = random.randint(1, 10)
# x = int(input('Escolha um nmero entre 1 e 10: '))
#... | 27.285714 | 86 | 0.642932 |
0737281036977c90f04b5a6cdebc502ad5e24b6d | 293 | py | Python | slogviz/config.py | mariusfrinken/slogviz | 0557eda336c257245eefe75699eb2479eb672ca1 | [
"MIT"
] | 1 | 2021-05-11T06:54:28.000Z | 2021-05-11T06:54:28.000Z | slogviz/config.py | mariusfrinken/slogviz | 0557eda336c257245eefe75699eb2479eb672ca1 | [
"MIT"
] | null | null | null | slogviz/config.py | mariusfrinken/slogviz | 0557eda336c257245eefe75699eb2479eb672ca1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""This sub module provides a global variable to check for checking if the non-interactive argument was set
Exported variable:
interactive -- False, if the main the non-interactive argument was set, True, if it was not set
"""
global interactive
interactive = True; | 29.3 | 107 | 0.744027 |
0737de527d56f865ee1256abea29660c8dca454e | 894 | py | Python | setup.py | shb84/ATM76 | 433179bde8935abeaf2ace52fe17dedb7a313487 | [
"MIT"
] | null | null | null | setup.py | shb84/ATM76 | 433179bde8935abeaf2ace52fe17dedb7a313487 | [
"MIT"
] | null | null | null | setup.py | shb84/ATM76 | 433179bde8935abeaf2ace52fe17dedb7a313487 | [
"MIT"
] | null | null | null | import setuptools
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setuptools.setup(
name="atm76",
version="0.1.0",
author="Steven H. Berg... | 27.9375 | 63 | 0.680089 |
073976d41a2a2bee70b7facb5e914072923e6d0f | 4,065 | py | Python | agent/check_plugins/download_speed.py | indigos33k3r/god-eye | b2af5ca6dbbd1b302dd5cda1fd0f0c0eee009e76 | [
"BSD-3-Clause"
] | 1 | 2019-04-01T01:59:22.000Z | 2019-04-01T01:59:22.000Z | agent/check_plugins/download_speed.py | indigos33k3r/god-eye | b2af5ca6dbbd1b302dd5cda1fd0f0c0eee009e76 | [
"BSD-3-Clause"
] | null | null | null | agent/check_plugins/download_speed.py | indigos33k3r/god-eye | b2af5ca6dbbd1b302dd5cda1fd0f0c0eee009e76 | [
"BSD-3-Clause"
] | null | null | null | import logging
import asyncio
from agent.check_plugins import AbstractCheckPlugin
# Do khong biet dung thu vien asyncio ntn ca nen em dung thu vien request
# python
import requests
import sys
import time
from datetime import datetime
logger = logging.getLogger(__name__)
def mean_deviation(self, array_speed, dow... | 32.007874 | 116 | 0.571218 |
073a8f2eb2cea5666b00d9e848e53968468e9ca6 | 130 | py | Python | Setup Rich Text Editor/mysite/main/urls.py | AyemunHossain/Django | 0b1ed21fd6bd2906a4a1a220c029a2193658320f | [
"MIT"
] | 2 | 2020-02-14T19:23:50.000Z | 2020-04-19T08:26:38.000Z | Setup Rich Text Editor/mysite/main/urls.py | AyemunHossain/Django | 0b1ed21fd6bd2906a4a1a220c029a2193658320f | [
"MIT"
] | 42 | 2021-02-02T23:08:30.000Z | 2022-03-12T00:54:55.000Z | Setup Rich Text Editor/mysite/main/urls.py | AyemunHossain/Django | 0b1ed21fd6bd2906a4a1a220c029a2193658320f | [
"MIT"
] | 1 | 2022-03-07T08:09:41.000Z | 2022-03-07T08:09:41.000Z | from django.urls import path
from . import views
app_name = "main"
urlpatterns = [
path("",views.homepage,name="homepage")
] | 16.25 | 43 | 0.7 |
073aa245c28c69910b8c705ef18f357b5c9e4c5f | 5,846 | py | Python | GA/train.py | jcordell/keras-optimization | cbda84bcf3b31928d829af4afc82af1886877341 | [
"MIT"
] | 1 | 2017-05-29T13:48:22.000Z | 2017-05-29T13:48:22.000Z | GA/train.py | jcordell/keras-optimization | cbda84bcf3b31928d829af4afc82af1886877341 | [
"MIT"
] | null | null | null | GA/train.py | jcordell/keras-optimization | cbda84bcf3b31928d829af4afc82af1886877341 | [
"MIT"
] | null | null | null | """
Utility used by the Network class to actually train.
Based on:
https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py
"""
from keras.datasets import mnist, cifar10
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.utils.np_utils import to_categorical
from kera... | 33.028249 | 113 | 0.653609 |
073abd8b8de49a73d08e10cf329cea3aaaac91fa | 491 | py | Python | tests/integration/agenda/test_models.py | rolandgeider/OpenSlides | 331141c17cb23da26e377d4285efdb4a50753a59 | [
"MIT"
] | null | null | null | tests/integration/agenda/test_models.py | rolandgeider/OpenSlides | 331141c17cb23da26e377d4285efdb4a50753a59 | [
"MIT"
] | null | null | null | tests/integration/agenda/test_models.py | rolandgeider/OpenSlides | 331141c17cb23da26e377d4285efdb4a50753a59 | [
"MIT"
] | null | null | null | from openslides.agenda.models import Item
from openslides.core.models import CustomSlide
from openslides.utils.test import TestCase
| 30.6875 | 64 | 0.700611 |
073cf557d5c1841920fb8cd559522daa79d5440d | 3,272 | py | Python | ssl_context_builder/http_impl/requests_wrapper/secure_session.py | mbjahnoon/ssl_context_builder | e73530f900b56710c705675e8e657f0bd17f7c07 | [
"Apache-2.0"
] | 1 | 2022-03-01T16:27:33.000Z | 2022-03-01T16:27:33.000Z | ssl_context_builder/http_impl/requests_wrapper/secure_session.py | mbjahnoon/ssl_context_builder | e73530f900b56710c705675e8e657f0bd17f7c07 | [
"Apache-2.0"
] | null | null | null | ssl_context_builder/http_impl/requests_wrapper/secure_session.py | mbjahnoon/ssl_context_builder | e73530f900b56710c705675e8e657f0bd17f7c07 | [
"Apache-2.0"
] | null | null | null | import weakref
import os
import requests
import ssl
from ssl import SSLContext
import logging
from ssl_context_builder.builder.builder import SslContextBuilder
from ssl_context_builder.http_impl.requests_wrapper.ssl_adapter import SslAdapter
| 34.808511 | 120 | 0.637531 |
073ddb35cfd257b4fe7bee31f410bb17b18b0611 | 621 | py | Python | tiny_scripts/select_cifar_10.py | jiaqiangwjq/python_workhouse | c0e739d8bc8ea3d318a0f916e9d79b1f4d4acad9 | [
"Unlicense"
] | null | null | null | tiny_scripts/select_cifar_10.py | jiaqiangwjq/python_workhouse | c0e739d8bc8ea3d318a0f916e9d79b1f4d4acad9 | [
"Unlicense"
] | null | null | null | tiny_scripts/select_cifar_10.py | jiaqiangwjq/python_workhouse | c0e739d8bc8ea3d318a0f916e9d79b1f4d4acad9 | [
"Unlicense"
] | null | null | null | '''
Selected cifar-10. The .csv file format:
class_index,data_index
3,0
8,1
8,2
...
'''
import pickle
import pandas as pd
file = 'E:\pycharm\LEARN\data\cifar-10\cifar-10-batches-py\\test_batch'
with open(file, 'rb') as f:
dict = pickle.load(f, encoding='bytes')
dict.keys()
batch_label = dict[b'batch_label']
... | 18.818182 | 71 | 0.710145 |
074082800249cdc23669711e86fb83230db924ee | 940 | py | Python | codebox/scripts/fixture.py | disqus/codebox | 9f8e1a9c08c6a79bf3519782be483ff9763c4b4e | [
"Apache-2.0"
] | 5 | 2015-09-24T19:53:02.000Z | 2019-05-14T11:56:07.000Z | codebox/scripts/fixture.py | disqus/codebox | 9f8e1a9c08c6a79bf3519782be483ff9763c4b4e | [
"Apache-2.0"
] | null | null | null | codebox/scripts/fixture.py | disqus/codebox | 9f8e1a9c08c6a79bf3519782be483ff9763c4b4e | [
"Apache-2.0"
] | null | null | null | # Ghetto Fixtures
from codebox import app
from codebox.apps.auth.models import User
from codebox.apps.snippets.models import Snippet
from codebox.apps.organizations.models import Organization, OrganizationMember
from flask import g
client = app.test_client()
_ctx = app.test_request_context()
_ctx.push()
app.preproces... | 29.375 | 99 | 0.75 |
0740a865caa54dd6749985e9ca6d8ad7824f4098 | 3,062 | py | Python | corehq/apps/linked_domain/tests/test_views.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/linked_domain/tests/test_views.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/linked_domain/tests/test_views.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | from unittest.mock import Mock, patch
from django.test import SimpleTestCase
from corehq.apps.domain.exceptions import DomainDoesNotExist
from corehq.apps.linked_domain.exceptions import (
DomainLinkAlreadyExists,
DomainLinkError,
DomainLinkNotAllowed,
)
from corehq.apps.linked_domain.views import link_do... | 48.603175 | 112 | 0.736447 |
0740aa099c767617a2ec263fb4853c2833c7342f | 79 | py | Python | LanguageBasics/functions/import_eg.py | Vamsi-TM/jubilant-train | a3ca0216e161ead4f59d923a36587098790beb5d | [
"MIT"
] | null | null | null | LanguageBasics/functions/import_eg.py | Vamsi-TM/jubilant-train | a3ca0216e161ead4f59d923a36587098790beb5d | [
"MIT"
] | null | null | null | LanguageBasics/functions/import_eg.py | Vamsi-TM/jubilant-train | a3ca0216e161ead4f59d923a36587098790beb5d | [
"MIT"
] | null | null | null | import function_exercise_01 as st
st.sandwich_toppings('meatballs', 'salad')
| 15.8 | 42 | 0.797468 |
0740e77524f70aef71e87bb08ca6fba979752644 | 2,207 | py | Python | pyingest/parsers/zenodo.py | golnazads/adsabs-pyingest | 37b37dd9e0d8a6e5cc34c59d30acd14e3381b48e | [
"MIT"
] | 1 | 2020-06-04T20:09:03.000Z | 2020-06-04T20:09:03.000Z | pyingest/parsers/zenodo.py | golnazads/adsabs-pyingest | 37b37dd9e0d8a6e5cc34c59d30acd14e3381b48e | [
"MIT"
] | 81 | 2017-11-16T16:07:21.000Z | 2022-03-08T14:05:37.000Z | pyingest/parsers/zenodo.py | golnazads/adsabs-pyingest | 37b37dd9e0d8a6e5cc34c59d30acd14e3381b48e | [
"MIT"
] | 17 | 2016-04-13T17:03:25.000Z | 2021-12-22T15:26:54.000Z | #!/usr/bin/python
#
#
from __future__ import absolute_import
import json
import re
import logging
from .datacite import DataCiteParser
#
# if __name__ == "__main__":
#
# # allows program to print utf-8 encoded output sensibly
# import codecs
# sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
# sys.std... | 30.232877 | 101 | 0.566833 |
07421cfb41d4ae2f25674d5123c3192c8a85313e | 25,223 | py | Python | src/fullnode.py | AmeyaDaddikar/vjtichain | 2a9b68d475fe5cc2babdf3f5b463a685e8423f05 | [
"MIT"
] | 1 | 2019-05-26T12:36:37.000Z | 2019-05-26T12:36:37.000Z | src/fullnode.py | AmeyaDaddikar/vjtichain | 2a9b68d475fe5cc2babdf3f5b463a685e8423f05 | [
"MIT"
] | null | null | null | src/fullnode.py | AmeyaDaddikar/vjtichain | 2a9b68d475fe5cc2babdf3f5b463a685e8423f05 | [
"MIT"
] | null | null | null | import json
import time
from functools import lru_cache
from multiprocessing import Pool, Process
from threading import Thread, Timer
from typing import Any, Dict, List
from datetime import datetime
import hashlib
import inspect
import requests
import waitress
from bottle import BaseTemplate, Bottle, request, response,... | 34.223881 | 203 | 0.632082 |
074273af8a268ef926e75f5dce65175c9bfb7048 | 5,914 | py | Python | deepexplain/tf/v1_x/main.py | alexus37/MasterThesisCode | a7eada603686de75968acc8586fd307a91b0491b | [
"MIT"
] | 1 | 2020-04-23T15:39:27.000Z | 2020-04-23T15:39:27.000Z | deepexplain/tf/v1_x/main.py | alexus37/DeepExplain | a7eada603686de75968acc8586fd307a91b0491b | [
"MIT"
] | null | null | null | deepexplain/tf/v1_x/main.py | alexus37/DeepExplain | a7eada603686de75968acc8586fd307a91b0491b | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.framework import ops
from collections import OrderedDict
import warnings, logging
from deepexplain.tf.v1_x import constants
from deepexplain.tf.v1_x.baseClasses i... | 46.566929 | 153 | 0.672979 |
074414b6699fea23b4050feee569e12a24d49670 | 1,457 | py | Python | util/mem_usage.py | robinupham/cnn_lensing | f5d4defc7e2c5b7a23744051da904526d04c27c8 | [
"MIT"
] | null | null | null | util/mem_usage.py | robinupham/cnn_lensing | f5d4defc7e2c5b7a23744051da904526d04c27c8 | [
"MIT"
] | null | null | null | util/mem_usage.py | robinupham/cnn_lensing | f5d4defc7e2c5b7a23744051da904526d04c27c8 | [
"MIT"
] | null | null | null | """
Get the memory usage of a Keras model.
From https://stackoverflow.com/a/46216013.
"""
def get_model_memory_usage(batch_size, model):
"""
Get the memory usage of a Keras model in GB.
From https://stackoverflow.com/a/46216013.
"""
import numpy as np
try:
from keras import backend a... | 30.354167 | 104 | 0.649279 |
0744b878366a1f07bc8ae64bebfadf9106c8ad3a | 303 | py | Python | hexrd/distortion/distortionabc.py | glemaitre/hexrd | b68b1ba72e0f480d29bdaae2adbd6c6e2380cc7c | [
"BSD-3-Clause"
] | 27 | 2020-02-18T12:15:08.000Z | 2022-03-24T17:53:46.000Z | hexrd/distortion/distortionabc.py | glemaitre/hexrd | b68b1ba72e0f480d29bdaae2adbd6c6e2380cc7c | [
"BSD-3-Clause"
] | 259 | 2020-02-02T22:18:29.000Z | 2022-03-30T19:59:58.000Z | hexrd/distortion/distortionabc.py | glemaitre/hexrd | b68b1ba72e0f480d29bdaae2adbd6c6e2380cc7c | [
"BSD-3-Clause"
] | 11 | 2020-02-18T12:14:44.000Z | 2022-03-04T16:19:11.000Z | import abc
| 17.823529 | 46 | 0.633663 |
0745c582ad840fd55885e6625d498a1f4e1e1d0a | 799 | py | Python | setup.py | statisticianinstilettos/recommender_metrics | 82091ec53eb8b3527f95755006237658deb03c18 | [
"MIT"
] | null | null | null | setup.py | statisticianinstilettos/recommender_metrics | 82091ec53eb8b3527f95755006237658deb03c18 | [
"MIT"
] | null | null | null | setup.py | statisticianinstilettos/recommender_metrics | 82091ec53eb8b3527f95755006237658deb03c18 | [
"MIT"
] | null | null | null | import io
import os
from setuptools import setup
def read(file_name):
"""Read a text file and return the content as a string."""
with io.open(os.path.join(os.path.dirname(__file__), file_name),
encoding='utf-8') as f:
return f.read()
setup(
name='recmetrics',
url='https://gi... | 25.774194 | 73 | 0.644556 |
0745f258c3fda6d1caa28babca894afcfee11f9f | 10,829 | py | Python | run_classifier.py | wj-Mcat/model-getting-started | abe8c9df10b45841eeb38e859e680a37ec03fe8a | [
"Apache-2.0"
] | null | null | null | run_classifier.py | wj-Mcat/model-getting-started | abe8c9df10b45841eeb38e859e680a37ec03fe8a | [
"Apache-2.0"
] | null | null | null | run_classifier.py | wj-Mcat/model-getting-started | abe8c9df10b45841eeb38e859e680a37ec03fe8a | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 38.537367 | 122 | 0.651676 |
07461f1a486f88f500aad5210c29f31d3c93dac1 | 1,174 | py | Python | module2-sql-for-analysis/rpg_db.py | TobyChen320/DS-Unit-3-Sprint-2-SQL-and-Databases | 306d2252b3756a501e2412fcb5eddbdebc16a362 | [
"MIT"
] | null | null | null | module2-sql-for-analysis/rpg_db.py | TobyChen320/DS-Unit-3-Sprint-2-SQL-and-Databases | 306d2252b3756a501e2412fcb5eddbdebc16a362 | [
"MIT"
] | null | null | null | module2-sql-for-analysis/rpg_db.py | TobyChen320/DS-Unit-3-Sprint-2-SQL-and-Databases | 306d2252b3756a501e2412fcb5eddbdebc16a362 | [
"MIT"
] | null | null | null | import sqlite3
import os
import psycopg2
from dotenv import load_dotenv
load_dotenv()
DB_NAME2 = os.getenv("DB_NAME3")
DB_USER2 = os.getenv("DB_USER3")
DB_PASS2 = os.getenv("DB_PASS3")
DB_HOST2 = os.getenv("DB_HOST3")
conn = psycopg2.connect(dbname=DB_NAME2,
user=DB_USER2,
... | 22.150943 | 94 | 0.698467 |
0748c347781432c41ed5dc21b2a78b229eb50e78 | 24,232 | py | Python | sws_comp_wiki_gen.py | moff-wildfire/sws-battlefy | 04b12b54f91e450980c2c57eed57f0504abec1bb | [
"Unlicense"
] | 1 | 2021-12-10T01:36:36.000Z | 2021-12-10T01:36:36.000Z | sws_comp_wiki_gen.py | moff-wildfire/sws-battlefy | 04b12b54f91e450980c2c57eed57f0504abec1bb | [
"Unlicense"
] | null | null | null | sws_comp_wiki_gen.py | moff-wildfire/sws-battlefy | 04b12b54f91e450980c2c57eed57f0504abec1bb | [
"Unlicense"
] | null | null | null | import battlefy_data
import battlefy_wiki_linkings
from datetime import datetime
from operator import itemgetter
from pathlib import Path
import calcup_roster_tracking
if __name__ == '__main__':
main()
| 42.812721 | 119 | 0.560333 |
0748f0d589516cda25a4a57eb049a757da513fda | 3,169 | py | Python | utilidades/texto.py | DeadZombie14/chillMagicCarPygame | 756bb6d27939bed3c2834222d03096e90f05a788 | [
"MIT"
] | null | null | null | utilidades/texto.py | DeadZombie14/chillMagicCarPygame | 756bb6d27939bed3c2834222d03096e90f05a788 | [
"MIT"
] | null | null | null | utilidades/texto.py | DeadZombie14/chillMagicCarPygame | 756bb6d27939bed3c2834222d03096e90f05a788 | [
"MIT"
] | null | null | null | import pygame
##################### EJEMPLO DE USO ##############################
# texto1 = Texto(screen, 'Hola', 10, 10)
##################### EJEMPLO DE USO ##############################
# textarea1 = Textarea(screen, 'Hola mundo que tal estas hoy') | 31.376238 | 161 | 0.517829 |
074906b7cce1eac2c3d5b9dbf7a25ead70cb372d | 11,662 | py | Python | training_xgboost_model.py | MighTy-Weaver/Inefficient-AC-detection | 8229f19accd1569ba7b48f77f71783173393d9ed | [
"Apache-2.0"
] | 2 | 2021-02-21T13:28:30.000Z | 2021-07-10T05:24:05.000Z | training_xgboost_model.py | MighTy-Weaver/Inefficient-AC-detection | 8229f19accd1569ba7b48f77f71783173393d9ed | [
"Apache-2.0"
] | null | null | null | training_xgboost_model.py | MighTy-Weaver/Inefficient-AC-detection | 8229f19accd1569ba7b48f77f71783173393d9ed | [
"Apache-2.0"
] | null | null | null | # This is the code to train the xgboost model with cross-validation for each unique room in the dataset.
# Models are dumped into ./models and results are dumped into two csv files in the current work directory.
import argparse
import json
import math
import os
import pickle
import warnings
from typing import Tuple
i... | 51.149123 | 120 | 0.667038 |
07494bf06325a1ec59e4ef3f00ab6c72a53bc972 | 1,293 | py | Python | setup.py | editorconfig/editorconfig-core-py | f43312abcf6888b78ca80f1e95bfa627281746ad | [
"PSF-2.0",
"BSD-2-Clause"
] | 70 | 2015-01-12T09:55:18.000Z | 2022-03-29T06:15:49.000Z | setup.py | editorconfig/editorconfig-core-py | f43312abcf6888b78ca80f1e95bfa627281746ad | [
"PSF-2.0",
"BSD-2-Clause"
] | 26 | 2015-09-15T06:46:51.000Z | 2022-03-28T08:56:35.000Z | setup.py | editorconfig/editorconfig-core-py | f43312abcf6888b78ca80f1e95bfa627281746ad | [
"PSF-2.0",
"BSD-2-Clause"
] | 28 | 2015-04-05T18:07:16.000Z | 2022-03-28T08:08:00.000Z | import os
from setuptools import setup
# Read the version
g = {}
with open(os.path.join("editorconfig", "version.py"), "rt") as fp:
exec(fp.read(), g)
v = g['VERSION']
version = ".".join(str(x) for x in v[:3])
if v[3] != "final":
version += "-" + v[3]
setup(
name='EditorConfig',
versio... | 31.536585 | 72 | 0.590101 |
074981b228683f09166c88b994c571524093496b | 6,035 | py | Python | multi_group_memory_contrast.py | wangzy0327/hadoop-cluster-docker | cf1de6bf458ade132ad5a688e4f8f9b9968a704a | [
"Apache-2.0"
] | 1 | 2020-03-03T10:16:33.000Z | 2020-03-03T10:16:33.000Z | multi_group_memory_contrast.py | wangzy0327/hadoop-cluster-docker | cf1de6bf458ade132ad5a688e4f8f9b9968a704a | [
"Apache-2.0"
] | null | null | null | multi_group_memory_contrast.py | wangzy0327/hadoop-cluster-docker | cf1de6bf458ade132ad5a688e4f8f9b9968a704a | [
"Apache-2.0"
] | 1 | 2020-12-21T09:20:52.000Z | 2020-12-21T09:20:52.000Z | import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0,375,6.5)
# MEM_1 = [0.031, 0.034, 0.034, 0.034, 0.031, 0.034, 0.034, 0.034, 0.031, 0.033, 0.035, 0.034, 0.031, 0.033, 0.034, 0.034, 0.031, 0.033, 0.034, 0.034, 0.031, 0.033, 0.034, 0.034, 0.031, 0.033, 0.034, 0.034, 0.031, 0.031, 0.031, 0.031, 0.031, 0... | 104.051724 | 414 | 0.596189 |
0749f9a616656fe35e1c0d2532a8c8a5e40dc4ab | 1,042 | py | Python | vaping/config.py | josephburnett/vaping | 16f9092f0b3c1692e6d1a040f746e1277e197353 | [
"Apache-2.0"
] | null | null | null | vaping/config.py | josephburnett/vaping | 16f9092f0b3c1692e6d1a040f746e1277e197353 | [
"Apache-2.0"
] | null | null | null | vaping/config.py | josephburnett/vaping | 16f9092f0b3c1692e6d1a040f746e1277e197353 | [
"Apache-2.0"
] | null | null | null | import re
import munge
def parse_interval(val):
"""
converts a string to float of seconds
.5 = 500ms
90 = 1m30s
**Arguments**
- val (`str`)
"""
re_intv = re.compile(r"([\d\.]+)([a-zA-Z]+)")
val = val.strip()
total = 0.0
for match in re_intv.findall(val):
... | 20.84 | 86 | 0.46833 |
074b42be48178517185311cda7a91881826a6fd2 | 654 | py | Python | sktime/annotation/tests/test_all_annotators.py | Rubiel1/sktime | 2fd2290fb438224f11ddf202148917eaf9b73a87 | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:24:52.000Z | 2021-09-08T14:24:52.000Z | sktime/annotation/tests/test_all_annotators.py | Rubiel1/sktime | 2fd2290fb438224f11ddf202148917eaf9b73a87 | [
"BSD-3-Clause"
] | null | null | null | sktime/annotation/tests/test_all_annotators.py | Rubiel1/sktime | 2fd2290fb438224f11ddf202148917eaf9b73a87 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for sktime annotators."""
import pandas as pd
import pytest
from sktime.registry import all_estimators
from sktime.utils._testing.estimator_checks import _make_args
ALL_ANNOTATORS = all_estimators(estimator_types="series-annotator", return_names=False)
| 28.434783 | 87 | 0.750765 |
074b7ef708bdd483e5b790825c69a90db600e852 | 569 | py | Python | raspberry-pi-camera/cam.py | AlexMassin/mlh-react-vr-website | dc08788ccdecc9923b8dbfd31fa452cb83d214ae | [
"MIT"
] | 1 | 2019-05-19T03:37:26.000Z | 2019-05-19T03:37:26.000Z | raspberry-pi-camera/cam.py | AlexMassin/mlh-react-vr-website | dc08788ccdecc9923b8dbfd31fa452cb83d214ae | [
"MIT"
] | null | null | null | raspberry-pi-camera/cam.py | AlexMassin/mlh-react-vr-website | dc08788ccdecc9923b8dbfd31fa452cb83d214ae | [
"MIT"
] | 1 | 2019-10-02T20:18:54.000Z | 2019-10-02T20:18:54.000Z | picamera import PiCamera
from time import sleep
import boto3
import os.path
import subprocess
s3 = boto3.client('s3')
bucket = 'cambucket21'
camera = PiCamera()
#camera.resolution(1920,1080)
x = 0
camerafile = x
while True:
if (x == 6):
x = 1
else:
x = x + 1
camera.start_preview()
camera.start_recording('/home/pi/' ... | 20.321429 | 82 | 0.671353 |
074b9d7491ffbc8fda4dfce94456f63c57933830 | 437 | py | Python | Part_3_advanced/m04_datetime_and_timedelta/datetime_formats/example_1.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m04_datetime_and_timedelta/datetime_formats/example_1.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m04_datetime_and_timedelta/datetime_formats/example_1.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | from datetime import datetime
if __name__ == "__main__":
run_example()
| 23 | 53 | 0.734554 |
074c422d6b8b108e68ca3caffc0062b15b80774b | 1,333 | py | Python | examples/scripts/segmentation/nnet3-segmenter.py | mxmpl/pykaldi | 0570307138c5391cc47b019450d08bcb9686dd98 | [
"Apache-2.0"
] | 916 | 2017-11-22T19:33:36.000Z | 2022-03-31T11:51:58.000Z | examples/scripts/segmentation/nnet3-segmenter.py | mxmpl/pykaldi | 0570307138c5391cc47b019450d08bcb9686dd98 | [
"Apache-2.0"
] | 268 | 2018-01-16T22:06:45.000Z | 2022-03-29T03:24:41.000Z | examples/scripts/segmentation/nnet3-segmenter.py | mxmpl/pykaldi | 0570307138c5391cc47b019450d08bcb9686dd98 | [
"Apache-2.0"
] | 260 | 2018-01-23T18:39:40.000Z | 2022-03-24T08:17:39.000Z | #!/usr/bin/env python
from __future__ import print_function
from kaldi.segmentation import NnetSAD, SegmentationProcessor
from kaldi.nnet3 import NnetSimpleComputationOptions
from kaldi.util.table import SequentialMatrixReader
# Construct SAD
model = NnetSAD.read_model("final.raw")
post = NnetSAD.read_average_poster... | 37.027778 | 77 | 0.775694 |
074c987bce7bacca56810d03a725dd7cdf352776 | 4,911 | py | Python | src/dataset.py | HeegyuKim/CurseFilter | dc4a64aebd997706553c24e919a88e19a3c92dd3 | [
"MIT"
] | null | null | null | src/dataset.py | HeegyuKim/CurseFilter | dc4a64aebd997706553c24e919a88e19a3c92dd3 | [
"MIT"
] | null | null | null | src/dataset.py | HeegyuKim/CurseFilter | dc4a64aebd997706553c24e919a88e19a3c92dd3 | [
"MIT"
] | null | null | null | from cProfile import label
from matplotlib.pyplot import text
import pandas as pd
import numpy as np
from tokenizers import Tokenizer
import torch
from torch.utils.data import Dataset, DataLoader
from typing import Dict, Any, Tuple
from datasets import load_dataset
| 38.069767 | 131 | 0.609448 |
074cdaf58b71e5a0a7b4da96e1a1535d7fb91e4b | 987 | py | Python | helper_tools/raspi_OMX-Player_Howto_demo.py | stko/Schnipsl | 824572c657e48f18950f584b9529661ff5bb8069 | [
"MIT"
] | null | null | null | helper_tools/raspi_OMX-Player_Howto_demo.py | stko/Schnipsl | 824572c657e48f18950f584b9529661ff5bb8069 | [
"MIT"
] | 29 | 2020-08-30T15:07:50.000Z | 2022-02-19T03:41:26.000Z | helper_tools/raspi_OMX-Player_Howto_demo.py | wifitvbox/Schnipsl | 553ce8de3dda26fb92297ad76e92f4a363070e4e | [
"MIT"
] | 1 | 2020-12-28T05:46:17.000Z | 2020-12-28T05:46:17.000Z | #!/usr/bin/python
# mp4museum.org by julius schmiedel 2019
import os
import sys
import glob
from subprocess import Popen, PIPE
import RPi.GPIO as GPIO
FNULL = open(os.devnull, "w")
# setup GPIO pin
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
GPIO.setup(13, GPIO.IN, pull_up_down = ... | 25.973684 | 97 | 0.73151 |
074ce069ee533cbcb1f8fc2b612416adfbbf158a | 4,549 | py | Python | dash_app/compare_alg.py | zeyu2001/ICT1002-Python | 76a2c8ad3e3c4a3c873a9259e2a11488c33f2bf7 | [
"MIT"
] | 1 | 2020-10-31T06:57:01.000Z | 2020-10-31T06:57:01.000Z | dash_app/compare_alg.py | zeyu2001/ICT1002-Python | 76a2c8ad3e3c4a3c873a9259e2a11488c33f2bf7 | [
"MIT"
] | null | null | null | dash_app/compare_alg.py | zeyu2001/ICT1002-Python | 76a2c8ad3e3c4a3c873a9259e2a11488c33f2bf7 | [
"MIT"
] | 1 | 2021-12-04T10:02:16.000Z | 2021-12-04T10:02:16.000Z | """
Comparison between the efficiency of the Boyer-Moore algorithm and the naive substring search algorithm.
The runtimes for both algorithms are plotted on the same axes.
"""
import matplotlib.pyplot as plt
import numpy as np
import string
import time
import random
from bm_alg import boyer_moore_match, naive_match
#... | 28.254658 | 104 | 0.585843 |
074fa8cb751dc3e01a0d7cf156f12acfd22b5c7b | 616 | py | Python | TSIS_3/3774.py | GMKanat/PP2_spring | 423617d559c5690f689741aaa152b9fee5082baf | [
"MIT"
] | null | null | null | TSIS_3/3774.py | GMKanat/PP2_spring | 423617d559c5690f689741aaa152b9fee5082baf | [
"MIT"
] | null | null | null | TSIS_3/3774.py | GMKanat/PP2_spring | 423617d559c5690f689741aaa152b9fee5082baf | [
"MIT"
] | null | null | null | ans = dict()
pairs = dict()
n = int(input())
for i in range(0, n-1):
child, parent = input().split()
if parent in pairs:
pairs[parent].append(child)
else:
pairs[parent] = [child]
if n > 0:
for k in pairs:
create_tree(k)
for key in sorted(ans.keys()):
print(key, ans[ke... | 22.814815 | 46 | 0.469156 |
075329f4475d143e6e7eeffda251a30feb1872ce | 404 | py | Python | italicizer.py | Dorijan-Cirkveni/Miniprojects | 2109275c9c1b9f5e7a286604cbb1b7966dff9798 | [
"MIT"
] | null | null | null | italicizer.py | Dorijan-Cirkveni/Miniprojects | 2109275c9c1b9f5e7a286604cbb1b7966dff9798 | [
"MIT"
] | null | null | null | italicizer.py | Dorijan-Cirkveni/Miniprojects | 2109275c9c1b9f5e7a286604cbb1b7966dff9798 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main()
| 15.538462 | 34 | 0.368812 |
07532f5a10906c237ad3a39209766e0e40d93170 | 3,036 | py | Python | maps/views.py | WPRDC/neighborhood-simulacrum | 46892dfdbc8bc3201e31fee4ee991c49b208753e | [
"MIT"
] | null | null | null | maps/views.py | WPRDC/neighborhood-simulacrum | 46892dfdbc8bc3201e31fee4ee991c49b208753e | [
"MIT"
] | 6 | 2020-12-18T17:21:35.000Z | 2021-03-03T21:08:44.000Z | maps/views.py | WPRDC/neighborhood-simulacrum | 46892dfdbc8bc3201e31fee4ee991c49b208753e | [
"MIT"
] | null | null | null | import json
from typing import Type, TYPE_CHECKING
from django.core.exceptions import ObjectDoesNotExist
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from rest_framework import viewsets, filters
from rest_framework.exceptions import NotFound
from rest_framew... | 35.717647 | 94 | 0.745389 |
0754a45f518b76cfc3fadb21e0d4b383c11aeb7f | 2,937 | py | Python | magma/operators.py | Kuree/magma | be2439aa897768c5810be72e3a55a6f772ac83cf | [
"MIT"
] | null | null | null | magma/operators.py | Kuree/magma | be2439aa897768c5810be72e3a55a6f772ac83cf | [
"MIT"
] | null | null | null | magma/operators.py | Kuree/magma | be2439aa897768c5810be72e3a55a6f772ac83cf | [
"MIT"
] | null | null | null | from magma import _BitType, BitType, BitsType, UIntType, SIntType
def raise_mantle_import_error_unary(self):
raise MantleImportError(
"Operators are not defined until mantle has been imported")
def raise_mantle_import_error_binary(self, other):
raise MantleImportError(
"Operators are not d... | 26.459459 | 79 | 0.571672 |
075601d812e7788a83abdb5d69e6437c29517e9c | 7,993 | py | Python | src/sultan/result.py | bquantump/sultan | a46e8dc9b09385a7226f6151134ae2417166f25d | [
"MIT"
] | null | null | null | src/sultan/result.py | bquantump/sultan | a46e8dc9b09385a7226f6151134ae2417166f25d | [
"MIT"
] | null | null | null | src/sultan/result.py | bquantump/sultan | a46e8dc9b09385a7226f6151134ae2417166f25d | [
"MIT"
] | null | null | null | import subprocess
import sys
import time
import traceback
from queue import Queue
from sultan.core import Base
from sultan.echo import Echo
from threading import Thread
def print_stdout(self, always_print=False):
"""
Prints the stdout to console - if there is any stdout, otherwise does nothing.
... | 31.222656 | 110 | 0.555236 |
07565d1f240205eff7e6a9514e645e53e8414dbd | 10,991 | py | Python | great_expectations/cli/datasource.py | orenovadia/great_expectations | 76ef0c4e066227f8b589a1ee6ac885618f65906e | [
"Apache-2.0"
] | null | null | null | great_expectations/cli/datasource.py | orenovadia/great_expectations | 76ef0c4e066227f8b589a1ee6ac885618f65906e | [
"Apache-2.0"
] | null | null | null | great_expectations/cli/datasource.py | orenovadia/great_expectations | 76ef0c4e066227f8b589a1ee6ac885618f65906e | [
"Apache-2.0"
] | null | null | null | import os
import click
from .util import cli_message
from great_expectations.render import DefaultJinjaPageView
from great_expectations.version import __version__ as __version__
msg_prompt_choose_data_source = """
Configure a datasource:
1. Pandas DataFrame
2. Relational database (SQL)
3. Spark DataFram... | 38.837456 | 180 | 0.655263 |
0756766e6e04859ce22940229b15353362178faa | 4,105 | py | Python | python/crawler/downloader.py | rgb-24bit/code-library | 8da8336e241e1428b2b46c6939bd5e9eadcf3e68 | [
"MIT"
] | null | null | null | python/crawler/downloader.py | rgb-24bit/code-library | 8da8336e241e1428b2b46c6939bd5e9eadcf3e68 | [
"MIT"
] | null | null | null | python/crawler/downloader.py | rgb-24bit/code-library | 8da8336e241e1428b2b46c6939bd5e9eadcf3e68 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Provide download function by request
"""
from datetime import datetime
import logging
import time
import urllib.parse
import requests
from bs4 import BeautifulSoup
| 37.66055 | 81 | 0.599026 |
07571f5303eed07dcbb7a47a5145eef3cd7c884f | 536 | py | Python | medium/151.py | pisskidney/leetcode | 08c19cbf3d7afc897908ea05db4ad11a5487f523 | [
"MIT"
] | null | null | null | medium/151.py | pisskidney/leetcode | 08c19cbf3d7afc897908ea05db4ad11a5487f523 | [
"MIT"
] | null | null | null | medium/151.py | pisskidney/leetcode | 08c19cbf3d7afc897908ea05db4ad11a5487f523 | [
"MIT"
] | null | null | null | #!/usr/bin/python
s = Solution()
print s.reverseWords('a x')
| 20.615385 | 49 | 0.33209 |
07573778dc31fb4c60d28d2030387a7be8144f36 | 7,327 | py | Python | src/keycloak/connection.py | ecederstrand/python-keycloak | 77686a2764a3fcba092d78e02f42a58c7214c30e | [
"MIT"
] | null | null | null | src/keycloak/connection.py | ecederstrand/python-keycloak | 77686a2764a3fcba092d78e02f42a58c7214c30e | [
"MIT"
] | null | null | null | src/keycloak/connection.py | ecederstrand/python-keycloak | 77686a2764a3fcba092d78e02f42a58c7214c30e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (C) 2017 Marcos Pereira <marcospereira.mpj@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, in... | 32.564444 | 88 | 0.608162 |
07577b638bc8a39bd8fcb86c2ed5cc924e43d86a | 700 | py | Python | 2020/23.py | Valokoodari/advent-of-code | c664987f739e0b07ddad34bad87d56768556a5a5 | [
"MIT"
] | 2 | 2021-12-27T18:59:11.000Z | 2022-01-10T02:31:36.000Z | 2020/23.py | Valokoodari/advent-of-code-2019 | c664987f739e0b07ddad34bad87d56768556a5a5 | [
"MIT"
] | null | null | null | 2020/23.py | Valokoodari/advent-of-code-2019 | c664987f739e0b07ddad34bad87d56768556a5a5 | [
"MIT"
] | 2 | 2021-12-23T17:29:10.000Z | 2021-12-24T03:21:49.000Z | #!venv/bin/python3
cs = [int(c) for c in open("inputs/23.in", "r").readline().strip()]
print("Part 1:", f(cs.copy(), 100)[0])
print("Part 2:", f(cs.copy() + [i for i in range(10, 1000001)], 10000000)[1]) | 29.166667 | 77 | 0.452857 |
07579f83aea9f0c480c258cdf19ac53f9ebbfd10 | 160 | py | Python | run.py | jakewright/home-automation-device-registry | b073966b1dc259a6997c47f8d369f51dee9cbbf3 | [
"MIT"
] | 15 | 2018-01-09T21:57:09.000Z | 2021-05-08T10:23:01.000Z | run.py | jakewright/home-automation-device-registry | b073966b1dc259a6997c47f8d369f51dee9cbbf3 | [
"MIT"
] | null | null | null | run.py | jakewright/home-automation-device-registry | b073966b1dc259a6997c47f8d369f51dee9cbbf3 | [
"MIT"
] | 10 | 2018-09-23T20:30:24.000Z | 2021-05-08T10:23:02.000Z | # Import the application
from device_registry import app
# Run the application in debug mode
app.run(host='0.0.0.0', port=int(app.config['PORT']), debug=True)
| 26.666667 | 65 | 0.74375 |
0758c8b4614be9ea14ff7452e9accfcfb90b432b | 1,263 | py | Python | dvc/utils/stage.py | Abrosimov-a-a/dvc | 93280c937b9160003afb0d2f3fd473c03d6d9673 | [
"Apache-2.0"
] | null | null | null | dvc/utils/stage.py | Abrosimov-a-a/dvc | 93280c937b9160003afb0d2f3fd473c03d6d9673 | [
"Apache-2.0"
] | null | null | null | dvc/utils/stage.py | Abrosimov-a-a/dvc | 93280c937b9160003afb0d2f3fd473c03d6d9673 | [
"Apache-2.0"
] | null | null | null | import yaml
from ruamel.yaml import YAML
from ruamel.yaml.error import YAMLError
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
from dvc.exceptions import StageFileCorruptedError
from dvc.utils.compat import open
def parse_stage_for_update(text, path):
... | 26.87234 | 76 | 0.69517 |
075a282b1afd93e2cc9af2acd58c24b3702f7904 | 93 | py | Python | CAMPODETIRO/test.py | Arguel/old-projects | 2e5f594a6303b2e137acf555569eca98aab08054 | [
"Apache-2.0"
] | null | null | null | CAMPODETIRO/test.py | Arguel/old-projects | 2e5f594a6303b2e137acf555569eca98aab08054 | [
"Apache-2.0"
] | null | null | null | CAMPODETIRO/test.py | Arguel/old-projects | 2e5f594a6303b2e137acf555569eca98aab08054 | [
"Apache-2.0"
] | null | null | null | entrada = input("palabra")
listaDeLetras = []
for i in entrada:
listaDeLetras.append(i)
| 15.5 | 27 | 0.698925 |
075a46f6df538e13d87e3247bc8ca4b6d54f0b7b | 659 | py | Python | demos/nn_classification_demo.py | fire-breathing-rubber-lemons/cs207-FinalProject | 92d1d7d70637e2478effb01c9ce56199e0f873c9 | [
"MIT"
] | null | null | null | demos/nn_classification_demo.py | fire-breathing-rubber-lemons/cs207-FinalProject | 92d1d7d70637e2478effb01c9ce56199e0f873c9 | [
"MIT"
] | 31 | 2019-10-18T16:14:07.000Z | 2019-12-10T16:38:34.000Z | demos/nn_classification_demo.py | fire-breathing-rubber-lemons/cs207-FinalProject | 92d1d7d70637e2478effb01c9ce56199e0f873c9 | [
"MIT"
] | null | null | null | import numpy as np
from pyad.nn import NeuralNet
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
np.random.seed(0)
data = load_breast_cancer()
X_train, X_test, y_train, y_test = train_test_split(
data.data, data.target, train_size=0.8, random_state=0
)
nn = Ne... | 26.36 | 59 | 0.76176 |
075c40bff74b1c9ad80e482ccef0c574552a2c97 | 226 | py | Python | mgatemp.py | zobclub/chapter8 | fbd9e8711747b7446f75b472bae1465fe0ab495c | [
"MIT"
] | 1 | 2021-12-02T10:56:49.000Z | 2021-12-02T10:56:49.000Z | mgatemp.py | zobclub/chapter8 | fbd9e8711747b7446f75b472bae1465fe0ab495c | [
"MIT"
] | null | null | null | mgatemp.py | zobclub/chapter8 | fbd9e8711747b7446f75b472bae1465fe0ab495c | [
"MIT"
] | null | null | null | from microbit import *
I2CADR = 0x0E
DIE_TEMP = 0x0F
while True:
i2c.write(I2CADR, bytearray([DIE_TEMP]))
d = i2c.read(I2CADR, 1)
x = d[0]
if x >=128:
x -= 256
x += 10
print(x)
sleep(500) | 16.142857 | 44 | 0.553097 |
075cb80186092395148f9c03498c024c22cfd0b5 | 793 | py | Python | utils/nlp.py | splovyt/SFPython-Project-Night | 50f20f581e074401d59d91457bac2a69631bef61 | [
"Apache-2.0"
] | 1 | 2019-04-17T18:02:59.000Z | 2019-04-17T18:02:59.000Z | utils/nlp.py | splovyt/SFPython-Project-Night | 50f20f581e074401d59d91457bac2a69631bef61 | [
"Apache-2.0"
] | null | null | null | utils/nlp.py | splovyt/SFPython-Project-Night | 50f20f581e074401d59d91457bac2a69631bef61 | [
"Apache-2.0"
] | null | null | null | import ssl
import nltk
from textblob import TextBlob
from nltk.corpus import stopwords
# set SSL
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
pass
else:
ssl._create_default_https_context = _create_unverified_https_context
# download noun data (if required... | 26.433333 | 98 | 0.760404 |
075cf0dd079f839e7d44c9491837f8a19123cdd5 | 1,418 | py | Python | toolbox/core/management/commands/celery_beat_resource_scraper.py | akshedu/toolbox | 7c647433b68f1098ee4c8623f836f74785dc970c | [
"MIT"
] | null | null | null | toolbox/core/management/commands/celery_beat_resource_scraper.py | akshedu/toolbox | 7c647433b68f1098ee4c8623f836f74785dc970c | [
"MIT"
] | null | null | null | toolbox/core/management/commands/celery_beat_resource_scraper.py | akshedu/toolbox | 7c647433b68f1098ee4c8623f836f74785dc970c | [
"MIT"
] | null | null | null |
from django_celery_beat.models import PeriodicTask, IntervalSchedule
from django.core.management.base import BaseCommand
from django.db import IntegrityError
| 32.227273 | 79 | 0.499295 |
075ee89278e2e099ce3c9cbc108dfe159e2012f2 | 3,284 | py | Python | ppcls/data/preprocess/__init__.py | zhusonghe/PaddleClas-1 | e2e492f9c78ed5084cc50d7c45eef4cc41e1eeaf | [
"Apache-2.0"
] | 3,763 | 2020-04-10T04:48:11.000Z | 2022-03-31T13:24:37.000Z | ppcls/data/preprocess/__init__.py | zhusonghe/PaddleClas-1 | e2e492f9c78ed5084cc50d7c45eef4cc41e1eeaf | [
"Apache-2.0"
] | 633 | 2020-04-08T18:27:31.000Z | 2022-03-31T01:09:43.000Z | ppcls/data/preprocess/__init__.py | zhusonghe/PaddleClas-1 | e2e492f9c78ed5084cc50d7c45eef4cc41e1eeaf | [
"Apache-2.0"
] | 846 | 2020-04-08T08:13:18.000Z | 2022-03-31T12:28:37.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 32.514851 | 114 | 0.715286 |
075fafdab69c5858ee27f6483fe78f36b26b216c | 11,121 | py | Python | src/scalar_net/visualisations.py | scheeloong/lindaedynamics_icml2018 | d03b450e254d33b019161a3cd015e44aafe407cb | [
"MIT"
] | 1 | 2018-08-04T17:04:13.000Z | 2018-08-04T17:04:13.000Z | src/scalar_net/visualisations.py | scheeloong/lindaedynamics_icml2018 | d03b450e254d33b019161a3cd015e44aafe407cb | [
"MIT"
] | null | null | null | src/scalar_net/visualisations.py | scheeloong/lindaedynamics_icml2018 | d03b450e254d33b019161a3cd015e44aafe407cb | [
"MIT"
] | null | null | null | # required modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib import cm
from matplotlib.colors import Normalize
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.animation import FuncAnimation
# two-dimesional version
# three-dimensional version
... | 35.193038 | 103 | 0.608488 |
075fc7c73e1c7b1fe3355a9a233cd8869299a19e | 7,435 | py | Python | tests/qconvolutional_test.py | kshithijiyer/qkeras | 78ac608c6dcd84151792a986d03fe7afb17929cf | [
"Apache-2.0"
] | null | null | null | tests/qconvolutional_test.py | kshithijiyer/qkeras | 78ac608c6dcd84151792a986d03fe7afb17929cf | [
"Apache-2.0"
] | null | null | null | tests/qconvolutional_test.py | kshithijiyer/qkeras | 78ac608c6dcd84151792a986d03fe7afb17929cf | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
#
# 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,... | 33.490991 | 80 | 0.646537 |
076073f7df321e46ea5bd065cc9331746695ec1f | 2,356 | py | Python | discord/ext/ui/select.py | Lapis256/discord-ext-ui | 593de0a1107d2a0c26023587a2937f00ecec3ed1 | [
"MIT"
] | null | null | null | discord/ext/ui/select.py | Lapis256/discord-ext-ui | 593de0a1107d2a0c26023587a2937f00ecec3ed1 | [
"MIT"
] | null | null | null | discord/ext/ui/select.py | Lapis256/discord-ext-ui | 593de0a1107d2a0c26023587a2937f00ecec3ed1 | [
"MIT"
] | null | null | null | from typing import Optional, List, TypeVar, Generic, Callable
import discord.ui
from .item import Item
from .select_option import SelectOption
from .custom import CustomSelect
C = TypeVar("C", bound=discord.ui.Select)
| 28.731707 | 79 | 0.61163 |
0760aecd744d04b7a42ae02e90ca8b423ee0a619 | 2,834 | py | Python | ucscsdk/mometa/storage/StorageScsiLunRef.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/storage/StorageScsiLunRef.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/storage/StorageScsiLunRef.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for StorageScsiLunRef ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
| 50.607143 | 251 | 0.642202 |
0761a4f4179e9679d7d567a51af6174207abac78 | 16,697 | py | Python | saxstools/fullsaxs.py | latrocinia/saxstools | 8e88474f62466b745791c0ccbb07c80a959880f3 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | saxstools/fullsaxs.py | latrocinia/saxstools | 8e88474f62466b745791c0ccbb07c80a959880f3 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | saxstools/fullsaxs.py | latrocinia/saxstools | 8e88474f62466b745791c0ccbb07c80a959880f3 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | from __future__ import print_function, absolute_import, division
from sys import stdout as _stdout
from time import time as _time
import numpy as np
try:
import pyfftw
pyfftw.interfaces.cache.enable()
pyfftw.interfaces.cache.set_keepalive_time(10)
rfftn = pyfftw.interfaces.numpy_fft.rfftn
irfftn =... | 32.675147 | 115 | 0.581302 |
0762390f8b5995d6cf171f62842c5c4b8e02141e | 985 | py | Python | lib/generate_random_obs.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | 8 | 2020-08-16T00:09:57.000Z | 2021-09-24T00:58:46.000Z | lib/generate_random_obs.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | null | null | null | lib/generate_random_obs.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | 2 | 2021-01-26T02:33:13.000Z | 2021-08-25T01:52:07.000Z | #!/usr/bin/env python3
import os
import sys
import time
sys.path.append(os.getcwd()+'/lib')
import random
from dataclasses import dataclass, field
from ObsInfo import ObsInfo
def generate_random_obs(num_obs: int, size_list: list, config_data):
"""
config_file_name = "config.json"
json_file = open(config_f... | 30.78125 | 131 | 0.658883 |
07629f29c3ccce164edffac5aaf1f19ce3ce8456 | 6,934 | py | Python | userbot/helper_funcs/misc.py | Abucuyy/Uciha | 726e9cd61eabf056064e40f7b322d8993161e52a | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/helper_funcs/misc.py | Abucuyy/Uciha | 726e9cd61eabf056064e40f7b322d8993161e52a | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-02-08T20:43:56.000Z | 2021-02-08T20:43:56.000Z | userbot/helper_funcs/misc.py | Abucuyy/Uciha | 726e9cd61eabf056064e40f7b322d8993161e52a | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 5 | 2020-09-05T12:45:31.000Z | 2020-09-25T09:04:29.000Z | # TG-UserBot - A modular Telegram UserBot script for Python.
# Copyright (C) 2019 Kandarp <https://github.com/kandnub>
#
# TG-UserBot 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 t... | 37.27957 | 80 | 0.608595 |
0763811316d721bd61d00c534d919a140fb4b71a | 1,421 | py | Python | gym-multilayerthinfilm/utils.py | HarryTheBird/gym-multilayerthinfilm | 22eda96e71e95e9ea1b491fae633c4a32fadb023 | [
"MIT"
] | 10 | 2021-05-20T19:46:36.000Z | 2022-02-24T03:06:46.000Z | gym-multilayerthinfilm/utils.py | HarryTheBird/gym-multilayerthinfilm | 22eda96e71e95e9ea1b491fae633c4a32fadb023 | [
"MIT"
] | null | null | null | gym-multilayerthinfilm/utils.py | HarryTheBird/gym-multilayerthinfilm | 22eda96e71e95e9ea1b491fae633c4a32fadb023 | [
"MIT"
] | 2 | 2021-12-11T21:49:35.000Z | 2022-03-04T06:28:57.000Z | import numpy as np
| 43.060606 | 113 | 0.626319 |
0765d0b1f7f6046c9a5ec38c71317e234a345a45 | 270 | py | Python | pyrocco/__init__.py | joaopalmeiro/pyrocco | 4144f56d654500c3ec49cb04c06b98296004eafe | [
"MIT"
] | null | null | null | pyrocco/__init__.py | joaopalmeiro/pyrocco | 4144f56d654500c3ec49cb04c06b98296004eafe | [
"MIT"
] | 4 | 2021-05-31T16:44:16.000Z | 2021-05-31T17:08:04.000Z | pyrocco/__init__.py | joaopalmeiro/pyrocco | 4144f56d654500c3ec49cb04c06b98296004eafe | [
"MIT"
] | null | null | null | __package_name__ = "pyrocco"
__version__ = "0.1.0"
__author__ = "Joo Palmeiro"
__author_email__ = "jm.palmeiro@campus.fct.unl.pt"
__description__ = "A Python CLI to add the Party Parrot to a custom background image."
__url__ = "https://github.com/joaopalmeiro/pyrocco"
| 38.571429 | 86 | 0.766667 |
0768ed6923c47dbe150e783f6cd01fa2f7c9e54c | 41 | py | Python | EduData/Task/__init__.py | BAOOOOOM/EduData | affa465779cb94db00ed19291f8411229d342c0f | [
"Apache-2.0"
] | 98 | 2019-07-05T03:27:36.000Z | 2022-03-30T08:38:09.000Z | EduData/Task/__init__.py | BAOOOOOM/EduData | affa465779cb94db00ed19291f8411229d342c0f | [
"Apache-2.0"
] | 45 | 2020-12-25T03:49:43.000Z | 2021-11-26T09:45:42.000Z | EduData/Task/__init__.py | BAOOOOOM/EduData | affa465779cb94db00ed19291f8411229d342c0f | [
"Apache-2.0"
] | 50 | 2019-08-17T05:11:15.000Z | 2022-03-29T07:54:13.000Z | # coding: utf-8
# 2019/8/23 @ tongshiwei
| 13.666667 | 24 | 0.658537 |
076975f577d6632b0b1b26b10892f5123c387c67 | 1,286 | py | Python | 010-round.py | richardvecsey/python-basics | b66abef77bce2ddd6f2f39b631e1dd97a9aa2fac | [
"MIT"
] | 3 | 2019-12-29T18:52:21.000Z | 2020-02-20T09:18:08.000Z | 010-round.py | richardvecsey/python-basics | b66abef77bce2ddd6f2f39b631e1dd97a9aa2fac | [
"MIT"
] | null | null | null | 010-round.py | richardvecsey/python-basics | b66abef77bce2ddd6f2f39b631e1dd97a9aa2fac | [
"MIT"
] | 2 | 2020-02-20T09:18:13.000Z | 2020-06-04T04:51:44.000Z | """
Round a number
--------------
Input (float) A floating point number
(int) Number of decimals
Default value is: 0
Output (float) Rounded number
(int) Whether using the default decimals value, the return number
will be the nearest ... | 33.842105 | 80 | 0.64619 |
076ab2cb67c5bd176123d8332c42ca379bbe81d8 | 992 | py | Python | service.py | Kleist/MusicPlayer | 95f634d1e4d47e7b430e32ad9224d94ad0453c82 | [
"MIT"
] | 1 | 2020-08-14T21:14:09.000Z | 2020-08-14T21:14:09.000Z | service.py | Kleist/MusicPlayer | 95f634d1e4d47e7b430e32ad9224d94ad0453c82 | [
"MIT"
] | null | null | null | service.py | Kleist/MusicPlayer | 95f634d1e4d47e7b430e32ad9224d94ad0453c82 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
import play
import time
if __name__ == "__main__":
main()
| 22.545455 | 64 | 0.521169 |
076b099ed1e8933339bc07b3aea99e064efdee24 | 1,118 | py | Python | mypy/defaults.py | ckanesan/mypy | ffb3ce925e8bb3376e19f942c7d3a3806c9bba97 | [
"PSF-2.0"
] | null | null | null | mypy/defaults.py | ckanesan/mypy | ffb3ce925e8bb3376e19f942c7d3a3806c9bba97 | [
"PSF-2.0"
] | 8 | 2021-03-18T22:27:44.000Z | 2022-02-10T09:18:50.000Z | mypy/defaults.py | ckanesan/mypy | ffb3ce925e8bb3376e19f942c7d3a3806c9bba97 | [
"PSF-2.0"
] | 1 | 2021-09-20T06:37:41.000Z | 2021-09-20T06:37:41.000Z | import os
MYPY = False
if MYPY:
from typing_extensions import Final
PYTHON2_VERSION = (2, 7) # type: Final
PYTHON3_VERSION = (3, 6) # type: Final
PYTHON3_VERSION_MIN = (3, 4) # type: Final
CACHE_DIR = '.mypy_cache' # type: Final
CONFIG_FILE = 'mypy.ini' # type: Final
SHARED_CONFIG_FILES = ['setup.cfg', ] # ... | 34.9375 | 91 | 0.604651 |
4aca7d77d6d130f3025fa754e718e7148f830e41 | 3,558 | py | Python | skcriteria/preprocessing/push_negatives.py | elcolie/scikit-criteria | 216674d699b60d68fefa98d44afd619943f3bb00 | [
"BSD-3-Clause"
] | null | null | null | skcriteria/preprocessing/push_negatives.py | elcolie/scikit-criteria | 216674d699b60d68fefa98d44afd619943f3bb00 | [
"BSD-3-Clause"
] | null | null | null | skcriteria/preprocessing/push_negatives.py | elcolie/scikit-criteria | 216674d699b60d68fefa98d44afd619943f3bb00 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised))
# Copyright (c) 2016-2021, Cabral, Juan; Luczywo, Nadia
# All rights reserved.
# =============================================================================
# DOCS
# =========================... | 30.93913 | 79 | 0.522766 |
4acaa4e6a8b6fa3eb236788a62a84f44c80e376f | 3,451 | py | Python | ingenico/direct/sdk/domain/customer_token.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | null | null | null | ingenico/direct/sdk/domain/customer_token.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | 1 | 2021-03-30T12:55:39.000Z | 2021-04-08T08:23:27.000Z | ingenico/direct/sdk/domain/customer_token.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://support.direct.ingenico.com/documentation/api/reference/
#
from ingenico.direct.sdk.data_object import DataObject
from ingenico.direct.sdk.domain.address import Address
from ingenico.direct.sdk.domain.company_informatio... | 41.578313 | 109 | 0.703854 |
4acbbae7f94e1d806015de62ee5a96d02c3544d7 | 301 | py | Python | inserter.py | pirate/macOS-global-autocomplete | 4ba8c3efdd34e7b4c0044c50f47d21a1bafd9aac | [
"MIT"
] | 23 | 2018-12-28T17:33:33.000Z | 2022-03-07T21:25:31.000Z | inserter.py | pirate/osx-global-autocomplete | 4ba8c3efdd34e7b4c0044c50f47d21a1bafd9aac | [
"MIT"
] | null | null | null | inserter.py | pirate/osx-global-autocomplete | 4ba8c3efdd34e7b4c0044c50f47d21a1bafd9aac | [
"MIT"
] | 2 | 2017-02-27T18:08:12.000Z | 2018-08-27T00:40:10.000Z | import time
import pykeyboard
# TODO: Replace following two lines with the code that activate the application.
print('Activate the application 3 seconds.')
time.sleep(3)
k = pykeyboard.PyKeyboard()
k.press_key(k.left_key)
time.sleep(1) # Hold down left key for 1 second.
k.release_key(k.left_key)
| 21.5 | 80 | 0.770764 |
4acbd0cbd7b35addaf03f24e1fa4d33805db8c3a | 4,819 | py | Python | tools/corpora.py | EleutherAI/megatron-3d | be3014d47a127f08871d0ba6d6389363f2484397 | [
"MIT"
] | 3 | 2021-02-13T21:51:45.000Z | 2021-02-14T23:15:02.000Z | tools/corpora.py | EleutherAI/megatron-3d | be3014d47a127f08871d0ba6d6389363f2484397 | [
"MIT"
] | 13 | 2021-02-08T11:22:38.000Z | 2021-02-18T20:13:10.000Z | tools/corpora.py | EleutherAI/megatron-3d | be3014d47a127f08871d0ba6d6389363f2484397 | [
"MIT"
] | 2 | 2021-02-13T22:13:21.000Z | 2021-10-12T06:39:33.000Z | import os
import tarfile
from abc import ABC, abstractmethod
from glob import glob
import shutil
import random
import zstandard
"""
This registry is for automatically downloading and extracting datasets.
To register a class you need to inherit the DataDownloader class, provide name, filetype and url attributes, and
(... | 35.175182 | 136 | 0.661756 |
4acced6bfbc482f9d38f37f561868a587991d47b | 1,575 | py | Python | othello_rl/qlearning/qlearning.py | aka256/othello-rl | ef5e78c6cf6b276e16b50086b53138ab968d728c | [
"MIT"
] | null | null | null | othello_rl/qlearning/qlearning.py | aka256/othello-rl | ef5e78c6cf6b276e16b50086b53138ab968d728c | [
"MIT"
] | null | null | null | othello_rl/qlearning/qlearning.py | aka256/othello-rl | ef5e78c6cf6b276e16b50086b53138ab968d728c | [
"MIT"
] | null | null | null | from logging import getLogger
logger = getLogger(__name__)
| 17.119565 | 98 | 0.507937 |
4acdb07fa21e6d09ec1006ea9fc4f7c0e59b102d | 6,748 | py | Python | SearchService/test/unit/test_solr_interface.py | loftwah/appscale | 586fc1347ebc743d7a632de698f4dbfb09ae38d6 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | SearchService/test/unit/test_solr_interface.py | loftwah/appscale | 586fc1347ebc743d7a632de698f4dbfb09ae38d6 | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | SearchService/test/unit/test_solr_interface.py | loftwah/appscale | 586fc1347ebc743d7a632de698f4dbfb09ae38d6 | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | #!/usr/bin/env python
import os
import json
import sys
import unittest
import urllib2
from flexmock import flexmock
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
import solr_interface
import search_exceptions
| 33.405941 | 80 | 0.678275 |
4ace0f44b44658df4422d4f5661978d41ce06350 | 1,923 | py | Python | src/mpu/__init__.py | TsinghuaAI/CPM-2-Pretrain | 33003865239e7ba13a12aabf9ec2735cef66bf3b | [
"MIT"
] | 54 | 2021-06-17T09:05:11.000Z | 2022-03-18T09:12:14.000Z | src/mpu/__init__.py | TsinghuaAI/CPM-2-Pretrain | 33003865239e7ba13a12aabf9ec2735cef66bf3b | [
"MIT"
] | 25 | 2021-06-29T02:58:28.000Z | 2022-03-30T04:45:06.000Z | src/mpu/__init__.py | TsinghuaAI/CPM-2-Pretrain | 33003865239e7ba13a12aabf9ec2735cef66bf3b | [
"MIT"
] | 11 | 2021-06-22T08:00:25.000Z | 2022-03-04T05:41:50.000Z | # coding=utf-8
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 36.980769 | 74 | 0.841914 |
4ace72273e1ae90dc1c68aa24e3b23afcdc01695 | 2,141 | py | Python | djangosige/apps/cadastro/models/empresa.py | MateusMolina/lunoERP | 0880adb93b3a2d3169c6780efa60a229272f927a | [
"MIT"
] | null | null | null | djangosige/apps/cadastro/models/empresa.py | MateusMolina/lunoERP | 0880adb93b3a2d3169c6780efa60a229272f927a | [
"MIT"
] | null | null | null | djangosige/apps/cadastro/models/empresa.py | MateusMolina/lunoERP | 0880adb93b3a2d3169c6780efa60a229272f927a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from django.db import models
from django.db.models.signals import post_delete
from django.dispatch import receiver
from .base import Pessoa
from djangosige.apps.login.models import Usuario
from djangosige.configs.settings import MEDIA_ROOT
# Deletar logo quando empr... | 32.439394 | 105 | 0.666978 |
4acea4b00d95238388dfdf1bfda34fd153268c2f | 5,858 | py | Python | WDJN/eval/eval.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 21 | 2020-12-16T08:53:38.000Z | 2022-01-21T09:08:55.000Z | WDJN/eval/eval.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 1 | 2020-12-27T07:56:01.000Z | 2020-12-30T05:13:11.000Z | WDJN/eval/eval.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 1 | 2022-02-28T12:19:19.000Z | 2022-02-28T12:19:19.000Z | import os
from nltk.translate.bleu_score import corpus_bleu
from nltk.translate.bleu_score import SmoothingFunction
import json
from tqdm import tqdm, trange
from random import sample
import numpy as np
import pickle
import argparse
import bert_eval_acc
import svm_eval_acc
smooth = SmoothingFunction()
def eval_bleu... | 32.726257 | 118 | 0.602083 |
4acf75fbdd9f5684eaa634c30e9274299d052baa | 804 | py | Python | homeassistant/components/unifi/const.py | olbjan/home-assistant-1 | 1adb45f74e96fc5eff137a3727647a7e428e123c | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/unifi/const.py | olbjan/home-assistant-1 | 1adb45f74e96fc5eff137a3727647a7e428e123c | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | homeassistant/components/unifi/const.py | olbjan/home-assistant-1 | 1adb45f74e96fc5eff137a3727647a7e428e123c | [
"Apache-2.0"
] | 1 | 2020-09-23T16:41:16.000Z | 2020-09-23T16:41:16.000Z | """Constants for the UniFi component."""
import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "unifi"
CONTROLLER_ID = "{host}-{site}"
CONF_CONTROLLER = "controller"
CONF_SITE_ID = "site"
UNIFI_WIRELESS_CLIENTS = "unifi_wireless_clients"
CONF_ALLOW_BANDWIDTH_SENSORS = "allow_bandwidth_sensors"
CONF_BLOCK... | 25.935484 | 56 | 0.823383 |
4acfa6e08c91d6cf965af047f2b0bfd2e83e88a1 | 503 | py | Python | coding_intereview/1656. Design an Ordered Stream.py | Jahidul007/Python-Bootcamp | 3c870587465ff66c2c1871c8d3c4eea72463abda | [
"MIT"
] | 2 | 2020-12-07T16:07:07.000Z | 2020-12-07T16:08:53.000Z | coding_intereview/1656. Design an Ordered Stream.py | Jahidul007/Python-Bootcamp | 3c870587465ff66c2c1871c8d3c4eea72463abda | [
"MIT"
] | null | null | null | coding_intereview/1656. Design an Ordered Stream.py | Jahidul007/Python-Bootcamp | 3c870587465ff66c2c1871c8d3c4eea72463abda | [
"MIT"
] | 1 | 2020-10-03T16:38:02.000Z | 2020-10-03T16:38:02.000Z |
# Your OrderedStream object will be instantiated and called as such:
# obj = OrderedStream(n)
# param_1 = obj.insert(id,value)
| 26.473684 | 80 | 0.584493 |
4acfc9cbd59d86d35555e057b3b06babb6b17219 | 1,091 | py | Python | python/test/test_tree_dp.py | EQt/treelas | 24a5cebf101180822198806c0a4131b0efb7a36d | [
"MIT"
] | 3 | 2020-06-18T13:31:26.000Z | 2021-04-05T17:42:56.000Z | python/test/test_tree_dp.py | EQt/treelas | 24a5cebf101180822198806c0a4131b0efb7a36d | [
"MIT"
] | null | null | null | python/test/test_tree_dp.py | EQt/treelas | 24a5cebf101180822198806c0a4131b0efb7a36d | [
"MIT"
] | null | null | null | import numpy as np
from treelas import post_order, TreeInstance
| 37.62069 | 70 | 0.508708 |