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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6b14f7437ca14e5b3781f258d21af0a221b6b30b | 646 | py | Python | day08_1.py | filippocorradino/advent_of_code_2020 | be46aabf8c58e4e96f541f3555646e1a4875861a | [
"MIT"
] | 1 | 2020-12-01T09:28:43.000Z | 2020-12-01T09:28:43.000Z | day08_1.py | filippocorradino/advent_of_code_2020 | be46aabf8c58e4e96f541f3555646e1a4875861a | [
"MIT"
] | null | null | null | day08_1.py | filippocorradino/advent_of_code_2020 | be46aabf8c58e4e96f541f3555646e1a4875861a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
Advent of Code 2020 - Day 8 - Challenge 1
https://adventofcode.com/2020/day/8
Solution: 1384
"""
__author__ = "Filippo Corradino"
__email__ = "filippo.corradino@gmail.com"
from aocmodule import Processor
if __name__ == "__main__":
main()
| 20.83871 | 71 | 0.69195 | #!/usr/bin/env python
# encoding: utf-8
"""
Advent of Code 2020 - Day 8 - Challenge 1
https://adventofcode.com/2020/day/8
Solution: 1384
"""
__author__ = "Filippo Corradino"
__email__ = "filippo.corradino@gmail.com"
from aocmodule import Processor
def main(ifile='inputs/day_08_input.txt'):
handheld = Processo... | 330 | 0 | 23 |
8a446e0520dbc10186a90890022585b162d03c89 | 83,256 | py | Python | software/goagent-3.2.3/local/proxy.py | foolcage/backup | 8d0457e3a042ed1777422109711998c971c8ad84 | [
"Apache-2.0"
] | null | null | null | software/goagent-3.2.3/local/proxy.py | foolcage/backup | 8d0457e3a042ed1777422109711998c971c8ad84 | [
"Apache-2.0"
] | null | null | null | software/goagent-3.2.3/local/proxy.py | foolcage/backup | 8d0457e3a042ed1777422109711998c971c8ad84 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
# Based on GAppProxy 2.0.0 by Du XiaoGang <dugang.2008@gmail.com>
# Based on WallProxy 0.4.0 by Hust Moon <www.ehust@gmail.com>
# Contributor:
# Phus Lu <phus.lu@gmail.com>
# Hewig Xu <hewigovens@gmail.com>
# Ayanamist Yang <ayanamist@gmail.com>
... | 49.913669 | 265 | 0.564464 | #!/usr/bin/env python
# coding:utf-8
# Based on GAppProxy 2.0.0 by Du XiaoGang <dugang.2008@gmail.com>
# Based on WallProxy 0.4.0 by Hust Moon <www.ehust@gmail.com>
# Contributor:
# Phus Lu <phus.lu@gmail.com>
# Hewig Xu <hewigovens@gmail.com>
# Ayanamist Yang <ayanamist@gmail.com>
... | 48,046 | 479 | 655 |
319d2183f5ecf68e3663348385a4612b81b8b154 | 42,278 | py | Python | course/page/base.py | hanjianwei/relate | 971e27a1bdd69236dc6dc294024b50584435a18d | [
"Unlicense"
] | null | null | null | course/page/base.py | hanjianwei/relate | 971e27a1bdd69236dc6dc294024b50584435a18d | [
"Unlicense"
] | 6 | 2015-08-18T00:13:40.000Z | 2018-01-31T05:55:13.000Z | course/page/base.py | dzhuang/relate | f90cc146861e1523f50d29fa1e90ded32e351428 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
__copyright__ = "Copyright (C) 2014 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restricti... | 33.634049 | 92 | 0.569847 | # -*- coding: utf-8 -*-
from __future__ import division
__copyright__ = "Copyright (C) 2014 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restricti... | 21,132 | 146 | 1,112 |
63c88eb1c05fb6d4ee96cb16c8b888caab50853e | 6,619 | py | Python | Files/models/train_classifier.py | LuisGaravaso/disaster-response-pipeline | 09ac1b9b0b9d8c46cea848db7a63db3037182b36 | [
"MIT"
] | null | null | null | Files/models/train_classifier.py | LuisGaravaso/disaster-response-pipeline | 09ac1b9b0b9d8c46cea848db7a63db3037182b36 | [
"MIT"
] | null | null | null | Files/models/train_classifier.py | LuisGaravaso/disaster-response-pipeline | 09ac1b9b0b9d8c46cea848db7a63db3037182b36 | [
"MIT"
] | null | null | null | # Data
import sys
import pandas as pd
import numpy as np
import re
from sqlalchemy import create_engine
from collections import defaultdict
import pickle
from warnings import filterwarnings
#Sklearn
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from... | 28.530172 | 86 | 0.632875 | # Data
import sys
import pandas as pd
import numpy as np
import re
from sqlalchemy import create_engine
from collections import defaultdict
import pickle
from warnings import filterwarnings
#Sklearn
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from... | 1,109 | 0 | 23 |
5f65d717dbfe23c2684aa3008e10dc8c3936e6c4 | 1,722 | py | Python | apps/08_file_searcher/you_try/program.py | dspec12/python-jumpstart-course-demos | 40235a9cc1bbc189941e096421fc2b705c5cb740 | [
"MIT"
] | null | null | null | apps/08_file_searcher/you_try/program.py | dspec12/python-jumpstart-course-demos | 40235a9cc1bbc189941e096421fc2b705c5cb740 | [
"MIT"
] | null | null | null | apps/08_file_searcher/you_try/program.py | dspec12/python-jumpstart-course-demos | 40235a9cc1bbc189941e096421fc2b705c5cb740 | [
"MIT"
] | null | null | null | import os
import collections
if __name__ == '__main__':
main()
| 20.746988 | 94 | 0.54007 | import os
import collections
def main():
header()
folder = target_dir()
print()
if not folder:
print('Not a valid directory')
return
text = target_text()
print()
if not text:
print('Not a valid search string')
return
print('\nResults:\n')
file... | 1,509 | 0 | 138 |
ee5cb95448a0d0ff469286da1e736be1573a9fd1 | 829 | py | Python | game_db/games/migrations/0002_game.py | ErnestC30/DjangoReact_GameDB | a40ef74c7afb0d1823e9393df02fe41b4769831c | [
"Unlicense"
] | null | null | null | game_db/games/migrations/0002_game.py | ErnestC30/DjangoReact_GameDB | a40ef74c7afb0d1823e9393df02fe41b4769831c | [
"Unlicense"
] | null | null | null | game_db/games/migrations/0002_game.py | ErnestC30/DjangoReact_GameDB | a40ef74c7afb0d1823e9393df02fe41b4769831c | [
"Unlicense"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-15 21:27
from django.db import migrations, models
| 31.884615 | 117 | 0.568154 | # Generated by Django 3.2.7 on 2021-09-15 21:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
('games', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Game',
fi... | 0 | 715 | 23 |
317254403b0af938d18b2a31f914aa874e490678 | 10,310 | py | Python | jobs/SCH/JB_WORK_INVOICE.py | bibinvasudev/EBI_Project | df2560139e463d68a37e67e0bb683c06fa9ef91b | [
"CNRI-Python"
] | null | null | null | jobs/SCH/JB_WORK_INVOICE.py | bibinvasudev/EBI_Project | df2560139e463d68a37e67e0bb683c06fa9ef91b | [
"CNRI-Python"
] | null | null | null | jobs/SCH/JB_WORK_INVOICE.py | bibinvasudev/EBI_Project | df2560139e463d68a37e67e0bb683c06fa9ef91b | [
"CNRI-Python"
] | null | null | null | #SCH1006.py --> JB_WORK_INVOICE.py
#**************************************************************************************************************
#
# Programmer : bibin
# Version : 1.0
#
# Description :
#
#
#
# Initial Creation:
#
# Date (YYYY-MM-DD) Change Description
# ----------------- ... | 34.949153 | 218 | 0.573036 | #SCH1006.py --> JB_WORK_INVOICE.py
#**************************************************************************************************************
#
# Programmer : bibin
# Version : 1.0
#
# Description :
#
#
#
# Initial Creation:
#
# Date (YYYY-MM-DD) Change Description
# ----------------- ... | 9,097 | 0 | 44 |
599dcc1a4f136c0862129c9da820653dc8caa55c | 8,384 | py | Python | framework/plugin/plugin_params.py | DarKnight24/owtf | cb4d17ecfec1e8a2f22af3cb0ef7b33f8173825c | [
"BSD-3-Clause"
] | 2 | 2018-03-12T01:32:16.000Z | 2018-03-12T05:10:25.000Z | framework/plugin/plugin_params.py | unexpectedBy/owtf | 695b6dc723756bffcd6c21f6e962a927758ae4f9 | [
"BSD-3-Clause"
] | null | null | null | framework/plugin/plugin_params.py | unexpectedBy/owtf | 695b6dc723756bffcd6c21f6e962a927758ae4f9 | [
"BSD-3-Clause"
] | 3 | 2018-03-12T01:04:42.000Z | 2020-08-26T08:43:32.000Z | #!/usr/bin/env python
from collections import defaultdict
from framework.dependency_management.dependency_resolver import BaseComponent
from framework.lib.general import *
| 45.075269 | 120 | 0.607109 | #!/usr/bin/env python
from collections import defaultdict
from framework.dependency_management.dependency_resolver import BaseComponent
from framework.lib.general import *
class PluginParams(BaseComponent):
COMPONENT_NAME = "plugin_params"
def __init__(self, Options):
self.register_in_service_loca... | 7,649 | 537 | 23 |
71f40893766ddc8711690d46ca680cd5d6430068 | 4,874 | py | Python | DATA/workflow/miRNA/databases/miRDeathDB/script.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | DATA/workflow/miRNA/databases/miRDeathDB/script.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | DATA/workflow/miRNA/databases/miRDeathDB/script.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | """
Parses MiRDeath database
:argument: DATA_FILE: http://www.rna-world.org/mirdeathdb/data/miRDeathDB_all_data.txt
:argument: DB_DESTINATION: saving location of database
"""
# Imports
from SLKlib.SQLiteDBApi.sqlite_db_api import PsimiSQL
# Defining constants
SQL_SEED = '../../../../../SLKlib/SQLiteDBApi/network-d... | 40.957983 | 241 | 0.527493 | """
Parses MiRDeath database
:argument: DATA_FILE: http://www.rna-world.org/mirdeathdb/data/miRDeathDB_all_data.txt
:argument: DB_DESTINATION: saving location of database
"""
# Imports
from SLKlib.SQLiteDBApi.sqlite_db_api import PsimiSQL
# Defining constants
SQL_SEED = '../../../../../SLKlib/SQLiteDBApi/network-d... | 2,625 | 0 | 46 |
9dafbd3b3293d58f6ec8470ec1f4b64f39e224be | 7,678 | py | Python | eval_lm.py | rom1mouret/domain_identification | 4c3ad6ede15d9d7aa8a3b03b1bf40e18d0d28207 | [
"Apache-2.0"
] | 1 | 2021-07-02T05:23:19.000Z | 2021-07-02T05:23:19.000Z | eval_lm.py | rom1mouret/domain_identification | 4c3ad6ede15d9d7aa8a3b03b1bf40e18d0d28207 | [
"Apache-2.0"
] | null | null | null | eval_lm.py | rom1mouret/domain_identification | 4c3ad6ede15d9d7aa8a3b03b1bf40e18d0d28207 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from typing import Tuple
import sys
import torch
import torch.nn as nn
import numpy as np
from tqdm import tqdm, trange
from nn_utils import freeze
from recipe_dataset import Dataset
from eval_utils import scoring, measure_time
from architecture import Processor, AbstractToGoal, AbstractToAbstr... | 41.27957 | 93 | 0.604324 | #!/usr/bin/env python3
from typing import Tuple
import sys
import torch
import torch.nn as nn
import numpy as np
from tqdm import tqdm, trange
from nn_utils import freeze
from recipe_dataset import Dataset
from eval_utils import scoring, measure_time
from architecture import Processor, AbstractToGoal, AbstractToAbstr... | 606 | 0 | 23 |
88d4e09c9d301fa0dd4a79919320ff442773a721 | 4,101 | py | Python | staircase/core/arrays/transform.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | 25 | 2020-09-05T01:26:43.000Z | 2021-01-31T06:51:47.000Z | staircase/core/arrays/transform.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | 76 | 2020-03-03T22:26:19.000Z | 2021-07-09T09:29:38.000Z | staircase/core/arrays/transform.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from staircase.constants import inf
from staircase.core.arrays import docstrings
from staircase.core.stairs import Stairs
from staircase.core.stats.statistic import corr as _corr
from staircase.core.stats.statistic import cov as _cov
from staircase.util._decorators import Appende... | 41.424242 | 110 | 0.689588 | import numpy as np
import pandas as pd
from staircase.constants import inf
from staircase.core.arrays import docstrings
from staircase.core.stairs import Stairs
from staircase.core.stats.statistic import corr as _corr
from staircase.core.stats.statistic import cov as _cov
from staircase.util._decorators import Appende... | 567 | 0 | 23 |
d43622069d2b346e91d23f2353893802e2a1464a | 49,163 | py | Python | src/cone/app/tests/test_browser_authoring.py | lenadax/cone.app | b25c55aedb85e45a962003d2767a22a927cc61c0 | [
"BSD-3-Clause"
] | 1 | 2022-03-13T17:51:09.000Z | 2022-03-13T17:51:09.000Z | src/cone/app/tests/test_browser_authoring.py | lenadax/cone.app | b25c55aedb85e45a962003d2767a22a927cc61c0 | [
"BSD-3-Clause"
] | 1 | 2021-08-06T08:12:00.000Z | 2021-08-06T08:12:00.000Z | src/cone/app/tests/test_browser_authoring.py | lenadax/cone.app | b25c55aedb85e45a962003d2767a22a927cc61c0 | [
"BSD-3-Clause"
] | null | null | null | from cone.app import compat
from cone.app import testing
from cone.app.browser.ajax import AjaxEvent
from cone.app.browser.ajax import AjaxMessage
from cone.app.browser.ajax import AjaxPath
from cone.app.browser.authoring import _FormRenderingTile
from cone.app.browser.authoring import add
from cone.app.browser.authori... | 38.833333 | 84 | 0.563493 | from cone.app import compat
from cone.app import testing
from cone.app.browser.ajax import AjaxEvent
from cone.app.browser.ajax import AjaxMessage
from cone.app.browser.ajax import AjaxPath
from cone.app.browser.authoring import _FormRenderingTile
from cone.app.browser.authoring import add
from cone.app.browser.authori... | 46,783 | 693 | 23 |
58b3dad12fc8387e6db9091fd360418cd25764f5 | 1,067 | py | Python | __main__.py | CodeArch/python-ftp | 09b0f73bfd52b8b2aecdfbfe2d1732e29b488d7a | [
"MIT"
] | null | null | null | __main__.py | CodeArch/python-ftp | 09b0f73bfd52b8b2aecdfbfe2d1732e29b488d7a | [
"MIT"
] | 1 | 2019-03-18T19:14:20.000Z | 2019-03-18T19:15:20.000Z | __main__.py | CodeArch/python-ftp | 09b0f73bfd52b8b2aecdfbfe2d1732e29b488d7a | [
"MIT"
] | null | null | null | import sys
import terminal
import ftp_server
import ftp_client
if __name__ == '__main__':
main()
| 21.34 | 79 | 0.573571 | import sys
import terminal
import ftp_server
import ftp_client
def main():
display = terminal.Terminal()
display.display_startup_sequence()
is_server = display.ask_if_server()
if is_server:
user = display.display_server_config_sequence()
server = ftp_server.FTPServer(user)
... | 940 | 0 | 23 |
d28fef4ee4821d384a37f7456ecba694c549ea9f | 7,272 | py | Python | datatransfer/datatransfer.py | chasehult/misc-cogs | 171bfacccb534d5e73bf53ce71e0a312c35e0ec7 | [
"MIT"
] | null | null | null | datatransfer/datatransfer.py | chasehult/misc-cogs | 171bfacccb534d5e73bf53ce71e0a312c35e0ec7 | [
"MIT"
] | null | null | null | datatransfer/datatransfer.py | chasehult/misc-cogs | 171bfacccb534d5e73bf53ce71e0a312c35e0ec7 | [
"MIT"
] | null | null | null | import json
import os
import re
import base64
import io
import aiohttp
import discord
from redbot.core import checks, data_manager, commands
from redbot.core.utils.chat_formatting import inline, box, pagify
R_MESSAGE_LINK = r"https://discordapp.com/channels/(\d+)/(\d+)/(\d+)"
R_ATTATCH_LINK = r"https://cdn.discordapp... | 43.029586 | 108 | 0.635451 | import json
import os
import re
import base64
import io
import aiohttp
import discord
from redbot.core import checks, data_manager, commands
from redbot.core.utils.chat_formatting import inline, box, pagify
R_MESSAGE_LINK = r"https://discordapp.com/channels/(\d+)/(\d+)/(\d+)"
R_ATTATCH_LINK = r"https://cdn.discordapp... | 5,418 | 0 | 183 |
84e2247af8ce4c0eb4f64ae89ddbc3506cc4c0ce | 2,284 | py | Python | tests/test_live_schemas.py | mlspec/mlspec-lib | 4d7fcca3067e228c9396bf5811f572310487cca0 | [
"MIT"
] | 12 | 2020-04-22T02:41:17.000Z | 2020-11-29T12:36:26.000Z | tests/test_live_schemas.py | mlspec/mlspec-lib | 4d7fcca3067e228c9396bf5811f572310487cca0 | [
"MIT"
] | 12 | 2020-04-01T23:31:41.000Z | 2020-11-19T01:32:11.000Z | tests/test_live_schemas.py | mlspec/mlspec-lib | 4d7fcca3067e228c9396bf5811f572310487cca0 | [
"MIT"
] | 5 | 2020-03-23T16:32:36.000Z | 2020-06-15T16:07:28.000Z | # pylint: disable=protected-access,missing-function-docstring, missing-class-docstring, missing-module-docstring, missing-class-docstring # noqa
# -*- coding: utf-8 -*-
import unittest
import tempfile
from pathlib import Path
from mlspeclib.helpers import convert_yaml_to_dict
import marshmallow.class_registry
from m... | 34.606061 | 144 | 0.664186 | # pylint: disable=protected-access,missing-function-docstring, missing-class-docstring, missing-module-docstring, missing-class-docstring # noqa
# -*- coding: utf-8 -*-
import unittest
import tempfile
from pathlib import Path
from mlspeclib.helpers import convert_yaml_to_dict
import marshmallow.class_registry
from m... | 1,590 | 0 | 108 |
832f74e5188a943ff4406b383edbb32f7e63f332 | 34,405 | py | Python | sequence-lexical_decision/sequence-2_LD_lastrun.py | LauraGwilliams/phoneme_seequence | 799ff4cd5717e14a54cad5e5888bbc7e5eb9abb9 | [
"MIT"
] | 1 | 2021-02-25T01:03:28.000Z | 2021-02-25T01:03:28.000Z | sequence-lexical_decision/sequence-2_LD_lastrun.py | LauraGwilliams/phoneme_seequence | 799ff4cd5717e14a54cad5e5888bbc7e5eb9abb9 | [
"MIT"
] | null | null | null | sequence-lexical_decision/sequence-2_LD_lastrun.py | LauraGwilliams/phoneme_seequence | 799ff4cd5717e14a54cad5e5888bbc7e5eb9abb9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.2.9),
on Mon Feb 1 17:31:07 2021
If you publish work using this script the most relevant publication is:
Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindel... | 43.772265 | 224 | 0.689754 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.2.9),
on Mon Feb 1 17:31:07 2021
If you publish work using this script the most relevant publication is:
Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindel... | 0 | 0 | 0 |
f865c2a5405cc77bc329e9160d9194db4bfbcfce | 2,180 | py | Python | example/demoprj/testcase/validations.py | kaige201314/knitter-master-qbb | 1ec6ad6b17dc255ea25b29ef4c95217f79ea56be | [
"MIT"
] | null | null | null | example/demoprj/testcase/validations.py | kaige201314/knitter-master-qbb | 1ec6ad6b17dc255ea25b29ef4c95217f79ea56be | [
"MIT"
] | null | null | null | example/demoprj/testcase/validations.py | kaige201314/knitter-master-qbb | 1ec6ad6b17dc255ea25b29ef4c95217f79ea56be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from knitter import datadriver, log
from demoprj.page import KnitterDemo
| 26.585366 | 81 | 0.580275 | # -*- coding: utf-8 -*-
from knitter import datadriver, log
from demoprj.page import KnitterDemo
def TestCase001_NormalInputTest():
#### Name ###
KnitterDemo.Name.Title.Select("Mr.")
KnitterDemo.Name.Name.Set("Henry.Wang")
### Gender ###
KnitterDemo.Gender.Male.Click()
### Hobbies ... | 2,022 | 0 | 46 |
73e168ec2adbcbd79ba3c661158a41bf414f7044 | 1,542 | py | Python | tests/test_Exponential.py | AdityaVadlamani/prob-distrs | 616e1a2802e78dc024d6ddabef3cbcb8cb06567e | [
"MIT"
] | null | null | null | tests/test_Exponential.py | AdityaVadlamani/prob-distrs | 616e1a2802e78dc024d6ddabef3cbcb8cb06567e | [
"MIT"
] | null | null | null | tests/test_Exponential.py | AdityaVadlamani/prob-distrs | 616e1a2802e78dc024d6ddabef3cbcb8cb06567e | [
"MIT"
] | null | null | null | import unittest
from prob_distrs import Exponential
if __name__ == '__main__':
unittest.main()
| 41.675676 | 154 | 0.702983 | import unittest
from prob_distrs import Exponential
class TestExponentialClass(unittest.TestCase):
def setUp(self):
self.exponential = Exponential(5)
self.exponential_file = Exponential()
self.exponential_file.read_data_file('tests/data/data_exponential.txt')
def test_initialization(s... | 1,219 | 25 | 193 |
f04742376d3d09d000b5988e4fd79227e61fc201 | 647 | py | Python | docs/examples/best_practices/logger/my_handler.py | ran-isenberg/aws-lambda-handler-cookbook | adfe58dacd87315151265818869bb842c7eb4971 | [
"MIT"
] | 61 | 2022-02-07T05:21:14.000Z | 2022-03-27T14:11:30.000Z | docs/examples/best_practices/logger/my_handler.py | ran-isenberg/aws-lambda-handler-cookbook | adfe58dacd87315151265818869bb842c7eb4971 | [
"MIT"
] | 17 | 2022-02-26T05:25:31.000Z | 2022-03-16T20:02:46.000Z | docs/examples/best_practices/logger/my_handler.py | ran-isenberg/aws-lambda-handler-cookbook | adfe58dacd87315151265818869bb842c7eb4971 | [
"MIT"
] | 4 | 2022-02-17T16:35:27.000Z | 2022-03-07T03:13:07.000Z | import json
from http import HTTPStatus
from typing import Any, Dict
from aws_lambda_powertools.logging.logger import Logger
from aws_lambda_powertools.utilities.typing import LambdaContext
logger: Logger = Logger(service='my_service') # JSON output format, service name can be set by environment variable "POWERTOOLS... | 43.133333 | 142 | 0.772798 | import json
from http import HTTPStatus
from typing import Any, Dict
from aws_lambda_powertools.logging.logger import Logger
from aws_lambda_powertools.utilities.typing import LambdaContext
logger: Logger = Logger(service='my_service') # JSON output format, service name can be set by environment variable "POWERTOOLS... | 288 | 0 | 23 |
35efe41ca32c69e02a07ad87092f018feb1d8508 | 334 | py | Python | tests/test_day07.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | tests/test_day07.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | tests/test_day07.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | from pathlib import Path
from advent.solutions import day07
| 23.857143 | 62 | 0.736527 | from pathlib import Path
from advent.solutions import day07
def test_part1(fixtures_path: Path):
solution = day07.Day07(fixtures_path / "test_input07.txt")
assert solution.part1() == 37
def test_part2(fixtures_path: Path):
solution = day07.Day07(fixtures_path / "test_input07.txt")
assert solution.p... | 225 | 0 | 46 |
a77a8b559d4dad93cd9b114729a1063314611d4c | 468 | py | Python | src/utils/__init__.py | peng-data-minimization/dm-spi | 0d6e6d7b87afee31a3c898646e14eda29b3a1e27 | [
"MIT"
] | null | null | null | src/utils/__init__.py | peng-data-minimization/dm-spi | 0d6e6d7b87afee31a3c898646e14eda29b3a1e27 | [
"MIT"
] | null | null | null | src/utils/__init__.py | peng-data-minimization/dm-spi | 0d6e6d7b87afee31a3c898646e14eda29b3a1e27 | [
"MIT"
] | null | null | null | import json
import logging.config
import yaml
| 26 | 58 | 0.717949 | import json
import logging.config
import yaml
def get_value_deserializer(data_input_format):
if data_input_format == 'json':
return json.loads
def get_logger(log_config_path='utils/logger_config.yml'):
with open(log_config_path, 'r') as yaml_file:
config = yaml.safe_load(yaml_file)
l... | 374 | 0 | 46 |
4ca6fe1820ca6a53504abcaf3f4c7d63d27a5ba5 | 1,537 | py | Python | get_single_PN_configuration_from_PSREF/get_single_PN_configuration_from_PSREF.py | smallfish-bigocean/smallcodes | 22ab15f969f0acb75036db9f73d8ddd210a94432 | [
"MIT"
] | null | null | null | get_single_PN_configuration_from_PSREF/get_single_PN_configuration_from_PSREF.py | smallfish-bigocean/smallcodes | 22ab15f969f0acb75036db9f73d8ddd210a94432 | [
"MIT"
] | null | null | null | get_single_PN_configuration_from_PSREF/get_single_PN_configuration_from_PSREF.py | smallfish-bigocean/smallcodes | 22ab15f969f0acb75036db9f73d8ddd210a94432 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from openpyxl import Workbook
from openpyxl import load_workbook
import winreg
#额外任务,获取当前用户的桌面路径,这样就可以把抓到的Excel表格存到桌面了
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders')
mydesktop = winreg.QueryValueEx(key... | 32.702128 | 115 | 0.689005 | import requests
from bs4 import BeautifulSoup
from openpyxl import Workbook
from openpyxl import load_workbook
import winreg
#额外任务,获取当前用户的桌面路径,这样就可以把抓到的Excel表格存到桌面了
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders')
mydesktop = winreg.QueryValueEx(key... | 0 | 0 | 0 |
a9d9468d95c655a8efc48f0e6837d4ef016ff168 | 2,943 | py | Python | ChoreographyHive/__main__.py | DaCoolOne/HiveWriter | 23002986911cd3c977014e2b459853304421ac19 | [
"MIT"
] | 1 | 2020-05-18T14:16:58.000Z | 2020-05-18T14:16:58.000Z | ChoreographyHive/__main__.py | DaCoolOne/HiveWriter | 23002986911cd3c977014e2b459853304421ac19 | [
"MIT"
] | null | null | null | ChoreographyHive/__main__.py | DaCoolOne/HiveWriter | 23002986911cd3c977014e2b459853304421ac19 | [
"MIT"
] | null | null | null | """RLBotChoreography
Usage:
choreograph [--min-bots=<min>] [--bot-folder=<folder>]
Options:
--min-bots=<min> The minimum number of bots to spawn [default: 10].
--bot-folder=<folder> Searches this folder for bot configs to use for names and appearances [default: .].
"""
import traceback... | 28.028571 | 116 | 0.721033 | """RLBotChoreography
Usage:
choreograph [--min-bots=<min>] [--bot-folder=<folder>]
Options:
--min-bots=<min> The minimum number of bots to spawn [default: 10].
--bot-folder=<folder> Searches this folder for bot configs to use for names and appearances [default: .].
"""
import traceback... | 0 | 0 | 0 |
073529f5a9f9f9982fdefdee42a1187d4a845556 | 5,560 | py | Python | cannabis_reports/tests/test_request_paginator.py | kwaaak/python-cannabis-reports | 9919630bb558d9ff23c9911aa9d6e2c27a0e80ef | [
"MIT"
] | 13 | 2018-02-23T00:17:38.000Z | 2021-12-08T22:36:12.000Z | cannabis_reports/tests/test_request_paginator.py | nestorwheelock/python-cannabis-reports | 6b64cecd881247eee23f9d2223f6d364bafad937 | [
"MIT"
] | 4 | 2017-12-07T23:42:01.000Z | 2017-12-09T20:56:46.000Z | cannabis_reports/tests/test_request_paginator.py | nestorwheelock/python-cannabis-reports | 6b64cecd881247eee23f9d2223f6d364bafad937 | [
"MIT"
] | 6 | 2018-07-02T13:35:19.000Z | 2021-12-08T22:37:00.000Z | # -*- coding: utf-8 -*-
# Copyright 2017-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
import mock
import unittest
from contextlib import contextmanager
from ..request_paginator import RequestPaginator
| 34.320988 | 78 | 0.541547 | # -*- coding: utf-8 -*-
# Copyright 2017-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
import mock
import unittest
from contextlib import contextmanager
from ..request_paginator import RequestPaginator
class TestRequestPaginator(unittest.TestCase):
REQUEST_TYPES = ['get', 'delete', '... | 2,352 | 2,953 | 23 |
606b7bbb1a3d39fc8fed9991601c30c101255b07 | 23,833 | py | Python | orix/quaternion/rotation.py | bm424/texpy | 8d78b568209a6da36fc831c6bc9e2b0cb4c740c8 | [
"MIT"
] | 6 | 2018-02-05T18:37:10.000Z | 2018-10-07T22:07:26.000Z | orix/quaternion/rotation.py | bm424/texpy | 8d78b568209a6da36fc831c6bc9e2b0cb4c740c8 | [
"MIT"
] | 5 | 2018-11-04T18:06:28.000Z | 2019-09-13T11:22:43.000Z | orix/quaternion/rotation.py | bm424/texpy | 8d78b568209a6da36fc831c6bc9e2b0cb4c740c8 | [
"MIT"
] | 3 | 2019-04-27T09:24:28.000Z | 2019-09-13T10:24:57.000Z | # -*- coding: utf-8 -*-
# Copyright 2018-2022 the orix developers
#
# This file is part of orix.
#
# orix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | 33.426367 | 105 | 0.538455 | # -*- coding: utf-8 -*-
# Copyright 2018-2022 the orix developers
#
# This file is part of orix.
#
# orix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | 2,141 | 0 | 188 |
79e814b64bea7882d104f1d9061d403649af258f | 1,842 | py | Python | Kaggle/kaggleANN.py | J-Douglas/Digit-Recognition | 0b5c8afff28ea1253b33ffdd07b16c8b4d4cc943 | [
"MIT"
] | null | null | null | Kaggle/kaggleANN.py | J-Douglas/Digit-Recognition | 0b5c8afff28ea1253b33ffdd07b16c8b4d4cc943 | [
"MIT"
] | null | null | null | Kaggle/kaggleANN.py | J-Douglas/Digit-Recognition | 0b5c8afff28ea1253b33ffdd07b16c8b4d4cc943 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import *
from keras.utils import to_categorical
train_dataset = pd.read_csv('datasets/train.csv')
test_dataset = pd.read_csv('datasets/test.csv')
train_dataset.head()
train_images = train_dataset.iloc[... | 26.695652 | 72 | 0.757872 | import os
import pandas as pd
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import *
from keras.utils import to_categorical
train_dataset = pd.read_csv('datasets/train.csv')
test_dataset = pd.read_csv('datasets/test.csv')
train_dataset.head()
train_images = train_dataset.iloc[... | 0 | 0 | 0 |
7ad6511b993cfbcac31b8dc99981d0c13082ea86 | 4,029 | py | Python | arithmetic-lamp/vision/01_calibrate.py | leebinjun/mathAI | 7bdd383e9af5853bb9161df38f352588593172e7 | [
"MIT"
] | null | null | null | arithmetic-lamp/vision/01_calibrate.py | leebinjun/mathAI | 7bdd383e9af5853bb9161df38f352588593172e7 | [
"MIT"
] | null | null | null | arithmetic-lamp/vision/01_calibrate.py | leebinjun/mathAI | 7bdd383e9af5853bb9161df38f352588593172e7 | [
"MIT"
] | null | null | null | #coding:utf-8
import cv2
import numpy as np
import sys
sys.path.append(".\vision")
#棋盘格模板规格
w = 9
h = 7
# TODO
if __name__ == '__main__':
a_temp = Calibrate()
image_path = '.\\data\\*.jpg'
a_temp.read_sample(image_path)
a_temp.calibrate()
# filename = '.\\Config\\calibrate_config.t... | 24.418182 | 127 | 0.558948 | #coding:utf-8
import cv2
import numpy as np
import sys
sys.path.append(".\vision")
#棋盘格模板规格
w = 9
h = 7
class Calibrate (object):
def __init__ (self):
# 找棋盘格角点
# 阈值
self.criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 20, 0.001)
# 世界坐标系中的棋盘格点,例如(0,0,0), (1,0,0... | 3,225 | 4 | 215 |
d451186b33906da88157257c25b44507efd8f26c | 5,949 | py | Python | tests/test_genomic_test.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 1 | 2020-07-22T12:46:58.000Z | 2020-07-22T12:46:58.000Z | tests/test_genomic_test.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 54 | 2019-10-09T16:19:04.000Z | 2022-01-19T20:28:59.000Z | tests/test_genomic_test.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 2 | 2019-10-30T19:54:43.000Z | 2020-12-03T18:57:15.000Z | from unittest import mock
from unittest.mock import ANY
from math import nan
import pandas as pd
from phc.easy.omics.genomic_test import GenomicTest
raw_df = pd.DataFrame(
# NOTE: Sample is taken and adapted from BRCA data set
[
{
"sets": [
{
"status": "... | 32.686813 | 78 | 0.448311 | from unittest import mock
from unittest.mock import ANY
from math import nan
import pandas as pd
from phc.easy.omics.genomic_test import GenomicTest
raw_df = pd.DataFrame(
# NOTE: Sample is taken and adapted from BRCA data set
[
{
"sets": [
{
"status": "... | 373 | 0 | 46 |
ed6b3fe356f10d96883dbdcc0a6b3da8b905af9f | 8,396 | py | Python | DataUtils/Embed.py | zhangmeishan/pytorch_Joint-Word-Segmentation-and-POS-Tagging | 10c8395334b244cc98acc6e0816632ee5a54faa0 | [
"Apache-2.0"
] | 3 | 2018-09-09T11:42:28.000Z | 2019-05-29T08:43:59.000Z | DataUtils/Embed.py | zhangmeishan/pytorch_Joint-Word-Segmentation-and-POS-Tagging | 10c8395334b244cc98acc6e0816632ee5a54faa0 | [
"Apache-2.0"
] | null | null | null | DataUtils/Embed.py | zhangmeishan/pytorch_Joint-Word-Segmentation-and-POS-Tagging | 10c8395334b244cc98acc6e0816632ee5a54faa0 | [
"Apache-2.0"
] | null | null | null | # @Author : bamtercelboo
# @Datetime : 2018/8/27 15:34
# @File : Embed.py
# @Last Modify Time : 2018/8/27 15:34
# @Contact : bamtercelboo@{gmail.com, 163.com}
"""
FILE : Embed.py
FUNCTION : None
"""
import os
import sys
import time
import tqdm
import numpy as np
import torch
import torch.nn as nn
import torc... | 37.482143 | 118 | 0.569319 | # @Author : bamtercelboo
# @Datetime : 2018/8/27 15:34
# @File : Embed.py
# @Last Modify Time : 2018/8/27 15:34
# @Contact : bamtercelboo@{gmail.com, 163.com}
"""
FILE : Embed.py
FUNCTION : None
"""
import os
import sys
import time
import tqdm
import numpy as np
import torch
import torch.nn as nn
import torc... | 569 | 0 | 26 |
4b2171b297c9cd8a280ef353df84162d4b58b9df | 299 | py | Python | src/spaceone/cost_analysis/info/data_source_info.py | spaceone-dev/plugin-sse-cost-datasource | c7dd2494b4de82f87dd4b5c131c4e975f033e651 | [
"Apache-2.0"
] | null | null | null | src/spaceone/cost_analysis/info/data_source_info.py | spaceone-dev/plugin-sse-cost-datasource | c7dd2494b4de82f87dd4b5c131c4e975f033e651 | [
"Apache-2.0"
] | 1 | 2022-03-28T10:54:26.000Z | 2022-03-29T04:43:36.000Z | src/spaceone/cost_analysis/info/data_source_info.py | spaceone-dev/plugin-sse-cost-datasource | c7dd2494b4de82f87dd4b5c131c4e975f033e651 | [
"Apache-2.0"
] | null | null | null | from spaceone.api.cost_analysis.plugin import data_source_pb2
from spaceone.core.pygrpc.message_type import *
__all__ = ['PluginInfo']
| 21.357143 | 64 | 0.735786 | from spaceone.api.cost_analysis.plugin import data_source_pb2
from spaceone.core.pygrpc.message_type import *
__all__ = ['PluginInfo']
def PluginInfo(plugin_data):
info = {
'metadata': change_struct_type(plugin_data['metadata']),
}
return data_source_pb2.PluginInfo(**info)
| 138 | 0 | 23 |
e505f2091733711b72e96b92e656dd9e7168509f | 579 | py | Python | week_7/simple_inserts__m101p_52b36d2ee2d423678d3b9d7b.py | bschwartz757/M101JS | 21bb0bbd9a3546e129ac5b9d95822b44d02d63ac | [
"MIT"
] | 1 | 2020-04-08T03:03:16.000Z | 2020-04-08T03:03:16.000Z | week_7/simple_inserts__m101p_52b36d2ee2d423678d3b9d7b.py | bschwartz757/M101JS | 21bb0bbd9a3546e129ac5b9d95822b44d02d63ac | [
"MIT"
] | null | null | null | week_7/simple_inserts__m101p_52b36d2ee2d423678d3b9d7b.py | bschwartz757/M101JS | 21bb0bbd9a3546e129ac5b9d95822b44d02d63ac | [
"MIT"
] | 1 | 2020-04-08T03:03:18.000Z | 2020-04-08T03:03:18.000Z |
import pymongo
read_pref = pymongo.read_preferences.ReadPreference.SECONDARY
c = pymongo.MongoClient(host="mongodb://localhost:27017",
replicaSet="rs1",
w=3, wtimeout=10000, j=True,
read_preference=read_pref)
db = c.m101
people = db.people
pr... | 23.16 | 67 | 0.651123 |
import pymongo
read_pref = pymongo.read_preferences.ReadPreference.SECONDARY
c = pymongo.MongoClient(host="mongodb://localhost:27017",
replicaSet="rs1",
w=3, wtimeout=10000, j=True,
read_preference=read_pref)
db = c.m101
people = db.people
pr... | 0 | 0 | 0 |
5a86e910069b2ca2b0f0200df3d9c4ed05c14ccf | 2,676 | py | Python | system-base/server-setup/src/main/resources/weblogic/scripts/wlst/DeployBakerHughesMigrator.py | eep60b/etlexamples | 92ecfdca07ad01127b76c978432cf67f56b5f9ce | [
"Apache-2.0"
] | null | null | null | system-base/server-setup/src/main/resources/weblogic/scripts/wlst/DeployBakerHughesMigrator.py | eep60b/etlexamples | 92ecfdca07ad01127b76c978432cf67f56b5f9ce | [
"Apache-2.0"
] | null | null | null | system-base/server-setup/src/main/resources/weblogic/scripts/wlst/DeployBakerHughesMigrator.py | eep60b/etlexamples | 92ecfdca07ad01127b76c978432cf67f56b5f9ce | [
"Apache-2.0"
] | null | null | null | #
# Function for fresh plain deployment
import os
import fnmatch
import os.pathsep
from java.io import File
from java.io import FileInputStream
username = None
password = None
adminUrl = None
applicationPath = None
planPath = None
targetServers = None
# All the application will be undeployed.... | 25.245283 | 113 | 0.699925 | #
# Function for fresh plain deployment
import os
import fnmatch
import os.pathsep
from java.io import File
from java.io import FileInputStream
username = None
password = None
adminUrl = None
applicationPath = None
planPath = None
targetServers = None
def init():
try:
propInputStream = FileInp... | 2,105 | 0 | 103 |
c9dd611fabd5a6b5efa4b58035eeefc63ab69d22 | 2,947 | py | Python | tst/test_logger.py | kangasta/rpa_logger | 63fb9d2472cc8039b6d794c5a09f4fbb77f5ac23 | [
"MIT"
] | null | null | null | tst/test_logger.py | kangasta/rpa_logger | 63fb9d2472cc8039b6d794c5a09f4fbb77f5ac23 | [
"MIT"
] | null | null | null | tst/test_logger.py | kangasta/rpa_logger | 63fb9d2472cc8039b6d794c5a09f4fbb77f5ac23 | [
"MIT"
] | null | null | null | from io import StringIO
from unittest import TestCase
from rpa_logger import Logger
from rpa_logger.task import ERROR, STATUSES, SUCCESS
| 32.744444 | 101 | 0.62606 | from io import StringIO
from unittest import TestCase
from rpa_logger import Logger
from rpa_logger.task import ERROR, STATUSES, SUCCESS
class LoggerTest(TestCase):
def test_cannot_finish_without_text_or_key(self):
logger = Logger(target=StringIO())
with self.assertRaises(RuntimeError):
... | 2,619 | 6 | 184 |
e9f8fcf9795d1eddd482d0d1a9dfd47415338af5 | 913 | py | Python | simulation/modelsim/csv2vhdl.py | pd0wm/flexray-interceptor | 1a53799108fcf743ed47782db4f2746f47a0d8f6 | [
"MIT"
] | 47 | 2020-03-04T02:24:34.000Z | 2022-02-14T15:21:28.000Z | simulation/modelsim/csv2vhdl.py | eiselekd/flexray-interceptor | 1a53799108fcf743ed47782db4f2746f47a0d8f6 | [
"MIT"
] | null | null | null | simulation/modelsim/csv2vhdl.py | eiselekd/flexray-interceptor | 1a53799108fcf743ed47782db4f2746f47a0d8f6 | [
"MIT"
] | 12 | 2020-03-04T03:08:09.000Z | 2022-02-24T14:42:01.000Z | #!/usr/bin/env python3
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert VCD file to VHDL statements')
parser.add_argument("-i", "--input", required=True)
args = parser.parse_args()
timescale = "0 ns"
prev_t = 0
r = ""
with open(args.input) a... | 24.026316 | 87 | 0.457831 | #!/usr/bin/env python3
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert VCD file to VHDL statements')
parser.add_argument("-i", "--input", required=True)
args = parser.parse_args()
timescale = "0 ns"
prev_t = 0
r = ""
with open(args.input) a... | 0 | 0 | 0 |
e44c5c7369153c0b335096d306e417b6a7e39271 | 2,635 | py | Python | day12/__init__.py | MikkelPaulson/advent-of-code-2020 | 79568b4f99f961afe79f243236bf3a7f61cf0646 | [
"MIT"
] | 2 | 2020-12-06T20:01:06.000Z | 2020-12-06T20:01:11.000Z | day12/__init__.py | MikkelPaulson/advent-of-code-2020 | 79568b4f99f961afe79f243236bf3a7f61cf0646 | [
"MIT"
] | null | null | null | day12/__init__.py | MikkelPaulson/advent-of-code-2020 | 79568b4f99f961afe79f243236bf3a7f61cf0646 | [
"MIT"
] | null | null | null | """https://adventofcode.com/2020/day/12"""
import io
import math
def part1(stdin: io.TextIOWrapper, stderr: io.TextIOWrapper) -> int:
"""
Figure out where the navigation instructions lead. What is the Manhattan
distance between that location and the ship's starting position?
"""
directions = par... | 27.736842 | 78 | 0.545731 | """https://adventofcode.com/2020/day/12"""
import io
import math
def part1(stdin: io.TextIOWrapper, stderr: io.TextIOWrapper) -> int:
"""
Figure out where the navigation instructions lead. What is the Manhattan
distance between that location and the ship's starting position?
"""
directions = par... | 0 | 0 | 0 |
02dbf3be2f111fa52077a293d6991af803388c30 | 790 | py | Python | Algorithms_easy/1232. Check If It Is a Straight Line.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | 4 | 2020-08-11T20:45:15.000Z | 2021-03-12T00:33:34.000Z | Algorithms_easy/1232. Check If It Is a Straight Line.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | null | null | null | Algorithms_easy/1232. Check If It Is a Straight Line.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | null | null | null | """
1232. Check If It Is a Straight Line
Easy
You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.
Example 1:
Input: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]
Output: true
Example 2:
Inp... | 26.333333 | 171 | 0.629114 | """
1232. Check If It Is a Straight Line
Easy
You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.
Example 1:
Input: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]
Output: true
Example 2:
Inp... | 183 | -6 | 48 |
3e7fb5609842506699e8cd6d35a086e4ee17a0e9 | 6,377 | py | Python | classification/Kaggle: Malware Prediction/models.py | Diyago/ML-DL-scripts | 40718a9d4318d6d6531bcea5998c0a18afcd9cb3 | [
"Apache-2.0"
] | 142 | 2018-09-02T08:59:45.000Z | 2022-03-30T17:08:24.000Z | classification/Kaggle: Malware Prediction/models.py | jerinka/ML-DL-scripts | eeb5c3c7c5841eb4cdb272690e14d6718f3685b2 | [
"Apache-2.0"
] | 4 | 2019-09-08T07:27:11.000Z | 2021-10-19T05:50:24.000Z | classification/Kaggle: Malware Prediction/models.py | jerinka/ML-DL-scripts | eeb5c3c7c5841eb4cdb272690e14d6718f3685b2 | [
"Apache-2.0"
] | 75 | 2018-10-04T17:08:40.000Z | 2022-03-08T18:50:52.000Z | from numba import jit
# fast roc_auc computation: https://www.kaggle.com/c/microsoft-malware-prediction/discussion/76013
@jit
# idea from this kernel: https://www.kaggle.com/fabiendaniel/detecting-malwares-with-lgbm
| 32.370558 | 98 | 0.565626 | from numba import jit
# fast roc_auc computation: https://www.kaggle.com/c/microsoft-malware-prediction/discussion/76013
@jit
def fast_auc(y_true, y_prob):
y_true = np.asarray(y_true)
y_true = y_true[np.argsort(y_prob)]
nfalse = 0
auc = 0
n = len(y_true)
for i in range(n):
y_i = y_true[... | 6,066 | 0 | 90 |
d4b01411ed23c1c9bf55b4dba7e93ddf0d6bd2b1 | 81 | py | Python | Python/1002 - basico.py | carloshenrique051994/exerciciosUri | 1f73a32b44c79cd7aa47a89f2afb8e9618d27e3b | [
"MIT"
] | null | null | null | Python/1002 - basico.py | carloshenrique051994/exerciciosUri | 1f73a32b44c79cd7aa47a89f2afb8e9618d27e3b | [
"MIT"
] | null | null | null | Python/1002 - basico.py | carloshenrique051994/exerciciosUri | 1f73a32b44c79cd7aa47a89f2afb8e9618d27e3b | [
"MIT"
] | null | null | null | n = 3.14159
raio = float(input())
A = pow(raio, 2)*n
print('A={:.4f}'.format(A))
| 16.2 | 27 | 0.567901 | n = 3.14159
raio = float(input())
A = pow(raio, 2)*n
print('A={:.4f}'.format(A))
| 0 | 0 | 0 |
9ec914eabeb8a09bd951de7921432567a4c64f56 | 545 | py | Python | packages/care-package/core/python-iso.py | pgenevv/vcd-ext-sdk | 3bba3df0f8559ff55c723d22ba52864ebbc03b4b | [
"BSD-2-Clause"
] | 46 | 2018-03-06T22:18:58.000Z | 2022-02-18T14:13:51.000Z | packages/care-package/core/python-iso.py | pgenevv/vcd-ext-sdk | 3bba3df0f8559ff55c723d22ba52864ebbc03b4b | [
"BSD-2-Clause"
] | 104 | 2018-03-20T17:55:15.000Z | 2022-03-04T09:05:04.000Z | packages/care-package/core/python-iso.py | pgenevv/vcd-ext-sdk | 3bba3df0f8559ff55c723d22ba52864ebbc03b4b | [
"BSD-2-Clause"
] | 56 | 2018-03-20T15:39:31.000Z | 2022-02-15T08:27:01.000Z | #!/usr/bin/env python
import sys
import os
# Import pycdlib itself.
import pycdlib
if len(sys.argv) < 1:
print('Usage: %s' % (sys.argv[0]))
sys.exit(1)
# Create a new PyCdlib object.
iso = pycdlib.PyCdlib()
iso.new(interchange_level=3)
slash = '/'
for i in range(1, len(sys.argv)):
name = '/%s' % sys.arg... | 20.961538 | 75 | 0.636697 | #!/usr/bin/env python
import sys
import os
# Import pycdlib itself.
import pycdlib
if len(sys.argv) < 1:
print('Usage: %s' % (sys.argv[0]))
sys.exit(1)
# Create a new PyCdlib object.
iso = pycdlib.PyCdlib()
iso.new(interchange_level=3)
slash = '/'
for i in range(1, len(sys.argv)):
name = '/%s' % sys.arg... | 0 | 0 | 0 |
ee5be41de22957bf08359b41ab93b90a09d2de5d | 19,870 | py | Python | scripts/annotation_with_asm.py | maojanlin/gAIRRsuite | 2c7b586624a8ec3f7321da787729bf5435b219d3 | [
"MIT"
] | 3 | 2021-05-20T06:05:40.000Z | 2022-03-07T03:05:30.000Z | scripts/annotation_with_asm.py | maojanlin/gAIRRsuite | 2c7b586624a8ec3f7321da787729bf5435b219d3 | [
"MIT"
] | null | null | null | scripts/annotation_with_asm.py | maojanlin/gAIRRsuite | 2c7b586624a8ec3f7321da787729bf5435b219d3 | [
"MIT"
] | 1 | 2022-03-04T02:29:27.000Z | 2022-03-04T02:29:27.000Z | import argparse
import pickle
import os
import numpy as np
from filter_corrected_alleles import parse_perfect_sam, parse_fasta
from parse_contig_realign import parse_CIGAR
from utils import get_reverse_complement
import sys
if __name__ == "__main__":
args = parse_args()
fn_sam_H1 = args.fn_sam_H1
f... | 46.863208 | 166 | 0.605435 | import argparse
import pickle
import os
import numpy as np
from filter_corrected_alleles import parse_perfect_sam, parse_fasta
from parse_contig_realign import parse_CIGAR
from utils import get_reverse_complement
import sys
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'-fs1... | 11,120 | 0 | 184 |
19ce69b400977ed74915dd7704910d6a133e00b7 | 1,098 | py | Python | common/key_exchange/protocols/ssrp.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | 2 | 2015-04-04T01:44:11.000Z | 2017-11-04T11:59:27.000Z | common/key_exchange/protocols/ssrp.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | null | null | null | common/key_exchange/protocols/ssrp.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | null | null | null | import random
from common.key_exchange.protocols.srp import SecureRemotePasswordClient,\
SecureRemotePasswordServer
| 29.675676 | 74 | 0.65847 | import random
from common.key_exchange.protocols.srp import SecureRemotePasswordClient,\
SecureRemotePasswordServer
class SimplifiedSRPClient(SecureRemotePasswordClient):
def _compute_u(self):
return self.u
def _compute_S_from(self, x):
... | 593 | 66 | 267 |
e7d576c53eae00a0c81bdbf3e404b1f590d34a9b | 722 | py | Python | experiments/keras_numpy_backend.py | FabioTomaz/msc | 23e5b20cddd6285739b00b482ee5a24d7786356a | [
"MIT"
] | null | null | null | experiments/keras_numpy_backend.py | FabioTomaz/msc | 23e5b20cddd6285739b00b482ee5a24d7786356a | [
"MIT"
] | 1 | 2021-02-24T12:55:07.000Z | 2021-04-12T10:16:56.000Z | experiments/keras_numpy_backend.py | FabioTomaz/msc | 23e5b20cddd6285739b00b482ee5a24d7786356a | [
"MIT"
] | null | null | null | """Clone some funtions from Keras.
# References https://github.com/keras-team/keras/blob/master/keras/backend/numpy_backend.py
"""
import numpy as np | 36.1 | 91 | 0.671745 | """Clone some funtions from Keras.
# References https://github.com/keras-team/keras/blob/master/keras/backend/numpy_backend.py
"""
import numpy as np
def categorical_crossentropy(target, output, class_weights=None, from_logits=False):
if from_logits:
output = softmax(output)
else:
output /= ou... | 526 | 0 | 46 |
fa038528668db81a28ecda15a164552e97295a89 | 7,137 | py | Python | request/managers.py | Derecho/django-request | a2305a128acc879f9c4db50b08c0e7209fc1bd7b | [
"BSD-2-Clause"
] | 1 | 2015-11-08T13:25:11.000Z | 2015-11-08T13:25:11.000Z | request/managers.py | Derecho/django-request | a2305a128acc879f9c4db50b08c0e7209fc1bd7b | [
"BSD-2-Clause"
] | null | null | null | request/managers.py | Derecho/django-request | a2305a128acc879f9c4db50b08c0e7209fc1bd7b | [
"BSD-2-Clause"
] | null | null | null | import datetime, time
from urlparse import urlparse
from django.db import models
from django.contrib.auth.models import User
| 35.331683 | 144 | 0.514362 | import datetime, time
from urlparse import urlparse
from django.db import models
from django.contrib.auth.models import User
class RequestManager(models.Manager):
def active_users(self, **options):
"""
Returns a list of active users.
Any arguments passed to this method will be
... | 5,965 | 1,023 | 23 |
e2b62682e63b2d0fb39e1640881d3ce022c781d0 | 185 | py | Python | backend/core/__init__.py | EMUNES/hust-mdb | 578a9113bc48e19559bb2e62340d38e40bd6ccd8 | [
"Apache-2.0"
] | 2 | 2021-04-14T02:43:48.000Z | 2021-05-17T06:37:10.000Z | backend/core/__init__.py | EMUNES/hust-mdb | 578a9113bc48e19559bb2e62340d38e40bd6ccd8 | [
"Apache-2.0"
] | null | null | null | backend/core/__init__.py | EMUNES/hust-mdb | 578a9113bc48e19559bb2e62340d38e40bd6ccd8 | [
"Apache-2.0"
] | 1 | 2021-04-14T02:57:15.000Z | 2021-04-14T02:57:15.000Z | """Allow users to view and modify (add, delete, chnage) material data.
For the convennience of data manipulation and displaying, this application
is built on Django REST Framework.
""" | 37 | 74 | 0.778378 | """Allow users to view and modify (add, delete, chnage) material data.
For the convennience of data manipulation and displaying, this application
is built on Django REST Framework.
""" | 0 | 0 | 0 |
624fa509d2bfcd17e893b762a0d96d956033eb0d | 726 | py | Python | src/NZGBplugin/LINZ/Widgets/ErrorHandler.py | strk/gazetteer | 7c1a46827aaef47ffebe10f7d9dde1bbf477e6fe | [
"MIT"
] | null | null | null | src/NZGBplugin/LINZ/Widgets/ErrorHandler.py | strk/gazetteer | 7c1a46827aaef47ffebe10f7d9dde1bbf477e6fe | [
"MIT"
] | null | null | null | src/NZGBplugin/LINZ/Widgets/ErrorHandler.py | strk/gazetteer | 7c1a46827aaef47ffebe10f7d9dde1bbf477e6fe | [
"MIT"
] | null | null | null | ################################################################################
#
# New Zealand Geographic Board gazetteer application,
# Crown copyright (c) 2020, Land Information New Zealand on behalf of
# the New Zealand Government.
#
# This file is released under the MIT licence. See the LICENCE file found
# ... | 33 | 82 | 0.570248 | ################################################################################
#
# New Zealand Geographic Board gazetteer application,
# Crown copyright (c) 2020, Land Information New Zealand on behalf of
# the New Zealand Government.
#
# This file is released under the MIT licence. See the LICENCE file found
# ... | 164 | 0 | 23 |
6aa8d92c0afc291882ee31997e1b0279d7f8b78d | 7,735 | py | Python | homeassistant/components/homekit/type_sensors.py | henrikstumpf/home-assistant | e00e65a8938214b16a583cd44601a9729cad2873 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/homekit/type_sensors.py | henrikstumpf/home-assistant | e00e65a8938214b16a583cd44601a9729cad2873 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/homekit/type_sensors.py | henrikstumpf/home-assistant | e00e65a8938214b16a583cd44601a9729cad2873 | [
"Apache-2.0"
] | null | null | null | """Class to hold all sensor accessories."""
import logging
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS,
ATTR_DEVICE_CLASS, STATE_ON, STATE_HOME)
from . import TYPES
from .accessories import HomeAccessory, add_preload_service, setup_char
from .const import (
CATEGORY_SENSOR, SE... | 42.5 | 79 | 0.707563 | """Class to hold all sensor accessories."""
import logging
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS,
ATTR_DEVICE_CLASS, STATE_ON, STATE_HOME)
from . import TYPES
from .accessories import HomeAccessory, add_preload_service, setup_char
from .const import (
CATEGORY_SENSOR, SE... | 0 | 0 | 0 |
13cca3f6a11d5e5f0e3f6897cd6c5254e2c3f935 | 252 | py | Python | main.py | michaelmatias96/algorithms-coursera | c348cd1bba67b8913306c581873f6fac6ef404cc | [
"MIT"
] | null | null | null | main.py | michaelmatias96/algorithms-coursera | c348cd1bba67b8913306c581873f6fac6ef404cc | [
"MIT"
] | null | null | null | main.py | michaelmatias96/algorithms-coursera | c348cd1bba67b8913306c581873f6fac6ef404cc | [
"MIT"
] | null | null | null | from karatsuba import karatsuba
if __name__ == '__main__':
print(karatsuba.karatsuba(3141592653589793238462643383279502884197169399375105820974944592,
2718281828459045235360287471352662497757247093699959574966967627)) | 50.4 | 96 | 0.781746 | from karatsuba import karatsuba
if __name__ == '__main__':
print(karatsuba.karatsuba(3141592653589793238462643383279502884197169399375105820974944592,
2718281828459045235360287471352662497757247093699959574966967627)) | 0 | 0 | 0 |
ca9cc79b7d74d5b1e85191fe1eedef92646024c8 | 10,215 | py | Python | util/options.py | HiYKY/candock | fdbfced6f91f1d9a264bd6cdf9f957c03ec5d5d2 | [
"MIT"
] | null | null | null | util/options.py | HiYKY/candock | fdbfced6f91f1d9a264bd6cdf9f957c03ec5d5d2 | [
"MIT"
] | null | null | null | util/options.py | HiYKY/candock | fdbfced6f91f1d9a264bd6cdf9f957c03ec5d5d2 | [
"MIT"
] | 1 | 2022-01-21T03:25:24.000Z | 2022-01-21T03:25:24.000Z | import argparse
import os
import time
import numpy as np
from . import util,dsp,plot | 52.117347 | 152 | 0.606657 | import argparse
import os
import time
import numpy as np
from . import util,dsp,plot
class Options():
def __init__(self):
self.parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
self.initialized = False
def initialize(self):
# ---------------------... | 10,010 | -5 | 126 |
aca0f39efb10299f353154d7030fbdadb6967809 | 9,782 | py | Python | handyhelpers/serialise.py | JamesPerisher/usefull-resources | 3f8d283b7c75fed2dd2ff5ede67566df1ea73f1a | [
"MIT"
] | 1 | 2020-04-01T13:55:42.000Z | 2020-04-01T13:55:42.000Z | handyhelpers/serialise.py | JamesPerisher/handyhelpers | 3f8d283b7c75fed2dd2ff5ede67566df1ea73f1a | [
"MIT"
] | null | null | null | handyhelpers/serialise.py | JamesPerisher/handyhelpers | 3f8d283b7c75fed2dd2ff5ede67566df1ea73f1a | [
"MIT"
] | 1 | 2020-05-29T11:10:17.000Z | 2020-05-29T11:10:17.000Z | from hashlib import md5
import logging
import base64
h = logging.StreamHandler()
serial_log = logging.Logger(__name__)
h.setFormatter(logging.Formatter("%(levelname)s:%(name)s:%(message)s"))
serial_log.addHandler(h)
serial_log.critical("""
# NOTE: This program serialises objects that if saved to an external source ... | 35.314079 | 182 | 0.574934 | from hashlib import md5
import logging
import base64
h = logging.StreamHandler()
serial_log = logging.Logger(__name__)
h.setFormatter(logging.Formatter("%(levelname)s:%(name)s:%(message)s"))
serial_log.addHandler(h)
serial_log.critical("""
# NOTE: This program serialises objects that if saved to an external source ... | 7,423 | 20 | 1,185 |
ed6f69989f92159e507fb8a1afb92555b4ab1a71 | 272 | py | Python | app/api/models.py | spiritEcosse/app | 1bf1dbc95530f2ab0b063b7eeb7deb761821caf6 | [
"MIT"
] | null | null | null | app/api/models.py | spiritEcosse/app | 1bf1dbc95530f2ab0b063b7eeb7deb761821caf6 | [
"MIT"
] | null | null | null | app/api/models.py | spiritEcosse/app | 1bf1dbc95530f2ab0b063b7eeb7deb761821caf6 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
| 20.923077 | 45 | 0.683824 | import uuid
from django.db import models
class Application(models.Model):
key = models.CharField(max_length=40)
name = models.CharField(max_length=200)
def save(self, **kwargs):
self.key = uuid.uuid4()
super(Application, self).save(kwargs)
| 82 | 124 | 23 |
928aec18127c0f28dc432c0c179a6dadcf847688 | 1,593 | py | Python | tests/unit/util/interfaces.py | ethanjli/phylline | f11307d0f37ca835996250e1e835c44abd282769 | [
"MIT"
] | null | null | null | tests/unit/util/interfaces.py | ethanjli/phylline | f11307d0f37ca835996250e1e835c44abd282769 | [
"MIT"
] | null | null | null | tests/unit/util/interfaces.py | ethanjli/phylline | f11307d0f37ca835996250e1e835c44abd282769 | [
"MIT"
] | null | null | null | """Test the util.interfaces module."""
# Builtins
import abc
# Packages
from phylline.util.interfaces import InterfaceClass, SetterProperty
class Interface(object, metaclass=InterfaceClass):
"""Interface class for testing interfaces."""
def __init__(self):
"""Initialize members."""
self.v... | 22.43662 | 78 | 0.679849 | """Test the util.interfaces module."""
# Builtins
import abc
# Packages
from phylline.util.interfaces import InterfaceClass, SetterProperty
class Interface(object, metaclass=InterfaceClass):
"""Interface class for testing interfaces."""
def __init__(self):
"""Initialize members."""
self.v... | 44 | 0 | 80 |
8080e39246d1d1153fe7413a6638e093c9c74917 | 1,330 | py | Python | preprocessed_data/RGHS/Code/LabStretching.py | SaiKrishna1207/Underwater-Image-Segmentation | 78def27e577b10e6722c02807bdcfeb7ba53d760 | [
"MIT"
] | null | null | null | preprocessed_data/RGHS/Code/LabStretching.py | SaiKrishna1207/Underwater-Image-Segmentation | 78def27e577b10e6722c02807bdcfeb7ba53d760 | [
"MIT"
] | null | null | null | preprocessed_data/RGHS/Code/LabStretching.py | SaiKrishna1207/Underwater-Image-Segmentation | 78def27e577b10e6722c02807bdcfeb7ba53d760 | [
"MIT"
] | null | null | null | import cv2
from skimage.color import rgb2hsv,hsv2rgb
import numpy as np
from skimage.color import rgb2lab, lab2rgb
from global_StretchingL import global_stretching
from global_stretching_ab import global_Stretching_ab
| 22.931034 | 73 | 0.7 | import cv2
from skimage.color import rgb2hsv,hsv2rgb
import numpy as np
from skimage.color import rgb2lab, lab2rgb
from global_StretchingL import global_stretching
from global_stretching_ab import global_Stretching_ab
def LABStretching(sceneRadiance):
sceneRadiance = np.clip(sceneRadiance, 0, 255)
sceneRa... | 1,088 | 0 | 23 |
659b2d4941b7be7d29770df225f7cd84071e9102 | 549 | py | Python | Instagram/migrations/0008_auto_20180525_0947.py | T-Boya/Instagram-Clone | f012a809b8d8aba7f2524769da77c521dafb6d2c | [
"CNRI-Python"
] | null | null | null | Instagram/migrations/0008_auto_20180525_0947.py | T-Boya/Instagram-Clone | f012a809b8d8aba7f2524769da77c521dafb6d2c | [
"CNRI-Python"
] | null | null | null | Instagram/migrations/0008_auto_20180525_0947.py | T-Boya/Instagram-Clone | f012a809b8d8aba7f2524769da77c521dafb6d2c | [
"CNRI-Python"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2018-05-25 06:47
from __future__ import unicode_literals
from django.db import migrations, models
| 21.96 | 49 | 0.582878 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2018-05-25 06:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Instagram', '0007_auto_20180524_1439'),
]
operations = [
migrations.RemoveF... | 0 | 370 | 23 |
c9d89a6723f38c6e81b1141b4f22954c3760a272 | 5,631 | py | Python | src/Person.py | hillegass/discrete-simulation | 553746f457d76d64167d2048962843fa05d702c2 | [
"MIT"
] | 1 | 2020-01-22T20:35:54.000Z | 2020-01-22T20:35:54.000Z | src/Person.py | hillegass/discrete-simulation | 553746f457d76d64167d2048962843fa05d702c2 | [
"MIT"
] | null | null | null | src/Person.py | hillegass/discrete-simulation | 553746f457d76d64167d2048962843fa05d702c2 | [
"MIT"
] | null | null | null | import sys
import random
import Event
import numpy as np
# 1 is couple, 0 is single, affecting the risk
# allocate this person according to the risk
# get the probability of affecting
| 38.306122 | 100 | 0.591192 | import sys
import random
import Event
import numpy as np
class DeathEvent (Event.Event):
def __init__(self, day, person):
super().__init__(day)
self.person = person
def execute(self, world):
room = self.person.room
age = round((world.day - self.person.birthday) / 365)
... | 5,116 | 2 | 312 |
127b52f3962250409d98b8092dcea427d1156ecf | 4,172 | py | Python | Chapter06/snake-game-OOP.py | PacktPublishing/Learning-Python-by-building-games | 0713e6fc141b2cd201128560ae0c3b689b7d2116 | [
"MIT"
] | 25 | 2019-09-01T16:19:16.000Z | 2021-12-20T07:08:35.000Z | Chapter06/snake-game-OOP.py | PacktPublishing/Learning-Python-by-building-games. | 0713e6fc141b2cd201128560ae0c3b689b7d2116 | [
"MIT"
] | 4 | 2019-08-27T19:45:48.000Z | 2020-07-24T12:29:56.000Z | Chapter06/snake-game-OOP.py | PacktPublishing/Learning-Python-by-building-games | 0713e6fc141b2cd201128560ae0c3b689b7d2116 | [
"MIT"
] | 24 | 2019-06-01T18:31:07.000Z | 2022-03-15T19:24:34.000Z |
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_DOWN, KEY_UP
from random import randint
WIDTH = 35
HEIGHT = 20
MAX_X = WIDTH - 2
MAX_Y = HEIGHT - 2
SNAKE_LENGTH = 5
SNAKE_X = SNAKE_LENGTH + 1
SNAKE_Y = 3
TIMEOUT = 100
if __name__ == '__main__':
curses.initscr()
curses.beep()
curses.beep()
... | 24.115607 | 67 | 0.561361 |
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_DOWN, KEY_UP
from random import randint
WIDTH = 35
HEIGHT = 20
MAX_X = WIDTH - 2
MAX_Y = HEIGHT - 2
SNAKE_LENGTH = 5
SNAKE_X = SNAKE_LENGTH + 1
SNAKE_Y = 3
TIMEOUT = 100
class Snake(object):
REV_DIR_MAP = {
KEY_UP: KEY_DOWN, KEY_DOWN: KEY_UP,
... | 2,231 | 616 | 149 |
8ba45f53d6d6ecab732fbfb50c7a68c3ad41db12 | 8,774 | py | Python | preprocess/01data_preprocess_.py | LitteleStar/TDPP | 7b85016bea01c4c018337152599043dc2efbaba8 | [
"Apache-2.0"
] | null | null | null | preprocess/01data_preprocess_.py | LitteleStar/TDPP | 7b85016bea01c4c018337152599043dc2efbaba8 | [
"Apache-2.0"
] | null | null | null | preprocess/01data_preprocess_.py | LitteleStar/TDPP | 7b85016bea01c4c018337152599043dc2efbaba8 | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
import sys
import json
import random
from collections import defaultdict
import csv
import pickle
# 22179163 taobao单个用户最大scale
random.seed(1230)
name = 'book'
filter_size = 80 # 过滤item
filter_len = 0 # 过滤item history
# 把不对的时间筛掉
def read_from_amazon(source):
"... | 35.812245 | 133 | 0.58434 | import os
import pandas as pd
import sys
import json
import random
from collections import defaultdict
import csv
import pickle
# 22179163 taobao单个用户最大scale
random.seed(1230)
name = 'book'
filter_size = 80 # 过滤item
filter_len = 0 # 过滤item history
# 把不对的时间筛掉
def to_csv(RAW_DATA_FILE):
df = pd.... | 7,876 | 0 | 192 |
32b673cae99a2a3a1e39f6ffe354e42f39a56630 | 8,497 | py | Python | Lib/Graph_Construction.py | Brain03Yao/M2TGCN | 72c65687fa52c618740cd6d1db7366116f68398c | [
"MIT"
] | 6 | 2021-04-16T07:47:01.000Z | 2022-02-22T13:57:47.000Z | Lib/Graph_Construction.py | Brain03Yao/M2TGCN | 72c65687fa52c618740cd6d1db7366116f68398c | [
"MIT"
] | 2 | 2021-04-27T02:41:33.000Z | 2021-06-18T03:56:22.000Z | Lib/Graph_Construction.py | Brain03Yao/M2TGCN | 72c65687fa52c618740cd6d1db7366116f68398c | [
"MIT"
] | 2 | 2021-10-04T13:22:45.000Z | 2021-12-20T12:46:46.000Z | import pickle
import numpy as np
import scipy
import sklearn
from sklearn.metrics import confusion_matrix
import torch
| 33.718254 | 102 | 0.641638 | import pickle
import numpy as np
import scipy
import sklearn
from sklearn.metrics import confusion_matrix
import torch
def without_random_walk_train_whole(train_index, k_value, file_path):
# calculate group-level adj matrix from training set
idx_mean, prob_mean = read_train_pkl_k_whole(train_index,... | 8,067 | 0 | 275 |
a0d46d3a990b99c7f241835f0d67230d9806303d | 2,264 | py | Python | setup.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | 4 | 2016-02-22T02:34:32.000Z | 2018-11-02T02:31:58.000Z | setup.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | null | null | null | setup.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | 1 | 2018-03-19T13:59:25.000Z | 2018-03-19T13:59:25.000Z | from setuptools import setup, Extension
import numpy as np
from Cython.Distutils import build_ext
requires = ['h5py',
'pandas',
'scipy',
'george',
'emcee',
'matplotlib',
'bokeh==0.10',
'astropy',
'corner',
'scik... | 34.830769 | 99 | 0.556979 | from setuptools import setup, Extension
import numpy as np
from Cython.Distutils import build_ext
requires = ['h5py',
'pandas',
'scipy',
'george',
'emcee',
'matplotlib',
'bokeh==0.10',
'astropy',
'corner',
'scik... | 0 | 0 | 0 |
5993c7d726586163fef911e97765d4b9587e3fcf | 11,277 | py | Python | quantus/helpers/utils.py | sebastian-lapuschkin/Quantus | c3b8a9fb2018f34bd89ba38efa2b2b8c38128b3f | [
"MIT"
] | null | null | null | quantus/helpers/utils.py | sebastian-lapuschkin/Quantus | c3b8a9fb2018f34bd89ba38efa2b2b8c38128b3f | [
"MIT"
] | null | null | null | quantus/helpers/utils.py | sebastian-lapuschkin/Quantus | c3b8a9fb2018f34bd89ba38efa2b2b8c38128b3f | [
"MIT"
] | null | null | null | """This module contains the utils functions of the library."""
import re
import random
import numpy as np
from typing import Callable, List, Optional, Sequence, Tuple, Union
from importlib import util
from skimage.segmentation import slic, felzenszwalb
from ..helpers.model_interface import ModelInterface
if util.find_... | 35.351097 | 116 | 0.608673 | """This module contains the utils functions of the library."""
import re
import random
import numpy as np
from typing import Callable, List, Optional, Sequence, Tuple, Union
from importlib import util
from skimage.segmentation import slic, felzenszwalb
from ..helpers.model_interface import ModelInterface
if util.find_... | 114 | 0 | 23 |
f8d3f7a0afcfea9b9f5dca1f71c0e3bd76be9fbf | 1,535 | py | Python | dapp_user/testcases/unit_testcases/test_user_service.py | vinthedark/snet-marketplace-service | 66ed9d093b00f09d3e28ef4d86c4e4c125037d06 | [
"MIT"
] | 14 | 2019-02-12T09:14:52.000Z | 2021-03-11T18:42:22.000Z | dapp_user/testcases/unit_testcases/test_user_service.py | vinthedark/snet-marketplace-service | 66ed9d093b00f09d3e28ef4d86c4e4c125037d06 | [
"MIT"
] | 1,079 | 2019-01-10T04:31:24.000Z | 2022-03-29T06:16:42.000Z | dapp_user/testcases/unit_testcases/test_user_service.py | vinthedark/snet-marketplace-service | 66ed9d093b00f09d3e28ef4d86c4e4c125037d06 | [
"MIT"
] | 20 | 2018-12-18T13:06:41.000Z | 2021-09-17T11:13:01.000Z | from datetime import datetime
from unittest import TestCase
from unittest.mock import patch
from common.repository import Repository
from dapp_user.config import NETWORK_ID, NETWORKS
from dapp_user.domain.services.user_service import UserService
| 35.697674 | 107 | 0.6443 | from datetime import datetime
from unittest import TestCase
from unittest.mock import patch
from common.repository import Repository
from dapp_user.config import NETWORK_ID, NETWORKS
from dapp_user.domain.services.user_service import UserService
class TestUserService(TestCase):
def setUp(self):
self.repo... | 1,117 | 147 | 23 |
a88f1e74f7aea2a2a9f2227deaecd62b02d38785 | 3,929 | py | Python | trainer/image/iterator.py | Vottivott/mildnet | 4787dc756f1abcab4f7cb57ffb8701dcaf27edba | [
"Apache-2.0"
] | null | null | null | trainer/image/iterator.py | Vottivott/mildnet | 4787dc756f1abcab4f7cb57ffb8701dcaf27edba | [
"Apache-2.0"
] | null | null | null | trainer/image/iterator.py | Vottivott/mildnet | 4787dc756f1abcab4f7cb57ffb8701dcaf27edba | [
"Apache-2.0"
] | 2 | 2019-08-06T10:10:27.000Z | 2020-05-03T11:51:34.000Z | import logging
import os
import numpy as np
from keras_preprocessing.image import Iterator, load_img, img_to_array, array_to_img
from keras_preprocessing.image.iterator import BatchFromFilesMixin
from keras_preprocessing.image.directory_iterator import DirectoryIterator
class MildIterator(Iterator):
"""Abstract b... | 41.797872 | 116 | 0.570629 | import logging
import os
import numpy as np
from keras_preprocessing.image import Iterator, load_img, img_to_array, array_to_img
from keras_preprocessing.image.iterator import BatchFromFilesMixin
from keras_preprocessing.image.directory_iterator import DirectoryIterator
class MildIterator(Iterator):
"""Abstract b... | 3,203 | 30 | 77 |
919b58ca39b8909cae2467529ef6f2f64c5b88b4 | 1,524 | py | Python | notebooks/manta-multi-frame-save.py | igred8/laser-rb | 1c3d1acc821a5bdaebba8fe63f1013430a1fe80f | [
"MIT"
] | null | null | null | notebooks/manta-multi-frame-save.py | igred8/laser-rb | 1c3d1acc821a5bdaebba8fe63f1013430a1fe80f | [
"MIT"
] | null | null | null | notebooks/manta-multi-frame-save.py | igred8/laser-rb | 1c3d1acc821a5bdaebba8fe63f1013430a1fe80f | [
"MIT"
] | null | null | null | from vimba import *
import sys
sys.path.append('D:/Dropbox/py_projects/vimba-api/src/')
import vimbaapilib as val
from time import sleep, time_ns
if __name__ == '__main__':
main() | 33.866667 | 134 | 0.578084 | from vimba import *
import sys
sys.path.append('D:/Dropbox/py_projects/vimba-api/src/')
import vimbaapilib as val
from time import sleep, time_ns
def main():
val.print_preamble()
# change this ID if it does not match the desired camera
# cam_id = parse_args()
CAM_ID = 'DEV_000F314EED0D'
NFRAMES ... | 1,316 | 0 | 23 |
6460cc716b4e24183027ff1670a1412ec27ffa91 | 20 | py | Python | nwbindexer/__init__.py | jeffteeters/nwb_indexer | 40469793645d3e08ae9f0ddf2cff5df7577c413d | [
"BSD-4-Clause-UC"
] | null | null | null | nwbindexer/__init__.py | jeffteeters/nwb_indexer | 40469793645d3e08ae9f0ddf2cff5df7577c413d | [
"BSD-4-Clause-UC"
] | null | null | null | nwbindexer/__init__.py | jeffteeters/nwb_indexer | 40469793645d3e08ae9f0ddf2cff5df7577c413d | [
"BSD-4-Clause-UC"
] | null | null | null | name = "nwbindexer"
| 10 | 19 | 0.7 | name = "nwbindexer"
| 0 | 0 | 0 |
6b3c724afdd2103dda2cacbede214161dbdf5067 | 20,679 | py | Python | main_a2c.py | abaisero/asym-porl | 8a76d920e51d783bbeeeea3cd2b02efffbb33c72 | [
"MIT"
] | 2 | 2021-08-24T22:41:36.000Z | 2021-10-31T01:55:37.000Z | main_a2c.py | abaisero/asym-porl | 8a76d920e51d783bbeeeea3cd2b02efffbb33c72 | [
"MIT"
] | null | null | null | main_a2c.py | abaisero/asym-porl | 8a76d920e51d783bbeeeea3cd2b02efffbb33c72 | [
"MIT"
] | 1 | 2021-10-13T12:27:40.000Z | 2021-10-13T12:27:40.000Z | #!/usr/bin/env python
import argparse
import logging
import logging.config
import os
import random
import signal
from dataclasses import asdict, dataclass
from typing import Dict, NamedTuple
import gym
import numpy as np
import torch
import torch.nn as nn
import wandb
from gym_gridverse.rng import reset_gv_rng
from a... | 32.980861 | 95 | 0.614488 | #!/usr/bin/env python
import argparse
import logging
import logging.config
import os
import random
import signal
from dataclasses import asdict, dataclass
from typing import Dict, NamedTuple
import gym
import numpy as np
import torch
import torch.nn as nn
import wandb
from gym_gridverse.rng import reset_gv_rng
from a... | 17,836 | 601 | 136 |
66b50b92d565476c53524409574868c0f065f74b | 9,166 | py | Python | phanas/automount.py | lesaint/phanas_destkop | 2bfc8d4a4feed1fe4474b6f827f253a3263c2bc2 | [
"Apache-2.0"
] | null | null | null | phanas/automount.py | lesaint/phanas_destkop | 2bfc8d4a4feed1fe4474b6f827f253a3263c2bc2 | [
"Apache-2.0"
] | null | null | null | phanas/automount.py | lesaint/phanas_destkop | 2bfc8d4a4feed1fe4474b6f827f253a3263c2bc2 | [
"Apache-2.0"
] | null | null | null | import getpass
import logging
import os
import phanas.nas
import phanas.file_utils
import subprocess
import sys
from pathlib import Path
from subprocess import PIPE
MOUNT_DIR_NAME = "__NAS__"
| 37.260163 | 159 | 0.639974 | import getpass
import logging
import os
import phanas.nas
import phanas.file_utils
import subprocess
import sys
from pathlib import Path
from subprocess import PIPE
MOUNT_DIR_NAME = "__NAS__"
class Env:
linux_username = getpass.getuser()
# from https://stackoverflow.com/a/4028943
home_dir_path = Path.hom... | 7,595 | 1,331 | 46 |
89861368e363d7117722953e7d647f846c932972 | 3,027 | py | Python | products/views.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | products/views.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | products/views.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | from django.urls.base import reverse_lazy
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormMixin, FormView
from django.views.generic.list import ListView
from products.forms import Reviewform
from products.models import Color, Product, ProductCategory, Review, Size
from djang... | 32.202128 | 75 | 0.627023 | from django.urls.base import reverse_lazy
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormMixin, FormView
from django.views.generic.list import ListView
from products.forms import Reviewform
from products.models import Color, Product, ProductCategory, Review, Size
from djang... | 2,032 | 432 | 46 |
a29c2322eed79598a53f445e200511ddd6bf4c83 | 168 | py | Python | examples/simple.py | sehlstrom/compas_viewers | 9644d22e8ea9ddfd52698c48775b6e5e7ab4dd56 | [
"MIT"
] | null | null | null | examples/simple.py | sehlstrom/compas_viewers | 9644d22e8ea9ddfd52698c48775b6e5e7ab4dd56 | [
"MIT"
] | null | null | null | examples/simple.py | sehlstrom/compas_viewers | 9644d22e8ea9ddfd52698c48775b6e5e7ab4dd56 | [
"MIT"
] | null | null | null | import compas
from compas.datastructures import Mesh
from compas_viewers import MeshViewer
viewer = MeshViewer()
viewer.mesh = Mesh.from_polyhedron(6)
viewer.show()
| 16.8 | 38 | 0.809524 | import compas
from compas.datastructures import Mesh
from compas_viewers import MeshViewer
viewer = MeshViewer()
viewer.mesh = Mesh.from_polyhedron(6)
viewer.show()
| 0 | 0 | 0 |
426d1afdbf57af655c133d5801e5bdaf46d67d4a | 26,590 | py | Python | processing.py | corobiapolitici-sk/corobiapolitici-sk-scraper | 4ebce9046cc511c692f6bbece3e4e5504a3846d1 | [
"MIT"
] | null | null | null | processing.py | corobiapolitici-sk/corobiapolitici-sk-scraper | 4ebce9046cc511c692f6bbece3e4e5504a3846d1 | [
"MIT"
] | null | null | null | processing.py | corobiapolitici-sk/corobiapolitici-sk-scraper | 4ebce9046cc511c692f6bbece3e4e5504a3846d1 | [
"MIT"
] | null | null | null | # Load external modules.
from datetime import datetime, timedelta
import logging
import numpy as np
import pandas as pd
# Load internal modules.
import constants as const
import storage
import utils
#########
# NODES #
#########
#########
# EDGES #
#########
| 41.611894 | 119 | 0.615871 | # Load external modules.
from datetime import datetime, timedelta
import logging
import numpy as np
import pandas as pd
# Load internal modules.
import constants as const
import storage
import utils
class Processing:
def __init__(self, db, conf):
self.db = db
self.conf = conf
self.name = s... | 23,589 | 460 | 2,286 |
14b4af56341cc43acb2826ac104d86dd50a6c97d | 8,511 | py | Python | tests/test_network.py | lewoudar/click_params | 85d2bfb68d0b5f163840afbbd03b08b30d5f0f46 | [
"Apache-2.0"
] | null | null | null | tests/test_network.py | lewoudar/click_params | 85d2bfb68d0b5f163840afbbd03b08b30d5f0f46 | [
"Apache-2.0"
] | null | null | null | tests/test_network.py | lewoudar/click_params | 85d2bfb68d0b5f163840afbbd03b08b30d5f0f46 | [
"Apache-2.0"
] | null | null | null | from ipaddress import IPv4Address, IPv6Address
import click
import pytest
from click_params.network import (
IP_ADDRESS, IPV4_ADDRESS, IPV6_ADDRESS, IP_NETWORK, IPV4_NETWORK, IPV6_NETWORK, Ipv4AddressRange, Ipv6AddressRange,
IpAddressListParamType, Ipv4AddressListParamType, Ipv6AddressListParamType, IpNetwork... | 43.646154 | 120 | 0.653977 | from ipaddress import IPv4Address, IPv6Address
import click
import pytest
from click_params.network import (
IP_ADDRESS, IPV4_ADDRESS, IPV6_ADDRESS, IP_NETWORK, IPV4_NETWORK, IPV6_NETWORK, Ipv4AddressRange, Ipv6AddressRange,
IpAddressListParamType, Ipv4AddressListParamType, Ipv6AddressListParamType, IpNetwork... | 2,243 | 0 | 176 |
3d30a41e746065d31caf1ef36a38915fbf3d90ff | 1,131 | py | Python | LeetCode/Aug 2020 Leetcoding Challenge/Vertical Order Traversal of a Binary Tree - BFS Approach with Partition Sorting.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | 13 | 2021-09-02T07:30:02.000Z | 2022-03-22T19:32:03.000Z | LeetCode/Aug 2020 Leetcoding Challenge/Vertical Order Traversal of a Binary Tree - BFS Approach with Partition Sorting.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | null | null | null | LeetCode/Aug 2020 Leetcoding Challenge/Vertical Order Traversal of a Binary Tree - BFS Approach with Partition Sorting.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | 3 | 2021-08-24T16:06:22.000Z | 2021-09-17T15:39:53.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right | 37.7 | 73 | 0.524315 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def verticalTraversal(self, root: TreeNode) -> List[List[int]]:
if root is None:
return ... | 898 | -6 | 48 |
1654a72adbec9a84782245aa1ea13563907ee085 | 12,908 | py | Python | load_all_results.py | eatkinson/UKBB-Diverse-pops | 8e20c5f235ea8f7a66f401915bbecd9cfed45e7d | [
"MIT"
] | 3 | 2019-06-25T21:55:47.000Z | 2019-07-24T04:48:13.000Z | load_all_results.py | eatkinson/UKBB-Diverse-pops | 8e20c5f235ea8f7a66f401915bbecd9cfed45e7d | [
"MIT"
] | null | null | null | load_all_results.py | eatkinson/UKBB-Diverse-pops | 8e20c5f235ea8f7a66f401915bbecd9cfed45e7d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
__author__ = 'konradk'
import sys
import argparse
from pprint import pprint
from datetime import date
from collections import Counter
from tqdm import tqdm
from gnomad.utils import slack
from ukbb_pan_ancestry import *
if __name__ == '__main__':
parser = argparse.ArgumentParser... | 47.807407 | 172 | 0.648048 | #!/usr/bin/env python3
__author__ = 'konradk'
import sys
import argparse
from pprint import pprint
from datetime import date
from collections import Counter
from tqdm import tqdm
from gnomad.utils import slack
from ukbb_pan_ancestry import *
def get_all_valid_variant_results_ht_paths(pop):
results_dir = f'{buck... | 11,015 | 0 | 230 |
12abea2b15ace4e14045a87dcaa8ddf414311e5d | 1,729 | py | Python | src/reg/infer_reg.py | quantran14/HC | 57b5440b0436db8d25402ccd7d9531b30cf6a13d | [
"MIT"
] | null | null | null | src/reg/infer_reg.py | quantran14/HC | 57b5440b0436db8d25402ccd7d9531b30cf6a13d | [
"MIT"
] | null | null | null | src/reg/infer_reg.py | quantran14/HC | 57b5440b0436db8d25402ccd7d9531b30cf6a13d | [
"MIT"
] | null | null | null | import os
import cv2
import argparse
import numpy as np
import pandas as pd
from PIL import Image
import tensorflow as tf
import matplotlib.pyplot as plt
from reg.data import DataLoader, read_image_by_tf
data = DataLoader("../data/training_set",
one_hot_encoding=True,
palette=[255... | 28.816667 | 125 | 0.625217 | import os
import cv2
import argparse
import numpy as np
import pandas as pd
from PIL import Image
import tensorflow as tf
import matplotlib.pyplot as plt
from reg.data import DataLoader, read_image_by_tf
data = DataLoader("../data/training_set",
one_hot_encoding=True,
palette=[255... | 1,267 | 0 | 92 |
195e75e6baa3c10ae9955eceb31122b4f716ffd5 | 915 | py | Python | final_project/machinetranslation/translator.py | DSingh04/xzceb-flask_eng_fr | db22d4a259105e95b117f2ad47d3a9ff573bb75a | [
"Apache-2.0"
] | null | null | null | final_project/machinetranslation/translator.py | DSingh04/xzceb-flask_eng_fr | db22d4a259105e95b117f2ad47d3a9ff573bb75a | [
"Apache-2.0"
] | null | null | null | final_project/machinetranslation/translator.py | DSingh04/xzceb-flask_eng_fr | db22d4a259105e95b117f2ad47d3a9ff573bb75a | [
"Apache-2.0"
] | null | null | null | import json
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
authenticator = IAMAuthenticator(apikey)
language_translator = LanguageTranslatorV3(
... | 32.678571 | 100 | 0.801093 | import json
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
authenticator = IAMAuthenticator(apikey)
language_translator = LanguageTranslatorV3(
... | 392 | 0 | 46 |
f4e77fa36650bc14f8742779ee1db00ab5b56774 | 391 | py | Python | mezzanine_themes/html5_boilerplate/urls.py | standenman/MyDjangoProject | dfc3fdc7f6a7bba4e34b078cf3c9f42f6c51a226 | [
"BSD-2-Clause"
] | 64 | 2015-01-13T11:24:10.000Z | 2021-07-01T02:39:20.000Z | mezzanine_themes/html5_boilerplate/urls.py | standenman/MyDjangoProject | dfc3fdc7f6a7bba4e34b078cf3c9f42f6c51a226 | [
"BSD-2-Clause"
] | 6 | 2015-08-27T08:57:20.000Z | 2018-07-24T06:19:26.000Z | mezzanine_themes/html5_boilerplate/urls.py | standenman/MyDjangoProject | dfc3fdc7f6a7bba4e34b078cf3c9f42f6c51a226 | [
"BSD-2-Clause"
] | 22 | 2015-06-05T02:28:10.000Z | 2019-05-27T13:09:14.000Z | from django.conf.urls.defaults import patterns, include, url
try:
from django.views.generic.base import TemplateView
urlpatterns = patterns('',
url(r'^robots\.txt$', TextPlainView.as_view(template_name='robots.txt')),
)
except:
urlpatterns = patterns('django.views.generic.simple',
(r'^r... | 32.583333 | 81 | 0.677749 | from django.conf.urls.defaults import patterns, include, url
try:
from django.views.generic.base import TemplateView
urlpatterns = patterns('',
url(r'^robots\.txt$', TextPlainView.as_view(template_name='robots.txt')),
)
except:
urlpatterns = patterns('django.views.generic.simple',
(r'^r... | 0 | 0 | 0 |
176dc9eba620b1b188e0454e8709cbc61a280f57 | 12,676 | py | Python | synapse/_scripts/batch_generate_users/batch_register_matrix_users.py | AwesomeChristian/synapse | a78dd956a0a078a4f4f340a1471b3de1af6b40de | [
"Apache-2.0"
] | null | null | null | synapse/_scripts/batch_generate_users/batch_register_matrix_users.py | AwesomeChristian/synapse | a78dd956a0a078a4f4f340a1471b3de1af6b40de | [
"Apache-2.0"
] | null | null | null | synapse/_scripts/batch_generate_users/batch_register_matrix_users.py | AwesomeChristian/synapse | a78dd956a0a078a4f4f340a1471b3de1af6b40de | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2018 New Vector
# Copyright 2019 Awesome Technologies Innovationslabor GmbH
#
# 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 Lice... | 30.109264 | 137 | 0.585831 | # -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2018 New Vector
# Copyright 2019 Awesome Technologies Innovationslabor GmbH
#
# 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 Lice... | 11,467 | 0 | 165 |
0eee5dc25dc379c5ecbdd2135d10170b144ef3c5 | 2,962 | py | Python | v1/third_party/rest_framework/permissions.py | jamessspanggg/Website-API | 60c65d0714145a67800d91f420351c4ae04aa7fa | [
"MIT"
] | null | null | null | v1/third_party/rest_framework/permissions.py | jamessspanggg/Website-API | 60c65d0714145a67800d91f420351c4ae04aa7fa | [
"MIT"
] | null | null | null | v1/third_party/rest_framework/permissions.py | jamessspanggg/Website-API | 60c65d0714145a67800d91f420351c4ae04aa7fa | [
"MIT"
] | null | null | null | from rest_framework.permissions import BasePermission, SAFE_METHODS
from v1.teams.models.team import CoreTeam, ProjectTeam
from v1.teams.models.team_member import CoreMember, ProjectMember
class IsStaffOrReadOnly(BasePermission):
"""The request is authenticated as a user and is staff, or is a read-only request"... | 34.847059 | 104 | 0.701891 | from rest_framework.permissions import BasePermission, SAFE_METHODS
from v1.teams.models.team import CoreTeam, ProjectTeam
from v1.teams.models.team_member import CoreMember, ProjectMember
class AnonWrite(BasePermission):
def has_permission(self, request, view):
return request.user.is_anonymous and requ... | 1,830 | 284 | 381 |
129e1da98a1c1f4468307be458dc5aa46bccd5dd | 70 | py | Python | pytorch/detector/detectors/yolov2_slim/__init__.py | xuantong/maix_train | 58c9522399a030e8b56e9901fac201ec4cabc836 | [
"Apache-2.0"
] | 45 | 2020-11-30T11:23:52.000Z | 2022-02-14T16:57:43.000Z | pytorch/detector/detectors/yolov2_slim/__init__.py | xuantong/maix_train | 58c9522399a030e8b56e9901fac201ec4cabc836 | [
"Apache-2.0"
] | 20 | 2020-12-10T13:58:08.000Z | 2022-03-29T12:43:54.000Z | pytorch/detector/detectors/yolov2_slim/__init__.py | xuantong/maix_train | 58c9522399a030e8b56e9901fac201ec4cabc836 | [
"Apache-2.0"
] | 28 | 2020-11-29T21:22:28.000Z | 2022-03-24T03:03:08.000Z |
from .train import Train
from .test import Test
framwork = "torch"
| 10 | 24 | 0.728571 |
from .train import Train
from .test import Test
framwork = "torch"
| 0 | 0 | 0 |
e3f880e8cab0aa831b2d1ebb3aa33a32e69d4474 | 4,977 | py | Python | src/sdi_utils_operators/line_array/line_array.py | thhapke/gensolution | f5e9600928ab34a5552033f6a3ef062f950a6cfa | [
"MIT"
] | 6 | 2019-12-06T02:34:17.000Z | 2020-05-22T08:05:27.000Z | src/sdi_utils_operators/line_array/line_array.py | thhapke/gensolution | f5e9600928ab34a5552033f6a3ef062f950a6cfa | [
"MIT"
] | 1 | 2020-04-21T09:35:27.000Z | 2020-04-21T09:43:45.000Z | src/sdi_utils_operators/line_array/line_array.py | thhapke/gensolution | f5e9600928ab34a5552033f6a3ef062f950a6cfa | [
"MIT"
] | null | null | null | import io
import json
import os
import subprocess
import sdi_utils.gensolution as gs
import sdi_utils.set_logging as slog
import sdi_utils.textfield_parser as tfp
import sdi_utils.tprogress as tp
try:
api
except NameError:
all_lines = list()
inports = [{'name': 'stream', 'type': 'message.file',"description":"... | 36.328467 | 147 | 0.581274 | import io
import json
import os
import subprocess
import sdi_utils.gensolution as gs
import sdi_utils.set_logging as slog
import sdi_utils.textfield_parser as tfp
import sdi_utils.tprogress as tp
try:
api
except NameError:
class api:
class Message:
def __init__(self,body = None,attributes ... | 2,367 | 1,246 | 72 |
efae4b469ad3905c9fcaecde5cc6f79df0b9647c | 372 | py | Python | PARTE_2/EX018/index.py | 0Fernando0/CursoPython | 1dcfdb6556e41c6dedcba2857aa4382b2f81aa59 | [
"MIT"
] | null | null | null | PARTE_2/EX018/index.py | 0Fernando0/CursoPython | 1dcfdb6556e41c6dedcba2857aa4382b2f81aa59 | [
"MIT"
] | null | null | null | PARTE_2/EX018/index.py | 0Fernando0/CursoPython | 1dcfdb6556e41c6dedcba2857aa4382b2f81aa59 | [
"MIT"
] | null | null | null | from datetime import datetime
atual = datetime.now().year
maiores = 0
menores = 0
for c in range(1,8):
nasc = int(input('Em Que Ano Você Nasceu? '))
idade = atual - nasc
if idade >= 18:
maiores += 1
else:
menores += 1
print('{} pessoa(s) é(são) de maior(es)'.format(maiores))
print('{} ... | 23.25 | 57 | 0.602151 | from datetime import datetime
atual = datetime.now().year
maiores = 0
menores = 0
for c in range(1,8):
nasc = int(input('Em Que Ano Você Nasceu? '))
idade = atual - nasc
if idade >= 18:
maiores += 1
else:
menores += 1
print('{} pessoa(s) é(são) de maior(es)'.format(maiores))
print('{} ... | 0 | 0 | 0 |
572add4b036435d61908e20a07c508090b61b595 | 1,907 | py | Python | myrsidea/patterns/body_part.py | rafelafrance/traiter_myrsidea | 5fdf71554e52c239d53dadcef1f204fc018be728 | [
"MIT"
] | null | null | null | myrsidea/patterns/body_part.py | rafelafrance/traiter_myrsidea | 5fdf71554e52c239d53dadcef1f204fc018be728 | [
"MIT"
] | 1 | 2021-06-11T17:25:11.000Z | 2021-06-11T17:25:11.000Z | myrsidea/patterns/body_part.py | rafelafrance/traiter_myrsidea | 5fdf71554e52c239d53dadcef1f204fc018be728 | [
"MIT"
] | null | null | null | """Extract body part annotations."""
import re
import spacy
from traiter.const import COMMA
from traiter.patterns.matcher_patterns import MatcherPatterns
from myrsidea.pylib.const import COMMON_PATTERNS, CONJ, MISSING, REPLACE
JOINER = CONJ + COMMA
MISSING_RE = '|'.join([fr'\b{m}\b' for m in MISSING])
MISSING_RE =... | 22.975904 | 72 | 0.572627 | """Extract body part annotations."""
import re
import spacy
from traiter.const import COMMA
from traiter.patterns.matcher_patterns import MatcherPatterns
from myrsidea.pylib.const import COMMON_PATTERNS, CONJ, MISSING, REPLACE
JOINER = CONJ + COMMA
MISSING_RE = '|'.join([fr'\b{m}\b' for m in MISSING])
MISSING_RE =... | 0 | 0 | 0 |
ae6fb46b699307b0db6034a32e4d92f3b5d837b9 | 48 | py | Python | selia_managers/settings.py | CONABIO-audio/selia-managers | 4d603bd329bd47654839596793e168db7a0ec35f | [
"BSD-4-Clause"
] | null | null | null | selia_managers/settings.py | CONABIO-audio/selia-managers | 4d603bd329bd47654839596793e168db7a0ec35f | [
"BSD-4-Clause"
] | 10 | 2020-04-15T17:54:57.000Z | 2022-03-12T00:11:27.000Z | selia_managers/settings.py | CONABIO-audio/selia-managers | 4d603bd329bd47654839596793e168db7a0ec35f | [
"BSD-4-Clause"
] | null | null | null | SELIA_MANAGERS_APPS = [
'selia_managers',
]
| 12 | 23 | 0.6875 | SELIA_MANAGERS_APPS = [
'selia_managers',
]
| 0 | 0 | 0 |
094f67b0a780a51c02f19a970fa3a7e33dc33b5f | 5,904 | py | Python | py_scripts/models.py | flimao/case-previsao-faturamento | 333afe0f83a8acdf2f5f021a04530649b18915e4 | [
"MIT"
] | null | null | null | py_scripts/models.py | flimao/case-previsao-faturamento | 333afe0f83a8acdf2f5f021a04530649b18915e4 | [
"MIT"
] | null | null | null | py_scripts/models.py | flimao/case-previsao-faturamento | 333afe0f83a8acdf2f5f021a04530649b18915e4 | [
"MIT"
] | 1 | 2021-12-01T13:38:35.000Z | 2021-12-01T13:38:35.000Z | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
import os
from typing import List, Tuple
import pandas as pd
import numpy as np
import datetime as dt
import py_scripts.transform
import pickle
MODELSDIR = r'../models'
DATASET = r'../data/sim_ts_limpo.csv'
class modelo_produtos:
""" encapsulador para os modelos de c... | 33.355932 | 121 | 0.580962 | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
import os
from typing import List, Tuple
import pandas as pd
import numpy as np
import datetime as dt
import py_scripts.transform
import pickle
MODELSDIR = r'../models'
DATASET = r'../data/sim_ts_limpo.csv'
class modelo_produtos:
""" encapsulador para os modelos de c... | 5,356 | 0 | 232 |
ac337f50c6a96986a6077d5f9ed4642ee56f21df | 5,258 | py | Python | grape/cli.py | eSentire/grape | 7be7dd91fd8775dd7b57e52b5deed451e69d28a8 | [
"MIT"
] | 3 | 2020-09-16T19:48:49.000Z | 2021-01-08T17:33:16.000Z | grape/cli.py | eSentire/grape | 7be7dd91fd8775dd7b57e52b5deed451e69d28a8 | [
"MIT"
] | 16 | 2020-09-13T20:21:03.000Z | 2021-08-10T15:07:46.000Z | grape/cli.py | eSentire/grape | 7be7dd91fd8775dd7b57e52b5deed451e69d28a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
CLI interface for the grape system.
This allows the user to only deal with a single interface.
'''
import os
import sys
from grape import __version__
from grape import create, delete, save, load, ximport, xexport, status, tree
PROGRAM = os.path.splitext(os.path.basename(sys.argv[0]))[0]
... | 30.218391 | 76 | 0.562381 | #!/usr/bin/env python3
'''
CLI interface for the grape system.
This allows the user to only deal with a single interface.
'''
import os
import sys
from grape import __version__
from grape import create, delete, save, load, ximport, xexport, status, tree
PROGRAM = os.path.splitext(os.path.basename(sys.argv[0]))[0]
... | 0 | 0 | 0 |
b8da6fddef5729d5afbb42a199005af31fad3a76 | 268 | py | Python | project-euler/25.py | hydroo/coding-and-math-exercises | c0c9b8ae48e043b0809e4c592444f3e4bc3222d8 | [
"CC0-1.0"
] | 2 | 2015-05-29T21:03:26.000Z | 2019-11-11T02:10:53.000Z | project-euler/25.py | hydroo/coding-and-math-exercises | c0c9b8ae48e043b0809e4c592444f3e4bc3222d8 | [
"CC0-1.0"
] | null | null | null | project-euler/25.py | hydroo/coding-and-math-exercises | c0c9b8ae48e043b0809e4c592444f3e4bc3222d8 | [
"CC0-1.0"
] | null | null | null | #! /usr/bin/python
import sys
print "fib_loop: ", fib_loop()
| 10.307692 | 30 | 0.578358 | #! /usr/bin/python
def fib_loop() :
pre = 1
prepre = 0
tmp = 0
i = 0
while len(str(tmp)) < 1000 :
tmp = prepre
prepre = pre
pre = tmp+pre
#print i, tmp
i = i + 1
print i
print tmp
print len(str(tmp))
import sys
print "fib_loop: ", fib_loop()
| 181 | 0 | 23 |
0f0606725f37d7fff832e08f2a2a61ffa1c00f39 | 2,384 | py | Python | src/cool/cmp/utils.py | C0NKER/cool-compiler-2020 | 1da79216bb3e67effd79215979d0ca8909b41c38 | [
"MIT"
] | 3 | 2019-10-07T15:37:08.000Z | 2019-12-03T19:56:24.000Z | src/cool/cmp/utils.py | C0NKER/cool-compiler-base | 42700586e35808061789b35ef3e048ca79c36e7f | [
"MIT"
] | null | null | null | src/cool/cmp/utils.py | C0NKER/cool-compiler-base | 42700586e35808061789b35ef3e048ca79c36e7f | [
"MIT"
] | null | null | null |
class Token:
"""
Basic token class.
Parameters
----------
lex : str
Token's lexeme.
token_type : Enum
Token's type.
"""
@property
| 26.786517 | 125 | 0.575084 | class ContainerSet:
def __init__(self, *values, contains_epsilon=False):
self.set = set(values)
self.contains_epsilon = contains_epsilon
def add(self, value):
n = len(self.set)
self.set.add(value)
return n != len(self.set)
def extend(self, values):
... | 1,613 | -2 | 574 |
c9dcf3ef33e1cc5e9711e2937dd38e0307c056ee | 381 | py | Python | Modelling/Classification/Gradient Boosting.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | Modelling/Classification/Gradient Boosting.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | Modelling/Classification/Gradient Boosting.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import GridSearchCV
parameters = {'n_estimators':[2, 5, 10, 50, 100],
'max_depth':[3, 4, 5],
'learning_rate':[0.001, 0.01, 0.1]}
model = GradientBoostingClassifier()
clfs = GridSearchCV(model, parameters... | 34.636364 | 55 | 0.703412 | from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import GridSearchCV
parameters = {'n_estimators':[2, 5, 10, 50, 100],
'max_depth':[3, 4, 5],
'learning_rate':[0.001, 0.01, 0.1]}
model = GradientBoostingClassifier()
clfs = GridSearchCV(model, parameters... | 0 | 0 | 0 |
aee4968071d84a1f0328dbbf0ac116728a5e6965 | 1,638 | py | Python | lib/services.py | clfs/cryptopals-new | 67f49d37778083ade3488d3c838bbcddacd8540a | [
"MIT"
] | null | null | null | lib/services.py | clfs/cryptopals-new | 67f49d37778083ade3488d3c838bbcddacd8540a | [
"MIT"
] | null | null | null | lib/services.py | clfs/cryptopals-new | 67f49d37778083ade3488d3c838bbcddacd8540a | [
"MIT"
] | null | null | null | """Various compromisable services.
Attackers are PERMITTED to:
- call any service method not prefixed by an underscore
Attackers are PROHIBITED from:
- instantiating additional services beyond the one(s) provided
- manually getting/setting service attributes, regardless of underscores
"""
from Cryptodome.Cipher impor... | 34.851064 | 106 | 0.686813 | """Various compromisable services.
Attackers are PERMITTED to:
- call any service method not prefixed by an underscore
Attackers are PROHIBITED from:
- instantiating additional services beyond the one(s) provided
- manually getting/setting service attributes, regardless of underscores
"""
from Cryptodome.Cipher impor... | 1,015 | 4 | 206 |
9e6b7af4b54a9342a0d4b44307d0d161b33b145d | 2,808 | py | Python | contrib/share_driver_hooks/zaqarclientwrapper.py | gouthampacha/manila | 4b7ba9b99d272663f519b495668715fbf979ffbc | [
"Apache-2.0"
] | 159 | 2015-01-02T09:35:15.000Z | 2022-01-04T11:51:34.000Z | contrib/share_driver_hooks/zaqarclientwrapper.py | gouthampacha/manila | 4b7ba9b99d272663f519b495668715fbf979ffbc | [
"Apache-2.0"
] | 6 | 2021-02-11T16:09:43.000Z | 2022-03-15T09:56:25.000Z | contrib/share_driver_hooks/zaqarclientwrapper.py | gouthampacha/manila | 4b7ba9b99d272663f519b495668715fbf979ffbc | [
"Apache-2.0"
] | 128 | 2015-01-05T22:52:28.000Z | 2021-12-29T14:00:58.000Z | # Copyright (c) 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 32.275862 | 79 | 0.616809 | # Copyright (c) 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 0 | 0 | 0 |
1322c1e547ca0fed21d3b213818137d7b4577146 | 213 | py | Python | starttls_policy_cli/constants.py | iammyr/starttls-policy-cli | 687dbbf99b683eebceb524fb93286d5ebfe57204 | [
"Apache-2.0"
] | 10 | 2018-10-30T10:29:55.000Z | 2022-02-16T22:42:26.000Z | starttls_policy_cli/constants.py | iammyr/starttls-policy-cli | 687dbbf99b683eebceb524fb93286d5ebfe57204 | [
"Apache-2.0"
] | 20 | 2018-10-24T00:29:30.000Z | 2020-04-07T13:41:25.000Z | starttls_policy_cli/constants.py | iammyr/starttls-policy-cli | 687dbbf99b683eebceb524fb93286d5ebfe57204 | [
"Apache-2.0"
] | 7 | 2018-10-24T19:05:48.000Z | 2022-02-16T22:42:27.000Z | """ Constants. """
import os
POLICY_REMOTE_URL = "https://dl.eff.org/starttls-everywhere/policy.json"
POLICY_FILENAME = "policy.json"
POLICY_LOCAL_FILE = os.path.join(os.path.dirname(__file__), POLICY_FILENAME)
| 26.625 | 76 | 0.765258 | """ Constants. """
import os
POLICY_REMOTE_URL = "https://dl.eff.org/starttls-everywhere/policy.json"
POLICY_FILENAME = "policy.json"
POLICY_LOCAL_FILE = os.path.join(os.path.dirname(__file__), POLICY_FILENAME)
| 0 | 0 | 0 |
0be5c1376297c3a5ac92764fdd6c54f45f868f6e | 1,415 | py | Python | maintenance/writePyCaches.py | GlenWalker/pymel | 8b69b72e1bb726a66792707af39626a987bf5c21 | [
"BSD-3-Clause"
] | null | null | null | maintenance/writePyCaches.py | GlenWalker/pymel | 8b69b72e1bb726a66792707af39626a987bf5c21 | [
"BSD-3-Clause"
] | null | null | null | maintenance/writePyCaches.py | GlenWalker/pymel | 8b69b72e1bb726a66792707af39626a987bf5c21 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env mayapy
import pymel.internal.apicache as apicache
import pymel.internal.cmdcache as cmdcache
print apicache
import pymel.internal.startup
print pymel.internal.startup
logger = pymel.internal.startup._logger
cacheClasses = (
# apicache.ApiMelBridgeCache,
apicache.ApiCache,
cmdcache.CmdExamplesCa... | 23.583333 | 58 | 0.669258 | #!/usr/bin/env mayapy
import pymel.internal.apicache as apicache
import pymel.internal.cmdcache as cmdcache
print apicache
import pymel.internal.startup
print pymel.internal.startup
logger = pymel.internal.startup._logger
cacheClasses = (
# apicache.ApiMelBridgeCache,
apicache.ApiCache,
cmdcache.CmdExamplesCa... | 124 | 0 | 26 |
2985c93b418d352824fea4d4f8829a7800cca664 | 20,756 | py | Python | mi/dataset/parser/zplsc_b.py | ronkyo/mi-dataset | 5ee2d3a5b66c17500e5f7f1b3e4ba7a996a34c45 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/parser/zplsc_b.py | ronkyo/mi-dataset | 5ee2d3a5b66c17500e5f7f1b3e4ba7a996a34c45 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/parser/zplsc_b.py | ronkyo/mi-dataset | 5ee2d3a5b66c17500e5f7f1b3e4ba7a996a34c45 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
@package mi.dataset.parser.zplsc_b
@file marine-integrations/mi/dataset/parser/zplsc_b.py
@author Ronald Ronquillo & Richard Han
@brief Parser for the zplsc_b dataset driver
This file contains code for the zplsc_b parser to produce data particles and echogram plots.
The Simrad EK60 scientif... | 50.378641 | 119 | 0.621073 | #!/usr/bin/env python
"""
@package mi.dataset.parser.zplsc_b
@file marine-integrations/mi/dataset/parser/zplsc_b.py
@author Ronald Ronquillo & Richard Han
@brief Parser for the zplsc_b dataset driver
This file contains code for the zplsc_b parser to produce data particles and echogram plots.
The Simrad EK60 scientif... | 527 | 0 | 53 |
ede952355076ea42cf3afc378b5ddaa6b9eecff5 | 1,010 | py | Python | graphql/validation/rules/single_field_subscriptions.py | dfee/graphql-core-next | 1ada7146bd0510171ae931b68f6c77dbdf5d5c63 | [
"MIT"
] | null | null | null | graphql/validation/rules/single_field_subscriptions.py | dfee/graphql-core-next | 1ada7146bd0510171ae931b68f6c77dbdf5d5c63 | [
"MIT"
] | null | null | null | graphql/validation/rules/single_field_subscriptions.py | dfee/graphql-core-next | 1ada7146bd0510171ae931b68f6c77dbdf5d5c63 | [
"MIT"
] | null | null | null | from typing import Optional
from ...error import GraphQLError
from ...language import OperationDefinitionNode, OperationType
from . import ASTValidationRule
__all__ = ['SingleFieldSubscriptionsRule', 'single_field_only_message']
class SingleFieldSubscriptionsRule(ASTValidationRule):
"""Subscriptions must only ... | 36.071429 | 78 | 0.70495 | from typing import Optional
from ...error import GraphQLError
from ...language import OperationDefinitionNode, OperationType
from . import ASTValidationRule
__all__ = ['SingleFieldSubscriptionsRule', 'single_field_only_message']
def single_field_only_message(name: Optional[str]) -> str:
return ((f"Subscription ... | 542 | 0 | 50 |
b17cf6fa23c2a01cf0d0ca4ba9fdccd8b4757c6d | 529 | py | Python | autoprep/data_manager.py | haginot/auto-prep | b1de3eceba5b82432e7042e7e62270df467ed828 | [
"Apache-2.0"
] | null | null | null | autoprep/data_manager.py | haginot/auto-prep | b1de3eceba5b82432e7042e7e62270df467ed828 | [
"Apache-2.0"
] | 4 | 2019-01-15T01:55:46.000Z | 2019-02-21T04:15:25.000Z | autoprep/data_manager.py | haginot/auto-prep | b1de3eceba5b82432e7042e7e62270df467ed828 | [
"Apache-2.0"
] | null | null | null | from typing import List
from autoprep.relation import Relation
from autoprep.storage.base.train_storage_mixin import TrainStorageMixin
from autoprep.table import Table
| 29.388889 | 130 | 0.73913 | from typing import List
from autoprep.relation import Relation
from autoprep.storage.base.train_storage_mixin import TrainStorageMixin
from autoprep.table import Table
class DataManager:
def __init__(self, storage: TrainStorageMixin):
self.__storage = storage
self.__tables = {name: Table(title=n... | 313 | -3 | 49 |
16a77f824fdabf306a1ca528a7627f5f4edf133d | 8,980 | py | Python | ppr-api/tests/integration/utilities/sample_data_utility.py | gh2os/ppr | 9f67321baa5bbb450ac5e06755e2838497a2cf96 | [
"Apache-2.0"
] | null | null | null | ppr-api/tests/integration/utilities/sample_data_utility.py | gh2os/ppr | 9f67321baa5bbb450ac5e06755e2838497a2cf96 | [
"Apache-2.0"
] | 2 | 2020-03-18T23:26:53.000Z | 2020-03-18T23:40:19.000Z | ppr-api/tests/integration/utilities/sample_data_utility.py | gh2os/ppr | 9f67321baa5bbb450ac5e06755e2838497a2cf96 | [
"Apache-2.0"
] | null | null | null | import datetime
import time
import datedelta
import sqlalchemy.orm
import models.collateral
import models.database
import models.financing_statement
import models.party
import models.payment
import models.search
import schemas.financing_statement
import schemas.payment
| 43.381643 | 120 | 0.67951 | import datetime
import time
import datedelta
import sqlalchemy.orm
import models.collateral
import models.database
import models.financing_statement
import models.party
import models.payment
import models.search
import schemas.financing_statement
import schemas.payment
def create_test_financing_statement(**kwargs):... | 8,516 | 0 | 184 |
6d6061f30e6a05a84716b2e577b96831738bcf24 | 791 | py | Python | rotting-oranges/rotting-oranges.py | QQuinn03/LeetHub | 51ce21d721f0f524a07ed24266fb5fca473fcaa5 | [
"MIT"
] | null | null | null | rotting-oranges/rotting-oranges.py | QQuinn03/LeetHub | 51ce21d721f0f524a07ed24266fb5fca473fcaa5 | [
"MIT"
] | null | null | null | rotting-oranges/rotting-oranges.py | QQuinn03/LeetHub | 51ce21d721f0f524a07ed24266fb5fca473fcaa5 | [
"MIT"
] | null | null | null | from collections import deque | 30.423077 | 59 | 0.399494 | from collections import deque
class Solution:
def orangesRotting(self, grid: List[List[int]]) -> int:
row=len(grid)
col=len(grid[0])
que=deque([])
time=0
for i in range(row):
for j in range(col):
if grid[i][j]==2:
que.a... | 712 | -6 | 56 |
a2ac28caeb960d8d95efc53f5cfde70d3c8d36a2 | 2,997 | py | Python | optipyzer/db/models.py | nleroy917/optipyzer | 2a499e2759841fa01b0dc078bf7b17cc4335c566 | [
"Apache-2.0"
] | 3 | 2022-02-19T03:15:15.000Z | 2022-03-20T03:41:39.000Z | optipyzer/db/models.py | nleroy917/optipyzer | 2a499e2759841fa01b0dc078bf7b17cc4335c566 | [
"Apache-2.0"
] | 13 | 2021-12-09T06:56:27.000Z | 2022-03-31T03:28:30.000Z | optipyzer/db/models.py | nleroy917/optipyzer | 2a499e2759841fa01b0dc078bf7b17cc4335c566 | [
"Apache-2.0"
] | 1 | 2022-02-28T05:52:38.000Z | 2022-02-28T05:52:38.000Z | from decimal import Inexact
from sqlalchemy import Column, Float
from .database import Base
from sqlalchemy import Column, Integer, String, Float
# this is a truncated version of the above table
# to improve browser performance
| 26.522124 | 53 | 0.655656 | from decimal import Inexact
from sqlalchemy import Column, Float
from .database import Base
from sqlalchemy import Column, Integer, String, Float
class Organism(Base):
__tablename__ = "organisms"
org_id = Column(Integer, primary_key=True)
division = Column(String)
assembly = Column(String)
taxid ... | 0 | 2,699 | 68 |
43b29988ba50f8dded3a0a6db74a79fe63f7e382 | 466 | py | Python | scripts/collect/store.py | luiscape/hdxscraper-reach-resource-center | 4e478a424c1221f776e54d5a6cf5ee51e36ce512 | [
"MIT"
] | null | null | null | scripts/collect/store.py | luiscape/hdxscraper-reach-resource-center | 4e478a424c1221f776e54d5a6cf5ee51e36ce512 | [
"MIT"
] | null | null | null | scripts/collect/store.py | luiscape/hdxscraper-reach-resource-center | 4e478a424c1221f776e54d5a6cf5ee51e36ce512 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
def StoreRecords(data, path='data.csv', verbose=False):
'''Store records in a CSV file.'''
try:
with open(path, 'wb') as f:
w = csv.writer(f)
w.writerow(data[0].keys())
for record in data:
w.writerow([value.encode('utf-8').strip()... | 23.3 | 98 | 0.600858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
def StoreRecords(data, path='data.csv', verbose=False):
'''Store records in a CSV file.'''
try:
with open(path, 'wb') as f:
w = csv.writer(f)
w.writerow(data[0].keys())
for record in data:
w.writerow([value.encode('utf-8').strip()... | 0 | 0 | 0 |
3d1c154110ed07b0ff2304879fa200e4bfcf9ebe | 254 | py | Python | main.py | alvherrey/request-loop | df0b938ed306fa11c90c860dbcaf2606ef8866f2 | [
"MIT"
] | null | null | null | main.py | alvherrey/request-loop | df0b938ed306fa11c90c860dbcaf2606ef8866f2 | [
"MIT"
] | null | null | null | main.py | alvherrey/request-loop | df0b938ed306fa11c90c860dbcaf2606ef8866f2 | [
"MIT"
] | null | null | null | from request import request
if __name__ == '__main__':
main() | 19.538462 | 48 | 0.543307 | from request import request
def loop():
for i in range(3):
print("Lanzando peticion...")
with open(f"result-{i}.json", "w") as f:
f.write(str(request(i)))
def main():
loop()
if __name__ == '__main__':
main() | 138 | 0 | 50 |
5b698a4ea2b6bf4d5660de4f781b87aa25dff20e | 1,437 | py | Python | AdventOfCode/Day12_tests.py | btrzcinski/AdventOfCode | 46012e81ba8a56cde811ad481ab14b43ce73f09f | [
"MIT"
] | null | null | null | AdventOfCode/Day12_tests.py | btrzcinski/AdventOfCode | 46012e81ba8a56cde811ad481ab14b43ce73f09f | [
"MIT"
] | null | null | null | AdventOfCode/Day12_tests.py | btrzcinski/AdventOfCode | 46012e81ba8a56cde811ad481ab14b43ce73f09f | [
"MIT"
] | null | null | null | import unittest
from Day12 import sum_of_numbers_in_json as sut
if __name__ == '__main__':
unittest.main(verbosity=2)
| 27.634615 | 53 | 0.512874 | import unittest
from Day12 import sum_of_numbers_in_json as sut
class Day12_tests(unittest.TestCase):
def test_case_1(self):
doc1 = """[1,2,3]"""
doc2 = """{"a":2,"b":4}"""
self.assertEqual(6, sut(doc1))
self.assertEqual(6, sut(doc2))
def test_case_2(self):
doc1 = """[... | 1,032 | 16 | 265 |
c83d03acff7fac2c094f85a1200875d25c784ed9 | 2,149 | py | Python | Latest News App.py | chandan9369/Latest-News-App | 2873b71162d118237984d75ca6a96fafc1f53cec | [
"MIT"
] | null | null | null | Latest News App.py | chandan9369/Latest-News-App | 2873b71162d118237984d75ca6a96fafc1f53cec | [
"MIT"
] | null | null | null | Latest News App.py | chandan9369/Latest-News-App | 2873b71162d118237984d75ca6a96fafc1f53cec | [
"MIT"
] | null | null | null | import requests
import json
import time
read("Hello To All ")
time.sleep(2)
# Steps To Find any News API
# #
# 1. go to chrome search for news API
# 2. create new account and get your api key
# 3. then go to source section search your favorite News API
# 4. copy that url
# 5. then enter here
while(True):
read("... | 29.438356 | 95 | 0.646347 | import requests
import json
import time
def read(str):
from win32com.client import Dispatch
speak = Dispatch("SAPI.SpVoice").Speak
speak(str)
read("Hello To All ")
time.sleep(2)
# Steps To Find any News API
# #
# 1. go to chrome search for news API
# 2. create new account and get your api key
# 3. the... | 94 | 0 | 23 |