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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c420711beff9837696decc0b73a04ed0db8b294 | 14,316 | py | Python | NVIDIA/benchmarks/dlrm/implementations/pytorch/dlrm/data/dataset.py | goswamig/training_results_v0.7 | 4278ce8a0f3d4db6b5e6054277724ca36278d7a3 | [
"Apache-2.0"
] | 48 | 2020-07-29T18:09:23.000Z | 2021-10-09T01:53:33.000Z | NVIDIA/benchmarks/dlrm/implementations/pytorch/dlrm/data/dataset.py | goswamig/training_results_v0.7 | 4278ce8a0f3d4db6b5e6054277724ca36278d7a3 | [
"Apache-2.0"
] | 9 | 2021-04-02T02:28:07.000Z | 2022-03-26T18:23:59.000Z | NVIDIA/benchmarks/dlrm/implementations/pytorch/dlrm/data/dataset.py | lablup/training_results_v0.7 | f5bb59aa0f8b18b602763abe47d1d24d0d54b197 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | import concurrent
import functools
import math
import os
import queue
import numpy as np
from dlrm import mlperf_logger
import torch
from torch.utils.data import Dataset
from dlrm.utils import distributed as dist
def get_data_loader(dataset_path,
batch_size,
test_batch_size,... | 40.326761 | 119 | 0.656538 | import concurrent
import functools
import math
import os
import queue
import numpy as np
from dlrm import mlperf_logger
import torch
from torch.utils.data import Dataset
from dlrm.utils import distributed as dist
def get_data_loader(dataset_path,
batch_size,
test_batch_size,... | true | true |
1c420781d029b750bab07902b9e11705fcd9a9da | 1,654 | py | Python | main.py | iFly350x/Parental-Control-Website-Blockage- | fdf30f35d8a7cea0634dd7a1f7b20b05877d249a | [
"BSL-1.0"
] | null | null | null | main.py | iFly350x/Parental-Control-Website-Blockage- | fdf30f35d8a7cea0634dd7a1f7b20b05877d249a | [
"BSL-1.0"
] | null | null | null | main.py | iFly350x/Parental-Control-Website-Blockage- | fdf30f35d8a7cea0634dd7a1f7b20b05877d249a | [
"BSL-1.0"
] | null | null | null | import os
from pathlib import Path
import sys
from typing import *
import ipaddress
class sitesControl:
FILE_PATH = Path('C:\Windows\System32\drivers\etc')
def __init__(self) -> None:
self.path = self.FILE_PATH
self.websites = websites = []
self.size = None
self.ip = ipaddre... | 25.84375 | 89 | 0.561064 | import os
from pathlib import Path
import sys
from typing import *
import ipaddress
class sitesControl:
FILE_PATH = Path('C:\Windows\System32\drivers\etc')
def __init__(self) -> None:
self.path = self.FILE_PATH
self.websites = websites = []
self.size = None
self.ip = ipaddre... | true | true |
1c420894852746a91a8d8ed2518ead17557c43f2 | 11,264 | py | Python | integration/python/integration_api/models/kyc_response_vo.py | ShekharPaatni/SDK | 6534ffdb63af87c02c431df9add05a90370183cb | [
"Apache-2.0"
] | 11 | 2019-04-16T02:11:17.000Z | 2021-12-16T22:51:40.000Z | integration/python/integration_api/models/kyc_response_vo.py | ShekharPaatni/SDK | 6534ffdb63af87c02c431df9add05a90370183cb | [
"Apache-2.0"
] | 81 | 2019-11-19T23:24:28.000Z | 2022-03-28T11:35:47.000Z | integration/python/integration_api/models/kyc_response_vo.py | ShekharPaatni/SDK | 6534ffdb63af87c02c431df9add05a90370183cb | [
"Apache-2.0"
] | 11 | 2020-07-08T02:29:56.000Z | 2022-03-28T10:05:33.000Z | # coding: utf-8
"""
Hydrogen Integration API
The Hydrogen Integration API # noqa: E501
OpenAPI spec version: 1.3.1
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from integration_api.con... | 29.333333 | 282 | 0.621893 |
import pprint
import re
import six
from integration_api.configuration import Configuration
class KycResponseVo(object):
swagger_types = {
'create_date': 'datetime',
'kyc_status': 'str',
'kyc_type': 'str',
'nucleus_business_id': 'str',
'nucleus_client_id': 'str',
... | true | true |
1c4208b2f7a2bd869e15e83d2bdd272601022302 | 29,953 | py | Python | testsSDW__copy/card_tests/shaman_tests.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | testsSDW__copy/card_tests/shaman_tests.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | testsSDW__copy/card_tests/shaman_tests.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | import random
import unittest
from SDWLE.cards.spells.neutral import TheCoin
from testsSDW.agents.testing_agents import OneCardPlayingAgent, MinionAttackingAgent, CardTestingAgent, \
PlayAndAttackAgent
from testsSDW.testing_utils import generate_game_for
from SDWLE.cards import *
from SDWLE.constants import MINION... | 43.097842 | 120 | 0.672988 | import random
import unittest
from SDWLE.cards.spells.neutral import TheCoin
from testsSDW.agents.testing_agents import OneCardPlayingAgent, MinionAttackingAgent, CardTestingAgent, \
PlayAndAttackAgent
from testsSDW.testing_utils import generate_game_for
from SDWLE.cards import *
from SDWLE.constants import MINION... | true | true |
1c4208b6ad9a7e5b1a47d5852047900afcc2793d | 3,146 | py | Python | lib/exabgp/bgp/message/update/attribute/bgpls/link/sradjlan.py | fser/exabgp | 9a41b5f833a00a4d56b1a38f73858d62685065dd | [
"BSD-3-Clause"
] | 2 | 2018-02-07T14:49:11.000Z | 2021-09-08T15:31:51.000Z | lib/exabgp/bgp/message/update/attribute/bgpls/link/sradjlan.py | fser/exabgp | 9a41b5f833a00a4d56b1a38f73858d62685065dd | [
"BSD-3-Clause"
] | null | null | null | lib/exabgp/bgp/message/update/attribute/bgpls/link/sradjlan.py | fser/exabgp | 9a41b5f833a00a4d56b1a38f73858d62685065dd | [
"BSD-3-Clause"
] | 1 | 2020-07-23T16:54:01.000Z | 2020-07-23T16:54:01.000Z | # encoding: utf-8
"""
sradjlan.py
Created by Evelio Vila
Copyright (c) 2014-2017 Exa Networks. All rights reserved.
"""
import json
from struct import unpack
from exabgp.vendoring import six
from exabgp.vendoring.bitstring import BitArray
from exabgp.protocol.iso import ISO
from exabgp.bgp.message.update.attribute.b... | 36.581395 | 89 | 0.508264 |
import json
from struct import unpack
from exabgp.vendoring import six
from exabgp.vendoring.bitstring import BitArray
from exabgp.protocol.iso import ISO
from exabgp.bgp.message.update.attribute.bgpls.linkstate import LINKSTATE, LsGenericFlags
from exabgp.bgp.message.notification import Notify
@... | true | true |
1c4209296b5062a78da810907578479114e202ca | 7,060 | py | Python | electrum/plugins/ledger/auth2fa.py | lucasan123/electrum-bitgesell | 92eb2c28035aa96674d50b611ac9de0382adbc2b | [
"MIT"
] | null | null | null | electrum/plugins/ledger/auth2fa.py | lucasan123/electrum-bitgesell | 92eb2c28035aa96674d50b611ac9de0382adbc2b | [
"MIT"
] | 1 | 2020-08-26T20:31:21.000Z | 2020-08-26T20:32:32.000Z | electrum/plugins/ledger/auth2fa.py | lucasan123/electrum-bitgesell | 92eb2c28035aa96674d50b611ac9de0382adbc2b | [
"MIT"
] | null | null | null | import copy
from PyQt5.QtWidgets import (QDialog, QLineEdit, QTextEdit, QVBoxLayout, QLabel,
QWidget, QHBoxLayout, QComboBox)
from btchip.btchip import BGLhipException
from electrum.gui.qt.util import PasswordLineEdit
from electrum.i18n import _
from electrum import constants, bitgesell... | 42.787879 | 157 | 0.610057 | import copy
from PyQt5.QtWidgets import (QDialog, QLineEdit, QTextEdit, QVBoxLayout, QLabel,
QWidget, QHBoxLayout, QComboBox)
from btchip.btchip import BGLhipException
from electrum.gui.qt.util import PasswordLineEdit
from electrum.i18n import _
from electrum import constants, bitgesell... | true | true |
1c42095fa66c2003f5d58eae607de990f19f42e8 | 565 | py | Python | py_sys_test/ping_test/ping_icmp_test.py | interhui/py-sys | 5d0f8cf5421a5766ed66d78a5364a017cb38aa3a | [
"Apache-2.0"
] | 1 | 2016-03-23T10:25:57.000Z | 2016-03-23T10:25:57.000Z | py_sys_test/ping_test/ping_icmp_test.py | vicky-tan/py-sys | 5d0f8cf5421a5766ed66d78a5364a017cb38aa3a | [
"Apache-2.0"
] | null | null | null | py_sys_test/ping_test/ping_icmp_test.py | vicky-tan/py-sys | 5d0f8cf5421a5766ed66d78a5364a017cb38aa3a | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import unittest
from py_sys.ping import ping_icmp
class Test(unittest.TestCase):
def test_ping(self):
p = ping_icmp.PingICMP()
result = p.ping('127.0.0.1', 1, 5)
for item in result:
self.assertEqual(item.get('result'), 'success')
de... | 28.25 | 60 | 0.573451 |
import unittest
from py_sys.ping import ping_icmp
class Test(unittest.TestCase):
def test_ping(self):
p = ping_icmp.PingICMP()
result = p.ping('127.0.0.1', 1, 5)
for item in result:
self.assertEqual(item.get('result'), 'success')
def test_ping_tim... | true | true |
1c420a026350f63f0fc65e8540cbbb62db2549ca | 2,058 | py | Python | _old_basic_tensorflow/tutorial2_simpleRegressionLowLevel/simpleRegressionLowLevel.py | UnnamedMoose/LearningMLandRL | a3a47998c32078a069ea82ce0032c30bb8b387f2 | [
"MIT"
] | 2 | 2021-01-29T12:33:35.000Z | 2021-07-11T05:47:26.000Z | _old_basic_tensorflow/tutorial2_simpleRegressionLowLevel/simpleRegressionLowLevel.py | UnnamedMoose/LearningMLandRL | a3a47998c32078a069ea82ce0032c30bb8b387f2 | [
"MIT"
] | null | null | null | _old_basic_tensorflow/tutorial2_simpleRegressionLowLevel/simpleRegressionLowLevel.py | UnnamedMoose/LearningMLandRL | a3a47998c32078a069ea82ce0032c30bb8b387f2 | [
"MIT"
] | 1 | 2018-03-14T18:23:10.000Z | 2018-03-14T18:23:10.000Z | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
# correlation variable x and ground truth values
x = tf.constant([[1], [2], [3], [4]], dtype=tf.float32, name="inputData")
y_true = tf.constant([[0], [-1], [-2], [-3]], dtype=tf.float32, name="groundTruth")
# linear model
linear_model = tf.lay... | 32.666667 | 90 | 0.706511 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
x = tf.constant([[1], [2], [3], [4]], dtype=tf.float32, name="inputData")
y_true = tf.constant([[0], [-1], [-2], [-3]], dtype=tf.float32, name="groundTruth")
linear_model = tf.layers.Dense(units=1, name="regressionModel")
y_pred = linear_m... | true | true |
1c420bf7c19855a237c76ab11081492f6b152c52 | 89 | py | Python | main.py | asa-leholland/GRE-calculator | 43530e24c2e6059ce03027eec1cce82d4fe70479 | [
"MIT"
] | null | null | null | main.py | asa-leholland/GRE-calculator | 43530e24c2e6059ce03027eec1cce82d4fe70479 | [
"MIT"
] | 1 | 2020-12-08T22:41:41.000Z | 2020-12-08T22:41:41.000Z | main.py | asa-leholland/GRE-calculator | 43530e24c2e6059ce03027eec1cce82d4fe70479 | [
"MIT"
] | null | null | null | # main.py
from GRECalculator import Calculator_GRE
Calculator_GRE.run_calculator_app() | 17.8 | 40 | 0.842697 |
from GRECalculator import Calculator_GRE
Calculator_GRE.run_calculator_app() | true | true |
1c420e114a9eed82cb11c9a5c735161c1461defa | 6,106 | py | Python | constantsgen/constantsparse.py | barracudanetworks/constantsgen | ff5b0a2d9d297b5da6d4475a91b8180ce9b60f16 | [
"BSD-3-Clause"
] | null | null | null | constantsgen/constantsparse.py | barracudanetworks/constantsgen | ff5b0a2d9d297b5da6d4475a91b8180ce9b60f16 | [
"BSD-3-Clause"
] | 1 | 2016-12-15T18:41:51.000Z | 2016-12-15T18:41:51.000Z | constantsgen/constantsparse.py | barracudanetworks/constantsgen | ff5b0a2d9d297b5da6d4475a91b8180ce9b60f16 | [
"BSD-3-Clause"
] | 1 | 2016-09-25T21:26:54.000Z | 2016-09-25T21:26:54.000Z | import re
import os
from collections import namedtuple, OrderedDict
EnumImport = namedtuple("EnumImport",
"source_name destination_name name_overrides")
# #define constants.
constants = re.compile(r"#define ([^\s]+)\s+(.+)")
# Enums.
enums = re.compile(r"enum[^{]+\{[^}]+\};")
# Name of an en... | 36.783133 | 80 | 0.531281 | import re
import os
from collections import namedtuple, OrderedDict
EnumImport = namedtuple("EnumImport",
"source_name destination_name name_overrides")
mpile(r"#define ([^\s]+)\s+(.+)")
enums = re.compile(r"enum[^{]+\{[^}]+\};")
enum_name = re.compile(r"enum\s+([^\s{]+)")
enum_contents ... | true | true |
1c420f99903144b944d2260c5b9ff72eff0c7772 | 274 | py | Python | integration/tests_failed/query_invalid_utf8.py | jleverenz/hurl | b81ca8ab7e0e409ec0c074fd8e118721ff4d3fb3 | [
"Apache-2.0"
] | null | null | null | integration/tests_failed/query_invalid_utf8.py | jleverenz/hurl | b81ca8ab7e0e409ec0c074fd8e118721ff4d3fb3 | [
"Apache-2.0"
] | null | null | null | integration/tests_failed/query_invalid_utf8.py | jleverenz/hurl | b81ca8ab7e0e409ec0c074fd8e118721ff4d3fb3 | [
"Apache-2.0"
] | null | null | null | from app import app
from flask import make_response
from io import BytesIO
@app.route("/error-query-invalid-utf8")
def error_query_invalid_utf8():
result = BytesIO()
result.write(b"\xff")
data = result.getvalue()
resp = make_response(data)
return resp
| 21.076923 | 39 | 0.715328 | from app import app
from flask import make_response
from io import BytesIO
@app.route("/error-query-invalid-utf8")
def error_query_invalid_utf8():
result = BytesIO()
result.write(b"\xff")
data = result.getvalue()
resp = make_response(data)
return resp
| true | true |
1c42103b29fe10fcf21d4225eab8d5603dd15223 | 2,111 | py | Python | p5/feature_selection/find_signature.py | stefanbuenten/nanodegree | 9885fd3232620a48a5e849a0a0056a25825c3b8f | [
"MIT"
] | null | null | null | p5/feature_selection/find_signature.py | stefanbuenten/nanodegree | 9885fd3232620a48a5e849a0a0056a25825c3b8f | [
"MIT"
] | null | null | null | p5/feature_selection/find_signature.py | stefanbuenten/nanodegree | 9885fd3232620a48a5e849a0a0056a25825c3b8f | [
"MIT"
] | 1 | 2020-05-11T15:54:40.000Z | 2020-05-11T15:54:40.000Z | #!/usr/bin/python
import pickle
import numpy
numpy.random.seed(42)
### The words (features) and authors (labels), already largely processed.
### These files should have been created from the previous (Lesson 10)
### mini-project.
words_file = "../text_learning/your_word_data.pkl"
authors_file = "../text_learning/yo... | 32.476923 | 144 | 0.775462 |
import pickle
import numpy
numpy.random.seed(42)
i in enumerate(feature_importance) if i > 0.2]
print most_important
feature_names = vectorizer.get_feature_names()
print feature_names[most_important[0][0]]
| false | true |
1c42108de4de8747904799e9ec22da386bb66ec9 | 23,990 | py | Python | lib/PyAMF-0.6.1/pyamf/__init__.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/PyAMF-0.6.1/pyamf/__init__.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/PyAMF-0.6.1/pyamf/__init__.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
U{PyAMF<http://pyamf.org>} provides Action Message Format (U{AMF
<http://en.wikipedia.org/wiki/Action_Message_Format>}) support for Python that
is compatible with the Adobe U{Flash Player
<http://en.wikipedia.org/wiki/Flash_Player>}.
@since: Octobe... | 28.256773 | 104 | 0.644393 |
import types
import inspect
from pyamf import util, _version
from pyamf.adapters import register_adapters
from pyamf import python
from pyamf.alias import ClassAlias, UnknownClassAlias
__all__ = [
'register_class',
'register_class_loader',
'encode',
'decode',
'__version__',
'version'
]
... | true | true |
1c42115399dbe0144a26fa8dc6aa87e3e16e5769 | 4,117 | py | Python | datasets/gutenberg_time/gutenberg_time.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 10,608 | 2020-09-10T15:47:50.000Z | 2022-03-31T22:51:47.000Z | datasets/gutenberg_time/gutenberg_time.py | realChainLife/datasets | 98261e8b0b7be4dbaaa71ae188b950f7fbe51bbd | [
"Apache-2.0"
] | 2,396 | 2020-09-10T14:55:31.000Z | 2022-03-31T19:41:04.000Z | datasets/gutenberg_time/gutenberg_time.py | realChainLife/datasets | 98261e8b0b7be4dbaaa71ae188b950f7fbe51bbd | [
"Apache-2.0"
] | 1,530 | 2020-09-10T21:43:10.000Z | 2022-03-31T01:59:12.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 37.770642 | 439 | 0.632499 |
import csv
import os
import datasets
_CITATION = """\
@misc{kim2020time,
title={What time is it? Temporal Analysis of Novels},
author={Allen Kim and Charuta Pethe and Steven Skiena},
year={2020},
eprint={2011.04124},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
""... | true | true |
1c4211be12ac569a922d65f12f4891262c862e23 | 6,936 | py | Python | cellpose/resnet_style.py | YinuoJin/cellpose | eb8df70f295ac8465633f468d487aee1dd13a181 | [
"BSD-3-Clause"
] | 504 | 2020-02-04T06:42:53.000Z | 2022-03-31T06:13:11.000Z | cellpose/resnet_style.py | YinuoJin/cellpose | eb8df70f295ac8465633f468d487aee1dd13a181 | [
"BSD-3-Clause"
] | 457 | 2020-02-04T20:53:06.000Z | 2022-03-30T07:30:32.000Z | cellpose/resnet_style.py | YinuoJin/cellpose | eb8df70f295ac8465633f468d487aee1dd13a181 | [
"BSD-3-Clause"
] | 208 | 2020-02-04T15:50:20.000Z | 2022-03-31T14:57:48.000Z | from mxnet import gluon, nd
from mxnet.gluon import nn
import numpy as np
nfeat = 128
sz = [3, 3, 3, 3, 3]
sz2 = [3, 3, 3, 3, 3]
szf = [1]
def total_variation_loss(x):
""" regularize convolutional masks (not currently in use) """
a = nd.square(x[:, :, :-1, :-1] - x[:, :, 1:, :-1])
b = nd.square(x[:, :, ... | 33.346154 | 100 | 0.560409 | from mxnet import gluon, nd
from mxnet.gluon import nn
import numpy as np
nfeat = 128
sz = [3, 3, 3, 3, 3]
sz2 = [3, 3, 3, 3, 3]
szf = [1]
def total_variation_loss(x):
a = nd.square(x[:, :, :-1, :-1] - x[:, :, 1:, :-1])
b = nd.square(x[:, :, :-1, :-1] - x[:, :, :-1, 1:])
return nd.sum(nd.mean(nd.power(a... | true | true |
1c42124eb9ac9ec0b0d34996cbda5ac176daf67c | 11,640 | py | Python | my_pygame/joystick.py | francis-clairicia/Py-Game-Case | af2da857f2ef758051ad3c174d77f5a2deab935d | [
"MIT"
] | 6 | 2022-02-10T09:07:56.000Z | 2022-02-10T10:36:18.000Z | my_pygame/joystick.py | francis-clairicia/Py-Game-Case | af2da857f2ef758051ad3c174d77f5a2deab935d | [
"MIT"
] | null | null | null | my_pygame/joystick.py | francis-clairicia/Py-Game-Case | af2da857f2ef758051ad3c174d77f5a2deab935d | [
"MIT"
] | null | null | null | # -*-coding:Utf-8-*
import os
import sys
from typing import Union, Optional, Iterator
import pickle
import pygame
class Joystick:
def __init__(self, index: int):
self.__index = index
self.__joystick = pygame.joystick.Joystick(index) if index in range(Joystick.count()) else None
self.__bu... | 42.173913 | 150 | 0.564089 |
import os
import sys
from typing import Union, Optional, Iterator
import pickle
import pygame
class Joystick:
def __init__(self, index: int):
self.__index = index
self.__joystick = pygame.joystick.Joystick(index) if index in range(Joystick.count()) else None
self.__button_list = ["A", "... | true | true |
1c421365662f9c384e027d6403a99b7bfe2c0777 | 152 | py | Python | slnee_quality/slnee_quality/doctype/request/test_request.py | erpcloudsystems/slnee_quality | ad81f029a795ee073768c7c933cd91e61b6df059 | [
"MIT"
] | null | null | null | slnee_quality/slnee_quality/doctype/request/test_request.py | erpcloudsystems/slnee_quality | ad81f029a795ee073768c7c933cd91e61b6df059 | [
"MIT"
] | null | null | null | slnee_quality/slnee_quality/doctype/request/test_request.py | erpcloudsystems/slnee_quality | ad81f029a795ee073768c7c933cd91e61b6df059 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, erpcloud.systems and Contributors
# See license.txt
# import frappe
import unittest
class TestRequest(unittest.TestCase):
pass
| 16.888889 | 55 | 0.782895 |
import unittest
class TestRequest(unittest.TestCase):
pass
| true | true |
1c42146f0e6735ced4e1a4fbe2550582ad5298af | 4,187 | py | Python | setup.py | jscurtu/flask-exchange | a2dddb3e03c14c488a90ee63df4858d832d4e841 | [
"MIT"
] | null | null | null | setup.py | jscurtu/flask-exchange | a2dddb3e03c14c488a90ee63df4858d832d4e841 | [
"MIT"
] | null | null | null | setup.py | jscurtu/flask-exchange | a2dddb3e03c14c488a90ee63df4858d832d4e841 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'Flask-Exchange'
DESCRIPTION = 'Exchange s... | 29.695035 | 86 | 0.633389 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = 'Flask-Exchange'
DESCRIPTION = 'Exchange support for Flask using ExchangeLib.'
URL = 'https://github.com/jscurtu/flask-exchange'
EMAIL = 'jscurtu@gmail.com'
AUTHOR = 'Jason Scurtu'
REQUIRES_PYTH... | true | true |
1c4214d2e36cfc42beb2859a091fcdd9139c8678 | 2,019 | py | Python | deepface/basemodels/Boosting.py | olive380/deepface | 630e8e72f591eee63c724cb8cbcbbc66712f93fc | [
"MIT"
] | 2 | 2021-03-24T07:06:56.000Z | 2021-04-09T15:08:13.000Z | deepface/basemodels/Boosting.py | olive380/deepface | 630e8e72f591eee63c724cb8cbcbbc66712f93fc | [
"MIT"
] | null | null | null | deepface/basemodels/Boosting.py | olive380/deepface | 630e8e72f591eee63c724cb8cbcbbc66712f93fc | [
"MIT"
] | 2 | 2021-04-09T15:09:27.000Z | 2021-08-06T17:57:03.000Z | from deepface import DeepFace
from tqdm import tqdm
import os
from os import path
from pathlib import Path
import numpy as np
import gdown
from deepface.commons import functions, distance as dst
def loadModel():
model_names = ['VGG-Face', 'Facenet', 'OpenFace', 'DeepFace']
model = {}
model_pbar = tqdm(range(0,... | 33.65 | 244 | 0.741951 | from deepface import DeepFace
from tqdm import tqdm
import os
from os import path
from pathlib import Path
import numpy as np
import gdown
from deepface.commons import functions, distance as dst
def loadModel():
model_names = ['VGG-Face', 'Facenet', 'OpenFace', 'DeepFace']
model = {}
model_pbar = tqdm(range(0,... | true | true |
1c4214ef8c07af7c6afe258f74e0b3e443f397d4 | 2,278 | py | Python | accounts/migrations/0001_initial.py | bilesanmiahmad/weight-tracker | 6badd70d0b1005fb96ec354dece3e2e5f3f016e3 | [
"MIT"
] | null | null | null | accounts/migrations/0001_initial.py | bilesanmiahmad/weight-tracker | 6badd70d0b1005fb96ec354dece3e2e5f3f016e3 | [
"MIT"
] | null | null | null | accounts/migrations/0001_initial.py | bilesanmiahmad/weight-tracker | 6badd70d0b1005fb96ec354dece3e2e5f3f016e3 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-18 10:33
import accounts.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
... | 54.238095 | 266 | 0.634767 |
import accounts.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
... | true | true |
1c4215e580012b8cf3f0bf5efeb4374d96ab1b0d | 8,357 | py | Python | sonnet/src/depthwise_conv_test.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 10,287 | 2017-04-07T12:33:37.000Z | 2022-03-30T03:32:16.000Z | sonnet/src/depthwise_conv_test.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 209 | 2017-04-07T15:57:11.000Z | 2022-03-27T10:43:03.000Z | sonnet/src/depthwise_conv_test.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 1,563 | 2017-04-07T13:15:06.000Z | 2022-03-29T15:26:04.000Z | # Copyright 2019 The Sonnet 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 applicable l... | 35.411017 | 78 | 0.642216 |
from absl.testing import parameterized
import numpy as np
from sonnet.src import depthwise_conv
from sonnet.src import initializers
from sonnet.src import test_utils
import tensorflow as tf
def create_constant_initializers(w, b, with_bias):
if with_bias:
return {
"w_init": initializers.C... | true | true |
1c4218b85311fa77639a3d344b13425637df0161 | 13,317 | py | Python | metrics/visualisation.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | 9 | 2021-08-18T17:49:42.000Z | 2022-02-22T02:15:07.000Z | metrics/visualisation.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | null | null | null | metrics/visualisation.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | 1 | 2021-10-02T19:53:03.000Z | 2021-10-02T19:53:03.000Z | import os
import numpy as np
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
import skimage.transform as sk_transform
from sklearn.cluster import KMeans
from PIL import Image
from core.metrics import ProjectionMetric, ImageMetric
class TSNEProjection(ProjectionMetric):
name = 'tsne'
... | 36.585165 | 174 | 0.560787 | import os
import numpy as np
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
import skimage.transform as sk_transform
from sklearn.cluster import KMeans
from PIL import Image
from core.metrics import ProjectionMetric, ImageMetric
class TSNEProjection(ProjectionMetric):
name = 'tsne'
... | true | true |
1c4218ccb0778ac35e790ae6907fa890294ef128 | 2,321 | py | Python | codes/apks/pipelines/image_download_pipeline.py | RiskySignal/APKCrawler | 28e1cbccdd378bcb66d020349877f1d87679f8bd | [
"MIT"
] | 11 | 2020-11-26T08:15:56.000Z | 2022-03-30T11:15:39.000Z | codes/apks/pipelines/image_download_pipeline.py | RiskySignal/APKCrawler | 28e1cbccdd378bcb66d020349877f1d87679f8bd | [
"MIT"
] | 1 | 2021-01-15T02:04:12.000Z | 2021-01-15T02:41:01.000Z | codes/apks/pipelines/image_download_pipeline.py | RiskySignal/APKCrawler | 28e1cbccdd378bcb66d020349877f1d87679f8bd | [
"MIT"
] | 2 | 2021-07-21T19:17:56.000Z | 2022-02-14T07:36:11.000Z | # coding=utf-8
import logging
from scrapy.pipelines.images import ImagesPipeline
from items import AppDetail
from scrapy.utils.python import to_bytes
import hashlib
import scrapy
import os
from pipelines.folder_path import get_app_folder
import settings as project_settings
from database import Database
class ImageDow... | 41.446429 | 113 | 0.687635 |
import logging
from scrapy.pipelines.images import ImagesPipeline
from items import AppDetail
from scrapy.utils.python import to_bytes
import hashlib
import scrapy
import os
from pipelines.folder_path import get_app_folder
import settings as project_settings
from database import Database
class ImageDownloadPipeline(... | true | true |
1c4218f8f1a6553933731f5deb42365604dfe0b2 | 2,123 | py | Python | src/interviewbit/hash/copy_list.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | src/interviewbit/hash/copy_list.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | src/interviewbit/hash/copy_list.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | """
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or NULL.
Return a deep copy of the list.
Example
Given list
_
1 -> 2 -> 3
_
1 -> 2
keep a visited
last
root
1
2 4 ... | 26.5375 | 227 | 0.607631 | from typing import List, Dict, Set, Optional
class RandomListNode:
def __init__(self, x):
self.label = x
self.next = None
self.random = None
class Solution:
def copyRandomList(self, head: RandomListNode) -> Optional[RandomListNode]:
visited: Dict[int, RandomListNod... | true | true |
1c4219c10b3a2ceaaedd396a815c22e2d089d4d4 | 1,097 | py | Python | azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 32.264706 | 76 | 0.600729 |
from msrest.serialization import Model
class DatabaseAccountRegenerateKeyParameters(Model):
_validation = {
'key_kind': {'required': True},
}
_attribute_map = {
'key_kind': {'key': 'keyKind', 'type': 'str'},
}
def __init__(self, key_kind):
self.key_kind = key_... | true | true |
1c4219fff67ffabcc60003d010889745dc2acda1 | 28,399 | py | Python | qwiic_button.py | sparkfun/Qwiic_Button_Py | c7d4a195e7d379c38ee23f445a514a06c92ef8d4 | [
"MIT"
] | null | null | null | qwiic_button.py | sparkfun/Qwiic_Button_Py | c7d4a195e7d379c38ee23f445a514a06c92ef8d4 | [
"MIT"
] | 2 | 2021-02-14T02:05:05.000Z | 2021-03-11T16:49:08.000Z | qwiic_button.py | sparkfun/Qwiic_Button_Py | c7d4a195e7d379c38ee23f445a514a06c92ef8d4 | [
"MIT"
] | null | null | null | #-----------------------------------------------------------------------------
# qwiic_button.py
#
# Python library for the SparkFun qwiic button.
# https://www.sparkfun.com/products/15932
#
#------------------------------------------------------------------------
#
# Written by Priyanka Makin @ SparkFun Electronics,... | 39.279391 | 153 | 0.601535 |
import math
import qwiic_i2c
_DEFAULT_NAME = "Qwiic Button"
_QWIIC_BUTTON_DEFAULT_ADDRESS = 0x6F
_FULL_ADDRESS_LIST = list(range(0x08, 0x77+1))
_FULL_ADDRESS_LIST.remove(_QWIIC_BUTTON_DEFAULT_ADDRESS >> 1)
_AVAILABLE_I2C_ADDRESS = [_QWIIC_BUTTON_DEFAULT_ADDRESS] ... | true | true |
1c421b356518bf4c59535b3263ca030af4edeada | 3,562 | py | Python | im2txt/train.py | iamdebanjangoswami/Image-Caption-IR--Im2txt | e871cdd03c80fd70695ae5a46f32351e35956684 | [
"MIT"
] | 5 | 2018-07-17T16:10:02.000Z | 2018-07-17T21:53:37.000Z | im2txt/train.py | iamdebanjangoswami/Image-Caption-IR--Im2txt | e871cdd03c80fd70695ae5a46f32351e35956684 | [
"MIT"
] | null | null | null | im2txt/train.py | iamdebanjangoswami/Image-Caption-IR--Im2txt | e871cdd03c80fd70695ae5a46f32351e35956684 | [
"MIT"
] | null | null | null |
"""Train the model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from im2txt import configuration
from im2txt import show_and_tell_model
FLAGS = tf.app.flags.FLAGS
tf.flags.DEFINE_string("input_file_pattern", "",
... | 34.921569 | 80 | 0.71196 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from im2txt import configuration
from im2txt import show_and_tell_model
FLAGS = tf.app.flags.FLAGS
tf.flags.DEFINE_string("input_file_pattern", "",
"File pat... | true | true |
1c421ba5cc25e81faa06ed54d8a9d618d0e83d7d | 745 | py | Python | task_scheduler_alt.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | 6 | 2021-05-21T01:10:42.000Z | 2021-12-16T16:12:30.000Z | task_scheduler_alt.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | null | null | null | task_scheduler_alt.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | null | null | null | from collections import Counter
class Solution:
def leastInterval(self, tasks: list[str], n: int) -> int:
counters = list(Counter(tasks).values())
counters.sort()
max_freq = counters.pop()
max_idle_time = (max_freq - 1) * n
idle_time = max_idle_time
while counters ... | 21.285714 | 75 | 0.436242 | from collections import Counter
class Solution:
def leastInterval(self, tasks: list[str], n: int) -> int:
counters = list(Counter(tasks).values())
counters.sort()
max_freq = counters.pop()
max_idle_time = (max_freq - 1) * n
idle_time = max_idle_time
while counters ... | true | true |
1c421bda6f16f21a6ab023a696c0e57cf3193402 | 14,249 | py | Python | src/twisted/python/_setup.py | tirkarthi/twisted | 74f1e5418742b5404210e4799ee1b914ef1f646b | [
"Unlicense",
"MIT"
] | null | null | null | src/twisted/python/_setup.py | tirkarthi/twisted | 74f1e5418742b5404210e4799ee1b914ef1f646b | [
"Unlicense",
"MIT"
] | null | null | null | src/twisted/python/_setup.py | tirkarthi/twisted | 74f1e5418742b5404210e4799ee1b914ef1f646b | [
"Unlicense",
"MIT"
] | null | null | null | # -*- test-case-name: twisted.python.test.test_setup -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# pylint: disable=I0011,C0103,C9302,W9401,W9402
"""
Setuptools convenience functionality.
This file must not import anything from Twisted, as it is loaded by C{exec} in
C{setup.py}. If you... | 31.524336 | 79 | 0.644186 |
import io
import os
import platform
import re
import sys
from distutils.command import build_ext
from distutils.errors import CompileError
from setuptools import Extension, find_packages
from setuptools.command.build_py import build_py
if sys.version_info < (3, 0):
_PY3 = False
else:
_PY3 = True
STA... | true | true |
1c421be8bea10155ae25c22a24e0e3f840106c07 | 1,844 | py | Python | starlite/handlers/asgi.py | to-ph/starlite | 8169749468c1fb76c408c9939669e89e18ca6f02 | [
"MIT"
] | 334 | 2022-01-07T12:14:54.000Z | 2022-03-30T23:28:03.000Z | starlite/handlers/asgi.py | to-ph/starlite | 8169749468c1fb76c408c9939669e89e18ca6f02 | [
"MIT"
] | 70 | 2022-01-06T18:41:33.000Z | 2022-03-23T20:21:33.000Z | starlite/handlers/asgi.py | to-ph/starlite | 8169749468c1fb76c408c9939669e89e18ca6f02 | [
"MIT"
] | 24 | 2022-01-06T22:02:01.000Z | 2022-03-20T01:43:39.000Z | from inspect import Signature, iscoroutinefunction
from typing import Any, Dict, List, Optional, Union, cast
from pydantic import validate_arguments
from pydantic.typing import AnyCallable
from starlite.exceptions import ImproperlyConfiguredException
from starlite.handlers.base import BaseRouteHandler
from starlite.t... | 38.416667 | 116 | 0.693059 | from inspect import Signature, iscoroutinefunction
from typing import Any, Dict, List, Optional, Union, cast
from pydantic import validate_arguments
from pydantic.typing import AnyCallable
from starlite.exceptions import ImproperlyConfiguredException
from starlite.handlers.base import BaseRouteHandler
from starlite.t... | true | true |
1c421c084e646eb6b6d1dc10ae2a6dceda689c38 | 9,411 | py | Python | venv/Lib/site-packages/_TFL/I18N.py | nasir733/airbnb-clone | 9ac746b6f3f3c8fc45f97773266e6f5f182d14b9 | [
"MIT"
] | 6 | 2016-12-10T17:51:10.000Z | 2021-10-11T07:51:48.000Z | venv/Lib/site-packages/_TFL/I18N.py | nasir733/airbnb-clone | 9ac746b6f3f3c8fc45f97773266e6f5f182d14b9 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/_TFL/I18N.py | nasir733/airbnb-clone | 9ac746b6f3f3c8fc45f97773266e6f5f182d14b9 | [
"MIT"
] | 3 | 2020-03-29T07:37:03.000Z | 2021-01-21T16:08:40.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2019 Mag. Christian Tanzer. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
# ****************************************************************************
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.... | 32.340206 | 80 | 0.592817 |
from _TFL import TFL
from _TFL.pyk import pyk
from _TFL.Record import Record
from _TFL.predicate import first, split_hst
import _TFL.Decorator
import _TFL.User_Config
import gettext
import locale
import sys
class _Config_ (Record)... | true | true |
1c421c8fa09d98cc032788271130bc9b9f3fb194 | 17,010 | py | Python | tensorflow/contrib/distributions/python/ops/mixture.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | 1 | 2017-02-24T05:09:40.000Z | 2017-02-24T05:09:40.000Z | tensorflow/contrib/distributions/python/ops/mixture.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distributions/python/ops/mixture.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | 1 | 2021-02-16T15:38:50.000Z | 2021-02-16T15:38:50.000Z | # Copyright 2016 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... | 42 | 80 | 0.671193 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.distributions.python.ops import categorical
from tensorflow.contrib.distributions.python.ops import distribution
from tensorflow.contrib.distributions.... | true | true |
1c421d28381f9d123cea2b322a695d6ce0506811 | 3,350 | py | Python | tests/h/util/session_tracker_test.py | julien-cheng/h | 36c8ec044725720cf36f0986cdf025395aca8929 | [
"BSD-2-Clause"
] | 2 | 2019-08-04T07:22:11.000Z | 2020-07-17T05:01:41.000Z | tests/h/util/session_tracker_test.py | fuelpress/i.fuel.press | af7b25895d813af0fef656dcf483afe852a99d76 | [
"BSD-2-Clause"
] | null | null | null | tests/h/util/session_tracker_test.py | fuelpress/i.fuel.press | af7b25895d813af0fef656dcf483afe852a99d76 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import unicode_literals
from uuid import uuid4
import pytest
from sqlalchemy.orm.util import identity_key
from h.db.types import _get_urlsafe_from_hex
from h.models import Annotation, Document
from h.util.session_tracker import Tracker, ObjectState
def generate_ann_id():
"""
Generate a rando... | 30.18018 | 84 | 0.678507 | from __future__ import unicode_literals
from uuid import uuid4
import pytest
from sqlalchemy.orm.util import identity_key
from h.db.types import _get_urlsafe_from_hex
from h.models import Annotation, Document
from h.util.session_tracker import Tracker, ObjectState
def generate_ann_id():
return _get_urlsafe_from... | true | true |
1c421d4c0b1c6e259ed2a537e534baf86c9bbbdc | 1,603 | py | Python | lib/matplotlib/tests/test_offsetbox.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/tests/test_offsetbox.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/tests/test_offsetbox.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import nose
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
from matplotlib.offsetbox import A... | 32.06 | 75 | 0.621335 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import nose
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
from matplotlib.offsetbox import A... | true | true |
1c421d50e973debea0380ade73241e0e1bcd3193 | 2,269 | py | Python | internal_external_comments/models.py | ortkin/django-internal-external-comments | ea608c34398549ca053d7b50a19cc8f614f91bf5 | [
"MIT"
] | null | null | null | internal_external_comments/models.py | ortkin/django-internal-external-comments | ea608c34398549ca053d7b50a19cc8f614f91bf5 | [
"MIT"
] | null | null | null | internal_external_comments/models.py | ortkin/django-internal-external-comments | ea608c34398549ca053d7b50a19cc8f614f91bf5 | [
"MIT"
] | null | null | null | from django.db import models
from django_comments.abstracts import CommentAbstractModel
from django_comments.managers import CommentManager
from django.contrib.sites.models import Site
from django.urls import reverse
class InternalExternalCommentManager(CommentManager):
def for_site(self, site=None):
if s... | 32.414286 | 75 | 0.619216 | from django.db import models
from django_comments.abstracts import CommentAbstractModel
from django_comments.managers import CommentManager
from django.contrib.sites.models import Site
from django.urls import reverse
class InternalExternalCommentManager(CommentManager):
def for_site(self, site=None):
if s... | true | true |
1c421dabaf6d795cc19ab256b3f39a700a58b938 | 5,702 | py | Python | data.py | markpasc/makerbase | d35bc9da8fc843806465c2159b220cb8ca9234f6 | [
"MIT"
] | 4 | 2015-02-12T19:18:11.000Z | 2015-07-30T18:45:48.000Z | data.py | markpasc/makerbase | d35bc9da8fc843806465c2159b220cb8ca9234f6 | [
"MIT"
] | null | null | null | data.py | markpasc/makerbase | d35bc9da8fc843806465c2159b220cb8ca9234f6 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import makerbase
from makerbase.models import *
"""
user: {
'id':
'name':
'avatar_url':
'html_url':
<link to person?>
}
maker: {
'name':
'avatar_url':
'html_url':
}
project: {
'name':
'description':
'avatar_url':
'html_url':
}... | 21.598485 | 177 | 0.659418 | from datetime import datetime, timedelta
import makerbase
from makerbase.models import *
def blit(cls, ident):
obj = cls.get(ident)
if obj is not None:
obj.delete()
def empty_bucket(cls):
keys = cls.get_bucket().get_keys()
for key in keys:
blit(cls, key)
for cls in (Project, Mak... | true | true |
1c421ddfb599c1e298cfa6ac646ba1826abb9a61 | 3,595 | py | Python | data/filter_dataset.py | KaijuML/dtt-multi-branch | a49850a95034e58d387b9d48c647cfc2b83c45b5 | [
"Apache-2.0"
] | 8 | 2021-02-25T08:19:55.000Z | 2022-03-12T06:25:36.000Z | data/filter_dataset.py | KaijuML/dtt-multi-branch | a49850a95034e58d387b9d48c647cfc2b83c45b5 | [
"Apache-2.0"
] | 5 | 2021-05-20T19:11:58.000Z | 2021-07-14T07:46:33.000Z | data/filter_dataset.py | KaijuML/dtt-multi-branch | a49850a95034e58d387b9d48c647cfc2b83c45b5 | [
"Apache-2.0"
] | null | null | null | """
This scripts filters the references from WikiBIO using our custom token score function
For now, only token with a score > 0 are kept.
"""
from utils import FileIterable, TaggedFileIterable
import multiprocessing as mp
import argparse
import tqdm
import os
if __name__ == '__main__':
parser = argparse.Argumen... | 39.505495 | 92 | 0.588595 | from utils import FileIterable, TaggedFileIterable
import multiprocessing as mp
import argparse
import tqdm
import os
if __name__ == '__main__':
parser = argparse.ArgumentParser()
group = parser.add_argument_group('How to config paths')
group.add_argument('--dest', dest='dest', required=True,
... | true | true |
1c421de3392afbd8279bdc95c2597c5b7c2a09fc | 1,381 | py | Python | examples/Baselines/Halite_competition/torch/config.py | lp2333/PARL | e4bde1f5b7e69c5f8d3ee3a90a647dfe12204bd3 | [
"ECL-2.0",
"Apache-2.0"
] | 3,172 | 2018-05-22T02:02:29.000Z | 2022-03-31T09:14:56.000Z | examples/Baselines/Halite_competition/torch/config.py | BKBK00/PARL | f508bc6085420431b504441c7ff129e64826603e | [
"Apache-2.0"
] | 422 | 2018-05-17T16:58:45.000Z | 2022-03-31T02:03:25.000Z | examples/Baselines/Halite_competition/torch/config.py | BKBK00/PARL | f508bc6085420431b504441c7ff129e64826603e | [
"Apache-2.0"
] | 794 | 2018-05-21T18:33:19.000Z | 2022-03-30T13:38:09.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 27.078431 | 74 | 0.669804 |
config = {
"board_size": 21,
"episodes": 10000,
"batch_size": 128,
"train_times": 2,
"gamma": 0.997,
"lr": 0.0001,
"test_every_episode": 100,
"vf_loss_coef": 1,
"ent_coef": 0.01,
"world_dim": 5 * 21 * 21,
"ship_obs_dim": 6,
"ship_act_... | true | true |
1c421e40cbc61c50529786cd59cc92e00d2cf13d | 143 | py | Python | gym-battleship-basic/gym_battleship_basic/__init__.py | xwx1989119/Battleship | 518f0211d898c0ed20bf2a14c1b1b5750b371f25 | [
"MIT"
] | null | null | null | gym-battleship-basic/gym_battleship_basic/__init__.py | xwx1989119/Battleship | 518f0211d898c0ed20bf2a14c1b1b5750b371f25 | [
"MIT"
] | null | null | null | gym-battleship-basic/gym_battleship_basic/__init__.py | xwx1989119/Battleship | 518f0211d898c0ed20bf2a14c1b1b5750b371f25 | [
"MIT"
] | null | null | null | from gym.envs.registration import register
register(
id='battleshipBasic-v0',
entry_point='gym_battleship_basic.envs:BattleshipEnv',
) | 23.833333 | 58 | 0.783217 | from gym.envs.registration import register
register(
id='battleshipBasic-v0',
entry_point='gym_battleship_basic.envs:BattleshipEnv',
) | true | true |
1c421fb628459617e362cb622c3fe92548a7c650 | 17,918 | py | Python | custom_components/xiaomi_cloud_map_extractor/camera.py | GuyKh/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor | 65e0a905fdb6048facdb34cbec40b7ece4fef991 | [
"MIT"
] | 697 | 2020-09-30T08:35:58.000Z | 2022-03-31T17:14:20.000Z | custom_components/xiaomi_cloud_map_extractor/camera.py | GuyKh/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor | 65e0a905fdb6048facdb34cbec40b7ece4fef991 | [
"MIT"
] | 216 | 2020-10-01T12:05:24.000Z | 2022-03-31T11:35:46.000Z | custom_components/xiaomi_cloud_map_extractor/camera.py | GuyKh/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor | 65e0a905fdb6048facdb34cbec40b7ece4fef991 | [
"MIT"
] | 92 | 2020-09-30T18:10:19.000Z | 2022-03-24T12:15:18.000Z | import io
import logging
import time
from datetime import timedelta
from enum import Enum
import miio
import PIL.Image as Image
import voluptuous as vol
from homeassistant.components.camera import Camera, ENTITY_ID_FORMAT, PLATFORM_SCHEMA, SUPPORT_ON_OFF
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSW... | 45.592875 | 119 | 0.661904 | import io
import logging
import time
from datetime import timedelta
from enum import Enum
import miio
import PIL.Image as Image
import voluptuous as vol
from homeassistant.components.camera import Camera, ENTITY_ID_FORMAT, PLATFORM_SCHEMA, SUPPORT_ON_OFF
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSW... | true | true |
1c42205c2c3bdfdbae7dda9529705e4baf7faae6 | 1,586 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/DeleteNoteRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/DeleteNoteRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/DeleteNoteRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may ... | 36.883721 | 75 | 0.750315 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkemr.endpoint import endpoint_data
class DeleteNoteRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Emr', '2016-04-08', 'DeleteNote','emr')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map", en... | true | true |
1c422200b03e653ed0fce33c03d778100afa9fd7 | 2,131 | py | Python | data_process/2d_1d/simon/upload_data_to_db.py | ribuild/delphin_6_automation | 12024381fc1042b46314c55d88b6349229ea33b7 | [
"MIT"
] | 2 | 2017-11-08T18:37:36.000Z | 2018-01-09T12:10:58.000Z | data_process/2d_1d/simon/upload_data_to_db.py | ribuild/delphin_6_automation | 12024381fc1042b46314c55d88b6349229ea33b7 | [
"MIT"
] | 111 | 2018-02-26T08:25:44.000Z | 2021-03-31T19:17:19.000Z | data_process/2d_1d/simon/upload_data_to_db.py | thp44/delphin_6_automation | 12024381fc1042b46314c55d88b6349229ea33b7 | [
"MIT"
] | 3 | 2017-11-06T10:01:25.000Z | 2018-02-14T09:45:28.000Z | __author__ = "Christian Kongsgaard"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
import os
import json
# RiBuild Modules
from delphin_6_automation.database_interactions import mongo_setup
from delphin_... | 36.118644 | 120 | 0.714688 | __author__ = "Christian Kongsgaard"
__license__ = 'MIT'
import os
import json
from delphin_6_automation.database_interactions import mongo_setup
from delphin_6_automation.database_interactions.auth import auth_2d_1d as auth_dict
from delphin_6_automation.database_interactions import weather_interactions
from delp... | true | true |
1c4222c1e21b8471a57878aeb66220ab3d64daec | 1,812 | py | Python | code/models/AlexNet.py | ArvindSubramaniam/Pruning-Networks-using-Neuron2Neuron-Skip-Connections | bbe402bbf4c5afb4ae712354e8fca5ce320501b8 | [
"Apache-2.0"
] | 1 | 2021-11-16T03:36:51.000Z | 2021-11-16T03:36:51.000Z | code/models/AlexNet.py | ArvindSubramaniam/Pruning-Networks-using-Neuron2Neuron-Skip-Connections | bbe402bbf4c5afb4ae712354e8fca5ce320501b8 | [
"Apache-2.0"
] | null | null | null | code/models/AlexNet.py | ArvindSubramaniam/Pruning-Networks-using-Neuron2Neuron-Skip-Connections | bbe402bbf4c5afb4ae712354e8fca5ce320501b8 | [
"Apache-2.0"
] | 3 | 2020-12-29T01:52:01.000Z | 2021-11-16T03:36:52.000Z | import torch.nn as nn
import torch.utils.model_zoo as model_zoo
__all__ = ['AlexNet', 'alexnet']
model_urls = {
'alexnet': 'https://download.pytorch.org/models/alexnet-owt-4df8aa71.pth',
}
class AlexNet(nn.Module):
def __init__(self, num_classes=10):
super(AlexNet, self).__init__()
self.fe... | 30.711864 | 78 | 0.571192 | import torch.nn as nn
import torch.utils.model_zoo as model_zoo
__all__ = ['AlexNet', 'alexnet']
model_urls = {
'alexnet': 'https://download.pytorch.org/models/alexnet-owt-4df8aa71.pth',
}
class AlexNet(nn.Module):
def __init__(self, num_classes=10):
super(AlexNet, self).__init__()
self.fe... | true | true |
1c42243bb54c2335aeb253f2b0b05b730467c11e | 163 | py | Python | setup.py | DixiGroup/fuel_flow | d869c417d0fded452409e6572d94b77317262326 | [
"MIT"
] | null | null | null | setup.py | DixiGroup/fuel_flow | d869c417d0fded452409e6572d94b77317262326 | [
"MIT"
] | null | null | null | setup.py | DixiGroup/fuel_flow | d869c417d0fded452409e6572d94b77317262326 | [
"MIT"
] | null | null | null | from distutils.core import setup
import py2exe
setup(console=[{'script':'fuel_transform.py'}],
options={"py2exe":{"includes":["xlrd", "xlsxwriter"]}})
| 27.166667 | 62 | 0.668712 | from distutils.core import setup
import py2exe
setup(console=[{'script':'fuel_transform.py'}],
options={"py2exe":{"includes":["xlrd", "xlsxwriter"]}})
| true | true |
1c42249594d6b1f31f8ce6b14ac9498a4d1e0e6b | 5,109 | py | Python | websocket/websocket/server.py | hi2017teamB/ChatAppProject | d78790800dab407f46c487098718babc847a861f | [
"MIT"
] | 69 | 2018-01-06T07:00:34.000Z | 2022-02-21T03:30:20.000Z | websocket/websocket/server.py | hi2017teamB/ChatAppProject | d78790800dab407f46c487098718babc847a861f | [
"MIT"
] | 1 | 2021-10-19T08:05:06.000Z | 2021-10-19T08:05:06.000Z | websocket/websocket/server.py | hi2017teamB/ChatAppProject | d78790800dab407f46c487098718babc847a861f | [
"MIT"
] | 31 | 2018-01-22T12:21:55.000Z | 2022-02-21T03:30:23.000Z | import sys
import traceback
from os.path import abspath, dirname, join, basename
from socket import error
from hashlib import md5
from datetime import datetime
from gevent.pywsgi import WSGIHandler, WSGIServer
from websocket.policyserver import FlashPolicyServer
from websocket import WebSocket
import gevent
assert ge... | 37.844444 | 125 | 0.599922 | import sys
import traceback
from os.path import abspath, dirname, join, basename
from socket import error
from hashlib import md5
from datetime import datetime
from gevent.pywsgi import WSGIHandler, WSGIServer
from websocket.policyserver import FlashPolicyServer
from websocket import WebSocket
import gevent
assert ge... | false | true |
1c42256fb3332783211a320c3ff901c2043853b1 | 112 | py | Python | api/admin.py | vulture990/memo-App | 8cbb63392682f57d29758dc8e842a4f1f8a4e9c3 | [
"MIT"
] | null | null | null | api/admin.py | vulture990/memo-App | 8cbb63392682f57d29758dc8e842a4f1f8a4e9c3 | [
"MIT"
] | 3 | 2020-06-05T18:14:29.000Z | 2021-06-10T20:17:57.000Z | api/admin.py | vulture990/memo-App | 8cbb63392682f57d29758dc8e842a4f1f8a4e9c3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Note
# Register your models here.
admin.site.register(Note) | 28 | 32 | 0.8125 | from django.contrib import admin
from .models import Note
admin.site.register(Note) | true | true |
1c4226e431d31b4206940f44ee3e0b27310391b5 | 2,196 | py | Python | scripts/csv_handling/dataload_format_to_csv.py | samholt/NeuralSymbolicRegressionThatScales | da023e5a3fdf157ab60e56a966eeea0129366bfc | [
"MIT"
] | 27 | 2021-06-17T07:31:55.000Z | 2022-03-16T14:52:16.000Z | scripts/csv_handling/dataload_format_to_csv.py | samholt/NeuralSymbolicRegressionThatScales | da023e5a3fdf157ab60e56a966eeea0129366bfc | [
"MIT"
] | 9 | 2021-07-05T12:58:42.000Z | 2022-03-31T15:11:36.000Z | scripts/csv_handling/dataload_format_to_csv.py | samholt/NeuralSymbolicRegressionThatScales | da023e5a3fdf157ab60e56a966eeea0129366bfc | [
"MIT"
] | 5 | 2021-06-26T19:07:43.000Z | 2022-03-23T15:09:31.000Z | import pandas as pd
import numpy as np
import multiprocessing
from multiprocessing import Manager
import click
import warnings
from tqdm import tqdm
import json
import os
from nesymres.dataset import generator
import time
import signal
from pathlib import Path
import pickle
from sympy import lambdify
from nesymres.uti... | 32.776119 | 98 | 0.718124 | import pandas as pd
import numpy as np
import multiprocessing
from multiprocessing import Manager
import click
import warnings
from tqdm import tqdm
import json
import os
from nesymres.dataset import generator
import time
import signal
from pathlib import Path
import pickle
from sympy import lambdify
from nesymres.uti... | true | true |
1c4227fd30ccc3e48c9226b868ed03f448567525 | 5,611 | py | Python | src/django/api/migrations/0033_add_generate_hexgrid_function_20190909.py | azavea/open-apparel-registry | 20f7a6d502d9152c85ee7f2696b25b6badf98924 | [
"MIT"
] | 32 | 2019-01-26T05:04:03.000Z | 2022-03-11T15:09:09.000Z | src/django/api/migrations/0033_add_generate_hexgrid_function_20190909.py | azavea/open-apparel-registry | 20f7a6d502d9152c85ee7f2696b25b6badf98924 | [
"MIT"
] | 1,586 | 2019-01-15T21:54:42.000Z | 2022-03-31T17:38:14.000Z | src/django/api/migrations/0033_add_generate_hexgrid_function_20190909.py | Home-ac/Base0 | 04f03b8bf31146783c583df0871ab69fd6309a27 | [
"MIT"
] | 7 | 2019-02-28T03:32:46.000Z | 2021-11-04T17:03:46.000Z | # Generated by Django 2.2.3 on 2019-09-09 21:11
from django.db import migrations
# SOURCE: https://gist.github.com/mjumbewu/1761802ea06fb78c596f9cf8c9b2e769
create_generate_hexgrid = """
/*
The default SRID is EPSG 3857 (web mercator -- https://epsg.io/3857). However
you can use any SRID you want. All input parameter... | 37.406667 | 127 | 0.629478 |
from django.db import migrations
create_generate_hexgrid = """
/*
The default SRID is EPSG 3857 (web mercator -- https://epsg.io/3857). However
you can use any SRID you want. All input parameters should be interpreted as
coordinates and distances in whatever the SRID is set to.
SRID 3857 units are [very approximat... | true | true |
1c42284aa5378a568fc95740857cb45663a7a7c1 | 15,896 | py | Python | cloudify_cli/commands/plugins.py | TS-at-WS/cloudify-cli | 598b54ecd67495a76678177f910cdc5eac6128d0 | [
"Apache-2.0"
] | null | null | null | cloudify_cli/commands/plugins.py | TS-at-WS/cloudify-cli | 598b54ecd67495a76678177f910cdc5eac6128d0 | [
"Apache-2.0"
] | 10 | 2020-08-02T07:45:42.000Z | 2021-06-11T01:03:45.000Z | cloudify_cli/commands/plugins.py | TS-at-WS/cloudify-cli | 598b54ecd67495a76678177f910cdc5eac6128d0 | [
"Apache-2.0"
] | null | null | null | ########
# Copyright (c) 2018 Cloudify Platform Ltd. 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 requi... | 37.053613 | 79 | 0.669602 | m cloudify_cli.logger import get_events_logger
from cloudify_cli.exceptions import SuppressedCloudifyCliError
from cloudify_rest_client.constants import VISIBILITY_EXCEPT_PRIVATE
from .. import utils
from ..table import print_data, print_single
from ..cli import helptexts, cfy
from ..utils import (prettify_client_err... | true | true |
1c4228dbb2d4de48a3adda7dd0f253c0aee5db36 | 8,872 | py | Python | ironic-plugin-pike/ironic/tests/unit/drivers/modules/network/test_flat.py | saintifly/Server_Manage_Plugin | ae272e7e3ca065236cc7bc86c296ff9eb83f1bb9 | [
"Apache-2.0"
] | null | null | null | ironic-plugin-pike/ironic/tests/unit/drivers/modules/network/test_flat.py | saintifly/Server_Manage_Plugin | ae272e7e3ca065236cc7bc86c296ff9eb83f1bb9 | [
"Apache-2.0"
] | null | null | null | ironic-plugin-pike/ironic/tests/unit/drivers/modules/network/test_flat.py | saintifly/Server_Manage_Plugin | ae272e7e3ca065236cc7bc86c296ff9eb83f1bb9 | [
"Apache-2.0"
] | 1 | 2019-01-11T16:00:23.000Z | 2019-01-11T16:00:23.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 46.208333 | 78 | 0.664675 |
import mock
from neutronclient.common import exceptions as neutron_exceptions
from oslo_config import cfg
from oslo_utils import uuidutils
from ironic.common import exception
from ironic.common import neutron
from ironic.conductor import task_manager
from ironic.drivers.modules.network import flat as flat_... | true | true |
1c422994b9f5e1e95b9791a3d2ed123c94ba30ac | 37,827 | py | Python | dataproc/google/cloud/dataproc_v1beta2/gapic/cluster_controller_client.py | ryanyuan/google-cloud-python | db481bfdd6816d020d99df0d4caa307358ab1141 | [
"Apache-2.0"
] | 2 | 2021-11-26T07:08:43.000Z | 2022-03-07T20:20:04.000Z | dataproc/google/cloud/dataproc_v1beta2/gapic/cluster_controller_client.py | ryanyuan/google-cloud-python | db481bfdd6816d020d99df0d4caa307358ab1141 | [
"Apache-2.0"
] | null | null | null | dataproc/google/cloud/dataproc_v1beta2/gapic/cluster_controller_client.py | ryanyuan/google-cloud-python | db481bfdd6816d020d99df0d4caa307358ab1141 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 43.329897 | 164 | 0.588601 |
import functools
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.client_options
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.api_core.grpc_helpers
import goo... | true | true |
1c4229d82360abfecb0c9b9eeb6d19c89a7b1ea2 | 468 | py | Python | touchpoint/employee.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | touchpoint/employee.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | touchpoint/employee.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | # touchpoint/employee.py
class Employee():
def __init__(self, employee_id, first_name=None, last_name=None, emp_id=None):
self.employee_id = employee_id
self.first_name = first_name
self.last_name = last_name
self.emp_id = emp_id
def info(self):
return {'employee_id': s... | 31.2 | 82 | 0.617521 |
class Employee():
def __init__(self, employee_id, first_name=None, last_name=None, emp_id=None):
self.employee_id = employee_id
self.first_name = first_name
self.last_name = last_name
self.emp_id = emp_id
def info(self):
return {'employee_id': self.employee_id,
... | true | true |
1c422bf19b2171922a496659c3a4345cf5fbb0b3 | 4,397 | py | Python | sandy-disaster-recovery/key.py | toddjcrane/crisiscleanup-legacy | 74dbad143ebc3bfae4cc5afc478e43ab4033ff69 | [
"Apache-2.0"
] | 1 | 2017-01-07T21:44:21.000Z | 2017-01-07T21:44:21.000Z | sandy-disaster-recovery/key.py | aarontitus/crisiscleanup-legacy | 74dbad143ebc3bfae4cc5afc478e43ab4033ff69 | [
"Apache-2.0"
] | 1 | 2021-03-26T00:25:19.000Z | 2021-03-26T00:25:19.000Z | sandy-disaster-recovery/key.py | toddjcrane/crisiscleanup-legacy | 74dbad143ebc3bfae4cc5afc478e43ab4033ff69 | [
"Apache-2.0"
] | 1 | 2017-09-07T09:52:15.000Z | 2017-09-07T09:52:15.000Z | #!/usr/bin/env python
#
# Copyright 2012 Jeremy Pack
#
# 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... | 35.176 | 74 | 0.626791 |
from google.appengine.ext import db
import Cookie
import datetime
import hashlib
import organization
from google.appengine.api import memcache
import cache
import event_db
class Key(db.Model):
secret_key = db.StringProperty(required = True)
date = db.DateTimeProperty(required = True, auto_now_add... | true | true |
1c422bf79ecd435d6fec656ed68ebd798c8bf2b3 | 6,981 | py | Python | parser.py | shtratos/ms-uk-payslip-parser | 6372ca671d1942cb6d3cd54f6e22cce1dd6852cd | [
"MIT"
] | 3 | 2019-12-09T15:32:51.000Z | 2021-02-08T14:10:30.000Z | parser.py | shtratos/ms-uk-payslip-parser | 6372ca671d1942cb6d3cd54f6e22cce1dd6852cd | [
"MIT"
] | null | null | null | parser.py | shtratos/ms-uk-payslip-parser | 6372ca671d1942cb6d3cd54f6e22cce1dd6852cd | [
"MIT"
] | 1 | 2022-01-08T16:18:38.000Z | 2022-01-08T16:18:38.000Z | import collections
import csv
import re
import sys
from collections import OrderedDict
from pathlib import Path
HEADER_FIELD = '.m.Pay Date'
FIELDS_ORDER = [
HEADER_FIELD, '.m.Pay', '.m.',
'.d.p',
'.d.d',
'.d.t',
'.d.et',
'.d.ytd',
]
UNWANTED_FIELDS = [
'.m.Company Name', '.m.Account', '.... | 30.889381 | 103 | 0.624409 | import collections
import csv
import re
import sys
from collections import OrderedDict
from pathlib import Path
HEADER_FIELD = '.m.Pay Date'
FIELDS_ORDER = [
HEADER_FIELD, '.m.Pay', '.m.',
'.d.p',
'.d.d',
'.d.t',
'.d.et',
'.d.ytd',
]
UNWANTED_FIELDS = [
'.m.Company Name', '.m.Account', '.... | true | true |
1c422c3e02bebbc8def8f727bb5f9427050dd1c2 | 5,960 | py | Python | docs/source/conf.py | LourensVeen/simple-cwl-xenon-service | f8ff51629d1198200bd84d59e78ca456321af940 | [
"Apache-2.0"
] | 10 | 2017-09-07T10:25:33.000Z | 2021-01-20T00:32:31.000Z | docs/source/conf.py | MD-Studio/cerise | f8ff51629d1198200bd84d59e78ca456321af940 | [
"Apache-2.0"
] | 52 | 2017-08-22T09:53:35.000Z | 2021-08-19T08:24:16.000Z | docs/source/conf.py | LourensVeen/simple-cwl-xenon-service | f8ff51629d1198200bd84d59e78ca456321af940 | [
"Apache-2.0"
] | 3 | 2017-11-13T22:01:37.000Z | 2021-08-14T10:50:21.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# cerise documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 19 10:25:17 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | 30.408163 | 79 | 0.677685 |
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.viewcode']
source_suffix = '.rst'
master_doc = 'index'
project = 'cerise'
copyright = ... | true | true |
1c422cfb212b27838ec057a950c0547282063541 | 1,320 | py | Python | pyzoo/test/zoo/serving/test_serialization.py | hkvision/analytics-zoo | aee693a0604db5b5d01540d5d414b644313d5d22 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/serving/test_serialization.py | hkvision/analytics-zoo | aee693a0604db5b5d01540d5d414b644313d5d22 | [
"Apache-2.0"
] | 1 | 2020-11-19T09:18:01.000Z | 2020-11-20T07:14:21.000Z | pyzoo/test/zoo/serving/test_serialization.py | hkvision/analytics-zoo | aee693a0604db5b5d01540d5d414b644313d5d22 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 32.195122 | 80 | 0.701515 |
import numpy as np
import base64
from zoo.serving.client import InputQueue, OutputQueue, http_response_to_ndarray
import os
resource_path = os.path.join(os.path.split(__file__)[0], "../resources")
class TestSerialization:
def test_encode(self):
input_api = InputQueue()
b64 = in... | true | true |
1c422d734a930cbdf97d4c899dd2c2c62930bff4 | 9,073 | py | Python | src/wx/event_handlers.py | z80lives/affective-movie-evaluator | c22e0d75166c9c26cbca276c70b38c1f6419bfe0 | [
"MIT"
] | null | null | null | src/wx/event_handlers.py | z80lives/affective-movie-evaluator | c22e0d75166c9c26cbca276c70b38c1f6419bfe0 | [
"MIT"
] | 1 | 2019-11-16T23:43:28.000Z | 2019-11-16T23:43:28.000Z | src/wx/event_handlers.py | z80lives/affective-movie-evaluator | c22e0d75166c9c26cbca276c70b38c1f6419bfe0 | [
"MIT"
] | null | null | null | import wx
from src.playback import RecordSystem, VLCPlayer
from src.utils import SampleLoader, SampleController, MovieController, PersonController
from src.wx.record import RecordTabPanel, CameraCaptureFrame
from src.wx.analyse_movie import AnalyseMovieTabPanel
from src.wx.samples import SampleTabPanel, SampleTabFrame... | 34.896154 | 92 | 0.616114 | import wx
from src.playback import RecordSystem, VLCPlayer
from src.utils import SampleLoader, SampleController, MovieController, PersonController
from src.wx.record import RecordTabPanel, CameraCaptureFrame
from src.wx.analyse_movie import AnalyseMovieTabPanel
from src.wx.samples import SampleTabPanel, SampleTabFrame... | true | true |
1c422e8a6aafaa91932fb0b8728d242ea83b1153 | 3,879 | py | Python | Processing/play_model.py | AndrewJBean/Stocks | 1a082856983936e77c45d5b47274ac5f2a344348 | [
"MIT"
] | 1 | 2019-06-13T03:13:55.000Z | 2019-06-13T03:13:55.000Z | Processing/play_model.py | AndrewJBean/Stocks | 1a082856983936e77c45d5b47274ac5f2a344348 | [
"MIT"
] | null | null | null | Processing/play_model.py | AndrewJBean/Stocks | 1a082856983936e77c45d5b47274ac5f2a344348 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# MIT License
# Copyright (c) 2018 Andrew J. Bean
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | 34.327434 | 82 | 0.67801 |
import h5py
import numpy as np
import matplotlib.pyplot as plt
from keras.models import load_model
def main():
Gain = '0.5'
Loss = '0.5'
MSE_Loss = False
LinearActivation = False
DropFrac = '0.0'
NEpochs = '200'
NameRoot = 'my_model_'
whichplot = 1
extensio... | true | true |
1c422ef9036dbb792a8e97dffa85983051952d08 | 1,251 | py | Python | manage.py | cristobal23/strabo | ab9aa1d4fde9ae9c1c225e689898cb30ff7f86c6 | [
"Apache-2.0"
] | null | null | null | manage.py | cristobal23/strabo | ab9aa1d4fde9ae9c1c225e689898cb30ff7f86c6 | [
"Apache-2.0"
] | 3 | 2018-07-27T01:49:13.000Z | 2018-08-20T01:57:06.000Z | manage.py | cristobal23/strabo | ab9aa1d4fde9ae9c1c225e689898cb30ff7f86c6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
from flask_script import Manager, Shell, Server
from flask_script.commands import ShowUrls, Clean
from strabo.app import create_app
from strabo.models import db, User
# default to dev config
env = os.environ.get('STRABO_ENV', 'dev')
app = create_app('strabo.settings.%sConfig' % env.ca... | 24.529412 | 78 | 0.704237 |
import os
from flask_script import Manager, Shell, Server
from flask_script.commands import ShowUrls, Clean
from strabo.app import create_app
from strabo.models import db, User
env = os.environ.get('STRABO_ENV', 'dev')
app = create_app('strabo.settings.%sConfig' % env.capitalize())
HERE = os.path.abspath(os.path.... | true | true |
1c422fb7fbcdd11294596298fce6ebce66e1b612 | 4,639 | py | Python | utils/fs.py | pombredanne/swarming.client | 45f9d61c66e18bf3bddc2022cba615abbeb826ce | [
"Apache-2.0"
] | null | null | null | utils/fs.py | pombredanne/swarming.client | 45f9d61c66e18bf3bddc2022cba615abbeb826ce | [
"Apache-2.0"
] | null | null | null | utils/fs.py | pombredanne/swarming.client | 45f9d61c66e18bf3bddc2022cba615abbeb826ce | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Wraps os, os.path and shutil functions to work around MAX_PATH on Windows."""
import __builtin__
import inspect
import os
import shutil
import... | 25.772222 | 80 | 0.686786 |
import __builtin__
import inspect
import os
import shutil
import sys
if sys.platform == 'win32':
import ctypes
GetFileAttributesW = ctypes.windll.kernel32.GetFileAttributesW
GetFileAttributesW.argtypes = (ctypes.c_wchar_p,)
GetFileAttributesW.restype = ctypes.c_uint
CreateSymbolicLinkW = ctypes.windl... | true | true |
1c4231dd19d810e39685a4bcc81a1b4b6addc51b | 4,994 | py | Python | selfdrive/controls/lib/lane_planner.py | YHKIM71/openpilot0813Volt | 9f8b401d2b544d54e3b5e8c019f6ca20926a61f0 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/lane_planner.py | YHKIM71/openpilot0813Volt | 9f8b401d2b544d54e3b5e8c019f6ca20926a61f0 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/lane_planner.py | YHKIM71/openpilot0813Volt | 9f8b401d2b544d54e3b5e8c019f6ca20926a61f0 | [
"MIT"
] | null | null | null | import numpy as np
from cereal import log
from common.filter_simple import FirstOrderFilter
from common.numpy_fast import interp, clip, mean
from common.realtime import DT_MDL
from selfdrive.hardware import EON, TICI
from selfdrive.swaglog import cloudlog
from selfdrive.ntune import ntune_common_get
ENABLE_ZORROBYTE =... | 35.671429 | 118 | 0.676812 | import numpy as np
from cereal import log
from common.filter_simple import FirstOrderFilter
from common.numpy_fast import interp, clip, mean
from common.realtime import DT_MDL
from selfdrive.hardware import EON, TICI
from selfdrive.swaglog import cloudlog
from selfdrive.ntune import ntune_common_get
ENABLE_ZORROBYTE =... | true | true |
1c4233a81772cebc4ed4ece2d3a93645f94d10de | 22,510 | py | Python | tests/flow/test_ts_mrange.py | rostyboost/RedisTimeSeries | 61b9db88ec00447ecd87583b60dbf7ad9394719d | [
"MIT",
"Ruby",
"BSD-3-Clause"
] | null | null | null | tests/flow/test_ts_mrange.py | rostyboost/RedisTimeSeries | 61b9db88ec00447ecd87583b60dbf7ad9394719d | [
"MIT",
"Ruby",
"BSD-3-Clause"
] | null | null | null | tests/flow/test_ts_mrange.py | rostyboost/RedisTimeSeries | 61b9db88ec00447ecd87583b60dbf7ad9394719d | [
"MIT",
"Ruby",
"BSD-3-Clause"
] | null | null | null | import pytest
import redis
import time
from collections import defaultdict
from utils import Env, set_hertz
from test_helper_classes import _insert_data
from test_ts_range import build_expected_aligned_data
from includes import *
def test_mrange_with_expire_cmd():
env = Env()
set_hertz(env)
with env.getC... | 61.00271 | 333 | 0.609329 | import pytest
import redis
import time
from collections import defaultdict
from utils import Env, set_hertz
from test_helper_classes import _insert_data
from test_ts_range import build_expected_aligned_data
from includes import *
def test_mrange_with_expire_cmd():
env = Env()
set_hertz(env)
with env.getC... | true | true |
1c4234181841813e745a8ada5c9d0aa53e8be2dc | 24,222 | py | Python | workers/data_refinery_workers/processors/test_compendia.py | AlexsLemonade/refinebio | 52f44947f902adedaccf270d5f9dbd56ab47e40a | [
"BSD-3-Clause"
] | 106 | 2018-03-05T16:24:47.000Z | 2022-03-19T19:12:25.000Z | workers/data_refinery_workers/processors/test_compendia.py | AlexsLemonade/refinebio | 52f44947f902adedaccf270d5f9dbd56ab47e40a | [
"BSD-3-Clause"
] | 1,494 | 2018-02-27T17:02:21.000Z | 2022-03-24T15:10:30.000Z | workers/data_refinery_workers/processors/test_compendia.py | AlexsLemonade/refinebio | 52f44947f902adedaccf270d5f9dbd56ab47e40a | [
"BSD-3-Clause"
] | 15 | 2019-02-03T01:34:59.000Z | 2022-03-29T01:59:13.000Z | import copy
import itertools
import json
import math
import os
import random
import zipfile
from typing import Dict
from django.test import TransactionTestCase, tag
import numpy as np
import pandas as pd
from data_refinery_common.enums import PipelineEnum, ProcessorPipeline
from data_refinery_common.models import (
... | 33.782427 | 99 | 0.592313 | import copy
import itertools
import json
import math
import os
import random
import zipfile
from typing import Dict
from django.test import TransactionTestCase, tag
import numpy as np
import pandas as pd
from data_refinery_common.enums import PipelineEnum, ProcessorPipeline
from data_refinery_common.models import (
... | true | true |
1c4234506b59f49708e87e082d6cfd6b4e7c42d0 | 3,253 | py | Python | src/model/region2d.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | src/model/region2d.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | src/model/region2d.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Union
@dataclass(frozen=True)
class Region2d:
"""The basic Region (rectangle) in an image
Top left is (0,0) and x increases to the right while
y increases down the image.
"""
x: int
y: int
w: int
h: int
@property
def x1(sel... | 28.787611 | 96 | 0.627421 | from dataclasses import dataclass
from typing import Union
@dataclass(frozen=True)
class Region2d:
x: int
y: int
w: int
h: int
@property
def x1(self) -> int:
return self.x
@property
def y1(self) -> int:
return self.y
@property
def x2(self) -> int:
re... | true | true |
1c4234615ff82fe07f07ba85b5f296cecc94fb84 | 7,813 | py | Python | tests/plugins/test_ckan.py | augusto-herrmann/frictionless-py | b4ff35f064141a2c04882edb592666ca6b066776 | [
"MIT"
] | 1 | 2021-11-08T22:29:30.000Z | 2021-11-08T22:29:30.000Z | tests/plugins/test_ckan.py | augusto-herrmann/frictionless-py | b4ff35f064141a2c04882edb592666ca6b066776 | [
"MIT"
] | null | null | null | tests/plugins/test_ckan.py | augusto-herrmann/frictionless-py | b4ff35f064141a2c04882edb592666ca6b066776 | [
"MIT"
] | null | null | null | import pytest
import datetime
from frictionless import Package, Resource, FrictionlessException
from frictionless.plugins.ckan import CkanStorage, CkanDialect
# Parser
@pytest.mark.vcr
def test_ckan_parser(options):
url = options.pop("url")
dialect = CkanDialect(resource="table", **options)
source = Res... | 33.676724 | 87 | 0.581211 | import pytest
import datetime
from frictionless import Package, Resource, FrictionlessException
from frictionless.plugins.ckan import CkanStorage, CkanDialect
@pytest.mark.vcr
def test_ckan_parser(options):
url = options.pop("url")
dialect = CkanDialect(resource="table", **options)
source = Resource("d... | true | true |
1c423486be8d98de941898b2331c90c0380eded0 | 63,214 | py | Python | python/pyspark/ml/feature.py | bbejeck/spark | 56a0fe5c6e4ae2929c48fae2d6225558d020e5f9 | [
"Apache-2.0",
"MIT"
] | null | null | null | python/pyspark/ml/feature.py | bbejeck/spark | 56a0fe5c6e4ae2929c48fae2d6225558d020e5f9 | [
"Apache-2.0",
"MIT"
] | null | null | null | python/pyspark/ml/feature.py | bbejeck/spark | 56a0fe5c6e4ae2929c48fae2d6225558d020e5f9 | [
"Apache-2.0",
"MIT"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 37.206592 | 100 | 0.619119 |
import sys
if sys.version > '3':
basestring = str
from pyspark.rdd import ignore_unicode_prefix
from pyspark.ml.param.shared import *
from pyspark.ml.util import keyword_only
from pyspark.ml.wrapper import JavaEstimator, JavaModel, JavaTransformer, _jvm
from pyspark.mllib.common import inherit_doc... | true | true |
1c4234b59d2bb634497dd779d5c0cfcece2d0d7f | 315 | py | Python | run.py | andreafioraldi/ascii-ctf | d1ca4e7826cb5a0fe4600cdd769d35eecd0125d0 | [
"BSD-2-Clause"
] | 8 | 2019-03-20T09:11:24.000Z | 2021-12-04T21:42:57.000Z | run.py | andreafioraldi/ascii-ctf | d1ca4e7826cb5a0fe4600cdd769d35eecd0125d0 | [
"BSD-2-Clause"
] | null | null | null | run.py | andreafioraldi/ascii-ctf | d1ca4e7826cb5a0fe4600cdd769d35eecd0125d0 | [
"BSD-2-Clause"
] | 3 | 2019-05-18T06:56:34.000Z | 2021-12-23T13:45:52.000Z | from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from ascii_ctf import app
import os
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000 if os.getenv("PORT") is None else int(os.getenv("PORT")),'0.0.0.0')
IOLoop.instance().start()
| 31.5 | 91 | 0.793651 | from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from ascii_ctf import app
import os
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000 if os.getenv("PORT") is None else int(os.getenv("PORT")),'0.0.0.0')
IOLoop.instance().start()
| true | true |
1c423684b4b593f020b9926639ad1cddd04c6111 | 1,387 | py | Python | playground/abstract/abs_ast.py | drew-loukusa/lang-playground | 16e64001444f9cb20bc24228ea6588811e96eea0 | [
"MIT"
] | null | null | null | playground/abstract/abs_ast.py | drew-loukusa/lang-playground | 16e64001444f9cb20bc24228ea6588811e96eea0 | [
"MIT"
] | null | null | null | playground/abstract/abs_ast.py | drew-loukusa/lang-playground | 16e64001444f9cb20bc24228ea6588811e96eea0 | [
"MIT"
] | null | null | null | class AST:
def __init__(self, token=None, artificial=False, name=None):
self.name = (
name # Artificial nodes won't have any "token_text", so give them a name
)
self.token = token # From which token did we create node?
self.children = [] # normalized list of AST nodes
... | 30.152174 | 85 | 0.55876 | class AST:
def __init__(self, token=None, artificial=False, name=None):
self.name = (
name
)
self.token = token # From which token did we create node?
self.children = [] # normalized list of AST nodes
self.artificial = artificial
def is_none(self):
... | true | true |
1c4236b5748bbe5e651eeeafccab2cbb7c42f1db | 7,836 | py | Python | tests/benchmark/milvus_benchmark/utils.py | haorenfsa/milvus | d8bab0cd21ce3d76576b4f75f76e1224bb1b5548 | [
"Apache-2.0"
] | null | null | null | tests/benchmark/milvus_benchmark/utils.py | haorenfsa/milvus | d8bab0cd21ce3d76576b4f75f76e1224bb1b5548 | [
"Apache-2.0"
] | null | null | null | tests/benchmark/milvus_benchmark/utils.py | haorenfsa/milvus | d8bab0cd21ce3d76576b4f75f76e1224bb1b5548 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import time
import logging
import string
import random
import json
import os
from yaml.representer import SafeRepresenter
# from yaml import full_load, dump
import yaml
import tableprint as tp
# from pprint import pprint
import config
logger = logging.getLogger("milvus_benchmark.utils")
def t... | 31.219124 | 109 | 0.596988 |
import time
import logging
import string
import random
import json
import os
from yaml.representer import SafeRepresenter
import yaml
import tableprint as tp
import config
logger = logging.getLogger("milvus_benchmark.utils")
def timestr_to_int(time_str):
if isinstance(time_str, int) or time_str.isdigit()... | true | true |
1c4237c8308eb73fae7beab7359bba15be44693b | 306 | py | Python | setup.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | 4 | 2017-12-25T10:36:15.000Z | 2018-01-01T10:42:34.000Z | setup.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | null | null | null | setup.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(name='somebox',
version='0.0.1',
description='Dropbox-like file sharing service',
author='Jaeseung Ha',
author_email='ipknhama@gmail.com',
url='https://github.com/ipkn/somebox',
packages=['somebox'],
)
| 23.538462 | 54 | 0.640523 |
from distutils.core import setup
setup(name='somebox',
version='0.0.1',
description='Dropbox-like file sharing service',
author='Jaeseung Ha',
author_email='ipknhama@gmail.com',
url='https://github.com/ipkn/somebox',
packages=['somebox'],
)
| true | true |
1c42381fa1ef141081328c94ed77762e9634c47f | 1,079 | py | Python | auxiliary/summon/php-web.py | Qmeimei10086/T-BOX | 5ca58311861b121fd337d26412e0f6ba8200ab66 | [
"MIT"
] | 5 | 2020-07-17T03:13:49.000Z | 2021-07-26T14:17:15.000Z | auxiliary/summon/php-web.py | Qmeimei10086/T-BOX | 5ca58311861b121fd337d26412e0f6ba8200ab66 | [
"MIT"
] | null | null | null | auxiliary/summon/php-web.py | Qmeimei10086/T-BOX | 5ca58311861b121fd337d26412e0f6ba8200ab66 | [
"MIT"
] | 2 | 2020-09-28T14:46:26.000Z | 2021-04-26T07:42:07.000Z | import os
password = '123456'
def summon_php(password):
f = open('shell.txt','w')
f.write("<?php @eval($_POST['")
f.write(password)
f.write("']); ?>")
f.close()
os.rename('shell.txt','shell.php')
print('[*]生成完毕 R > /shell.php',' password: '+password)
while True:
... | 26.317073 | 76 | 0.39481 | import os
password = '123456'
def summon_php(password):
f = open('shell.txt','w')
f.write("<?php @eval($_POST['")
f.write(password)
f.write("']); ?>")
f.close()
os.rename('shell.txt','shell.php')
print('[*]生成完毕 R > /shell.php',' password: '+password)
while True:
... | true | true |
1c42382591392e7525836c3f91d1ee5694ec9c32 | 1,011 | py | Python | var/spack/repos/builtin/packages/atom-dft/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/atom-dft/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/atom-dft/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 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)
from spack import *
class AtomDft(MakefilePackage):
"""ATOM is a program for DFT calculations in atoms and pseudopot... | 30.636364 | 94 | 0.664688 |
from spack import *
class AtomDft(MakefilePackage):
homepage = "https://departments.icmab.es/leem/siesta/Pseudopotentials/"
url = "https://departments.icmab.es/leem/siesta/Pseudopotentials/Code/atom-4.2.6.tgz"
version('4.2.6', 'c0c80cf349f951601942ed6c7cb0256b')
depends_on('libgridxc')
... | true | true |
1c42387b1ebfe6056c5b893f540ce5c174057639 | 4,234 | py | Python | todo_django/todo_django/settings.py | danjac/todo-djember | 7fcfc644c73b702ae9e18a9a27bea0b075fea187 | [
"MIT"
] | 2 | 2016-12-08T11:24:54.000Z | 2017-03-18T04:36:35.000Z | todo_django/todo_django/settings.py | danjac/todo-djember | 7fcfc644c73b702ae9e18a9a27bea0b075fea187 | [
"MIT"
] | null | null | null | todo_django/todo_django/settings.py | danjac/todo-djember | 7fcfc644c73b702ae9e18a9a27bea0b075fea187 | [
"MIT"
] | null | null | null | """
Django settings for todo_django project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import o... | 27.316129 | 91 | 0.709258 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'ry%8!dfeiilht!0!da0h29!y4tnnzu8qe6%79bsy4i(_nb%k(u'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c4239313b0fb16df0db4b986bf039eafabbb42e | 217 | py | Python | Pacote download/Exercicios/custo da viagem.py | Henrique-GM/Exercicios_de_Python | 8cbbcaa31fc19e467576ab21ba3458d67052c40b | [
"Unlicense"
] | null | null | null | Pacote download/Exercicios/custo da viagem.py | Henrique-GM/Exercicios_de_Python | 8cbbcaa31fc19e467576ab21ba3458d67052c40b | [
"Unlicense"
] | null | null | null | Pacote download/Exercicios/custo da viagem.py | Henrique-GM/Exercicios_de_Python | 8cbbcaa31fc19e467576ab21ba3458d67052c40b | [
"Unlicense"
] | null | null | null | viagem = float(input('Digite a distância da viagem em KM: '))
if viagem <= 200:
print('O valor cobrado será: {:.2f}$'.format(viagem * 0.50))
else:
print('O valor cobrado será: {:.2f}$'.format(viagem * 0.45)) | 31 | 64 | 0.631336 | viagem = float(input('Digite a distância da viagem em KM: '))
if viagem <= 200:
print('O valor cobrado será: {:.2f}$'.format(viagem * 0.50))
else:
print('O valor cobrado será: {:.2f}$'.format(viagem * 0.45)) | true | true |
1c42399e0db35b1c24761a4d2384b6a7728a5989 | 588 | py | Python | bin/get_data_urls.py | peterhil/ninhursag | 582133ae51e98b2e4272d6a78794b08aed845960 | [
"MIT"
] | 4 | 2015-05-24T20:39:54.000Z | 2021-06-23T06:48:23.000Z | bin/get_data_urls.py | peterhil/ninhursag | 582133ae51e98b2e4272d6a78794b08aed845960 | [
"MIT"
] | 10 | 2021-03-23T01:11:49.000Z | 2021-06-22T23:58:36.000Z | bin/get_data_urls.py | peterhil/ninhursag | 582133ae51e98b2e4272d6a78794b08aed845960 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 mode: python -*-
import urllib.request
from bs4 import BeautifulSoup
url = 'https://www.usgs.gov/centers/nmic/historical-statistics-mineral-and-material-commodities-united-states'
with urllib.request.urlopen(url) as response:
page = response.read()
soup = BeautifulSoup... | 26.727273 | 110 | 0.659864 |
import urllib.request
from bs4 import BeautifulSoup
url = 'https://www.usgs.gov/centers/nmic/historical-statistics-mineral-and-material-commodities-united-states'
with urllib.request.urlopen(url) as response:
page = response.read()
soup = BeautifulSoup(page, 'html.parser')
trs = soup.select('tr')
for tr in ... | true | true |
1c423aacb2531aad54f0c1359c050aa5b046564a | 5,270 | py | Python | neurokit2/rsp/rsp_eventrelated.py | aristotelisxs/NeuroKit | 61c8c9b26ac7bc8ac5b666ce6cb1dfe59b1c146b | [
"MIT"
] | 1 | 2020-12-31T17:48:11.000Z | 2020-12-31T17:48:11.000Z | neurokit2/rsp/rsp_eventrelated.py | aristotelisxs/NeuroKit | 61c8c9b26ac7bc8ac5b666ce6cb1dfe59b1c146b | [
"MIT"
] | null | null | null | neurokit2/rsp/rsp_eventrelated.py | aristotelisxs/NeuroKit | 61c8c9b26ac7bc8ac5b666ce6cb1dfe59b1c146b | [
"MIT"
] | 1 | 2020-12-20T17:24:25.000Z | 2020-12-20T17:24:25.000Z | # -*- coding: utf-8 -*-
from warnings import warn
import numpy as np
from ..epochs.eventrelated_utils import (
_eventrelated_addinfo,
_eventrelated_rate,
_eventrelated_sanitizeinput,
_eventrelated_sanitizeoutput,
)
from ..misc import NeuroKitWarning
def rsp_eventrelated(epochs, silent=False):
""... | 35.133333 | 105 | 0.627135 |
from warnings import warn
import numpy as np
from ..epochs.eventrelated_utils import (
_eventrelated_addinfo,
_eventrelated_rate,
_eventrelated_sanitizeinput,
_eventrelated_sanitizeoutput,
)
from ..misc import NeuroKitWarning
def rsp_eventrelated(epochs, silent=False):
epochs = _eventrelat... | true | true |
1c423aad6f7ea469c32c1c28202143fc23d66473 | 12,918 | py | Python | apprise/plugins/NotifyNexmo.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 4,764 | 2018-02-02T18:17:06.000Z | 2022-03-31T20:41:13.000Z | apprise/plugins/NotifyNexmo.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 504 | 2017-11-26T15:56:14.000Z | 2022-03-31T22:38:49.000Z | apprise/plugins/NotifyNexmo.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 217 | 2018-05-22T14:29:20.000Z | 2022-03-28T06:24:46.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files(the "Software"), to deal
# in th... | 33.466321 | 79 | 0.542963 |
import requests
from .NotifyBase import NotifyBase
from ..URLBase import PrivacyMode
from ..common import NotifyType
from ..utils import is_phone_no
from ..utils import parse_phone_no
from ..utils import validate_regex
from ..AppriseLocale import gettext_lazy as _
class NotifyNexmo(Noti... | true | true |
1c423ab64dfbb1ededc7018e40988e7380610cec | 3,421 | py | Python | EfficientGCNv1/utils/tracking/deepsort/deep/model.py | myatthukyaw/res_efficient_gcns | 89280d10f1d4864dfa0a5c3813db11e074dcb2f2 | [
"MIT"
] | null | null | null | EfficientGCNv1/utils/tracking/deepsort/deep/model.py | myatthukyaw/res_efficient_gcns | 89280d10f1d4864dfa0a5c3813db11e074dcb2f2 | [
"MIT"
] | null | null | null | EfficientGCNv1/utils/tracking/deepsort/deep/model.py | myatthukyaw/res_efficient_gcns | 89280d10f1d4864dfa0a5c3813db11e074dcb2f2 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
def __init__(self, c_in, c_out, is_downsample=False):
super(BasicBlock, self).__init__()
self.is_downsample = is_downsample
if is_downsample:
self.conv1 = nn.Conv2d(
... | 31.1 | 77 | 0.504239 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
def __init__(self, c_in, c_out, is_downsample=False):
super(BasicBlock, self).__init__()
self.is_downsample = is_downsample
if is_downsample:
self.conv1 = nn.Conv2d(
... | true | true |
1c423b8b7b57531cefb41a87ab4a95bea00517a7 | 7,780 | py | Python | src/losses/lovasz.py | vpeopleonatank/segmentation | 6c93e14f465117ca1818e7d9cdd95ffc37e15f45 | [
"MIT"
] | null | null | null | src/losses/lovasz.py | vpeopleonatank/segmentation | 6c93e14f465117ca1818e7d9cdd95ffc37e15f45 | [
"MIT"
] | null | null | null | src/losses/lovasz.py | vpeopleonatank/segmentation | 6c93e14f465117ca1818e7d9cdd95ffc37e15f45 | [
"MIT"
] | null | null | null | # type: ignore
"""
Lovasz-Softmax and Jaccard hinge loss in PyTorch
Maxim Berman 2018 ESAT-PSI KU Leuven (MIT License)
"""
from __future__ import print_function, division
from typing import Optional
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.modules.loss import _Los... | 34.122807 | 112 | 0.621465 |
from __future__ import print_function, division
from typing import Optional
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.modules.loss import _Loss
from .constants import BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE
try:
from itertools import ifilterfalse
except... | true | true |
1c423d1db13036f9e4d5254adda577280f573f86 | 90 | py | Python | algorithms/algorithm.py | songheony/oplp | 7947fec7c0cf84d327c5bb3406e5dfd465e82a10 | [
"MIT"
] | null | null | null | algorithms/algorithm.py | songheony/oplp | 7947fec7c0cf84d327c5bb3406e5dfd465e82a10 | [
"MIT"
] | null | null | null | algorithms/algorithm.py | songheony/oplp | 7947fec7c0cf84d327c5bb3406e5dfd465e82a10 | [
"MIT"
] | null | null | null | class Algorithm:
def update(self, *args, **kwargs):
raise NotImplementedError
| 22.5 | 38 | 0.677778 | class Algorithm:
def update(self, *args, **kwargs):
raise NotImplementedError
| true | true |
1c423d68a9156819e5928c17fa91da75b8ce1ef1 | 4,341 | py | Python | src/inverse_text_normalization/ori/taggers/money.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 15 | 2021-07-30T18:18:47.000Z | 2022-02-14T09:04:19.000Z | src/inverse_text_normalization/ori/taggers/money.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 1 | 2021-12-15T12:42:12.000Z | 2022-02-15T05:33:00.000Z | src/inverse_text_normalization/ori/taggers/money.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 4 | 2021-07-30T10:03:38.000Z | 2021-12-01T14:46:54.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 37.747826 | 116 | 0.646164 |
from inverse_text_normalization.ori.data_loader_utils import get_abs_path
from inverse_text_normalization.ori.graph_utils import (
NEMO_DIGIT,
NEMO_SIGMA,
GraphFst,
convert_space,
delete_extra_space,
delete_space,
get_singulars,
insert_space,
)
try:
import pynini
f... | true | true |
1c423fb9b382926c97effb864db3316e9698d827 | 2,137 | py | Python | data/local_news_data/baltimore_sun/loader.py | tpsatish95/covid19-search-engine | e09ae172216e204f5efc284ead99d17b4461e159 | [
"Apache-2.0"
] | 1 | 2020-06-14T16:52:55.000Z | 2020-06-14T16:52:55.000Z | data/local_news_data/baltimore_sun/loader.py | tpsatish95/covid19-search-engine | e09ae172216e204f5efc284ead99d17b4461e159 | [
"Apache-2.0"
] | 1 | 2020-05-06T14:28:10.000Z | 2020-05-06T14:28:10.000Z | data/local_news_data/baltimore_sun/loader.py | tpsatish95/covid19-search-engine | e09ae172216e204f5efc284ead99d17b4461e159 | [
"Apache-2.0"
] | null | null | null | import os
import re
from collections import defaultdict
from nltk.tokenize import word_tokenize
from data.template import Dataset, Document, Text
class BaltimoreSunCovidDataset(Dataset):
def __init__(self, base_path):
self.base_path = base_path
self.documents = None
super().__init__()
... | 31.895522 | 96 | 0.552644 | import os
import re
from collections import defaultdict
from nltk.tokenize import word_tokenize
from data.template import Dataset, Document, Text
class BaltimoreSunCovidDataset(Dataset):
def __init__(self, base_path):
self.base_path = base_path
self.documents = None
super().__init__()
... | true | true |
1c4240229e4a83fba94c99ce1dbe3f737b8b1fda | 3,026 | py | Python | examples/NN/1_MNIST/mnist_mlp_initializers.py | deephealthproject/pyeddl | a6c304b7cec2b342aa84a7b3ace2d91c69ad5a84 | [
"MIT"
] | 8 | 2020-02-28T06:39:17.000Z | 2022-02-01T09:59:51.000Z | examples/NN/1_MNIST/mnist_mlp_initializers.py | deephealthproject/pyeddl | a6c304b7cec2b342aa84a7b3ace2d91c69ad5a84 | [
"MIT"
] | 26 | 2019-10-30T10:53:21.000Z | 2022-02-17T08:56:37.000Z | examples/NN/1_MNIST/mnist_mlp_initializers.py | deephealthproject/pyeddl | a6c304b7cec2b342aa84a7b3ace2d91c69ad5a84 | [
"MIT"
] | 4 | 2019-10-17T07:48:37.000Z | 2022-02-03T10:04:37.000Z | # Copyright (c) 2019-2021 CRS4
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribut... | 34.781609 | 79 | 0.692333 |
import argparse
import sys
import pyeddl.eddl as eddl
from pyeddl.tensor import Tensor
MEM_CHOICES = ("low_mem", "mid_mem", "full_mem")
def main(args):
eddl.download_mnist()
num_classes = 10
in_ = eddl.Input([784])
layer = in_
layer = eddl.ReLu(eddl.GlorotNormal(eddl.Den... | true | true |
1c424050ab858e63b10d2aa80a83c2f500499ff2 | 9,734 | py | Python | instruction_env/Lib/site-packages/sphinx/transforms/post_transforms/__init__.py | hanhtong/Effective-Instructions- | a1766f300c4e613b4ce10e9b6eae1b14e43c7d60 | [
"MIT"
] | 3 | 2021-07-30T19:07:06.000Z | 2021-08-28T19:35:40.000Z | instruction_env/Lib/site-packages/sphinx/transforms/post_transforms/__init__.py | hanhtong/Effective-Instructions- | a1766f300c4e613b4ce10e9b6eae1b14e43c7d60 | [
"MIT"
] | 7 | 2020-12-04T04:10:42.000Z | 2021-03-16T00:53:09.000Z | env/lib/python3.9/site-packages/sphinx/transforms/post_transforms/__init__.py | simotwo/AbileneParadox-ddd | c85961efb37aba43c0d99ed1c36d083507e2b2d3 | [
"MIT"
] | 1 | 2021-01-20T01:58:53.000Z | 2021-01-20T01:58:53.000Z | """
sphinx.transforms.post_transforms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Docutils transforms used by Sphinx.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from typing import Any, Dict, List, Optional, Tuple, Type, cast
from docutils i... | 41.776824 | 92 | 0.581981 |
from typing import Any, Dict, List, Optional, Tuple, Type, cast
from docutils import nodes
from docutils.nodes import Element
from sphinx import addnodes
from sphinx.addnodes import pending_xref
from sphinx.application import Sphinx
from sphinx.domains import Domain
from sphinx.errors import NoUri
from sphinx.locale... | true | true |
1c42409c2dcd2bc7895d7d82bdf7f199c13bfae3 | 4,020 | py | Python | Python_3.6/ANN_class/ANN.py | Eclipse-Dominator/machine_learning_ANN_python | cb65b1ed6d62544ee8eaa749fb64fa5d3e792f76 | [
"MIT"
] | 1 | 2018-02-07T11:10:39.000Z | 2018-02-07T11:10:39.000Z | Python_3.6/ANN_class/ANN.py | Eclipse-Dominator/machine_learning_ANN_python | cb65b1ed6d62544ee8eaa749fb64fa5d3e792f76 | [
"MIT"
] | 1 | 2018-02-07T11:10:31.000Z | 2018-02-07T11:10:31.000Z | Python_3.6/ANN_class/ANN.py | Eclipse-Dominator/machine_learning_ANN_python | cb65b1ed6d62544ee8eaa749fb64fa5d3e792f76 | [
"MIT"
] | 1 | 2018-03-11T15:07:10.000Z | 2018-03-11T15:07:10.000Z | import numpy as np
# Artificial Neural Network
class ANN:
def __init__(self, layer_size_list):
self.input_size = layer_size_list[0]
self.hidden_output_layer = []
self.cost_result = []
self.accuracy_result = []
for layer_index in range(1, len(layer_size_list)):
self.hidden_output_layer.append( NNlayer( lay... | 42.315789 | 142 | 0.765672 | import numpy as np
class ANN:
def __init__(self, layer_size_list):
self.input_size = layer_size_list[0]
self.hidden_output_layer = []
self.cost_result = []
self.accuracy_result = []
for layer_index in range(1, len(layer_size_list)):
self.hidden_output_layer.append( NNlayer( layer_size_list[layer_index - ... | true | true |
1c4240c3a65bca5c805f1ae7a103998ad6bb6f55 | 2,212 | py | Python | tests/sparkml/test_bucketed_random_projection_lsh.py | xhochy/onnxmltools | cb2782b155ff67dc1e586f36a27c5d032070c801 | [
"Apache-2.0"
] | null | null | null | tests/sparkml/test_bucketed_random_projection_lsh.py | xhochy/onnxmltools | cb2782b155ff67dc1e586f36a27c5d032070c801 | [
"Apache-2.0"
] | null | null | null | tests/sparkml/test_bucketed_random_projection_lsh.py | xhochy/onnxmltools | cb2782b155ff67dc1e586f36a27c5d032070c801 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
import sys
import unittest
import pandas
import numpy
from pyspark.ml.feature import BucketedRandomProjectionLSH
from pyspark.ml.linalg import Vectors
from onnxmltools import convert_sparkml
from onnxmltools.convert.common.data_types import FloatTensorType
from tests.sparkml.spark... | 40.962963 | 111 | 0.648282 |
import sys
import unittest
import pandas
import numpy
from pyspark.ml.feature import BucketedRandomProjectionLSH
from pyspark.ml.linalg import Vectors
from onnxmltools import convert_sparkml
from onnxmltools.convert.common.data_types import FloatTensorType
from tests.sparkml.sparkml_test_utils import save_data_models... | true | true |
1c4245ef50b820bbed08ca2fb090aa1c3a77795b | 3,699 | py | Python | python/lib/lib_care/utils/chunk_traj.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | python/lib/lib_care/utils/chunk_traj.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | python/lib/lib_care/utils/chunk_traj.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | #compute_traj.py
from ..my_initialization import *
from . import *
def chunk_traj(df,pid_lst,width,height, DS, DT, jump_thresh=10., distance_L2_pbc=None, LT_thresh=1, **kwargs):
# d_lst = []
chunk_index=1
if distance_L2_pbc is None:
distance_L2_pbc = get_distance_L2_pbc(width=width,height=height)
... | 48.038961 | 168 | 0.583671 |
from ..my_initialization import *
from . import *
def chunk_traj(df,pid_lst,width,height, DS, DT, jump_thresh=10., distance_L2_pbc=None, LT_thresh=1, **kwargs):
chunk_index=1
if distance_L2_pbc is None:
distance_L2_pbc = get_distance_L2_pbc(width=width,height=height)
for pid in pid_lst:
... | true | true |
1c42466f12034657d3309d69a4856592d9ec39cb | 27,467 | py | Python | onmt/model_builder.py | mataney/encoder-agnostic-adaptation | 59d7c2d4fe69f794c7449f0459f00350fcfbbf70 | [
"MIT"
] | 2 | 2020-01-18T02:07:25.000Z | 2020-04-16T23:19:03.000Z | onmt/model_builder.py | mataney/encoder-agnostic-adaptation | 59d7c2d4fe69f794c7449f0459f00350fcfbbf70 | [
"MIT"
] | null | null | null | onmt/model_builder.py | mataney/encoder-agnostic-adaptation | 59d7c2d4fe69f794c7449f0459f00350fcfbbf70 | [
"MIT"
] | 1 | 2020-01-22T04:01:42.000Z | 2020-01-22T04:01:42.000Z | """
This file is for models creation, which consults options
and creates each encoder and decoder accordingly.
"""
import re
import math
import copy
import torch
import torch.nn as nn
from torch.nn.init import xavier_uniform_
import onmt.inputters as inputters
import onmt.modules
from onmt.encoders import str2enc
fro... | 44.807504 | 227 | 0.545891 | import re
import math
import copy
import torch
import torch.nn as nn
from torch.nn.init import xavier_uniform_
import onmt.inputters as inputters
import onmt.modules
from onmt.encoders import str2enc
from onmt.decoders import str2dec
from onmt.modules import Embeddings, CopyGenerator, SimpleFusionGenerator
from onmt... | true | true |
1c4246c3000494cc4c4d7a4c26fd49406dd8cde8 | 3,398 | py | Python | dev/local/data/source.py | LaurenSpiegel/fastai_docs | 4fe6b62116d88dea9610548133e6cadb6b260a73 | [
"Apache-2.0"
] | null | null | null | dev/local/data/source.py | LaurenSpiegel/fastai_docs | 4fe6b62116d88dea9610548133e6cadb6b260a73 | [
"Apache-2.0"
] | null | null | null | dev/local/data/source.py | LaurenSpiegel/fastai_docs | 4fe6b62116d88dea9610548133e6cadb6b260a73 | [
"Apache-2.0"
] | null | null | null | #AUTOGENERATED! DO NOT EDIT! File to edit: dev/05_data_source.ipynb (unless otherwise specified).
__all__ = ['DataSource', 'DsrcSubset', 'DsrcSubset']
from ..imports import *
from ..test import *
from ..core import *
from .core import *
from .pipeline import *
from ..notebook.showdoc import show_doc
@docs
class Data... | 44.12987 | 99 | 0.64744 |
__all__ = ['DataSource', 'DsrcSubset', 'DsrcSubset']
from ..imports import *
from ..test import *
from ..core import *
from .core import *
from .pipeline import *
from ..notebook.showdoc import show_doc
@docs
class DataSource(PipedList):
def __init__(self, items, tfms=None, filts=None):
if filts is None... | true | true |
1c424705772097a3c80a8562483cdfce635a7dd3 | 403 | py | Python | mayan/apps/common/tests/test_api.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/common/tests/test_api.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/common/tests/test_api.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | from rest_framework import status
from mayan.apps.rest_api.tests.base import BaseAPITestCase
from .mixins import CommonAPITestMixin
class CommonAPITestCase(CommonAPITestMixin, BaseAPITestCase):
auto_login_user = False
def test_content_type_list_api_view(self):
response = self._request_content_type_... | 28.785714 | 66 | 0.808933 | from rest_framework import status
from mayan.apps.rest_api.tests.base import BaseAPITestCase
from .mixins import CommonAPITestMixin
class CommonAPITestCase(CommonAPITestMixin, BaseAPITestCase):
auto_login_user = False
def test_content_type_list_api_view(self):
response = self._request_content_type_... | true | true |
1c4247727af42b6f5aaf853eecedbf57120e3803 | 2,415 | py | Python | checkmerge/analysis/report.py | jjkester/checkmerge | 23d1d9982cd7dc333b5748be3415e9b92f6576f4 | [
"Apache-2.0"
] | 1 | 2019-06-16T07:57:15.000Z | 2019-06-16T07:57:15.000Z | checkmerge/analysis/report.py | jjkester/checkmerge | 23d1d9982cd7dc333b5748be3415e9b92f6576f4 | [
"Apache-2.0"
] | null | null | null | checkmerge/analysis/report.py | jjkester/checkmerge | 23d1d9982cd7dc333b5748be3415e9b92f6576f4 | [
"Apache-2.0"
] | null | null | null | import collections
import itertools
import typing
from checkmerge import analysis, report
class AnalysisResultMaxSeverityMetric(report.Metric):
"""
Metric for the maximum analysis result severity within a type.
"""
name = 'Max. severity'
low = .5
high = 1.5
def __init__(self, items: typi... | 31.776316 | 111 | 0.677847 | import collections
import itertools
import typing
from checkmerge import analysis, report
class AnalysisResultMaxSeverityMetric(report.Metric):
name = 'Max. severity'
low = .5
high = 1.5
def __init__(self, items: typing.List[analysis.AnalysisResult]):
value = max((item.severity for item in i... | true | true |
1c42484dfb1349b7f128742b125618ab7f66f4ea | 553 | py | Python | _singleActions-AsScripts/04_AnalyzePhotos.py | campbell-ja/MetashapePythonScripts | b4a54e49558a8a7d1c5dc2327f878a8c354bbe58 | [
"CC0-1.0"
] | 4 | 2021-06-17T03:06:19.000Z | 2022-02-08T17:39:29.000Z | _singleActions-AsScripts/04_AnalyzePhotos.py | campbell-ja/MetashapePythonScripts | b4a54e49558a8a7d1c5dc2327f878a8c354bbe58 | [
"CC0-1.0"
] | null | null | null | _singleActions-AsScripts/04_AnalyzePhotos.py | campbell-ja/MetashapePythonScripts | b4a54e49558a8a7d1c5dc2327f878a8c354bbe58 | [
"CC0-1.0"
] | null | null | null | # This script created by Joseph Aaron Campbell - 10/2020
""" Set up Working Environment """
# import Metashape library module
import Metashape
# create a reference to the current project via Document Class
doc = Metashape.app.document
# set reference for the currently active chunk
activeChunk = Metashape.app.d... | 39.5 | 82 | 0.772152 |
import Metashape
doc = Metashape.app.document
activeChunk = Metashape.app.document.chunk
activeChunk.analyzePhotos() | true | true |
1c424a3c4b56515039f7ae7f528464de549d5d37 | 2,216 | py | Python | py-code/nmrvar.py | alvicler/python-nmr | 7b68275f0e1e8dd85622a6b796dc618eb5ac3e62 | [
"BSD-3-Clause"
] | null | null | null | py-code/nmrvar.py | alvicler/python-nmr | 7b68275f0e1e8dd85622a6b796dc618eb5ac3e62 | [
"BSD-3-Clause"
] | null | null | null | py-code/nmrvar.py | alvicler/python-nmr | 7b68275f0e1e8dd85622a6b796dc618eb5ac3e62 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import nmrglue as ng
import sys
import numpy as np
import pandas as pd
get_ipython().run_line_magic('matplotlib', 'qt5')
import matplotlib.pyplot as plt
#import matplotlib
#print('Python version ' + sys.version)
#print('Pandas version ' + pd.__version__)
#print('Matplo... | 22.845361 | 77 | 0.570397 |
import nmrglue as ng
import sys
import numpy as np
import pandas as pd
get_ipython().run_line_magic('matplotlib', 'qt5')
import matplotlib.pyplot as plt
import os
samples = len(os.listdir('urine'))
this = sys.modules[__name__]
def find_nearest(array, value):
array = np.asarray(array)
idx = (np.abs... | true | true |
1c424ae2b5a7e4f8cc44cdee482b49da3c0d31b5 | 1,622 | py | Python | backend/course/api/v1/serializers.py | crowdbotics-apps/suraj-30223 | 1830a1c3dcd5ca56e817ec2dd110778c5ab1feb4 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/course/api/v1/serializers.py | crowdbotics-apps/suraj-30223 | 1830a1c3dcd5ca56e817ec2dd110778c5ab1feb4 | [
"FTL",
"AML",
"RSA-MD"
] | 8 | 2021-09-05T22:19:20.000Z | 2021-10-06T13:40:50.000Z | backend/course/api/v1/serializers.py | crowdbotics-apps/suraj-30223 | 1830a1c3dcd5ca56e817ec2dd110778c5ab1feb4 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from rest_framework import serializers
from course.models import (
PaymentMethod,
Recording,
Category,
Lesson,
Enrollment,
SubscriptionType,
Module,
Group,
Course,
Subscription,
Event,
)
class ModuleSerializer(serializers.ModelSerializer):
class Meta:
model = Mo... | 20.024691 | 62 | 0.673859 | from rest_framework import serializers
from course.models import (
PaymentMethod,
Recording,
Category,
Lesson,
Enrollment,
SubscriptionType,
Module,
Group,
Course,
Subscription,
Event,
)
class ModuleSerializer(serializers.ModelSerializer):
class Meta:
model = Mo... | true | true |
1c424b51f87ee9c16ce3ceab130d2364d060ec6d | 80 | py | Python | main/passport/__init__.py | anvarliorxan/task1 | 39c5a42c174adce16b0ddbbde4692ebd510d5cb2 | [
"MIT"
] | null | null | null | main/passport/__init__.py | anvarliorxan/task1 | 39c5a42c174adce16b0ddbbde4692ebd510d5cb2 | [
"MIT"
] | null | null | null | main/passport/__init__.py | anvarliorxan/task1 | 39c5a42c174adce16b0ddbbde4692ebd510d5cb2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
default_app_config = 'main.passport.apps.PassportConfig' | 40 | 56 | 0.725 |
default_app_config = 'main.passport.apps.PassportConfig' | true | true |
1c424bcf1e1344e55e8c40bcca6a160fb609ccc7 | 7,626 | py | Python | examples/gensen_util.py | goel96vibhor/AdvSentEval | c23684c5f9da905517071361fdb40acf194cd608 | [
"BSD-3-Clause"
] | 2 | 2018-12-19T22:06:22.000Z | 2019-01-29T16:59:31.000Z | examples/gensen_util.py | goel96vibhor/AdvSentEval | c23684c5f9da905517071361fdb40acf194cd608 | [
"BSD-3-Clause"
] | null | null | null | examples/gensen_util.py | goel96vibhor/AdvSentEval | c23684c5f9da905517071361fdb40acf194cd608 | [
"BSD-3-Clause"
] | 2 | 2019-02-10T22:40:43.000Z | 2019-04-03T06:16:33.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
"""
Clone GenSen repo here: https://github.com/Maluuba/gensen.git
And follow instructions for loading the model used in batcher... | 32.589744 | 123 | 0.621558 |
from __future__ import absolute_import, division, unicode_literals
import sys
import logging
from gensen import GenSen, GenSenSingle
import gensen
import numpy as np
PATH_TO_SENTEVAL = '../'
PATH_TO_DATA = '../data'
PATH_TO_VEC = 'fasttext/crawl-300d-2M.vec'
sys.path.insert(0, PATH_TO_SENTEVAL)
import ... | true | true |
1c424c5b0f0ac998a7628cfec79e85809197b4fa | 439 | py | Python | setup.py | Kailiangdong/hgail | a668c4dda09d4e7f85b4640f42ff57b6764d24cc | [
"MIT"
] | 24 | 2018-03-16T22:29:16.000Z | 2021-11-12T07:33:28.000Z | setup.py | Kailiangdong/hgail | a668c4dda09d4e7f85b4640f42ff57b6764d24cc | [
"MIT"
] | 2 | 2018-06-29T06:37:46.000Z | 2018-08-06T01:02:13.000Z | setup.py | Kailiangdong/hgail | a668c4dda09d4e7f85b4640f42ff57b6764d24cc | [
"MIT"
] | 15 | 2018-07-30T16:46:07.000Z | 2022-03-13T06:24:11.000Z | from setuptools import setup
setup(name='hgail',
version='0.1',
description='Generative Adversarial Imitation Learning',
author='Blake Wulfe',
author_email='wulfebw@stanford.edu',
license='MIT',
packages=['hgail'],
zip_safe=False,
install_requires=[
'numpy',
... | 23.105263 | 62 | 0.553531 | from setuptools import setup
setup(name='hgail',
version='0.1',
description='Generative Adversarial Imitation Learning',
author='Blake Wulfe',
author_email='wulfebw@stanford.edu',
license='MIT',
packages=['hgail'],
zip_safe=False,
install_requires=[
'numpy',
... | true | true |
1c424ce98abcf0f737bebde30fff739a28e3c53b | 2,806 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.515152 | 129 | 0.705987 |
from typing import Any, Optional, TYPE_CHECKING
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer
if TYPE_CHECKING:
from azure.core.credentials_async import AsyncTokenCredential
from ._configuration import MonitorManagementClientConfiguration
from .operat... | true | true |
1c424d2b0340b27ca4ef99b29114c2e41034020c | 6,816 | py | Python | scipy/linalg/decomp_lu.py | magnusja/scipy | c4a5a1f984e28840010f20a7e41caa21b8f41979 | [
"FSFAP"
] | 366 | 2019-04-07T20:34:48.000Z | 2022-03-29T07:35:38.000Z | scipy/linalg/decomp_lu.py | magnusja/scipy | c4a5a1f984e28840010f20a7e41caa21b8f41979 | [
"FSFAP"
] | 26 | 2020-03-24T18:07:06.000Z | 2022-03-12T00:12:27.000Z | scipy/linalg/decomp_lu.py | magnusja/scipy | c4a5a1f984e28840010f20a7e41caa21b8f41979 | [
"FSFAP"
] | 61 | 2019-04-08T00:58:14.000Z | 2022-03-20T23:04:28.000Z | """LU decomposition functions."""
from __future__ import division, print_function, absolute_import
from warnings import warn
from numpy import asarray, asarray_chkfinite
# Local imports
from .misc import _datacopied, LinAlgWarning
from .lapack import get_lapack_funcs
from .flinalg import get_flinalg_funcs
__all__ ... | 30.293333 | 79 | 0.591256 |
from __future__ import division, print_function, absolute_import
from warnings import warn
from numpy import asarray, asarray_chkfinite
from .misc import _datacopied, LinAlgWarning
from .lapack import get_lapack_funcs
from .flinalg import get_flinalg_funcs
__all__ = ['lu', 'lu_solve', 'lu_factor']
def lu_factor... | true | true |
1c424d733b42474c1db1ce3755a624674fd7d334 | 221 | py | Python | src/diamond/error.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 6 | 2015-04-13T21:24:24.000Z | 2020-05-11T07:43:05.000Z | src/diamond/error.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 3 | 2015-09-11T16:29:54.000Z | 2016-05-18T15:31:54.000Z | src/diamond/error.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 13 | 2015-01-11T12:10:45.000Z | 2021-01-27T10:55:02.000Z | # coding=utf-8
class DiamondException(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message
def __repr__(self):
return self.message
| 17 | 34 | 0.647059 |
class DiamondException(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message
def __repr__(self):
return self.message
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.