hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c09bed1b6f6417fb694256eebd2011785609c4f | 3,622 | py | Python | trigonometric.py | ChristophorusX/Burer-Monteiro | c69b72c3ad5eab901a6df4da6ebf48d4c6ee8e3b | [
"Apache-2.0"
] | null | null | null | trigonometric.py | ChristophorusX/Burer-Monteiro | c69b72c3ad5eab901a6df4da6ebf48d4c6ee8e3b | [
"Apache-2.0"
] | null | null | null | trigonometric.py | ChristophorusX/Burer-Monteiro | c69b72c3ad5eab901a6df4da6ebf48d4c6ee8e3b | [
"Apache-2.0"
] | null | null | null | import numpy as np
import burer_monteiro as bm
import basin_of_attraction as basin
import aux
from scipy import optimize as opt
def trig_objective_function(A, theta):
"""
Returns the function value in trigonometric parameterization.
"""
# dim, _ = A.shape
# T = np.empty((dim, dim))
# for i in... | 29.447154 | 101 | 0.569299 | import numpy as np
import burer_monteiro as bm
import basin_of_attraction as basin
import aux
from scipy import optimize as opt
def trig_objective_function(A, theta):
Q = recover_solution(theta)
return np.trace(A.dot(Q.dot(Q.T)))
def trig_grad(A, theta):
dim, _ = A.shape
... | true | true |
1c09beef8e6d777043ea3d3016e7b492adeddf9a | 8,237 | py | Python | setup.py | mobashgr/datasets | 5311f9a4c5bcb7bae0d31dcdc2f54fe5622d926d | [
"Apache-2.0"
] | null | null | null | setup.py | mobashgr/datasets | 5311f9a4c5bcb7bae0d31dcdc2f54fe5622d926d | [
"Apache-2.0"
] | null | null | null | setup.py | mobashgr/datasets | 5311f9a4c5bcb7bae0d31dcdc2f54fe5622d926d | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
""" HuggingFace/Datasets is an open library of datasets.
Note:
VERSION needs to be formatted following the MAJOR.MINOR.PATCH convention
(we need to follow this convention to be able to retrieve versioned scripts)
Simple check list for release from AllenNLP repo: https://github.com/allenai/al... | 31.559387 | 117 | 0.643802 |
import os
from setuptools import find_packages, setup
REQUIRED_PKGS = [
"numpy>=1.17",
"pyarrow>=3.0.0,!=4.0.0",
"dill",
"pandas",
"requests>=2.19.0",
"tqdm>=4.62.1",
"dataclasses;python_version<'3.7'",
# for fast hashing
"xxhash",
# for be... | true | true |
1c09bf2e821739215fad7be8de1c6be203f860e5 | 5,700 | py | Python | var/spack/repos/builtin/packages/protobuf/package.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-12-28T14:38:41.000Z | 2020-12-28T14:38:41.000Z | var/spack/repos/builtin/packages/protobuf/package.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | var/spack/repos/builtin/packages/protobuf/package.py | Kerilk/spack | e027942b55407a4a5fe323b93d8e57200c873a43 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack import *
import spack.util.web
class Protobuf(Package):
"""Google's data interchange format.""... | 49.137931 | 144 | 0.713509 |
import sys
from spack import *
import spack.util.web
class Protobuf(Package):
homepage = "https://developers.google.com/protocol-buffers"
url = "https://github.com/protocolbuffers/protobuf/archive/v3.12.2.tar.gz"
version('3.12.2', sha256='bb8ce9ba11eb7bccf080599fe7cad9cc461751c8dd1ba61701c0070d58... | true | true |
1c09bf9f9e09a5f2a8853ee17b94b196ac009241 | 6,299 | py | Python | tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/utils/saving.py | bluetiger9/Vitis-AI | a7728733bbcfc292ff3afa46b9c8b03e94b740b3 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/utils/saving.py | wangyifan778/Vitis-AI | f61061eef7550d98bf02a171604c9a9f283a7c47 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/utils/saving.py | wangyifan778/Vitis-AI | f61061eef7550d98bf02a171604c9a9f283a7c47 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | #
# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 35.789773 | 126 | 0.643118 |
import h5py
import json
from nndct_shared.nndct_graph.base_tensor import Tensor
def save_graph(nndct_graph, hdf5_path='graph.hdf5'):
GraphHDF5Saver(nndct_graph).save(hdf5_path)
class GraphHDF5Saver():
def __init__(self, nndct_graph):
self.graph = nndct_graph
def get_node_config(self, node):
node_inf... | true | true |
1c09bfe9bbf79ec5d0e80f1bf5ae17d142f279f8 | 3,622 | py | Python | official/utils/docs/build_all_api_docs.py | brian-j-cao/models | e0ed507504b4efa6780e244677ded563b36b0ee7 | [
"Apache-2.0"
] | null | null | null | official/utils/docs/build_all_api_docs.py | brian-j-cao/models | e0ed507504b4efa6780e244677ded563b36b0ee7 | [
"Apache-2.0"
] | null | null | null | official/utils/docs/build_all_api_docs.py | brian-j-cao/models | e0ed507504b4efa6780e244677ded563b36b0ee7 | [
"Apache-2.0"
] | 1 | 2022-03-21T13:47:02.000Z | 2022-03-21T13:47:02.000Z | # Copyright 2022 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... | 30.957265 | 80 | 0.738542 |
import pathlib
from absl import app
from absl import flags
from absl import logging
from tensorflow_docs.api_generator import generate_lib
from tensorflow_docs.api_generator import public_api
import tensorflow_models as tfm
from official.utils.docs import build_api_docs_lib
FLAGS = flags.FLAGS
flags.DEFINE_string... | true | true |
1c09c2ae926691420cf200ff70cf1f38f6c56c2b | 10,073 | py | Python | tensorboard/plugins/debugger_v2/debugger_v2_plugin.py | ReDeiPirati/tensorboard | 96c9327de762c56179165d881cc51adcf45e27f3 | [
"Apache-2.0"
] | null | null | null | tensorboard/plugins/debugger_v2/debugger_v2_plugin.py | ReDeiPirati/tensorboard | 96c9327de762c56179165d881cc51adcf45e27f3 | [
"Apache-2.0"
] | null | null | null | tensorboard/plugins/debugger_v2/debugger_v2_plugin.py | ReDeiPirati/tensorboard | 96c9327de762c56179165d881cc51adcf45e27f3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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... | 36.762774 | 82 | 0.610047 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from werkzeug import wrappers
from tensorboard import plugin_util
from tensorboard.plugins import base_plugin
from tensorboard.plugins.debugger_v2 import debug_data_provider
from tensorboard.backend import ht... | true | true |
1c09c34d27ad94a26e205988fc6ac094b9787002 | 768 | py | Python | src/crawl_config.py | mad-center/bilibili-mad-crawler | ef980a334627c92d4f2ea19c5efab9dfa4a0eef6 | [
"MIT"
] | null | null | null | src/crawl_config.py | mad-center/bilibili-mad-crawler | ef980a334627c92d4f2ea19c5efab9dfa4a0eef6 | [
"MIT"
] | null | null | null | src/crawl_config.py | mad-center/bilibili-mad-crawler | ef980a334627c92d4f2ea19c5efab9dfa4a0eef6 | [
"MIT"
] | null | null | null | db_name = 'bilibili'
mongodb_url = 'mongodb://127.0.0.1:27017/'
# reference: https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/video/video_zone.md
# ==============================================================
primary_partition_code = 'douga'
subpartition_name = 'MAD·AMV'
subpartition_code = 'mad'... | 30.72 | 99 | 0.591146 | db_name = 'bilibili'
mongodb_url = 'mongodb://127.0.0.1:27017/'
primary_partition_code = 'douga'
subpartition_name = 'MAD·AMV'
subpartition_code = 'mad'
subpartition_tid = 24
crawl_progress_collection_name = 'multi_crawl_mad_by_init_tag'
| true | true |
1c09c351b421013f19094c0ac397c7446cf98e05 | 4,546 | py | Python | pget/agent.py | tehZevo/pget | f3b5ff85221d15911548f7d18d45b1bec9c68ddb | [
"MIT"
] | 2 | 2019-09-06T13:53:20.000Z | 2021-07-04T14:12:21.000Z | pget/agent.py | tehZevo/pget | f3b5ff85221d15911548f7d18d45b1bec9c68ddb | [
"MIT"
] | null | null | null | pget/agent.py | tehZevo/pget | f3b5ff85221d15911548f7d18d45b1bec9c68ddb | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
from ml_utils.keras import get_states, set_states, apply_regularization
from ml_utils.model_builders import dense_stack
from .pget import create_traces, update_traces, step_weights_opt
from .pget import explore_continuous, explore_discrete, explore_multibinary
#TODO: saving... | 38.201681 | 96 | 0.723053 | import tensorflow as tf
import numpy as np
from ml_utils.keras import get_states, set_states, apply_regularization
from ml_utils.model_builders import dense_stack
from .pget import create_traces, update_traces, step_weights_opt
from .pget import explore_continuous, explore_discrete, explore_multibinary
class Agent(... | true | true |
1c09c3f81bef0c0e38ee6dcfa97ed1ae6976d948 | 1,541 | py | Python | examples/_benchmarking/beams.py | yijiangh/compas_fea | 632542da6a3794f6a82c30131c61a421a10a9aa8 | [
"MIT"
] | null | null | null | examples/_benchmarking/beams.py | yijiangh/compas_fea | 632542da6a3794f6a82c30131c61a421a10a9aa8 | [
"MIT"
] | null | null | null | examples/_benchmarking/beams.py | yijiangh/compas_fea | 632542da6a3794f6a82c30131c61a421a10a9aa8 | [
"MIT"
] | null | null | null | import compas_fea
from compas_fea.structure import ElementProperties as Properties
from compas_fea.structure import GeneralStep
from compas_fea.structure import FixedDisplacement
from compas_fea.structure import RectangularSection
from compas_fea.structure import PointLoad
from compas_fea.structure import Steel
from c... | 23 | 103 | 0.740428 | import compas_fea
from compas_fea.structure import ElementProperties as Properties
from compas_fea.structure import GeneralStep
from compas_fea.structure import FixedDisplacement
from compas_fea.structure import RectangularSection
from compas_fea.structure import PointLoad
from compas_fea.structure import Steel
from c... | true | true |
1c09c4a9c69cfdfe58499d9eea36883ecb84dbcd | 3,960 | py | Python | electroncash_gui/qt/amountedit.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 208 | 2017-07-25T19:52:15.000Z | 2018-09-21T13:44:58.000Z | electroncash_gui/qt/amountedit.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 1,478 | 2018-09-24T09:30:13.000Z | 2022-03-29T15:48:17.000Z | electroncash_gui/qt/amountedit.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 159 | 2018-09-24T12:56:47.000Z | 2022-03-28T23:52:17.000Z | # -*- coding: utf-8 -*-
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame)
from decimal import Decimal as PyDecimal # Qt 5.12 also exports Decimal
from electroncash.util import format_satoshis_plain, inv_base_units
from .util import ColorScheme
cl... | 33.559322 | 184 | 0.612121 |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame)
from decimal import Decimal as PyDecimal from electroncash.util import format_satoshis_plain, inv_base_units
from .util import ColorScheme
class MyLineEdit(QLineEdit):
frozen = pyqtSignal()
... | true | true |
1c09c538fdd4a6d61b58eecfef554976e7bcfa00 | 1,102 | py | Python | assignments/02_sum/sum.py | wentingluo1993/be434-fall-2021 | 8ffe9ab276c3d1f5c0b2108ad8b4235b421ff5d7 | [
"MIT"
] | null | null | null | assignments/02_sum/sum.py | wentingluo1993/be434-fall-2021 | 8ffe9ab276c3d1f5c0b2108ad8b4235b421ff5d7 | [
"MIT"
] | null | null | null | assignments/02_sum/sum.py | wentingluo1993/be434-fall-2021 | 8ffe9ab276c3d1f5c0b2108ad8b4235b421ff5d7 | [
"MIT"
] | 1 | 2021-09-21T06:45:32.000Z | 2021-09-21T06:45:32.000Z | #!/usr/bin/env python3
"""
Author : wenting <wenting@localhost>
Date : 2021-09-14
Purpose: sum numbers
"""
import argparse
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='sum numbers',
form... | 24.488889 | 73 | 0.528131 |
import argparse
def get_args():
parser = argparse.ArgumentParser(
description='sum numbers',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('int', metavar='INT', type=int, nargs='+',
help='Numbers to add')
return parser.parse_args()... | true | true |
1c09c55aa2c834e566dd8d6cd57b9a254bf26efe | 6,628 | py | Python | research/object_detection/core/keypoint_ops_test.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 3,326 | 2018-01-26T22:42:25.000Z | 2022-02-16T13:16:39.000Z | research/object_detection/core/keypoint_ops_test.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | research/object_detection/core/keypoint_ops_test.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 2,580 | 2017-05-14T14:33:41.000Z | 2022-03-31T15:04:14.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.975124 | 80 | 0.596258 |
import numpy as np
import tensorflow as tf
from object_detection.core import keypoint_ops
class KeypointOpsTest(tf.test.TestCase):
def test_scale(self):
keypoints = tf.constant([
[[0.0, 0.0], [100.0, 200.0]],
[[50.0, 120.0], [100.0, 140.0]]
])
y_scale = tf.constant(1.0 / 100)
x_sc... | true | true |
1c09c6c8e1b12ca440c64ec6e972d3340e38b79c | 6,902 | py | Python | kalmfl/multistanza/models/common/char_model.py | yuhengwang1/kalm-fl | c713014d85e71bf728f6687a1b41c47ebd626263 | [
"BSD-3-Clause"
] | null | null | null | kalmfl/multistanza/models/common/char_model.py | yuhengwang1/kalm-fl | c713014d85e71bf728f6687a1b41c47ebd626263 | [
"BSD-3-Clause"
] | null | null | null | kalmfl/multistanza/models/common/char_model.py | yuhengwang1/kalm-fl | c713014d85e71bf728f6687a1b41c47ebd626263 | [
"BSD-3-Clause"
] | 1 | 2022-02-22T16:12:40.000Z | 2022-02-22T16:12:40.000Z | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_sequence, pad_packed_sequence, pack_padded_sequence, PackedSequence
from kalmfl.multistanza.models.common.packed_lstm import PackedLSTM
from kalmfl.multistanza.models.common.utils import tensor_unsort, unsort
from kalmfl.multistanza.models.common.d... | 48.605634 | 165 | 0.657056 | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_sequence, pad_packed_sequence, pack_padded_sequence, PackedSequence
from kalmfl.multistanza.models.common.packed_lstm import PackedLSTM
from kalmfl.multistanza.models.common.utils import tensor_unsort, unsort
from kalmfl.multistanza.models.common.d... | true | true |
1c09c6c9b63a27a7bf67bf35fa800ab4fd702020 | 629 | py | Python | NewsComparer/setup.py | vijay-chavakula/TwitterNewsAnalyserBot | 8ae66f4666a67ed9604d031354bd11fc15de9a33 | [
"MIT"
] | 15 | 2018-06-19T12:51:26.000Z | 2022-01-10T03:54:33.000Z | NewsComparer/setup.py | vijay-chavakula/TwitterNewsAnalyserBot | 8ae66f4666a67ed9604d031354bd11fc15de9a33 | [
"MIT"
] | 11 | 2018-06-10T12:42:18.000Z | 2018-10-01T06:19:46.000Z | NewsComparer/setup.py | vijay-chavakula/TwitterNewsAnalyserBot | 8ae66f4666a67ed9604d031354bd11fc15de9a33 | [
"MIT"
] | 8 | 2018-07-07T05:02:23.000Z | 2018-07-07T12:33:07.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="News_Comparer",
version="0.0.1",
author="Rohith Gilla",
author_email="gillarohith1@gmail.com",
description="News comparison bot",
long_description=long_description,
long_descriptio... | 29.952381 | 66 | 0.678855 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="News_Comparer",
version="0.0.1",
author="Rohith Gilla",
author_email="gillarohith1@gmail.com",
description="News comparison bot",
long_description=long_description,
long_descriptio... | true | true |
1c09c767cd126ecccf8b61075b65c3c23d830251 | 12,185 | py | Python | tests/test.py | blakev/python-xxhash | fa2bc598b19c1b088b38cbf18c45fc7d6e6b9fd7 | [
"BSD-2-Clause"
] | null | null | null | tests/test.py | blakev/python-xxhash | fa2bc598b19c1b088b38cbf18c45fc7d6e6b9fd7 | [
"BSD-2-Clause"
] | null | null | null | tests/test.py | blakev/python-xxhash | fa2bc598b19c1b088b38cbf18c45fc7d6e6b9fd7 | [
"BSD-2-Clause"
] | null | null | null | import array
import os
import unittest
import random
import struct
import sys
import xxhash
def getrefcount(obj):
if hasattr(sys, "getrefcount"):
return sys.getrefcount(obj)
else:
# Non-CPython implementation
return 0
class TestXXH(unittest.TestCase):
def test_version(self):
... | 43.362989 | 85 | 0.622651 | import array
import os
import unittest
import random
import struct
import sys
import xxhash
def getrefcount(obj):
if hasattr(sys, "getrefcount"):
return sys.getrefcount(obj)
else:
return 0
class TestXXH(unittest.TestCase):
def test_version(self):
self.assertTrue(xxhash.VE... | true | true |
1c09c76828d71b351d423729e9a409706ea096c0 | 1,267 | py | Python | Assignment 3/problem 2/Qplot.py | takeitbillykyle/EL2805-Reinforcement-Learning- | ba16f1bff7d6676fcafd2ec19e6d2bcd195ebb1f | [
"MIT"
] | null | null | null | Assignment 3/problem 2/Qplot.py | takeitbillykyle/EL2805-Reinforcement-Learning- | ba16f1bff7d6676fcafd2ec19e6d2bcd195ebb1f | [
"MIT"
] | null | null | null | Assignment 3/problem 2/Qplot.py | takeitbillykyle/EL2805-Reinforcement-Learning- | ba16f1bff7d6676fcafd2ec19e6d2bcd195ebb1f | [
"MIT"
] | null | null | null | '''
AUTHORS:
NORSTRÖM, ARVID 19940206-3193,
HISELIUS, LEO 9402214192
'''
import torch
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
actor = torch.load('models/neural-network-2-actor.pt')
critic = torch.load('models/neural-network-2-critic.pt')
ys = np.linspace(0,1.... | 22.625 | 111 | 0.687451 |
import torch
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
actor = torch.load('models/neural-network-2-actor.pt')
critic = torch.load('models/neural-network-2-critic.pt')
ys = np.linspace(0,1.5,100)
omegas = np.linspace(-np.pi,np.pi,100)
Q = np.zeros((100,100))
for i,y ... | true | true |
1c09c86254a4aa63ec766fef123b82ac03051d75 | 8,847 | py | Python | intersight/model/resource_license_resource_count_list_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/resource_license_resource_count_list_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/resource_license_resource_count_list_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 50.267045 | 1,678 | 0.644399 |
import re import sys
from intersight.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def lazy_... | true | true |
1c09c954fb4464c4888410f8575a83c330b27f25 | 21,836 | py | Python | target_python_sdk/helper.py | adobe/target-python-sdk | f3e9b1bb6c8e1984e3d758ab1fe1a71225ade13e | [
"Apache-2.0"
] | 3 | 2021-05-25T20:10:46.000Z | 2021-06-15T05:49:18.000Z | target_python_sdk/helper.py | adobe/target-python-sdk | f3e9b1bb6c8e1984e3d758ab1fe1a71225ade13e | [
"Apache-2.0"
] | 15 | 2021-01-13T22:53:25.000Z | 2021-09-03T23:11:25.000Z | target_python_sdk/helper.py | adobe/target-python-sdk | f3e9b1bb6c8e1984e3d758ab1fe1a71225ade13e | [
"Apache-2.0"
] | 4 | 2021-01-04T18:44:01.000Z | 2022-03-15T21:30:11.000Z | # Copyright 2021 Adobe. All rights reserved.
# This file is licensed to you 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 ... | 32.301775 | 112 | 0.73791 |
try:
from functools import reduce
except ImportError:
pass
from copy import deepcopy
import pkg_resources
from delivery_api_client import ApiClient
from delivery_api_client import MobilePlatformType
from delivery_api_client import DeviceType
from delivery_api_client import ScreenOrientationType
from delivery_a... | true | true |
1c09ca03eaf6d7c28e91c42ec49f326e810c1da4 | 63,396 | py | Python | etcdgrpc/rpc_pb2_grpc.py | caslt/pyetcd3 | da8d993ca59d37457ad94f64ec88f3dbab61cc14 | [
"MIT"
] | null | null | null | etcdgrpc/rpc_pb2_grpc.py | caslt/pyetcd3 | da8d993ca59d37457ad94f64ec88f3dbab61cc14 | [
"MIT"
] | null | null | null | etcdgrpc/rpc_pb2_grpc.py | caslt/pyetcd3 | da8d993ca59d37457ad94f64ec88f3dbab61cc14 | [
"MIT"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from etcdgrpc import rpc_pb2 as rpc__pb2
class KVStub(object):
"""Missing associated documentation comment in .proto file"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Chann... | 42.777328 | 110 | 0.646098 | import grpc
from etcdgrpc import rpc_pb2 as rpc__pb2
class KVStub(object):
def __init__(self, channel):
self.Range = channel.unary_unary(
'/etcdserverpb.KV/Range',
request_serializer=rpc__pb2.RangeRequest.SerializeToString,
response_deserializer=rpc__pb2.R... | true | true |
1c09ca18d271d1d6346ab12d62e1b58a00080353 | 5,133 | py | Python | qinling/utils/common.py | lingxiankong/qinling | e18f80345ae519c9308cfc93fdf53b82c9be7618 | [
"Apache-2.0"
] | 2 | 2017-04-11T04:23:25.000Z | 2017-05-04T13:30:46.000Z | qinling/utils/common.py | lingxiankong/qinling | e18f80345ae519c9308cfc93fdf53b82c9be7618 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | qinling/utils/common.py | lingxiankong/qinling | e18f80345ae519c9308cfc93fdf53b82c9be7618 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2017 Catalyst IT Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31.685185 | 77 | 0.554062 | import functools
import hashlib
import pdb
import sys
import warnings
from oslo_utils import uuidutils
import six
from qinling import exceptions as exc
from qinling import version
def print_server_info(service):
QINLING_TITLE = r"""
/^L_ ,."\
/~\ __ ... | true | true |
1c09ca4146972ebf7d9ead2652097e19afc4ba71 | 1,175 | py | Python | sympy/matrices/__init__.py | nikkigabbard/sympy | 1819379bdcca733eabc635ca4b3c9ae3deff1205 | [
"BSD-3-Clause"
] | null | null | null | sympy/matrices/__init__.py | nikkigabbard/sympy | 1819379bdcca733eabc635ca4b3c9ae3deff1205 | [
"BSD-3-Clause"
] | null | null | null | sympy/matrices/__init__.py | nikkigabbard/sympy | 1819379bdcca733eabc635ca4b3c9ae3deff1205 | [
"BSD-3-Clause"
] | 1 | 2019-10-02T10:47:13.000Z | 2019-10-02T10:47:13.000Z | """A module that handles matrices.
Includes functions for fast creating matrices like zero, one/eye, random
matrix, etc.
"""
from .common import ShapeError, NonSquareMatrixError
from .dense import (
GramSchmidt, casoratian, diag, eye, hessian, jordan_cell,
list2numpy, matrix2numpy, matrix_multiply_elementwise,... | 39.166667 | 77 | 0.805106 | from .common import ShapeError, NonSquareMatrixError
from .dense import (
GramSchmidt, casoratian, diag, eye, hessian, jordan_cell,
list2numpy, matrix2numpy, matrix_multiply_elementwise, ones,
randMatrix, rot_axis1, rot_axis2, rot_axis3, symarray, wronskian,
zeros)
from .dense import MutableDenseMatrix
... | true | true |
1c09ca6b9dfd1b974597507c1992f57edf5429d7 | 276 | py | Python | care/apps/facility/validators.py | chetanyakan/care-platform | 52cd390b711bda4d8081f9cb4aed198c3ccc4195 | [
"MIT"
] | null | null | null | care/apps/facility/validators.py | chetanyakan/care-platform | 52cd390b711bda4d8081f9cb4aed198c3ccc4195 | [
"MIT"
] | null | null | null | care/apps/facility/validators.py | chetanyakan/care-platform | 52cd390b711bda4d8081f9cb4aed198c3ccc4195 | [
"MIT"
] | 2 | 2020-05-21T07:18:49.000Z | 2020-11-03T12:18:43.000Z | from django.core.validators import RegexValidator
vehicle_number_regex = RegexValidator(
regex="^[A-Z]{2}[0-9]{1,2}[A-Z]{0,2}[0-9]{1,4}$",
message="Please Enter the vehicle number in all uppercase without spaces, eg: KL13AB1234",
code="invalid_vehicle_number",
)
| 34.5 | 94 | 0.713768 | from django.core.validators import RegexValidator
vehicle_number_regex = RegexValidator(
regex="^[A-Z]{2}[0-9]{1,2}[A-Z]{0,2}[0-9]{1,4}$",
message="Please Enter the vehicle number in all uppercase without spaces, eg: KL13AB1234",
code="invalid_vehicle_number",
)
| true | true |
1c09caee2133c00c813383f53492154ffaaa15ab | 1,900 | py | Python | kwiklib/utils/pydict.py | fiath/test | b50898dafa90e93da48f573e0b3feb1bb6acd8de | [
"MIT",
"BSD-3-Clause"
] | 7 | 2015-01-20T13:55:51.000Z | 2018-02-06T09:31:21.000Z | kwiklib/utils/pydict.py | fiath/test | b50898dafa90e93da48f573e0b3feb1bb6acd8de | [
"MIT",
"BSD-3-Clause"
] | 6 | 2015-01-08T18:13:53.000Z | 2016-06-22T09:53:53.000Z | kwiklib/utils/pydict.py | fiath/test | b50898dafa90e93da48f573e0b3feb1bb6acd8de | [
"MIT",
"BSD-3-Clause"
] | 8 | 2015-01-22T22:57:19.000Z | 2020-03-19T11:43:56.000Z | """Handle user-specified and default dictionaries."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os
from six import string_types, iteritems
# -----------------------------------------... | 38 | 79 | 0.504737 | """Handle user-specified and default dictionaries."""
import os
from six import string_types, iteritems
def to_str(val):
"""Get a string representation of any Python variable."""
if isinstance(val, string_types):
return "'{0:s}'".format(val)
else:
return str(val)
def to_lower(d):
ret... | false | true |
1c09caf14a65cea46259596af5af84bbdb73010e | 3,450 | py | Python | coverage/env.py | Ross1503/coveragepy | 2a4e140b4c67cb5d7ab13bd7f425a9c1de8d4391 | [
"Apache-2.0"
] | 1 | 2020-02-24T10:03:21.000Z | 2020-02-24T10:03:21.000Z | coverage/env.py | ossdev07/coveragepy | 3a6f5ed72bb7e71693ffb07b13713e4047f82f05 | [
"Apache-2.0"
] | 9 | 2020-08-11T15:19:55.000Z | 2022-03-12T00:11:12.000Z | coverage/env.py | ossdev07/coveragepy | 3a6f5ed72bb7e71693ffb07b13713e4047f82f05 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Determine facts about the environment."""
import os
import platform
import sys
# Operating systems.
WINDOWS = sys.platform == "win32"
LINUX = sys.platform.star... | 34.5 | 79 | 0.681159 |
import os
import platform
import sys
WINDOWS = sys.platform == "win32"
LINUX = sys.platform.startswith("linux")
PYPY = (platform.python_implementation() == 'PyPy')
if PYPY:
PYPYVERSION = sys.pypy_version_info
JYTHON = (platform.python_implementation() == 'Jython')
IRONPYTHON = (platform.python_implementation()... | true | true |
1c09caff52a77d4565f8bb0df81803050b4e93a2 | 6,168 | py | Python | torch/nn/intrinsic/modules/fused.py | ljhOfGithub/pytorch | c568f7b16f2a98d72ff5b7c6c6161b67b2c27514 | [
"Intel"
] | 1 | 2022-03-02T00:28:04.000Z | 2022-03-02T00:28:04.000Z | torch/nn/intrinsic/modules/fused.py | ljhOfGithub/pytorch | c568f7b16f2a98d72ff5b7c6c6161b67b2c27514 | [
"Intel"
] | 1 | 2019-07-23T15:23:32.000Z | 2019-07-23T15:32:23.000Z | torch/nn/intrinsic/modules/fused.py | ljhOfGithub/pytorch | c568f7b16f2a98d72ff5b7c6c6161b67b2c27514 | [
"Intel"
] | 2 | 2019-07-23T14:37:31.000Z | 2019-07-23T14:47:13.000Z | import torch
from torch.nn import Conv1d, Conv2d, Conv3d, ReLU, Linear, BatchNorm1d, BatchNorm2d, BatchNorm3d
# Used for identifying intrinsic modules used in quantization
class _FusedModule(torch.nn.Sequential):
pass
class ConvReLU1d(_FusedModule):
r"""This is a sequential container which calls the Conv1d an... | 49.344 | 96 | 0.666342 | import torch
from torch.nn import Conv1d, Conv2d, Conv3d, ReLU, Linear, BatchNorm1d, BatchNorm2d, BatchNorm3d
class _FusedModule(torch.nn.Sequential):
pass
class ConvReLU1d(_FusedModule):
def __init__(self, conv, relu):
assert type(conv) == Conv1d and type(relu) == ReLU, \
'Incorrect types... | true | true |
1c09cc909e195df44893b85671c477e2b9fcc19b | 662 | py | Python | students/K33402/Ivanova_Inessa/lab_02/manage.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 4 | 2020-09-03T15:41:42.000Z | 2021-12-24T15:28:20.000Z | students/K33402/Ivanova_Inessa/lab_02/manage.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 48 | 2020-09-13T20:22:42.000Z | 2021-04-30T11:13:30.000Z | students/K33402/Ivanova_Inessa/lab_02/manage.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 69 | 2020-09-06T10:32:37.000Z | 2021-11-28T18:13:17.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lab_02.settings')
try:
from django.core.management import execute_from_command_line
except Impor... | 28.782609 | 73 | 0.678248 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lab_02.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c09ccbe76dbb90269f80f0e44d31f1f8cd83114 | 3,245 | py | Python | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_permissions.py | ymrzkrrs/dagster | b5713af752146674d1f96436d0a01363e6834cb7 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_permissions.py | ymrzkrrs/dagster | b5713af752146674d1f96436d0a01363e6834cb7 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_permissions.py | ymrzkrrs/dagster | b5713af752146674d1f96436d0a01363e6834cb7 | [
"Apache-2.0"
] | 1 | 2021-11-30T21:40:46.000Z | 2021-11-30T21:40:46.000Z | from unittest.mock import Mock
import pytest
from dagster import check
from dagster.core.workspace.permissions import EDITOR_PERMISSIONS, VIEWER_PERMISSIONS
from dagster_graphql.implementation.utils import (
UserFacingGraphQLError,
assert_permission,
check_permission,
)
from dagster_graphql.test.utils impo... | 29.5 | 89 | 0.755932 | from unittest.mock import Mock
import pytest
from dagster import check
from dagster.core.workspace.permissions import EDITOR_PERMISSIONS, VIEWER_PERMISSIONS
from dagster_graphql.implementation.utils import (
UserFacingGraphQLError,
assert_permission,
check_permission,
)
from dagster_graphql.test.utils impo... | true | true |
1c09ccdf89dcd0a2a6b24680e7070787a0fae4b6 | 11,345 | py | Python | cleanup/holdings.py | ETspielberg/alma-scripts | d120e706962354c2c78f0544a1d84ea4573d9092 | [
"MIT"
] | 2 | 2020-12-18T12:18:33.000Z | 2022-01-04T21:33:30.000Z | cleanup/holdings.py | ETspielberg/alma-scripts | d120e706962354c2c78f0544a1d84ea4573d9092 | [
"MIT"
] | null | null | null | cleanup/holdings.py | ETspielberg/alma-scripts | d120e706962354c2c78f0544a1d84ea4573d9092 | [
"MIT"
] | null | null | null | import copy
import json
import logging
import math
import os
from threading import Thread
import requests
from service import table_reader_service
from service.alma import alma_bib_service, alma_electronic_service
from service.alma.alma_bib_service import retrieve_holding_record
from service.list_reader_service impor... | 42.33209 | 158 | 0.598678 | import copy
import json
import logging
import math
import os
from threading import Thread
import requests
from service import table_reader_service
from service.alma import alma_bib_service, alma_electronic_service
from service.alma.alma_bib_service import retrieve_holding_record
from service.list_reader_service impor... | true | true |
1c09cd5dd8a98ca19dbdca1494b5d8778fa9e9c5 | 3,975 | py | Python | transformer_net.py | jacobchanyeol/style-transfer_v1.0 | d272cb2aa0f67a8db4f8efe01808d1e480c9d075 | [
"MIT"
] | null | null | null | transformer_net.py | jacobchanyeol/style-transfer_v1.0 | d272cb2aa0f67a8db4f8efe01808d1e480c9d075 | [
"MIT"
] | null | null | null | transformer_net.py | jacobchanyeol/style-transfer_v1.0 | d272cb2aa0f67a8db4f8efe01808d1e480c9d075 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 4 02:03:13 2019
@author: jacobchoi
"""
import torch
class TransformerNet(torch.nn.Module):
def __init__(self):
super(TransformerNet, self).__init__()
# Initial convolution layers
self.conv1 = ConvLayer(3, 32, kernel_size=9, st... | 37.5 | 101 | 0.626415 |
import torch
class TransformerNet(torch.nn.Module):
def __init__(self):
super(TransformerNet, self).__init__()
self.conv1 = ConvLayer(3, 32, kernel_size=9, stride=1)
self.in1 = torch.nn.InstanceNorm2d(32, affine=True)
self.conv2 = ConvLayer(32, 64, kernel_size=3, ... | true | true |
1c09cdbbf5fcb2ac21032d5f974877d948cf271d | 5,610 | py | Python | load_data.py | ArefMq/cafe-data-contest | 4f00578f01b415348ef72efb6509559d009174a1 | [
"MIT"
] | 2 | 2020-04-04T05:38:13.000Z | 2020-04-05T05:29:23.000Z | load_data.py | ArefMq/cafe-data-contest | 4f00578f01b415348ef72efb6509559d009174a1 | [
"MIT"
] | null | null | null | load_data.py | ArefMq/cafe-data-contest | 4f00578f01b415348ef72efb6509559d009174a1 | [
"MIT"
] | null | null | null |
import pandas
import numpy as np
import time
import datetime
PK = 0
CITY = 1
DISTRICT = 2
CREATED_DATA = 3
TITLE = 4
DESC = 5
AREA = 6
BEDROOMS = 7
ADVERTISER = 8
SUBURBS = 9
LATITUDE = 10
LONGITUDE = 11
PRICE = 12
MILLION = 1000*1000
NORM_F_PRICE = 20
NORM_F_PK = 142320544
NORM_F_CITY = 710
NORM_F_DISTRICT = 673
N... | 29.68254 | 125 | 0.625134 |
import pandas
import numpy as np
import time
import datetime
PK = 0
CITY = 1
DISTRICT = 2
CREATED_DATA = 3
TITLE = 4
DESC = 5
AREA = 6
BEDROOMS = 7
ADVERTISER = 8
SUBURBS = 9
LATITUDE = 10
LONGITUDE = 11
PRICE = 12
MILLION = 1000*1000
NORM_F_PRICE = 20
NORM_F_PK = 142320544
NORM_F_CITY = 710
NORM_F_DISTRICT = 673
N... | false | true |
1c09cdedbcf63983cd3933a4befb26bd17d913e0 | 30,208 | py | Python | src/robotide/ui/mainframe.py | alepo239/RIDE | 4063c86208ce4c4ca7e27480a89eeab9c27a2fed | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robotide/ui/mainframe.py | alepo239/RIDE | 4063c86208ce4c4ca7e27480a89eeab9c27a2fed | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-07-16T19:27:56.000Z | 2019-07-16T19:27:56.000Z | src/robotide/ui/mainframe.py | alepo239/RIDE | 4063c86208ce4c4ca7e27480a89eeab9c27a2fed | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... | 39.028424 | 94 | 0.600238 |
import wx
import wx.lib.agw.aui as aui
from wx import Icon
from wx.lib.agw.aui import aui_switcherdialog as ASD
from robotide.lib.robot.utils.compat import with_metaclass
from robotide.action import ActionInfoCollection, ActionFactory, SeparatorInfo
from robotide.context import ABOUT_RIDE, SHORTCUT_KEYS
from robotide.... | true | true |
1c09cdf205955aba25705193b894c102bde5b8ff | 15,718 | py | Python | grafana_alerts/reporting.py | tictocplanet/grafana-alerts | ff6a662e232aa7f912821c6dc080e8ead9308bde | [
"Apache-2.0"
] | 52 | 2015-06-11T06:25:42.000Z | 2020-12-30T07:24:24.000Z | grafana_alerts/reporting.py | tictocplanet/grafana-alerts | ff6a662e232aa7f912821c6dc080e8ead9308bde | [
"Apache-2.0"
] | 15 | 2015-06-12T23:03:22.000Z | 2022-03-07T06:03:55.000Z | grafana_alerts/reporting.py | tictocplanet/grafana-alerts | ff6a662e232aa7f912821c6dc080e8ead9308bde | [
"Apache-2.0"
] | 20 | 2015-10-19T02:37:29.000Z | 2021-07-31T14:18:28.000Z | from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import hashlib
import os
import pickle
import smtplib
import datetime
import pkg_resources
__author__ = 'Pablo Alcaraz'
__copyright__ = "Copyright 2015, Pablo Alcaraz"
# __credits__ = [""]
__license__ = "Apache Software License V2.0"
... | 49.427673 | 254 | 0.621135 | from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import hashlib
import os
import pickle
import smtplib
import datetime
import pkg_resources
__author__ = 'Pablo Alcaraz'
__copyright__ = "Copyright 2015, Pablo Alcaraz"
__license__ = "Apache Software License V2.0"
_GRAFANA_URL_PATH_OB... | true | true |
1c09cea2fa84a44cca67dd562b5c6c2ee4ccdc09 | 3,983 | py | Python | cvat/apps/engine/migrations/0020_remove_task_flipped.py | raunilillemets/cvat | c083b5d3a60270121abc3f3fe596ff94ae0eb60f | [
"MIT"
] | 2 | 2020-03-16T03:41:27.000Z | 2020-03-16T03:53:01.000Z | cvat/apps/engine/migrations/0020_remove_task_flipped.py | raunilillemets/cvat | c083b5d3a60270121abc3f3fe596ff94ae0eb60f | [
"MIT"
] | 29 | 2020-01-28T23:08:18.000Z | 2022-03-12T00:05:33.000Z | cvat/apps/engine/migrations/0020_remove_task_flipped.py | maitreyamaity/CVAT-SIM-TEST | 6b97145c8f4584d9ad40a4b6541424955e272e42 | [
"MIT"
] | 3 | 2019-11-06T09:12:29.000Z | 2019-12-10T02:30:39.000Z | # Generated by Django 2.1.7 on 2019-06-18 11:08
from django.db import migrations
from django.conf import settings
from cvat.apps.engine.task import get_image_meta_cache
from cvat.apps.engine.models import Job, ShapeType
from PIL import Image
import os
def _flip_shape(shape, size):
if shape.type == ShapeType.R... | 31.611111 | 101 | 0.592769 |
from django.db import migrations
from django.conf import settings
from cvat.apps.engine.task import get_image_meta_cache
from cvat.apps.engine.models import Job, ShapeType
from PIL import Image
import os
def _flip_shape(shape, size):
if shape.type == ShapeType.RECTANGLE:
shape.points = [
s... | true | true |
1c09cf811bf01d0d46b3ae456c501013e8ebdcab | 958 | py | Python | Visualizacion_comparativo_nuevos.py | marko4789/Visualizacion-Covid19-MX | 9194a2590c35a12ddd66f1914c93f1ff869620b0 | [
"MIT"
] | null | null | null | Visualizacion_comparativo_nuevos.py | marko4789/Visualizacion-Covid19-MX | 9194a2590c35a12ddd66f1914c93f1ff869620b0 | [
"MIT"
] | null | null | null | Visualizacion_comparativo_nuevos.py | marko4789/Visualizacion-Covid19-MX | 9194a2590c35a12ddd66f1914c93f1ff869620b0 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
dataset_casos = pd.read_csv("Datos/comparativo_casos_nuevos.csv")
dataset_muertes = pd.read_csv("Datos/comparativo_muertes_nuevas.csv")
dias = np.arange(585)
casos = dataset_casos.iloc[:, 1]
casos_prom = dataset_casos.iloc[:, 3]
muertes = dataset_... | 38.32 | 86 | 0.741127 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
dataset_casos = pd.read_csv("Datos/comparativo_casos_nuevos.csv")
dataset_muertes = pd.read_csv("Datos/comparativo_muertes_nuevas.csv")
dias = np.arange(585)
casos = dataset_casos.iloc[:, 1]
casos_prom = dataset_casos.iloc[:, 3]
muertes = dataset_... | true | true |
1c09d19edeb96700cabff078e4173969d7369462 | 2,630 | py | Python | archive/video/pub.py | joseph-x-li/pystreaming | 31cd0129fdedfe4b11d73ead90bf4792f343ff42 | [
"MIT"
] | 1 | 2022-01-17T05:27:51.000Z | 2022-01-17T05:27:51.000Z | archive/video/pub.py | joseph-x-li/pystreaming | 31cd0129fdedfe4b11d73ead90bf4792f343ff42 | [
"MIT"
] | null | null | null | archive/video/pub.py | joseph-x-li/pystreaming | 31cd0129fdedfe4b11d73ead90bf4792f343ff42 | [
"MIT"
] | null | null | null | import zmq
import time
import multiprocessing as mp
import pystreaming.video.interface as intf
TIMESTEP = 0.01
def pullpub_ps(shutdown, infd, outfd, rcvhwm, sndhwm):
context = zmq.Context()
socket = context.socket(zmq.PULL)
socket.setsockopt(zmq.RCVHWM, rcvhwm)
socket.bind(infd)
out = context.s... | 29.886364 | 99 | 0.595057 | import zmq
import time
import multiprocessing as mp
import pystreaming.video.interface as intf
TIMESTEP = 0.01
def pullpub_ps(shutdown, infd, outfd, rcvhwm, sndhwm):
context = zmq.Context()
socket = context.socket(zmq.PULL)
socket.setsockopt(zmq.RCVHWM, rcvhwm)
socket.bind(infd)
out = context.s... | true | true |
1c09d1a15d91cfecb926724101e0c2f8e8660495 | 4,131 | py | Python | bot_modules/py/markov.py | cumdata/irc_bot | 6593215acb7850f435389ae64652d831279f3332 | [
"WTFPL"
] | null | null | null | bot_modules/py/markov.py | cumdata/irc_bot | 6593215acb7850f435389ae64652d831279f3332 | [
"WTFPL"
] | 2 | 2021-09-10T04:15:59.000Z | 2021-09-14T03:30:21.000Z | bot_modules/py/markov.py | cumdata/irc_bot | 6593215acb7850f435389ae64652d831279f3332 | [
"WTFPL"
] | null | null | null | """simple markov chaining for shitposting"""
import asyncio
import os
import pathlib
import random
import colors
import logger
import plugin_api
_logger = logger.LOGGER
# End of Sentence for Markov chaining
EOS = ('.', '?', '!')
def _should_log(msg):
"""Returns bool to log or not
will return False if:
... | 25.343558 | 71 | 0.573469 | import asyncio
import os
import pathlib
import random
import colors
import logger
import plugin_api
_logger = logger.LOGGER
EOS = ('.', '?', '!')
def _should_log(msg):
if msg.startswith('.'):
return False
if colors.CONTROL_COLOR in msg:
return False
return True
def _maybe_log(msg):
... | true | true |
1c09d1e1a84f0e8202581f876de4b676d6de1a75 | 5,627 | py | Python | ObitSystem/Obit/python/ConvUtil.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | 5 | 2019-08-26T06:53:08.000Z | 2020-10-20T01:08:59.000Z | ObitSystem/Obit/python/ConvUtil.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | null | null | null | ObitSystem/Obit/python/ConvUtil.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | 8 | 2017-08-29T15:12:32.000Z | 2022-03-31T12:16:08.000Z | # $Id$
#-----------------------------------------------------------------------
# Copyright (C) 2006,2009,2019
# Associated Universities, Inc. Washington DC, USA.
#
# 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 Fr... | 41.681481 | 85 | 0.6252 |
from __future__ import absolute_import
from __future__ import print_function
import Obit, Image, FArray, FArrayUtil, OErr
def PConv(inImage, convFn, doDivide, rescale, outImage, err):
if not Image.PIsA(inImage):
print("Actually ",inImage.__class__)
raise TypeError("inImage MUST be a Python... | true | true |
1c09d24cfb51d52f16c432b0cd43dd51254d8b9b | 16,461 | py | Python | alipay/aop/api/request/AlipayAcquireCreateandpayRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayAcquireCreateandpayRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayAcquireCreateandpayRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayAcquireCreateandpayRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
self._alipay_ca_request = ... | 35.324034 | 162 | 0.621712 | import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayAcquireCreateandpayRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
self._alipay_ca_request = None
self._body = None
self._b... | true | true |
1c09d3fdec5366fecd93b01d104dd70175bd50f3 | 608 | py | Python | fontawesome/forms.py | CodeForAfrica/django-fontawesome | 70b6eee7ef66fec83a62df78d66025923d4071aa | [
"BSD-2-Clause"
] | null | null | null | fontawesome/forms.py | CodeForAfrica/django-fontawesome | 70b6eee7ef66fec83a62df78d66025923d4071aa | [
"BSD-2-Clause"
] | 1 | 2018-08-06T13:52:08.000Z | 2018-08-06T14:53:51.000Z | fontawesome/forms.py | CodeForAfrica/django-fontawesome | 70b6eee7ef66fec83a62df78d66025923d4071aa | [
"BSD-2-Clause"
] | 1 | 2018-08-16T11:07:19.000Z | 2018-08-16T11:07:19.000Z | from __future__ import absolute_import
from django import forms
from django.conf import settings
from . import Icon
from .widgets import IconWidget
class IconFormField(forms.Field):
def __init__(self, *args, **kwargs):
self.widget = IconWidget
if 'initial' in kwargs:
kwargs['initial'... | 23.384615 | 55 | 0.639803 | from __future__ import absolute_import
from django import forms
from django.conf import settings
from . import Icon
from .widgets import IconWidget
class IconFormField(forms.Field):
def __init__(self, *args, **kwargs):
self.widget = IconWidget
if 'initial' in kwargs:
kwargs['initial'... | true | true |
1c09d47a035b835e442f99f5c3e56e6cfa7cde43 | 24,658 | py | Python | NBA Project/venv/Lib/site-packages/plotly/graph_objs/carpet/aaxis/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 1 | 2020-08-08T21:56:11.000Z | 2020-08-08T21:56:11.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/carpet/aaxis/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 2 | 2021-03-31T19:54:17.000Z | 2021-06-02T02:33:56.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/carpet/aaxis/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# font
# ----
@property
def font(self):
"""
Sets this axis' title font. Note that the title's font used to
be set by the now deprecated... | 34.390516 | 85 | 0.564198 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
@property
def font(self):
return self["font"]
@font.setter
def font(self, val):
self["font"] = val
@property
def offs... | true | true |
1c09d49ae81cc42edede51190b46179a22df0c91 | 1,560 | py | Python | transvae/version.py | ordaosbio/TransVAE | 578cb2b015e205da362332336d8f4815bd373edc | [
"MIT"
] | null | null | null | transvae/version.py | ordaosbio/TransVAE | 578cb2b015e205da362332336d8f4815bd373edc | [
"MIT"
] | null | null | null | transvae/version.py | ordaosbio/TransVAE | 578cb2b015e205da362332336d8f4815bd373edc | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
from os.path import join as pjoin
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 6
_version_micro = 3 # use '' for first of series, number for 1 and above
# _version_extra = 'dev1'
_versi... | 33.913043 | 95 | 0.714744 | from __future__ import absolute_import, division, print_function
from os.path import join as pjoin
_version_major = 0
_version_minor = 6
_version_micro = 3 _version_extra = ''
_ver = [_version_major, _version_minor]
if _version_micro:
_ver.append(_version_micro)
if _version_extra:
_ver.append(_version_extra... | true | true |
1c09d4c9551bca308cf996979d1fe0718e06d93b | 350 | py | Python | plugins/status.py | hank9999/QQBot | a28ec55218dd5cee11ef17376a0c79991e87d1aa | [
"MIT"
] | 1 | 2021-01-29T23:14:56.000Z | 2021-01-29T23:14:56.000Z | plugins/status.py | hank9999/QQBot | a28ec55218dd5cee11ef17376a0c79991e87d1aa | [
"MIT"
] | null | null | null | plugins/status.py | hank9999/QQBot | a28ec55218dd5cee11ef17376a0c79991e87d1aa | [
"MIT"
] | null | null | null | from nonebot import on_command, CommandSession
from nonebot import permission as perm
from Libs.getServerStatus import getStatus
@on_command('status', aliases=('服务器状态', '状态', 'list'), permission=perm.GROUP_MEMBER, only_to_me=False)
async def statusCommand(session: CommandSession):
message = await getStatus()
... | 29.166667 | 102 | 0.78 | from nonebot import on_command, CommandSession
from nonebot import permission as perm
from Libs.getServerStatus import getStatus
@on_command('status', aliases=('服务器状态', '状态', 'list'), permission=perm.GROUP_MEMBER, only_to_me=False)
async def statusCommand(session: CommandSession):
message = await getStatus()
... | true | true |
1c09d51a4d69bf2bf1be3aacd25b434f4ed6abd1 | 12,440 | py | Python | experiments/26_train_on_FNO_IC_distribution/plotting_utils.py | meliao/fourier_neural_operator | 216915c6f1acd0651c7203bc8f16824efc495c5f | [
"MIT"
] | null | null | null | experiments/26_train_on_FNO_IC_distribution/plotting_utils.py | meliao/fourier_neural_operator | 216915c6f1acd0651c7203bc8f16824efc495c5f | [
"MIT"
] | null | null | null | experiments/26_train_on_FNO_IC_distribution/plotting_utils.py | meliao/fourier_neural_operator | 216915c6f1acd0651c7203bc8f16824efc495c5f | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
def plot_time_errors(errors_dd, t_grid=None, title=None, fp=None,
log_scale=False, x_label='Time step',
y_label='$L_2$-Normalized Errors', names_dd=None):
"""Makes a plot visualizing an array of time-dependent errors... | 34.175824 | 107 | 0.603055 | import matplotlib.pyplot as plt
import numpy as np
def plot_time_errors(errors_dd, t_grid=None, title=None, fp=None,
log_scale=False, x_label='Time step',
y_label='$L_2$-Normalized Errors', names_dd=None):
if t_grid is not None:
x_vals = t_grid.flatten()... | true | true |
1c09d5426a7d78749b7304fe5e6b7f22dee23932 | 1,706 | py | Python | OnToology/tests/__init__.py | nvbach91/OnToology | c136db35b5d97d75fa3538cac429f149e162a2e3 | [
"Apache-2.0"
] | null | null | null | OnToology/tests/__init__.py | nvbach91/OnToology | c136db35b5d97d75fa3538cac429f149e162a2e3 | [
"Apache-2.0"
] | null | null | null | OnToology/tests/__init__.py | nvbach91/OnToology | c136db35b5d97d75fa3538cac429f149e162a2e3 | [
"Apache-2.0"
] | null | null | null | import pkgutil
import unittest
from django.test import TestCase
from django.test.runner import DiscoverRunner
from OnToology import settings
from OnToology.models import *
from mongoengine import connection, connect
import pyclbr
def suite():
return unittest.TestLoader().discover("OnToology.tests", pattern="te... | 25.462687 | 102 | 0.66823 | import pkgutil
import unittest
from django.test import TestCase
from django.test.runner import DiscoverRunner
from OnToology import settings
from OnToology.models import *
from mongoengine import connection, connect
import pyclbr
def suite():
return unittest.TestLoader().discover("OnToology.tests", pattern="te... | true | true |
1c09d56bed7fcbca664dc421c51b9c4719a16aa6 | 1,464 | py | Python | PyPoll/main.py | rdhaliwal96/python_challenge | 1c8b0cbbc923063595462f0e14298e256d736970 | [
"ADSL"
] | null | null | null | PyPoll/main.py | rdhaliwal96/python_challenge | 1c8b0cbbc923063595462f0e14298e256d736970 | [
"ADSL"
] | null | null | null | PyPoll/main.py | rdhaliwal96/python_challenge | 1c8b0cbbc923063595462f0e14298e256d736970 | [
"ADSL"
] | null | null | null |
import os
import csv
csvpath = os.path.join('Resources', 'election_data.csv')
output_file = "Resources/results.txt"
total_votes = 0
candidates = {}
candidates_percent = {}
winner_count = 0
winner = ""
with open(csvpath, newline = "") as csvfile:
csvreader = csv.reader(csvfile, delimiter = ",")
next(csvrea... | 30.5 | 91 | 0.521175 |
import os
import csv
csvpath = os.path.join('Resources', 'election_data.csv')
output_file = "Resources/results.txt"
total_votes = 0
candidates = {}
candidates_percent = {}
winner_count = 0
winner = ""
with open(csvpath, newline = "") as csvfile:
csvreader = csv.reader(csvfile, delimiter = ",")
next(csvrea... | true | true |
1c09d7bc1fd636da740afe435fe9d1248b27fd76 | 868 | py | Python | PYTHON/python-datastructures/Recursion/Palindrome Check/palindrome_check.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | null | null | null | PYTHON/python-datastructures/Recursion/Palindrome Check/palindrome_check.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | null | null | null | PYTHON/python-datastructures/Recursion/Palindrome Check/palindrome_check.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | null | null | null |
## Palindrome checker
def isPalindrome(s):
"""This function checks if a string is palindrome or not using recursion
Input: String to be checked
Output: True if it is a palindrome, False if it is not
"""
if len(s) == 0:
return True
if s[0] != s[len(s)-1]:
return False
... | 23.459459 | 76 | 0.573733 |
def isPalindrome(s):
if len(s) == 0:
return True
if s[0] != s[len(s)-1]:
return False
return isPalindrome(s[1:-1])
if __name__ == "__main__":
s = input("\nEnter the string to be checked: ")
case = input("\nIs it case sensitive? (1/0): ")
if case == '0':
... | true | true |
1c09d7d280a5bf66bc0c10d54a015535bb9efe79 | 6,913 | py | Python | fastNLP/io/pipe/summarization.py | cuhksz-nlp/SANER | ac30f441be615de5224411816935283eddfbe330 | [
"MIT"
] | 34 | 2020-10-13T04:29:50.000Z | 2021-12-09T07:18:17.000Z | phenobert/utils/fastNLP/io/pipe/summarization.py | TianlabTech/PhenoBERT | dffc7a06cdbff2671a3ca73d2398159d91a4a7db | [
"MIT"
] | 17 | 2020-10-15T03:05:32.000Z | 2021-12-05T09:31:28.000Z | phenobert/utils/fastNLP/io/pipe/summarization.py | TianlabTech/PhenoBERT | dffc7a06cdbff2671a3ca73d2398159d91a4a7db | [
"MIT"
] | 6 | 2020-12-21T09:08:43.000Z | 2021-11-27T00:13:44.000Z | """undocumented"""
import os
import numpy as np
from .pipe import Pipe
from .utils import _drop_empty_instance
from ..loader.summarization import ExtCNNDMLoader
from ..data_bundle import DataBundle
from ...core.const import Const
from ...core.vocabulary import Vocabulary
from ...core._logger import logger
WORD_PAD =... | 34.914141 | 132 | 0.61218 | import os
import numpy as np
from .pipe import Pipe
from .utils import _drop_empty_instance
from ..loader.summarization import ExtCNNDMLoader
from ..data_bundle import DataBundle
from ...core.const import Const
from ...core.vocabulary import Vocabulary
from ...core._logger import logger
WORD_PAD = "[PAD]"
WORD_UNK =... | true | true |
1c09d7d68eb82b5f4edbf32cfe0361c7fad1c851 | 19,557 | py | Python | utils/SeleniumUtil.py | LoriSun/petp | f3bf52e5e26091d98907f97a6c95c9ddbf4999ae | [
"MIT"
] | 4 | 2021-06-06T11:57:14.000Z | 2021-07-18T00:34:09.000Z | utils/SeleniumUtil.py | LoriSun/petp | f3bf52e5e26091d98907f97a6c95c9ddbf4999ae | [
"MIT"
] | null | null | null | utils/SeleniumUtil.py | LoriSun/petp | f3bf52e5e26091d98907f97a6c95c9ddbf4999ae | [
"MIT"
] | 1 | 2021-06-16T16:05:55.000Z | 2021-06-16T16:05:55.000Z | import logging
import os
from PIL import Image
from selenium import webdriver
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.web... | 39.429435 | 139 | 0.639771 | import logging
import os
from PIL import Image
from selenium import webdriver
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.web... | true | true |
1c09d8914ac1cad727e4786db5e1a334ada45da3 | 423 | py | Python | config.py | baluyotraf/flask-basic | 31658b8b57dab8c1379de9b177cc0e0b3fab3059 | [
"MIT"
] | null | null | null | config.py | baluyotraf/flask-basic | 31658b8b57dab8c1379de9b177cc0e0b3fab3059 | [
"MIT"
] | null | null | null | config.py | baluyotraf/flask-basic | 31658b8b57dab8c1379de9b177cc0e0b3fab3059 | [
"MIT"
] | 2 | 2018-10-06T00:42:05.000Z | 2019-06-27T05:45:57.000Z | from flask_env import MetaFlaskEnv
class Configuration(metaclass=MetaFlaskEnv):
PROPERTY_1 = 'value'
PROPERTY_2 = 10.1
PROPERTY_3 = 20
PROPERTY_4 = 'hello'
# Flask-SQLAlchemy Configs
SQLALCHEMY_DATABASE_URI = 'mysql://root:root@localhost/db'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# T... | 24.882353 | 62 | 0.730496 | from flask_env import MetaFlaskEnv
class Configuration(metaclass=MetaFlaskEnv):
PROPERTY_1 = 'value'
PROPERTY_2 = 10.1
PROPERTY_3 = 20
PROPERTY_4 = 'hello'
SQLALCHEMY_DATABASE_URI = 'mysql://root:root@localhost/db'
SQLALCHEMY_TRACK_MODIFICATIONS = False
ITSDANGEROUS_SECRET_KEY = ... | true | true |
1c09d89b8a340772bf6aa71cc66ff31576eac841 | 14,102 | py | Python | salt/utils/win_pdh.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 2 | 2016-11-14T15:08:53.000Z | 2016-11-20T09:25:30.000Z | salt/utils/win_pdh.py | snetsystems/salt | 6f8bedfc2453624e00037f80b8099ed010fad506 | [
"Apache-2.0"
] | 3 | 2021-03-31T19:54:10.000Z | 2021-12-13T20:47:12.000Z | salt/utils/win_pdh.py | snetsystems/salt | 6f8bedfc2453624e00037f80b8099ed010fad506 | [
"Apache-2.0"
] | 2 | 2020-11-04T06:32:02.000Z | 2020-11-06T11:01:18.000Z | # -*- coding: utf-8 -*-
r"""
Salt Util for getting system information with the Performance Data Helper (pdh).
Counter information is gathered from current activity or log files.
Usage:
.. code-block:: python
import salt.utils.win_pdh
# Get a list of Counter objects
salt.utils.win_pdh.list_objects()
... | 31.199115 | 107 | 0.617997 |
from __future__ import absolute_import, unicode_literals
import logging
import time
import salt.utils.platform
from salt.exceptions import CommandExecutionError
try:
import pywintypes
import win32pdh
HAS_WINDOWS_MODULES = True
except ImportError:
HAS_WINDOWS_MODULES = False
log = logging.getLogge... | true | true |
1c09d89cf6cc1f837d564b25ff92711121ae5674 | 51 | py | Python | graphic_coloring_engine/errors.py | filosfino/graphic-coloring-engine | 6416d90a00e347d8daa99acdd006c13a94ae1734 | [
"MIT"
] | null | null | null | graphic_coloring_engine/errors.py | filosfino/graphic-coloring-engine | 6416d90a00e347d8daa99acdd006c13a94ae1734 | [
"MIT"
] | null | null | null | graphic_coloring_engine/errors.py | filosfino/graphic-coloring-engine | 6416d90a00e347d8daa99acdd006c13a94ae1734 | [
"MIT"
] | null | null | null | class ColoringEngineError(Exception):
msg: str
| 17 | 37 | 0.764706 | class ColoringEngineError(Exception):
msg: str
| true | true |
1c09da9807117a8c917c584049c956a7bd2d48ba | 3,742 | py | Python | wukong/gateway/udpwkpf/udpdevice_eeg_server.py | wukong-m2m/wukong-darjeeling | 429ffdd62384c0a6b7f6695bb780359fc58a804c | [
"BSD-2-Clause-FreeBSD"
] | 16 | 2015-01-07T10:32:47.000Z | 2019-01-16T16:13:51.000Z | wukong/gateway/udpwkpf/udpdevice_eeg_server.py | wukong-m2m/wukong-darjeeling | 429ffdd62384c0a6b7f6695bb780359fc58a804c | [
"BSD-2-Clause-FreeBSD"
] | 14 | 2015-05-01T04:45:45.000Z | 2016-05-11T01:29:23.000Z | wukong/gateway/udpwkpf/udpdevice_eeg_server.py | wukong-m2m/wukong-darjeeling | 429ffdd62384c0a6b7f6695bb780359fc58a804c | [
"BSD-2-Clause-FreeBSD"
] | 13 | 2015-06-17T06:42:17.000Z | 2020-11-27T18:23:08.000Z | from udpwkpf import WuClass, Device
import sys
import mraa
from twisted.protocols import basic
from twisted.internet import reactor, protocol
PORT = 2222
if __name__ == "__main__":
class Number(WuClass): #"Number" WuClass has been defined in ~/wukong-darjeeling/wukong/ComponentDefinitions/WuKongStandardLibrary.x... | 34.971963 | 147 | 0.580706 | from udpwkpf import WuClass, Device
import sys
import mraa
from twisted.protocols import basic
from twisted.internet import reactor, protocol
PORT = 2222
if __name__ == "__main__":
class Number(WuClass): def __init__(self):
WuClass.__init__(self)
self.ID = 2014 print ... | false | true |
1c09dbebff61d2724f423d2b7639e4dcbf4bfce6 | 14,077 | py | Python | src/metarl/tf/models/model.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | 2 | 2021-02-07T12:14:52.000Z | 2021-07-29T08:07:22.000Z | src/metarl/tf/models/model.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | null | null | null | src/metarl/tf/models/model.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | null | null | null | """Base model classes."""
import abc
from collections import namedtuple
import warnings
import tensorflow as tf
class BaseModel(abc.ABC):
"""Interface-only abstract class for models.
A Model contains the structure/configuration of a set of computation
graphs, or can be understood as a set of networks. U... | 31.143805 | 79 | 0.577254 | import abc
from collections import namedtuple
import warnings
import tensorflow as tf
class BaseModel(abc.ABC):
def build(self, *inputs, name=None):
@property
@abc.abstractmethod
def name(self):
@property
@abc.abstractmethod
def parameters(self):
@parameters.setter
def paramet... | true | true |
1c09dd08639e596e543a08218c628cff9a34ef5c | 5,480 | py | Python | library/check_if_need_to_apt_get_update.py | yanhan/provision-ubuntu | 883875133a337d305f29403fcc9de5399d84f5e9 | [
"BSD-3-Clause"
] | null | null | null | library/check_if_need_to_apt_get_update.py | yanhan/provision-ubuntu | 883875133a337d305f29403fcc9de5399d84f5e9 | [
"BSD-3-Clause"
] | 3 | 2021-04-07T20:34:27.000Z | 2021-10-10T07:44:28.000Z | library/check_if_need_to_apt_get_update.py | yanhan/provision-ubuntu-ansible | 9f6b6d457b375bc294c90ba5c95dd6707ce97cdb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# vim: set fileencoding=utf-8
DOCUMENTATION = """
---
module: check_if_need_to_apt_get_update
short_description: Checks if an `apt-get update` should be performed
description:
- Performs `apt-get update` when the Singapore Ubuntu mirror has been
replaced or when the last successful `apt... | 40.895522 | 220 | 0.615876 |
DOCUMENTATION = """
---
module: check_if_need_to_apt_get_update
short_description: Checks if an `apt-get update` should be performed
description:
- Performs `apt-get update` when the Singapore Ubuntu mirror has been
replaced or when the last successful `apt-get update` was performed >=
`cache_time_vali... | true | true |
1c09dd8af6253c9de1ac6840842daa0f2fa64009 | 4,293 | py | Python | docs/tools/test_table_gen.py | LaudateCorpus1/lisa | a3f9c1facd6403f6eea09956fc76882129c2f6c3 | [
"MIT"
] | null | null | null | docs/tools/test_table_gen.py | LaudateCorpus1/lisa | a3f9c1facd6403f6eea09956fc76882129c2f6c3 | [
"MIT"
] | 3 | 2021-08-19T23:07:28.000Z | 2022-03-12T01:05:43.000Z | docs/tools/test_table_gen.py | LaudateCorpus1/lisa | a3f9c1facd6403f6eea09956fc76882129c2f6c3 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""
Update test_table.rst with test metadata
"""
import ast
import os
from pathlib import Path
from typing import Dict, List, TextIO
from doc_generator import ( # type: ignore
TESTS,
ClassVisitor,
FuncVisitor,
extract_metadata,... | 30.884892 | 112 | 0.517587 |
import ast
import os
from pathlib import Path
from typing import Dict, List, TextIO
from doc_generator import ( TESTS,
ClassVisitor,
FuncVisitor,
extract_metadata,
load_path,
)
base_path = Path(__file__).parent
table_path = (
base_path / "../run_test/test_table.rst"
).resolve()
def updat... | true | true |
1c09de5e2038186fb3d359b53cdc5e3ca7510d88 | 5,131 | py | Python | interactive_text_to_sql/src/components/nl_modiifer.py | shivam2509/ContextualSP | 24aee1b9c59388478b1391851fdb30ee7c63298d | [
"MIT"
] | null | null | null | interactive_text_to_sql/src/components/nl_modiifer.py | shivam2509/ContextualSP | 24aee1b9c59388478b1391851fdb30ee7c63298d | [
"MIT"
] | null | null | null | interactive_text_to_sql/src/components/nl_modiifer.py | shivam2509/ContextualSP | 24aee1b9c59388478b1391851fdb30ee7c63298d | [
"MIT"
] | null | null | null | # coding: utf-8
import re
import nltk
from src.utils.utils import STOP_WORD_LIST
from src.utils.external import complex_rephrase
class NLModifier(object):
def __init__(self, mode='simple'):
self.database = ''
self.utterance = ''
self.utterance_tokens = []
self.utterance_tokens_n... | 48.40566 | 114 | 0.554473 |
import re
import nltk
from src.utils.utils import STOP_WORD_LIST
from src.utils.external import complex_rephrase
class NLModifier(object):
def __init__(self, mode='simple'):
self.database = ''
self.utterance = ''
self.utterance_tokens = []
self.utterance_tokens_no_stopwords = []... | true | true |
1c09debca595e448a05c0f0c7e5cbf537780326e | 49,104 | py | Python | generators/masculine_first_names.py | jrigden/Seeds-of-Infinity | 1dfdc41b0a65dbb366ce64bb14bd0b36c897963e | [
"Unlicense"
] | null | null | null | generators/masculine_first_names.py | jrigden/Seeds-of-Infinity | 1dfdc41b0a65dbb366ce64bb14bd0b36c897963e | [
"Unlicense"
] | 2 | 2020-09-15T20:53:53.000Z | 2020-09-15T21:52:34.000Z | generators/masculine_first_names.py | jrigden/Seeds-of-Infinity | 1dfdc41b0a65dbb366ce64bb14bd0b36c897963e | [
"Unlicense"
] | 2 | 2020-09-15T20:44:30.000Z | 2020-09-15T20:59:42.000Z | NAMES = [
'aaden',
'aarav',
'aaron',
'ab',
'abb',
'abbie',
'abbott',
'abdiel',
'abdul',
'abdullah',
'abe',
'abel',
'abelardo',
'abie',
'abner',
'abraham',
'abram',
'ace',
'acey',
'acie',
'acy',
'ada',
'adalbert',
'adalberto'... | 13.793258 | 18 | 0.420231 | NAMES = [
'aaden',
'aarav',
'aaron',
'ab',
'abb',
'abbie',
'abbott',
'abdiel',
'abdul',
'abdullah',
'abe',
'abel',
'abelardo',
'abie',
'abner',
'abraham',
'abram',
'ace',
'acey',
'acie',
'acy',
'ada',
'adalbert',
'adalberto'... | true | true |
1c09e15e92a535f6e5433bde861d773c157b774b | 5,219 | py | Python | tests/python/relay/test_pass_combine_parallel_batch_matmul.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | tests/python/relay/test_pass_combine_parallel_batch_matmul.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | tests/python/relay/test_pass_combine_parallel_batch_matmul.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.818841 | 92 | 0.598199 |
import tvm
from tvm import relay
from tvm.relay import transform
def run_opt_pass(expr, opt_pass):
assert isinstance(opt_pass, tvm.transform.Pass)
mod = tvm.IRModule.from_expr(expr)
mod = tvm.relay.transform.InferType()(mod)
mod = opt_pass(mod)
return mod["main"]
def test_combine_parallel_batch... | true | true |
1c09e188c0b9a992b958397dedc50c84d52b93f1 | 21,112 | py | Python | models/Scalar_U_NP_UFO/parameters.py | jlrainbolt/MG5_v2_6_1 | 241f0c6f309342d6e8b813284467b2edd393c7d6 | [
"NCSA"
] | null | null | null | models/Scalar_U_NP_UFO/parameters.py | jlrainbolt/MG5_v2_6_1 | 241f0c6f309342d6e8b813284467b2edd393c7d6 | [
"NCSA"
] | null | null | null | models/Scalar_U_NP_UFO/parameters.py | jlrainbolt/MG5_v2_6_1 | 241f0c6f309342d6e8b813284467b2edd393c7d6 | [
"NCSA"
] | null | null | null | # This file was automatically created by FeynRules 2.3.29
# Mathematica version: 10.3.0 for Mac OS X x86 (64-bit) (October 9, 2015)
# Date: Wed 14 Feb 2018 15:11:44
from object_library import all_parameters, Parameter
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
# This is a def... | 31.510448 | 111 | 0.396457 |
from object_library import all_parameters, Parameter
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
ZERO = Parameter(name = 'ZERO',
nature = 'internal',
type = 'real',
value = '0.0',
texname = '0')
cabi = Parame... | true | true |
1c09e1dab34e2e4bc2ee5dbda2c0d50b291e208d | 1,120 | py | Python | tests/fixtures/fixtures.py | alvaro-serra/malib | fe2b0736974c2a3ed9e41121b6cf475a3ee0b5a0 | [
"MIT"
] | 6 | 2021-05-19T10:25:36.000Z | 2021-12-27T03:30:33.000Z | tests/fixtures/fixtures.py | Taospirit/malib | fe2b0736974c2a3ed9e41121b6cf475a3ee0b5a0 | [
"MIT"
] | 1 | 2021-05-29T04:51:37.000Z | 2021-05-30T06:18:10.000Z | tests/fixtures/fixtures.py | Taospirit/malib | fe2b0736974c2a3ed9e41121b6cf475a3ee0b5a0 | [
"MIT"
] | 1 | 2021-05-31T16:16:12.000Z | 2021-05-31T16:16:12.000Z | import gc
import unittest
import tensorflow as tf
# from malib.experiment import deterministic
from malib.logger import logger
from tests.fixtures.logger import NullOutput
class TfTestCase(unittest.TestCase):
def setUp(self):
self.sess = tf.Session()
self.sess.__enter__()
def tearDown(self)... | 26.666667 | 59 | 0.634821 | import gc
import unittest
import tensorflow as tf
from malib.logger import logger
from tests.fixtures.logger import NullOutput
class TfTestCase(unittest.TestCase):
def setUp(self):
self.sess = tf.Session()
self.sess.__enter__()
def tearDown(self):
if tf.get_default_session() is self... | true | true |
1c09e2abc9a5f9c086eaa524fb97ab0638664b36 | 3,491 | py | Python | ex1_w2v/predict.py | minkj1992/Korean_emotion_classification_attention | 7e09cd8cd9b18c438d7b9032efb8ee37c505a7fa | [
"MIT"
] | 3 | 2020-04-24T12:54:37.000Z | 2021-12-21T02:03:06.000Z | ex1_w2v/predict.py | minkj1992/Korean_emotion_classification_attention | 7e09cd8cd9b18c438d7b9032efb8ee37c505a7fa | [
"MIT"
] | null | null | null | ex1_w2v/predict.py | minkj1992/Korean_emotion_classification_attention | 7e09cd8cd9b18c438d7b9032efb8ee37c505a7fa | [
"MIT"
] | 3 | 2020-03-10T10:50:03.000Z | 2021-12-21T02:03:07.000Z | # 0. 사용할 패키지 불러오기
from keras.utils import np_utils
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Activation
import numpy as np
import keras
from keras.models import model_from_json
from konlpy.tag import Okt as Twitter
import re
import json
# token2index에서는 '0'외에... | 37.537634 | 121 | 0.607849 | from keras.utils import np_utils
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Activation
import numpy as np
import keras
from keras.models import model_from_json
from konlpy.tag import Okt as Twitter
import re
import json
class Predict():
def __init__(s... | true | true |
1c09e3fbf807d6febfba62cf858f3103e9f4db67 | 674 | py | Python | Python/minecraft-getservers.py | phillipinman/Binary-Gaming-Network-Scripts | 75ac2b53e4be6d4ee1b66a849576a586c4b26534 | [
"MIT"
] | null | null | null | Python/minecraft-getservers.py | phillipinman/Binary-Gaming-Network-Scripts | 75ac2b53e4be6d4ee1b66a849576a586c4b26534 | [
"MIT"
] | null | null | null | Python/minecraft-getservers.py | phillipinman/Binary-Gaming-Network-Scripts | 75ac2b53e4be6d4ee1b66a849576a586c4b26534 | [
"MIT"
] | null | null | null | import json, boto3
def lambda_handler(event, context):
key = "KEY"
statusCode = 500
dynamodbTableName = "minecraft-proxy-servers"
if key == event["queryStringParameters"]['key']:
# Get servers in DynamoDB
dynamodb = boto3.client('dynamodb')
... | 25.923077 | 60 | 0.565282 | import json, boto3
def lambda_handler(event, context):
key = "KEY"
statusCode = 500
dynamodbTableName = "minecraft-proxy-servers"
if key == event["queryStringParameters"]['key']:
dynamodb = boto3.client('dynamodb')
result = dynamodb.scan(T... | true | true |
1c09e4625c82b73373f8bf6127b645b4a45078f8 | 475 | py | Python | zero/components/geometry/geometry.py | jsa4000/OpenGL-Python | 62055ba0c16f54507b7ba709d6691b2e9c7bc152 | [
"Apache-2.0"
] | null | null | null | zero/components/geometry/geometry.py | jsa4000/OpenGL-Python | 62055ba0c16f54507b7ba709d6691b2e9c7bc152 | [
"Apache-2.0"
] | null | null | null | zero/components/geometry/geometry.py | jsa4000/OpenGL-Python | 62055ba0c16f54507b7ba709d6691b2e9c7bc152 | [
"Apache-2.0"
] | 1 | 2021-10-08T06:12:11.000Z | 2021-10-08T06:12:11.000Z | from collections import OrderedDict as dict
from ...core import Component
class GeometryComponent(Component):
""" Geometry Component class
"""
# Defaut type/name the component will have
DEFAULT_TYPE = "geometry"
# Default paramters of the component
defaults = dict({"geometry": None})
def... | 25 | 63 | 0.658947 | from collections import OrderedDict as dict
from ...core import Component
class GeometryComponent(Component):
DEFAULT_TYPE = "geometry"
defaults = dict({"geometry": None})
def __init__(self, *args, **kwargs):
super(GeometryComponent,self).__init__(*args, **kwargs)
| true | true |
1c09e49f32f0b7bf1a17e3bcd38bb739952b5240 | 11,889 | py | Python | grr/server/grr_response_server/flows/general/discovery.py | acidburn0zzz/grr | 44e1a5b1630e8101610faaaebe15b19b5ad30cb1 | [
"Apache-2.0"
] | 1 | 2019-08-28T23:48:20.000Z | 2019-08-28T23:48:20.000Z | grr/server/grr_response_server/flows/general/discovery.py | acidburn0zzz/grr | 44e1a5b1630e8101610faaaebe15b19b5ad30cb1 | [
"Apache-2.0"
] | 2 | 2022-01-15T03:18:12.000Z | 2022-02-13T22:02:43.000Z | grr/server/grr_response_server/flows/general/discovery.py | acidburn0zzz/grr | 44e1a5b1630e8101610faaaebe15b19b5ad30cb1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""These are flows designed to discover information about the host."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
from future.builtins import str
from future.utils import iteritems
from grr_response_core import c... | 35.489552 | 80 | 0.723274 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
from future.builtins import str
from future.utils import iteritems
from grr_response_core import config
from grr_response_core.lib import rdfvalue
from grr_response_core.lib import type_info
... | true | true |
1c09e54da8b8fb0c807a5ca6f9dc2711dd06fa7b | 1,193 | py | Python | walkers/TwitterCrawler.py | M4Numbers/Walkers | 41c283f6bcdaf3abf3da0d5fba321b0065a276e1 | [
"Apache-2.0"
] | null | null | null | walkers/TwitterCrawler.py | M4Numbers/Walkers | 41c283f6bcdaf3abf3da0d5fba321b0065a276e1 | [
"Apache-2.0"
] | 1 | 2015-05-29T10:33:28.000Z | 2015-05-29T21:57:21.000Z | walkers/TwitterCrawler.py | M4Numbers/Walkers | 41c283f6bcdaf3abf3da0d5fba321b0065a276e1 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2015 Matthew D. Ball (M4Numbers)
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 o... | 28.404762 | 75 | 0.708298 |
__author__ = 'Matthew Ball'
import tweepy
class TwitterCrawler:
api = 0
def __init__(self, con_key, con_secret, acc_key, acc_secret):
auth = tweepy.OAuthHandler(con_key, con_secret)
auth.set_access_token(acc_key, acc_secret)
self.api = tweepy.API(auth)
def get_my_timeline(self... | true | true |
1c09e559a18bb8dbf178498e574d3d661379340e | 1,319 | py | Python | datastructures/circular_buffer/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | datastructures/circular_buffer/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | datastructures/circular_buffer/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | class BufferFullException(Exception):
pass
class BufferEmptyException(Exception):
pass
class CircularBuffer(object):
def __init__(self, size):
self.buffer = bytearray(size)
self.read_point = 0
self.write_point = 0
def _update_buffer(self, data):
"""
Protected... | 28.673913 | 70 | 0.61486 | class BufferFullException(Exception):
pass
class BufferEmptyException(Exception):
pass
class CircularBuffer(object):
def __init__(self, size):
self.buffer = bytearray(size)
self.read_point = 0
self.write_point = 0
def _update_buffer(self, data):
try:
self... | true | true |
1c09e719559c42ae2c8f0b68d35e03956ae6d1c0 | 2,273 | py | Python | app/lab/view/experimentViews.py | jerry0chu/Experiment | 18c70cf00328f8b80c9be1a324ed51c83bd16028 | [
"MIT"
] | null | null | null | app/lab/view/experimentViews.py | jerry0chu/Experiment | 18c70cf00328f8b80c9be1a324ed51c83bd16028 | [
"MIT"
] | null | null | null | app/lab/view/experimentViews.py | jerry0chu/Experiment | 18c70cf00328f8b80c9be1a324ed51c83bd16028 | [
"MIT"
] | null | null | null | from app.lab import lab
from flask import request, send_file
from app import APP_STATIC_DOWNLOAD
from app.lab.handle.handleExperiment import handleGetExperiments, handleSubmitExperimentEditForm, \
handleSubmitExperimentAddForm, handleRemoveExperiment, handleExperimentBatchDelete, handleExperimentQueryContent, \
... | 33.426471 | 119 | 0.741311 | from app.lab import lab
from flask import request, send_file
from app import APP_STATIC_DOWNLOAD
from app.lab.handle.handleExperiment import handleGetExperiments, handleSubmitExperimentEditForm, \
handleSubmitExperimentAddForm, handleRemoveExperiment, handleExperimentBatchDelete, handleExperimentQueryContent, \
... | true | true |
1c09e7717916bb630437ec9de5dd2c17513c6a83 | 4,201 | py | Python | src/abstract_rl/operator/retrace_operator.py | kosmitive/abstract_rl | 13038a1a5a93c78374ba869c9e75221c2b73d290 | [
"MIT"
] | 1 | 2021-07-05T17:03:29.000Z | 2021-07-05T17:03:29.000Z | src/abstract_rl/operator/retrace_operator.py | kosmitive/abstract_rl | 13038a1a5a93c78374ba869c9e75221c2b73d290 | [
"MIT"
] | null | null | null | src/abstract_rl/operator/retrace_operator.py | kosmitive/abstract_rl | 13038a1a5a93c78374ba869c9e75221c2b73d290 | [
"MIT"
] | null | null | null | import torch
from pandas.tests.extension.numpy_.test_numpy_nested import np
from abstract_rl.src.data_structures.abstract_conf.model_configuration import ModelConfiguration
from abstract_rl.src.operator.trajectory_operator import TrajectoryOperator
from abstract_rl.src.policy.continuous.univariate_gaussian_policy impo... | 35.302521 | 97 | 0.623185 | import torch
from pandas.tests.extension.numpy_.test_numpy_nested import np
from abstract_rl.src.data_structures.abstract_conf.model_configuration import ModelConfiguration
from abstract_rl.src.operator.trajectory_operator import TrajectoryOperator
from abstract_rl.src.policy.continuous.univariate_gaussian_policy impo... | true | true |
1c09e7f40d1a0aca2392f595ba4744f553fa2ad5 | 1,619 | py | Python | QUANTAXIS/TSFetch/fetchdata.py | Leevisir/TimeseriesForecastingQA | df6402fdc499d28195e88177c2c866787cf1f019 | [
"MIT"
] | 4 | 2019-08-21T18:05:06.000Z | 2019-12-28T07:45:23.000Z | QUANTAXIS/TSFetch/fetchdata.py | Leevisir/TimeseriesForecastingQA | df6402fdc499d28195e88177c2c866787cf1f019 | [
"MIT"
] | null | null | null | QUANTAXIS/TSFetch/fetchdata.py | Leevisir/TimeseriesForecastingQA | df6402fdc499d28195e88177c2c866787cf1f019 | [
"MIT"
] | 2 | 2019-10-23T20:23:59.000Z | 2019-12-28T07:41:25.000Z | import QUANTAXIS as QA
import pandas as pd
import json
import datetime
from QUANTAXIS.QAUtil import QASETTING
from QUANTAXIS.TSData.TSRawdata import TSRawdata
def TS_fetch_stock_day_adv(code, start, end):
#get all history data from tdx
# date = datetime.date.today()
# data=QA.QAFetch.QATdx.QA_fetch_get_st... | 32.38 | 85 | 0.71958 | import QUANTAXIS as QA
import pandas as pd
import json
import datetime
from QUANTAXIS.QAUtil import QASETTING
from QUANTAXIS.TSData.TSRawdata import TSRawdata
def TS_fetch_stock_day_adv(code, start, end):
data = QA.QA_fetch_stock_day_adv(code=code, start=start, end=end)
result = data.data
... | true | true |
1c09e94f44bde2551b47a94ba6d0ed2715374eb3 | 17,060 | py | Python | parser/team05/proyecto/Window.py | MynorSaban1906/tytus | d1f04cb9e1ca791705dcccb8733bc380172d8fff | [
"MIT"
] | null | null | null | parser/team05/proyecto/Window.py | MynorSaban1906/tytus | d1f04cb9e1ca791705dcccb8733bc380172d8fff | [
"MIT"
] | null | null | null | parser/team05/proyecto/Window.py | MynorSaban1906/tytus | d1f04cb9e1ca791705dcccb8733bc380172d8fff | [
"MIT"
] | null | null | null | # GRUPO 5
# 201213062 - Mónica Raquel Calderon Muñoz
# 201213223 - Astrid Edith Hernandez Gonzalez
# 201213255 - Leonel Eduardo Avila Calvillo
# 201220159 - Diego Ahtohil Noj Armira
# 201220165 - Oscar Rolando Bernard Peralta
# IMPORT SECTION
import proyecto.WidgetLineNumber as ln
import tkinter.scrolledtext as tkst
f... | 41.508516 | 117 | 0.587925 |
import proyecto.WidgetLineNumber as ln
import tkinter.scrolledtext as tkst
from tkinter.ttk import *
from tkinter import Menu, Frame, ttk, filedialog, messagebox, simpledialog
from tkinter.simpledialog import askstring
import tkinter as tk
from tkinter import *
from tkinter import filedialog
import os
import webbrows... | true | true |
1c09e96406237a1df762f5de886c16696de305ba | 592 | py | Python | landavailability/voa/views.py | alphagov/land-availability-voa | 424c9ffe30ba16dcc5a1a0ed7b0138acc3d549ed | [
"MIT"
] | 1 | 2017-07-24T16:47:57.000Z | 2017-07-24T16:47:57.000Z | landavailability/voa/views.py | alphagov/land-availability-voa | 424c9ffe30ba16dcc5a1a0ed7b0138acc3d549ed | [
"MIT"
] | 4 | 2017-05-10T15:34:23.000Z | 2017-09-06T10:37:26.000Z | landavailability/voa/views.py | alphagov/land-availability-voa | 424c9ffe30ba16dcc5a1a0ed7b0138acc3d549ed | [
"MIT"
] | 2 | 2019-08-29T11:52:17.000Z | 2021-04-10T19:54:35.000Z | from rest_framework import generics
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from .serializers import PropertySerializer
from .models import Property
class VOACreateView(generics.CreateAPIView):
permission_classes = (IsAdminUser, )
queryset = Property.objects.all()
serializer_cl... | 31.157895 | 67 | 0.795608 | from rest_framework import generics
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from .serializers import PropertySerializer
from .models import Property
class VOACreateView(generics.CreateAPIView):
permission_classes = (IsAdminUser, )
queryset = Property.objects.all()
serializer_cl... | true | true |
1c09e964e20ddf1ab28af7827d06342367337189 | 7,028 | py | Python | acq4/util/generator/SeqParamSet.py | campagnola/acq4 | 09699c07d8949950f6df149cf17892aaa3a37402 | [
"MIT"
] | 47 | 2015-01-05T16:18:10.000Z | 2022-03-16T13:09:30.000Z | acq4/util/generator/SeqParamSet.py | acq4/acq4 | c77636a76d68ffa1bc7dbd41edc522e523b909b8 | [
"MIT"
] | 48 | 2015-04-19T16:51:41.000Z | 2022-03-31T14:48:16.000Z | acq4/util/generator/SeqParamSet.py | acq4/acq4 | c77636a76d68ffa1bc7dbd41edc522e523b909b8 | [
"MIT"
] | 32 | 2015-01-15T14:11:49.000Z | 2021-07-15T13:44:52.000Z | from __future__ import print_function
import pyqtgraph.units as units
from pyqtgraph.parametertree.parameterTypes import SimpleParameter, GroupParameter
import pyqtgraph as pg
import numpy as np
import acq4.util.functions as fn
import sys, collections
class SequenceParamSet(GroupParameter):
## top-level parameter... | 36.414508 | 109 | 0.50313 | from __future__ import print_function
import pyqtgraph.units as units
from pyqtgraph.parametertree.parameterTypes import SimpleParameter, GroupParameter
import pyqtgraph as pg
import numpy as np
import acq4.util.functions as fn
import sys, collections
class SequenceParamSet(GroupParameter):
def __init__(self)... | true | true |
1c09e9a9582caac0b722779057c7aa75cc8c3bc6 | 144 | py | Python | thoughtful_termites/app/widgets/__init__.py | mathsman5133/code-jam-5 | 629e51e58c640ce088ac7dec182a359e1b5357f5 | [
"MIT"
] | 2 | 2019-07-03T18:08:24.000Z | 2019-07-03T18:27:18.000Z | thoughtful_termites/app/widgets/__init__.py | RohanJnr/code-jam-5 | 40e4552b57b09ed3d81cbd47533c2483f8de3bc4 | [
"MIT"
] | 2 | 2019-07-02T22:49:19.000Z | 2019-07-06T23:51:05.000Z | thoughtful_termites/app/widgets/__init__.py | RohanJnr/code-jam-5 | 40e4552b57b09ed3d81cbd47533c2483f8de3bc4 | [
"MIT"
] | 1 | 2019-06-29T11:27:36.000Z | 2019-06-29T11:27:36.000Z | from .goal_list_window import GoalListWindow
from .unlocks_window import UnlocksWindow
__all__ = [
'GoalListWindow',
'UnlocksWindow'
]
| 18 | 44 | 0.770833 | from .goal_list_window import GoalListWindow
from .unlocks_window import UnlocksWindow
__all__ = [
'GoalListWindow',
'UnlocksWindow'
]
| true | true |
1c09eac007cc9ec375238c769fca84fbaba3f745 | 2,300 | py | Python | tests/unit/test_rst_assessments.py | codio/book-converter | ea3fd75f2ca8704ffad6bfcc83cf7af557bcd0b8 | [
"MIT"
] | 1 | 2019-09-14T12:22:25.000Z | 2019-09-14T12:22:25.000Z | tests/unit/test_rst_assessments.py | codio/book-converter | ea3fd75f2ca8704ffad6bfcc83cf7af557bcd0b8 | [
"MIT"
] | 4 | 2020-08-21T08:24:40.000Z | 2022-03-11T23:57:03.000Z | tests/unit/test_rst_assessments.py | codio/book-converter | ea3fd75f2ca8704ffad6bfcc83cf7af557bcd0b8 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import patch
from pathlib import Path
from converter.rst.model.assessment_data import AssessmentData
from converter.convert import convert_assessment, write_assessments
class TestSuite(unittest.TestCase):
def test_convert_custom(self):
assessment1 = AssessmentData('id1... | 48.93617 | 111 | 0.698696 | import unittest
from unittest.mock import patch
from pathlib import Path
from converter.rst.model.assessment_data import AssessmentData
from converter.convert import convert_assessment, write_assessments
class TestSuite(unittest.TestCase):
def test_convert_custom(self):
assessment1 = AssessmentData('id1... | true | true |
1c09eae8f41e9ea6fef1183957734c6bf00da89c | 7,351 | py | Python | mmdet/models/roi_heads/mask_heads/maskiou_head.py | zactodd/mmdetection | 9596b9a4c916ae601f9a8a641c3a0ea47265abec | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | mmdet/models/roi_heads/mask_heads/maskiou_head.py | epsilon11101/mmdetection | f8d5f6cafeafeac8beb22d855798327682f65f0a | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | mmdet/models/roi_heads/mask_heads/maskiou_head.py | epsilon11101/mmdetection | f8d5f6cafeafeac8beb22d855798327682f65f0a | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import kaiming_init, normal_init
from mmcv.ops import Conv2d, Linear, MaxPool2d
from torch.nn.modules.utils import _pair
from mmdet.core import force_fp32
from mmdet.models.builder import HEADS, build_loss
@HEADS.register_module()
class MaskIoUHead(... | 39.101064 | 79 | 0.602503 | import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import kaiming_init, normal_init
from mmcv.ops import Conv2d, Linear, MaxPool2d
from torch.nn.modules.utils import _pair
from mmdet.core import force_fp32
from mmdet.models.builder import HEADS, build_loss
@HEADS.register_module()
class MaskIoUHead(... | true | true |
1c09eb484049c46ecadd2dbd7475f037e8d7bf70 | 1,425 | py | Python | aulaspythonintermediario/aula02/aula02.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | 1 | 2021-09-04T14:34:34.000Z | 2021-09-04T14:34:34.000Z | aulaspythonintermediario/aula02/aula02.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | null | null | null | aulaspythonintermediario/aula02/aula02.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | null | null | null | # Funções (def) em Python - Parte 2 - Return
def funcao(var):
print(var)
'''
função sempre retorna um valor mesmo não tendo um "return" nela
'''
variavel = funcao('oi')
print(variavel) # retorna None = Tipo de dado básico que representa algo sem algum valor.
if not variavel:
print('Nenhum valor !!! ')
def f... | 19.520548 | 110 | 0.650526 |
def funcao(var):
print(var)
variavel = funcao('oi')
print(variavel) if not variavel:
print('Nenhum valor !!! ')
def funcao2(var):
return var
print('Teste', var)
variavel = funcao2('oi')
print(variavel) if variavel:
print(variavel)
else:
print('Nenhum valor !!! ')
def divisao(n1, n2):
... | true | true |
1c09ec3a892a3069c775c84e98c5411b505906e5 | 946 | py | Python | Unidad_03/Uni3_lab_05_diccionarios.py | Fundamentos-de-Informatica-Python/fund-info-py | 60c64f1ae29b833abc5a395361814c15472c0c11 | [
"Apache-2.0"
] | 1 | 2022-03-31T12:45:42.000Z | 2022-03-31T12:45:42.000Z | Unidad_03/Uni3_lab_05_diccionarios.py | Fundamentos-de-Informatica-Python/fund-info-py | 60c64f1ae29b833abc5a395361814c15472c0c11 | [
"Apache-2.0"
] | 1 | 2022-03-21T02:22:30.000Z | 2022-03-21T02:22:30.000Z | Unidad_03/Uni3_lab_05_diccionarios.py | Fundamentos-de-Informatica-Python/fund-info-py | 60c64f1ae29b833abc5a395361814c15472c0c11 | [
"Apache-2.0"
] | null | null | null | # UNIDAD 03.D28 - D29
# Diccionarios
print('\n\n---[Diapo 27]---------------------')
print('Diccionarios e Iteraciones:')
diccio = {
'naranja': 'orange',
'manzana': 'apple',
'pera': 'pear'
}
print('Se imprimen las claves: ')
for fruta in diccio:
print(fruta)
print('Se imprime con clave, valores: ')... | 22.52381 | 69 | 0.604651 |
print('\n\n---[Diapo 27]---------------------')
print('Diccionarios e Iteraciones:')
diccio = {
'naranja': 'orange',
'manzana': 'apple',
'pera': 'pear'
}
print('Se imprimen las claves: ')
for fruta in diccio:
print(fruta)
print('Se imprime con clave, valores: ')
for fruta in diccio:
print(fruta... | true | true |
1c09ed42f4ac679b285e549a55d1f51ed5d95c88 | 3,697 | py | Python | disentanglement_lib/data/ground_truth/shapes3d.py | zhuxinqimac/disentanglement_lib | 6620090e90ce935758cb607c01764ee404749e87 | [
"Apache-2.0"
] | null | null | null | disentanglement_lib/data/ground_truth/shapes3d.py | zhuxinqimac/disentanglement_lib | 6620090e90ce935758cb607c01764ee404749e87 | [
"Apache-2.0"
] | null | null | null | disentanglement_lib/data/ground_truth/shapes3d.py | zhuxinqimac/disentanglement_lib | 6620090e90ce935758cb607c01764ee404749e87 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... | 33.609091 | 82 | 0.704625 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from disentanglement_lib.data.ground_truth import ground_truth_data
from disentanglement_lib.data.ground_truth import util
import numpy as np
from six.moves import range
import tensorflow.compat.v1 as... | true | true |
1c09eea3f67bfdd609305871d30d2f54b74b039b | 4,995 | py | Python | main/test_env_change.py | punk95/Continual-Learning-With-Curiosity | af0c507040e1352beb8740b6b3a7849417fc879a | [
"MIT"
] | 2 | 2021-07-12T17:11:35.000Z | 2021-07-13T05:56:30.000Z | main/test_env_change.py | punk95/Continual-Learning-With-Curiosity | af0c507040e1352beb8740b6b3a7849417fc879a | [
"MIT"
] | null | null | null | main/test_env_change.py | punk95/Continual-Learning-With-Curiosity | af0c507040e1352beb8740b6b3a7849417fc879a | [
"MIT"
] | null | null | null | import torch
import numpy as np
import argparse
from algorithms.SAC import SAC
from parameters import Algo_Param, NN_Paramters, Save_Paths, Load_Paths
import gym
from custom_envs.custom_pendulum import PendulumEnv
parser = argparse.ArgumentParser(description='SAC arguments')
parser.add_argument("--env", type=str, d... | 38.72093 | 155 | 0.65025 | import torch
import numpy as np
import argparse
from algorithms.SAC import SAC
from parameters import Algo_Param, NN_Paramters, Save_Paths, Load_Paths
import gym
from custom_envs.custom_pendulum import PendulumEnv
parser = argparse.ArgumentParser(description='SAC arguments')
parser.add_argument("--env", type=str, d... | true | true |
1c09ef7f0572aae3b074142b9233d3230b808046 | 1,881 | py | Python | xlsxwriter/test/comparison/test_utf8_06.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2015-05-19T22:17:15.000Z | 2015-05-19T22:17:15.000Z | xlsxwriter/test/comparison/test_utf8_06.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_utf8_06.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
# _*_ coding: utf-8
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2014, John McNamara, jmcnamara@cpan.org
#
from __future__ import unicode_literals
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import... | 27.26087 | 79 | 0.539075 | from __future__ import unicode_literals
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestCase):
def setUp(self):
self.maxDiff = None
filename = 'utf8_06.xlsx'
test_dir = 'xlsxwriter/test/... | true | true |
1c09f006cf6e591feaacd931e65bfd41c724d8b3 | 19,373 | py | Python | python/sklearn/linear-regression/workload-analysis/ssd-obj-detect/post-process/ssd-vgg16/sparse-int8/sparsity-0.5/get-heat-map.py | lijiansong/lang | e255709da2b12e09dea45f86d54f77a19b96f13b | [
"WTFPL"
] | 1 | 2020-01-09T03:22:09.000Z | 2020-01-09T03:22:09.000Z | python/sklearn/linear-regression/workload-analysis/ssd-obj-detect/post-process/ssd-vgg16/sparse-int8/sparsity-0.9/get-heat-map.py | lijiansong/lang | e255709da2b12e09dea45f86d54f77a19b96f13b | [
"WTFPL"
] | null | null | null | python/sklearn/linear-regression/workload-analysis/ssd-obj-detect/post-process/ssd-vgg16/sparse-int8/sparsity-0.9/get-heat-map.py | lijiansong/lang | e255709da2b12e09dea45f86d54f77a19b96f13b | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python3
def get_bs_vs_tn(in_file_name, out_file_name, best_config_list):
'''
Note: best case for dense int8 new log is:
batch_size data_parallel model_parallel thread_num
16 4 1 8
batch size: 1 2 4 8 16 32 64 128 256 512 1024
data parallel: 1 2 4 8 16 32
mo... | 48.553885 | 190 | 0.58659 |
def get_bs_vs_tn(in_file_name, out_file_name, best_config_list):
best_bs, best_dp, best_mp, best_tn = best_config_list[0], best_config_list[1], best_config_list[2], best_config_list[3]
batch_size_index_dict={1:1, 2:2, 4:3, 8:4, 16:5, 32:6, 64:7}
thread_num_index_dict={1:1, 2:2, 4:3, 8:4, 16:5, 32:6... | true | true |
1c09f0c619d4cb6a07eea6464aa468e733310eb9 | 498 | py | Python | GRADE 9/Python/BraydenViana-Python-Video5.py | i1470s/School-Work | e00843f3506b2ad674dce5e47ce3321002cc23e5 | [
"MIT"
] | null | null | null | GRADE 9/Python/BraydenViana-Python-Video5.py | i1470s/School-Work | e00843f3506b2ad674dce5e47ce3321002cc23e5 | [
"MIT"
] | null | null | null | GRADE 9/Python/BraydenViana-Python-Video5.py | i1470s/School-Work | e00843f3506b2ad674dce5e47ce3321002cc23e5 | [
"MIT"
] | null | null | null | Python 3.8.2 (default, Feb 26 2020, 02:56:10)
players = [29, 5 , 1, 2]
players[2]
1
players[2]= 68
players
[29, 5, 68, 2]
players + [90, 91, 92]
[29, 5, 68, 2, 90, 91, 92]
players
[29, 5, 68, 2]
players[:2]
[29, 5]
players[:7] = [0, 0]
players
[0, 0]
players[:2] = 0
Traceback (most ... | 18.444444 | 46 | 0.566265 | Python 3.8.2 (default, Feb 26 2020, 02:56:10)
players = [29, 5 , 1, 2]
players[2]
1
players[2]= 68
players
[29, 5, 68, 2]
players + [90, 91, 92]
[29, 5, 68, 2, 90, 91, 92]
players
[29, 5, 68, 2]
players[:2]
[29, 5]
players[:7] = [0, 0]
players
[0, 0]
players[:2] = 0
Traceback (most ... | false | true |
1c09f0cd877dba19b35a16616ea2796a2861b065 | 152 | py | Python | apps/requestlogger/admin.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | 1 | 2017-05-19T07:23:00.000Z | 2017-05-19T07:23:00.000Z | apps/requestlogger/admin.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | null | null | null | apps/requestlogger/admin.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.contrib import admin
from requestlogger.models import *
admin.site.register(RequestLog) | 21.714286 | 34 | 0.763158 |
from django.contrib import admin
from requestlogger.models import *
admin.site.register(RequestLog) | true | true |
1c09f17ebcd2b19065b5baa63e210210fb90976d | 7,569 | py | Python | saleor/graphql/app/tests/queries/test_apps.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 1 | 2022-03-22T02:54:38.000Z | 2022-03-22T02:54:38.000Z | saleor/graphql/app/tests/queries/test_apps.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 86 | 2021-11-01T04:51:55.000Z | 2022-03-30T16:30:16.000Z | saleor/graphql/app/tests/queries/test_apps.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 1 | 2022-02-16T22:00:59.000Z | 2022-02-16T22:00:59.000Z | import graphene
import pytest
from freezegun import freeze_time
from .....app.models import App
from .....webhook.models import Webhook
from ....tests.utils import assert_no_permission, get_graphql_content
from ...enums import AppTypeEnum
QUERY_APPS_WITH_FILTER = """
query ($filter: AppFilterInput ){
apps... | 29.682353 | 88 | 0.577223 | import graphene
import pytest
from freezegun import freeze_time
from .....app.models import App
from .....webhook.models import Webhook
from ....tests.utils import assert_no_permission, get_graphql_content
from ...enums import AppTypeEnum
QUERY_APPS_WITH_FILTER = """
query ($filter: AppFilterInput ){
apps... | true | true |
1c09f1df539ca54366330b4e6b504006e8b89b6a | 122 | py | Python | setup.py | chlab/lunchy | 6cfd49fb5f121ae968c0a4c748350a3cb78b1bbc | [
"MIT"
] | null | null | null | setup.py | chlab/lunchy | 6cfd49fb5f121ae968c0a4c748350a3cb78b1bbc | [
"MIT"
] | null | null | null | setup.py | chlab/lunchy | 6cfd49fb5f121ae968c0a4c748350a3cb78b1bbc | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='lunchy',
install_requires=[
'django>=1.9,<5',
'mysql-python>=1.2,<5'
]
) | 13.555556 | 28 | 0.647541 | from setuptools import setup
setup(
name='lunchy',
install_requires=[
'django>=1.9,<5',
'mysql-python>=1.2,<5'
]
) | true | true |
1c09f235282e19ccf865dab799c725fe45a960ad | 261 | py | Python | tracking/tests.py | yi-syong/Benga | ef8cff66b8853d03c9615ef36d566cec27b9d9fd | [
"MIT"
] | 2 | 2018-10-22T08:02:09.000Z | 2022-03-15T10:58:34.000Z | tracking/tests.py | yi-syong/Benga | ef8cff66b8853d03c9615ef36d566cec27b9d9fd | [
"MIT"
] | 81 | 2018-10-26T09:02:49.000Z | 2020-10-27T06:30:02.000Z | tracking/tests.py | yi-syong/Benga | ef8cff66b8853d03c9615ef36d566cec27b9d9fd | [
"MIT"
] | 4 | 2018-10-22T05:18:20.000Z | 2018-10-26T02:13:55.000Z | import os
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework.test import APIClient
from django.conf import settings
TESTDATA_ROOT = os.path.join(settings.BASE_DIR, 'test', 'data')
| 26.1 | 63 | 0.827586 | import os
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework.test import APIClient
from django.conf import settings
TESTDATA_ROOT = os.path.join(settings.BASE_DIR, 'test', 'data')
| true | true |
1c09f3203f24af59176cd113d76d68326845485b | 849 | py | Python | tests/framework.py | Kulikovpavel/IstraHistory | df04d42ee9369fc9468af036eff254a31df181f5 | [
"MIT"
] | null | null | null | tests/framework.py | Kulikovpavel/IstraHistory | df04d42ee9369fc9468af036eff254a31df181f5 | [
"MIT"
] | null | null | null | tests/framework.py | Kulikovpavel/IstraHistory | df04d42ee9369fc9468af036eff254a31df181f5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import optparse
import sys
# Install the Python unittest2 package before you run this script.
import unittest2
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation
TEST_PATH Path to package containing test modules"""
def main(sdk_path, ... | 27.387097 | 66 | 0.711425 | import optparse
import sys
import unittest2
USAGE = """%prog SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation
TEST_PATH Path to package containing test modules"""
def main(sdk_path, test_path):
sys.path.insert(0, sdk_path)
import dev_appserver
dev_appserv... | false | true |
1c09f38d38b18c93151456a62d430e6e3e179d4b | 3,328 | py | Python | modules/function-deploy/functions/image-resize-function/__init__.py | anzoman/demo-tosca-blueprint-azure-function | 52792ffb9e5e9d25c5c6faa996ede959b54983cc | [
"Apache-2.0"
] | null | null | null | modules/function-deploy/functions/image-resize-function/__init__.py | anzoman/demo-tosca-blueprint-azure-function | 52792ffb9e5e9d25c5c6faa996ede959b54983cc | [
"Apache-2.0"
] | 9 | 2020-03-31T09:25:41.000Z | 2022-03-12T00:50:05.000Z | modules/function-deploy/functions/image-resize-function/__init__.py | anzoman/demo-tosca-blueprint-azure-function | 52792ffb9e5e9d25c5c6faa996ede959b54983cc | [
"Apache-2.0"
] | 2 | 2020-03-31T14:08:02.000Z | 2021-06-30T10:47:18.000Z | import json
import logging
import os
from .azure_helper import Azure
import azure.functions as func
from PIL import Image
'''
Azure function for resizing images
Gets image from container, resizes it and stores it into destination container. Both buckets must exist for smooth execution.
'''
THUMBNAIL_SIZES_PX = [100,... | 37.818182 | 125 | 0.676683 | import json
import logging
import os
from .azure_helper import Azure
import azure.functions as func
from PIL import Image
THUMBNAIL_SIZES_PX = [100, 160, 200]
conn_str = os.getenv('CONNECT_STR')
container_out_name = os.getenv('CONTAINER_OUT_NAME')
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.i... | true | true |
1c09f39a8efbca9de9d181cc2596f6ca5a7f3d57 | 2,319 | py | Python | storm/web/runner.py | GaretJax/storm-erp | 78f9ec3fc86d177184b8b94e06f5ae2a88de406c | [
"MIT"
] | null | null | null | storm/web/runner.py | GaretJax/storm-erp | 78f9ec3fc86d177184b8b94e06f5ae2a88de406c | [
"MIT"
] | 4 | 2021-03-18T20:43:17.000Z | 2022-01-13T00:48:45.000Z | storm/web/runner.py | GaretJax/storm-erp | 78f9ec3fc86d177184b8b94e06f5ae2a88de406c | [
"MIT"
] | 1 | 2015-03-12T14:48:46.000Z | 2015-03-12T14:48:46.000Z | import os
import click
DEFAULT_INTERFACE = '0.0.0.0'
DEFAULT_PORT = 5000
def load_config(debug, prefix):
def k(s):
return '{}_{}'.format(prefix, s)
if debug:
os.environ[k('DEBUG')] = '1'
os.environ.setdefault(k('SECRET_KEY'), 'changeme')
elif k('DEBUG') in os.environ:
d... | 24.670213 | 77 | 0.545063 | import os
import click
DEFAULT_INTERFACE = '0.0.0.0'
DEFAULT_PORT = 5000
def load_config(debug, prefix):
def k(s):
return '{}_{}'.format(prefix, s)
if debug:
os.environ[k('DEBUG')] = '1'
os.environ.setdefault(k('SECRET_KEY'), 'changeme')
elif k('DEBUG') in os.environ:
d... | true | true |
1c09f447cd8def2081540083e0eed06c131877a3 | 7,954 | py | Python | src/python/WMCore/MicroService/Unified/RSEQuotas.py | ramonbrugman/WMCore | 7faea49e870a1a08459509c7fc681b0ce09cb2b9 | [
"Apache-2.0"
] | null | null | null | src/python/WMCore/MicroService/Unified/RSEQuotas.py | ramonbrugman/WMCore | 7faea49e870a1a08459509c7fc681b0ce09cb2b9 | [
"Apache-2.0"
] | null | null | null | src/python/WMCore/MicroService/Unified/RSEQuotas.py | ramonbrugman/WMCore | 7faea49e870a1a08459509c7fc681b0ce09cb2b9 | [
"Apache-2.0"
] | null | null | null | """
Non thread-safe object which provides all the RSE/PNN information
required for automatic data placement.
It uses Rucio for checking quota available and data usage
"""
from __future__ import division, print_function
from builtins import str as newstr, bytes, object
from future.utils import viewitems
from WMCore.Mic... | 45.451429 | 104 | 0.612648 | from __future__ import division, print_function
from builtins import str as newstr, bytes, object
from future.utils import viewitems
from WMCore.MicroService.Unified.Common import getMSLogger, gigaBytes, teraBytes
class RSEQuotas(object):
def __init__(self, dataAcct, quotaFraction, **kwargs):
self.dataA... | true | true |
1c09f5102fdd8c8cae91f4a64535898bb0e0b879 | 1,970 | py | Python | test_file.py | lavanaythakral/Aspect-Based-Sentiment-Analysis | 1e2d57277b33778309131e69b69ead7afbd0dd59 | [
"Apache-2.0"
] | 1 | 2020-09-30T09:30:46.000Z | 2020-09-30T09:30:46.000Z | test_file.py | lavanaythakral/Aspect-Based-Sentiment-Analysis | 1e2d57277b33778309131e69b69ead7afbd0dd59 | [
"Apache-2.0"
] | null | null | null | test_file.py | lavanaythakral/Aspect-Based-Sentiment-Analysis | 1e2d57277b33778309131e69b69ead7afbd0dd59 | [
"Apache-2.0"
] | null | null | null | import aspect_based_sentiment_analysis as absa
import pandas as pd
import time
import re
import csv
import logging
import os
def find_sentence(word,test_sentences):
print("Finding sentences")
sentence =[]
for sen in test_sentences:
if(word in sen.lower()):
sentence.append(sen.lower())
print("Sentences found\... | 28.550725 | 175 | 0.693909 | import aspect_based_sentiment_analysis as absa
import pandas as pd
import time
import re
import csv
import logging
import os
def find_sentence(word,test_sentences):
print("Finding sentences")
sentence =[]
for sen in test_sentences:
if(word in sen.lower()):
sentence.append(sen.lower())
print("Sentences found\... | true | true |
1c09f7b34f88c6ea4b16b7f178cc910597826c5d | 2,254 | py | Python | docs/source/conf.py | thomas-coding/makefile_study | e8b567469d6cc9cd0339ac7b545596ea5dfa7018 | [
"MIT"
] | null | null | null | docs/source/conf.py | thomas-coding/makefile_study | e8b567469d6cc9cd0339ac7b545596ea5dfa7018 | [
"MIT"
] | null | null | null | docs/source/conf.py | thomas-coding/makefile_study | e8b567469d6cc9cd0339ac7b545596ea5dfa7018 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 35.777778 | 79 | 0.685448 |
import sphinx_rtd_theme
project = 'Makefile Study'
copyright = '2021, Jinping Wu'
author = 'Jinping Wu'
release = '0.1'
extensions = [
]
templates_path = ['_templates']
language = 'zh_CN'
exclude_patterns = []
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_theme_path = [sphinx_rtd_th... | true | true |
1c09f7f9ef7d7eb25a5a20a2f1c472ab12d8ee1b | 692 | py | Python | bin_num_translator.py | dk1xd/translator_binary_integer | 4376a5e2c645b8fdad204e2880333f8bf7330477 | [
"BSD-3-Clause"
] | null | null | null | bin_num_translator.py | dk1xd/translator_binary_integer | 4376a5e2c645b8fdad204e2880333f8bf7330477 | [
"BSD-3-Clause"
] | null | null | null | bin_num_translator.py | dk1xd/translator_binary_integer | 4376a5e2c645b8fdad204e2880333f8bf7330477 | [
"BSD-3-Clause"
] | null | null | null | def bin2num(b):
x = -1
y = 1
ln = []
lb_str = list(str(b))
lb_int = []
for i in lb_str:
lb_int.append(int(i))
while(abs(x) != len(lb_int) + 1):
ln.append(lb_int[x] * y)
x -= 1
y *= 2
return sum(ln)
def num2bin(b):
def max_2_multiplier(x):
y ... | 16.47619 | 37 | 0.384393 | def bin2num(b):
x = -1
y = 1
ln = []
lb_str = list(str(b))
lb_int = []
for i in lb_str:
lb_int.append(int(i))
while(abs(x) != len(lb_int) + 1):
ln.append(lb_int[x] * y)
x -= 1
y *= 2
return sum(ln)
def num2bin(b):
def max_2_multiplier(x):
y ... | true | true |
1c09f8024252e2b3e6a88716ccfb8bd1671076e7 | 6,584 | py | Python | note_mapper/image.py | miliarch/note_mapper | 65cb884de197ac787a0b05f26aa514d2b6440724 | [
"MIT"
] | null | null | null | note_mapper/image.py | miliarch/note_mapper | 65cb884de197ac787a0b05f26aa514d2b6440724 | [
"MIT"
] | null | null | null | note_mapper/image.py | miliarch/note_mapper | 65cb884de197ac787a0b05f26aa514d2b6440724 | [
"MIT"
] | 1 | 2019-06-11T15:05:10.000Z | 2019-06-11T15:05:10.000Z | """ image - collection of classes and functions used in drawing component
parts of musical instruments on a canvas
"""
from PIL import Image, ImageDraw
class Canvas:
"""Canvas - collection of dimensions used for drawing"""
image_box = (0, 0)
def __init__(self, width, height):
"""Initialize Canvas... | 37.622857 | 94 | 0.617861 | from PIL import Image, ImageDraw
class Canvas:
image_box = (0, 0)
def __init__(self, width, height):
self.width = width
self.height = height
self.set_margins(0, 0, 0, 0)
self.set_padding(0, 0, 0, 0)
def pack_margins(self):
self.margins = (
self.margin_... | true | true |
1c09f9643230f1efc0e3c90847362cfab4aa0b58 | 5,433 | py | Python | build/plugins/lib/nots/package_manager/pnpm/lockfile.py | jochenater/catboost | de2786fbc633b0d6ea6a23b3862496c6151b95c2 | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | build/plugins/lib/nots/package_manager/pnpm/lockfile.py | jochenater/catboost | de2786fbc633b0d6ea6a23b3862496c6151b95c2 | [
"Apache-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | build/plugins/lib/nots/package_manager/pnpm/lockfile.py | jochenater/catboost | de2786fbc633b0d6ea6a23b3862496c6151b95c2 | [
"Apache-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | import base64
import binascii
import yaml
import os
from six.moves.urllib import parse as urlparse
from six import iteritems
from ..base import PackageJson, BaseLockfile, LockfilePackageMeta, LockfilePackageMetaInvalidError
class PnpmLockfile(BaseLockfile):
IMPORTER_KEYS = PackageJson.DEP_KEYS + ("specifiers",)... | 33.128049 | 130 | 0.642187 | import base64
import binascii
import yaml
import os
from six.moves.urllib import parse as urlparse
from six import iteritems
from ..base import PackageJson, BaseLockfile, LockfilePackageMeta, LockfilePackageMetaInvalidError
class PnpmLockfile(BaseLockfile):
IMPORTER_KEYS = PackageJson.DEP_KEYS + ("specifiers",)... | true | true |
1c09f96df0fe27b8b25bc0a813415b5f50fbc71c | 5,876 | py | Python | stft.py | sooftware/nvidia-tacotron2 | 6c44cbd1ddd20e6607cec1ef7612432e85ae45e8 | [
"BSD-3-Clause"
] | 8 | 2021-10-16T12:51:49.000Z | 2022-03-01T15:41:11.000Z | stft.py | sooftware/nvidia-tacotron2 | 6c44cbd1ddd20e6607cec1ef7612432e85ae45e8 | [
"BSD-3-Clause"
] | null | null | null | stft.py | sooftware/nvidia-tacotron2 | 6c44cbd1ddd20e6607cec1ef7612432e85ae45e8 | [
"BSD-3-Clause"
] | 2 | 2021-12-25T17:28:32.000Z | 2022-03-07T04:26:22.000Z | """
BSD 3-Clause License
Copyright (c) 2017, Prem Seetharaman
All rights reserved.
* Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of... | 41.673759 | 97 | 0.683628 |
import torch
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
from scipy.signal import get_window
from librosa.util import pad_center, tiny
from audio_processing import window_sumsquare
class STFT(torch.nn.Module):
def __init__(self, filter_length=800, hop_length=200, win_le... | true | true |
1c09faa20d7ed92618062b8cccfc322ba3e4baea | 1,944 | py | Python | gcp_doctor/lint/gce/warn_2021_001_logging_perm.py | bnjf/gcp-doctor | c98d756835a94d57349702ce42aa1d829b08fbfa | [
"Apache-2.0"
] | null | null | null | gcp_doctor/lint/gce/warn_2021_001_logging_perm.py | bnjf/gcp-doctor | c98d756835a94d57349702ce42aa1d829b08fbfa | [
"Apache-2.0"
] | null | null | null | gcp_doctor/lint/gce/warn_2021_001_logging_perm.py | bnjf/gcp-doctor | c98d756835a94d57349702ce42aa1d829b08fbfa | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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, ... | 34.714286 | 79 | 0.742284 |
import operator as op
from gcp_doctor import lint, models
from gcp_doctor.queries import gce, iam
ROLE = 'roles/logging.logWriter'
def prefetch_rule(context: models.Context):
project_ids = {i.project_id for i in gce.get_instances(context).values()}
for pid in project_ids:
iam.get_project_policy(pid)
d... | true | true |
1c09faa90796132d2830e0e98b07f059835565b7 | 4,258 | py | Python | sdk/python/pulumi_azure_native/signalrservice/list_signal_r_keys.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/signalrservice/list_signal_r_keys.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/signalrservice/list_signal_r_keys.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__al... | 40.169811 | 171 | 0.707374 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__all__ = [
'ListSignalRKeysResult',
'AwaitableListSignalRKeysResult',
'list_signal_r_keys',
]
@pulumi.output_type
class ListSignalRKeysResult:
def __init_... | true | true |
1c09fae00798ef11c0d3413f7cb70fda1c373d85 | 467 | py | Python | RecoLocalCalo/HGCalRecProducers/python/HGCalLocalRecoTestBeamSequence_cff.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | RecoLocalCalo/HGCalRecProducers/python/HGCalLocalRecoTestBeamSequence_cff.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 3 | 2018-08-23T13:40:24.000Z | 2019-12-05T21:16:03.000Z | RecoLocalCalo/HGCalRecProducers/python/HGCalLocalRecoTestBeamSequence_cff.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
#HGCAL reconstruction
from RecoLocalCalo.HGCalRecProducers.HGCalUncalibRecHit_cfi import *
from RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi import *
from RecoLocalCalo.HGCalRecProducers.hgcalLayerClusters_cff import hgcalLayerClusters
from RecoLocalCalo.HGCalRecProducers.hg... | 46.7 | 115 | 0.897216 | import FWCore.ParameterSet.Config as cms
from RecoLocalCalo.HGCalRecProducers.HGCalUncalibRecHit_cfi import *
from RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi import *
from RecoLocalCalo.HGCalRecProducers.hgcalLayerClusters_cff import hgcalLayerClusters
from RecoLocalCalo.HGCalRecProducers.hgcalMultiClusters_cfi i... | true | true |
1c09faf94c3f4305de4ac8e6a83b3a88ab5039c5 | 2,928 | py | Python | navigation/src/move_to_goal.py | SylvainCadel/projet-integration-sri-2020-2021 | 4ae0c2f80cbb50c91d1397e5c238942be25ca419 | [
"Apache-2.0"
] | null | null | null | navigation/src/move_to_goal.py | SylvainCadel/projet-integration-sri-2020-2021 | 4ae0c2f80cbb50c91d1397e5c238942be25ca419 | [
"Apache-2.0"
] | null | null | null | navigation/src/move_to_goal.py | SylvainCadel/projet-integration-sri-2020-2021 | 4ae0c2f80cbb50c91d1397e5c238942be25ca419 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# license removed for brevity
import rospy
import tf
import sys
# Brings in the SimpleActionClient
import actionlib
# Brings in the .action file and messages used by the move base action
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from geometry_msgs.msg import Pose, Point, Quater... | 36.6 | 92 | 0.665301 |
import rospy
import tf
import sys
import actionlib
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from geometry_msgs.msg import Pose, Point, Quaternion
def movebase_client(point, quaternion, frame):
client = actionlib.SimpleActionClient('move_base',MoveBaseAction)
client.wait_for_server... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.