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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73951a2ff7c61f7da6a3e38ec8442b76133eb83 | 3,094 | py | Python | pipeline/jonatan_pipeline.py | i-ivanova/Explorify | 54d14eedb121bb8cb972f86c807c7fe4ae174ac1 | [
"MIT"
] | null | null | null | pipeline/jonatan_pipeline.py | i-ivanova/Explorify | 54d14eedb121bb8cb972f86c807c7fe4ae174ac1 | [
"MIT"
] | null | null | null | pipeline/jonatan_pipeline.py | i-ivanova/Explorify | 54d14eedb121bb8cb972f86c807c7fe4ae174ac1 | [
"MIT"
] | 1 | 2022-03-21T17:20:28.000Z | 2022-03-21T17:20:28.000Z | import json
import pandas as pd
import numpy as np
import pprint
from sklearn.preprocessing import StandardScaler
from jonatan_settings import data_path, write_final_df, write_dr_results, audio_features
from jonatan_scrape import get_track_data, get_artist_data, get_audio_feature_data
from jonatan_dr import compute_d... | 38.675 | 153 | 0.72075 | import json
import pandas as pd
import numpy as np
import pprint
from sklearn.preprocessing import StandardScaler
from jonatan_settings import data_path, write_final_df, write_dr_results, audio_features
from jonatan_scrape import get_track_data, get_artist_data, get_audio_feature_data
from jonatan_dr import compute_d... | true | true |
f7395221924310d3a6eecb2e07b458e3a69d881a | 7,419 | py | Python | accelbyte_py_sdk/api/platform/operations/campaign/download.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/platform/operations/campaign/download.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/platform/operations/campaign/download.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | 29.094118 | 136 | 0.61046 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple, Union
from .....core import Operation
from .....core import HeaderStr
from .....core import HttpResponse
class Download(Operation):
_url: str = "/platform/admin/namespaces/{namespace}/codes/camp... | true | true |
f739537c73edf793543cdfc1064b760727396f9d | 15,477 | py | Python | rpython/rtyper/tool/test/test_rffi_platform.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2016-07-06T23:30:20.000Z | 2017-05-30T15:59:31.000Z | rpython/rtyper/tool/test/test_rffi_platform.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | null | null | null | rpython/rtyper/tool/test/test_rffi_platform.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2020-07-09T08:14:22.000Z | 2021-01-15T18:01:25.000Z | import py, sys, struct
from rpython.rtyper.tool import rffi_platform
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.lltypesystem import rffi
from rpython.tool.udir import udir
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.translator.platform import platform
from rpy... | 36.85 | 89 | 0.522517 | import py, sys, struct
from rpython.rtyper.tool import rffi_platform
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.lltypesystem import rffi
from rpython.tool.udir import udir
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.translator.platform import platform
from rpy... | false | true |
f73954cc95e128bb1c472309da9233648ae14486 | 1,185 | py | Python | samples/model-builder/experiment_tracking/create_experiment_sample.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | samples/model-builder/experiment_tracking/create_experiment_sample.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | samples/model-builder/experiment_tracking/create_experiment_sample.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.184211 | 74 | 0.756962 |
from typing import Optional, Union
from google.cloud import aiplatform
def create_experiment_sample(
experiment_name: str,
experiment_description: str,
experiment_tensorboard: Optional[Union[str, aiplatform.Tensorboard]],
project: str,
location: str,
):
aiplatform.init(
... | true | true |
f739551234e10d1baaf79e51a885cbc45371f883 | 16,644 | py | Python | applications/init/controllers/admin.py | himelpdas/biddrive | 786e0fc58d8c0afeef0bcad9125b0d98eaabc709 | [
"BSD-3-Clause"
] | null | null | null | applications/init/controllers/admin.py | himelpdas/biddrive | 786e0fc58d8c0afeef0bcad9125b0d98eaabc709 | [
"BSD-3-Clause"
] | null | null | null | applications/init/controllers/admin.py | himelpdas/biddrive | 786e0fc58d8c0afeef0bcad9125b0d98eaabc709 | [
"BSD-3-Clause"
] | null | null | null | """
@auth.requires_membership('admins')
def index():
response.title="Admin portal"
return dict()
"""
response.title=None
@auth.requires_membership('admins')
def dealership_requests():
if not request.args:
verification = "awaiting"
else:
verification=request.args[0]
dealership_requests = db(db.... | 50.589666 | 386 | 0.722302 | response.title=None
@auth.requires_membership('admins')
def dealership_requests():
if not request.args:
verification = "awaiting"
else:
verification=request.args[0]
dealership_requests = db(db.dealership_info.verification == verification).select()
response.title="%s dealership requests"%verificat... | true | true |
f739555e3d96d08ef40b4d2c000cac98bba4c496 | 1,661 | py | Python | src/mold/plugins/tools/sphinx/__init__.py | felix-hilden/mold | f29b689673a158094196e3d853e61812c9957cb5 | [
"MIT"
] | 1 | 2021-04-13T11:08:59.000Z | 2021-04-13T11:08:59.000Z | src/mold/plugins/tools/sphinx/__init__.py | felix-hilden/mold | f29b689673a158094196e3d853e61812c9957cb5 | [
"MIT"
] | 1 | 2021-08-10T10:39:14.000Z | 2021-08-10T10:39:14.000Z | src/mold/plugins/tools/sphinx/__init__.py | felix-hilden/mold | f29b689673a158094196e3d853e61812c9957cb5 | [
"MIT"
] | null | null | null | """
Provides an extra question and configuration ``docs_semver_over_calver``
to :mod:`doc` to determine whether Semantic or Calendar Versioning is wanted.
"""
from mold import Tool, Question, templates_from_directory
from ...domains import python, module
from ...face.doc import interface as doc, Provides as DocVars
fro... | 29.660714 | 77 | 0.727875 | from mold import Tool, Question, templates_from_directory
from ...domains import python, module
from ...face.doc import interface as doc, Provides as DocVars
from ...face.readme import interface as readme
from ...face.source import interface as source
from ...face.license import interface as license_
from ...face.build... | true | true |
f7395681935a393430ed6d6a10602fd5e323b9f7 | 1,394 | py | Python | utils/metric.py | toandaominh1997/understanding_cloud_organization | 7da991ff3da557c18f4585c1b956ed799c104c7c | [
"MIT"
] | null | null | null | utils/metric.py | toandaominh1997/understanding_cloud_organization | 7da991ff3da557c18f4585c1b956ed799c104c7c | [
"MIT"
] | null | null | null | utils/metric.py | toandaominh1997/understanding_cloud_organization | 7da991ff3da557c18f4585c1b956ed799c104c7c | [
"MIT"
] | null | null | null | import torch
import numpy as np
class AverageMetric(object):
def __init__(self, threshold=0.5):
self.dice_scores = []
self.threshold = threshold
def update(self, outputs, labels):
with torch.no_grad():
probs = torch.sigmoid(outputs)
dice_score = self.dice_metr... | 35.74359 | 76 | 0.563128 | import torch
import numpy as np
class AverageMetric(object):
def __init__(self, threshold=0.5):
self.dice_scores = []
self.threshold = threshold
def update(self, outputs, labels):
with torch.no_grad():
probs = torch.sigmoid(outputs)
dice_score = self.dice_metr... | true | true |
f7395989ada5906499b84798921ec2bdef985b12 | 3,435 | py | Python | Learning Scripts/Learn_PT.py | n3urovirtual/EyeTracking_Experiment_Children | 56c08a1202a686ac8f05d3c4e53766537895fe4f | [
"MIT"
] | 1 | 2022-02-11T19:22:07.000Z | 2022-02-11T19:22:07.000Z | Learning Scripts/Learn_PT.py | n3urovirtual/EyeTracking_Experiment_Children | 56c08a1202a686ac8f05d3c4e53766537895fe4f | [
"MIT"
] | null | null | null | Learning Scripts/Learn_PT.py | n3urovirtual/EyeTracking_Experiment_Children | 56c08a1202a686ac8f05d3c4e53766537895fe4f | [
"MIT"
] | null | null | null | """APPLY PYTHAGOREAN THEOREM IN LEARNING DATA + SMOOTH VELOCITIES"""
import os
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from helper import img_id, sub_id, TRIALS_PATH
# Apply PT into smoothed learning data to find sample-to-sample d... | 36.542553 | 77 | 0.60262 |
import os
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from helper import img_id, sub_id, TRIALS_PATH
for file in os.listdir(TRIALS_PATH):
dataset = pd.read_csv(os.path.join(TRIALS_PATH, file))
x = dataset["BPOGX"].diff().fill... | true | true |
f73959d15263e4360839ffcd13aa7778446b878c | 4,500 | py | Python | thriftpy2/rpc.py | Angelbear/thriftpy2 | 4065b80530107744172889ca909ce9270ac2f6d6 | [
"MIT"
] | null | null | null | thriftpy2/rpc.py | Angelbear/thriftpy2 | 4065b80530107744172889ca909ce9270ac2f6d6 | [
"MIT"
] | null | null | null | thriftpy2/rpc.py | Angelbear/thriftpy2 | 4065b80530107744172889ca909ce9270ac2f6d6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import contextlib
import warnings
from thriftpy2._compat import PY35
from thriftpy2.protocol import TBinaryProtocolFactory
from thriftpy2.server import TThreadedServer
from thriftpy2.thrift import TProcessor, TClient
from thriftpy2.transport import (
... | 36.585366 | 79 | 0.618889 |
from __future__ import absolute_import
import contextlib
import warnings
from thriftpy2._compat import PY35
from thriftpy2.protocol import TBinaryProtocolFactory
from thriftpy2.server import TThreadedServer
from thriftpy2.thrift import TProcessor, TClient
from thriftpy2.transport import (
TBufferedTransportFac... | true | true |
f7395a085f1ea90e3c277bcac92fe4a328f00b8f | 3,032 | py | Python | services/users/project/api/users.py | mgw2168/testdriven-app | 1ad7edfcff5a0ccdd0e17448746f40ac383af9b5 | [
"Apache-2.0"
] | 2 | 2019-02-11T05:41:13.000Z | 2019-03-27T07:25:14.000Z | services/users/project/api/users.py | mgw2168/testdriven-app | 1ad7edfcff5a0ccdd0e17448746f40ac383af9b5 | [
"Apache-2.0"
] | null | null | null | services/users/project/api/users.py | mgw2168/testdriven-app | 1ad7edfcff5a0ccdd0e17448746f40ac383af9b5 | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint, jsonify
from flask import render_template
from flask import request
from sqlalchemy import exc
from project.api.utils import authenticate
from project import db
from project.api.models import User
users_blueprint = Blueprint('users', __name__, template_folder='./templates')
@users_bluepr... | 30.32 | 79 | 0.588061 | from flask import Blueprint, jsonify
from flask import render_template
from flask import request
from sqlalchemy import exc
from project.api.utils import authenticate
from project import db
from project.api.models import User
users_blueprint = Blueprint('users', __name__, template_folder='./templates')
@users_bluepr... | true | true |
f7395b1fc1b5e04128dacc93a70d9b5713297940 | 380 | py | Python | 2020/08_1/solution_test.py | budavariam/advent_of_code | 0903bcbb0df46371b6a340ca2be007dce6470c66 | [
"MIT"
] | null | null | null | 2020/08_1/solution_test.py | budavariam/advent_of_code | 0903bcbb0df46371b6a340ca2be007dce6470c66 | [
"MIT"
] | null | null | null | 2020/08_1/solution_test.py | budavariam/advent_of_code | 0903bcbb0df46371b6a340ca2be007dce6470c66 | [
"MIT"
] | 1 | 2022-02-11T13:14:50.000Z | 2022-02-11T13:14:50.000Z | """ Advent of code 2020 day 08/1 """
import unittest
from solution import solution
class MyTest(unittest.TestCase):
"""Unist tests for actual day"""
def test_basic(self):
""" Test from the task """
self.assertEqual(solution("""\
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6... | 14.074074 | 38 | 0.615789 |
import unittest
from solution import solution
class MyTest(unittest.TestCase):
def test_basic(self):
self.assertEqual(solution("""\
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6\
"""), 5)
if __name__ == '__main__':
unittest.main()
| true | true |
f7395d296e7210efc00c1e2dfc258ec22f4f03a0 | 1,409 | py | Python | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2ono_progress.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2ono_progress.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2ono_progress.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
try:
from io import StringIO # py3
except ImportError:
from StringIO import StringIO # py2
def h2ono_progress():
"""
... | 32.767442 | 111 | 0.678495 | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
def h2ono_progress():
try:
s... | true | true |
f7395d68129548cfde74d3c774374a3aa75ca291 | 447 | py | Python | CEV/ex023.py | EduardoMachadoCostaOliveira/Python | 329e388c190118f742a3c3df90a15cd00519a58e | [
"MIT"
] | null | null | null | CEV/ex023.py | EduardoMachadoCostaOliveira/Python | 329e388c190118f742a3c3df90a15cd00519a58e | [
"MIT"
] | null | null | null | CEV/ex023.py | EduardoMachadoCostaOliveira/Python | 329e388c190118f742a3c3df90a15cd00519a58e | [
"MIT"
] | null | null | null | #Faça um programa que leia um número de 0 a 9999 e
#mostre na tela cada um dos dígitos separados.
numero = float(input('Digite um número: '))
unidade = numero // 1 % 10
dezena = numero // 10 % 10
centena = numero // 100 % 10
milhar = numero // 1000 % 10
print(f'Unidade: {unidade}')
print(f'Dezena: {dezena}')
print(f'Ce... | 24.833333 | 50 | 0.66443 |
numero = float(input('Digite um número: '))
unidade = numero // 1 % 10
dezena = numero // 10 % 10
centena = numero // 100 % 10
milhar = numero // 1000 % 10
print(f'Unidade: {unidade}')
print(f'Dezena: {dezena}')
print(f'Centena: {centena}')
print(f'Milhar: {milhar}')
| true | true |
f7396046533629ad9142b29a24d9194d40512e56 | 1,241 | py | Python | google/ads/googleads/v9/errors/types/ad_group_criterion_customizer_error.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/errors/types/ad_group_criterion_customizer_error.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/errors/types/ad_group_criterion_customizer_error.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 29.547619 | 74 | 0.722804 |
import proto
__protobuf__ = proto.module(
package="google.ads.googleads.v9.errors",
marshal="google.ads.googleads.v9",
manifest={"AdGroupCriterionCustomizerErrorEnum",},
)
class AdGroupCriterionCustomizerErrorEnum(proto.Message):
class AdGroupCriterionCustomizerError(proto.Enum):
... | true | true |
f73960939ac931d823ffd7b7b8517bbe18de2005 | 275 | py | Python | Radio/radio_receive.py | JustinWingChungHui/MicrobitPlayground | a61b4f1f351d51351a7025bc5da7953a0b37a381 | [
"MIT"
] | null | null | null | Radio/radio_receive.py | JustinWingChungHui/MicrobitPlayground | a61b4f1f351d51351a7025bc5da7953a0b37a381 | [
"MIT"
] | null | null | null | Radio/radio_receive.py | JustinWingChungHui/MicrobitPlayground | a61b4f1f351d51351a7025bc5da7953a0b37a381 | [
"MIT"
] | null | null | null | import radio
import speech
import music
from microbit import *
radio.on()
while True:
try:
incoming = radio.receive()
#display.scroll(incoming,wait=False)
#music.pitch(int(incoming))
speech.say(incoming)
except:
pass
| 17.1875 | 44 | 0.614545 | import radio
import speech
import music
from microbit import *
radio.on()
while True:
try:
incoming = radio.receive()
speech.say(incoming)
except:
pass
| true | true |
f73961fa0ccc6a4899ebef6a3f31b10f0c301859 | 1,881 | py | Python | data_lakes.py | the-timoye/spark-examples | d8784653a862e09e1c755ed2055d37a5516d2c3f | [
"MIT"
] | null | null | null | data_lakes.py | the-timoye/spark-examples | d8784653a862e09e1c755ed2055d37a5516d2c3f | [
"MIT"
] | null | null | null | data_lakes.py | the-timoye/spark-examples | d8784653a862e09e1c755ed2055d37a5516d2c3f | [
"MIT"
] | 1 | 2021-06-30T15:12:19.000Z | 2021-06-30T15:12:19.000Z | import pandas as pd
import pyspark.sql.functions as F
from pyspark.sql import SparkSession
import sparknlp
sparknlp.start()
from sparknlp.pretrained import PretrainedPipeline
pd.set_option('max_colwidth', 800)
spark = SparkSession.builder.config("spark.jars.packages", "com.johnsnowlabs.nlp:spark-nlp_2.12:3.0.3").getO... | 36.882353 | 120 | 0.688995 | import pandas as pd
import pyspark.sql.functions as F
from pyspark.sql import SparkSession
import sparknlp
sparknlp.start()
from sparknlp.pretrained import PretrainedPipeline
pd.set_option('max_colwidth', 800)
spark = SparkSession.builder.config("spark.jars.packages", "com.johnsnowlabs.nlp:spark-nlp_2.12:3.0.3").getO... | true | true |
f739630369b62075dbecd0e8796432eb075f471d | 2,366 | py | Python | Aumented Reality 101/Fiducials and Markers/opencv-generate-aruco/opencv_generate_aruco.py | jjaramillo34/pyimagesearchuniversity_course | 0a4a26c29a6f8122f6a03d3393ac01ebbc14a391 | [
"MIT"
] | 1 | 2022-03-13T16:52:58.000Z | 2022-03-13T16:52:58.000Z | Aumented Reality 101/Fiducials and Markers/opencv-generate-aruco/opencv_generate_aruco.py | jjaramillo34/pyimagesearchuniversity_course | 0a4a26c29a6f8122f6a03d3393ac01ebbc14a391 | [
"MIT"
] | null | null | null | Aumented Reality 101/Fiducials and Markers/opencv-generate-aruco/opencv_generate_aruco.py | jjaramillo34/pyimagesearchuniversity_course | 0a4a26c29a6f8122f6a03d3393ac01ebbc14a391 | [
"MIT"
] | null | null | null | # USAGE
# python opencv_generate_aruco.py --id 24 --type DICT_5X5_100 --output tags/DICT_5X5_100_id24.png
# import the necessary packages
import numpy as np
import argparse
import cv2
import sys
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-o", "--output", re... | 35.313433 | 97 | 0.752325 |
import numpy as np
import argparse
import cv2
import sys
ap = argparse.ArgumentParser()
ap.add_argument("-o", "--output", required=True,
help="path to output image containing ArUCo tag")
ap.add_argument("-i", "--id", type=int, required=True,
help="ID of ArUCo tag to generate")
ap.add_argument("-t", "--type", ty... | true | true |
f739636f301d9e486dd281255508775b18813c2d | 22,410 | py | Python | mmtbx/validation/restraints.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | mmtbx/validation/restraints.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | mmtbx/validation/restraints.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z |
"""
Validation of models of any type against basic covalent geometry restraints.
By default this will flag all restrained atoms deviating by more than 4 sigma
from the target value.
"""
from __future__ import absolute_import, division, print_function
from mmtbx.validation import atoms, validation, get_atoms_info
from... | 35.015625 | 132 | 0.678626 |
from __future__ import absolute_import, division, print_function
from mmtbx.validation import atoms, validation, get_atoms_info
from libtbx.str_utils import make_sub_header
from libtbx import slots_getstate_setstate
from math import sqrt
import sys
__restraint_attr__ = [
"sigma",
"target",
"model",
"delta",
... | true | true |
f7396532b2c3ad5d664726f232cb165395f341c4 | 6,865 | py | Python | fpga/lib/eth/lib/axis/rtl/axis_crosspoint_wrap.py | totuwei/corundum | e983ad519fb4523d0ffca32f5e436195bcfc945c | [
"BSD-2-Clause-FreeBSD"
] | 1,121 | 2015-05-26T14:41:44.000Z | 2022-03-31T07:17:48.000Z | lib/axis/rtl/axis_crosspoint_wrap.py | yuzu762/verilog-ethernet | 108c02d721aada8a8f51e22328f6ca6c64b70d33 | [
"MIT"
] | 98 | 2016-02-12T21:15:45.000Z | 2022-03-31T03:13:00.000Z | lib/axis/rtl/axis_crosspoint_wrap.py | yuzu762/verilog-ethernet | 108c02d721aada8a8f51e22328f6ca6c64b70d33 | [
"MIT"
] | 368 | 2015-05-05T20:49:01.000Z | 2022-03-31T09:43:53.000Z | #!/usr/bin/env python
"""
Generates an AXI Stream crosspoint wrapper with the specified number of ports
"""
import argparse
from jinja2 import Template
def main():
parser = argparse.ArgumentParser(description=__doc__.strip())
parser.add_argument('-p', '--ports', type=int, default=[4], nargs='+', help="numbe... | 35.02551 | 128 | 0.59563 |
import argparse
from jinja2 import Template
def main():
parser = argparse.ArgumentParser(description=__doc__.strip())
parser.add_argument('-p', '--ports', type=int, default=[4], nargs='+', help="number of ports")
parser.add_argument('-n', '--name', type=str, help="module name")
parser.add_argumen... | true | true |
f739657fbfc04ae7325b956253ff5e707ad9fa35 | 10,934 | py | Python | shade/tests/functional/test_floating_ip.py | mail2nsrajesh/shade | 65ce1a22896e52ff59a23a393e3bc4227f55f006 | [
"Apache-2.0"
] | null | null | null | shade/tests/functional/test_floating_ip.py | mail2nsrajesh/shade | 65ce1a22896e52ff59a23a393e3bc4227f55f006 | [
"Apache-2.0"
] | null | null | null | shade/tests/functional/test_floating_ip.py | mail2nsrajesh/shade | 65ce1a22896e52ff59a23a393e3bc4227f55f006 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | 39.330935 | 79 | 0.58908 |
import pprint
from testtools import content
from shade import _utils
from shade import meta
from shade.exc import OpenStackCloudException
from shade.tests.functional import base
from shade.tests.functional.util import pick_flavor
class TestFloatingIP(base.BaseFunctionalTestCase):
timeout = 60
... | true | true |
f73965cc71992ab9e887b50a297a05f6fd51c46a | 3,269 | py | Python | api/metadata/migrations/0019_add_non_ministerial_departments.py | cad106uk/market-access-api | a357c33bbec93408b193e598a5628634126e9e99 | [
"MIT"
] | null | null | null | api/metadata/migrations/0019_add_non_ministerial_departments.py | cad106uk/market-access-api | a357c33bbec93408b193e598a5628634126e9e99 | [
"MIT"
] | null | null | null | api/metadata/migrations/0019_add_non_ministerial_departments.py | cad106uk/market-access-api | a357c33bbec93408b193e598a5628634126e9e99 | [
"MIT"
] | null | null | null | from django.db import migrations
from api.metadata.constants import OrganisationType
ORGANISATIONS = [
{
"name": "The Charity Commission",
"organisation_type": OrganisationType.NON_MINISTERIAL_DEPARTMENTS
},
{
"name": "Competition and Markets Authority",
"organisation_type... | 28.929204 | 86 | 0.663812 | from django.db import migrations
from api.metadata.constants import OrganisationType
ORGANISATIONS = [
{
"name": "The Charity Commission",
"organisation_type": OrganisationType.NON_MINISTERIAL_DEPARTMENTS
},
{
"name": "Competition and Markets Authority",
"organisation_type... | true | true |
f73967755c490c9e1120b2c21e745c507cbc5e62 | 13,441 | py | Python | tools/skpbench/skpbench.py | mohad12211/skia | 042a53aa094715e031ebad4da072524ace316744 | [
"BSD-3-Clause"
] | 3 | 2019-03-07T17:01:23.000Z | 2021-07-03T22:01:36.000Z | tools/skpbench/skpbench.py | mohad12211/skia | 042a53aa094715e031ebad4da072524ace316744 | [
"BSD-3-Clause"
] | 2 | 2020-08-11T17:14:27.000Z | 2020-09-12T17:08:46.000Z | tools/skpbench/skpbench.py | promoter/skia | bc5ed776134c60ae13d22cabc8e0f6aca0fdd422 | [
"BSD-3-Clause"
] | 14 | 2015-07-17T17:23:53.000Z | 2020-07-06T21:06:57.000Z | #!/usr/bin/env python
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from _adb import Adb
from _benchresult import BenchResult
from _hardware import HardwareException, Hardware
from argparse imp... | 36.229111 | 80 | 0.654788 |
from __future__ import print_function
from _adb import Adb
from _benchresult import BenchResult
from _hardware import HardwareException, Hardware
from argparse import ArgumentParser
from multiprocessing import Queue
from threading import Thread, Timer
import collections
import glob
import math
import re
import s... | true | true |
f73967f1cca06e84f142f53ce00b6ee8683e87d9 | 1,955 | py | Python | Project 2/receiver.py | jontlu/ECE303-Comm-Nets | d21bf285c3231db3c2c328cbf07cbc150afdc1af | [
"MIT"
] | null | null | null | Project 2/receiver.py | jontlu/ECE303-Comm-Nets | d21bf285c3231db3c2c328cbf07cbc150afdc1af | [
"MIT"
] | null | null | null | Project 2/receiver.py | jontlu/ECE303-Comm-Nets | d21bf285c3231db3c2c328cbf07cbc150afdc1af | [
"MIT"
] | null | null | null | # Written by S. Mevawala, modified by D. Gitzel
# ECE303 Communication Networks
# Project 2: Selective Repeat simulator
# Jon Lu & David Yang 05/02/2021
import logging
import channelsimulator
import utils
import sys
import socket
import array
import hashlib
class Receiver(object):
def __init__(self, inbound_por... | 32.04918 | 115 | 0.627621 |
import logging
import channelsimulator
import utils
import sys
import socket
import array
import hashlib
class Receiver(object):
def __init__(self, inbound_port=50005, outbound_port=50006, timeout=5, debug_level=logging.INFO):
self.logger = utils.Logger(self.__class__.__name__, debug_level)
... | true | true |
f7396a2d5d3be53b95d8c738f9978a887a468a33 | 300 | py | Python | blog/templatetags/blog.py | mikespub-archive/wkornewald-allbuttonspressed | 57adb0de9a61b8abec80e678b6589f6a5a3131b5 | [
"BSD-3-Clause"
] | null | null | null | blog/templatetags/blog.py | mikespub-archive/wkornewald-allbuttonspressed | 57adb0de9a61b8abec80e678b6589f6a5a3131b5 | [
"BSD-3-Clause"
] | null | null | null | blog/templatetags/blog.py | mikespub-archive/wkornewald-allbuttonspressed | 57adb0de9a61b8abec80e678b6589f6a5a3131b5 | [
"BSD-3-Clause"
] | null | null | null | from ..models import Blog
from django.template import Library
register = Library()
@register.inclusion_tag('blog/feeds.html')
def blog_feeds():
blogs = Blog.objects.all()
return {'blogs': blogs}
@register.inclusion_tag('blog/feeds.html')
def blog_feed(blog):
return {'blogs': (blog,)}
| 21.428571 | 42 | 0.71 | from ..models import Blog
from django.template import Library
register = Library()
@register.inclusion_tag('blog/feeds.html')
def blog_feeds():
blogs = Blog.objects.all()
return {'blogs': blogs}
@register.inclusion_tag('blog/feeds.html')
def blog_feed(blog):
return {'blogs': (blog,)}
| true | true |
f7396a8e2c74169aab5f5de45a108e3134ec84bd | 832 | py | Python | utils/polling.py | CyberPuffer/CyberPuffer | 8e503e5c93ba57ed5242bfa9d0cf1664d857e148 | [
"BSD-2-Clause"
] | null | null | null | utils/polling.py | CyberPuffer/CyberPuffer | 8e503e5c93ba57ed5242bfa9d0cf1664d857e148 | [
"BSD-2-Clause"
] | null | null | null | utils/polling.py | CyberPuffer/CyberPuffer | 8e503e5c93ba57ed5242bfa9d0cf1664d857e148 | [
"BSD-2-Clause"
] | null | null | null | from telegram import constants
from telegram.ext import Updater
from distutils.version import LooseVersion
from telegram import __version__ as ptb_version
from utils import functions, globals, log
logger = log.get_logger(name='Bot')
def polling(args):
request_kwargs = {
'proxy_url': args.proxy} if args.pr... | 39.619048 | 77 | 0.735577 | from telegram import constants
from telegram.ext import Updater
from distutils.version import LooseVersion
from telegram import __version__ as ptb_version
from utils import functions, globals, log
logger = log.get_logger(name='Bot')
def polling(args):
request_kwargs = {
'proxy_url': args.proxy} if args.pr... | true | true |
f7396aff93d93748dffb75bd4dfe7e81fd9922a6 | 2,426 | py | Python | jobCrawler/jobCrawler/pipelines.py | arsArtD/python_learn | bb22dd6b587b88d2645b64420111ba09b9eed64d | [
"MIT"
] | null | null | null | jobCrawler/jobCrawler/pipelines.py | arsArtD/python_learn | bb22dd6b587b88d2645b64420111ba09b9eed64d | [
"MIT"
] | null | null | null | jobCrawler/jobCrawler/pipelines.py | arsArtD/python_learn | bb22dd6b587b88d2645b64420111ba09b9eed64d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
import datetime
import logging
from scrapy.conf import settings
import sys
reload(sys)
sys.setdefaultencoding(... | 26.369565 | 106 | 0.602638 |
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
import datetime
import logging
from scrapy.conf import settings
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class JobcrawlerPipeline(object):
def process_item(self, item, spider):
return item
educations = ... | false | true |
f7396bf0fe3e00bb7ed8191b0c1b265e7db6a240 | 1,048 | py | Python | Programming Challenges/Maximum Pairwise Product/maximum_pairwise_product.py | Tarbo/algo-data-structure | 3f1219dac9a56e385d3db347e713d1ccae17087b | [
"MIT"
] | null | null | null | Programming Challenges/Maximum Pairwise Product/maximum_pairwise_product.py | Tarbo/algo-data-structure | 3f1219dac9a56e385d3db347e713d1ccae17087b | [
"MIT"
] | null | null | null | Programming Challenges/Maximum Pairwise Product/maximum_pairwise_product.py | Tarbo/algo-data-structure | 3f1219dac9a56e385d3db347e713d1ccae17087b | [
"MIT"
] | null | null | null | # python3
def max_pairwise_product_naive(numbers):
assert len(numbers) >= 2
assert all(0 <= x <= 2 * 10 ** 5 for x in numbers)
product = 0
for i in range(len(numbers)):
for j in range(i + 1, len(numbers)):
product = max(product, numbers[i] * numbers[j])
return product
def ... | 27.578947 | 80 | 0.596374 |
def max_pairwise_product_naive(numbers):
assert len(numbers) >= 2
assert all(0 <= x <= 2 * 10 ** 5 for x in numbers)
product = 0
for i in range(len(numbers)):
for j in range(i + 1, len(numbers)):
product = max(product, numbers[i] * numbers[j])
return product
def max_pairw... | true | true |
f7396e484b0f2218dd8363f969c209091fb6e511 | 8,469 | py | Python | tests/integration/suite/test_cluster_defaults.py | arthurh4/rancher | 1e7e336de5ee546a8dd8291211af5cff8754f6f7 | [
"Apache-2.0"
] | null | null | null | tests/integration/suite/test_cluster_defaults.py | arthurh4/rancher | 1e7e336de5ee546a8dd8291211af5cff8754f6f7 | [
"Apache-2.0"
] | null | null | null | tests/integration/suite/test_cluster_defaults.py | arthurh4/rancher | 1e7e336de5ee546a8dd8291211af5cff8754f6f7 | [
"Apache-2.0"
] | null | null | null | import json
import pytest
from rancher import ApiError
from .common import random_str
from .conftest import wait_for
@pytest.mark.skip(reason="cluster-defaults disabled")
def test_generic_initial_defaults(admin_mc):
cclient = admin_mc.client
schema_defaults = {}
setting_defaults = {}
data = cclient.s... | 38.671233 | 79 | 0.581651 | import json
import pytest
from rancher import ApiError
from .common import random_str
from .conftest import wait_for
@pytest.mark.skip(reason="cluster-defaults disabled")
def test_generic_initial_defaults(admin_mc):
cclient = admin_mc.client
schema_defaults = {}
setting_defaults = {}
data = cclient.s... | true | true |
f7396f29e1bc9378dc70ababb0cc17936d600bc6 | 745 | py | Python | Test.py | kamil-mech/LamPy-Server | 09bfc2872f368151fa2e402281593a075d838153 | [
"MIT"
] | null | null | null | Test.py | kamil-mech/LamPy-Server | 09bfc2872f368151fa2e402281593a075d838153 | [
"MIT"
] | null | null | null | Test.py | kamil-mech/LamPy-Server | 09bfc2872f368151fa2e402281593a075d838153 | [
"MIT"
] | null | null | null | import time
from Adafruit_PWM_Servo_Driver import PWM
from Servo import Servo
if __name__ == '__main__':
# mg995
servo2 = Servo(channel=0, min=150, max=530, freq=100) # mg995
# sg90
# Servo pan
# servo2 = Servo(channel=2, min=250, max=380, freq=50)
# sg90 2
# servo tilt
# servo3 = S... | 19.102564 | 65 | 0.583893 | import time
from Adafruit_PWM_Servo_Driver import PWM
from Servo import Servo
if __name__ == '__main__':
servo2 = Servo(channel=0, min=150, max=530, freq=100)
time.sleep(4)
servo2.move_to(0)
(4)
servo2.move_to(1)
sleep(4)
... | true | true |
f7396fa042dd6ee92327090762398516eb4196f1 | 7,106 | py | Python | plugin.video.catchuptvandmore/resources/lib/skeletons/wo_live.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | 2 | 2018-11-02T19:55:30.000Z | 2020-08-14T02:22:20.000Z | plugin.video.catchuptvandmore/resources/lib/skeletons/wo_live.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | null | null | null | plugin.video.catchuptvandmore/resources/lib/skeletons/wo_live.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | 3 | 2019-12-17T20:47:00.000Z | 2021-02-11T19:03:59.000Z | # -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2016 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundat... | 32.746544 | 78 | 0.562764 |
from __future__ import unicode_literals
from codequick import Script
menu = {
'euronews': {
'callback':
'live_bridge',
'thumb':
'channels/wo/euronews.png',
'fanart':
'channels/wo/euronews_fanart.jpg',
'module':
'resources.lib.channels.wo.euronews... | true | true |
f7396fc9d79c91054f1706d011fce6444565db44 | 6,473 | py | Python | projects/opengrok/opengrok-tools/src/test/python/test_command.py | pwr-pbrwio/PBR20M2 | 98904cb265baa7ce6a00455ea6edb8366a51c61b | [
"Apache-2.0"
] | 5 | 2018-12-13T17:46:39.000Z | 2022-03-29T02:07:47.000Z | projects/opengrok/opengrok-tools/src/test/python/test_command.py | pwr-pbrwio/PBR20M2 | 98904cb265baa7ce6a00455ea6edb8366a51c61b | [
"Apache-2.0"
] | 42 | 2019-12-08T18:41:13.000Z | 2021-08-28T13:08:55.000Z | projects/opengrok/opengrok-tools/src/test/python/test_command.py | sealuzh/lightweight-effectiveness | f6ef4c98b8f572a86e42252686995b771e655f80 | [
"MIT"
] | 8 | 2018-12-25T04:19:01.000Z | 2021-03-24T17:02:44.000Z | #!/usr/bin/env python3
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# See LICENSE.txt included in this distribution for the specific
# language gove... | 36.778409 | 111 | 0.612544 |
import unittest
import sys
import os
import time
sys.path.insert(0, os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..',
'main', 'python')))
from opengrok_tools.utils.command import Command
import tempfile
class TestApp(unittest.TestCase):
... | true | true |
f739706fc12fea041b8d25d4b64f842543b1a907 | 495 | py | Python | app/db/functions/server_defaults/uuid_.py | Max-Zhenzhera/my_vocab_backend | f93d0c7c7f4a45fce47eb7ce74cfcda195b13a72 | [
"MIT"
] | 1 | 2021-11-18T16:25:22.000Z | 2021-11-18T16:25:22.000Z | app/db/functions/server_defaults/uuid_.py | Max-Zhenzhera/my_vocab_backend | f93d0c7c7f4a45fce47eb7ce74cfcda195b13a72 | [
"MIT"
] | null | null | null | app/db/functions/server_defaults/uuid_.py | Max-Zhenzhera/my_vocab_backend | f93d0c7c7f4a45fce47eb7ce74cfcda195b13a72 | [
"MIT"
] | null | null | null | from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql import expression
__all__ = ['gen_random_uuid']
class gen_random_uuid(expression.FunctionElement): # noqa Class names should use CamelCase convention
type = UUID()
@compiles(gen_random_uuid, ... | 29.117647 | 107 | 0.765657 | from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql import expression
__all__ = ['gen_random_uuid']
class gen_random_uuid(expression.FunctionElement):
type = UUID()
@compiles(gen_random_uuid, 'postgresql')
def pg_gen_random_uuid(element, comp... | true | true |
f73970aa3e5a592264043fb2f931cc2bca5f1423 | 3,235 | py | Python | profiles_project/settings.py | Eldor99/profiles-rest-api | 2ec2bd0e796cb31001e32254b71eba4e273a5e20 | [
"MIT"
] | null | null | null | profiles_project/settings.py | Eldor99/profiles-rest-api | 2ec2bd0e796cb31001e32254b71eba4e273a5e20 | [
"MIT"
] | null | null | null | profiles_project/settings.py | Eldor99/profiles-rest-api | 2ec2bd0e796cb31001e32254b71eba4e273a5e20 | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 25.88 | 91 | 0.698609 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'l7sye_6)^fxo*4tj^+^fx5r5axl=$=@%*!$nqlvsck!aa6&wb%'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f73971afbc14a8e1cb7448175f685ff0fd11ada3 | 854 | py | Python | leetcode/easy/excel_sheet_column_title/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | leetcode/easy/excel_sheet_column_title/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | leetcode/easy/excel_sheet_column_title/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | class Solution(object):
def convertToTitle(self, n):
"""
:type n: int
:rtype: str
"""
LOOKUP = {
0: 'A', 1: 'B',
2: 'C', 3: 'D',
4: 'E', 5: 'F',
6: 'G', 7: 'H',
8: ... | 28.466667 | 41 | 0.204918 | class Solution(object):
def convertToTitle(self, n):
LOOKUP = {
0: 'A', 1: 'B',
2: 'C', 3: 'D',
4: 'E', 5: 'F',
6: 'G', 7: 'H',
8: 'I', 9: 'J',
10: 'K', 11: 'L'... | true | true |
f73972567fa204a891dbbd0d1f85d42ba03d310a | 32 | py | Python | factorial/loader/work/__init__.py | mgarciadelojo/factorialhr | f776694effb96ed973b49699809f835aa0b19dfa | [
"MIT"
] | 6 | 2020-09-01T09:53:05.000Z | 2021-06-29T21:31:18.000Z | factorial/loader/work/__init__.py | mgarciadelojo/factorialhr | f776694effb96ed973b49699809f835aa0b19dfa | [
"MIT"
] | 2 | 2020-11-28T02:48:12.000Z | 2020-12-12T14:13:32.000Z | factorial/loader/work/__init__.py | mgarciadelojo/factorialhr | f776694effb96ed973b49699809f835aa0b19dfa | [
"MIT"
] | 3 | 2020-06-25T05:51:04.000Z | 2021-03-23T07:53:27.000Z | from .json_work import JsonWork
| 16 | 31 | 0.84375 | from .json_work import JsonWork
| true | true |
f73974a5a549a98135ff703c3d5b57bc65680f40 | 16,761 | py | Python | mmdet/models/roi_heads/mask_heads/fcn_mask_head.py | lnmdlong/mmdetection | 87768a5d0a0188d46c50b575b417e9ec2fb5c06c | [
"Apache-2.0"
] | null | null | null | mmdet/models/roi_heads/mask_heads/fcn_mask_head.py | lnmdlong/mmdetection | 87768a5d0a0188d46c50b575b417e9ec2fb5c06c | [
"Apache-2.0"
] | null | null | null | mmdet/models/roi_heads/mask_heads/fcn_mask_head.py | lnmdlong/mmdetection | 87768a5d0a0188d46c50b575b417e9ec2fb5c06c | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_conv_layer, build_upsample_layer
from mmcv.ops.carafe import CARAFEPack
from mmcv.runner import BaseModule, ModuleList, auto_fp16, force_fp32
from torch.nn.modules.utils import _pair
... | 42.113065 | 85 | 0.569477 | import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_conv_layer, build_upsample_layer
from mmcv.ops.carafe import CARAFEPack
from mmcv.runner import BaseModule, ModuleList, auto_fp16, force_fp32
from torch.nn.modules.utils import _pair
... | true | true |
f73974b03ae39de3b8a04e0e22ae6d94b91dd2a0 | 1,376 | py | Python | miningstatistic/statistic/migrations/0002_add_verbose_names.py | crowmurk/miners | d173f1bee44d0752eefb53b1a0da847a3882a352 | [
"MIT"
] | null | null | null | miningstatistic/statistic/migrations/0002_add_verbose_names.py | crowmurk/miners | d173f1bee44d0752eefb53b1a0da847a3882a352 | [
"MIT"
] | 1 | 2018-09-16T05:35:01.000Z | 2018-09-16T05:35:01.000Z | miningstatistic/statistic/migrations/0002_add_verbose_names.py | crowmurk/miners | d173f1bee44d0752eefb53b1a0da847a3882a352 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-10-17 07:32
import core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('statistic', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... | 34.4 | 153 | 0.625 |
import core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('statistic', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='serverstatistic',
options... | true | true |
f73974fd21116cf205103e78262fe4b388883bb5 | 820 | py | Python | spark_auto_mapper_fhir/value_sets/v2_0532.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/value_sets/v2_0532.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/value_sets/v2_0532.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | 31.538462 | 85 | 0.757317 | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
class V2_0532(GenericTypeCode):
def __init__(self, value... | true | true |
f739768ba3a3dcd1ee2df044fba957f6a1611d66 | 156 | py | Python | versions.py | oguznsari/sentdex-NN | b91ebf6bb9e8c0580f3e186090716c7c33eb823d | [
"MIT"
] | null | null | null | versions.py | oguznsari/sentdex-NN | b91ebf6bb9e8c0580f3e186090716c7c33eb823d | [
"MIT"
] | null | null | null | versions.py | oguznsari/sentdex-NN | b91ebf6bb9e8c0580f3e186090716c7c33eb823d | [
"MIT"
] | null | null | null | import sys
import numpy as np
import matplotlib
print("Python:", sys.version)
print("Numpy:", np.__version__)
print("Matplotlib:", matplotlib.__version__)
| 19.5 | 44 | 0.769231 | import sys
import numpy as np
import matplotlib
print("Python:", sys.version)
print("Numpy:", np.__version__)
print("Matplotlib:", matplotlib.__version__)
| true | true |
f7397778926ebf421f7d9d0ffdc39316f57579f6 | 420 | py | Python | examples/idioms/programs/037.0671-currying.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 31 | 2020-05-02T13:34:26.000Z | 2021-06-06T17:25:52.000Z | examples/idioms/programs/037.0671-currying.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 108 | 2019-11-18T19:41:52.000Z | 2022-03-18T13:58:17.000Z | examples/idioms/programs/037.0671-currying.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 4 | 2020-05-19T08:57:44.000Z | 2020-09-21T08:53:46.000Z | """Currying.
Transform a function that takes multiple arguments into a function for which some of the arguments are preset.
Source: Adrian
"""
# Implementation author: cym13
# Created on 2015-11-30T12:37:28.255934Z
# Last modified on 2019-09-26T16:59:21.413984Z
# Version 3
from functools import partial
def f(a):
... | 16.153846 | 110 | 0.7 |
from functools import partial
def f(a):
def add(b):
return a + b
return add
print(f(2)(1))
| true | true |
f7397796c5f3f08bb50d94301d9225dd5ece1f1b | 1,114 | py | Python | spikeinterface/toolkit/tests/test_utils.py | marcbue/spikeinterface | d3462eeabcb9f0b9816004dd47355e40f4de1ac5 | [
"MIT"
] | null | null | null | spikeinterface/toolkit/tests/test_utils.py | marcbue/spikeinterface | d3462eeabcb9f0b9816004dd47355e40f4de1ac5 | [
"MIT"
] | null | null | null | spikeinterface/toolkit/tests/test_utils.py | marcbue/spikeinterface | d3462eeabcb9f0b9816004dd47355e40f4de1ac5 | [
"MIT"
] | null | null | null | import unittest
import pytest
import numpy as np
from spikeinterface.core.tests.testing_tools import generate_recording
from spikeinterface.toolkit.utils import (get_random_data_chunks,
get_closest_channels, get_noise_levels)
def test_get_random_data_chunks():
rec = g... | 30.944444 | 92 | 0.753142 | import unittest
import pytest
import numpy as np
from spikeinterface.core.tests.testing_tools import generate_recording
from spikeinterface.toolkit.utils import (get_random_data_chunks,
get_closest_channels, get_noise_levels)
def test_get_random_data_chunks():
rec = g... | true | true |
f73979105d96c017dcdbf9d64d2b3bc00b8ea5ad | 3,764 | py | Python | GetStarted/03_finding_images.py | pberezina/earthengine-py-notebooks | 4cbe3c52bcc9ed3f1337bf097aa5799442991a5e | [
"MIT"
] | 1 | 2020-03-20T19:39:34.000Z | 2020-03-20T19:39:34.000Z | GetStarted/03_finding_images.py | pberezina/earthengine-py-notebooks | 4cbe3c52bcc9ed3f1337bf097aa5799442991a5e | [
"MIT"
] | null | null | null | GetStarted/03_finding_images.py | pberezina/earthengine-py-notebooks | 4cbe3c52bcc9ed3f1337bf097aa5799442991a5e | [
"MIT"
] | null | null | null | '''
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/GetStarted/03_finding_images.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_bla... | 35.509434 | 422 | 0.720244 |
import subprocess
try:
import geehydro
except ImportError:
print('geehydro package not installed. Installing ...')
subprocess.check_call(["python", '-m', 'pip', 'install', 'geehydro'])
import ee
import folium
import geehydro
try:
ee.Initialize()
except Exception as e:
ee.Authenticate... | true | true |
f7397ac015f87f3ed5275efc9f2b5140d07fad8b | 299 | py | Python | tree_registry_crawler/pipelines.py | g0vhk-io/tree-registry-crawler | 95f959615c00a486ebd95d896d74907af96f0579 | [
"Apache-2.0"
] | null | null | null | tree_registry_crawler/pipelines.py | g0vhk-io/tree-registry-crawler | 95f959615c00a486ebd95d896d74907af96f0579 | [
"Apache-2.0"
] | null | null | null | tree_registry_crawler/pipelines.py | g0vhk-io/tree-registry-crawler | 95f959615c00a486ebd95d896d74907af96f0579 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class TreeRegistryCrawlerPipeline(object):
def process_item(self, item, spider):
return item
| 24.916667 | 65 | 0.722408 |
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class TreeRegistryCrawlerPipeline(object):
def process_item(self, item, spider):
return item
| true | true |
f7397ac8f6550cb6035d1be0d3d3974eda410e08 | 1,191 | py | Python | user/utils/validators.py | shoorday/IC | dfd6509d2e850ffd02dc0ddd31366e5e7f51eab8 | [
"MIT"
] | 2 | 2020-05-13T03:53:11.000Z | 2020-05-27T11:19:18.000Z | user/utils/validators.py | ShoorDay/IC | dfd6509d2e850ffd02dc0ddd31366e5e7f51eab8 | [
"MIT"
] | 4 | 2021-03-01T21:13:48.000Z | 2021-06-28T19:57:00.000Z | user/utils/validators.py | shoorday/IC | dfd6509d2e850ffd02dc0ddd31366e5e7f51eab8 | [
"MIT"
] | null | null | null | from rest_framework.serializers import ValidationError
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth import get_user_model, authenticate
User = get_user_model()
def pwdExist(data):
try:
new_password = str(data['new_password'])
return data
except Key... | 29.775 | 66 | 0.638119 | from rest_framework.serializers import ValidationError
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth import get_user_model, authenticate
User = get_user_model()
def pwdExist(data):
try:
new_password = str(data['new_password'])
return data
except Key... | true | true |
f7397b8effcc0c80aa4665a9fc237a3ced823fa4 | 1,323 | py | Python | facein_api/profiles/migrations/0002_fix_user_model.py | gda2048/facein-backend | 01a8500ffcdaef91540b0cdf94d50dd64cb46276 | [
"MIT"
] | 1 | 2021-12-27T12:35:06.000Z | 2021-12-27T12:35:06.000Z | facein_api/profiles/migrations/0002_fix_user_model.py | Sirkirill/facetracker-backend | 462dff11e7dccc379a6e04250b121120ec954c8d | [
"MIT"
] | 10 | 2021-06-07T16:41:35.000Z | 2022-03-12T01:04:23.000Z | facein_api/profiles/migrations/0002_fix_user_model.py | gda2048/facein-backend | 01a8500ffcdaef91540b0cdf94d50dd64cb46276 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.12 on 2020-05-24 21:17
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_add_custom_user'),
]
operations = [
migrations.AlterField(
model_name='user',
... | 37.8 | 141 | 0.540438 |
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_add_custom_user'),
]
operations = [
migrations.AlterField(
model_name='user',
name='is_admin',
field=models.Boolea... | true | true |
f7397cc615020ec3d682feaf0352f879ca7afd63 | 51,090 | py | Python | tests/t5/test_modeling_tf_t5.py | symphonylyh/transformers | 03e5d5196ca76008b60da9bb6d604e6bdbcba0db | [
"Apache-2.0"
] | 1 | 2022-03-16T13:02:15.000Z | 2022-03-16T13:02:15.000Z | tests/t5/test_modeling_tf_t5.py | symphonylyh/transformers | 03e5d5196ca76008b60da9bb6d604e6bdbcba0db | [
"Apache-2.0"
] | null | null | null | tests/t5/test_modeling_tf_t5.py | symphonylyh/transformers | 03e5d5196ca76008b60da9bb6d604e6bdbcba0db | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Google T5 Authors and HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 63.15204 | 7,207 | 0.727324 |
import unittest
from transformers import T5Config, is_tf_available
from transformers.file_utils import cached_property
from transformers.testing_utils import require_sentencepiece, require_tf, require_tokenizers, slow
from ..test_configuration_common import ConfigTester
from ..test_modeling_tf_common i... | true | true |
f7397ceefd9a0bfecc0fb5077977ef0966957942 | 8,844 | py | Python | pyutils/iolib/audio.py | SantiagoJN/spatialaudiogen | 5092b8988731f9704914beb44c5688a819508ade | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | pyutils/iolib/audio.py | SantiagoJN/spatialaudiogen | 5092b8988731f9704914beb44c5688a819508ade | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | pyutils/iolib/audio.py | SantiagoJN/spatialaudiogen | 5092b8988731f9704914beb44c5688a819508ade | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | import os
import scipy.signal
import numpy as np
from soundfile import SoundFile
from pyutils.iolib.video import getFFprobeMeta
from pyutils.cmd import runSystemCMD
# from scikits.audiolab import Sndfile, Format
import tempfile
import resampy
# import librosa
def load_wav(fname, rate=None):
# fp = Sndfile(fname, ... | 33.885057 | 162 | 0.558005 | import os
import scipy.signal
import numpy as np
from soundfile import SoundFile
from pyutils.iolib.video import getFFprobeMeta
from pyutils.cmd import runSystemCMD
import tempfile
import resampy
def load_wav(fname, rate=None):
fp = SoundFile(fname, 'r')
_signal = fp.buffer_read(dtype="int32")
... | true | true |
f7397d6d8749cf208e8db8144b75bcfd12aa7be3 | 46 | py | Python | payeer_api/__init__.py | MrGreen0/payeer_api | ccac0d91f5c33718a98b0803740e1ee4577d8da2 | [
"MIT"
] | 15 | 2018-05-17T09:52:58.000Z | 2022-03-26T01:25:24.000Z | payeer_api/__init__.py | naprsa/payeer_api | 247fe588dd5552cce93e41cc922f4f85a338f8d2 | [
"MIT"
] | 4 | 2020-03-08T01:56:27.000Z | 2022-03-26T07:23:01.000Z | payeer_api/__init__.py | naprsa/payeer_api | 247fe588dd5552cce93e41cc922f4f85a338f8d2 | [
"MIT"
] | 11 | 2018-04-01T13:42:34.000Z | 2022-03-26T01:24:25.000Z | from .api import PayeerAPI, PayeerAPIException | 46 | 46 | 0.869565 | from .api import PayeerAPI, PayeerAPIException | true | true |
f7397e75fe3089c6eeef45bde9626ad365d0d2ff | 1,289 | py | Python | test/functional/p2p_mempool.py | thehomosapien/AMLBitcoin | f097ca52c2e8039761f1927d83a9fe0b4c355b1c | [
"MIT"
] | null | null | null | test/functional/p2p_mempool.py | thehomosapien/AMLBitcoin | f097ca52c2e8039761f1927d83a9fe0b4c355b1c | [
"MIT"
] | null | null | null | test/functional/p2p_mempool.py | thehomosapien/AMLBitcoin | f097ca52c2e8039761f1927d83a9fe0b4c355b1c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The AmlBitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test p2p mempool message.
Test that nodes are disc... | 33.051282 | 75 | 0.711404 |
from test_framework.mininode import *
from test_framework.test_framework import AmlBitcoinTestFramework
from test_framework.util import *
class P2PMempoolTests(AmlBitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra_args = [["-p... | true | true |
f7397f5d7807ad22c78ac3a4d71ca0baada27b94 | 235,533 | py | Python | tools/cpplint.py | weizhenwei/OpenRTP | 7254c61064b2ed5d0023c688daa1c9fe768c3cb0 | [
"BSD-3-Clause"
] | 13 | 2016-10-03T12:18:13.000Z | 2021-06-29T06:09:02.000Z | tools/cpplint.py | weizhenwei/OpenRTP | 7254c61064b2ed5d0023c688daa1c9fe768c3cb0 | [
"BSD-3-Clause"
] | null | null | null | tools/cpplint.py | weizhenwei/OpenRTP | 7254c61064b2ed5d0023c688daa1c9fe768c3cb0 | [
"BSD-3-Clause"
] | 6 | 2017-04-10T02:46:25.000Z | 2021-11-30T06:13:57.000Z | #!/usr/bin/python
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of ... | 38.273156 | 97 | 0.651386 |
import codecs
import copy
import getopt
import math
import os
import re
import sre_compile
import string
import sys
import unicodedata
_USAGE = """
Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
[--counting=total|toplevel|detailed] [--root=subd... | true | true |
f7397f66da06a94adfa8579e5135288d2a19efe2 | 425 | py | Python | src/kol/request/TakeMeatFromClosetRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 19 | 2015-02-16T08:30:49.000Z | 2020-05-01T06:06:33.000Z | src/kol/request/TakeMeatFromClosetRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 5 | 2015-01-13T23:01:54.000Z | 2016-11-30T15:23:43.000Z | src/kol/request/TakeMeatFromClosetRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 19 | 2015-05-28T09:36:19.000Z | 2022-03-15T23:19:29.000Z | from GenericRequest import GenericRequest
class TakeMeatFromClosetRequest(GenericRequest):
"Adds meat to the player's closet."
def __init__(self, session, meat=""):
super(TakeMeatFromClosetRequest, self).__init__(session)
self.url = session.serverURL + "closet.php"
self.requestData["pw... | 35.416667 | 64 | 0.691765 | from GenericRequest import GenericRequest
class TakeMeatFromClosetRequest(GenericRequest):
def __init__(self, session, meat=""):
super(TakeMeatFromClosetRequest, self).__init__(session)
self.url = session.serverURL + "closet.php"
self.requestData["pwd"] = session.pwd
self.requestDa... | true | true |
f7397fbb415af0ad08cbdf9fc88f1effdda80b6b | 765 | py | Python | scripts/init-all-courses.py | osmaelo/university-setup | 16ec634e1c64dac4cebdd5c071b22907ec6f8848 | [
"MIT"
] | 245 | 2019-09-15T19:17:47.000Z | 2022-03-29T06:09:52.000Z | scripts/init-all-courses.py | osmaelo/university-setup | 16ec634e1c64dac4cebdd5c071b22907ec6f8848 | [
"MIT"
] | 9 | 2019-12-24T20:02:52.000Z | 2020-11-24T12:25:02.000Z | scripts/init-all-courses.py | osmaelo/university-setup | 16ec634e1c64dac4cebdd5c071b22907ec6f8848 | [
"MIT"
] | 76 | 2019-09-16T00:10:24.000Z | 2022-02-19T01:27:48.000Z | #!/bin/python3
from courses import Courses
for course in Courses():
lectures = course.lectures
course_title = lectures.course.info["title"]
lines = [r'\documentclass[a4paper]{article}',
r'\input{../preamble.tex}',
fr'\title{{{course_title}}}',
... | 36.428571 | 57 | 0.512418 |
from courses import Courses
for course in Courses():
lectures = course.lectures
course_title = lectures.course.info["title"]
lines = [r'\documentclass[a4paper]{article}',
r'\input{../preamble.tex}',
fr'\title{{{course_title}}}',
r'\begin{docum... | true | true |
f73980d50f3fd61ff3f286d51df51ca3393b6781 | 1,085 | py | Python | utils/kaggle.py | AdityaSidharta/kaggle_pneumonia | d4c2f257257aff3a30f0742f534fcf8975fc0815 | [
"MIT"
] | null | null | null | utils/kaggle.py | AdityaSidharta/kaggle_pneumonia | d4c2f257257aff3a30f0742f534fcf8975fc0815 | [
"MIT"
] | null | null | null | utils/kaggle.py | AdityaSidharta/kaggle_pneumonia | d4c2f257257aff3a30f0742f534fcf8975fc0815 | [
"MIT"
] | 1 | 2018-10-10T07:16:24.000Z | 2018-10-10T07:16:24.000Z | def to_predictionstring(x):
prob, x, y, width, height = x
return "{} {} {} {} {}".format(prob, x, y, width, height)
def create_predict_df(label_predict_df, bb_predict_df):
predict_df = label_predict_df.merge(bb_predict_df, how="left", on="name")
predict_df["patientId"] = predict_df["name"]
predict... | 41.730769 | 85 | 0.635023 | def to_predictionstring(x):
prob, x, y, width, height = x
return "{} {} {} {} {}".format(prob, x, y, width, height)
def create_predict_df(label_predict_df, bb_predict_df):
predict_df = label_predict_df.merge(bb_predict_df, how="left", on="name")
predict_df["patientId"] = predict_df["name"]
predict... | true | true |
f739810c170f625cf1a359eda8729aeef7377da5 | 2,720 | py | Python | Python Programs & Projects/Queue.py | EdgarCastillo101/Python | 3d47aaaa911def287e3b7a02f8c637e87539ffe7 | [
"MIT"
] | 2 | 2021-05-25T16:17:46.000Z | 2021-05-25T16:17:47.000Z | Python Programs & Projects/Queue.py | EdgarCastillo101/Python | 3d47aaaa911def287e3b7a02f8c637e87539ffe7 | [
"MIT"
] | null | null | null | Python Programs & Projects/Queue.py | EdgarCastillo101/Python | 3d47aaaa911def287e3b7a02f8c637e87539ffe7 | [
"MIT"
] | null | null | null | # Queue
# Queue is a FIFO data structure - - first-in, first-out.
# Deque is a double-ended queue, but we can use it for our queue.
# We use append() to enqueue an item, and popleft() to dequeue an item.
# See Python docs for deque.
"""
from collections import deque
my_queue = deque()
my_queue.append(5)
my_queue.appen... | 24.727273 | 76 | 0.557721 |
from collections import deque
class Queue():
def __init__(self):
self.queue = deque()
self.size = 0
def enqueue(self, item):
self.queue.append(item)
self.size += 1
def dequeue(self, item):
if self.size > 0:
self.size -= 1
return se... | true | true |
f7398156ae31a52e060987da62538da487c61775 | 3,448 | py | Python | selenium_egencia.py | ghandic/egenica | 000956721115d190d5e2af2ee0a01ac3f84ff55c | [
"MIT"
] | null | null | null | selenium_egencia.py | ghandic/egenica | 000956721115d190d5e2af2ee0a01ac3f84ff55c | [
"MIT"
] | null | null | null | selenium_egencia.py | ghandic/egenica | 000956721115d190d5e2af2ee0a01ac3f84ff55c | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class Egencia(object):
def __init__(self, credentials):
self.driver = webdriver.Remote('http://localhost:4444/wd/hub', webdriver.DesiredCapabilities.CHROME)
self.__login(credentials)
self.s... | 37.478261 | 129 | 0.607889 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class Egencia(object):
def __init__(self, credentials):
self.driver = webdriver.Remote('http://localhost:4444/wd/hub', webdriver.DesiredCapabilities.CHROME)
self.__login(credentials)
self.s... | true | true |
f739832932d30cf4fcf2d8ee9fb77c4e75b99176 | 5,823 | py | Python | episcanpy/preprocessing/_readimpute.py | mruffalo/epiScanpy | bcb86347d2b8451c384f97162625c8d5efb27ffc | [
"BSD-3-Clause"
] | 96 | 2019-05-25T17:41:13.000Z | 2022-02-28T10:29:23.000Z | episcanpy/preprocessing/_readimpute.py | mruffalo/epiScanpy | bcb86347d2b8451c384f97162625c8d5efb27ffc | [
"BSD-3-Clause"
] | 43 | 2019-07-12T03:12:51.000Z | 2022-03-30T13:07:19.000Z | episcanpy/preprocessing/_readimpute.py | mruffalo/epiScanpy | bcb86347d2b8451c384f97162625c8d5efb27ffc | [
"BSD-3-Clause"
] | 28 | 2019-03-28T16:40:52.000Z | 2022-03-16T16:12:40.000Z | import numpy as np
import anndata as ad
import pandas as pd
def load_met_noimput(matrix_file, path='', save=False):
"""
read the raw count matrix and convert it into an AnnData object.
write down the matrix as .h5ad (AnnData object) if save = True.
Return AnnData object
"""
matrix = []
cell... | 32.713483 | 122 | 0.604499 | import numpy as np
import anndata as ad
import pandas as pd
def load_met_noimput(matrix_file, path='', save=False):
matrix = []
cell_names = []
feature_names = []
with open(path+matrix_file) as f:
line = f.readline()[:-2].split('\t')
if line[0] == 'sample_name':
feature_name... | true | true |
f73984c433d98d58cae5e8d8f3b8afeceb366e7d | 18,890 | py | Python | nuitka/tools/quality/autoformat/Autoformat.py | lermana/Nuitka | 6e31e323278fff9fe6c1a99e52d1017129e4120a | [
"Apache-2.0"
] | null | null | null | nuitka/tools/quality/autoformat/Autoformat.py | lermana/Nuitka | 6e31e323278fff9fe6c1a99e52d1017129e4120a | [
"Apache-2.0"
] | null | null | null | nuitka/tools/quality/autoformat/Autoformat.py | lermana/Nuitka | 6e31e323278fff9fe6c1a99e52d1017129e4120a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... | 30.175719 | 108 | 0.591424 |
import os
import re
import subprocess
import sys
from nuitka.tools.quality.Git import (
getFileHashContent,
putFileHashContent,
updateFileIndex,
updateWorkingFile,
)
from nuitka.tools.quality.ScanSources import isPythonFile
from nuitka.Tracing import general, my_print
from nuitka.ut... | true | true |
f7398579137bd1f5161e88e5dafc93be49c62d75 | 2,054 | py | Python | training_curves.py | yourwanghao/Ultrasound_Nerve_Segmentation | 9a73cdb9a97b27c375a1023f4426d7e5a89b6a4d | [
"MIT"
] | null | null | null | training_curves.py | yourwanghao/Ultrasound_Nerve_Segmentation | 9a73cdb9a97b27c375a1023f4426d7e5a89b6a4d | [
"MIT"
] | null | null | null | training_curves.py | yourwanghao/Ultrasound_Nerve_Segmentation | 9a73cdb9a97b27c375a1023f4426d7e5a89b6a4d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
## based on https://github.com/dmlc/mxnet/issues/1302
## Parses the model fit log file and generates a train/val vs epoch plot
import matplotlib.pyplot as plt
import numpy as np
import re
import argparse
def log_train_metric(period, auto_reset=False):
"""Callback to log the training evaluati... | 29.342857 | 94 | 0.642162 |
se):
def _callback(param):
if param.nbatch % period == 0 and param.eval_metric is not None:
name_value = param.eval_metric.get_name_value()
for name, value in name_value:
logging.info('Iter[%d] Batch[%d] Train-%s=%f',
param.epoch, param.... | true | true |
f739857b3a1066812a6cd3d08249b014803a9745 | 364 | py | Python | tests/test_ghebbrish_converter.py | ctrl-escp/gibberish2utf8 | 052cad946e8fa847dfbc984ee02adbb6d8c07a65 | [
"MIT"
] | 3 | 2020-11-14T17:11:52.000Z | 2020-11-30T08:34:06.000Z | tests/test_ghebbrish_converter.py | ctrl-escp/gibberish2utf8 | 052cad946e8fa847dfbc984ee02adbb6d8c07a65 | [
"MIT"
] | null | null | null | tests/test_ghebbrish_converter.py | ctrl-escp/gibberish2utf8 | 052cad946e8fa847dfbc984ee02adbb6d8c07a65 | [
"MIT"
] | 1 | 2021-03-29T19:11:11.000Z | 2021-03-29T19:11:11.000Z | from unittest import TestCase
from ..gib2u import GhebbrishConverter
class TestGhebbrishConverter(TestCase):
gib = GhebbrishConverter('')
def test_gibberish_to_utf8_converter(self):
original_string = "ùìåí çðåê"
expected_output = "שלום חנוך"
self.assertEqual(self.gib.convert_gibberish... | 30.333333 | 94 | 0.760989 | from unittest import TestCase
from ..gib2u import GhebbrishConverter
class TestGhebbrishConverter(TestCase):
gib = GhebbrishConverter('')
def test_gibberish_to_utf8_converter(self):
original_string = "ùìåí çðåê"
expected_output = "שלום חנוך"
self.assertEqual(self.gib.convert_gibberish... | true | true |
f739872425e13a4775572df191a1cc5a921c1485 | 4,855 | py | Python | src/selectedtests/test_mappings/update_test_mappings.py | isabella232/selected-tests | 890cd5f39f5571d50f0406b4c25a1a2eef1006a3 | [
"Apache-2.0"
] | 2 | 2020-04-13T11:26:57.000Z | 2022-01-21T00:03:52.000Z | src/selectedtests/test_mappings/update_test_mappings.py | mongodb/selected-tests | 467f71f1d45b06ac3cc5db252f18658f8cd93083 | [
"Apache-2.0"
] | 54 | 2019-09-26T18:56:34.000Z | 2022-03-12T01:07:00.000Z | src/selectedtests/test_mappings/update_test_mappings.py | isabella232/selected-tests | 890cd5f39f5571d50f0406b4c25a1a2eef1006a3 | [
"Apache-2.0"
] | 6 | 2019-10-01T14:24:27.000Z | 2020-02-13T15:53:47.000Z | """Methods to update test mappings for a project."""
from typing import Any, Dict, List
import structlog
from evergreen.api import EvergreenApi
from pymongo import ReturnDocument, UpdateOne
from pymongo.errors import BulkWriteError
from selectedtests.datasource.mongo_wrapper import MongoWrapper
from selectedtests.he... | 39.471545 | 98 | 0.702987 | from typing import Any, Dict, List
import structlog
from evergreen.api import EvergreenApi
from pymongo import ReturnDocument, UpdateOne
from pymongo.errors import BulkWriteError
from selectedtests.datasource.mongo_wrapper import MongoWrapper
from selectedtests.helpers import create_query
from selectedtests.project_... | true | true |
f739880c7d893e39c63d767d3c9cfaafd4237b81 | 416 | py | Python | dashboard/migrations/0006_auto_20181212_0011.py | HemanthJella/ewallet | cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a | [
"Apache-2.0"
] | null | null | null | dashboard/migrations/0006_auto_20181212_0011.py | HemanthJella/ewallet | cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a | [
"Apache-2.0"
] | null | null | null | dashboard/migrations/0006_auto_20181212_0011.py | HemanthJella/ewallet | cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.9 on 2018-12-11 18:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0005_profile_card_id'),
]
operations = [
migrations.AlterField(
model_name='profile',
nam... | 21.894737 | 62 | 0.576923 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0005_profile_card_id'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='card_id',
field=models.CharField... | true | true |
f7398845d400b1fd4fedd532eb1520dff30d47a0 | 6,990 | py | Python | tensorflow/python/keras/_impl/keras/layers/embeddings.py | rxbtz/tensorflow | 499f7ed810928e29986453c83778f71e2b351eb5 | [
"Apache-2.0"
] | 14 | 2018-12-06T06:51:33.000Z | 2021-03-23T11:29:24.000Z | tensorflow/python/keras/_impl/keras/layers/embeddings.py | rxbtz/tensorflow | 499f7ed810928e29986453c83778f71e2b351eb5 | [
"Apache-2.0"
] | 1 | 2018-05-11T18:18:05.000Z | 2018-05-11T18:18:05.000Z | tensorflow/python/keras/_impl/keras/layers/embeddings.py | rxbtz/tensorflow | 499f7ed810928e29986453c83778f71e2b351eb5 | [
"Apache-2.0"
] | 2 | 2021-03-25T13:15:18.000Z | 2022-03-31T13:12:24.000Z | # Copyright 2015 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... | 38.196721 | 80 | 0.67568 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.keras._impl.keras import backend as K
from tensorflow.python.keras._impl.keras import constraints
from tensorflow.python.keras._impl.keras import initializers
from tensorflo... | true | true |
f73988562b7b327b20555dd522e268f576e4a131 | 568 | py | Python | salvia/protocols/introducer_protocol.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 6 | 2021-09-13T17:20:49.000Z | 2022-02-09T04:31:47.000Z | salvia/protocols/introducer_protocol.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 21 | 2021-09-20T00:56:54.000Z | 2022-03-22T01:12:12.000Z | salvia/protocols/introducer_protocol.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 9 | 2021-09-13T17:54:04.000Z | 2022-03-15T08:38:35.000Z | from dataclasses import dataclass
from typing import List
from salvia.types.peer_info import TimestampedPeerInfo
from salvia.util.streamable import Streamable, streamable
"""
Protocol to introducer
Note: When changing this file, also change protocol_message_types.py, and the protocol version in shared_protocol.py
"""... | 22.72 | 116 | 0.795775 | from dataclasses import dataclass
from typing import List
from salvia.types.peer_info import TimestampedPeerInfo
from salvia.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class RequestPeersIntroducer(Streamable):
@dataclass(frozen=True)
@streamable
class RespondPeersIntroducer(... | true | true |
f73988ca2c8902727c2fd83b0ac9135c87264288 | 2,810 | py | Python | chaco/tests/test_grid_data_source.py | martinRenou/chaco | 1888da3ecee89f9b2d11900cda9333b32fc5e89a | [
"BSD-3-Clause"
] | null | null | null | chaco/tests/test_grid_data_source.py | martinRenou/chaco | 1888da3ecee89f9b2d11900cda9333b32fc5e89a | [
"BSD-3-Clause"
] | null | null | null | chaco/tests/test_grid_data_source.py | martinRenou/chaco | 1888da3ecee89f9b2d11900cda9333b32fc5e89a | [
"BSD-3-Clause"
] | null | null | null | """
Tests of GridDataSource behavior.
"""
import unittest
from numpy import array
from numpy.testing import assert_array_equal
from chaco.api import GridDataSource
from traits.testing.unittest_tools import UnittestTools
class GridDataSourceTestCase(UnittestTools, unittest.TestCase):
def setUp(self):
s... | 37.466667 | 84 | 0.623488 |
import unittest
from numpy import array
from numpy.testing import assert_array_equal
from chaco.api import GridDataSource
from traits.testing.unittest_tools import UnittestTools
class GridDataSourceTestCase(UnittestTools, unittest.TestCase):
def setUp(self):
self.data_source = GridDataSource(
... | true | true |
f73988e65ec63a80b874f6af00124bc0d252e6d3 | 751 | py | Python | app/pizzarest/urls.py | LuisQBlanco/django-pizza-rest | f0ce591e58dc988375b8a79443293e1517fbc2b0 | [
"MIT"
] | null | null | null | app/pizzarest/urls.py | LuisQBlanco/django-pizza-rest | f0ce591e58dc988375b8a79443293e1517fbc2b0 | [
"MIT"
] | null | null | null | app/pizzarest/urls.py | LuisQBlanco/django-pizza-rest | f0ce591e58dc988375b8a79443293e1517fbc2b0 | [
"MIT"
] | null | null | null | """pizzarest URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 34.136364 | 77 | 0.70972 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f73989fd13fd3fa05e6c36bc3e9eee18c7a46981 | 106 | py | Python | lab01/client/client_app/urls.py | Boris-Barboris/rsoi | 30b03f50549f7977d5ecb7788b8e22b789f8859f | [
"MIT"
] | null | null | null | lab01/client/client_app/urls.py | Boris-Barboris/rsoi | 30b03f50549f7977d5ecb7788b8e22b789f8859f | [
"MIT"
] | null | null | null | lab01/client/client_app/urls.py | Boris-Barboris/rsoi | 30b03f50549f7977d5ecb7788b8e22b789f8859f | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^', views.index),
] | 15.142857 | 33 | 0.632075 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^', views.index),
] | true | true |
f7398a8a479eccf26faa8f62e461a5f188216d6f | 1,562 | py | Python | test/2020/test_2020_day7.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | 1 | 2020-11-30T19:17:50.000Z | 2020-11-30T19:17:50.000Z | test/2020/test_2020_day7.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | null | null | null | test/2020/test_2020_day7.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | null | null | null | from aoc_cas.aoc2020 import day7 as aoc
def testPart1():
data = """
light red bags contain 1 bright white bag, 2 muted yellow bags.
dark orange bags contain 3 bright white bags, 4 muted yellow bags.
bright white bags contain 1 shiny gold bag.
muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.
shiny g... | 38.097561 | 77 | 0.752241 | from aoc_cas.aoc2020 import day7 as aoc
def testPart1():
data = """
light red bags contain 1 bright white bag, 2 muted yellow bags.
dark orange bags contain 3 bright white bags, 4 muted yellow bags.
bright white bags contain 1 shiny gold bag.
muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.
shiny g... | true | true |
f7398b5c58c4df1dde303c88c55a586a55e6fd7f | 729 | py | Python | server/utils.py | shambu09/chat-bot | b84e74535091d71c9f26f3ab99829aad217cb18b | [
"MIT"
] | 1 | 2021-12-21T15:56:33.000Z | 2021-12-21T15:56:33.000Z | server/utils.py | shambu09/chat-bot-model | b84e74535091d71c9f26f3ab99829aad217cb18b | [
"MIT"
] | 1 | 2021-06-20T18:14:39.000Z | 2021-06-21T16:54:55.000Z | server/utils.py | shambu09/chat-bot-model | b84e74535091d71c9f26f3ab99829aad217cb18b | [
"MIT"
] | 1 | 2021-06-22T22:26:37.000Z | 2021-06-22T22:26:37.000Z | def write_qs(qs):
with open("qs.txt", "w") as f:
for i in qs:
f.write(i + "\n")
def write_ans(ans):
with open("ans.txt", "w") as f:
for i in ans:
f.write(i + "\n")
def read_qs():
with open("qs.txt", "r") as f:
qs = f.readlines()
qs = [i.rstrip("\n") for ... | 21.441176 | 41 | 0.533608 | def write_qs(qs):
with open("qs.txt", "w") as f:
for i in qs:
f.write(i + "\n")
def write_ans(ans):
with open("ans.txt", "w") as f:
for i in ans:
f.write(i + "\n")
def read_qs():
with open("qs.txt", "r") as f:
qs = f.readlines()
qs = [i.rstrip("\n") for ... | true | true |
f7398b8ee2735d8542260e92ce02ce683faeb4b4 | 577 | py | Python | pipeline/table_figure_scripts/rename_abundance_file_datasets.py | dewyman/TALON-paper-2019 | 8644b34573d6a5924e8d84a234fd0fcbf010c233 | [
"MIT"
] | 4 | 2019-08-23T20:59:26.000Z | 2020-05-07T02:32:35.000Z | pipeline/table_figure_scripts/rename_abundance_file_datasets.py | dewyman/TALON-paper-2019 | 8644b34573d6a5924e8d84a234fd0fcbf010c233 | [
"MIT"
] | null | null | null | pipeline/table_figure_scripts/rename_abundance_file_datasets.py | dewyman/TALON-paper-2019 | 8644b34573d6a5924e8d84a234fd0fcbf010c233 | [
"MIT"
] | 1 | 2020-04-28T07:34:09.000Z | 2020-04-28T07:34:09.000Z | import pandas as pd
from collections import defaultdict
import argparse
parser = argparse.ArgumentParser(description=\
'Renames PacBio and ONT datasets with more\
intelligent names')
parser.add_argument('--f', help='file to swap dataset col names in')
args = parser.parse_args()
f = args.f
# read in mapping file
m... | 26.227273 | 68 | 0.745234 | import pandas as pd
from collections import defaultdict
import argparse
parser = argparse.ArgumentParser(description=\
'Renames PacBio and ONT datasets with more\
intelligent names')
parser.add_argument('--f', help='file to swap dataset col names in')
args = parser.parse_args()
f = args.f
map_df = pd.read_csv('d... | true | true |
f7398bf1eff15fbb3d9d6bd1f250fd98451b79cc | 20,748 | py | Python | scf/_vhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | scf/_vhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | scf/_vhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import ctypes
import _ctypes
import numpy
import pyscf.lib
from pyscf import gto
from pyscf.gto.moleintor import make_cintopt
libcvhf = pyscf.lib.load_library('libcvhf')
def _fpointer(name):
return ctypes.c_void_p(_ctypes.dlsym(libcvhf._handle, name))
class VHFOpt(object):
de... | 37.05 | 90 | 0.587623 |
import sys
import ctypes
import _ctypes
import numpy
import pyscf.lib
from pyscf import gto
from pyscf.gto.moleintor import make_cintopt
libcvhf = pyscf.lib.load_library('libcvhf')
def _fpointer(name):
return ctypes.c_void_p(_ctypes.dlsym(libcvhf._handle, name))
class VHFOpt(object):
def __init__(self, mol,... | true | true |
f7398c1f7d30ab2bf048039b2b0e23837965d1ae | 16,869 | py | Python | yolov5/models/common.py | mrzhuzhe/yunru | faa7380a5363f654f1dc8f5d53b077d9f33bff6f | [
"MIT"
] | null | null | null | yolov5/models/common.py | mrzhuzhe/yunru | faa7380a5363f654f1dc8f5d53b077d9f33bff6f | [
"MIT"
] | null | null | null | yolov5/models/common.py | mrzhuzhe/yunru | faa7380a5363f654f1dc8f5d53b077d9f33bff6f | [
"MIT"
] | null | null | null | # YOLOv5 common modules
import math
from copy import copy
from pathlib import Path
import numpy as np
import pandas as pd
import requests
import torch
import torch.nn as nn
from PIL import Image
from torch.cuda import amp
from utils.datasets import letterbox
from utils.general import non_max_suppression, make_divisi... | 42.706329 | 120 | 0.57247 |
import math
from copy import copy
from pathlib import Path
import numpy as np
import pandas as pd
import requests
import torch
import torch.nn as nn
from PIL import Image
from torch.cuda import amp
from utils.datasets import letterbox
from utils.general import non_max_suppression, make_divisible, scale_coords, incr... | true | true |
f7398c1fa458a70e403ac5bb83bd055850d38530 | 278 | py | Python | Task2C.py | xd2w/Lent_Computing | ad7f772618363dd82f21d21d5df5636ec997fe3c | [
"MIT"
] | null | null | null | Task2C.py | xd2w/Lent_Computing | ad7f772618363dd82f21d21d5df5636ec997fe3c | [
"MIT"
] | null | null | null | Task2C.py | xd2w/Lent_Computing | ad7f772618363dd82f21d21d5df5636ec997fe3c | [
"MIT"
] | 1 | 2022-02-02T21:30:35.000Z | 2022-02-02T21:30:35.000Z | from floodsystem.stationdata import build_station_list
from floodsystem.stationdata import update_water_levels
from floodsystem.flood import stations_highest_rel_level
stations = build_station_list()
update_water_levels(stations)
print(stations_highest_rel_level(stations,10))
| 34.75 | 56 | 0.888489 | from floodsystem.stationdata import build_station_list
from floodsystem.stationdata import update_water_levels
from floodsystem.flood import stations_highest_rel_level
stations = build_station_list()
update_water_levels(stations)
print(stations_highest_rel_level(stations,10))
| true | true |
f7398cd89e326e9453c3ce94ad448b5d8dce5e1c | 2,364 | py | Python | tools/icon_build.py | awslabs/aws-sdk-api-changes | a3e6cbad729bb69f9d63373dc52c5e53faa349f2 | [
"Apache-2.0"
] | 11 | 2020-04-27T22:53:01.000Z | 2021-09-09T16:19:09.000Z | tools/icon_build.py | awslabs/aws-sdk-api-changes | a3e6cbad729bb69f9d63373dc52c5e53faa349f2 | [
"Apache-2.0"
] | 4 | 2020-03-05T17:41:25.000Z | 2021-06-02T02:39:34.000Z | tools/icon_build.py | awslabs/aws-sdk-api-changes | a3e6cbad729bb69f9d63373dc52c5e53faa349f2 | [
"Apache-2.0"
] | 2 | 2020-03-12T10:23:51.000Z | 2021-01-27T10:56:10.000Z | #!/usr/bin/env python
# note we'll use glue to assemble a css sprite
# for now we use this to pickup the images we want, convert
# from svg to png in our preferred size
import click
import cairosvg
import os
from pathlib import Path
from jinja2 import Template
from apichanges.icons import ICON_SERVICE_MAP
CSS_BUILD... | 29.185185 | 70 | 0.565567 |
# for now we use this to pickup the images we want, convert
# from svg to png in our preferred size
import click
import cairosvg
import os
from pathlib import Path
from jinja2 import Template
from apichanges.icons import ICON_SERVICE_MAP
CSS_BUILD = """
{% for name, path in icons.items() %}
.{{ name }} {backgroun... | true | true |
f7398d657af6b28533dc61ff9b7e5a7af7a0e424 | 989 | py | Python | app/app/urls.py | umtdemr/recipe-app-api | e28b2a704106240b47672c4aa5fe2ac169adb002 | [
"MIT"
] | null | null | null | app/app/urls.py | umtdemr/recipe-app-api | e28b2a704106240b47672c4aa5fe2ac169adb002 | [
"MIT"
] | 6 | 2021-03-19T00:29:34.000Z | 2021-09-22T18:39:45.000Z | app/app/urls.py | umtdemr/recipe-app-api | e28b2a704106240b47672c4aa5fe2ac169adb002 | [
"MIT"
] | null | null | null | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 36.62963 | 77 | 0.715875 | from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('api/user/', include('user.urls')),
path('api/recipe/', include('recipe.urls')),
] + static(settings.MEDIA... | true | true |
f7398da7dea040c14e019dc29b22255bbd8b853b | 15,670 | py | Python | main_window.py | MKing301/password-generator | 65a2450887539f9453f426220d9c5c34f8e8d508 | [
"MIT"
] | null | null | null | main_window.py | MKing301/password-generator | 65a2450887539f9453f426220d9c5c34f8e8d508 | [
"MIT"
] | null | null | null | main_window.py | MKing301/password-generator | 65a2450887539f9453f426220d9c5c34f8e8d508 | [
"MIT"
] | null | null | null | import sys
import random
import string
import json
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QStatusBar
from PyQt5.QtWidgets import QToolBar
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QAction
from ... | 39.771574 | 79 | 0.54365 | import sys
import random
import string
import json
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QStatusBar
from PyQt5.QtWidgets import QToolBar
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QAction
from ... | true | true |
f7398ddbab50e8ca13952c4009e17f1a8769e970 | 3,407 | py | Python | HDhomerunProxy.py | JortdeBokx/NPO-streams | 1ad35751f41f6cd4019be3cb3d73ab019d08efe0 | [
"MIT"
] | 2 | 2019-01-31T18:19:22.000Z | 2019-11-07T09:05:40.000Z | HDhomerunProxy.py | JortdeBokx/NPO-streams | 1ad35751f41f6cd4019be3cb3d73ab019d08efe0 | [
"MIT"
] | 4 | 2019-01-02T20:17:29.000Z | 2019-01-05T10:52:57.000Z | HDhomerunProxy.py | JortdeBokx/NPO-streams | 1ad35751f41f6cd4019be3cb3d73ab019d08efe0 | [
"MIT"
] | null | null | null | import logging
from flask import jsonify, request, abort, Response, stream_with_context
# Code similar to https://github.com/jkaberg/tvhProxy
from util.Helpers import generate_stream_ffmpeg
def setup_hdhrproxy(app, stream_handlers):
lineup = []
for sh in stream_handlers:
name = sh.__class__.__name__... | 33.732673 | 108 | 0.550338 | import logging
from flask import jsonify, request, abort, Response, stream_with_context
from util.Helpers import generate_stream_ffmpeg
def setup_hdhrproxy(app, stream_handlers):
lineup = []
for sh in stream_handlers:
name = sh.__class__.__name__
lineup += sh.get_lineup("http://" + app.conf... | true | true |
f7398eddf540bc00dfc4f86bff555a653deea03d | 5,783 | py | Python | cell2location/plt/plot_factor_spatial.py | nadavyayon/cell2location | 54141fb85d4b0d64825dfdb6d1bf147b025c856b | [
"Apache-2.0"
] | 127 | 2020-06-22T16:50:00.000Z | 2022-03-23T09:48:30.000Z | cell2location/plt/plot_factor_spatial.py | nadavyayon/cell2location | 54141fb85d4b0d64825dfdb6d1bf147b025c856b | [
"Apache-2.0"
] | 70 | 2020-06-24T01:31:28.000Z | 2022-03-29T13:40:05.000Z | cell2location/plt/plot_factor_spatial.py | nadavyayon/cell2location | 54141fb85d4b0d64825dfdb6d1bf147b025c856b | [
"Apache-2.0"
] | 36 | 2020-06-19T16:41:27.000Z | 2022-03-25T02:40:51.000Z | #!pip install plotnine
import numpy as np
import pandas as pd
import plotnine
def plot_factor_spatial(
adata,
fact,
cluster_names,
fact_ind=[0],
trans="log",
sample_name=None,
samples_col="sample",
obs_x="imagecol",
obs_y="imagerow",
n_columns=6,
max_col=5000,
col_break... | 43.156716 | 128 | 0.652948 |
import numpy as np
import pandas as pd
import plotnine
def plot_factor_spatial(
adata,
fact,
cluster_names,
fact_ind=[0],
trans="log",
sample_name=None,
samples_col="sample",
obs_x="imagecol",
obs_y="imagerow",
n_columns=6,
max_col=5000,
col_breaks=[0.1, 100, 1000, 300... | true | true |
f7399158ec2ad40e4861202ef1f4ddf096aadabd | 455 | py | Python | tst/types/condition_with_args.py | TST-Group-BE/flax-blockchain | ed850df4f28ef4b6f71c175c8b6d07d27f7b3cd5 | [
"Apache-2.0"
] | null | null | null | tst/types/condition_with_args.py | TST-Group-BE/flax-blockchain | ed850df4f28ef4b6f71c175c8b6d07d27f7b3cd5 | [
"Apache-2.0"
] | null | null | null | tst/types/condition_with_args.py | TST-Group-BE/flax-blockchain | ed850df4f28ef4b6f71c175c8b6d07d27f7b3cd5 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import List
from tst.types.condition_opcodes import ConditionOpcode
from tst.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class ConditionWithArgs(Streamable):
"""
This structure is used to store parsed CLVM conditions
Cond... | 25.277778 | 83 | 0.764835 | from dataclasses import dataclass
from typing import List
from tst.types.condition_opcodes import ConditionOpcode
from tst.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class ConditionWithArgs(Streamable):
opcode: ConditionOpcode
vars: List[bytes]
| true | true |
f73991b6463eb0e74d4aad55c6ff58d054e62fc4 | 3,843 | py | Python | Plots/Scatter/NCL_scatter_5.py | NCAR/GeoCAT-examples | fba1b045ba5145fa48cf2f3c1e3b3c7c863b0b5b | [
"Apache-2.0"
] | 42 | 2020-03-03T16:19:30.000Z | 2022-03-18T09:03:26.000Z | Plots/Scatter/NCL_scatter_5.py | netgodz/GeoCAT-examples | 5ed9a1d68b69a921d0f1fee1160e109853926ed9 | [
"Apache-2.0"
] | 351 | 2019-12-20T22:10:47.000Z | 2022-03-16T20:46:09.000Z | Plots/Scatter/NCL_scatter_5.py | netgodz/GeoCAT-examples | 5ed9a1d68b69a921d0f1fee1160e109853926ed9 | [
"Apache-2.0"
] | 32 | 2020-01-06T21:18:48.000Z | 2022-03-31T13:45:01.000Z | """
NCL_scatter_5.py
================
This script illustrates the following concepts:
- Drawing a scatter plot with markers of different colors
- Generating dummy data using "random.normal"
- Manually creating a legend using markers and text
- Customizing the label locations in a legend
- Changing the or... | 37.676471 | 106 | 0.586261 | true | true | |
f73992ba610e261d51c1cb910b95a2170b41e142 | 4,998 | py | Python | decoder/LimitedReorderDecoder.py | sshearing/mt-hw2 | 07494beb055a62839d64cb3e04c1bd26a0bfc584 | [
"MIT"
] | null | null | null | decoder/LimitedReorderDecoder.py | sshearing/mt-hw2 | 07494beb055a62839d64cb3e04c1bd26a0bfc584 | [
"MIT"
] | null | null | null | decoder/LimitedReorderDecoder.py | sshearing/mt-hw2 | 07494beb055a62839d64cb3e04c1bd26a0bfc584 | [
"MIT"
] | null | null | null | from operator import itemgetter
from itertools import groupby
from Decoder import Decoder
from collections import namedtuple
class LimitedReorderDecoder(Decoder):
def __init__(self, tm, lm, maxsize, reorderlimit, threshold):
# model and option inputs
self.tm = tm
self.lm = lm
self... | 42 | 137 | 0.551421 | from operator import itemgetter
from itertools import groupby
from Decoder import Decoder
from collections import namedtuple
class LimitedReorderDecoder(Decoder):
def __init__(self, tm, lm, maxsize, reorderlimit, threshold):
self.tm = tm
self.lm = lm
self.ms = maxsize
sel... | false | true |
f73993c541a696c9041c73c61c7ff09aee664cf9 | 821 | py | Python | apps/TCPB_-_ShadowServer_Binary_Whitelist_Search/app.py | cvahid/threatconnect-playbooks | 2a862a1739750104785aedd1af29de868363140a | [
"Apache-2.0"
] | null | null | null | apps/TCPB_-_ShadowServer_Binary_Whitelist_Search/app.py | cvahid/threatconnect-playbooks | 2a862a1739750104785aedd1af29de868363140a | [
"Apache-2.0"
] | null | null | null | apps/TCPB_-_ShadowServer_Binary_Whitelist_Search/app.py | cvahid/threatconnect-playbooks | 2a862a1739750104785aedd1af29de868363140a | [
"Apache-2.0"
] | 2 | 2021-09-23T01:47:03.000Z | 2022-03-10T04:25:43.000Z | # -*- coding: utf-8 -*-
""" ThreatConnect Playbook App """
import requests
# Import default Playbook Class (Required)
from playbook_app import PlaybookApp
class App(PlaybookApp):
""" Playbook App """
def run(self):
""" Run the App main logic.
This method should contain the core logic of t... | 31.576923 | 85 | 0.65408 |
import requests
from playbook_app import PlaybookApp
class App(PlaybookApp):
def run(self):
url = 'http://bin-test.shadowserver.org/api?md5={}'
md5 = self.tcex.playbook.read(self.args.md5_hash)
self.tcex.log.info('Querying the ShadowServer API for md5: {}'.format(md5))
respon... | true | true |
f73996a071303ab71db0b925e94fd8af9779a846 | 967 | py | Python | test/test_gross_price_component_dto.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | 1 | 2019-01-12T18:10:24.000Z | 2019-01-12T18:10:24.000Z | test/test_gross_price_component_dto.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | null | null | null | test/test_gross_price_component_dto.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
AVACloud API 1.17.3
AVACloud API specification # noqa: E501
OpenAPI spec version: 1.17.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import avacloud_client_python
from avacloud_client_python.... | 23.585366 | 112 | 0.731127 |
from __future__ import absolute_import
import unittest
import avacloud_client_python
from avacloud_client_python.models.gross_price_component_dto import GrossPriceComponentDto
from avacloud_client_python.rest import ApiException
class TestGrossPriceComponentDto(unittest.TestCase):
def setUp(self):
... | true | true |
f73997c890180a37039bd408c2806815f4657fdb | 6,950 | py | Python | mcitems.py | Mustard2/MenuCreator | c5d942ae0fc5997ed32da3b9e4dc6e9e6271d4b3 | [
"MIT"
] | 19 | 2020-12-17T05:19:20.000Z | 2022-03-28T23:19:39.000Z | mcitems.py | DJHartley/MenuCreator | c5d942ae0fc5997ed32da3b9e4dc6e9e6271d4b3 | [
"MIT"
] | 7 | 2021-02-07T18:49:14.000Z | 2021-05-29T12:19:21.000Z | mcitems.py | DJHartley/MenuCreator | c5d942ae0fc5997ed32da3b9e4dc6e9e6271d4b3 | [
"MIT"
] | 1 | 2021-02-22T23:35:30.000Z | 2021-02-22T23:35:30.000Z |
import bpy
from . import mcdata
# Class to store collections for section informations
class MCCollectionItem(bpy.types.PropertyGroup):
collection : bpy.props.PointerProperty(name="Collection",type=bpy.types.Collection)
# Class to store section informations
class MCSectionItem(bpy.types.PropertyGroup):
... | 48.263889 | 229 | 0.690072 |
import bpy
from . import mcdata
class MCCollectionItem(bpy.types.PropertyGroup):
collection : bpy.props.PointerProperty(name="Collection",type=bpy.types.Collection)
class MCSectionItem(bpy.types.PropertyGroup):
def mc_sections_collapsed_update(self, context):
if not self.collap... | true | true |
f739986e7e42db987a37377b934c4b267d477613 | 730 | py | Python | music_blog/forms.py | sashis/music-blog | c0ed13e3df4d25606345c4d8e064833fa86eb0c3 | [
"MIT"
] | null | null | null | music_blog/forms.py | sashis/music-blog | c0ed13e3df4d25606345c4d8e064833fa86eb0c3 | [
"MIT"
] | null | null | null | music_blog/forms.py | sashis/music-blog | c0ed13e3df4d25606345c4d8e064833fa86eb0c3 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Email, EqualTo
class LoginForm(FlaskForm):
username = StringField('Логин', validators=[DataRequired()])
password = PasswordField('Пароль', validators=[DataRequired()])
class RegisterFo... | 40.555556 | 116 | 0.736986 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Email, EqualTo
class LoginForm(FlaskForm):
username = StringField('Логин', validators=[DataRequired()])
password = PasswordField('Пароль', validators=[DataRequired()])
class RegisterFo... | true | true |
f7399aff48c6113e779047cdf465f74efc5e0bdf | 5,761 | py | Python | h1/models/agent_resource_event.py | hyperonecom/h1-client-python | 4ce355852ba3120ec1b8f509ab5894a5c08da730 | [
"MIT"
] | null | null | null | h1/models/agent_resource_event.py | hyperonecom/h1-client-python | 4ce355852ba3120ec1b8f509ab5894a5c08da730 | [
"MIT"
] | null | null | null | h1/models/agent_resource_event.py | hyperonecom/h1-client-python | 4ce355852ba3120ec1b8f509ab5894a5c08da730 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
HyperOne
HyperOne API # noqa: E501
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from h1.configuration import Configuration
class AgentResourceEvent(object):
"""NOTE: This cla... | 25.604444 | 131 | 0.563444 |
import pprint
import re
import six
from h1.configuration import Configuration
class AgentResourceEvent(object):
openapi_types = {
'id': 'str',
'name': 'str',
'state': 'str',
'created_on': 'str',
'project': 'str'
}
attribute_map = {
'id': 'id',
... | true | true |
f7399b220a705df30b220b604450037bb08ad392 | 9,471 | py | Python | resources/lib/basictypes/callable.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 22 | 2015-02-04T19:58:02.000Z | 2021-07-29T05:25:08.000Z | resources/lib/basictypes/callable.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 14 | 2015-01-07T00:08:28.000Z | 2019-10-24T00:27:48.000Z | resources/lib/basictypes/callable.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 15 | 2015-02-26T15:01:04.000Z | 2020-12-02T09:14:44.000Z | """Preliminary callable-object modelling classes"""
from basicproperty import propertied, basic, common
import inspect
from basictypes import list_types
__NULL__ = []
class Argument( propertied.Propertied ):
"""Representation of a single argument on a callable object"""
name = common.StringLocaleProperty(
'name',... | 30.551613 | 94 | 0.679548 | from basicproperty import propertied, basic, common
import inspect
from basictypes import list_types
__NULL__ = []
class Argument( propertied.Propertied ):
name = common.StringLocaleProperty(
'name', """The argument's name, as a simple string""",
)
default = basic.BasicProperty(
'default', """Default-value for... | true | true |
f7399c13194cace8b3bdd6347bccd6952f0d850d | 24,918 | py | Python | {{cookiecutter.project_slug}}/core/management/commands/fastapi.py | claysllanxavier/django-cookiecutter | 97de7ff4ed3dc94c32bf756a57aee0664a888cbc | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/core/management/commands/fastapi.py | claysllanxavier/django-cookiecutter | 97de7ff4ed3dc94c32bf756a57aee0664a888cbc | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/core/management/commands/fastapi.py | claysllanxavier/django-cookiecutter | 97de7ff4ed3dc94c32bf756a57aee0664a888cbc | [
"BSD-3-Clause"
] | null | null | null | import os
import platform
import subprocess
import sys
from pathlib import Path
from core.management.commands.utils import Utils
from django.apps import apps
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = """Manager responsável por analisar as classes de modelos do projeto... | 47.644359 | 141 | 0.566017 | import os
import platform
import subprocess
import sys
from pathlib import Path
from core.management.commands.utils import Utils
from django.apps import apps
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = """Manager responsável por analisar as classes de modelos do projeto... | true | true |
f7399da1a6f2badfb0f8ee94970291153318b5fd | 1,572 | py | Python | j1939/message_id.py | rliebscher/python-can-j1939 | a53b410ab05edd5f6ccd16b6888f1d770dd0df18 | [
"MIT"
] | null | null | null | j1939/message_id.py | rliebscher/python-can-j1939 | a53b410ab05edd5f6ccd16b6888f1d770dd0df18 | [
"MIT"
] | null | null | null | j1939/message_id.py | rliebscher/python-can-j1939 | a53b410ab05edd5f6ccd16b6888f1d770dd0df18 | [
"MIT"
] | null | null | null |
class MessageId:
"""The CAN MessageId of an PDU.
The MessageId consists of three parts:
* Priority
* Parameter Group Number
* Source Address
"""
def __init__(self, **kwargs): #priority=0, parameter_group_number=0, source_address=0):
"""
:param priority:
... | 34.933333 | 97 | 0.60369 |
class MessageId:
def __init__(self, **kwargs):
if 'can_id' in kwargs:
self.can_id = kwargs.get('can_id')
else:
self.priority = kwargs.get('priority', 0) & 7
self.parameter_group_number = kwargs.get('parameter_group_number', 0) & 0x3FFFF
... | true | true |
f7399ef9fe1cd64a45630716948933386260b1aa | 4,612 | py | Python | igibson/examples/demo/generate_data_semseg_lidar.py | Nick-AhSen/iGibson | c6854f11eec5d935fa3ef3d6d4852c6571beab4b | [
"MIT"
] | null | null | null | igibson/examples/demo/generate_data_semseg_lidar.py | Nick-AhSen/iGibson | c6854f11eec5d935fa3ef3d6d4852c6571beab4b | [
"MIT"
] | null | null | null | igibson/examples/demo/generate_data_semseg_lidar.py | Nick-AhSen/iGibson | c6854f11eec5d935fa3ef3d6d4852c6571beab4b | [
"MIT"
] | null | null | null | import os
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import igibson
from igibson.envs.igibson_env import iGibsonEnv
def get_lidar_sampling_pattern():
lidar_vertical_low = -15 / 180.0 * np.pi
lidar_vertical_high = 15 / 180.0 * np.pi
lidar_vertical_n_beams =... | 34.676692 | 138 | 0.6585 | import os
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import igibson
from igibson.envs.igibson_env import iGibsonEnv
def get_lidar_sampling_pattern():
lidar_vertical_low = -15 / 180.0 * np.pi
lidar_vertical_high = 15 / 180.0 * np.pi
lidar_vertical_n_beams =... | true | true |
f7399fbb5415937ee67219af20b12806764dc87c | 14,431 | py | Python | salt/cloud/libcloudfuncs.py | lyft/salt | 2715908423a412f736253d0e5d3cfe185a0179a2 | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | salt/salt/cloud/libcloudfuncs.py | smallyear/linuxLearn | 342e5020bf24b5fac732c4275a512087b47e578d | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/salt/cloud/libcloudfuncs.py | smallyear/linuxLearn | 342e5020bf24b5fac732c4275a512087b47e578d | [
"Apache-2.0"
] | 1 | 2017-01-27T21:33:36.000Z | 2017-01-27T21:33:36.000Z | # -*- coding: utf-8 -*-
'''
The generic libcloud template used to create the connections and deploy the
cloud virtual machines
'''
from __future__ import absolute_import
# Import python libs
import os
import logging
from salt.ext.six import string_types
import salt.ext.six as six
from salt.ext.six.moves import zip
#... | 28.185547 | 128 | 0.59095 |
from __future__ import absolute_import
import os
import logging
from salt.ext.six import string_types
import salt.ext.six as six
from salt.ext.six.moves import zip
try:
import libcloud
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from libcloud.comp... | true | true |
f739a06af2228d7ae09588fa651ee5d70db09994 | 7,994 | py | Python | face_lib/sort.py | Spain-AI/dark_helper | c2a5d774b455b2a374d6ca5e2715f7a560f5fe5b | [
"Apache-2.0"
] | null | null | null | face_lib/sort.py | Spain-AI/dark_helper | c2a5d774b455b2a374d6ca5e2715f7a560f5fe5b | [
"Apache-2.0"
] | 8 | 2020-11-13T18:59:55.000Z | 2022-03-12T00:39:43.000Z | face_lib/sort.py | Spain-AI/dark_helper | c2a5d774b455b2a374d6ca5e2715f7a560f5fe5b | [
"Apache-2.0"
] | 1 | 2020-07-10T19:16:37.000Z | 2020-07-10T19:16:37.000Z | """
SORT: A Simple, Online and Realtime Tracker
Copyright (C) 2016-2020 Alex Bewley alex@bewley.ai
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,... | 31.848606 | 141 | 0.641856 | from __future__ import print_function
import os
import numpy as np
from filterpy.kalman import KalmanFilter
try:
from numba import jit
except:
def jit(func):
return func
np.random.seed(0)
def linear_assignment(cost_matrix):
try:
import lap
_, x, y = lap.lapjv(cost_matrix, extend_cost=True)
re... | true | true |
f739a070c21ba2c681957348bca4279bc2086a5e | 8,998 | py | Python | utils/data_iterators/cifar100.py | ashishgaurav13/cl_safer_classifiers | a3df87a4bc863377485fa58a8a475991a4fc9800 | [
"MIT"
] | 1 | 2020-07-03T06:51:19.000Z | 2020-07-03T06:51:19.000Z | utils/data_iterators/cifar100.py | ashishgaurav13/cl_safer_classifiers | a3df87a4bc863377485fa58a8a475991a4fc9800 | [
"MIT"
] | 3 | 2021-06-08T20:55:17.000Z | 2022-03-12T00:14:23.000Z | utils/data_iterators/cifar100.py | ashishgaurav13/cl_safer_classifiers | a3df87a4bc863377485fa58a8a475991a4fc9800 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import os
from tensorflow.keras.models import load_model
from tensorflow.keras.backend import clear_session
from keras.utils import to_categorical
import tensorflow.keras as keras
from .common import save_pickle, load_pickle
from tqdm import tqdm
# utils/data_iterator... | 43.892683 | 100 | 0.599355 | import numpy as np
import matplotlib.pyplot as plt
import os
from tensorflow.keras.models import load_model
from tensorflow.keras.backend import clear_session
from keras.utils import to_categorical
import tensorflow.keras as keras
from .common import save_pickle, load_pickle
from tqdm import tqdm
class CIFAR100_Dat... | true | true |
f739a1518b03b04ccd669f466a9ce6a25ca6b6d6 | 354 | py | Python | b2share/records/__init__.py | hjhsalo/b2share-new | 2a2a961f7cc3a5353850e9a409fd7e879c715b0b | [
"MIT"
] | null | null | null | b2share/records/__init__.py | hjhsalo/b2share-new | 2a2a961f7cc3a5353850e9a409fd7e879c715b0b | [
"MIT"
] | null | null | null | b2share/records/__init__.py | hjhsalo/b2share-new | 2a2a961f7cc3a5353850e9a409fd7e879c715b0b | [
"MIT"
] | 1 | 2020-09-29T10:56:03.000Z | 2020-09-29T10:56:03.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 EUDAT.
#
# B2SHARE is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.
"""EUDAT Collaborative Data Infrastructure."""
from __future__ import absolute_import, print_function
from .ext import... | 22.125 | 74 | 0.728814 |
from __future__ import absolute_import, print_function
from .ext import B2SHARE
__all__ = ('B2SHARE', )
| true | true |
f739a270319b2d8d31892c372cc46ea5a17414c5 | 128 | py | Python | cma_es/__init__.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | cma_es/__init__.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | cma_es/__init__.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
import boost.python
cma_es_ext = boost.python.import_ext("cma_es_ext")
from cma_es_ext import *
| 25.6 | 50 | 0.828125 | from __future__ import division
import boost.python
cma_es_ext = boost.python.import_ext("cma_es_ext")
from cma_es_ext import *
| true | true |
f739a2dbd892235c33c043932a06a72ce6ceade8 | 1,395 | py | Python | c42_csr2postman/models/interfaces.py | 42c-presales/42c-report-scan-to-postman | 1d9a4965d54d2fd28944367894896f2ace9c74e9 | [
"Apache-2.0"
] | 1 | 2021-12-30T21:20:35.000Z | 2021-12-30T21:20:35.000Z | c42_csr2postman/models/interfaces.py | 42c-presales/42c-report-scan-to-postman | 1d9a4965d54d2fd28944367894896f2ace9c74e9 | [
"Apache-2.0"
] | null | null | null | c42_csr2postman/models/interfaces.py | 42c-presales/42c-report-scan-to-postman | 1d9a4965d54d2fd28944367894896f2ace9c74e9 | [
"Apache-2.0"
] | null | null | null | from enum import Enum
#
# This code was taken from:
# https://gist.github.com/cr0hn/89172938b7ac42c3100f4980ad881a24
#
class Serializable:
def _clean_dict_(self,
data = None,
clean_or_raw: str = "clean") -> dict:
# DICT
if type(data) is dict:
r... | 23.644068 | 75 | 0.542652 | from enum import Enum
class Serializable:
def _clean_dict_(self,
data = None,
clean_or_raw: str = "clean") -> dict:
if type(data) is dict:
ret = {}
for x, y in data.items():
if x.startswith("raw") and clean_or_r... | true | true |
f739a6c60de2b2fb645d7927730f0bfd084ab556 | 927 | py | Python | app/admin/forms/role_form.py | erics1996/D5-Video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | 1 | 2020-09-26T14:03:48.000Z | 2020-09-26T14:03:48.000Z | app/admin/forms/role_form.py | erics1996/d5_video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | null | null | null | app/admin/forms/role_form.py | erics1996/d5_video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectMultipleField
from wtforms.validators import DataRequired
from ...models import Auth
auth_list = Auth.query.all()
class RoleForm(FlaskForm):
name = StringField(
label="角色名称",
validators=[
DataRequired(... | 23.175 | 65 | 0.536138 | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectMultipleField
from wtforms.validators import DataRequired
from ...models import Auth
auth_list = Auth.query.all()
class RoleForm(FlaskForm):
name = StringField(
label="角色名称",
validators=[
DataRequired(... | true | true |
f739a745aa5a59a1a22b1c74871f419c2106250e | 413 | py | Python | python_modules/libraries/dagster-postgres/dagster_postgres/alembic/versions/b601eb913efa_add_tick_selector_index.py | dehume/dagster | 3b55c4e864775b7a70ed8ff539629317a1202505 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-postgres/dagster_postgres/alembic/versions/b601eb913efa_add_tick_selector_index.py | dehume/dagster | 3b55c4e864775b7a70ed8ff539629317a1202505 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-postgres/dagster_postgres/alembic/versions/b601eb913efa_add_tick_selector_index.py | dehume/dagster | 3b55c4e864775b7a70ed8ff539629317a1202505 | [
"Apache-2.0"
] | null | null | null | """add tick selector index
Revision ID: b601eb913efa
Revises: 16e3115a602a
Create Date: 2022-03-25 10:28:53.372766
"""
from dagster.core.storage.migration.utils import create_tick_selector_index
# revision identifiers, used by Alembic.
revision = "b601eb913efa"
down_revision = "16e3115a602a"
branch_labels = None
dep... | 17.956522 | 75 | 0.772397 | from dagster.core.storage.migration.utils import create_tick_selector_index
revision = "b601eb913efa"
down_revision = "16e3115a602a"
branch_labels = None
depends_on = None
def upgrade():
create_tick_selector_index()
def downgrade():
pass
| true | true |
f739aa00433ed35b99af31f1e5fd4de6fccab999 | 1,142 | py | Python | scripts/addons/animation_nodes/nodes/mesh/bmesh_create.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | 2 | 2020-04-16T22:12:40.000Z | 2022-01-22T17:18:45.000Z | scripts/addons/animation_nodes/nodes/mesh/bmesh_create.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | null | null | null | scripts/addons/animation_nodes/nodes/mesh/bmesh_create.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | 2 | 2019-05-16T04:01:09.000Z | 2020-08-25T11:42:26.000Z | import bpy
import bmesh
from bpy.props import *
from ... base_types import AnimationNode
class CreateBMeshFromMesh(bpy.types.Node, AnimationNode):
bl_idname = "an_CreateBMeshFromMeshNode"
bl_label = "Create BMesh"
errorHandlingType = "EXCEPTION"
def create(self):
self.newInput("Mesh", "Mesh", ... | 28.55 | 74 | 0.669877 | import bpy
import bmesh
from bpy.props import *
from ... base_types import AnimationNode
class CreateBMeshFromMesh(bpy.types.Node, AnimationNode):
bl_idname = "an_CreateBMeshFromMeshNode"
bl_label = "Create BMesh"
errorHandlingType = "EXCEPTION"
def create(self):
self.newInput("Mesh", "Mesh", ... | true | true |
f739aacd030ba09bfd0eb44145da5d5dbad40ed4 | 4,934 | py | Python | PDF_Generation_and_Text_Summarization/src/main.py | kanishkaa24/Telegram-bots | f91532244e8950a9e9c74dd76cf64e9bd2e23c04 | [
"MIT"
] | null | null | null | PDF_Generation_and_Text_Summarization/src/main.py | kanishkaa24/Telegram-bots | f91532244e8950a9e9c74dd76cf64e9bd2e23c04 | [
"MIT"
] | 7 | 2021-07-01T18:02:45.000Z | 2021-07-14T07:03:10.000Z | PDF_Generation_and_Text_Summarization/src/main.py | kanishkaa24/Telegram-bots | f91532244e8950a9e9c74dd76cf64e9bd2e23c04 | [
"MIT"
] | 9 | 2021-07-01T18:02:03.000Z | 2021-07-11T10:20:34.000Z | from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from sumy.parsers.html import HtmlParser
from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lsa import LsaSummarizer as Summarizer
from sumy.nlp.stemm... | 39.790323 | 227 | 0.747669 | from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from sumy.parsers.html import HtmlParser
from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lsa import LsaSummarizer as Summarizer
from sumy.nlp.stemm... | true | true |
f739ab0c9b82f092ac736775b4d3e4a637761850 | 2,206 | py | Python | datahub/omis/payment/test/test_utils.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 6 | 2019-12-02T16:11:24.000Z | 2022-03-18T10:02:02.000Z | datahub/omis/payment/test/test_utils.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 1,696 | 2019-10-31T14:08:37.000Z | 2022-03-29T12:35:57.000Z | datahub/omis/payment/test/test_utils.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 9 | 2019-11-22T12:42:03.000Z | 2021-09-03T14:25:05.000Z | from dateutil.parser import parse as dateutil_parse
from datahub.omis.payment.constants import PaymentMethod
from datahub.omis.payment.utils import trasform_govuk_payment_to_omis_payment_data
class TestGetOmisPaymentDataFromGovukPayment:
"""
Tests for the `trasform_govuk_payment_to_omis_payment_data` functio... | 35.015873 | 82 | 0.548504 | from dateutil.parser import parse as dateutil_parse
from datahub.omis.payment.constants import PaymentMethod
from datahub.omis.payment.utils import trasform_govuk_payment_to_omis_payment_data
class TestGetOmisPaymentDataFromGovukPayment:
def test_with_non_success_response_returns_none(self):
govuk_payme... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.