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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c29296030d03cdaaea08e55950d1af28c3a339a | 20,564 | py | Python | tests/cupyx_tests/fallback_mode_tests/test_fallback.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | null | null | null | tests/cupyx_tests/fallback_mode_tests/test_fallback.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | 54 | 2018-04-26T04:55:40.000Z | 2022-03-15T05:26:47.000Z | tests/cupyx_tests/fallback_mode_tests/test_fallback.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | null | null | null | import functools
import operator
import unittest
import numpy
import pytest
import cupy
from cupy import testing
from cupyx import fallback_mode
from cupyx.fallback_mode import fallback
from cupyx.fallback_mode.notification import FallbackWarning
ignore_fallback_warnings = pytest.mark.filterwarnings(
"ignore", ... | 30.646796 | 79 | 0.604843 | import functools
import operator
import unittest
import numpy
import pytest
import cupy
from cupy import testing
from cupyx import fallback_mode
from cupyx.fallback_mode import fallback
from cupyx.fallback_mode.notification import FallbackWarning
ignore_fallback_warnings = pytest.mark.filterwarnings(
"ignore", ... | true | true |
1c2929f93171923c2d68c466582fb8d76f0032eb | 1,354 | py | Python | boundary_layer_default_plugin/plugin.py | jcraver1021/boundary-layer | 6b3fe2d61c6ef8b7b42fbed3583664106a9e310f | [
"Apache-2.0"
] | 252 | 2018-11-06T01:56:31.000Z | 2022-03-27T14:46:34.000Z | boundary_layer_default_plugin/plugin.py | jcraver1021/boundary-layer | 6b3fe2d61c6ef8b7b42fbed3583664106a9e310f | [
"Apache-2.0"
] | 94 | 2018-11-06T14:41:27.000Z | 2021-11-01T18:56:33.000Z | boundary_layer_default_plugin/plugin.py | jcraver1021/boundary-layer | 6b3fe2d61c6ef8b7b42fbed3583664106a9e310f | [
"Apache-2.0"
] | 59 | 2018-11-03T14:31:33.000Z | 2021-07-13T17:14:00.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 Etsy Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 30.772727 | 78 | 0.737814 |
import os
from boundary_layer.plugins import BasePlugin, PluginPriority
from .oozie_plugin import DefaultOozieParserPlugin
from .preprocessors import (
BuildTimedelta,
DateStringToDatetime,
EnsureRenderedStringPattern,
KubernetesPrep,
PubsubMessageDataToBinaryString,
StringifyObject)
class De... | true | true |
1c292c1ddbaa86af0ce56be66ff1bb89d5d2ab2d | 1,106 | py | Python | Snippets/Scripts/greek letters.py | martin-azpillaga/Matex | ed1d6ee40dbb7c15eb27e5296fbd61feeb13fc58 | [
"Apache-2.0"
] | null | null | null | Snippets/Scripts/greek letters.py | martin-azpillaga/Matex | ed1d6ee40dbb7c15eb27e5296fbd61feeb13fc58 | [
"Apache-2.0"
] | null | null | null | Snippets/Scripts/greek letters.py | martin-azpillaga/Matex | ed1d6ee40dbb7c15eb27e5296fbd61feeb13fc58 | [
"Apache-2.0"
] | null | null | null | import os
def main():
lowercase = ["alpha","beta","gamma","delta","epsilon","zeta","eta","theta",
"kappa","iota","lambda","mu","nu","xi","omicron","pi","rho","sigma","tau","upsilon",
"phi","chi","psi","omega"]
uppercase = ["Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta"... | 48.086957 | 198 | 0.542495 | import os
def main():
lowercase = ["alpha","beta","gamma","delta","epsilon","zeta","eta","theta",
"kappa","iota","lambda","mu","nu","xi","omicron","pi","rho","sigma","tau","upsilon",
"phi","chi","psi","omega"]
uppercase = ["Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta"... | true | true |
1c292c33410fc32c98990113b9c26505c3787ff9 | 242 | py | Python | blog/admin.py | Abhishek-jangid/Blogger | fb894c166d3ab5823863c4de0beef9c8f6d8cd49 | [
"MIT"
] | null | null | null | blog/admin.py | Abhishek-jangid/Blogger | fb894c166d3ab5823863c4de0beef9c8f6d8cd49 | [
"MIT"
] | null | null | null | blog/admin.py | Abhishek-jangid/Blogger | fb894c166d3ab5823863c4de0beef9c8f6d8cd49 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Post
# Register your models here.
# the Post model was not present in the admin page but by registering the model here
# we can see the model there in admin page
admin.site.register(Post)
| 30.25 | 84 | 0.785124 | from django.contrib import admin
from .models import Post
admin.site.register(Post)
| true | true |
1c292ce84b5262f712ac0783e32e91e8540c9440 | 1,537 | py | Python | proper_parenthetics/test_proper_parenthetics.py | philipwerner/code-katas | 3bdce2b5d12df612e7c8f2e2b8b5ebe16a653712 | [
"MIT"
] | null | null | null | proper_parenthetics/test_proper_parenthetics.py | philipwerner/code-katas | 3bdce2b5d12df612e7c8f2e2b8b5ebe16a653712 | [
"MIT"
] | null | null | null | proper_parenthetics/test_proper_parenthetics.py | philipwerner/code-katas | 3bdce2b5d12df612e7c8f2e2b8b5ebe16a653712 | [
"MIT"
] | null | null | null | """Test module for proper parenthetics."""
import pytest
from proper_parenthetics import parens
def test_error_is_raised_when_invalid_input():
"""."""
x = ''
with pytest.raises(ValueError):
parens(x)
def test_parens_on_balanced_input():
"""Test that a 0 is returned on a balanced string."""
... | 23.646154 | 65 | 0.627846 | import pytest
from proper_parenthetics import parens
def test_error_is_raised_when_invalid_input():
x = ''
with pytest.raises(ValueError):
parens(x)
def test_parens_on_balanced_input():
x = '()'
assert parens(x) == 0
def test_parens_on_balanced_input_2():
x = '((((()))))'
assert pa... | true | true |
1c292cf7e9724348cdb4778bbff3a875fb837669 | 150 | py | Python | ExerciciosPythonMundo2/15. Tabuada Versão 2.0.py | juniorppb/arquivos-python | 25690e9ba65352fc332a0517ef65f1042e44edff | [
"MIT"
] | null | null | null | ExerciciosPythonMundo2/15. Tabuada Versão 2.0.py | juniorppb/arquivos-python | 25690e9ba65352fc332a0517ef65f1042e44edff | [
"MIT"
] | null | null | null | ExerciciosPythonMundo2/15. Tabuada Versão 2.0.py | juniorppb/arquivos-python | 25690e9ba65352fc332a0517ef65f1042e44edff | [
"MIT"
] | null | null | null | tabuada = int(input('Digite um número para ver sua tabuada? '))
for tab in range(1, 11):
print('{} x {:2} = {}'.format(tabuada, tab, tabuada*tab)) | 50 | 63 | 0.633333 | tabuada = int(input('Digite um número para ver sua tabuada? '))
for tab in range(1, 11):
print('{} x {:2} = {}'.format(tabuada, tab, tabuada*tab)) | true | true |
1c292dcdbcb0c5473dd38b184ff896239c449df9 | 7,778 | py | Python | test/tpm_test/crypto_test.py | mmind/servo-chromiumos-ec | bb7b80033561023cd69cef86b00d2faa12fbc7d8 | [
"BSD-3-Clause"
] | 1 | 2020-07-28T08:21:43.000Z | 2020-07-28T08:21:43.000Z | test/tpm_test/crypto_test.py | mmind/servo-chromiumos-ec | bb7b80033561023cd69cef86b00d2faa12fbc7d8 | [
"BSD-3-Clause"
] | null | null | null | test/tpm_test/crypto_test.py | mmind/servo-chromiumos-ec | bb7b80033561023cd69cef86b00d2faa12fbc7d8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module for testing cryptography functions using extended commands."""
from __future__ import print_function
import binascii
import ... | 34.568889 | 78 | 0.670095 |
from __future__ import print_function
import binascii
import struct
import xml.etree.ElementTree as ET
import subcmd
import utils
DECRYPT = 0
ENCRYPT = 1
def get_attribute(tdesc, attr_name, required=True):
default_hex = ('cipher_text', 'iv', 'key')
data = tdesc.find(attr_name)
if data is None:
if req... | true | true |
1c292e2c77fcd7084db2a9722d8921ba92bc8f8f | 911 | py | Python | src/restriction-types-stats/A35MaximumQualifiedCardinality.py | IDLabResearch/lovstats | dd33183574eed692ee89059ff3c6494160dfb8a9 | [
"MIT"
] | 1 | 2018-12-11T13:57:38.000Z | 2018-12-11T13:57:38.000Z | src/restriction-types-stats/A35MaximumQualifiedCardinality.py | IDLabResearch/lovstats | dd33183574eed692ee89059ff3c6494160dfb8a9 | [
"MIT"
] | null | null | null | src/restriction-types-stats/A35MaximumQualifiedCardinality.py | IDLabResearch/lovstats | dd33183574eed692ee89059ff3c6494160dfb8a9 | [
"MIT"
] | null | null | null | from lodstats.stats.RDFStatInterface import RDFStatInterface
from utils.MaxQualifiedCardinalityDetectorOwlMaxQualifiedCardinality import MaxQualifiedCardinalityDetectorOwlMaxQualifiedCardinality
from utils import util_functions
class A35MaximumQualifiedCardinality(RDFStatInterface):
"""Create statistics about maxi... | 39.608696 | 133 | 0.756312 | from lodstats.stats.RDFStatInterface import RDFStatInterface
from utils.MaxQualifiedCardinalityDetectorOwlMaxQualifiedCardinality import MaxQualifiedCardinalityDetectorOwlMaxQualifiedCardinality
from utils import util_functions
class A35MaximumQualifiedCardinality(RDFStatInterface):
def __init__(self, results):
... | true | true |
1c292e5ed4811fe788b7a854495097bba0333f51 | 8,944 | py | Python | tests/helpers/test_config_entry_flow.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | tests/helpers/test_config_entry_flow.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:59:36.000Z | 2022-03-12T00:52:11.000Z | tests/helpers/test_config_entry_flow.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """Tests for the Config Entry Flow helper."""
from unittest.mock import Mock, patch
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.helpers import config_entry_flow
from tests.common import (
MockConfigEntry,
MockModule,
mock_coro,
mock_entity_platfor... | 34.9375 | 88 | 0.717464 | from unittest.mock import Mock, patch
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.helpers import config_entry_flow
from tests.common import (
MockConfigEntry,
MockModule,
mock_coro,
mock_entity_platform,
mock_integration,
)
@pytest.fixture
d... | true | true |
1c292eda52ed3489f40c9ce5b8b117153be55c13 | 3,055 | py | Python | sdk/python/pulumi_alicloud/ots/get_service.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 42 | 2019-03-18T06:34:37.000Z | 2022-03-24T07:08:57.000Z | sdk/python/pulumi_alicloud/ots/get_service.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 152 | 2019-04-15T21:03:44.000Z | 2022-03-29T18:00:57.000Z | sdk/python/pulumi_alicloud/ots/get_service.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2020-08-26T17:30:07.000Z | 2021-07-05T01:37:45.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 30.858586 | 158 | 0.648773 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = [
'GetServiceResult',
'AwaitableGetServiceResult',
'get_service',
]
@pulumi.output_type
class GetServiceResult:
def __init__(__self__, enable=No... | true | true |
1c29307869ae07dfbd6f41e99a132a1d4d6265fe | 11,018 | py | Python | tests/integration/test_method_equivalence.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | tests/integration/test_method_equivalence.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | tests/integration/test_method_equivalence.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 the GPflow 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 in writi... | 33.186747 | 100 | 0.709385 |
import numpy as np
import pytest
import tensorflow as tf
from numpy.testing import assert_allclose
import gpflow
from gpflow.config import default_jitter
from gpflow.mean_functions import Constant
rng = np.random.RandomState(0)
class Datum:
X = rng.rand(20, 1) * 10
Y = np.sin(X) + 0.9 * np.cos(X * 1.6) + r... | true | true |
1c293085cc4229251a650fa1f6443171dedd9f31 | 665 | py | Python | resolucoes/uri/1768.py | RodrigoEC/nosso-py | eaa94f3c61f488fe5f8bc15792076894a89cc1a4 | [
"MIT"
] | 55 | 2020-10-03T14:23:16.000Z | 2022-03-03T04:45:01.000Z | resolucoes/uri/1768.py | RodrigoEC/nosso-py | eaa94f3c61f488fe5f8bc15792076894a89cc1a4 | [
"MIT"
] | 27 | 2020-10-04T23:14:37.000Z | 2021-10-20T04:33:39.000Z | resolucoes/uri/1768.py | RodrigoEC/nosso-py | eaa94f3c61f488fe5f8bc15792076894a89cc1a4 | [
"MIT"
] | 23 | 2020-10-03T14:07:43.000Z | 2022-03-03T04:45:02.000Z | # lê novos valores enquanto não houver EOF
while True:
try:
# n sempre ímpar
n = int(input())
for i in range(n):
# imprime metade das n-iterações
if (not(int((n+1)/2) == i)):
# imprime n-1 espaços antes e os asteriscos depois
print(' ' ... | 35 | 66 | 0.434586 | while True:
try:
n = int(input())
for i in range(n):
if (not(int((n+1)/2) == i)):
print(' ' * (n - i),'*' * (2*i+1))
else:
break
for k in range(2):
... | true | true |
1c29314224912108a085888591fb010051d76b7c | 516 | py | Python | machine-learning/edge-detection/edge_detector.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | machine-learning/edge-detection/edge_detector.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | machine-learning/edge-detection/edge_detector.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
import sys
# read the image
image = cv2.imread(sys.argv[1])
# convert it to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# show the grayscale image, if you want to show, uncomment 2 below lines
# plt.imshow(gray, cmap="gray")
# pl... | 24.571429 | 73 | 0.718992 | import cv2
import numpy as np
import matplotlib.pyplot as plt
import sys
image = cv2.imread(sys.argv[1])
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(gray, threshold1=30, threshold2=100)
plt.imshow(edges, cmap="gray")
plt.show() | true | true |
1c293205ca5498cc58e8e1208dc671884e53feea | 6,065 | py | Python | django_airavata/apps/auth/utils.py | akbranam/airavata-django-portal | 2ba71a34af95b58ba225abb6d5ad1d969af92142 | [
"Apache-2.0"
] | 19 | 2017-09-04T00:36:52.000Z | 2022-01-24T08:44:22.000Z | django_airavata/apps/auth/utils.py | akbranam/airavata-django-portal | 2ba71a34af95b58ba225abb6d5ad1d969af92142 | [
"Apache-2.0"
] | 35 | 2017-10-17T02:36:01.000Z | 2022-03-09T04:46:57.000Z | django_airavata/apps/auth/utils.py | akbranam/airavata-django-portal | 2ba71a34af95b58ba225abb6d5ad1d969af92142 | [
"Apache-2.0"
] | 38 | 2017-09-15T14:17:42.000Z | 2021-12-15T17:11:31.000Z | """Auth utilities."""
import time
from airavata.model.security.ttypes import AuthzToken
from django.conf import settings
from django.contrib.auth import authenticate
from django.core.mail import EmailMessage
from django.http.request import split_domain_port
from django.template import Context, Template
from oauthlib.... | 37.90625 | 102 | 0.658697 |
import time
from airavata.model.security.ttypes import AuthzToken
from django.conf import settings
from django.contrib.auth import authenticate
from django.core.mail import EmailMessage
from django.http.request import split_domain_port
from django.template import Context, Template
from oauthlib.oauth2 import BackendA... | true | true |
1c29326e6878d7034803b8d22ab7aace85427c14 | 9,130 | py | Python | bin/pdf_pyboleto_sample.py | erpbrasil/erpbrasil.febraban | a4f6b254d41e18c8883be6243dd27c143ea4e74d | [
"BSD-3-Clause"
] | 1 | 2020-08-27T18:43:01.000Z | 2020-08-27T18:43:01.000Z | bin/pdf_pyboleto_sample.py | erpbrasil/erpbrasil.febraban | a4f6b254d41e18c8883be6243dd27c143ea4e74d | [
"BSD-3-Clause"
] | 1 | 2020-01-13T22:41:53.000Z | 2020-01-13T22:41:53.000Z | bin/pdf_pyboleto_sample.py | erpbrasil/erpbrasil.febraban | a4f6b254d41e18c8883be6243dd27c143ea4e74d | [
"BSD-3-Clause"
] | 4 | 2019-09-06T12:25:25.000Z | 2021-05-17T11:41:45.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import erpbrasil.febraban
from erpbrasil.febraban.boleto.banco.real import BoletoReal
from erpbrasil.febraban.boleto.banco.bradesco import BoletoBradesco
from erpbrasil.febraban.boleto.banco.caixa import BoletoCaixa
from erpbrasil.febraban.boleto.banco.bancodobrasil import ... | 31.37457 | 76 | 0.551369 | import erpbrasil.febraban
from erpbrasil.febraban.boleto.banco.real import BoletoReal
from erpbrasil.febraban.boleto.banco.bradesco import BoletoBradesco
from erpbrasil.febraban.boleto.banco.caixa import BoletoCaixa
from erpbrasil.febraban.boleto.banco.bancodobrasil import BoletoBB
from erpbrasil.febraban.boleto.banco.... | true | true |
1c29328d243929255f2f01a174d7f1a0531b1ba5 | 2,273 | py | Python | dataset_analysis.py | aditya140/NoveltyDetectionResearch | f9b27e6e8d9c23f85d4d91241ee5d050ecd6b6ef | [
"MIT"
] | 1 | 2021-11-17T10:53:42.000Z | 2021-11-17T10:53:42.000Z | dataset_analysis.py | aditya140/NoveltyDetectionResearch | f9b27e6e8d9c23f85d4d91241ee5d050ecd6b6ef | [
"MIT"
] | null | null | null | dataset_analysis.py | aditya140/NoveltyDetectionResearch | f9b27e6e8d9c23f85d4d91241ee5d050ecd6b6ef | [
"MIT"
] | null | null | null | # %%
import pandas as pd
import json
import os
from nltk import sentence_tokenizer
# %%
with open(".data/dlnd/TAP-DLND-1.0_LREC2018_modified/dlnd.jsonl", "r") as f:
data = [json.loads(i) for i in f.readlines()]
# %%
source_lens = [len(nltk.sent_tokenize(i["source"])) for i in data]
target_lens = [len(nltk.sent_tok... | 20.853211 | 79 | 0.688077 | import pandas as pd
import json
import os
from nltk import sentence_tokenizer
with open(".data/dlnd/TAP-DLND-1.0_LREC2018_modified/dlnd.jsonl", "r") as f:
data = [json.loads(i) for i in f.readlines()]
source_lens = [len(nltk.sent_tokenize(i["source"])) for i in data]
target_lens = [len(nltk.sent_tokenize(i["target... | true | true |
1c2932ac5a5196814ef030ac471510dd26dc9e68 | 1,822 | py | Python | agents/rpi/KafkaClient.py | flyballlabs/threatdetectionservice | 46b6d1e5a651f72c97dad7eb5870695dc5950484 | [
"Apache-2.0"
] | 7 | 2016-09-21T19:21:13.000Z | 2019-09-26T02:26:19.000Z | agents/rpi/KafkaClient.py | devopsec/threatdetectionservice | abea38582aaab706a3a8887c1f36436054e46b41 | [
"Apache-2.0"
] | 24 | 2016-10-06T23:37:43.000Z | 2017-02-18T21:36:37.000Z | agents/rpi/KafkaClient.py | flyballlabs/threatdetectionservice | 46b6d1e5a651f72c97dad7eb5870695dc5950484 | [
"Apache-2.0"
] | 4 | 2016-09-27T17:07:38.000Z | 2018-05-05T03:18:19.000Z | import kafka
from kafka import KafkaProducer
from kafka import BrokerConnection
from sys import api_version
#dt = datetime.now()
#date = datetime.strftime(dt, '%Y-%m-%d')
#connector = kafka.BrokerConnection(host='10.10.10.154', port='6667', afi=ip_)
#connector.connect()
#if connector.connected() == True:
# print("c... | 30.366667 | 142 | 0.731614 | import kafka
from kafka import KafkaProducer
from kafka import BrokerConnection
from sys import api_version
producer = KafkaProducer(bootstrap_servers='50.253.243.17:6667', value_serializer=lambda m: json.dumps(m).encode('ascii'), api_version=(0, 9))
for _ in range(100):
producer.send('pcap', {'key': 'value'})
... | true | true |
1c2934511f90db24927061670f18ecf357cc5be5 | 215 | py | Python | project01/chronalcal.py | jakereps/adventofcode | 956ce3087e0f1865f028bdc37236d00aa198a836 | [
"MIT"
] | null | null | null | project01/chronalcal.py | jakereps/adventofcode | 956ce3087e0f1865f028bdc37236d00aa198a836 | [
"MIT"
] | null | null | null | project01/chronalcal.py | jakereps/adventofcode | 956ce3087e0f1865f028bdc37236d00aa198a836 | [
"MIT"
] | null | null | null | if __name__ == "__main__":
with open("input.txt", "rt") as fh:
data = filter(
lambda line: line != "", map(lambda line: line.strip(), fh.readlines())
)
print(sum(map(int, data)))
| 30.714286 | 83 | 0.534884 | if __name__ == "__main__":
with open("input.txt", "rt") as fh:
data = filter(
lambda line: line != "", map(lambda line: line.strip(), fh.readlines())
)
print(sum(map(int, data)))
| true | true |
1c29349f5f3708aa01f4f8c132989fb656e0a6c6 | 21,499 | py | Python | airflow/operators/sql.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 1 | 2019-05-07T06:46:55.000Z | 2019-05-07T06:46:55.000Z | airflow/operators/sql.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 7 | 2021-06-28T20:24:56.000Z | 2022-02-26T02:01:36.000Z | airflow/operators/sql.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 1 | 2019-06-15T08:38:53.000Z | 2019-06-15T08:38:53.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 34.788026 | 110 | 0.606633 | from distutils.util import strtobool
from typing import Any, Dict, Iterable, List, Mapping, Optional, SupportsAbs, Union
from airflow.exceptions import AirflowException
from airflow.hooks.base_hook import BaseHook
from airflow.models import BaseOperator, SkipMixin
from airflow.utils.decorators import apply_defaults
A... | true | true |
1c2935c97c51a879290d4f1d75ba4d34cc701784 | 13,843 | py | Python | google/cloud/aiplatform_v1beta1/services/migration_service/transports/grpc.py | conankun/python-aiplatform | d6c1bce7e00186aa5ee3cd0e7b8712b21bd06f2a | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | google/cloud/aiplatform_v1beta1/services/migration_service/transports/grpc.py | conankun/python-aiplatform | d6c1bce7e00186aa5ee3cd0e7b8712b21bd06f2a | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | google/cloud/aiplatform_v1beta1/services/migration_service/transports/grpc.py | conankun/python-aiplatform | d6c1bce7e00186aa5ee3cd0e7b8712b21bd06f2a | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.226837 | 102 | 0.647114 | import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth from google.auth import credentials as ga_credentials from google.auth.transport.grpc import S... | true | true |
1c29388d0332a1e02ca78adcb5d07b2e9653affe | 1,407 | py | Python | detect_secrets/plugins/slack.py | gazali-alfatih/detect-secrets | cb632c7b7f7611823939a237726b056df232d85b | [
"Apache-2.0"
] | null | null | null | detect_secrets/plugins/slack.py | gazali-alfatih/detect-secrets | cb632c7b7f7611823939a237726b056df232d85b | [
"Apache-2.0"
] | null | null | null | detect_secrets/plugins/slack.py | gazali-alfatih/detect-secrets | cb632c7b7f7611823939a237726b056df232d85b | [
"Apache-2.0"
] | null | null | null | """
This plugin searches for Slack tokens
"""
from __future__ import absolute_import
import re
import requests
from .base import RegexBasedDetector
from detect_secrets.core.constants import VerifiedResult
class SlackDetector(RegexBasedDetector):
"""Scans for Slack tokens."""
secret_type = 'Slack Token'
... | 26.54717 | 95 | 0.520256 | from __future__ import absolute_import
import re
import requests
from .base import RegexBasedDetector
from detect_secrets.core.constants import VerifiedResult
class SlackDetector(RegexBasedDetector):
secret_type = 'Slack Token'
denylist = (
re.compile(r'xox(?:a|b|p|o|s|r)-(?:\d+-)+[a-z0-9]... | true | true |
1c29398f2ad69d201a956b98fa63a1a36622e77f | 397 | py | Python | blog/migrations/0006_auto_20200309_1827.py | richards12306/blog | 615ab60aebed82d668fb152d2e8da2e2cb4411c2 | [
"MIT"
] | null | null | null | blog/migrations/0006_auto_20200309_1827.py | richards12306/blog | 615ab60aebed82d668fb152d2e8da2e2cb4411c2 | [
"MIT"
] | null | null | null | blog/migrations/0006_auto_20200309_1827.py | richards12306/blog | 615ab60aebed82d668fb152d2e8da2e2cb4411c2 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-09 10:27
import ckeditor.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20200304_1157'),
]
operations = [
migrations.AlterField(
model_name='blog',
name='c... | 19.85 | 50 | 0.607053 |
import ckeditor.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20200304_1157'),
]
operations = [
migrations.AlterField(
model_name='blog',
name='content',
field=ckeditor.fields.RichT... | true | true |
1c2939a835606e837877576bf0ceb32faf569948 | 1,404 | py | Python | aioredis/__init__.py | khudyakovavi/aioredis | ea948d0d7047db3315b4fbb9aa66e9ccc7e41522 | [
"MIT"
] | 2 | 2018-01-03T08:15:02.000Z | 2018-01-03T08:15:03.000Z | aioredis/__init__.py | khudyakovavi/aioredis | ea948d0d7047db3315b4fbb9aa66e9ccc7e41522 | [
"MIT"
] | null | null | null | aioredis/__init__.py | khudyakovavi/aioredis | ea948d0d7047db3315b4fbb9aa66e9ccc7e41522 | [
"MIT"
] | 1 | 2019-09-15T12:51:35.000Z | 2019-09-15T12:51:35.000Z | from .connection import RedisConnection, create_connection
from .commands import (
Redis, create_redis,
create_redis_pool,
GeoPoint, GeoMember,
)
from .pool import ConnectionsPool, create_pool
from .pubsub import Channel
from .sentinel import RedisSentinel, create_sentinel
from .errors import (
Conn... | 20.955224 | 58 | 0.683048 | from .connection import RedisConnection, create_connection
from .commands import (
Redis, create_redis,
create_redis_pool,
GeoPoint, GeoMember,
)
from .pool import ConnectionsPool, create_pool
from .pubsub import Channel
from .sentinel import RedisSentinel, create_sentinel
from .errors import (
Conn... | true | true |
1c293a44d22c2f4979866cf3ba4949e9c5b39e7a | 1,597 | py | Python | monk/system_unit_tests/keras/test_loss_binary_crossentropy.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 542 | 2019-11-10T12:09:31.000Z | 2022-03-28T11:39:07.000Z | monk/system_unit_tests/keras/test_loss_binary_crossentropy.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 117 | 2019-11-12T09:39:24.000Z | 2022-03-12T00:20:41.000Z | monk/system_unit_tests/keras/test_loss_binary_crossentropy.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 246 | 2019-11-09T21:53:24.000Z | 2022-03-29T00:57:07.000Z | import os
import sys
sys.path.append("../../../../monk_v1/");
sys.path.append("../../../monk/");
import psutil
from keras_prototype import prototype
from compare_prototype import compare
from common import print_start
from common import print_status
import numpy as np
from tf_keras_1.losses.return_loss import load_lo... | 28.517857 | 69 | 0.629931 | import os
import sys
sys.path.append("../../../../monk_v1/");
sys.path.append("../../../monk/");
import psutil
from keras_prototype import prototype
from compare_prototype import compare
from common import print_start
from common import print_status
import numpy as np
from tf_keras_1.losses.return_loss import load_lo... | true | true |
1c293cff26177c38f7809a2f489b164919e8ba68 | 304 | py | Python | fdk_client/platform/models/InvoicePaymentMethod.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/InvoicePaymentMethod.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/InvoicePaymentMethod.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class InvoicePaymentMethod(BaseSchema):
# Billing swagger.json
pg_payment_method_id = fields.Str(required=False)
| 16.888889 | 53 | 0.746711 |
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class InvoicePaymentMethod(BaseSchema):
pg_payment_method_id = fields.Str(required=False)
| true | true |
1c293d539578de6f1ef7fcad8bd8b118b92f8704 | 824 | py | Python | src/python/misc/serifxml_round_trip.py | BBN-E/text-open | c508f6caeaa51a43cdb0bc27d8ed77e5750fdda9 | [
"Apache-2.0"
] | 2 | 2022-03-24T14:37:51.000Z | 2022-03-24T19:56:45.000Z | src/python/misc/serifxml_round_trip.py | BBN-E/text-open | c508f6caeaa51a43cdb0bc27d8ed77e5750fdda9 | [
"Apache-2.0"
] | null | null | null | src/python/misc/serifxml_round_trip.py | BBN-E/text-open | c508f6caeaa51a43cdb0bc27d8ed77e5750fdda9 | [
"Apache-2.0"
] | null | null | null | # Read in serifxml then save it an make sure the files are
# essentially identical
import sys, os
script_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(script_dir, ".."))
import serifxml3
if len(sys.argv) != 3:
print("Usage: " + sys.argv[0] + " input-serifxml-file output-serifxml-... | 21.684211 | 80 | 0.713592 |
import sys, os
script_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(script_dir, ".."))
import serifxml3
if len(sys.argv) != 3:
print("Usage: " + sys.argv[0] + " input-serifxml-file output-serifxml-file")
sys.exit(1)
input_file, output_file = sys.argv[1:]
if os.path.exists(ou... | true | true |
1c293daf5b651412037612a0c9263d28ea116b96 | 3,029 | py | Python | ark_nlp/nn/text_level_gcn.py | yubuyuabc/ark-nlp | 165d35cfacd7476791c0aeba19bf43f4f8079553 | [
"Apache-2.0"
] | 1 | 2022-03-23T05:10:55.000Z | 2022-03-23T05:10:55.000Z | ark_nlp/nn/text_level_gcn.py | yubuyuabc/ark-nlp | 165d35cfacd7476791c0aeba19bf43f4f8079553 | [
"Apache-2.0"
] | null | null | null | ark_nlp/nn/text_level_gcn.py | yubuyuabc/ark-nlp | 165d35cfacd7476791c0aeba19bf43f4f8079553 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 DataArk 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... | 28.847619 | 88 | 0.635853 |
import dgl
import torch
from torch import nn
class TextLevelGCN(torch.nn.Module):
def __init__(
self,
vocab_size,
node_embed_size,
edge_num,
class_num=2,
pre_node_embed=False,
node_embed_vectors=0,
is_node_freeze=False,
pre_edge_embed=Fals... | true | true |
1c293e26b6e16fee95aa77b0375c6cafc30adde4 | 865 | py | Python | test/ml/regression/test_regression.py | xenron/coco | e318d534127b769612716c05d40e3d5b090eb5a3 | [
"MIT"
] | null | null | null | test/ml/regression/test_regression.py | xenron/coco | e318d534127b769612716c05d40e3d5b090eb5a3 | [
"MIT"
] | null | null | null | test/ml/regression/test_regression.py | xenron/coco | e318d534127b769612716c05d40e3d5b090eb5a3 | [
"MIT"
] | null | null | null |
import unittest as ut
import sys
sys.path.append("../../../package")
import ml.regression
class TestRegression(ut.TestCase):
def setUp(self):
super(TestRegression, self).setUp()
def test_linear(self):
model = ml.regression.getRegressionByName("Linear")
data = dict()
data["t... | 25.441176 | 62 | 0.545665 |
import unittest as ut
import sys
sys.path.append("../../../package")
import ml.regression
class TestRegression(ut.TestCase):
def setUp(self):
super(TestRegression, self).setUp()
def test_linear(self):
model = ml.regression.getRegressionByName("Linear")
data = dict()
data["t... | false | true |
1c2940a9f7bc7c69d731b5b874bbae2ffe53b5a6 | 34,187 | py | Python | src/synapse/azext_synapse/vendored_sdks/azure_mgmt_synapse/operations/_sql_pools_operations.py | houk-ms/azure-cli-extensions | 76904479fb1d00227e99c8785f3488190a077fa9 | [
"MIT"
] | 1 | 2020-03-25T05:03:17.000Z | 2020-03-25T05:03:17.000Z | src/synapse/azext_synapse/vendored_sdks/azure_mgmt_synapse/operations/_sql_pools_operations.py | houk-ms/azure-cli-extensions | 76904479fb1d00227e99c8785f3488190a077fa9 | [
"MIT"
] | null | null | null | src/synapse/azext_synapse/vendored_sdks/azure_mgmt_synapse/operations/_sql_pools_operations.py | houk-ms/azure-cli-extensions | 76904479fb1d00227e99c8785f3488190a077fa9 | [
"MIT"
] | 1 | 2020-07-16T23:49:49.000Z | 2020-07-16T23:49:49.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 ... | 47.089532 | 184 | 0.671074 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class SqlPoolsOperations(object):
models = models
def __init__(self, cl... | true | true |
1c2940e62b97f5d5c85de26e36e4afce9a2feb80 | 9,969 | py | Python | example_project/my_cifar_train.py | HamedMP/ImageFlow | e33ff64e296aef302cfa06d2179dc213ade68a80 | [
"Apache-2.0"
] | 202 | 2015-11-23T01:46:43.000Z | 2021-10-31T11:14:55.000Z | example_project/my_cifar_train.py | HamedMP/ImageFlow | e33ff64e296aef302cfa06d2179dc213ade68a80 | [
"Apache-2.0"
] | 13 | 2016-05-03T13:17:29.000Z | 2017-09-11T12:18:13.000Z | example_project/my_cifar_train.py | HamedMP/ImageFlow | e33ff64e296aef302cfa06d2179dc213ade68a80 | [
"Apache-2.0"
] | 73 | 2015-12-14T15:15:22.000Z | 2020-10-05T21:49:26.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
# distributed under th... | 37.197761 | 122 | 0.631558 |
"""Training the model"""
__author__ = 'HANEL'
import os.path
import time
from datetime import datetime
import numpy as np
import tensorflow as tf
from six.moves import xrange
import imageflow
import my_cifar
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_float('learning_rate', 0.01, 'Initial learning rat... | false | true |
1c2941108e29229f672cd863085a37badc851754 | 1,040 | py | Python | Lectures/UAV_control/message_types/msg_path.py | donnel2-cooper/drone_control | 3bb3a1c1f768916ac41d4b78692e2edab0776c07 | [
"MIT"
] | null | null | null | Lectures/UAV_control/message_types/msg_path.py | donnel2-cooper/drone_control | 3bb3a1c1f768916ac41d4b78692e2edab0776c07 | [
"MIT"
] | null | null | null | Lectures/UAV_control/message_types/msg_path.py | donnel2-cooper/drone_control | 3bb3a1c1f768916ac41d4b78692e2edab0776c07 | [
"MIT"
] | null | null | null | """
msg_path
- messages type for input to path follower
part of mavsim_python
- Beard & McLain, PUP, 2012
- Last update:
3/11/2019 - RWB
"""
import numpy as np
class msgPath:
def __init__(self):
# type='line' means straight line following, type='orbit' means orbit following
... | 33.548387 | 89 | 0.597115 | import numpy as np
class msgPath:
def __init__(self):
self.type = 'line'
self.airspeed = 25
self.line_origin = np.array([[0.0, 0.0, 0.0]]).T
self.line_direction = np.array([[1.0, 0.0, 0.0]]).T
self.orbit_center = np.array([[0.0... | true | true |
1c29412b53c6177af930e4cab80b35228e418e5c | 2,018 | py | Python | phase_3/simple_job_predictions.py | fgentile89/Deep-Docking-NonAutomated | cbde2df913f6f0e5e151cc0913e20f8443a788ed | [
"MIT"
] | 21 | 2021-03-05T23:46:07.000Z | 2022-03-26T09:23:09.000Z | phase_3/simple_job_predictions.py | fgentile89/Deep-Docking-NonAutomated | cbde2df913f6f0e5e151cc0913e20f8443a788ed | [
"MIT"
] | 14 | 2021-04-07T11:03:28.000Z | 2022-01-14T22:42:08.000Z | phase_3/simple_job_predictions.py | fgentile89/Deep-Docking-NonAutomated | cbde2df913f6f0e5e151cc0913e20f8443a788ed | [
"MIT"
] | 9 | 2021-03-16T08:32:12.000Z | 2022-02-10T02:03:29.000Z | import argparse
import glob
import os
parser = argparse.ArgumentParser()
parser.add_argument('-protein', '--protein', required=True, help='Name of DD project')
parser.add_argument('-file_path', '--file_path', required=True, help='PAth to project folder without project folder name')
parser.add_argument('-n_it', '--n_it... | 33.633333 | 122 | 0.640733 | import argparse
import glob
import os
parser = argparse.ArgumentParser()
parser.add_argument('-protein', '--protein', required=True, help='Name of DD project')
parser.add_argument('-file_path', '--file_path', required=True, help='PAth to project folder without project folder name')
parser.add_argument('-n_it', '--n_it... | true | true |
1c2941f98710613409185f860a972db26870622f | 10,628 | py | Python | brian2/tests/test_preferences.py | excinhbal/brian2 | 52e49e6e6024e41e189026bdeddc39a6c2ea119d | [
"BSD-2-Clause"
] | 1 | 2021-06-10T15:28:51.000Z | 2021-06-10T15:28:51.000Z | brian2/tests/test_preferences.py | excinhbal/brian2 | 52e49e6e6024e41e189026bdeddc39a6c2ea119d | [
"BSD-2-Clause"
] | 1 | 2019-04-11T13:57:13.000Z | 2019-04-13T17:41:04.000Z | brian2/tests/test_preferences.py | excinhbal/brian2 | 52e49e6e6024e41e189026bdeddc39a6c2ea119d | [
"BSD-2-Clause"
] | null | null | null |
from numpy import float64, float32
from io import StringIO
from brian2 import restore_initial_state, volt, amp
from brian2.core.preferences import (DefaultValidator, BrianPreference,
BrianGlobalPreferences, PreferenceError,
BrianGlobalPreferenc... | 34.394822 | 88 | 0.641419 |
from numpy import float64, float32
from io import StringIO
from brian2 import restore_initial_state, volt, amp
from brian2.core.preferences import (DefaultValidator, BrianPreference,
BrianGlobalPreferences, PreferenceError,
BrianGlobalPreferenc... | true | true |
1c29424fca185bf9cc36096c221ba72efcb3d388 | 2,427 | py | Python | flow/benchmarks/baselines/bottleneck0.py | SHITIANYU-hue/flow | 6fb5697868517fea7098a81b78c1be8e925f09f7 | [
"MIT"
] | 805 | 2018-08-16T22:30:51.000Z | 2022-03-31T09:25:50.000Z | flow/benchmarks/baselines/bottleneck0.py | SHITIANYU-hue/flow | 6fb5697868517fea7098a81b78c1be8e925f09f7 | [
"MIT"
] | 879 | 2018-08-22T17:37:06.000Z | 2022-03-29T01:06:11.000Z | flow/benchmarks/baselines/bottleneck0.py | SHITIANYU-hue/flow | 6fb5697868517fea7098a81b78c1be8e925f09f7 | [
"MIT"
] | 325 | 2018-08-22T06:48:00.000Z | 2022-03-21T15:09:04.000Z | """Evaluates the baseline performance of bottleneck0 without RL control.
Baseline is no AVs.
"""
import numpy as np
from flow.core.experiment import Experiment
from flow.core.params import InFlows
from flow.core.params import SumoLaneChangeParams
from flow.core.params import SumoCarFollowingParams
from flow.core.para... | 31.519481 | 78 | 0.660486 |
import numpy as np
from flow.core.experiment import Experiment
from flow.core.params import InFlows
from flow.core.params import SumoLaneChangeParams
from flow.core.params import SumoCarFollowingParams
from flow.core.params import VehicleParams
from flow.controllers import ContinuousRouter
from flow.benchmarks.bottlen... | true | true |
1c29426d9b98208e07d10c62c4fd45013040547b | 371 | py | Python | tests/www/www/admin.py | grantjenks/django-modelqueue | 6e46760cd6da1060d8e7a011c7c8f160f905bddc | [
"Apache-2.0"
] | 3 | 2018-03-27T01:12:03.000Z | 2021-03-07T17:06:09.000Z | tests/www/www/admin.py | grantjenks/django-modelqueue | 6e46760cd6da1060d8e7a011c7c8f160f905bddc | [
"Apache-2.0"
] | 2 | 2021-12-13T16:11:13.000Z | 2021-12-13T16:13:39.000Z | tests/www/www/admin.py | grantjenks/django-modelqueue | 6e46760cd6da1060d8e7a011c7c8f160f905bddc | [
"Apache-2.0"
] | 1 | 2020-06-13T10:02:51.000Z | 2020-06-13T10:02:51.000Z | from django.contrib import admin
import modelqueue
from .models import Task
@admin.register(Task)
class TaskAdmin(admin.ModelAdmin):
actions = [*modelqueue.admin_actions('status')]
list_filter = [
modelqueue.admin_list_filter('status'),
]
def get_changeform_initial_data(self, request):
... | 21.823529 | 54 | 0.716981 | from django.contrib import admin
import modelqueue
from .models import Task
@admin.register(Task)
class TaskAdmin(admin.ModelAdmin):
actions = [*modelqueue.admin_actions('status')]
list_filter = [
modelqueue.admin_list_filter('status'),
]
def get_changeform_initial_data(self, request):
... | true | true |
1c2944d984588d61d63a9663a6569c0db92651ea | 159 | py | Python | env/Scripts/django-admin.py | AnilCharles96/django_chat_app | 4b90fa90a703fe002e7e305e85c7621db7275d6f | [
"MIT"
] | null | null | null | env/Scripts/django-admin.py | AnilCharles96/django_chat_app | 4b90fa90a703fe002e7e305e85c7621db7275d6f | [
"MIT"
] | null | null | null | env/Scripts/django-admin.py | AnilCharles96/django_chat_app | 4b90fa90a703fe002e7e305e85c7621db7275d6f | [
"MIT"
] | null | null | null | #!c:\users\anil\desktop\main\env\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 26.5 | 52 | 0.773585 | from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| true | true |
1c2945ce6610de882ff6f9072a856dcb161457d5 | 2,313 | py | Python | capella_console_client/config.py | capellaspace/console-client | bad631f207043231630c9b8c0893a1b4382d4061 | [
"MIT"
] | 23 | 2021-07-28T19:32:25.000Z | 2022-03-19T07:57:36.000Z | capella_console_client/config.py | capellaspace/console-client | bad631f207043231630c9b8c0893a1b4382d4061 | [
"MIT"
] | 6 | 2021-07-16T22:31:56.000Z | 2022-03-11T21:09:40.000Z | capella_console_client/config.py | capellaspace/console-client | bad631f207043231630c9b8c0893a1b4382d4061 | [
"MIT"
] | 1 | 2022-01-05T18:38:46.000Z | 2022-01-05T18:38:46.000Z | CONSOLE_API_URL = "https://api.capellaspace.com"
DEFAULT_TIMEOUT = 60
DEFAULT_PAGE_SIZE = 999
DEFAULT_MAX_FEATURE_COUNT = 500
SUPPORTED_SEARCH_FIELDS = {
"bbox",
"intersects",
"collections",
"ids",
"limit",
}
SUPPORTED_QUERY_FIELDS = {
"center_frequency",
"collect_id",
"constellation... | 26.895349 | 71 | 0.690878 | CONSOLE_API_URL = "https://api.capellaspace.com"
DEFAULT_TIMEOUT = 60
DEFAULT_PAGE_SIZE = 999
DEFAULT_MAX_FEATURE_COUNT = 500
SUPPORTED_SEARCH_FIELDS = {
"bbox",
"intersects",
"collections",
"ids",
"limit",
}
SUPPORTED_QUERY_FIELDS = {
"center_frequency",
"collect_id",
"constellation... | true | true |
1c2945d2fed08c33bec99c0789217d37d5ce7ece | 24,530 | py | Python | PyPoE/poe/constants.py | brather1ng/PyPoE | b9cc5ff391a90d1b42c2f058545f3b51b09103e9 | [
"MIT"
] | 7 | 2021-04-25T17:22:01.000Z | 2021-10-13T20:21:32.000Z | PyPoE/poe/constants.py | brather1ng/PyPoE | b9cc5ff391a90d1b42c2f058545f3b51b09103e9 | [
"MIT"
] | 3 | 2021-04-27T01:59:04.000Z | 2021-08-08T09:51:09.000Z | PyPoE/poe/constants.py | brather1ng/PyPoE | b9cc5ff391a90d1b42c2f058545f3b51b09103e9 | [
"MIT"
] | 4 | 2021-07-29T18:13:10.000Z | 2021-10-14T15:44:43.000Z | """
Overview
===============================================================================
+----------+------------------------------------------------------------------+
| Path | PyPoE/poe/constants.py |
+----------+------------------------------------------------------... | 25.821053 | 83 | 0.60053 |
from enum import IntEnum, EnumMeta, Enum
__all__ = [
'BETRAYAL_UPGRADE_SLOTS',
'DELVE_UPGRADE_TYPE',
'DISTRIBUTOR',
'MAP_FRAGMENT_FAMILIES',
'MOD_DOMAIN',
'MOD_GENERATION_TYPE',
'RARITY',
'SHOP_PACKAGE_PLATFORM',
'SOCKET_COLOUR',
'STAT_INTERPOLATION_TYPES',
'VERSION',
... | true | true |
1c2946e16e3102395a34cf5a460359e6a8dcdc2d | 41,492 | py | Python | runtime/rlibuv.py | cheery/lever | 6fa8cd6afec440b32232f87236b0457fb8bfb8b1 | [
"MIT"
] | 136 | 2015-12-18T21:11:59.000Z | 2022-02-21T19:47:36.000Z | runtime/rlibuv.py | cheery/lever | 6fa8cd6afec440b32232f87236b0457fb8bfb8b1 | [
"MIT"
] | 1 | 2021-05-07T11:17:02.000Z | 2021-05-07T18:15:07.000Z | runtime/rlibuv.py | cheery/lever | 6fa8cd6afec440b32232f87236b0457fb8bfb8b1 | [
"MIT"
] | 13 | 2016-03-06T18:27:17.000Z | 2020-06-18T14:27:32.000Z | from rpython.rlib.objectmodel import always_inline, specialize
from rpython.rtyper.lltypesystem import rffi, lltype, llmemory
from rpython.rtyper.tool import rffi_platform
from rpython.translator.tool.cbuild import ExternalCompilationInfo
import os, sys
stdio_flags = rffi.INT
uv_file = rffi.INT
# recurring pattern, a... | 42.599589 | 137 | 0.715584 | from rpython.rlib.objectmodel import always_inline, specialize
from rpython.rtyper.lltypesystem import rffi, lltype, llmemory
from rpython.rtyper.tool import rffi_platform
from rpython.translator.tool.cbuild import ExternalCompilationInfo
import os, sys
stdio_flags = rffi.INT
uv_file = rffi.INT
@specialize.call_locat... | true | true |
1c2947340aa3385d76ac80117202ebca7b5018d1 | 1,058 | py | Python | tests/test_args_opts/test_options.py | jnoortheen/arger | 8353d5a30b2ef3ca335f51c9934070fad526de66 | [
"MIT"
] | 11 | 2020-11-11T19:42:39.000Z | 2022-01-13T18:41:05.000Z | tests/test_args_opts/test_options.py | jnoortheen/arger | 8353d5a30b2ef3ca335f51c9934070fad526de66 | [
"MIT"
] | 3 | 2021-01-30T03:35:12.000Z | 2021-10-16T07:16:16.000Z | tests/test_args_opts/test_options.py | jnoortheen/arger | 8353d5a30b2ef3ca335f51c9934070fad526de66 | [
"MIT"
] | null | null | null | import inspect
from decimal import Decimal
import pytest
@pytest.fixture
def parameter(name, default):
return inspect.Parameter(
name,
inspect.Parameter.POSITIONAL_OR_KEYWORD,
default=default,
)
@pytest.mark.parametrize(
'name, default, input, expected',
[
# simple t... | 26.45 | 67 | 0.543478 | import inspect
from decimal import Decimal
import pytest
@pytest.fixture
def parameter(name, default):
return inspect.Parameter(
name,
inspect.Parameter.POSITIONAL_OR_KEYWORD,
default=default,
)
@pytest.mark.parametrize(
'name, default, input, expected',
[
('... | true | true |
1c29479abd7fa099c9626783a55e7dd20ebbb2f3 | 1,007 | py | Python | html2md/transformers/Replace.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | null | null | null | html2md/transformers/Replace.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | null | null | null | html2md/transformers/Replace.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | 1 | 2021-11-08T01:53:55.000Z | 2021-11-08T01:53:55.000Z | import re
from builtins import print
from html2md.transformers.Tranformation import Transformation
class Replace(Transformation):
"""
Transformation that replaces all occurrences of a string give in the first argument to another one given in the
second argument. This Transformation accepts an optional th... | 31.46875 | 115 | 0.621648 | import re
from builtins import print
from html2md.transformers.Tranformation import Transformation
class Replace(Transformation):
def __init__(self, args):
self._from_ = args[0]
self._to_ = args[1]
self._toggle_ = None
if len(args) > 2:
self._toggle_ = args[2]
de... | true | true |
1c294879054d5a227c4f1fdeb44d15b4c110f01b | 10,216 | py | Python | thesis/segmentation_models_v1/metrics.py | shenghh2015/segmentation_models | 473c528c724f62ff38ac127747dd8babb7de6b85 | [
"MIT"
] | 1 | 2021-02-20T05:44:27.000Z | 2021-02-20T05:44:27.000Z | thesis/segmentation_models_v1/metrics.py | shenghh2015/segmentation_models | 473c528c724f62ff38ac127747dd8babb7de6b85 | [
"MIT"
] | null | null | null | thesis/segmentation_models_v1/metrics.py | shenghh2015/segmentation_models | 473c528c724f62ff38ac127747dd8babb7de6b85 | [
"MIT"
] | null | null | null | from .base import Metric
from .base import functional as F
import tensorflow as tf
SMOOTH = 1e-5
class IOUScore(Metric):
r""" The `Jaccard index`_, also known as Intersection over Union and the Jaccard similarity coefficient
(originally coined coefficient de communauté by Paul Jaccard), is a statistic used f... | 31.530864 | 117 | 0.59906 | from .base import Metric
from .base import functional as F
import tensorflow as tf
SMOOTH = 1e-5
class IOUScore(Metric):
def __init__(
self,
class_weights=None,
class_indexes=None,
threshold=None,
per_image=False,
smooth=SMOOTH,
... | true | true |
1c294b9012126620989b302b823bfa7819fbac56 | 1,912 | py | Python | posts/serializers.py | yuyuyuhaoshi/Blog-BE | a485d5159076d619d4fd6019fe9b96ac04020d4d | [
"Apache-2.0"
] | null | null | null | posts/serializers.py | yuyuyuhaoshi/Blog-BE | a485d5159076d619d4fd6019fe9b96ac04020d4d | [
"Apache-2.0"
] | null | null | null | posts/serializers.py | yuyuyuhaoshi/Blog-BE | a485d5159076d619d4fd6019fe9b96ac04020d4d | [
"Apache-2.0"
] | null | null | null | from rest_framework import serializers
from categories.serializers import CategoryListSerializer
from posts.models import Post
from tags.serializers import TagListSerializer
from utils.mixins import EagerLoaderMixin
class PostListSerializer(serializers.HyperlinkedModelSerializer, EagerLoaderMixin):
"""
文章列表
... | 26.555556 | 90 | 0.571653 | from rest_framework import serializers
from categories.serializers import CategoryListSerializer
from posts.models import Post
from tags.serializers import TagListSerializer
from utils.mixins import EagerLoaderMixin
class PostListSerializer(serializers.HyperlinkedModelSerializer, EagerLoaderMixin):
author = seri... | true | true |
1c294be872c4ecfb31d36f65dc9b18e9276a7d9c | 1,138 | py | Python | training_api/src/checkpoint_module/checkpoint_validator.py | michaelnguyen11/BMW-Classification-Training-GUI | 315e6f4a4c3cd7136ef965ab089abda051110a27 | [
"Apache-2.0"
] | 69 | 2021-01-22T18:09:15.000Z | 2022-03-29T09:38:03.000Z | training_api/src/checkpoint_module/checkpoint_validator.py | michaelnguyen11/BMW-Classification-Training-GUI | 315e6f4a4c3cd7136ef965ab089abda051110a27 | [
"Apache-2.0"
] | null | null | null | training_api/src/checkpoint_module/checkpoint_validator.py | michaelnguyen11/BMW-Classification-Training-GUI | 315e6f4a4c3cd7136ef965ab089abda051110a27 | [
"Apache-2.0"
] | 3 | 2021-06-29T13:29:25.000Z | 2022-01-27T13:42:35.000Z | """
Imports
"""
import os
from DTO.Checkpoint import Checkpoint
class CheckpointValidator():
def __init__(self):
self.checkpoint_base_path = '/checkpoints/'
"""
Validates the checkpoins folder by checking if the path exists,
if it is a folder and checking all the files are there
We mig... | 27.756098 | 121 | 0.662566 | import os
from DTO.Checkpoint import Checkpoint
class CheckpointValidator():
def __init__(self):
self.checkpoint_base_path = '/checkpoints/'
def validate_checkpoint(self, checkpoint_name, checkpoint_architecture):
checkpoint_path = os.path.join(self.checkpoint_base_path, os.path.join(check... | true | true |
1c294c6d244673cab8b77a02f38e336ef190ed86 | 3,679 | py | Python | obsei/source/google_news_source.py | reenabapna/obsei | 95e5ce24616eb69cdc960c3dce15fb597f93075b | [
"Apache-2.0"
] | null | null | null | obsei/source/google_news_source.py | reenabapna/obsei | 95e5ce24616eb69cdc960c3dce15fb597f93075b | [
"Apache-2.0"
] | null | null | null | obsei/source/google_news_source.py | reenabapna/obsei | 95e5ce24616eb69cdc960c3dce15fb597f93075b | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, List, Optional
import dateparser
from gnews import GNews
from pydantic import PrivateAttr
from obsei.payload import TextPayload
from obsei.misc.utils import DATETIME_STRING_PATTERN, convert_utc_time
from obsei.source.base_source import BaseSource, BaseSourceConfig
from obsei.source.websi... | 34.707547 | 104 | 0.62517 | from typing import Any, Dict, List, Optional
import dateparser
from gnews import GNews
from pydantic import PrivateAttr
from obsei.payload import TextPayload
from obsei.misc.utils import DATETIME_STRING_PATTERN, convert_utc_time
from obsei.source.base_source import BaseSource, BaseSourceConfig
from obsei.source.websi... | true | true |
1c294d6a428fa505f52252d746bf545c89aa7f6c | 1,849 | py | Python | src/olympia/amo/management/commands/create_db.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 3 | 2020-03-05T18:17:14.000Z | 2020-03-09T01:24:38.000Z | src/olympia/amo/management/commands/create_db.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1,398 | 2020-10-08T06:32:26.000Z | 2022-03-31T12:06:24.000Z | src/olympia/amo/management/commands/create_db.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2020-06-04T10:18:59.000Z | 2020-06-04T10:18:59.000Z | # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import MySQLdb as mysql
class Command(BaseCommand):
"""Based on django_extension's reset_db command but simplifed and with
support for all character sets defined in setti... | 31.87931 | 74 | 0.593294 | import logging
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import MySQLdb as mysql
class Command(BaseCommand):
help = ('Creates the database for this project.')
def add_arguments(self, parser):
super(Command, self).add_arguments(parser)
... | true | true |
1c294db237b83cde5bb2be94e978ddfdf2d05cd2 | 5,672 | py | Python | main.py | ravireddy07/PeopleCounterAppEdge | 8aea8b669e13eb6c31272fc5ceb9c6d3c27bfc58 | [
"Apache-2.0"
] | 1 | 2020-09-21T10:25:24.000Z | 2020-09-21T10:25:24.000Z | main.py | ravireddy07/PeopleCounterAppEdge | 8aea8b669e13eb6c31272fc5ceb9c6d3c27bfc58 | [
"Apache-2.0"
] | null | null | null | main.py | ravireddy07/PeopleCounterAppEdge | 8aea8b669e13eb6c31272fc5ceb9c6d3c27bfc58 | [
"Apache-2.0"
] | 2 | 2020-05-24T12:01:15.000Z | 2020-07-28T02:48:55.000Z | import os
import sys
import time
import socket
import json
import cv2
import logging as log
import paho.mqtt.client as mqtt
from argparse import ArgumentParser
from inference import Network
HostName = socket.gethostname()
ipAddress = socket.gethostbyname(HostName)
mqtt_host = ipAddress
mqtt_port = 3001
mqtt_break = 6... | 35.012346 | 85 | 0.538787 | import os
import sys
import time
import socket
import json
import cv2
import logging as log
import paho.mqtt.client as mqtt
from argparse import ArgumentParser
from inference import Network
HostName = socket.gethostname()
ipAddress = socket.gethostbyname(HostName)
mqtt_host = ipAddress
mqtt_port = 3001
mqtt_break = 6... | true | true |
1c294ea9dc2e426986f33c9d77e7dcaf06275fe6 | 745 | py | Python | leetcode/340-Longest-Substring-with-At-Most-K-Distinct-Characters/LgstSubstrMostKChr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/340-Longest-Substring-with-At-Most-K-Distinct-Characters/LgstSubstrMostKChr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/340-Longest-Substring-with-At-Most-K-Distinct-Characters/LgstSubstrMostKChr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def lengthOfLongestSubstringKDistinct(self, s, k):
"""
:type s: str
:type k: int
:rtype: int
"""
res = 0
i, j = 0, 0
cnt = 0
chrs = {ch: [] for ch in set(s)}
while j < len(s) or cnt > k:
if cnt <= k:
... | 26.607143 | 54 | 0.339597 | class Solution(object):
def lengthOfLongestSubstringKDistinct(self, s, k):
res = 0
i, j = 0, 0
cnt = 0
chrs = {ch: [] for ch in set(s)}
while j < len(s) or cnt > k:
if cnt <= k:
pre = j
while j < len(s) and s[pre] == s[j]:
... | true | true |
1c294eb01cb5d9e67a02189f4cc4937e6aa5ebfc | 7,852 | py | Python | test/functional/wallet_backup.py | ecryptoproject/bitcoinreco | 82ba8f9b62b5398ff82a244e81fe5639933e8567 | [
"MIT"
] | null | null | null | test/functional/wallet_backup.py | ecryptoproject/bitcoinreco | 82ba8f9b62b5398ff82a244e81fe5639933e8567 | [
"MIT"
] | null | null | null | test/functional/wallet_backup.py | ecryptoproject/bitcoinreco | 82ba8f9b62b5398ff82a244e81fe5639933e8567 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoinreco Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet backup features.
Test case is:
4 nodes. 1 2 and 3 send transactions between each o... | 38.116505 | 147 | 0.647988 | from random import randint
import shutil
from test_framework.test_framework import BitcoinrecoTestFramework
from test_framework.util import *
class WalletBackupTest(BitcoinrecoTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.setup_clean_chain = True
self.extra_arg... | true | true |
1c294ec7b3c076f24df38d6ef764d5c79507b6e5 | 17,827 | py | Python | sphinx/directives/code.py | varphone/sphinx | 01b44ebf3cb386612b10480a4917079c3abf87f9 | [
"BSD-2-Clause"
] | null | null | null | sphinx/directives/code.py | varphone/sphinx | 01b44ebf3cb386612b10480a4917079c3abf87f9 | [
"BSD-2-Clause"
] | null | null | null | sphinx/directives/code.py | varphone/sphinx | 01b44ebf3cb386612b10480a4917079c3abf87f9 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinx.directives.code
~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import codecs
import sys
from difflib import unified_diff
from docutils import nodes
from docutils.parsers.rst import ... | 37.530526 | 105 | 0.569137 |
import codecs
import sys
from difflib import unified_diff
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.statemachine import ViewList
from six import text_type
from sphinx import addnodes
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util import parsel... | true | true |
1c294f1ef1216effafc79a47e417b811f83643f3 | 1,568 | py | Python | statusparser_core/configurations.py | DFC302/statusparser | d57d3ac036dda43c6640e4880343bb13022dea34 | [
"MIT"
] | 29 | 2019-10-12T05:21:02.000Z | 2021-08-17T19:12:42.000Z | statusparser_core/configurations.py | DFC302/statusparser | d57d3ac036dda43c6640e4880343bb13022dea34 | [
"MIT"
] | 2 | 2019-10-19T15:09:49.000Z | 2021-08-18T12:59:04.000Z | statusparser_core/configurations.py | DFC302/statusparser | d57d3ac036dda43c6640e4880343bb13022dea34 | [
"MIT"
] | 11 | 2019-10-12T13:14:10.000Z | 2020-08-30T00:32:48.000Z | #!/usr/bin/env python3
import argparse
import sys
def options():
parser = argparse.ArgumentParser()
# File containing list of URLs
parser.add_argument(
"-f", "--file",
help="Specify input file containing list of URLs",
action="store",
)
# Write output to file
parser.add_argument(
"--textfile",
help="... | 20.631579 | 75 | 0.678571 |
import argparse
import sys
def options():
parser = argparse.ArgumentParser()
parser.add_argument(
"-f", "--file",
help="Specify input file containing list of URLs",
action="store",
)
parser.add_argument(
"--textfile",
help="Write results to simple text file output.",
action="store",
)
parser.add... | true | true |
1c294f5126a4162f5f11260b37440784b46bfc5c | 4,072 | py | Python | python/key_demo.py | ZuChen93/Piano-LED-Visualizer | 3878bae1bc521e5f3e0fb8ccb661b1af02447fe6 | [
"MIT"
] | null | null | null | python/key_demo.py | ZuChen93/Piano-LED-Visualizer | 3878bae1bc521e5f3e0fb8ccb661b1af02447fe6 | [
"MIT"
] | null | null | null | python/key_demo.py | ZuChen93/Piano-LED-Visualizer | 3878bae1bc521e5f3e0fb8ccb661b1af02447fe6 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import spidev as SPI
import ST7789
import RPi.GPIO as GPIO
import time
import subprocess
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
#GPIO define
# RST_PIN = 25
# CS_PIN = 8
# DC_PIN = 24
KEY_UP_PIN = 6
KEY_DOWN_PIN = 19
KEY_LEFT_PI... | 33.105691 | 95 | 0.633841 | import spidev as SPI
import ST7789
import RPi.GPIO as GPIO
import time
import subprocess
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
KEY_UP_PIN = 6
KEY_DOWN_PIN = 19
KEY_LEFT_PIN = 5
KEY_RIGHT_PIN = 26
KEY_PRESS_PIN = 13
KEY1_PIN = 21
KEY2_PIN = 20
KEY3_PIN ... | true | true |
1c294fd079aa24fc75ccdffaf3508334bd1cef79 | 2,907 | py | Python | pycls/datasets/cifar10.py | donguk-dev/pycls | 31355a3473fd9389313527cf7e1bf5ad31466aad | [
"MIT"
] | null | null | null | pycls/datasets/cifar10.py | donguk-dev/pycls | 31355a3473fd9389313527cf7e1bf5ad31466aad | [
"MIT"
] | null | null | null | pycls/datasets/cifar10.py | donguk-dev/pycls | 31355a3473fd9389313527cf7e1bf5ad31466aad | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""CIFAR10 dataset."""
import os
import pickle
import numpy as np
import pycls.core.logging as logging
import torch.... | 35.45122 | 88 | 0.601651 |
import os
import pickle
import numpy as np
import pycls.core.logging as logging
import torch.utils.data
from iopath.common.file_io import g_pathmgr
from pycls.core.config import cfg
logger = logging.get_logger(__name__)
_MEAN = [125.3, 123.0, 113.9]
_STD = [63.0, 62.1, 66.7]
class Cifar10(torch.utils.data.Data... | true | true |
1c29500f4a622437671453e2043a80d9315eaec1 | 560 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractKannablogsWordpressCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractKannablogsWordpressCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractKannablogsWordpressCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractKannablogsWordpressCom(item):
'''
Parser for 'kannablogs.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loi... | 25.454545 | 104 | 0.639286 |
def extractKannablogsWordpressCom(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', 'oel'),
]
... | true | true |
1c295046a95d6ace885428046e863e3e4f4b0493 | 4,205 | py | Python | arpym/statistics/invariance_test_ks.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | 6 | 2021-04-10T13:24:30.000Z | 2022-03-26T08:20:42.000Z | arpym/statistics/invariance_test_ks.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | null | null | null | arpym/statistics/invariance_test_ks.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | 6 | 2019-08-13T22:02:17.000Z | 2022-02-09T17:49:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
# import seaborn as sns
from arpym.statistics.cdf_sp import cdf_sp
from arpym.tools.histogram_sp import histogram_sp
def invariance_test_ks(epsi, *, conf_lev=0.95,
... | 33.110236 | 90 | 0.578121 |
import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
from arpym.statistics.cdf_sp import cdf_sp
from arpym.tools.histogram_sp import histogram_sp
def invariance_test_ks(epsi, *, conf_lev=0.95,
title='Kolmogorov-Smirnov test',
plot_te... | true | true |
1c2951ff386582e266c280c6494be23d908d3ce5 | 1,395 | py | Python | p18.py | fiskenslakt/aoc-2020 | 10784043bff9df8e088b32f7fe63b9be68d997ff | [
"MIT"
] | 1 | 2020-12-06T06:29:35.000Z | 2020-12-06T06:29:35.000Z | p18.py | fiskenslakt/aoc-2020 | 10784043bff9df8e088b32f7fe63b9be68d997ff | [
"MIT"
] | null | null | null | p18.py | fiskenslakt/aoc-2020 | 10784043bff9df8e088b32f7fe63b9be68d997ff | [
"MIT"
] | null | null | null | from collections import deque
from operator import add, mul
from aocd import data as homework
def get_postfix(expression: str, advanced: bool = False) -> deque:
ops = []
queue = deque()
for token in expression.replace(' ', ''):
if token.isdigit():
queue.append(token)
elif tok... | 24.910714 | 66 | 0.477419 | from collections import deque
from operator import add, mul
from aocd import data as homework
def get_postfix(expression: str, advanced: bool = False) -> deque:
ops = []
queue = deque()
for token in expression.replace(' ', ''):
if token.isdigit():
queue.append(token)
elif tok... | true | true |
1c2953cb99907ee9133f24265a9dc4f56a14c93f | 752 | py | Python | fx/plasmafx_plugin_cycle/plasmafx_plugin_cycle/__init__.py | vangual/plasma | b5acdd8114b87c723103f90405d79e71499d4f78 | [
"MIT"
] | null | null | null | fx/plasmafx_plugin_cycle/plasmafx_plugin_cycle/__init__.py | vangual/plasma | b5acdd8114b87c723103f90405d79e71499d4f78 | [
"MIT"
] | null | null | null | fx/plasmafx_plugin_cycle/plasmafx_plugin_cycle/__init__.py | vangual/plasma | b5acdd8114b87c723103f90405d79e71499d4f78 | [
"MIT"
] | null | null | null | from plasmafx import Plugin
from colorsys import hsv_to_rgb
class Cycle(Plugin):
def __init__(self, speed=1.0, spread=1.0, offset=0, saturation=1.0, value=1.0):
Plugin.__init__(self)
self._speed = float(speed)
self._saturation = float(saturation)
self._value = float(value)
s... | 34.181818 | 84 | 0.570479 | from plasmafx import Plugin
from colorsys import hsv_to_rgb
class Cycle(Plugin):
def __init__(self, speed=1.0, spread=1.0, offset=0, saturation=1.0, value=1.0):
Plugin.__init__(self)
self._speed = float(speed)
self._saturation = float(saturation)
self._value = float(value)
s... | true | true |
1c29549fc45138a2da15b99a7554fd9e97089a08 | 3,922 | py | Python | external/emd/emd_module.py | benedictlee21/FYP_SCSE21_0204 | b5fdefac0fbec1291def5d47c780e8e7dced3b50 | [
"MIT"
] | 1 | 2022-02-07T04:25:38.000Z | 2022-02-07T04:25:38.000Z | external/emd/emd_module.py | benedictlee21/FYP_SCSE21_0204 | b5fdefac0fbec1291def5d47c780e8e7dced3b50 | [
"MIT"
] | null | null | null | external/emd/emd_module.py | benedictlee21/FYP_SCSE21_0204 | b5fdefac0fbec1291def5d47c780e8e7dced3b50 | [
"MIT"
] | null | null | null | # EMD approximation module (based on auction algorithm)
# memory complexity: O(n)
# time complexity: O(n^2 * iter)
# author: Minghua Liu
# Input:
# xyz1, xyz2: [#batch, #points, 3]
# where xyz1 is the predicted point cloud and xyz2 is the ground truth point cloud
# two point clouds should have same size and be norma... | 40.43299 | 176 | 0.663947 |
import time
import numpy as np
import torch
from torch import nn
from torch.autograd import Function
import emd
class emdFunction(Function):
@staticmethod
def forward(ctx, xyz1, xyz2, eps, iters):
batchsize, n, _ = xyz1.size()
_, m, _ = xyz2.size()
assert(n == m)
assert(xy... | true | true |
1c2954aa9043e561fb23a7508ca1d9f30138a7b4 | 2,177 | py | Python | blo/tests/test_blog.py | jamess098/blo | a4ab03b691d9809eb4a1f46669ae51e882640520 | [
"BSD-3-Clause"
] | 12 | 2015-12-21T13:07:30.000Z | 2020-09-20T08:27:17.000Z | blo/tests/test_blog.py | jamess098/blo | a4ab03b691d9809eb4a1f46669ae51e882640520 | [
"BSD-3-Clause"
] | 5 | 2016-08-02T09:34:33.000Z | 2017-10-12T15:02:09.000Z | blo/tests/test_blog.py | jamess098/blo | a4ab03b691d9809eb4a1f46669ae51e882640520 | [
"BSD-3-Clause"
] | 8 | 2015-12-06T00:03:28.000Z | 2021-01-19T02:46:46.000Z | import unittest
import os
import shutil
import sys
import subprocess
from datetime import datetime
import blog
class SandboxTestCase(unittest.TestCase):
def make_sandbox(self):
self.sandbox = '{0}/test-artifacts/'.format(
os.getcwd(),
self.__class__.__name__,
self._tes... | 23.923077 | 79 | 0.567754 | import unittest
import os
import shutil
import sys
import subprocess
from datetime import datetime
import blog
class SandboxTestCase(unittest.TestCase):
def make_sandbox(self):
self.sandbox = '{0}/test-artifacts/'.format(
os.getcwd(),
self.__class__.__name__,
self._tes... | true | true |
1c29560bd901dd155bbd1f8c7aec307de3c8a9c3 | 898 | py | Python | setup.py | someshchaturvedi/reference-sequence-fetcher | 76bd99021e317fc85c9ea3b62b85bfaaf95139d8 | [
"MIT"
] | null | null | null | setup.py | someshchaturvedi/reference-sequence-fetcher | 76bd99021e317fc85c9ea3b62b85bfaaf95139d8 | [
"MIT"
] | 3 | 2018-06-25T08:01:42.000Z | 2021-06-01T22:12:37.000Z | setup.py | someshchaturvedi/reference-sequence-fetcher | 76bd99021e317fc85c9ea3b62b85bfaaf95139d8 | [
"MIT"
] | 1 | 2018-08-28T15:06:34.000Z | 2018-08-28T15:06:34.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
install_requires = ['requests', 'click']
setuptools.setup(
name="reference-sequence-fetcher",
version="0.0.1",
author="Somesh Chaturvedi",
author_email="somesh.08.96@gmail.com",
description="A client library for... | 30.965517 | 73 | 0.69265 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
install_requires = ['requests', 'click']
setuptools.setup(
name="reference-sequence-fetcher",
version="0.0.1",
author="Somesh Chaturvedi",
author_email="somesh.08.96@gmail.com",
description="A client library for... | true | true |
1c29567663e802bf2f84453941b357a9cf540c63 | 3,146 | py | Python | doc/kendo/src/ch1/kw.py | axiros/transcrypt_material | 2fdffe0331ea6c368fc1dde3bd1102135c082fa9 | [
"BSD-3-Clause"
] | 3 | 2016-07-25T11:39:11.000Z | 2016-11-29T23:54:30.000Z | doc/kendo/src/ch1/kw.py | axiros/transcrypt_material | 2fdffe0331ea6c368fc1dde3bd1102135c082fa9 | [
"BSD-3-Clause"
] | null | null | null | doc/kendo/src/ch1/kw.py | axiros/transcrypt_material | 2fdffe0331ea6c368fc1dde3bd1102135c082fa9 | [
"BSD-3-Clause"
] | null | null | null | __pragma__ ('alias', 'S', '$')
from observable import Observable
class PyWin:
width = '200px'
class Window(Observable, kendo.ui.Window):
widget = None
def __init__(self, parent):
self.parent = parent
__pragma__('js', '{}', '''
(function ($) {
var ui = kendo.ui,
Window = ui.... | 26 | 121 | 0.433566 | __pragma__ ('alias', 'S', '$')
from observable import Observable
class PyWin:
width = '200px'
class Window(Observable, kendo.ui.Window):
widget = None
def __init__(self, parent):
self.parent = parent
__pragma__('js', '{}', '''
(function ($) {
var ui = kendo.ui,
Window = ui.... | true | true |
1c2956def60605ec34862223be70ec7739dc72e9 | 7,481 | py | Python | orttraining/orttraining/test/python/orttraining_run_glue.py | thorjohnsen/onnxruntime | 81101c9efd15a69342dec94362cf7c29a4e41be9 | [
"MIT"
] | null | null | null | orttraining/orttraining/test/python/orttraining_run_glue.py | thorjohnsen/onnxruntime | 81101c9efd15a69342dec94362cf7c29a4e41be9 | [
"MIT"
] | null | null | null | orttraining/orttraining/test/python/orttraining_run_glue.py | thorjohnsen/onnxruntime | 81101c9efd15a69342dec94362cf7c29a4e41be9 | [
"MIT"
] | null | null | null | # adapted from run_glue.py of huggingface transformers
import dataclasses
import logging
import os
from dataclasses import dataclass, field
from typing import Dict, Optional
import unittest
import numpy as np
from transformers import (
AutoConfig,
AutoModelForSequenceClassification,
AutoTokenizer,
Eva... | 37.974619 | 124 | 0.651517 |
import dataclasses
import logging
import os
from dataclasses import dataclass, field
from typing import Dict, Optional
import unittest
import numpy as np
from transformers import (
AutoConfig,
AutoModelForSequenceClassification,
AutoTokenizer,
EvalPrediction,
GlueDataset,
GlueDataTrainingArgum... | true | true |
1c29574ee1ec1c51987460e77af49748a10f6490 | 1,870 | py | Python | pythonbrew/commands/buildout.py | igroff/pythonbrew | 4d5042cbac129226d6a807e10763e0ee24480f47 | [
"Unlicense"
] | 2 | 2015-01-07T17:26:48.000Z | 2016-08-29T08:42:55.000Z | pythonbrew/commands/buildout.py | idobatter/pythonbrew | e8823c5494a26e2c91aa516eac80b748474ba129 | [
"Unlicense"
] | null | null | null | pythonbrew/commands/buildout.py | idobatter/pythonbrew | e8823c5494a26e2c91aa516eac80b748474ba129 | [
"Unlicense"
] | null | null | null | import os
import sys
import subprocess
from pythonbrew.basecommand import Command
from pythonbrew.define import PATH_PYTHONS, BOOTSTRAP_DLSITE
from pythonbrew.util import Package, get_using_python_pkgname, Link, is_installed
from pythonbrew.log import logger
from pythonbrew.downloader import Downloader
class BuildoutC... | 31.694915 | 89 | 0.605348 | import os
import sys
import subprocess
from pythonbrew.basecommand import Command
from pythonbrew.define import PATH_PYTHONS, BOOTSTRAP_DLSITE
from pythonbrew.util import Package, get_using_python_pkgname, Link, is_installed
from pythonbrew.log import logger
from pythonbrew.downloader import Downloader
class BuildoutC... | true | true |
1c2958652c7764e4b6a9a9a1eca0b368b880ea37 | 903 | py | Python | personal_mycroft_backend/database/__init__.py | flatsiedatsie/personal-backend | ebeca60a7e4a7057fde394fe9865bc8f05a9c2f2 | [
"Apache-2.0"
] | 120 | 2019-01-03T22:41:06.000Z | 2022-03-24T22:04:27.000Z | personal_mycroft_backend/database/__init__.py | flatsiedatsie/personal-backend | ebeca60a7e4a7057fde394fe9865bc8f05a9c2f2 | [
"Apache-2.0"
] | 30 | 2019-01-03T05:22:04.000Z | 2022-02-28T07:07:08.000Z | personal_mycroft_backend/database/__init__.py | flatsiedatsie/personal-backend | ebeca60a7e4a7057fde394fe9865bc8f05a9c2f2 | [
"Apache-2.0"
] | 33 | 2019-01-09T11:36:34.000Z | 2022-03-30T03:26:54.000Z | # Copyright 2019 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 29.129032 | 81 | 0.743079 | from sqlalchemy.ext.declarative import declarative_base
__author__ = "JarbasAI"
Base = declarative_base()
def model_to_dict(obj):
serialized_data = {c.key: getattr(obj, c.key) for c in obj.__table__.columns}
return serialized_data
def props(cls):
return [i for i in cls.__dict__.keys() if i[:1] != '_'... | true | true |
1c2959a7bca8bdd21f189bf4e4657e529ad5ae8a | 2,672 | py | Python | psq/datastore_storage.py | Tomesco/bookshelf-demo-project | 9d422f3aa04edbb3312d3e177caf699653ed6a73 | [
"Apache-2.0"
] | 210 | 2015-07-29T16:50:01.000Z | 2022-03-02T15:24:52.000Z | psq/datastore_storage.py | Tomesco/bookshelf-demo-project | 9d422f3aa04edbb3312d3e177caf699653ed6a73 | [
"Apache-2.0"
] | 60 | 2015-12-03T23:15:57.000Z | 2021-01-21T09:25:42.000Z | psq/datastore_storage.py | Tomesco/bookshelf-demo-project | 9d422f3aa04edbb3312d3e177caf699653ed6a73 | [
"Apache-2.0"
] | 47 | 2015-12-21T06:09:36.000Z | 2021-09-04T13:20:21.000Z | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.688889 | 79 | 0.655314 |
from __future__ import absolute_import
from datetime import datetime
from google.cloud import datastore
from six.moves import range
from .storage import Storage
from .task import FAILED, FINISHED
from .utils import dumps, loads
DATASTORE_KIND_PREFIX = 'psq'
class DatastoreStorage(Storage):
store_on_status =... | true | true |
1c2959ed0362cf39ac343a5e7c5cc6d66f163588 | 12,379 | py | Python | tests/mypy_test.py | DetachHead/typeshed | 7746d0ab732b14f3e6b7f827b4d4e7fbd85df105 | [
"Apache-2.0"
] | null | null | null | tests/mypy_test.py | DetachHead/typeshed | 7746d0ab732b14f3e6b7f827b4d4e7fbd85df105 | [
"Apache-2.0"
] | null | null | null | tests/mypy_test.py | DetachHead/typeshed | 7746d0ab732b14f3e6b7f827b4d4e7fbd85df105 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Test runner for typeshed.
Depends on mypy being installed.
Approach:
1. Parse sys.argv
2. Compute appropriate arguments for mypy
3. Stuff those arguments into sys.argv
4. Run mypy.main('')
5. Repeat steps 2-4 for other mypy runs (e.g. --py2)
"""
import argparse
import os
import re
import s... | 34.578212 | 123 | 0.608369 |
import argparse
import os
import re
import sys
import tempfile
from glob import glob
from pathlib import Path
from typing import Dict, NamedTuple
import tomli
parser = argparse.ArgumentParser(description="Test runner for typeshed. Patterns are unanchored regexps on the full path.")
parser.add_argument("-v", "--verbo... | true | true |
1c295b1d5c8a2980d90eb76b2ca5acb512c174b9 | 2,615 | py | Python | jobs/migrations/0009_auto_20201013_2033.py | northcott-j/jobhopper | f1996a1b27a34fe3883ba0b6c05cf853884cd4c7 | [
"MIT"
] | null | null | null | jobs/migrations/0009_auto_20201013_2033.py | northcott-j/jobhopper | f1996a1b27a34fe3883ba0b6c05cf853884cd4c7 | [
"MIT"
] | null | null | null | jobs/migrations/0009_auto_20201013_2033.py | northcott-j/jobhopper | f1996a1b27a34fe3883ba0b6c05cf853884cd4c7 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-10-14 00:33
from django.db import migrations, models, connection
from data.scripts.sql_loader import (
load_bls_oes_to_sql,
load_occupation_transitions_to_sql,
)
class Migration(migrations.Migration):
"""
Update the model to have autofield to accomodate auto-increment... | 35.337838 | 182 | 0.628681 | from django.db import migrations, models, connection
from data.scripts.sql_loader import (
load_bls_oes_to_sql,
load_occupation_transitions_to_sql,
)
class Migration(migrations.Migration):
dependencies = [
("jobs", "0008_auto_20201006_AddStateData"),
]
def forwards_source_data(apps, sche... | true | true |
1c295bd8906e2a21ef64bba0e131bb2f3de2c960 | 224 | py | Python | app/__init__.py | queenfiona/SendITv3 | 87519a096438e70da2e69f410d3f4cc2dae50109 | [
"MIT"
] | null | null | null | app/__init__.py | queenfiona/SendITv3 | 87519a096438e70da2e69f410d3f4cc2dae50109 | [
"MIT"
] | 3 | 2021-03-18T21:26:58.000Z | 2021-09-08T00:35:24.000Z | app/__init__.py | queenfiona/SendITv3 | 87519a096438e70da2e69f410d3f4cc2dae50109 | [
"MIT"
] | 1 | 2018-11-11T20:56:54.000Z | 2018-11-11T20:56:54.000Z | """docstring for flask."""
from flask import Flask
from .api.v1 import version_1
def create_app():
"""Docstring for create_app method."""
app = Flask(__name__)
app.register_blueprint(version_1)
return app
| 18.666667 | 42 | 0.700893 | from flask import Flask
from .api.v1 import version_1
def create_app():
app = Flask(__name__)
app.register_blueprint(version_1)
return app
| true | true |
1c295cca5e7114adf7697021e6943fc19feae757 | 531 | py | Python | tests/utils.py | hasty-ai/hasty-python | e286c6cba8216d7b840a7fde5dc37b472b23296c | [
"MIT"
] | 1 | 2022-02-27T08:09:08.000Z | 2022-02-27T08:09:08.000Z | tests/utils.py | hasty-ai/hasty-python | e286c6cba8216d7b840a7fde5dc37b472b23296c | [
"MIT"
] | 3 | 2021-07-26T15:20:20.000Z | 2022-03-29T22:58:27.000Z | tests/utils.py | hasty-ai/hasty-python | e286c6cba8216d7b840a7fde5dc37b472b23296c | [
"MIT"
] | 2 | 2021-09-12T01:59:56.000Z | 2022-03-12T02:40:06.000Z | import os
from hasty import Client
img_url = "https://images.ctfassets.net/hiiv1w4761fl/6NhZFymLPiX8abIUuEYV7i/c7a63c3a56e7e4f40cfd459c01a10853" \
"/Untitled_presentation__6_.jpg?w=945&h=494&q=50&fit=fill"
def get_client():
API_KEY = os.environ.get("HASTY_API_KEY")
BASE_URL = os.environ.get("HAST... | 29.5 | 111 | 0.709981 | import os
from hasty import Client
img_url = "https://images.ctfassets.net/hiiv1w4761fl/6NhZFymLPiX8abIUuEYV7i/c7a63c3a56e7e4f40cfd459c01a10853" \
"/Untitled_presentation__6_.jpg?w=945&h=494&q=50&fit=fill"
def get_client():
API_KEY = os.environ.get("HASTY_API_KEY")
BASE_URL = os.environ.get("HAST... | true | true |
1c295d700e3dd3d8dacdd36d7ed5541d4f0646ef | 26,555 | py | Python | initial_rel.py | xszhang0320/sjtu_csic | fc0dd8472c47dc9d5a8f232a9cf42128afd14ecb | [
"Apache-2.0"
] | null | null | null | initial_rel.py | xszhang0320/sjtu_csic | fc0dd8472c47dc9d5a8f232a9cf42128afd14ecb | [
"Apache-2.0"
] | null | null | null | initial_rel.py | xszhang0320/sjtu_csic | fc0dd8472c47dc9d5a8f232a9cf42128afd14ecb | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
#embedding the position
def pos_embed(x):
if x < -60:
return 0
if x >= -60 and x <= 60:
return x+61
if x > 60:
return 122
#find the index of x in y, if x not in y, return -1
def find_index(x,y):
flag = -1
for i in range(len(y)):
if x != y[i]:
continue
else:
return i
... | 29.085433 | 121 | 0.596535 | import numpy as np
import os
def pos_embed(x):
if x < -60:
return 0
if x >= -60 and x <= 60:
return x+61
if x > 60:
return 122
def find_index(x,y):
flag = -1
for i in range(len(y)):
if x != y[i]:
continue
else:
return i
return flag
def init():
print 'reading word embedding data...'
vec = []
... | false | true |
1c295d82603645ba19b937545ee8f32abdcbb009 | 28,496 | py | Python | reference_quality_predictor/model_bac.py | Aliossandro/WD_references_analysis | ee054182dd398fed90fce49fdfa4b8cd6192f38e | [
"MIT"
] | 5 | 2017-05-10T08:40:30.000Z | 2020-04-27T07:28:48.000Z | reference_quality_predictor/model_bac.py | Aliossandro/WD_references_analysis | ee054182dd398fed90fce49fdfa4b8cd6192f38e | [
"MIT"
] | null | null | null | reference_quality_predictor/model_bac.py | Aliossandro/WD_references_analysis | ee054182dd398fed90fce49fdfa4b8cd6192f38e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on May 1 2017
@author: Alessandro
"""
import os
import sys
import argparse
reload(sys)
sys.setdefaultencoding("utf8")
import pandas as pd
import scipy as sp
import numpy as np
import chardet
import re
from joblib import dump, load
from sklearn.feature_extraction import DictVec... | 43.439024 | 149 | 0.60019 | """
Created on May 1 2017
@author: Alessandro
"""
import os
import sys
import argparse
reload(sys)
sys.setdefaultencoding("utf8")
import pandas as pd
import scipy as sp
import numpy as np
import chardet
import re
from joblib import dump, load
from sklearn.feature_extraction import DictVectorizer
from sklearn.fea... | false | true |
1c295da2ccda7aa4bd1bdc9886367863d7493a77 | 444 | py | Python | sim_max.py | qiange15/channel_tools | c8f49c203201898ef90b86aac8c97ad70653b053 | [
"BSD-2-Clause"
] | 1 | 2016-12-16T14:56:20.000Z | 2016-12-16T14:56:20.000Z | sim_max.py | qiange15/channel_tools | c8f49c203201898ef90b86aac8c97ad70653b053 | [
"BSD-2-Clause"
] | null | null | null | sim_max.py | qiange15/channel_tools | c8f49c203201898ef90b86aac8c97ad70653b053 | [
"BSD-2-Clause"
] | null | null | null | # sim_max.py
#
# Find the greatest simulated capacities.
#
# This code is experimental, and error-handling is primitive.
#
# Copyright 2013, NICTA. See COPYRIGHT for license details.
#!/usr/bin/env python
import sys
ymax= -1
for l in sys.stdin:
bits= l.strip().split(' ')
if len(bits) == 0: continue
if ... | 17.76 | 61 | 0.630631 |
import sys
ymax= -1
for l in sys.stdin:
bits= l.strip().split(' ')
if len(bits) == 0: continue
if bits[0] == '#': continue
x, y, ye= map(float, bits)
if y+ye > ymax: ymax= y+ye
print "%.2e %.12e" % (ymax, ymax)
| false | true |
1c295e163f13d05e45b380d8aadfef04f936f788 | 349 | py | Python | chapter6/code/pywebfuzz/demofuzzdb2.py | abbbhucho/Mastering-Python-for-Networking-and-Security | f4fb1131253e9daad8da501c297758fdcedfbac3 | [
"MIT"
] | 98 | 2018-05-13T20:41:43.000Z | 2022-03-31T00:24:01.000Z | chapter6/code/pywebfuzz/demofuzzdb2.py | Cyb3rid10ts/Mastering-Python-for-Networking-and-Security | 4cf04d1758f17ae378b5e3422404e5b7a174a243 | [
"MIT"
] | null | null | null | chapter6/code/pywebfuzz/demofuzzdb2.py | Cyb3rid10ts/Mastering-Python-for-Networking-and-Security | 4cf04d1758f17ae378b5e3422404e5b7a174a243 | [
"MIT"
] | 62 | 2018-06-19T13:46:34.000Z | 2022-02-11T05:47:24.000Z | from pywebfuzz import fuzzdb
import requests
httpMethods= fuzzdb.attack_payloads.http_protocol.http_protocol_methods
domain = "http://www.google.com"
for method in httpMethods:
print("Testing... "+ domain +"/"+ method)
response = requests.get(domain, method)
if response.status_code not in range(400,599):
print(... | 29.083333 | 71 | 0.759312 | from pywebfuzz import fuzzdb
import requests
httpMethods= fuzzdb.attack_payloads.http_protocol.http_protocol_methods
domain = "http://www.google.com"
for method in httpMethods:
print("Testing... "+ domain +"/"+ method)
response = requests.get(domain, method)
if response.status_code not in range(400,599):
print(... | true | true |
1c295e3fab75928be1fba0f4c3c432768457e8bf | 21,643 | py | Python | py/plot.py | vipasi/indiacovid19 | 08c5799cb0ad531b26b63a0faaeb22cdf45a80a8 | [
"MIT"
] | null | null | null | py/plot.py | vipasi/indiacovid19 | 08c5799cb0ad531b26b63a0faaeb22cdf45a80a8 | [
"MIT"
] | null | null | null | py/plot.py | vipasi/indiacovid19 | 08c5799cb0ad531b26b63a0faaeb22cdf45a80a8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# Copyright (c) 2020 Susam Pal
# Licensed under the terms of the MIT License.
# The MIT License (MIT)
#
# Copyright (c) 2020 Susam Pal
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal i... | 38.238516 | 79 | 0.619831 |
import argparse
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
from py import archive, log
total_color = '#06c'
active_color = '#f60'
cured_color = '#393'
death_color = '#c33'
recent_days = 30
def plot_begin(data):
global formatted_dates
formatted_dates = [d.strftime('%d %b') for d i... | true | true |
1c295e87d29885f37111df763f29ccbf61e04092 | 872 | py | Python | test/test_decode.py | denchii/configurator | f504d0397b57884cbe7a8efe4ca3d7bdedaaed62 | [
"MIT"
] | null | null | null | test/test_decode.py | denchii/configurator | f504d0397b57884cbe7a8efe4ca3d7bdedaaed62 | [
"MIT"
] | null | null | null | test/test_decode.py | denchii/configurator | f504d0397b57884cbe7a8efe4ca3d7bdedaaed62 | [
"MIT"
] | null | null | null | from ..configurator import MapDecoder, MapEncoder
import json
from pathlib import Path
raw_data = {
"project": {
"build": {"type": "Debug"},
"dependecies": {
"jsonschema": None,
"libnacl": "^1.7.2",
"python": False,
"pytomlpp": True,
},
... | 26.424242 | 64 | 0.591743 | from ..configurator import MapDecoder, MapEncoder
import json
from pathlib import Path
raw_data = {
"project": {
"build": {"type": "Debug"},
"dependecies": {
"jsonschema": None,
"libnacl": "^1.7.2",
"python": False,
"pytomlpp": True,
},
... | true | true |
1c295f01504994f45456a4e9cec9a5ee0c1dcd28 | 4,115 | py | Python | helga_versionone/tests/test_alias.py | aarcro/helga-versionone | 3ae1dd538c8b33dd0e835470847226266dcba0e2 | [
"MIT"
] | 4 | 2015-01-02T22:04:56.000Z | 2015-11-11T16:20:35.000Z | helga_versionone/tests/test_alias.py | aarcro/helga-versionone | 3ae1dd538c8b33dd0e835470847226266dcba0e2 | [
"MIT"
] | 15 | 2015-01-02T17:44:07.000Z | 2020-05-21T17:51:15.000Z | helga_versionone/tests/test_alias.py | aarcro/helga-versionone | 3ae1dd538c8b33dd0e835470847226266dcba0e2 | [
"MIT"
] | 1 | 2016-05-23T20:30:29.000Z | 2016-05-23T20:30:29.000Z | from mock import call
from .util import V1TestCase
class TestAliasCommand(V1TestCase):
def test_no_args_no_match(self):
# v1_nick = db.v1_user_map.find_one(lookup)['v1_nick']
self.db.v1_user_map.find_one.return_value = {}
return self._test_command(
'alias',
'{0} is... | 31.899225 | 81 | 0.586877 | from mock import call
from .util import V1TestCase
class TestAliasCommand(V1TestCase):
def test_no_args_no_match(self):
self.db.v1_user_map.find_one.return_value = {}
return self._test_command(
'alias',
'{0} is known as {1} in V1'.format(self.nick, self.nick),
... | true | true |
1c295f4a3e105467abaf2c4d1e2dd38fb48202a7 | 7,563 | py | Python | migratemonitors.py | psi09/nr-account-migration | 31ab8a2d998b2ee66305fe454346f3c874982f42 | [
"Apache-2.0"
] | null | null | null | migratemonitors.py | psi09/nr-account-migration | 31ab8a2d998b2ee66305fe454346f3c874982f42 | [
"Apache-2.0"
] | null | null | null | migratemonitors.py | psi09/nr-account-migration | 31ab8a2d998b2ee66305fe454346f3c874982f42 | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import sys
import time
import library.localstore as store
import library.migrationlogger as migrationlogger
from library.clients.monitorsclient import get_monitor, post_monitor_definition, populate_script, \
put_script, apply_tags
import library.monitortypes as monitortypes
import library... | 50.42 | 127 | 0.693772 | import argparse
import os
import sys
import time
import library.localstore as store
import library.migrationlogger as migrationlogger
from library.clients.monitorsclient import get_monitor, post_monitor_definition, populate_script, \
put_script, apply_tags
import library.monitortypes as monitortypes
import library... | true | true |
1c29612334f3b1d56923340e6ffe1ccbf411010d | 99 | py | Python | smart-bookmarks-django/smart_bookmarks/core/apps.py | tpiwonski/smart-bookmarks | 747968ad96242937c9369776bbf52bf44b4b87b4 | [
"MIT"
] | null | null | null | smart-bookmarks-django/smart_bookmarks/core/apps.py | tpiwonski/smart-bookmarks | 747968ad96242937c9369776bbf52bf44b4b87b4 | [
"MIT"
] | 1 | 2021-03-10T12:22:14.000Z | 2021-03-10T12:22:14.000Z | smart-bookmarks-django/smart_bookmarks/core/apps.py | tpiwonski/smart-bookmarks | 747968ad96242937c9369776bbf52bf44b4b87b4 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CoreConfig(AppConfig):
name = "smart_bookmarks.core"
| 16.5 | 33 | 0.767677 | from django.apps import AppConfig
class CoreConfig(AppConfig):
name = "smart_bookmarks.core"
| true | true |
1c2961a424d823aa0373f34f78a3874a72979cb1 | 572 | py | Python | models/__init__.py | shiyu-wangbyte/leadopt | ef289ab349a19ba1f8aa581638ef7e8e3810cb41 | [
"Apache-2.0"
] | null | null | null | models/__init__.py | shiyu-wangbyte/leadopt | ef289ab349a19ba1f8aa581638ef7e8e3810cb41 | [
"Apache-2.0"
] | null | null | null | models/__init__.py | shiyu-wangbyte/leadopt | ef289ab349a19ba1f8aa581638ef7e8e3810cb41 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Jacob Durrant
# 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, sof... | 40.857143 | 77 | 0.770979 | true | true | |
1c2961e4a068be97f4891cfcc5a4f6fc5a692073 | 2,420 | py | Python | setup.py | matheusmatos/django-rest-models | 18da71bd921064279b03129aac38d3fbb9e29ae2 | [
"BSD-2-Clause"
] | null | null | null | setup.py | matheusmatos/django-rest-models | 18da71bd921064279b03129aac38d3fbb9e29ae2 | [
"BSD-2-Clause"
] | null | null | null | setup.py | matheusmatos/django-rest-models | 18da71bd921064279b03129aac38d3fbb9e29ae2 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import rest_models
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = rest_models.__VERSION__
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
os.environ['DJANGO_SETTINGS_MODULE'] = 'testsetti... | 30.25 | 97 | 0.631818 |
import os
import sys
import rest_models
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = rest_models.__VERSION__
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
os.environ['DJANGO_SETTINGS_MODULE'] = 'testsettings'
if sys.argv[-1] == 'publish':
os... | true | true |
1c29623970cc411e5ac5fc1a68a6bbaf69dc0ffa | 8,502 | py | Python | SBaaS_MFA/stage02_isotopomer_fittedNetFluxDifferences_execute.py | dmccloskey/SBaaS_MFA | 005e1d34c2ace7e28c53dffcab3e9cb8c7e7ce18 | [
"MIT"
] | null | null | null | SBaaS_MFA/stage02_isotopomer_fittedNetFluxDifferences_execute.py | dmccloskey/SBaaS_MFA | 005e1d34c2ace7e28c53dffcab3e9cb8c7e7ce18 | [
"MIT"
] | null | null | null | SBaaS_MFA/stage02_isotopomer_fittedNetFluxDifferences_execute.py | dmccloskey/SBaaS_MFA | 005e1d34c2ace7e28c53dffcab3e9cb8c7e7ce18 | [
"MIT"
] | null | null | null | #SBaaS
from .stage02_isotopomer_fittedNetFluxDifferences_io import stage02_isotopomer_fittedNetFluxDifferences_io
from .stage02_isotopomer_fittedNetFluxes_query import stage02_isotopomer_fittedNetFluxes_query
#Resources
from genomeScale_MFA.MFA_methods import MFA_methods
class stage02_isotopomer_fittedNetFluxDifferenc... | 70.264463 | 261 | 0.623147 | from .stage02_isotopomer_fittedNetFluxDifferences_io import stage02_isotopomer_fittedNetFluxDifferences_io
from .stage02_isotopomer_fittedNetFluxes_query import stage02_isotopomer_fittedNetFluxes_query
from genomeScale_MFA.MFA_methods import MFA_methods
class stage02_isotopomer_fittedNetFluxDifferences_execute(stage02... | true | true |
1c296319654e1f84161a6b6ffeff5183a987e1c4 | 15,802 | py | Python | superset/jinja_context.py | alihankocak/superset | 8d0776491aef05f375c7359d11fc9ec04a53ec57 | [
"Apache-2.0"
] | null | null | null | superset/jinja_context.py | alihankocak/superset | 8d0776491aef05f375c7359d11fc9ec04a53ec57 | [
"Apache-2.0"
] | null | null | null | superset/jinja_context.py | alihankocak/superset | 8d0776491aef05f375c7359d11fc9ec04a53ec57 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.352174 | 90 | 0.646943 | import json
import re
from functools import partial
from typing import Any, Callable, cast, Dict, List, Optional, Tuple, TYPE_CHECKING
from flask import current_app, g, request
from flask_babel import gettext as _
from jinja2 import DebugUndefined
from jinja2.sandbox import SandboxedEnvironment
from superset.exceptio... | true | true |
1c29636aae9375dc21814c26a4eaf2a35e73a50f | 161 | py | Python | simple_logger.py | soda92/ftp_upload_service | d087ffda7b2920329efac8292fa37731566c6984 | [
"MIT"
] | null | null | null | simple_logger.py | soda92/ftp_upload_service | d087ffda7b2920329efac8292fa37731566c6984 | [
"MIT"
] | null | null | null | simple_logger.py | soda92/ftp_upload_service | d087ffda7b2920329efac8292fa37731566c6984 | [
"MIT"
] | null | null | null | import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
logging.info("sdf")
| 32.2 | 85 | 0.602484 | import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
logging.info("sdf")
| true | true |
1c2963724712efc4c430269f4eeb69e21a55b217 | 1,623 | py | Python | setup.py | bohan-amplitude/Amplitude-Python | 8eb6e5242d77a84d6516dce96e8b8411e6fc1247 | [
"MIT"
] | null | null | null | setup.py | bohan-amplitude/Amplitude-Python | 8eb6e5242d77a84d6516dce96e8b8411e6fc1247 | [
"MIT"
] | null | null | null | setup.py | bohan-amplitude/Amplitude-Python | 8eb6e5242d77a84d6516dce96e8b8411e6fc1247 | [
"MIT"
] | 2 | 2022-03-31T21:40:43.000Z | 2022-03-31T21:42:54.000Z | import sys
from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent.resolve()
sys.path.insert(0, str(here / 'src'))
from amplitude.constants import SDK_VERSION
# Get the long description from the README file
long_description = (here / "README.md").read_text(encoding="utf-8")
s... | 36.066667 | 93 | 0.664818 | import sys
from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent.resolve()
sys.path.insert(0, str(here / 'src'))
from amplitude.constants import SDK_VERSION
long_description = (here / "README.md").read_text(encoding="utf-8")
setup(
name="amplitude-analytics",
versio... | true | true |
1c2963ba8ddbe829c3a4ef63cef22a7b673900f3 | 237 | py | Python | PhantomJS_Sample/phantom_example.py | twodulls/pythonsample | f576f79be75d96df61e26ef79a0e36a6feedfec1 | [
"Apache-2.0"
] | null | null | null | PhantomJS_Sample/phantom_example.py | twodulls/pythonsample | f576f79be75d96df61e26ef79a0e36a6feedfec1 | [
"Apache-2.0"
] | null | null | null | PhantomJS_Sample/phantom_example.py | twodulls/pythonsample | f576f79be75d96df61e26ef79a0e36a6feedfec1 | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
#executable_path 항목의 경로부분 앞에 꼭 r을 추가해야 한다.
driver = webdriver.PhantomJS(executable_path=r'C:\phantomjs-2.1.1-windows\bin\phantomjs.exe')
driver.get("http://www.naver.com")
print(driver.title)
driver.quit() | 33.857143 | 93 | 0.780591 | from selenium import webdriver
driver = webdriver.PhantomJS(executable_path=r'C:\phantomjs-2.1.1-windows\bin\phantomjs.exe')
driver.get("http://www.naver.com")
print(driver.title)
driver.quit() | true | true |
1c29640d0b6577223cbbe4aff401eb8ead60eb4c | 1,552 | py | Python | merge/merge.py | AnSchwarzkopf/MergeIntervals | 30d771fa3546016919969aa9adb39c0be6f014ac | [
"MIT"
] | null | null | null | merge/merge.py | AnSchwarzkopf/MergeIntervals | 30d771fa3546016919969aa9adb39c0be6f014ac | [
"MIT"
] | null | null | null | merge/merge.py | AnSchwarzkopf/MergeIntervals | 30d771fa3546016919969aa9adb39c0be6f014ac | [
"MIT"
] | null | null | null | # @Andreas Schwarzkopf (schwarzkopf.and@gmail.com)
# standard library
# using List to handle duplicates and order of the intervals and to define input/output of function
from typing import List
# example input [[25,30],[2,19],[14,23],4,8]]
# Expected type for input and output are a List of Lists of Integers
... | 44.342857 | 130 | 0.691366 |
from typing import List
def mergeIntervals(intervals: List[List[int]]) -> List[List[int]]:
mergedIntervals = []
if not isinstance(intervals, List):
raise TypeError
if not intervals:
return []
intervals.sort(key=lambda x: x[0])
for interval in interva... | true | true |
1c29645ed4ee1464c59e6701c954ef54fb85f6b0 | 3,368 | py | Python | kimp_calc.py | owen151128/kimp_calc | 8900cad1bb8871dba348258a2315a3d1c0348c4d | [
"Apache-2.0"
] | 1 | 2021-05-28T04:15:38.000Z | 2021-05-28T04:15:38.000Z | kimp_calc.py | owen151128/kimp_calc | 8900cad1bb8871dba348258a2315a3d1c0348c4d | [
"Apache-2.0"
] | null | null | null | kimp_calc.py | owen151128/kimp_calc | 8900cad1bb8871dba348258a2315a3d1c0348c4d | [
"Apache-2.0"
] | 1 | 2022-03-22T21:55:31.000Z | 2022-03-22T21:55:31.000Z | # -*- coding:utf8 -*-
from rich.console import Console
from rich.table import Table
from rich.live import Live
from time import sleep
import requests
import ccxt
import pyupbit
version = '1.0.0'
headers = {'User-Agent': 'Mozilla/5.0 '
'(Macintosh; Intel Mac OS X 10_15_7) '
... | 42.632911 | 117 | 0.680523 |
from rich.console import Console
from rich.table import Table
from rich.live import Live
from time import sleep
import requests
import ccxt
import pyupbit
version = '1.0.0'
headers = {'User-Agent': 'Mozilla/5.0 '
'(Macintosh; Intel Mac OS X 10_15_7) '
'AppleWebKit/5... | true | true |
1c296460c9e31b7636c6b712b5d15268a5ace7d8 | 2,417 | py | Python | setup.py | liyongyue/dnsspider | ab29fb240c45bf16e146e96acff41aea29591f51 | [
"0BSD"
] | null | null | null | setup.py | liyongyue/dnsspider | ab29fb240c45bf16e146e96acff41aea29591f51 | [
"0BSD"
] | null | null | null | setup.py | liyongyue/dnsspider | ab29fb240c45bf16e146e96acff41aea29591f51 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (C) 2003-2006 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE ... | 38.365079 | 77 | 0.693008 |
import sys
from distutils.core import setup
version = '1.5.0'
kwargs = {
'name' : 'dnspython',
'version' : version,
'description' : 'DNS toolkit',
'long_description' : \
"""dnspython is a DNS toolkit for Python. It supports almost all
record types. It can be used for queries, zone transfers, and ... | true | true |
1c2966b2b3d6c5ad00db52513056e6c66d4a98b1 | 381 | py | Python | experiments/realdata/scripts/extract_subsam.py | Parsoa/SVSS | 0f36b268b9a0bf83b4d909d4d485cf75f58f9401 | [
"MIT"
] | null | null | null | experiments/realdata/scripts/extract_subsam.py | Parsoa/SVSS | 0f36b268b9a0bf83b4d909d4d485cf75f58f9401 | [
"MIT"
] | null | null | null | experiments/realdata/scripts/extract_subsam.py | Parsoa/SVSS | 0f36b268b9a0bf83b4d909d4d485cf75f58f9401 | [
"MIT"
] | null | null | null | import sys
import pysam
def main():
sampath = sys.argv[1]
fpath = sys.argv[2]
idxs = set()
for line in open(fpath):
idxs.add(line.strip('\n'))
sam = pysam.AlignmentFile(sampath, 'r')
print(sam.header, end='')
for al in sam.fetch():
if al.query_name in idxs:
pr... | 18.142857 | 43 | 0.572178 | import sys
import pysam
def main():
sampath = sys.argv[1]
fpath = sys.argv[2]
idxs = set()
for line in open(fpath):
idxs.add(line.strip('\n'))
sam = pysam.AlignmentFile(sampath, 'r')
print(sam.header, end='')
for al in sam.fetch():
if al.query_name in idxs:
pr... | true | true |
1c296886c5b793096c817ea34a9d8244ea5f3175 | 71,417 | py | Python | keras-ssd-master/data_generator/object_detection_2d_data_generator.py | dlsaavedra/Detector_GDXray | 1e120f8fa548819eef1b86ccfbbe306b44405b6f | [
"MIT"
] | 3 | 2021-05-27T07:27:44.000Z | 2022-02-19T05:20:16.000Z | keras-ssd-master/data_generator/object_detection_2d_data_generator.py | dlsaavedra/Detector_GDXray | 1e120f8fa548819eef1b86ccfbbe306b44405b6f | [
"MIT"
] | 8 | 2020-09-25T22:34:27.000Z | 2022-02-10T01:09:19.000Z | keras-ssd-master/data_generator/object_detection_2d_data_generator.py | dlsaavedra/Detector_GDXray | 1e120f8fa548819eef1b86ccfbbe306b44405b6f | [
"MIT"
] | 3 | 2020-03-18T20:27:18.000Z | 2021-11-03T03:10:11.000Z | '''
A data generator for 2D object detection.
Copyright (C) 2018 Pierluigi Ferrari
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... | 58.109845 | 211 | 0.578826 |
from __future__ import division
import numpy as np
import inspect
from collections import defaultdict
import warnings
import sklearn.utils
from copy import deepcopy
from PIL import Image
import cv2
import csv
import os
import sys
from tqdm import tqdm, trange
try:
import h5py
except ImportError:
warnings.warn(... | true | true |
1c2969c81f21d96b7a740e516fdd647185eba6a4 | 8,547 | py | Python | tests/python/test_mpm88.py | mzmzm/taichi | 39129820a922fdd936728d6feb7944ae208345a5 | [
"MIT"
] | 11,699 | 2020-01-09T03:02:46.000Z | 2022-03-31T20:59:08.000Z | tests/python/test_mpm88.py | mzmzm/taichi | 39129820a922fdd936728d6feb7944ae208345a5 | [
"MIT"
] | 3,589 | 2020-01-09T03:18:25.000Z | 2022-03-31T19:06:42.000Z | tests/python/test_mpm88.py | mzmzm/taichi | 39129820a922fdd936728d6feb7944ae208345a5 | [
"MIT"
] | 1,391 | 2020-01-09T03:02:54.000Z | 2022-03-31T08:44:29.000Z | import os
import pytest
import taichi as ti
from taichi import approx
def run_mpm88_test():
dim = 2
N = 64
n_particles = N * N
n_grid = 128
dx = 1 / n_grid
inv_dx = 1 / dx
dt = 2.0e-4
p_vol = (dx * 0.5)**2
p_rho = 1
p_mass = p_vol * p_rho
E = 400
x = ti.Vector.field(... | 35.46473 | 78 | 0.468234 | import os
import pytest
import taichi as ti
from taichi import approx
def run_mpm88_test():
dim = 2
N = 64
n_particles = N * N
n_grid = 128
dx = 1 / n_grid
inv_dx = 1 / dx
dt = 2.0e-4
p_vol = (dx * 0.5)**2
p_rho = 1
p_mass = p_vol * p_rho
E = 400
x = ti.Vector.field(... | true | true |
1c296a68f364078e70e7ea9462ad9201eb4ecef5 | 198 | py | Python | src/checkPalindrome/200202_selftest.py | kasimte/coding-challenges | 975506a7257ad0d2d234a7856006472b79ebfdc3 | [
"MIT"
] | null | null | null | src/checkPalindrome/200202_selftest.py | kasimte/coding-challenges | 975506a7257ad0d2d234a7856006472b79ebfdc3 | [
"MIT"
] | null | null | null | src/checkPalindrome/200202_selftest.py | kasimte/coding-challenges | 975506a7257ad0d2d234a7856006472b79ebfdc3 | [
"MIT"
] | null | null | null | def checkPalindrome(inputString):
return inputString == inputString[::-1]
print(checkPalindrome("aabaa")) # True
print(checkPalindrome("010110")) # False
print(checkPalindrome("ab3ba")) # True
| 28.285714 | 43 | 0.742424 | def checkPalindrome(inputString):
return inputString == inputString[::-1]
print(checkPalindrome("aabaa")) print(checkPalindrome("010110")) print(checkPalindrome("ab3ba")) | true | true |
1c296ac57b6c26eba65d508f74367e6d24fe1e70 | 611 | py | Python | datawriters/csvwriter.py | jamesmarlowe/Python-Data-Writers | dc437b8ba4fe9ff4ac2ac7561051665cd15bd238 | [
"BSD-2-Clause"
] | 4 | 2016-06-06T19:27:16.000Z | 2021-10-05T06:51:48.000Z | datawriters/csvwriter.py | jamesmarlowe/Python-Data-Writers | dc437b8ba4fe9ff4ac2ac7561051665cd15bd238 | [
"BSD-2-Clause"
] | null | null | null | datawriters/csvwriter.py | jamesmarlowe/Python-Data-Writers | dc437b8ba4fe9ff4ac2ac7561051665cd15bd238 | [
"BSD-2-Clause"
] | null | null | null | import csv
class CsvWriter:
def __init__(self, *args, **kwargs):
if 'database' in kwargs:
self.db_csv = kwargs['database']
else:
print 'missing database argument, using data.csv'
self.db_csv = 'data.csv'
def save(self, list_of_dicts):
all_keys = list... | 29.095238 | 72 | 0.567921 | import csv
class CsvWriter:
def __init__(self, *args, **kwargs):
if 'database' in kwargs:
self.db_csv = kwargs['database']
else:
print 'missing database argument, using data.csv'
self.db_csv = 'data.csv'
def save(self, list_of_dicts):
all_keys = list... | false | true |
1c296ae42ec35d10bf0b1f6703f926fca28d11ea | 2,773 | py | Python | scons-local-1.1.0/SCons/Tool/pdflatex.py | frew/simpleproto | 393a7a059802152c888130c0a117fcc62d4fc8ab | [
"BSD-2-Clause",
"MIT"
] | null | null | null | scons-local-1.1.0/SCons/Tool/pdflatex.py | frew/simpleproto | 393a7a059802152c888130c0a117fcc62d4fc8ab | [
"BSD-2-Clause",
"MIT"
] | null | null | null | scons-local-1.1.0/SCons/Tool/pdflatex.py | frew/simpleproto | 393a7a059802152c888130c0a117fcc62d4fc8ab | [
"BSD-2-Clause",
"MIT"
] | null | null | null | """SCons.Tool.pdflatex
Tool-specific initialization for pdflatex.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Per... | 36.486842 | 89 | 0.73855 |
__revision__ = "src/engine/SCons/Tool/pdflatex.py 3603 2008/10/10 05:46:45 scons"
import SCons.Action
import SCons.Util
import SCons.Tool.pdf
import SCons.Tool.tex
PDFLaTeXAction = None
def PDFLaTeXAuxFunction(target = None, source= None, env=None):
result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXActio... | true | true |
1c296b00a260c7a1ccf92333c7050a8726f95e30 | 4,157 | py | Python | cornbread/__main__.py | tomislacker/cornbread | 160a2733a516154ac6831798d40d405de0f10ff8 | [
"Apache-2.0"
] | 1 | 2017-06-07T23:05:50.000Z | 2017-06-07T23:05:50.000Z | cornbread/__main__.py | tomislacker/cornbread | 160a2733a516154ac6831798d40d405de0f10ff8 | [
"Apache-2.0"
] | null | null | null | cornbread/__main__.py | tomislacker/cornbread | 160a2733a516154ac6831798d40d405de0f10ff8 | [
"Apache-2.0"
] | null | null | null | """
cornbread - Daemon to track your window focus
Usage:
cornbread daemon [options]
cornbread process [options]
Options:
-h, --help See this dialogue
-l, --log-level=L Logging module level [default: debug]
-v, --version See program version
"""
import logging
import time
from queue... | 27.713333 | 76 | 0.605725 | import logging
import time
from queue import Queue
from threading import Condition
from threading import Thread
from . import __version__
from .xorg import FocusedWindow
from .xorg import FocusedWindowWatcher
log = logging.getLogger("cornbread")
class ObjectBuffer(object):
def __init__(self):
self.cond... | true | true |
1c296badaae805dc980f7b2b556029e186852ea7 | 3,726 | py | Python | running_times/time_coxcc.py | georgehc/dksa | bcd9eab6c9ded47f5b166cf1351b06e26e0c8f90 | [
"MIT"
] | 8 | 2020-07-31T00:46:32.000Z | 2021-12-07T08:16:00.000Z | running_times/time_coxcc.py | georgehc/dksa | bcd9eab6c9ded47f5b166cf1351b06e26e0c8f90 | [
"MIT"
] | 1 | 2021-01-21T15:30:44.000Z | 2021-01-22T17:52:02.000Z | running_times/time_coxcc.py | georgehc/dksa | bcd9eab6c9ded47f5b166cf1351b06e26e0c8f90 | [
"MIT"
] | 1 | 2021-01-21T12:37:23.000Z | 2021-01-21T12:37:23.000Z | #!/usr/bin/env python
import ast
import configparser
import os
os.environ['QT_QPA_PLATFORM'] = 'offscreen'
import pickle
import sys
sys.path.insert(1, os.path.dirname(sys.path[0]))
__package__ = 'running_times'
import numpy as np
survival_estimator_name = 'coxcc'
if not (len(sys.argv) == 2 and os.path.isfile(sys.ar... | 36.529412 | 79 | 0.612453 | import ast
import configparser
import os
os.environ['QT_QPA_PLATFORM'] = 'offscreen'
import pickle
import sys
sys.path.insert(1, os.path.dirname(sys.path[0]))
__package__ = 'running_times'
import numpy as np
survival_estimator_name = 'coxcc'
if not (len(sys.argv) == 2 and os.path.isfile(sys.argv[1])):
print('Us... | true | true |
1c296c0bec2050515836b7494975f337426c74f1 | 35,080 | py | Python | hue.py | TWoolhouse/Libraries | 26079ed387cb800cb97f20980720ae094008c7bf | [
"MIT"
] | 1 | 2020-10-11T15:34:56.000Z | 2020-10-11T15:34:56.000Z | hue.py | TWoolhouse/Libraries | 26079ed387cb800cb97f20980720ae094008c7bf | [
"MIT"
] | null | null | null | hue.py | TWoolhouse/Libraries | 26079ed387cb800cb97f20980720ae094008c7bf | [
"MIT"
] | null | null | null | import enum
import json
import asyncio
import datetime
import http.client
import urllib.request
from bitfield import BitField
from interface import Interface
from collections import defaultdict
from typing import Iterable, Union, Any
def Address(obj) -> str:
if isinstance(obj, type): # Root
return {
... | 39.151786 | 339 | 0.552395 | import enum
import json
import asyncio
import datetime
import http.client
import urllib.request
from bitfield import BitField
from interface import Interface
from collections import defaultdict
from typing import Iterable, Union, Any
def Address(obj) -> str:
if isinstance(obj, type): return {
L... | true | true |
1c296c519ea59d6b7f47e29e3615169082772789 | 9,544 | py | Python | tests/providers/google/cloud/operators/test_datafusion.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 1 | 2019-05-07T06:46:55.000Z | 2019-05-07T06:46:55.000Z | tests/providers/google/cloud/operators/test_datafusion.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 37 | 2020-07-21T07:50:02.000Z | 2022-03-29T22:31:28.000Z | tests/providers/google/cloud/operators/test_datafusion.py | vuppalli/airflow | dfe8337ca2d3ed173d9ecc112938271519792c40 | [
"Apache-2.0"
] | 2 | 2020-03-08T14:12:55.000Z | 2020-06-10T10:17:32.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.879699 | 88 | 0.685562 |
import mock
from airflow import DAG
from airflow.providers.google.cloud.operators.datafusion import (
CloudDataFusionCreateInstanceOperator, CloudDataFusionCreatePipelineOperator,
CloudDataFusionDeleteInstanceOperator, CloudDataFusionDeletePipelineOperator,
CloudDataFusionGetInstanceOperator, CloudDataFus... | true | true |
1c296d319c64003939a24110eb6d1a89936d3ed2 | 741 | py | Python | darts/base_actions/ActionStack.py | GabrielAmare/Darts | 182748d821b8c1838071f3b28724d0d9b095dcf9 | [
"MIT"
] | null | null | null | darts/base_actions/ActionStack.py | GabrielAmare/Darts | 182748d821b8c1838071f3b28724d0d9b095dcf9 | [
"MIT"
] | null | null | null | darts/base_actions/ActionStack.py | GabrielAmare/Darts | 182748d821b8c1838071f3b28724d0d9b095dcf9 | [
"MIT"
] | null | null | null | from typing import List, Sequence
from .Action import Action
from .ActionList import ActionList
class ActionStack:
def __init__(self):
self.actions: List[Action] = []
def append(self, action: Action) -> None:
"""Append action to the stack."""
self.actions.append(action)
def exte... | 26.464286 | 71 | 0.618084 | from typing import List, Sequence
from .Action import Action
from .ActionList import ActionList
class ActionStack:
def __init__(self):
self.actions: List[Action] = []
def append(self, action: Action) -> None:
self.actions.append(action)
def extend(self, actions: Sequence[Action]) -> Non... | true | true |
1c296de61cff9e8bba2f875987501871a2ee9cc7 | 30 | py | Python | flot/models/__init__.py | Yang-L1/FLOT | 92a96cbdba684cffff5529d9eb09a506216900f4 | [
"Apache-2.0"
] | 71 | 2020-07-20T16:50:42.000Z | 2022-03-24T05:13:56.000Z | flot/models/__init__.py | Yang-L1/FLOT | 92a96cbdba684cffff5529d9eb09a506216900f4 | [
"Apache-2.0"
] | 4 | 2020-08-14T07:41:38.000Z | 2021-06-17T02:46:37.000Z | flot/models/__init__.py | Yang-L1/FLOT | 92a96cbdba684cffff5529d9eb09a506216900f4 | [
"Apache-2.0"
] | 9 | 2020-07-23T01:25:20.000Z | 2022-01-20T08:16:44.000Z | from .scene_flow import FLOT
| 15 | 29 | 0.8 | from .scene_flow import FLOT
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.