hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
542ed650cd51d1be301e72556d0e3aecf6a5572b | 2,711 | py | Python | tests/test_wsgisubdomain.py | xsleonard/wsgisubdomain | 394c705a9e39cf4e4e1af2551ed0ed79d2c070f3 | [
"MIT"
] | 2 | 2016-06-15T09:31:20.000Z | 2016-06-20T11:43:01.000Z | tests/test_wsgisubdomain.py | xsleonard/wsgisubdomain | 394c705a9e39cf4e4e1af2551ed0ed79d2c070f3 | [
"MIT"
] | null | null | null | tests/test_wsgisubdomain.py | xsleonard/wsgisubdomain | 394c705a9e39cf4e4e1af2551ed0ed79d2c070f3 | [
"MIT"
] | null | null | null | from unittest import TestCase
from wsgisubdomain import SubdomainDispatcher
| 37.136986 | 79 | 0.620435 | from unittest import TestCase
from wsgisubdomain import SubdomainDispatcher
class TestSubdomainDispatcher(TestCase):
def assertIs(self, a, b):
try:
super(TestSubdomainDispatcher, self).assertIs(a, b)
except AttributeError:
# python 2.6 support
self.assertTrue(a... | 2,385 | 226 | 23 |
5575aa3a08f72b6233406337d9b98d6034623d01 | 26,482 | py | Python | tests/unit_tests/test_set_dropin.py | realead/cykhash | b1a45843c3be49cd232d3c78315d2291a830284f | [
"MIT"
] | 18 | 2019-03-13T08:20:06.000Z | 2021-06-22T08:03:01.000Z | tests/unit_tests/test_set_dropin.py | realead/cykhash | b1a45843c3be49cd232d3c78315d2291a830284f | [
"MIT"
] | 6 | 2020-04-13T10:11:45.000Z | 2021-11-14T15:59:55.000Z | tests/unit_tests/test_set_dropin.py | realead/cykhash | b1a45843c3be49cd232d3c78315d2291a830284f | [
"MIT"
] | 7 | 2019-05-19T22:24:57.000Z | 2020-08-26T23:01:23.000Z | import pytest
from unittestmock import UnitTestMock
from cykhash import Int64Set, Int32Set, Float64Set, Float32Set, PyObjectSet
import cykhash
SUFFIX={Int64Set : "int64",
Int32Set : "int32",
Float64Set : "float64",
Float32Set : "float32",
PyObjectSet : "pyobject"}
@pyte... | 32.099394 | 85 | 0.601088 | import pytest
from unittestmock import UnitTestMock
from cykhash import Int64Set, Int32Set, Float64Set, Float32Set, PyObjectSet
import cykhash
SUFFIX={Int64Set : "int64",
Int32Set : "int32",
Float64Set : "float64",
Float32Set : "float32",
PyObjectSet : "pyobject"}
def pick_fun... | 22,305 | 125 | 2,763 |
a1fba859af22a9a1b8fc1410806c26c08f872a7f | 6,478 | py | Python | lib/airflow/tests/contrib/jobs/test_dag_trigger.py | ideax-business/ai-flow | 0a7797a093beddf827f68cad7a11e0babf1b5059 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | lib/airflow/tests/contrib/jobs/test_dag_trigger.py | ideax-business/ai-flow | 0a7797a093beddf827f68cad7a11e0babf1b5059 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | lib/airflow/tests/contrib/jobs/test_dag_trigger.py | ideax-business/ai-flow | 0a7797a093beddf827f68cad7a11e0babf1b5059 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 42.064935 | 113 | 0.706082 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 4,286 | 253 | 23 |
db967d18b0150b9b46f807e4175b670ec1cd835a | 1,063 | py | Python | tests/test_model_registry.py | murthyn/composer | 2a04cf387dd8558556500f7ef2bc6d3d131043d5 | [
"Apache-2.0"
] | null | null | null | tests/test_model_registry.py | murthyn/composer | 2a04cf387dd8558556500f7ef2bc6d3d131043d5 | [
"Apache-2.0"
] | null | null | null | tests/test_model_registry.py | murthyn/composer | 2a04cf387dd8558556500f7ef2bc6d3d131043d5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MosaicML. All Rights Reserved.
import pytest
from composer.models import ModelHparams
from composer.trainer.trainer_hparams import model_registry
@pytest.mark.parametrize("model_name", model_registry.keys())
| 26.575 | 61 | 0.686736 | # Copyright 2021 MosaicML. All Rights Reserved.
import pytest
from composer.models import ModelHparams
from composer.trainer.trainer_hparams import model_registry
@pytest.mark.parametrize("model_name", model_registry.keys())
def test_model_registry(model_name, request):
if model_name in ['timm']:
pytest... | 812 | 0 | 22 |
f0d8e904d213c2024920577bec459677043c4496 | 1,490 | py | Python | hardhat/recipes/poppler.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/poppler.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/poppler.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | from .base import GnuRecipe
| 32.391304 | 75 | 0.502013 | from .base import GnuRecipe
class Extra:
pass
class PopplerRecipe(GnuRecipe):
def __init__(self, *args, **kwargs):
super(PopplerRecipe, self).__init__(*args, **kwargs)
self.sha256 = '420abaab63caed9e1ee28964a0ba216d' \
'1979506726164bc99ad5ade289192a1b'
self.na... | 1,351 | 10 | 99 |
6d2e3d350112bf5ba43f5eeb7294864da2a45653 | 1,290 | py | Python | src/lab2rgb.py | ytyaru/Python.ColorSpace.Converter.20210606081641 | 7cd88aa12eb23ac26785ad1bff3a3e8034947c65 | [
"CC0-1.0"
] | null | null | null | src/lab2rgb.py | ytyaru/Python.ColorSpace.Converter.20210606081641 | 7cd88aa12eb23ac26785ad1bff3a3e8034947c65 | [
"CC0-1.0"
] | null | null | null | src/lab2rgb.py | ytyaru/Python.ColorSpace.Converter.20210606081641 | 7cd88aa12eb23ac26785ad1bff3a3e8034947c65 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf8
from labconstants import LabConstants
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description='色空間を変換する。Lab->RGB', formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('lab', help="色。カンマ区切りで渡す。\n 0.0 <= l <= 100.0\n -86.1... | 33.076923 | 134 | 0.589147 | #!/usr/bin/env python3
# coding: utf8
from labconstants import LabConstants
def lab2rgb(lab):
import math
l, a, b = lab
y = (l + 16) / 116
x = y if math.isnan(a) else y + a / 500
z = y if math.isnan(b) else y - b / 200
y = LabConstants.Yn * lab_xyz(y)
x = LabConstants.Xn * lab_xyz(x)
z... | 642 | 0 | 68 |
0300076d66cbcef4d8deb5912fdfdb704586b6be | 23,969 | py | Python | app/model.py | Princessgladys/googleresourcefinder | 7715276b3c588f7c457de04944559052c8170f7e | [
"Apache-2.0"
] | null | null | null | app/model.py | Princessgladys/googleresourcefinder | 7715276b3c588f7c457de04944559052c8170f7e | [
"Apache-2.0"
] | null | null | null | app/model.py | Princessgladys/googleresourcefinder | 7715276b3c588f7c457de04944559052c8170f7e | [
"Apache-2.0"
] | null | null | null | # Copyright 2009-2010 by Ka-Ping Yee
#
# 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 w... | 49.217659 | 80 | 0.683925 | # Copyright 2009-2010 by Ka-Ping Yee
#
# 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 w... | 455 | 0 | 130 |
d9b6dacb47bb3bb1903c75fd6a311e2b090af877 | 12,452 | py | Python | rllib/policy/torch_policy.py | brechtmann/ray | 0c76ebd676f794847ea990aecced22b88717d09e | [
"Apache-2.0"
] | null | null | null | rllib/policy/torch_policy.py | brechtmann/ray | 0c76ebd676f794847ea990aecced22b88717d09e | [
"Apache-2.0"
] | null | null | null | rllib/policy/torch_policy.py | brechtmann/ray | 0c76ebd676f794847ea990aecced22b88717d09e | [
"Apache-2.0"
] | null | null | null | import numpy as np
import time
from ray.rllib.policy.policy import Policy, LEARNER_STATS_KEY, ACTION_PROB, \
ACTION_LOGP
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.utils.annotations import override, DeveloperAPI
from ray.rllib.utils.framework import try_import_torch
from ray.rllib.utils.s... | 37.963415 | 79 | 0.608336 | import numpy as np
import time
from ray.rllib.policy.policy import Policy, LEARNER_STATS_KEY, ACTION_PROB, \
ACTION_LOGP
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.utils.annotations import override, DeveloperAPI
from ray.rllib.utils.framework import try_import_torch
from ray.rllib.utils.s... | 7,402 | 0 | 444 |
3788688439f869905b054a77ecac95a103f926f6 | 1,297 | py | Python | sshd_telegram_alert/__main__.py | nanih98/sshd-telegram-alert | 7f5adb662658bcf3dc9020113f6133b1184a971b | [
"MIT"
] | null | null | null | sshd_telegram_alert/__main__.py | nanih98/sshd-telegram-alert | 7f5adb662658bcf3dc9020113f6133b1184a971b | [
"MIT"
] | null | null | null | sshd_telegram_alert/__main__.py | nanih98/sshd-telegram-alert | 7f5adb662658bcf3dc9020113f6133b1184a971b | [
"MIT"
] | null | null | null | import os
from .parser import parse_args
from .logger import Logger
from .configuration import Configuration
from .requester import Requester
import platform
def main() -> None:
"""Main function where the program start"""
args = parse_args()
config_path = check_os_path()
log = Logger(debug_flag=Tru... | 25.94 | 86 | 0.656901 | import os
from .parser import parse_args
from .logger import Logger
from .configuration import Configuration
from .requester import Requester
import platform
def check_os_path():
if platform.system() == "Darwin":
print(os.path.join(os.environ.get('HOME'),
".sshd-telegram-credentials.json"))
... | 293 | 0 | 23 |
5444b2b64f6468f6af4c6c70f4231a23dad1d247 | 4,773 | py | Python | bans/database/db_bans.py | examknow/bans | 2a405788770090e552e605e00e70cfb2cf910ac1 | [
"MIT"
] | null | null | null | bans/database/db_bans.py | examknow/bans | 2a405788770090e552e605e00e70cfb2cf910ac1 | [
"MIT"
] | null | null | null | bans/database/db_bans.py | examknow/bans | 2a405788770090e552e605e00e70cfb2cf910ac1 | [
"MIT"
] | null | null | null | from aiosqlite import connect as db_connect
from time import time
from typing import List, Optional
from dataclasses import dataclass
from .common import DBTable
@dataclass
| 30.208861 | 100 | 0.503247 | from aiosqlite import connect as db_connect
from time import time
from typing import List, Optional
from dataclasses import dataclass
from .common import DBTable
@dataclass
class DBBan(object):
id: int
channelid: int
setter: str
mode: str
ts: int
mask: Optional[int]
expiry:... | 4,035 | 206 | 341 |
077847e78c05efc885c4770c62e1e3d7fa340596 | 6,461 | py | Python | azure-mgmt-search/azure/mgmt/search/models/search_service.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-search/azure/mgmt/search/models/search_service.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-search/azure/mgmt/search/models/search_service.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.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 ... | 52.959016 | 99 | 0.67358 | # 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 ... | 396 | 0 | 27 |
a50e62be14975592aef74c3fa5ad879365e37cfa | 1,893 | py | Python | Prediction.py | sarthak25/Google-Stock-Price-Prediction | 017f78b20def5ca5a3e2727051bcbc735b9dc33c | [
"MIT"
] | 1 | 2021-07-04T12:09:35.000Z | 2021-07-04T12:09:35.000Z | Prediction.py | sarthak25/Google-Stock-Price-Prediction | 017f78b20def5ca5a3e2727051bcbc735b9dc33c | [
"MIT"
] | null | null | null | Prediction.py | sarthak25/Google-Stock-Price-Prediction | 017f78b20def5ca5a3e2727051bcbc735b9dc33c | [
"MIT"
] | 1 | 2020-11-16T18:31:57.000Z | 2020-11-16T18:31:57.000Z | # A PREDICTIVE MODEL FOR GOOGLE STOCK PRICES USING LINEAR REGRESSION
# IMPORTING ALL THE MODULES
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
# READING THE DATASET AND VISUALIZING A FEW ENTRIES
dt=pd.read_csv... | 27.042857 | 69 | 0.725304 | # A PREDICTIVE MODEL FOR GOOGLE STOCK PRICES USING LINEAR REGRESSION
# IMPORTING ALL THE MODULES
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
# READING THE DATASET AND VISUALIZING A FEW ENTRIES
dt=pd.read_csv... | 0 | 0 | 0 |
f95e1333ac543570c7afc2700e11021923f0fd0f | 579 | py | Python | torchtools/test.py | Takezo87/torchtools | 4230305d9063dabee3614f0dcd8557739b90f817 | [
"Apache-2.0"
] | null | null | null | torchtools/test.py | Takezo87/torchtools | 4230305d9063dabee3614f0dcd8557739b90f817 | [
"Apache-2.0"
] | 1 | 2022-02-26T06:23:52.000Z | 2022-02-26T06:23:52.000Z | torchtools/test.py | Takezo87/torchtools | 4230305d9063dabee3614f0dcd8557739b90f817 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 100_test.ipynb (unless otherwise specified).
__all__ = ['items_to_arrays']
# Cell
from .core import *
from .data import *
from .models import *
from .datasets import *
from .augmentations import *
from .datablock import *
from .dataloader import *
# Cell
def items_to_array... | 32.166667 | 91 | 0.704663 | # AUTOGENERATED! DO NOT EDIT! File to edit: 100_test.ipynb (unless otherwise specified).
__all__ = ['items_to_arrays']
# Cell
from .core import *
from .data import *
from .models import *
from .datasets import *
from .augmentations import *
from .datablock import *
from .dataloader import *
# Cell
def items_to_array... | 0 | 0 | 0 |
13d97300471566ef042dc75cbe53f61f814fbf4a | 28,681 | py | Python | sopel/tools/__init__.py | cottongin/sopel | 54e42747959d86ddc1ba40bc02098cb3ab7d9439 | [
"EFL-2.0"
] | null | null | null | sopel/tools/__init__.py | cottongin/sopel | 54e42747959d86ddc1ba40bc02098cb3ab7d9439 | [
"EFL-2.0"
] | null | null | null | sopel/tools/__init__.py | cottongin/sopel | 54e42747959d86ddc1ba40bc02098cb3ab7d9439 | [
"EFL-2.0"
] | null | null | null | # coding=utf-8
"""Useful miscellaneous tools and shortcuts for Sopel plugins
*Availability: 3+*
"""
# tools.py - Sopel misc tools
# Copyright 2008, Sean B. Palmer, inamidst.com
# Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
# Copyright 2012, Elsie Powell, embolalia.com
# Licensed under the Eiffel Forum Lic... | 34.103448 | 87 | 0.62055 | # coding=utf-8
"""Useful miscellaneous tools and shortcuts for Sopel plugins
*Availability: 3+*
"""
# tools.py - Sopel misc tools
# Copyright 2008, Sean B. Palmer, inamidst.com
# Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
# Copyright 2012, Elsie Powell, embolalia.com
# Licensed under the Eiffel Forum Lic... | 2,488 | 0 | 532 |
22713b1b406683d4ed6ad898aa63ba71a1a28ac4 | 3,520 | py | Python | oracle-runs.py | fair-trec/trec2021-fair-public | d9f16bd7d70c350fa6e5906fac36c4f1af837573 | [
"MIT"
] | 3 | 2021-07-28T09:10:48.000Z | 2022-03-23T15:08:48.000Z | oracle-runs.py | fair-trec/trec2021-fair-public | d9f16bd7d70c350fa6e5906fac36c4f1af837573 | [
"MIT"
] | null | null | null | oracle-runs.py | fair-trec/trec2021-fair-public | d9f16bd7d70c350fa6e5906fac36c4f1af837573 | [
"MIT"
] | null | null | null | """
Produce TREC fair ranking runs from an oracle.
This script assumes the data lives in a directory 'data'. It loads the training
topics and uses them as an oracle for producing rankings.
Usage:
oracle-runs.py --task1 [options]
oracle-runs.py --task2 [options]
Options:
-v, --verbose
Write verbo... | 27.716535 | 95 | 0.641477 | """
Produce TREC fair ranking runs from an oracle.
This script assumes the data lives in a directory 'data'. It loads the training
topics and uses them as an oracle for producing rankings.
Usage:
oracle-runs.py --task1 [options]
oracle-runs.py --task2 [options]
Options:
-v, --verbose
Write verbo... | 2,641 | 0 | 138 |
4b44ab6318cc359b020659d482e8f114bcd8d62d | 6,394 | py | Python | scan_list.py | jeremyng123/cobaltstrike | 51a67ec918904d8a3b7ea07ab62a10b58183eb8f | [
"MIT"
] | 193 | 2020-12-21T03:20:27.000Z | 2022-02-28T11:11:08.000Z | scan_list.py | jeremyng123/cobaltstrike | 51a67ec918904d8a3b7ea07ab62a10b58183eb8f | [
"MIT"
] | 4 | 2021-01-09T11:27:57.000Z | 2021-12-06T13:38:17.000Z | scan_list.py | jeremyng123/cobaltstrike | 51a67ec918904d8a3b7ea07ab62a10b58183eb8f | [
"MIT"
] | 54 | 2020-12-20T20:24:54.000Z | 2022-02-28T11:11:09.000Z | import argparse
import csv
import requests
import urllib3
from urllib.parse import urljoin
from lib import decrypt_beacon, decode_config, JsonEncoder
import multiprocessing
from functools import partial
import datetime
import pandas as pd
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='... | 43.202703 | 174 | 0.542853 | import argparse
import csv
import requests
import urllib3
from urllib.parse import urljoin
from lib import decrypt_beacon, decode_config, JsonEncoder
import multiprocessing
from functools import partial
import datetime
import pandas as pd
def mp_worker( BITS, PORT, HTTP,output_list, host ):
print("Checking {}".fo... | 3,961 | 0 | 46 |
30ce9806dbf6f7dbafe0f568c2b2657bff6791b5 | 9,140 | py | Python | ar-cnn/utils/midi_utils.py | carniblood/aws-deepcomposer-retrogame | 6876eedd2a128362baff4daace73ee4f254676c3 | [
"MIT-0"
] | null | null | null | ar-cnn/utils/midi_utils.py | carniblood/aws-deepcomposer-retrogame | 6876eedd2a128362baff4daace73ee4f254676c3 | [
"MIT-0"
] | null | null | null | ar-cnn/utils/midi_utils.py | carniblood/aws-deepcomposer-retrogame | 6876eedd2a128362baff4daace73ee4f254676c3 | [
"MIT-0"
] | null | null | null | # The MIT-Zero License
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | 42.511628 | 101 | 0.659956 | # The MIT-Zero License
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | 1,093 | 0 | 23 |
958a3b3c3c8bbbf71fdafc826be947de6c1e562c | 2,740 | py | Python | core/constraints/__init__.py | AluBhorta/UCSPy-Engine | 917eea6ab98338c5763c9fd07e24da7fa2ee1cda | [
"MIT"
] | 6 | 2021-09-29T06:18:55.000Z | 2021-09-29T18:56:13.000Z | core/constraints/__init__.py | AluBhorta/UCSPy-Engine | 917eea6ab98338c5763c9fd07e24da7fa2ee1cda | [
"MIT"
] | 1 | 2021-10-01T00:00:15.000Z | 2021-10-01T00:14:24.000Z | core/constraints/__init__.py | AluBhorta/UCSPy-Engine | 917eea6ab98338c5763c9fd07e24da7fa2ee1cda | [
"MIT"
] | 3 | 2020-06-26T05:59:56.000Z | 2021-09-29T06:25:23.000Z |
from core.constraints.hard.hard_constraint_1 import violates_hard_constraint_1
from core.constraints.hard.hard_constraint_2 import violates_hard_constraint_2
from core.constraints.soft.soft_constraint_1 import penalty_of_soft_constraint_1
from core.constraints.soft.soft_constraint_2 import penalty_of_soft_constraint_... | 44.193548 | 143 | 0.712409 |
from core.constraints.hard.hard_constraint_1 import violates_hard_constraint_1
from core.constraints.hard.hard_constraint_2 import violates_hard_constraint_2
from core.constraints.soft.soft_constraint_1 import penalty_of_soft_constraint_1
from core.constraints.soft.soft_constraint_2 import penalty_of_soft_constraint_... | 0 | 0 | 0 |
b38add5b43c8c288b94da71185957d3fc3fad700 | 963 | py | Python | extras/scripts/convert_pronto_codes.py | aneisch/home-assistant | d8a866d75f512d23ffa7b9e5d82d7c575ece3c76 | [
"Apache-2.0"
] | 18 | 2016-08-10T01:02:27.000Z | 2017-10-26T04:19:49.000Z | extras/scripts/convert_pronto_codes.py | aneisch/home-assistant | d8a866d75f512d23ffa7b9e5d82d7c575ece3c76 | [
"Apache-2.0"
] | null | null | null | extras/scripts/convert_pronto_codes.py | aneisch/home-assistant | d8a866d75f512d23ffa7b9e5d82d7c575ece3c76 | [
"Apache-2.0"
] | 4 | 2017-04-20T19:41:21.000Z | 2017-05-16T17:10:05.000Z | #!/usr/bin/env python
# Provide code as arg: ./whatever.py "0000 ... ..."
import binascii
import struct
if __name__ == '__main__':
import sys
for code in sys.argv[1:]:
pronto = bytearray.fromhex(code)
pulses = pronto2lirc(pronto)
output = ""
count = 0
for pulse in ... | 27.514286 | 90 | 0.554517 | #!/usr/bin/env python
# Provide code as arg: ./whatever.py "0000 ... ..."
import binascii
import struct
def pronto2lirc(pronto):
codes = [long(binascii.hexlify(pronto[i:i+2]), 16) for i in xrange(0, len(pronto), 2)]
if codes[0]:
raise ValueError('Pronto code should start with 0000')
if len(code... | 413 | 0 | 23 |
43dab3bbe7439e488e44d82a67a8a105d29e8e3d | 7,328 | py | Python | models/losses.py | yueyu-stu/EdgeAwareSpixel | f7f9fcb15bfa8e31bd4ad9473f9058c44a8391d7 | [
"MIT"
] | null | null | null | models/losses.py | yueyu-stu/EdgeAwareSpixel | f7f9fcb15bfa8e31bd4ad9473f9058c44a8391d7 | [
"MIT"
] | null | null | null | models/losses.py | yueyu-stu/EdgeAwareSpixel | f7f9fcb15bfa8e31bd4ad9473f9058c44a8391d7 | [
"MIT"
] | null | null | null | import torch
from torch import nn
class MutualInfoLoss(nn.Module):
"""
Mutual Information Loss derived from ss-with-RIM that also applied in
this work.
First term enforces to generate a sparse nSpixel dimension vector for
each pixel; Second term indicates the cardinality o... | 37.387755 | 83 | 0.553357 | import torch
from torch import nn
class MutualInfoLoss(nn.Module):
"""
Mutual Information Loss derived from ss-with-RIM that also applied in
this work.
First term enforces to generate a sparse nSpixel dimension vector for
each pixel; Second term indicates the cardinality o... | 3,197 | 0 | 319 |
2585b1efefd1186d26a369a8a60b9ee6612d3e1c | 1,302 | py | Python | cards/turret.py | MrCoft/EngiMod | 65c90bd9231ac388d8af7849a1835914f1eefc78 | [
"MIT"
] | null | null | null | cards/turret.py | MrCoft/EngiMod | 65c90bd9231ac388d8af7849a1835914f1eefc78 | [
"MIT"
] | null | null | null | cards/turret.py | MrCoft/EngiMod | 65c90bd9231ac388d8af7849a1835914f1eefc78 | [
"MIT"
] | null | null | null | from engi_mod import *
Card(
name = "Turret",
type = "power",
target = "self",
rarity = "uncommon",
cost = 1,
const = dict(
DAMAGE = 6,
DAMAGE_UPGRADE = 3,
MAGIC_NUMBER = "DAMAGE",
),
desc = "At the end of your turn, deal !M! damage to a random enemy.",
upgra... | 28.933333 | 123 | 0.554531 | from engi_mod import *
Card(
name = "Turret",
type = "power",
target = "self",
rarity = "uncommon",
cost = 1,
const = dict(
DAMAGE = 6,
DAMAGE_UPGRADE = 3,
MAGIC_NUMBER = "DAMAGE",
),
desc = "At the end of your turn, deal !M! damage to a random enemy.",
upgra... | 0 | 0 | 0 |
d31cdcc12511cabf5ac61c6151db8886c0888504 | 494 | py | Python | 0x0F-python-object_relational_mapping/model_city.py | C-distin/alx-higher_level_programming | ee018135b24ac07d40f2309a4febf21b8a25aee4 | [
"MIT"
] | null | null | null | 0x0F-python-object_relational_mapping/model_city.py | C-distin/alx-higher_level_programming | ee018135b24ac07d40f2309a4febf21b8a25aee4 | [
"MIT"
] | null | null | null | 0x0F-python-object_relational_mapping/model_city.py | C-distin/alx-higher_level_programming | ee018135b24ac07d40f2309a4febf21b8a25aee4 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Define a class City that inherits from Base
"""
from sqlalchemy import Column, Integer, String, ForeignKey
from model_state import Base
class City(Base):
"""
A class City that inherits from Base
"""
__tablename__ = "cities"
id = Column(Integer, primary_key=True, nullable=F... | 24.7 | 71 | 0.686235 | #!/usr/bin/python3
"""
Define a class City that inherits from Base
"""
from sqlalchemy import Column, Integer, String, ForeignKey
from model_state import Base
class City(Base):
"""
A class City that inherits from Base
"""
__tablename__ = "cities"
id = Column(Integer, primary_key=True, nullable=F... | 0 | 0 | 0 |
86d16852ee15057e22545a2d7257027440ff9f5d | 2,857 | py | Python | static_grouper/templatetags/static_grouper.py | adrienlachaize/dezede | 584ec30cedab95152e2f95595b7691a04e6736e2 | [
"BSD-3-Clause"
] | 15 | 2015-02-10T21:16:31.000Z | 2021-03-25T16:46:20.000Z | static_grouper/templatetags/static_grouper.py | adrienlachaize/dezede | 584ec30cedab95152e2f95595b7691a04e6736e2 | [
"BSD-3-Clause"
] | 4 | 2021-02-10T15:42:08.000Z | 2022-03-11T23:20:38.000Z | static_grouper/templatetags/static_grouper.py | adrienlachaize/dezede | 584ec30cedab95152e2f95595b7691a04e6736e2 | [
"BSD-3-Clause"
] | 6 | 2016-07-10T14:20:48.000Z | 2022-01-19T18:34:02.000Z | from collections import defaultdict
from compressor.templatetags.compress import CompressorNode
from django.template import (
Library, Node, Template, TemplateSyntaxError, Context)
register = Library()
CONTEXT_VARIABLE_NAME = 'static_grouper_dict'
register.tag('addstatic', AddStaticNode)
register.tag('stati... | 32.465909 | 83 | 0.621281 | from collections import defaultdict
from compressor.templatetags.compress import CompressorNode
from django.template import (
Library, Node, Template, TemplateSyntaxError, Context)
register = Library()
CONTEXT_VARIABLE_NAME = 'static_grouper_dict'
class AddStaticNode(Node):
def __init__(self, parser, toke... | 2,322 | 11 | 179 |
b9d69527abbd1d87104316935718861ead22d02c | 549 | py | Python | solfasol/issues/migrations/0009_auto_20200918_0020.py | rekognize/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | null | null | null | solfasol/issues/migrations/0009_auto_20200918_0020.py | rekognize/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | 1 | 2020-06-18T13:08:47.000Z | 2020-06-18T13:08:47.000Z | solfasol/issues/migrations/0009_auto_20200918_0020.py | Solfasol/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-17 21:20
from django.db import migrations, models
| 23.869565 | 109 | 0.591985 | # Generated by Django 3.1.1 on 2020-09-17 21:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('issues', '0008_auto_20200918_0006'),
]
operations = [
migrations.RemoveField(
model_name='issue',
name='file_data',
... | 0 | 435 | 23 |
c7e38cb251d253e29429b6f992fbff071d6adf2c | 627 | py | Python | osm_austria_building_coverage/urls.py | thomaskonrad/osm_austria_building_coverage | 3f678837b6800adfdd165f9b8424d1a258ca63de | [
"MIT"
] | 2 | 2015-06-21T19:39:05.000Z | 2015-06-22T10:54:17.000Z | osm_austria_building_coverage/urls.py | thomaskonrad/osm-austria-building-coverage | 3f678837b6800adfdd165f9b8424d1a258ca63de | [
"MIT"
] | 2 | 2018-02-17T16:51:06.000Z | 2018-02-23T07:11:13.000Z | osm_austria_building_coverage/urls.py | thomaskonrad/osm_austria_building_coverage | 3f678837b6800adfdd165f9b8424d1a258ca63de | [
"MIT"
] | 3 | 2019-10-16T08:46:13.000Z | 2021-04-14T23:49:07.000Z | from django.conf.urls import url
from coverage_score_viewer.views import index, states, districts, municipalities, details, search, coverage_chart
from map.views import map
urlpatterns = [
url(r'^$', index, name='index'),
url(r'^states/$', states, name='states'),
url(r'^districts/$', districts, name='dist... | 33 | 113 | 0.673046 | from django.conf.urls import url
from coverage_score_viewer.views import index, states, districts, municipalities, details, search, coverage_chart
from map.views import map
urlpatterns = [
url(r'^$', index, name='index'),
url(r'^states/$', states, name='states'),
url(r'^districts/$', districts, name='dist... | 0 | 0 | 0 |
3cc7f8fa749c9cf61233fe046871543a9e762b27 | 672 | py | Python | PythonApps/hanoi_tower.py | zactsiap/SB4-sample | b9a70d267db3a330170a5cd6aa2c0bf37bfdd5d2 | [
"MIT"
] | 1 | 2018-03-28T08:55:10.000Z | 2018-03-28T08:55:10.000Z | PythonApps/hanoi_tower.py | zactsiap/Python | b9a70d267db3a330170a5cd6aa2c0bf37bfdd5d2 | [
"MIT"
] | null | null | null | PythonApps/hanoi_tower.py | zactsiap/Python | b9a70d267db3a330170a5cd6aa2c0bf37bfdd5d2 | [
"MIT"
] | null | null | null | #Hanoi tower
import time
diskNumber = 1
while diskNumber != 0:
print("============================")
diskNumber = input("Give how many disk you have.\nGive 0 to end.\n============================\n")
print("============================")
diskNumber=int(diskNumber)
moveTower(diskNumber,"A... | 28 | 103 | 0.552083 | #Hanoi tower
import time
def moveTower(height,fromPole, toPole, withPole):
if height >= 1:
moveTower(height-1,fromPole,withPole,toPole)
moveDisk(fromPole,toPole)
moveTower(height-1,withPole,toPole,fromPole)
def moveDisk(fp,tp):
print("Moving disk from",fp,"to",tp)
... | 233 | 0 | 58 |
0c47d0dab31b2f5af3dda0da867f4d530e0f3323 | 8,665 | py | Python | build/lib/Pythactyl/client.py | IAmGadget/Pythactyl | b0cca838d434e8ceba1a90328708b9cde3d9fbcc | [
"MIT"
] | 2 | 2021-07-13T21:43:44.000Z | 2021-09-06T08:05:35.000Z | build/lib/Pythactyl/client.py | IAmGadget/Pythactyl | b0cca838d434e8ceba1a90328708b9cde3d9fbcc | [
"MIT"
] | 1 | 2021-09-11T16:08:43.000Z | 2021-10-30T16:10:56.000Z | build/lib/Pythactyl/client.py | IAmGadget/Pythactyl | b0cca838d434e8ceba1a90328708b9cde3d9fbcc | [
"MIT"
] | null | null | null | import requests
from errors import PermissionsMissing
# Servers
# Subusers
if __name__ == "__main__":
print("I dont run. No use in trying to make me lol")
| 36.716102 | 130 | 0.552222 | import requests
from errors import PermissionsMissing
class PterodactylClient(object):
def __init__(self, url, api_key):
self.url = url + "/api/client"
self.api_key = api_key
def account(self):
headers = {
"Authorization": "Bearer {}".format(self.api_key),
"Acce... | 7,888 | 11 | 588 |
2958aa609c7322fec1b8dd23a67c95f349cb1219 | 1,110 | py | Python | terse/Grammar/Command_Assign.py | talipovm/Terse | e6bfd3ac0d411b18d5167019623d5451695e787c | [
"MIT"
] | 2 | 2015-04-08T21:28:35.000Z | 2015-04-08T23:25:04.000Z | terse/Grammar/Command_Assign.py | talipovm/Terse | e6bfd3ac0d411b18d5167019623d5451695e787c | [
"MIT"
] | null | null | null | terse/Grammar/Command_Assign.py | talipovm/Terse | e6bfd3ac0d411b18d5167019623d5451695e787c | [
"MIT"
] | 1 | 2015-04-08T21:29:22.000Z | 2015-04-08T21:29:22.000Z | from Containers.ParsedStructure import ParsedElement
from Tools.misc import strip_all
from Grammar.Top_Grammar import Top_Grammar
from Grammar.Functions import ExpressionFactory
import logging
log = logging.getLogger(__name__) | 32.647059 | 101 | 0.667568 | from Containers.ParsedStructure import ParsedElement
from Tools.misc import strip_all
from Grammar.Top_Grammar import Top_Grammar
from Grammar.Functions import ExpressionFactory
import logging
log = logging.getLogger(__name__)
class Command_Assign(Top_Grammar):
def __init__(self, GI, FI, parsed_container, trouble... | 794 | 13 | 76 |
2543280c31c85783d24075e8fcbb3059c3236aa9 | 136 | py | Python | minos/aggregate/models/diffs/__init__.py | Clariteia/minos_microservice_aggregate | 517db2f1abb11f5a8f2d77da76613061590ee5a7 | [
"MIT"
] | 3 | 2021-11-05T08:47:45.000Z | 2021-11-17T09:37:26.000Z | minos/aggregate/models/diffs/__init__.py | Clariteia/minos_microservice_aggregate | 517db2f1abb11f5a8f2d77da76613061590ee5a7 | [
"MIT"
] | 30 | 2021-11-05T08:49:28.000Z | 2022-01-28T12:00:56.000Z | minos/aggregate/models/diffs/__init__.py | Clariteia/minos_microservice_aggregate | 517db2f1abb11f5a8f2d77da76613061590ee5a7 | [
"MIT"
] | null | null | null | from .aggregates import (
AggregateDiff,
)
from .fields import (
FieldDiff,
FieldDiffContainer,
IncrementalFieldDiff,
)
| 15.111111 | 25 | 0.705882 | from .aggregates import (
AggregateDiff,
)
from .fields import (
FieldDiff,
FieldDiffContainer,
IncrementalFieldDiff,
)
| 0 | 0 | 0 |
54e7f05eb53e54dca85ec1cb19c90651ae041cb3 | 2,596 | py | Python | app/api/schema/image_sizes.py | akashtalole/python-flask-restful-api | 475d8fd7be1724183716a197aac4257f8fbbeac4 | [
"MIT"
] | 3 | 2019-09-05T05:28:49.000Z | 2020-06-10T09:03:37.000Z | app/api/schema/image_sizes.py | akashtalole/python-flask-restful-api | 475d8fd7be1724183716a197aac4257f8fbbeac4 | [
"MIT"
] | null | null | null | app/api/schema/image_sizes.py | akashtalole/python-flask-restful-api | 475d8fd7be1724183716a197aac4257f8fbbeac4 | [
"MIT"
] | null | null | null | from marshmallow_jsonapi import fields
from marshmallow_jsonapi.flask import Schema
from app.api.helpers.utilities import dasherize
from utils.common import use_defaults
@use_defaults()
class EventImageSizeSchema(Schema):
"""
Api schema for image_size Model
"""
class Meta:
"""
Meta cl... | 41.870968 | 94 | 0.692604 | from marshmallow_jsonapi import fields
from marshmallow_jsonapi.flask import Schema
from app.api.helpers.utilities import dasherize
from utils.common import use_defaults
@use_defaults()
class EventImageSizeSchema(Schema):
"""
Api schema for image_size Model
"""
class Meta:
"""
Meta cl... | 0 | 0 | 0 |
80ccd07a50d9e26f0f3c296670920b067e2d2e5e | 1,043 | py | Python | Algorithms/0097_Interleaving_String/Python/Interleaving_String_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null | Algorithms/0097_Interleaving_String/Python/Interleaving_String_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null | Algorithms/0097_Interleaving_String/Python/Interleaving_String_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null |
# Space: O(n)
# Time: O(n)
| 28.972222 | 99 | 0.540748 |
# Space: O(n)
# Time: O(n)
class Solution:
def isInterleave(self, s1: str, s2: str, s3: str) -> bool:
length_1, length_2, length_3 = len(s1), len(s2), len(s3)
if length_1 == length_2 == length_3 == 0: return True
if length_1 + length_2 != length_3: return False
cache = [[None for ... | 964 | -6 | 49 |
a2cfb3dd847c2c2f892bf3b4da52f1a13e5ade61 | 338 | py | Python | carProject/carApp/models.py | cs-fullstack-2019-spring/django-validation-cw-cgarciapieto | 51df6fbd8d4e5ad878c4a620ca822ecd9df55711 | [
"Apache-2.0"
] | null | null | null | carProject/carApp/models.py | cs-fullstack-2019-spring/django-validation-cw-cgarciapieto | 51df6fbd8d4e5ad878c4a620ca822ecd9df55711 | [
"Apache-2.0"
] | null | null | null | carProject/carApp/models.py | cs-fullstack-2019-spring/django-validation-cw-cgarciapieto | 51df6fbd8d4e5ad878c4a620ca822ecd9df55711 | [
"Apache-2.0"
] | null | null | null | from django.db import models
# car Model with input/attributes make, model, year, mpg | 28.166667 | 56 | 0.718935 | from django.db import models
# car Model with input/attributes make, model, year, mpg
class CarModel(models.Model):
make = models.CharField(max_length=200)
model = models.CharField(max_length=200)
year = models.IntegerField(default=0)
mpg = models.IntegerField(default=0)
def __str__(self):
... | 22 | 207 | 23 |
e8525b400d730f96fedff9ad040d2992ff14e0fd | 193 | py | Python | ecfactory/mnt_cycles/mnt_cycles_examples.py | weikengchen/ecfactory | f509c00b7cf66f4b8dbe9540599a4c95b9742bfd | [
"MIT"
] | 39 | 2016-06-09T13:47:57.000Z | 2022-02-10T14:06:20.000Z | ecfactory/mnt_cycles/mnt_cycles_examples.py | frevson/ecfactory-A-SageMath-Library-for-Constructing-Elliptic-Curves | f509c00b7cf66f4b8dbe9540599a4c95b9742bfd | [
"MIT"
] | 3 | 2019-04-26T14:15:34.000Z | 2021-02-03T09:21:37.000Z | ecfactory/mnt_cycles/mnt_cycles_examples.py | frevson/ecfactory-A-SageMath-Library-for-Constructing-Elliptic-Curves | f509c00b7cf66f4b8dbe9540599a4c95b9742bfd | [
"MIT"
] | 13 | 2017-09-27T08:08:49.000Z | 2022-03-28T12:11:20.000Z | import ecfactory.mnt_cycles as mnt_cycles
# Example (find an MNT cycle with D = -19)
cycles = mnt_cycles.make_cycle(-19)
print('Found a cycle: ' + str(cycles[0][0]) + ', ' + str(cycles[0][1])) | 38.6 | 71 | 0.678756 | import ecfactory.mnt_cycles as mnt_cycles
# Example (find an MNT cycle with D = -19)
cycles = mnt_cycles.make_cycle(-19)
print('Found a cycle: ' + str(cycles[0][0]) + ', ' + str(cycles[0][1])) | 0 | 0 | 0 |
394e112047884d425fd5bac24f0c8c865dbcab28 | 2,159 | py | Python | tests/unit/test_core.py | ehebert/pipenv | b771621274fcdb6980b4c9682bd2b2879e3354d1 | [
"MIT"
] | 2 | 2018-11-06T04:53:13.000Z | 2018-11-08T22:10:20.000Z | tests/unit/test_core.py | ehebert/pipenv | b771621274fcdb6980b4c9682bd2b2879e3354d1 | [
"MIT"
] | 1 | 2018-11-25T10:50:57.000Z | 2018-11-25T10:50:57.000Z | tests/unit/test_core.py | ehebert/pipenv | b771621274fcdb6980b4c9682bd2b2879e3354d1 | [
"MIT"
] | 1 | 2021-07-03T03:30:45.000Z | 2021-07-03T03:30:45.000Z | import os
import pytest
import mock
from pipenv._compat import TemporaryDirectory
from pipenv.core import warn_in_virtualenv, load_dot_env
from pipenv.utils import temp_environ
@mock.patch('pipenv.environments.PIPENV_VIRTUALENV', 'totallyrealenv')
@mock.patch('pipenv.environments.PIPENV_VERBOSITY', -1)
@pytest.mark... | 35.983333 | 84 | 0.692913 | import os
import pytest
import mock
from pipenv._compat import TemporaryDirectory
from pipenv.core import warn_in_virtualenv, load_dot_env
from pipenv.utils import temp_environ
@mock.patch('pipenv.environments.PIPENV_VIRTUALENV', 'totallyrealenv')
@mock.patch('pipenv.environments.PIPENV_VERBOSITY', -1)
@pytest.mark... | 1,685 | 0 | 88 |
19600211c81f047065f97d9d51dc1a3189acd673 | 4,107 | py | Python | data_collector_app.py | durgeshsamariya/foodify.ai | c058996fb095103f3b28e1d439073cf4ddbd26b0 | [
"MIT"
] | 2 | 2022-02-17T06:25:10.000Z | 2022-02-20T03:57:37.000Z | data_collector_app.py | durgeshsamariya/foodify.ai | c058996fb095103f3b28e1d439073cf4ddbd26b0 | [
"MIT"
] | null | null | null | data_collector_app.py | durgeshsamariya/foodify.ai | c058996fb095103f3b28e1d439073cf4ddbd26b0 | [
"MIT"
] | null | null | null | import PIL
import streamlit as st
import datetime
import uuid
from streamlit.uploaded_file_manager import UploadedFile
from utils.utils import upload_image, create_unique_filename, save_to_google_sheet
st.title("Foodify.ai Data Collection 🍔🌯🍫")
st.write(
"Upload or take a photo of your food and help us to build... | 33.390244 | 110 | 0.600195 | import PIL
import streamlit as st
import datetime
import uuid
from streamlit.uploaded_file_manager import UploadedFile
from utils.utils import upload_image, create_unique_filename, save_to_google_sheet
st.title("Foodify.ai Data Collection 🍔🌯🍫")
st.write(
"Upload or take a photo of your food and help us to build... | 0 | 0 | 0 |
62c7d6156a97c6551bc35203a263f248aed6d089 | 2,525 | py | Python | libs/orm.py | BreakUnrealGod/TanTan | 043454a76ee27d61e7d9aede7818f9127e34aaf2 | [
"MIT"
] | null | null | null | libs/orm.py | BreakUnrealGod/TanTan | 043454a76ee27d61e7d9aede7818f9127e34aaf2 | [
"MIT"
] | 10 | 2019-12-04T23:38:04.000Z | 2022-02-10T09:53:59.000Z | swiper/libs/orm.py | lijiaqipy/test1 | ab628a794ab67e153b929c819c876c5a676ab068 | [
"MIT"
] | null | null | null | from django.db import models
from django.core.cache import cache
from common import config
# class ModelToDictMixin(object):
def get(cls, *args, **kwargs):
"""
为 objects 管理类的 get 方法增加缓存功能
Model.get(pk=123)
:param self:
:param args:
:param kwargs:
:return:
"""
# 1、从缓存中获取数据
... | 22.954545 | 75 | 0.636832 | from django.db import models
from django.core.cache import cache
from common import config
# class ModelToDictMixin(object):
def to_dict(self, exclude=[]):
attr_dict = {}
for field in self._meta.fields:
field_name = field.attname
if field_name not in exclude:
attr_dict[field_name... | 794 | 0 | 68 |
a3a6bcc50693cebd7f3c061c9e8471bb491ad207 | 3,142 | py | Python | airbyte-integrations/connectors/source-trello/unit_tests/test_control_rate_limit.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 6,215 | 2020-09-21T13:45:56.000Z | 2022-03-31T21:21:45.000Z | airbyte-integrations/connectors/source-trello/unit_tests/test_control_rate_limit.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 8,448 | 2020-09-21T00:43:50.000Z | 2022-03-31T23:56:06.000Z | airbyte-integrations/connectors/source-trello/unit_tests/test_control_rate_limit.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 1,251 | 2020-09-20T05:48:47.000Z | 2022-03-31T10:41:29.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from functools import wraps
import requests
# Define standard timings in seconds
SLEEP_ON_HIGH_LOAD: float = 9.0
TEST_DATA_FIELD = "some_data_field"
TEST_RATE_LIMIT_THRESHOLD = 0.1
TEST_HEADERS_NAME = [
("x-rate-limit-api-key-remaining", "x-rate-limit... | 34.911111 | 116 | 0.668046 | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from functools import wraps
import requests
# Define standard timings in seconds
SLEEP_ON_HIGH_LOAD: float = 9.0
TEST_DATA_FIELD = "some_data_field"
TEST_RATE_LIMIT_THRESHOLD = 0.1
TEST_HEADERS_NAME = [
("x-rate-limit-api-key-remaining", "x-rate-limit... | 1,434 | 0 | 49 |
d9d1654b34f40e0c7abcc17dff20fa72909b9f64 | 8,810 | py | Python | xmonitor/db/sqlalchemy/migrate_repo/versions/017_quote_encrypted_swift_credentials.py | froyobin/xmonitor | 092dcaa01f834353ffd8dd3c40edf9e97543bfe8 | [
"Apache-2.0"
] | null | null | null | xmonitor/db/sqlalchemy/migrate_repo/versions/017_quote_encrypted_swift_credentials.py | froyobin/xmonitor | 092dcaa01f834353ffd8dd3c40edf9e97543bfe8 | [
"Apache-2.0"
] | null | null | null | xmonitor/db/sqlalchemy/migrate_repo/versions/017_quote_encrypted_swift_credentials.py | froyobin/xmonitor | 092dcaa01f834353ffd8dd3c40edf9e97543bfe8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# 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 requ... | 36.106557 | 78 | 0.632123 | # Copyright 2013 OpenStack Foundation
# 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 requ... | 297 | 0 | 92 |
54fcba5a90b30f291e1a2fab18963885b8029fe5 | 1,885 | py | Python | cm/cm_dhexppot/CM/CM_TUW19/array2raster.py | historeno/enermaps | ad3a97636baa153a56367e374d0fef7f009bf19d | [
"Apache-2.0"
] | null | null | null | cm/cm_dhexppot/CM/CM_TUW19/array2raster.py | historeno/enermaps | ad3a97636baa153a56367e374d0fef7f009bf19d | [
"Apache-2.0"
] | null | null | null | cm/cm_dhexppot/CM/CM_TUW19/array2raster.py | historeno/enermaps | ad3a97636baa153a56367e374d0fef7f009bf19d | [
"Apache-2.0"
] | null | null | null | """
Created on August 14 2018
@author: fallahnejad@eeg.tuwien.ac.at
"""
import os
import sys
from osgeo import gdal, osr
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
if path not in sys.path:
sys.path.append(path)
def array2raster(
outRasterPath, geo_transform, dataTyp... | 29.920635 | 86 | 0.646154 | """
Created on August 14 2018
@author: fallahnejad@eeg.tuwien.ac.at
"""
import os
import sys
from osgeo import gdal, osr
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
if path not in sys.path:
sys.path.append(path)
def array2raster(
outRasterPath, geo_transform, dataTyp... | 0 | 0 | 0 |
9ba66ac0118865fada74771be7bf4006b25265ce | 5,286 | py | Python | util/scripts/stack-depth-info.py | systems-nuts/popcorn-compiler-alpine | 5c225c7d3055db83dc654b6b5525c34bbdacded1 | [
"Linux-OpenIB"
] | 30 | 2019-04-07T14:58:31.000Z | 2021-05-24T19:07:20.000Z | util/scripts/stack-depth-info.py | XRDevIEEE/popcorn-compiler | 2cb2eccc0c75b5963d9fec26ad80a7b881316b1d | [
"Linux-OpenIB"
] | 11 | 2018-07-24T19:31:26.000Z | 2020-09-03T08:56:23.000Z | util/scripts/stack-depth-info.py | XRDevIEEE/popcorn-compiler | 2cb2eccc0c75b5963d9fec26ad80a7b881316b1d | [
"Linux-OpenIB"
] | 17 | 2018-08-26T12:43:15.000Z | 2022-03-18T12:08:40.000Z | #!/usr/bin/python3
import sys, subprocess
###############################################################################
# Config
###############################################################################
dataFile = None
binFile = None
onlyFunc = False
verbose = False
#########################################... | 30.732558 | 104 | 0.574915 | #!/usr/bin/python3
import sys, subprocess
###############################################################################
# Config
###############################################################################
dataFile = None
binFile = None
onlyFunc = False
verbose = False
#########################################... | 3,657 | 0 | 115 |
d6d71f011810b5ff2754627d1771f5d19d8fd950 | 178 | py | Python | examples/get_user_info.py | suyashjawale/InstagramCLI | 56b7f8e1f97ad723c41a15874d5ab5c8967d08c3 | [
"MIT"
] | 5 | 2022-01-26T00:15:52.000Z | 2022-03-16T17:18:29.000Z | examples/get_user_info.py | suyashjawale/InstagramCLI | 56b7f8e1f97ad723c41a15874d5ab5c8967d08c3 | [
"MIT"
] | 1 | 2021-11-03T17:26:11.000Z | 2021-11-14T05:06:20.000Z | examples/get_user_info.py | suyashjawale/InstagramCLI | 56b7f8e1f97ad723c41a15874d5ab5c8967d08c3 | [
"MIT"
] | 1 | 2022-01-02T03:50:29.000Z | 2022-01-02T03:50:29.000Z | from InstagramCLI import InstagramCLI
cli = InstagramCLI(username="", password="")
data= cli.get_user_info(target_username="usnjsi77",save_to_device=True)
print(data)
cli.close() | 35.6 | 71 | 0.803371 | from InstagramCLI import InstagramCLI
cli = InstagramCLI(username="", password="")
data= cli.get_user_info(target_username="usnjsi77",save_to_device=True)
print(data)
cli.close() | 0 | 0 | 0 |
6a8f79a8e7bb2e7ba26110a94905fe82627d84c0 | 8,592 | py | Python | pymatgen/analysis/molecule_structure_comparator.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | 1 | 2022-03-22T22:08:16.000Z | 2022-03-22T22:08:16.000Z | pymatgen/analysis/molecule_structure_comparator.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | null | null | null | pymatgen/analysis/molecule_structure_comparator.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | null | null | null | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to comparsion the structures of the two
molecule. As long as the two molecule have the same bond connection tables,
the molecules are deemed to be same. The atom in the two molecule must be
pa... | 28.54485 | 119 | 0.516527 | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to comparsion the structures of the two
molecule. As long as the two molecule have the same bond connection tables,
the molecules are deemed to be same. The atom in the two molecule must be
pa... | 0 | 0 | 0 |
f836aea2e60665ebbee4033654498c2a4b470d74 | 1,858 | py | Python | ThenWhatTree/execute_tree.py | intel/ThenWhatTree | ddcd5af58e55705ba2dd6a824828f3fc48bd68da | [
"BSD-3-Clause"
] | 3 | 2018-05-23T17:15:39.000Z | 2019-03-17T18:44:19.000Z | ThenWhatTree/execute_tree.py | intel/ThenWhatTree | ddcd5af58e55705ba2dd6a824828f3fc48bd68da | [
"BSD-3-Clause"
] | null | null | null | ThenWhatTree/execute_tree.py | intel/ThenWhatTree | ddcd5af58e55705ba2dd6a824828f3fc48bd68da | [
"BSD-3-Clause"
] | 4 | 2019-11-02T01:15:21.000Z | 2021-09-16T11:01:29.000Z | #!/usr/bin/env python3
# Copyright (C) 2018 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
"""Function for evaluating the nodes of a decision tree and extracting out the results from each of the nodes."""
# Import built in modules
import argparse
import sys
import os
# Import 3rd party modules
# Import... | 25.108108 | 113 | 0.703983 | #!/usr/bin/env python3
# Copyright (C) 2018 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
"""Function for evaluating the nodes of a decision tree and extracting out the results from each of the nodes."""
# Import built in modules
import argparse
import sys
import os
# Import 3rd party modules
# Import... | 0 | 0 | 0 |
5e9d965ec0e648c42b7858dcd55dc6a562d14c96 | 140 | py | Python | DOM/game/item.py | AlexDev-py/CubIC | 7932d2789c0b45ebc9ce631d21f6bed99d3a3a51 | [
"MIT"
] | 2 | 2022-02-05T13:06:28.000Z | 2022-02-09T07:07:11.000Z | DOM/game/item.py | AlexDev-py/CubIC | 7932d2789c0b45ebc9ce631d21f6bed99d3a3a51 | [
"MIT"
] | null | null | null | DOM/game/item.py | AlexDev-py/CubIC | 7932d2789c0b45ebc9ce631d21f6bed99d3a3a51 | [
"MIT"
] | 2 | 2022-01-24T13:42:45.000Z | 2022-02-08T09:18:58.000Z | from dataclasses import dataclass
@dataclass
| 12.727273 | 33 | 0.642857 | from dataclasses import dataclass
@dataclass
class Item:
name: str
lvl: int
price: int
icon: str
desc: dict[str, str]
| 0 | 71 | 22 |
2773a2b5fb1ba7a66e740bb2804aab93cde6bb13 | 10,125 | py | Python | sfw_torch.py | bwilder0/tb_code_release | e0994116cff1ec0c04e0297f2b558ec5dd53f765 | [
"MIT"
] | null | null | null | sfw_torch.py | bwilder0/tb_code_release | e0994116cff1ec0c04e0297f2b558ec5dd53f765 | [
"MIT"
] | null | null | null | sfw_torch.py | bwilder0/tb_code_release | e0994116cff1ec0c04e0297f2b558ec5dd53f765 | [
"MIT"
] | null | null | null | import torch
import numpy as np
def run_sis(T, G, S, I, newI, nu, mu, d, beta, N):
'''
Runs the linearized SIS model, returning the total number of infected agents
summed over all time steps.
'''
#duplicate these variables along an additional axis to match the batch size
nu = torch.diag(1 - nu)... | 37.5 | 169 | 0.618469 | import torch
import numpy as np
def run_sis(T, G, S, I, newI, nu, mu, d, beta, N):
'''
Runs the linearized SIS model, returning the total number of infected agents
summed over all time steps.
'''
#duplicate these variables along an additional axis to match the batch size
nu = torch.diag(1 - nu)... | 1,754 | 0 | 126 |
886d846b1bd5e2c59d450a892dc2cfd09102c8c5 | 3,042 | py | Python | cj_2nd/problem_2/problem2.py | yskang/AlgorithmPracticeWithPython | f7129bd1924a7961489198f0ee052d2cd1e9cf40 | [
"MIT"
] | null | null | null | cj_2nd/problem_2/problem2.py | yskang/AlgorithmPracticeWithPython | f7129bd1924a7961489198f0ee052d2cd1e9cf40 | [
"MIT"
] | 1 | 2019-11-04T06:44:04.000Z | 2019-11-04T06:46:55.000Z | cj_2nd/problem_2/problem2.py | yskang/AlgorithmPractice | 31b76e38b4c2f1e3e29fb029587662a745437912 | [
"MIT"
] | null | null | null | import sys
filename = sys.argv[1]
test_input = open(filename, 'r')
numberOfTest = int(test_input.readline().replace('\n', '').replace('\r', '').strip())
nodesR = []
distanceR = []
nodesC = []
distanceC = []
branchPoint = 0
output = open(filename.replace('in', 'out'), 'w')
for i in range(numberOfTest):
initDat... | 28.698113 | 87 | 0.606838 | import sys
filename = sys.argv[1]
test_input = open(filename, 'r')
numberOfTest = int(test_input.readline().replace('\n', '').replace('\r', '').strip())
nodesR = []
distanceR = []
nodesC = []
distanceC = []
branchPoint = 0
def initData():
nodesR[:] = []
distanceR[:] = []
nodesC[:] = []
distanceC[:]... | 1,696 | 0 | 161 |
ece9c2de7d3783b49ddc26cdb15385cc57ba75f8 | 1,094 | py | Python | LinearRegression/pcr.py | jayshonzs/ESL | 2b51b1e01cb204d17588b7a2a8f765daa0a1e0c5 | [
"MIT"
] | 9 | 2016-09-26T15:56:16.000Z | 2019-10-21T05:59:14.000Z | LinearRegression/pcr.py | jayshonzs/ESL | 2b51b1e01cb204d17588b7a2a8f765daa0a1e0c5 | [
"MIT"
] | null | null | null | LinearRegression/pcr.py | jayshonzs/ESL | 2b51b1e01cb204d17588b7a2a8f765daa0a1e0c5 | [
"MIT"
] | 3 | 2016-08-15T00:18:22.000Z | 2019-02-28T14:54:55.000Z | '''
Created on 2014-5-25
@author: xiajie
'''
import numpy as np
import prostate
import preprocess
if __name__ == '__main__':
inputs, output, Ttype = prostate.loaddata()
train_data, train_out, test_data, test_out = prostate.cookdata2(inputs, output, Ttype)
X, X_mean, Y_mean, X_std = preprocess.center_data(... | 26.682927 | 90 | 0.617002 | '''
Created on 2014-5-25
@author: xiajie
'''
import numpy as np
import prostate
import preprocess
def theta(z, y):
return np.transpose(z).dot(y)/np.transpose(z).dot(z)
def PCR(X,Y,m=7):
z = []
thetas = []
beta = np.zeros(len(X[0]))
U, S, V = np.linalg.svd(X, full_matrices=True)
for i in range... | 400 | 0 | 69 |
46fd6c109844df9a60a301cc1c15e3eb17f850a2 | 11,188 | py | Python | tests/unit/profiles/test_views.py | etienne86/oc_p13_team_spirit | fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa | [
"MIT"
] | null | null | null | tests/unit/profiles/test_views.py | etienne86/oc_p13_team_spirit | fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa | [
"MIT"
] | null | null | null | tests/unit/profiles/test_views.py | etienne86/oc_p13_team_spirit | fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa | [
"MIT"
] | null | null | null | """Contain the unit tests related to the views in app ``profiles``."""
from django.http.request import HttpRequest
from django.test import TestCase
from teamspirit.core.models import Address
from teamspirit.profiles.models import Personal
from teamspirit.profiles.views import (
add_id_file_view,
add_medical_f... | 36.442997 | 79 | 0.611459 | """Contain the unit tests related to the views in app ``profiles``."""
from django.http.request import HttpRequest
from django.test import TestCase
from teamspirit.core.models import Address
from teamspirit.profiles.models import Personal
from teamspirit.profiles.views import (
add_id_file_view,
add_medical_f... | 995 | 0 | 27 |
86a8ad2afb7633e6e47ada84d04ae169c3278ecc | 4,831 | py | Python | modules/benchmark_common_functions.py | liushiyu1994/random_binary_file | 17c317b777387346114a4ad20c1bc3cb8a4147ce | [
"MIT"
] | null | null | null | modules/benchmark_common_functions.py | liushiyu1994/random_binary_file | 17c317b777387346114a4ad20c1bc3cb8a4147ce | [
"MIT"
] | null | null | null | modules/benchmark_common_functions.py | liushiyu1994/random_binary_file | 17c317b777387346114a4ad20c1bc3cb8a4147ce | [
"MIT"
] | null | null | null | from .packages import os, plt
from .common_functions import parameter_check_function, random_binary_files_single, time_stamp
| 49.295918 | 114 | 0.742703 | from .packages import os, plt
from .common_functions import parameter_check_function, random_binary_files_single, time_stamp
def benchmark_text_output(result_sorted_list, output_file_name, output_folder_name):
headline = "Generator name,\t\t Running time,\t\t File count rate (count/s),\t\t File size rate (MiB/s)"... | 4,586 | 0 | 115 |
6ad8ac63ac2ca2e4e626cb985983826a1b89907e | 10,317 | py | Python | bin/vrc_ssh.py | osrf/cloudsim-legacy | 01ea7dd2708ed9797a860ac839028ec62fd96a23 | [
"Apache-2.0"
] | null | null | null | bin/vrc_ssh.py | osrf/cloudsim-legacy | 01ea7dd2708ed9797a860ac839028ec62fd96a23 | [
"Apache-2.0"
] | null | null | null | bin/vrc_ssh.py | osrf/cloudsim-legacy | 01ea7dd2708ed9797a860ac839028ec62fd96a23 | [
"Apache-2.0"
] | 1 | 2021-03-16T15:00:51.000Z | 2021-03-16T15:00:51.000Z | #!/usr/bin/env python
"""
Program that runs a script or copy a file into a set of machines.
"""
import argparse
import os
import sys
from threading import Thread
import abc
import subprocess
import getpass
import Queue
NORMAL = '\033[00m'
RED = '\033[0;31m'
CLOUDSIM_PREFIX = 'OSRF_CloudSim_'
CONST_PREFIX = 'OSRF_VRC... | 34.275748 | 85 | 0.583794 | #!/usr/bin/env python
"""
Program that runs a script or copy a file into a set of machines.
"""
import argparse
import os
import sys
from threading import Thread
import abc
import subprocess
import getpass
import Queue
NORMAL = '\033[00m'
RED = '\033[0;31m'
CLOUDSIM_PREFIX = 'OSRF_CloudSim_'
CONST_PREFIX = 'OSRF_VRC... | 508 | 0 | 105 |
d4cd314bd47d95820381415300f80a6c264fbc93 | 10,264 | py | Python | sandbox/finetuning/algos/concurrent_continuous_ppo.py | andrewli77/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 23 | 2020-04-27T23:53:44.000Z | 2022-03-10T03:13:16.000Z | sandbox/finetuning/algos/concurrent_continuous_ppo.py | WeiChengTseng/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 1 | 2021-11-14T13:30:22.000Z | 2021-11-14T13:30:22.000Z | sandbox/finetuning/algos/concurrent_continuous_ppo.py | WeiChengTseng/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 8 | 2020-06-17T03:28:34.000Z | 2022-03-09T03:13:03.000Z | import theano
import theano.tensor as TT
from rllab.misc import ext
import numpy as np
import copy
import rllab.misc.logger as logger
from rllab.spaces.box import Box
from rllab.envs.env_spec import EnvSpec
from sandbox.finetuning.policies.concurrent_hier_policy2 import HierarchicalPolicy
from sandbox.finetuning.algos.... | 48.87619 | 118 | 0.667771 | import theano
import theano.tensor as TT
from rllab.misc import ext
import numpy as np
import copy
import rllab.misc.logger as logger
from rllab.spaces.box import Box
from rllab.envs.env_spec import EnvSpec
from sandbox.finetuning.policies.concurrent_hier_policy2 import HierarchicalPolicy
from sandbox.finetuning.algos.... | 8,738 | 0 | 132 |
db8d1e3d87eeb6f3a0f5a5bfe9414cd167fe9148 | 1,064 | py | Python | test/perspective.py | cburggie/py3D | d0fe21aae1d5ab77ec80f85533e941c902dad6f4 | [
"MIT"
] | null | null | null | test/perspective.py | cburggie/py3D | d0fe21aae1d5ab77ec80f85533e941c902dad6f4 | [
"MIT"
] | null | null | null | test/perspective.py | cburggie/py3D | d0fe21aae1d5ab77ec80f85533e941c902dad6f4 | [
"MIT"
] | null | null | null | import pytrace
import py3D
filename = 'perspective.png'
ppu = 400
passes = 16
S = py3D.Sphere
C = py3D.Color
V = py3D.Vector
cam = pytrace.Camera(V(0.0,10.0,0.0), V(0.0,0.0,0.0), 2.0, 2.0, V(0.0,0.0,1.0))
cam.set_ppu(ppu)
center = S(V(0.0,0.0,0.0), 1.0, C(0.99,0.99,0.99)).set_reflectivity(0.8)
bodies = []
bodies... | 30.4 | 79 | 0.596805 | import pytrace
import py3D
filename = 'perspective.png'
ppu = 400
passes = 16
S = py3D.Sphere
C = py3D.Color
V = py3D.Vector
cam = pytrace.Camera(V(0.0,10.0,0.0), V(0.0,0.0,0.0), 2.0, 2.0, V(0.0,0.0,1.0))
cam.set_ppu(ppu)
center = S(V(0.0,0.0,0.0), 1.0, C(0.99,0.99,0.99)).set_reflectivity(0.8)
bodies = []
bodies... | 0 | 0 | 0 |
7d9b7841c0014afe5edcc26667fa135680bc684d | 6,061 | py | Python | flask_app/app.py | bulatcute/tatfac | 1bbfcff2622dd11a8caf69ff17268156720bb2c1 | [
"MIT"
] | null | null | null | flask_app/app.py | bulatcute/tatfac | 1bbfcff2622dd11a8caf69ff17268156720bb2c1 | [
"MIT"
] | null | null | null | flask_app/app.py | bulatcute/tatfac | 1bbfcff2622dd11a8caf69ff17268156720bb2c1 | [
"MIT"
] | null | null | null | import asyncio
import atexit
import os
import dotenv
import requests
from apscheduler.schedulers.background import BackgroundScheduler
from flask import (Flask, make_response, redirect, render_template, request,
send_from_directory, url_for)
from flask_login import (
LoginManager, UserMixin, cur... | 31.082051 | 107 | 0.671176 | import asyncio
import atexit
import os
import dotenv
import requests
from apscheduler.schedulers.background import BackgroundScheduler
from flask import (Flask, make_response, redirect, render_template, request,
send_from_directory, url_for)
from flask_login import (
LoginManager, UserMixin, cur... | 3,445 | 256 | 310 |
b7db7352d4a55e0347fe2a602885c256089ac79d | 62 | py | Python | Clase1/HolaNombre.py | JoseCordobaEAN/EstructurasDeDatosUE4P | 86a5c426d83d9d9ae86656c3c78324a1c07f608d | [
"MIT"
] | 2 | 2019-08-17T21:15:47.000Z | 2019-09-21T12:15:19.000Z | Clase1/HolaNombre.py | JoseCordobaEAN/EstructurasDeDatosUE4P | 86a5c426d83d9d9ae86656c3c78324a1c07f608d | [
"MIT"
] | null | null | null | Clase1/HolaNombre.py | JoseCordobaEAN/EstructurasDeDatosUE4P | 86a5c426d83d9d9ae86656c3c78324a1c07f608d | [
"MIT"
] | null | null | null | nombre = input("¿Cual es tu nombre?")
print(f'Hola {nombre}')
| 20.666667 | 37 | 0.66129 | nombre = input("¿Cual es tu nombre?")
print(f'Hola {nombre}')
| 0 | 0 | 0 |
011f123996b9652d7897969a4b6e12700739981a | 765 | py | Python | main/MouseAtlas.py | jimmayxu/scVI | 23cb7597e0b0677736a14c903c8053ad62c74938 | [
"MIT"
] | null | null | null | main/MouseAtlas.py | jimmayxu/scVI | 23cb7597e0b0677736a14c903c8053ad62c74938 | [
"MIT"
] | null | null | null | main/MouseAtlas.py | jimmayxu/scVI | 23cb7597e0b0677736a14c903c8053ad62c74938 | [
"MIT"
] | null | null | null | import os
os.getcwd()
import sys
sys.path.append('scvi')
import torch
import numpy as np
import pandas as pd
import scanpy as sc
save_path = "/lustre/scratch117/cellgen/team205/tpcg/backup/backup_20190401/sc_sclassification/CellTypist/data_repo/MouseAtlas/MouseAtlas.total.h5ad"
save_path2 = "/lustre/scratch117/cell... | 22.5 | 149 | 0.816993 | import os
os.getcwd()
import sys
sys.path.append('scvi')
import torch
import numpy as np
import pandas as pd
import scanpy as sc
save_path = "/lustre/scratch117/cellgen/team205/tpcg/backup/backup_20190401/sc_sclassification/CellTypist/data_repo/MouseAtlas/MouseAtlas.total.h5ad"
save_path2 = "/lustre/scratch117/cell... | 0 | 0 | 0 |
c7f59edb3a5c8d3619ad68f6b6967bea28d3ba40 | 3,792 | py | Python | shell/shell.py | kreusada/JackCogs | f1c5b30e0656cb9634fa8bb0d6b00aa7c2384c40 | [
"Apache-2.0"
] | null | null | null | shell/shell.py | kreusada/JackCogs | f1c5b30e0656cb9634fa8bb0d6b00aa7c2384c40 | [
"Apache-2.0"
] | null | null | null | shell/shell.py | kreusada/JackCogs | f1c5b30e0656cb9634fa8bb0d6b00aa7c2384c40 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Jakub Kuczys (https://github.com/jack1142)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 35.111111 | 86 | 0.629483 | # Copyright 2018-2021 Jakub Kuczys (https://github.com/jack1142)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 1,481 | 0 | 108 |
1aca8312e8b3a002362d2b49a0e848391cf47680 | 2,032 | py | Python | markov.py | AVMatthews/Outlet | c84765ef1288d206f09cdace5841d36192782875 | [
"CC0-1.0"
] | null | null | null | markov.py | AVMatthews/Outlet | c84765ef1288d206f09cdace5841d36192782875 | [
"CC0-1.0"
] | null | null | null | markov.py | AVMatthews/Outlet | c84765ef1288d206f09cdace5841d36192782875 | [
"CC0-1.0"
] | null | null | null | import re;
import random
import sys
# splitter = re.compile('.', re.MULTILINE)
if __name__ == '__main__':
k = int(sys.argv[1])
n = int(sys.argv[2])
ma = Markov(n)
for i in sys.argv[3:]:
ma.Feed(open(i, 'r').read())
#print ma.probs
#print ma.Dump(int(sys.argv[1]))
words, hits = ma... | 32.774194 | 79 | 0.468012 | import re;
import random
import sys
class Markov(object):
splitter = re.compile(r'([\w\'!\?\.,<>="\'/:]+)')
# splitter = re.compile('.', re.MULTILINE)
def __init__(self, n = 1):
self.probs = {}
self.n = n
def Feed(self, str):
self.Update(map(lambda x: x.lower(), self.splitter.fin... | 1,363 | 54 | 153 |
d05ba470162792a18c8b6797afd697c420796a34 | 3,882 | py | Python | batchflow/models/tf/pyramidnet.py | bestetc/batchflow | d2a843640383fbe860654236881483f755227e06 | [
"Apache-2.0"
] | 87 | 2018-11-16T08:04:12.000Z | 2022-03-24T20:08:44.000Z | batchflow/models/tf/pyramidnet.py | bestetc/batchflow | d2a843640383fbe860654236881483f755227e06 | [
"Apache-2.0"
] | 243 | 2018-11-29T02:03:55.000Z | 2022-02-21T08:28:29.000Z | batchflow/models/tf/pyramidnet.py | bestetc/batchflow | d2a843640383fbe860654236881483f755227e06 | [
"Apache-2.0"
] | 35 | 2019-01-29T14:26:14.000Z | 2021-12-30T01:39:02.000Z | """
Dongyoon Han et al. "`Deep Pyramidal Residual Networks
<https://arxiv.org/abs/1610.02915>`_"
"""
from . import ResNet
class PyramidNet(ResNet):
""" The base PyramidNet model
Notes
-----
This class is intended to define custom PyramidNets.
For more convenience use predefined :class:`.tf.Pyram... | 31.056 | 94 | 0.617723 | """
Dongyoon Han et al. "`Deep Pyramidal Residual Networks
<https://arxiv.org/abs/1610.02915>`_"
"""
from . import ResNet
class PyramidNet(ResNet):
""" The base PyramidNet model
Notes
-----
This class is intended to define custom PyramidNets.
For more convenience use predefined :class:`.tf.Pyram... | 834 | 0 | 130 |
814151f26dafa0c3a95ca7fedafaed5b2414e027 | 18,627 | py | Python | MiNTiF_Utils/cnn/model_zoos/model_zoo_default.py | CAiM-lab/MiNTiF | b292670d3cc97f884fa02fb60229869df59fccbc | [
"MIT"
] | 2 | 2021-02-25T10:22:10.000Z | 2022-02-09T12:42:31.000Z | MiNTiF_Utils/cnn/model_zoos/model_zoo_default.py | CAiM-lab/MiNTiF | b292670d3cc97f884fa02fb60229869df59fccbc | [
"MIT"
] | null | null | null | MiNTiF_Utils/cnn/model_zoos/model_zoo_default.py | CAiM-lab/MiNTiF | b292670d3cc97f884fa02fb60229869df59fccbc | [
"MIT"
] | 2 | 2021-09-22T12:56:18.000Z | 2021-11-29T18:22:03.000Z | # (c) 2019-2021, Alvaro Gomariz @ ETH Zurich
# Computer-assisted Applications in Medicine (CAiM) Group, Prof. Orcun Goksel
import numpy as np
import tensorflow as tf
from cnn import layers_keras as clayers, losses, metrics_keras as cmetrics
import logging
logger = logging.getLogger(__name__)
logger.setLevel(loggin... | 40.231102 | 137 | 0.543995 | # (c) 2019-2021, Alvaro Gomariz @ ETH Zurich
# Computer-assisted Applications in Medicine (CAiM) Group, Prof. Orcun Goksel
import numpy as np
import tensorflow as tf
from cnn import layers_keras as clayers, losses, metrics_keras as cmetrics
import logging
logger = logging.getLogger(__name__)
logger.setLevel(loggin... | 3,025 | -2 | 292 |
bd11547a58a12b55ae74731078e2652183703ae4 | 3,559 | py | Python | src/euros/en.py | ThbtSprt/euros | 750be3d31eab995b162a916234351e47a2dc27fa | [
"MIT"
] | 5 | 2021-06-11T08:32:35.000Z | 2021-08-13T15:48:22.000Z | src/euros/en.py | ThbtSprt/euros | 750be3d31eab995b162a916234351e47a2dc27fa | [
"MIT"
] | 1 | 2021-07-24T13:47:15.000Z | 2021-07-24T17:19:55.000Z | src/euros/en.py | ThbtSprt/euros | 750be3d31eab995b162a916234351e47a2dc27fa | [
"MIT"
] | null | null | null | from re import sub
chiffres = ['','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen']
nombres = ['','ten','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety']
def formater(x):
"""
... | 27.376923 | 178 | 0.503793 | from re import sub
chiffres = ['','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen']
nombres = ['','ten','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety']
def formater(x):
"""
... | 0 | 0 | 0 |
17845ad1df35ea63d566e55450a0df8d9184b04b | 6,077 | py | Python | data/external/repositories_2to3/197834/Kaggle_Avito-2015-master/model2.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/197834/Kaggle_Avito-2015-master/model2.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/197834/Kaggle_Avito-2015-master/model2.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | '''
This script runs the ftrl-proximal model on data from combo.gl and extras.gl.
author: David Thaler
date: July 2015
'''
import avito2_io
from run_model import compute_offset
import sframes
from ftrl_proximal import ftrl_proximal
from hash_features import hash_features
from eval import logloss
from datet... | 30.691919 | 96 | 0.611486 | '''
This script runs the ftrl-proximal model on data from combo.gl and extras.gl.
author: David Thaler
date: July 2015
'''
import avito2_io
from run_model import compute_offset
import sframes
from ftrl_proximal import ftrl_proximal
from hash_features import hash_features
from eval import logloss
from datet... | 2,011 | 0 | 183 |
d295c9c8af4367b5caeee5f1b85613c99b24d519 | 159 | py | Python | python/ql/test/library-tests/modules/__all__/no_all.py | timoles/codeql | 2d24387e9e300bf03be35694816b1e76ae88a50c | [
"MIT"
] | 4,036 | 2020-04-29T00:09:57.000Z | 2022-03-31T14:16:38.000Z | python/ql/test/library-tests/modules/__all__/no_all.py | timoles/codeql | 2d24387e9e300bf03be35694816b1e76ae88a50c | [
"MIT"
] | 2,970 | 2020-04-28T17:24:18.000Z | 2022-03-31T22:40:46.000Z | python/ql/test/library-tests/modules/__all__/no_all.py | ScriptBox99/github-codeql | 2ecf0d3264db8fb4904b2056964da469372a235c | [
"MIT"
] | 794 | 2020-04-29T00:28:25.000Z | 2022-03-30T08:21:46.000Z | foo = "foo"
bar = "bar"
baz = "baz"
# When `__all__` is not defined, names starting with underscore is not imported with `from <module> import *`
_qux = "qux"
| 26.5 | 109 | 0.679245 | foo = "foo"
bar = "bar"
baz = "baz"
# When `__all__` is not defined, names starting with underscore is not imported with `from <module> import *`
_qux = "qux"
| 0 | 0 | 0 |
1bbc16675a2f5aea15cb82cb075fde95938a9438 | 7,942 | py | Python | deepstreampy/event.py | sapid/deepstreampy-twisted | 78025141bb0ac3aadc248d68f9273bf8993fc3d4 | [
"MIT"
] | 28 | 2016-06-16T08:25:28.000Z | 2022-03-03T06:48:13.000Z | deepstreampy/event.py | sapid/deepstreampy-twisted | 78025141bb0ac3aadc248d68f9273bf8993fc3d4 | [
"MIT"
] | 8 | 2017-05-23T01:38:09.000Z | 2020-03-18T09:21:49.000Z | deepstreampy/event.py | sapid/deepstreampy-twisted | 78025141bb0ac3aadc248d68f9273bf8993fc3d4 | [
"MIT"
] | 11 | 2017-04-25T20:12:24.000Z | 2020-04-21T13:28:32.000Z | """Deepstream event handling."""
from __future__ import absolute_import, division, print_function, with_statement
from __future__ import unicode_literals
from deepstreampy.constants import actions
from deepstreampy.constants import topic as topic_constants
from deepstreampy.constants import event as event_constants
f... | 35.297778 | 80 | 0.568623 | """Deepstream event handling."""
from __future__ import absolute_import, division, print_function, with_statement
from __future__ import unicode_literals
from deepstreampy.constants import actions
from deepstreampy.constants import topic as topic_constants
from deepstreampy.constants import event as event_constants
f... | 2,690 | 0 | 81 |
0a692b3cd1f1f666974a59c77dda0ffc0636b6d0 | 12,132 | py | Python | research/cv/Yolact++/train.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/Yolact++/train.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/Yolact++/train.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., 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... | 49.518367 | 119 | 0.639219 | # Copyright 2021 Huawei Technologies Co., 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... | 788 | 0 | 76 |
d9b0d046b1f7c5af9b84530342ad4cf9beb9cbd8 | 1,481 | py | Python | zksync_sdk/types/signatures.py | zksync-sdk/zksync-python | 740020b6c6b83548cf6cd2ec1b4af94316a74667 | [
"MIT"
] | 22 | 2021-03-05T07:01:05.000Z | 2022-03-26T19:15:19.000Z | zksync_sdk/types/signatures.py | zksync-sdk/zksync-python | 740020b6c6b83548cf6cd2ec1b4af94316a74667 | [
"MIT"
] | 23 | 2021-03-01T06:09:26.000Z | 2022-02-17T21:54:44.000Z | zksync_sdk/types/signatures.py | zksync-sdk/zksync-python | 740020b6c6b83548cf6cd2ec1b4af94316a74667 | [
"MIT"
] | 10 | 2021-03-08T13:43:49.000Z | 2021-08-23T16:18:14.000Z | from dataclasses import dataclass
from enum import Enum
@dataclass
@dataclass
| 25.101695 | 82 | 0.617151 | from dataclasses import dataclass
from enum import Enum
class SignatureType(Enum):
ethereum_signature = "EthereumSignature"
EIP1271_signature = "EIP1271Signature"
@dataclass
class TxEthSignature:
sig_type: SignatureType
signature: str
@classmethod
def from_dict(cls, json: dict):
"""... | 444 | 887 | 67 |
ac93c64ddf02c37ad59edc10df03a3fbb2005e63 | 5,860 | py | Python | model/Birdview/test.py | MinesNicaicai/large-scale-pointcloud-matching | cfe140f2be1110ed75b6edd27538021e513a31c9 | [
"MIT"
] | 1 | 2020-11-21T16:39:51.000Z | 2020-11-21T16:39:51.000Z | model/Birdview/test.py | MinesNicaicai/large-scale-pointcloud-matching | cfe140f2be1110ed75b6edd27538021e513a31c9 | [
"MIT"
] | null | null | null | model/Birdview/test.py | MinesNicaicai/large-scale-pointcloud-matching | cfe140f2be1110ed75b6edd27538021e513a31c9 | [
"MIT"
] | 1 | 2020-12-13T14:51:44.000Z | 2020-12-13T14:51:44.000Z | import argparse
import os
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from PIL import Image
from torchvision.models import resnet18
from dataset import *
from netvlad import EmbedNet
from netvlad import NetVLAD
parser = argparse.ArgumentParser(description='WayzNetVlad')
# parser.add_argument('... | 47.258065 | 123 | 0.690785 | import argparse
import os
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from PIL import Image
from torchvision.models import resnet18
from dataset import *
from netvlad import EmbedNet
from netvlad import NetVLAD
parser = argparse.ArgumentParser(description='WayzNetVlad')
# parser.add_argument('... | 3,607 | 0 | 46 |
e0a74c8b5c04dabcccb68f37533b7fb8c88dedad | 5,112 | py | Python | runtool/tests/test_transformations/test_recurse_config.py | arangatang/gluon-ts-tools | 26509b853ddf1039993779f6049eafd4ec434ff7 | [
"Apache-2.0"
] | null | null | null | runtool/tests/test_transformations/test_recurse_config.py | arangatang/gluon-ts-tools | 26509b853ddf1039993779f6049eafd4ec434ff7 | [
"Apache-2.0"
] | null | null | null | runtool/tests/test_transformations/test_recurse_config.py | arangatang/gluon-ts-tools | 26509b853ddf1039993779f6049eafd4ec434ff7 | [
"Apache-2.0"
] | null | null | null | from runtool.recurse_config import (
recursive_apply,
recursive_apply_dict,
recursive_apply_list,
Versions,
)
def transform(node: dict):
"""
Converts node to a version object if the node has a key "versions"
else it multiplies the node by 2 if the node has key "double"
"""
if "vers... | 27.336898 | 70 | 0.385563 | from runtool.recurse_config import (
recursive_apply,
recursive_apply_dict,
recursive_apply_list,
Versions,
)
def transform(node: dict):
"""
Converts node to a version object if the node has a key "versions"
else it multiplies the node by 2 if the node has key "double"
"""
if "vers... | 4,372 | 0 | 276 |
8b20124b5243f95d96250a4026b4f24c594f8ebb | 2,160 | py | Python | tube/etl/indexers/interpreter.py | chicagopcdc/tube | 547d021fe00aa25995e7e8d2eb2a57f5633395fd | [
"Apache-2.0"
] | null | null | null | tube/etl/indexers/interpreter.py | chicagopcdc/tube | 547d021fe00aa25995e7e8d2eb2a57f5633395fd | [
"Apache-2.0"
] | 2 | 2021-03-24T16:04:22.000Z | 2021-03-30T12:54:07.000Z | tube/etl/indexers/interpreter.py | chicagopcdc/tube | 547d021fe00aa25995e7e8d2eb2a57f5633395fd | [
"Apache-2.0"
] | null | null | null | import yaml
from .aggregation.translator import Translator as AggregatorTranslator
from tube.etl.indexers.injection.translator import Translator as InjectionTranslator
from .base.translator import Translator as BaseTranslator
from tube.utils.dd import init_dictionary
from tube.etl.outputs.es.writer import Writer
| 34.83871 | 84 | 0.668981 | import yaml
from .aggregation.translator import Translator as AggregatorTranslator
from tube.etl.indexers.injection.translator import Translator as InjectionTranslator
from .base.translator import Translator as BaseTranslator
from tube.utils.dd import init_dictionary
from tube.etl.outputs.es.writer import Writer
def ... | 1,774 | 0 | 69 |
07ac0d51e2432251bef3d9eac592921ad7a815a7 | 998 | py | Python | 5-python-dataviz-homework/plotting_charts_with_matplotlib.py | eduardohl/CEBD-1160-winter-2020-code | ffafffff5100b338b7a4842fc05abd7234732d8e | [
"MIT"
] | 1 | 2020-02-11T04:29:14.000Z | 2020-02-11T04:29:14.000Z | 5-python-dataviz-homework/plotting_charts_with_matplotlib.py | eduardohl/CEBD-1160-winter-2020-code | ffafffff5100b338b7a4842fc05abd7234732d8e | [
"MIT"
] | null | null | null | 5-python-dataviz-homework/plotting_charts_with_matplotlib.py | eduardohl/CEBD-1160-winter-2020-code | ffafffff5100b338b7a4842fc05abd7234732d8e | [
"MIT"
] | 5 | 2020-01-18T21:22:04.000Z | 2020-02-27T23:00:07.000Z | # 1 Still using the same DataFrame from the previous exercise insurance.csv plot the chart for charges and save it
# as charges_plot.png
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('data/insurance.csv', header=0)
plt.plot(df['charges'])
plt.title('Charges Plot')
plt.ylabel('Charges')
plt.savefi... | 32.193548 | 120 | 0.749499 | # 1 Still using the same DataFrame from the previous exercise insurance.csv plot the chart for charges and save it
# as charges_plot.png
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('data/insurance.csv', header=0)
plt.plot(df['charges'])
plt.title('Charges Plot')
plt.ylabel('Charges')
plt.savefi... | 0 | 0 | 0 |
a54c7c2864b2796866b44586d232abc572d83805 | 36,346 | py | Python | bank/database/operate.py | zpf0117b/BankingManagementSystem | 7e6c99e827bb0899d2389e8893311a557c336ea9 | [
"MIT"
] | 3 | 2020-09-03T12:39:21.000Z | 2021-06-16T02:37:54.000Z | bank/database/operate.py | zpf0117b/BankingManagementSystem | 7e6c99e827bb0899d2389e8893311a557c336ea9 | [
"MIT"
] | 4 | 2021-05-15T11:10:18.000Z | 2021-05-15T11:10:26.000Z | bank/database/operate.py | zpf0117b/BankingManagementSystem | 7e6c99e827bb0899d2389e8893311a557c336ea9 | [
"MIT"
] | null | null | null | import sys
from os import path
d = path.dirname(__file__) # 获取当前路径
sys.path.append(d)
from model import BankClient, BankName, Staff, Charge, Cheque, Loan, Lend, Payments, PossessCheque, Saving, PossessSaving, database
from datetime import date, datetime, timedelta
from peewee import DatabaseError, DataError, IntegrityE... | 41.349261 | 313 | 0.615749 | import sys
from os import path
d = path.dirname(__file__) # 获取当前路径
sys.path.append(d)
from model import BankClient, BankName, Staff, Charge, Cheque, Loan, Lend, Payments, PossessCheque, Saving, PossessSaving, database
from datetime import date, datetime, timedelta
from peewee import DatabaseError, DataError, IntegrityE... | 35,451 | 21 | 586 |
581d89ac51782d24c0741d4f545d4bc1a7f38aa1 | 297 | py | Python | tests/settings_test.py | jamesperes/autonomiaBot | bbc90497d29fa16a85477281f87ceaeb7c3e55fc | [
"MIT"
] | 8 | 2018-03-22T21:46:30.000Z | 2021-04-07T07:06:05.000Z | tests/settings_test.py | jamesperes/autonomiaBot | bbc90497d29fa16a85477281f87ceaeb7c3e55fc | [
"MIT"
] | 42 | 2018-03-23T17:20:38.000Z | 2021-06-02T01:19:51.000Z | tests/settings_test.py | jamesperes/autonomiaBot | bbc90497d29fa16a85477281f87ceaeb7c3e55fc | [
"MIT"
] | 3 | 2018-03-26T20:30:53.000Z | 2020-01-18T13:52:32.000Z | # application configuration
from autonomia.settings import * # noqa
DEBUG = True
TESTING = True
LOG_LEVEL = "DEBUG"
WEBHOOK_DOMAIN = "localhost:5000"
WEBHOOK_PATH = "hook"
CHAT_ID = -123456
# Third party configuration
API_TOKEN = "133505823:AAHZFMHno3mzVLErU5b5jJvaeG--qUyLyG0"
REDIS_URL = ""
| 19.8 | 59 | 0.767677 | # application configuration
from autonomia.settings import * # noqa
DEBUG = True
TESTING = True
LOG_LEVEL = "DEBUG"
WEBHOOK_DOMAIN = "localhost:5000"
WEBHOOK_PATH = "hook"
CHAT_ID = -123456
# Third party configuration
API_TOKEN = "133505823:AAHZFMHno3mzVLErU5b5jJvaeG--qUyLyG0"
REDIS_URL = ""
| 0 | 0 | 0 |
af56ccce5a7ef323f67d85aaae8849e66a22a7f8 | 27,895 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/p2p_tunnel_attributes/p2p_primary_path/p2p_primary_path_/candidate_secondary_paths/candidate_secondary_path/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/p2p_tunnel_attributes/p2p_primary_path/p2p_primary_path_/candidate_secondary_paths/candidate_secondary_path/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/p2p_tunnel_attributes/p2p_primary_path/p2p_primary_path_/candidate_secondary_paths/candidate_secondary_path/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 42.587786 | 423 | 0.624628 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 9,200 | 0 | 270 |
89fc6f1de5be83c46722245878ac20f1102c60e8 | 555 | py | Python | socialite/preprocess/get_max_degree.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | socialite/preprocess/get_max_degree.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | socialite/preprocess/get_max_degree.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | import sys
if len(sys.argv) != 2:
print 'usage: [edge pair input path]'
exit(1)
with open(sys.argv[1], 'r') as fi:
node_dict = {}
for line in fi:
tmp = line.split()
src = int(tmp[0])
if src not in node_dict:
node_dict[src] = 1
else:
node_dict[src]... | 23.125 | 41 | 0.538739 | import sys
if len(sys.argv) != 2:
print 'usage: [edge pair input path]'
exit(1)
with open(sys.argv[1], 'r') as fi:
node_dict = {}
for line in fi:
tmp = line.split()
src = int(tmp[0])
if src not in node_dict:
node_dict[src] = 1
else:
node_dict[src]... | 0 | 0 | 0 |
1658ee280f3440ab4466219888be9de4ead0bb43 | 2,159 | py | Python | derivativetest.py | syangliu/Newton-MR-grad | bf17cac404f0d0c92d5852e265162cc82fe3fefd | [
"Apache-2.0"
] | 1 | 2022-03-31T05:15:31.000Z | 2022-03-31T05:15:31.000Z | derivativetest.py | syangliu/Newton-MR | bf17cac404f0d0c92d5852e265162cc82fe3fefd | [
"Apache-2.0"
] | null | null | null | derivativetest.py | syangliu/Newton-MR | bf17cac404f0d0c92d5852e265162cc82fe3fefd | [
"Apache-2.0"
] | 1 | 2022-03-20T00:11:03.000Z | 2022-03-20T00:11:03.000Z | import numpy as np
import numpy.random as rand
import matplotlib.pyplot as plt
from numpy.linalg import norm
def derivativetest(fun, x0):
"""
Test the gradient and Hessian of a function. A large proportion
parallel in the middle of both plots means accuraccy.
INPUTS:
fun: a function handle tha... | 29.175676 | 76 | 0.548865 | import numpy as np
import numpy.random as rand
import matplotlib.pyplot as plt
from numpy.linalg import norm
def derivativetest(fun, x0):
"""
Test the gradient and Hessian of a function. A large proportion
parallel in the middle of both plots means accuraccy.
INPUTS:
fun: a function handle tha... | 75 | 0 | 23 |
dc248dbf9ee291025d20284dbe3dde3da67d21fa | 6,222 | py | Python | dt_stripe/migrations/0001_initial.py | itsnamgyu/api-demo | ddf726928bd7f1021143c4dbb530e3017a3edda9 | [
"MIT"
] | 1 | 2019-06-02T08:20:38.000Z | 2019-06-02T08:20:38.000Z | dt_stripe/migrations/0001_initial.py | itsnamgyu/api-demo | ddf726928bd7f1021143c4dbb530e3017a3edda9 | [
"MIT"
] | 12 | 2019-07-21T18:40:35.000Z | 2019-10-05T19:57:49.000Z | dt_stripe/migrations/0001_initial.py | itsnamgyu/django-template | 20f64974e0dda69cf8dcf0dac9e0a309f200fb61 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-09-23 23:32
from django.db import migrations, models
import django.db.models.deletion
| 69.133333 | 272 | 0.624558 | # Generated by Django 2.2.4 on 2019-09-23 23:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Customer',
fields=[
... | 0 | 6,075 | 23 |
ae20cf10f08092916ececf243f8198d8ffd52c36 | 2,915 | py | Python | tests/sett/test_upgrade_crv_setts.py | shuklaayush/badger-system | 1274eadbd0b0f3a02efbf40702719ce1d0a96c44 | [
"MIT"
] | 99 | 2020-12-02T08:40:48.000Z | 2022-03-15T05:21:06.000Z | tests/sett/test_upgrade_crv_setts.py | shuklaayush/badger-system | 1274eadbd0b0f3a02efbf40702719ce1d0a96c44 | [
"MIT"
] | 115 | 2020-12-15T07:15:39.000Z | 2022-03-28T22:21:03.000Z | tests/sett/test_upgrade_crv_setts.py | shuklaayush/badger-system | 1274eadbd0b0f3a02efbf40702719ce1d0a96c44 | [
"MIT"
] | 56 | 2020-12-11T06:50:04.000Z | 2022-02-21T09:17:38.000Z | import pytest
from brownie import Contract, chain, interface
from rich.console import Console
from helpers.sett.SnapshotManager import SnapshotManager
from helpers.sett.simulation.SimulationManager import SimulationManager
from helpers.registry import registry
from helpers.registry.artifacts import artifacts
from help... | 32.388889 | 71 | 0.797942 | import pytest
from brownie import Contract, chain, interface
from rich.console import Console
from helpers.sett.SnapshotManager import SnapshotManager
from helpers.sett.simulation.SimulationManager import SimulationManager
from helpers.registry import registry
from helpers.registry.artifacts import artifacts
from help... | 1,590 | 0 | 22 |
7dff39fe5f92e51a87e2ac41d42efa20ffd5a3e0 | 4,215 | py | Python | wideq/refrigerator.py | davewatson91/wideq | 3746447a1321d4a03e715c110bd8b150256cf6d1 | [
"MIT"
] | 2 | 2021-03-25T22:22:23.000Z | 2021-04-20T05:44:26.000Z | wideq/refrigerator.py | davewatson91/wideq | 3746447a1321d4a03e715c110bd8b150256cf6d1 | [
"MIT"
] | 1 | 2021-04-20T05:43:32.000Z | 2021-04-20T05:46:56.000Z | wideq/refrigerator.py | davewatson91/wideq | 3746447a1321d4a03e715c110bd8b150256cf6d1 | [
"MIT"
] | 3 | 2021-04-20T05:45:25.000Z | 2021-06-04T23:57:17.000Z | import enum
from typing import Optional
from .client import Device
from .util import lookup_enum
class RefrigeratorDevice(Device):
"""A higher-level interface for a refrigerator."""
def set_temp_refrigerator_c(self, temp):
"""Set the refrigerator temperature in Celsius.
"""
value ... | 29.893617 | 76 | 0.671886 | import enum
from typing import Optional
from .client import Device
from .util import lookup_enum
class IcePlus(enum.Enum):
OFF = "@CP_OFF_EN_W"
ON = "@CP_ON_EN_W"
ICE_PLUS = "@RE_TERM_ICE_PLUS_W"
ICE_PLUS_FREEZE = "@RE_MAIN_SPEED_FREEZE_TERM_W"
ICE_PLUS_OFF = "@CP_TERM_OFF_KO_W"
class FreshAirF... | 1,326 | 872 | 408 |
75331b011bd2fbc98c3034f1d5e7ec1e561ea62b | 780 | py | Python | ursinanetworking/examples/QTChat/server.py | nutanstrek/UrsinaNetworking | f505f073f9a25f9f79fa0a1c059aeed6661377e0 | [
"MIT"
] | 38 | 2021-04-06T05:07:24.000Z | 2022-03-29T01:44:10.000Z | ursinanetworking/examples/QTChat/server.py | nutanstrek/UrsinaNetworking | f505f073f9a25f9f79fa0a1c059aeed6661377e0 | [
"MIT"
] | 3 | 2021-04-11T02:24:19.000Z | 2022-03-29T03:34:19.000Z | ursinanetworking/examples/QTChat/server.py | nutanstrek/UrsinaNetworking | f505f073f9a25f9f79fa0a1c059aeed6661377e0 | [
"MIT"
] | 6 | 2021-04-06T12:01:25.000Z | 2022-03-28T20:12:10.000Z | from ursinanetworking import *
Server = UrsinaNetworkingServer("localhost", 25565)
@Server.event
@Server.event
while True:
Server.process_net_events() | 30 | 85 | 0.694872 | from ursinanetworking import *
Server = UrsinaNetworkingServer("localhost", 25565)
def broadcast_message(message, author):
Server.broadcast("receive_message", {"message" : message, "author" : author})
@Server.event
def onClientConnected(client):
client.registered = False
#broadcast_message(f"{client} con... | 557 | 0 | 67 |
43e6bb65360a0bc2d24721dd4aa6582d161eb065 | 2,575 | py | Python | src/day8.py | chao-mu/aoc2021 | 9cb0590a8de100f260a78f22e50d00d6acb13ae4 | [
"CC0-1.0"
] | null | null | null | src/day8.py | chao-mu/aoc2021 | 9cb0590a8de100f260a78f22e50d00d6acb13ae4 | [
"CC0-1.0"
] | null | null | null | src/day8.py | chao-mu/aoc2021 | 9cb0590a8de100f260a78f22e50d00d6acb13ae4 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
from aoc2021.util import print_solutions, import_strs
from math import inf
from itertools import permutations
import copy
Numbers = {
"abcefg": 0,
"cf": 1,
"acdeg": 2,
"acdfg": 3,
"bcdf": 4,
"abdfg": 5,
"abdefg": 6,
"acf": 7,
"abcdefg": 8,
"abcdfg": 9
... | 22.198276 | 76 | 0.553398 | #!/usr/bin/env python3
from aoc2021.util import print_solutions, import_strs
from math import inf
from itertools import permutations
import copy
def part_1(clock):
uniqs = 0
for face in clock:
_, signals = face
for signal in signals:
if len(signal) in [2, 4, 3, 7]:
... | 2,076 | 0 | 138 |
4344fa9db3e3548e4b2450324536e75bc3e05d90 | 1,660 | py | Python | CUT/experiments/__init__.py | Theomat/colorization-av-enseirb-2020 | c54c2388ea39a62289fa2f1c51b4757bf55d3c4f | [
"Apache-2.0"
] | 1,422 | 2020-07-31T00:31:19.000Z | 2022-03-31T11:35:26.000Z | CUT/experiments/__init__.py | Theomat/colorization-av-enseirb-2020 | c54c2388ea39a62289fa2f1c51b4757bf55d3c4f | [
"Apache-2.0"
] | 123 | 2020-07-31T04:16:03.000Z | 2022-03-21T14:02:20.000Z | CUT/experiments/__init__.py | Theomat/colorization-av-enseirb-2020 | c54c2388ea39a62289fa2f1c51b4757bf55d3c4f | [
"Apache-2.0"
] | 324 | 2020-07-31T00:40:11.000Z | 2022-03-31T10:01:10.000Z | import os
import importlib
if __name__ == "__main__":
import sys
import pickle
assert len(sys.argv) >= 3
name = sys.argv[1]
Launcher = find_launcher_using_name(name)
cache = "/tmp/tmux_launcher/{}".format(name)
if os.path.isfile(cache):
instance = pickle.load(open(cache, 'r'))
... | 30.181818 | 80 | 0.633735 | import os
import importlib
def find_launcher_using_name(launcher_name):
# cur_dir = os.path.dirname(os.path.abspath(__file__))
# pythonfiles = glob.glob(cur_dir + '/**/*.py')
launcher_filename = "experiments.{}_launcher".format(launcher_name)
launcherlib = importlib.import_module(launcher_filename)
... | 927 | 0 | 23 |
f2c84250d49b0b78d8283962f1d175aafa4b43ad | 2,366 | py | Python | tools/gyp_jc3_handling_editor.py | xforce/jc3-handling-editor | 48485e91ef3ce0e2849ae5f5aae1ef40f989c4c6 | [
"MIT"
] | 4 | 2016-11-25T12:45:35.000Z | 2020-02-20T21:55:49.000Z | tools/gyp_jc3_handling_editor.py | xforce/jc3-handling-editor | 48485e91ef3ce0e2849ae5f5aae1ef40f989c4c6 | [
"MIT"
] | 6 | 2016-11-21T19:32:47.000Z | 2017-03-21T17:18:43.000Z | tools/gyp_jc3_handling_editor.py | xforce/jc3-handling-editor | 48485e91ef3ce0e2849ae5f5aae1ef40f989c4c6 | [
"MIT"
] | 2 | 2016-11-20T21:05:41.000Z | 2022-01-31T02:19:12.000Z | #!/usr/bin/env python
import glob
import os
import shlex
import sys
import platform
script_dir = os.path.dirname(__file__)
jc3_handling_editor_root = os.path.normpath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.abspath(os.path.join(jc3_handling_editor_root, 'tools')))
sys.path.insert(0, os.path.j... | 35.313433 | 99 | 0.724852 | #!/usr/bin/env python
import glob
import os
import shlex
import sys
import platform
script_dir = os.path.dirname(__file__)
jc3_handling_editor_root = os.path.normpath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.abspath(os.path.join(jc3_handling_editor_root, 'tools')))
sys.path.insert(0, os.path.j... | 80 | 0 | 23 |
04f5b502729ac86c25e910f36933883cca287f3f | 627 | py | Python | sliceprovider/ResourceManagement.py | fernnf/idc | 6abf0e55467ab2b2cd3a22b869b3e0698ebfc5d2 | [
"Apache-2.0"
] | null | null | null | sliceprovider/ResourceManagement.py | fernnf/idc | 6abf0e55467ab2b2cd3a22b869b3e0698ebfc5d2 | [
"Apache-2.0"
] | 3 | 2018-08-16T14:35:11.000Z | 2018-08-16T14:52:12.000Z | sliceprovider/ResourceManagement.py | fernnf/idc | 6abf0e55467ab2b2cd3a22b869b3e0698ebfc5d2 | [
"Apache-2.0"
] | null | null | null | """
Res. & VM Mgmt. component of the Infrastructure Management & Abstraction (IMA)
Interacts with Docker to replicate the container from origin to destiny
"""
from docker import APIClient
| 27.26087 | 78 | 0.740032 | """
Res. & VM Mgmt. component of the Infrastructure Management & Abstraction (IMA)
Interacts with Docker to replicate the container from origin to destiny
"""
from docker import APIClient
def replicateContainer(containerID, orig_url, dest_url):
orig_client = APIClient(base_url=orig_url, tlf=False)
dest_client = AP... | 416 | 0 | 23 |
1207bd1d9849c7d09ef1136111f4fbe44b5966be | 3,921 | py | Python | src/parser.py | zhexiongliu/Nasdaq-ITCH-5.0-VWAP | aa78482171d2172d4feeb826b78e00dee195c181 | [
"MIT"
] | 9 | 2019-06-04T14:08:17.000Z | 2021-11-24T12:02:57.000Z | src/parser.py | zhexiongliu/Nasdaq-ITCH-5.0-VWAP | aa78482171d2172d4feeb826b78e00dee195c181 | [
"MIT"
] | null | null | null | src/parser.py | zhexiongliu/Nasdaq-ITCH-5.0-VWAP | aa78482171d2172d4feeb826b78e00dee195c181 | [
"MIT"
] | 2 | 2019-10-06T01:47:26.000Z | 2022-01-10T13:20:58.000Z | import gzip
import struct
import datetime
import pandas as pd
import os
if __name__ == '__main__':
bin_data = gzip.open(os.path.join('..', 'res', '08302019.NASDAQ_ITCH50.gz'), 'rb')
msg_header = bin_data.read(1)
itch = ITCH()
while msg_header:
if msg_header == "S":
message = itc... | 29.261194 | 115 | 0.530477 | import gzip
import struct
import datetime
import pandas as pd
import os
class ITCH():
def __init__(self):
self.temp = []
self.flag = None
if not os.path.exists(os.path.join('.', 'output')):
os.makedirs(os.path.join('.', 'output'))
def get_binary(self, size):
read ... | 1,886 | -8 | 185 |
c5ab311027e4d350a3a36cc33e8cee4864e34548 | 198 | py | Python | 4.py | lzbferrari/ljb_python | e545891c707e412bb12601c94b456be721c85573 | [
"MIT"
] | null | null | null | 4.py | lzbferrari/ljb_python | e545891c707e412bb12601c94b456be721c85573 | [
"MIT"
] | null | null | null | 4.py | lzbferrari/ljb_python | e545891c707e412bb12601c94b456be721c85573 | [
"MIT"
] | null | null | null | '''
创造一个变量他等于5如果这个变量小于10会打印我打得过那些忍者,小于30会打印有点难,不过我能应付如果小于50会打印太多了
'''
ninjas = 5
if ninjas < 10:
print('我打得过那些忍者')
elif ninjas < 30:
print('有点难,不过我能应付')
elif ninjas < 50:
print('太多了')
| 15.230769 | 61 | 0.681818 | '''
创造一个变量他等于5如果这个变量小于10会打印我打得过那些忍者,小于30会打印有点难,不过我能应付如果小于50会打印太多了
'''
ninjas = 5
if ninjas < 10:
print('我打得过那些忍者')
elif ninjas < 30:
print('有点难,不过我能应付')
elif ninjas < 50:
print('太多了')
| 0 | 0 | 0 |
0d8cdabb6bfa49bc5a270e7bc3fa38275087f891 | 1,273 | py | Python | tests/ut/python/parallel/test_auto_parallel_inference.py | doc22940/mindspore | 21bcdcd8adb97b9171b2822a7ed2c4c138c99607 | [
"Apache-2.0"
] | 1 | 2020-05-13T11:31:21.000Z | 2020-05-13T11:31:21.000Z | tests/ut/python/parallel/test_auto_parallel_inference.py | doc22940/mindspore | 21bcdcd8adb97b9171b2822a7ed2c4c138c99607 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/parallel/test_auto_parallel_inference.py | doc22940/mindspore | 21bcdcd8adb97b9171b2822a7ed2c4c138c99607 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import mindspore.nn as nn
from mindspore import Tensor, context
from mindspore.ops import operations as P
from mindspore.nn import WithLossCell, TrainOneStepCell
from mindspore.nn import Momentum
from mindspore.parallel._cost_model_context import set_cost_model_context | 34.405405 | 88 | 0.728987 | import numpy as np
import mindspore.nn as nn
from mindspore import Tensor, context
from mindspore.ops import operations as P
from mindspore.nn import WithLossCell, TrainOneStepCell
from mindspore.nn import Momentum
from mindspore.parallel._cost_model_context import set_cost_model_context
class Net(nn.Cell):
def _... | 887 | -2 | 99 |
f9da18cdb4b8afbbf3b00ddbb3ca9a4c8a07f66c | 2,043 | py | Python | agua_amiga/gui/streak_window.py | mpnordland/agua_amiga | abbfaceea6aa90332a7782c2ea6d01f1fec1d41a | [
"MIT"
] | 2 | 2022-01-04T10:35:24.000Z | 2022-02-02T21:51:25.000Z | agua_amiga/gui/streak_window.py | mpnordland/agua_amiga | abbfaceea6aa90332a7782c2ea6d01f1fec1d41a | [
"MIT"
] | null | null | null | agua_amiga/gui/streak_window.py | mpnordland/agua_amiga | abbfaceea6aa90332a7782c2ea6d01f1fec1d41a | [
"MIT"
] | null | null | null | from gi.repository import GLib, Gio, Gtk
from datetime import datetime, timedelta, date
from agua_amiga.datastore import Datastore, convert_from_display_to_mL, convert_from_mL_to_display
@Gtk.Template.from_file("ui_definitions/StreakWindow.glade") | 38.54717 | 160 | 0.657367 | from gi.repository import GLib, Gio, Gtk
from datetime import datetime, timedelta, date
from agua_amiga.datastore import Datastore, convert_from_display_to_mL, convert_from_mL_to_display
@Gtk.Template.from_file("ui_definitions/StreakWindow.glade")
class StreakWindow(Gtk.Window):
__gtype_name__ = "StreakWindow"
... | 1,555 | 217 | 22 |
1102cf09a961527fe7f8f6eccb81022c752e0bfc | 957 | py | Python | subset.py | zygmuntz/phraug2 | ef2a6d42008b31024407208d2b9798ddddc2b7a5 | [
"BSD-2-Clause"
] | 190 | 2015-01-14T15:32:30.000Z | 2022-02-17T08:18:27.000Z | subset.py | zygmuntz/phraug2 | ef2a6d42008b31024407208d2b9798ddddc2b7a5 | [
"BSD-2-Clause"
] | 6 | 2015-04-24T17:07:08.000Z | 2020-01-13T10:07:37.000Z | subset.py | zygmuntz/phraug2 | ef2a6d42008b31024407208d2b9798ddddc2b7a5 | [
"BSD-2-Clause"
] | 69 | 2015-01-25T19:49:42.000Z | 2021-02-10T05:24:34.000Z | 'Save a subset of lines from an input file; start at offset and count n lines'
'default 100 lines starting from 0'
import sys
import argparse
parser = argparse.ArgumentParser( description = "Save a subset of lines from the input file to the output file" )
parser.add_argument( "input_file", help = "path to input file"... | 19.9375 | 113 | 0.668757 | 'Save a subset of lines from an input file; start at offset and count n lines'
'default 100 lines starting from 0'
import sys
import argparse
parser = argparse.ArgumentParser( description = "Save a subset of lines from the input file to the output file" )
parser.add_argument( "input_file", help = "path to input file"... | 0 | 0 | 0 |
6e26e1f0af0b391c2d44a64eeef08c7927ec934b | 13,401 | py | Python | pygw2/core/models/character.py | Natsku123/pygw2 | c8e579c07f4d33c7afadc8dee510be0a5e71d16e | [
"MIT"
] | 1 | 2020-01-19T21:27:53.000Z | 2020-01-19T21:27:53.000Z | pygw2/core/models/character.py | Natsku123/pygw2 | c8e579c07f4d33c7afadc8dee510be0a5e71d16e | [
"MIT"
] | 1 | 2021-12-09T21:18:13.000Z | 2021-12-09T21:18:13.000Z | pygw2/core/models/character.py | Natsku123/pygw2 | c8e579c07f4d33c7afadc8dee510be0a5e71d16e | [
"MIT"
] | null | null | null | import datetime
from typing import Optional, List, Union, TYPE_CHECKING
from pygw2.core.enums import *
from pygw2.utils import LazyLoader, BaseModel
if TYPE_CHECKING:
from pygw2.core.models.pvp import PvPEquipment
from pygw2.core.models.sab import SAB
from pygw2.core.models.guild import Guild
from pyg... | 23.428322 | 85 | 0.676367 | import datetime
from typing import Optional, List, Union, TYPE_CHECKING
from pygw2.core.enums import *
from pygw2.utils import LazyLoader, BaseModel
if TYPE_CHECKING:
from pygw2.core.models.pvp import PvPEquipment
from pygw2.core.models.sab import SAB
from pygw2.core.models.guild import Guild
from pyg... | 3,203 | 8,859 | 736 |
531964ba161ada42348b3db5388f68060006c2ec | 2,423 | py | Python | plotter.py | BartlomiejF/ParHumidSensor | 4782a0ae646c13d037fbe9bceda2d6ec5c440b72 | [
"MIT"
] | null | null | null | plotter.py | BartlomiejF/ParHumidSensor | 4782a0ae646c13d037fbe9bceda2d6ec5c440b72 | [
"MIT"
] | null | null | null | plotter.py | BartlomiejF/ParHumidSensor | 4782a0ae646c13d037fbe9bceda2d6ec5c440b72 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
from io import BytesIO
import base64
| 41.775862 | 96 | 0.666116 | import pandas as pd
import matplotlib.pyplot as plt
from io import BytesIO
import base64
def plot(airqualjson=None, temphumidjson=None):
# carnb_data = pd.DataFrame.from_dict(carnbjson)
figdata_airqual_png = None
figdata_temphumid_png = None
if airqualjson is not None:
airqual_data = pd.DataF... | 2,310 | 0 | 23 |
0c09238973033b093fa0969c6f3f3f36233309e5 | 1,906 | py | Python | src/sentry/api/bases/team.py | augustand/sentry | 9e5e0b6744d878d623f483661e40c49bb902047c | [
"BSD-3-Clause"
] | 1 | 2021-08-10T06:07:13.000Z | 2021-08-10T06:07:13.000Z | src/sentry/api/bases/team.py | augustand/sentry | 9e5e0b6744d878d623f483661e40c49bb902047c | [
"BSD-3-Clause"
] | 5 | 2019-12-28T18:13:59.000Z | 2022-03-02T04:32:45.000Z | src/sentry/api/bases/team.py | augustand/sentry | 9e5e0b6744d878d623f483661e40c49bb902047c | [
"BSD-3-Clause"
] | 1 | 2017-04-08T04:09:18.000Z | 2017-04-08T04:09:18.000Z | from __future__ import absolute_import
from sentry.api.base import Endpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.app import raven
from sentry.models import Team, TeamStatus
from sentry.models.apikey import ROOT_KEY
from .organization import OrganizationPermission
| 31.245902 | 83 | 0.643757 | from __future__ import absolute_import
from sentry.api.base import Endpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.app import raven
from sentry.models import Team, TeamStatus
from sentry.models.apikey import ROOT_KEY
from .organization import OrganizationPermission
class TeamPermission(O... | 1,222 | 340 | 46 |
8e5dd8d936892226fc66c24989ea52dcf046dedb | 663 | py | Python | PyNEng/To-Do Task 5.2b.py | fugrusha/education | 89712a93e0727e94543cb252482920a503135c7f | [
"MIT"
] | null | null | null | PyNEng/To-Do Task 5.2b.py | fugrusha/education | 89712a93e0727e94543cb252482920a503135c7f | [
"MIT"
] | null | null | null | PyNEng/To-Do Task 5.2b.py | fugrusha/education | 89712a93e0727e94543cb252482920a503135c7f | [
"MIT"
] | null | null | null | # Задание 5.2b
london_co = {
'r1' : {
'location': '21 New Globe Walk',
'vendor': 'Cisco',
'model': '4451',
'ios': '15.4',
'ip': '10.255.0.1'
},
'r2' : {
'location': '21 New Globe Walk',
'vendor': 'Cisco',
'model': '4451',
'ios': '15.4',
'ip': '10.255.0.2'
},
... | 20.090909 | 54 | 0.493213 | # Задание 5.2b
london_co = {
'r1' : {
'location': '21 New Globe Walk',
'vendor': 'Cisco',
'model': '4451',
'ios': '15.4',
'ip': '10.255.0.1'
},
'r2' : {
'location': '21 New Globe Walk',
'vendor': 'Cisco',
'model': '4451',
'ios': '15.4',
'ip': '10.255.0.2'
},
... | 0 | 0 | 0 |
86bc01aa6a0d9b9a74b765460b3330e59f59daef | 1,857 | py | Python | src/snovault/elasticsearch/searches/interfaces.py | caseylitton/snovault | cfaace963bc9b1ca87bca4739b380c559026bcfb | [
"MIT"
] | null | null | null | src/snovault/elasticsearch/searches/interfaces.py | caseylitton/snovault | cfaace963bc9b1ca87bca4739b380c559026bcfb | [
"MIT"
] | null | null | null | src/snovault/elasticsearch/searches/interfaces.py | caseylitton/snovault | cfaace963bc9b1ca87bca4739b380c559026bcfb | [
"MIT"
] | null | null | null | ADVANCED_QUERY_KEY = 'advancedQuery'
ALL = 'all'
AND = 'AND'
AND_JOIN = ' AND '
AND_NOT_JOIN = ' AND NOT '
APPENDED = 'appended'
APPLICATION_JSON = 'application/json'
ASC = 'asc'
AT_ID = '@id'
AT_CONTEXT = '@context'
AT_TYPE = '@type'
AUDIT = 'audit'
AUDIT_TITLE = 'Audit'
BOOL = 'bool'
BOOST_VALUES = 'boost_values'
BUC... | 21.102273 | 51 | 0.706516 | ADVANCED_QUERY_KEY = 'advancedQuery'
ALL = 'all'
AND = 'AND'
AND_JOIN = ' AND '
AND_NOT_JOIN = ' AND NOT '
APPENDED = 'appended'
APPLICATION_JSON = 'application/json'
ASC = 'asc'
AT_ID = '@id'
AT_CONTEXT = '@context'
AT_TYPE = '@type'
AUDIT = 'audit'
AUDIT_TITLE = 'Audit'
BOOL = 'bool'
BOOST_VALUES = 'boost_values'
BUC... | 0 | 0 | 0 |
bbed43c689132df7b14e284f2ed94a474f88d84a | 399 | py | Python | tests/conftest.py | dajor/youtube2 | 390a701c0de3cb7dd6240a775b980edda150c376 | [
"MIT"
] | null | null | null | tests/conftest.py | dajor/youtube2 | 390a701c0de3cb7dd6240a775b980edda150c376 | [
"MIT"
] | null | null | null | tests/conftest.py | dajor/youtube2 | 390a701c0de3cb7dd6240a775b980edda150c376 | [
"MIT"
] | null | null | null | import pytest
from app.app import create_app
@pytest.fixture()
@pytest.fixture()
@pytest.fixture()
| 13.3 | 37 | 0.606516 | import pytest
from app.app import create_app
@pytest.fixture()
def app():
app = create_app()
app.config.update(
{
"TESTING": True,
}
)
# other setup can go here
yield app
# clean up / reset resources here
@pytest.fixture()
def client(app):
return app.test_... | 227 | 0 | 66 |
6c171d09be3d70b2660fd3b47e32ad03e08cc1fc | 29,122 | py | Python | src/charm.py | stgraber/charm-lxd | 48c4b56a50902f9dcaebe6d3f80911927bab09ab | [
"Apache-2.0"
] | null | null | null | src/charm.py | stgraber/charm-lxd | 48c4b56a50902f9dcaebe6d3f80911927bab09ab | [
"Apache-2.0"
] | null | null | null | src/charm.py | stgraber/charm-lxd | 48c4b56a50902f9dcaebe6d3f80911927bab09ab | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""LXD charm."""
import logging
import os
import shutil
import subprocess
import tarfile
import tempfile
from urllib.error import HTTPError, URLError
from urllib.request import urlopen
from ops.charm import (
ActionEvent,
CharmBase,
ConfigChangedEvent,
InstallEvent,
StartEv... | 37.576774 | 99 | 0.571836 | #!/usr/bin/env python3
"""LXD charm."""
import logging
import os
import shutil
import subprocess
import tarfile
import tempfile
from urllib.error import HTTPError, URLError
from urllib.request import urlopen
from ops.charm import (
ActionEvent,
CharmBase,
ConfigChangedEvent,
InstallEvent,
StartEv... | 2,791 | 0 | 81 |
e78f3c1f96b6fb488ed74ffb65acfec6dce420a4 | 5,332 | py | Python | textube.py | mmjakub/textube | 118db7a6734e4484ce9d33916322a912277086ac | [
"BSD-2-Clause"
] | null | null | null | textube.py | mmjakub/textube | 118db7a6734e4484ce9d33916322a912277086ac | [
"BSD-2-Clause"
] | null | null | null | textube.py | mmjakub/textube | 118db7a6734e4484ce9d33916322a912277086ac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3.9
import base64
import html
from http.client import HTTPSConnection
import json
import threading
import urllib.parse
if __name__ == "__main__":
import argparse
import concurrent.futures as cofu
import logging
import pathlib
import sys
parser = argparse.ArgumentParser(
... | 37.027778 | 111 | 0.67123 | #!/usr/bin/env python3.9
import base64
import html
from http.client import HTTPSConnection
import json
import threading
import urllib.parse
class ConnectionManager():
_thread_local = threading.local()
_thread_local.gapis = HTTPSConnection('www.googleapis.com')
_thread_local.yt = HTTPSConnection('www.yout... | 2,587 | 350 | 234 |
fd6f0427dc3f1f96809c38df7ca11b783c62bcca | 6,777 | py | Python | main.py | codewithlennylen/GAS-LAWS | 1420d2e68d029d2fc137cc909b5398e67be4f0c6 | [
"MIT"
] | null | null | null | main.py | codewithlennylen/GAS-LAWS | 1420d2e68d029d2fc137cc909b5398e67be4f0c6 | [
"MIT"
] | null | null | null | main.py | codewithlennylen/GAS-LAWS | 1420d2e68d029d2fc137cc909b5398e67be4f0c6 | [
"MIT"
] | null | null | null | import pygame
import random
pygame.init()
WIDTH, HEIGHT = 960, 700
SCREEN = pygame.display.set_mode((WIDTH, HEIGHT))
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
BLUE = (0, 0, 255)
CLOCK = pygame.time.Clock()
FPS = 30
particles_list = []
container = Container(500, 500)
generate_particles(contai... | 35.668421 | 147 | 0.614284 | import pygame
import random
pygame.init()
WIDTH, HEIGHT = 960, 700
SCREEN = pygame.display.set_mode((WIDTH, HEIGHT))
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
BLUE = (0, 0, 255)
CLOCK = pygame.time.Clock()
FPS = 30
particles_list = []
class Container(object):
def __init__(self, width=600, h... | 603 | 4,514 | 122 |
3363492ff5f446b8195aa3dfd8957d55562fe848 | 4,835 | py | Python | submit_scripts_and_plotting/paper_plots/make_interpretation_plots.py | apizzuto/v2_alert_stacking_FRA | 6b5bd3f6cd1b5e472797a81a389a30198c64cd9f | [
"MIT"
] | null | null | null | submit_scripts_and_plotting/paper_plots/make_interpretation_plots.py | apizzuto/v2_alert_stacking_FRA | 6b5bd3f6cd1b5e472797a81a389a30198c64cd9f | [
"MIT"
] | 4 | 2021-01-08T20:14:23.000Z | 2021-03-25T21:05:15.000Z | submit_scripts_and_plotting/paper_plots/make_interpretation_plots.py | apizzuto/v2_alert_stacking_FRA | 6b5bd3f6cd1b5e472797a81a389a30198c64cd9f | [
"MIT"
] | null | null | null | '''Script to make all interpretation based plots
for the alert followup fast response paper'''
import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy.stats as st
from francis import utils
from results_utils import *
from francis.universe.universe_plotter import UniversePlott... | 37.192308 | 96 | 0.583247 | '''Script to make all interpretation based plots
for the alert followup fast response paper'''
import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy.stats as st
from francis import utils
from results_utils import *
from francis.universe.universe_plotter import UniversePlott... | 3,990 | 0 | 100 |
b4ffc6d69f9d120135e6f21d3579c97210bec686 | 957 | py | Python | tests/test_igit.py | jmosbacher/igit | 62b613fd5bed28b603160dc998c02106ee4fdef0 | [
"Apache-2.0"
] | null | null | null | tests/test_igit.py | jmosbacher/igit | 62b613fd5bed28b603160dc998c02106ee4fdef0 | [
"Apache-2.0"
] | 107 | 2021-06-28T02:10:11.000Z | 2022-03-30T02:38:03.000Z | tests/test_igit.py | jmosbacher/igit | 62b613fd5bed28b603160dc998c02106ee4fdef0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Tests for `igit` package."""
# pylint: disable=redefined-outer-name
import random
import pytest
import igit
@pytest.fixture(scope="module")
| 22.255814 | 62 | 0.654127 | #!/usr/bin/env python
"""Tests for `igit` package."""
# pylint: disable=redefined-outer-name
import random
import pytest
import igit
@pytest.fixture(scope="module")
def memory_repo():
return igit.init("memory://igit_test")
def test_interval_tree():
tree = igit.IntervalTree()
tree[1, 10] = 9
asser... | 693 | 0 | 91 |
79a11c886a6c2abb67ccf6ef4d9891b92e62ae1b | 1,191 | py | Python | projects/nncrystal/tools/export_dataset.py | nncrystals/detectron2 | ea5dcbbb135a62807cacded5a381253d1f605427 | [
"Apache-2.0"
] | null | null | null | projects/nncrystal/tools/export_dataset.py | nncrystals/detectron2 | ea5dcbbb135a62807cacded5a381253d1f605427 | [
"Apache-2.0"
] | null | null | null | projects/nncrystal/tools/export_dataset.py | nncrystals/detectron2 | ea5dcbbb135a62807cacded5a381253d1f605427 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import os
from xml.etree import ElementTree
from cvat.api import CVATAPI
from cvat.argument import cvat_args
from cvat.cvat_xml import cvat_xml_to_coco
if __name__ == '__main__':
parser = argparse.ArgumentParser()
cvat_args(parser)
parser.add_argument("--job_id", action="append... | 34.028571 | 93 | 0.619647 | import argparse
import json
import os
from xml.etree import ElementTree
from cvat.api import CVATAPI
from cvat.argument import cvat_args
from cvat.cvat_xml import cvat_xml_to_coco
if __name__ == '__main__':
parser = argparse.ArgumentParser()
cvat_args(parser)
parser.add_argument("--job_id", action="append... | 0 | 0 | 0 |
5522a16200a742cf8ad364ad9d24d6f9e876d0e7 | 1,533 | py | Python | apps/user/views.py | Agrimonia/Mobileshop | 1922572c7652aa85f4676a66fc49e456f560d120 | [
"MIT"
] | 4 | 2017-12-17T13:41:31.000Z | 2018-09-22T06:17:14.000Z | apps/user/views.py | Agrimonia/Mobileshop | 1922572c7652aa85f4676a66fc49e456f560d120 | [
"MIT"
] | 2 | 2017-12-16T08:30:13.000Z | 2020-01-09T03:21:43.000Z | apps/user/views.py | Agrimonia/Mobileshop | 1922572c7652aa85f4676a66fc49e456f560d120 | [
"MIT"
] | 1 | 2017-12-04T13:55:12.000Z | 2017-12-04T13:55:12.000Z | # from django.shortcuts import render
import json
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import AllowAny
from backend.helpers import InputErrorMessage, JSONResponse
from .models import UserSerialiser, User
... | 36.5 | 114 | 0.668624 | # from django.shortcuts import render
import json
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import AllowAny
from backend.helpers import InputErrorMessage, JSONResponse
from .models import UserSerialiser, User
... | 1,040 | 75 | 71 |