hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0500677a4c2553954a6216bb86929110bd81544d | 230 | py | Python | core/urls.py | evantbyrne/khanban | 39ed990a706013408cd7ccc82d6045b2319507c4 | [
"0BSD"
] | 1 | 2018-09-03T21:07:43.000Z | 2018-09-03T21:07:43.000Z | core/urls.py | evantbyrne/khanban | 39ed990a706013408cd7ccc82d6045b2319507c4 | [
"0BSD"
] | 43 | 2018-06-27T23:48:00.000Z | 2018-10-28T19:58:09.000Z | core/urls.py | evantbyrne/khanban | 39ed990a706013408cd7ccc82d6045b2319507c4 | [
"0BSD"
] | null | null | null | from django.conf.urls.static import static
from django.urls import include, path
from . import settings
urlpatterns = [
path('', include('frontend.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
| 25.555556 | 67 | 0.76087 | from django.conf.urls.static import static
from django.urls import include, path
from . import settings
urlpatterns = [
path('', include('frontend.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed507ba09d84f4e72003722038d7cfb2ed5aa702 | 22,586 | py | Python | src/foolscap/logging/gatherer.py | jaraco/foolscap | 845bea550447991b194ef884713a7b3be4b4a6c2 | [
"MIT"
] | 29 | 2015-01-05T19:37:27.000Z | 2021-03-03T21:59:13.000Z | src/foolscap/logging/gatherer.py | jaraco/foolscap | 845bea550447991b194ef884713a7b3be4b4a6c2 | [
"MIT"
] | 65 | 2015-03-01T03:18:03.000Z | 2022-03-24T16:00:48.000Z | src/foolscap/logging/gatherer.py | jaraco/foolscap | 845bea550447991b194ef884713a7b3be4b4a6c2 | [
"MIT"
] | 22 | 2015-01-28T10:51:46.000Z | 2022-01-26T07:56:25.000Z | from __future__ import print_function, unicode_literals
signal = None
try:
except ImportError:
pass
LOG_GATHERER_TACFILE = """\
# -*- python -*-
# we record the path when 'flogtool create-gatherer' is run, in case flogtool
# was run out of a source tree. This is somewhat fragile, of course.
stashed_path = [
%(... | 38.542662 | 123 | 0.635969 | from __future__ import print_function, unicode_literals
import six, os, sys, time, bz2
signal = None
try:
import signal
except ImportError:
pass
from zope.interface import implementer
from twisted.internet import reactor, utils, defer
from twisted.python import usage, procutils, filepath, log as tw_log
from twi... | 0 | 13,680 | 0 | 4,360 | 0 | 1,969 | 0 | 279 | 499 |
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"
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... | 0 | 0 | 0 | 0 | 0 | 330 | 0 | 10 | 46 |
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>
... | 144 | 18,074 | 0 | 51,507 | 0 | 8,419 | 0 | 377 | 1,625 |
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... | 0 | 461 | 0 | 35,313 | 0 | 2,429 | 0 | 394 | 602 |
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 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 sklearn.en... | 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... | 0 | 0 | 0 | 0 | 0 | 1,109 | 0 | 7 | 45 |
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 |
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... | 0 | 0 | 0 | 0 | 589 | 920 | 0 | -15 | 182 |
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
| 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 | 0 | 0 | 715 | 0 | 0 | 0 | 19 | 46 |
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
# ----------------- ... | 0 | 0 | 0 | 0 | 0 | 9,097 | 0 | 17 | 177 |
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
| 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... | 0 | 0 | 0 | 8,186 | 0 | 0 | 0 | 84 | 91 |
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
# Defining constants
SQL_SEED = '../../../../../SLKlib/SQLiteDBApi/network-db-seed.sql'
DATA_FILE = 'files/miRDeathDB_all_data.txt... | 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... | 0 | 0 | 0 | 0 | 0 | 2,625 | 0 | 32 | 68 |
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
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, AbstractToAbstract
if torch.cuda.is_avai... | 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... | 0 | 0 | 0 | 0 | 0 | 606 | 0 | 3 | 46 |
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 | from staircase.core.arrays import docstrings
from staircase.core.stats.statistic import corr as _corr
from staircase.core.stats.statistic import cov as _cov
corr = _make_corr_cov_func(docstrings.corr_docstring, _corr, assume_ones_diagonal=True)
cov = _make_corr_cov_func(docstrings.cov_docstring, _cov, assume_ones_... | 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... | 0 | 3,437 | 0 | 0 | 0 | 94 | 0 | 54 | 180 |
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 |
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)
... | 0 | 0 | 0 | 0 | 0 | 940 | 0 | -25 | 111 |
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 |
R_MESSAGE_LINK = r"https://discordapp.com/channels/(\d+)/(\d+)/(\d+)"
R_ATTATCH_LINK = r"https://cdn.discordapp.com/attachments/\d+/\d+/.+"
| 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... | 0 | 6,114 | 363 | 423 | 0 | 0 | 0 | 9 | 222 |
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
if __name__ == "__main__":
unittest.main()
| 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... | 0 | 0 | 0 | 1,817 | 0 | 0 | 0 | 74 | 158 |
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, Hchenberger R, Sogo H, Kastman E, Lindelv ... | 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... | 31 | 0 | 0 | 0 | 0 | 0 | 0 | 238 | 190 |
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 -*-
| 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 ... | 0 | 0 | 0 | 0 | 0 | 2,022 | 0 | 29 | 91 |
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
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... | 0 | 0 | 0 | 1,414 | 0 | 0 | 0 | 14 | 46 |
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 |
from aws_lambda_powertools.logging.logger import Logger
logger: Logger = Logger(service='my_service') # JSON output format, service name can be set by environment variable "POWERTOOLS_SERVICE_NAME"
| 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... | 0 | 0 | 0 | 0 | 0 | 288 | 0 | 46 | 111 |
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
import winreg
#Excel
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders')
mydesktop = winreg.QueryValueEx(key,"Desktop")[0]
mydesktop = mydesktop.replace('\\', '\\\\')
#MTM
mtm = ... | 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... | 315 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 22 |
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 | 0 | 0 | 0 | 0 | 33 | 46 |
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).
| 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', '... | 0 | 955 | 0 | 4,350 | 0 | 0 | 0 | 27 | 114 |
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) ... | 4 | 10,627 | 0 | 10,363 | 0 | 0 | 0 | 73 | 158 |
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 pandas as pd
from keras.models import Sequential
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[:, 1:785]
train_labels = train_dataset.iloc[:, 0]
test_images = test... | 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 | 0 | 0 | 0 | 0 | -19 | 88 |
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 sys
sys.path.append(".\vision")
#
w = 9
h = 7
if __name__ == '__main__':
a_temp = Calibrate()
image_path = '.\\data\\*.jpg'
a_temp.read_sample(image_path)
a_temp.calibrate()
# filename = '.\\Config\\calibrate_config.txt'
# a_temp.save_parameter(filename)
# fi... | 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... | 555 | 0 | 0 | 2,994 | 0 | 0 | 0 | -14 | 67 |
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 math import nan
import pandas as pd
raw_df = pd.DataFrame(
# NOTE: Sample is taken and adapted from BRCA data set
[
{
"sets": [
{
"status": "ACTIVE",
"setType": "expression",
"id": "1578b108-719e-4962-85f4-488... | 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": "... | 0 | 1,358 | 0 | 0 | 0 | 373 | 0 | 42 | 135 |
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 numpy as np
import torch
import torch.nn as nn
import torch.nn.init as init
torch.manual_seed(seed_num)
... | 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... | 0 | 1,504 | 0 | 6,409 | 0 | 0 | 0 | -20 | 156 |
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 |
__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)
| 0 | 0 | 0 | 0 | 0 | 138 | 0 | 66 | 67 |
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 | 0 | 0 | 0 | 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
username = None
password = None
adminUrl = None
applicationPath = None
planPath = None
targetServers = None
# All the application will be undeployed. This is necessary
try:
init()
conn()
stop_and_undeploy_all_applications()
deploy_b... | 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... | 0 | 0 | 0 | 0 | 0 | 2,105 | 0 | 6 | 197 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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... | 0 | 0 | 0 | 203 | 0 | 0 | 0 | 0 | 22 |
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 |
# fast roc_auc computation: https://www.kaggle.com/c/microsoft-malware-prediction/discussion/76013
# 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[... | 0 | 281 | 0 | 0 | 0 | 5,790 | 0 | 0 | 112 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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 pickle
import os
from filter_corrected_alleles import parse_perfect_sam, parse_fasta
if __name__ == "__main__":
args = parse_args()
fn_sam_H1 = args.fn_sam_H1
fn_sam_H2 = args.fn_sam_H2
fn_asm_H1 = args.fn_asm_H1
fn_asm_H2 = args.fn_asm_H2
fn_pickle_H1 = args.fn_pickle_H1
fn_... | 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... | 0 | 0 | 0 | 0 | 0 | 11,120 | 0 | 22 | 294 |
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
""" | 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... | 0 | 0 | 0 | 0 | 0 | 526 | 0 | -3 | 69 |
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 | 0 | 0 | 0 | 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
# ... | 0 | 0 | 0 | 0 | 0 | 164 | 0 | -2 | 91 |
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 .const import (DEVICE_CLASS_CO2, SERV_CARBON_DIOXIDE_SENSOR, CHAR_CARBON_DIOXIDE_DETECTED, DEVICE_CLASS_GAS, SERV_CARBON_MONOXIDE_SENSOR, CHAR_CARBON_MONOXIDE_DETECTED, DEVICE_CLASS_MOISTURE, SERV_LEAK_SENSOR, CHAR_LEAK_DETECTED, DEVICE_CLASS_MOTION, SERV_... | 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... | 6 | 5,719 | 0 | 0 | 0 | 0 | 0 | 582 | 228 |
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 | 0 | 0 | 0 | 0 | 0 | 0 |
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 | import logging
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 can be directly modified by the end us... | 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 ... | 0 | 0 | 0 | 8,468 | 0 | 0 | 0 | -6 | 205 |
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
# Packages
def test_interface_class():
"""Test whether the InterfaceClass works for docstring inheritance."""
test_object = Derived()
assert test_object.value is None
assert test_object.method.__doc__ == 'Do nothing.'
test_object.method()
... | 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... | 0 | 183 | 0 | 534 | 0 | 0 | 0 | 35 | 138 |
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
| 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 | 0 | 0 | 370 | 0 | 0 | 0 | 19 | 46 |
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
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()
window = curses.newwin(HEIG... | 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,
... | 0 | 302 | 0 | 2,625 | 0 | 0 | 0 | 5 | 91 |
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 json
import random
from collections import defaultdict
# 22179163 taobaoscale
random.seed(1230)
name = 'book'
filter_size = 80 # item
filter_len = 0 # item history
#
def read_from_amazon(source):
"""
:param source: ../data/book_data/merged_book_data.json
UserID ItemID CateID... | 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.... | 879 | 0 | 0 | 0 | 0 | 7,096 | 0 | -44 | 307 |
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 | 0 | 0 | 0 | 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 Optional, Sequence, Tuple, Union
from importlib import util
from skimage.segmentation import slic, felzenszwalb
from ..helpers.model_interface import ModelInterface
if util.find_spec("torch"):
... | 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_... | 0 | 0 | 0 | 0 | 0 | 114 | 0 | 16 | 23 |
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 | import sys
sys.path.append('D:/Dropbox/py_projects/vimba-api/src/')
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 ... | 0 | 0 | 0 | 0 | 0 | 1,316 | 0 | 12 | 89 |
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 | 0 | 0 | 0 | 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 logging
import logging.config
import torch.nn as nn
logger = logging.getLogger(__name__)
# NOTE: namedtuple does not allow multiple inheritance.. luckily Serializable
# is only an interface...
# class RunState(NamedTuple, Serializable):
if __name__ == '__main__':
logging.conf... | 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... | 0 | 678 | 0 | 2,056 | 0 | 15,714 | 0 | 449 | 667 |
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 phanas.nas
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... | 0 | 0 | 0 | 8,926 | 0 | 0 | 0 | -29 | 223 |
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 |
# Create your views here.
# def ProductDetail(request):
# return render(request, 'product-detail.html')
| 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... | 0 | 0 | 0 | 2,464 | 0 | 0 | 0 | 221 | 222 |
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 | 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 | 0 | 0 | 0 | 0 | -8 | 22 |
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.
# Load internal modules.
#########
# 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... | 14 | 378 | 0 | 25,276 | 0 | 0 | 0 | -5 | 821 |
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 ... | 0 | 0 | 0 | 918 | 0 | 0 | 0 | 0 | 22 |
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 argparse
from gnomad.utils import slack
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--overwrite', help='Overwrite everything', action='store_true')
parser.add_argument('--run_basic_load', help='Overwri... | 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... | 0 | 0 | 0 | 0 | 0 | 11,015 | 0 | 17 | 363 |
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 |
from reg.data import DataLoader
data = DataLoader("../data/training_set",
one_hot_encoding=True,
palette=[255])
if __name__ == "__main__":
show_pred("") | 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... | 0 | 0 | 0 | 0 | 0 | 1,267 | 0 | -4 | 269 |
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 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(
version='201... | 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(
... | 0 | 0 | 0 | 0 | 0 | 392 | 0 | -10 | 68 |
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, url
try:
urlpatterns = patterns('',
url(r'^robots\.txt$', TextPlainView.as_view(template_name='robots.txt')),
)
except:
urlpatterns = patterns('django.views.generic.simple',
(r'^robots\.txt$', 'direct_to_template', {'template': 'robots.txt'}),... | 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 | 0 | 0 | 0 | 0 | 38 | 26 |
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... | 6 | 0 | 0 | 0 | 0 | 11,461 | 0 | -109 | 543 |
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 |
framwork = "torch"
| 10 | 24 | 0.728571 |
from .train import Train
from .test import Test
framwork = "torch"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 45 |
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 ... | 0 | 0 | 0 | 1,786 | 0 | 1,827 | 0 | 0 | 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) (so) de maior(es)'.format(maiores))
print('{} pes... | 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('{} ... | 10 | 0 | 0 | 0 | 0 | 0 | 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
from traiter.const import COMMA
from traiter.patterns.matcher_patterns import MatcherPatterns
from myrsidea.pylib.const import COMMON_PATTERNS, CONJ, MISSING
JOINER = CONJ + COMMA
MISSING_RE = '|'.join([fr'\b{m}\b' for m in MISSING])
MISSING_RE = re.compile(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 | 685 | 0 | 0 | 0 | 0 | 0 | 0 | 69 |
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 | 0 | 0 | 0 | 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 -*-
MODELSDIR = r'../models'
DATASET = r'../data/sim_ts_limpo.csv' | 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... | 38 | 0 | 0 | 5,608 | 0 | 0 | 0 | -10 | 178 |
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 | 0 | 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()
| 0 | 0 | 0 | 0 | 0 | 181 | 0 | 0 | 23 |
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 | 0 | 0 | 0 | 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
"""
import lib.ciphers as ciphe... | 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... | 0 | 0 | 0 | 1,179 | 0 | 0 | 0 | 12 | 68 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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... | 0 | 0 | 0 | 0 | 0 | 124 | 0 | 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... | 0 | 426 | 0 | 14,700 | 0 | 0 | 0 | 379 | 403 |
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 |
__all__ = ['SingleFieldSubscriptionsRule', 'single_field_only_message']
| 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 ... | 0 | 0 | 0 | 561 | 0 | 170 | 0 | 69 | 135 |
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 models.collateral
import models.database
import models.financing_statement
import models.party
import models.payment
import schemas.financing_statement
| 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):... | 0 | 0 | 0 | 0 | 0 | 8,516 | 0 | -21 | 317 |
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 sqlalchemy import Column, 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 | 0 | 0 | 2,699 | 0 | 0 | 0 | 43 | 135 |
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 | 0 | 0 | 0 | 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 |
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() | 0 | 0 | 0 | 0 | 0 | 138 | 0 | 6 | 72 |
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
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 = """[... | 0 | 0 | 0 | 1,290 | 0 | 0 | 0 | 26 | 46 |
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... | 0 | 0 | 0 | 0 | 0 | 94 | 0 | 0 | 23 |
588f9c4616a8701d1460beff010278c4c26a6a2e | 241 | py | Python | eve_travel_helper/__init__.py | Srogozins/eve-travel-helper | a0d2013ecff84abcb257ad54fd2496124eef866a | [
"BSD-3-Clause"
] | null | null | null | eve_travel_helper/__init__.py | Srogozins/eve-travel-helper | a0d2013ecff84abcb257ad54fd2496124eef866a | [
"BSD-3-Clause"
] | 12 | 2015-03-09T17:48:47.000Z | 2015-06-02T15:16:25.000Z | eve_travel_helper/__init__.py | Srogozins/eve-travel-helper | a0d2013ecff84abcb257ad54fd2496124eef866a | [
"BSD-3-Clause"
] | null | null | null | """ eve_travel_helper -- EVE Online travel planning helper tool package
This tool is intended to provide assistance to EVE Online players with
planning travel routes.
Modules:
* routing
* server
Sub-packages:
* dbclient
"""
| 16.066667 | 71 | 0.726141 | """ eve_travel_helper -- EVE Online travel planning helper tool package
This tool is intended to provide assistance to EVE Online players with
planning travel routes.
Modules:
* routing
* server
Sub-packages:
* dbclient
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ce1ee071621f61bb7527b607cc7c202068b0b7b | 940 | py | Python | math/probability.py | Rin-The-QT-Bunny/Kabalium | ebb2ce611b715c7f9e212426e2d914418445d3b6 | [
"CC0-1.0"
] | null | null | null | math/probability.py | Rin-The-QT-Bunny/Kabalium | ebb2ce611b715c7f9e212426e2d914418445d3b6 | [
"CC0-1.0"
] | null | null | null | math/probability.py | Rin-The-QT-Bunny/Kabalium | ebb2ce611b715c7f9e212426e2d914418445d3b6 | [
"CC0-1.0"
] | null | null | null | """
Distributions and Probability Tools
"""
import numpy as np
#plt.style.use('seaborn')
#
num1, mu1, var1 = 400, [0.5, 0.5], [1, 3]
X1 = np.random.multivariate_normal(mu1, np.diag(var1), num1)
#
num2, mu2, var2 = 600, [5.5, 2.5], [2, 2]
X2 = np.random.multivariate_normal(mu2, np.diag(var2), num2)
#
... | 29.375 | 70 | 0.66383 | """
Distributions and Probability Tools
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from scipy.stats import multivariate_normal
#plt.style.use('seaborn')
def C(n,m):
# Cnm means the combinational number of n boxes with m balls
return mat... | 69 | 0 | 0 | 0 | 0 | 281 | 0 | 39 | 142 |
456177cc19c195f1558e04dd4f40c6b9406dfaba | 1,268 | py | Python | tests/test_wrapbuffer.py | slmnv5/pepelats | 044efa45be4c15289de9e300d681c2008af69962 | [
"MIT"
] | 1 | 2022-01-06T02:51:25.000Z | 2022-01-06T02:51:25.000Z | tests/test_wrapbuffer.py | slmnv5/pepelats | 044efa45be4c15289de9e300d681c2008af69962 | [
"MIT"
] | null | null | null | tests/test_wrapbuffer.py | slmnv5/pepelats | 044efa45be4c15289de9e300d681c2008af69962 | [
"MIT"
] | 1 | 2021-12-01T20:52:21.000Z | 2021-12-01T20:52:21.000Z | import unittest
from utils import make_sin_sound, SD_RATE
sound_len = 500_000 # samples
sound = make_sin_sound(440, sound_len / SD_RATE)
if __name__ == "__main__":
unittest.main()
| 27.565217 | 60 | 0.657729 | import unittest
from loop import WrapBuffer
from utils import make_sin_sound, SD_RATE
sound_len = 500_000 # samples
sound = make_sin_sound(440, sound_len / SD_RATE)
class TestWrapBuffer(unittest.TestCase):
def test_1(self):
test_buff = WrapBuffer()
test_buff.record_samples(sound[:100_000], 0)
... | 0 | 0 | 0 | 1,027 | 0 | 0 | 0 | 6 | 46 |
66af38c441b2bb64e4989e31c860ba86ebd137fd | 7,268 | py | Python | tests/test_functions.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 18 | 2020-11-13T11:54:23.000Z | 2022-03-23T15:25:10.000Z | tests/test_functions.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 9 | 2020-11-17T07:54:58.000Z | 2022-02-09T23:29:52.000Z | tests/test_functions.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 7 | 2021-05-06T22:00:39.000Z | 2022-01-31T06:25:01.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python Team Awareness Kit (PyTAK) Module Tests."""
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
__copyright__ = 'Copyright 2021 Orion Labs, Inc.'
__license__ = 'Apache License, Version 2.0'
| 33.33945 | 119 | 0.509906 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python Team Awareness Kit (PyTAK) Module Tests."""
import asyncio
import csv
import io
import urllib
import xml.etree.ElementTree
import pytest
import adsbxcot.functions
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
__copyright__ = 'Copyright 2021 Orion Labs, I... | 0 | 3,616 | 0 | 0 | 0 | 3,138 | 0 | -35 | 295 |
3613d965085b8c8d23f5f7e8c431c083ad6d3328 | 1,063 | py | Python | exercises/ex_4_3.py | bcornelusse/ELEC0053-circuits-electriques | ee86a908d4d0b3bc95e41e5eef9031a00604db40 | [
"BSD-2-Clause"
] | 3 | 2018-03-07T10:17:38.000Z | 2021-06-21T06:20:51.000Z | exercises/ex_4_3.py | bcornelusse/ELEC0053-circuits-electriques | ee86a908d4d0b3bc95e41e5eef9031a00604db40 | [
"BSD-2-Clause"
] | null | null | null | exercises/ex_4_3.py | bcornelusse/ELEC0053-circuits-electriques | ee86a908d4d0b3bc95e41e5eef9031a00604db40 | [
"BSD-2-Clause"
] | 1 | 2020-06-04T19:23:11.000Z | 2020-06-04T19:23:11.000Z | # Exercise 4.3
from matplotlib import pyplot as plt
from RSE.impedance import Impedance
Z_1 = Impedance(3, 5)
Z_2 = Impedance(5, -6)
Z_0 = Impedance(2, 3)
Z_12 = Z_1.parallel(Z_2)
Z_tot = Z_0 + Z_12
E = complex(100, 0)
# Compute currents.
I = E/Z_tot.Z
V_12 = Z_0.Z * I
V_23 = Z_12.Z * I
I_Z1 = V_12 / Z_1.Z
I_Z2 ... | 20.056604 | 55 | 0.634055 | # Exercise 4.3
from matplotlib import pyplot as plt
from RSE.impedance import Impedance
def print_complex(n: complex):
return '({c.real:.2f} + {c.imag:.2f}i)'.format(c=n)
Z_1 = Impedance(3, 5)
Z_2 = Impedance(5, -6)
Z_0 = Impedance(2, 3)
Z_12 = Z_1.parallel(Z_2)
Z_tot = Z_0 + Z_12
E = complex(100, 0)
# Comp... | 0 | 0 | 0 | 0 | 0 | 65 | 0 | 0 | 23 |
ef0b1e90a414cd10b99ab947636c1ca2151cab55 | 430 | py | Python | flatlist/__init__.py | dwabece/flatlist | 61b6f7f70bf9db2bf14f8bfdebce2c4f9a95811f | [
"WTFPL"
] | null | null | null | flatlist/__init__.py | dwabece/flatlist | 61b6f7f70bf9db2bf14f8bfdebce2c4f9a95811f | [
"WTFPL"
] | null | null | null | flatlist/__init__.py | dwabece/flatlist | 61b6f7f70bf9db2bf14f8bfdebce2c4f9a95811f | [
"WTFPL"
] | null | null | null | __version__ = '0.0.1'
def flatten_list(input_list):
"""
Flattens list with many nested lists.
>>> flatten_list([1, [2, [3], [4]]])
[1, 2, 3, 4]
"""
result = []
for item in input_list:
if isinstance(item, list):
result.extend(flatten_list(item))
# yield from... | 20.47619 | 45 | 0.532558 | __version__ = '0.0.1'
def flatten_list(input_list):
"""
Flattens list with many nested lists.
>>> flatten_list([1, [2, [3], [4]]])
[1, 2, 3, 4]
"""
result = []
for item in input_list:
if isinstance(item, list):
result.extend(flatten_list(item))
# yield from... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4f71e1c937b43af22eece8ca9d295888877421bd | 24,684 | py | Python | sparse/tune_sparse_dense_mali_test2.py | sunghern/Auto-Compression | 7c1123e5ffb63b0c34bef2db40dbfb560cb25c2e | [
"MIT"
] | 11 | 2019-11-26T04:33:31.000Z | 2022-03-28T11:35:54.000Z | sparse/tune_sparse_dense_mali_test2.py | sunghern/Auto-Compression | 7c1123e5ffb63b0c34bef2db40dbfb560cb25c2e | [
"MIT"
] | 22 | 2019-11-26T06:48:07.000Z | 2021-12-20T12:50:16.000Z | sparse/tune_sparse_dense_mali_test2.py | sunghern/Auto-Compression | 7c1123e5ffb63b0c34bef2db40dbfb560cb25c2e | [
"MIT"
] | 10 | 2019-11-26T04:33:57.000Z | 2021-10-12T04:30:48.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 42.48537 | 494 | 0.641792 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 4,123 | 0 | 0 | 0 | 6,750 | 0 | 37 | 181 |
9ea03ef9a7f91e79eaec7affb8fae971a0ddb50d | 2,523 | py | Python | Scripts/build_identity_profile.py | seatonullberg/PyPPA | 0175b38b2c8944d43f8d7b7f07b04f0bb46f8744 | [
"BSD-2-Clause"
] | 1 | 2017-11-12T23:18:49.000Z | 2017-11-12T23:18:49.000Z | Scripts/build_identity_profile.py | seatonullberg/PyPPA | 0175b38b2c8944d43f8d7b7f07b04f0bb46f8744 | [
"BSD-2-Clause"
] | null | null | null | Scripts/build_identity_profile.py | seatonullberg/PyPPA | 0175b38b2c8944d43f8d7b7f07b04f0bb46f8744 | [
"BSD-2-Clause"
] | null | null | null | import dlib
import pickle
import numpy as np
import os
import argparse
from utils import path_utils
from utils import identity_profile_utils
def main(path=None):
"""
Creates an IdentityProfile
:param path: (str) absolute path to a directory containing training images
- the end of the path... | 37.102941 | 108 | 0.692033 | import dlib
import pickle
import numpy as np
import os
import argparse
from utils import path_utils
from utils import identity_profile_utils
def main(path=None):
"""
Creates an IdentityProfile
:param path: (str) absolute path to a directory containing training images
- the end of the path... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
222000c011a49d429d50cb833a0e75575999b37e | 703 | py | Python | Algorithm/String/Red OR Green.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | Algorithm/String/Red OR Green.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | Algorithm/String/Red OR Green.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | # https://practice.geeksforgeeks.org/problems/red-or-green5711/1/?category[]=Strings&category[]=Strings&page=1&query=category[]Stringspage1category[]Strings#
#User function Template for python3
#{
# Driver Code Starts
#Initial Template for Python 3
if __name__=='__main__':
t=int(input())
for _ in range(t):
... | 25.107143 | 157 | 0.561878 | # https://practice.geeksforgeeks.org/problems/red-or-green5711/1/?category[]=Strings&category[]=Strings&page=1&query=category[]Stringspage1category[]Strings#
#User function Template for python3
class Solution:
def RedOrGreen(self,N,S):
#code here
count = [0] * 2
for c in S:
if ... | 0 | 0 | 0 | 234 | 0 | 0 | 0 | 0 | 23 |
c2b614bd1efd11cc8596ed9f047ce9555bc76d30 | 7,227 | py | Python | src/adaptationengine_plugintester/harness.py | IntelLabsEurope/AdaptationEngineFramework | bbf7a2ca32b84c6208b43ee55c14bc5262fc51b2 | [
"Apache-2.0"
] | 1 | 2016-02-11T16:26:10.000Z | 2016-02-11T16:26:10.000Z | src/adaptationengine_plugintester/harness.py | IntelLabsEurope/AdaptationEngineFramework | bbf7a2ca32b84c6208b43ee55c14bc5262fc51b2 | [
"Apache-2.0"
] | null | null | null | src/adaptationengine_plugintester/harness.py | IntelLabsEurope/AdaptationEngineFramework | bbf7a2ca32b84c6208b43ee55c14bc5262fc51b2 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2015 INTEL RESEARCH AND INNOVATION IRELAND LIMITED
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | 30.1125 | 79 | 0.575896 | """
Copyright 2015 INTEL RESEARCH AND INNOVATION IRELAND LIMITED
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | 0 | 0 | 0 | 0 | 0 | 6,182 | 0 | 10 | 291 |
6ac060184271e5720aac6230094cb4944c0ce7d6 | 4,534 | py | Python | src/socketio/redis_manager.py | rrsal/python-socketio | 826a3e9ae0e22757172433bd6b29ec655689fa75 | [
"MIT"
] | 2,977 | 2015-07-15T08:01:56.000Z | 2022-03-31T15:36:09.000Z | src/socketio/redis_manager.py | rrsal/python-socketio | 826a3e9ae0e22757172433bd6b29ec655689fa75 | [
"MIT"
] | 758 | 2015-07-15T09:37:11.000Z | 2022-03-31T22:49:07.000Z | src/socketio/redis_manager.py | rrsal/python-socketio | 826a3e9ae0e22757172433bd6b29ec655689fa75 | [
"MIT"
] | 584 | 2015-08-08T03:16:29.000Z | 2022-03-30T09:25:30.000Z | import logging
try:
import redis
except ImportError:
redis = None
logger = logging.getLogger('socketio')
| 38.423729 | 78 | 0.568152 | import logging
import pickle
import time
try:
import redis
except ImportError:
redis = None
from .pubsub_manager import PubSubManager
logger = logging.getLogger('socketio')
class RedisManager(PubSubManager): # pragma: no cover
"""Redis based client manager.
This class implements a Redis backend f... | 0 | 0 | 0 | 4,326 | 0 | 0 | 0 | 2 | 90 |
426b744903c0239e03ef4ef537e308bfcd6a9c72 | 2,710 | py | Python | LC_problems/1728.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | LC_problems/1728.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | LC_problems/1728.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : 1728.py
@Contact : huanghoward@foxmail.com
@Modify Time : 2022/5/10 22:30
------------
"""
if __name__ == '__main__':
s = Solution()
print(s.canMouseWin(["####F","#C...","M...."], catJump = 1, mouseJump = 2))
| 35.194805 | 118 | 0.420664 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : 1728.py
@Contact : huanghoward@foxmail.com
@Modify Time : 2022/5/10 22:30
------------
"""
import collections
from typing import List
class Solution:
def canMouseWin(self, grid: List[str], catJump: int, mouseJump: int) -> bool:
... | 0 | 0 | 0 | 2,342 | 0 | 0 | 0 | -1 | 67 |
d3b77120473ef31f2ef79a0e2ea70785736dc587 | 1,257 | py | Python | v3/as_drivers/sched/asynctest.py | Dilepa/micropython-async | 3c8817d9ead33bcd8399d0935ffb24dd7bcd6e71 | [
"MIT"
] | 443 | 2017-01-01T20:54:46.000Z | 2022-03-28T06:17:30.000Z | v3/as_drivers/sched/asynctest.py | Dilepa/micropython-async | 3c8817d9ead33bcd8399d0935ffb24dd7bcd6e71 | [
"MIT"
] | 79 | 2017-01-28T17:53:32.000Z | 2022-02-08T10:05:04.000Z | v3/as_drivers/sched/asynctest.py | Dilepa/micropython-async | 3c8817d9ead33bcd8399d0935ffb24dd7bcd6e71 | [
"MIT"
] | 126 | 2017-02-17T13:06:01.000Z | 2022-03-07T03:50:50.000Z | # asynctest.py Demo of asynchronous code scheduling tasks with cron
# Copyright (c) 2020 Peter Hinch
# Released under the MIT License (MIT) - see LICENSE file
import uasyncio as asyncio
try:
asyncio.run(main())
finally:
_ = asyncio.new_event_loop()
| 33.972973 | 91 | 0.647574 | # asynctest.py Demo of asynchronous code scheduling tasks with cron
# Copyright (c) 2020 Peter Hinch
# Released under the MIT License (MIT) - see LICENSE file
import uasyncio as asyncio
from sched.sched import schedule
from time import localtime
def foo(txt): # Demonstrate callback
yr, mo, md, h, m, s, wd = loc... | 0 | 0 | 689 | 0 | 0 | 179 | 0 | 16 | 113 |
73ab89ce555e209a9b360cac8f9d2d2538e5131d | 1,029 | py | Python | cv_workshops/8-day/6-clazz.py | afterloe/opencv-practice | 83d76132d004ebbc96d99d34a0fd3fc37a044f9f | [
"MIT"
] | 5 | 2020-03-13T07:34:30.000Z | 2021-10-01T03:03:05.000Z | cv_workshops/8-day/6-clazz.py | afterloe/Opencv-practice | 83d76132d004ebbc96d99d34a0fd3fc37a044f9f | [
"MIT"
] | null | null | null | cv_workshops/8-day/6-clazz.py | afterloe/Opencv-practice | 83d76132d004ebbc96d99d34a0fd3fc37a044f9f | [
"MIT"
] | 1 | 2020-03-01T12:35:02.000Z | 2020-03-01T12:35:02.000Z | #!/usr/bin/env python3
# -*- coding=utf-8 -*-
"""
FPS3005
"""
if "__main__" == __name__:
main()
| 21.4375 | 68 | 0.525753 | #!/usr/bin/env python3
# -*- coding=utf-8 -*-
import cv2 as cv
import numpy as np
"""
视频的读写与处理
FPS即每秒多少帧的处理能力,一般情况下(人类对300毫秒以下的变动是无法察觉的)每秒大于5帧的处理可以认为是视屏处理
"""
def process(frame, option):
dst = frame
if 1 == option:
dst = cv.bitwise_not(frame)
if 2 == option:
... | 195 | 0 | 0 | 0 | 0 | 743 | 0 | -8 | 98 |
cc241bf078185f3bf1613b1440e7428e5cee7327 | 4,217 | py | Python | Utils/Exceptions.py | Caius-Lu/Savior | 47c22e06c38cc9b5f7007d79f791015c8b2b76aa | [
"BSD-2-Clause"
] | 108 | 2021-03-19T03:45:48.000Z | 2022-03-29T12:19:38.000Z | Utils/Exceptions.py | Caius-Lu/Savior | 47c22e06c38cc9b5f7007d79f791015c8b2b76aa | [
"BSD-2-Clause"
] | 2 | 2021-05-12T07:26:21.000Z | 2021-07-16T12:53:52.000Z | Utils/Exceptions.py | Caius-Lu/Savior | 47c22e06c38cc9b5f7007d79f791015c8b2b76aa | [
"BSD-2-Clause"
] | 27 | 2021-03-19T05:50:26.000Z | 2021-12-28T07:13:09.000Z | # todo: major codemirror code
| 17.004032 | 73 | 0.686033 | # todo: 后续需要重新规划major code和mirror code,前期先这样写
class CustomException(Exception):
MAJOR_CODE = 0
MIRROR_CODE = 0
def format_exception(self):
return self.MAJOR_CODE * 100 + self.MIRROR_CODE, str(self)
class AlgorithmOperatorException(CustomException):
"""
算子异常基类
"""
MAJOR_CODE = 1
... | 915 | 0 | 0 | 3,044 | 0 | 0 | 0 | 0 | 804 |
fc4d8e9107b1c075331241297982a316e3727ea9 | 16,530 | py | Python | erica_app/erica/pyeric/eric.py | digitalservice4germany/steuerlotse | ef3e094e4d7d4768431a50ac4be60672cd03221d | [
"MIT"
] | 20 | 2021-07-02T07:49:08.000Z | 2022-03-18T22:26:10.000Z | erica_app/erica/pyeric/eric.py | digitalservice4germany/steuerlotse | ef3e094e4d7d4768431a50ac4be60672cd03221d | [
"MIT"
] | 555 | 2021-06-28T15:35:15.000Z | 2022-03-31T11:51:55.000Z | erica_app/erica/pyeric/eric.py | digitalservice4germany/steuerlotse | ef3e094e4d7d4768431a50ac4be60672cd03221d | [
"MIT"
] | 1 | 2021-07-04T20:34:12.000Z | 2021-07-04T20:34:12.000Z | import logging
logger = logging.getLogger('eric')
# As explained in the original ERiC documentation
# As explained in the original ERiC documentation
# TODO: Unify usage of EricWrapper; rethink having eric_wrapper as a parameter
def verify_using_stick():
"""Calls into eric to verify whether we are using a... | 40.024213 | 119 | 0.648336 | import logging
import os
import tempfile
from contextlib import contextmanager
from ctypes import Structure, c_int, c_uint32, c_char_p, c_void_p, pointer, CDLL, RTLD_GLOBAL
from dataclasses import dataclass
from typing import ByteString
from erica.config import get_settings, Settings
from erica.pyeric.eric_errors impo... | 0 | 1,188 | 0 | 14,185 | 0 | 0 | 0 | 194 | 289 |