hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f723bc9754ddb86c41340d88ffa3f486b80a42f3 | 258 | py | Python | weight_converter/utils.py | adamriaz/weight-converter | 1ac82ef2935e76ec6c78f322e995fbce6454b6c8 | [
"MIT"
] | null | null | null | weight_converter/utils.py | adamriaz/weight-converter | 1ac82ef2935e76ec6c78f322e995fbce6454b6c8 | [
"MIT"
] | null | null | null | weight_converter/utils.py | adamriaz/weight-converter | 1ac82ef2935e76ec6c78f322e995fbce6454b6c8 | [
"MIT"
] | null | null | null | def divide_by_zero_check(func):
"""
Decorator for checking division by zero from user input
"""
def inner(value):
if value.value == 0:
raise ValueError('Cannot divide by zero!')
return func(value)
return inner
| 25.8 | 59 | 0.616279 | def divide_by_zero_check(func):
def inner(value):
if value.value == 0:
raise ValueError('Cannot divide by zero!')
return func(value)
return inner
| true | true |
f723be6ac409c60b2a0d167791d7a99d3f39abbb | 2,575 | py | Python | external_libs/spglib-1.9.9/python/test/test_hall_number_from_symmetry.py | shunsuke-sato/octopus | dcf68a185cdb13708395546b1557ca46aed969f6 | [
"Apache-2.0"
] | 4 | 2016-11-17T09:03:11.000Z | 2019-10-17T06:31:08.000Z | external_libs/spglib-1.9.9/python/test/test_hall_number_from_symmetry.py | shunsuke-sato/octopus | dcf68a185cdb13708395546b1557ca46aed969f6 | [
"Apache-2.0"
] | 1 | 2020-08-11T19:14:06.000Z | 2020-08-11T19:14:06.000Z | external_libs/spglib-1.9.9/python/test/test_hall_number_from_symmetry.py | shunsuke-sato/octopus | dcf68a185cdb13708395546b1557ca46aed969f6 | [
"Apache-2.0"
] | 5 | 2016-11-22T20:30:46.000Z | 2020-05-29T23:24:51.000Z | import unittest
import numpy as np
from spglib import get_symmetry_dataset, get_hall_number_from_symmetry
from vasp import read_vasp
from os import listdir
dirnames = ('cubic',
'hexagonal',
'monoclinic',
'orthorhombic',
'tetragonal',
'triclinic',
... | 39.015152 | 80 | 0.514951 | import unittest
import numpy as np
from spglib import get_symmetry_dataset, get_hall_number_from_symmetry
from vasp import read_vasp
from os import listdir
dirnames = ('cubic',
'hexagonal',
'monoclinic',
'orthorhombic',
'tetragonal',
'triclinic',
... | true | true |
f723be8c97c6be2454140fb16008806dc90a7f1d | 2,740 | py | Python | data/get_data.py | OmarJabri7/SAIA | f45f1d8073d4b56f5bed6f378f791102b067317c | [
"MIT"
] | 1 | 2022-03-22T19:11:48.000Z | 2022-03-22T19:11:48.000Z | data/get_data.py | OmarJabri7/Disaster-Tweets-Kaggle | 54dfee4684dbfd5bf6cb58cc3974abc051022022 | [
"MIT"
] | null | null | null | data/get_data.py | OmarJabri7/Disaster-Tweets-Kaggle | 54dfee4684dbfd5bf6cb58cc3974abc051022022 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from nltk.corpus import words
import nltk
import re
import string
from data_processing import DisasterProcessor
X = pd.read_csv("emotion_data/tweet_emotions.csv")
stop_wrds = nltk.corpus.stopwords.words("english")
columns = X.columns
columns = ["content"]
preprocessor = Disaster... | 37.027027 | 113 | 0.630657 | import pandas as pd
import numpy as np
from nltk.corpus import words
import nltk
import re
import string
from data_processing import DisasterProcessor
X = pd.read_csv("emotion_data/tweet_emotions.csv")
stop_wrds = nltk.corpus.stopwords.words("english")
columns = X.columns
columns = ["content"]
preprocessor = Disaster... | true | true |
f723c10b490155fd4a2bd2ac7ff767f6f0cf72e9 | 8,494 | py | Python | crosshair/opcode_intercept.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | crosshair/opcode_intercept.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | crosshair/opcode_intercept.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | from collections.abc import MutableMapping, Set
import dis
from types import CodeType
from types import FrameType
from sys import version_info
from crosshair.core import CrossHairValue
from crosshair.core import register_opcode_patch
from crosshair.libimpl.builtinslib import SymbolicInt
from crosshair.libimpl.builtins... | 38.089686 | 88 | 0.674005 | from collections.abc import MutableMapping, Set
import dis
from types import CodeType
from types import FrameType
from sys import version_info
from crosshair.core import CrossHairValue
from crosshair.core import register_opcode_patch
from crosshair.libimpl.builtinslib import SymbolicInt
from crosshair.libimpl.builtins... | true | true |
f723c12709c80e71332f0ad4c801db953c05c2c8 | 1,652 | py | Python | linptech/packet.py | yangguozhanzhao/linptech | 92ee1538d11baf473535cd0ed6b879adcee66e70 | [
"MIT"
] | 1 | 2020-07-26T05:37:43.000Z | 2020-07-26T05:37:43.000Z | linptech/packet.py | yangguozhanzhao/linptech | 92ee1538d11baf473535cd0ed6b879adcee66e70 | [
"MIT"
] | null | null | null | linptech/packet.py | yangguozhanzhao/linptech | 92ee1538d11baf473535cd0ed6b879adcee66e70 | [
"MIT"
] | 2 | 2018-04-03T04:17:12.000Z | 2018-10-12T09:44:20.000Z | from linptech.crc8 import crc8
import logging
class Packet(object):
'''
Base class for Packet.
Mainly used for for packet generation and
Packet.parse_msg(buf) for parsing message.
parse_msg() returns subclass, if one is defined for the data type.
'''
def __init__(self, data=None, optional="00"*7):
if data i... | 23.6 | 67 | 0.672518 | from linptech.crc8 import crc8
import logging
class Packet(object):
def __init__(self, data=None, optional="00"*7):
if data is None:
logging.warning('Packet.data is None')
else:
self.data = data
if optional is None:
logging.info('Packet.optional is None.')
else:
self.optional = optional
@stat... | true | true |
f723c13ed49b8c87b5f0275078a084b4c8f235a1 | 16,785 | py | Python | test/latency_position_test.py | AustinHellerRepo/GameManager | 2eee8e821f551b4683e59ea8cde7e61c26cf8878 | [
"MIT"
] | null | null | null | test/latency_position_test.py | AustinHellerRepo/GameManager | 2eee8e821f551b4683e59ea8cde7e61c26cf8878 | [
"MIT"
] | null | null | null | test/latency_position_test.py | AustinHellerRepo/GameManager | 2eee8e821f551b4683e59ea8cde7e61c26cf8878 | [
"MIT"
] | null | null | null | from __future__ import annotations
import unittest
import time
import matplotlib.pyplot as plt
import numpy as np
from typing import List, Tuple, Dict, Set, Callable, Type
class Dot():
def __init__(self, position: Tuple[float, float], velocity: Tuple[float, float], acceleration: Tuple[float, float]):
self.__posi... | 28.305228 | 276 | 0.742985 | from __future__ import annotations
import unittest
import time
import matplotlib.pyplot as plt
import numpy as np
from typing import List, Tuple, Dict, Set, Callable, Type
class Dot():
def __init__(self, position: Tuple[float, float], velocity: Tuple[float, float], acceleration: Tuple[float, float]):
self.__posi... | true | true |
f723c14378cc4d16c4baa11917ffffcdd73ab43e | 190 | py | Python | mmdet3d/ops/paconv/__init__.py | maskjp/mmdetection3d | 98f332372b1a4c82bc2d57588a5d764f4176c869 | [
"Apache-2.0"
] | 1 | 2022-03-04T19:29:42.000Z | 2022-03-04T19:29:42.000Z | mmdet3d/ops/paconv/__init__.py | maskjp/mmdetection3d | 98f332372b1a4c82bc2d57588a5d764f4176c869 | [
"Apache-2.0"
] | null | null | null | mmdet3d/ops/paconv/__init__.py | maskjp/mmdetection3d | 98f332372b1a4c82bc2d57588a5d764f4176c869 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .assign_score import assign_score_withk
from .paconv import PAConv, PAConvCUDA
__all__ = ['assign_score_withk', 'PAConv', 'PAConvCUDA']
| 31.666667 | 56 | 0.784211 |
from .assign_score import assign_score_withk
from .paconv import PAConv, PAConvCUDA
__all__ = ['assign_score_withk', 'PAConv', 'PAConvCUDA']
| true | true |
f723c28d10fea756d280aba926ac651ddd9a5b0d | 354 | py | Python | wiser_care_theme/wiser_care_theme/doctype/wiser_website_settings/wiser_website_settings.py | MostafaFekry/wiser_care_theme | 9892442803dffeeb5e02136c87c2eb4cc9144b60 | [
"MIT"
] | null | null | null | wiser_care_theme/wiser_care_theme/doctype/wiser_website_settings/wiser_website_settings.py | MostafaFekry/wiser_care_theme | 9892442803dffeeb5e02136c87c2eb4cc9144b60 | [
"MIT"
] | null | null | null | wiser_care_theme/wiser_care_theme/doctype/wiser_website_settings/wiser_website_settings.py | MostafaFekry/wiser_care_theme | 9892442803dffeeb5e02136c87c2eb4cc9144b60 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Systematic and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class WiserWebsiteSettings(Document):
def on_update(self):
from frappe.website.render import c... | 27.230769 | 49 | 0.788136 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class WiserWebsiteSettings(Document):
def on_update(self):
from frappe.website.render import clear_cache
clear_cache("index")
| true | true |
f723c54aee85d58c016b328753e3fa153669b6d6 | 2,533 | py | Python | voctocore/tests/test_audiomix_multiple_sources.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 521 | 2015-01-07T21:43:30.000Z | 2022-03-17T22:07:13.000Z | voctocore/tests/test_audiomix_multiple_sources.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 241 | 2015-05-27T10:11:09.000Z | 2022-02-11T03:29:20.000Z | voctocore/tests/test_audiomix_multiple_sources.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 111 | 2015-08-13T20:06:52.000Z | 2022-03-11T09:48:46.000Z | import unittest
from lib.errors.configuration_error import ConfigurationError
from tests.helper.voctomix_test import VoctomixTest
from lib.audiomix import AudioMix
from lib.config import Config
# noinspection PyUnusedLocal
class AudiomixMultipleSources(VoctomixTest):
def test_no_configured_audiosource_sets_first... | 36.185714 | 102 | 0.698776 | import unittest
from lib.errors.configuration_error import ConfigurationError
from tests.helper.voctomix_test import VoctomixTest
from lib.audiomix import AudioMix
from lib.config import Config
class AudiomixMultipleSources(VoctomixTest):
def test_no_configured_audiosource_sets_first_to_full(self):
audi... | true | true |
f723c5c9d3b222d7776eada4ac0bace2610445b6 | 450 | py | Python | V2RaycSpider1225/BusinessCentralLayer/middleware/work_io.py | kujie0121/V2RayCloudSpider | 32cd65f7811374679fe09cfae2fda805d42fe7ab | [
"MIT"
] | 1 | 2021-02-17T07:51:09.000Z | 2021-02-17T07:51:09.000Z | V2RaycSpider1225/BusinessCentralLayer/middleware/work_io.py | kujie0121/V2RayCloudSpider | 32cd65f7811374679fe09cfae2fda805d42fe7ab | [
"MIT"
] | null | null | null | V2RaycSpider1225/BusinessCentralLayer/middleware/work_io.py | kujie0121/V2RayCloudSpider | 32cd65f7811374679fe09cfae2fda805d42fe7ab | [
"MIT"
] | null | null | null | __all__ = ['Middleware']
from gevent.queue import Queue
# 工作栈
class Middleware:
# cache of redis
zeus = Queue()
# Trash
apollo = Queue()
theseus = {}
# 共享任务队列
poseidon = Queue()
hera = Queue()
# FIXME
# 不明原因bug 使用dict(zip())方案生成的同样的变量,
# 在经过同一个函数方案后输出竟然不一样
cach... | 16.666667 | 88 | 0.6 | __all__ = ['Middleware']
from gevent.queue import Queue
class Middleware:
zeus = Queue()
apollo = Queue()
theseus = {}
poseidon = Queue()
hera = Queue()
cache_redis_queue = {'ssr': {}, 'v2ray': {}}
| true | true |
f723c61d42e207f1fe86c447483a8df191033920 | 2,661 | py | Python | tests/test_basics.py | JunyongYao/flask-backend-seed | 9d16f56a9f34ebb1ec32eaab800b7ad6b10d0c9d | [
"MIT"
] | 9 | 2017-10-20T09:26:09.000Z | 2021-01-28T02:54:43.000Z | tests/test_basics.py | JunyongYao/flask-backend-seed | 9d16f56a9f34ebb1ec32eaab800b7ad6b10d0c9d | [
"MIT"
] | 2 | 2018-03-06T06:27:53.000Z | 2018-04-19T01:47:38.000Z | tests/test_basics.py | JunyongYao/flask-backend-seed | 9d16f56a9f34ebb1ec32eaab800b7ad6b10d0c9d | [
"MIT"
] | 2 | 2019-07-18T22:32:28.000Z | 2020-06-15T14:10:29.000Z | # -*- coding: utf-8 -*-
import json
import random
import string
import unittest
from flask import current_app
from config import config
from app import create_app, db, redis, add_api_support
class BasicsTestCase(unittest.TestCase):
def setUp(self):
test_app = create_app(config['testing'])
test_ap... | 32.45122 | 100 | 0.661405 |
import json
import random
import string
import unittest
from flask import current_app
from config import config
from app import create_app, db, redis, add_api_support
class BasicsTestCase(unittest.TestCase):
def setUp(self):
test_app = create_app(config['testing'])
test_app = add_api_support(tes... | true | true |
f723c6be07f0c68bbd987b45988d3ea7dc170622 | 24,126 | py | Python | refactorings/utils/utils_listener_fast.py | mossj77/CodART | ac83a49a4aa9310b09da12fb476a84586812310b | [
"MIT"
] | 1 | 2021-10-10T23:56:49.000Z | 2021-10-10T23:56:49.000Z | refactorings/utils/utils_listener_fast.py | pouorix/CodART | 84b35a5a14e583d88319d7f6c2de8dc3b3dc83b2 | [
"MIT"
] | null | null | null | refactorings/utils/utils_listener_fast.py | pouorix/CodART | 84b35a5a14e583d88319d7f6c2de8dc3b3dc83b2 | [
"MIT"
] | null | null | null | import re # regular expressions
import antlr4
from antlr4.Token import CommonToken
import antlr4.tree
from antlr4.CommonTokenStream import CommonTokenStream
from typing import List, Optional
from gen.java.JavaParser import JavaParser
from gen.java.JavaParserListener import JavaParserListener
class Program:
def... | 40.822335 | 116 | 0.619829 | import re
import antlr4
from antlr4.Token import CommonToken
import antlr4.tree
from antlr4.CommonTokenStream import CommonTokenStream
from typing import List, Optional
from gen.java.JavaParser import JavaParser
from gen.java.JavaParserListener import JavaParserListener
class Program:
def __init__(self):
... | true | true |
f723c6d8b64443d90a1248040568d87fc7bf7641 | 4,464 | py | Python | tensorflow/python/keras/optimizer_v2/utils.py | luisangel86a/tensorflow | 77ee5e02721ba797fe01d47019e6017d2bb09ab7 | [
"Apache-2.0"
] | 1 | 2020-10-25T00:12:12.000Z | 2020-10-25T00:12:12.000Z | tensorflow/python/keras/optimizer_v2/utils.py | luisangel86a/tensorflow | 77ee5e02721ba797fe01d47019e6017d2bb09ab7 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/optimizer_v2/utils.py | luisangel86a/tensorflow | 77ee5e02721ba797fe01d47019e6017d2bb09ab7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.428571 | 88 | 0.714382 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.distribute import central_storage_strategy
from tensorflow.python.distribute import distribution_strategy_context as distribute_ctx
from tensorflow.python.distribute import... | true | true |
f723c71f72bc88cff1f65f82dbd10987ac1732ba | 9,771 | py | Python | stable_baselines3/common/vec_env/subproc_vec_env.py | qgallouedec/stable-baselines3 | a6f5049a99a4c21a6f0bcce458ca3306cef310e0 | [
"MIT"
] | null | null | null | stable_baselines3/common/vec_env/subproc_vec_env.py | qgallouedec/stable-baselines3 | a6f5049a99a4c21a6f0bcce458ca3306cef310e0 | [
"MIT"
] | null | null | null | stable_baselines3/common/vec_env/subproc_vec_env.py | qgallouedec/stable-baselines3 | a6f5049a99a4c21a6f0bcce458ca3306cef310e0 | [
"MIT"
] | null | null | null | import multiprocessing as mp
from collections import OrderedDict
from typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union
import gym
import numpy as np
from stable_baselines3.common.vec_env.base_vec_env import (
CloudpickleWrapper,
VecEnv,
VecEnvIndices,
VecEnvObs,
VecEnvStep... | 43.816143 | 118 | 0.635861 | import multiprocessing as mp
from collections import OrderedDict
from typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union
import gym
import numpy as np
from stable_baselines3.common.vec_env.base_vec_env import (
CloudpickleWrapper,
VecEnv,
VecEnvIndices,
VecEnvObs,
VecEnvStep... | true | true |
f723c763e4fef4f96747ccb5bded293f8e7b9e66 | 1,057 | py | Python | app/main/tools/test_report.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 1 | 2021-03-15T02:59:13.000Z | 2021-03-15T02:59:13.000Z | app/main/tools/test_report.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 6 | 2021-03-19T09:49:44.000Z | 2022-03-12T00:10:14.000Z | app/main/tools/test_report.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 2 | 2020-01-11T13:39:22.000Z | 2020-07-02T03:57:43.000Z | import json
from flask import request, render_template
from app.utils.docx.docx import set_sand_docxtpl
from config import Config
from app.main import main
@main.route('/test_report/', methods=['GET', 'POST'])
def test_report():
if request.method == 'POST':
file_location = Config.SAVE_DOCUMENT_PATH
... | 26.425 | 57 | 0.655629 | import json
from flask import request, render_template
from app.utils.docx.docx import set_sand_docxtpl
from config import Config
from app.main import main
@main.route('/test_report/', methods=['GET', 'POST'])
def test_report():
if request.method == 'POST':
file_location = Config.SAVE_DOCUMENT_PATH
... | true | true |
f723c8a42621a6c77b949415bc7d8ebb1efd5fee | 8,382 | py | Python | rstslide/plugins/Matplotlib/XKCDify.py | rartino/httk-rsttools | 57c46362899105a72b3b6efc45b50bcda8e574a7 | [
"MIT"
] | null | null | null | rstslide/plugins/Matplotlib/XKCDify.py | rartino/httk-rsttools | 57c46362899105a72b3b6efc45b50bcda8e574a7 | [
"MIT"
] | null | null | null | rstslide/plugins/Matplotlib/XKCDify.py | rartino/httk-rsttools | 57c46362899105a72b3b6efc45b50bcda8e574a7 | [
"MIT"
] | null | null | null | """
XKCD plot generator
-------------------
Author: Jake Vanderplas
This is a script that will take any matplotlib line diagram, and convert it
to an XKCD-style plot. It will work for plots with line & text elements,
including axes labels and titles (but not axes tick labels).
The idea for this comes from work by Da... | 31.393258 | 97 | 0.570866 | import os
import numpy as np
import pylab as pl
from scipy import interpolate, signal
import matplotlib.font_manager as fm
script_path = os.path.dirname(os.path.abspath(__file__))
def xkcd_line(x, y, xlim=None, ylim=None,
mag=1.0, f1=30, f2=0.05, f3=15):
x = np.asarray(x)
y = np.asarra... | true | true |
f723c8c94f31ee4136915426bd76d4aad731bdda | 5,323 | py | Python | utils/utils_fit.py | bubbliiiing/yolox-tf2 | 0407c77858d436a6b370e591eea7963cc807f3b4 | [
"Apache-2.0"
] | 49 | 2021-11-01T06:02:21.000Z | 2022-03-29T07:08:22.000Z | utils/utils_fit.py | bubbliiiing/yolox-tf2 | 0407c77858d436a6b370e591eea7963cc807f3b4 | [
"Apache-2.0"
] | 6 | 2021-11-17T08:35:09.000Z | 2022-02-15T12:43:14.000Z | utils/utils_fit.py | bubbliiiing/yolox-tf2 | 0407c77858d436a6b370e591eea7963cc807f3b4 | [
"Apache-2.0"
] | 20 | 2021-11-19T12:03:21.000Z | 2022-03-16T01:45:25.000Z | import os
import tensorflow as tf
from nets.yolo import get_yolo_loss
from tqdm import tqdm
#------------------------------#
# 防止bug
#------------------------------#
def get_train_step_fn(strategy):
@tf.function
def train_step(imgs, targets, net, yolo_loss, optimizer):
with tf.Gradient... | 43.276423 | 144 | 0.520195 | import os
import tensorflow as tf
from nets.yolo import get_yolo_loss
from tqdm import tqdm
ef get_train_step_fn(strategy):
@tf.function
def train_step(imgs, targets, net, yolo_loss, optimizer):
with tf.GradientTape() as tape:
P5_output, P4_ou... | true | true |
f723c9484375a916d20b7a139369a7ec0dc8afb7 | 3,140 | py | Python | warrior/WarriorCore/Classes/war_print_class.py | YutakaMizugaki/warriorframework | 685761cf044182ec88ce86a942d4be1e150a1256 | [
"Apache-2.0"
] | 24 | 2017-06-06T15:48:08.000Z | 2021-03-17T07:52:52.000Z | warrior/WarriorCore/Classes/war_print_class.py | YutakaMizugaki/warriorframework | 685761cf044182ec88ce86a942d4be1e150a1256 | [
"Apache-2.0"
] | 272 | 2017-05-19T20:39:12.000Z | 2021-12-13T19:34:51.000Z | warrior/WarriorCore/Classes/war_print_class.py | pavithra-gowda/warrior | 19b153310552b986b86b5470fcfea9547a74c3a9 | [
"Apache-2.0"
] | 37 | 2017-05-17T21:24:37.000Z | 2021-07-24T18:09:22.000Z | '''
Copyright 2017, Fujitsu Network Communications, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | 35.280899 | 80 | 0.670064 |
import sys
import re
def print_main(message, print_type, color_message=None, *args, **kwargs):
if color_message is not None:
print_string = print_type + " " + str(color_message)
elif color_message is None:
print_string = print_type + " " + str(message)
if len(args) > 0:
print_stri... | true | true |
f723c959dc405638e9be66e367589488a0bb7950 | 74,965 | py | Python | doppyo/sugar.py | aaronspring/doppyo | e29e21fbb997f024f39d2e5e67decfc235b0dcca | [
"MIT"
] | null | null | null | doppyo/sugar.py | aaronspring/doppyo | e29e21fbb997f024f39d2e5e67decfc235b0dcca | [
"MIT"
] | null | null | null | doppyo/sugar.py | aaronspring/doppyo | e29e21fbb997f024f39d2e5e67decfc235b0dcca | [
"MIT"
] | null | null | null | """
Collection of old doppyo functions and useful tidbits for internal dcfp use
Authors: Dougie Squire and Thomas Moore
Date created: 01/10/2018
Python Version: 3.6
"""
# ===================================================================================================
# Packages
# ===================... | 48.837134 | 201 | 0.555499 |
import numpy as np
import pandas as pd
import xarray as xr
import cartopy
from collections import Sequence
from itertools import chain, count
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
from cartopy.util import add_cyclic_point
from cartopy.mpl.gridliner import LONGITUDE_F... | true | true |
f723c95d5658ceeced474744cccb763f8b5be84d | 2,382 | py | Python | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_k_ejt1.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | 5 | 2021-01-06T16:49:22.000Z | 2021-02-19T05:34:27.000Z | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_k_ejt1.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | null | null | null | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_k_ejt1.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
""" Demo for exponentiated Jensen-Tsallis kernel-1 estimators.
Analytical vs estimated value is illustrated for spherical normal random
variables.
"""
from numpy import eye
from numpy.random import rand, multivariate_normal, randn
from scipy import arange, zeros, ones
import matplotlib.pyplot... | 33.549296 | 74 | 0.646096 |
from numpy import eye
from numpy.random import rand, multivariate_normal, randn
from scipy import arange, zeros, ones
import matplotlib.pyplot as plt
from ite.cost.x_factory import co_factory
from ite.cost.x_analytical_values import analytical_value_k_ejt1
def main():
dim = 1
num_of_samples_v = ara... | true | true |
f723ca086eef0104ef4640b52705cddbd642cc36 | 2,063 | py | Python | parsifal/reviews/migrations/0046_auto_20190717_2301.py | glauberferreira/parsifal-mec | 66f85e0d48a270bddd1170caa2131bc74872462d | [
"MIT"
] | 1 | 2019-06-13T16:09:26.000Z | 2019-06-13T16:09:26.000Z | parsifal/reviews/migrations/0046_auto_20190717_2301.py | glauberferreira/parsifal-mec | 66f85e0d48a270bddd1170caa2131bc74872462d | [
"MIT"
] | null | null | null | parsifal/reviews/migrations/0046_auto_20190717_2301.py | glauberferreira/parsifal-mec | 66f85e0d48a270bddd1170caa2131bc74872462d | [
"MIT"
] | 3 | 2019-10-05T04:16:59.000Z | 2021-04-20T05:00:50.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('reviews'... | 35.568966 | 164 | 0.596704 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('reviews', '0045_articlefile'),
... | true | true |
f723ca1a6623fc6b30625bd969dcb19ab9192111 | 358 | py | Python | Lessons/simpleWebBrowser.py | Luderio/Scientific-Computing-with-Python | c7eebcc3b46b68b3d5c08ad25fb802ae9ff42f7f | [
"MIT"
] | null | null | null | Lessons/simpleWebBrowser.py | Luderio/Scientific-Computing-with-Python | c7eebcc3b46b68b3d5c08ad25fb802ae9ff42f7f | [
"MIT"
] | null | null | null | Lessons/simpleWebBrowser.py | Luderio/Scientific-Computing-with-Python | c7eebcc3b46b68b3d5c08ad25fb802ae9ff42f7f | [
"MIT"
] | null | null | null | #Simple We Browser using sockets
import socket
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connect(('data.pr4e.org', 80))
cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\r\n\r\n'.encode()
mysock.send(cmd)
while True :
data = mysock.recv(512)
if len(data) < 1 :
break
... | 23.866667 | 68 | 0.664804 |
import socket
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connect(('data.pr4e.org', 80))
cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\r\n\r\n'.encode()
mysock.send(cmd)
while True :
data = mysock.recv(512)
if len(data) < 1 :
break
print(data.decode())
mysock.c... | true | true |
f723ca2e7cf32da6dc08be2afefe8b8e7395f254 | 287 | py | Python | app.py | IIVIIIII/2020_Weathering | 0759f2848ca912c8f1f9875f18c8e0aa604948f5 | [
"MIT"
] | null | null | null | app.py | IIVIIIII/2020_Weathering | 0759f2848ca912c8f1f9875f18c8e0aa604948f5 | [
"MIT"
] | null | null | null | app.py | IIVIIIII/2020_Weathering | 0759f2848ca912c8f1f9875f18c8e0aa604948f5 | [
"MIT"
] | null | null | null | from flask import Flask, jsonify
import data4app
app = Flask(__name__)
@app.route("/")
def home():
return "Lets goooo!!!"
@app.route("/<var>")
def jsonified(var):
data = data4app.get_data(var)
return jsonify(data)
if __name__ == "__main__":
app.run(debug=True)
| 15.105263 | 33 | 0.648084 | from flask import Flask, jsonify
import data4app
app = Flask(__name__)
@app.route("/")
def home():
return "Lets goooo!!!"
@app.route("/<var>")
def jsonified(var):
data = data4app.get_data(var)
return jsonify(data)
if __name__ == "__main__":
app.run(debug=True)
| true | true |
f723ca8574f5c324eb54931b511ea756f5d6462f | 18,973 | py | Python | sdk/python/tekton_pipeline/models/pod_template.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | null | null | null | sdk/python/tekton_pipeline/models/pod_template.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | null | null | null | sdk/python/tekton_pipeline/models/pod_template.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | 1 | 2020-07-30T15:55:45.000Z | 2020-07-30T15:55:45.000Z | # Copyright 2020 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 38.329293 | 485 | 0.669056 |
import pprint
import re
import six
from tekton_pipeline.configuration import Configuration
class PodTemplate(object):
openapi_types = {
'affinity': 'V1Affinity',
'automount_service_account_token': 'bool',
'dns_config': 'V1PodDNSConfig',
'dns_policy': 'str',
... | true | true |
f723cb619eaf3108159317787a8063eb46bfbdab | 413 | py | Python | experiments/fdtd-2d/tmp_files/144.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/144.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/144.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/144.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
til... | 22.944444 | 116 | 0.72155 | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/144.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
til... | true | true |
f723cba44ec9074d909b91e8b3bb8d8e84df91e5 | 506 | py | Python | tests/test_base.py | not-nexus/shelf | ea59703082402ad3b6454482f0487418295fbd19 | [
"MIT"
] | 4 | 2016-11-07T13:02:18.000Z | 2019-09-03T02:04:05.000Z | tests/test_base.py | not-nexus/shelf | ea59703082402ad3b6454482f0487418295fbd19 | [
"MIT"
] | 21 | 2016-11-30T20:44:52.000Z | 2017-05-02T15:38:56.000Z | tests/test_base.py | not-nexus/shelf | ea59703082402ad3b6454482f0487418295fbd19 | [
"MIT"
] | 2 | 2017-01-24T14:36:04.000Z | 2020-01-13T16:10:05.000Z | import pyproctor
class TestBase(pyproctor.TestBase):
@classmethod
def setUpClass(cls):
"""
This exists to make sure that no matter what, tests
will log on stdout. Every call to basicConfig after
this point will be a no-op
"""
# AGI-731
# See... | 25.3 | 64 | 0.561265 | import pyproctor
class TestBase(pyproctor.TestBase):
@classmethod
def setUpClass(cls):
| true | true |
f723cc233a58a2785fb04f6b38b7dd40a29e256b | 97 | py | Python | tests/test_import.py | Quiltomics/indexd | 95274d40f16de881492c2db70a969eb77c8f5e7c | [
"Apache-2.0"
] | 2 | 2019-06-10T15:30:51.000Z | 2020-01-18T23:24:13.000Z | tests/test_import.py | lookcrabs/indexd | 646a7f336148496b07462ce3d3f8e930fa08a06c | [
"Apache-2.0"
] | 15 | 2019-03-19T21:57:31.000Z | 2021-08-11T21:01:33.000Z | tests/test_import.py | NCI-GDC/indexd | d159a82e7da100c807621bc41f2626dae64b4be9 | [
"Apache-2.0"
] | 1 | 2020-11-05T15:03:24.000Z | 2020-11-05T15:03:24.000Z | def test_import_index():
'''
Try to import the indexd package.
'''
import indexd
| 16.166667 | 37 | 0.608247 | def test_import_index():
import indexd
| true | true |
f723ccb1d235fd916b20e25c9c162899696706eb | 4,292 | py | Python | tests/python/contrib/test_gemm_acc32_vnni.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 9 | 2019-12-17T08:03:54.000Z | 2022-01-19T02:34:23.000Z | tests/python/contrib/test_gemm_acc32_vnni.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 2 | 2020-06-18T21:15:42.000Z | 2020-06-24T17:38:37.000Z | tests/python/contrib/test_gemm_acc32_vnni.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 3 | 2020-10-04T20:30:18.000Z | 2022-01-24T18:03:52.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.11215 | 107 | 0.627213 |
import tvm
from tvm import te
import numpy as np
from topi.x86.tensor_intrin import dot_16x1x16_uint8_int8_int32_cascadelake
from topi.x86.tensor_intrin import dot_16x1x16_uint8_int8_int32
import pytest
@pytest.mark.skip("skip because feature not enabled")
def test_fc_int8_acc32():
m = 1024
... | true | true |
f723ccc97ea70d87a17b104645eede99a1853ac3 | 2,675 | py | Python | wings/api_client.py | KnowledgeCaptureAndDiscovery/wings-client | af1d068f4adc07d9060afa94dc99e0b2565be088 | [
"Apache-2.0"
] | null | null | null | wings/api_client.py | KnowledgeCaptureAndDiscovery/wings-client | af1d068f4adc07d9060afa94dc99e0b2565be088 | [
"Apache-2.0"
] | 8 | 2019-07-28T17:04:38.000Z | 2019-08-06T23:57:08.000Z | wings/api_client.py | KnowledgeCaptureAndDiscovery/wings-client | af1d068f4adc07d9060afa94dc99e0b2565be088 | [
"Apache-2.0"
] | 1 | 2019-07-29T22:53:41.000Z | 2019-07-29T22:53:41.000Z | import atexit
import importlib
import logging
import requests
class ApiClient:
def __init__(self, **kwargs):
self.kwargs = kwargs
self.session = requests.Session()
self.libns = self.get_export_url() + "components/library.owl#"
self.dcdom = self.get_export_url() + "data/ontology.ow... | 31.104651 | 88 | 0.603738 | import atexit
import importlib
import logging
import requests
class ApiClient:
def __init__(self, **kwargs):
self.kwargs = kwargs
self.session = requests.Session()
self.libns = self.get_export_url() + "components/library.owl#"
self.dcdom = self.get_export_url() + "data/ontology.ow... | true | true |
f723ce701eeae1b756748f8b4615052fa8ad1b50 | 4,318 | py | Python | ramp-database/ramp_database/tests/test_testing.py | agramfort/ramp-board | 1c2cfe7af486e57ee0d4fb017b5266bb8ad152e3 | [
"BSD-3-Clause"
] | null | null | null | ramp-database/ramp_database/tests/test_testing.py | agramfort/ramp-board | 1c2cfe7af486e57ee0d4fb017b5266bb8ad152e3 | [
"BSD-3-Clause"
] | null | null | null | ramp-database/ramp_database/tests/test_testing.py | agramfort/ramp-board | 1c2cfe7af486e57ee0d4fb017b5266bb8ad152e3 | [
"BSD-3-Clause"
] | null | null | null | import os
import shutil
import pytest
from ramp_utils import read_config
from ramp_utils import generate_ramp_config
from ramp_utils.testing import database_config_template
from ramp_utils.testing import ramp_config_template
from ramp_database.utils import setup_db
from ramp_database.utils import session_scope
fro... | 34.822581 | 76 | 0.789717 | import os
import shutil
import pytest
from ramp_utils import read_config
from ramp_utils import generate_ramp_config
from ramp_utils.testing import database_config_template
from ramp_utils.testing import ramp_config_template
from ramp_database.utils import setup_db
from ramp_database.utils import session_scope
fro... | true | true |
f723cf6dae464950f3d8b77edb889dcb5492b6ce | 4,453 | py | Python | python/ingestor/business.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | null | null | null | python/ingestor/business.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | null | null | null | python/ingestor/business.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | null | null | null | import python.common.middleware as middleware
import python.common.actions as actions
import python.common.rsi_email as rsi_email
import python.common.rest as rest
def get_available_time_slots() -> list:
"""
An application is ready for scheduling when all the payment rules are satisfied plus:
- the ap... | 46.385417 | 89 | 0.614193 | import python.common.middleware as middleware
import python.common.actions as actions
import python.common.rsi_email as rsi_email
import python.common.rest as rest
def get_available_time_slots() -> list:
return [
{"try": middleware.create_correlation_id, "fail": []},
{"try": middleware.determine_c... | true | true |
f723cf8e92377defaba93082120d82ab6f27e07b | 343 | py | Python | tests/test_models.py | devopsmakers/dj-prosftpd | fcef6b4a5b8b872c9830eaf0315f0467dd1944ff | [
"MIT"
] | null | null | null | tests/test_models.py | devopsmakers/dj-prosftpd | fcef6b4a5b8b872c9830eaf0315f0467dd1944ff | [
"MIT"
] | null | null | null | tests/test_models.py | devopsmakers/dj-prosftpd | fcef6b4a5b8b872c9830eaf0315f0467dd1944ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_dj-prosftpd
------------
Tests for `dj-prosftpd` models module.
"""
from django.test import TestCase
from dj_prosftpd import models
class TestDj_prosftpd(TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDo... | 13.192308 | 38 | 0.620991 |
from django.test import TestCase
from dj_prosftpd import models
class TestDj_prosftpd(TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
| true | true |
f723cfc4543d31b1df927182b8dd2e714298c92e | 14,427 | py | Python | fermi_blind_search/database.py | giacomov/fermi_blind_search | f8d52cb8b61519223918d197682b4f70c78cce10 | [
"BSD-3-Clause"
] | null | null | null | fermi_blind_search/database.py | giacomov/fermi_blind_search | f8d52cb8b61519223918d197682b4f70c78cce10 | [
"BSD-3-Clause"
] | null | null | null | fermi_blind_search/database.py | giacomov/fermi_blind_search | f8d52cb8b61519223918d197682b4f70c78cce10 | [
"BSD-3-Clause"
] | 1 | 2017-04-01T10:42:07.000Z | 2017-04-01T10:42:07.000Z | #!/usr/bin/env python
from contextlib import contextmanager
import argparse
import sys
import sshtunnel
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from fermi_blind_search.configuration import get_config
from fermi_blind_search import myLoggi... | 37.27907 | 121 | 0.582311 |
from contextlib import contextmanager
import argparse
import sys
import sshtunnel
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from fermi_blind_search.configuration import get_config
from fermi_blind_search import myLogging
_logger = myLoggi... | true | true |
f723cfd084712344629373ab39822ddba59ccffa | 2,538 | py | Python | irrigator_pro/farms/migrations/0012_copy_field_list_to_field_for_waterhistory_and_probe.py | warnes/irrigatorpro | 4838f8832bdbf87f394a0298adc5dabfc26e82e8 | [
"MIT"
] | null | null | null | irrigator_pro/farms/migrations/0012_copy_field_list_to_field_for_waterhistory_and_probe.py | warnes/irrigatorpro | 4838f8832bdbf87f394a0298adc5dabfc26e82e8 | [
"MIT"
] | null | null | null | irrigator_pro/farms/migrations/0012_copy_field_list_to_field_for_waterhistory_and_probe.py | warnes/irrigatorpro | 4838f8832bdbf87f394a0298adc5dabfc26e82e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import sys
from django.db import connection
def convert_probe_field_list_to_field(apps, schema_editor):
"""
For each current Probe, copy field_list[0] into field, and create
n... | 29.511628 | 84 | 0.670607 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import sys
from django.db import connection
def convert_probe_field_list_to_field(apps, schema_editor):
Probe = apps.get_model("farms", "Probe")
cursor = connection.cursor()
cursor.execute("select ... | true | true |
f723d086e096878de8624880928432132d608eb2 | 7,000 | py | Python | rllib/agents/marwil/tests/test_marwil.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | 3 | 2021-08-29T20:41:21.000Z | 2022-01-31T18:47:51.000Z | rllib/agents/marwil/tests/test_marwil.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | 61 | 2021-06-05T07:05:08.000Z | 2022-03-19T07:14:56.000Z | rllib/agents/marwil/tests/test_marwil.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
from pathlib import Path
import unittest
import ray
import ray.rllib.agents.marwil as marwil
from ray.rllib.evaluation.postprocessing import compute_advantages
from ray.rllib.offline import JsonReader
from ray.rllib.utils.framework import try_import_tf, try_import_torch
from ray.rllib.util... | 41.666667 | 79 | 0.576857 | import numpy as np
import os
from pathlib import Path
import unittest
import ray
import ray.rllib.agents.marwil as marwil
from ray.rllib.evaluation.postprocessing import compute_advantages
from ray.rllib.offline import JsonReader
from ray.rllib.utils.framework import try_import_tf, try_import_torch
from ray.rllib.util... | true | true |
f723d0fdbd1846134fc03f67f0123e5aedd5f7e6 | 1,938 | py | Python | config.py | LucaMalavolta/q2 | d4cd62c3ea898c99334ea84e2b41ec75db9558f7 | [
"BSD-2-Clause"
] | null | null | null | config.py | LucaMalavolta/q2 | d4cd62c3ea898c99334ea84e2b41ec75db9558f7 | [
"BSD-2-Clause"
] | null | null | null | config.py | LucaMalavolta/q2 | d4cd62c3ea898c99334ea84e2b41ec75db9558f7 | [
"BSD-2-Clause"
] | null | null | null | import os
import logging
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'Data')
COLORTEFF_PATH = os.path.join(path, 'ColorTeff')
MODATM_PATH = os.path.join(path, 'ModelAtmospheres')
ISOCHRONES_PATH = ... | 36.566038 | 78 | 0.663055 | import os
import logging
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'Data')
COLORTEFF_PATH = os.path.join(path, 'ColorTeff')
MODATM_PATH = os.path.join(path, 'ModelAtmospheres')
ISOCHRONES_PATH = ... | true | true |
f723d13c5a9085305d4224504015e2a6d6c0eef1 | 1,341 | py | Python | concepts/recursion/fibonacci_sesies.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | 1 | 2021-02-19T11:00:11.000Z | 2021-02-19T11:00:11.000Z | concepts/recursion/fibonacci_sesies.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | null | null | null | concepts/recursion/fibonacci_sesies.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.8
"""
given a number N generate N no of fibonacci numbers
"""
from memoize import memoize
number = 25
fib_list = [None] * (number)
def fibonacci(num):
"""
fibonacci series using iteration
"""
a, b = 0, 1
for i in range(num-1):
fib_list[i], fib_list[i+1] = a, b
a, b = b, a+b
return a... | 19.434783 | 71 | 0.671141 |
from memoize import memoize
number = 25
fib_list = [None] * (number)
def fibonacci(num):
a, b = 0, 1
for i in range(num-1):
fib_list[i], fib_list[i+1] = a, b
a, b = b, a+b
return a
fibonacci(number)
print("fibonacci series using iteration : ", fib_list)
fib_list = [None] * (number)
def fibonacci_a(num):
... | true | true |
f723d38041e06dcc3fe6b444f4b546e4e28b9d49 | 754 | py | Python | pydatastructs/linear_data_structures/__init__.py | hpnightowl/pydatastructs | ec69ef887fee200390bff41ab6859a4ab0b26fbf | [
"BSD-3-Clause"
] | null | null | null | pydatastructs/linear_data_structures/__init__.py | hpnightowl/pydatastructs | ec69ef887fee200390bff41ab6859a4ab0b26fbf | [
"BSD-3-Clause"
] | null | null | null | pydatastructs/linear_data_structures/__init__.py | hpnightowl/pydatastructs | ec69ef887fee200390bff41ab6859a4ab0b26fbf | [
"BSD-3-Clause"
] | 1 | 2021-02-05T04:49:55.000Z | 2021-02-05T04:49:55.000Z | __all__ = []
from pydatastructs.linear_data_structures import arrays, linked_lists, algorithms
from pydatastructs.linear_data_structures.arrays import OneDimensionalArray, DynamicOneDimensionalArray, \
MultiDimensionalArray
from pydatastructs.linear_data_structures.algorithms import merge_sort_parallel, brick_so... | 37.7 | 115 | 0.855438 | __all__ = []
from pydatastructs.linear_data_structures import arrays, linked_lists, algorithms
from pydatastructs.linear_data_structures.arrays import OneDimensionalArray, DynamicOneDimensionalArray, \
MultiDimensionalArray
from pydatastructs.linear_data_structures.algorithms import merge_sort_parallel, brick_so... | true | true |
f723d3bddf9b5128923113de82df064942d27440 | 391 | py | Python | Epitome/wsgi.py | pbout/ept | 7da64e606c9c163ffc8285cd8c77288807f4f477 | [
"RSA-MD"
] | null | null | null | Epitome/wsgi.py | pbout/ept | 7da64e606c9c163ffc8285cd8c77288807f4f477 | [
"RSA-MD"
] | null | null | null | Epitome/wsgi.py | pbout/ept | 7da64e606c9c163ffc8285cd8c77288807f4f477 | [
"RSA-MD"
] | null | null | null | """
WSGI config for Epitome project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Epitome.settings")
application = get_wsgi_application()
| true | true |
f723d4daf4d337355a5c29418d6ad94c37865a78 | 3,109 | py | Python | meiduotest/meiduotest/settings.py | littrell0/meiduo_project_test | 3d2f6a6e528e6c45a5ffc1db0ddc5de9b4e52bf8 | [
"MIT"
] | null | null | null | meiduotest/meiduotest/settings.py | littrell0/meiduo_project_test | 3d2f6a6e528e6c45a5ffc1db0ddc5de9b4e52bf8 | [
"MIT"
] | null | null | null | meiduotest/meiduotest/settings.py | littrell0/meiduo_project_test | 3d2f6a6e528e6c45a5ffc1db0ddc5de9b4e52bf8 | [
"MIT"
] | null | null | null | """
Django settings for meiduotest project.
Generated by 'django-admin startproject' using Django 1.11.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impor... | 25.694215 | 91 | 0.69733 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '8zj*1u%iy2m+d0hg$@#5d(nrr5_-2u))cqkf^_3wj&f3ayr)o='
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f723d5a84455b1eb99d7bfc740ea30ad3707a3a0 | 4,334 | py | Python | mmdet/models/seg_heads/panoptic_fpn_head.py | SeHwanJoo/mmdetection_body | 1e1cadc6df91926fc99c4afbae383df0ea9cfed3 | [
"Apache-2.0"
] | 7 | 2021-08-08T08:34:30.000Z | 2022-01-10T18:37:47.000Z | mmdet/models/seg_heads/panoptic_fpn_head.py | SeHwanJoo/mmdetection_body | 1e1cadc6df91926fc99c4afbae383df0ea9cfed3 | [
"Apache-2.0"
] | null | null | null | mmdet/models/seg_heads/panoptic_fpn_head.py | SeHwanJoo/mmdetection_body | 1e1cadc6df91926fc99c4afbae383df0ea9cfed3 | [
"Apache-2.0"
] | 2 | 2021-08-11T05:57:50.000Z | 2022-01-04T11:13:32.000Z | import torch
import torch.nn as nn
from mmcv.runner import ModuleList
from ..builder import HEADS
from ..utils import ConvUpsample
from .base_semantic_head import BaseSemanticHead
@HEADS.register_module()
class PanopticFPNHead(BaseSemanticHead):
"""PanopticFPNHead used in Panoptic FPN.
Arg:
num_clas... | 38.696429 | 78 | 0.601292 | import torch
import torch.nn as nn
from mmcv.runner import ModuleList
from ..builder import HEADS
from ..utils import ConvUpsample
from .base_semantic_head import BaseSemanticHead
@HEADS.register_module()
class PanopticFPNHead(BaseSemanticHead):
def __init__(self,
num_classes,
... | true | true |
f723d8eb5daadf4e81d3c79aabb857dd8a2823c2 | 276 | py | Python | dashboard/apps.py | lynetteoh/COVID19dashboard | 61193d35acf004999443c47a30f0b9f9c6220c03 | [
"MIT"
] | null | null | null | dashboard/apps.py | lynetteoh/COVID19dashboard | 61193d35acf004999443c47a30f0b9f9c6220c03 | [
"MIT"
] | null | null | null | dashboard/apps.py | lynetteoh/COVID19dashboard | 61193d35acf004999443c47a30f0b9f9c6220c03 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
import pandas as pd
import sys
class DashboardConfig(AppConfig):
name = 'dashboard'
def ready(self):
if 'runserver' not in sys.argv:
return True
from dashboard.models import Case, State, Country
| 21.230769 | 57 | 0.65942 | from django.apps import AppConfig
import pandas as pd
import sys
class DashboardConfig(AppConfig):
name = 'dashboard'
def ready(self):
if 'runserver' not in sys.argv:
return True
from dashboard.models import Case, State, Country
| true | true |
f723d9b3d877c48369368b51d3310d0d2b722ba2 | 372 | py | Python | exercicios-turtle/.history/flower_20210624115429.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | 1 | 2021-11-28T18:49:21.000Z | 2021-11-28T18:49:21.000Z | exercicios-turtle/.history/flower_20210624115429.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | exercicios-turtle/.history/flower_20210624115429.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | import turtle
tortuguita = turtle.Turtle()
tortuguita.color('blue')
tortuguita.speed(100)
for i in range (18):
tortuguita.circle(200,100)
tortuguita.left(110)
tortuguita.up()
tortuguita.left(35)
tortuguita.forward(160)
tortuguita.down()
tortuguita.dot(70,"black")
tortuguita.left(35)
tortuguita.up()
tortugui... | 17.714286 | 30 | 0.752688 | import turtle
tortuguita = turtle.Turtle()
tortuguita.color('blue')
tortuguita.speed(100)
for i in range (18):
tortuguita.circle(200,100)
tortuguita.left(110)
tortuguita.up()
tortuguita.left(35)
tortuguita.forward(160)
tortuguita.down()
tortuguita.dot(70,"black")
tortuguita.left(35)
tortuguita.up()
tortugui... | true | true |
f723d9cabe29840070a01c4f2c8c2878b8b99f27 | 5,505 | py | Python | ccc/elasticsearch.py | mliepold/cc-utils | 3f8c4b0d11d6a52d1605026f478371411daab81e | [
"BSD-3-Clause"
] | 15 | 2018-04-18T13:25:30.000Z | 2022-03-04T09:25:41.000Z | ccc/elasticsearch.py | mliepold/cc-utils | 3f8c4b0d11d6a52d1605026f478371411daab81e | [
"BSD-3-Clause"
] | 221 | 2018-04-12T06:29:43.000Z | 2022-03-27T03:01:40.000Z | ccc/elasticsearch.py | mliepold/cc-utils | 3f8c4b0d11d6a52d1605026f478371411daab81e | [
"BSD-3-Clause"
] | 29 | 2018-04-11T14:42:23.000Z | 2021-11-09T16:26:32.000Z | # Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 29.438503 | 97 | 0.622525 |
import datetime
import functools
import os
import json
import elasticsearch
import ci.util
import concourse.util
import model.elasticsearch
def default_client_if_available():
if not ci.util._running_on_ci():
return None
cfg_factory = ci.util.ctx().cfg_factory()
cfg_set = cfg_fact... | true | true |
f723da3d31fc0d1c210b41c7779cc8ee4f4cd08c | 6,876 | py | Python | src/wallet/wallet_block_store.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | src/wallet/wallet_block_store.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | src/wallet/wallet_block_store.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | from typing import Dict, Optional, Tuple, List
import aiosqlite
from src.consensus.sub_block_record import SubBlockRecord
from src.types.header_block import HeaderBlock
from src.util.ints import uint32, uint64
from src.wallet.block_record import HeaderBlockRecord
from src.types.sized_bytes import bytes32
class Walle... | 39.745665 | 112 | 0.627981 | from typing import Dict, Optional, Tuple, List
import aiosqlite
from src.consensus.sub_block_record import SubBlockRecord
from src.types.header_block import HeaderBlock
from src.util.ints import uint32, uint64
from src.wallet.block_record import HeaderBlockRecord
from src.types.sized_bytes import bytes32
class Walle... | true | true |
f723db4534fac7bbdbc1fca243f9cc9d68e9c713 | 56,361 | py | Python | plugins/modules/oci_loadbalancer_backend_set.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_loadbalancer_backend_set.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_loadbalancer_backend_set.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 49.657269 | 149 | 0.558134 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_loadbalancer_backend_set
short_description: Manage a BackendSet resource... | true | true |
f723dcbf78bff84e6aa9186e1ba18550f5791807 | 4,002 | py | Python | CodingEasy/settings.py | Atif0604/CodingEasy | 75d7e88dd7ab514ee4fdaa4b1b80175d78c5a91c | [
"MIT"
] | 40 | 2021-12-22T15:16:03.000Z | 2022-03-26T08:24:04.000Z | CodingEasy/settings.py | Atif0604/CodingEasy | 75d7e88dd7ab514ee4fdaa4b1b80175d78c5a91c | [
"MIT"
] | 222 | 2021-12-14T05:37:10.000Z | 2022-03-31T16:38:59.000Z | CodingEasy/settings.py | Atif0604/CodingEasy | 75d7e88dd7ab514ee4fdaa4b1b80175d78c5a91c | [
"MIT"
] | 89 | 2021-12-14T05:00:23.000Z | 2022-03-29T10:55:25.000Z | """
Django settings for CodingEasy project.
Generated by 'django-admin startproject' using Django 4.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from path... | 26.156863 | 91 | 0.703648 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-x_1=q*b(j*34f(dg0^2sa)-f$k^!0d(qa=@geze9s@8)-(!hy5'
DEBUG = True
ALLOWED_HOSTS = ["*"]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.co... | true | true |
f723def610c1a3cf3e0216947eb0d00eb4392e68 | 9,125 | py | Python | tf_object_detection/to_tfrecords.py | AndresGarciaEscalante/bstld | cc37fb3388b7731be9e76fd1c4e2be13b6716afe | [
"MIT"
] | null | null | null | tf_object_detection/to_tfrecords.py | AndresGarciaEscalante/bstld | cc37fb3388b7731be9e76fd1c4e2be13b6716afe | [
"MIT"
] | null | null | null | tf_object_detection/to_tfrecords.py | AndresGarciaEscalante/bstld | cc37fb3388b7731be9e76fd1c4e2be13b6716afe | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Creates full-image tfrecords to use the Bosch Small Traffic Lights Dataset
with the Tensorflow Object Detection API.
The training set is split into training and validation. Tfrecords are created
for a training, validation, and test set. Labels are grouped by their respective
colors to simpli... | 43.452381 | 98 | 0.699288 |
import argparse
from collections import OrderedDict, defaultdict
import hashlib
import os
from random import shuffle
import cv2
import tensorflow as tf
import tqdm
from object_detection.utils import dataset_util
import sys
current = os.path.dirname(os.path.realpath(__file__))
parent = os.path.dirname(cu... | true | true |
f723e0a0bf9e03267963a7c69b5889fe7fcdda12 | 2,069 | py | Python | scripts/generate_delta_sysroot_unittest.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | scripts/generate_delta_sysroot_unittest.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | scripts/generate_delta_sysroot_unittest.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for generate_delta_sysroot."""
from __future__ import print_function
import os
from chromite.lib import cros_build_lib
from chromite.l... | 29.985507 | 73 | 0.697438 |
from __future__ import print_function
import os
from chromite.lib import cros_build_lib
from chromite.lib import cros_test_lib
from chromite.scripts import generate_delta_sysroot as gds
def _Parse(argv):
return gds._ParseCommandLine(argv)
class InterfaceTest(cros_test_lib.OutputTestCase,
... | true | true |
f723e168770bfc02d7b2018b83bc4abe150a4e30 | 678 | py | Python | ex9_1_applications_agumentation.py | soyoung9306/-3-keras | e65f40171aadef3fe0b59c649b55b3f0bd09ca41 | [
"MIT"
] | 200 | 2017-10-23T05:05:34.000Z | 2022-01-25T00:58:45.000Z | ex9_1_applications_agumentation.py | MyeongHaHwang/keraspp | 4090fcc86072cda816d1d6056b5113ace49534ae | [
"MIT"
] | 8 | 2018-02-07T08:33:49.000Z | 2020-09-11T20:59:30.000Z | ex9_1_applications_agumentation.py | MyeongHaHwang/keraspp | 4090fcc86072cda816d1d6056b5113ace49534ae | [
"MIT"
] | 135 | 2017-12-15T05:41:47.000Z | 2021-12-15T12:21:09.000Z | """
CH 9.1 Applications/Image Augmentation
"""
from sklearn import model_selection
from keras import datasets
import keras
assert keras.backend.image_data_format() == 'channels_last'
from keraspp import aigen
class Machine(aigen.Machine_Generator):
def __init__(self):
(x_train, y_train), (x_test, y_test)... | 23.37931 | 87 | 0.690265 | from sklearn import model_selection
from keras import datasets
import keras
assert keras.backend.image_data_format() == 'channels_last'
from keraspp import aigen
class Machine(aigen.Machine_Generator):
def __init__(self):
(x_train, y_train), (x_test, y_test) = datasets.cifar10.load_data()
_, X, _... | true | true |
f723e1dd1990acf6f94ec2386a12f7b48ddc2589 | 274 | py | Python | core/index_db/index_object.py | AliRezaBeigy/Gitools | b7defd332bb144cb45962a351b1f56e941c8ca4b | [
"MIT"
] | 6 | 2021-01-06T05:18:06.000Z | 2022-03-17T06:44:29.000Z | core/index_db/index_object.py | AliRezaBeigy/Gitools | b7defd332bb144cb45962a351b1f56e941c8ca4b | [
"MIT"
] | null | null | null | core/index_db/index_object.py | AliRezaBeigy/Gitools | b7defd332bb144cb45962a351b1f56e941c8ca4b | [
"MIT"
] | 1 | 2021-04-15T20:51:26.000Z | 2021-04-15T20:51:26.000Z | class IndexObject:
hash: str
crc32: int
pack_end_offset: int
pack_start_offset: int
def __init__(self, hash: str, crc32: int, pack_start_offset: int):
self.hash = hash
self.crc32 = crc32
self.pack_start_offset = pack_start_offset | 27.4 | 70 | 0.667883 | class IndexObject:
hash: str
crc32: int
pack_end_offset: int
pack_start_offset: int
def __init__(self, hash: str, crc32: int, pack_start_offset: int):
self.hash = hash
self.crc32 = crc32
self.pack_start_offset = pack_start_offset | true | true |
f723e22ccbf007fd40e2124e7515473ede314c02 | 1,440 | py | Python | setup.py | dharif23/xtermcolors | fb35b9b7a04fbf7a0ea236bb94275240c6322b1a | [
"MIT"
] | null | null | null | setup.py | dharif23/xtermcolors | fb35b9b7a04fbf7a0ea236bb94275240c6322b1a | [
"MIT"
] | null | null | null | setup.py | dharif23/xtermcolors | fb35b9b7a04fbf7a0ea236bb94275240c6322b1a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Dalwar Hossain'
__email__ = 'dalwar.hossain@protonmail.com'
from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='pyrainbowterm',
version='1.0',
description='pyrainbowterm - Smart cu... | 32.727273 | 103 | 0.603472 |
__author__ = 'Dalwar Hossain'
__email__ = 'dalwar.hossain@protonmail.com'
from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='pyrainbowterm',
version='1.0',
description='pyrainbowterm - Smart custom print function with color and log infor... | true | true |
f723e3633555478d9d24ed98d7498972bfe2deda | 13,424 | py | Python | pyabsa/core/tc/prediction/text_classifier.py | yangheng95/PyABSA | f5b46047a58fa8054a0469486be3f1cada933814 | [
"MIT"
] | 199 | 2021-06-07T15:07:28.000Z | 2022-03-31T11:53:28.000Z | pyabsa/core/tc/prediction/text_classifier.py | yangheng95/PyABSA | f5b46047a58fa8054a0469486be3f1cada933814 | [
"MIT"
] | 98 | 2021-06-06T06:01:02.000Z | 2022-03-31T15:48:28.000Z | pyabsa/core/tc/prediction/text_classifier.py | yangheng95/PyABSA | f5b46047a58fa8054a0469486be3f1cada933814 | [
"MIT"
] | 55 | 2021-06-10T08:52:17.000Z | 2022-03-31T11:08:58.000Z | # -*- coding: utf-8 -*-
# file: text_classifier.py
# author: yangheng <yangheng@m.scnu.edu.cn>
# Copyright (C) 2020. All Rights Reserved.
import json
import os
import pickle
import random
import numpy
import torch
from findfile import find_file
from termcolor import colored
from torch.utils.data import DataLoader
from... | 45.505085 | 163 | 0.560489 |
import json
import os
import pickle
import random
import numpy
import torch
from findfile import find_file
from termcolor import colored
from torch.utils.data import DataLoader
from transformers import AutoTokenizer, AutoModel
from pyabsa.functional.dataset import detect_infer_dataset
from ..models import GloVeC... | true | true |
f723e39e9c8312aae14d30f2933e41983a1269e0 | 16,210 | py | Python | syfertext/language.py | AlexKer/SyferText | 021eea2255d9d8e1fc49c98c7b5f98b9e516ba21 | [
"Apache-2.0"
] | null | null | null | syfertext/language.py | AlexKer/SyferText | 021eea2255d9d8e1fc49c98c7b5f98b9e516ba21 | [
"Apache-2.0"
] | null | null | null | syfertext/language.py | AlexKer/SyferText | 021eea2255d9d8e1fc49c98c7b5f98b9e516ba21 | [
"Apache-2.0"
] | null | null | null | from .tokenizer import Tokenizer
from .vocab import Vocab
from .doc import Doc
from .pointers.doc_pointer import DocPointer
from .pipeline import SubPipeline
from syft.generic.object import AbstractObject
from syft.workers.base import BaseWorker
from syft.generic.string import String
from syft.generic.pointers.string_... | 39.440389 | 117 | 0.613017 | from .tokenizer import Tokenizer
from .vocab import Vocab
from .doc import Doc
from .pointers.doc_pointer import DocPointer
from .pipeline import SubPipeline
from syft.generic.object import AbstractObject
from syft.workers.base import BaseWorker
from syft.generic.string import String
from syft.generic.pointers.string_... | true | true |
f723e3b85ffbd830c43dccf93a9dd2bd55bc2e30 | 31,635 | py | Python | sdk/python/pulumi_google_native/apigee/v1/rate_plan.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/apigee/v1/rate_plan.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/apigee/v1/rate_plan.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 53.168067 | 724 | 0.676656 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['RatePlanArgs', 'RatePlan']
@pulumi.input_type
class RatePlanArgs:
def __init__(__se... | true | true |
f723e43173495e3c39cb07e034e93d2ac42f8401 | 2,275 | py | Python | frappe/cache_manager.py | karthikeyan5/frappe | d2c652ef3a3cc6997eedcc3925e359e216b8a569 | [
"MIT"
] | null | null | null | frappe/cache_manager.py | karthikeyan5/frappe | d2c652ef3a3cc6997eedcc3925e359e216b8a569 | [
"MIT"
] | null | null | null | frappe/cache_manager.py | karthikeyan5/frappe | d2c652ef3a3cc6997eedcc3925e359e216b8a569 | [
"MIT"
] | null | null | null | # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.desk.notifications import (delete_notification_count_for,
clear_notifications)
common_default_keys = ["__default", "__global"]
... | 27.083333 | 94 | 0.745495 |
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.desk.notifications import (delete_notification_count_for,
clear_notifications)
common_default_keys = ["__default", "__global"]
def clear_user_cache(user=None):
cache = frappe.cache()
groups = ("bootinfo", "user_recent", "... | true | true |
f723e7c0843a98cbd38780ee04a037d43c171c68 | 15,765 | py | Python | dataset_loader.py | fqnchina/NeuralRouting | 333dc95cb2d9a779de88e2349883a0002111d1b3 | [
"MIT"
] | 58 | 2021-03-25T19:18:56.000Z | 2022-03-30T04:59:32.000Z | dataset_loader.py | fqnchina/NeuralRouting | 333dc95cb2d9a779de88e2349883a0002111d1b3 | [
"MIT"
] | null | null | null | dataset_loader.py | fqnchina/NeuralRouting | 333dc95cb2d9a779de88e2349883a0002111d1b3 | [
"MIT"
] | 6 | 2021-06-19T03:48:50.000Z | 2021-07-02T13:05:04.000Z | import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms as tfs
from PIL import Image
import os, cv2, copy, time
from config import *
# args.
image_height, image_width = opt.image_height, opt.image_width
intrinsics = opt.intrinsics
close_radius, f... | 44.159664 | 122 | 0.562195 | import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms as tfs
from PIL import Image
import os, cv2, copy, time
from config import *
image_height, image_width = opt.image_height, opt.image_width
intrinsics = opt.intrinsics
close_radius, far_radiu... | true | true |
f723e84d3365845116c25dda9340902ab173b6cd | 799 | py | Python | core/data/dataloader/__init__.py | HareshKarnan/awesome-semantic-segmentation-pytorch | 3c53fc004973abcb88882dcc8be899570c3053cf | [
"Apache-2.0"
] | null | null | null | core/data/dataloader/__init__.py | HareshKarnan/awesome-semantic-segmentation-pytorch | 3c53fc004973abcb88882dcc8be899570c3053cf | [
"Apache-2.0"
] | null | null | null | core/data/dataloader/__init__.py | HareshKarnan/awesome-semantic-segmentation-pytorch | 3c53fc004973abcb88882dcc8be899570c3053cf | [
"Apache-2.0"
] | null | null | null | """
This module provides data loaders and transformers for popular vision datasets.
"""
from .mscoco import COCOSegmentation
from .cityscapes import CitySegmentation
from .ade import ADE20KSegmentation
from .pascal_voc import VOCSegmentation
from .pascal_aug import VOCAugSegmentation
from .sbu_shadow import SBUSegmenta... | 28.535714 | 79 | 0.767209 | from .mscoco import COCOSegmentation
from .cityscapes import CitySegmentation
from .ade import ADE20KSegmentation
from .pascal_voc import VOCSegmentation
from .pascal_aug import VOCAugSegmentation
from .sbu_shadow import SBUSegmentation
from .ycb import YCBSegmentation
from .robocup import RobocupSegmentation
datasets... | true | true |
f723e8b52caef4e5fb333357c7a8f97adccc1b2a | 11,436 | py | Python | src/roslaunch2/package.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 10 | 2019-11-19T12:35:30.000Z | 2022-01-16T15:59:44.000Z | src/roslaunch2/package.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 1 | 2022-01-11T09:30:36.000Z | 2022-02-07T22:03:36.000Z | src/roslaunch2/package.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 3 | 2019-08-01T08:50:00.000Z | 2021-05-02T01:27:47.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Adrian Böckenkamp
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
# Date: 08/06/2020
import rospkg
import os
import sys
import Pyro4
from . import logger
class Package:
"""
Encapsulates a ROS package and its ability to find files in... | 39.030717 | 119 | 0.612977 |
import rospkg
import os
import sys
import Pyro4
from . import logger
class Package:
__pkg_cache = {}
__dir_cache = {}
__find_cache = {}
@staticmethod
def invalidate_cache():
Package.__pkg_cache = {}
Package.__dir_cache = {}
Package.__find_cache = {}
@staticmet... | true | true |
f723e8f7914d47ae6d2455622f8a55aacd1c6ccf | 72 | py | Python | cibin/__init__.py | betochimasan/AntibodyCocktailEfficiency | 67850eb85d502af80b691b49001803f2e3091a0b | [
"BSD-3-Clause"
] | null | null | null | cibin/__init__.py | betochimasan/AntibodyCocktailEfficiency | 67850eb85d502af80b691b49001803f2e3091a0b | [
"BSD-3-Clause"
] | null | null | null | cibin/__init__.py | betochimasan/AntibodyCocktailEfficiency | 67850eb85d502af80b691b49001803f2e3091a0b | [
"BSD-3-Clause"
] | null | null | null | """
The Cibin package.
"""
__version__ = "0.0.1"
from .cibin import *
| 9 | 21 | 0.611111 |
__version__ = "0.0.1"
from .cibin import *
| true | true |
f723e91ac20eac5aead5f13782edc311af79e501 | 4,293 | py | Python | python/cairo/text_align_center.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 23 | 2015-06-08T13:01:00.000Z | 2021-12-30T08:20:04.000Z | python/cairo/text_align_center.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 1 | 2020-10-22T02:36:10.000Z | 2020-10-22T02:36:10.000Z | python/cairo/text_align_center.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 7 | 2017-10-31T09:48:14.000Z | 2022-01-04T15:59:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | 37.008621 | 89 | 0.699278 |
import cairo
import math
WIDTH, HEIGHT = 400, 400
def main():
surface = cairo.SVGSurface("text_align_center.svg", WIDTH, HEIGHT)
context = cairo.Context(surface)
... | true | true |
f723e929ff2525653af0e5fc4da9eb8c8a0a5165 | 532 | py | Python | deploy.py | oneofthezombies/cpp-enum-class-string-idl | e1188e6a94d5c7c6a4bc6a7d025b12f4d22c53e1 | [
"MIT"
] | 1 | 2021-05-08T08:34:09.000Z | 2021-05-08T08:34:09.000Z | deploy.py | oneofthezombies/argparse-best-practice | c29bffb014bb66d7694e4e27ad2911cc5abb3eef | [
"MIT"
] | null | null | null | deploy.py | oneofthezombies/argparse-best-practice | c29bffb014bb66d7694e4e27ad2911cc5abb3eef | [
"MIT"
] | null | null | null | from shutil import rmtree
from subprocess import run
from pathlib import Path
from itertools import chain
from more_itertools import consume
dirnames = ['build', 'dist']
paths = map(lambda path: Path(path), dirnames)
outputs = chain(paths, Path().glob('*.egg-info'))
exists = filter(lambda path: path.exists(), outputs... | 31.294118 | 71 | 0.721805 | from shutil import rmtree
from subprocess import run
from pathlib import Path
from itertools import chain
from more_itertools import consume
dirnames = ['build', 'dist']
paths = map(lambda path: Path(path), dirnames)
outputs = chain(paths, Path().glob('*.egg-info'))
exists = filter(lambda path: path.exists(), outputs... | true | true |
f723ea0c1c6678a854eaf1b914ce06a246ec9ada | 32,902 | py | Python | api/registrations/serializers.py | mattclarkcos/osf.io | 0e5ee8c0ff2a9bc7449061124ac8ce6d00f775ca | [
"Apache-2.0"
] | null | null | null | api/registrations/serializers.py | mattclarkcos/osf.io | 0e5ee8c0ff2a9bc7449061124ac8ce6d00f775ca | [
"Apache-2.0"
] | 4 | 2022-02-26T03:28:02.000Z | 2022-03-08T23:36:45.000Z | api/registrations/serializers.py | mattclarkcos/osf.io | 0e5ee8c0ff2a9bc7449061124ac8ce6d00f775ca | [
"Apache-2.0"
] | null | null | null | import pytz
import json
from unicodedata import normalize
from distutils.version import StrictVersion
from django.core.exceptions import ValidationError
from rest_framework import serializers as ser
from rest_framework import exceptions
from api.base.exceptions import Conflict, InvalidModelValueError, JSONAPIException... | 42.619171 | 133 | 0.687891 | import pytz
import json
from unicodedata import normalize
from distutils.version import StrictVersion
from django.core.exceptions import ValidationError
from rest_framework import serializers as ser
from rest_framework import exceptions
from api.base.exceptions import Conflict, InvalidModelValueError, JSONAPIException... | true | true |
f723eb375382b38526c20e9d0239da24728a5d3d | 698 | py | Python | tests/nested_foreign_keys/models.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/nested_foreign_keys/models.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/nested_foreign_keys/models.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
class Movie(models.Model):
title = models.CharField(max_length=200)
director = models.ForeignKey(Person, models.CASCADE)
class Event(models.Model):
pass
class Screening(Event):
m... | 22.516129 | 79 | 0.717765 | from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
class Movie(models.Model):
title = models.CharField(max_length=200)
director = models.ForeignKey(Person, models.CASCADE)
class Event(models.Model):
pass
class Screening(Event):
m... | true | true |
f723eb9b8474a649714e9207663dcbb042ef7f19 | 14,422 | py | Python | scipy/optimize/tests/test_linesearch.py | ischrot/scipy_rmt_bsc | 1dd8f7f0ee7ac1311ed1735ca6b6025150524418 | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_linesearch.py | ischrot/scipy_rmt_bsc | 1dd8f7f0ee7ac1311ed1735ca6b6025150524418 | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_linesearch.py | ischrot/scipy_rmt_bsc | 1dd8f7f0ee7ac1311ed1735ca6b6025150524418 | [
"BSD-3-Clause"
] | null | null | null | """
Tests for line search routines
"""
from numpy.testing import (assert_, assert_equal, assert_array_almost_equal,
assert_array_almost_equal_nulp, assert_warns,
suppress_warnings)
import scipy.optimize.linesearch as ls
import scipy.optimize.nonlin as nl #(LS)
from ... | 35.348039 | 123 | 0.533491 | from numpy.testing import (assert_, assert_equal, assert_array_almost_equal,
assert_array_almost_equal_nulp, assert_warns,
suppress_warnings)
import scipy.optimize.linesearch as ls
import scipy.optimize.nonlin as nl
from scipy.linalg import norm
from scipy.optimize... | true | true |
f723ece8e845f677ad57a09ea90a361f54d50c23 | 12,408 | bzl | Python | apple/internal/apple_toolchains.bzl | wendyliga/rules_apple | ac43c1e467564d9df6b3355ff93fcaf224f2c0f9 | [
"Apache-2.0"
] | null | null | null | apple/internal/apple_toolchains.bzl | wendyliga/rules_apple | ac43c1e467564d9df6b3355ff93fcaf224f2c0f9 | [
"Apache-2.0"
] | null | null | null | apple/internal/apple_toolchains.bzl | wendyliga/rules_apple | ac43c1e467564d9df6b3355ff93fcaf224f2c0f9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 39.390476 | 100 | 0.651273 |
AppleMacToolsToolchainInfo = provider(
doc = """
Propagates information about an Apple toolchain to internal bundling rules that use the toolchain.
This provider exists as an internal detail for the rules to reference common, executable tools and
files used as script templates for the purposes of ex... | true | true |
f723ee4aca2ba51e913883657260206b3974214b | 597 | py | Python | psaw/decorators.py | LeartS/PSAW | fd0faac7205e10cc6fcb3654de8e2b23a0d79bf2 | [
"MIT"
] | null | null | null | psaw/decorators.py | LeartS/PSAW | fd0faac7205e10cc6fcb3654de8e2b23a0d79bf2 | [
"MIT"
] | null | null | null | psaw/decorators.py | LeartS/PSAW | fd0faac7205e10cc6fcb3654de8e2b23a0d79bf2 | [
"MIT"
] | null | null | null | from .exceptions import PSAWException
def requires_private_key(method):
def wrapper(self, *args, **kwargs):
if not self.private_key:
raise PSAWException(
'The {} method requires a private key'.format(method.__name__))
return method(self, *args, **kwargs)
return wrapp... | 33.166667 | 79 | 0.633166 | from .exceptions import PSAWException
def requires_private_key(method):
def wrapper(self, *args, **kwargs):
if not self.private_key:
raise PSAWException(
'The {} method requires a private key'.format(method.__name__))
return method(self, *args, **kwargs)
return wrapp... | true | true |
f723ee57e5b3ea5abd16c6bfccb377f6f8af7698 | 532 | py | Python | stats/attendance.py | lxchen2019/Python-Baseball | 0498830e92c67de8221aac1777651ae141df0ec6 | [
"MIT"
] | null | null | null | stats/attendance.py | lxchen2019/Python-Baseball | 0498830e92c67de8221aac1777651ae141df0ec6 | [
"MIT"
] | null | null | null | stats/attendance.py | lxchen2019/Python-Baseball | 0498830e92c67de8221aac1777651ae141df0ec6 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
from data import games
attendance = games.loc[(games['type'] == 'info') & (games['multi2'] == 'attendance'), ['year', 'multi3']]
attendance.columns = ['year', 'attendance']
attendance.loc[:, 'attendance'] = pd.to_numeric(attendance.loc[:, 'attendance'])
attendance.... | 33.25 | 105 | 0.680451 | import pandas as pd
import matplotlib.pyplot as plt
from data import games
attendance = games.loc[(games['type'] == 'info') & (games['multi2'] == 'attendance'), ['year', 'multi3']]
attendance.columns = ['year', 'attendance']
attendance.loc[:, 'attendance'] = pd.to_numeric(attendance.loc[:, 'attendance'])
attendance.... | true | true |
f723ef0ead92ce0867c0219f60d16635c90e2cd6 | 2,755 | py | Python | ch1/recipe4/load_save_model.py | xinglu/Tensorflow-2.0-Computer-Vision-Cookbook | d02c57d566f9df8b5980d58fc51a1194faef442c | [
"MIT"
] | 1 | 2021-11-27T05:44:01.000Z | 2021-11-27T05:44:01.000Z | ch1/recipe4/load_save_model.py | ArjunVarma39/Tensorflow-2.0-Computer-Vision-Cookbook | 92ea6713f664cff9eccaaccea8ac756f808e2066 | [
"MIT"
] | null | null | null | ch1/recipe4/load_save_model.py | ArjunVarma39/Tensorflow-2.0-Computer-Vision-Cookbook | 92ea6713f664cff9eccaaccea8ac756f808e2066 | [
"MIT"
] | 1 | 2021-01-21T04:36:33.000Z | 2021-01-21T04:36:33.000Z | import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import *
from tensorflow.keras.models import *
def load_data():
(X_train, y_train), (X_test, y_test) = mnist.load_data()... | 34.012346 | 91 | 0.684211 | import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import *
from tensorflow.keras.models import *
def load_data():
(X_train, y_train), (X_test, y_test) = mnist.load_data()... | true | true |
f723f0b24682ef7fb196a22b5764bea459ee3007 | 1,103 | py | Python | String-Algorithms/String-Algorithms-master/One Edit Away/oneEditAway.py | SrijaniSom/dsa-code-store | 148292c8f963214629f271ec8601e73d3d0e145e | [
"MIT"
] | 3 | 2021-02-19T07:09:46.000Z | 2021-10-04T10:12:45.000Z | String-Algorithms/String-Algorithms-master/One Edit Away/oneEditAway.py | SrijaniSom/dsa-code-store | 148292c8f963214629f271ec8601e73d3d0e145e | [
"MIT"
] | 6 | 2021-02-21T19:35:18.000Z | 2021-05-06T11:51:37.000Z | String-Algorithms/String-Algorithms-master/One Edit Away/oneEditAway.py | SrijaniSom/dsa-code-store | 148292c8f963214629f271ec8601e73d3d0e145e | [
"MIT"
] | 6 | 2021-02-21T19:28:03.000Z | 2021-10-04T03:35:57.000Z | class solution:
def oneEditAwayInsert(self,input1,input2):
index1 = 0
index2 = 0
while((index2 < len(input2)) and (index1 < len(input1))):
if(input1[index1] != input2[index2]):
if(index1 != index2):
return False
index2+=1
... | 29.810811 | 65 | 0.537625 | class solution:
def oneEditAwayInsert(self,input1,input2):
index1 = 0
index2 = 0
while((index2 < len(input2)) and (index1 < len(input1))):
if(input1[index1] != input2[index2]):
if(index1 != index2):
return False
index2+=1
... | true | true |
f723f2da7cb69cc97d7d2508483485aef439d3c6 | 5,384 | py | Python | 1-50/p13.py | YiWeiShen/Project-Euler-Hints | a79cacab075dd98d393516f083aaa7ffc6115a06 | [
"MIT"
] | 1 | 2019-02-25T13:00:31.000Z | 2019-02-25T13:00:31.000Z | 1-50/p13.py | YiWeiShen/Project-Euler-Hints | a79cacab075dd98d393516f083aaa7ffc6115a06 | [
"MIT"
] | null | null | null | 1-50/p13.py | YiWeiShen/Project-Euler-Hints | a79cacab075dd98d393516f083aaa7ffc6115a06 | [
"MIT"
] | null | null | null | l = []
a = '37107287533902102798797998220837590246510135740250\
46376937677490009712648124896970078050417018260538\
74324986199524741059474233309513058123726617309629\
91942213363574161572522430563301811072406154908250\
23067588207539346171171980310421047513778063246676\
89261670696623633820136378418383684178734361726... | 47.646018 | 56 | 0.944279 | l = []
a = '37107287533902102798797998220837590246510135740250\
46376937677490009712648124896970078050417018260538\
74324986199524741059474233309513058123726617309629\
91942213363574161572522430563301811072406154908250\
23067588207539346171171980310421047513778063246676\
89261670696623633820136378418383684178734361726... | true | true |
f723f3fb8c08361f204ed3b00ea1c886a4107a59 | 1,457 | py | Python | botutils/searchforlinks.py | yashprakash13/Honeysuckle | d8adb83a63318a8c4994d18aea6fd28116b46f4e | [
"MIT"
] | 2 | 2020-08-11T17:23:05.000Z | 2021-02-20T04:02:33.000Z | botutils/searchforlinks.py | yashprakash13/Honeysuckle | d8adb83a63318a8c4994d18aea6fd28116b46f4e | [
"MIT"
] | null | null | null | botutils/searchforlinks.py | yashprakash13/Honeysuckle | d8adb83a63318a8c4994d18aea6fd28116b46f4e | [
"MIT"
] | 1 | 2020-08-15T05:29:14.000Z | 2020-08-15T05:29:14.000Z | import re
import requests
from bs4 import BeautifulSoup
from botutils.constants import IS_URL_REGEX
def get_ffn_url_from_query(query):
ffn_list = []
href = []
url = 'https://www.google.com/search?q=' + \
query+"+fanfiction"
page = requests.get(url)
soup = BeautifulSoup(page.content, 'h... | 22.075758 | 80 | 0.614276 | import re
import requests
from bs4 import BeautifulSoup
from botutils.constants import IS_URL_REGEX
def get_ffn_url_from_query(query):
ffn_list = []
href = []
url = 'https://www.google.com/search?q=' + \
query+"+fanfiction"
page = requests.get(url)
soup = BeautifulSoup(page.content, 'h... | true | true |
f723f47402f819e72e9efeddd056d1ccea3fb2f6 | 1,107 | py | Python | bach/tests/unit/bach/test_series_json.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | 23 | 2021-11-10T21:37:42.000Z | 2022-03-30T11:46:19.000Z | bach/tests/unit/bach/test_series_json.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | 163 | 2021-11-10T10:11:26.000Z | 2022-03-31T16:04:27.000Z | bach/tests/unit/bach/test_series_json.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2022 Objectiv B.V.
"""
import pytest
from bach.series.series_json import JsonBigQueryAccessorImpl
from tests.unit.bach.util import get_fake_df
@pytest.mark.skip_postgres
def test_bq_get_slice_partial_expr(dialect):
# Here we test the _get_slice_partial_expr function of the BigQuery specific JsonBi... | 36.9 | 105 | 0.712737 | import pytest
from bach.series.series_json import JsonBigQueryAccessorImpl
from tests.unit.bach.util import get_fake_df
@pytest.mark.skip_postgres
def test_bq_get_slice_partial_expr(dialect):
df = get_fake_df(
dialect=dialect,
index_names=['i'],
data_names=['a'],
dtype=... | true | true |
f723f53cdb2ac0facc06438330246f32fcc5c7e7 | 3,101 | py | Python | pupil/models/clustering.py | hadi-gharibi/pupil | 9d266572cc1ebf659e87206be6e5f1548959d510 | [
"Apache-2.0"
] | 2 | 2022-03-31T23:17:14.000Z | 2022-03-31T23:24:58.000Z | pupil/models/clustering.py | hadi-gharibi/pupil | 9d266572cc1ebf659e87206be6e5f1548959d510 | [
"Apache-2.0"
] | null | null | null | pupil/models/clustering.py | hadi-gharibi/pupil | 9d266572cc1ebf659e87206be6e5f1548959d510 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Dict, Protocol, Tuple
import faiss
import numpy as np
from pupil.types import NDArray2D
from sklearn.cluster import AgglomerativeClustering
class Clustering(Protocol):
n_clusters: int
def fit(self, X: NDArray2D):
...
def predict(self, X: ND... | 28.981308 | 132 | 0.603354 | from abc import ABC, abstractmethod
from typing import Dict, Protocol, Tuple
import faiss
import numpy as np
from pupil.types import NDArray2D
from sklearn.cluster import AgglomerativeClustering
class Clustering(Protocol):
n_clusters: int
def fit(self, X: NDArray2D):
...
def predict(self, X: ND... | true | true |
f723f5a286cb6bd6f00ddea9012b0aaff76a5524 | 6,044 | py | Python | sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query3.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 2 | 2017-12-19T18:34:54.000Z | 2019-05-14T21:50:06.000Z | sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query3.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 80 | 2020-01-16T09:55:09.000Z | 2020-10-03T13:43:07.000Z | sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query3.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 1 | 2020-11-11T18:45:54.000Z | 2020-11-11T18:45:54.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 38.012579 | 89 | 0.720218 |
from __future__ import absolute_import
import logging
import apache_beam as beam
from apache_beam.testing.benchmarks.nexmark.models import nexmark_model
from apache_beam.testing.benchmarks.nexmark.queries import nexmark_query_util
from apache_beam.testing.benchmarks.nexmark.queries.nexmark_query_uti... | true | true |
f723f5e67a95794ea25c2e636d620a2789ac60ad | 48,091 | py | Python | core/controllers/admin.py | Ragify/oppia | a530c7e4d5274b646afc7dd7040d13c7ed45b829 | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:53.000Z | 2022-02-06T13:00:14.000Z | core/controllers/admin.py | Ragify/oppia | a530c7e4d5274b646afc7dd7040d13c7ed45b829 | [
"Apache-2.0"
] | null | null | null | core/controllers/admin.py | Ragify/oppia | a530c7e4d5274b646afc7dd7040d13c7ed45b829 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 38.814366 | 80 | 0.587823 |
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import logging
import random
from core import feconf
from core import python_utils
from core import utils
from core.constants import constants
from core.controllers import acl_decorators
from core.controllers impor... | true | true |
f723f6aed494f61892583333010aad58dbc25f9a | 1,503 | py | Python | test/test_maintenance_configuration_api.py | cvent/octopus-deploy-api-client | 0e03e842e1beb29b132776aee077df570b88366a | [
"Apache-2.0"
] | null | null | null | test/test_maintenance_configuration_api.py | cvent/octopus-deploy-api-client | 0e03e842e1beb29b132776aee077df570b88366a | [
"Apache-2.0"
] | null | null | null | test/test_maintenance_configuration_api.py | cvent/octopus-deploy-api-client | 0e03e842e1beb29b132776aee077df570b88366a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Octopus Server API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2019.6.7+Branch.tags-2019.6.7.Sha.aa18dc6809953218c66f57eff7d26481d9b23d6a
Generated by: https://github.com/swagger-api... | 31.978723 | 129 | 0.795742 |
from __future__ import absolute_import
import unittest
import octopus_deploy_swagger_client
from octopus_deploy_client.maintenance_configuration_api import MaintenanceConfigurationApi
from octopus_deploy_swagger_client.rest import ApiException
class TestMaintenanceConfigurationApi(unittest.TestCase):
def... | true | true |
f723f6d3146fbf9c9696d5956391430c0797a221 | 6,843 | py | Python | src/azure-cli/setup.py | t-bzhan/azure-cli | d64b25204b661438e9284f261bc5a11f3221c837 | [
"MIT"
] | null | null | null | src/azure-cli/setup.py | t-bzhan/azure-cli | d64b25204b661438e9284f261bc5a11f3221c837 | [
"MIT"
] | null | null | null | src/azure-cli/setup.py | t-bzhan/azure-cli | d64b25204b661438e9284f261bc5a11f3221c837 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 34.044776 | 103 | 0.604998 |
from __future__ import print_function
from codecs import open
from setuptools import setup, find_packages
import sys
try:
from azure_cli_bdist_wheel import cmdclass
except ImportError:
from distutils import log as logger
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass... | true | true |
f723f6f2ec0f62ea9f018768408724d303030146 | 1,583 | py | Python | valid_subsequence.py | GerardCod/algoexpert-python | 35d7f635f68e0d28eaead815f653bf749aa275cb | [
"Apache-2.0"
] | null | null | null | valid_subsequence.py | GerardCod/algoexpert-python | 35d7f635f68e0d28eaead815f653bf749aa275cb | [
"Apache-2.0"
] | null | null | null | valid_subsequence.py | GerardCod/algoexpert-python | 35d7f635f68e0d28eaead815f653bf749aa275cb | [
"Apache-2.0"
] | null | null | null | def validateSubSequence(array, sequence):
"""
### Description
validateSubSequence -> validates if a sequence of elements is a subsequence of a list.
### Parameters
- array: the list where it will validate the subsequence.
- sequence: the potential subsequence of elements
... | 29.867925 | 94 | 0.598863 | def validateSubSequence(array, sequence):
arrIdx = 0
seqIdx = 0
while arrIdx < len(array) and seqIdx < len(sequence):
if array[arrIdx] == sequence[seqIdx]:
seqIdx += 1
arrIdx += 1
return seqIdx == len(sequence)
def validateSubSequenceFor(array, sequence):
... | true | true |
f723f81e9a3f4e12dffa9c9a8c28e3e333ab9a3c | 3,092 | py | Python | fhirbug/Fhir/Resources/address.py | VerdantAI/fhirbug | 8a8e2555c0edfeee0a7edbc8d67f2fcb2edd3c2d | [
"MIT"
] | 8 | 2019-01-06T18:11:20.000Z | 2022-02-24T02:06:55.000Z | fhirbug/Fhir/Resources/address.py | VerdantAI/fhirbug | 8a8e2555c0edfeee0a7edbc8d67f2fcb2edd3c2d | [
"MIT"
] | 5 | 2019-01-25T14:15:35.000Z | 2021-06-01T23:22:41.000Z | fhirbug/Fhir/Resources/address.py | VerdantAI/fhirbug | 8a8e2555c0edfeee0a7edbc8d67f2fcb2edd3c2d | [
"MIT"
] | 3 | 2020-10-14T23:09:29.000Z | 2021-08-09T19:27:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Address) on 2019-01-25.
# 2019, SMART Health IT.
##
from . import element
class Address(element.Element):
""" An address expressed using postal conventions (as opposed to GPS or other... | 32.547368 | 104 | 0.583441 |
from . import element
class Address(element.Element):
resource_type = "Address"
def __init__(self, jsondict=None, strict=True, **kwargs):
self.city = None
self.country = None
self.district = None
self.line = None
self.period = None
self.postalCode ... | true | true |
f723f8a8d4760f751862af7dd8140ab1cad4f937 | 755 | py | Python | setup.py | salesforce/bite | 0619bc6d87b81ec65cf311906da3889043176ead | [
"BSD-3-Clause"
] | 6 | 2020-12-09T01:57:13.000Z | 2021-10-09T01:50:21.000Z | setup.py | salesforce/bite | 0619bc6d87b81ec65cf311906da3889043176ead | [
"BSD-3-Clause"
] | 1 | 2021-02-16T14:50:09.000Z | 2021-02-23T07:29:15.000Z | setup.py | salesforce/bite | 0619bc6d87b81ec65cf311906da3889043176ead | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="bite",
version="0.1",
author="Samson Tan",
author_email="samson.tan@salesforce.com",
description="A tokenizer that splits words into bases and inflections.",
long_descriptio... | 30.2 | 76 | 0.65298 | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="bite",
version="0.1",
author="Samson Tan",
author_email="samson.tan@salesforce.com",
description="A tokenizer that splits words into bases and inflections.",
long_descriptio... | true | true |
f723f8c5703335b1a0fa5a181861df8ecc2a13f8 | 6,240 | py | Python | python/istio_api/mixer/v1/config/client/service_pb2.py | mt-inside/api | 3197d4dee332beb55f830899f37091c9899833f9 | [
"Apache-2.0"
] | 3 | 2020-11-30T15:35:37.000Z | 2022-01-06T14:17:18.000Z | python/istio_api/mixer/v1/config/client/service_pb2.py | mt-inside/api | 3197d4dee332beb55f830899f37091c9899833f9 | [
"Apache-2.0"
] | 54 | 2020-06-23T17:34:04.000Z | 2022-03-31T02:04:06.000Z | python/istio_api/mixer/v1/config/client/service_pb2.py | mt-inside/api | 3197d4dee332beb55f830899f37091c9899833f9 | [
"Apache-2.0"
] | 12 | 2020-07-14T23:59:57.000Z | 2022-03-22T09:59:18.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mixer/v1/config/client/service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
f... | 41.6 | 624 | 0.747276 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
f723fa96b4b622359c95f9d0ad4cdd27364d7401 | 3,267 | py | Python | tests/test_paper_collection.py | h1-the-swan/paper_collection | f07ad5cd8c40ddd75df2031b15c49eee60f1d914 | [
"MIT"
] | null | null | null | tests/test_paper_collection.py | h1-the-swan/paper_collection | f07ad5cd8c40ddd75df2031b15c49eee60f1d914 | [
"MIT"
] | 2 | 2020-03-31T11:20:29.000Z | 2020-03-31T15:20:21.000Z | tests/test_paper_collection.py | h1-the-swan/paper_collection | f07ad5cd8c40ddd75df2031b15c49eee60f1d914 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Tests for `paper_collection` package."""
import unittest
from paper_collection import paper_collection
import pandas as pd
import numpy as np
class TestPaper_collection(unittest.TestCase):
"""Tests for `paper_collection` package."""
def setUp(self):
"""Set up test fixtur... | 38.435294 | 95 | 0.585859 |
import unittest
from paper_collection import paper_collection
import pandas as pd
import numpy as np
class TestPaper_collection(unittest.TestCase):
def setUp(self):
self.df_papers = pd.read_csv('tests/jw_papers_mag2019.tsv', sep='\t')
self.df_papers.drop_duplicates(subset=['PaperId'], inpla... | true | true |
f723faadd5d49357ab40cc0e11d377652ed79a23 | 541 | py | Python | scripts/idc/sortsymbols.py | camden314/CacaoSDK | 57b7e0654595eb7a432ef1faec9b239a3854cf45 | [
"MIT"
] | 4 | 2021-01-26T10:00:43.000Z | 2021-08-06T21:35:15.000Z | scripts/idc/sortsymbols.py | camden314/CacaoSDK | 57b7e0654595eb7a432ef1faec9b239a3854cf45 | [
"MIT"
] | 2 | 2021-07-26T01:55:43.000Z | 2021-07-26T17:42:20.000Z | scripts/idc/sortsymbols.py | camden314/CacaoSDK | 57b7e0654595eb7a432ef1faec9b239a3854cf45 | [
"MIT"
] | 1 | 2021-06-01T17:40:01.000Z | 2021-06-01T17:40:01.000Z | import re
l = []
with open("functionsthunk.txt", "r") as f:
s = f.readlines()
for k, m in zip(s[0::2], s[1::2]):
if 'non-virtual' not in k:
l.append((k, m))
def sfun(a):
m = re.search(r"(?:non-virtual thunk to )?(.+?\(.*\)(?: const)?\n.+\n\n)", a)
print(a)
return m.group(1)
with open("functions.tx... | 24.590909 | 81 | 0.502773 | import re
l = []
with open("functionsthunk.txt", "r") as f:
s = f.readlines()
for k, m in zip(s[0::2], s[1::2]):
if 'non-virtual' not in k:
l.append((k, m))
def sfun(a):
m = re.search(r"(?:non-virtual thunk to )?(.+?\(.*\)(?: const)?\n.+\n\n)", a)
print(a)
return m.group(1)
with open("functions.tx... | true | true |
f723fbc0745a9cea8325676af39c388286cf6b75 | 10,985 | py | Python | search/skip_list_search.py | AstiaSun/Search-Engine | 2c04031f1c21d7ea78e6ce61a53349d538905cbe | [
"MIT"
] | null | null | null | search/skip_list_search.py | AstiaSun/Search-Engine | 2c04031f1c21d7ea78e6ce61a53349d538905cbe | [
"MIT"
] | null | null | null | search/skip_list_search.py | AstiaSun/Search-Engine | 2c04031f1c21d7ea78e6ce61a53349d538905cbe | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from enum import Enum
from typing import Optional
from common.constants import PATH_TO_LIST_OF_FILES, SPLIT
OPERATION_CODES = Enum('OPERATION_CODES', 'AND OR NOT')
ALL = '*'
@dataclass
class DocumentNode:
"""
Data structure used to implement skip list. Contains a reference
... | 35.665584 | 83 | 0.570505 | from dataclasses import dataclass
from enum import Enum
from typing import Optional
from common.constants import PATH_TO_LIST_OF_FILES, SPLIT
OPERATION_CODES = Enum('OPERATION_CODES', 'AND OR NOT')
ALL = '*'
@dataclass
class DocumentNode:
id: int
next_id_index: Optional[int]
def __eq__(s... | true | true |
f723fc45ed2a21c26e65c590692824efb0148cf6 | 395 | py | Python | backend/main.py | SwiftWinds/LAHacks | 2bfeb7e073e6624ab5bd91ce9feceb3eab7965e7 | [
"MIT"
] | 1 | 2020-03-29T06:10:04.000Z | 2020-03-29T06:10:04.000Z | backend/main.py | SwiftWinds/LAHacks | 2bfeb7e073e6624ab5bd91ce9feceb3eab7965e7 | [
"MIT"
] | 8 | 2020-03-29T01:47:47.000Z | 2022-02-27T12:43:08.000Z | backend/main.py | SwiftWinds/LAHacks | 2bfeb7e073e6624ab5bd91ce9feceb3eab7965e7 | [
"MIT"
] | null | null | null | from flask import Flask, session, request
app = Flask(__name__)
@app.route('/upload', methods=['GET', 'POST'])
def hello_world():
if request.method == 'POST':
session['audio_data'] = request.form['audio_data']
print(session['audio_data'])
# abc = vars(request)
# for i in abc:
... | 30.384615 | 58 | 0.594937 | from flask import Flask, session, request
app = Flask(__name__)
@app.route('/upload', methods=['GET', 'POST'])
def hello_world():
if request.method == 'POST':
session['audio_data'] = request.form['audio_data']
print(session['audio_data'])
return "Uploaded Audio"
... | true | true |
f723fcc14afc0f2cce14de94db3fff3d2351f6e1 | 1,122 | py | Python | var/spack/repos/builtin/packages/chrony/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/chrony/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/chrony/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Chrony(AutotoolsPackage):
"""chrony is a versatile implementation of the Network Time
... | 41.555556 | 95 | 0.757576 |
from spack import *
class Chrony(AutotoolsPackage):
homepage = "https://chrony.tuxfamily.org/"
url = "https://github.com/mlichvar/chrony/archive/3.5.1.tar.gz"
version('3.5.1', sha256='881085b944a14853402e1c5cff4de5d815ff104ec6e12eea51c12e42f32f71bd')
version('3.5', sha256='145a270fe4df42... | true | true |
f723fdf48d7b23a6b7b5b3707c12e799fe8951e0 | 45 | py | Python | sbody/alignment/mesh_distance/__init__.py | Rubikplayer/flame-fitting | db3d622547b83ab158dceb46a5d049781e6e6c3a | [
"AAL"
] | 394 | 2017-11-25T13:26:27.000Z | 2022-03-28T07:19:05.000Z | sbody/alignment/mesh_distance/__init__.py | Rubikplayer/flame-fitting | db3d622547b83ab158dceb46a5d049781e6e6c3a | [
"AAL"
] | 25 | 2017-11-30T04:26:32.000Z | 2022-03-10T10:27:54.000Z | sbody/alignment/mesh_distance/__init__.py | Rubikplayer/flame-fitting | db3d622547b83ab158dceb46a5d049781e6e6c3a | [
"AAL"
] | 84 | 2017-11-27T05:42:43.000Z | 2022-03-30T02:56:48.000Z | from sbody.alignment.mesh_distance import *
| 22.5 | 44 | 0.822222 | from sbody.alignment.mesh_distance import *
| true | true |
f723ff274099a624e2dce58b9a204bbe4255d1c3 | 67,751 | py | Python | mindspore/nn/optim/thor.py | mindspore-ai/mindspore | a9fbb25530a2874166ff0045ddcdfc73207bf5eb | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | mindspore/nn/optim/thor.py | mindspore-ai/mindspore | a9fbb25530a2874166ff0045ddcdfc73207bf5eb | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | mindspore/nn/optim/thor.py | mindspore-ai/mindspore | a9fbb25530a2874166ff0045ddcdfc73207bf5eb | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 51.678871 | 120 | 0.615061 |
import numpy as np
from mindspore.ops import functional as F, composite as C, operations as P
from mindspore.common.initializer import initializer
from mindspore.common.parameter import Parameter, ParameterTuple
from mindspore.common.tensor import Tensor
import mindspore.nn as nn
import mindspore.common.d... | true | true |
f724002fa49e096c91bf4ad7fbf5255ed93e8e91 | 10,946 | py | Python | packages/fetchai/protocols/register/message.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | packages/fetchai/protocols/register/message.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | packages/fetchai/protocols/register/message.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021 fetchai
#
# 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
#
#... | 38.272727 | 115 | 0.504659 |
import logging
from typing import Dict, Set, Tuple, cast
from aea.configurations.base import PublicId
from aea.exceptions import AEAEnforceError, enforce
from aea.protocols.base import Message
_default_logger = logging.getLogger("aea.packages.fetchai.protocols.register.message")
DEFAULT_BODY_SIZ... | true | true |
f72400b1078101ea758b0e655b5076476f1d0bd0 | 1,995 | py | Python | dbops_venv/lib/python3.5/site-packages/alembic/templates/generic/env.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | 36 | 2015-01-03T07:57:07.000Z | 2019-12-09T10:48:08.000Z | dbops_venv/lib/python3.5/site-packages/alembic/templates/generic/env.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | 4 | 2015-01-08T20:18:49.000Z | 2015-08-12T18:09:21.000Z | dbops_venv/lib/python3.5/site-packages/alembic/templates/generic/env.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | 11 | 2015-02-07T01:03:23.000Z | 2021-09-24T07:13:38.000Z | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | 27.708333 | 69 | 0.704261 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
config = context.config
fileConfig(config.config_file_name)
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
t... | true | true |
f72400dd434d64329eb589b199f10dc4c9c14be1 | 14,518 | py | Python | shapSD/pysubgroup/nominal_target.py | XiaoqiMa/shapSD | 545f61c9e8329c7271051f22f99ba32508ba74a1 | [
"MIT"
] | 2 | 2019-06-26T21:31:03.000Z | 2019-06-27T16:59:58.000Z | shapSD/pysubgroup/nominal_target.py | XiaoqiMa/shapSD | 545f61c9e8329c7271051f22f99ba32508ba74a1 | [
"MIT"
] | null | null | null | shapSD/pysubgroup/nominal_target.py | XiaoqiMa/shapSD | 545f61c9e8329c7271051f22f99ba32508ba74a1 | [
"MIT"
] | null | null | null | '''
Created on 29.09.2017
@author: lemmerfn
'''
import numpy as np
import scipy.stats
from functools import total_ordering
from .measures import AbstractInterestingnessMeasure, BoundedInterestingnessMeasure
from .utils import effective_sample_size, powerset
from .subgroup import SubgroupDescription, Subgroup, Nominal... | 49.549488 | 134 | 0.694655 | import numpy as np
import scipy.stats
from functools import total_ordering
from .measures import AbstractInterestingnessMeasure, BoundedInterestingnessMeasure
from .utils import effective_sample_size, powerset
from .subgroup import SubgroupDescription, Subgroup, NominalSelector
@total_ordering
class NominalTarget(ob... | true | true |
f724016dd1c040c5547f313a4d9c94947563f287 | 37 | py | Python | cushead/generator/__init__.py | mrsantos321/customhead | bb70867afc34abe7a2ef76bb0f92c08d7ff38214 | [
"MIT"
] | 3 | 2019-10-08T06:02:23.000Z | 2020-01-22T09:14:35.000Z | cushead/generator/__init__.py | mrsantos321/cushead | bb70867afc34abe7a2ef76bb0f92c08d7ff38214 | [
"MIT"
] | 297 | 2019-08-22T19:45:23.000Z | 2022-03-26T02:30:25.000Z | cushead/generator/__init__.py | mrsantos321/cushead | bb70867afc34abe7a2ef76bb0f92c08d7ff38214 | [
"MIT"
] | 5 | 2019-09-25T02:35:04.000Z | 2021-03-31T04:23:47.000Z | """
Handle the files generation.
"""
| 9.25 | 28 | 0.648649 | true | true | |
f724019f2879e58a1cc31e046087322927173612 | 21,423 | py | Python | train.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 14 | 2017-07-21T18:31:21.000Z | 2022-01-21T11:39:45.000Z | train.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 3 | 2019-06-02T13:00:58.000Z | 2020-04-24T14:40:50.000Z | train.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 6 | 2018-02-22T08:26:11.000Z | 2022-03-08T23:32:06.000Z | # -*- coding:utf-8 -*-
"""
mincheng:mc.cheng@my.cityu.edu.hk
"""
from __future__ import division
import sys
import printlog
import datetime
import os
import time
import sklearn
from sklearn.metrics import confusion_matrix
from baselines import sclearn
import evaluation
from collections import defaultdict
import tensorf... | 46.170259 | 333 | 0.586986 |
from __future__ import division
import sys
import printlog
import datetime
import os
import time
import sklearn
from sklearn.metrics import confusion_matrix
from baselines import sclearn
import evaluation
from collections import defaultdict
import tensorflow as tf
import mslstm
import config
import loaddata
import num... | true | true |
f72402f269dd0023b44f39c7340a56de50e067b1 | 1,835 | py | Python | bot.py | HeitorDJAk47Gamer/B0TPYbeta | e2c6707bcd74161bfb8b75a044833d23e66ed26b | [
"MIT"
] | null | null | null | bot.py | HeitorDJAk47Gamer/B0TPYbeta | e2c6707bcd74161bfb8b75a044833d23e66ed26b | [
"MIT"
] | null | null | null | bot.py | HeitorDJAk47Gamer/B0TPYbeta | e2c6707bcd74161bfb8b75a044833d23e66ed26b | [
"MIT"
] | null | null | null | import json
import os
import discord
import asyncio
import datetime
from discord.ext import commands, tasks
with open('config.json') as e:
infos = json.load(e)
token = infos['token']
prefix = infos['prefix']
lara = commands.Bot(command_prefix=prefix, case_insensitive=True, intents=discord.Intents.all())
... | 29.126984 | 129 | 0.681744 | import json
import os
import discord
import asyncio
import datetime
from discord.ext import commands, tasks
with open('config.json') as e:
infos = json.load(e)
token = infos['token']
prefix = infos['prefix']
lara = commands.Bot(command_prefix=prefix, case_insensitive=True, intents=discord.Intents.all())
... | true | true |
f72403e3633318d3eef4d9f59835f9dbf420aea9 | 3,080 | py | Python | addon/resources/community/livetvcaptcha.py | mar9a7louwa/marga | f20d815e14190d6ec95b24d52cf97ef4173079ef | [
"MIT"
] | null | null | null | addon/resources/community/livetvcaptcha.py | mar9a7louwa/marga | f20d815e14190d6ec95b24d52cf97ef4173079ef | [
"MIT"
] | null | null | null | addon/resources/community/livetvcaptcha.py | mar9a7louwa/marga | f20d815e14190d6ec95b24d52cf97ef4173079ef | [
"MIT"
] | null | null | null | from PIL import Image
import hashlib
import time
import os
import xbmcaddon
addonPath = xbmcaddon.Addon().getAddonInfo("path")
communityStreamPath = os.path.join(addonPath,'resources')
communityStreamPath = os.path.join(communityStreamPath,'community')
#print 'path is ',communityStreamPath
import math
class VectorCom... | 25.245902 | 162 | 0.599351 | from PIL import Image
import hashlib
import time
import os
import xbmcaddon
addonPath = xbmcaddon.Addon().getAddonInfo("path")
communityStreamPath = os.path.join(addonPath,'resources')
communityStreamPath = os.path.join(communityStreamPath,'community')
import math
class VectorCompare:
def magnitude(self,concordanc... | true | true |
f7240418d759063b2c79292315a9b4fb2bce2595 | 1,854 | py | Python | leetcode/0-250/175-15. 3Sum.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 23 | 2018-11-06T03:54:00.000Z | 2022-03-14T13:30:40.000Z | leetcode/0-250/175-15. 3Sum.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | null | null | null | leetcode/0-250/175-15. 3Sum.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 5 | 2019-05-24T16:56:45.000Z | 2022-03-10T17:29:10.000Z | # 15. 3Sum
from collections import defaultdict
class Solution:
# TLE at test # 312 out of 313
def threeSum(self, nums):
n = len(nums)
dic = defaultdict(set)
nums.sort()
mini = nums[0]
# d = {}
for i in range(n):
dic[nums[i]].add(i)
# d.setd... | 30.393443 | 59 | 0.342503 |
from collections import defaultdict
class Solution:
m(self, nums):
n = len(nums)
dic = defaultdict(set)
nums.sort()
mini = nums[0]
for i in range(n):
dic[nums[i]].add(i)
ans = []
table = set()
for i in range(n):
... | true | true |
f724041b5d2e83411bc60f733f4a4170bc7d026e | 7,763 | py | Python | ObjectDetNet/retinanet/dataloaders/custom_transforms.py | erinfolami/ZazuML | 8dbe934c06612dd7917f38090701e3ead0337fb8 | [
"MIT"
] | 1 | 2020-12-31T18:02:41.000Z | 2020-12-31T18:02:41.000Z | ObjectDetNet/retinanet/dataloaders/custom_transforms.py | PatiMohit/ZazuML | c5247859353cacf0e4a58f9c530a07038d9e12cf | [
"MIT"
] | null | null | null | ObjectDetNet/retinanet/dataloaders/custom_transforms.py | PatiMohit/ZazuML | c5247859353cacf0e4a58f9c530a07038d9e12cf | [
"MIT"
] | 1 | 2020-08-09T09:23:25.000Z | 2020-08-09T09:23:25.000Z | import math
import torch
import random
import numpy as np
import torch.nn as nn
from numpy import int64 as int64
import torchvision.transforms as transforms
from PIL import Image, ImageOps, ImageFilter
class Normalize(object):
"""Normalize a tensor image with mean and standard deviation.
Args:
mean (... | 31.176707 | 109 | 0.556744 | import math
import torch
import random
import numpy as np
import torch.nn as nn
from numpy import int64 as int64
import torchvision.transforms as transforms
from PIL import Image, ImageOps, ImageFilter
class Normalize(object):
def __init__(self, mean=(0., 0., 0.), std=(1., 1., 1.)):
self.mean = mean
... | true | true |
f7240423341243823327a6a3db2d9cd1d055c4df | 4,407 | py | Python | models/resnet.py | DwaraknathT/sparsify | bbe3b6e492c2bc8fdd9dd37d87ffc5f51f520792 | [
"MIT"
] | null | null | null | models/resnet.py | DwaraknathT/sparsify | bbe3b6e492c2bc8fdd9dd37d87ffc5f51f520792 | [
"MIT"
] | null | null | null | models/resnet.py | DwaraknathT/sparsify | bbe3b6e492c2bc8fdd9dd37d87ffc5f51f520792 | [
"MIT"
] | null | null | null | '''
Properly implemented ResNet-s for CIFAR10 as described in paper [1].
The implementation and structure of this file is hugely influenced by [2]
which is implemented for ImageNet and doesn't have option A for identity.
Moreover, most of the implementations on the web is copy-paste from
torchvision's resnet and has w... | 30.604167 | 99 | 0.701157 | import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from layers.layers import MaskedConv
__all__ = ['ResNet', 'resnet20', 'resnet32', 'resnet44', 'resnet56', 'resnet110', 'resnet1202']
def _weights_init(m):
classname = m.__class__.__name__
if isinstance(m, nn.Linear) or isinsta... | true | true |
f72404dd1d78fb904526c04c15ecc01bbd1e1401 | 1,392 | py | Python | api/kiveapi/endpoint_manager.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | 1 | 2021-12-22T06:10:01.000Z | 2021-12-22T06:10:01.000Z | api/kiveapi/endpoint_manager.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | null | null | null | api/kiveapi/endpoint_manager.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | null | null | null | import re
class EndpointManager(object):
def __init__(self, session):
self.session = session
def __getattr__(self, name):
return SessionContext(self.session, name)
class SessionContext(object):
def __init__(self, session, name):
self.session = session
self.prefix = '/api... | 30.26087 | 78 | 0.591954 | import re
class EndpointManager(object):
def __init__(self, session):
self.session = session
def __getattr__(self, name):
return SessionContext(self.session, name)
class SessionContext(object):
def __init__(self, session, name):
self.session = session
self.prefix = '/api... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.