hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ea472ba98b118db51678256b53b75e13e1db4839 | 5,171 | py | Python | tests/mypy/test_mypy.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 1 | 2020-05-03T06:32:47.000Z | 2020-05-03T06:32:47.000Z | tests/mypy/test_mypy.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 189 | 2020-07-12T08:13:29.000Z | 2022-03-28T01:16:29.000Z | tests/mypy/test_mypy.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 2 | 2021-11-23T16:28:21.000Z | 2021-11-23T16:28:33.000Z | import importlib
import os
import re
from pathlib import Path
import pytest
try:
from mypy import api as mypy_api
except ImportError:
mypy_api = None # type: ignore
try:
import dotenv
except ImportError:
dotenv = None # type: ignore
# This ensures mypy can find the test files, no matter where test... | 46.169643 | 116 | 0.705473 | import importlib
import os
import re
from pathlib import Path
import pytest
try:
from mypy import api as mypy_api
except ImportError:
mypy_api = None # type: ignore
try:
import dotenv
except ImportError:
dotenv = None # type: ignore
# This ensures mypy can find the test files, no matter where test... | 2,942 | 0 | 67 |
f8b9e4e8b0c62ee60777e7974dd1a400acc61e2c | 18,835 | py | Python | cli/aps.py | Verimatrix/app-shield-protect | 1e9e02ef2760139fb7cf6efc0e22155234e7aa4c | [
"MIT"
] | 19 | 2021-04-26T15:38:22.000Z | 2022-03-30T20:01:20.000Z | cli/aps.py | Daniel1Rosen/app-shield-protect | 1e9e02ef2760139fb7cf6efc0e22155234e7aa4c | [
"MIT"
] | 1 | 2021-03-11T14:20:55.000Z | 2021-03-11T17:32:13.000Z | cli/aps.py | Daniel1Rosen/app-shield-protect | 1e9e02ef2760139fb7cf6efc0e22155234e7aa4c | [
"MIT"
] | 1 | 2022-01-06T20:53:32.000Z | 2022-01-06T20:53:32.000Z | #!/usr/bin/python
'''Entrypoint for APS CLI'''
import argparse
import json
import logging
import os
import sys
import traceback
import coloredlogs
from aps_commands import ApsCommands
from aps_utils import get_config, authenticate_secret
LOGGER = logging.getLogger(__name__)
# set environment variables that control ... | 43.700696 | 124 | 0.628935 | #!/usr/bin/python
'''Entrypoint for APS CLI'''
import argparse
import json
import logging
import os
import sys
import traceback
import coloredlogs
from aps_commands import ApsCommands
from aps_utils import get_config, authenticate_secret
LOGGER = logging.getLogger(__name__)
# set environment variables that control ... | 3,888 | 0 | 53 |
9cd14774cef42968c64c6869f09ed35f3728ce7a | 2,379 | py | Python | botx/bots/mixins/collectors.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 13 | 2021-01-21T12:43:10.000Z | 2022-03-23T11:11:59.000Z | botx/bots/mixins/collectors.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 259 | 2020-02-26T08:51:03.000Z | 2022-03-23T11:08:36.000Z | botx/bots/mixins/collectors.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 5 | 2019-12-02T16:19:22.000Z | 2021-11-22T20:33:34.000Z | """Definition for bot's collecting component.
All of this methods are just wrappers around inner collector.
"""
from typing import Any, List, Optional, Sequence
from botx.bots.mixins.collecting.add_handler import AddHandlerMixin
from botx.bots.mixins.collecting.default import DefaultHandlerMixin
from botx.bots.mixin... | 30.896104 | 85 | 0.688525 | """Definition for bot's collecting component.
All of this methods are just wrappers around inner collector.
"""
from typing import Any, List, Optional, Sequence
from botx.bots.mixins.collecting.add_handler import AddHandlerMixin
from botx.bots.mixins.collecting.default import DefaultHandlerMixin
from botx.bots.mixin... | 0 | 0 | 0 |
7f4f696664f38e804ec5049ca26eb5c74828b503 | 1,455 | py | Python | cds_ils/ldap/cli.py | kpsherva/cds-ils | 8eeeb6e03784756ed24895c8d030682f9d733e8a | [
"MIT"
] | 6 | 2020-09-18T00:13:38.000Z | 2021-11-14T17:12:19.000Z | cds_ils/ldap/cli.py | kpsherva/cds-ils | 8eeeb6e03784756ed24895c8d030682f9d733e8a | [
"MIT"
] | 321 | 2020-08-28T15:42:25.000Z | 2022-03-14T15:11:50.000Z | cds_ils/ldap/cli.py | kpsherva/cds-ils | 8eeeb6e03784756ed24895c8d030682f9d733e8a | [
"MIT"
] | 4 | 2020-08-31T08:55:47.000Z | 2022-01-14T11:30:23.000Z | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2020 CERN.
#
# cds-migrator-kit is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""CDS-ILS ldap users CLI."""
import click
from flask import current_app
fr... | 25.982143 | 77 | 0.717526 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2020 CERN.
#
# cds-migrator-kit is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""CDS-ILS ldap users CLI."""
import click
from flask import current_app
fr... | 0 | 0 | 0 |
eb6df24de1ebfc73472eb5e92e6a7151f65ea7fd | 1,354 | py | Python | myDjangoProject/myDjangoProject/SSHConn.py | yueheng-li/pythonLearn | 375028537be08a8ae14104bf439172816017323e | [
"MIT"
] | null | null | null | myDjangoProject/myDjangoProject/SSHConn.py | yueheng-li/pythonLearn | 375028537be08a8ae14104bf439172816017323e | [
"MIT"
] | null | null | null | myDjangoProject/myDjangoProject/SSHConn.py | yueheng-li/pythonLearn | 375028537be08a8ae14104bf439172816017323e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import paramiko
import logging
| 27.632653 | 89 | 0.718612 | # -*- coding: utf-8 -*-
import paramiko
import logging
class SSHConn:
logger = logging.getLogger('scripts')
def __init__(self, hostname, port, username, password):
self.client = paramiko.SSHClient()
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
self.client.connect(hostname=hostname, port=... | 1,166 | 154 | 23 |
91d9922392d11c99a25f3dd872cb144761ea21f3 | 1,732 | py | Python | pytdx/pytdx/parser/get_company_info_content.py | iamweilee/nodetdx | 5048cb25da6aae18e3204fa365e92866c0914340 | [
"MIT"
] | 7 | 2021-06-27T11:42:00.000Z | 2022-03-15T15:01:29.000Z | pytdx/pytdx/parser/get_company_info_content.py | hitrading/nodetdx | 5048cb25da6aae18e3204fa365e92866c0914340 | [
"MIT"
] | null | null | null | pytdx/pytdx/parser/get_company_info_content.py | hitrading/nodetdx | 5048cb25da6aae18e3204fa365e92866c0914340 | [
"MIT"
] | 2 | 2021-07-08T03:44:41.000Z | 2021-09-15T00:41:19.000Z | # coding=utf-8
from pytdx.parser.base import BaseParser
from pytdx.helper import get_datetime, get_volume, get_price
from collections import OrderedDict
import struct
import six
import zlib
| 34.64 | 264 | 0.691109 | # coding=utf-8
from pytdx.parser.base import BaseParser
from pytdx.helper import get_datetime, get_volume, get_price
from collections import OrderedDict
import struct
import six
import zlib
class GetCompanyInfoContent(BaseParser):
def setParams(self, market, code, filename, start, length):
if type(code)... | 1,422 | 19 | 100 |
7d8dbfd1ee273cc85c76d1e6dd4508382ec92620 | 5,927 | py | Python | wsrpc/__init__.py | guyingbo/websocket-rpc | 326765cd660b5ae4c77cea456ca774deae80e9f6 | [
"MIT"
] | 8 | 2018-01-22T12:03:13.000Z | 2021-07-06T15:24:48.000Z | wsrpc/__init__.py | guyingbo/websocket-rpc | 326765cd660b5ae4c77cea456ca774deae80e9f6 | [
"MIT"
] | 2 | 2019-10-22T17:43:15.000Z | 2020-04-27T15:09:36.000Z | wsrpc/__init__.py | guyingbo/websocket-rpc | 326765cd660b5ae4c77cea456ca774deae80e9f6 | [
"MIT"
] | 1 | 2020-06-08T19:34:13.000Z | 2020-06-08T19:34:13.000Z | """msgpack rpc over websockets"""
import asyncio
import inspect
import itertools
import logging
import typing
import msgpack # type: ignore
logger = logging.getLogger(__name__)
__version__ = "0.0.6"
| 31.359788 | 86 | 0.596254 | """msgpack rpc over websockets"""
import asyncio
import inspect
import itertools
import logging
import typing
import msgpack # type: ignore
logger = logging.getLogger(__name__)
__version__ = "0.0.6"
class RPCError(Exception):
pass
class RemoteCallError(Exception):
pass
class WebsocketRPC:
REQUEST =... | 4,971 | 634 | 115 |
c945c07012decbd51269c28e92ef14a6644a2d2e | 1,279 | py | Python | tests/neurofire/datasets/isbi/loaders/master.py | nasimrahaman/neurofire | 4d645be149165da4c8202fe13b3c2360c2832383 | [
"MIT"
] | 9 | 2018-01-29T07:30:14.000Z | 2022-03-09T04:23:14.000Z | tests/neurofire/datasets/isbi/loaders/master.py | nasimrahaman/neurofire | 4d645be149165da4c8202fe13b3c2360c2832383 | [
"MIT"
] | 1 | 2017-12-19T14:27:18.000Z | 2017-12-19T15:35:59.000Z | tests/neurofire/datasets/isbi/loaders/master.py | nasimrahaman/neurofire | 4d645be149165da4c8202fe13b3c2360c2832383 | [
"MIT"
] | 5 | 2018-01-27T12:16:37.000Z | 2020-01-20T13:14:26.000Z | import os
import unittest
if __name__ == '__main__':
TestMaster().test_master()
| 36.542857 | 96 | 0.621579 | import os
import unittest
class TestMaster(unittest.TestCase):
DATA_CONFIG = os.path.join(os.path.dirname(__file__), 'data_config_test.yml')
PLOT_DIRECTORY = os.path.join(os.path.dirname(__file__), 'plots')
def test_master(self):
from neurofire.datasets.isbi2012.loaders.master import ISBI2012Data... | 976 | 194 | 23 |
8f92f89adceb8143275e8758b8bfe37c82df0da9 | 481 | py | Python | setup.py | DiegoLigtenberg/Workspace-MasterThesis-MSS | e8183031b6223051049f48e0da2bc2824e60239e | [
"MIT"
] | null | null | null | setup.py | DiegoLigtenberg/Workspace-MasterThesis-MSS | e8183031b6223051049f48e0da2bc2824e60239e | [
"MIT"
] | null | null | null | setup.py | DiegoLigtenberg/Workspace-MasterThesis-MSS | e8183031b6223051049f48e0da2bc2824e60239e | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="mss_project",
version="1.0",
author="Diego Ligtenberg",
author_email="diegoligtenberg@gmail.com",
description="Master Thesis about Music Source Separation, and Instrument classification",
license="MIT",
long_description=("README"),
... | 30.0625 | 93 | 0.711019 | from setuptools import setup, find_packages
setup(
name="mss_project",
version="1.0",
author="Diego Ligtenberg",
author_email="diegoligtenberg@gmail.com",
description="Master Thesis about Music Source Separation, and Instrument classification",
license="MIT",
long_description=("README"),
... | 0 | 0 | 0 |
f230d13b83b27eab0a372096cee774eb318e7ef3 | 76 | py | Python | djangobotcfg/__init__.py | henriquebastos/django-buildmaster | a3169509e2a8fb2623cde0a99c4087ef04b0be38 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T20:18:59.000Z | 2018-04-18T20:18:59.000Z | djangobotcfg/__init__.py | henriquebastos/django-buildmaster | a3169509e2a8fb2623cde0a99c4087ef04b0be38 | [
"BSD-3-Clause"
] | null | null | null | djangobotcfg/__init__.py | henriquebastos/django-buildmaster | a3169509e2a8fb2623cde0a99c4087ef04b0be38 | [
"BSD-3-Clause"
] | null | null | null | from . import builders, buildsteps, changesource, schedulers, slaves, status | 76 | 76 | 0.815789 | from . import builders, buildsteps, changesource, schedulers, slaves, status | 0 | 0 | 0 |
3f84395d2f49e57e7b6548b518e2f701e3b76824 | 236 | py | Python | backend/reports/admin.py | nikhilkutinha/athena | dd46eac06ed3bf2d24e4c0882c1a79adca8025b5 | [
"MIT"
] | 1 | 2021-02-12T10:25:03.000Z | 2021-02-12T10:25:03.000Z | backend/reports/admin.py | nikhilkutinha/athena | dd46eac06ed3bf2d24e4c0882c1a79adca8025b5 | [
"MIT"
] | null | null | null | backend/reports/admin.py | nikhilkutinha/athena | dd46eac06ed3bf2d24e4c0882c1a79adca8025b5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . models import Region, Report
admin.site.register(Region, RegionAdmin)
admin.site.register(Report)
| 23.6 | 57 | 0.771186 | from django.contrib import admin
from . models import Region, Report
class RegionAdmin(admin.ModelAdmin):
list_display = ('name', 'get_type_display', 'parent')
admin.site.register(Region, RegionAdmin)
admin.site.register(Report)
| 0 | 73 | 23 |
df8b64d264ab4c00a24b54e27a1d1471a8499466 | 2,390 | py | Python | tardis/configuration/configuration.py | stwunsch/tardis | cfc01a7a3b2e58e7e88653dd8d119a724e27d620 | [
"MIT"
] | 11 | 2019-06-06T14:44:56.000Z | 2021-12-17T19:46:18.000Z | tardis/configuration/configuration.py | stwunsch/tardis | cfc01a7a3b2e58e7e88653dd8d119a724e27d620 | [
"MIT"
] | 165 | 2019-04-26T09:31:19.000Z | 2022-03-09T16:45:45.000Z | tardis/configuration/configuration.py | stwunsch/tardis | cfc01a7a3b2e58e7e88653dd8d119a724e27d620 | [
"MIT"
] | 12 | 2019-06-06T14:06:15.000Z | 2021-12-21T12:31:03.000Z | from ..interfaces.borg import Borg
from ..utilities.attributedict import AttributeDict
from ..utilities.attributedict import convert_to_attribute_dict
# Need to import all pyyaml loadable classes (bootstrapping problem) FIX ME
from ..utilities.executors import * # noqa: F403, F401
from ..utilities.simulators import *... | 36.769231 | 81 | 0.667364 | from ..interfaces.borg import Borg
from ..utilities.attributedict import AttributeDict
from ..utilities.attributedict import convert_to_attribute_dict
# Need to import all pyyaml loadable classes (bootstrapping problem) FIX ME
from ..utilities.executors import * # noqa: F403, F401
from ..utilities.simulators import *... | 986 | 801 | 45 |
e8a18d18e4d026ba92c527e07f4aab2ed6809c1d | 1,261 | py | Python | backup/main.py | ProgMeli/backup-mega | c7d7c3e0eaa2f416ed0bf596745b19f31b4f5f42 | [
"BSD-2-Clause"
] | null | null | null | backup/main.py | ProgMeli/backup-mega | c7d7c3e0eaa2f416ed0bf596745b19f31b4f5f42 | [
"BSD-2-Clause"
] | null | null | null | backup/main.py | ProgMeli/backup-mega | c7d7c3e0eaa2f416ed0bf596745b19f31b4f5f42 | [
"BSD-2-Clause"
] | null | null | null | import os
import subprocess
from datetime import datetime
from os.path import join
from pathlib import Path
from backup.build_files import zipping_files
| 29.325581 | 101 | 0.66931 | import os
import subprocess
from datetime import datetime
from os.path import join
from pathlib import Path
from backup.build_files import zipping_files
def backup():
home_folder = str(Path.home())
path_conf = join(home_folder, "backup-mega.txt")
now = datetime.now()
output_file = '/tmp/backup/{}-{}-{... | 1,012 | 0 | 92 |
120369d341d9b59da985a66835a1ca1e27100fb4 | 3,626 | py | Python | src/sparsezoo/requests/get.py | signalism/sparsezoo | 5ca44f8cb514e80844034920d743baba97279ec2 | [
"Apache-2.0"
] | 116 | 2021-02-04T17:51:22.000Z | 2022-03-25T03:15:19.000Z | src/sparsezoo/requests/get.py | PIlotcnc/new | 6e6413632de01f6acf691dca8fadb84f841444b9 | [
"Apache-2.0"
] | 15 | 2021-02-13T12:00:40.000Z | 2022-03-17T18:44:54.000Z | src/sparsezoo/requests/get.py | PIlotcnc/new | 6e6413632de01f6acf691dca8fadb84f841444b9 | [
"Apache-2.0"
] | 11 | 2021-02-04T22:20:47.000Z | 2021-12-03T12:20:09.000Z | # Copyright (c) 2021 - present / Neuralmagic, 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 required b... | 32.088496 | 88 | 0.714286 | # Copyright (c) 2021 - present / Neuralmagic, 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 required b... | 0 | 0 | 0 |
0a9e5488d671080d52c88d3170387721e61d8893 | 4,851 | py | Python | data_filter.py | linmengsysu/isonode | e471def853adbcbc25ef169c178510bbcddeab38 | [
"MIT"
] | 1 | 2022-01-28T23:59:24.000Z | 2022-01-28T23:59:24.000Z | data_filter.py | linmengsysu/isonode | e471def853adbcbc25ef169c178510bbcddeab38 | [
"MIT"
] | null | null | null | data_filter.py | linmengsysu/isonode | e471def853adbcbc25ef169c178510bbcddeab38 | [
"MIT"
] | null | null | null | # from pytorch_transformers import *
# from sklearn.preprocessing import OneHotEncoder, LabelBinarizer, MultiLabelBinarizer
# from data import *
# import gensim
# from gensim.models import Word2Vec
# from tqdm import tqdm
# from tqdm import tqdm_notebook as tqdm # Comment this line if using jupyter notebook
from scip... | 37.604651 | 141 | 0.603793 | # from pytorch_transformers import *
# from sklearn.preprocessing import OneHotEncoder, LabelBinarizer, MultiLabelBinarizer
# from data import *
# import gensim
# from gensim.models import Word2Vec
# from tqdm import tqdm
# from tqdm import tqdm_notebook as tqdm # Comment this line if using jupyter notebook
from scip... | 0 | 0 | 0 |
53535af0d4e9f21ee100b03504a8ad034178c9c9 | 738 | py | Python | planners/mouseSampler.py | jkwang1992/rrdt | 5579081fc53f56573c772ff9a894c0093e0bc5e0 | [
"MIT"
] | 8 | 2019-05-21T04:40:53.000Z | 2020-10-17T07:20:04.000Z | planners/mouseSampler.py | soraxas/rrdt | 5579081fc53f56573c772ff9a894c0093e0bc5e0 | [
"MIT"
] | null | null | null | planners/mouseSampler.py | soraxas/rrdt | 5579081fc53f56573c772ff9a894c0093e0bc5e0 | [
"MIT"
] | 3 | 2021-07-16T07:06:14.000Z | 2022-02-09T12:06:06.000Z | import time
import pygame
from overrides import overrides
from planners.baseSampler import Sampler
"""
For demo / testing only. This policy wait for user mouse input for next sampling node.
"""
| 27.333333 | 110 | 0.650407 | import time
import pygame
from overrides import overrides
from planners.baseSampler import Sampler
"""
For demo / testing only. This policy wait for user mouse input for next sampling node.
"""
class MouseSampler(Sampler):
@overrides
def get_next_pos(self):
return self.get_mouse_click_position(scal... | 424 | 94 | 23 |
6557b4215fd9305d2dc5481a24a7bb9f504b5e55 | 14,012 | py | Python | tests/comments/test_video_comments_view.py | Torniojaws/vortech-backend | f775a97eeae089fa720088d86fe92d40bc5d65bc | [
"MIT"
] | null | null | null | tests/comments/test_video_comments_view.py | Torniojaws/vortech-backend | f775a97eeae089fa720088d86fe92d40bc5d65bc | [
"MIT"
] | 93 | 2017-09-01T22:24:10.000Z | 2021-12-22T14:07:06.000Z | tests/comments/test_video_comments_view.py | Torniojaws/vortech-backend | f775a97eeae089fa720088d86fe92d40bc5d65bc | [
"MIT"
] | null | null | null | import json
import unittest
from flask_caching import Cache
from sqlalchemy import asc
from app import app, db
from apps.comments.models import CommentsVideos
from apps.videos.models import Videos
from apps.users.models import Users, UsersAccessLevels, UsersAccessMapping, UsersAccessTokens
from apps.utils.time import... | 35.03 | 93 | 0.567371 | import json
import unittest
from flask_caching import Cache
from sqlalchemy import asc
from app import app, db
from apps.comments.models import CommentsVideos
from apps.videos.models import Videos
from apps.users.models import Users, UsersAccessLevels, UsersAccessMapping, UsersAccessTokens
from apps.utils.time import... | 4,545 | 9,080 | 23 |
b36409855170a5bba1fa8e4bfcd74d4fb54b5b4d | 5,887 | py | Python | Tutorial 2 - Data Navigation/PlugIns/experimental/scripts/CompositeSurveyImage.py | paradimdata/Cornell_EM_SummerSchool_2021 | 9f3583e1b85a9cdd86e1b91800027966d501ce96 | [
"MIT"
] | 8 | 2021-06-13T20:02:12.000Z | 2022-03-24T09:19:23.000Z | Tutorial 2 - Data Navigation/PlugIns/experimental/scripts/CompositeSurveyImage.py | paradimdata/Cornell_EM_SummerSchool_2021 | 9f3583e1b85a9cdd86e1b91800027966d501ce96 | [
"MIT"
] | null | null | null | Tutorial 2 - Data Navigation/PlugIns/experimental/scripts/CompositeSurveyImage.py | paradimdata/Cornell_EM_SummerSchool_2021 | 9f3583e1b85a9cdd86e1b91800027966d501ce96 | [
"MIT"
] | 1 | 2021-07-16T20:12:28.000Z | 2021-07-16T20:12:28.000Z | """
Example script to do acquire a composite survey image using stage shift.
The script uses the center 50% of the image, shifts the stage by the appropriate amount
in x, y directions, and stitches the resulting images together into a larger super image.
To use:
Run Nion Swift and get a good image
Set the def... | 51.191304 | 189 | 0.675556 | """
Example script to do acquire a composite survey image using stage shift.
The script uses the center 50% of the image, shifts the stage by the appropriate amount
in x, y directions, and stitches the resulting images together into a larger super image.
To use:
Run Nion Swift and get a good image
Set the def... | 4,368 | 0 | 23 |
7b6e6935e9f10e3177f7f225ae50e045d968b7a9 | 18,997 | py | Python | python/biograph/vdb/study_cmd.py | spiralgenetics/biograph | 33c78278ce673e885f38435384f9578bfbf9cdb8 | [
"BSD-2-Clause"
] | 16 | 2021-07-14T23:32:31.000Z | 2022-03-24T16:25:15.000Z | python/biograph/vdb/study_cmd.py | spiralgenetics/biograph | 33c78278ce673e885f38435384f9578bfbf9cdb8 | [
"BSD-2-Clause"
] | 9 | 2021-07-20T20:39:47.000Z | 2021-09-16T20:57:59.000Z | python/biograph/vdb/study_cmd.py | spiralgenetics/biograph | 33c78278ce673e885f38435384f9578bfbf9cdb8 | [
"BSD-2-Clause"
] | 9 | 2021-07-15T19:38:35.000Z | 2022-01-31T19:24:56.000Z | #!/usr/bin/env python3
'''
Manage VDB studies
'''
import argparse
import inspect
import multiprocessing
import subprocess
import sys
import tempfile
from pathlib import Path
import orjson as json
import biograph.vdb.athena as athena
from biograph.tools.log import setup_logging, log
from biograph.tools.refhash import... | 37.031189 | 177 | 0.635574 | #!/usr/bin/env python3
'''
Manage VDB studies
'''
import argparse
import inspect
import multiprocessing
import subprocess
import sys
import tempfile
from pathlib import Path
import orjson as json
import biograph.vdb.athena as athena
from biograph.tools.log import setup_logging, log
from biograph.tools.refhash import... | 1,197 | 0 | 53 |
4fd45db9c2e379d53922d350b4c817fe2011fd1f | 38 | py | Python | tests/core/backend_tests.py | LTD-Beget/cement | e885932583c14037599a2aa8a16d4d8a521364bd | [
"BSD-3-Clause"
] | null | null | null | tests/core/backend_tests.py | LTD-Beget/cement | e885932583c14037599a2aa8a16d4d8a521364bd | [
"BSD-3-Clause"
] | null | null | null | tests/core/backend_tests.py | LTD-Beget/cement | e885932583c14037599a2aa8a16d4d8a521364bd | [
"BSD-3-Clause"
] | null | null | null | """Tests for cement.core.backend."""
| 12.666667 | 36 | 0.657895 | """Tests for cement.core.backend."""
| 0 | 0 | 0 |
8038c2dcc55dc95a304ef67bf6c48b936f148f68 | 3,610 | py | Python | sdk/python/lib/pulumi/runtime/proto/language_pb2_grpc.py | goverdhan07/pulumi | 301efa60653c90047a3427af41339387223dbccd | [
"Apache-2.0"
] | 1 | 2021-11-23T21:49:18.000Z | 2021-11-23T21:49:18.000Z | sdk/python/lib/pulumi/runtime/proto/language_pb2_grpc.py | goverdhan07/pulumi | 301efa60653c90047a3427af41339387223dbccd | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/pulumi/runtime/proto/language_pb2_grpc.py | goverdhan07/pulumi | 301efa60653c90047a3427af41339387223dbccd | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from . import language_pb2 as language__pb2
from . import plugin_pb2 as plugin__pb2
class LanguageRuntimeStub(object):
"""LanguageRuntime is the interface ... | 43.493976 | 119 | 0.726593 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from . import language_pb2 as language__pb2
from . import plugin_pb2 as plugin__pb2
class LanguageRuntimeStub(object):
"""LanguageRuntime is the interface ... | 1,053 | 0 | 23 |
340a6637d5d3b1008bf7f41fcad83627e2c6f06d | 2,447 | py | Python | tsdl/classifiers/poly.py | burgerdev/hostload | 93142628bb32923c5e6f3a8b791488d72a5c9077 | [
"MIT"
] | null | null | null | tsdl/classifiers/poly.py | burgerdev/hostload | 93142628bb32923c5e6f3a8b791488d72a5c9077 | [
"MIT"
] | null | null | null | tsdl/classifiers/poly.py | burgerdev/hostload | 93142628bb32923c5e6f3a8b791488d72a5c9077 | [
"MIT"
] | null | null | null |
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from sklearn.pipeline import Pipeline
from lazyflow.rtype import SubRegion
from lazyflow.operator import InputSlot
from .abcs import OpTrain
from .abcs import OpPredict
from tsdl.tools import R... | 32.197368 | 78 | 0.637515 |
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from sklearn.pipeline import Pipeline
from lazyflow.rtype import SubRegion
from lazyflow.operator import InputSlot
from .abcs import OpTrain
from .abcs import OpPredict
from tsdl.tools import R... | 1,838 | 205 | 72 |
c371bf194a11f9f676fde05a640618c87f3d85b8 | 2,632 | py | Python | slope/models/corefres/mentionpair/data.py | RyanElliott10/slope | 3247b04181cb6696978ce544382d97fa570b862d | [
"MIT"
] | 1 | 2020-10-07T04:33:54.000Z | 2020-10-07T04:33:54.000Z | slope/models/corefres/mentionpair/data.py | RyanElliott10/slope | 3247b04181cb6696978ce544382d97fa570b862d | [
"MIT"
] | 1 | 2021-08-31T04:10:05.000Z | 2021-08-31T04:10:05.000Z | slope/models/corefres/mentionpair/data.py | RyanElliott10/slope | 3247b04181cb6696978ce544382d97fa570b862d | [
"MIT"
] | null | null | null | from itertools import combinations, product
import pprint
from typing import List, Tuple
import numpy as np
from slope.utils.preco_parser import PreCoFileType, PreCoParser
MentionIndices = List[int]
RawMentionClusters = List[List[MentionIndices]]
pp = pprint.PrettyPrinter()
class MentionPairDataLoader(object):
... | 31.710843 | 106 | 0.616261 | from itertools import combinations, product
import pprint
from typing import List, Tuple
import numpy as np
from slope.utils.preco_parser import PreCoFileType, PreCoParser
MentionIndices = List[int]
RawMentionClusters = List[List[MentionIndices]]
pp = pprint.PrettyPrinter()
class MentionPair(object):
def __in... | 684 | 171 | 104 |
bcc5f415ab3d29c23264e830404576ecdb146419 | 4,816 | py | Python | doorman/webserver.py | fruch/doorman | 75bea9f5e776af6e8a0f1d5a27d8bb508bb9687d | [
"BSD-2-Clause"
] | 8 | 2016-10-23T13:00:06.000Z | 2021-03-05T13:03:24.000Z | doorman/webserver.py | fruch/doorman | 75bea9f5e776af6e8a0f1d5a27d8bb508bb9687d | [
"BSD-2-Clause"
] | null | null | null | doorman/webserver.py | fruch/doorman | 75bea9f5e776af6e8a0f1d5a27d8bb508bb9687d | [
"BSD-2-Clause"
] | 2 | 2019-05-23T13:12:47.000Z | 2021-02-15T18:34:33.000Z | import datetime
import json
import pymongo.errors
from bson import json_util
import pymongo
import pql
from flask import Flask, request, g
from flask_restful import Resource, Api, reqparse, abort
app = Flask(__name__)
api = Api(app)
app.config.from_pyfile('config.py', silent=True)
def get_resources_db():
"""Op... | 31.477124 | 121 | 0.61711 | import datetime
import json
import pymongo.errors
from bson import json_util
import pymongo
import pql
from flask import Flask, request, g
from flask_restful import Resource, Api, reqparse, abort
app = Flask(__name__)
api = Api(app)
app.config.from_pyfile('config.py', silent=True)
def get_resources_db():
"""Op... | 3,032 | 292 | 95 |
05240aa8c3b464addff9da5629d2e9178b976d59 | 2,229 | py | Python | examples/hireps/pendulum/pendulum_cart.py | hanyas/reps | 447c461b89dec516ce3368d841cfe9734be78199 | [
"MIT"
] | 8 | 2021-06-21T18:58:56.000Z | 2021-12-13T09:47:41.000Z | examples/hireps/pendulum/pendulum_cart.py | hanyas/reps | 447c461b89dec516ce3368d841cfe9734be78199 | [
"MIT"
] | null | null | null | examples/hireps/pendulum/pendulum_cart.py | hanyas/reps | 447c461b89dec516ce3368d841cfe9734be78199 | [
"MIT"
] | 1 | 2021-06-29T04:42:45.000Z | 2021-06-29T04:42:45.000Z | import numpy as np
import gym
import scipy as sc
from scipy.special import comb
import torch
from sds.distributions.gamma import Gamma
from sds.models import HybridController
from reps.hireps import hbREPS
# np.random.seed(1337)
# torch.manual_seed(1337)
torch.set_num_threads(1)
env = gym.make('Pendulum-RL-v1')
en... | 29.72 | 89 | 0.677882 | import numpy as np
import gym
import scipy as sc
from scipy.special import comb
import torch
from sds.distributions.gamma import Gamma
from sds.models import HybridController
from reps.hireps import hbREPS
# np.random.seed(1337)
# torch.manual_seed(1337)
torch.set_num_threads(1)
env = gym.make('Pendulum-RL-v1')
en... | 0 | 0 | 0 |
18c63db8476e3140408ff6aba738699a1ebfd1e2 | 3,660 | py | Python | Algorithm.Python/DividendAlgorithm.py | albertozatton/quant | 17381cb2520de0fbad328a7d7412a6e5aacb2e19 | [
"Apache-2.0"
] | 1 | 2022-03-11T09:30:09.000Z | 2022-03-11T09:30:09.000Z | Algorithm.Python/DividendAlgorithm.py | vmanjunathan/Lean | ff783a4d3abd38e6f56c8f9d55804175a421a021 | [
"Apache-2.0"
] | null | null | null | Algorithm.Python/DividendAlgorithm.py | vmanjunathan/Lean | ff783a4d3abd38e6f56c8f9d55804175a421a021 | [
"Apache-2.0"
] | 1 | 2020-08-09T21:36:47.000Z | 2020-08-09T21:36:47.000Z | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Li... | 48.8 | 151 | 0.694809 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Li... | 222 | 0 | 27 |
176d5912fea1a5af11e2bc7beb6f9b3f56c0ae8d | 2,730 | py | Python | adept/__init__.py | fictivekin/adept-python | 56dad62922badd238fd1614fc27ba3ad31380446 | [
"MIT"
] | 1 | 2019-01-14T11:50:04.000Z | 2019-01-14T11:50:04.000Z | adept/__init__.py | fictivekin/adept-python | 56dad62922badd238fd1614fc27ba3ad31380446 | [
"MIT"
] | null | null | null | adept/__init__.py | fictivekin/adept-python | 56dad62922badd238fd1614fc27ba3ad31380446 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import hashlib
import hmac
from urllib import quote as urlquote
from .errors import OperationError, AccountError
| 30.333333 | 110 | 0.545788 | # -*- coding: utf-8 -*-
import hashlib
import hmac
from urllib import quote as urlquote
from .errors import OperationError, AccountError
class Adept(object):
def __init__(self, account_id, account_key, cloudfront_hostname, default_bucket=None):
if account_id is not None:
self.account_id = acc... | 844 | 1,725 | 23 |
99714978b0b817fb700292a492f8900f1517ebec | 4,771 | py | Python | bash_to_python/tail.py | blakfeld/Bash-To-Python | d6a56dedbce1314e33e9773fa7039f25fccef1c3 | [
"MIT"
] | null | null | null | bash_to_python/tail.py | blakfeld/Bash-To-Python | d6a56dedbce1314e33e9773fa7039f25fccef1c3 | [
"MIT"
] | null | null | null | bash_to_python/tail.py | blakfeld/Bash-To-Python | d6a56dedbce1314e33e9773fa7039f25fccef1c3 | [
"MIT"
] | null | null | null | """
tail.py -- Emulate UNIX tail.
Author: Corwin Brown
E-Mail: blakfeld@gmail.com
Date: 5/24/2015
"""
import sys
import time
| 29.269939 | 76 | 0.518759 | """
tail.py -- Emulate UNIX tail.
Author: Corwin Brown
E-Mail: blakfeld@gmail.com
Date: 5/24/2015
"""
import sys
import time
class Tail(object):
BLOCK_SIZE = 512
SLEEP_INTERVAL = 1.0
def __init__(self, stdin=None, fname=None, num_lines=10, watch=False):
"""
Constructor
Args:
... | 0 | 4,620 | 23 |
e7bd25abfac8f18d2b26d78c00a893195783ee97 | 822 | py | Python | KernelGAN/blur_images.py | geopi1/Improved_USRNet | 06395641c30f3df2986cf70f7ceee6c9a5bc0aa9 | [
"MIT"
] | 20 | 2020-08-24T07:21:30.000Z | 2021-07-09T04:20:06.000Z | KernelGAN/blur_images.py | geopi1/Improved_USRNet | 06395641c30f3df2986cf70f7ceee6c9a5bc0aa9 | [
"MIT"
] | 1 | 2020-10-21T08:02:18.000Z | 2021-01-17T23:29:58.000Z | KernelGAN/blur_images.py | geopi1/Improved_USRNet | 06395641c30f3df2986cf70f7ceee6c9a5bc0aa9 | [
"MIT"
] | 3 | 2020-11-19T05:17:10.000Z | 2021-05-04T11:01:10.000Z | import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter
img = cv.imread('/home/george/PycharmProjects/Statistical_im_proc/KernelGAN/test.jpg')
kernel = np.ones((17,17),np.float32)/289
dst = cv.filter2D(img,-1,kernel)
g_img = gaussian_filter(img, [1,1... | 37.363636 | 97 | 0.733577 | import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter
img = cv.imread('/home/george/PycharmProjects/Statistical_im_proc/KernelGAN/test.jpg')
kernel = np.ones((17,17),np.float32)/289
dst = cv.filter2D(img,-1,kernel)
g_img = gaussian_filter(img, [1,1... | 0 | 0 | 0 |
b148aa310011894324b56d871905e3d3bdc30a06 | 2,550 | py | Python | examples/sample_iso_cliques.py | AtsushiHashimoto/isolated_clique_enumeration | 9ff817f57d929b5db07265fe6d85013c13825869 | [
"MIT"
] | null | null | null | examples/sample_iso_cliques.py | AtsushiHashimoto/isolated_clique_enumeration | 9ff817f57d929b5db07265fe6d85013c13825869 | [
"MIT"
] | null | null | null | examples/sample_iso_cliques.py | AtsushiHashimoto/isolated_clique_enumeration | 9ff817f57d929b5db07265fe6d85013c13825869 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import sys
sys.path.append('../isoclique')
import isoclique as ic
import networkx as nx
import matplotlib.pyplot as plt
import random
import math
import time
if __name__ == '__main__':
E = nx.karate_club_graph().edges()
start = time.time()
ic_graph = ic.I... | 28.651685 | 83 | 0.626275 | #!/usr/bin/env python
# coding: utf-8
import sys
sys.path.append('../isoclique')
import isoclique as ic
import networkx as nx
import matplotlib.pyplot as plt
import random
import math
import time
def generate_random_color():
return '#{:X}{:X}{:X}'.format(*[random.randint(16, 255) for _ in range(3)])
def generate... | 252 | 0 | 71 |
10e2930227e6a62d0a350d6fdef2abb269d54845 | 4,920 | py | Python | run_ensemble.py | gnkm/kaggle.house-prices | 5fd1fcc9fcf8e191c0729ab6244b01180d44f535 | [
"MIT"
] | null | null | null | run_ensemble.py | gnkm/kaggle.house-prices | 5fd1fcc9fcf8e191c0729ab6244b01180d44f535 | [
"MIT"
] | null | null | null | run_ensemble.py | gnkm/kaggle.house-prices | 5fd1fcc9fcf8e191c0729ab6244b01180d44f535 | [
"MIT"
] | null | null | null | import argparse
from datetime import datetime as dt
from lightgbm import LGBMRegressor
import numpy as np
import pandas as pd
from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor, StackingRegressor
from sklearn.kernel_ridge import KernelRidge
from sklearn.linear_model import ElasticNet, Lasso, ... | 27.333333 | 96 | 0.74878 | import argparse
from datetime import datetime as dt
from lightgbm import LGBMRegressor
import numpy as np
import pandas as pd
from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor, StackingRegressor
from sklearn.kernel_ridge import KernelRidge
from sklearn.linear_model import ElasticNet, Lasso, ... | 0 | 0 | 0 |
500b280c30d2110068a5ebf3ccc96e2778c5344d | 807 | py | Python | Python/HotelPrices/solution.py | cs-mshah/AlgoCode | 0d6556483c08f63166fd74d4ff80fb48d75e4a63 | [
"MIT"
] | 151 | 2020-10-01T07:38:26.000Z | 2022-03-31T10:07:55.000Z | Python/HotelPrices/solution.py | cs-mshah/AlgoCode | 0d6556483c08f63166fd74d4ff80fb48d75e4a63 | [
"MIT"
] | 285 | 2020-10-01T09:34:29.000Z | 2021-08-02T12:13:49.000Z | Python/HotelPrices/solution.py | cs-mshah/AlgoCode | 0d6556483c08f63166fd74d4ff80fb48d75e4a63 | [
"MIT"
] | 275 | 2020-10-01T09:43:51.000Z | 2022-03-30T19:30:53.000Z |
# object created and method calling
objHotel = hotel()
objHotel.calculateFee()
| 29.888889 | 69 | 0.525403 | class hotel():
def calculateFee(self):
"""
This Method calculates cost of hotel room based
on described scenario.
:return:
none.
"""
testCases = int(input("Enter no of test cases:"))
totalCost = 0
while (testCases != 0):
... | 0 | 698 | 23 |
985bde9d000f6e6ceedb6a8dd30d3f11831b4cdb | 497 | py | Python | Python/Shape Constrained risk measures/Prototype code ( not cleaned )/plot.py | MohamedMkaouar/Some_Projects | 8170126dc91f313638595f9f4b81e9ae8b308334 | [
"Apache-2.0"
] | null | null | null | Python/Shape Constrained risk measures/Prototype code ( not cleaned )/plot.py | MohamedMkaouar/Some_Projects | 8170126dc91f313638595f9f4b81e9ae8b308334 | [
"Apache-2.0"
] | null | null | null | Python/Shape Constrained risk measures/Prototype code ( not cleaned )/plot.py | MohamedMkaouar/Some_Projects | 8170126dc91f313638595f9f4b81e9ae8b308334 | [
"Apache-2.0"
] | 1 | 2021-02-02T17:09:04.000Z | 2021-02-02T17:09:04.000Z | test=np.arange(-2,2,0.1)
v1=[]
v2=[]
v3=[]
for i in test:
i=cp.Constant(i)
v1.append(pinball(i,0.2).value)
v2.append(pinball(i,0.5).value)
v3.append(pinball(i,0.8).value)
plt.plot(test,v1,label="$\\tau=0.2$")
plt.plot(test,v2,label="$\\tau=0.5$")
plt.plot(test,v3,label="$\\tau=0.8$")
plt.x... | 23.666667 | 48 | 0.585513 | test=np.arange(-2,2,0.1)
v1=[]
v2=[]
v3=[]
for i in test:
i=cp.Constant(i)
v1.append(pinball(i,0.2).value)
v2.append(pinball(i,0.5).value)
v3.append(pinball(i,0.8).value)
plt.plot(test,v1,label="$\\tau=0.2$")
plt.plot(test,v2,label="$\\tau=0.5$")
plt.plot(test,v3,label="$\\tau=0.8$")
plt.x... | 0 | 0 | 0 |
005b4ddbd559ece75bff42e2ee12e7619e1eb168 | 30,771 | py | Python | venv/lib/python3.8/site-packages/gtfs_kit/routes.py | MaximilianJanetschek/Urban_Intermodal_Transportation | 632caf668636448dc9290d54cf1c7b527c68a957 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/gtfs_kit/routes.py | MaximilianJanetschek/Urban_Intermodal_Transportation | 632caf668636448dc9290d54cf1c7b527c68a957 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/gtfs_kit/routes.py | MaximilianJanetschek/Urban_Intermodal_Transportation | 632caf668636448dc9290d54cf1c7b527c68a957 | [
"MIT"
] | null | null | null | """
Functions about routes.
"""
from collections import OrderedDict
from typing import Optional, Iterable, List, Dict, TYPE_CHECKING
import json
import geopandas as gp
import pandas as pd
import numpy as np
import shapely.geometry as sg
import shapely.ops as so
import folium as fl
from . import constants as cs
from .... | 35.491349 | 99 | 0.624192 | """
Functions about routes.
"""
from collections import OrderedDict
from typing import Optional, Iterable, List, Dict, TYPE_CHECKING
import json
import geopandas as gp
import pandas as pd
import numpy as np
import shapely.geometry as sg
import shapely.ops as so
import folium as fl
from . import constants as cs
from .... | 3,859 | 0 | 137 |
55261d12666c02ea8f67b72d2e1ed2b304a01b9b | 405 | py | Python | instagram_api/response/user_story_feed.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | 13 | 2019-08-07T21:24:34.000Z | 2020-12-12T12:23:50.000Z | instagram_api/response/user_story_feed.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | instagram_api/response/user_story_feed.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | from .mapper import ApiResponse, ApiResponseInterface
from .mapper.types import Timestamp, AnyType
from .model import Broadcast, PostLiveItem, Reel
__all__ = ['UserStoryFeedResponse']
| 25.3125 | 73 | 0.814815 | from .mapper import ApiResponse, ApiResponseInterface
from .mapper.types import Timestamp, AnyType
from .model import Broadcast, PostLiveItem, Reel
__all__ = ['UserStoryFeedResponse']
class UserStoryFeedResponseInterface(ApiResponseInterface):
broadcast: Broadcast
reel: Reel
post_live_item: PostLiveItem
... | 0 | 172 | 46 |
003530ab7e606f4f6731fe033677de163d5cdf63 | 2,640 | py | Python | b_tree/binary_search_tree/sum_of_common_nodes_in_bst.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | null | null | null | b_tree/binary_search_tree/sum_of_common_nodes_in_bst.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | 5 | 2021-03-10T11:49:39.000Z | 2022-02-27T01:35:59.000Z | b_tree/binary_search_tree/sum_of_common_nodes_in_bst.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | null | null | null | # Definition for a binary tree node
# @param A : root node of tree
# @param B : root node of tree
# @return an integer
# tree 1
t5 = TreeNode(5)
t2 = TreeNode(2)
t3 = TreeNode(3)
t5.left = t2
t2.right = t3
t8 = TreeNode(8)
t5.right = t8
t15 = TreeNode(15)
t8.right = t15
t7 = TreeNode(7)
t15.left = t... | 20.787402 | 50 | 0.507197 | # Definition for a binary tree node
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# @param A : root node of tree
# @param B : root node of tree
# @return an integer
def in_order_traversal(self, root):
curren... | 1,055 | -12 | 125 |
2707c7185ae66c32193ea16931b8b78b32de7be0 | 1,039 | py | Python | autonomous-fleet/afm-auction_house/server/migrations/0002_auto_20200622_0946.py | CodexWorks/autonomous-fleet | 26fd71e9b2e6ee1d97e04959c3a31c094fc40bc6 | [
"BSD-3-Clause"
] | null | null | null | autonomous-fleet/afm-auction_house/server/migrations/0002_auto_20200622_0946.py | CodexWorks/autonomous-fleet | 26fd71e9b2e6ee1d97e04959c3a31c094fc40bc6 | [
"BSD-3-Clause"
] | 3 | 2020-05-14T14:30:00.000Z | 2020-06-09T15:03:12.000Z | autonomous-fleet/afm-auction_house/server/migrations/0002_auto_20200622_0946.py | CodexWorks/autonomous-fleet | 26fd71e9b2e6ee1d97e04959c3a31c094fc40bc6 | [
"BSD-3-Clause"
] | 1 | 2020-06-10T09:30:32.000Z | 2020-06-10T09:30:32.000Z | # Generated by Django 3.0.7 on 2020-06-22 06:46
from django.db import migrations, models
| 25.341463 | 74 | 0.533205 | # Generated by Django 3.0.7 on 2020-06-22 06:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('server', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='text',
name='main_title',
),
... | 0 | 925 | 23 |
702293d9777a391ba191cfd89a932a4b0167e14b | 268 | py | Python | BeyondChaos/constants.py | emberling/BeyondChaosRandomizer | 2f69752611e25146a29aef51044d0446d4e80332 | [
"MIT"
] | 1 | 2021-06-15T03:54:53.000Z | 2021-06-15T03:54:53.000Z | BeyondChaos/constants.py | emberling/BeyondChaosRandomizer | 2f69752611e25146a29aef51044d0446d4e80332 | [
"MIT"
] | 1 | 2021-09-13T04:32:43.000Z | 2021-09-13T04:32:43.000Z | BeyondChaos/Constants.py | razzlestorm/BeyondChaosRandomizer | 04a0acdcd9d4c3991a3e42cf1bba4299adda4435 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#plans a lot of the "magic string" text will move into here to make modifying them alot easier on the fly.
UpdateFound = "Applying update..."
UpdateLaunching = "Launching the updater application. This application will now close automatically." | 44.666667 | 106 | 0.776119 | #!/usr/bin/env python3
#plans a lot of the "magic string" text will move into here to make modifying them alot easier on the fly.
UpdateFound = "Applying update..."
UpdateLaunching = "Launching the updater application. This application will now close automatically." | 0 | 0 | 0 |
5028b9618c72260c18e7e30aa727af8e41dfc7a6 | 7,222 | py | Python | app/label_maker/real/generate_labels.py | yuecideng/Misc3D | a4554b171d72e03ac8d03880523934a39a9ff515 | [
"MIT"
] | 13 | 2022-02-09T11:56:20.000Z | 2022-03-31T15:45:04.000Z | app/label_maker/real/generate_labels.py | yuecideng/Misc3D | a4554b171d72e03ac8d03880523934a39a9ff515 | [
"MIT"
] | 7 | 2022-02-26T08:58:43.000Z | 2022-03-29T11:19:05.000Z | app/label_maker/real/generate_labels.py | yuecideng/Misc3D | a4554b171d72e03ac8d03880523934a39a9ff515 | [
"MIT"
] | 5 | 2022-02-16T06:59:00.000Z | 2022-03-31T12:03:11.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import time
import argparse
import os
import cv2
import shutil
import numpy as np
import open3d as o3d
import misc3d as m3d
import json
from utils import Colors, mask_to_bbox, rgbd_to_pointcloud
if __name__ == '__main__':
parser = argparse.ArgumentParser()
p... | 34.721154 | 123 | 0.620742 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import time
import argparse
import os
import cv2
import shutil
import numpy as np
import open3d as o3d
import misc3d as m3d
import json
from utils import Colors, mask_to_bbox, rgbd_to_pointcloud
def remove_and_create_dir(dir_path):
mask_path = os.path.join(dir_path, 'm... | 3,836 | 0 | 161 |
8e134039300d24901c980001289804f5839ff7cf | 20,908 | py | Python | demisto_sdk/commands/doc_reviewer/doc_reviewer.py | SergeBakharev/demisto-sdk | 17d00942a1bd33039a8aba9ddffecfd81008d275 | [
"MIT"
] | null | null | null | demisto_sdk/commands/doc_reviewer/doc_reviewer.py | SergeBakharev/demisto-sdk | 17d00942a1bd33039a8aba9ddffecfd81008d275 | [
"MIT"
] | null | null | null | demisto_sdk/commands/doc_reviewer/doc_reviewer.py | SergeBakharev/demisto-sdk | 17d00942a1bd33039a8aba9ddffecfd81008d275 | [
"MIT"
] | null | null | null | import os
import re
import ssl
import string
import sys
from configparser import ConfigParser
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple
import click
import nltk
from nltk.corpus import brown, webtext
from spellchecker import SpellChecker
from demisto_sdk.commands.common.constants im... | 43.832285 | 131 | 0.626602 | import os
import re
import ssl
import string
import sys
from configparser import ConfigParser
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple
import click
import nltk
from nltk.corpus import brown, webtext
from spellchecker import SpellChecker
from demisto_sdk.commands.common.constants im... | 4,087 | 0 | 134 |
2fc2dadded385489f36ae8202bdaf7d1a553a3eb | 1,435 | py | Python | step by step/Dominant topic.py | YuchenTan777/CCI-S2-Coding-Two-Final | 0f2faacbae741c0809f6de3f8ef2d5c16a009583 | [
"MIT"
] | null | null | null | step by step/Dominant topic.py | YuchenTan777/CCI-S2-Coding-Two-Final | 0f2faacbae741c0809f6de3f8ef2d5c16a009583 | [
"MIT"
] | null | null | null | step by step/Dominant topic.py | YuchenTan777/CCI-S2-Coding-Two-Final | 0f2faacbae741c0809f6de3f8ef2d5c16a009583 | [
"MIT"
] | null | null | null |
df_topic_sents_keywords = format_topics_sentences(ldamodel=lda_model, corpus=corpus, texts=data_ready)
# Format
df_dominant_topic = df_topic_sents_keywords.reset_index()
df_dominant_topic.columns = ['Document_No', 'Dominant_Topic', 'Topic_Perc_Contrib', 'Keywords', 'Text']
df_dominant_topic.head(10)
| 44.84375 | 139 | 0.681533 | def format_topics_sentences(ldamodel=None, corpus=corpus, texts=data):
# Init output
sent_topics_df = pd.DataFrame()
# Get main topic in each document
for i, row_list in enumerate(ldamodel[corpus]):
row = row_list[0] if ldamodel.per_word_topics else row_list
# print(row)
... | 1,109 | 0 | 22 |
31b014feff5c20c649627b27c2443f43f373894c | 410 | py | Python | _init_paths.py | klo9klo9kloi/win_det_heatmaps | fc427bcd593831d627698455b8917eb37add3f6e | [
"MIT"
] | 29 | 2020-07-27T10:49:09.000Z | 2022-03-17T02:15:03.000Z | _init_paths.py | klo9klo9kloi/win_det_heatmaps | fc427bcd593831d627698455b8917eb37add3f6e | [
"MIT"
] | 6 | 2020-09-30T01:51:34.000Z | 2022-01-02T08:00:22.000Z | _init_paths.py | klo9klo9kloi/win_det_heatmaps | fc427bcd593831d627698455b8917eb37add3f6e | [
"MIT"
] | 10 | 2020-07-31T00:43:38.000Z | 2022-03-07T02:45:25.000Z | import os
import sys
this_dir = os.path.dirname(__file__)
add_path(os.path.join(this_dir))
add_path(os.path.join(this_dir, 'common'))
add_path(os.path.join(this_dir, 'common_pytorch'))
print("=================SYS PATH================")
for path in sys.path:
print(path)
print("=================SYS PATH============... | 24.117647 | 50 | 0.595122 | import os
import sys
def add_path(path):
if path not in sys.path:
sys.path.insert(0, path)
this_dir = os.path.dirname(__file__)
add_path(os.path.join(this_dir))
add_path(os.path.join(this_dir, 'common'))
add_path(os.path.join(this_dir, 'common_pytorch'))
print("=================SYS PATH================")... | 60 | 0 | 23 |
22d1d15046cddd021171b44b762d0bc39889be72 | 8,131 | py | Python | stephanie_protocol/step1_template.py | caseystone/ot2-protocols | ca8ae72b5298c8064d91139f266996d0cb4d03cc | [
"MIT"
] | null | null | null | stephanie_protocol/step1_template.py | caseystone/ot2-protocols | ca8ae72b5298c8064d91139f266996d0cb4d03cc | [
"MIT"
] | null | null | null | stephanie_protocol/step1_template.py | caseystone/ot2-protocols | ca8ae72b5298c8064d91139f266996d0cb4d03cc | [
"MIT"
] | null | null | null | ### start
import profile
import sys
import os
import pandas as pd
from opentrons import protocol_api, simulate, execute
import json
import argparse
### end
"""
step1_tepmplate.py
Description: Generates python protocol file that can be uploaded directly to Opentrons app
Usage: python step1_template.py -r <number of... | 34.163866 | 136 | 0.64002 | ### start
import profile
import sys
import os
import pandas as pd
from opentrons import protocol_api, simulate, execute
import json
import argparse
### end
"""
step1_tepmplate.py
Description: Generates python protocol file that can be uploaded directly to Opentrons app
Usage: python step1_template.py -r <number of... | 3,248 | 0 | 46 |
544feca6b337dade97f3293e72f1e900e9812832 | 6,173 | py | Python | ceilometer/tests/db.py | aristanetworks/ceilometer | 8776b137f82f71eef1241bcb1600de10c1f77394 | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/db.py | aristanetworks/ceilometer | 8776b137f82f71eef1241bcb1600de10c1f77394 | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/db.py | aristanetworks/ceilometer | 8776b137f82f71eef1241bcb1600de10c1f77394 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
# Copyright 2013 eNovance
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
# Julien Danjou <julien@danjou.info>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You ... | 32.319372 | 79 | 0.634861 | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
# Copyright 2013 eNovance
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
# Julien Danjou <julien@danjou.info>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You ... | 3,516 | 1,094 | 194 |
44e883ffb62d069e4d49b74203000491b5ab0bb5 | 535 | py | Python | adjacency.py | rikusalminen/trimuncher | bdf534fdf382c750e0ec7a6031433de88014e656 | [
"Zlib"
] | 1 | 2018-11-06T05:11:08.000Z | 2018-11-06T05:11:08.000Z | adjacency.py | rikusalminen/trimuncher | bdf534fdf382c750e0ec7a6031433de88014e656 | [
"Zlib"
] | null | null | null | adjacency.py | rikusalminen/trimuncher | bdf534fdf382c750e0ec7a6031433de88014e656 | [
"Zlib"
] | null | null | null | from winged_edge import winged_edge_lookup
| 44.583333 | 92 | 0.68972 | from winged_edge import winged_edge_lookup
def build_adjacency_triangles(triangles, mapping, reverse_mapping, edges, position_idx = 0):
# TODO: This function shouldn't be hard to modify to handle triangle strips and fans
def adjacent_vertex(a, b):
ap, bp = [reverse_mapping[x][position_idx] for x in [a,... | 469 | 0 | 23 |
6050d946cca8c0645650b5ae57129fc0fbaca682 | 23,113 | py | Python | src/nli/modified_esim_v1_0.py | Derrors/Combine-FEVER-NSMN | e3458ee99f086e3d44c9da3ec3e2885511cd42c2 | [
"MIT"
] | 4 | 2020-10-09T16:46:56.000Z | 2022-01-03T18:42:24.000Z | src/nli/modified_esim_v1_0.py | Frankey419/combine-FEVER-NSMN | 8577ad47092c052d6c0456415cb2eebc2a392984 | [
"MIT"
] | 4 | 2020-11-02T01:00:33.000Z | 2020-11-02T01:07:45.000Z | src/nli/modified_esim_v1_0.py | Frankey419/combine-FEVER-NSMN | 8577ad47092c052d6c0456415cb2eebc2a392984 | [
"MIT"
] | 2 | 2020-12-10T12:50:45.000Z | 2021-03-06T11:26:53.000Z | import torch
from allennlp.data.iterators import BasicIterator
from allennlp.data.token_indexers import SingleIdTokenIndexer, ELMoTokenCharactersIndexer
from allennlp.modules import Embedding, Elmo
from torch import nn
import os
import config
from data_util.data_readers.fever_reader import BasicReader
from data_util.... | 37.76634 | 198 | 0.662008 | import torch
from allennlp.data.iterators import BasicIterator
from allennlp.data.token_indexers import SingleIdTokenIndexer, ELMoTokenCharactersIndexer
from allennlp.modules import Embedding, Elmo
from torch import nn
import os
import config
from data_util.data_readers.fever_reader import BasicReader
from data_util.... | 21,706 | 3 | 467 |
3ccf1d20e9550ceb4e18ff07cf68d4676f4502b9 | 537 | py | Python | educative/course1/arrays/ch3_add_upto_n_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | null | null | null | educative/course1/arrays/ch3_add_upto_n_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | null | null | null | educative/course1/arrays/ch3_add_upto_n_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | 1 | 2019-12-27T01:08:08.000Z | 2019-12-27T01:08:08.000Z | array = [1, 21, 3, 14, 5, 60, 7, 6]
n = 27
result = "[21, 6] or [6, 21]"
# iterate both arrays in a nested loop, check for sum == n, return when pair is found
print("Input: " + "array = " + str(array) + ", " + "n = " + str(n))
print("Expected: " + str(result))
print("Output: " + str(add_upto_n_1(array, n)))
| 22.375 | 85 | 0.510242 | array = [1, 21, 3, 14, 5, 60, 7, 6]
n = 27
result = "[21, 6] or [6, 21]"
# iterate both arrays in a nested loop, check for sum == n, return when pair is found
def add_upto_n_1(arr, n):
output = []
for x in arr:
for y in arr:
if x + y == n:
output.append(x)
... | 201 | 0 | 23 |
90ef0d2c16b49b287d1c5badd6ad2ca0f4bad954 | 7,959 | py | Python | nlp_toolkit/tools/farasa.py | abdelrahman-t/nlp-toolkit | 2617c5c91d369279fe73ea213709a4c29ffc6605 | [
"MIT"
] | 1 | 2019-05-22T12:12:28.000Z | 2019-05-22T12:12:28.000Z | nlp_toolkit/tools/farasa.py | abdelrahman-t/nlp-toolkit | 2617c5c91d369279fe73ea213709a4c29ffc6605 | [
"MIT"
] | null | null | null | nlp_toolkit/tools/farasa.py | abdelrahman-t/nlp-toolkit | 2617c5c91d369279fe73ea213709a4c29ffc6605 | [
"MIT"
] | 1 | 2020-04-04T14:30:29.000Z | 2020-04-04T14:30:29.000Z | """
Pythonic and thread-safe wrapper around Farasa.
Farasa is developed at QCRI and can be found at http://qatsdemo.cloudapp.net/farasa/
Paper can be found at http://www.aclweb.org/anthology/N16-3003
"""
import logging
from collections import defaultdict
from operator import concat, itemgetter
from threading import RL... | 31.963855 | 94 | 0.582108 | """
Pythonic and thread-safe wrapper around Farasa.
Farasa is developed at QCRI and can be found at http://qatsdemo.cloudapp.net/farasa/
Paper can be found at http://www.aclweb.org/anthology/N16-3003
"""
import logging
from collections import defaultdict
from operator import concat, itemgetter
from threading import RL... | 0 | 0 | 0 |
e151479c93a744211f6cfbfa208a26ae6d6d7fb4 | 597 | py | Python | tests/cars.py | ganmodokix/vaetc | 866b79677b4f06603203376d967989dedadbffae | [
"MIT"
] | null | null | null | tests/cars.py | ganmodokix/vaetc | 866b79677b4f06603203376d967989dedadbffae | [
"MIT"
] | null | null | null | tests/cars.py | ganmodokix/vaetc | 866b79677b4f06603203376d967989dedadbffae | [
"MIT"
] | null | null | null | import os, sys
import yaml
import torch
sys.path.append(os.path.dirname(__file__) + '/../')
import vaetc
if __name__ == "__main__":
checkpoint = vaetc.Checkpoint(options={
"model_name": "vae",
"dataset": "cars",
"epochs": 512,
"batch_size": 256,
"logger_path": "runs.test... | 20.586207 | 51 | 0.564489 | import os, sys
import yaml
import torch
sys.path.append(os.path.dirname(__file__) + '/../')
import vaetc
if __name__ == "__main__":
checkpoint = vaetc.Checkpoint(options={
"model_name": "vae",
"dataset": "cars",
"epochs": 512,
"batch_size": 256,
"logger_path": "runs.test... | 0 | 0 | 0 |
15c8c9a3ffaf7fa04e27d51c7f0037d2ac150f9b | 1,224 | py | Python | rex/exploit/shellcodes/linux_amd64_connectback.py | tiedaoxiaotubie/rex | 049bbce3ab2717cbb4d2f0fc10fe8c0433b39c1d | [
"BSD-2-Clause"
] | 1 | 2021-01-22T11:25:40.000Z | 2021-01-22T11:25:40.000Z | rex/exploit/shellcodes/linux_amd64_connectback.py | tiedaoxiaotubie/rex | 049bbce3ab2717cbb4d2f0fc10fe8c0433b39c1d | [
"BSD-2-Clause"
] | null | null | null | rex/exploit/shellcodes/linux_amd64_connectback.py | tiedaoxiaotubie/rex | 049bbce3ab2717cbb4d2f0fc10fe8c0433b39c1d | [
"BSD-2-Clause"
] | 1 | 2020-09-16T07:07:28.000Z | 2020-09-16T07:07:28.000Z | import socket
import struct
import logging
from rex.exploit.shellcode import Shellcode
l = logging.getLogger("rex.exploit.shellcodes.linux_amd64_connectback")
| 33.081081 | 245 | 0.716503 | import socket
import struct
import logging
from rex.exploit.shellcode import Shellcode
l = logging.getLogger("rex.exploit.shellcodes.linux_amd64_connectback")
class LinuxAMD64Connectback(Shellcode):
# TODO: should be 'linux' once CLE can identify linux files
supported_platforms = ["unix"]
arch = "AMD64"... | 0 | 1,041 | 23 |
6fdb2a7342567f7fdb0c92740396a30b4402c9c7 | 100 | py | Python | app/idealers/api/v1/views/__init__.py | leydson-vieira/dealers | 14f2f307f0f4497eec92f65d01ef111b42d528b9 | [
"MIT"
] | null | null | null | app/idealers/api/v1/views/__init__.py | leydson-vieira/dealers | 14f2f307f0f4497eec92f65d01ef111b42d528b9 | [
"MIT"
] | null | null | null | app/idealers/api/v1/views/__init__.py | leydson-vieira/dealers | 14f2f307f0f4497eec92f65d01ef111b42d528b9 | [
"MIT"
] | null | null | null | from .cashback import cashback_view
from .dealers import dealer_view
from .orders import order_view
| 25 | 35 | 0.85 | from .cashback import cashback_view
from .dealers import dealer_view
from .orders import order_view
| 0 | 0 | 0 |
f6c2251d9ad5a3d88156559765bec4c7ee6737d7 | 25,182 | py | Python | gluon/packages/dal/pydal/adapters/mongo.py | crania/dockconfig | ed981b9efefd6de8a00e0ec9d6c2530e1452fd17 | [
"BSD-3-Clause"
] | 2 | 2015-07-05T12:25:08.000Z | 2015-07-05T15:39:32.000Z | gluon/packages/dal/pydal/adapters/mongo.py | crania/dockconfig | ed981b9efefd6de8a00e0ec9d6c2530e1452fd17 | [
"BSD-3-Clause"
] | null | null | null | gluon/packages/dal/pydal/adapters/mongo.py | crania/dockconfig | ed981b9efefd6de8a00e0ec9d6c2530e1452fd17 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import re
from .._globals import IDENTITY
from .._compat import integer_types, basestring
from ..objects import Table, Query, Field, Expression
from ..helpers.classes import SQLALL, Reference
from ..helpers.methods import use_common_filters, xorify
from .base import NoSQLAdapter... | 37.529061 | 80 | 0.560797 | # -*- coding: utf-8 -*-
import datetime
import re
from .._globals import IDENTITY
from .._compat import integer_types, basestring
from ..objects import Table, Query, Field, Expression
from ..helpers.classes import SQLALL, Reference
from ..helpers.methods import use_common_filters, xorify
from .base import NoSQLAdapter... | 19,479 | 5,164 | 72 |
54ed7db99e67625149aca3b5d1418ff1460c4d3f | 279 | py | Python | harness/determined/experimental/__init__.py | brain-good/determined | 4a80514f514b1cc2aa5dcd604e17c18876b3b76e | [
"Apache-2.0"
] | null | null | null | harness/determined/experimental/__init__.py | brain-good/determined | 4a80514f514b1cc2aa5dcd604e17c18876b3b76e | [
"Apache-2.0"
] | null | null | null | harness/determined/experimental/__init__.py | brain-good/determined | 4a80514f514b1cc2aa5dcd604e17c18876b3b76e | [
"Apache-2.0"
] | null | null | null | from determined_common.experimental import (
Checkpoint,
Determined,
ExperimentReference,
TrialReference,
)
from determined.experimental._native import (
create,
create_trial_instance,
test_one_batch,
init_native,
_local_execution_manager,
)
| 18.6 | 45 | 0.741935 | from determined_common.experimental import (
Checkpoint,
Determined,
ExperimentReference,
TrialReference,
)
from determined.experimental._native import (
create,
create_trial_instance,
test_one_batch,
init_native,
_local_execution_manager,
)
| 0 | 0 | 0 |
751978667c9b933dfa751e93be53aa234dc1a2f2 | 897 | py | Python | ogs5py/fileclasses/asc/core.py | MuellerSeb/ogs5py | 752e7bd2298fbd476406d168f6b7d1a85863dccd | [
"MIT"
] | 3 | 2018-05-27T15:39:07.000Z | 2018-10-29T17:02:11.000Z | ogs5py/fileclasses/asc/core.py | MuellerSeb/ogs5py | 752e7bd2298fbd476406d168f6b7d1a85863dccd | [
"MIT"
] | 1 | 2018-11-12T11:32:12.000Z | 2018-11-12T13:07:48.000Z | ogs5py/fileclasses/asc/core.py | MuellerSeb/ogs5py | 752e7bd2298fbd476406d168f6b7d1a85863dccd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Class for the ogs ASC file."""
from ogs5py.fileclasses.base import LineFile
class ASC(LineFile):
"""
Class for the ogs ASC file.
Parameters
----------
lines : list of str, optional
content of the file as a list of lines
Default: None
name : str, opti... | 23.605263 | 77 | 0.595318 | # -*- coding: utf-8 -*-
"""Class for the ogs ASC file."""
from ogs5py.fileclasses.base import LineFile
class ASC(LineFile):
"""
Class for the ogs ASC file.
Parameters
----------
lines : list of str, optional
content of the file as a list of lines
Default: None
name : str, opti... | 82 | 0 | 27 |
d2ba4b0ec04f23a3715468b1721b22e8bd62bf9f | 4,361 | py | Python | Newcastle University/FewCloudComputing/Load.py | haoranD/Postgraduate-Master | b297211eeb20e3dc5535fefc84e1e0c2b71ddaa3 | [
"MIT"
] | null | null | null | Newcastle University/FewCloudComputing/Load.py | haoranD/Postgraduate-Master | b297211eeb20e3dc5535fefc84e1e0c2b71ddaa3 | [
"MIT"
] | null | null | null | Newcastle University/FewCloudComputing/Load.py | haoranD/Postgraduate-Master | b297211eeb20e3dc5535fefc84e1e0c2b71ddaa3 | [
"MIT"
] | 1 | 2019-12-08T03:14:15.000Z | 2019-12-08T03:14:15.000Z | import sys
import numpy
import time
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import urllib
import csv
import time
#Generate a list of random number from Normal distribution
#Generate a list of random number from Poisson distribution
# Visualize the number we generated
#Connect... | 39.645455 | 90 | 0.575327 | import sys
import numpy
import time
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import urllib
import csv
import time
#Generate a list of random number from Normal distribution
def gettimelistbyN(para1, para2, size):
timelistN = numpy.random.normal(loc=para1, scale=para2, size=size)
... | 2,124 | 0 | 92 |
1ebb0e2aefaa78274c44b66323485a579a2f7e3a | 3,675 | py | Python | src/python/nimbusml/examples/EnsembleClassifier.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 134 | 2018-11-01T22:15:24.000Z | 2019-05-04T11:30:08.000Z | src/python/nimbusml/examples/EnsembleClassifier.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 226 | 2019-05-07T19:00:44.000Z | 2021-01-06T07:59:48.000Z | src/python/nimbusml/examples/EnsembleClassifier.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 43 | 2019-05-15T20:19:42.000Z | 2022-03-30T10:26:07.000Z | ###############################################################################
# EnsembleClassifier
from nimbusml import Pipeline, FileDataStream
from nimbusml.datasets import get_dataset
from nimbusml.feature_extraction.categorical import OneHotVectorizer
from nimbusml.ensemble import EnsembleClassifier
from nimbusml... | 43.235294 | 86 | 0.578503 | ###############################################################################
# EnsembleClassifier
from nimbusml import Pipeline, FileDataStream
from nimbusml.datasets import get_dataset
from nimbusml.feature_extraction.categorical import OneHotVectorizer
from nimbusml.ensemble import EnsembleClassifier
from nimbusml... | 0 | 0 | 0 |
c50880c9f81ec471512cd26e3870a7cb328aba45 | 2,365 | py | Python | lte/gateway/python/integ_tests/s1aptests/test_s1setup_incorrect_plmn.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | 2 | 2020-12-09T11:42:30.000Z | 2021-09-26T03:28:33.000Z | lte/gateway/python/integ_tests/s1aptests/test_s1setup_incorrect_plmn.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | 151 | 2020-09-03T20:44:13.000Z | 2022-03-31T20:28:52.000Z | lte/gateway/python/integ_tests/s1aptests/test_s1setup_incorrect_plmn.py | kkahrs/magma | 73e666627dc28e0c492feab7321bb7d6dd433b09 | [
"BSD-3-Clause"
] | 2 | 2021-05-27T18:15:16.000Z | 2021-05-27T18:41:39.000Z | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 36.953125 | 78 | 0.668922 | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 200 | 1,513 | 23 |
ec7e896333522e77965ed3aa0a3b8527b6fb7d82 | 2,714 | py | Python | api/views/estate.py | sirghiny/Real-Estate-Manager | 10272feec22c40da7f927219225b8d2e27a20e38 | [
"MIT"
] | null | null | null | api/views/estate.py | sirghiny/Real-Estate-Manager | 10272feec22c40da7f927219225b8d2e27a20e38 | [
"MIT"
] | 1 | 2018-05-09T13:17:41.000Z | 2018-05-09T13:17:41.000Z | api/views/estate.py | sirghiny/Real-Estate-Manager | 10272feec22c40da7f927219225b8d2e27a20e38 | [
"MIT"
] | 2 | 2018-05-01T15:03:13.000Z | 2019-10-28T13:59:29.000Z | """Estate manipulation functionality."""
from flask import request
from flask_restful import Resource
from api.helpers.modelops import get_boards, get_estates
from api.helpers.validation import validate_json
from api.models import Estate
class EstateResource(Resource):
"""View functions for estates."""
def... | 30.155556 | 74 | 0.517686 | """Estate manipulation functionality."""
from flask import request
from flask_restful import Resource
from api.helpers.modelops import get_boards, get_estates
from api.helpers.validation import validate_json
from api.models import Estate
class EstateResource(Resource):
"""View functions for estates."""
def... | 0 | 0 | 0 |
fed235140b76762ddbbdc8dc73d0f0099b3df56a | 1,119 | py | Python | proto_1/ddq/topics/set_theory/topic.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | null | null | null | proto_1/ddq/topics/set_theory/topic.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | 6 | 2021-03-19T12:06:56.000Z | 2022-03-12T00:23:09.000Z | proto_1/ddq/topics/set_theory/topic.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | null | null | null | from typing import List
from ddq.universe import Universe
from ddq.builder import Builder
from ddq.topic import Topic, Predicate, Constant, Axiom, Definition
from ddq.topic import Topic as BaseTopic
from .membership import Membership
from .empty_set import EmptySetConstant, EmptySetAxiom
from .non_membership import Non... | 30.243243 | 67 | 0.710456 | from typing import List
from ddq.universe import Universe
from ddq.builder import Builder
from ddq.topic import Topic, Predicate, Constant, Axiom, Definition
from ddq.topic import Topic as BaseTopic
from .membership import Membership
from .empty_set import EmptySetConstant, EmptySetAxiom
from .non_membership import Non... | 559 | 11 | 207 |
ef257b6c367a828748bef558db92abca08e69c06 | 326 | py | Python | locustfile.py | vandmo/threlos-spring-example-1 | f95771c5936189b7b966c6baf42595e30fb45c75 | [
"Apache-2.0"
] | null | null | null | locustfile.py | vandmo/threlos-spring-example-1 | f95771c5936189b7b966c6baf42595e30fb45c75 | [
"Apache-2.0"
] | null | null | null | locustfile.py | vandmo/threlos-spring-example-1 | f95771c5936189b7b966c6baf42595e30fb45c75 | [
"Apache-2.0"
] | null | null | null | import random
from locust import HttpUser, task, between
| 19.176471 | 52 | 0.619632 | import random
from locust import HttpUser, task, between
def randomUser():
return random.choice([
('admin', 'verysecret'),
('normaluser', 'secret'),
])
class QuickstartUser(HttpUser):
wait_time = between(5, 9)
@task
def hello(self):
self.client.get("/hello", auth=randomUse... | 145 | 77 | 46 |
5ae4dfd0e7e700b5e5ca748a5ebfbe8d81ff66ab | 1,192 | py | Python | ensemble.py | piotrmirowski/DependencyTreeRnn | 8211a4ff4d0708dab83079295f9b768ebaeae68a | [
"BSD-3-Clause"
] | 39 | 2015-07-07T06:17:06.000Z | 2021-05-02T23:14:41.000Z | ensemble.py | zjh-nudger/DependencyRNN | c48c25c153551f340de704edf35b8831eab6e7a2 | [
"BSD-3-Clause"
] | 3 | 2016-06-21T02:58:04.000Z | 2016-07-05T17:27:55.000Z | ensemble.py | zjh-nudger/DependencyRNN | c48c25c153551f340de704edf35b8831eab6e7a2 | [
"BSD-3-Clause"
] | 11 | 2015-07-07T17:43:30.000Z | 2019-09-18T03:39:52.000Z | # first arg gold, following ones files with scores to ensemble
import sys
goldFile = sys.argv[1]
answers = []
for line in open(goldFile).readlines():
answers.append(int(line.strip()))
print "loaded " + str(len(answers)) + " answers"
# an array with an array per model to be ensebled
individualSentencePredictio... | 23.84 | 62 | 0.661074 | # first arg gold, following ones files with scores to ensemble
import sys
goldFile = sys.argv[1]
answers = []
for line in open(goldFile).readlines():
answers.append(int(line.strip()))
print "loaded " + str(len(answers)) + " answers"
# an array with an array per model to be ensebled
individualSentencePredictio... | 0 | 0 | 0 |
444c86d26250a7f57c0ea4bb01d3e3286fcbf2ee | 54,114 | py | Python | animation/face_editor.py | jzboylxj/XDLibs | 76ab640502d7e254bc98930d6ebb9e870476ed9a | [
"MIT"
] | 1 | 2021-03-11T02:24:08.000Z | 2021-03-11T02:24:08.000Z | animation/face_editor.py | jzboylxj/XDLibs | 76ab640502d7e254bc98930d6ebb9e870476ed9a | [
"MIT"
] | null | null | null | animation/face_editor.py | jzboylxj/XDLibs | 76ab640502d7e254bc98930d6ebb9e870476ed9a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# @Time : 2020/9/7 9:39
# @Author : Li XiaoJun
# @Site :
# @File : face_editor.py
import json
import os
from imp import reload
from animation import common
from animation import test_node
from animation.helper import manager_version
from pymel import core as pm
reload(... | 38.460554 | 89 | 0.533023 | #!/usr/bin/env python
# coding: utf-8
# @Time : 2020/9/7 9:39
# @Author : Li XiaoJun
# @Site :
# @File : face_editor.py
import json
import os
from imp import reload
from animation import common
from animation import test_node
from animation.helper import manager_version
from pymel import core as pm
reload(... | 24,588 | -10 | 715 |
718fa4fe50d6852876511690c70b17f636bd0209 | 10,738 | py | Python | gibson2/utils/assets_utils.py | dnandha/iGibson | bbd8c294aad1ddffce868244a474dd40c2976590 | [
"MIT"
] | 3 | 2021-02-07T14:00:38.000Z | 2021-07-03T19:40:59.000Z | gibson2/utils/assets_utils.py | dnandha/iGibson | bbd8c294aad1ddffce868244a474dd40c2976590 | [
"MIT"
] | null | null | null | gibson2/utils/assets_utils.py | dnandha/iGibson | bbd8c294aad1ddffce868244a474dd40c2976590 | [
"MIT"
] | 2 | 2021-04-01T12:14:59.000Z | 2021-06-18T13:04:39.000Z | import gibson2
import os
import argparse
import random
import subprocess
import json
from collections import defaultdict
import yaml
def get_ig_category_ids():
"""
Get iGibson object categories
:return: file path to the scene name
"""
ig_dataset_path = gibson2.ig_dataset_path
ig_categories_fi... | 36.033557 | 145 | 0.655336 | import gibson2
import os
import argparse
import random
import subprocess
import json
from collections import defaultdict
import yaml
def get_ig_category_ids():
"""
Get iGibson object categories
:return: file path to the scene name
"""
ig_dataset_path = gibson2.ig_dataset_path
ig_categories_fi... | 1,696 | 0 | 46 |
98b43896db4a9743c1b1d21ae5bcb6569ad055c4 | 2,797 | py | Python | satori/tests/test_common_templating.py | mgeisler/satori | dea382bae1cd043189589c0f7d4c20b4b6725ab5 | [
"Apache-2.0"
] | 1 | 2015-01-18T19:56:28.000Z | 2015-01-18T19:56:28.000Z | satori/tests/test_common_templating.py | samstav/satori | 239fa1e3c7aac78599145c670576f0ac76a41a89 | [
"Apache-2.0"
] | null | null | null | satori/tests/test_common_templating.py | samstav/satori | 239fa1e3c7aac78599145c670576f0ac76a41a89 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=C0103,R0904
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 34.9625 | 77 | 0.648552 | # pylint: disable=C0103,R0904
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 0 | 0 | 0 |
03e934b55fee6d774e434334e745d004e74e3130 | 4,638 | py | Python | finetune/lm_entailment.py | johndpope/finetune | 8cdc2a29104f3f2f6e032a9496b3c4e251ac028c | [
"MIT"
] | null | null | null | finetune/lm_entailment.py | johndpope/finetune | 8cdc2a29104f3f2f6e032a9496b3c4e251ac028c | [
"MIT"
] | null | null | null | finetune/lm_entailment.py | johndpope/finetune | 8cdc2a29104f3f2f6e032a9496b3c4e251ac028c | [
"MIT"
] | null | null | null | import json
from sklearn.model_selection import train_test_split
from finetune.config import BATCH_SIZE
from finetune.lm_base import LanguageModelBase
from finetune.target_encoders import OrdinalClassificationEncoder
if __name__ == "__main__":
with open("data/questions.json", "rt") as fp:
data = json.... | 42.163636 | 117 | 0.689521 | import json
from sklearn.model_selection import train_test_split
from finetune.config import BATCH_SIZE
from finetune.lm_base import LanguageModelBase
from finetune.target_encoders import OrdinalClassificationEncoder
class LanguageModelEntailment(LanguageModelBase):
def get_target_encoder(self):
return... | 383 | 2,977 | 23 |
ec8065188243aed314b8d7196f0b5047cc870aa9 | 1,543 | py | Python | bayesrl/environments/chainworld.py | OlehLuk/bayesrl | ceaee729e93254f8209738274e724afd463c994e | [
"MIT"
] | null | null | null | bayesrl/environments/chainworld.py | OlehLuk/bayesrl | ceaee729e93254f8209738274e724afd463c994e | [
"MIT"
] | null | null | null | bayesrl/environments/chainworld.py | OlehLuk/bayesrl | ceaee729e93254f8209738274e724afd463c994e | [
"MIT"
] | null | null | null | from ..utils import check_random_state
| 29.673077 | 88 | 0.593649 | from ..utils import check_random_state
class ChainWorld(object):
def __init__(self,
left_length,
left_reward,
right_length,
right_reward,
on_chain_reward,
p_return_to_start,
random_state=None):
... | 1,315 | 4 | 184 |
e543001c6dbbf7c0f14676334e540a1dbbbed706 | 4,780 | py | Python | backend.py | MahatKC/expertsystemassignment | 4db94390c9b7651d46b6a6e6a69c35e93aafcf31 | [
"MIT"
] | null | null | null | backend.py | MahatKC/expertsystemassignment | 4db94390c9b7651d46b6a6e6a69c35e93aafcf31 | [
"MIT"
] | null | null | null | backend.py | MahatKC/expertsystemassignment | 4db94390c9b7651d46b6a6e6a69c35e93aafcf31 | [
"MIT"
] | null | null | null | #trabalho por Leonardo Vanzin, Mateus Karvat e Roberta Aparecida
#inicialmente, são importadas as bibliotecas necessárias
from experta import *
import interface
valores_convertidos = {
'proximidadeMar': float(interface.valores['proximidadeMar']),
'desnivel': float(interface.valores['desnivel']),
'velocida... | 45.961538 | 127 | 0.722803 | #trabalho por Leonardo Vanzin, Mateus Karvat e Roberta Aparecida
#inicialmente, são importadas as bibliotecas necessárias
from experta import *
import interface
valores_convertidos = {
'proximidadeMar': float(interface.valores['proximidadeMar']),
'desnivel': float(interface.valores['desnivel']),
'velocida... | 374 | 2,424 | 136 |
880bad578d9944f1ec06e580824fc923f1978b8e | 2,886 | py | Python | main.py | warifp/InstagramPostAndDelete | d22577325eccf42e629cef076ab43f7788587bc4 | [
"MIT"
] | 4 | 2019-06-03T04:00:51.000Z | 2021-11-09T21:34:38.000Z | main.py | nittaya1990/InstagramPostAndDelete | d22577325eccf42e629cef076ab43f7788587bc4 | [
"MIT"
] | null | null | null | main.py | nittaya1990/InstagramPostAndDelete | d22577325eccf42e629cef076ab43f7788587bc4 | [
"MIT"
] | 4 | 2019-10-30T19:44:08.000Z | 2021-09-07T16:30:09.000Z | #! @@Author : WAHYU ARIF PURNOMO
#! @@Create : 18 Januari 2019
#! @@Modify : 19 Januari 2019
#! Gambar dari reddit.
#! Gunakan VPN karena DNS situs reddit sudah di blokir dari negara Indonesia.
import os
import json
import requests
import progressbar
from PIL import Image
from lxml import html
from time import sleep
f... | 28.574257 | 125 | 0.615731 | #! @@Author : WAHYU ARIF PURNOMO
#! @@Create : 18 Januari 2019
#! @@Modify : 19 Januari 2019
#! Gambar dari reddit.
#! Gunakan VPN karena DNS situs reddit sudah di blokir dari negara Indonesia.
import os
import json
import requests
import progressbar
from PIL import Image
from lxml import html
from time import sleep
f... | 1,986 | 0 | 115 |
66a485d2b69e5ed6b33aeebb70db814ec8baae6b | 3,101 | py | Python | examples/simple/simple_ep.py | thomashopkins32/LEAP | aafada03a261543f35ebfbb9b1ef7140cb079f6c | [
"AFL-3.0"
] | 53 | 2018-10-04T18:01:22.000Z | 2022-03-24T05:24:37.000Z | examples/simple/simple_ep.py | thomashopkins32/LEAP | aafada03a261543f35ebfbb9b1ef7140cb079f6c | [
"AFL-3.0"
] | 180 | 2018-10-11T21:36:57.000Z | 2022-03-25T17:38:33.000Z | examples/simple/simple_ep.py | thomashopkins32/LEAP | aafada03a261543f35ebfbb9b1ef7140cb079f6c | [
"AFL-3.0"
] | 8 | 2019-09-27T23:11:26.000Z | 2021-09-29T21:15:35.000Z | #!/usr/bin/env python3
"""
This implements a simple Evolutionary Programming (EP) system, but it
does not evolve state machines as done with the original EP approach.
TODO convert to a state machines problem
"""
import os
from toolz import pipe
from leap_ec import Individual, context, test_env_var
from ... | 37.361446 | 85 | 0.6198 | #!/usr/bin/env python3
"""
This implements a simple Evolutionary Programming (EP) system, but it
does not evolve state machines as done with the original EP approach.
TODO convert to a state machines problem
"""
import os
from toolz import pipe
from leap_ec import Individual, context, test_env_var
from ... | 0 | 0 | 0 |
3274152719814b53020602fee540527b2afc4a45 | 481 | py | Python | intervention_herd/intervention_herd/make_rand_pop.py | molkjar/bachelor | a0591691b820c6c8a45d16f8d55f3a7e80ea384b | [
"MIT"
] | null | null | null | intervention_herd/intervention_herd/make_rand_pop.py | molkjar/bachelor | a0591691b820c6c8a45d16f8d55f3a7e80ea384b | [
"MIT"
] | null | null | null | intervention_herd/intervention_herd/make_rand_pop.py | molkjar/bachelor | a0591691b820c6c8a45d16f8d55f3a7e80ea384b | [
"MIT"
] | null | null | null | import covasim as cv
import pandas as pd
import sciris as sc
import numpy as np
import population_random as pr
if __name__ == '__main__':
#Without dispersion
cv.set_seed(1)
people = pr.generate_people(n_people=200e3, n_contacts=20, dispersion=None)
sc.saveobj('randppl.pop', people)
# With disper... | 21.863636 | 82 | 0.721414 | import covasim as cv
import pandas as pd
import sciris as sc
import numpy as np
import population_random as pr
if __name__ == '__main__':
#Without dispersion
cv.set_seed(1)
people = pr.generate_people(n_people=200e3, n_contacts=20, dispersion=None)
sc.saveobj('randppl.pop', people)
# With disper... | 0 | 0 | 0 |
0321cbc0cd8aae6294dc88fca152c51fa61272fc | 978 | py | Python | LeetCode/069 Sqrt(x).py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | LeetCode/069 Sqrt(x).py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | LeetCode/069 Sqrt(x).py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | # Math; Binary Search
# Implement int sqrt(int x).
#
# Compute and return the square root of x, where x is guaranteed to be a non-negative integer.
#
# Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned.
#
# Example 1:
#
# Input: 4
# Output: 2
# Ex... | 25.736842 | 124 | 0.52863 | # Math; Binary Search
# Implement int sqrt(int x).
#
# Compute and return the square root of x, where x is guaranteed to be a non-negative integer.
#
# Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned.
#
# Example 1:
#
# Input: 4
# Output: 2
# Ex... | 0 | 480 | 22 |
c78ae29735b85b179be5cc23fb9f757749681fab | 1,645 | py | Python | compilador.py | RevertonLuis/NavierStokesSpaceTimeParallelProjectionMethod | 23fbf3b01a34c244d8928fae4ad9d12bffef8d07 | [
"MIT"
] | 1 | 2021-03-02T16:28:12.000Z | 2021-03-02T16:28:12.000Z | compilador.py | RevertonLuis/NavierStokesSpaceTimeParallelProjectionMethod | 23fbf3b01a34c244d8928fae4ad9d12bffef8d07 | [
"MIT"
] | null | null | null | compilador.py | RevertonLuis/NavierStokesSpaceTimeParallelProjectionMethod | 23fbf3b01a34c244d8928fae4ad9d12bffef8d07 | [
"MIT"
] | null | null | null | import os
import subprocess
import sys
fontes = ["funcoes_abstratas.f90",
"funcoes_alias.f90",
'matriz_A.f90',
'gs.f90',
'extrapolacoes_de_u_e_v.f90',
'fontes_subrotinas.f90',
'class_array_subrotinas.f90',
'residuo.f90',
'variaveis_solvers... | 22.22973 | 44 | 0.606687 | import os
import subprocess
import sys
fontes = ["funcoes_abstratas.f90",
"funcoes_alias.f90",
'matriz_A.f90',
'gs.f90',
'extrapolacoes_de_u_e_v.f90',
'fontes_subrotinas.f90',
'class_array_subrotinas.f90',
'residuo.f90',
'variaveis_solvers... | 0 | 0 | 0 |
486c6736e43246d360dbfa3421cf92c6a8d90770 | 8,057 | py | Python | s3splitmerge/tests/run.py | MacHu-GWU/s3splitmerge-project | 873892158f4a2d0ee20f291e5d3b2a80f0bae1ba | [
"MIT"
] | null | null | null | s3splitmerge/tests/run.py | MacHu-GWU/s3splitmerge-project | 873892158f4a2d0ee20f291e5d3b2a80f0bae1ba | [
"MIT"
] | null | null | null | s3splitmerge/tests/run.py | MacHu-GWU/s3splitmerge-project | 873892158f4a2d0ee20f291e5d3b2a80f0bae1ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import typing
import awswrangler as wr
from .data import (
create_s3_csv_file,
create_s3_json_file,
create_many_parquet_file,
create_many_json_file,
)
from ..merge import (
merge_parquet_by_prefix,
merge_json_by_prefix,
)
from ..helpers import (
is_s3_object_exists,
... | 31.84585 | 93 | 0.601092 | # -*- coding: utf-8 -*-
import typing
import awswrangler as wr
from .data import (
create_s3_csv_file,
create_s3_json_file,
create_many_parquet_file,
create_many_json_file,
)
from ..merge import (
merge_parquet_by_prefix,
merge_json_by_prefix,
)
from ..helpers import (
is_s3_object_exists,
... | 3,594 | 0 | 46 |
1a0d56e351e57ca087fab587b737387fabc26c12 | 12,731 | py | Python | pymilvus_orm/utility.py | scipe/pymilvus-orm | cdcf5b7c99430d9c7e6da16556964323cdb58e80 | [
"Apache-2.0"
] | null | null | null | pymilvus_orm/utility.py | scipe/pymilvus-orm | cdcf5b7c99430d9c7e6da16556964323cdb58e80 | [
"Apache-2.0"
] | null | null | null | pymilvus_orm/utility.py | scipe/pymilvus-orm | cdcf5b7c99430d9c7e6da16556964323cdb58e80 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019-2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 48.406844 | 139 | 0.684392 | # Copyright (C) 2019-2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 153 | 0 | 23 |
b656d4ba8b1282042b0f0afbfafd94533471b4d7 | 293 | py | Python | 04_devops/02_unittest/mock/file_util.py | bluehenry/python.best.practices | 99fde3557b0c423d3050e988e82a641ccd75b644 | [
"MIT"
] | null | null | null | 04_devops/02_unittest/mock/file_util.py | bluehenry/python.best.practices | 99fde3557b0c423d3050e988e82a641ccd75b644 | [
"MIT"
] | null | null | null | 04_devops/02_unittest/mock/file_util.py | bluehenry/python.best.practices | 99fde3557b0c423d3050e988e82a641ccd75b644 | [
"MIT"
] | null | null | null | import json
from collections import OrderedDict
from pandas.io.json import json_normalize
| 26.636364 | 73 | 0.795222 | import json
from collections import OrderedDict
from pandas.io.json import json_normalize
def get_data_frame_from_json_file(json_file_path):
with open(json_file_path) as f:
json_object = json.loads(f.read(), object_pairs_hook=OrderedDict)
return json_normalize(json_object)
| 178 | 0 | 23 |
a3d9228044efb6c05033803e028e1c86272deb18 | 3,595 | py | Python | pyocd/rtos/provider.py | majorlin/pyOCD | 62dbca36645a72152f0fb9049e5d46070f8b66b7 | [
"Apache-2.0"
] | 1 | 2022-02-13T13:47:49.000Z | 2022-02-13T13:47:49.000Z | pyocd/rtos/provider.py | majorlin/pyOCD | 62dbca36645a72152f0fb9049e5d46070f8b66b7 | [
"Apache-2.0"
] | null | null | null | pyocd/rtos/provider.py | majorlin/pyOCD | 62dbca36645a72152f0fb9049e5d46070f8b66b7 | [
"Apache-2.0"
] | null | null | null | # pyOCD debugger
# Copyright (c) 2016 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
# ... | 28.991935 | 100 | 0.667038 | # pyOCD debugger
# Copyright (c) 2016 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
# ... | 1,541 | 0 | 504 |
4aef6a340594c5e0b0940fd61bf81cef75f15b6f | 2,822 | py | Python | workflow/jena_functions.py | ChalkLab/SciFlow | 5bf021007d6184402ebfe6cefc2111d99160cb69 | [
"MIT"
] | null | null | null | workflow/jena_functions.py | ChalkLab/SciFlow | 5bf021007d6184402ebfe6cefc2111d99160cb69 | [
"MIT"
] | null | null | null | workflow/jena_functions.py | ChalkLab/SciFlow | 5bf021007d6184402ebfe6cefc2111d99160cb69 | [
"MIT"
] | null | null | null | import requests
import urllib3
from sciflow import localsettings
path = "http://jena1.unfcsd.unf.edu:3030/"
dset = "SciData"
hdrs = {'Content-Type': 'application/json'}
hdrsld = {'Content-Type': 'application/ld+json'}
fpath = localsettings.ppath + "/static/files/"
def server():
"""get the server info from the f... | 32.068182 | 114 | 0.634656 | import requests
import urllib3
from sciflow import localsettings
path = "http://jena1.unfcsd.unf.edu:3030/"
dset = "SciData"
hdrs = {'Content-Type': 'application/json'}
hdrsld = {'Content-Type': 'application/ld+json'}
fpath = localsettings.ppath + "/static/files/"
def server():
"""get the server info from the f... | 0 | 0 | 0 |
d16129aa31fa37f2f468978bdec0a57ead1ab1be | 678 | py | Python | add_categories.py | 1dot75cm/taobaobao | bce05319b57f6737a249945a75a99e09125734c3 | [
"MIT"
] | 14 | 2017-03-29T11:03:39.000Z | 2020-06-29T14:06:13.000Z | add_categories.py | 1dot75cm/taobaobao | bce05319b57f6737a249945a75a99e09125734c3 | [
"MIT"
] | 1 | 2017-12-19T09:50:30.000Z | 2017-12-19T09:50:30.000Z | add_categories.py | 1dot75cm/taobaobao | bce05319b57f6737a249945a75a99e09125734c3 | [
"MIT"
] | 4 | 2017-05-24T08:03:00.000Z | 2019-04-19T13:33:02.000Z | # -*- coding: utf-8 -*-
import pymongo
import json
if __name__ in '__main__':
main()
| 24.214286 | 65 | 0.575221 | # -*- coding: utf-8 -*-
import pymongo
import json
def main():
conn = pymongo.MongoClient('127.0.0.1', 27017)
db = conn['taobao']
goods_coll = db['goods']
cate_coll = db['categories']
print('Reading categories.')
cate = set()
for i in goods_coll.find():
cate.add(json.dumps(i['categ... | 565 | 0 | 23 |
76d56251ad43eae7317b80963b63d36463f6e5d2 | 5,977 | py | Python | populate_10_day_data.py | willBear/Insider_Monitor | 14eac71a9769ed95f7c8500fd4c6b9dfbf7ca88e | [
"MIT"
] | null | null | null | populate_10_day_data.py | willBear/Insider_Monitor | 14eac71a9769ed95f7c8500fd4c6b9dfbf7ca88e | [
"MIT"
] | null | null | null | populate_10_day_data.py | willBear/Insider_Monitor | 14eac71a9769ed95f7c8500fd4c6b9dfbf7ca88e | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from datetime import datetime
import time
import requests
from init_database_postgre import load_db_credential_info
from real_time_web_scraper import update_insider_trades, write_to_csv
insider_trades = []
trading_activity = {'B': 'Buy', 'S': 'Sell', 'O': 'Options Excersise'}
def parse_... | 34.75 | 116 | 0.628074 | from bs4 import BeautifulSoup
from datetime import datetime
import time
import requests
from init_database_postgre import load_db_credential_info
from real_time_web_scraper import update_insider_trades, write_to_csv
insider_trades = []
trading_activity = {'B': 'Buy', 'S': 'Sell', 'O': 'Options Excersise'}
def parse_... | 2,710 | 0 | 23 |
b0e8a8b9b6e76ec472f1b2d6bee4fe9b13ed9f73 | 1,989 | py | Python | pmaf/__init__.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | 1 | 2021-07-02T06:24:17.000Z | 2021-07-02T06:24:17.000Z | pmaf/__init__.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T12:02:46.000Z | 2021-06-28T12:02:46.000Z | pmaf/__init__.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | null | null | null | r"""
PhyloMAF (:mod:`pmaf`)
=======================
.. rubric:: Phylogenetic Microbiome Analysis Framework
.. currentmodule:: pmaf
PhyloMAF is a novel comprehensive microbiome data analysis tool based
on Python programming language. With memory efficient and extensible design, PhyloMAF
have wide range of applicatio... | 26.52 | 93 | 0.759175 | r"""
PhyloMAF (:mod:`pmaf`)
=======================
.. rubric:: Phylogenetic Microbiome Analysis Framework
.. currentmodule:: pmaf
PhyloMAF is a novel comprehensive microbiome data analysis tool based
on Python programming language. With memory efficient and extensible design, PhyloMAF
have wide range of applicatio... | 0 | 0 | 0 |
c64732ce1acdb5bd8b363d200430396748a5ed2c | 988 | py | Python | app/megatron/tests/slack_connection_test.py | team-labs/megatron | 24376a0173d654ef5bddb5c6ea3e763697a929bf | [
"MIT"
] | 4 | 2019-03-21T12:22:07.000Z | 2019-07-08T09:36:41.000Z | app/megatron/tests/slack_connection_test.py | team-labs/megatron | 24376a0173d654ef5bddb5c6ea3e763697a929bf | [
"MIT"
] | 17 | 2019-03-29T14:40:40.000Z | 2022-01-05T12:46:05.000Z | app/megatron/tests/slack_connection_test.py | team-labs/megatron | 24376a0173d654ef5bddb5c6ea3e763697a929bf | [
"MIT"
] | 3 | 2019-04-09T16:45:57.000Z | 2020-01-26T18:19:27.000Z | import pytest
from unittest.mock import MagicMock
from megatron.connections import slack
from megatron.tests.factories import factories
pytestmark = pytest.mark.django_db
@pytest.mark.django_db
| 32.933333 | 66 | 0.803644 | import pytest
from unittest.mock import MagicMock
from megatron.connections import slack
from megatron.tests.factories import factories
pytestmark = pytest.mark.django_db
def test_get_user_info():
workspace = factories.CustomerWorkspaceFactory()
connection = slack.SlackConnection(workspace.connection_token)... | 744 | 0 | 45 |
d07e9124fa7e0398e4d8d828555166b929492a62 | 3,878 | py | Python | src/demos/python/irrlicht/demo_IRR_visualize_collision.py | lucasw/chrono | e79d8c761c718ecb4c796725cff37026f357da8c | [
"BSD-3-Clause"
] | null | null | null | src/demos/python/irrlicht/demo_IRR_visualize_collision.py | lucasw/chrono | e79d8c761c718ecb4c796725cff37026f357da8c | [
"BSD-3-Clause"
] | null | null | null | src/demos/python/irrlicht/demo_IRR_visualize_collision.py | lucasw/chrono | e79d8c761c718ecb4c796725cff37026f357da8c | [
"BSD-3-Clause"
] | null | null | null | # =============================================================================
# PROJECT CHRONO - http://projectchrono.org
#
# Copyright (c) 2022 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distr... | 36.242991 | 107 | 0.636668 | # =============================================================================
# PROJECT CHRONO - http://projectchrono.org
#
# Copyright (c) 2022 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distr... | 128 | 27 | 75 |
3c25c23c04fb70e4cb3707a663dadaad60b47e80 | 1,600 | py | Python | src/bot.py | alexthvest/fresco-bot | b22d37bb0ad5975b3fe8268cfe5f8d9d2825c2e9 | [
"MIT"
] | null | null | null | src/bot.py | alexthvest/fresco-bot | b22d37bb0ad5975b3fe8268cfe5f8d9d2825c2e9 | [
"MIT"
] | null | null | null | src/bot.py | alexthvest/fresco-bot | b22d37bb0ad5975b3fe8268cfe5f8d9d2825c2e9 | [
"MIT"
] | null | null | null | import vk_api
import random
from fresko import create_quote_image
from vk_api.utils import get_random_id
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
| 29.090909 | 73 | 0.62625 | import vk_api
import random
from fresko import create_quote_image
from vk_api.utils import get_random_id
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
class FrescoBot:
def __init__(self, token, confirmation_code):
self.__vk_session = vk_api.VkApi(token=token)
self.__vk_api = self.... | 1,279 | -5 | 158 |
cd06d5bedfc6f1dcb68298520f00db8f4bd05de9 | 3,260 | py | Python | AboutWindow.py | tirtharajghosh/Subtitle-Downloader | 50f2eac6d960d2f5cd2769e3a327579abb62ecb5 | [
"MIT"
] | null | null | null | AboutWindow.py | tirtharajghosh/Subtitle-Downloader | 50f2eac6d960d2f5cd2769e3a327579abb62ecb5 | [
"MIT"
] | null | null | null | AboutWindow.py | tirtharajghosh/Subtitle-Downloader | 50f2eac6d960d2f5cd2769e3a327579abb62ecb5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'about.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
| 67.916667 | 330 | 0.692025 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'about.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class About(object):
def setupUi(self, Dialog):
Dialog.setObjectName... | 2,947 | -1 | 76 |
82fa9e18e1b0b25fb23249fe9014e2bb41d7811c | 5,903 | py | Python | ncsnv2/models/__init__.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 12 | 2020-05-23T10:02:12.000Z | 2021-03-25T19:54:00.000Z | ncsnv2/models/__init__.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 6 | 2021-03-19T15:30:28.000Z | 2022-03-12T00:51:16.000Z | ncsnv2/models/__init__.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 4 | 2020-11-04T03:52:45.000Z | 2021-12-28T16:07:08.000Z | import torch
import numpy as np
@torch.no_grad()
@torch.no_grad()
def anneal_Langevin_dynamics_inpainting(x_mod, refer_image, scorenet, sigmas, image_size,
n_steps_each=100, step_lr=0.000008):
"""
Currently only good for 32x32 images. Assuming the right half is missing.... | 43.404412 | 121 | 0.552262 | import torch
import numpy as np
def get_sigmas(config):
if config.model.sigma_dist == 'geometric':
sigmas = torch.tensor(
np.exp(np.linspace(np.log(config.model.sigma_begin), np.log(config.model.sigma_end),
config.model.num_classes))).float().to(config.device)
... | 4,296 | 0 | 67 |
5afb623dd4f4042147e31b2180ef2c02ab6f2fc7 | 885 | py | Python | main.py | pjkostrzewski/kanonierzy | 9b5cc95d5a6ddcb7fc647b16373f54f9c0bca21d | [
"MIT"
] | null | null | null | main.py | pjkostrzewski/kanonierzy | 9b5cc95d5a6ddcb7fc647b16373f54f9c0bca21d | [
"MIT"
] | null | null | null | main.py | pjkostrzewski/kanonierzy | 9b5cc95d5a6ddcb7fc647b16373f54f9c0bca21d | [
"MIT"
] | null | null | null | from scrap.kanonierzy_scraper import KanonierzyScraper
from adapters.article_adapter import ArticleAdapter
from page.article import Article
from engine.chrome_browser import BrowserChrome
from adapters.file_adapter import FileAdapter
FILENAME = "results.json"
if __name__ == '__main__':
articles = get_article... | 28.548387 | 101 | 0.764972 | from scrap.kanonierzy_scraper import KanonierzyScraper
from adapters.article_adapter import ArticleAdapter
from page.article import Article
from engine.chrome_browser import BrowserChrome
from adapters.file_adapter import FileAdapter
FILENAME = "results.json"
def get_articles_from_website():
browser = BrowserC... | 474 | 0 | 46 |
8384dd5ded0186242d11810a5ae349eeec80f730 | 5,896 | py | Python | dataset/shapenet.py | hirotong/NeuralFusion | b83145c79df03857de7e32a2c46302c77635ff98 | [
"MIT"
] | 1 | 2021-09-25T08:19:42.000Z | 2021-09-25T08:19:42.000Z | dataset/shapenet.py | hirotong/NeuralFusion | b83145c79df03857de7e32a2c46302c77635ff98 | [
"MIT"
] | null | null | null | dataset/shapenet.py | hirotong/NeuralFusion | b83145c79df03857de7e32a2c46302c77635ff98 | [
"MIT"
] | null | null | null | '''
Author: Jinguang Tong
Affliction: Australia National University, DATA61 CSIRO
'''
import os
import glob
import numpy as np
from skimage import io
from copy import copy
from graphics import Voxelgrid
from scipy.ndimage.morphology import binary_dilation
from torch.utils.data import Dataset
from utils.data import ad... | 31.195767 | 114 | 0.614315 | '''
Author: Jinguang Tong
Affliction: Australia National University, DATA61 CSIRO
'''
import os
import glob
import numpy as np
from skimage import io
from copy import copy
from graphics import Voxelgrid
from scipy.ndimage.morphology import binary_dilation
from torch.utils.data import Dataset
from utils.data import ad... | 4,906 | 206 | 23 |
d7c34b5cce6b5d68fdee32163b306249e4c320e0 | 2,470 | py | Python | dataLoader.py | deekshacsg/self_driving_car_dc | 36fb643026a6c0e222380a89f0874ca325e55fb5 | [
"MIT"
] | null | null | null | dataLoader.py | deekshacsg/self_driving_car_dc | 36fb643026a6c0e222380a89f0874ca325e55fb5 | [
"MIT"
] | null | null | null | dataLoader.py | deekshacsg/self_driving_car_dc | 36fb643026a6c0e222380a89f0874ca325e55fb5 | [
"MIT"
] | null | null | null | import os
import json
import pickle
import numpy as np
from PIL import Image
from collections import defaultdict
import swiftclient
feature_container_name = 'feature'
angle_container_name = 'angle'
def load_data(img_size, isSwiftEnabled):
"""
Create pickle objects of features and labels
:param img_size... | 30.493827 | 97 | 0.608502 | import os
import json
import pickle
import numpy as np
from PIL import Image
from collections import defaultdict
import swiftclient
feature_container_name = 'feature'
angle_container_name = 'angle'
def get_connection(name, key):
conn = swiftclient.Connection(
user=name,
key=key,
authurl='... | 238 | 0 | 46 |
17e0d16c450ac6b9ea1068936422fbddc9f95db2 | 92 | py | Python | presalytics/lib/plugins/__init__.py | presalytics/python-client | 5d80b78562126feeeb49af4738e2c1aed12dce3a | [
"MIT"
] | 4 | 2020-02-21T16:30:46.000Z | 2021-01-12T12:22:03.000Z | presalytics/lib/plugins/__init__.py | presalytics/python-client | 5d80b78562126feeeb49af4738e2c1aed12dce3a | [
"MIT"
] | 4 | 2019-12-28T19:30:08.000Z | 2020-03-31T19:27:45.000Z | presalytics/lib/plugins/__init__.py | presalytics/python-client | 5d80b78562126feeeb49af4738e2c1aed12dce3a | [
"MIT"
] | null | null | null | """
Library folder for plugins configured from `presalytics.story.outline.Plugin` class
"""
| 23 | 83 | 0.771739 | """
Library folder for plugins configured from `presalytics.story.outline.Plugin` class
"""
| 0 | 0 | 0 |
4ce237325f75cd18007718e718200915fa2bda4b | 1,264 | py | Python | ikaros/0003-longest-substring-without-repeating-characters/longest_substring.py | MerleLiuKun/GoGoGo | 2387d365bf86e53c0866ff03583c375ce0b5deb7 | [
"MIT"
] | 4 | 2020-01-05T07:24:27.000Z | 2020-09-22T00:44:25.000Z | ikaros/0003-longest-substring-without-repeating-characters/longest_substring.py | MerleLiuKun/GoGoGo | 2387d365bf86e53c0866ff03583c375ce0b5deb7 | [
"MIT"
] | null | null | null | ikaros/0003-longest-substring-without-repeating-characters/longest_substring.py | MerleLiuKun/GoGoGo | 2387d365bf86e53c0866ff03583c375ce0b5deb7 | [
"MIT"
] | 2 | 2020-01-06T09:32:35.000Z | 2020-09-22T00:44:36.000Z |
if __name__ == "__main__":
sr = "pwwkew"
so = Solution()
print(so.method2(sr))
| 22.981818 | 57 | 0.438291 | class Solution:
def method1(self, s: str) -> int:
max_length = 0
cur_length = 0
r = []
for val in s:
if val not in r:
cur_length += 1
max_length = max(max_length, cur_length)
r.append(val)
else:
... | 1,074 | -6 | 102 |
a14d84380d3b8f620573bdadf4a2f56bfbdccdb3 | 1,151 | py | Python | jobs/read_noise/v0/producer_read_noise.py | lsst-camera-dh/ts3-analysis | bf3400f286876c5ed4368e2dafe730a8598d0bf7 | [
"BSD-3-Clause-LBNL"
] | null | null | null | jobs/read_noise/v0/producer_read_noise.py | lsst-camera-dh/ts3-analysis | bf3400f286876c5ed4368e2dafe730a8598d0bf7 | [
"BSD-3-Clause-LBNL"
] | null | null | null | jobs/read_noise/v0/producer_read_noise.py | lsst-camera-dh/ts3-analysis | bf3400f286876c5ed4368e2dafe730a8598d0bf7 | [
"BSD-3-Clause-LBNL"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import shutil
import pyfits
import lsst.eotest.image_utils as imutils
import lsst.eotest.sensor as sensorTest
from lcatr.harness.helpers import dependency_glob
bias_files = dependency_glob('*_fe55_bias_*.fits', jobname='ts3_fe55_data')
system_noise_files = dependency_glob('no... | 33.852941 | 80 | 0.76629 | #!/usr/bin/env python
import os
import sys
import shutil
import pyfits
import lsst.eotest.image_utils as imutils
import lsst.eotest.sensor as sensorTest
from lcatr.harness.helpers import dependency_glob
bias_files = dependency_glob('*_fe55_bias_*.fits', jobname='ts3_fe55_data')
system_noise_files = dependency_glob('no... | 0 | 0 | 0 |
e693962e57ac3a4f3ad2e9e6be752f290d8e1b6a | 32,913 | py | Python | .venv/lib/python3.8/site-packages/pandas/tests/groupby/test_function.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 115 | 2020-06-18T15:00:58.000Z | 2022-03-02T10:13:19.000Z | .venv/lib/python3.8/site-packages/pandas/tests/groupby/test_function.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 37 | 2020-10-20T08:30:53.000Z | 2020-12-22T13:15:45.000Z | .venv/lib/python3.8/site-packages/pandas/tests/groupby/test_function.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 60 | 2020-07-22T14:53:10.000Z | 2022-03-23T10:17:59.000Z | import builtins
from io import StringIO
import numpy as np
import pytest
from pandas.errors import UnsupportedFunctionCall
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series, Timestamp, date_range, isna
import pandas._testing as tm
import pandas.core.nanops as nanops
from pandas.util import ... | 31.286122 | 88 | 0.568286 | import builtins
from io import StringIO
import numpy as np
import pytest
from pandas.errors import UnsupportedFunctionCall
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series, Timestamp, date_range, isna
import pandas._testing as tm
import pandas.core.nanops as nanops
from pandas.util import ... | 27,267 | 0 | 864 |
1b4d91fd688cefd8353cdc6165ee82de3e239164 | 3,032 | py | Python | CoREATAC_PredictionTool.py | UcarLab/CoRE-ATAC | 0a6f4c380d9ad0c542aa01368855ba9ebcd4246b | [
"MIT"
] | 7 | 2020-02-20T18:55:09.000Z | 2022-01-06T21:38:38.000Z | CoREATAC_PredictionTool.py | UcarLab/CoRE-ATAC | 0a6f4c380d9ad0c542aa01368855ba9ebcd4246b | [
"MIT"
] | 4 | 2021-07-30T13:23:30.000Z | 2022-03-02T14:41:52.000Z | CoREATAC_PredictionTool.py | UcarLab/CoRE-ATAC | 0a6f4c380d9ad0c542aa01368855ba9ebcd4246b | [
"MIT"
] | null | null | null | from __future__ import print_function
import tensorflow as tf
import keras
from tensorflow.keras.models import load_model
from keras import backend as K
from keras.layers import Input
import numpy as np
import subprocess
from tensorloader import TensorLoader as tl
import matplotlib.pyplot as plt
from matplotlib.backend... | 36.53012 | 133 | 0.742744 | from __future__ import print_function
import tensorflow as tf
import keras
from tensorflow.keras.models import load_model
from keras import backend as K
from keras.layers import Input
import numpy as np
import subprocess
from tensorloader import TensorLoader as tl
import matplotlib.pyplot as plt
from matplotlib.backend... | 1,547 | 0 | 23 |
138350e62c4891a09583d2b849d0df077a842cca | 68 | py | Python | chars/scripts/link.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 27 | 2016-01-13T14:16:13.000Z | 2022-01-03T05:38:44.000Z | chars/scripts/link.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 1 | 2017-04-29T00:51:26.000Z | 2017-04-29T00:54:43.000Z | chars/scripts/link.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 14 | 2016-01-20T21:02:37.000Z | 2020-07-19T05:47:20.000Z | from bge import logic | 13.6 | 21 | 0.705882 | from bge import logic
def main(cont):
own = cont.owner
own.main() | 24 | 0 | 23 |
014facf593970e594a62a84d02b0c51102ebfd0a | 8,303 | py | Python | examples/characterization/wigner-tomography/configuration.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 21 | 2021-05-21T08:23:34.000Z | 2022-03-25T11:30:55.000Z | examples/characterization/wigner-tomography/configuration.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 9 | 2021-05-13T19:56:00.000Z | 2021-12-21T05:11:04.000Z | examples/characterization/wigner-tomography/configuration.py | qua-platform/qua-libs | 805a3b1a69980b939b370b3ba09434bc26dc45ec | [
"BSD-3-Clause"
] | 2 | 2021-06-21T10:56:40.000Z | 2021-12-19T14:21:33.000Z | import numpy as np
import matplotlib.pyplot as plt
#############################
# simulation helpers #
#############################
lo_freq_cavity = 8.0e9
cavity_IF = 180e6
lo_freq_qubit = 7.4e9
qubit_IF = 60e6
lo_freq_rr = 9.3e9
rr_IF = 60e6
readout_len = 380
IF_freq = rr_IF
Td = 200
Ts =... | 29.759857 | 89 | 0.427797 | import numpy as np
import matplotlib.pyplot as plt
#############################
# simulation helpers #
#############################
def gauss(amplitude, mu, sigma, length):
t = np.linspace(-length / 2, length / 2, length)
gauss_wave = amplitude * np.exp(-((t - mu) ** 2) / (2 * sigma ** 2))
... | 853 | 0 | 50 |
0b15d56cbaad2a4b854cb25da85ed580da2ed79c | 3,994 | py | Python | litex/build/efinix/dbparser.py | navan93/litex | 2886fe170160d8481b77a53c11132d881b7bfa48 | [
"ADSL"
] | 1,501 | 2016-04-19T18:16:21.000Z | 2022-03-31T17:46:31.000Z | litex/build/efinix/dbparser.py | enjoy-digital/litex | 8fa4de5ede281f599879c6b1b2cd87b74ac67240 | [
"ADSL"
] | 1,135 | 2016-04-19T05:49:14.000Z | 2022-03-31T15:21:19.000Z | litex/build/efinix/dbparser.py | navan93/litex | 2886fe170160d8481b77a53c11132d881b7bfa48 | [
"ADSL"
] | 357 | 2016-04-19T05:00:24.000Z | 2022-03-31T11:28:32.000Z | #
# This file is part of LiteX.
#
# Copyright (c) 2021 Franck Jullien <franck.jullien@collshade.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import csv
import re
import xml.etree.ElementTree as et
# NameSpaces ---------------------------------------------------------------------------------------
namespace... | 31.698413 | 100 | 0.551077 | #
# This file is part of LiteX.
#
# Copyright (c) 2021 Franck Jullien <franck.jullien@collshade.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import csv
import re
import xml.etree.ElementTree as et
# NameSpaces ---------------------------------------------------------------------------------------
namespace... | 3,165 | 2 | 292 |
f0c04942cd991d526606ad9c0e44cc698dbfb490 | 837 | py | Python | tests/test_regexps.py | Luminaar/cocobump | 5771b0d1bb3be011f9485bc77057c0bc15ce0352 | [
"BSD-3-Clause"
] | null | null | null | tests/test_regexps.py | Luminaar/cocobump | 5771b0d1bb3be011f9485bc77057c0bc15ce0352 | [
"BSD-3-Clause"
] | 3 | 2021-07-20T08:01:36.000Z | 2021-08-01T03:11:32.000Z | tests/test_regexps.py | Luminaar/cocobump | 5771b0d1bb3be011f9485bc77057c0bc15ce0352 | [
"BSD-3-Clause"
] | null | null | null | import re
import pytest
from convbump.regexps import ensure_regexp_dots, to_regexp
@pytest.mark.parametrize(
"value, expected",
(
("one two three", r"one two three"),
("{version}", r"{version}"),
("-{type}.{number}", r"-{type}\.{number}"),
("{type}{number}", r"{type}{number}"... | 26.15625 | 77 | 0.567503 | import re
import pytest
from convbump.regexps import ensure_regexp_dots, to_regexp
@pytest.mark.parametrize(
"value, expected",
(
("one two three", r"one two three"),
("{version}", r"{version}"),
("-{type}.{number}", r"-{type}\.{number}"),
("{type}{number}", r"{type}{number}"... | 128 | 0 | 44 |
2a57be2e3d64e49a08677ee2dad2e7e1738f3265 | 366 | py | Python | CONTENT/PYTHON/LEETCODE/172_factorial_trailing_zeros/factorial_trailing_zeros.py | impastasyndrome/DS-ALGO-OFFICIAL | c85ec9cf0af0009f038b7a571a7ac1fb466b7f3a | [
"Apache-2.0"
] | 13 | 2021-03-11T00:25:22.000Z | 2022-03-19T00:19:23.000Z | CONTENT/PYTHON/LEETCODE/172_factorial_trailing_zeros/factorial_trailing_zeros.py | impastasyndrome/DS-ALGO-OFFICIAL | c85ec9cf0af0009f038b7a571a7ac1fb466b7f3a | [
"Apache-2.0"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | CONTENT/PYTHON/LEETCODE/172_factorial_trailing_zeros/factorial_trailing_zeros.py | impastasyndrome/DS-ALGO-OFFICIAL | c85ec9cf0af0009f038b7a571a7ac1fb466b7f3a | [
"Apache-2.0"
] | 12 | 2021-04-26T19:43:01.000Z | 2022-01-31T08:36:29.000Z | # @param {integer} n
# @return {integer}
| 20.333333 | 32 | 0.393443 | class Solution:
# @param {integer} n
# @return {integer}
def trailingZeroes(self, n):
if n <= 0:
return 0
twos = 0
fives = 0
n2 = n
while n2:
n2 = n2 / 2
twos += n2
n5 = n
while n5:
n5 = n5 / 5
... | 275 | -6 | 48 |
34116009d828dd230bd4ece7f92d1e2518654b63 | 4,717 | py | Python | app/shared_code/imap_sync.py | KubaTaba1uga/spam_recycler | 76056635fdf610c6304e8034a3f66f235761ca76 | [
"MIT"
] | 2 | 2021-12-17T18:12:51.000Z | 2021-12-17T18:12:52.000Z | app/shared_code/imap_sync.py | KubaTaba1uga/spam_recycler | 76056635fdf610c6304e8034a3f66f235761ca76 | [
"MIT"
] | null | null | null | app/shared_code/imap_sync.py | KubaTaba1uga/spam_recycler | 76056635fdf610c6304e8034a3f66f235761ca76 | [
"MIT"
] | null | null | null | from imap_tools.errors import MailboxFolderSelectError
from imap_tools import MailBox, AND
import logging
import datetime
def validate_credentials(email_address, server_address, password):
"""Validate IMAP credentials.
If IMAP validation succeed
return True
Args:
URL (str): [address ... | 27.747059 | 129 | 0.632817 | from imap_tools.errors import MailboxFolderSelectError
from imap_tools import MailBox, AND
import logging
import datetime
def validate_credentials(email_address, server_address, password):
"""Validate IMAP credentials.
If IMAP validation succeed
return True
Args:
URL (str): [address ... | 758 | 0 | 116 |
52b9d43bb25a77f006fb97c8fe40e8e7b244fb52 | 365 | py | Python | src/metrics.py | K-T-Ng/Ultrasound_Nerve_Segmentation | 51caf40b971995abd13d4158df53609943a508fe | [
"MIT"
] | null | null | null | src/metrics.py | K-T-Ng/Ultrasound_Nerve_Segmentation | 51caf40b971995abd13d4158df53609943a508fe | [
"MIT"
] | null | null | null | src/metrics.py | K-T-Ng/Ultrasound_Nerve_Segmentation | 51caf40b971995abd13d4158df53609943a508fe | [
"MIT"
] | 2 | 2022-01-04T08:51:29.000Z | 2022-01-04T12:02:00.000Z | import torch
| 26.071429 | 53 | 0.641096 | import torch
def compute_dice(inputs, targets):
smooth_ep = 1e-5
batch_size = inputs.shape[0]
inputs = inputs.reshape(batch_size, -1)
targets = targets.reshape(batch_size, -1)
nume = torch.sum(inputs*targets, dim=1)
deno = torch.sum(inputs+targets, dim=1)
dice = (2*nume + smooth_... | 324 | 0 | 25 |