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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f734d8142392b73526b2bc0c75d4fbafc3612f58 | 3,661 | py | Python | python_modules/dagster/setup.py | davemasino/dagster | cec365242853579c7100bfd87a9ee4f36bdd8344 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/setup.py | davemasino/dagster | cec365242853579c7100bfd87a9ee4f36bdd8344 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/setup.py | davemasino/dagster | cec365242853579c7100bfd87a9ee4f36bdd8344 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
def long_description():
return """
## Dagster
Dagster is a data orchestrator for machine learning, analytics, and ETL.
Dagster lets you define pipelines in terms of the data flow between reusable, logical components,
then test locally and run anywhere. With a unified v... | 39.365591 | 136 | 0.589183 | from setuptools import find_packages, setup
def long_description():
return """
## Dagster
Dagster is a data orchestrator for machine learning, analytics, and ETL.
Dagster lets you define pipelines in terms of the data flow between reusable, logical components,
then test locally and run anywhere. With a unified v... | true | true |
f734d818565dc62e225a1b3a231c734bfd459388 | 1,802 | py | Python | pre_tokenize.py | vyraun/awesome-align | 9871098b94be589f45c505a9732e943fa409cf4d | [
"BSD-3-Clause"
] | null | null | null | pre_tokenize.py | vyraun/awesome-align | 9871098b94be589f45c505a9732e943fa409cf4d | [
"BSD-3-Clause"
] | null | null | null | pre_tokenize.py | vyraun/awesome-align | 9871098b94be589f45c505a9732e943fa409cf4d | [
"BSD-3-Clause"
] | null | null | null | import argparse
import random
import itertools
import os
import tempfile
import warnings
warnings.filterwarnings("ignore")
from awesome_align.tokenization_bert import BasicTokenizer
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--data_file", default=None, type=str, required=True,... | 30.033333 | 116 | 0.630411 | import argparse
import random
import itertools
import os
import tempfile
import warnings
warnings.filterwarnings("ignore")
from awesome_align.tokenization_bert import BasicTokenizer
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--data_file", default=None, type=str, required=True,... | true | true |
f734d8a1c4282ee4aefbee1bf86ab99face93065 | 930 | py | Python | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from swagger_server.models.inline_response2004 import InlineResponse2004
from . import BaseTestCase
from six import BytesIO
from flask import json
class TestEvidenceController(BaseTestCase):
""" EvidenceController integration test stubs """
def test_ge... | 29.0625 | 108 | 0.611828 |
from __future__ import absolute_import
from swagger_server.models.inline_response2004 import InlineResponse2004
from . import BaseTestCase
from six import BytesIO
from flask import json
class TestEvidenceController(BaseTestCase):
def test_get_evidence(self):
query_string = [('keywords', 'keywords_exam... | true | true |
f734d8a2dc5aaa3965dc9b461bc243e1cfe6a270 | 1,081 | py | Python | recipes/cpp-peglib/0.x.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 562 | 2019-09-04T12:23:43.000Z | 2022-03-29T16:41:43.000Z | recipes/cpp-peglib/0.x.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 9,799 | 2019-09-04T12:02:11.000Z | 2022-03-31T23:55:45.000Z | recipes/cpp-peglib/0.x.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 1,126 | 2019-09-04T11:57:46.000Z | 2022-03-31T16:43:38.000Z | from conans import ConanFile, tools
required_conan_version = ">=1.33.0"
class CpppeglibConan(ConanFile):
name = "cpp-peglib"
description = "A single file C++11 header-only PEG (Parsing Expression Grammars) library."
license = "MIT"
topics = ("conan", "cpp-peglib", "peg", "parser", "header-only")
... | 31.794118 | 94 | 0.655874 | from conans import ConanFile, tools
required_conan_version = ">=1.33.0"
class CpppeglibConan(ConanFile):
name = "cpp-peglib"
description = "A single file C++11 header-only PEG (Parsing Expression Grammars) library."
license = "MIT"
topics = ("conan", "cpp-peglib", "peg", "parser", "header-only")
... | true | true |
f734da1f0b7a9ab56219579fceb1f161ba893075 | 14,951 | py | Python | tests/cli/test_rasa_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | tests/cli/test_rasa_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 52 | 2020-10-03T11:58:14.000Z | 2022-02-01T13:17:52.000Z | tests/cli/test_rasa_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | import os
import tempfile
from pathlib import Path
import pytest
from typing import Callable
from _pytest.pytester import RunResult
import rasa.shared.utils.io
from rasa import model
from rasa.nlu.model import Metadata
from rasa.shared.nlu.training_data import training_data
# noinspection PyProtectedMember
from rasa... | 30.826804 | 92 | 0.590596 | import os
import tempfile
from pathlib import Path
import pytest
from typing import Callable
from _pytest.pytester import RunResult
import rasa.shared.utils.io
from rasa import model
from rasa.nlu.model import Metadata
from rasa.shared.nlu.training_data import training_data
from rasa.cli.train import _get_valid_con... | true | true |
f734da6aa6ab9faacbf6cc70f08d939bab727772 | 146 | py | Python | old/03/08.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 10 | 2021-02-04T12:49:56.000Z | 2022-03-26T11:28:11.000Z | old/03/08.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 1 | 2022-03-24T03:47:14.000Z | 2022-03-24T03:54:52.000Z | old/03/08.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 4 | 2021-07-17T16:50:15.000Z | 2022-03-22T05:55:34.000Z | from pandas import Series
data = [1000, 2000, 3000]
index = ["메로나", "구구콘", "하겐다즈"]
s = Series(data=data, index=index)
print(s.loc['메로나':'구구콘'])
| 18.25 | 34 | 0.636986 | from pandas import Series
data = [1000, 2000, 3000]
index = ["메로나", "구구콘", "하겐다즈"]
s = Series(data=data, index=index)
print(s.loc['메로나':'구구콘'])
| true | true |
f734daed1be6b52d4591d0e3cbfdf1517893f84d | 5,975 | py | Python | proper_forms/fields/field.py | jpsca/hyperform | d5c450ad8684a853fed26f8c2606877151125a9e | [
"MIT"
] | 2 | 2020-09-30T22:41:00.000Z | 2020-12-04T16:47:17.000Z | proper_forms/fields/field.py | jpsca/hyperform | d5c450ad8684a853fed26f8c2606877151125a9e | [
"MIT"
] | null | null | null | proper_forms/fields/field.py | jpsca/hyperform | d5c450ad8684a853fed26f8c2606877151125a9e | [
"MIT"
] | null | null | null | import re
from .field_renderable import FieldRenderable
__all__ = ("Field", )
default_error_messages = {
"required": "This field is required.",
"type": "Invalid type.",
"min_num": "You need at least {num} values.",
"max_num": "You can have at most {num} values.",
}
HARD_MAX_NUM = 1000
class Fiel... | 25.105042 | 87 | 0.554477 | import re
from .field_renderable import FieldRenderable
__all__ = ("Field", )
default_error_messages = {
"required": "This field is required.",
"type": "Invalid type.",
"min_num": "You need at least {num} values.",
"max_num": "You can have at most {num} values.",
}
HARD_MAX_NUM = 1000
class Fiel... | true | true |
f734dbc58f6d9f310e99ffbb6ea2299976b3b377 | 1,078 | py | Python | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpInterfaceInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpInterfaceInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpInterfaceInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | expected_output = {
"interface":{
"if_id":"2a",
"clock_mode":"BOUNDARY CLOCK",
"delay_mechanism":"End-to-End",
"delay_req_seq_num":0,
"domain_value":0,
"log_mean_delay_interval":0,
"log_mean_sync_interval":0,
"num_info":{
"num_delay_requests_received":0,
"num_d... | 27.641026 | 51 | 0.592764 | expected_output = {
"interface":{
"if_id":"2a",
"clock_mode":"BOUNDARY CLOCK",
"delay_mechanism":"End-to-End",
"delay_req_seq_num":0,
"domain_value":0,
"log_mean_delay_interval":0,
"log_mean_sync_interval":0,
"num_info":{
"num_delay_requests_received":0,
"num_d... | true | true |
f734dca4d057e52d82e93c9c2cb00c6a673f1488 | 1,303 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 34.289474 | 98 | 0.649271 |
from msrest.serialization import Model
class VirtualMachineScaleSetInstanceViewStatusesSummary(Model):
_validation = {
'statuses_summary': {'readonly': True},
}
_attribute_map = {
'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'},
}
... | true | true |
f734dd1ef6c0c61d40522bf0bb879127537e3d4f | 1,272 | py | Python | exporter/myapp.py | zeshahid/websitecheck_exporter | 282e5f19d9e778479bbf9e00b468e1313060acba | [
"MIT"
] | null | null | null | exporter/myapp.py | zeshahid/websitecheck_exporter | 282e5f19d9e778479bbf9e00b468e1313060acba | [
"MIT"
] | null | null | null | exporter/myapp.py | zeshahid/websitecheck_exporter | 282e5f19d9e778479bbf9e00b468e1313060acba | [
"MIT"
] | null | null | null | from typing import Counter
from prometheus_client import start_http_server, Summary, Counter, Gauge ,__all__ ,Histogram
import random
import time
from requests import get
import requests
from requests.api import post
urls =["https://httpstat.us/503","https://httpstat.us/200"]
sitestatus = Gauge('sample_external_url_... | 34.378378 | 103 | 0.699686 | from typing import Counter
from prometheus_client import start_http_server, Summary, Counter, Gauge ,__all__ ,Histogram
import random
import time
from requests import get
import requests
from requests.api import post
urls =["https://httpstat.us/503","https://httpstat.us/200"]
sitestatus = Gauge('sample_external_url_... | true | true |
f734dd86bad4fa348424eff36dc67fc52e519284 | 32 | py | Python | HRM.py | asheu96/bme590hrm | c5d3b494149859a38f75452d1e61f6fc1c8bbea3 | [
"MIT"
] | null | null | null | HRM.py | asheu96/bme590hrm | c5d3b494149859a38f75452d1e61f6fc1c8bbea3 | [
"MIT"
] | null | null | null | HRM.py | asheu96/bme590hrm | c5d3b494149859a38f75452d1e61f6fc1c8bbea3 | [
"MIT"
] | null | null | null | # module for heart rate monitor
| 16 | 31 | 0.78125 | true | true | |
f734ddcdfbef18b57cb25db07dab576af78ed413 | 2,141 | py | Python | services.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | services.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | services.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | import json
import requests
import sys
import os
import socket
import fcntl
import struct
#info_device={"MAC_ADDRESS":"xx","IP_ADDRESS":"xxx","BLOCK_ID":"01","STOP_ID":"xxx"}
#info_buncher={"BUNCHER_ID":"xx","BUNCH_ID":"xx","COMPOSITION_ID":"xx","TUB_ID":"xx","TxR":"xx","GR":"xx","VARIETY_ID":"xx","BLOCK_ID":"xx"}
d... | 29.328767 | 140 | 0.627744 | import json
import requests
import sys
import os
import socket
import fcntl
import struct
def getMAC(interface='wlan0'):
try:
str = open('/sys/class/net/%s/address' %interface).read()
except:
str = "00:00:00:00:00:00"
return str[0:17]
def get_local_ip_address(target):
ipaddr = ''
try:
s ... | true | true |
f734ddfee0c273d99cb4d87ab366012e453afc2e | 7,323 | py | Python | tests/test_memory_leak.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 9,701 | 2019-04-16T15:46:27.000Z | 2022-03-31T11:52:18.000Z | tests/test_memory_leak.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 6,420 | 2019-04-16T15:58:22.000Z | 2022-03-31T17:54:35.000Z | tests/test_memory_leak.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 3,063 | 2019-04-16T15:23:52.000Z | 2022-03-31T00:01:12.000Z | import abc
import json
import subprocess
import sys
import tempfile
import time
from pathlib import Path
from typing import Text, List, Tuple, Optional, Union
import memory_profiler
import psutil
import pytest
import rasa
import rasa.shared.utils.io
PROFILING_INTERVAL = 0.1
# Enable this to plot the results locally... | 31.294872 | 87 | 0.583777 | import abc
import json
import subprocess
import sys
import tempfile
import time
from pathlib import Path
from typing import Text, List, Tuple, Optional, Union
import memory_profiler
import psutil
import pytest
import rasa
import rasa.shared.utils.io
PROFILING_INTERVAL = 0.1
WRITE_RESULTS_TO_DISK = False
def _cus... | true | true |
f734dead270c5ec9243064030981190070a9e1f6 | 83 | py | Python | FusionIIIT/applications/hostel_management/urls.py | suyash-code/Fusion-op | eb1242d184482cd6585988028afb182b37abc25c | [
"bzip2-1.0.6"
] | null | null | null | FusionIIIT/applications/hostel_management/urls.py | suyash-code/Fusion-op | eb1242d184482cd6585988028afb182b37abc25c | [
"bzip2-1.0.6"
] | null | null | null | FusionIIIT/applications/hostel_management/urls.py | suyash-code/Fusion-op | eb1242d184482cd6585988028afb182b37abc25c | [
"bzip2-1.0.6"
] | 3 | 2021-04-19T14:26:01.000Z | 2021-04-22T13:34:48.000Z | from django.conf.urls import url
app_name = 'hostel_management'
urlpatterns = []
| 13.833333 | 32 | 0.759036 | from django.conf.urls import url
app_name = 'hostel_management'
urlpatterns = []
| true | true |
f734ded5634d3062fbab77a54c8816eaf43cb21c | 327 | py | Python | setup.py | PyUnchained/pickle_storage | c0a978701ae59a9feeb3e14026ff0b2353b2e7f5 | [
"MIT"
] | null | null | null | setup.py | PyUnchained/pickle_storage | c0a978701ae59a9feeb3e14026ff0b2353b2e7f5 | [
"MIT"
] | null | null | null | setup.py | PyUnchained/pickle_storage | c0a978701ae59a9feeb3e14026ff0b2353b2e7f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='pickle-storage',
version='0.1',
description='Python Pickle-Based Data Storage',
author='Tatenda Tambo',
author_email='tatendatambo@gmail.com',
packages=find_packages(),
install_requires=['wrapt>=1.12.1']
... | 27.25 | 53 | 0.669725 |
from setuptools import setup, find_packages
setup(name='pickle-storage',
version='0.1',
description='Python Pickle-Based Data Storage',
author='Tatenda Tambo',
author_email='tatendatambo@gmail.com',
packages=find_packages(),
install_requires=['wrapt>=1.12.1']
) | true | true |
f734dee5533468bd89adc7a9869f9458710bc490 | 5,368 | py | Python | models.py | vidursatija/SongWCT | c892c2833ff9f85cfb31788babf016699c5eec8f | [
"MIT"
] | null | null | null | models.py | vidursatija/SongWCT | c892c2833ff9f85cfb31788babf016699c5eec8f | [
"MIT"
] | null | null | null | models.py | vidursatija/SongWCT | c892c2833ff9f85cfb31788babf016699c5eec8f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from torchsummary import summary
import numpy as np
class X_Enc(nn.Module):
def __init__(self, layers, num_classes=1000, init_we... | 32.731707 | 91 | 0.575075 | import torch
import torch.nn as nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from torchsummary import summary
import numpy as np
class X_Enc(nn.Module):
def __init__(self, layers, num_classes=1000, init_we... | true | true |
f734df57e7a00474f077f260bc9b03ce6ece41c0 | 492 | py | Python | apps/gradings/migrations/0001_initial.py | cloudartisan/dojomaster | 9d5efa0345c659636f8d8b556302d0d7bb2055a8 | [
"MIT"
] | 1 | 2019-02-21T14:47:31.000Z | 2019-02-21T14:47:31.000Z | apps/gradings/migrations/0001_initial.py | cloudartisan/dojomaster | 9d5efa0345c659636f8d8b556302d0d7bb2055a8 | [
"MIT"
] | null | null | null | apps/gradings/migrations/0001_initial.py | cloudartisan/dojomaster | 9d5efa0345c659636f8d8b556302d0d7bb2055a8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-30 23:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Gradin... | 21.391304 | 114 | 0.599593 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Grading',
fields=[
('id', models.AutoField(auto_c... | true | true |
f734df86fba52bb0e5b0075c1880a25fc79ec783 | 113 | py | Python | Python/pythonProject/exercise/ex047.py | JoaoMoreira2002/Linguagens-de-programacao | b91a902188428238a567c8f52b2ac9028378c4df | [
"MIT"
] | null | null | null | Python/pythonProject/exercise/ex047.py | JoaoMoreira2002/Linguagens-de-programacao | b91a902188428238a567c8f52b2ac9028378c4df | [
"MIT"
] | null | null | null | Python/pythonProject/exercise/ex047.py | JoaoMoreira2002/Linguagens-de-programacao | b91a902188428238a567c8f52b2ac9028378c4df | [
"MIT"
] | null | null | null | for x in range(0, 11):
for c in range(0, 11):
print(x, 'x', c, '= {}'.format(x * c))
print('\t')
| 22.6 | 46 | 0.442478 | for x in range(0, 11):
for c in range(0, 11):
print(x, 'x', c, '= {}'.format(x * c))
print('\t')
| true | true |
f734e032d4a7eeaed6fa44b9a554d7707bbd9ef9 | 6,038 | py | Python | reading_data.py | eembees/solar_flares | 9022f92c0577efaf06d7425002995e4fa4df74b4 | [
"MIT"
] | null | null | null | reading_data.py | eembees/solar_flares | 9022f92c0577efaf06d7425002995e4fa4df74b4 | [
"MIT"
] | null | null | null | reading_data.py | eembees/solar_flares | 9022f92c0577efaf06d7425002995e4fa4df74b4 | [
"MIT"
] | null | null | null | from pathlib import Path
import ijson
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from json import JSONDecoder, JSONDecodeError # for reading the JSON data files
import re # for regular expressions
import os # for os related operations
from sklearn.pre... | 29.598039 | 86 | 0.61792 | from pathlib import Path
import ijson
import numpy as np
import pandas as pd
from json import JSONDecoder, JSONDecodeError
import re
import os
from sklearn.preprocessing import maxabs_scale
def decode_obj(line, pos=0, decoder=JSONDecoder()):
no_white_space_regex = re.compile(r'[^\s]')
while True:
... | true | true |
f734e09b76bc265ceb72504136dbcb9a86e98111 | 5,912 | py | Python | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | 15 | 2017-11-08T10:03:26.000Z | 2021-12-21T07:02:44.000Z | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | 9 | 2020-01-17T15:09:22.000Z | 2022-03-25T19:02:05.000Z | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
##################################################################################
# File: c:\Projects\KENYA ONE PROJECT\CORE\engines\constraint.py #
# Project: c:\Projects\KENYA ONE PROJECT\CORE\engines #
# Created Date: Thur... | 38.894737 | 88 | 0.508965 | true | true | |
f734e0e3ddd024eab587865ded77a0ef1faf2c77 | 4,984 | py | Python | DEPRECATED_PYTHON_SRC/component/_brz_win.py | 17701253801/firefly-proxy | 153e0d343d93d68a803bba6b89497f7bc2b96bc8 | [
"BSD-2-Clause"
] | 5,895 | 2015-01-01T14:33:17.000Z | 2022-03-19T03:08:48.000Z | DEPRECATED_PYTHON_SRC/component/_brz_win.py | BIGMONK/firefly-proxy | 60161af7b239ab400d39a23b61ab312f84b94570 | [
"BSD-2-Clause"
] | 626 | 2015-01-07T22:09:26.000Z | 2022-03-24T01:56:50.000Z | DEPRECATED_PYTHON_SRC/component/_brz_win.py | BIGMONK/firefly-proxy | 60161af7b239ab400d39a23b61ab312f84b94570 | [
"BSD-2-Clause"
] | 1,145 | 2015-01-04T06:50:54.000Z | 2022-03-15T13:12:17.000Z | # Copied from https://github.com/downloadam/client/blob/master/client/registry/win.py
import logging
import sys
import os
from contextlib import contextmanager
import subprocess
import _winreg as winreg
from _winreg import HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, \
KEY_QUERY_VALUE, REG_SZ, KEY_ALL_ACC... | 33.006623 | 151 | 0.611758 |
import logging
import sys
import os
from contextlib import contextmanager
import subprocess
import _winreg as winreg
from _winreg import HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, \
KEY_QUERY_VALUE, REG_SZ, KEY_ALL_ACCESS, KEY_WRITE, KEY_CREATE_SUB_KEY, KEY_SET_VALUE
log = logging.getLogger(__name__)... | true | true |
f734e2ae995f4f0b1438b926ddce732f5c03bcb5 | 2,949 | py | Python | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/migrations/0001_initial.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/migrations/0001_initial.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/migrations/0001_initial.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | # Generated by Django 3.0.4 on 2020-04-18 12:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Car',
fields=[
... | 43.367647 | 418 | 0.528654 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Car',
fields=[
('id', models.AutoField(auto_created=True,... | true | true |
f734e32ec87c1cc2ff0c847206e45f81f0a44682 | 5,052 | py | Python | kubernetes/client/models/v1beta1_allowed_host_path.py | lp67/python | 33c5ea9835356410ce4a9fa54a02c6a2a22143c6 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta1_allowed_host_path.py | lp67/python | 33c5ea9835356410ce4a9fa54a02c6a2a22143c6 | [
"Apache-2.0"
] | 4 | 2019-11-19T10:33:47.000Z | 2022-03-01T03:33:52.000Z | kubernetes/client/models/v1beta1_allowed_host_path.py | mohramadan911/PythonClientAPI | 5d111812c81b7a573ac8661d1aec60bb97072412 | [
"Apache-2.0"
] | 2 | 2021-08-10T16:35:31.000Z | 2021-09-14T04:53:06.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.20
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 33.456954 | 294 | 0.615796 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class V1beta1AllowedHostPath(object):
openapi_types = {
'path_prefix': 'str',
'read_only': 'bool'
}
attribute_map = {
'path_prefix': 'pathPrefix',
'read_only': 'readOnly'
... | true | true |
f734e3a1ce3a24d57c1f838699b9ec656d8a897c | 7,219 | py | Python | src/antidote/_constants.py | Finistere/antidote | 97751e0e6a1b8bd638a1c33212345c7a84ad97b8 | [
"MIT"
] | 52 | 2017-12-17T19:52:37.000Z | 2022-03-29T10:24:04.000Z | src/antidote/_constants.py | Finistere/antidote | 97751e0e6a1b8bd638a1c33212345c7a84ad97b8 | [
"MIT"
] | 32 | 2018-11-02T08:49:16.000Z | 2022-03-25T22:23:30.000Z | src/antidote/_constants.py | Finistere/antidote | 97751e0e6a1b8bd638a1c33212345c7a84ad97b8 | [
"MIT"
] | 5 | 2019-05-17T18:26:14.000Z | 2021-12-25T23:13:31.000Z | from typing import (Any, Dict, Generic, Hashable, Optional, TYPE_CHECKING, Tuple, Type,
TypeVar, Union, cast, overload)
from ._compatibility.typing import final, Protocol
from ._internal import API
from ._internal.utils import AbstractMeta, Default, FinalImmutable, FinalMeta, debug_repr
from ._inte... | 33.892019 | 89 | 0.575842 | from typing import (Any, Dict, Generic, Hashable, Optional, TYPE_CHECKING, Tuple, Type,
TypeVar, Union, cast, overload)
from ._compatibility.typing import final, Protocol
from ._internal import API
from ._internal.utils import AbstractMeta, Default, FinalImmutable, FinalMeta, debug_repr
from ._inte... | true | true |
f734e42e8c40b73c89d6a81190560d99c06b2daa | 582 | py | Python | plot.py | nkuxx161/baseline-SR | c4caf06c5a5a88d7f8e27069018316b319f0913b | [
"MIT"
] | null | null | null | plot.py | nkuxx161/baseline-SR | c4caf06c5a5a88d7f8e27069018316b319f0913b | [
"MIT"
] | null | null | null | plot.py | nkuxx161/baseline-SR | c4caf06c5a5a88d7f8e27069018316b319f0913b | [
"MIT"
] | null | null | null | import pandas as pd
import os
curve_name = '5_k7'
data = pd.read_csv(os.path.join('result', curve_name+'.csv'))
timestamp = data['timestamp']
value = data['value']
mag = data['mag']
isAnomaly = data['isAnomaly']
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
plt.subplot(3, 1, 1)
plt.plot(t... | 19.4 | 62 | 0.704467 | import pandas as pd
import os
curve_name = '5_k7'
data = pd.read_csv(os.path.join('result', curve_name+'.csv'))
timestamp = data['timestamp']
value = data['value']
mag = data['mag']
isAnomaly = data['isAnomaly']
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
plt.subplot(3, 1, 1)
plt.plot(t... | true | true |
f734e53915eb41c00db1f0b9283810f28578ae28 | 1,048 | py | Python | troc/apps/record/migrations/0001_initial.py | Windfarer/species2 | 15849c5805621410f3e8c26d27213f9bcf483fd1 | [
"MIT"
] | 1 | 2020-01-02T11:50:50.000Z | 2020-01-02T11:50:50.000Z | troc/apps/record/migrations/0001_initial.py | Windfarer/species2 | 15849c5805621410f3e8c26d27213f9bcf483fd1 | [
"MIT"
] | 5 | 2019-12-15T07:43:46.000Z | 2022-02-26T17:47:26.000Z | troc/apps/record/migrations/0001_initial.py | Windfarer/species2 | 15849c5805621410f3e8c26d27213f9bcf483fd1 | [
"MIT"
] | 1 | 2020-06-13T02:25:42.000Z | 2020-06-13T02:25:42.000Z | # Generated by Django 2.2.5 on 2019-10-07 08:27
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('species', '0002_auto_20190908_0902'),
... | 34.933333 | 118 | 0.655534 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('species', '0002_auto_20190908_0902'),
migrations.swappable_dependency(settings.AU... | true | true |
f734e66795d03e7b634e13c3a1bbf25ad1e1bcbd | 20,783 | py | Python | models/_sources/model_trainer_c4d127b7cc8008ff2c0c849733ead6e1.py | catniplab/ML-music-analysis | 793d54ed16166fbcd9acf4eec24998892334e064 | [
"MIT"
] | null | null | null | models/_sources/model_trainer_c4d127b7cc8008ff2c0c849733ead6e1.py | catniplab/ML-music-analysis | 793d54ed16166fbcd9acf4eec24998892334e064 | [
"MIT"
] | null | null | null | models/_sources/model_trainer_c4d127b7cc8008ff2c0c849733ead6e1.py | catniplab/ML-music-analysis | 793d54ed16166fbcd9acf4eec24998892334e064 | [
"MIT"
] | 1 | 2021-12-01T22:57:56.000Z | 2021-12-01T22:57:56.000Z | """
This script creates an instance of a sacred experiment and defines default configurations for training a neural network or a regression model.
"""
from src.neural_nets.models import get_model
from src.neural_nets.load_data import get_loader
from src.neural_nets.metrics import MaskedBCE, Accuracy, compute_acc, comp... | 35.405451 | 142 | 0.505172 |
from src.neural_nets.models import get_model
from src.neural_nets.load_data import get_loader
from src.neural_nets.metrics import MaskedBCE, Accuracy, compute_acc, compute_loss
import src.regression.logistic_regression as reg
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim... | true | true |
f734e6fd78fd01730a7c42ee39a5882d91564b45 | 9,026 | py | Python | test/ut/tools/annotation/testcase/usercode/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | test/ut/tools/annotation/testcase/usercode/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | test/ut/tools/annotation/testcase/usercode/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | # -*- encoding:utf8 -*-
"""A deep MNIST classifier using convolutional layers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import math
import tempfile
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_dat... | 42.980952 | 260 | 0.634611 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import math
import tempfile
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
logger = logging.getLogger('mnist')
FLAGS = None
class MnistNetwork(object):
... | true | true |
f734e7ac84c8e5d7674c3e443378662983d9d4e5 | 386 | py | Python | demos/python/python_musl/demo.py | jessehui/occlum | 8a5f3033881c090340d678f2aecdca4ac6355bf4 | [
"BSD-3-Clause-Clear"
] | 928 | 2019-07-04T12:00:04.000Z | 2022-03-30T02:45:06.000Z | demos/python/python_musl/demo.py | jessehui/occlum | 8a5f3033881c090340d678f2aecdca4ac6355bf4 | [
"BSD-3-Clause-Clear"
] | 333 | 2019-07-01T07:42:49.000Z | 2022-03-31T10:53:19.000Z | demos/python/python_musl/demo.py | jessehui/occlum | 8a5f3033881c090340d678f2aecdca4ac6355bf4 | [
"BSD-3-Clause-Clear"
] | 161 | 2019-07-19T03:46:44.000Z | 2022-03-28T02:16:31.000Z | import pandas as pd
import numpy as np
from sklearn.datasets import dump_svmlight_file
df1 = pd.read_csv("./dataset/input_label.csv")
df2 = pd.read_csv("./dataset/input.csv")
res = pd.merge(df1, df2, how='left', left_on='id', right_on='id')
X = res[np.setdiff1d(res.columns,['label','id'])]
y = res.label
dump_svmligh... | 29.692308 | 77 | 0.733161 | import pandas as pd
import numpy as np
from sklearn.datasets import dump_svmlight_file
df1 = pd.read_csv("./dataset/input_label.csv")
df2 = pd.read_csv("./dataset/input.csv")
res = pd.merge(df1, df2, how='left', left_on='id', right_on='id')
X = res[np.setdiff1d(res.columns,['label','id'])]
y = res.label
dump_svmligh... | true | true |
f734e8958274ccdac27693b0e7a48b10a02f204d | 1,896 | py | Python | DSP Lab 6/Lab_6_Shuaiyu_Liang_sl5352/Lab6_Sec1_Ex2_sl5352.py | bubbledoodle/EL-GY-6183-Digital-Signal-Processing-LAB | fe8b00357f04a39806664d56eb4f9e9c681fb49e | [
"MIT"
] | null | null | null | DSP Lab 6/Lab_6_Shuaiyu_Liang_sl5352/Lab6_Sec1_Ex2_sl5352.py | bubbledoodle/EL-GY-6183-Digital-Signal-Processing-LAB | fe8b00357f04a39806664d56eb4f9e9c681fb49e | [
"MIT"
] | null | null | null | DSP Lab 6/Lab_6_Shuaiyu_Liang_sl5352/Lab6_Sec1_Ex2_sl5352.py | bubbledoodle/EL-GY-6183-Digital-Signal-Processing-LAB | fe8b00357f04a39806664d56eb4f9e9c681fb49e | [
"MIT"
] | null | null | null | # plot_micinput_spectrum.py
import pyaudio
import struct
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
pp = PdfPages('logarithmatic_spectrum.pdf')
plt.ion() # Turn on interactive mode so plot gets updated
WIDTH = 2 # bytes per sample
... | 29.625 | 93 | 0.638186 |
import pyaudio
import struct
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
pp = PdfPages('logarithmatic_spectrum.pdf')
plt.ion()
WIDTH = 2
CHANNELS = 1
RATE = 16000
BLOCKSIZE = 1024
DURATION = 10
NumBlocks = ... | false | true |
f734e9566f3cf524bbe315d7bf647bb37f74d70f | 4,634 | py | Python | attic/pyscan.py | KSchopmeyer/smipyping | 9c60b3489f02592bd9099b8719ca23ae43a9eaa5 | [
"MIT"
] | null | null | null | attic/pyscan.py | KSchopmeyer/smipyping | 9c60b3489f02592bd9099b8719ca23ae43a9eaa5 | [
"MIT"
] | 19 | 2017-10-18T15:31:25.000Z | 2020-03-04T19:31:59.000Z | attic/pyscan.py | KSchopmeyer/smipyping | 9c60b3489f02592bd9099b8719ca23ae43a9eaa5 | [
"MIT"
] | null | null | null | #! /usr/bin/python
# pyscan.py - Python based SYN scanner. A SYN packet is sent through a raw socket.
# If a SYN/ACK is received, the Linux TCP stack sends a RST/ACK, and an open
# port is assumed. Otherwise, a closed or filtered port is assumed.
# Does not rely on scapy, rather creates its own packets and raw socket... | 34.58209 | 122 | 0.657747 |
# raw sockets at http://www.binarytides.com/python-syn-flood-program-raw-sockets
#
import socket, sys, random
from struct import *
# checksum functions - direct from Silver Moon
def checksum(msg):
s = 0
#loop taking 2 characters at a time
for i in range(0, len(msg), 2):
w = (ord(msg[i]) <<... | false | true |
f734ea1c07870fb34749ffbc4233d57c196b4351 | 8,912 | py | Python | pgAdmin/pgadmin4/web/pgadmin/tools/sqleditor/tests/test_encoding_charset.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/web/pgadmin/tools/sqleditor/tests/test_encoding_charset.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/web/pgadmin/tools/sqleditor/tests/test_encoding_charset.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | # -*- coding: utf-8 -*-
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
#####################################################################... | 30.520548 | 76 | 0.439408 |
With Encoding KOI8R',
dict(
db_encoding='KOI8R',
lc_collate='C',
test_str='Альтернативная'
)),
(
'With Encoding KOI8U',
dict(
db_encoding='KOI8U',
lc_collate='C',
test... | true | true |
f734ea202c7b17c7d2628d4129edacee942ccbf4 | 1,324 | py | Python | oscar/apps/dashboard/ranges/app.py | endgame/django-oscar | e5d78436e20b55902537a6cc82edf4e22568f9d6 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/dashboard/ranges/app.py | endgame/django-oscar | e5d78436e20b55902537a6cc82edf4e22568f9d6 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/dashboard/ranges/app.py | endgame/django-oscar | e5d78436e20b55902537a6cc82edf4e22568f9d6 | [
"BSD-3-Clause"
] | 1 | 2019-07-10T06:32:14.000Z | 2019-07-10T06:32:14.000Z | from django.conf.urls import patterns, url
from django.contrib.admin.views.decorators import staff_member_required
from django.utils.translation import ugettext_lazy as _
from oscar.core.application import Application
from oscar.apps.dashboard.ranges import views
from oscar.apps.dashboard.nav import register, Node
no... | 35.783784 | 97 | 0.700906 | from django.conf.urls import patterns, url
from django.contrib.admin.views.decorators import staff_member_required
from django.utils.translation import ugettext_lazy as _
from oscar.core.application import Application
from oscar.apps.dashboard.ranges import views
from oscar.apps.dashboard.nav import register, Node
no... | true | true |
f734ea9b8bb5e64eb1c72b0e9195f75e0147dfe3 | 2,673 | py | Python | benchmark.py | lucas-sio-rosa/bigquery-benchmark | b37e029fffcb516818efa74e338d95293549499c | [
"WTFPL"
] | null | null | null | benchmark.py | lucas-sio-rosa/bigquery-benchmark | b37e029fffcb516818efa74e338d95293549499c | [
"WTFPL"
] | null | null | null | benchmark.py | lucas-sio-rosa/bigquery-benchmark | b37e029fffcb516818efa74e338d95293549499c | [
"WTFPL"
] | null | null | null | from concurrent.futures import ThreadPoolExecutor, as_completed
from google.cloud import bigquery as bq
from datetime import datetime as dt
import argparse
import json
import logging
import time
if __name__ == "__main__":
start_time = time.time()
threads = []
results = []
parser = argparse.Argum... | 41.765625 | 144 | 0.693603 | from concurrent.futures import ThreadPoolExecutor, as_completed
from google.cloud import bigquery as bq
from datetime import datetime as dt
import argparse
import json
import logging
import time
if __name__ == "__main__":
start_time = time.time()
threads = []
results = []
parser = argparse.Argum... | true | true |
f734eaa92f6550c0ce4abd1c44bdd7c44006debf | 1,640 | py | Python | python/oneflow/test/modules/test_TripletMarginLoss.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_TripletMarginLoss.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_TripletMarginLoss.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 32.8 | 72 | 0.702439 | import unittest
from collections import OrderedDict
import numpy as np
from test_util import GenArgList
from oneflow.test_utils.automated_test_util import *
import oneflow as flow
@flow.unittest.skip_unless_1n1d()
class TestTripletMarginLoss(flow.unittest.TestCase):
@autotest(n=10)
def test_triplet_marginlo... | true | true |
f734ece49fb38670af0abb06b808cf1656a36159 | 55,538 | py | Python | python/graphvite/application/application.py | adrenadine33/graphvite | 34fc203f96ff13095073c605ecfcae32213e7f6a | [
"Apache-2.0"
] | null | null | null | python/graphvite/application/application.py | adrenadine33/graphvite | 34fc203f96ff13095073c605ecfcae32213e7f6a | [
"Apache-2.0"
] | null | null | null | python/graphvite/application/application.py | adrenadine33/graphvite | 34fc203f96ff13095073c605ecfcae32213e7f6a | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 MilaGraph. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 39.783668 | 121 | 0.586355 |
from __future__ import print_function, absolute_import, unicode_literals, division
import os
import re
import pickle
import logging
import multiprocessing
from collections import defaultdict
from future.builtins import str, map, range
from easydict import EasyDict
import numpy as np
from .. import li... | true | true |
f734ed8bac4aef42dc6a6161d52892cad0940c1e | 5,894 | py | Python | atlas/measure_baseclass.py | USC-NSL/ripe-atlas | 9c512b0660923779031ec62909bc13bccace5890 | [
"MIT"
] | 4 | 2015-09-17T18:22:36.000Z | 2016-03-11T21:00:57.000Z | atlas/measure_baseclass.py | USC-NSL/ripe-atlas | 9c512b0660923779031ec62909bc13bccace5890 | [
"MIT"
] | null | null | null | atlas/measure_baseclass.py | USC-NSL/ripe-atlas | 9c512b0660923779031ec62909bc13bccace5890 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import json
import sys
import traceback
import os
import requests
import argparse
SLEEP_TIME = 60*5
debug = False
key_loc = '~/.atlas/auth'
class MeasurementBase(object):
def __init__(self, target, key, probe_list=None, sess=None):
self.target = target
self.description ... | 34.069364 | 150 | 0.619444 |
import json
import sys
import traceback
import os
import requests
import argparse
SLEEP_TIME = 60*5
debug = False
key_loc = '~/.atlas/auth'
class MeasurementBase(object):
def __init__(self, target, key, probe_list=None, sess=None):
self.target = target
self.description = ''
self... | true | true |
f734edb79c58022e50f9363b5ab9395deb5cbc15 | 138,531 | py | Python | nova/tests/api/openstack/compute/plugins/v3/test_servers.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/plugins/v3/test_servers.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/plugins/v3/test_servers.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | null | null | null | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, Inc.
# 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... | 41.663459 | 79 | 0.585652 |
import base64
import contextlib
import copy
import datetime
import uuid
import iso8601
import mock
import mox
from oslo.config import cfg
from oslo.utils import timeutils
import six.moves.urllib.parse as urlparse
import testtools
import webob
from nova.api.openstack import compute
from nova.api.openst... | true | true |
f734f159910ff4649f30f99b0dfdab7ad3c0bb6c | 744 | py | Python | 2019/Python/day02/part2.py | tymscar/Advent-Of-Code | cd7b96b0253191e236bd704b0d8b5540fb3e8ef6 | [
"MIT"
] | 4 | 2019-12-08T08:20:53.000Z | 2021-12-17T12:04:11.000Z | 2019/Python/day02/part2.py | tymscar/AdventOfCode2018 | 9742ddb6bbbc917062baad87d6b6de75375f1ae8 | [
"MIT"
] | null | null | null | 2019/Python/day02/part2.py | tymscar/AdventOfCode2018 | 9742ddb6bbbc917062baad87d6b6de75375f1ae8 | [
"MIT"
] | 4 | 2020-12-11T22:10:24.000Z | 2021-12-25T22:39:05.000Z | import math
file = open('input.txt','r')
for line in file:
initialMemory = line.split(',')
bruteforce = -1
result = 0
while result != 19690720:
memory = initialMemory.copy()
bruteforce = bruteforce + 1
opcode = 0
pc = 0
memory[1] = int(bruteforce/100)
memory[2] = int(bruteforce%100)
while True:
... | 17.302326 | 81 | 0.63172 | import math
file = open('input.txt','r')
for line in file:
initialMemory = line.split(',')
bruteforce = -1
result = 0
while result != 19690720:
memory = initialMemory.copy()
bruteforce = bruteforce + 1
opcode = 0
pc = 0
memory[1] = int(bruteforce/100)
memory[2] = int(bruteforce%100)
while True:
... | true | true |
f734f24d941d068d79153daa61667082f5311050 | 1,409 | py | Python | packages/linalg/nodes/linalg___OuterProduct0/linalg___OuterProduct0___METACODE.py | lidong1266/Ryven-Switch | 68d1f71e81d6564196f44ca49d5903f06db6a4d9 | [
"MIT"
] | 18 | 2021-01-18T09:52:41.000Z | 2022-03-22T10:48:44.000Z | packages/linalg/nodes/linalg___OuterProduct0/linalg___OuterProduct0___METACODE.py | xamofb-xsk/Ryven | 8c3dcc613098863ae9fb747e62c0bb9d9eb4cef1 | [
"MIT"
] | null | null | null | packages/linalg/nodes/linalg___OuterProduct0/linalg___OuterProduct0___METACODE.py | xamofb-xsk/Ryven | 8c3dcc613098863ae9fb747e62c0bb9d9eb4cef1 | [
"MIT"
] | 3 | 2021-01-18T09:49:42.000Z | 2022-03-22T10:48:47.000Z | from NIENV import *
# API METHODS
# self.main_widget <- access to main widget
# self.update_shape() <- recomputes the whole shape and content positions
# Ports
# self.input(index) <- access to input data
# self.set_output_val(index, val) <- set output data port value
# self.exec_outp... | 27.096154 | 83 | 0.601845 | from NIENV import *
# self.log_message('hello global!', target='global')
# self.log_message('that\'s not good', target='error')
from numpy import outer
class %CLASS%(NodeInstance):
def __init__(self, params):
super(%CLASS%, self).__init__(params)
def update_e... | false | true |
f734f40c8b6fc327694f4ecc097b36a67858d578 | 998 | py | Python | Python/unique-word-abbreviation.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | 68 | 2018-01-13T07:15:37.000Z | 2022-02-20T12:58:24.000Z | Python/unique-word-abbreviation.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | null | null | null | Python/unique-word-abbreviation.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | 63 | 2017-04-10T03:38:25.000Z | 2022-03-17T23:24:51.000Z | # Time: ctor: O(n), n is number of words in the dictionary.
# lookup: O(1)
# Space: O(k), k is number of unique words.
class ValidWordAbbr(object):
def __init__(self, dictionary):
"""
initialize your data structure here.
:type dictionary: List[str]
"""
self.lookup... | 26.972973 | 68 | 0.578156 |
class ValidWordAbbr(object):
def __init__(self, dictionary):
self.lookup_ = collections.defaultdict(set)
for word in dictionary:
abbr = self.abbreviation(word)
self.lookup_[abbr].add(word)
def isUnique(self, word):
abbr = self.abbreviation(word)
... | true | true |
f734f41506c92e5b58aa8af5f798f467d21f6f9e | 1,345 | py | Python | tests/distributed/test_workspaces/test_nonblocking.py | vishalbelsare/jina | ae72cc5ce1f7e7f4c662e72e96ea21dddc28bf43 | [
"Apache-2.0"
] | 15,179 | 2020-04-28T10:23:56.000Z | 2022-03-31T14:35:25.000Z | tests/distributed/test_workspaces/test_nonblocking.py | manavshah123/jina | f18b04eb82d18a3c554e2892bbae4b95fc0cb13e | [
"Apache-2.0"
] | 3,912 | 2020-04-28T13:01:29.000Z | 2022-03-31T14:36:46.000Z | tests/distributed/test_workspaces/test_nonblocking.py | manavshah123/jina | f18b04eb82d18a3c554e2892bbae4b95fc0cb13e | [
"Apache-2.0"
] | 1,955 | 2020-04-28T10:50:49.000Z | 2022-03-31T12:28:34.000Z | import os
import pytest
import asyncio
from jina import __default_host__
from daemon.clients import AsyncJinaDClient
cur_dir = os.path.dirname(os.path.abspath(__file__))
CLOUD_HOST = 'localhost:8000' # consider it as the staged version
success = 0
failure = 0
client = AsyncJinaDClient(host=__default_host__, port=... | 26.9 | 83 | 0.704833 | import os
import pytest
import asyncio
from jina import __default_host__
from daemon.clients import AsyncJinaDClient
cur_dir = os.path.dirname(os.path.abspath(__file__))
CLOUD_HOST = 'localhost:8000'
success = 0
failure = 0
client = AsyncJinaDClient(host=__default_host__, port=8000)
async def get_alive():
... | true | true |
f734f4c59aaf5760f233bff98b0f4f64a6485f4a | 3,922 | py | Python | core/controllers/beam_jobs.py | tonadev/oppia | ba55bb58763ed01c21017e3c34b72e25302f3bd8 | [
"Apache-2.0"
] | null | null | null | core/controllers/beam_jobs.py | tonadev/oppia | ba55bb58763ed01c21017e3c34b72e25302f3bd8 | [
"Apache-2.0"
] | null | null | null | core/controllers/beam_jobs.py | tonadev/oppia | ba55bb58763ed01c21017e3c34b72e25302f3bd8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | 32.413223 | 79 | 0.610658 |
from __future__ import absolute_import
from __future__ import unicode_literals
from core.controllers import acl_decorators
from core.controllers import base
from core.domain import beam_job_services
import feconf
from typing import Any, Dict
class BeamJobHandler(base.BaseHandler):
GET_HANDLER... | true | true |
f734f51521e82853a72828b8b24473e38736128d | 736 | py | Python | core/migrations/0008_auto_20210426_0828.py | honno/ascii-forever | 8364219db115229fa9eb0b059e9c0611dcb689cf | [
"MIT"
] | null | null | null | core/migrations/0008_auto_20210426_0828.py | honno/ascii-forever | 8364219db115229fa9eb0b059e9c0611dcb689cf | [
"MIT"
] | null | null | null | core/migrations/0008_auto_20210426_0828.py | honno/ascii-forever | 8364219db115229fa9eb0b059e9c0611dcb689cf | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-26 08:28
import uuid
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("core", "0007_art_thumb_render_squashed_0008_art_uuid"),
]
operations = [
migrations.AlterField(
... | 24.533333 | 91 | 0.585598 |
import uuid
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("core", "0007_art_thumb_render_squashed_0008_art_uuid"),
]
operations = [
migrations.AlterField(
model_name="art",
name="thumb_ren... | true | true |
f734f5164fe1306a6e83df0cf7c8142a2d2b6ab5 | 4,266 | py | Python | nativepython/tests/alternative_compilation_test.py | mjwoolf/nativepython | 3f469f6d3c8c0f03cb9f51eb2a851d68310c7f90 | [
"Apache-2.0"
] | null | null | null | nativepython/tests/alternative_compilation_test.py | mjwoolf/nativepython | 3f469f6d3c8c0f03cb9f51eb2a851d68310c7f90 | [
"Apache-2.0"
] | null | null | null | nativepython/tests/alternative_compilation_test.py | mjwoolf/nativepython | 3f469f6d3c8c0f03cb9f51eb2a851d68310c7f90 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Braxton Mckee
#
# 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 t... | 28.065789 | 76 | 0.545945 |
from typed_python import *
import typed_python._types as _types
from nativepython.runtime import Runtime
import unittest
import time
def Compiled(f):
f = Function(f)
return Runtime.singleton().compile(f)
class TestAlternativeCompilation(unittest.TestCase):
def test_simple_alternative_passi... | true | true |
f734f6c742d13b78096f4a33478f826a3c320dcd | 1,175 | py | Python | tests/utest/test_thresholds.py | wagnerd/robotframework-robocop | a52d5843e953544da61e26df3521b219ccfc344c | [
"Apache-2.0"
] | 2 | 2021-12-22T01:50:52.000Z | 2022-01-05T06:32:27.000Z | tests/utest/test_thresholds.py | wagnerd/robotframework-robocop | a52d5843e953544da61e26df3521b219ccfc344c | [
"Apache-2.0"
] | null | null | null | tests/utest/test_thresholds.py | wagnerd/robotframework-robocop | a52d5843e953544da61e26df3521b219ccfc344c | [
"Apache-2.0"
] | 1 | 2021-06-30T11:01:51.000Z | 2021-06-30T11:01:51.000Z | import pytest
from robocop.rules import RuleSeverity, Rule
def get_severity_enum(value):
for sev in RuleSeverity:
if sev.value == value:
return sev
return RuleSeverity.INFO
def get_message_with_id_sev(rule_id, sev):
for char in RuleSeverity:
rule_id = rule_id.replace(char.val... | 30.921053 | 98 | 0.629787 | import pytest
from robocop.rules import RuleSeverity, Rule
def get_severity_enum(value):
for sev in RuleSeverity:
if sev.value == value:
return sev
return RuleSeverity.INFO
def get_message_with_id_sev(rule_id, sev):
for char in RuleSeverity:
rule_id = rule_id.replace(char.val... | true | true |
f734f7bd14892873b678912da3d43da15dc8efca | 654 | py | Python | deliravision/torch/models/backbones/__init__.py | delira-dev/vision_torch | d944aa67d319bd63a2add5cb89e8308413943de6 | [
"BSD-2-Clause"
] | 4 | 2019-08-03T09:56:50.000Z | 2019-09-05T09:32:06.000Z | deliravision/torch/models/backbones/__init__.py | delira-dev/vision_torch | d944aa67d319bd63a2add5cb89e8308413943de6 | [
"BSD-2-Clause"
] | 23 | 2019-08-03T14:16:47.000Z | 2019-10-22T10:15:10.000Z | deliravision/torch/models/backbones/__init__.py | delira-dev/vision_torch | d944aa67d319bd63a2add5cb89e8308413943de6 | [
"BSD-2-Clause"
] | null | null | null | __all__ = []
from .resnet import ResNetTorch
from .vgg import VGGTorch
from .alexnet import AlexNetTorch
from .squeezenet import SqueezeNetTorch
from .densenet import DenseNetTorch
from .mobilenet import MobileNetV2Torch
from .resnext import ResNeXtTorch
from .seblocks import SEBasicBlockTorch, SEBottleneckTorch, \
... | 24.222222 | 61 | 0.743119 | __all__ = []
from .resnet import ResNetTorch
from .vgg import VGGTorch
from .alexnet import AlexNetTorch
from .squeezenet import SqueezeNetTorch
from .densenet import DenseNetTorch
from .mobilenet import MobileNetV2Torch
from .resnext import ResNeXtTorch
from .seblocks import SEBasicBlockTorch, SEBottleneckTorch, \
... | true | true |
f734f824d58a2eac60206f7d5648be51ce1cd66b | 1,018 | py | Python | app/models/user.py | qtdemo1/ibm-ops | 29f3d4ba406a1c39a007468977784d6c39f056bb | [
"Apache-2.0"
] | 1 | 2021-09-14T18:40:33.000Z | 2021-09-14T18:40:33.000Z | app/models/user.py | qtdemo1/ibm-ops | 29f3d4ba406a1c39a007468977784d6c39f056bb | [
"Apache-2.0"
] | 7 | 2021-04-23T13:41:39.000Z | 2021-08-12T09:33:10.000Z | app/models/user.py | qtdemo1/ibm-ops | 29f3d4ba406a1c39a007468977784d6c39f056bb | [
"Apache-2.0"
] | 5 | 2020-12-10T14:27:23.000Z | 2022-03-29T08:44:22.000Z | #!/usr/bin/env python3
#
# Copyright 2020 IBM
# 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 t... | 36.357143 | 97 | 0.752456 |
import sqlalchemy as sql
import app.db.base_class as base_class
class User(base_class.Base):
id = sql.Column('id', sql.Integer, nullable=False, unique=True, index=True, primary_key=True)
username = sql.Column(sql.NCHAR(32), nullable=False, index=True, unique=True)
hashed_password = ... | true | true |
f734f8778bf4b8e5ff157ae685a7c022d954b83a | 1,502 | py | Python | heat/engine/clients/os/aodh.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:26.000Z | 2018-07-04T07:59:26.000Z | heat/engine/clients/os/aodh.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | heat/engine/clients/os/aodh.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 3 | 2018-07-19T17:43:37.000Z | 2019-11-15T22:13:30.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
# ... | 30.04 | 78 | 0.699734 |
from aodhclient import client as ac
from aodhclient import exceptions
from heat.engine.clients import client_plugin
CLIENT_NAME = 'aodh'
class AodhClientPlugin(client_plugin.ClientPlugin):
exceptions_module = exceptions
service_types = [ALARMING] = ['alarming']
supported_versions = [V2] ... | true | true |
f734f997599f10b45b5a2ef8338f9a454cceefe8 | 28,143 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py | dmarx/azure-sdk-for-python | 86ac35b947c0ed3d5edb1cac03f5ad20a34a6fda | [
"MIT"
] | 1 | 2021-09-07T18:43:20.000Z | 2021-09-07T18:43:20.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py | dmarx/azure-sdk-for-python | 86ac35b947c0ed3d5edb1cac03f5ad20a34a6fda | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py | msyyc/azure-sdk-for-python | e2dba75181f8b4336ae57e75aa391322c12c3123 | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import pytest
import platform
import functools
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.c... | 45.318841 | 152 | 0.656291 |
import os
import pytest
import platform
import functools
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.credentials import AzureKeyCredential
from asynctestcase import AsyncTextAnalyticsTest
from testcase import GlobalTextAnalyticsAccountPreparer
from testcase impor... | true | true |
f734fad6c40629440b9272bed1e078ca97ba0134 | 2,276 | py | Python | lingvo/core/test_utils_test.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | lingvo/core/test_utils_test.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | lingvo/core/test_utils_test.py | zhoudoufu/lingvo | bd0f89809942fd0508ff43bd4b6bca1b598220cb | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2018 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
#
... | 39.241379 | 80 | 0.696397 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from lingvo.core import test_utils
class TestUtilsTest(test_utils.TestCase):
def testReplaceGoldenSingleFloat(self):
old_line = ' CompareToGoldenSingleFloat... | true | true |
f734fb6ee9073916872738ef1d419bf8d564a7d0 | 3,161 | py | Python | tests/agents/test_agent_interface.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 12 | 2020-05-19T18:58:55.000Z | 2021-02-21T20:26:46.000Z | tests/agents/test_agent_interface.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 39 | 2020-05-19T18:41:42.000Z | 2021-01-16T08:31:06.000Z | tests/agents/test_agent_interface.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 2 | 2020-05-19T15:15:04.000Z | 2020-05-21T08:45:59.000Z | import pytest
import torch
from gym.spaces import Discrete, MultiDiscrete, MultiBinary, Dict, Tuple, Box
from blobrl.agents import AgentInterface
class MOCKAgentInterface(AgentInterface):
def __init__(self, observation_space, action_space, device):
super().__init__(observation_space, action_space, device... | 30.68932 | 105 | 0.548561 | import pytest
import torch
from gym.spaces import Discrete, MultiDiscrete, MultiBinary, Dict, Tuple, Box
from blobrl.agents import AgentInterface
class MOCKAgentInterface(AgentInterface):
def __init__(self, observation_space, action_space, device):
super().__init__(observation_space, action_space, device... | true | true |
f734fc94c2982f19f46721f2e95b37368f72bc2d | 385 | py | Python | apps/wsgi.py | reimibeta/django-store-item-models | 0be5fad0df0b3ebc7283fc6369f0e769a4743987 | [
"Apache-2.0"
] | null | null | null | apps/wsgi.py | reimibeta/django-store-item-models | 0be5fad0df0b3ebc7283fc6369f0e769a4743987 | [
"Apache-2.0"
] | 35 | 2020-10-24T22:14:41.000Z | 2022-03-07T10:20:25.000Z | apps/wsgi.py | reimibeta/django-store-item-models | 0be5fad0df0b3ebc7283fc6369f0e769a4743987 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for apps project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS... | 22.647059 | 78 | 0.781818 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'apps.settings')
application = get_wsgi_application()
| true | true |
f734fd0b04be2065e704ed64eb67bd4f6f83c3c6 | 1,745 | py | Python | oleander/google.py | honzajavorek/oleander | d4a0dc4c2da1cf2394a5a1b206e5398ad6900bee | [
"ISC"
] | null | null | null | oleander/google.py | honzajavorek/oleander | d4a0dc4c2da1cf2394a5a1b206e5398ad6900bee | [
"ISC"
] | null | null | null | oleander/google.py | honzajavorek/oleander | d4a0dc4c2da1cf2394a5a1b206e5398ad6900bee | [
"ISC"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import url_for, request, session
from oleander import app
from gdata.client import Unauthorized as UnauthorizedError
from gdata.gauth import OAuth2Token, Error as ConnectionError, token_to_blob, token_from_blob
from gdata.contacts.client import ContactsClient
from gdata.calendar.cli... | 31.160714 | 93 | 0.731232 |
from flask import url_for, request, session
from oleander import app
from gdata.client import Unauthorized as UnauthorizedError
from gdata.gauth import OAuth2Token, Error as ConnectionError, token_to_blob, token_from_blob
from gdata.contacts.client import ContactsClient
from gdata.calendar.client import CalendarClie... | true | true |
f734fd169d9fe2785174d14db380bf2f369d6039 | 25,499 | py | Python | tests/schemas/test_openapi.py | mrtaalebi/django-rest-framework | d22daf4e05bc670f4ff96d97da5d2a9cf83df6c1 | [
"BSD-3-Clause"
] | 4 | 2019-02-11T13:01:34.000Z | 2020-10-22T08:39:57.000Z | tests/schemas/test_openapi.py | mrtaalebi/django-rest-framework | d22daf4e05bc670f4ff96d97da5d2a9cf83df6c1 | [
"BSD-3-Clause"
] | null | null | null | tests/schemas/test_openapi.py | mrtaalebi/django-rest-framework | d22daf4e05bc670f4ff96d97da5d2a9cf83df6c1 | [
"BSD-3-Clause"
] | 2 | 2020-04-24T01:54:08.000Z | 2020-06-05T18:37:03.000Z | import pytest
from django.conf.urls import url
from django.test import RequestFactory, TestCase, override_settings
from django.utils.translation import gettext_lazy as _
from rest_framework import filters, generics, pagination, routers, serializers
from rest_framework.compat import uritemplate
from rest_framework.pars... | 34.135207 | 119 | 0.553512 | import pytest
from django.conf.urls import url
from django.test import RequestFactory, TestCase, override_settings
from django.utils.translation import gettext_lazy as _
from rest_framework import filters, generics, pagination, routers, serializers
from rest_framework.compat import uritemplate
from rest_framework.pars... | true | true |
f734fe34b1e61e45b4b8a3552db35388a603ad0c | 376 | py | Python | trackme/utils/messages/auth_messages.py | j4l13n/trackMe | aab64060dfed7147a4604b80fe861f990d95a161 | [
"MIT"
] | null | null | null | trackme/utils/messages/auth_messages.py | j4l13n/trackMe | aab64060dfed7147a4604b80fe861f990d95a161 | [
"MIT"
] | 7 | 2020-08-10T08:20:20.000Z | 2020-08-18T07:58:22.000Z | trackme/utils/messages/auth_messages.py | j4l13n/trackMe | aab64060dfed7147a4604b80fe861f990d95a161 | [
"MIT"
] | null | null | null | AUTH_SUCCESS_RESPONSES = {
"register_success": "You have successfully registered to TrackMe",
"login_success": "User logged in successfully"
}
AUTH_ERROR_RESPONSES = {
"register_error": "Something went wrong while creating an account: {}",
"invalid_credentials": "Incorrect email or password",
"not_... | 34.181818 | 75 | 0.728723 | AUTH_SUCCESS_RESPONSES = {
"register_success": "You have successfully registered to TrackMe",
"login_success": "User logged in successfully"
}
AUTH_ERROR_RESPONSES = {
"register_error": "Something went wrong while creating an account: {}",
"invalid_credentials": "Incorrect email or password",
"not_... | true | true |
f734fe7fd58f4a3a26a042d8b339ae8dbff991e2 | 12,657 | py | Python | pandas/tests/series/test_alter_axes.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | 1 | 2020-04-26T17:14:25.000Z | 2020-04-26T17:14:25.000Z | pandas/tests/series/test_alter_axes.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/series/test_alter_axes.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | 1 | 2020-01-02T14:28:17.000Z | 2020-01-02T14:28:17.000Z | from datetime import datetime
import numpy as np
import pytest
from pandas import DataFrame, Index, MultiIndex, RangeIndex, Series
import pandas.util.testing as tm
class TestSeriesAlterAxes:
def test_setindex(self, string_series):
# wrong type
msg = (r"Index\(\.\.\.\) must be called with a coll... | 36.900875 | 79 | 0.555187 | from datetime import datetime
import numpy as np
import pytest
from pandas import DataFrame, Index, MultiIndex, RangeIndex, Series
import pandas.util.testing as tm
class TestSeriesAlterAxes:
def test_setindex(self, string_series):
msg = (r"Index\(\.\.\.\) must be called with a collection of so... | true | true |
f734fee836f525ac79f83d059794cdc10b43ae4a | 6,835 | py | Python | beagle/transformers/darpa_tc_transformer.py | limkokhian/beagle | 791e83db94e5a8ab1965b155bb79d32bb259d2b3 | [
"MIT"
] | 1,139 | 2019-03-24T09:09:05.000Z | 2022-03-27T14:54:38.000Z | beagle/transformers/darpa_tc_transformer.py | limkokhian/beagle | 791e83db94e5a8ab1965b155bb79d32bb259d2b3 | [
"MIT"
] | 78 | 2019-03-24T16:56:06.000Z | 2022-02-27T21:31:38.000Z | beagle/transformers/darpa_tc_transformer.py | limkokhian/beagle | 791e83db94e5a8ab1965b155bb79d32bb259d2b3 | [
"MIT"
] | 149 | 2019-03-24T16:44:45.000Z | 2022-03-11T12:20:51.000Z | from typing import List, Optional, Tuple, Union
from beagle.common import logger, split_path, split_reg_path
from beagle.nodes import File, Process, RegistryKey, IPAddress
from beagle.transformers.base_transformer import Transformer
# Custom Node classes to use the UUID in TC
class TCProcess(Process):
key_fields... | 34.004975 | 96 | 0.597952 | from typing import List, Optional, Tuple, Union
from beagle.common import logger, split_path, split_reg_path
from beagle.nodes import File, Process, RegistryKey, IPAddress
from beagle.transformers.base_transformer import Transformer
class TCProcess(Process):
key_fields: List[str] = ["uuid"]
uuid: Optional[s... | true | true |
f73500cf450e08e25d97f5cb04a26cfa720754d1 | 2,897 | py | Python | rest_framework_tracking/admin.py | Movemeback/drf-api-tracking | 3730907eee448917f766aa1d85402e85ed775d0c | [
"0BSD"
] | null | null | null | rest_framework_tracking/admin.py | Movemeback/drf-api-tracking | 3730907eee448917f766aa1d85402e85ed775d0c | [
"0BSD"
] | null | null | null | rest_framework_tracking/admin.py | Movemeback/drf-api-tracking | 3730907eee448917f766aa1d85402e85ed775d0c | [
"0BSD"
] | null | null | null | import datetime
from django.contrib import admin
from django.db.models import Count
from django.db.models.functions import TruncDay
from django.urls import path
from django.http import JsonResponse
from .app_settings import app_settings
from .models import APIRequestLog
class APIRequestLogAdmin(admin.ModelAdmin):
... | 28.97 | 85 | 0.594408 | import datetime
from django.contrib import admin
from django.db.models import Count
from django.db.models.functions import TruncDay
from django.urls import path
from django.http import JsonResponse
from .app_settings import app_settings
from .models import APIRequestLog
class APIRequestLogAdmin(admin.ModelAdmin):
... | true | true |
f73500ecce8a3e73abd3291d623dc2f348a5e473 | 47,456 | py | Python | python/GafferArnoldTest/ArnoldRenderTest.py | Tuftux/gaffer | 5acaf7cbfadbae841dc06854121ca85dcc5c338c | [
"BSD-3-Clause"
] | 31 | 2017-07-10T10:02:07.000Z | 2022-02-08T13:54:14.000Z | python/GafferArnoldTest/ArnoldRenderTest.py | Tuftux/gaffer | 5acaf7cbfadbae841dc06854121ca85dcc5c338c | [
"BSD-3-Clause"
] | null | null | null | python/GafferArnoldTest/ArnoldRenderTest.py | Tuftux/gaffer | 5acaf7cbfadbae841dc06854121ca85dcc5c338c | [
"BSD-3-Clause"
] | 3 | 2017-11-04T15:30:11.000Z | 2018-09-25T18:36:11.000Z | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | 36.364751 | 141 | 0.682506 | "/assTests/test.0001.ass" ) )
with s.context() :
s["render"]["task"].execute()
self.assertTrue( os.path.exists( self.temporaryDirectory() + "/renderTests" ) )
self.assertTrue( os.path.exists( self.temporaryDirectory() + "/assTests" ) )
self.assertTrue( os.path.exists( self.temporaryDirectory() + "/ass... | true | true |
f73501752e6c23eaebdfdfc652c07fdc952f82a3 | 1,049 | py | Python | tools/generateData_sensor_malfunction.py | Hemankita/refarch-kc-container-ms | c2e85eacabe8a194782835b04f3410c2d7956a9b | [
"Apache-2.0"
] | null | null | null | tools/generateData_sensor_malfunction.py | Hemankita/refarch-kc-container-ms | c2e85eacabe8a194782835b04f3410c2d7956a9b | [
"Apache-2.0"
] | null | null | null | tools/generateData_sensor_malfunction.py | Hemankita/refarch-kc-container-ms | c2e85eacabe8a194782835b04f3410c2d7956a9b | [
"Apache-2.0"
] | null | null | null | import csv
import json
from random import gauss
import random
import datetime
import numpy as np
import sys
import pandas as pd
df = pd.DataFrame(columns=['Timestamp', 'ID', 'Temperature(celsius)', 'Target_Temperature(celsius)', 'Amp', 'CumulativePowerConsumption', 'ContentType', 'Humidity', 'CO2', 'Time_Door_Open',
... | 31.787879 | 190 | 0.650143 | import csv
import json
from random import gauss
import random
import datetime
import numpy as np
import sys
import pandas as pd
df = pd.DataFrame(columns=['Timestamp', 'ID', 'Temperature(celsius)', 'Target_Temperature(celsius)', 'Amp', 'CumulativePowerConsumption', 'ContentType', 'Humidity', 'CO2', 'Time_Door_Open',
... | true | true |
f73502a0b1963176fdafca20bee31f09321e6c49 | 542 | py | Python | blogengine/manage.py | forgoty/django-blog | 2d4c2353d3614be04f06bdb3b713c8339f7e00b5 | [
"MIT"
] | null | null | null | blogengine/manage.py | forgoty/django-blog | 2d4c2353d3614be04f06bdb3b713c8339f7e00b5 | [
"MIT"
] | null | null | null | blogengine/manage.py | forgoty/django-blog | 2d4c2353d3614be04f06bdb3b713c8339f7e00b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blogengine.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. A... | 33.875 | 74 | 0.688192 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blogengine.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's inst... | true | true |
f73503258b60efbb2ff116d604275c8ed287bfee | 269 | py | Python | helpers/cols.py | ijlyttle/reactivity-demo-dash | 93260437a78c257c43cf8ddedefea3acbff4eb66 | [
"MIT"
] | null | null | null | helpers/cols.py | ijlyttle/reactivity-demo-dash | 93260437a78c257c43cf8ddedefea3acbff4eb66 | [
"MIT"
] | 1 | 2022-02-16T10:58:32.000Z | 2022-02-19T17:58:17.000Z | helpers/cols.py | ijlyttle/reactivity-demo-dash | 93260437a78c257c43cf8ddedefea3acbff4eb66 | [
"MIT"
] | null | null | null | import pandas as pd
def cols_choice (df, include):
return df.select_dtypes(include=include).columns.to_list()
def cols_header (data_records):
if (len(data_records) == 0):
return []
return [{'name': v, 'id': v} for v in data_records[0].keys()]
| 22.416667 | 65 | 0.650558 | import pandas as pd
def cols_choice (df, include):
return df.select_dtypes(include=include).columns.to_list()
def cols_header (data_records):
if (len(data_records) == 0):
return []
return [{'name': v, 'id': v} for v in data_records[0].keys()]
| true | true |
f7350478178bbe07092ac6792210521df315bc7f | 303 | py | Python | coding_intereview/1015. Smallest Integer Divisible by K.py | purusharthmalik/Python-Bootcamp | 2ed1cf886d1081de200b0fdd4cb4e28008c7e3d1 | [
"MIT"
] | 2 | 2020-10-03T16:38:10.000Z | 2021-06-03T11:01:59.000Z | coding_intereview/1015. Smallest Integer Divisible by K.py | purusharthmalik/Python-Bootcamp | 2ed1cf886d1081de200b0fdd4cb4e28008c7e3d1 | [
"MIT"
] | null | null | null | coding_intereview/1015. Smallest Integer Divisible by K.py | purusharthmalik/Python-Bootcamp | 2ed1cf886d1081de200b0fdd4cb4e28008c7e3d1 | [
"MIT"
] | 1 | 2020-10-03T16:38:02.000Z | 2020-10-03T16:38:02.000Z | class Solution:
def smallestRepunitDivByK(self, k: int) -> int:
if k % 2 == 0 or k % 5 == 0:
return -1
if k == 1:
return 1
count = 1
n = 1
while (n % k > 0):
n = (n % k) * 10 + 1
count += 1
return count
| 23.307692 | 51 | 0.379538 | class Solution:
def smallestRepunitDivByK(self, k: int) -> int:
if k % 2 == 0 or k % 5 == 0:
return -1
if k == 1:
return 1
count = 1
n = 1
while (n % k > 0):
n = (n % k) * 10 + 1
count += 1
return count
| true | true |
f73505c7a1c27e7bd446ee7783c3f5f7ec32f268 | 449 | py | Python | leetcode/0278_first_bad_version.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | 3 | 2018-05-10T09:56:49.000Z | 2020-11-07T18:09:42.000Z | leetcode/0278_first_bad_version.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | null | null | null | leetcode/0278_first_bad_version.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def isBadVersion(n):
return n >= 3
class Solution:
def firstBadVersion(self, n):
first, last = 1, n
while first <= last:
mid = (first + last) // 2
if isBadVersion(mid):
last = mid - 1
else:
first = m... | 17.269231 | 43 | 0.494432 |
def isBadVersion(n):
return n >= 3
class Solution:
def firstBadVersion(self, n):
first, last = 1, n
while first <= last:
mid = (first + last) // 2
if isBadVersion(mid):
last = mid - 1
else:
first = mid + 1
return ... | true | true |
f7350648874ae71f3a7650435ec8cd57044d8c7a | 8,527 | py | Python | scripts/config/dor-o1turn.py | rikygege/Hornet | 8b8ebe70fbc6391f361d98b8960dfdeeca0b8ebd | [
"MIT"
] | null | null | null | scripts/config/dor-o1turn.py | rikygege/Hornet | 8b8ebe70fbc6391f361d98b8960dfdeeca0b8ebd | [
"MIT"
] | null | null | null | scripts/config/dor-o1turn.py | rikygege/Hornet | 8b8ebe70fbc6391f361d98b8960dfdeeca0b8ebd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import with_statement
import sys, string, operator
def get_cpu2net_vcs(num_vcs):
assert num_vcs <= 8
return range(0,num_vcs)
def get_net2cpu_vcs(num_vcs):
assert num_vcs <= 8
return range(8,8+num_vcs)
def concat(xs):
return reduce(operator.add, xs, [])
# VC ... | 39.294931 | 125 | 0.514835 |
from __future__ import with_statement
import sys, string, operator
def get_cpu2net_vcs(num_vcs):
assert num_vcs <= 8
return range(0,num_vcs)
def get_net2cpu_vcs(num_vcs):
assert num_vcs <= 8
return range(8,8+num_vcs)
def concat(xs):
return reduce(operator.add, xs, [])
vcs_table = {
1: { (0... | false | true |
f735073dd8e4cb97b818e6d3e74a9803c651d4c0 | 473 | py | Python | animal-classifier/__init__.py | xvinay28x/cat_dog_classifier_library | 4d56f90f9d3e91051dba71dcdea78930c4ac0e52 | [
"MIT"
] | 1 | 2021-05-20T16:44:47.000Z | 2021-05-20T16:44:47.000Z | animal-classifier/__init__.py | xvinay28x/cat_dog_classifier_library | 4d56f90f9d3e91051dba71dcdea78930c4ac0e52 | [
"MIT"
] | null | null | null | animal-classifier/__init__.py | xvinay28x/cat_dog_classifier_library | 4d56f90f9d3e91051dba71dcdea78930c4ac0e52 | [
"MIT"
] | null | null | null | from tensorflow import keras
def classify(path):
model = keras.models.load_model("Cat_Dog_Classification.h5")
load_image = keras.preprocessing.image.load_image(path,target_size=(200,200))
image_array = keras.preprocessing.image.img_to_array(load_image)
reshape_array = image_array.reshape(1,200,200,3)
... | 33.785714 | 81 | 0.72093 | from tensorflow import keras
def classify(path):
model = keras.models.load_model("Cat_Dog_Classification.h5")
load_image = keras.preprocessing.image.load_image(path,target_size=(200,200))
image_array = keras.preprocessing.image.img_to_array(load_image)
reshape_array = image_array.reshape(1,200,200,3)
... | true | true |
f7350802904ca5629e003778588a92b700ad1475 | 51 | py | Python | test/run/t21.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 2,671 | 2015-01-03T08:23:25.000Z | 2022-03-31T06:15:48.000Z | test/run/t21.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 972 | 2015-01-05T08:11:00.000Z | 2022-03-29T13:47:15.000Z | test/run/t21.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 845 | 2015-01-03T19:53:36.000Z | 2022-03-29T18:34:22.000Z | x = 1
while x < 3:
break
x = x + 1
print x
| 8.5 | 13 | 0.45098 | x = 1
while x < 3:
break
x = x + 1
print x
| false | true |
f7350a516a0b79650e657142a36947cc0f4ff3df | 558 | py | Python | drfstripe/templatetags/payments_tags.py | brandon-fox/django-rest-framework-stripe | 883c1c82e64c67d5379460b5f6d2ce79b89b7e85 | [
"MIT"
] | null | null | null | drfstripe/templatetags/payments_tags.py | brandon-fox/django-rest-framework-stripe | 883c1c82e64c67d5379460b5f6d2ce79b89b7e85 | [
"MIT"
] | null | null | null | drfstripe/templatetags/payments_tags.py | brandon-fox/django-rest-framework-stripe | 883c1c82e64c67d5379460b5f6d2ce79b89b7e85 | [
"MIT"
] | null | null | null | from django import template
from ..forms import PlanForm
register = template.Library()
@register.inclusion_tag("drfstripe/_change_plan_form.html", takes_context=True)
def change_plan_form(context):
context.update({
"form": PlanForm(initial={
"plan": context["request"].user.customer.current_... | 22.32 | 79 | 0.700717 | from django import template
from ..forms import PlanForm
register = template.Library()
@register.inclusion_tag("drfstripe/_change_plan_form.html", takes_context=True)
def change_plan_form(context):
context.update({
"form": PlanForm(initial={
"plan": context["request"].user.customer.current_... | true | true |
f7350b3ed0632219aec9672fa33d4b3ba534f8ec | 299 | py | Python | tf_euler/python/euler_ops/type_ops.py | lixusign/euler | c8ce1968367aec2807cc542fcdb5958e3b1b9295 | [
"Apache-2.0"
] | 1 | 2019-09-18T02:18:06.000Z | 2019-09-18T02:18:06.000Z | tf_euler/python/euler_ops/type_ops.py | DingXiye/euler | c45225119c5b991ca953174f06c2f223562f34c9 | [
"Apache-2.0"
] | null | null | null | tf_euler/python/euler_ops/type_ops.py | DingXiye/euler | c45225119c5b991ca953174f06c2f223562f34c9 | [
"Apache-2.0"
] | 1 | 2020-09-18T13:37:08.000Z | 2020-09-18T13:37:08.000Z | # Copyright 2018 Alibaba Inc. All Rights Conserved
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ctypes
import os
import tensorflow as tf
from tf_euler.python.euler_ops import base
get_node_type = base._LIB_OP.get_node_type
| 19.933333 | 50 | 0.842809 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ctypes
import os
import tensorflow as tf
from tf_euler.python.euler_ops import base
get_node_type = base._LIB_OP.get_node_type
| true | true |
f7350b819bf2183789b58144d7ef8095f9e3572e | 940 | py | Python | test/io/testxyzwriter.py | alvarovm/cclib | 18a87de7fcb15c4133e1fd21939401672438ebb7 | [
"BSD-3-Clause"
] | null | null | null | test/io/testxyzwriter.py | alvarovm/cclib | 18a87de7fcb15c4133e1fd21939401672438ebb7 | [
"BSD-3-Clause"
] | null | null | null | test/io/testxyzwriter.py | alvarovm/cclib | 18a87de7fcb15c4133e1fd21939401672438ebb7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Unit tests for writer xyzwriter module."""
import os
import unittest
import cclib
__filedir__ = os.path.dirname(__f... | 24.736842 | 85 | 0.678723 |
import os
import unittest
import cclib
__filedir__ = os.path.dirname(__file__)
__filepath__ = os.path.realpath(__filedir__)
__datadir__ = os.path.join(__filepath__, "..", "..")
class XYZTest(unittest.TestCase):
def setUp(self):
self.XYZ = cclib.io.XYZ
def test_init(self):
fpath = ... | true | true |
f7350bcea3057e9df338ed9f0dbbcc6dfb9d9b74 | 388 | py | Python | featurewiz/__version__.py | hercules261188/featurewiz | b52ab472a76b87440fd2482f315e14c71b4061df | [
"Apache-2.0"
] | 1 | 2021-12-15T17:11:24.000Z | 2021-12-15T17:11:24.000Z | featurewiz/__version__.py | hercules261188/featurewiz | b52ab472a76b87440fd2482f315e14c71b4061df | [
"Apache-2.0"
] | null | null | null | featurewiz/__version__.py | hercules261188/featurewiz | b52ab472a76b87440fd2482f315e14c71b4061df | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Specifies the version of the featurewiz package."""
__title__ = "featurewiz"
__author__ = "Ram Seshadri"
__description__ = "Advanced Feature Engineering and Feature Selection for any data set, any size"
__url__ = "https://github.com/Auto_ViML/featurewiz.git"
__version__ = "0.0.51"
__... | 35.272727 | 98 | 0.721649 |
__title__ = "featurewiz"
__author__ = "Ram Seshadri"
__description__ = "Advanced Feature Engineering and Feature Selection for any data set, any size"
__url__ = "https://github.com/Auto_ViML/featurewiz.git"
__version__ = "0.0.51"
__license__ = "Apache License 2.0"
__copyright__ = "2020-21 Google"
| true | true |
f7350c06e31b0bd40b501e7b2cb33f083a294241 | 3,426 | py | Python | st2reactor/st2reactor/sensor/base.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 2 | 2021-08-04T01:04:06.000Z | 2021-08-04T01:04:08.000Z | st2reactor/st2reactor/sensor/base.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2022-03-31T03:53:22.000Z | 2022-03-31T03:53:22.000Z | st2reactor/st2reactor/sensor/base.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Extreme Networks, 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 i... | 24.297872 | 90 | 0.626678 |
from __future__ import absolute_import
import abc
import six
from st2common.util import concurrency
__all__ = [
'Sensor',
'PollingSensor'
]
@six.add_metaclass(abc.ABCMeta)
class BaseSensor(object):
def __init__(self, sensor_service, config=None):
self._sensor_service = sensor_se... | true | true |
f7350c2587fbe9b2c791461b60f362d4107f7172 | 1,470 | py | Python | config.py | crazynayan/tpf2 | 3552163a1dab7cd5e371d752a2651e73e8cd8e1e | [
"MIT"
] | null | null | null | config.py | crazynayan/tpf2 | 3552163a1dab7cd5e371d752a2651e73e8cd8e1e | [
"MIT"
] | 2 | 2021-03-23T02:46:31.000Z | 2021-08-04T07:39:45.000Z | config.py | crazynayan/tpf2 | 3552163a1dab7cd5e371d752a2651e73e8cd8e1e | [
"MIT"
] | null | null | null | import os
from base64 import b64encode
from socket import gethostname, gethostbyname
class Config:
SECRET_KEY = os.environ.get("SECRET_KEY") or b64encode(os.urandom(24)).decode()
SERVER_URL = os.environ.get("SERVER_URL") or f"http://{gethostbyname(gethostname())}:8000"
CI_SECURITY = True if os.environ.get... | 38.684211 | 118 | 0.538776 | import os
from base64 import b64encode
from socket import gethostname, gethostbyname
class Config:
SECRET_KEY = os.environ.get("SECRET_KEY") or b64encode(os.urandom(24)).decode()
SERVER_URL = os.environ.get("SERVER_URL") or f"http://{gethostbyname(gethostname())}:8000"
CI_SECURITY = True if os.environ.get... | true | true |
f7350d119267fcf4c70bb61c659559abce247fcd | 4,441 | py | Python | FastStyleTransfer/utils.py | ericlearning/style-transfer | f387515b4ffe441c4677400a65b9e7fdb50c979f | [
"MIT"
] | 1 | 2019-05-29T03:34:37.000Z | 2019-05-29T03:34:37.000Z | FastStyleTransfer/utils.py | ericlearning/style-transfer | f387515b4ffe441c4677400a65b9e7fdb50c979f | [
"MIT"
] | null | null | null | FastStyleTransfer/utils.py | ericlearning/style-transfer | f387515b4ffe441c4677400a65b9e7fdb50c979f | [
"MIT"
] | null | null | null | import os
import glob
import torch
import pandas as pd
import seaborn as sn
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from torch.optim.lr_scheduler import _LRScheduler
from sklearn.metrics import confusion_matrix
from PIL import Image
def set_lr(optimizer, lrs):
if(len(lrs) == ... | 27.41358 | 91 | 0.72236 | import os
import glob
import torch
import pandas as pd
import seaborn as sn
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from torch.optim.lr_scheduler import _LRScheduler
from sklearn.metrics import confusion_matrix
from PIL import Image
def set_lr(optimizer, lrs):
if(len(lrs) == ... | true | true |
f7350d55eb323216182562c19c57df83c0186aa7 | 12,830 | py | Python | proteome_count/search_proteome.py | ProteinsWebTeam/interpro-pfam-curation-tools | 41df7e4ad390ace8c68f137e582b6bd2bfe4b23a | [
"MIT"
] | null | null | null | proteome_count/search_proteome.py | ProteinsWebTeam/interpro-pfam-curation-tools | 41df7e4ad390ace8c68f137e582b6bd2bfe4b23a | [
"MIT"
] | null | null | null | proteome_count/search_proteome.py | ProteinsWebTeam/interpro-pfam-curation-tools | 41df7e4ad390ace8c68f137e582b6bd2bfe4b23a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
@author T. Paysan-Lafosse
@brief This script searches unintegrated proteins for a given organism or taxid
in InterPro signatures, if they are not found in signatures, they are clustered based on UniRef clusters
@arguments [-u USER]: database user
[-p PASSWORD]: database... | 40.345912 | 171 | 0.60304 |
import argparse
import os
import sys
from pathlib import Path
import requests
from utils import proteome
class protein_pipeline(proteome):
def __init__(self):
super().__init__()
self.uniref50 = dict()
self.clusters = dict()
def get_integrated(self, protein_list):
print("S... | true | true |
f7350ddc02325562c929b5462b8300547041db9d | 1,789 | py | Python | scraper_test.py | svennickel/itunes-app-scraper | 14b857bd40a237825cb6bd93be388e6bcd083c01 | [
"MIT"
] | 10 | 2020-08-12T06:47:04.000Z | 2021-12-04T03:06:19.000Z | scraper_test.py | svennickel/itunes-app-scraper | 14b857bd40a237825cb6bd93be388e6bcd083c01 | [
"MIT"
] | 5 | 2020-11-19T07:53:19.000Z | 2022-03-16T15:06:37.000Z | scraper_test.py | iaine/itunes-app-scraper | de60c8c0b369e78d4c87a0cb11284b2ef576c090 | [
"MIT"
] | 11 | 2020-08-12T06:47:31.000Z | 2022-03-19T23:36:18.000Z | from itunes_app_scraper.scraper import AppStoreScraper
from itunes_app_scraper.util import AppStoreException, AppStoreCollections, AppStoreCategories, AppStoreUtils
import json
import pytest
import os
def test_term_no_exception():
scraper = AppStoreScraper()
results = scraper.get_app_ids_for_query("mindful", ... | 34.403846 | 109 | 0.731694 | from itunes_app_scraper.scraper import AppStoreScraper
from itunes_app_scraper.util import AppStoreException, AppStoreCollections, AppStoreCategories, AppStoreUtils
import json
import pytest
import os
def test_term_no_exception():
scraper = AppStoreScraper()
results = scraper.get_app_ids_for_query("mindful", ... | true | true |
f7350e589e89dd1abef4cd35a2f99c754386137d | 4,190 | py | Python | tests/DatastoreTests.py | erasmospunk/pychohistory | 71b2bd35578fea9bb6603c017a41c036644b3d85 | [
"MIT"
] | 1 | 2015-02-12T02:05:20.000Z | 2015-02-12T02:05:20.000Z | tests/DatastoreTests.py | erasmospunk/pychohistory | 71b2bd35578fea9bb6603c017a41c036644b3d85 | [
"MIT"
] | null | null | null | tests/DatastoreTests.py | erasmospunk/pychohistory | 71b2bd35578fea9bb6603c017a41c036644b3d85 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
import logging
import unittest
import os
import shutil
from modules import Datastore, GoogSuggestMe
__author__ = 'Giannis Dzegoutanis'
TEMP_FOLDER = u'tmp'
TEST_DATABASE = u'testdatastore.tmp'
TEST_QUERY = u'test'
module_name = u'test_modu... | 32.230769 | 88 | 0.670883 |
from datetime import datetime
import logging
import unittest
import os
import shutil
from modules import Datastore, GoogSuggestMe
__author__ = 'Giannis Dzegoutanis'
TEMP_FOLDER = u'tmp'
TEST_DATABASE = u'testdatastore.tmp'
TEST_QUERY = u'test'
module_name = u'test_module'
module_signature = (module_name,
... | true | true |
f7350e66a3ad1c6722e41a833fd5c41b04536a0d | 31 | py | Python | fcsgg/__init__.py | liuhengyue/fcsgg | 826c6e194270461a66ca5d048cb67f1ccf7ef387 | [
"MIT"
] | 9 | 2022-01-17T03:27:46.000Z | 2022-03-26T09:35:59.000Z | fcsgg/__init__.py | liuhengyue/fcsgg | 826c6e194270461a66ca5d048cb67f1ccf7ef387 | [
"MIT"
] | 3 | 2022-01-26T03:28:18.000Z | 2022-02-03T04:19:29.000Z | fcsgg/__init__.py | liuhengyue/fcsgg | 826c6e194270461a66ca5d048cb67f1ccf7ef387 | [
"MIT"
] | null | null | null | from .modeling import meta_arch | 31 | 31 | 0.870968 | from .modeling import meta_arch | true | true |
f7350e908e65de4d2b166767ea22ffebc316a256 | 670 | py | Python | p007.py | pbgnz/project-euler | 8ab4549101f7a3ac2a478eb6193b2b67920c8102 | [
"MIT"
] | null | null | null | p007.py | pbgnz/project-euler | 8ab4549101f7a3ac2a478eb6193b2b67920c8102 | [
"MIT"
] | 1 | 2021-04-13T12:47:07.000Z | 2021-04-14T20:27:04.000Z | p007.py | escobot/project-euler | 8ab4549101f7a3ac2a478eb6193b2b67920c8102 | [
"MIT"
] | null | null | null | # 10001st prime
# Problem 7
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13,
# we can see that the 6th prime is 13.
# What is the 10 001st prime number?
# as of solving this challenge the largest prime number known is 24,862,048
def is_prime(n):
i = 2
while i*i <= n:
if n % i == 0:
... | 18.611111 | 75 | 0.570149 |
def is_prime(n):
i = 2
while i*i <= n:
if n % i == 0:
return False
i = i + 1
return True
def solution(nth):
count = 1
prime = 0
while prime != nth:
count = count + 1
if is_prime(count):
prime = prime + 1
return count
def m... | true | true |
f7350f87740d3150f4219cff8545678e6ec86cf2 | 537 | py | Python | randoms_products/main.py | pechuga22/services-kiero | 73ab9ac847fdbf3970e40d3d15098be38af924ca | [
"MIT"
] | null | null | null | randoms_products/main.py | pechuga22/services-kiero | 73ab9ac847fdbf3970e40d3d15098be38af924ca | [
"MIT"
] | null | null | null | randoms_products/main.py | pechuga22/services-kiero | 73ab9ac847fdbf3970e40d3d15098be38af924ca | [
"MIT"
] | null | null | null | from flask import Flask, json
import pyodbc
conn = pyodbc.connect('DRIVER={PostgreSQL Unicode};SERVER=10.4.28.183;DATABASE=postgres;UID=postgres;PWD=developer2020')
app = Flask(__name__)
def random_products(conn):
cnxn = conn.cursor()
cnxn.execute('select categoryid, name from categories c where parentid is... | 21.48 | 120 | 0.692737 | from flask import Flask, json
import pyodbc
conn = pyodbc.connect('DRIVER={PostgreSQL Unicode};SERVER=10.4.28.183;DATABASE=postgres;UID=postgres;PWD=developer2020')
app = Flask(__name__)
def random_products(conn):
cnxn = conn.cursor()
cnxn.execute('select categoryid, name from categories c where parentid is... | true | true |
f7350f891078f1e15ec28d2c4dc4c9392e366653 | 125 | py | Python | libalgopy/common/enums/algorithm_type.py | PotapenkoOleg/libalgopy | ac625c0f874918c1967218c302c6fcb200db0271 | [
"MIT"
] | null | null | null | libalgopy/common/enums/algorithm_type.py | PotapenkoOleg/libalgopy | ac625c0f874918c1967218c302c6fcb200db0271 | [
"MIT"
] | null | null | null | libalgopy/common/enums/algorithm_type.py | PotapenkoOleg/libalgopy | ac625c0f874918c1967218c302c6fcb200db0271 | [
"MIT"
] | null | null | null | from enum import Enum
class AlgorithmType(Enum):
ITERATIVE = 1
RECURSIVE = 2
if __name__ == '__main__':
pass
| 11.363636 | 26 | 0.656 | from enum import Enum
class AlgorithmType(Enum):
ITERATIVE = 1
RECURSIVE = 2
if __name__ == '__main__':
pass
| true | true |
f7350f8b72cb5a0b0bbab3f89585cc7c5b06e0fb | 8,012 | py | Python | configs/dcn/cascade_mask_rcnn_dconv_c3-c5_r50_fpn_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | configs/dcn/cascade_mask_rcnn_dconv_c3-c5_r50_fpn_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | configs/dcn/cascade_mask_rcnn_dconv_c3-c5_r50_fpn_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='CascadeRCNN',
num_stages=3,
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch',
dcn=dict(
type='DCN'... | 31.920319 | 78 | 0.552047 |
model = dict(
type='CascadeRCNN',
num_stages=3,
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch',
dcn=dict(
type='DCN', deformable_gro... | true | true |
f735108b6b0b94d4460d9293d1b15b476e83e94e | 4,419 | py | Python | Complement.py | Eltoney/Boolean-Algebra | 0607f7efb69c82fdf9508c101e05202cfc7a1a21 | [
"MIT"
] | 1 | 2020-02-29T22:03:09.000Z | 2020-02-29T22:03:09.000Z | Complement.py | Eltoney/Boolean-Algebra | 0607f7efb69c82fdf9508c101e05202cfc7a1a21 | [
"MIT"
] | null | null | null | Complement.py | Eltoney/Boolean-Algebra | 0607f7efb69c82fdf9508c101e05202cfc7a1a21 | [
"MIT"
] | null | null | null | def comp_9th(n):
"""takes a decimal number (n) in string fomat
returns the 9's complement of the number"""
n=str(n)
result=[]
for digit in n:
a=str(9-int(digit))
result.append(a)
return "".join(result)
def comp_1st(n):
"""takes a binary number (n) in string fomat
... | 30.475862 | 76 | 0.577959 | def comp_9th(n):
n=str(n)
result=[]
for digit in n:
a=str(9-int(digit))
result.append(a)
return "".join(result)
def comp_1st(n):
n=str(n)
result=[]
for digit in n:
a=str(1-int(digit))
result.append(a)
return "".join(result)
def comp_2nd(n):
n=str(n)
... | true | true |
f73510985a441443661c53bc3bebf97b0cc9972d | 5,249 | py | Python | scripts/maintenance/make_i18n_dict.py | anisayari/pywikibot | af470904ce62cedae63d285ca15146e9168a0ee6 | [
"MIT"
] | 3 | 2019-02-14T13:59:34.000Z | 2021-11-08T09:23:03.000Z | scripts/maintenance/make_i18n_dict.py | anisayari/pywikibot | af470904ce62cedae63d285ca15146e9168a0ee6 | [
"MIT"
] | null | null | null | scripts/maintenance/make_i18n_dict.py | anisayari/pywikibot | af470904ce62cedae63d285ca15146e9168a0ee6 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Generate a i18n file from a given script.
run IDLE at topmost level:
>>> import pwb
>>> from scripts.maintenance.make_i18n_dict import i18nBot
>>> bot = i18nBot('<scriptname>', '<msg dict>')
>>> bot.run()
If you have more than one message dictionary, give all these names... | 32.602484 | 80 | 0.536293 |
from __future__ import absolute_import, print_function, unicode_literals
import codecs
import json
import os
from pywikibot import config
class i18nBot(object):
def __init__(self, script, *args, **kwargs):
modules = script.split('.')
self.scriptname = modules[0]
self.script =... | true | true |
f7351112411b3e19d17758b77c9516a3e645b2f5 | 1,454 | py | Python | app/views.py | rdelfin/zork-cortana | b1c8671502edb17417e79b0b9c6ee132b7769707 | [
"Apache-2.0"
] | null | null | null | app/views.py | rdelfin/zork-cortana | b1c8671502edb17417e79b0b9c6ee132b7769707 | [
"Apache-2.0"
] | null | null | null | app/views.py | rdelfin/zork-cortana | b1c8671502edb17417e79b0b9c6ee132b7769707 | [
"Apache-2.0"
] | null | null | null | from flask import render_template, send_from_directory, request, jsonify
from app import app
import hashlib, uuid
import game
from app import __config__ as config
def compare_password(password, correct_hash):
"""
Compares password with hash
"""
hashed_password = hashlib.sha512(password).hexdigest()
... | 30.93617 | 85 | 0.670564 | from flask import render_template, send_from_directory, request, jsonify
from app import app
import hashlib, uuid
import game
from app import __config__ as config
def compare_password(password, correct_hash):
hashed_password = hashlib.sha512(password).hexdigest()
return hashed_password == correct_hash
@app... | true | true |
f73511cdee490faea5847952fef23d5660145c4b | 3,756 | py | Python | project/app.py | civicmapper/flush-the-toilet | 94eea064156cff2729bb76da40484870f341e087 | [
"MIT"
] | null | null | null | project/app.py | civicmapper/flush-the-toilet | 94eea064156cff2729bb76da40484870f341e087 | [
"MIT"
] | 14 | 2018-09-06T20:03:17.000Z | 2022-02-12T02:55:44.000Z | project/app.py | civicmapper/flush-the-toilet | 94eea064156cff2729bb76da40484870f341e087 | [
"MIT"
] | 4 | 2018-04-10T18:44:36.000Z | 2019-08-14T19:16:49.000Z | #----------------------------------------------------------------------------#
# APP CONFIGURATION
#----------------------------------------------------------------------------#
# standard library imports
import os
import logging
from logging import Formatter, FileHandler
import json
# dependencies
import requests
fr... | 30.536585 | 88 | 0.563099 |
import os
import logging
from logging import Formatter, FileHandler
import json
import requests
from flask import Flask, render_template, request, make_response, session, jsonify
app = Flask(__name__)
app.config.from_pyfile('config.py')
def get_ags_token(url,username,password,client,referer,session,token_nam... | true | true |
f735125056ef23768727c335713c992eb7fdb73d | 666 | py | Python | algorithms-implementation/07-next-permutation.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 23 | 2018-11-06T03:54:00.000Z | 2022-03-14T13:30:40.000Z | algorithms-implementation/07-next-permutation.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | null | null | null | algorithms-implementation/07-next-permutation.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 5 | 2019-05-24T16:56:45.000Z | 2022-03-10T17:29:10.000Z | # Next permutation
def nextPermutation(self, n: int) -> int:
digits = list(str(n))
i, j = len(digits)-2, len(digits)-1
# Find the first digit that is smaller than the digit next to it
while i >= 0 and digits[i] >= digits[i+1]:
i -= 1
# If not found, then all digits are in descending or... | 27.75 | 73 | 0.576577 |
def nextPermutation(self, n: int) -> int:
digits = list(str(n))
i, j = len(digits)-2, len(digits)-1
while i >= 0 and digits[i] >= digits[i+1]:
i -= 1
if i == -1: return -1
while digits[j] <= digits[i]:
j -= 1
digits[i], digits[j] = digits[j], digits[i... | true | true |
f735125479877e8418887aaff7cdd661b3e358a6 | 1,385 | py | Python | awwards/migrations/0002_projects.py | RonaldKiprotich/Awwards-clone | ba5182a174c741c62c621f739653ef964d6d9a95 | [
"MIT"
] | null | null | null | awwards/migrations/0002_projects.py | RonaldKiprotich/Awwards-clone | ba5182a174c741c62c621f739653ef964d6d9a95 | [
"MIT"
] | null | null | null | awwards/migrations/0002_projects.py | RonaldKiprotich/Awwards-clone | ba5182a174c741c62c621f739653ef964d6d9a95 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-28 15:05
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(setting... | 38.472222 | 146 | 0.615884 |
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('awwards', '0001_i... | true | true |
f735140f1db1f3e9d4edfbb49f834603e20cc8dc | 2,097 | py | Python | server/api/socket/room.py | hktrpg/PlanarAlly | ec2db6d53a619a9629e40f1ed755b2ef97f128bd | [
"MIT"
] | null | null | null | server/api/socket/room.py | hktrpg/PlanarAlly | ec2db6d53a619a9629e40f1ed755b2ef97f128bd | [
"MIT"
] | 1 | 2020-11-28T05:00:28.000Z | 2020-11-28T05:00:28.000Z | server/api/socket/room.py | tom-vanbraband-sonarsource/PlanarAlly | 2a0c457148f344d2669f50958bcb7c53a49ee600 | [
"MIT"
] | null | null | null | import uuid
import auth
from api.socket.constants import GAME_NS
from app import app, sio
from models import PlayerRoom
from models.role import Role
from state.game import game_state
from utils import logger
@sio.on("Room.Info.InviteCode.Refresh", namespace=GAME_NS)
@auth.login_required(app, sio)
async def refresh_i... | 28.337838 | 85 | 0.688126 | import uuid
import auth
from api.socket.constants import GAME_NS
from app import app, sio
from models import PlayerRoom
from models.role import Role
from state.game import game_state
from utils import logger
@sio.on("Room.Info.InviteCode.Refresh", namespace=GAME_NS)
@auth.login_required(app, sio)
async def refresh_i... | true | true |
f7351474b7727c1e9c5ecc3ec37ae3ed1a4c6fc3 | 1,003 | py | Python | coral/metrics/rolling.py | coralproject/atoll | 2b62b37d3a320480264c4a0242532aad99c338ec | [
"Apache-2.0"
] | 12 | 2016-01-09T17:47:05.000Z | 2022-02-09T18:09:41.000Z | coral/metrics/rolling.py | coralproject/atoll | 2b62b37d3a320480264c4a0242532aad99c338ec | [
"Apache-2.0"
] | 16 | 2016-01-05T15:49:31.000Z | 2016-08-04T20:59:15.000Z | coral/metrics/rolling.py | coralproject/atoll | 2b62b37d3a320480264c4a0242532aad99c338ec | [
"Apache-2.0"
] | 1 | 2016-04-06T16:00:32.000Z | 2016-04-06T16:00:32.000Z | def extract_history(input):
"""extract the past metrics"""
prev = input['prev']
prev['prev'] = True
return input['_id'], prev
def extract_update(input):
"""extract the update data, from which we compute new metrics"""
update = input['update']
update['_id'] = input['_id']
return update
... | 24.463415 | 68 | 0.582253 | def extract_history(input):
prev = input['prev']
prev['prev'] = True
return input['_id'], prev
def extract_update(input):
update = input['update']
update['_id'] = input['_id']
return update
def rolling_score(d1, d2, alpha=0.5):
if 'prev' in d1 and d1['prev']:
prev, update =... | true | true |
f73516171c98e7efa8128a56815f237e9da700a4 | 358 | py | Python | tag.py | shimayu22/ImageCodeGeneration | 9d9d06349818c9a2f65c31c9c28c454e48fae827 | [
"MIT"
] | null | null | null | tag.py | shimayu22/ImageCodeGeneration | 9d9d06349818c9a2f65c31c9c28c454e48fae827 | [
"MIT"
] | null | null | null | tag.py | shimayu22/ImageCodeGeneration | 9d9d06349818c9a2f65c31c9c28c454e48fae827 | [
"MIT"
] | null | null | null | import pyperclip
while True:
print("input URL(end:n)")
photo_url = input(">> ")
if photo_url == "n":
break
paste_code = "<span itemtype=\"http://schema.org/Photograph\" itemscope=\"itemscope\"><img class=\"magnifiable\" src=\"{}\" itemprop=\"image\"></span>".format(photo_url)
pyperclip.c... | 25.571429 | 173 | 0.634078 | import pyperclip
while True:
print("input URL(end:n)")
photo_url = input(">> ")
if photo_url == "n":
break
paste_code = "<span itemtype=\"http://schema.org/Photograph\" itemscope=\"itemscope\"><img class=\"magnifiable\" src=\"{}\" itemprop=\"image\"></span>".format(photo_url)
pyperclip.c... | true | true |
f7351619d814e5f964a3f9f454c3fbb1599c76d1 | 9,744 | py | Python | tests/__init__.py | murali-chevuri/cachetools | ab9e8af0d506759332a2d1a5ae9d36feae844fda | [
"MIT"
] | null | null | null | tests/__init__.py | murali-chevuri/cachetools | ab9e8af0d506759332a2d1a5ae9d36feae844fda | [
"MIT"
] | null | null | null | tests/__init__.py | murali-chevuri/cachetools | ab9e8af0d506759332a2d1a5ae9d36feae844fda | [
"MIT"
] | null | null | null | import unittest
class CacheTestMixin:
Cache = None
def test_defaults(self):
cache = self.Cache(maxsize=1)
self.assertEqual(0, len(cache))
self.assertEqual(1, cache.maxsize)
self.assertEqual(0, cache.currsize)
self.assertEqual(1, cache.getsizeof(None))
self.ass... | 32.158416 | 74 | 0.589491 | import unittest
class CacheTestMixin:
Cache = None
def test_defaults(self):
cache = self.Cache(maxsize=1)
self.assertEqual(0, len(cache))
self.assertEqual(1, cache.maxsize)
self.assertEqual(0, cache.currsize)
self.assertEqual(1, cache.getsizeof(None))
self.ass... | true | true |
f735177289b7dc8e9e0f4ca915f735688faed056 | 2,039 | py | Python | cpp/src/experiments/generate_csv.py | chathurawidanage/cylon | ac61b7a50880138fe67de21adee208016a94979a | [
"Apache-2.0"
] | null | null | null | cpp/src/experiments/generate_csv.py | chathurawidanage/cylon | ac61b7a50880138fe67de21adee208016a94979a | [
"Apache-2.0"
] | null | null | null | cpp/src/experiments/generate_csv.py | chathurawidanage/cylon | ac61b7a50880138fe67de21adee208016a94979a | [
"Apache-2.0"
] | null | null | null | ##
# 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 the... | 39.980392 | 98 | 0.672388 |
import numpy as np
import pandas as pd
import argparse
parser = argparse.ArgumentParser(description='generate random data')
parser.add_argument('-o', dest='output', type=str, help='output file', default='/tmp/csv.csv')
parser.add_argument('-r', dest='rows', type=int, help='number of rows', default=10)
pars... | true | true |
f73517992385749a8a4ce2a60897e50b2bd2fdc3 | 4,189 | py | Python | bibclean/utils/doi_tools.py | Svdvoort/BibClean | 0d891d0dc0d0b335afdf3a09f4df6103d1e96215 | [
"MIT"
] | null | null | null | bibclean/utils/doi_tools.py | Svdvoort/BibClean | 0d891d0dc0d0b335afdf3a09f4df6103d1e96215 | [
"MIT"
] | 218 | 2020-11-20T08:20:01.000Z | 2022-03-28T19:21:18.000Z | bibclean/utils/doi_tools.py | Svdvoort/BibClean | 0d891d0dc0d0b335afdf3a09f4df6103d1e96215 | [
"MIT"
] | null | null | null | import bibclean.utils.cleaning as cleaner
import bibclean.utils.formatting as formatter
import bibclean.config.constants as constants
from bibtexparser.customization import splitname
from Levenshtein import distance as levenshtein_distance
import requests
from crossref.restful import Works, Etiquette
import bibclean.cr... | 34.056911 | 91 | 0.664598 | import bibclean.utils.cleaning as cleaner
import bibclean.utils.formatting as formatter
import bibclean.config.constants as constants
from bibtexparser.customization import splitname
from Levenshtein import distance as levenshtein_distance
import requests
from crossref.restful import Works, Etiquette
import bibclean.cr... | true | true |
f735181a126708262e7d44866f853497400b4e62 | 5,248 | py | Python | reid/utils/evaluation_metrics/retrieval.py | ZoRoronoa/Camera-Aware-Proxy | 352f900bbae330f18c2bfe2b3f2516fb4e31adea | [
"Apache-2.0"
] | 37 | 2021-02-05T11:49:17.000Z | 2022-03-13T15:42:40.000Z | reid/utils/evaluation_metrics/retrieval.py | ZoRoronoa/Camera-Aware-Proxy | 352f900bbae330f18c2bfe2b3f2516fb4e31adea | [
"Apache-2.0"
] | 7 | 2021-03-30T01:33:40.000Z | 2022-03-24T07:54:33.000Z | reid/utils/evaluation_metrics/retrieval.py | ZoRoronoa/Camera-Aware-Proxy | 352f900bbae330f18c2bfe2b3f2516fb4e31adea | [
"Apache-2.0"
] | 9 | 2021-03-06T02:43:55.000Z | 2022-03-26T07:32:19.000Z | import numpy as np
from sklearn import metrics as sk_metrics
import torch
class PersonReIDMAP:
'''
Compute Rank@k and mean Average Precision (mAP) scores
Used for Person ReID
Test on MarKet and Duke
'''
def __init__(self, query_feature, query_cam, query_label, gallery_feature, gallery_cam, gal... | 34.754967 | 123 | 0.59032 | import numpy as np
from sklearn import metrics as sk_metrics
import torch
class PersonReIDMAP:
def __init__(self, query_feature, query_cam, query_label, gallery_feature, gallery_cam, gallery_label, dist):
self.query_feature = query_feature
self.query_cam = query_cam
self.query_label = que... | true | true |
f7351859a92efdb3f574e5bd14e14d145e99a4c7 | 517 | py | Python | boliau/plugins/gspread/cmd.py | hychen/boliau | 618e4557c7b4a3d97c9926b1d7e691291472ff7c | [
"MIT"
] | 1 | 2020-05-11T21:26:32.000Z | 2020-05-11T21:26:32.000Z | boliau/plugins/gspread/cmd.py | hychen/boliau | 618e4557c7b4a3d97c9926b1d7e691291472ff7c | [
"MIT"
] | null | null | null | boliau/plugins/gspread/cmd.py | hychen/boliau | 618e4557c7b4a3d97c9926b1d7e691291472ff7c | [
"MIT"
] | null | null | null | import sys
import getpass
from boliau import cmdlib
from boliau.plugins.gspread import actionlib
def do_insert():
cmd = cmdlib.as_command(actionlib.Upsert(),
require_stdin=True)
cmd.add_argument('spreadsheet', help="spreadsheet name.")
cmd.add_argument('--email', help = "us... | 32.3125 | 77 | 0.676983 | import sys
import getpass
from boliau import cmdlib
from boliau.plugins.gspread import actionlib
def do_insert():
cmd = cmdlib.as_command(actionlib.Upsert(),
require_stdin=True)
cmd.add_argument('spreadsheet', help="spreadsheet name.")
cmd.add_argument('--email', help = "us... | false | true |
f73518b051d1cc9646ebc5039c4ebb6aa6cbfa1f | 2,550 | py | Python | demo/voice/main.py | fatash89/atom | 12846c8a3f936ae6c83e7e7b1d2dbb896e63fe66 | [
"Apache-2.0"
] | 64 | 2019-04-01T20:32:07.000Z | 2021-11-24T17:12:03.000Z | demo/voice/main.py | elementary-robotics/atom | 36aea078c0e029f03e7b9b4768729a683fb32a88 | [
"Apache-2.0"
] | 291 | 2019-04-01T22:54:31.000Z | 2022-03-31T21:48:47.000Z | demo/voice/main.py | fatash89/atom | 12846c8a3f936ae6c83e7e7b1d2dbb896e63fe66 | [
"Apache-2.0"
] | 5 | 2019-06-27T22:42:54.000Z | 2022-02-01T23:00:37.000Z | # atombot.py
import time
from atom import Element
PUBLISH_FREQUENCY = 100
TIME_FOR_WAVEFORM = 5
if __name__ == "__main__":
element = Element("voice_demo")
# Wait for the record element to start up and launch the VNC.
# this can and should be fixed with a heartbeat!
time.sleep(10)
# Start the... | 30.722892 | 82 | 0.512549 |
import time
from atom import Element
PUBLISH_FREQUENCY = 100
TIME_FOR_WAVEFORM = 5
if __name__ == "__main__":
element = Element("voice_demo")
time.sleep(10)
data = {
"name": "example",
"t": TIME_FOR_WAVEFORM,
"perm": False,
"e": "waveform",
"s": ... | true | true |
f73518eb606b9fa6212405aa5f35e08518d35b0a | 3,468 | py | Python | tests/test_geointerface.py | tfardet/Shapely | 462de3aa7a8bbd80408762a2d5aaf84b04476e4d | [
"BSD-3-Clause"
] | 189 | 2021-12-10T17:43:54.000Z | 2022-03-30T22:03:02.000Z | tests/test_geointerface.py | tfardet/Shapely | 462de3aa7a8bbd80408762a2d5aaf84b04476e4d | [
"BSD-3-Clause"
] | 133 | 2021-12-10T16:28:25.000Z | 2022-03-31T21:22:58.000Z | tests/test_geointerface.py | tfardet/Shapely | 462de3aa7a8bbd80408762a2d5aaf84b04476e4d | [
"BSD-3-Clause"
] | 19 | 2021-12-17T14:42:17.000Z | 2022-03-15T08:25:02.000Z | from . import unittest, shapely20_deprecated
import pytest
from shapely.geometry import shape
from shapely.geometry.multipoint import MultiPoint
from shapely.geometry.linestring import LineString
from shapely.geometry.multilinestring import MultiLineString
from shapely.geometry.polygon import LinearRing, Polygon
from... | 34.68 | 79 | 0.542388 | from . import unittest, shapely20_deprecated
import pytest
from shapely.geometry import shape
from shapely.geometry.multipoint import MultiPoint
from shapely.geometry.linestring import LineString
from shapely.geometry.multilinestring import MultiLineString
from shapely.geometry.polygon import LinearRing, Polygon
from... | true | true |
f7351a8ea86926ad65c06a83f4fd64019da7bcb8 | 1,300 | py | Python | stackhpc_monasca_agent_plugins/detection/nvidia.py | stackhpc/monasca-agent-plugins | 55687c0337e060d67feb76497d943842f720efb2 | [
"Apache-2.0"
] | 2 | 2018-08-16T12:37:37.000Z | 2021-03-02T13:59:57.000Z | stackhpc_monasca_agent_plugins/detection/nvidia.py | stackhpc/monasca-agent-plugins | 55687c0337e060d67feb76497d943842f720efb2 | [
"Apache-2.0"
] | 9 | 2018-01-05T13:57:22.000Z | 2021-09-11T04:32:24.000Z | stackhpc_monasca_agent_plugins/detection/nvidia.py | stackhpc/monasca-agent-plugins | 55687c0337e060d67feb76497d943842f720efb2 | [
"Apache-2.0"
] | 3 | 2020-06-17T16:05:10.000Z | 2021-09-15T14:28:36.000Z | # Copyright (c) 2018 StackHPC Ltd.
#
# 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 wr... | 31.707317 | 75 | 0.686154 |
import logging
import subprocess
import monasca_setup.agent_config
import monasca_setup.detection
LOG = logging.getLogger(__name__)
class NvidiaDetect(monasca_setup.detection.Plugin):
def _detect(self):
self.available = False
if 'nvidia' not in subprocess.check_output(
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.