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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c20248231ef90a4718bcebfb19f64a4304246f8 | 31,755 | py | Python | Packs/ExportIndicators/Integrations/ExportIndicators/ExportIndicators_test.py | smokescreen-akshay/content | 780e0c57a3201e405d4416154c5d08a4fbb9384c | [
"MIT"
] | 1 | 2020-04-19T11:05:42.000Z | 2020-04-19T11:05:42.000Z | Packs/ExportIndicators/Integrations/ExportIndicators/ExportIndicators_test.py | smokescreen-akshay/content | 780e0c57a3201e405d4416154c5d08a4fbb9384c | [
"MIT"
] | null | null | null | Packs/ExportIndicators/Integrations/ExportIndicators/ExportIndicators_test.py | smokescreen-akshay/content | 780e0c57a3201e405d4416154c5d08a4fbb9384c | [
"MIT"
] | 1 | 2021-05-31T15:08:48.000Z | 2021-05-31T15:08:48.000Z | """Imports"""
import json
import pytest
import demistomock as demisto
from netaddr import IPAddress
IOC_RES_LEN = 38
'''Tests'''
@pytest.mark.helper_commands
class TestHelperFunctions:
@pytest.mark.get_outbound_ioc_values
def test_get_outbound_ioc_values_1(self, mocker):
"""Test on_demand"""
... | 55.808436 | 125 | 0.655834 | import json
import pytest
import demistomock as demisto
from netaddr import IPAddress
IOC_RES_LEN = 38
@pytest.mark.helper_commands
class TestHelperFunctions:
@pytest.mark.get_outbound_ioc_values
def test_get_outbound_ioc_values_1(self, mocker):
from ExportIndicators import get_outbound_ioc_values,... | true | true |
1c2024c9cbc999e868833149e57c178930087193 | 1,379 | py | Python | offensive.py | staeiou/deletionbot | dcaf184c681e6acb5c36be79d9ccc74808e9c5fc | [
"MIT"
] | null | null | null | offensive.py | staeiou/deletionbot | dcaf184c681e6acb5c36be79d9ccc74808e9c5fc | [
"MIT"
] | null | null | null | offensive.py | staeiou/deletionbot | dcaf184c681e6acb5c36be79d9ccc74808e9c5fc | [
"MIT"
] | null | null | null | import re
offensive = re.compile(
r"\b(deaths?|dead(ly)?|die(s|d)?|hurts?|(sex(ual(ly)?)?|child)[ -]?(abused?|trafficking|assault(ed|s)?)|"
r"injur(e|i?es|ed|y)|kill(ing|ed|er|s)?s?|wound(ing|ed|s)?|fatal(ly|ity)?|shoo?t(s|ing|er)?s?|"
r"crash(es|ed|ing)?|attack(s|ers?|ing|ed)?|murder(s|er|ed|ing)?s?|hosta... | 57.458333 | 124 | 0.640319 | import re
offensive = re.compile(
r"\b(deaths?|dead(ly)?|die(s|d)?|hurts?|(sex(ual(ly)?)?|child)[ -]?(abused?|trafficking|assault(ed|s)?)|"
r"injur(e|i?es|ed|y)|kill(ing|ed|er|s)?s?|wound(ing|ed|s)?|fatal(ly|ity)?|shoo?t(s|ing|er)?s?|"
r"crash(es|ed|ing)?|attack(s|ers?|ing|ed)?|murder(s|er|ed|ing)?s?|hosta... | true | true |
1c20252e583026a3604ebb9577b3eb9103e4f41f | 7,772 | py | Python | scvi/compose/_base_module.py | gitter-badger/scvi-tools | 8948405f6b393baede73ccd6a0a5ac0824e16c0d | [
"BSD-3-Clause"
] | null | null | null | scvi/compose/_base_module.py | gitter-badger/scvi-tools | 8948405f6b393baede73ccd6a0a5ac0824e16c0d | [
"BSD-3-Clause"
] | null | null | null | scvi/compose/_base_module.py | gitter-badger/scvi-tools | 8948405f6b393baede73ccd6a0a5ac0824e16c0d | [
"BSD-3-Clause"
] | null | null | null | from abc import abstractmethod
from typing import Dict, Iterable, Optional, Tuple, Union
import torch
import torch.nn as nn
from ._decorators import auto_move_data
class LossRecorder:
"""
Loss signature for models.
This class provides an organized way to record the model loss, as well as
the compon... | 32.932203 | 98 | 0.650154 | from abc import abstractmethod
from typing import Dict, Iterable, Optional, Tuple, Union
import torch
import torch.nn as nn
from ._decorators import auto_move_data
class LossRecorder:
def __init__(
self,
loss: torch.Tensor,
reconstruction_loss: torch.Tensor,
kl_local: torch.Tens... | true | true |
1c2025bc1596106ed96ef3d439993c136ad11d07 | 44,703 | py | Python | skein/test/test_kv.py | laungcisin/skein | 7f023239dcdee1482774466032bd63468cc7e42f | [
"BSD-3-Clause"
] | 124 | 2018-04-21T23:26:57.000Z | 2022-01-24T14:34:26.000Z | skein/test/test_kv.py | laungcisin/skein | 7f023239dcdee1482774466032bd63468cc7e42f | [
"BSD-3-Clause"
] | 144 | 2018-05-21T13:57:01.000Z | 2022-03-31T13:07:42.000Z | skein/test/test_kv.py | laungcisin/skein | 7f023239dcdee1482774466032bd63468cc7e42f | [
"BSD-3-Clause"
] | 36 | 2018-07-01T19:09:42.000Z | 2022-03-31T16:04:47.000Z | import copy
import operator
import sys
import threading
import time
import weakref
from collections import OrderedDict
from collections.abc import MutableMapping
import pytest
from skein import kv
from skein.exceptions import ConnectionError
from skein.test.conftest import run_application
@pytest.fixture(scope="mod... | 33.01551 | 90 | 0.605239 | import copy
import operator
import sys
import threading
import time
import weakref
from collections import OrderedDict
from collections.abc import MutableMapping
import pytest
from skein import kv
from skein.exceptions import ConnectionError
from skein.test.conftest import run_application
@pytest.fixture(scope="mod... | true | true |
1c2025c3c717ee63bb215593d9c03b62d8c72cbe | 1,656 | py | Python | nikola/data/themes/base/messages/messages_fr.py | maniacs-satm/nikola | fad241e78dfdaee56bb95203cdb8a11769b454de | [
"MIT"
] | null | null | null | nikola/data/themes/base/messages/messages_fr.py | maniacs-satm/nikola | fad241e78dfdaee56bb95203cdb8a11769b454de | [
"MIT"
] | null | null | null | nikola/data/themes/base/messages/messages_fr.py | maniacs-satm/nikola | fad241e78dfdaee56bb95203cdb8a11769b454de | [
"MIT"
] | null | null | null | # -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "Il reste encore %d min. de lecture",
"(active)": "(actif)",
"Also available in:": "Également disponible en :",
"Archive": "Archives",
"Authors": "Auteurs",
"Categories": "Catégories",
... | 37.636364 | 74 | 0.604469 |
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "Il reste encore %d min. de lecture",
"(active)": "(actif)",
"Also available in:": "Également disponible en :",
"Archive": "Archives",
"Authors": "Auteurs",
"Categories": "Catégories",
"Comments": "Commentaire... | true | true |
1c202654ecf69a992668cb6b99a8f9d49c7b5a3d | 13,189 | py | Python | qf_lib_tests/integration_tests/data_providers/bloomberg_beap_hapi/test_bloomberg_beap_hapi.py | webclinic017/qf-lib | 96463876719bba8a76c8269cef76addf3a2d836d | [
"Apache-2.0"
] | 198 | 2019-08-16T15:09:23.000Z | 2022-03-30T12:44:00.000Z | qf_lib_tests/integration_tests/data_providers/bloomberg_beap_hapi/test_bloomberg_beap_hapi.py | webclinic017/qf-lib | 96463876719bba8a76c8269cef76addf3a2d836d | [
"Apache-2.0"
] | 13 | 2021-01-07T10:15:19.000Z | 2022-03-29T13:01:47.000Z | qf_lib_tests/integration_tests/data_providers/bloomberg_beap_hapi/test_bloomberg_beap_hapi.py | webclinic017/qf-lib | 96463876719bba8a76c8269cef76addf3a2d836d | [
"Apache-2.0"
] | 29 | 2019-08-16T15:21:28.000Z | 2022-02-23T09:53:49.000Z | import unittest
from pandas import to_datetime
from qf_lib.common.enums.expiration_date_field import ExpirationDateField
from qf_lib.common.enums.price_field import PriceField
from qf_lib.common.tickers.tickers import BloombergTicker
from qf_lib.common.utils.dateutils.string_to_date import str_to_date
from qf_lib.commo... | 58.101322 | 144 | 0.753431 | import unittest
from pandas import to_datetime
from qf_lib.common.enums.expiration_date_field import ExpirationDateField
from qf_lib.common.enums.price_field import PriceField
from qf_lib.common.tickers.tickers import BloombergTicker
from qf_lib.common.utils.dateutils.string_to_date import str_to_date
from qf_lib.commo... | true | true |
1c2026c195431367da8d285f179418316155b80d | 370 | py | Python | PythonInterview/Python_basestudy/strtest.py | xtawfnhdx/PythonInterview | 515675ffd86eb1ad3bfa631fd3c88fddcf411e98 | [
"Apache-2.0"
] | null | null | null | PythonInterview/Python_basestudy/strtest.py | xtawfnhdx/PythonInterview | 515675ffd86eb1ad3bfa631fd3c88fddcf411e98 | [
"Apache-2.0"
] | null | null | null | PythonInterview/Python_basestudy/strtest.py | xtawfnhdx/PythonInterview | 515675ffd86eb1ad3bfa631fd3c88fddcf411e98 | [
"Apache-2.0"
] | null | null | null | s1='''
这是
一行
文本
'''
print(s1)
print(len(s1))
print(s1[4])
s2=['a','ab','cc']
print('_'.join(s2))
print('字符串格式化')
print("%s,%s" %("zhangsan",12))
n1="{} is a boy,age={}".format("zhangsan",12)
print(n1)
n2="{1} is a girl,age={0}".format(13,"huahua")
print(n2)
n3="{a} is a {b} is b".format(a="aa",b="bb")
print(n3)
nam... | 14.230769 | 46 | 0.575676 | s1='''
这是
一行
文本
'''
print(s1)
print(len(s1))
print(s1[4])
s2=['a','ab','cc']
print('_'.join(s2))
print('字符串格式化')
print("%s,%s" %("zhangsan",12))
n1="{} is a boy,age={}".format("zhangsan",12)
print(n1)
n2="{1} is a girl,age={0}".format(13,"huahua")
print(n2)
n3="{a} is a {b} is b".format(a="aa",b="bb")
print(n3)
nam... | true | true |
1c2027da23776e0a0e5d37f62f153246af14202d | 4,522 | py | Python | mayan/apps/document_states/tests/test_workflow_state_views.py | darrenflexxu/Mayan-EDMS | 6707365bfacd137e625ddc1b990168012246fa07 | [
"Apache-2.0"
] | null | null | null | mayan/apps/document_states/tests/test_workflow_state_views.py | darrenflexxu/Mayan-EDMS | 6707365bfacd137e625ddc1b990168012246fa07 | [
"Apache-2.0"
] | 5 | 2021-03-19T22:59:52.000Z | 2022-03-12T00:13:16.000Z | mayan/apps/document_states/tests/test_workflow_state_views.py | Sumit-Kumar-Jha/mayan | 5b7ddeccf080b9e41cc1074c70e27dfe447be19f | [
"Apache-2.0"
] | 1 | 2020-07-29T21:03:27.000Z | 2020-07-29T21:03:27.000Z | from __future__ import unicode_literals
from mayan.apps.common.tests.base import GenericViewTestCase
from ..models import WorkflowState
from ..permissions import permission_workflow_edit, permission_workflow_view
from .literals import (
TEST_WORKFLOW_STATE_LABEL, TEST_WORKFLOW_STATE_COMPLETION,
)
from .mixins im... | 33.496296 | 76 | 0.717603 | from __future__ import unicode_literals
from mayan.apps.common.tests.base import GenericViewTestCase
from ..models import WorkflowState
from ..permissions import permission_workflow_edit, permission_workflow_view
from .literals import (
TEST_WORKFLOW_STATE_LABEL, TEST_WORKFLOW_STATE_COMPLETION,
)
from .mixins im... | true | true |
1c2028d63f38dfa084191f6a4ad449b3b956223b | 61,601 | py | Python | pyiron/base/job/generic.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | pyiron/base/job/generic.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | pyiron/base/job/generic.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
# import copy
import signal
from datetime import datetime
import os
# import sys... | 38.404613 | 122 | 0.591857 |
from __future__ import print_function
import signal
from datetime import datetime
import os
import posixpath
import psutil
import multiprocessing
from pyiron.base.job.wrapper import JobWrapper
from pyiron.base.settings.generic import Settings
from pyiron.base.job.executable import Executable
from pyiron.base.jo... | true | true |
1c2028e9c8eac0f122ea0218ef2c4294595be467 | 1,402 | py | Python | src/platform/tomcat/fingerprints/Tomcat4.py | 0x27/clusterd | 0f04a4955c61aa523274e9ae35d750f4339b1e59 | [
"MIT"
] | 539 | 2015-01-08T23:59:32.000Z | 2022-03-29T17:53:02.000Z | src/platform/tomcat/fingerprints/Tomcat4.py | M31MOTH/clusterd | d190b2cbaa93820e928a7ce5471c661d4559fb7c | [
"MIT"
] | 21 | 2015-01-17T21:51:21.000Z | 2019-09-20T09:23:18.000Z | src/platform/tomcat/fingerprints/Tomcat4.py | M31MOTH/clusterd | d190b2cbaa93820e928a7ce5471c661d4559fb7c | [
"MIT"
] | 192 | 2015-01-26T20:44:14.000Z | 2021-12-22T01:39:50.000Z | from src.platform.tomcat.authenticate import checkAuth
from src.platform.tomcat.interfaces import TINTERFACES
from requests import exceptions
from cprint import FingerPrint
from re import findall
from log import LOG
import utility
class FPrint(FingerPrint):
def __init__(self):
self.platform = "tomcat"
... | 33.380952 | 79 | 0.508559 | from src.platform.tomcat.authenticate import checkAuth
from src.platform.tomcat.interfaces import TINTERFACES
from requests import exceptions
from cprint import FingerPrint
from re import findall
from log import LOG
import utility
class FPrint(FingerPrint):
def __init__(self):
self.platform = "tomcat"
... | true | true |
1c202900915c9c7cb3884c3d08d794034989ca75 | 44,982 | py | Python | lib/portage_util_unittest.py | sglass68/chromite | fa56d880e5970e63b8372895c5d43fe6edd8324a | [
"BSD-3-Clause"
] | null | null | null | lib/portage_util_unittest.py | sglass68/chromite | fa56d880e5970e63b8372895c5d43fe6edd8324a | [
"BSD-3-Clause"
] | null | null | null | lib/portage_util_unittest.py | sglass68/chromite | fa56d880e5970e63b8372895c5d43fe6edd8324a | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 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.
"""Unit tests for portage_util.py."""
from __future__ import print_function
import cStringIO
import os
from chromite.cbuildbot import constants
fro... | 40.818512 | 80 | 0.669023 |
from __future__ import print_function
import cStringIO
import os
from chromite.cbuildbot import constants
from chromite.cbuildbot import failures_lib
from chromite.lib import cros_test_lib
from chromite.lib import git
from chromite.lib import osutils
from chromite.lib import portage_util
MANIFEST = git.Manifes... | true | true |
1c202911cc826d314fd363856e1c1b8ef7424059 | 3,390 | py | Python | fuse/data/dataset/dataset_dataframe.py | LaudateCorpus1/fuse-med-ml | 56821be0824b599dfbbd7a4b158436cb2c300812 | [
"Apache-2.0"
] | 57 | 2021-06-23T12:16:08.000Z | 2022-03-29T15:51:25.000Z | fuse/data/dataset/dataset_dataframe.py | LaudateCorpus1/fuse-med-ml | 56821be0824b599dfbbd7a4b158436cb2c300812 | [
"Apache-2.0"
] | 3 | 2021-11-04T07:56:13.000Z | 2022-03-15T08:33:13.000Z | fuse/data/dataset/dataset_dataframe.py | LaudateCorpus1/fuse-med-ml | 56821be0824b599dfbbd7a4b158436cb2c300812 | [
"Apache-2.0"
] | 19 | 2021-07-19T13:29:22.000Z | 2022-03-23T07:48:13.000Z | """
(C) Copyright 2021 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... | 44.605263 | 123 | 0.657817 |
from typing import Optional, List, Dict, Union
import torch
import pandas as pd
from fuse.data.data_source.data_source_from_list import FuseDataSourceFromList
from fuse.data.dataset.dataset_default import FuseDatasetDefault
from fuse.data.processor.processor_dataframe import FuseProcessorDataFrame
class FuseDatase... | true | true |
1c2029c9afc968886197a0dbb790b31b7d11f319 | 5,375 | py | Python | data_structures_py.py | Nelson-Gon/sweetpy | 1e6639f351bbeb38cd8637a151054bbca419054b | [
"MIT"
] | null | null | null | data_structures_py.py | Nelson-Gon/sweetpy | 1e6639f351bbeb38cd8637a151054bbca419054b | [
"MIT"
] | null | null | null | data_structures_py.py | Nelson-Gon/sweetpy | 1e6639f351bbeb38cd8637a151054bbca419054b | [
"MIT"
] | null | null | null | # Data structures
# Still solely based on https://www.cse.unsw.edu.au/~en1811/python-docs/python-3.6.4-docs-pdf/tutorial.pdf
# With a few additions in and there.
# Lists
x = [1, 2, 3, 4]
# appending really does add to the end of a list.
x.append(34)
# Doesn't show(ie returns None, inplace appending.
# insert takes a ... | 20.05597 | 106 | 0.65507 |
x = [1, 2, 3, 4]
x.append(34)
# insert takes a postional argument and a value
x.insert(2, 45)
# Also inplace
x.extend([2, 3])
# extend requires an iterable
x.remove(2)
# removes first occurrence of an item in the list.
x.pop(2)
# Takes on an index
# x.clear() really does that.
x.index(2)
# Extraction via list.i... | true | true |
1c2029f79e385102a3887a03a7091401c5767559 | 5,763 | py | Python | openstack/tests/functional/network/v2/test_sfc_port_pair_group.py | gthiemonge/openstacksdk | e1c6f233eb6b07f488fe4acded72312d8d265b33 | [
"Apache-2.0"
] | null | null | null | openstack/tests/functional/network/v2/test_sfc_port_pair_group.py | gthiemonge/openstacksdk | e1c6f233eb6b07f488fe4acded72312d8d265b33 | [
"Apache-2.0"
] | null | null | null | openstack/tests/functional/network/v2/test_sfc_port_pair_group.py | gthiemonge/openstacksdk | e1c6f233eb6b07f488fe4acded72312d8d265b33 | [
"Apache-2.0"
] | 1 | 2021-03-12T14:28:28.000Z | 2021-03-12T14:28:28.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 t... | 37.666667 | 79 | 0.64515 |
from openstack.network.v2 import sfc_port_pair_group
from openstack.network.v2 import sfc_port_pair
from openstack.network.v2 import subnet
from openstack.network.v2 import network
from openstack.network.v2 import port
from openstack.tests.functional import base
from openstack import exceptions
class Tes... | true | true |
1c202a3412bcc952cc877f7489dbcd937e9fb888 | 3,503 | py | Python | terracotta/locals/underload/trivial.py | kvshamray/terracota | 8f6419693a2add12c0cd27005e6f58f8295ad7e6 | [
"Apache-2.0"
] | 1 | 2020-01-21T11:31:39.000Z | 2020-01-21T11:31:39.000Z | terracotta/locals/underload/trivial.py | kvshamray/terracota | 8f6419693a2add12c0cd27005e6f58f8295ad7e6 | [
"Apache-2.0"
] | null | null | null | terracotta/locals/underload/trivial.py | kvshamray/terracota | 8f6419693a2add12c0cd27005e6f58f8295ad7e6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Anton Beloglazov
#
# 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 writ... | 39.806818 | 74 | 0.706252 |
def always_underloaded_factory(time_step, migration_time, params):
return lambda utilization, state=None: (True, {})
def threshold_factory(time_step, migration_time, params):
return lambda utilization, state=None: (threshold(params['threshold'],
... | true | true |
1c202d942c16fcd78fe0828e27fb6a0505217bd4 | 82 | py | Python | tests/basic/float2int.py | treeform/pystorm | 3a2224bcdaccc5a2abf6a820c0bcf7afa3e6fed4 | [
"MIT"
] | 50 | 2015-03-24T19:45:34.000Z | 2022-02-20T04:34:26.000Z | tests/basic/float2int.py | MoonStarCZW/py2js | 6cda2b1d3cf281a5ca92c18b08ac9fa1c389cbea | [
"MIT"
] | 2 | 2017-02-26T09:43:07.000Z | 2017-03-06T20:04:24.000Z | tests/number/float2int.py | Slater-Victoroff/pyjaco | 89c4e3c46399c5023b0e160005d855a01241c58a | [
"MIT"
] | 12 | 2016-03-07T09:30:49.000Z | 2021-09-05T20:38:47.000Z |
for f in [123.456,1.1,-0.00045,-1.45,1.5,1022423.22]:
i = int(f)
print i
| 16.4 | 53 | 0.54878 |
for f in [123.456,1.1,-0.00045,-1.45,1.5,1022423.22]:
i = int(f)
print i
| false | true |
1c202f3fa4d370edab9cf79d8e50e8905bfa6dd4 | 432 | py | Python | pybw/nodes/read_variable.py | louisdevie/birdway | fc71ab4deaa154033cd3228746919e6e82c4723f | [
"CC0-1.0"
] | null | null | null | pybw/nodes/read_variable.py | louisdevie/birdway | fc71ab4deaa154033cd3228746919e6e82c4723f | [
"CC0-1.0"
] | null | null | null | pybw/nodes/read_variable.py | louisdevie/birdway | fc71ab4deaa154033cd3228746919e6e82c4723f | [
"CC0-1.0"
] | null | null | null | from .base import *
from birdway import Type
class ReadVariable(SyntaxNodeABC, PrettyAutoRepr, Typed, InContext, Identified):
def __init__(self):
super().__init__()
self.name = str()
self._t = Type.UNKNOWN
def _type(self):
return self._t
def _initialise(self):
ret... | 19.636364 | 80 | 0.613426 | from .base import *
from birdway import Type
class ReadVariable(SyntaxNodeABC, PrettyAutoRepr, Typed, InContext, Identified):
def __init__(self):
super().__init__()
self.name = str()
self._t = Type.UNKNOWN
def _type(self):
return self._t
def _initialise(self):
ret... | true | true |
1c202f907ec318e9c9c7322cef797c0d3754a55c | 6,975 | py | Python | test/modelbased/test_ppo_icm.py | dumpmemory/tianshou | bc53ead273f6f9d3788a78ecc739249eeb96b8c6 | [
"MIT"
] | 1 | 2022-02-14T19:40:51.000Z | 2022-02-14T19:40:51.000Z | test/modelbased/test_ppo_icm.py | mf093087/tianshou | 9c100e07057ad99f0a62d6e329451093dd44300a | [
"MIT"
] | null | null | null | test/modelbased/test_ppo_icm.py | mf093087/tianshou | 9c100e07057ad99f0a62d6e329451093dd44300a | [
"MIT"
] | null | null | null | import argparse
import os
import pprint
import gym
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from tianshou.data import Collector, VectorReplayBuffer
from tianshou.env import SubprocVectorEnv
from tianshou.policy import ICMPolicy, PPOPolicy
from tianshou.trainer import onpolicy_... | 36.139896 | 84 | 0.669534 | import argparse
import os
import pprint
import gym
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from tianshou.data import Collector, VectorReplayBuffer
from tianshou.env import SubprocVectorEnv
from tianshou.policy import ICMPolicy, PPOPolicy
from tianshou.trainer import onpolicy_... | true | true |
1c2030132a814a08f5294b942199d78414a71458 | 1,210 | py | Python | setup.py | maresb/keras-transformer | e7374b43625dc6e8997a1882ad94c886377bee74 | [
"MIT"
] | 3 | 2020-05-23T14:19:34.000Z | 2021-04-27T01:20:07.000Z | setup.py | maresb/keras-transformer | e7374b43625dc6e8997a1882ad94c886377bee74 | [
"MIT"
] | null | null | null | setup.py | maresb/keras-transformer | e7374b43625dc6e8997a1882ad94c886377bee74 | [
"MIT"
] | 1 | 2020-12-08T18:17:46.000Z | 2020-12-08T18:17:46.000Z | # this file was created by following
# https://github.com/pypa/sampleproject/blob/master/setup.py
# as example
from setuptools import setup, find_packages
setup(
name='keras_transformer',
# This allows to use git/hg to auto-generate new versions
use_scm_version={"root": ".", "relative_to": __file__},
... | 32.702703 | 71 | 0.66281 |
from setuptools import setup, find_packages
setup(
name='keras_transformer',
use_scm_version={"root": ".", "relative_to": __file__},
setup_requires=['setuptools_scm'],
description=('Library for building (Universal) Transformer models '
'using Keras'),
url='https://github.c... | true | true |
1c20311e74d37ec8511437c131969140820543c2 | 1,691 | py | Python | yolox/core/trainer.py | EighteenSprings/PP_YOLOX | 48cff5203d55c98b96c9a6f89da26ff098f4bb91 | [
"Apache-2.0"
] | null | null | null | yolox/core/trainer.py | EighteenSprings/PP_YOLOX | 48cff5203d55c98b96c9a6f89da26ff098f4bb91 | [
"Apache-2.0"
] | null | null | null | yolox/core/trainer.py | EighteenSprings/PP_YOLOX | 48cff5203d55c98b96c9a6f89da26ff098f4bb91 | [
"Apache-2.0"
] | null | null | null | """
Update:
Date: 2021/12/31
Msg: Megvii YOLOX got an good project template, so I decide
to imitate(copy) it (●'◡'●)
"""
import os
from loguru import logger
from yolox.utils import (
setup_logger,
get_rank
)
class Trainer:
def __init__(self, config):
self.config = config
... | 21.405063 | 73 | 0.570668 | import os
from loguru import logger
from yolox.utils import (
setup_logger,
get_rank
)
class Trainer:
def __init__(self, config):
self.config = config
self.rank = get_rank()
self.file_name = os.path.join(config.OUTPUT_DIR, config.EXP_NAME)
setup_logger(
self.f... | true | true |
1c20312f01b8721dcbee321960a9be2a39c4d41f | 1,628 | py | Python | zilencer/management/commands/profile_request.py | TanJay/zulip | 294030ca0427fb168292673b3150852c19e2692e | [
"Apache-2.0"
] | null | null | null | zilencer/management/commands/profile_request.py | TanJay/zulip | 294030ca0427fb168292673b3150852c19e2692e | [
"Apache-2.0"
] | null | null | null | zilencer/management/commands/profile_request.py | TanJay/zulip | 294030ca0427fb168292673b3150852c19e2692e | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zerver.models import get_user_profile_by_email, UserMessage
from zerver.views.messages import get_old_messages_backend
import cProfile
import logging
from zerver.middleware import LogRequest... | 31.921569 | 122 | 0.67629 | from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zerver.models import get_user_profile_by_email, UserMessage
from zerver.views.messages import get_old_messages_backend
import cProfile
import logging
from zerver.middleware import LogRequest... | true | true |
1c203148d9921198289533724961249be9914cc9 | 35,466 | py | Python | custom/champ/tests/test_pva_chart.py | akyogi/commcare-hq | 44c34634e1b54f566ca200f828ea2aa112f33aa4 | [
"BSD-3-Clause"
] | null | null | null | custom/champ/tests/test_pva_chart.py | akyogi/commcare-hq | 44c34634e1b54f566ca200f828ea2aa112f33aa4 | [
"BSD-3-Clause"
] | null | null | null | custom/champ/tests/test_pva_chart.py | akyogi/commcare-hq | 44c34634e1b54f566ca200f828ea2aa112f33aa4 | [
"BSD-3-Clause"
] | null | null | null | import json
import mock
from custom.champ.tests.utils import ChampTestCase
from custom.champ.views import PrevisionVsAchievementsView
from django.urls import reverse
class TestPVAChart(ChampTestCase):
def setUp(self):
super(TestPVAChart, self).setUp()
self.view = PrevisionVsAchievementsView.as_... | 35.289552 | 101 | 0.578695 | import json
import mock
from custom.champ.tests.utils import ChampTestCase
from custom.champ.views import PrevisionVsAchievementsView
from django.urls import reverse
class TestPVAChart(ChampTestCase):
def setUp(self):
super(TestPVAChart, self).setUp()
self.view = PrevisionVsAchievementsView.as_... | true | true |
1c2031718828d802eddf11a6021587e1ac457f27 | 12,042 | py | Python | qa/rpc-tests/p2p-acceptblock.py | shehzad002/blockdee_x11 | bc2fbd55192e462980e59bb6e8c0e5aa6740283e | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-acceptblock.py | shehzad002/blockdee_x11 | bc2fbd55192e462980e59bb6e8c0e5aa6740283e | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-acceptblock.py | shehzad002/blockdee_x11 | bc2fbd55192e462980e59bb6e8c0e5aa6740283e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of unrequested blocks.
Since behavior differs when receiving unrequested blocks from w... | 43.16129 | 107 | 0.658778 |
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import time
from test_framework.blocktools import create_block, create_coinbase
class TestNode(NodeConnCB):
def __init__(self):
NodeConnCB.__init__(self)
sel... | true | true |
1c203234667b76c6e72da1cdfaa7d3deb15c1827 | 4,189 | py | Python | rec_model_aoi_cuts.py | natcap/brute_force_rec_model | a2396340d3670e00496d63bd044038a8f3f3ef8b | [
"BSD-3-Clause"
] | null | null | null | rec_model_aoi_cuts.py | natcap/brute_force_rec_model | a2396340d3670e00496d63bd044038a8f3f3ef8b | [
"BSD-3-Clause"
] | null | null | null | rec_model_aoi_cuts.py | natcap/brute_force_rec_model | a2396340d3670e00496d63bd044038a8f3f3ef8b | [
"BSD-3-Clause"
] | null | null | null | """Go feature by feature for recreation model."""
import os
from osgeo import ogr
import natcap.invest.recreation.recmodel_client
def main():
"""Entry point."""
workspace_dir = r"rec_model_aoi_cuts_workspace"
if not os.path.exists(workspace_dir):
os.makedirs(workspace_dir)
aoi_pat... | 39.518868 | 78 | 0.62688 | """Go feature by feature for recreation model."""
import os
from osgeo import ogr
import natcap.invest.recreation.recmodel_client
def main():
"""Entry point."""
workspace_dir = r"rec_model_aoi_cuts_workspace"
if not os.path.exists(workspace_dir):
os.makedirs(workspace_dir)
aoi_pat... | false | true |
1c2032718541743e29a94a6eddb611e8fe745872 | 1,972 | py | Python | backend/nation_state/nation_state_data_plotter.py | EugMJang/Covid-20 | e56cb32bb2470c309cb983e28e8da3de5a2503c8 | [
"MIT"
] | null | null | null | backend/nation_state/nation_state_data_plotter.py | EugMJang/Covid-20 | e56cb32bb2470c309cb983e28e8da3de5a2503c8 | [
"MIT"
] | null | null | null | backend/nation_state/nation_state_data_plotter.py | EugMJang/Covid-20 | e56cb32bb2470c309cb983e28e8da3de5a2503c8 | [
"MIT"
] | 1 | 2021-09-22T02:02:12.000Z | 2021-09-22T02:02:12.000Z | import requests
import matplotlib.pyplot as plt
urls = ["https://api.covidtracking.com/v1/us/daily.json", "https://api.covidtracking.com/v1/states/il/daily.json"]
def get_nation_state_data(i):
r = requests.get(urls[i])
j = r.json()
times = []
positives = []
totals = []
percentages = []
j... | 32.327869 | 114 | 0.615619 | import requests
import matplotlib.pyplot as plt
urls = ["https://api.covidtracking.com/v1/us/daily.json", "https://api.covidtracking.com/v1/states/il/daily.json"]
def get_nation_state_data(i):
r = requests.get(urls[i])
j = r.json()
times = []
positives = []
totals = []
percentages = []
j... | true | true |
1c2033a9837dde9a2adcd669b880702d8b36a42e | 321 | py | Python | ex108/ex108.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | ex108/ex108.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | ex108/ex108.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | def aumentar(valor=0, taxa=0):
resposta = valor * (1 + (taxa / 100))
return resposta
def diminuir(valor=0, taxa=0):
return valor * (1 - (taxa / 100))
def dobro(valor=0):
return valor * 2
def metade(valor=0):
return valor * 0.5
def moeda(valor):
return f'{valor :>.2f}'.replace('.', ',')... | 14.590909 | 45 | 0.579439 | def aumentar(valor=0, taxa=0):
resposta = valor * (1 + (taxa / 100))
return resposta
def diminuir(valor=0, taxa=0):
return valor * (1 - (taxa / 100))
def dobro(valor=0):
return valor * 2
def metade(valor=0):
return valor * 0.5
def moeda(valor):
return f'{valor :>.2f}'.replace('.', ',')... | true | true |
1c2033aaee88e8ce5db712db81f030b3b50b129f | 2,800 | py | Python | tests/test_notebooks.py | informaton/GPflow | 6ee199f4ca1b02a83218578b94fef219b428ca04 | [
"Apache-2.0"
] | 1 | 2020-01-27T19:05:28.000Z | 2020-01-27T19:05:28.000Z | tests/test_notebooks.py | sdeepaknarayanan/GPflow | 164d90d78c1c6fd966ae19ebaee59b9241bcba39 | [
"Apache-2.0"
] | null | null | null | tests/test_notebooks.py | sdeepaknarayanan/GPflow | 164d90d78c1c6fd966ae19ebaee59b9241bcba39 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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.73494 | 91 | 0.731429 |
import glob
import os
import sys
import time
import traceback
import nbformat
import pytest
from nbconvert.preprocessors import ExecutePreprocessor
from nbconvert.preprocessors.execute import CellExecutionError
from gpflow.test_util import session_context
BLACKLISTED_NOTEBOOKS = [
]
def _nbpath():
... | true | true |
1c2033d90cd8adfc4336689f7941611e1f747812 | 1,745 | py | Python | pandas/core/reshape/util.py | henriqueribeiro/pandas | 996f361f8e6986ea1c65ccb164a4c585e1f4a027 | [
"BSD-3-Clause"
] | 4 | 2021-03-02T19:57:18.000Z | 2021-06-20T19:23:57.000Z | pandas/core/reshape/util.py | henriqueribeiro/pandas | 996f361f8e6986ea1c65ccb164a4c585e1f4a027 | [
"BSD-3-Clause"
] | 3 | 2018-09-24T22:09:28.000Z | 2018-10-01T21:10:00.000Z | pandas/core/reshape/util.py | henriqueribeiro/pandas | 996f361f8e6986ea1c65ccb164a4c585e1f4a027 | [
"BSD-3-Clause"
] | 1 | 2018-10-14T18:27:49.000Z | 2018-10-14T18:27:49.000Z | import numpy as np
from pandas.core.dtypes.common import is_list_like
from pandas.compat import reduce
from pandas.core import common as com
def cartesian_product(X):
"""
Numpy version of itertools.product or pandas.compat.product.
Sometimes faster (for large inputs)...
Parameters
----------
... | 24.928571 | 76 | 0.590831 | import numpy as np
from pandas.core.dtypes.common import is_list_like
from pandas.compat import reduce
from pandas.core import common as com
def cartesian_product(X):
msg = "Input must be a list-like of list-likes"
if not is_list_like(X):
raise TypeError(msg)
for x in X:
if not is_list_l... | true | true |
1c2034edfe4a24df41f0aa0a1e89113e7614d2b9 | 654 | py | Python | passbook/policies/hibp/api.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | passbook/policies/hibp/api.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | passbook/policies/hibp/api.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | """Source API Views"""
from rest_framework.serializers import ModelSerializer
from rest_framework.viewsets import ModelViewSet
from passbook.policies.forms import GENERAL_SERIALIZER_FIELDS
from passbook.policies.hibp.models import HaveIBeenPwendPolicy
class HaveIBeenPwendPolicySerializer(ModelSerializer):
"""Hav... | 29.727273 | 62 | 0.793578 | from rest_framework.serializers import ModelSerializer
from rest_framework.viewsets import ModelViewSet
from passbook.policies.forms import GENERAL_SERIALIZER_FIELDS
from passbook.policies.hibp.models import HaveIBeenPwendPolicy
class HaveIBeenPwendPolicySerializer(ModelSerializer):
class Meta:
model = ... | true | true |
1c2035d8f3b1a70549cf7fafa04b59453a4464ed | 2,013 | py | Python | src/management/console.py | mkRPGDev/mkRPG | 154e5d264dc1cc5fba78980da430e9d7ca0ccc22 | [
"Beerware"
] | 2 | 2016-10-06T10:09:10.000Z | 2016-10-07T14:16:19.000Z | src/management/console.py | mkRPGDev/mkRPG | 154e5d264dc1cc5fba78980da430e9d7ca0ccc22 | [
"Beerware"
] | 17 | 2016-12-01T10:10:23.000Z | 2017-01-12T16:41:51.000Z | src/management/console.py | mkRPGDev/mkRPG | 154e5d264dc1cc5fba78980da430e9d7ca0ccc22 | [
"Beerware"
] | null | null | null | """ Manages the server console """
# XXX en faire une classe avec un unique attribut server pour éviter le partial ?
def invite():
print(">> ", end='', flush=True)
def welcomeMessage(server):
""" Print server hello """
#print("Server started; waiting for", len(server.world.entities), "clients")
invit... | 40.26 | 95 | 0.61997 |
def invite():
print(">> ", end='', flush=True)
def welcomeMessage(server):
invite()
def inputReady(server):
st = input()
if st in ("h", "help"):
print("""Liste des commandes disponibles:
(vous pouvez aussi taper uniquement la première lettre)
clients - affiche la liste des clients ... | true | true |
1c2036e1b9824d4ed1058544c2ac327ea1d545f2 | 35,282 | py | Python | flask_googlemaps/__init__.py | Flapjack98/Flask-GoogleMaps | 5ee777b974ebd2f1e60504d079ab16e98cc04c74 | [
"MIT"
] | 424 | 2015-01-05T07:53:19.000Z | 2019-07-07T15:12:32.000Z | flask_googlemaps/__init__.py | Flapjack98/Flask-GoogleMaps | 5ee777b974ebd2f1e60504d079ab16e98cc04c74 | [
"MIT"
] | 72 | 2015-02-12T11:21:27.000Z | 2019-03-27T11:21:21.000Z | flask_googlemaps/__init__.py | Flapjack98/Flask-GoogleMaps | 5ee777b974ebd2f1e60504d079ab16e98cc04c74 | [
"MIT"
] | 163 | 2015-06-08T08:05:43.000Z | 2019-07-19T20:51:01.000Z | """FlaskGoogleMaps - Google Maps Extension for Flask"""
__version__ = "0.4.0"
from json import dumps
from typing import Optional, Dict, Any, List, Union, Tuple, Text
import requests as rq
import requests
from flask import Blueprint, Markup, g, render_template
from flask_googlemaps.icons import dots, Icon
DEFAULT_I... | 38.266811 | 124 | 0.566833 |
__version__ = "0.4.0"
from json import dumps
from typing import Optional, Dict, Any, List, Union, Tuple, Text
import requests as rq
import requests
from flask import Blueprint, Markup, g, render_template
from flask_googlemaps.icons import dots, Icon
DEFAULT_ICON = dots.red
DEFAULT_CLUSTER_IMAGE_PATH = "static/imag... | true | true |
1c2037129a299eb3c04b3670e04a6d7d61f8faa6 | 1,375 | py | Python | examples/03_picnic/picnic.py | zchen1-ua/be434-fall-2021 | 65e39e48371d511cb1fd505eeaaed6e628eddd18 | [
"MIT"
] | null | null | null | examples/03_picnic/picnic.py | zchen1-ua/be434-fall-2021 | 65e39e48371d511cb1fd505eeaaed6e628eddd18 | [
"MIT"
] | null | null | null | examples/03_picnic/picnic.py | zchen1-ua/be434-fall-2021 | 65e39e48371d511cb1fd505eeaaed6e628eddd18 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Author : zhuochen <zhuochen@localhost>
Date : 2021-09-12
Purpose: Rock the Casbah
"""
import argparse
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Rock the Casbah',
... | 25 | 76 | 0.443636 |
import argparse
def get_args():
parser = argparse.ArgumentParser(
description='Rock the Casbah',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('items',
metavar='str',
nargs='+',
help='It... | true | true |
1c20373bd81e1219489498458b593a9fc623235a | 235 | py | Python | setup.py | emreerhan/kaggle_bowl | 174eb98fc53b8592f03bfe24d3a940cad514f405 | [
"MIT"
] | null | null | null | setup.py | emreerhan/kaggle_bowl | 174eb98fc53b8592f03bfe24d3a940cad514f405 | [
"MIT"
] | null | null | null | setup.py | emreerhan/kaggle_bowl | 174eb98fc53b8592f03bfe24d3a940cad514f405 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='An attempt at the Kaggle Data Science Bowl 2019',
author='MOM_GENES_STU',
license='MIT',
)
| 21.363636 | 66 | 0.680851 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='An attempt at the Kaggle Data Science Bowl 2019',
author='MOM_GENES_STU',
license='MIT',
)
| true | true |
1c20398d4ef5f108d49681830a12ef0b5ef9b44f | 723 | py | Python | class-notes/chapter_13/c13-1.py | rhoenkelevra/python_simple_applications | 28ceb5f9fe7ecf11d606d49463385e92927e8f98 | [
"MIT"
] | null | null | null | class-notes/chapter_13/c13-1.py | rhoenkelevra/python_simple_applications | 28ceb5f9fe7ecf11d606d49463385e92927e8f98 | [
"MIT"
] | null | null | null | class-notes/chapter_13/c13-1.py | rhoenkelevra/python_simple_applications | 28ceb5f9fe7ecf11d606d49463385e92927e8f98 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 26 12:01:23 2021
@author: user24
"""
# =============================================================================
#
# Open file and reads it
#
# file = './data/fox.txt'
# fileobj = open(file)
# text = fileobj.read()
# fileobj.close()
# print(text)
#
# =============... | 17.214286 | 79 | 0.453665 |
le = './data/fox.txt'
# with open(file) as fileobj:
# text = fileobj.read()
# print(text)
file = './data/fox.txt'
with open(file) as fileobj:
text = fileobj.read()
newtext = text.rstrip(".")
wordlist = newtext.split(" ")
print(wordlist)
| true | true |
1c2039afbd7b4b164aac6e61146e65081b0cc7c3 | 4,322 | py | Python | deploy/hubserving/ocr_rec/module.py | henrywoo/PaddleOCR | ac2e0da2dd898b6767037b9206974ee84a736bd5 | [
"Apache-2.0"
] | 15 | 2021-08-18T01:53:44.000Z | 2022-03-28T10:57:05.000Z | deploy/hubserving/ocr_rec/module.py | salimakr/PaddleOCR | ac2e0da2dd898b6767037b9206974ee84a736bd5 | [
"Apache-2.0"
] | 1 | 2021-05-10T18:13:16.000Z | 2021-05-10T18:13:16.000Z | deploy/hubserving/ocr_rec/module.py | salimakr/PaddleOCR | ac2e0da2dd898b6767037b9206974ee84a736bd5 | [
"Apache-2.0"
] | 9 | 2021-08-12T13:52:07.000Z | 2022-03-28T17:58:50.000Z | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
sys.path.insert(0, ".")
import copy
from paddlehub.common.logger import logger
from paddlehub.module.module import moduleinfo, runnable, serving
import cv2
import pa... | 30.871429 | 187 | 0.592087 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
sys.path.insert(0, ".")
import copy
from paddlehub.common.logger import logger
from paddlehub.module.module import moduleinfo, runnable, serving
import cv2
import paddlehub as hub
from t... | true | true |
1c203a0535bdd720e49e4b75e58f7f6eb4d17569 | 233 | py | Python | python/ex061.py | deniseicorrea/Aulas-de-Python | c5bcafa34f03ea4b9c73805b58c8004bb13f70e5 | [
"MIT"
] | null | null | null | python/ex061.py | deniseicorrea/Aulas-de-Python | c5bcafa34f03ea4b9c73805b58c8004bb13f70e5 | [
"MIT"
] | null | null | null | python/ex061.py | deniseicorrea/Aulas-de-Python | c5bcafa34f03ea4b9c73805b58c8004bb13f70e5 | [
"MIT"
] | null | null | null | print('Gerador de PA')
print('-=' * 10)
primeiro = int(input('Primeiro termo: '))
razão = int(input('Razão: '))
termo = primeiro
cont = 1
while cont <= 10:
print(f'{termo}', end= ' ')
termo += razão
cont += 1
print('Fim') | 21.181818 | 41 | 0.583691 | print('Gerador de PA')
print('-=' * 10)
primeiro = int(input('Primeiro termo: '))
razão = int(input('Razão: '))
termo = primeiro
cont = 1
while cont <= 10:
print(f'{termo}', end= ' ')
termo += razão
cont += 1
print('Fim') | true | true |
1c203a2967bedc2244c3fbace89aad61bd41c156 | 19,981 | py | Python | Code/Evolutionary Algorithm/Filter.py | MauroSilvaPinto/A-personalized-and-evolutionary-algorithm-for-interpretable-EEG-epilepsy-seizure-prediction | 3bec2f06cfe0e2aff13e63c83ebc97135c079408 | [
"CC0-1.0"
] | null | null | null | Code/Evolutionary Algorithm/Filter.py | MauroSilvaPinto/A-personalized-and-evolutionary-algorithm-for-interpretable-EEG-epilepsy-seizure-prediction | 3bec2f06cfe0e2aff13e63c83ebc97135c079408 | [
"CC0-1.0"
] | null | null | null | Code/Evolutionary Algorithm/Filter.py | MauroSilvaPinto/A-personalized-and-evolutionary-algorithm-for-interpretable-EEG-epilepsy-seizure-prediction | 3bec2f06cfe0e2aff13e63c83ebc97135c079408 | [
"CC0-1.0"
] | null | null | null | """
Filter class.
Filter class constructs the second-level features (hyper-features)
by windowing the first-level ones. It performs this feature extraction
chronologically
"""
import numpy as np
from scipy.signal import find_peaks
from Feature import Feature
import networkx as nx
class Filter:
# creates ... | 41.36853 | 124 | 0.654372 |
import numpy as np
from scipy.signal import find_peaks
from Feature import Feature
import networkx as nx
class Filter:
def createFilter(decoded_phenotype):
filter=Filter.buildFilterChronology(decoded_phenotype)
filter=Filter.addFilterLengthToFilter(fil... | true | true |
1c203a8a7c727e9cf79f6e3b4679c1a5d2b5e8d1 | 998 | py | Python | pydbg.py | nealmcb/pydbg | 8cf7985f1c4978b95499b4177db2eb0c4603affa | [
"MIT"
] | null | null | null | pydbg.py | nealmcb/pydbg | 8cf7985f1c4978b95499b4177db2eb0c4603affa | [
"MIT"
] | null | null | null | pydbg.py | nealmcb/pydbg | 8cf7985f1c4978b95499b4177db2eb0c4603affa | [
"MIT"
] | null | null | null | """pydbg is an implementation of the Rust2018 builtin `dbg` for Python."""
import inspect
import sys
import typing
__version__ = "0.3.0"
_ExpType = typing.TypeVar('_ExpType')
def dbg(exp: _ExpType) -> _ExpType:
"""Call dbg with any variable or expression.
Calling debug will print out the content informa... | 20.791667 | 85 | 0.533066 |
import inspect
import sys
import typing
__version__ = "0.3.0"
_ExpType = typing.TypeVar('_ExpType')
def dbg(exp: _ExpType) -> _ExpType:
for frame in inspect.stack():
line = frame.code_context[0]
if "dbg" in line:
start = line.find('(') + 1
end = line.rfind(')')
... | true | true |
1c203af51f0c0b76897a5b18e12889a58a312f1f | 3,033 | py | Python | jax_cfd/ml/model_utils.py | ngam/jax-cfd | 8eff9c47bdc7fb19b6453db94ca65f6be64d91f6 | [
"Apache-2.0"
] | 244 | 2021-05-18T18:49:14.000Z | 2022-03-30T18:27:21.000Z | jax_cfd/ml/model_utils.py | ngam/jax-cfd | 8eff9c47bdc7fb19b6453db94ca65f6be64d91f6 | [
"Apache-2.0"
] | 14 | 2021-06-24T22:15:44.000Z | 2022-03-30T06:22:52.000Z | jax_cfd/ml/model_utils.py | ngam/jax-cfd | 8eff9c47bdc7fb19b6453db94ca65f6be64d91f6 | [
"Apache-2.0"
] | 36 | 2021-05-29T09:30:44.000Z | 2022-03-28T12:33:40.000Z | """Helper methods for constructing trajectory functions in model_builder.py."""
import functools
from jax_cfd.base import array_utils
def with_preprocessing(fn, preprocess_fn):
"""Generates a function that computes `fn` on `preprocess_fn(x)`."""
@functools.wraps(fn)
def apply_fn(x, *args, **kwargs):
return... | 34.078652 | 80 | 0.745467 |
import functools
from jax_cfd.base import array_utils
def with_preprocessing(fn, preprocess_fn):
@functools.wraps(fn)
def apply_fn(x, *args, **kwargs):
return fn(preprocess_fn(x), *args, **kwargs)
return apply_fn
def with_post_processing(fn, post_process_fn):
@functools.wraps(fn)
def apply_fn(*args,... | true | true |
1c203be0e370b8e7ed628f4f0168735e15f5591d | 1,635 | py | Python | pysap/base/loaders/nifti.py | LElgueddari/pisap | ddd9f9f02dcd629b5615fa571ac7795c2d5e9727 | [
"CECILL-B"
] | 46 | 2018-03-16T14:36:53.000Z | 2022-03-15T21:46:16.000Z | pysap/base/loaders/nifti.py | LElgueddari/pisap | ddd9f9f02dcd629b5615fa571ac7795c2d5e9727 | [
"CECILL-B"
] | 139 | 2018-03-02T10:06:50.000Z | 2022-03-08T08:57:37.000Z | pysap/base/loaders/nifti.py | LElgueddari/pisap | ddd9f9f02dcd629b5615fa571ac7795c2d5e9727 | [
"CECILL-B"
] | 17 | 2018-04-03T11:25:59.000Z | 2021-06-15T14:32:09.000Z | # -*- coding: utf-8 -*-
##########################################################################
# pySAP - Copyright (C) CEA, 2017 - 2018
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-e... | 29.196429 | 74 | 0.525382 | true | true | |
1c203cfb74171b6844875001a3411caf7e875ebc | 1,062 | py | Python | display_image.py | brenthaas/photopoof | d1172b8e58f924eac89c6f3a06087d63a1545ad8 | [
"MIT"
] | null | null | null | display_image.py | brenthaas/photopoof | d1172b8e58f924eac89c6f3a06087d63a1545ad8 | [
"MIT"
] | null | null | null | display_image.py | brenthaas/photopoof | d1172b8e58f924eac89c6f3a06087d63a1545ad8 | [
"MIT"
] | null | null | null | import sys
import os
import glob
import pygame
import countdown
counter = countdown.Countdown(count = 3)
files = glob.glob(sys.argv[1] + '/*.JPG')
pygame.display.init()
screen = pygame.display.set_mode( ( 800, 480 ), pygame.FULLSCREEN )
current_file = 0
num_files = len(files)
if num_files == 0:
exit('No files in ... | 25.285714 | 67 | 0.672316 | import sys
import os
import glob
import pygame
import countdown
counter = countdown.Countdown(count = 3)
files = glob.glob(sys.argv[1] + '/*.JPG')
pygame.display.init()
screen = pygame.display.set_mode( ( 800, 480 ), pygame.FULLSCREEN )
current_file = 0
num_files = len(files)
if num_files == 0:
exit('No files in ... | true | true |
1c203d0abea74a24cf3926444053785eeb70424d | 5,549 | py | Python | test/terra/backends/test_qasm_simulator_statevector.py | Matt-Stypulkoski/qiskit-aer | d2ccea906245b9bdfeacab29ff7fcfacb9b35b3d | [
"Apache-2.0"
] | null | null | null | test/terra/backends/test_qasm_simulator_statevector.py | Matt-Stypulkoski/qiskit-aer | d2ccea906245b9bdfeacab29ff7fcfacb9b35b3d | [
"Apache-2.0"
] | null | null | null | test/terra/backends/test_qasm_simulator_statevector.py | Matt-Stypulkoski/qiskit-aer | d2ccea906245b9bdfeacab29ff7fcfacb9b35b3d | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 53.355769 | 97 | 0.835286 |
import unittest
from test.terra import common
from test.terra.decorators import requires_method
from test.terra.backends.qasm_simulator.qasm_reset import QasmResetTests
from test.terra.backends.qasm_simulator.qasm_measure import QasmMeasureTests
from test.terra.backends.qasm_simulator.qasm_measure import ... | true | true |
1c203d32d5c37ca0a461d8f2f743c49e545a2fd9 | 5,972 | py | Python | pyAudioAnalysis/analyzeMovieSound.py | gandie/pyAudioAnalysis | 1449d667806161b5dace3612cbeceec9be93d843 | [
"Apache-2.0"
] | null | null | null | pyAudioAnalysis/analyzeMovieSound.py | gandie/pyAudioAnalysis | 1449d667806161b5dace3612cbeceec9be93d843 | [
"Apache-2.0"
] | null | null | null | pyAudioAnalysis/analyzeMovieSound.py | gandie/pyAudioAnalysis | 1449d667806161b5dace3612cbeceec9be93d843 | [
"Apache-2.0"
] | null | null | null | import os, sys, shutil, glob, numpy, csv, cPickle
import scipy.io.wavfile as wavfile
import audioBasicIO
import audioTrainTest as aT
import audioSegmentation as aS
import matplotlib.pyplot as plt
import scipy.spatial.distance
minDuration = 7;
def classifyFolderWrapper(inputFolder, modelType, modelName, outputMode=Fals... | 30.469388 | 136 | 0.667783 | import os, sys, shutil, glob, numpy, csv, cPickle
import scipy.io.wavfile as wavfile
import audioBasicIO
import audioTrainTest as aT
import audioSegmentation as aS
import matplotlib.pyplot as plt
import scipy.spatial.distance
minDuration = 7;
def classifyFolderWrapper(inputFolder, modelType, modelName, outputMode=Fals... | true | true |
1c203dc1533490a5fed0d8b1cc4e462a423ea864 | 2,316 | py | Python | bcol-api/src/bcol_api/resources/bcol_profile.py | karthik-aot/sbc-pay | 15ab3ad1057cf12913a8ba496a5ca722d95128d2 | [
"Apache-2.0"
] | null | null | null | bcol-api/src/bcol_api/resources/bcol_profile.py | karthik-aot/sbc-pay | 15ab3ad1057cf12913a8ba496a5ca722d95128d2 | [
"Apache-2.0"
] | null | null | null | bcol-api/src/bcol_api/resources/bcol_profile.py | karthik-aot/sbc-pay | 15ab3ad1057cf12913a8ba496a5ca722d95128d2 | [
"Apache-2.0"
] | null | null | null | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 39.254237 | 119 | 0.715458 |
from http import HTTPStatus
from flask import request
from flask_restplus import Namespace, Resource, cors
from bcol_api.exceptions import BusinessException, PaymentException
from bcol_api.exceptions import error_to_response
from bcol_api.schemas import utils as schema_utils
from bcol_api.services.bcol_... | true | true |
1c203e74cc9170842e045b544c0b2aa35e098be4 | 1,585 | py | Python | copy selected files from AWS S3 by using boto3-boto3-copy-file-from-s3-with-condition.py | pirahansiah/cv-ml-pipline | 0a8cbcce42538c4814f1ec3acd1dce38f7fd9d65 | [
"BSD-3-Clause-Attribution"
] | 1 | 2020-05-07T09:42:31.000Z | 2020-05-07T09:42:31.000Z | copy selected files from AWS S3 by using boto3-boto3-copy-file-from-s3-with-condition.py | pirahansiah/cv-ml-pipline | 0a8cbcce42538c4814f1ec3acd1dce38f7fd9d65 | [
"BSD-3-Clause-Attribution"
] | 8 | 2020-03-03T14:16:26.000Z | 2022-03-12T00:17:42.000Z | copy selected files from AWS S3 by using boto3-boto3-copy-file-from-s3-with-condition.py | pirahansiah/cv-ml-pipline | 0a8cbcce42538c4814f1ec3acd1dce38f7fd9d65 | [
"BSD-3-Clause-Attribution"
] | null | null | null | # Farshid PirahanSiah 17 March 2020
# copy selected files from AWS S3 by using boto3
# You can set two variables :
# number_of_files_to_escape
# how_many_files_you_need
# # !/usr/local/bin/python3
import boto3
from botocore.exceptions import ClientError
def get_all_s3_objects(s3, **base_kwargs):
continuat... | 37.738095 | 85 | 0.656782 |
ore.exceptions import ClientError
def get_all_s3_objects(s3, **base_kwargs):
continuation_token = None
while True:
list_kwargs = dict(MaxKeys=1000000, **base_kwargs)
if continuation_token:
list_kwargs['ContinuationToken'] = continuation_token
response = s3.list_... | true | true |
1c203fd8a27aef68b219fd3cc2bc05c69e04fd55 | 152 | py | Python | venv/bin/django-admin.py | EmadElmogy/youtubeCrawler | 3bd3bafc3deb3aaa44ba7685dd490725f585bb22 | [
"MIT"
] | null | null | null | venv/bin/django-admin.py | EmadElmogy/youtubeCrawler | 3bd3bafc3deb3aaa44ba7685dd490725f585bb22 | [
"MIT"
] | null | null | null | venv/bin/django-admin.py | EmadElmogy/youtubeCrawler | 3bd3bafc3deb3aaa44ba7685dd490725f585bb22 | [
"MIT"
] | null | null | null | #!/home/emad/Documents/ytc/venv/bin/python2.7
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 25.333333 | 45 | 0.776316 |
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| true | true |
1c2041315fc83adfdca707672a870e97164bc175 | 591 | py | Python | lista3/Q33.py | AlexandrePeBrito/Python | 79a09b1fb8e705dc7b6859d977c8916a2d0dd4d0 | [
"MIT"
] | null | null | null | lista3/Q33.py | AlexandrePeBrito/Python | 79a09b1fb8e705dc7b6859d977c8916a2d0dd4d0 | [
"MIT"
] | null | null | null | lista3/Q33.py | AlexandrePeBrito/Python | 79a09b1fb8e705dc7b6859d977c8916a2d0dd4d0 | [
"MIT"
] | null | null | null | #O Departamento Estadual de Meteorologia lhe contratou para desenvolver um programa que leia
#as um conjunto indeterminado de temperaturas, e informe ao final a menor e a maior
#temperaturas informadas, bem como a média das temperaturas.
temp=float(input("Informe a temperatura: "))
temperaturas=[]
resp=1
while(resp==... | 42.214286 | 99 | 0.752961 |
temp=float(input("Informe a temperatura: "))
temperaturas=[]
resp=1
while(resp==1):
temperaturas.append(temp)
resp=int(input("Deseja inserir outra Temperatura?(1->SIM 2->NAO): "))
if(resp==1): temp=float(input("nInforme a temperatura: "))
print(f"A maior temperatura foi {max(temperaturas)} e a menor t... | true | true |
1c2041c98419b17ae45b830d7dc0d97b35aadc43 | 271 | py | Python | tests/artificial/transf_Logit/trend_ConstantTrend/cycle_30/ar_/test_artificial_1024_Logit_ConstantTrend_30__20.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/artificial/transf_Logit/trend_ConstantTrend/cycle_30/ar_/test_artificial_1024_Logit_ConstantTrend_30__20.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/artificial/transf_Logit/trend_ConstantTrend/cycle_30/ar_/test_artificial_1024_Logit_ConstantTrend_30__20.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 30, transform = "Logit", sigma = 0.0, exog_count = 20, ar_order = 0); | 38.714286 | 166 | 0.734317 | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 30, transform = "Logit", sigma = 0.0, exog_count = 20, ar_order = 0); | true | true |
1c2042fe27eb05f9b01dd17a8d8be6dd7abec15c | 47 | py | Python | authaadhaar/__init__.py | jwaladiamonds/authAadhaar | 576f795dfc0285058429ebad6304c0d1d4b850f0 | [
"MIT"
] | 2 | 2021-07-20T07:46:37.000Z | 2022-03-01T18:35:04.000Z | authaadhaar/__init__.py | jwaladiamonds/authAadhaar | 576f795dfc0285058429ebad6304c0d1d4b850f0 | [
"MIT"
] | null | null | null | authaadhaar/__init__.py | jwaladiamonds/authAadhaar | 576f795dfc0285058429ebad6304c0d1d4b850f0 | [
"MIT"
] | null | null | null | __version__ = "0.1.0"
__auth_version__ = "2.5"
| 15.666667 | 24 | 0.680851 | __version__ = "0.1.0"
__auth_version__ = "2.5"
| true | true |
1c2043a5a8105ed7bad0b8f7d764cc07cd9522d6 | 3,214 | py | Python | iotbx/shelx/__init__.py | ErwinP/cctbx_project | 58f9fb5ed38c7391510e892f0ca9520467b692c1 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-03-18T12:31:57.000Z | 2022-03-14T06:27:06.000Z | iotbx/shelx/__init__.py | ErwinP/cctbx_project | 58f9fb5ed38c7391510e892f0ca9520467b692c1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | iotbx/shelx/__init__.py | ErwinP/cctbx_project | 58f9fb5ed38c7391510e892f0ca9520467b692c1 | [
"BSD-3-Clause-LBNL"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | from __future__ import absolute_import, division, print_function
from iotbx.shelx.errors import *
from iotbx.shelx.lexer import *
from iotbx.shelx.parsers import *
import iotbx.shelx.writer # implicit import
import boost.python
ext = boost.python.import_ext("iotbx_shelx_ext")
def _cctbx_xray_structure_from(file=None,... | 38.261905 | 87 | 0.701307 | from __future__ import absolute_import, division, print_function
from iotbx.shelx.errors import *
from iotbx.shelx.lexer import *
from iotbx.shelx.parsers import *
import iotbx.shelx.writer
import boost.python
ext = boost.python.import_ext("iotbx_shelx_ext")
def _cctbx_xray_structure_from(file=None, filename=None,
... | true | true |
1c20440a95c899b45d731347c852450e136095cb | 1,086 | py | Python | setup.py | SamuelJansen/Globals | 49a5ac10b18642ffbc54745c9bd55bf358ca73df | [
"MIT"
] | null | null | null | setup.py | SamuelJansen/Globals | 49a5ac10b18642ffbc54745c9bd55bf358ca73df | [
"MIT"
] | null | null | null | setup.py | SamuelJansen/Globals | 49a5ac10b18642ffbc54745c9bd55bf358ca73df | [
"MIT"
] | null | null | null | from distutils.core import setup
import os
version = '0.3.34'
name = 'globals'
url = f'https://github.com/SamuelJansen/{name}/'
OS_SEPARATOR = os.path.sep
setup(
name = name,
packages = [
name,
f'{name}{OS_SEPARATOR}api',
f'{name}{OS_SEPARATOR}api{OS_SEPARATOR}src',
f'{name}{O... | 28.578947 | 103 | 0.615101 | from distutils.core import setup
import os
version = '0.3.34'
name = 'globals'
url = f'https://github.com/SamuelJansen/{name}/'
OS_SEPARATOR = os.path.sep
setup(
name = name,
packages = [
name,
f'{name}{OS_SEPARATOR}api',
f'{name}{OS_SEPARATOR}api{OS_SEPARATOR}src',
f'{name}{O... | true | true |
1c2044fadc343494a5b5a49e08bc0d41fb9d4f17 | 7,374 | py | Python | olympicvaxinfo/sendmail-backup.py | mueslimak3r/olympicvax | 279bb5eda99d34b20477c613471c1ddcbd9dc968 | [
"MIT"
] | null | null | null | olympicvaxinfo/sendmail-backup.py | mueslimak3r/olympicvax | 279bb5eda99d34b20477c613471c1ddcbd9dc968 | [
"MIT"
] | null | null | null | olympicvaxinfo/sendmail-backup.py | mueslimak3r/olympicvax | 279bb5eda99d34b20477c613471c1ddcbd9dc968 | [
"MIT"
] | null | null | null | import os
import colorama
from colorama import Fore, Style
bodylength = 500
def make_mail(sourcename, url, body, timestamp, fromaddr, toaddr):
subject = "JeffCo Vax - new update from %s" % (sourcename)
unsubtext = "To unsubscribe from this mailing list, click on this link: [[UNSUB_LINK_LOCALE]]"
... | 111.727273 | 675 | 0.769596 | import os
import colorama
from colorama import Fore, Style
bodylength = 500
def make_mail(sourcename, url, body, timestamp, fromaddr, toaddr):
subject = "JeffCo Vax - new update from %s" % (sourcename)
unsubtext = "To unsubscribe from this mailing list, click on this link: [[UNSUB_LINK_LOCALE]]"
... | true | true |
1c20451378993f9b06dda525051e5508c99238d9 | 34,606 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_gateways_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_gateways_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_gateways_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.264993 | 214 | 0.66159 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse... | true | true |
1c20457884cd666f02d1253e43a94d43aec9a41e | 3,912 | py | Python | profil3r/app/modules/programming/github.py | 8L4NK/Profil3r | d45fea1efab0487bfac49e422ebc46cb26b29582 | [
"MIT"
] | 1 | 2021-10-30T19:19:50.000Z | 2021-10-30T19:19:50.000Z | profil3r/app/modules/programming/github.py | 8L4NK/Profil3r | d45fea1efab0487bfac49e422ebc46cb26b29582 | [
"MIT"
] | null | null | null | profil3r/app/modules/programming/github.py | 8L4NK/Profil3r | d45fea1efab0487bfac49e422ebc46cb26b29582 | [
"MIT"
] | 2 | 2021-08-14T04:10:24.000Z | 2021-09-19T01:55:05.000Z | import requests
from bs4 import BeautifulSoup
import time
class Github:
def __init__(self, config, permutations_list):
# 1000 ms
self.delay = config['plateform']['github']['rate_limit'] / 1000
# https://github.com/{username}
self.format = config['plateform']['github']['format']
... | 50.805195 | 217 | 0.564673 | import requests
from bs4 import BeautifulSoup
import time
class Github:
def __init__(self, config, permutations_list):
self.delay = config['plateform']['github']['rate_limit'] / 1000
self.format = config['plateform']['github']['format']
self.permutations_list = permutatio... | true | true |
1c2045cdc0eee609664bd8fa551dbe05b248b342 | 4,753 | py | Python | training/migrations/0001_initial.py | linikerunk/PeopleAnalytics-IA | baea534971a29d045df0986db2ecdc5f725fb77e | [
"MIT"
] | 1 | 2020-08-23T23:05:25.000Z | 2020-08-23T23:05:25.000Z | training/migrations/0001_initial.py | linikerunk/PeopleAnalytics-IA | baea534971a29d045df0986db2ecdc5f725fb77e | [
"MIT"
] | 7 | 2021-04-08T21:57:57.000Z | 2022-02-10T13:22:57.000Z | training/migrations/0001_initial.py | linikerunk/people-analytics-ia | baea534971a29d045df0986db2ecdc5f725fb77e | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-19 01:55
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entity',
fields=[
... | 57.26506 | 242 | 0.607195 |
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entity',
fields=[
('id', models.AutoField(auto_created=True,... | true | true |
1c2046c7f03cb36b30d0fb1ffae42885dca42a81 | 11,815 | py | Python | tensorflow/contrib/distributions/python/ops/poisson_lognormal.py | allenlavoie/tfgpu | 9e8e7666560c399d1ef01601d13909f2ab74e9cf | [
"Apache-2.0"
] | 47 | 2017-03-08T20:58:54.000Z | 2021-06-24T07:07:49.000Z | tensorflow/contrib/distributions/python/ops/poisson_lognormal.py | ChenAugustus/tensorflow | 5828e285209ff8c3d1bef2e4bd7c55ca611080d5 | [
"Apache-2.0"
] | 1 | 2017-11-03T18:07:26.000Z | 2017-11-20T05:13:12.000Z | tensorflow/contrib/distributions/python/ops/poisson_lognormal.py | ChenAugustus/tensorflow | 5828e285209ff8c3d1bef2e4bd7c55ca611080d5 | [
"Apache-2.0"
] | 19 | 2017-04-17T01:28:40.000Z | 2020-08-15T13:01:33.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.627389 | 102 | 0.671096 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.distributions.python.ops import poisson as poisson_lib
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape... | true | true |
1c20470325c0b871d56715ebd9c92b181219d9ec | 10,652 | py | Python | openeo/extra/spectral_indices/spectral_indices.py | bontekasper/openeo-python-client | 3a3cfd4ce619dd648e7dec0684281f4fecf4c2e3 | [
"Apache-2.0"
] | 75 | 2017-11-17T11:49:15.000Z | 2022-02-15T14:21:42.000Z | openeo/extra/spectral_indices/spectral_indices.py | jdries/openeo-python-client | 63e70bdb27749ba51553bb3fa46135125d8bc9d9 | [
"Apache-2.0"
] | 238 | 2017-12-05T14:48:30.000Z | 2022-03-31T15:42:38.000Z | openeo/extra/spectral_indices/spectral_indices.py | jdries/openeo-python-client | 63e70bdb27749ba51553bb3fa46135125d8bc9d9 | [
"Apache-2.0"
] | 28 | 2018-01-24T08:42:54.000Z | 2022-01-27T09:16:26.000Z | import json
import pkg_resources
from typing import Dict, List
import numpy as np
from openeo.processes import ProcessBuilder, array_modify, array_create
from openeo.rest.datacube import DataCube
BAND_MAPPING_LANDSAT457 = {
"B1": "B", "B2": "G", "B3": "R", "B4": "N", "B5": "S1", "B6": "T1", "B7": "S2"
}
BAND_MAP... | 42.608 | 159 | 0.654149 | import json
import pkg_resources
from typing import Dict, List
import numpy as np
from openeo.processes import ProcessBuilder, array_modify, array_create
from openeo.rest.datacube import DataCube
BAND_MAPPING_LANDSAT457 = {
"B1": "B", "B2": "G", "B3": "R", "B4": "N", "B5": "S1", "B6": "T1", "B7": "S2"
}
BAND_MAP... | true | true |
1c20470fd63f703728204c47d71ee7249305edc5 | 1,801 | py | Python | src/cipolla/game/room/client_collection.py | FraMecca/CipollaMod | d982fd0211b6895281d4fa7b99b80f4793ba2498 | [
"Zlib"
] | 1 | 2020-03-23T20:28:06.000Z | 2020-03-23T20:28:06.000Z | src/cipolla/game/room/client_collection.py | FraMecca/CipollaMod | d982fd0211b6895281d4fa7b99b80f4793ba2498 | [
"Zlib"
] | 1 | 2022-02-05T16:59:53.000Z | 2022-02-08T17:30:55.000Z | src/cipolla/game/room/client_collection.py | FraMecca/CipollaMod | d982fd0211b6895281d4fa7b99b80f4793ba2498 | [
"Zlib"
] | null | null | null | import contextlib
from cube2protocol.cube_data_stream import CubeDataStream # type: ignore
from cipolla.game.client.client import Client
from cipolla.game.player.player import Player
from typing import Any, Iterator, List, Optional, Tuple, Union, Set, Dict, Iterable
class ClientCollection(object):
def __init__(s... | 36.755102 | 204 | 0.659078 | import contextlib
from cube2protocol.cube_data_stream import CubeDataStream
from cipolla.game.client.client import Client
from cipolla.game.player.player import Player
from typing import Any, Iterator, List, Optional, Tuple, Union, Set, Dict, Iterable
class ClientCollection(object):
def __init__(self) -> None:
... | true | true |
1c20471148580a8a512dd51bacb5d641384d0a6c | 6,325 | py | Python | streamlit_ace/__init__.py | okld/streamlit-ace | e89d0c1d17bc22eb180046a02bf3d9a3cfbaed20 | [
"MIT"
] | 71 | 2020-10-19T07:26:59.000Z | 2022-03-26T11:00:39.000Z | streamlit_ace/__init__.py | okld/streamlit-ace | e89d0c1d17bc22eb180046a02bf3d9a3cfbaed20 | [
"MIT"
] | 27 | 2020-10-24T05:38:31.000Z | 2022-02-27T07:20:55.000Z | streamlit_ace/__init__.py | okld/streamlit-ace | e89d0c1d17bc22eb180046a02bf3d9a3cfbaed20 | [
"MIT"
] | 14 | 2020-11-06T14:24:51.000Z | 2022-02-09T12:00:02.000Z | import streamlit as st
from pathlib import Path
from streamlit.components.v1.components import declare_component
from streamlit_ace.version import __release__, __version__
if __release__:
_source = {"path": (Path(__file__).parent/"frontend"/"build").resolve()}
else:
_source = {"url": "http://localhost:3001"}
... | 41.339869 | 110 | 0.633676 | import streamlit as st
from pathlib import Path
from streamlit.components.v1.components import declare_component
from streamlit_ace.version import __release__, __version__
if __release__:
_source = {"path": (Path(__file__).parent/"frontend"/"build").resolve()}
else:
_source = {"url": "http://localhost:3001"}
... | true | true |
1c20471714460decdc342a04aed2c17cbb6d33ac | 8,013 | py | Python | tests/test_html_pbp.py | adamcyber1/hockeydata | b1ef31c7491648e8d23a7fd1d70fe0bd0067c63d | [
"MIT"
] | 4 | 2020-03-02T03:25:37.000Z | 2020-12-27T04:48:12.000Z | tests/test_html_pbp.py | adamcyber1/hockeydata | b1ef31c7491648e8d23a7fd1d70fe0bd0067c63d | [
"MIT"
] | 8 | 2020-03-02T02:38:40.000Z | 2020-05-27T17:07:06.000Z | tests/test_html_pbp.py | adamfillion/hockeydata | b1ef31c7491648e8d23a7fd1d70fe0bd0067c63d | [
"MIT"
] | 2 | 2020-05-24T00:12:28.000Z | 2020-05-25T05:15:59.000Z | import pandas as pd
import unittest
import hockeydata.scrape.html_pbp as html_pbp
from hockeydata.scrape.scrape import game_html_pbp
#TODO get can actual example with an expected output
class TestHTMLPBP(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.game_id = '2018021000'
def test_ra... | 68.487179 | 122 | 0.520654 | import pandas as pd
import unittest
import hockeydata.scrape.html_pbp as html_pbp
from hockeydata.scrape.scrape import game_html_pbp
class TestHTMLPBP(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.game_id = '2018021000'
def test_raw_html(self):
try:
res = html_pb... | true | true |
1c204804e857d6ce17ba35093245e074c02a0bea | 1,164 | py | Python | DP/Microsoft. Maximum Uncontinuous Sequence.py | xli1110/LC | 3c18b8809c5a21a62903060eef659654e0595036 | [
"MIT"
] | 2 | 2021-04-02T11:57:46.000Z | 2021-04-02T11:57:47.000Z | DP/Microsoft. Maximum Uncontinuous Sequence.py | xli1110/LC | 3c18b8809c5a21a62903060eef659654e0595036 | [
"MIT"
] | null | null | null | DP/Microsoft. Maximum Uncontinuous Sequence.py | xli1110/LC | 3c18b8809c5a21a62903060eef659654e0595036 | [
"MIT"
] | null | null | null | def max_sub_seq(arr):
"""
Problem1
Maximal Uncontinuous Sequence
arr = [1, 2, 3, 4]
res = 6 (2 + 4)
arr = [-1, 1]
res = 1
arr = [-1, -1, -1, ...]
res = 0
length = 10 ^ 6
dp[i] = max(dp[i - 1], dp[i - 2] + arr[i])
dp[i - 1] = max(dp[i - 2], dp[i - 3] + arr[i - 1])
... | 16.869565 | 77 | 0.458763 | def max_sub_seq(arr):
if not arr:
raise Exception("Empty")
if len(arr) == 1:
return max(arr[0], 0)
if len(arr) == 2:
return max(arr[0], arr[1], 0)
dp = [0] * len(arr)
dp[0] = max(arr[0], 0)
dp[1] = max(arr[0], arr[1], 0)
for i in range(2, len(arr)):
... | true | true |
1c2049eae4c608315aa437e8dff44f339bdc5f97 | 6,317 | py | Python | algorithm/replay_buffer/atari_buffer/frame_stack_buffer.py | Stilwell-Git/Randomized-Return-Decomposition | bc804736cbac0ab7ef2eb241d5b17f4a5e2e80a2 | [
"MIT"
] | 1 | 2022-03-21T21:38:15.000Z | 2022-03-21T21:38:15.000Z | algorithm/replay_buffer/atari_buffer/frame_stack_buffer.py | Stilwell-Git/Randomized-Return-Decomposition | bc804736cbac0ab7ef2eb241d5b17f4a5e2e80a2 | [
"MIT"
] | null | null | null | algorithm/replay_buffer/atari_buffer/frame_stack_buffer.py | Stilwell-Git/Randomized-Return-Decomposition | bc804736cbac0ab7ef2eb241d5b17f4a5e2e80a2 | [
"MIT"
] | null | null | null | import copy
import numpy as np
class Episode_FrameStack:
def __init__(self, info):
self.common_info = [
'obs', 'obs_next', 'frame_next',
'acts', 'rews', 'done'
]
self.ep = {
'obs': [],
'acts': [],
'rews': [],
'done': []... | 36.514451 | 123 | 0.549153 | import copy
import numpy as np
class Episode_FrameStack:
def __init__(self, info):
self.common_info = [
'obs', 'obs_next', 'frame_next',
'acts', 'rews', 'done'
]
self.ep = {
'obs': [],
'acts': [],
'rews': [],
'done': []... | true | true |
1c204a75d93b50e9e018f4070e53c73c860c04b3 | 16,798 | py | Python | run_summarization.py | chmille3/pointer-generator | 8718e1b63e6a396e3475196bf1af70877ee0adb7 | [
"Apache-2.0"
] | null | null | null | run_summarization.py | chmille3/pointer-generator | 8718e1b63e6a396e3475196bf1af70877ee0adb7 | [
"Apache-2.0"
] | null | null | null | run_summarization.py | chmille3/pointer-generator | 8718e1b63e6a396e3475196bf1af70877ee0adb7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... | 51.057751 | 503 | 0.738302 |
"""This is the top-level file to train, evaluate or test your summarization model"""
import sys
import time
import os
import tensorflow as tf
import numpy as np
from collections import namedtuple
from data import Vocab
from batcher import Batcher
from model import SummarizationModel
from decode import ... | false | true |
1c204a83da79688202690e9cd3df95bbe4079283 | 1,218 | py | Python | env/lib/python2.7/site-packages/django/core/management/commands/dbshell.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/django/core/management/commands/dbshell.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/django/core/management/commands/dbshell.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
requires_system_checks = False
... | 45.111111 | 100 | 0.659278 | from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
requires_system_checks = False
... | true | true |
1c204b0e51561e744df68b0835f3145d1e5b05bb | 1,898 | py | Python | src/odinapi/views/read_odinsmr2_old.py | Odin-SMR/odin-api | dea75016a6f9e61be0dd64a698b03ded5a6f0f10 | [
"MIT"
] | null | null | null | src/odinapi/views/read_odinsmr2_old.py | Odin-SMR/odin-api | dea75016a6f9e61be0dd64a698b03ded5a6f0f10 | [
"MIT"
] | 85 | 2020-04-01T06:24:29.000Z | 2022-03-28T04:28:56.000Z | src/odinapi/views/read_odinsmr2_old.py | Odin-SMR/odin-api | dea75016a6f9e61be0dd64a698b03ded5a6f0f10 | [
"MIT"
] | null | null | null | import os
from pyhdf import VS, HDF
L2P_PATH_2_1 = "/odin-smr-2-1-data"
L2P_PATH_2_0 = "/odin-smr-2-0-data"
L2P_PATH_2_3 = "/odin-smr-2-3-data"
L2P_PATH_2_4 = "/odin-smr-2-4-data"
def read_qsmr_file(filename, species, index2):
# Open HDF file:
index2 = int(index2)
if filename.split('.')[0].endswith('020'... | 30.612903 | 75 | 0.589041 | import os
from pyhdf import VS, HDF
L2P_PATH_2_1 = "/odin-smr-2-1-data"
L2P_PATH_2_0 = "/odin-smr-2-0-data"
L2P_PATH_2_3 = "/odin-smr-2-3-data"
L2P_PATH_2_4 = "/odin-smr-2-4-data"
def read_qsmr_file(filename, species, index2):
index2 = int(index2)
if filename.split('.')[0].endswith('020'):
l2p_p... | true | true |
1c204bb1eb3b74c6a6b309ec072f1bd705ae813e | 769 | py | Python | proxypool/crawlers/base.py | ccfleaf/Python3WebSpider | 9ebb54af28dab930d44a70443be6ad1ab8daa693 | [
"MIT"
] | null | null | null | proxypool/crawlers/base.py | ccfleaf/Python3WebSpider | 9ebb54af28dab930d44a70443be6ad1ab8daa693 | [
"MIT"
] | null | null | null | proxypool/crawlers/base.py | ccfleaf/Python3WebSpider | 9ebb54af28dab930d44a70443be6ad1ab8daa693 | [
"MIT"
] | null | null | null | from retrying import retry
import requests
from loguru import logger
class BaseCrawler(object):
urls = []
@retry(stop_max_attempt_number=3, retry_on_result=lambda x: x is None)
def fetch(self, url, **kwargs):
try:
response = requests.get(url, **kwargs)
if response.stat... | 26.517241 | 74 | 0.560468 | from retrying import retry
import requests
from loguru import logger
class BaseCrawler(object):
urls = []
@retry(stop_max_attempt_number=3, retry_on_result=lambda x: x is None)
def fetch(self, url, **kwargs):
try:
response = requests.get(url, **kwargs)
if response.stat... | true | true |
1c204c8f5af5e461860e5eb969d253c2c297d46a | 2,038 | py | Python | bot.py | iLuiizUHD/Expertise-Bot-v2 | 2b5264804d14d74ce1c0511dede434b7225683e0 | [
"MIT"
] | 2 | 2020-11-01T02:44:58.000Z | 2021-02-21T18:05:39.000Z | bot.py | iLuiizUHD/Expertise-Bot-v2 | 2b5264804d14d74ce1c0511dede434b7225683e0 | [
"MIT"
] | 1 | 2020-09-13T20:53:26.000Z | 2020-09-13T20:53:26.000Z | bot.py | iLuiizUHD/ExpertiseBot2 | 2b5264804d14d74ce1c0511dede434b7225683e0 | [
"MIT"
] | null | null | null | from libs import utils
from colorama import init as colinit
from colorama import Fore, Back, Style
import json
import math
import os
import datetime
# Discord
import discord
from discord.ext import commands, tasks
# Loading config file...
with open("./config.json", "r", encoding="utf-8") as config:
configFile = j... | 26.815789 | 104 | 0.665358 | from libs import utils
from colorama import init as colinit
from colorama import Fore, Back, Style
import json
import math
import os
import datetime
import discord
from discord.ext import commands, tasks
with open("./config.json", "r", encoding="utf-8") as config:
configFile = json.load(config)
colinit()
to... | true | true |
1c204dc1ff7d894c755866aca5da6c7e86b4c881 | 24,716 | py | Python | trac/wiki/tests/macros.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | 1 | 2017-08-03T07:04:28.000Z | 2017-08-03T07:04:28.000Z | trac/wiki/tests/macros.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | null | null | null | trac/wiki/tests/macros.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | 46.371482 | 991 | 0.55454 |
from StringIO import StringIO
from datetime import datetime
import os
import shutil
import tempfile
import unittest
from trac.config import Option, ListOption, IntOption, BoolOption
from trac.test import locale_en
from trac.util.datefmt import format_date, utc
from trac.wiki.model import WikiPage
from tra... | true | true |
1c204e999a548b554bf568edf877e5419dbdaee4 | 11,797 | py | Python | tuning/position.py | bptripp/it-cnn | aa8b9fc86de7692a02b2fa51ed5398798a63204f | [
"MIT"
] | null | null | null | tuning/position.py | bptripp/it-cnn | aa8b9fc86de7692a02b2fa51ed5398798a63204f | [
"MIT"
] | null | null | null | tuning/position.py | bptripp/it-cnn | aa8b9fc86de7692a02b2fa51ed5398798a63204f | [
"MIT"
] | null | null | null | __author__ = 'bptripp'
import cPickle as pickle
from scipy.optimize import curve_fit
import numpy as np
import matplotlib
matplotlib.rcParams['xtick.labelsize'] = 16
matplotlib.rcParams['ytick.labelsize'] = 16
import matplotlib.pyplot as plt
from cnn_stimuli import get_image_file_list
from alexnet import preprocess, l... | 31.044737 | 109 | 0.614224 | __author__ = 'bptripp'
import cPickle as pickle
from scipy.optimize import curve_fit
import numpy as np
import matplotlib
matplotlib.rcParams['xtick.labelsize'] = 16
matplotlib.rcParams['ytick.labelsize'] = 16
import matplotlib.pyplot as plt
from cnn_stimuli import get_image_file_list
from alexnet import preprocess, l... | true | true |
1c204fae7991b0e01654d1af5fa5061fffa22159 | 1,905 | py | Python | cart_venv/Lib/site-packages/tensorflow_core/_api/v1/distributions/__init__.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | 2 | 2019-08-04T20:28:14.000Z | 2019-10-27T23:26:42.000Z | cart_venv/Lib/site-packages/tensorflow_core/_api/v1/distributions/__init__.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | null | null | null | cart_venv/Lib/site-packages/tensorflow_core/_api/v1/distributions/__init__.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | 1 | 2020-11-04T03:16:29.000Z | 2020-11-04T03:16:29.000Z | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Core module for TensorFlow distribution objects and helpers.
"""
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.ops.distributions.be... | 51.486486 | 90 | 0.860892 |
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.ops.distributions.bernoulli import Bernoulli
from tensorflow.python.ops.distributions.beta import Beta
from tensorflow.python.ops.distributions.categorical import Categorical
from tensorflow.python.ops.distributions.... | true | true |
1c2051f244683d60e7cfd23b4106bdc5c46ebe2e | 2,384 | py | Python | tests/test_syscall_override.py | SiameseJuly/angr | 24d960d558b77f5a85d76dccb45e5f3827e6227f | [
"BSD-2-Clause"
] | null | null | null | tests/test_syscall_override.py | SiameseJuly/angr | 24d960d558b77f5a85d76dccb45e5f3827e6227f | [
"BSD-2-Clause"
] | null | null | null | tests/test_syscall_override.py | SiameseJuly/angr | 24d960d558b77f5a85d76dccb45e5f3827e6227f | [
"BSD-2-Clause"
] | 1 | 2020-03-10T04:25:33.000Z | 2020-03-10T04:25:33.000Z | import nose
import angr
import logging
l = logging.getLogger("angr.tests")
import os
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
target_addrs = {
'i386': [ 0x080485C9 ],
'x86_64': [ 0x4006ed ],
'ppc': [ 0x1000060C ],
'armel': [ 0x85F0 ],
... | 36.676923 | 102 | 0.67156 | import nose
import angr
import logging
l = logging.getLogger("angr.tests")
import os
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
target_addrs = {
'i386': [ 0x080485C9 ],
'x86_64': [ 0x4006ed ],
'ppc': [ 0x1000060C ],
'armel': [ 0x85F0 ],
... | true | true |
1c2052a376c0d0b8abb96a34bf57933324515060 | 7,342 | py | Python | cogs/Fun.py | a2br/Noodles | 505f0b40c012223ef7dc0c6dc0c6b00f496a693c | [
"MIT"
] | 3 | 2020-06-16T15:24:51.000Z | 2020-07-22T09:06:13.000Z | cogs/Fun.py | a2br/Noodles | 505f0b40c012223ef7dc0c6dc0c6b00f496a693c | [
"MIT"
] | 1 | 2021-02-22T00:25:50.000Z | 2021-02-22T00:25:50.000Z | cogs/Fun.py | a2br/Noodles | 505f0b40c012223ef7dc0c6dc0c6b00f496a693c | [
"MIT"
] | 2 | 2020-06-16T12:10:37.000Z | 2020-06-18T02:44:31.000Z | import random
from io import BytesIO
import PIL
import aiohttp
import discord
import requests
from PIL import ImageDraw
from discord.ext import commands
from utils.fun.data import fight_results, insults
from utils.fun.fortunes import fortunes
from utils.secret import *
session = aiohttp.ClientSession()... | 39.053191 | 197 | 0.561019 | import random
from io import BytesIO
import PIL
import aiohttp
import discord
import requests
from PIL import ImageDraw
from discord.ext import commands
from utils.fun.data import fight_results, insults
from utils.fun.fortunes import fortunes
from utils.secret import *
session = aiohttp.ClientSession()... | true | true |
1c205372d5edd18b388e2a7d5668a203c80d875b | 1,651 | py | Python | problem solving/birthday-cake-candles.py | avnoor-488/hackerrank-solutions | b62315549c254d88104b70755e4dfcd43eba59bf | [
"MIT"
] | 1 | 2020-10-01T16:54:52.000Z | 2020-10-01T16:54:52.000Z | problem solving/birthday-cake-candles.py | avnoor-488/hackerrank-solutions | b62315549c254d88104b70755e4dfcd43eba59bf | [
"MIT"
] | 2 | 2020-10-07T02:22:13.000Z | 2020-10-22T06:15:50.000Z | problem solving/birthday-cake-candles.py | avnoor-488/hackerrank-solutions | b62315549c254d88104b70755e4dfcd43eba59bf | [
"MIT"
] | 9 | 2020-10-01T12:30:56.000Z | 2020-10-22T06:10:14.000Z | '''
problem--
You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out.
For example, i... | 25.796875 | 289 | 0.718353 |
import math
import os
import random
import re
import sys
def birthdayCakeCandles(ar):
x=max(ar)
c=0
for i in ar:
if i==x:
c+=1
return c
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
ar_count = int(input())
ar = list(map(int, input().rstri... | true | true |
1c205378597259cc03c0dbbaec49a9720f6bca2b | 1,297 | py | Python | Problems/Study Plans/Data Structure/Data Structure II/36_3sum.py | andor2718/LeetCode | 59874f49085818e6da751f1cc26867b31079d35d | [
"BSD-3-Clause"
] | 1 | 2022-01-17T19:51:15.000Z | 2022-01-17T19:51:15.000Z | Problems/Study Plans/Data Structure/Data Structure II/36_3sum.py | andor2718/LeetCode | 59874f49085818e6da751f1cc26867b31079d35d | [
"BSD-3-Clause"
] | null | null | null | Problems/Study Plans/Data Structure/Data Structure II/36_3sum.py | andor2718/LeetCode | 59874f49085818e6da751f1cc26867b31079d35d | [
"BSD-3-Clause"
] | null | null | null | # https://leetcode.com/problems/3sum/
def find(nums: list[int], left: int, right: int, target: int) -> bool:
while left <= right:
mid = (left + right) // 2
guess = nums[mid]
if guess == target:
return True
elif guess < target:
left = mid + 1
else:
... | 32.425 | 70 | 0.457209 |
def find(nums: list[int], left: int, right: int, target: int) -> bool:
while left <= right:
mid = (left + right) // 2
guess = nums[mid]
if guess == target:
return True
elif guess < target:
left = mid + 1
else:
right = mid - 1
return F... | true | true |
1c20550764056d9613e2e1f1f6c6e354a0a67b23 | 7,123 | py | Python | desktop/core/ext-py/cffi-1.11.5/testing/cffi1/test_dlopen.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 163 | 2016-03-18T21:32:05.000Z | 2021-11-08T08:46:22.000Z | desktop/core/ext-py/cffi-1.11.5/testing/cffi1/test_dlopen.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 9 | 2018-12-14T07:31:42.000Z | 2020-12-09T20:29:28.000Z | desktop/core/ext-py/cffi-1.11.5/testing/cffi1/test_dlopen.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 64 | 2018-04-25T08:51:57.000Z | 2022-01-29T14:13:57.000Z | import py
from cffi import FFI, VerificationError, CDefError
from cffi.recompiler import make_py_source
from testing.udir import udir
def test_simple():
ffi = FFI()
ffi.cdef("int close(int); static const int BB = 42; int somevar;")
target = udir.join('test_simple.py')
make_py_source(ffi, 'test_simple'... | 31.517699 | 152 | 0.661519 | import py
from cffi import FFI, VerificationError, CDefError
from cffi.recompiler import make_py_source
from testing.udir import udir
def test_simple():
ffi = FFI()
ffi.cdef("int close(int); static const int BB = 42; int somevar;")
target = udir.join('test_simple.py')
make_py_source(ffi, 'test_simple'... | true | true |
1c20553a4f81bae50096079e5ebf4f6439b30b54 | 7,359 | py | Python | litex/soc/cores/hyperbus.py | motec-research/litex | 0bd2abf68d3047e9bba09604b99b9019b02084fd | [
"ADSL"
] | null | null | null | litex/soc/cores/hyperbus.py | motec-research/litex | 0bd2abf68d3047e9bba09604b99b9019b02084fd | [
"ADSL"
] | null | null | null | litex/soc/cores/hyperbus.py | motec-research/litex | 0bd2abf68d3047e9bba09604b99b9019b02084fd | [
"ADSL"
] | null | null | null | #
# This file is part of LiteHyperBus
#
# Copyright (c) 2019-2022 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2019 Antti Lukats <antti.lukats@gmail.com>
# Copyright (c) 2021 Franck Jullien <franck.jullien@collshade.fr>
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from migen.genlib.misc ... | 36.979899 | 100 | 0.430357 |
from migen import *
from migen.genlib.misc import timeline
from litex.build.io import DifferentialOutput
from litex.soc.interconnect import wishbone
class HyperRAM(Module):
def __init__(self, pads, latency=6):
self.pads = pads
self.bus = bus = wishbone.Interface()
clk ... | true | true |
1c20554b4d7fa0df3869f9b12e0cdbbeb24fb8ab | 16,799 | py | Python | django/db/backends/mysql/base.py | DavTema/django | 5d13cc540e29eedafe695338d8ec9ec500185ccd | [
"BSD-3-Clause",
"0BSD"
] | 1 | 2022-01-03T21:10:41.000Z | 2022-01-03T21:10:41.000Z | django/db/backends/mysql/base.py | DavTema/django | 5d13cc540e29eedafe695338d8ec9ec500185ccd | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | django/db/backends/mysql/base.py | DavTema/django | 5d13cc540e29eedafe695338d8ec9ec500185ccd | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | """
MySQL database backend for Django.
Requires mysqlclient: https://pypi.org/project/mysqlclient/
"""
from django.core.exceptions import ImproperlyConfigured
from django.db import IntegrityError
from django.db.backends import utils as backend_utils
from django.db.backends.base.base import BaseDatabaseWrapper
from dja... | 38.092971 | 88 | 0.588368 | from django.core.exceptions import ImproperlyConfigured
from django.db import IntegrityError
from django.db.backends import utils as backend_utils
from django.db.backends.base.base import BaseDatabaseWrapper
from django.utils.asyncio import async_unsafe
from django.utils.functional import cached_property
from django.ut... | true | true |
1c20559b0df05d6db30b65d091b84a150157b66d | 179 | py | Python | hackerrank/30-days-of-code/day-7.py | vaishali-bariwal/Practice-Coding-Questions | 747bfcb1cb2be5340daa745f2b9938f0ee87c9ac | [
"Unlicense"
] | 25 | 2018-05-22T15:18:50.000Z | 2022-01-08T02:41:46.000Z | hackerrank/30-days-of-code/day-7.py | vaishali-bariwal/Practice-Coding-Questions | 747bfcb1cb2be5340daa745f2b9938f0ee87c9ac | [
"Unlicense"
] | 1 | 2019-05-24T16:55:27.000Z | 2019-05-24T16:55:27.000Z | hackerrank/30-days-of-code/day-7.py | vaishali-bariwal/Practice-Coding-Questions | 747bfcb1cb2be5340daa745f2b9938f0ee87c9ac | [
"Unlicense"
] | 18 | 2018-09-20T15:39:26.000Z | 2022-03-02T21:38:22.000Z | #!/bin/python3
import sys
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
for i in range(n):
print (arr[n-i-1], end=" ") | 17.9 | 65 | 0.564246 |
import sys
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
for i in range(n):
print (arr[n-i-1], end=" ") | true | true |
1c205668c7a36f0f2c12259262710e942f2e2187 | 7,444 | py | Python | mjrl/utils/gym_env.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | mjrl/utils/gym_env.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | mjrl/utils/gym_env.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | """
Wrapper around a gym env that provides convenience functions
"""
import gym
import numpy as np
import mj_envs.envs.hand_manipulation_suite # just make the gym registration
class EnvSpec(object):
def __init__(self, obs_dim, act_dim, horizon):
self.observation_dim = obs_dim
self.action_dim = act... | 32.649123 | 115 | 0.548361 |
import gym
import numpy as np
import mj_envs.envs.hand_manipulation_suite
class EnvSpec(object):
def __init__(self, obs_dim, act_dim, horizon):
self.observation_dim = obs_dim
self.action_dim = act_dim
self.horizon = horizon
class GymEnv(object):
def __init__(self, env_name, env_kwar... | true | true |
1c2057ab30f012a1c9184cd86606c1735e8c0851 | 5,298 | py | Python | Tictactoe.py | Nik6198/TicTacToe | cb62dcd84cd83cc66030ab91717022c1d903e205 | [
"MIT"
] | null | null | null | Tictactoe.py | Nik6198/TicTacToe | cb62dcd84cd83cc66030ab91717022c1d903e205 | [
"MIT"
] | null | null | null | Tictactoe.py | Nik6198/TicTacToe | cb62dcd84cd83cc66030ab91717022c1d903e205 | [
"MIT"
] | null | null | null | class TicTacToe:
def __init__(self, board, sign):
self.board = board
self.player = sign
self.minmaxarg = [0, 999 ]
def printBoard(self):
for i in range(3):
for j in range(3):
print(self.board[i*3 + j],end=' ')
print()
print()
... | 30.624277 | 67 | 0.416572 | class TicTacToe:
def __init__(self, board, sign):
self.board = board
self.player = sign
self.minmaxarg = [0, 999 ]
def printBoard(self):
for i in range(3):
for j in range(3):
print(self.board[i*3 + j],end=' ')
print()
print()
... | true | true |
1c205869f94c92cc51fa93b14cdd2a3f8a157f2e | 2,620 | py | Python | IPython/utils/doctestreload.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 1 | 2018-09-24T13:45:40.000Z | 2018-09-24T13:45:40.000Z | IPython/utils/doctestreload.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 3 | 2015-04-01T13:14:57.000Z | 2015-05-26T16:01:37.000Z | IPython/utils/doctestreload.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-10-06T07:59:25.000Z | 2021-10-06T07:59:25.000Z | # encoding: utf-8
"""
A utility for handling the reloading of doctest.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distribute... | 34.473684 | 78 | 0.578626 |
import sys
def dhook_wrap(func,*a,**k):
def f(*a,**k):
dhook_s = sys.displayhook
sys.displayhook = sys.__displayhook__
try:
out = func(*a,**k)
finally:
sys.displayhook = dhook_s
return out
f.__doc__ = func.__doc__
return f... | true | true |
1c205893f780b84fac8c267b6c373013f7511b7c | 1,103 | py | Python | Bugscan_exploits-master/exp_list/exp-1934.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-1934.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-1934.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
# coding: UTF-8
'''
author: yichin
name: 华创路由器命令执行0day
refer: 0day
description:
写个插件还要自己挖0day我容易么我,你们轻点刷行不行啊!!!
POC:
http://foobar/acc/bindipmac/static_arp_list_action.php?chkSysArpList[0]=0&sysArpEth[0]=1' and 0 union select 'a||echo hehehe>testvul.txt||b--&sysArpIp[0]=1&sysArp... | 34.46875 | 195 | 0.645512 |
import urlparse
def assign(service, arg):
if service == 'huachuang_router':
arr = urlparse.urlparse(arg)
return True, '%s://%s/' % (arr.scheme, arr.netloc)
def audit(arg):
payload = arg + 'acc/bindipmac/static_arp_list_action.php?chkSysArpList[0]=0&sysArpEth[0]=1%27%20and%200%2... | true | true |
1c20591110455c3e7ab5a75adad1f5793601492c | 5,049 | py | Python | models/retinaface.py | FlyEgle/retinaface_pytorch | 79628fc5837b888b7f3e19c97a5ceabe860b0344 | [
"MIT"
] | 2 | 2021-08-19T12:50:48.000Z | 2021-08-20T00:19:00.000Z | models/retinaface.py | FlyEgle/retinaface_pytorch | 79628fc5837b888b7f3e19c97a5ceabe860b0344 | [
"MIT"
] | null | null | null | models/retinaface.py | FlyEgle/retinaface_pytorch | 79628fc5837b888b7f3e19c97a5ceabe860b0344 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torchvision.models.detection.backbone_utils as backbone_utils
import torchvision.models._utils as _utils
import torch.nn.functional as F
from collections import OrderedDict
from models.net import MobileNetV1 as MobileNetV1
from models.net import FPN as FPN
from models... | 39.755906 | 174 | 0.628639 | import torch
import torch.nn as nn
import torchvision.models.detection.backbone_utils as backbone_utils
import torchvision.models._utils as _utils
import torch.nn.functional as F
from collections import OrderedDict
from models.net import MobileNetV1 as MobileNetV1
from models.net import FPN as FPN
from models... | true | true |
1c2059f34cd249c4c5b89caf12f150482e6c129f | 1,071 | py | Python | benchmarks/future_full_throttle.py | fatelei/python-driver | 3bddef6185f2691e1713dfe51d1fa26d1555724c | [
"Apache-2.0"
] | 1 | 2021-03-06T05:07:47.000Z | 2021-03-06T05:07:47.000Z | benchmarks/future_full_throttle.py | fatelei/python-driver | 3bddef6185f2691e1713dfe51d1fa26d1555724c | [
"Apache-2.0"
] | null | null | null | benchmarks/future_full_throttle.py | fatelei/python-driver | 3bddef6185f2691e1713dfe51d1fa26d1555724c | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2015 DataStax, 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 writi... | 26.775 | 74 | 0.706816 |
import logging
from base import benchmark, BenchmarkThread
log = logging.getLogger(__name__)
class Runner(BenchmarkThread):
def run(self):
futures = []
self.start_profile()
for _ in range(self.num_queries):
future = self.session.execute_async(self.query, self.... | true | true |
1c205ad3d7297d1ffceceb7fded29b50d4134633 | 1,937 | py | Python | test.py | yoyonel/twint | d41c5f459974c9c19574fb9b778ed4e09e468c75 | [
"MIT"
] | 15 | 2019-10-07T17:38:11.000Z | 2021-04-14T17:50:51.000Z | test_public.py | datagram1/twint | a1c01827ff9d88290fd5eeb04748e522a6d5f827 | [
"MIT"
] | null | null | null | test_public.py | datagram1/twint | a1c01827ff9d88290fd5eeb04748e522a6d5f827 | [
"MIT"
] | 1 | 2019-10-07T17:39:03.000Z | 2019-10-07T17:39:03.000Z | import twint
import os
'''
Test.py - Testing TWINT to make sure everything works.
'''
def test_reg(c, run):
print("[+] Beginning vanilla test in {}".format(str(run)))
run(c)
def test_db(c, run):
print("[+] Beginning DB test in {}".format(str(run)))
c.Database = "test_twint.db"
run(c)
def custom(... | 22.523256 | 71 | 0.549303 | import twint
import os
def test_reg(c, run):
print("[+] Beginning vanilla test in {}".format(str(run)))
run(c)
def test_db(c, run):
print("[+] Beginning DB test in {}".format(str(run)))
c.Database = "test_twint.db"
run(c)
def custom(c, run, _type):
print("[+] Beginning custom {} test in {}".... | true | true |
1c205af46d74c7c789404f19e67ce141cf7beedf | 2,501 | py | Python | tests/unit/workflows/go_modules/test_builder.py | wchengru/aws-lambda-builders | 0f2abdcb3a83ab46440abd6a6c4350ce67fd1f7a | [
"Apache-2.0"
] | 1 | 2021-07-10T14:34:20.000Z | 2021-07-10T14:34:20.000Z | tests/unit/workflows/go_modules/test_builder.py | wchengru/aws-lambda-builders | 0f2abdcb3a83ab46440abd6a6c4350ce67fd1f7a | [
"Apache-2.0"
] | null | null | null | tests/unit/workflows/go_modules/test_builder.py | wchengru/aws-lambda-builders | 0f2abdcb3a83ab46440abd6a6c4350ce67fd1f7a | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from mock import patch, Mock
from aws_lambda_builders.binary_path import BinaryPath
from aws_lambda_builders.workflows.go_modules.builder import GoModulesBuilder, BuilderError
class FakePopen:
def __init__(self, out=b"out", err=b"err", retcode=0):
self.out = out
sel... | 39.698413 | 117 | 0.653739 | from unittest import TestCase
from mock import patch, Mock
from aws_lambda_builders.binary_path import BinaryPath
from aws_lambda_builders.workflows.go_modules.builder import GoModulesBuilder, BuilderError
class FakePopen:
def __init__(self, out=b"out", err=b"err", retcode=0):
self.out = out
sel... | true | true |
1c205dec1106ac355821ef63b522da5729264572 | 2,723 | py | Python | graphiql_debug_toolbar/middleware.py | djmaze/django-graphiql-debug-toolbar | 087e7361f3f10f7af52edb20d03de31167bea5b4 | [
"MIT"
] | 1 | 2019-06-19T12:04:56.000Z | 2019-06-19T12:04:56.000Z | graphiql_debug_toolbar/middleware.py | urantialife/django-graphiql-debug-toolbar | 087e7361f3f10f7af52edb20d03de31167bea5b4 | [
"MIT"
] | null | null | null | graphiql_debug_toolbar/middleware.py | urantialife/django-graphiql-debug-toolbar | 087e7361f3f10f7af52edb20d03de31167bea5b4 | [
"MIT"
] | null | null | null | import json
import threading
from collections import OrderedDict
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from debug_toolbar import middleware
from graphene_django.views import GraphQLView
from .serializers import CallableJSONEncoder
__all__ = ['DebugToolbarMi... | 32.035294 | 75 | 0.67646 | import json
import threading
from collections import OrderedDict
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from debug_toolbar import middleware
from graphene_django.views import GraphQLView
from .serializers import CallableJSONEncoder
__all__ = ['DebugToolbarMi... | true | true |
1c205dec2ba8a66f7a53d54a16a11fe424c44630 | 1,408 | py | Python | app/main/forms.py | doraadong/product_info | b5d63237fd2de44541d04bc9dc29763e9e37da59 | [
"MIT"
] | 3 | 2018-06-20T10:22:14.000Z | 2020-12-18T02:57:15.000Z | app/main/forms.py | doraadong/product_info | b5d63237fd2de44541d04bc9dc29763e9e37da59 | [
"MIT"
] | null | null | null | app/main/forms.py | doraadong/product_info | b5d63237fd2de44541d04bc9dc29763e9e37da59 | [
"MIT"
] | null | null | null | from flask_wtf import Form, widgets
from wtforms import StringField, SubmitField, SelectField, FormField, FieldList, TextAreaField, IntegerField, DateField
from wtforms.validators import Required, Optional
from wtforms.widgets import ListWidget, TableWidget, TextInput, HiddenInput
from werkzeug import MultiDict
class ... | 38.054054 | 124 | 0.716619 | from flask_wtf import Form, widgets
from wtforms import StringField, SubmitField, SelectField, FormField, FieldList, TextAreaField, IntegerField, DateField
from wtforms.validators import Required, Optional
from wtforms.widgets import ListWidget, TableWidget, TextInput, HiddenInput
from werkzeug import MultiDict
class ... | true | true |
1c205ec6fd31334f914ccc0035917d25d8be43ed | 40,906 | py | Python | libs/win32/test/test_win32file.py | scannama/microsoftwordmodule | d49294da129c71bfc579c6e448d206921953f304 | [
"MIT"
] | 5 | 2020-08-24T23:29:58.000Z | 2022-02-07T19:58:07.000Z | libs/win32/test/test_win32file.py | scannama/microsoftwordmodule | d49294da129c71bfc579c6e448d206921953f304 | [
"MIT"
] | 10 | 2020-09-30T12:49:45.000Z | 2020-10-04T10:26:33.000Z | libs/win32/test/test_win32file.py | scannama/microsoftwordmodule | d49294da129c71bfc579c6e448d206921953f304 | [
"MIT"
] | 2 | 2020-08-24T23:30:06.000Z | 2021-12-23T18:23:38.000Z | from __future__ import print_function
import unittest
from pywin32_testutil import str2bytes, TestSkipped, testmain
import win32api, win32file, win32pipe, pywintypes, winerror, win32event
import win32con, ntsecuritycon
import sys
import os
import tempfile
import threading
import time
import shutil
import socket
import ... | 42.566077 | 148 | 0.599594 | from __future__ import print_function
import unittest
from pywin32_testutil import str2bytes, TestSkipped, testmain
import win32api, win32file, win32pipe, pywintypes, winerror, win32event
import win32con, ntsecuritycon
import sys
import os
import tempfile
import threading
import time
import shutil
import socket
import ... | true | true |
1c205f69658da630526107bd0e38e87d277b9bf6 | 9,243 | py | Python | pyEigenstrat.py | aabiddanda/gdc | 5e999ba5363a45a9a4e8f2edec03e5082a3cdab5 | [
"Apache-2.0"
] | null | null | null | pyEigenstrat.py | aabiddanda/gdc | 5e999ba5363a45a9a4e8f2edec03e5082a3cdab5 | [
"Apache-2.0"
] | null | null | null | pyEigenstrat.py | aabiddanda/gdc | 5e999ba5363a45a9a4e8f2edec03e5082a3cdab5 | [
"Apache-2.0"
] | null | null | null | # Class for reading packed and unpacked Eigenstrat/Ancestrymap format files.
# packedancestrymap format description by Nick Patterson below:
#
################################################################################
#
# usage:
#
# files named root.{ind,snp,geno} either packed or unpacked
#
# > data=pyEigenstrat... | 31.332203 | 93 | 0.535757 | true | true | |
1c20606ffdff189567abacb6980c85773708c855 | 526 | py | Python | encodeplz/cli.py | kennell/encodeplz | 0e480e08484b5f234a5ae0f2bff2c13baddd86f4 | [
"MIT"
] | 2 | 2017-11-14T00:31:09.000Z | 2020-05-19T05:51:12.000Z | encodeplz/cli.py | kennell/encodeplz | 0e480e08484b5f234a5ae0f2bff2c13baddd86f4 | [
"MIT"
] | null | null | null | encodeplz/cli.py | kennell/encodeplz | 0e480e08484b5f234a5ae0f2bff2c13baddd86f4 | [
"MIT"
] | null | null | null | import click
from .app import app
from .server import StandaloneServer
@click.command()
@click.option(
'--port',
default=5000,
help='Port to listen on, default is 5000'
)
def main(port):
server_options = {
'bind': '{ip}:{port}'.format(
ip='0.0.0.0',
port=port
),... | 19.481481 | 47 | 0.557034 | import click
from .app import app
from .server import StandaloneServer
@click.command()
@click.option(
'--port',
default=5000,
help='Port to listen on, default is 5000'
)
def main(port):
server_options = {
'bind': '{ip}:{port}'.format(
ip='0.0.0.0',
port=port
),... | true | true |
1c2060f9a9d2e0dd77fcd2875f054a0644b22c00 | 1,605 | py | Python | courses/E375004/control/utils.py | CVUT-FS-12110/Python-for-scientific-computation-and-control | b2ebae9eb3ded5c28238e39a0cac9e23eb1d25d1 | [
"MIT"
] | null | null | null | courses/E375004/control/utils.py | CVUT-FS-12110/Python-for-scientific-computation-and-control | b2ebae9eb3ded5c28238e39a0cac9e23eb1d25d1 | [
"MIT"
] | null | null | null | courses/E375004/control/utils.py | CVUT-FS-12110/Python-for-scientific-computation-and-control | b2ebae9eb3ded5c28238e39a0cac9e23eb1d25d1 | [
"MIT"
] | 1 | 2019-12-09T10:59:20.000Z | 2019-12-09T10:59:20.000Z | """
Utility functions for pygame simulator ('simulator.py')
"""
import numpy as np
import matplotlib.pyplot as plt
def solver(x, v_x, c, m, f, delta_t, x_max, x_img_size, padding = 0):
"""
Euler solver of dynamical system:
m*x" + c*x' = f
state space substitution:
x1 = x
x2 = v_x
x1(k+1... | 29.181818 | 98 | 0.626791 | import numpy as np
import matplotlib.pyplot as plt
def solver(x, v_x, c, m, f, delta_t, x_max, x_img_size, padding = 0):
x_new = x + v_x*delta_t
v_new = v_x - (c / m) * v_x * delta_t + (f / m) * delta_t
if x_new + x_img_size//2 +padding > x_max:
return x, 0
elif x_new + x_img_size//2 <... | true | true |
1c20614251aa913cea89f9a4cef4531030951996 | 2,974 | py | Python | python/pyarrow/tests/test_misc.py | robertnishihara/arrow | 27f990a503f8d9370037bd12c235aae1c1378fb9 | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/test_misc.py | robertnishihara/arrow | 27f990a503f8d9370037bd12c235aae1c1378fb9 | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/test_misc.py | robertnishihara/arrow | 27f990a503f8d9370037bd12c235aae1c1378fb9 | [
"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... | 24.991597 | 72 | 0.688635 |
import os
import pytest
import pyarrow as pa
def test_get_include():
include_dir = pa.get_include()
assert os.path.exists(os.path.join(include_dir, 'arrow', 'api.h'))
def test_cpu_count():
n = pa.cpu_count()
assert n > 0
try:
pa.set_cpu_count(n + 5)
assert pa.cp... | true | true |
1c2061ae43f2a1e7084cc83c3c772280e278fed6 | 7,395 | py | Python | ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/KERBEROS/package/scripts/params.py | kennyballou/ambari | 8985bcf11296d540a861a8634c17d6b9b1accd5a | [
"Apache-2.0"
] | 1 | 2015-05-04T12:19:05.000Z | 2015-05-04T12:19:05.000Z | ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/KERBEROS/package/scripts/params.py | kennyballou/ambari | 8985bcf11296d540a861a8634c17d6b9b1accd5a | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/KERBEROS/package/scripts/params.py | kennyballou/ambari | 8985bcf11296d540a861a8634c17d6b9b1accd5a | [
"Apache-2.0"
] | 1 | 2021-01-07T08:55:01.000Z | 2021-01-07T08:55:01.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 use this ... | 38.921053 | 100 | 0.694253 |
from resource_management import *
from utils import get_property_value, get_unstructured_data
os_family = System.get_instance().os_family
krb5_conf_dir = '/etc'
krb5_conf_file = 'krb5.conf'
krb5_conf_path = krb5_conf_dir + '/' + krb5_conf_file
if os_family == 'suse':
kdc_conf_dir = '/var/lib/kerberos/krb5kdc'
eli... | true | true |
1c2062153498ef3eeef920936749b972cc4b1c85 | 2,345 | py | Python | examples/multi_rules_old/show_solution.py | smbct/LOLH | a9b608b500c83731db2c7dcb70e08cf9a2a94fe0 | [
"MIT"
] | 2 | 2022-01-13T18:53:03.000Z | 2022-01-13T18:53:42.000Z | examples/multi_rules_old/show_solution.py | smbct/LOLH | a9b608b500c83731db2c7dcb70e08cf9a2a94fe0 | [
"MIT"
] | null | null | null | examples/multi_rules_old/show_solution.py | smbct/LOLH | a9b608b500c83731db2c7dcb70e08cf9a2a94fe0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import colors as mcolors
import sys
sys.path.append('../../python')
from instance import Instance
from solver import Solver
import visualizer
import histogram
print('\n')
print('Class... | 28.597561 | 117 | 0.727079 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import colors as mcolors
import sys
sys.path.append('../../python')
from instance import Instance
from solver import Solver
import visualizer
import histogram
print('\n')
print('Classification of the ... | true | true |
1c20622dfda5555c5fcec506df24ad34d44cc1b8 | 7,244 | py | Python | reviewboard/accounts/backends/standard.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | reviewboard/accounts/backends/standard.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | reviewboard/accounts/backends/standard.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | """Standard authentication backend."""
import logging
from django.conf import settings
from django.contrib.auth import hashers
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from djblets.db.query import get_obje... | 36.959184 | 78 | 0.621066 |
import logging
from django.conf import settings
from django.contrib.auth import hashers
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from djblets.db.query import get_object_or_none
from reviewboard.accounts.b... | true | true |
1c20626ef91f6f6e6382f514e04693bdec441c9f | 17,048 | py | Python | applications/welcome/languages/zh-cn.py | misl6/web2py | 4191d4c48c37c66cc7eb293b610a6b6e86870571 | [
"BSD-3-Clause"
] | 5 | 2020-04-09T15:07:00.000Z | 2021-07-19T14:12:17.000Z | applications/welcome/languages/zh-cn.py | misl6/web2py | 4191d4c48c37c66cc7eb293b610a6b6e86870571 | [
"BSD-3-Clause"
] | 16 | 2020-03-30T13:00:10.000Z | 2020-05-16T16:42:52.000Z | applications/welcome/languages/zh-cn.py | misl6/web2py | 4191d4c48c37c66cc7eb293b610a6b6e86870571 | [
"BSD-3-Clause"
] | 2 | 2020-09-18T15:12:26.000Z | 2020-11-10T22:09:59.000Z | # -*- coding: utf-8 -*-
{
'!langcode!': 'zh-cn',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" 应为选择表达式, 格式如 "field1=\'value\'". 但是对 JOIN 的结果不可以使用 update 或者 delete"',
'%s %%{row} deleted': '已删除 %s 笔',
'%s %%{row} updated'... | 46.835165 | 265 | 0.654505 |
{
'!langcode!': 'zh-cn',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" 应为选择表达式, 格式如 "field1=\'value\'". 但是对 JOIN 的结果不可以使用 update 或者 delete"',
'%s %%{row} deleted': '已删除 %s 笔',
'%s %%{row} updated': '已更新 %s 笔',
'%s selec... | true | true |
1c2062c630a4fb5b1caf7a2ee51e2d30ce07374e | 12,114 | py | Python | quantumflow/decompositions.py | stjordanis/quantumflow | bf965f0ca70cd69b387f9ca8407ab38da955e925 | [
"Apache-2.0"
] | 99 | 2018-12-03T20:41:39.000Z | 2022-02-21T13:56:08.000Z | quantumflow/decompositions.py | stjordanis/quantumflow | bf965f0ca70cd69b387f9ca8407ab38da955e925 | [
"Apache-2.0"
] | 1 | 2021-06-25T15:18:31.000Z | 2021-06-25T15:18:31.000Z | quantumflow/decompositions.py | stjordanis/quantumflow | bf965f0ca70cd69b387f9ca8407ab38da955e925 | [
"Apache-2.0"
] | 24 | 2018-12-03T20:41:41.000Z | 2022-01-03T01:11:45.000Z |
# Copyright 2016-2018, Rigetti Computing
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
QuantumFlow Gate Decompositions
"""
from typing import Sequence, Tuple
import itertools
import numpy as np
from numpy import ... | 32.740541 | 77 | 0.625062 |
from typing import Sequence, Tuple
import itertools
import numpy as np
from numpy import pi
from .qubits import asarray
from .config import TOLERANCE
from .gates import Gate
from .measures import gates_close
from .stdgates import RN, CANONICAL, TZ, TY
from .circuits import Circuit
__all__ = ['bloch_decomposit... | true | true |
1c2062e61b86333cc1e125c89a3b9bb27e5aec1c | 4,205 | py | Python | notes/42 - PyGame Sprites/drawing spritesv6 - toggle by event.py | Drv4MC/ICS3-Python-Notes | 3614a5adfb4199bfc67dad8bbeb3bfee45401a5d | [
"MIT"
] | 3 | 2022-02-10T19:06:28.000Z | 2022-03-25T17:55:56.000Z | notes/42 - PyGame Sprites/drawing spritesv6 - toggle by event.py | Drv4MC/ICS3-Python-Notes | 3614a5adfb4199bfc67dad8bbeb3bfee45401a5d | [
"MIT"
] | null | null | null | notes/42 - PyGame Sprites/drawing spritesv6 - toggle by event.py | Drv4MC/ICS3-Python-Notes | 3614a5adfb4199bfc67dad8bbeb3bfee45401a5d | [
"MIT"
] | 17 | 2020-09-15T16:40:23.000Z | 2022-03-22T17:52:32.000Z | #TODO ADD KEYBOARD Control to make the character move left and right
#TODO Make the sprite would move when clicked
import pygame
import random
import copy
#Wizard Rect: [130,165,16,28]
class Character():
def __init__(self, imageIn, posIn, imageRectIn):
""" Create and initialize a wizard at this locat... | 35.041667 | 109 | 0.615696 |
import pygame
import random
import copy
class Character():
def __init__(self, imageIn, posIn, imageRectIn):
self.image = imageIn
self.imageRect = imageRectIn
self.pos = posIn
self.origImageRect = copy.copy(self.imageRect)
self.patchNumber = 0;
... | true | true |
1c20630956d68ccd5c65671898022587535e348d | 747 | py | Python | main/urls.py | mnecas/bpc_bds_web | 3c5d4289d74c053e1225e19cdcbb048994271f57 | [
"Apache-2.0"
] | null | null | null | main/urls.py | mnecas/bpc_bds_web | 3c5d4289d74c053e1225e19cdcbb048994271f57 | [
"Apache-2.0"
] | null | null | null | main/urls.py | mnecas/bpc_bds_web | 3c5d4289d74c053e1225e19cdcbb048994271f57 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('login', views.login),
path('register', views.register),
path('logout', views.logout),
path('user', views.info),
path('users', views.test_sql_injection),
path('cart', views.cart),
path('reviews'... | 33.954545 | 55 | 0.655957 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('login', views.login),
path('register', views.register),
path('logout', views.logout),
path('user', views.info),
path('users', views.test_sql_injection),
path('cart', views.cart),
path('reviews'... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.