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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f739f2f5b6b458f3a2cb5f2dbb8060e080fca2d8 | 243 | py | Python | mac/pyobjc-framework-Quartz/PyObjCTest/test_cifiltershape.py | albertz/music-player | d23586f5bf657cbaea8147223be7814d117ae73d | [
"BSD-2-Clause"
] | 132 | 2015-01-01T10:02:42.000Z | 2022-03-09T12:51:01.000Z | mac/pyobjc-framework-Quartz/PyObjCTest/test_cifiltershape.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 6 | 2015-01-06T08:23:19.000Z | 2019-03-14T12:22:06.000Z | mac/pyobjc-framework-Quartz/PyObjCTest/test_cifiltershape.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 27 | 2015-02-23T11:51:43.000Z | 2022-03-07T02:34:18.000Z |
from PyObjCTools.TestSupport import *
from Quartz.QuartzCore import *
class TestCIFilterShape (TestCase):
def testMethods(self):
self.assertArgIsBOOL(CIFilterShape.transformBy_interior_, 1)
if __name__ == "__main__":
main()
| 22.090909 | 68 | 0.748971 |
from PyObjCTools.TestSupport import *
from Quartz.QuartzCore import *
class TestCIFilterShape (TestCase):
def testMethods(self):
self.assertArgIsBOOL(CIFilterShape.transformBy_interior_, 1)
if __name__ == "__main__":
main()
| true | true |
f739f45f996aaacfcdd9136f44db8f1afcb98858 | 797 | py | Python | migrations/versions/577055ed7da4_.py | Evantually/cash-and-associates | ffccaf8d1018b312296adc6d432f802fd825b483 | [
"MIT"
] | null | null | null | migrations/versions/577055ed7da4_.py | Evantually/cash-and-associates | ffccaf8d1018b312296adc6d432f802fd825b483 | [
"MIT"
] | null | null | null | migrations/versions/577055ed7da4_.py | Evantually/cash-and-associates | ffccaf8d1018b312296adc6d432f802fd825b483 | [
"MIT"
] | 1 | 2021-08-21T12:42:57.000Z | 2021-08-21T12:42:57.000Z | """empty message
Revision ID: 577055ed7da4
Revises: 732b6fffe866
Create Date: 2021-08-19 02:09:56.472249
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '577055ed7da4'
down_revision = '732b6fffe866'
branch_labels = None
depends_on = None
def upgrade():
# ... | 25.709677 | 81 | 0.691343 | from alembic import op
import sqlalchemy as sa
revision = '577055ed7da4'
down_revision = '732b6fffe866'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f739f4aedbbfd71a426630b9d953e9fdb732b50e | 1,641 | py | Python | ds5-scripts/aosp_8_1/arm/open.py | rewhy/happer | 3b48894e2d91f150f1aee0ce75291b9ca2a29bbe | [
"Apache-2.0"
] | 32 | 2021-04-08T05:39:51.000Z | 2022-03-31T03:49:35.000Z | ds5-scripts/aosp_8_1/arm/open.py | rewhy/happer | 3b48894e2d91f150f1aee0ce75291b9ca2a29bbe | [
"Apache-2.0"
] | 2 | 2021-04-14T08:31:30.000Z | 2021-08-29T19:12:09.000Z | ds5-scripts/aosp_8_1/arm/open.py | rewhy/happer | 3b48894e2d91f150f1aee0ce75291b9ca2a29bbe | [
"Apache-2.0"
] | 3 | 2021-06-08T08:52:56.000Z | 2021-06-23T17:28:51.000Z | # open.py is used to ... when the open method is invoked in 32-bit mode.
import gc
import os
import sys
import time
from arm_ds.debugger_v1 import Debugger
from arm_ds.debugger_v1 import DebugException
import config
import memory
import mmu
# obtain current execution state
debugger = Debugger()
exec... | 24.863636 | 83 | 0.707495 |
import gc
import os
import sys
import time
from arm_ds.debugger_v1 import Debugger
from arm_ds.debugger_v1 import DebugException
import config
import memory
import mmu
debugger = Debugger()
execution_state = debugger.getCurrentExecutionContext()
def cleanup():
if mmu.page_table is not None:
... | false | true |
f739f5e047215138ecb2c702d77b4628b3c2bf85 | 13,067 | py | Python | indicators/admin.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | null | null | null | indicators/admin.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | 268 | 2020-03-31T15:46:59.000Z | 2022-03-31T18:01:08.000Z | indicators/admin.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | 1 | 2021-01-05T01:58:24.000Z | 2021-01-05T01:58:24.000Z | from adminsortable2.admin import SortableInlineAdminMixin
from django.contrib import admin
from django.db import models
from django.utils.encoding import force_text
from django.utils.translation import gettext_lazy as _
from django.utils.html import format_html
from indicators.models import (
Indicator, IndicatorTy... | 41.48254 | 130 | 0.688605 | from adminsortable2.admin import SortableInlineAdminMixin
from django.contrib import admin
from django.db import models
from django.utils.encoding import force_text
from django.utils.translation import gettext_lazy as _
from django.utils.html import format_html
from indicators.models import (
Indicator, IndicatorTy... | true | true |
f739f6fc414801c38208b08e4891b11de4a43d1e | 12,699 | py | Python | tests/contrib/redis/test_redis.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/contrib/redis/test_redis.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-12-22T16:56:55.000Z | 2020-12-22T16:56:55.000Z | tests/contrib/redis/test_redis.py | kenferrara/dd-trace-py | 12e52e0ab804061e72b0f76214f5e4bb475ae20f | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-12-22T16:54:02.000Z | 2020-12-22T16:54:02.000Z | # -*- coding: utf-8 -*-
import redis
import ddtrace
from ddtrace import Pin, compat
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.redis import get_traced_redis
from ddtrace.contrib.redis.patch import patch, unpatch
from tests.opentracer.utils import init_tracer
from ..config import REDI... | 30.453237 | 109 | 0.597449 |
import redis
import ddtrace
from ddtrace import Pin, compat
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.redis import get_traced_redis
from ddtrace.contrib.redis.patch import patch, unpatch
from tests.opentracer.utils import init_tracer
from ..config import REDIS_CONFIG
from tests.tra... | true | true |
f739f7405479ab6c149c0f968f26736c35c97367 | 3,525 | py | Python | MobileRevelator/python/android_xing.py | ohunecker/MR | b0c93436c7964d87a0b8154f8b7662b1731124b9 | [
"MIT"
] | 98 | 2019-02-03T22:50:24.000Z | 2022-03-17T12:50:56.000Z | MobileRevelator/python/android_xing.py | cewatkins/MR | 5ba553fd0eb4c1d80842074a553119486f005822 | [
"MIT"
] | 10 | 2019-03-14T20:12:10.000Z | 2020-05-23T10:37:54.000Z | MobileRevelator/python/android_xing.py | cewatkins/MR | 5ba553fd0eb4c1d80842074a553119486f005822 | [
"MIT"
] | 30 | 2019-02-03T22:50:27.000Z | 2022-03-30T12:37:30.000Z | #Pluginname="Xing (Android)"
#Filename="conversations.db"
#Type=App
import struct
def convertdata(db):
#ctx.gui_clearData()
waconn=ctx.sqlite_run_cmd(db,"SELECT _id, im_skype, company_name, bussiness_province, birthdate, display_name, page_name, bussiness_city, occupation_title from users.users_table;... | 38.315217 | 185 | 0.626383 |
import struct
def convertdata(db):
waconn=ctx.sqlite_run_cmd(db,"SELECT _id, im_skype, company_name, bussiness_province, birthdate, display_name, page_name, bussiness_city, occupation_title from users.users_table;")
if (waconn==-1):
print ("Error: "+ctx.sqlite_last_error(db))
... | true | true |
f739f7b974d2d1dd16a7b9aded204c562a1b9f9c | 191 | py | Python | HelmState/__init__.py | hansehe/HelmState | d4b83f1ed2259bd9728c61b8c95270b264fcfda1 | [
"MIT"
] | 1 | 2020-03-21T12:22:23.000Z | 2020-03-21T12:22:23.000Z | HelmState/__main__.py | hansehe/HelmState | d4b83f1ed2259bd9728c61b8c95270b264fcfda1 | [
"MIT"
] | null | null | null | HelmState/__main__.py | hansehe/HelmState | d4b83f1ed2259bd9728c61b8c95270b264fcfda1 | [
"MIT"
] | null | null | null | from HelmState import Main
import sys
def main():
"""Entry point for the application script"""
sys.stdout.write(Main.Main())
sys.exit(0)
if __name__ == "__main__":
main()
| 14.692308 | 48 | 0.649215 | from HelmState import Main
import sys
def main():
sys.stdout.write(Main.Main())
sys.exit(0)
if __name__ == "__main__":
main()
| true | true |
f739f980016373c8eb44419fbbcca1766d4dbbc6 | 4,906 | py | Python | examples/pipeline/hetero_sbt/pipeline-hetero-sbt-multi.py | QuantumA/FATE | 89a3dd593252128c1bf86fb1014b25a629bdb31a | [
"Apache-2.0"
] | 1 | 2021-12-03T06:33:33.000Z | 2021-12-03T06:33:33.000Z | examples/pipeline/hetero_sbt/pipeline-hetero-sbt-multi.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | 11 | 2020-10-09T09:53:50.000Z | 2021-12-06T16:14:51.000Z | examples/pipeline/hetero_sbt/pipeline-hetero-sbt-multi.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 The FATE 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 appli... | 45.850467 | 126 | 0.711374 |
import argparse
from pipeline.backend.pipeline import PipeLine
from pipeline.component import DataTransform
from pipeline.component import HeteroSecureBoost
from pipeline.component import Intersection
from pipeline.component import Reader
from pipeline.interface import Data
from pipeline.component impo... | true | true |
f739f9b082b1daeb0978051a0233b904bc22f951 | 3,051 | py | Python | sail_bpm/sail_bpm/custom_scripts/jinja_file/jinja_file.py | hrishikesh20/SAIL-BPM | 5288168be29ec1f46ba4231b62f65f1758fdb227 | [
"MIT"
] | 1 | 2021-04-04T13:12:04.000Z | 2021-04-04T13:12:04.000Z | sail_bpm/sail_bpm/custom_scripts/jinja_file/jinja_file.py | hrishikesh20/SAIL-BPM | 5288168be29ec1f46ba4231b62f65f1758fdb227 | [
"MIT"
] | null | null | null | sail_bpm/sail_bpm/custom_scripts/jinja_file/jinja_file.py | hrishikesh20/SAIL-BPM | 5288168be29ec1f46ba4231b62f65f1758fdb227 | [
"MIT"
] | 2 | 2022-03-23T06:30:46.000Z | 2022-03-23T07:21:43.000Z | from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe.utils import flt,today
from frappe import _
import decimal
import json
from datetime import datetime, timedelta
@frappe.whitelist()
def get_delivery_note_data(doc):
data = frappe.db.sql("""select item_cod... | 47.671875 | 299 | 0.658145 | from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe.utils import flt,today
from frappe import _
import decimal
import json
from datetime import datetime, timedelta
@frappe.whitelist()
def get_delivery_note_data(doc):
data = frappe.db.sql("""select item_cod... | true | true |
f739fa5aa2c2be84427ccffc4362b76e98bcaed9 | 1,330 | py | Python | django_auth2/views/reset_password.py | Nick1994209/django-auth2 | b8678f06ade985d2b5b0606e6e49bd9d2a49931a | [
"MIT"
] | null | null | null | django_auth2/views/reset_password.py | Nick1994209/django-auth2 | b8678f06ade985d2b5b0606e6e49bd9d2a49931a | [
"MIT"
] | null | null | null | django_auth2/views/reset_password.py | Nick1994209/django-auth2 | b8678f06ade985d2b5b0606e6e49bd9d2a49931a | [
"MIT"
] | null | null | null | from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
from django.views.generic import FormView
from .. import forms, mails
from ..tokens import password_reset_token_generator
class PasswordReset(FormView):
form_class = forms.PasswordResetForm
template_name = 'django_auth2/... | 28.913043 | 71 | 0.737594 | from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
from django.views.generic import FormView
from .. import forms, mails
from ..tokens import password_reset_token_generator
class PasswordReset(FormView):
form_class = forms.PasswordResetForm
template_name = 'django_auth2/... | true | true |
f739fb6a9e6fe996c02de0612bff3dcff6ea7b5c | 1,758 | py | Python | demo.py | Zeta36/devol | 06f762ed0f647dead1389cb920367cf27ca8dbfb | [
"MIT"
] | 3 | 2018-09-04T12:12:09.000Z | 2021-05-01T01:43:24.000Z | demo.py | Zeta36/devol | 06f762ed0f647dead1389cb920367cf27ca8dbfb | [
"MIT"
] | null | null | null | demo.py | Zeta36/devol | 06f762ed0f647dead1389cb920367cf27ca8dbfb | [
"MIT"
] | 2 | 2018-02-21T02:11:51.000Z | 2019-08-01T17:58:37.000Z | from keras.datasets import mnist
from keras.utils.np_utils import to_categorical
from devol import DEvol, GenomeHandler
import numpy as np
# **Prepare dataset**
# This problem uses mnist, a handwritten digit classification problem used
# for many introductory deep learning examples. Here, we load the data and
# prep... | 38.217391 | 85 | 0.758817 | from keras.datasets import mnist
from keras.utils.np_utils import to_categorical
from devol import DEvol, GenomeHandler
import numpy as np
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train.reshape(x_train.shape[0], 1, 28, 28).astype('float32') / 255
x_test = x_test.reshape(x_test.shape[0]... | false | true |
f739fd1040b679d5040af2976da189d84f3401ba | 5,588 | py | Python | data-science-onramp/ai-platform/modules/trainer/tfkeras_model/task.py | TKone7/python-docs-samples | ef3dd032d6fde6a47b944604788bb674e8e51b66 | [
"Apache-2.0"
] | 1 | 2021-03-25T10:15:56.000Z | 2021-03-25T10:15:56.000Z | data-science-onramp/ai-platform/modules/trainer/tfkeras_model/task.py | TKone7/python-docs-samples | ef3dd032d6fde6a47b944604788bb674e8e51b66 | [
"Apache-2.0"
] | 2 | 2021-04-15T19:02:01.000Z | 2021-05-11T04:53:15.000Z | data-science-onramp/ai-platform/modules/trainer/tfkeras_model/task.py | TKone7/python-docs-samples | ef3dd032d6fde6a47b944604788bb674e8e51b66 | [
"Apache-2.0"
] | 1 | 2021-07-15T21:04:39.000Z | 2021-07-15T21:04:39.000Z | # Copyright 2021 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, sof... | 32.678363 | 94 | 0.713314 |
import argparse
import os
import tensorflow as tf
from trainer import utils
from trainer.tfkeras_model import model
def get_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument(
"--input-path",
type=str,
required=True,
help="... | true | true |
f739fdb2899321a502b29b4687eb0f071e6271c2 | 166 | py | Python | rlflows/__init__.py | levmckinney/NormalizingFlowPolicies | 4474e4b96fea1b6238680bc9b3ebf277be39676d | [
"MIT"
] | 1 | 2021-07-31T00:12:33.000Z | 2021-07-31T00:12:33.000Z | rlflows/__init__.py | levmckinney/NormalizingFlowPolicies | 4474e4b96fea1b6238680bc9b3ebf277be39676d | [
"MIT"
] | null | null | null | rlflows/__init__.py | levmckinney/NormalizingFlowPolicies | 4474e4b96fea1b6238680bc9b3ebf277be39676d | [
"MIT"
] | null | null | null | from .action_dists import TorchGaussianMixtureDistribution
from .envs import cheetah_env_creator, ant_env_creator
from .custom_trainer import CustomKLUpdatePPOTrainer | 55.333333 | 58 | 0.903614 | from .action_dists import TorchGaussianMixtureDistribution
from .envs import cheetah_env_creator, ant_env_creator
from .custom_trainer import CustomKLUpdatePPOTrainer | true | true |
f739fea85a258a9d214794f00a720d41a723aadf | 17,928 | py | Python | pymc/bart/pgbart.py | austereantelope/pymc | 657eb2a7e46fa30e61d3c1b12a8ce15020794a2c | [
"Apache-2.0"
] | 1 | 2021-12-02T07:40:25.000Z | 2021-12-02T07:40:25.000Z | pymc/bart/pgbart.py | austereantelope/pymc | 657eb2a7e46fa30e61d3c1b12a8ce15020794a2c | [
"Apache-2.0"
] | null | null | null | pymc/bart/pgbart.py | austereantelope/pymc | 657eb2a7e46fa30e61d3c1b12a8ce15020794a2c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.447761 | 100 | 0.603693 |
import logging
from copy import copy
import aesara
import numpy as np
from aesara import function as aesara_function
from pymc.aesaraf import inputvars, join_nonshared_inputs, make_shared_replacements
from pymc.bart.bart import BARTRV
from pymc.bart.tree import LeafNode, SplitNode, Tree
from pymc.mode... | true | true |
f739ff70d24635826bcf0d76af520ce019c18470 | 5,626 | py | Python | .modules/.metagoofil/hachoir_parser/audio/flac.py | termux-one/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 1,103 | 2018-04-20T14:08:11.000Z | 2022-03-29T06:22:43.000Z | .modules/.metagoofil/hachoir_parser/audio/flac.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 236 | 2016-11-20T07:56:15.000Z | 2017-04-12T12:10:00.000Z | .modules/.metagoofil/hachoir_parser/audio/flac.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 262 | 2017-09-16T22:15:50.000Z | 2022-03-31T00:38:42.000Z | """
FLAC (audio) parser
Documentation:
* http://flac.sourceforge.net/format.html
Author: Esteban Loiseau <baal AT tuxfamily.org>
Creation date: 2008-04-09
"""
from hachoir_parser import Parser
from hachoir_core.field import FieldSet, String, Bit, Bits, UInt16, UInt24, RawBytes, Enum, NullBytes
from hachoir_core.st... | 35.607595 | 116 | 0.614824 |
from hachoir_parser import Parser
from hachoir_core.field import FieldSet, String, Bit, Bits, UInt16, UInt24, RawBytes, Enum, NullBytes
from hachoir_core.stream import BIG_ENDIAN, LITTLE_ENDIAN
from hachoir_core.tools import createDict
from hachoir_parser.container.ogg import parseVorbisComment
class VorbisComment(Fi... | true | true |
f739ffae5620d3e95bc4447bf10ca03f3d74fe05 | 2,023 | py | Python | drf_app_generators/templates/factories.py | drf-tools/drf-app-generators | b73db872810f6d6d931b564082942ac5227464cb | [
"MIT"
] | 3 | 2020-03-17T10:00:43.000Z | 2021-09-28T04:08:46.000Z | drf_app_generators/templates/factories.py | drf-tools/drf-app-generators | b73db872810f6d6d931b564082942ac5227464cb | [
"MIT"
] | 18 | 2020-03-17T09:49:26.000Z | 2021-09-22T18:45:30.000Z | drf_app_generators/templates/factories.py | drf-tools/drf-app-generators | b73db872810f6d6d931b564082942ac5227464cb | [
"MIT"
] | 1 | 2020-03-19T04:44:06.000Z | 2020-03-19T04:44:06.000Z | __all__ = ['FACTORY_VIEW', 'FACTORIES_VIEW', 'FACTORY_INIT']
FACTORIES_VIEW = """import datetime
from drf_core import factories
from {{ app_name }}.models import ({% for model in models %}
{{ model.object_name }},{% endfor %}
)
{% for model in models %}
# =========================================================... | 38.169811 | 142 | 0.560059 | __all__ = ['FACTORY_VIEW', 'FACTORIES_VIEW', 'FACTORY_INIT']
FACTORIES_VIEW = """import datetime
from drf_core import factories
from {{ app_name }}.models import ({% for model in models %}
{{ model.object_name }},{% endfor %}
)
{% for model in models %}
# =========================================================... | true | true |
f73a01ee3e92eb4c9a4ebb9332a63d1d080785ab | 355 | py | Python | program/migrations/0011_programslot_remove_is_active.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | program/migrations/0011_programslot_remove_is_active.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | program/migrations/0011_programslot_remove_is_active.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('program', '0010_show_remove_is_active'),
]
operations = [
migrations.RemoveField(
model_name='programslot',
... | 18.684211 | 50 | 0.611268 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('program', '0010_show_remove_is_active'),
]
operations = [
migrations.RemoveField(
model_name='programslot',
name='is_active',
... | true | true |
f73a02ef0f16ad8396acafba0c3ba04a9b062bdd | 2,319 | py | Python | du/android/hdump/renderer/qt/DiffViewer.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | 1 | 2021-12-21T13:18:08.000Z | 2021-12-21T13:18:08.000Z | du/android/hdump/renderer/qt/DiffViewer.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | null | null | null | du/android/hdump/renderer/qt/DiffViewer.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | null | null | null | import os
from PyQt4 import QtGui, QtCore
from du.android.hdump.HeapDump import HeapDump
from du.android.hdump.HeapDumpDiff import HeapDumpDiff, DiffNode
from du.android.hdump.SymbolResolver import SymbolResolver
from du.android.hdump.renderer.qt.ui.diffWindow import Ui_MainWindow
class DiffViewer(QtGui.QMainWindow,... | 32.661972 | 82 | 0.633463 | import os
from PyQt4 import QtGui, QtCore
from du.android.hdump.HeapDump import HeapDump
from du.android.hdump.HeapDumpDiff import HeapDumpDiff, DiffNode
from du.android.hdump.SymbolResolver import SymbolResolver
from du.android.hdump.renderer.qt.ui.diffWindow import Ui_MainWindow
class DiffViewer(QtGui.QMainWindow,... | true | true |
f73a037152f42e609132b726e7d2cd24691d8258 | 39 | py | Python | venv/lib/python3.6/encodings/ptcp154.py | JamesMusyoka/Blog | fdcb51cf4541bbb3b9b3e7a1c3735a0b1f45f0b5 | [
"Unlicense"
] | 2 | 2019-04-17T13:35:50.000Z | 2021-12-21T00:11:36.000Z | venv/lib/python3.6/encodings/ptcp154.py | JamesMusyoka/Blog | fdcb51cf4541bbb3b9b3e7a1c3735a0b1f45f0b5 | [
"Unlicense"
] | 2 | 2021-03-31T19:51:24.000Z | 2021-06-10T23:05:09.000Z | venv/lib/python3.6/encodings/ptcp154.py | JamesMusyoka/Blog | fdcb51cf4541bbb3b9b3e7a1c3735a0b1f45f0b5 | [
"Unlicense"
] | 2 | 2019-10-01T08:47:35.000Z | 2020-07-11T06:32:16.000Z | /usr/lib/python3.6/encodings/ptcp154.py | 39 | 39 | 0.820513 | /usr/lib/python3.6/encodings/ptcp154.py | false | true |
f73a0451d2c8f7256c5c2475175e60d5a83aa6ee | 586 | py | Python | overtime/calculations.py | Atwinenickson/lendsuphumanresourcemanagement | b46df164d59a4e94300376d679e07bd9a60d6343 | [
"MIT",
"Unlicense"
] | 36 | 2019-11-26T11:46:32.000Z | 2022-02-17T13:18:18.000Z | overtime/calculations.py | Atwinenickson/lendsuphumanresourcemanagement | b46df164d59a4e94300376d679e07bd9a60d6343 | [
"MIT",
"Unlicense"
] | 13 | 2020-02-14T09:30:16.000Z | 2022-03-12T00:58:09.000Z | overtime/calculations.py | Atwinenickson/lendsuphumanresourcemanagement | b46df164d59a4e94300376d679e07bd9a60d6343 | [
"MIT",
"Unlicense"
] | 16 | 2019-06-14T12:11:29.000Z | 2022-02-14T15:16:07.000Z | from holidays.selectors import is_on_holiday
def get_overtime_pay(overtime_application) -> float:
# determine the overtime pay for the overtime application
if overtime_application.is_on_holiday or overtime_application.is_on_sunday:
overtime_amount = overtime_application.number_of_hours * 2 * overtime_... | 41.857143 | 103 | 0.764505 | from holidays.selectors import is_on_holiday
def get_overtime_pay(overtime_application) -> float:
if overtime_application.is_on_holiday or overtime_application.is_on_sunday:
overtime_amount = overtime_application.number_of_hours * 2 * overtime_application.applicant.\
overtime_hourly_rate
... | true | true |
f73a0465ae7a1e497e613408d7bc3d6b4286c115 | 2,363 | py | Python | lambdas/record-set-cleaner-1.0.0-1/record-set-cleaner.py | dev-cloudbd/cfn-templates | 19aedb87273fcffd1fdd1a082e4b7333d44d6139 | [
"MIT"
] | null | null | null | lambdas/record-set-cleaner-1.0.0-1/record-set-cleaner.py | dev-cloudbd/cfn-templates | 19aedb87273fcffd1fdd1a082e4b7333d44d6139 | [
"MIT"
] | null | null | null | lambdas/record-set-cleaner-1.0.0-1/record-set-cleaner.py | dev-cloudbd/cfn-templates | 19aedb87273fcffd1fdd1a082e4b7333d44d6139 | [
"MIT"
] | null | null | null | # IAM Permissions
# Requires
# - 'route53:ListResourceRecordSets'
# - 'route53:ChangeResourceRecordSets'
# - 'route53:GetChange'
# Optional
# - 'logs:CreateLogGroup'
# - 'logs:CreateLogStream'
# - 'logs:PutLogEvents'
import logging
import os
import time
import boto3
from crhelper import CfnResource
LOG... | 28.817073 | 85 | 0.664833 |
import logging
import os
import time
import boto3
from crhelper import CfnResource
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.INFO)
helper = CfnResource()
try:
route53_client = boto3.client('route53')
except Exception as e:
helper.init_failure(e)
@helper.create
@helper.update
def n... | true | true |
f73a053fdbf81204ff6a8f61c79d54d982663492 | 25,787 | py | Python | paddlenlp/transformers/roberta/tokenizer.py | tanhanzhuo/PaddleNLP | d0d20678f2bec820570b4f09ca49cd402d20c3b6 | [
"Apache-2.0"
] | 1 | 2022-01-28T06:32:26.000Z | 2022-01-28T06:32:26.000Z | paddlenlp/transformers/roberta/tokenizer.py | tanhanzhuo/PaddleNLP | d0d20678f2bec820570b4f09ca49cd402d20c3b6 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/roberta/tokenizer.py | tanhanzhuo/PaddleNLP | d0d20678f2bec820570b4f09ca49cd402d20c3b6 | [
"Apache-2.0"
] | 1 | 2022-03-30T03:05:52.000Z | 2022-03-30T03:05:52.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 The Google AI Language Team Authors and The 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 Licens... | 41.2592 | 121 | 0.586769 |
import io
import os
import json
from paddle.utils import try_import
from .. import BasicTokenizer, PretrainedTokenizer, WordpieceTokenizer, GPTTokenizer, AddedToken
from ..gpt.tokenizer import bytes_to_unicode
from ...utils.downloader import get_path_from_url, COMMUNITY_MODEL_PREFIX
from ...utils.env im... | true | true |
f73a0566a5648baba82ef35edd6a06447f333e67 | 1,433 | py | Python | PyToolkit/logger.py | LiangsLi/PyToolkit | 2406835a1b653ad5b3bdbb1e9ae9cf2aaf6447d8 | [
"MIT"
] | null | null | null | PyToolkit/logger.py | LiangsLi/PyToolkit | 2406835a1b653ad5b3bdbb1e9ae9cf2aaf6447d8 | [
"MIT"
] | null | null | null | PyToolkit/logger.py | LiangsLi/PyToolkit | 2406835a1b653ad5b3bdbb1e9ae9cf2aaf6447d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: logger
Description :
Author : Liangs
date: 2019/7/28
-------------------------------------------------
Change Activity:
2019/7/28:
-----------------------------------------------... | 30.489362 | 96 | 0.568039 |
import logging
def init_logger(logger_name, log_file=None, is_debug=False, only_console=False):
if not only_console:
assert log_file
logger = logging.getLogger(logger_name)
if is_debug:
logger.setLevel(logging.DEBUG)
else:
logger.setLevel(logging.INFO)
c_handler = log... | true | true |
f73a05a35e2268d1368fe692a994702fa2899886 | 1,368 | py | Python | tests/y2018/test_2018_d10.py | ErikThorsell/advent-of-code-python | 8afb3d2dd731b77a421eff9dbd33d1f6a9dfbee3 | [
"MIT"
] | 2 | 2021-12-03T16:17:13.000Z | 2022-01-27T12:29:45.000Z | tests/y2018/test_2018_d10.py | ErikThorsell/advent-of-code-python | 8afb3d2dd731b77a421eff9dbd33d1f6a9dfbee3 | [
"MIT"
] | null | null | null | tests/y2018/test_2018_d10.py | ErikThorsell/advent-of-code-python | 8afb3d2dd731b77a421eff9dbd33d1f6a9dfbee3 | [
"MIT"
] | 1 | 2021-12-29T20:38:38.000Z | 2021-12-29T20:38:38.000Z | """TEST MODULE TEMPLATE"""
from advent_of_code.utils.parse import parse_star_vectors
from advent_of_code.y2018.d10 import solution_1
def test_solution_1():
example_input = """position=< 9, 1> velocity=< 0, 2>
position=< 7, 0> velocity=<-1, 0>
position=< 3, -2> velocity=<-1, 1>
position=< 6, 10> velocity=<-2,... | 34.2 | 58 | 0.598684 | from advent_of_code.utils.parse import parse_star_vectors
from advent_of_code.y2018.d10 import solution_1
def test_solution_1():
example_input = """position=< 9, 1> velocity=< 0, 2>
position=< 7, 0> velocity=<-1, 0>
position=< 3, -2> velocity=<-1, 1>
position=< 6, 10> velocity=<-2, -1>
position=< 2, -4> velo... | true | true |
f73a071480fc63afad913916ce833f0566fa595e | 8,304 | py | Python | test.py | Hooooot/doubanSpider | 0f011705ae9218ebdce3ef83ad3cd9e723c98e42 | [
"MIT"
] | 1 | 2019-12-24T08:05:26.000Z | 2019-12-24T08:05:26.000Z | test.py | Hooooot/doubanSpider | 0f011705ae9218ebdce3ef83ad3cd9e723c98e42 | [
"MIT"
] | null | null | null | test.py | Hooooot/doubanSpider | 0f011705ae9218ebdce3ef83ad3cd9e723c98e42 | [
"MIT"
] | null | null | null | import pickle
import sys
import time
from PyQt5.QtCore import Qt, QThread, QTimer, pyqtSignal
from PyQt5.QtGui import QIntValidator, QStandardItem, QStandardItemModel
from PyQt5.QtWidgets import (QAction, QApplication, QCheckBox, QComboBox,
QDialog, QGridLayout, QLabel, QLineEdit,
... | 34.6 | 79 | 0.589355 | import pickle
import sys
import time
from PyQt5.QtCore import Qt, QThread, QTimer, pyqtSignal
from PyQt5.QtGui import QIntValidator, QStandardItem, QStandardItemModel
from PyQt5.QtWidgets import (QAction, QApplication, QCheckBox, QComboBox,
QDialog, QGridLayout, QLabel, QLineEdit,
... | true | true |
f73a07dee8e21b1cca6a2cbac3105a06c33fa974 | 32,654 | py | Python | src/poretitioner/hdf5/hdf5.py | uwmisl/poretitioner | 0ff9f67a3b25fdcb460b11c970b2ed366da07da7 | [
"MIT"
] | 2 | 2021-03-11T21:27:16.000Z | 2021-03-18T00:58:22.000Z | src/poretitioner/hdf5/hdf5.py | uwmisl/poretitioner | 0ff9f67a3b25fdcb460b11c970b2ed366da07da7 | [
"MIT"
] | 12 | 2021-02-19T19:36:05.000Z | 2021-03-24T15:38:02.000Z | src/poretitioner/hdf5/hdf5.py | uwmisl/poretitioner | 0ff9f67a3b25fdcb460b11c970b2ed366da07da7 | [
"MIT"
] | null | null | null | """
===================
hdf5.py
===================
The Hierarchical Data Format version 5 (HDF5) defines a
a file format for storing and organzing massive amounts of
hiearchical data.
This module attempts to encapsulate the rich features of HDF5
alongside your favorite python3.7+ constructs
(e.g dataclasses)
[1] - ... | 35.962555 | 222 | 0.617597 | from __future__ import annotations
from abc import ABC, abstractmethod
from logging import Logger, getLogger
from typing import (
Any,
Dict,
Generic,
Iterable,
Mapping,
Optional,
Protocol,
Type,
TypedDict,
TypeVar,
Union,
)
import h5py
import numpy as np
from h5py import Fi... | true | true |
f73a0832b9fd89b058c81ae2b61ab5e1e7aac952 | 4,435 | py | Python | screen.py | devendra-beep/screen | 2cd8b86cc2a97cbc2b0bea33998e076054a2eca1 | [
"MIT"
] | null | null | null | screen.py | devendra-beep/screen | 2cd8b86cc2a97cbc2b0bea33998e076054a2eca1 | [
"MIT"
] | null | null | null | screen.py | devendra-beep/screen | 2cd8b86cc2a97cbc2b0bea33998e076054a2eca1 | [
"MIT"
] | null | null | null |
#author::devendra
import os
import shutil
l1="*" * 100
l2="-" * 100
print(l1)
print(l1)
print(l2)
print(l2)
print(" ###### ###### ##### ###### ##### ## # ")
print(" # # # # # # # # # ")
print(" ... | 27.71875 | 107 | 0.381511 |
import os
import shutil
l1="*" * 100
l2="-" * 100
print(l1)
print(l1)
print(l2)
print(l2)
print(" ###### ###### ##### ###### ##### ## # ")
print(" # # # # # # # # # ")
print(" ###... | true | true |
f73a0880b4e933988ec94e019043affed13c632c | 4,597 | py | Python | examples/python/using_qiskit_terra_level_2.py | biplab37/qiskit-aakash | e10b204887606f1f75bdfde182bb0c6d0a322c68 | [
"Apache-2.0"
] | 22 | 2019-08-15T04:39:15.000Z | 2022-03-06T05:17:04.000Z | examples/python/using_qiskit_terra_level_2.py | biplab37/qiskit-aakash | e10b204887606f1f75bdfde182bb0c6d0a322c68 | [
"Apache-2.0"
] | 2 | 2020-10-26T07:12:12.000Z | 2021-12-09T16:22:51.000Z | examples/python/using_qiskit_terra_level_2.py | biplab37/qiskit-aakash | e10b204887606f1f75bdfde182bb0c6d0a322c68 | [
"Apache-2.0"
] | 9 | 2019-09-05T05:33:00.000Z | 2021-10-09T16:04:53.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 32.373239 | 78 | 0.724385 |
import pprint, time
from qiskit import IBMQ, BasicAer
from qiskit import QiskitError
from qiskit.circuit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit.extensions import SwapGate
from qiskit.compiler import assemble
from qiskit.providers.ibmq import least_busy
from qiskit.tools.m... | true | true |
f73a096f68d9022cd6fb93c0b13f02d01d49e2d8 | 28,448 | py | Python | python/lbann/modules/subgraph/transformer.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | python/lbann/modules/subgraph/transformer.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | python/lbann/modules/subgraph/transformer.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | """Neural network modules for transformer models."""
import math
import lbann
from lbann.modules.base import Module, FullyConnectedModule
from lbann.util import make_iterable
class MultiheadAttention(Module):
"""Parallel instances of scaled dot-product attention.
See:
Ashish Vaswani, Noam Shazeer, Niki P... | 34.482424 | 127 | 0.565664 | import math
import lbann
from lbann.modules.base import Module, FullyConnectedModule
from lbann.util import make_iterable
class MultiheadAttention(Module):
global_count = 0
def __init__(self,
embed_dim,
num_heads,
branches,
d_kv = None,
... | true | true |
f73a0a857e15ef305c67c6934661566d9dbe8cfb | 1,954 | py | Python | src/models/predict_model.py | BasianLesi/Master-Thesis | 3417ab9d4f05e23da16203374fe9aaf20e51fab1 | [
"MIT"
] | null | null | null | src/models/predict_model.py | BasianLesi/Master-Thesis | 3417ab9d4f05e23da16203374fe9aaf20e51fab1 | [
"MIT"
] | null | null | null | src/models/predict_model.py | BasianLesi/Master-Thesis | 3417ab9d4f05e23da16203374fe9aaf20e51fab1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from helper import *
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
ROOT_DIR = g.ROOT_DIR
raw_data_dir = g.raw_data_dir
processed_data_dir = g.processed_data_dir
print(f"ROOT DIR = {ROOT_DIR}")
data_directory = ROOT_DIR+"/data/raw/"
@click.command()
@click.option('--data_dir', default=ROOT_DIR+"/d... | 34.280702 | 100 | 0.670931 |
from helper import *
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
ROOT_DIR = g.ROOT_DIR
raw_data_dir = g.raw_data_dir
processed_data_dir = g.processed_data_dir
print(f"ROOT DIR = {ROOT_DIR}")
data_directory = ROOT_DIR+"/data/raw/"
@click.command()
@click.option('--data_dir', default=ROOT_DIR+"/data/processed/", ... | true | true |
f73a0c1ffc56ec2f6589ebc91cff322666f2312e | 7,218 | py | Python | neurom/fst/__init__.py | mgeplf/NeuroM | e21c01979de3db643c309b6bf2fe0b5dc9363c3a | [
"BSD-3-Clause"
] | null | null | null | neurom/fst/__init__.py | mgeplf/NeuroM | e21c01979de3db643c309b6bf2fe0b5dc9363c3a | [
"BSD-3-Clause"
] | null | null | null | neurom/fst/__init__.py | mgeplf/NeuroM | e21c01979de3db643c309b6bf2fe0b5dc9363c3a | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | 41.245714 | 96 | 0.744389 |
import numpy as _np
from . import _neuritefunc as _nrt
from . import _neuronfunc as _nrn
from ..core import NeuriteType as _ntype
from ..core import iter_neurites as _ineurites
from ..core.types import tree_type_checker as _is_type
from ..exceptions import NeuroMError
from ._core import Fs... | true | true |
f73a0dbea7dcdfb682ba16834db550c8863f64e4 | 10,289 | py | Python | tests/testing/cPerf.py | sx-aurora-dev/llvm-lnt | 1befd8e072138ca843305a0b5e20e0883d19eafd | [
"Apache-2.0"
] | null | null | null | tests/testing/cPerf.py | sx-aurora-dev/llvm-lnt | 1befd8e072138ca843305a0b5e20e0883d19eafd | [
"Apache-2.0"
] | null | null | null | tests/testing/cPerf.py | sx-aurora-dev/llvm-lnt | 1befd8e072138ca843305a0b5e20e0883d19eafd | [
"Apache-2.0"
] | null | null | null | # RUN: python %s
import unittest
import sys
import os
import tempfile
from lnt.testing.profile.perf import LinuxPerfProfile
class CPerfTest(unittest.TestCase):
def setUp(self):
self.inputs = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'Inputs')
self... | 45.526549 | 92 | 0.372631 |
import unittest
import sys
import os
import tempfile
from lnt.testing.profile.perf import LinuxPerfProfile
class CPerfTest(unittest.TestCase):
def setUp(self):
self.inputs = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'Inputs')
self.fake_nm = 'pyth... | true | true |
f73a0ddb2db194fce0ec4cf9ef67bddd85155a2d | 1,962 | py | Python | bw2io/strategies/biosphere.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | bw2io/strategies/biosphere.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | bw2io/strategies/biosphere.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | from .migrations import migrate_exchanges, migrate_datasets
def drop_unspecified_subcategories(db):
"""Drop subcategories if they are in the following:
* ``unspecified``
* ``(unspecified)``
* ``''`` (empty string)
* ``None``
"""
UNSPECIFIED = {"unspecified", "(unspecified)... | 35.035714 | 121 | 0.626911 | from .migrations import migrate_exchanges, migrate_datasets
def drop_unspecified_subcategories(db):
UNSPECIFIED = {"unspecified", "(unspecified)", "", None}
for ds in db:
if ds.get("categories"):
while ds["categories"] and ds["categories"][-1] in UNSPECIFIED:
ds["categories... | true | true |
f73a0de2c7e56bea4206d064a99da01d4126616a | 1,159 | py | Python | corehq/apps/styleguide/views/docs.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | 1 | 2017-02-10T03:14:51.000Z | 2017-02-10T03:14:51.000Z | corehq/apps/styleguide/views/docs.py | bglar/commcare-hq | 972129fc26864c08c7bef07874bd2a7218550bff | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | corehq/apps/styleguide/views/docs.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | from django.http import HttpResponse
from django.utils.translation import ugettext_noop
from corehq.apps.styleguide.examples.simple_crispy_form.views import \
BaseSimpleCrispyFormSectionView
def default(request):
return HttpResponse('woot')
class FormsSimpleCrispyFormExampleView(BaseSimpleCrispyFormSectionV... | 35.121212 | 72 | 0.811044 | from django.http import HttpResponse
from django.utils.translation import ugettext_noop
from corehq.apps.styleguide.examples.simple_crispy_form.views import \
BaseSimpleCrispyFormSectionView
def default(request):
return HttpResponse('woot')
class FormsSimpleCrispyFormExampleView(BaseSimpleCrispyFormSectionV... | true | true |
f73a0e68b9586d049c9d0d1b572cb4200bb93bde | 44,179 | py | Python | dbaas/maintenance/migrations/0025_auto__add_field_databasecreate_plan_name__chg_field_databasecreate_pla.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | 303 | 2015-01-08T10:35:54.000Z | 2022-02-28T08:54:06.000Z | dbaas/maintenance/migrations/0025_auto__add_field_databasecreate_plan_name__chg_field_databasecreate_pla.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 124 | 2015-01-14T12:56:15.000Z | 2022-03-22T20:45:11.000Z | dbaas/maintenance/migrations/0025_auto__add_field_databasecreate_plan_name__chg_field_databasecreate_pla.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 110 | 2015-01-02T11:59:48.000Z | 2022-02-28T08:54:06.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DatabaseCreate.plan_name'
db.add_column(u'maintenance_dat... | 94.804721 | 227 | 0.58143 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'maintenance_databasecreate', 'plan_name',
self.gf('django... | true | true |
f73a0f5cf29abc4d4a26c951919bee15179889f8 | 3,921 | py | Python | scripts/publisher.py | jasonsbrooks/ARTIST | a4c95faefc964c147807dffccf55e7d7a5c58bb0 | [
"MIT"
] | null | null | null | scripts/publisher.py | jasonsbrooks/ARTIST | a4c95faefc964c147807dffccf55e7d7a5c58bb0 | [
"MIT"
] | null | null | null | scripts/publisher.py | jasonsbrooks/ARTIST | a4c95faefc964c147807dffccf55e7d7a5c58bb0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import json, copy, rospy, pdb, sys, signal
from artist_performer import Performer, NotePublisher
from sensor_msgs.msg import (
Image,
)
def main():
rospy.loginfo("Initializing node... ")
rospy.init_node("play_xylophone")
# performer = Performer()
# print("Performing!...")
... | 50.269231 | 821 | 0.41418 |
import json, copy, rospy, pdb, sys, signal
from artist_performer import Performer, NotePublisher
from sensor_msgs.msg import (
Image,
)
def main():
rospy.loginfo("Initializing node... ")
rospy.init_node("play_xylophone")
noteToNum = {"G4": 47,
"A4": 49,
"... | false | true |
f73a0f687f6d4f639ddfc53aa61e341146b91a13 | 1,704 | gyp | Python | src/trusted/validator/validator.gyp | MicrohexHQ/nacl_contracts | 3efab5eecb3cf7ba43f2d61000e65918aa4ba77a | [
"BSD-3-Clause"
] | 6 | 2015-02-06T23:41:01.000Z | 2015-10-21T03:08:51.000Z | src/trusted/validator/validator.gyp | MicrohexHQ/nacl_contracts | 3efab5eecb3cf7ba43f2d61000e65918aa4ba77a | [
"BSD-3-Clause"
] | null | null | null | src/trusted/validator/validator.gyp | MicrohexHQ/nacl_contracts | 3efab5eecb3cf7ba43f2d61000e65918aa4ba77a | [
"BSD-3-Clause"
] | 1 | 2019-10-02T08:41:50.000Z | 2019-10-02T08:41:50.000Z | # -*- gyp -*-
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'../../../build/common.gypi',
],
'targets': [
{
'target_name': 'validators',
'type': 'static... | 23.342466 | 81 | 0.44777 |
{
'includes': [
'../../../build/common.gypi',
],
'targets': [
{
'target_name': 'validators',
'type': 'static_library',
'sources' : [
'validator_init.c',
],
'conditions': [
['nacl_validator_ragel!=0', {
'defines': [
'NACL_VALIDATOR_RA... | true | true |
f73a0f70a34dbddd528d3e34e9f52558a60c5191 | 4,292 | py | Python | mythril/analysis/symbolic.py | soad003/mythril | 08882bfd9fcb90cef7fa623e66b7f9aec11f004d | [
"MIT"
] | null | null | null | mythril/analysis/symbolic.py | soad003/mythril | 08882bfd9fcb90cef7fa623e66b7f9aec11f004d | [
"MIT"
] | null | null | null | mythril/analysis/symbolic.py | soad003/mythril | 08882bfd9fcb90cef7fa623e66b7f9aec11f004d | [
"MIT"
] | null | null | null | from mythril import ether
from mythril.laser.ethereum import svm
import copy
import logging
from .ops import get_variable, SStore, Call, VarType
from mythril.laser.ethereum.strategy.basic import DepthFirstSearchStrategy, BreadthFirstSearchStrategy
class SymExecWrapper:
'''
Wrapper class for the LASER Symboli... | 37.982301 | 201 | 0.561277 | from mythril import ether
from mythril.laser.ethereum import svm
import copy
import logging
from .ops import get_variable, SStore, Call, VarType
from mythril.laser.ethereum.strategy.basic import DepthFirstSearchStrategy, BreadthFirstSearchStrategy
class SymExecWrapper:
def __init__(self, contract, address, stra... | true | true |
f73a0fcca07df0f7b112e6705b8b0aeea447e9f2 | 12,827 | py | Python | python/GafferUI/__init__.py | Tuftux/gaffer | 5acaf7cbfadbae841dc06854121ca85dcc5c338c | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/__init__.py | Tuftux/gaffer | 5acaf7cbfadbae841dc06854121ca85dcc5c338c | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/__init__.py | Tuftux/gaffer | 5acaf7cbfadbae841dc06854121ca85dcc5c338c | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | 37.505848 | 92 | 0.753801 | mport SelectionMenu
from .PathFilterWidget import PathFilterWidget
from .CompoundPathFilterWidget import CompoundPathFilterWidget
from .InfoPathFilterWidget import InfoPathFilterWidget
from .MatchPatternPathFilterWidget import MatchPatternPathFilterWidget
from .FileSequencePathFilterWidget import FileSequencePathFilter... | true | true |
f73a10bcb4592c94e60c746029271dd88c1e6e9b | 305 | py | Python | graphic_templates/slopegraph/graphic_config.py | stlpublicradio/dailygraphics | ce29a89ed99209579d849cdd6077529f63009fa8 | [
"MIT"
] | null | null | null | graphic_templates/slopegraph/graphic_config.py | stlpublicradio/dailygraphics | ce29a89ed99209579d849cdd6077529f63009fa8 | [
"MIT"
] | 1 | 2019-01-23T21:45:24.000Z | 2019-01-23T21:45:24.000Z | graphic_templates/slopegraph/graphic_config.py | stlpublicradio/dailygraphics | ce29a89ed99209579d849cdd6077529f63009fa8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1dF4lI8j77VOLP6SiGzByvbgg-yQOqZRq5FWJniOcrBE'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.816393 |
import base_filters
COPY_GOOGLE_DOC_KEY = '1dF4lI8j77VOLP6SiGzByvbgg-yQOqZRq5FWJniOcrBE'
USE_ASSETS = False
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| true | true |
f73a10df600fc03d8edd6652f5d7c50b27f6036e | 1,191 | py | Python | examples/capture_x.py | elerac/codepattern | 8ee7d04870b1d9b64045a15c488792b0f0f9aef3 | [
"MIT"
] | 45 | 2020-09-10T19:36:19.000Z | 2022-03-23T07:52:22.000Z | examples/capture_x.py | elerac/codepattern | 8ee7d04870b1d9b64045a15c488792b0f0f9aef3 | [
"MIT"
] | 3 | 2021-05-17T01:25:20.000Z | 2021-11-09T13:03:09.000Z | examples/capture_x.py | elerac/codepattern | 8ee7d04870b1d9b64045a15c488792b0f0f9aef3 | [
"MIT"
] | 11 | 2020-09-12T09:23:52.000Z | 2022-03-13T16:08:08.000Z | """
Capture projection pattern and decode x-coorde.
"""
import cv2
import numpy as np
import structuredlight as sl
def imshowAndCapture(cap, img_pattern, delay=250):
cv2.imshow("", img_pattern)
cv2.waitKey(delay)
ret, img_frame = cap.read()
img_gray = cv2.cvtColor(img_frame, cv2.COLOR_BGR2GRAY)
ret... | 27.068182 | 80 | 0.700252 | import cv2
import numpy as np
import structuredlight as sl
def imshowAndCapture(cap, img_pattern, delay=250):
cv2.imshow("", img_pattern)
cv2.waitKey(delay)
ret, img_frame = cap.read()
img_gray = cv2.cvtColor(img_frame, cv2.COLOR_BGR2GRAY)
return img_gray
def main():
width = 640
height = ... | true | true |
f73a11105fc65c11f7e6b663732253973747f0af | 3,103 | py | Python | torchplasma/filters/gaussian.py | hdkai/Plasma | 1942d7fe5f6b41c9a16c8e2d1b6c7cf263307c39 | [
"Apache-2.0"
] | null | null | null | torchplasma/filters/gaussian.py | hdkai/Plasma | 1942d7fe5f6b41c9a16c8e2d1b6c7cf263307c39 | [
"Apache-2.0"
] | null | null | null | torchplasma/filters/gaussian.py | hdkai/Plasma | 1942d7fe5f6b41c9a16c8e2d1b6c7cf263307c39 | [
"Apache-2.0"
] | null | null | null | #
# Plasma
# Copyright (c) 2021 Yusuf Olokoba.
#
from torch import arange, exp, tensor, Tensor
from torch.nn.functional import conv2d, conv3d, pad
from typing import Tuple
def gaussian_kernel (kernel_size: int, sigma: float = -1.) -> Tensor:
"""
Normalized 1D Gaussian kernel.
This operation is NOT di... | 40.298701 | 118 | 0.66613 |
from torch import arange, exp, tensor, Tensor
from torch.nn.functional import conv2d, conv3d, pad
from typing import Tuple
def gaussian_kernel (kernel_size: int, sigma: float = -1.) -> Tensor:
sigma = 0.3 * ((kernel_size - 1) * 0.5 - 1) + 0.8 if sigma < 0 else sigma
x = arange(kernel_size).float() - kern... | true | true |
f73a114ece41202ab698575bee28dd0d752a99ef | 1,689 | py | Python | src/python/WMCore/BossAir/MySQL/RunJobByStatus.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/BossAir/MySQL/RunJobByStatus.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/BossAir/MySQL/RunJobByStatus.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | """
_RunJobByStatus_
Monitoring DAO classes for Jobs in BossAir database.
It groups jobs in each sched_status and bossAir status and guarantee
all sched_status are always present in the output.
"""
from __future__ import print_function, division
from WMCore.Database.DBFormatter import DBFormatter
class RunJobByStat... | 35.93617 | 105 | 0.64476 | from __future__ import print_function, division
from WMCore.Database.DBFormatter import DBFormatter
class RunJobByStatus(DBFormatter):
sql = """
SELECT bl_status.name AS sched_status, count(bl_runjob.sched_status) AS count, bl_runjob.status
FROM bl_status
LEFT OUTER JOIN bl_runj... | true | true |
f73a11ec74c510ce53e589d16f35b0e29075e224 | 2,447 | py | Python | Hamiltonian_Cycle.py | jp20indian/HacktoberFest2021 | 093dc9a9a2b400039107df8a2ff09648ecc0eede | [
"Apache-2.0"
] | 2 | 2021-10-03T08:08:55.000Z | 2021-10-03T11:42:21.000Z | Hamiltonian_Cycle.py | jp20indian/HacktoberFest2021 | 093dc9a9a2b400039107df8a2ff09648ecc0eede | [
"Apache-2.0"
] | 1 | 2021-10-21T04:23:00.000Z | 2021-10-21T04:23:00.000Z | Hamiltonian_Cycle.py | jp20indian/HacktoberFest2021 | 093dc9a9a2b400039107df8a2ff09648ecc0eede | [
"Apache-2.0"
] | 17 | 2021-10-03T11:42:25.000Z | 2021-10-31T01:34:25.000Z |
# Hamiltonian cycle problem
class Graph():
def __init__(self, vertices):
self.graph = [[0 for column in range(vertices)]
for row in range(vertices)]
self.V = vertices
''' Check if this vertex is an adjacent vertex
of the previously added vertex and is not
included in the path earlier '''
def isSafe... | 21.848214 | 49 | 0.604005 |
class Graph():
def __init__(self, vertices):
self.graph = [[0 for column in range(vertices)]
for row in range(vertices)]
self.V = vertices
def isSafe(self, v, pos, path):
if self.graph[ path[pos-1] ][v] == 0:
return False
for vertex in path:
if vertex == v:
return False
retur... | true | true |
f73a12a5c0a914cbd4457a81f7e3871ccb3db12a | 2,289 | py | Python | Modules/nn/architectures/DenseNet/classes.py | iheb-brini/fitness-lab | 2d82d7a2ecba27f535cda880865e6d9ed446eac5 | [
"MIT"
] | null | null | null | Modules/nn/architectures/DenseNet/classes.py | iheb-brini/fitness-lab | 2d82d7a2ecba27f535cda880865e6d9ed446eac5 | [
"MIT"
] | null | null | null | Modules/nn/architectures/DenseNet/classes.py | iheb-brini/fitness-lab | 2d82d7a2ecba27f535cda880865e6d9ed446eac5 | [
"MIT"
] | null | null | null | from torch import nn, cat
from .constants import NUM_CONVS_IN_DENSE_BLOCKS
def conv_block(in_channels, out_channels):
blk = nn.Sequential(
nn.BatchNorm2d(in_channels), nn.ReLU(),
nn.Conv2d(in_channels, out_channels,
kernel_size=3, padding=1)
)
return blk
class DenseBl... | 30.118421 | 98 | 0.609 | from torch import nn, cat
from .constants import NUM_CONVS_IN_DENSE_BLOCKS
def conv_block(in_channels, out_channels):
blk = nn.Sequential(
nn.BatchNorm2d(in_channels), nn.ReLU(),
nn.Conv2d(in_channels, out_channels,
kernel_size=3, padding=1)
)
return blk
class DenseBl... | true | true |
f73a12cc371c83d417aff8ac443d2d5075ef6a7b | 17,480 | py | Python | myGym/envs/base_env.py | gabinsane/myGym | a41c6b11a47eaf19d0c69e67aeb48cf7a999d45a | [
"MIT"
] | 1 | 2021-04-23T20:52:39.000Z | 2021-04-23T20:52:39.000Z | myGym/envs/base_env.py | gabinsane/myGym | a41c6b11a47eaf19d0c69e67aeb48cf7a999d45a | [
"MIT"
] | null | null | null | myGym/envs/base_env.py | gabinsane/myGym | a41c6b11a47eaf19d0c69e67aeb48cf7a999d45a | [
"MIT"
] | 1 | 2021-01-22T16:46:48.000Z | 2021-01-22T16:46:48.000Z | import pybullet_data
import glob
import pybullet
import pybullet_utils.bullet_client as bc
import time
import numpy as np
from gym.utils import seeding
import gym
import os
import inspect
from myGym.envs.camera import Camera
import pkg_resources
currentdir = pkg_resources.resource_filename("myGym", "envs")
repodir = pk... | 35.528455 | 233 | 0.618593 | import pybullet_data
import glob
import pybullet
import pybullet_utils.bullet_client as bc
import time
import numpy as np
from gym.utils import seeding
import gym
import os
import inspect
from myGym.envs.camera import Camera
import pkg_resources
currentdir = pkg_resources.resource_filename("myGym", "envs")
repodir = pk... | true | true |
f73a1347135db69cb5b55591e12984998b2b6ef0 | 1,897 | py | Python | minisculus/wheel/_wheel_chain.py | rvodden/minisculus | 097f0be1e061c1e313d929e1d71c17c2a402d71c | [
"MIT"
] | null | null | null | minisculus/wheel/_wheel_chain.py | rvodden/minisculus | 097f0be1e061c1e313d929e1d71c17c2a402d71c | [
"MIT"
] | null | null | null | minisculus/wheel/_wheel_chain.py | rvodden/minisculus | 097f0be1e061c1e313d929e1d71c17c2a402d71c | [
"MIT"
] | null | null | null | from typing import List
from pydantic import validate_arguments
from minisculus.wheel._wheel import Wheel
class WheelChain:
"""Processes indexes using a chain of wheels."""
_wheels: List[Wheel]
def __init__(self, wheels: List[Wheel]):
self._validate_wheels(wheels)
self._wheels = wheels... | 23.7125 | 77 | 0.565103 | from typing import List
from pydantic import validate_arguments
from minisculus.wheel._wheel import Wheel
class WheelChain:
_wheels: List[Wheel]
def __init__(self, wheels: List[Wheel]):
self._validate_wheels(wheels)
self._wheels = wheels
@validate_arguments
def encode(self, idx: i... | true | true |
f73a14ce9ea1e132cdb8761e5f061240a16538fd | 520 | py | Python | Season 09 - Advanced built-in functions in Python/Episode 02 - Generators class and iterators.py | Pythobit/Python-tutorial | b0743eaa9c237c3578131ead1b3f2c295f11b7ee | [
"MIT"
] | 3 | 2021-02-19T18:33:00.000Z | 2021-08-03T14:56:50.000Z | Season 09 - Advanced built-in functions in Python/Episode 02 - Generators class and iterators.py | barawalojas/Python-tutorial | 3f4b2b073e421888b3d62ff634658317d9abcb9b | [
"MIT"
] | 1 | 2021-07-10T14:37:57.000Z | 2021-07-20T09:51:39.000Z | Season 09 - Advanced built-in functions in Python/Episode 02 - Generators class and iterators.py | barawalojas/Python-tutorial | 3f4b2b073e421888b3d62ff634658317d9abcb9b | [
"MIT"
] | 1 | 2021-08-02T05:39:38.000Z | 2021-08-02T05:39:38.000Z | # generator class and iterators
class FirstHundredNumbers:
def __init__(self):
self.numbers = 0
def __next__(self):
if self.numbers < 100:
current = self.numbers
self.numbers += 1
return current
else:
raise StopIteration()
my_gen = Firs... | 20.8 | 74 | 0.651923 |
class FirstHundredNumbers:
def __init__(self):
self.numbers = 0
def __next__(self):
if self.numbers < 100:
current = self.numbers
self.numbers += 1
return current
else:
raise StopIteration()
my_gen = FirstHundredNumbers()
print(next(my... | true | true |
f73a14ed8bf965f6136ac165652854c5f0b67b0f | 3,157 | py | Python | Fracktory3-3.0_b11/plugins/Tools/MirrorTool/MirrorTool.py | ganeshmev/Fracktory3-3.0_b11_KLE | 16066e6993b96a880aa1a2f044a27930cbd0787d | [
"MIT"
] | null | null | null | Fracktory3-3.0_b11/plugins/Tools/MirrorTool/MirrorTool.py | ganeshmev/Fracktory3-3.0_b11_KLE | 16066e6993b96a880aa1a2f044a27930cbd0787d | [
"MIT"
] | null | null | null | Fracktory3-3.0_b11/plugins/Tools/MirrorTool/MirrorTool.py | ganeshmev/Fracktory3-3.0_b11_KLE | 16066e6993b96a880aa1a2f044a27930cbd0787d | [
"MIT"
] | null | null | null | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from UM.Tool import Tool
from UM.Event import Event, MouseEvent
from UM.Math.Vector import Vector
from UM.Operations.MirrorOperation import MirrorOperation
from UM.Operations.GroupedOperation import GroupedOperation
f... | 35.077778 | 99 | 0.558125 |
from UM.Tool import Tool
from UM.Event import Event, MouseEvent
from UM.Math.Vector import Vector
from UM.Operations.MirrorOperation import MirrorOperation
from UM.Operations.GroupedOperation import GroupedOperation
from UM.Scene.Selection import Selection
from UM.Scene.ToolHandle import ToolHandle
from PyQt5.Qt... | true | true |
f73a151eaf488ae0f3ef70dec4055c8c6362b10b | 2,810 | py | Python | src/TreeDetector.py | dsilvalo28/AIVA-DAIA | 55b1f547aaf850df1ea3ddd9a2f6b5a2af410889 | [
"CC0-1.0"
] | 1 | 2020-02-25T15:21:13.000Z | 2020-02-25T15:21:13.000Z | src/TreeDetector.py | dsilvalo28/AIVA-DAIA | 55b1f547aaf850df1ea3ddd9a2f6b5a2af410889 | [
"CC0-1.0"
] | 22 | 2020-02-28T10:31:59.000Z | 2020-04-21T20:04:11.000Z | src/TreeDetector.py | dsilvalo28/AIVA-DAIA | 55b1f547aaf850df1ea3ddd9a2f6b5a2af410889 | [
"CC0-1.0"
] | null | null | null | import cv2
import numpy as np
from src.Detector import Detector
# Tree detector class #
class TreeDetector(Detector):
def __init__(self, image_path=None):
self.__image_path = image_path
self.image = None
if image_path is not None:
self.read(self.__image_path)
# *** CON... | 31.931818 | 108 | 0.603559 | import cv2
import numpy as np
from src.Detector import Detector
class TreeDetector(Detector):
def __init__(self, image_path=None):
self.__image_path = image_path
self.image = None
if image_path is not None:
self.read(self.__image_path)
self.__threshold_down = 1... | true | true |
f73a15c0d6a54f3000c9bd50909d3ca60aa4dd51 | 3,178 | py | Python | codes/trainer/networks.py | neonbjb/DL-Art-School | a6f0f854b987ac724e258af8b042ea4459a571bc | [
"Apache-2.0"
] | 12 | 2020-12-13T12:45:03.000Z | 2022-03-29T09:58:15.000Z | codes/trainer/networks.py | neonbjb/DL-Art-School | a6f0f854b987ac724e258af8b042ea4459a571bc | [
"Apache-2.0"
] | 1 | 2020-12-31T01:12:45.000Z | 2021-03-31T11:43:52.000Z | codes/trainer/networks.py | neonbjb/DL-Art-School | a6f0f854b987ac724e258af8b042ea4459a571bc | [
"Apache-2.0"
] | 3 | 2020-12-14T06:04:04.000Z | 2020-12-26T19:11:41.000Z | import importlib
import logging
import os
import pkgutil
import sys
from collections import OrderedDict
from inspect import isfunction, getmembers, signature
import torch
import models.feature_arch as feature_arch
logger = logging.getLogger('base')
class RegisteredModelNameError(Exception):
def __init__(self, na... | 41.272727 | 119 | 0.697294 | import importlib
import logging
import os
import pkgutil
import sys
from collections import OrderedDict
from inspect import isfunction, getmembers, signature
import torch
import models.feature_arch as feature_arch
logger = logging.getLogger('base')
class RegisteredModelNameError(Exception):
def __init__(self, na... | true | true |
f73a17dc043e21a9af4216bfb716cd677517acfb | 8,086 | py | Python | panda/tests/automated/helpers.py | BoneE562/openpilot | bc0934f8c0d49cb971f0aa1c20361f0b0959650f | [
"MIT"
] | 114 | 2020-02-24T14:18:01.000Z | 2022-03-19T03:42:00.000Z | panda/tests/automated/helpers.py | BoneE562/openpilot | bc0934f8c0d49cb971f0aa1c20361f0b0959650f | [
"MIT"
] | 15 | 2020-02-25T03:37:44.000Z | 2021-09-08T01:51:15.000Z | panda/tests/automated/helpers.py | BoneE562/openpilot | bc0934f8c0d49cb971f0aa1c20361f0b0959650f | [
"MIT"
] | 55 | 2020-02-24T09:43:04.000Z | 2022-02-15T04:52:00.000Z | import os
import sys
import time
import random
import binascii
import subprocess
import requests
import _thread
from functools import wraps
from panda import Panda
from nose.tools import timed, assert_equal, assert_less, assert_greater
from parameterized import parameterized, param
SPEED_NORMAL = 500
SPEED_GMLAN = 33.... | 30.745247 | 121 | 0.633193 | import os
import sys
import time
import random
import binascii
import subprocess
import requests
import _thread
from functools import wraps
from panda import Panda
from nose.tools import timed, assert_equal, assert_less, assert_greater
from parameterized import parameterized, param
SPEED_NORMAL = 500
SPEED_GMLAN = 33.... | true | true |
f73a194a33be4e5988caca75413dd53fe934f568 | 2,827 | py | Python | pex/finders.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | pex/finders.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | pex/finders.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import ast
import os
from pex.common import is_python_script
from pex.third_party.pkg_resources import Distribution
from pex.typing import TYPE_CHE... | 30.728261 | 101 | 0.625752 |
from __future__ import absolute_import
import ast
import os
from pex.common import is_python_script
from pex.third_party.pkg_resources import Distribution
from pex.typing import TYPE_CHECKING, cast
if TYPE_CHECKING:
from typing import Optional
import attr
else:
from pex.third_party import attr
@a... | true | true |
f73a1a4aa5e6d5e05df796daddc33504ebe32372 | 49,673 | py | Python | pypowervm/tests/test_adapter.py | VedaAnnayappa/pypowervm | 266e5cb2f8725c63267b41b617ba5a1db2adadfa | [
"Apache-2.0"
] | null | null | null | pypowervm/tests/test_adapter.py | VedaAnnayappa/pypowervm | 266e5cb2f8725c63267b41b617ba5a1db2adadfa | [
"Apache-2.0"
] | null | null | null | pypowervm/tests/test_adapter.py | VedaAnnayappa/pypowervm | 266e5cb2f8725c63267b41b617ba5a1db2adadfa | [
"Apache-2.0"
] | null | null | null | # Copyright 2014, 2015, 2016 IBM Corp.
#
# 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 r... | 43.344677 | 79 | 0.615707 |
import copy
import errno
import fixtures
import gc
from lxml import etree
import six
import subunit
if six.PY2:
import __builtin__ as builtins
elif six.PY3:
import builtins
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
import mock
import requests.models as r... | true | true |
f73a1a4b745e4ff53cf589027674c09f70c7c395 | 4,829 | gyp | Python | libyuv.gyp | DeepARSDK/libyuv | dc0a9aebe75f2ef3e005ff1d31d88817e9aecd88 | [
"BSD-3-Clause"
] | 97 | 2019-10-28T13:10:03.000Z | 2022-03-08T09:48:37.000Z | libyuv.gyp | DeepARSDK/libyuv | dc0a9aebe75f2ef3e005ff1d31d88817e9aecd88 | [
"BSD-3-Clause"
] | 7 | 2019-12-03T02:54:24.000Z | 2021-09-08T09:36:06.000Z | libyuv.gyp | DeepARSDK/libyuv | dc0a9aebe75f2ef3e005ff1d31d88817e9aecd88 | [
"BSD-3-Clause"
] | 31 | 2019-11-14T14:51:13.000Z | 2022-02-18T06:46:48.000Z | # Copyright 2011 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors... | 29.625767 | 79 | 0.490578 |
{
'includes': [
'libyuv.gypi',
],
'xcode_settings': {
'GCC_PREFIX_HEADER': '',
'GCC_PRECOMPILE_PREFIX_HEADER': 'NO',
},
'variables': {
'use_system_libjpeg%': 0,
'libyuv_disable_jpeg%': 1,
'chromium_code': 1,
'clang%': 0,
'use_lto%': 0,
'mip... | true | true |
f73a1b0d6ca587bbe2d19600256e4c0c3ca40241 | 4,641 | py | Python | util/kgh.py | aholinch/Keplers-Goat-Herd | 18cc49465353eb6ce6ce9e9e84d81fca9f5d3c59 | [
"MIT"
] | null | null | null | util/kgh.py | aholinch/Keplers-Goat-Herd | 18cc49465353eb6ce6ce9e9e84d81fca9f5d3c59 | [
"MIT"
] | null | null | null | util/kgh.py | aholinch/Keplers-Goat-Herd | 18cc49465353eb6ce6ce9e9e84d81fca9f5d3c59 | [
"MIT"
] | null | null | null | import numpy as np, time
def mToE(m, e):
if e <= 0.5:
return mToE(m,e,10)
if e <= 0.9:
return mToE(m,e,25)
if e <= 0.95:
return mToE(m,e,50)
if e <= 0.99:
return mToE(m,e,128)
return mToE(m,e,256)
def mToE(m, eccentricity, N_it):
"""Solve Kepler's equation,... | 28.826087 | 133 | 0.623357 | import numpy as np, time
def mToE(m, e):
if e <= 0.5:
return mToE(m,e,10)
if e <= 0.9:
return mToE(m,e,25)
if e <= 0.95:
return mToE(m,e,50)
if e <= 0.99:
return mToE(m,e,128)
return mToE(m,e,256)
def mToE(m, eccentricity, N_it):
if eccentricity<=0.:
... | true | true |
f73a1b559f33bf3c084c5088359ddb186c947187 | 1,118 | py | Python | qf_09_条件判断.py | tianming-jianai/QFPython | bf14fc5da077e745670c5898f1d3322cb87e6f6b | [
"MIT"
] | null | null | null | qf_09_条件判断.py | tianming-jianai/QFPython | bf14fc5da077e745670c5898f1d3322cb87e6f6b | [
"MIT"
] | null | null | null | qf_09_条件判断.py | tianming-jianai/QFPython | bf14fc5da077e745670c5898f1d3322cb87e6f6b | [
"MIT"
] | null | null | null | import random
# pass 关键字在Python里面没有意义,知识单纯的用来占位,保证豫剧的完整性
# 输入年,写代码判断输入的年是否是闰年,并且打印对应的结果。
# (是闰年的条件:能被4 整除但是不能被100整除或者能够被400整除的年)
year = int(input('请输入一个年份:'))
if (year % 4 == 0 and year % 100 != 0) or (year % 1400 == 0):
print("您输入的是闰年" + str(year))
pass
# ---------------猜拳游戏---------------------------
print... | 24.844444 | 105 | 0.592129 | import random
year = int(input('请输入一个年份:'))
if (year % 4 == 0 and year % 100 != 0) or (year % 1400 == 0):
print("您输入的是闰年" + str(year))
pass
print("0剪刀 1石头 2布")
computer = random.randint(0, 2)
print('电脑' + str(computer))
player = int(input('请输入:'))
if (player == 0 and computer == 2) or (player == 1 and co... | true | true |
f73a1b6e36386c2c059dd4e7bcb51e7dcb4e93b3 | 3,438 | py | Python | tests/test_compynent.py | caioaao/compynent | 433bb23ed6edff81b67ba9be2f4d142f01f4db0c | [
"MIT"
] | 3 | 2020-11-16T01:58:43.000Z | 2021-08-16T19:29:19.000Z | tests/test_compynent.py | caioaao/compynent | 433bb23ed6edff81b67ba9be2f4d142f01f4db0c | [
"MIT"
] | null | null | null | tests/test_compynent.py | caioaao/compynent | 433bb23ed6edff81b67ba9be2f4d142f01f4db0c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Tests for `compynent` package."""
from contextlib import AbstractContextManager, contextmanager
from compynent import System
class InitCounter(AbstractContextManager):
def __init__(self):
self.cnt = -1
def incr(self):
self.cnt += 1
return self.cnt
def ... | 24.211268 | 68 | 0.589005 |
from contextlib import AbstractContextManager, contextmanager
from compynent import System
class InitCounter(AbstractContextManager):
def __init__(self):
self.cnt = -1
def incr(self):
self.cnt += 1
return self.cnt
def __enter__(self):
self.cnt = 0
return self
... | true | true |
f73a1c5ace41ac50664cf0171d2f25fb60c1fd44 | 4,618 | py | Python | models/backbone.py | liuky74/detr | e2b59573dcb86720562dfbdb02977ef996857025 | [
"Apache-2.0"
] | null | null | null | models/backbone.py | liuky74/detr | e2b59573dcb86720562dfbdb02977ef996857025 | [
"Apache-2.0"
] | null | null | null | models/backbone.py | liuky74/detr | e2b59573dcb86720562dfbdb02977ef996857025 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Backbone modules.
"""
from collections import OrderedDict
import torch
import torch.nn.functional as F
import torchvision
from torch import nn
from torchvision.models._utils import IntermediateLayerGetter
from typing import Dict, List
from uti... | 38.483333 | 123 | 0.663058 |
from collections import OrderedDict
import torch
import torch.nn.functional as F
import torchvision
from torch import nn
from torchvision.models._utils import IntermediateLayerGetter
from typing import Dict, List
from util.misc import NestedTensor, is_main_process
from .position_encoding import build_position_encod... | true | true |
f73a1d131da66c45f3619b5cce1359f15cf14184 | 628 | py | Python | src/create_dataset.py | garciadias/k-means_on_apogee | 7c3315a0d305f255c121a015607e22e5a46bba82 | [
"CC0-1.0"
] | null | null | null | src/create_dataset.py | garciadias/k-means_on_apogee | 7c3315a0d305f255c121a015607e22e5a46bba82 | [
"CC0-1.0"
] | null | null | null | src/create_dataset.py | garciadias/k-means_on_apogee | 7c3315a0d305f255c121a015607e22e5a46bba82 | [
"CC0-1.0"
] | null | null | null | """Create csv with spectral data"""
from os import getcwd
from pathlib import Path
from astropy.io import fits
import pandas as pd
PROJECT_PATH = getcwd()
SPECTRA = {}
for spectrum_path in Path('%s/data/fits/' % PROJECT_PATH).glob('*fits'):
spectrum_fits = fits.open(spectrum_path)
spectrum = spectrum_fits[1].... | 28.545455 | 72 | 0.738854 | from os import getcwd
from pathlib import Path
from astropy.io import fits
import pandas as pd
PROJECT_PATH = getcwd()
SPECTRA = {}
for spectrum_path in Path('%s/data/fits/' % PROJECT_PATH).glob('*fits'):
spectrum_fits = fits.open(spectrum_path)
spectrum = spectrum_fits[1].data[0]
SPECTRA[spectrum_fits[0]... | true | true |
f73a1e1e0fb8f6902c832d12edbfb271d89b0b69 | 3,245 | py | Python | starthinker/task/bqflow/run.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 138 | 2018-11-28T21:42:44.000Z | 2022-03-30T17:26:35.000Z | starthinker/task/bqflow/run.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 36 | 2019-02-19T18:33:20.000Z | 2022-01-24T18:02:44.000Z | starthinker/task/bqflow/run.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 54 | 2018-12-06T05:47:32.000Z | 2022-02-21T22:01:01.000Z | ###########################################################################
#
# 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
#
# https://www.apache.org/l... | 32.777778 | 127 | 0.646225 | true | true | |
f73a1ebf24f3b1ed80fa8aa279e730ef9ae2e7ac | 2,601 | py | Python | struct2tensor/calculate_options.py | jay90099/struct2tensor | 47d651757efa27586bf75f991b2174d8173a750b | [
"Apache-2.0"
] | 30 | 2019-10-07T21:31:44.000Z | 2022-03-30T17:11:44.000Z | struct2tensor/calculate_options.py | jay90099/struct2tensor | 47d651757efa27586bf75f991b2174d8173a750b | [
"Apache-2.0"
] | 2 | 2020-03-23T20:48:14.000Z | 2021-04-16T15:05:33.000Z | struct2tensor/calculate_options.py | jay90099/struct2tensor | 47d651757efa27586bf75f991b2174d8173a750b | [
"Apache-2.0"
] | 30 | 2019-07-16T13:01:53.000Z | 2022-03-01T22:04:36.000Z | # Copyright 2019 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 agreed to in writing, ... | 38.820896 | 80 | 0.748174 |
class Options(object):
def __init__(self, ragged_checks: bool, sparse_checks: bool):
self.ragged_checks = ragged_checks
self.sparse_checks = sparse_checks
self.use_string_view = False
self.experimental_honor_proto3_optional_semantics = False
def __str__(self):
return ("{ragged_c... | true | true |
f73a1fb3d2cf15ad986a8bcd12e39f7a10c685e1 | 1,441 | py | Python | djangocms_fil_permissions/permissions.py | FidelityInternational/djangocms-fil-permissions | 59e759b320ef44c3cf91695383d097d69fb4b3e9 | [
"BSD-3-Clause"
] | null | null | null | djangocms_fil_permissions/permissions.py | FidelityInternational/djangocms-fil-permissions | 59e759b320ef44c3cf91695383d097d69fb4b3e9 | [
"BSD-3-Clause"
] | null | null | null | djangocms_fil_permissions/permissions.py | FidelityInternational/djangocms-fil-permissions | 59e759b320ef44c3cf91695383d097d69fb4b3e9 | [
"BSD-3-Clause"
] | 1 | 2019-02-22T13:58:28.000Z | 2019-02-22T13:58:28.000Z | from django.core.exceptions import PermissionDenied
from rules.rulesets import RuleSet
from .rules import has_site_access
site_permissions = RuleSet()
site_permissions.add_rule("site_perm", has_site_access)
class SitePermissionBackend(object):
"""Authentication backend that checks row-level permissions grante... | 30.020833 | 71 | 0.659264 | from django.core.exceptions import PermissionDenied
from rules.rulesets import RuleSet
from .rules import has_site_access
site_permissions = RuleSet()
site_permissions.add_rule("site_perm", has_site_access)
class SitePermissionBackend(object):
def authenticate(self, request, **credentials):
return No... | true | true |
f73a20aee35d8cd5dea6f8d2e7fd7dcb9d75d040 | 6,100 | py | Python | tensorflow_federated/python/core/impl/executors/execution_context_test.py | Vishal-V/federated | 3cf0e4017c6a072ddb428ff993f2db9254c00cc0 | [
"Apache-2.0"
] | 1 | 2020-06-11T16:34:24.000Z | 2020-06-11T16:34:24.000Z | tensorflow_federated/python/core/impl/executors/execution_context_test.py | savitakumbhare/federated | 2575ac3c571004ba554bd0c0d11c2e307ff22d57 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/executors/execution_context_test.py | savitakumbhare/federated | 2575ac3c571004ba554bd0c0d11c2e307ff22d57 | [
"Apache-2.0"
] | 1 | 2021-09-06T03:33:14.000Z | 2021-09-06T03:33:14.000Z | # Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 31.606218 | 80 | 0.718033 |
import collections
import contextlib
from absl.testing import absltest
import numpy as np
import tensorflow as tf
from tensorflow_federated.python.core.api import computation_types
from tensorflow_federated.python.core.api import computations
from tensorflow_federated.python.core.api import intrinsics
... | true | true |
f73a2151abde4ec417d246705e0947cf7228530a | 35,026 | py | Python | .history/neuroformer/model_perceiver_20220121144506.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | .history/neuroformer/model_perceiver_20220121144506.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | .history/neuroformer/model_perceiver_20220121144506.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | # from code.transformer_vid.utils import convert_weights
# import rotary_embedding_torch
from torch.nn.modules.activation import GELU, ReLU
# from data.OneCombo3.trainer import TrainerConfig
import math
import numpy as np
import itertools
import logging
import torch
import torch.nn as nn
from torch.nn import functiona... | 39.266816 | 139 | 0.581739 |
from torch.nn.modules.activation import GELU, ReLU
import math
import numpy as np
import itertools
import logging
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.autograd import Variable
from torchvision.models.video import r3d_18
from scipy.optimize import linear_sum_assignment... | true | true |
f73a21885d0d1792bc3b8c64a5f050f218b5234b | 16,125 | py | Python | dags/deal_finder_dag.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | null | null | null | dags/deal_finder_dag.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | null | null | null | dags/deal_finder_dag.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# 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
#
# https://www.apache.org/l... | 39.716749 | 3,640 | 0.536992 | },
{
'name': 'Site_ID',
'type': 'INTEGER'
},
{
'name': 'Inventory',
'type': 'STRING',
'mode': 'NULLABLE'
},
{
'name': 'Inventory_ID',
... | true | true |
f73a219dc110568fa8e73c4546516659de8f6158 | 87,688 | py | Python | scripts/layer_chassis_generator.py | hysw/Vulkan-ValidationLayers | ad5d043ff34503d0bac122fe1221667b3e7bb36a | [
"Apache-2.0"
] | 20 | 2019-04-18T07:37:34.000Z | 2022-02-02T21:43:47.000Z | scripts/layer_chassis_generator.py | hysw/Vulkan-ValidationLayers | ad5d043ff34503d0bac122fe1221667b3e7bb36a | [
"Apache-2.0"
] | 11 | 2019-10-21T13:39:41.000Z | 2021-11-05T08:11:54.000Z | scripts/layer_chassis_generator.py | hysw/Vulkan-ValidationLayers | ad5d043ff34503d0bac122fe1221667b3e7bb36a | [
"Apache-2.0"
] | 1 | 2021-12-03T18:11:36.000Z | 2021-12-03T18:11:36.000Z | #!/usr/bin/python3 -i
#
# Copyright (c) 2015-2019 Valve Corporation
# Copyright (c) 2015-2019 LunarG, Inc.
# Copyright (c) 2015-2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License a... | 50.482441 | 292 | 0.710747 |
import os,re,sys
from generator import *
from common_codegen import *
apiname = None,
profile = None,
versions = '.*',
emitversions = '.*',
defaultExtensions = None,
addExtensions = None,
... | true | true |
f73a2275431944df3f862dc93c2b8e649be1cf91 | 8,800 | py | Python | onadata/apps/api/tests/viewsets/test_note_viewset.py | childhelpline/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 1 | 2018-07-15T13:13:43.000Z | 2018-07-15T13:13:43.000Z | onadata/apps/api/tests/viewsets/test_note_viewset.py | aondiaye/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 14 | 2018-07-10T12:48:46.000Z | 2022-03-11T23:24:51.000Z | onadata/apps/api/tests/viewsets/test_note_viewset.py | aondiaye/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 5 | 2018-07-04T07:59:14.000Z | 2020-01-28T07:50:18.000Z | import os
from datetime import datetime
from django.conf import settings
from django.utils.timezone import make_aware
from django.test import RequestFactory
from guardian.shortcuts import assign_perm
from onadata.apps.api.viewsets.note_viewset import NoteViewSet
from onadata.apps.api.viewsets.xform_viewset import XFo... | 37.606838 | 78 | 0.637841 | import os
from datetime import datetime
from django.conf import settings
from django.utils.timezone import make_aware
from django.test import RequestFactory
from guardian.shortcuts import assign_perm
from onadata.apps.api.viewsets.note_viewset import NoteViewSet
from onadata.apps.api.viewsets.xform_viewset import XFo... | true | true |
f73a24b814c65a9339fbcf5f01245b82951c31e5 | 9,773 | py | Python | discord/widget.py | BillSchumacher/discord.py | bba09204cbbe3661ac2fa869e25497e5eef422c4 | [
"MIT"
] | null | null | null | discord/widget.py | BillSchumacher/discord.py | bba09204cbbe3661ac2fa869e25497e5eef422c4 | [
"MIT"
] | 1 | 2022-01-21T08:20:30.000Z | 2022-01-21T08:20:30.000Z | discord/widget.py | BillSchumacher/discord.py | bba09204cbbe3661ac2fa869e25497e5eef422c4 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 32.576667 | 130 | 0.629694 |
from __future__ import annotations
from typing import Any, List, Optional, TYPE_CHECKING, Union
from .utils import snowflake_time, _get_as_snowflake, resolve_invite
from .user import BaseUser
from .activity import Activity, BaseActivity, Spotify, create_activity
from .invite import Invite
from .enums import Status, ... | true | true |
f73a25dff7fcc5665c27e55e9470b27bb07f770b | 8,363 | py | Python | invoke/executor.py | oynil/Invoke-Taskset | 4a206ce125926d52bc20f8c3bb5373912c65e91f | [
"BSD-2-Clause"
] | null | null | null | invoke/executor.py | oynil/Invoke-Taskset | 4a206ce125926d52bc20f8c3bb5373912c65e91f | [
"BSD-2-Clause"
] | null | null | null | invoke/executor.py | oynil/Invoke-Taskset | 4a206ce125926d52bc20f8c3bb5373912c65e91f | [
"BSD-2-Clause"
] | null | null | null | from .util import six
from .config import Config
from .parser import ParserContext
from .util import debug
from .tasks import Call, Task
class Executor(object):
"""
An execution strategy for Task objects.
Subclasses may override various extension points to change, add or remove
behavior.
.. ver... | 39.079439 | 79 | 0.580892 | from .util import six
from .config import Config
from .parser import ParserContext
from .util import debug
from .tasks import Call, Task
class Executor(object):
def __init__(self, collection, config=None, core=None):
self.collection = collection
self.config = config if config is not None else Co... | true | true |
f73a26d83a8acf23c96c6d692226c322322968e1 | 2,139 | py | Python | mmaction/models/__init__.py | andreeacosma/mmaction2 | 925a8813fb4b443e45566eb83e6b55576e3f2aad | [
"Apache-2.0"
] | null | null | null | mmaction/models/__init__.py | andreeacosma/mmaction2 | 925a8813fb4b443e45566eb83e6b55576e3f2aad | [
"Apache-2.0"
] | null | null | null | mmaction/models/__init__.py | andreeacosma/mmaction2 | 925a8813fb4b443e45566eb83e6b55576e3f2aad | [
"Apache-2.0"
] | 1 | 2022-03-22T02:18:40.000Z | 2022-03-22T02:18:40.000Z | from .backbones import (C3D, X3D, MobileNetV2, MobileNetV2TSM, ResNet,
ResNet2Plus1d, ResNet3d, ResNet3dCSN, ResNet3dLayer,
ResNet3dSlowFast, ResNet3dSlowOnly, ResNetAudio,
ResNetTIN, ResNetTSM, TANet)
from .builder import (DETECTORS, build_backbon... | 57.810811 | 79 | 0.672277 | from .backbones import (C3D, X3D, MobileNetV2, MobileNetV2TSM, ResNet,
ResNet2Plus1d, ResNet3d, ResNet3dCSN, ResNet3dLayer,
ResNet3dSlowFast, ResNet3dSlowOnly, ResNetAudio,
ResNetTIN, ResNetTSM, TANet)
from .builder import (DETECTORS, build_backbon... | true | true |
f73a27231a5734c402e39f01f9abb3d2b71ff0a8 | 3,750 | py | Python | bitbots_navigation/bitbots_localization/src/bitbots_localization/localization_dsd/decisions/decisions.py | MosHumanoid/bitbots_thmos_meta | f45ccc362dc689b69027be5b0d000d2a08580de4 | [
"MIT"
] | null | null | null | bitbots_navigation/bitbots_localization/src/bitbots_localization/localization_dsd/decisions/decisions.py | MosHumanoid/bitbots_thmos_meta | f45ccc362dc689b69027be5b0d000d2a08580de4 | [
"MIT"
] | null | null | null | bitbots_navigation/bitbots_localization/src/bitbots_localization/localization_dsd/decisions/decisions.py | MosHumanoid/bitbots_thmos_meta | f45ccc362dc689b69027be5b0d000d2a08580de4 | [
"MIT"
] | null | null | null | import rospy
from humanoid_league_msgs.msg import GameState, RobotControlState
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class CheckFallen(AbstractDecisionElement):
"""
Checks if robot is fallen
"""
def perform(self, reevaluate=False):
self.clear_debu... | 25.167785 | 83 | 0.6416 | import rospy
from humanoid_league_msgs.msg import GameState, RobotControlState
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class CheckFallen(AbstractDecisionElement):
def perform(self, reevaluate=False):
self.clear_debug_data()
if self.blackboard.robot_con... | true | true |
f73a272f69474bd8614deac8cab5edccb4b283d6 | 8,583 | py | Python | nablapps/nablashop/views.py | NablaWebkom/nablaweb | 9247c5e3f7b5d965d9437c74530638f925d0e9c6 | [
"MIT"
] | 1 | 2019-10-07T13:59:19.000Z | 2019-10-07T13:59:19.000Z | nablapps/nablashop/views.py | NablaWebkom/nablaweb | 9247c5e3f7b5d965d9437c74530638f925d0e9c6 | [
"MIT"
] | 2 | 2019-10-07T14:47:37.000Z | 2019-10-07T14:49:49.000Z | nablapps/nablashop/views.py | NablaWebkom/nablaweb | 9247c5e3f7b5d965d9437c74530638f925d0e9c6 | [
"MIT"
] | null | null | null | from datetime import datetime
from django import forms
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.http... | 37.977876 | 111 | 0.633345 | from datetime import datetime
from django import forms
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.http... | true | true |
f73a27c9847522d5f8fd8651a5bc8aab84329317 | 3,810 | py | Python | util/im_processing.py | ronghanghu/cmn | 85644ad56f8f62d04a5e8636ad3efe9ef7b34705 | [
"MIT"
] | 72 | 2017-04-12T17:07:36.000Z | 2021-06-18T08:20:47.000Z | util/im_processing.py | ronghanghu/cmn | 85644ad56f8f62d04a5e8636ad3efe9ef7b34705 | [
"MIT"
] | 8 | 2017-07-06T04:24:04.000Z | 2020-09-17T10:29:44.000Z | util/im_processing.py | ronghanghu/cmn | 85644ad56f8f62d04a5e8636ad3efe9ef7b34705 | [
"MIT"
] | 21 | 2017-04-19T07:38:09.000Z | 2021-02-28T13:39:22.000Z | from __future__ import absolute_import, division, print_function
import skimage.transform
import numpy as np
def rectify_bboxes(bboxes, height, width):
bboxes = np.maximum(bboxes, 0)
bboxes[:, 2:4] = np.maximum(bboxes[:, 0:2], bboxes[:, 2:4])
bboxes[:, 0] = np.minimum(bboxes[:, 0], width-1)
bboxes[:, ... | 37.722772 | 102 | 0.642782 | from __future__ import absolute_import, division, print_function
import skimage.transform
import numpy as np
def rectify_bboxes(bboxes, height, width):
bboxes = np.maximum(bboxes, 0)
bboxes[:, 2:4] = np.maximum(bboxes[:, 0:2], bboxes[:, 2:4])
bboxes[:, 0] = np.minimum(bboxes[:, 0], width-1)
bboxes[:, ... | true | true |
f73a28171f08fbe4fdec729da8d06cf7f77356a9 | 7,392 | py | Python | src/generated-spec/iam.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | src/generated-spec/iam.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | src/generated-spec/iam.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | from . import *
class AWS_IAM_Role_Policy(CloudFormationProperty):
def write(self, w):
with w.block("policy"):
self.property(w, "PolicyDocument", "policy_document", JsonValueConverter())
self.property(w, "PolicyName", "policy_name", StringValueConverter())
class AWS_IAM_Group_Policy(CloudFormationP... | 41.066667 | 151 | 0.713745 | from . import *
class AWS_IAM_Role_Policy(CloudFormationProperty):
def write(self, w):
with w.block("policy"):
self.property(w, "PolicyDocument", "policy_document", JsonValueConverter())
self.property(w, "PolicyName", "policy_name", StringValueConverter())
class AWS_IAM_Group_Policy(CloudFormationP... | true | true |
f73a29167bde13bfd58d1992fd74947483c2b0de | 401 | py | Python | code/dataset/__init__.py | aarashfeizi/Proxy-Anchor-CVPR2020 | a7b9ed46d9d44841bd6bce78f4fddb95107a022b | [
"MIT"
] | null | null | null | code/dataset/__init__.py | aarashfeizi/Proxy-Anchor-CVPR2020 | a7b9ed46d9d44841bd6bce78f4fddb95107a022b | [
"MIT"
] | null | null | null | code/dataset/__init__.py | aarashfeizi/Proxy-Anchor-CVPR2020 | a7b9ed46d9d44841bd6bce78f4fddb95107a022b | [
"MIT"
] | null | null | null | from .cars import Cars
from .cub import CUBirds
from .SOP import SOP
from .hotels import Hotels
from .import utils
from .base import BaseDataset
_type = {
'cars': Cars,
'cub': CUBirds,
'SOP': SOP,
'hotels': Hotels
}
def load(name, root, mode, transform = None, project_dir=None):
return _type[name... | 21.105263 | 96 | 0.685786 | from .cars import Cars
from .cub import CUBirds
from .SOP import SOP
from .hotels import Hotels
from .import utils
from .base import BaseDataset
_type = {
'cars': Cars,
'cub': CUBirds,
'SOP': SOP,
'hotels': Hotels
}
def load(name, root, mode, transform = None, project_dir=None):
return _type[name... | true | true |
f73a291f4a9842a6bfa0d29eee9e379595558c23 | 18,878 | py | Python | PyFlow/stylesheet.py | pedroCabrera/PyFlow | 8b439d9b47fff450e91c09d40c7b286e88cb624f | [
"MIT"
] | 7 | 2018-06-24T15:55:00.000Z | 2021-07-13T08:11:25.000Z | PyFlow/stylesheet.py | pedroCabrera/PyFlow | 8b439d9b47fff450e91c09d40c7b286e88cb624f | [
"MIT"
] | 32 | 2019-02-18T20:47:46.000Z | 2019-05-30T12:51:10.000Z | PyFlow/stylesheet.py | pedroCabrera/PyFlow | 8b439d9b47fff450e91c09d40c7b286e88cb624f | [
"MIT"
] | 5 | 2019-02-19T23:26:21.000Z | 2020-12-23T00:32:59.000Z | from Qt import QtGui
import inspect
from Core.Settings import Colors
def clamp(val,min_value,max_value):
return max(min(val, max_value), min_value)
class editableStyleSheet():
def __init__(self):
self.MainColor = Colors.Orange
self.MainColor_Lighter = Colors.OrangeLighter
self.MainColo... | 44.947619 | 155 | 0.471342 | from Qt import QtGui
import inspect
from Core.Settings import Colors
def clamp(val,min_value,max_value):
return max(min(val, max_value), min_value)
class editableStyleSheet():
def __init__(self):
self.MainColor = Colors.Orange
self.MainColor_Lighter = Colors.OrangeLighter
self.MainColo... | true | true |
f73a2a3fdc2c3465104276ed39f89bdfcaae950c | 422 | py | Python | retweet/py/config.py | adventuringImagineer/estimator-retweet-adventure | 3c3ea925f38cd50870c6150a804014bfd07ca190 | [
"MIT"
] | null | null | null | retweet/py/config.py | adventuringImagineer/estimator-retweet-adventure | 3c3ea925f38cd50870c6150a804014bfd07ca190 | [
"MIT"
] | null | null | null | retweet/py/config.py | adventuringImagineer/estimator-retweet-adventure | 3c3ea925f38cd50870c6150a804014bfd07ca190 | [
"MIT"
] | null | null | null | tweepy_consumer_key = "cVjPt6UCDPHFxGCk5M8wKz9Bo"
tweepy_consumer_secret = "ImLY50oHMd2noPrchO2qXYXKJQxxjng4UK7Rp1kj74GUDTCfTF"
tweepy_access_token = "34813916-plJKktZVBPOqKPQ7zdV5uTEuRiiDWeX9weZNliYct"
tweepy_access_token_secret = "CWwzOqAkkxfKl6VDK6OUBoYFKPZD2JDfOQjOcPjQYz7pP"
# estimator_url = 'wss://passgraf.com:2... | 52.75 | 77 | 0.869668 | tweepy_consumer_key = "cVjPt6UCDPHFxGCk5M8wKz9Bo"
tweepy_consumer_secret = "ImLY50oHMd2noPrchO2qXYXKJQxxjng4UK7Rp1kj74GUDTCfTF"
tweepy_access_token = "34813916-plJKktZVBPOqKPQ7zdV5uTEuRiiDWeX9weZNliYct"
tweepy_access_token_secret = "CWwzOqAkkxfKl6VDK6OUBoYFKPZD2JDfOQjOcPjQYz7pP"
estimator_url = 'wss://bypass.passgraf... | true | true |
f73a2aaad3ed855531ad4f8468faef4409b19561 | 9,665 | py | Python | contrib/bitrpc/bitrpc.py | DiplexSoftfork/Skyrcoin | 379ea3f22e8c75168230289be51ee24a7f1c1590 | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | DiplexSoftfork/Skyrcoin | 379ea3f22e8c75168230289be51ee24a7f1c1590 | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | DiplexSoftfork/Skyrcoin | 379ea3f22e8c75168230289be51ee24a7f1c1590 | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:15890")
... | 28.594675 | 101 | 0.573513 | from jsonrpc import ServiceProxy
import sys
import string
import getpass
rpcuser = ""
rpcpass = ""
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:15890")
else:
access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:15890")
cmd = sys.argv[1].lower()
if cmd == "backupwallet":
try:
... | false | true |
f73a2ae3c540a9a90052d279a3881c4aaf86097f | 3,410 | py | Python | kopf/engines/probing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | kopf/engines/probing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | kopf/engines/probing.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | import asyncio
import datetime
import logging
import urllib.parse
from typing import MutableMapping, Optional, Tuple
import aiohttp.web
from kopf.reactor import activities, lifecycles, registries
from kopf.structs import callbacks, configuration, handlers, memos
logger = logging.getLogger(__name__)
LOCALHOST: str =... | 35.894737 | 97 | 0.657478 | import asyncio
import datetime
import logging
import urllib.parse
from typing import MutableMapping, Optional, Tuple
import aiohttp.web
from kopf.reactor import activities, lifecycles, registries
from kopf.structs import callbacks, configuration, handlers, memos
logger = logging.getLogger(__name__)
LOCALHOST: str =... | true | true |
f73a2d1b39502b040e25908c237c6ab73a1553a9 | 3,898 | py | Python | accounts/tests/test_view_password_change.py | sureshkunku/Dispatch | eda68d5bf94029a324d22f5b6eb6c5087923ab7e | [
"MIT"
] | null | null | null | accounts/tests/test_view_password_change.py | sureshkunku/Dispatch | eda68d5bf94029a324d22f5b6eb6c5087923ab7e | [
"MIT"
] | 7 | 2019-10-22T14:15:59.000Z | 2022-02-10T08:50:49.000Z | accounts/tests/test_view_password_change.py | sureshkunku/Dispatch | eda68d5bf94029a324d22f5b6eb6c5087923ab7e | [
"MIT"
] | null | null | null | from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import resolve, reverse
class PasswordChangeTests(TestCase):
def setUp(self):
username = 'john... | 35.761468 | 109 | 0.653155 | from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import resolve, reverse
class PasswordChangeTests(TestCase):
def setUp(self):
username = 'john... | true | true |
f73a2d9712f3fc4ebd6f7b04a3d34803f74e8d1a | 318 | py | Python | examples/load_samples.py | jieggii/mc.py | 74e0489370c7c1a1cbc5e40fbc295ce32a124dd1 | [
"MIT"
] | 30 | 2019-08-20T14:56:39.000Z | 2022-03-30T14:03:28.000Z | examples/load_samples.py | babydickdanilko/mc.py | 74e0489370c7c1a1cbc5e40fbc295ce32a124dd1 | [
"MIT"
] | 4 | 2019-11-30T17:56:54.000Z | 2022-03-25T11:59:55.000Z | examples/load_samples.py | babydickdanilko/mc.py | 74e0489370c7c1a1cbc5e40fbc295ce32a124dd1 | [
"MIT"
] | 10 | 2019-09-15T19:11:58.000Z | 2021-08-06T08:13:17.000Z | import mc
samples_from_txt = mc.util.load_txt_samples("samples.txt", separator=";")
print(samples_from_txt)
# >> "['hello world', 'hello world of cutes', 'string with escaped ";"']"
samples_from_json = mc.util.load_json_samples("samples.json")
print(samples_from_json)
# >> ['hello world', 'hello world of cuties']
| 28.909091 | 73 | 0.726415 | import mc
samples_from_txt = mc.util.load_txt_samples("samples.txt", separator=";")
print(samples_from_txt)
samples_from_json = mc.util.load_json_samples("samples.json")
print(samples_from_json)
| true | true |
f73a2dba0d726fef3d4b923de1c75b4b846cc6ab | 343 | py | Python | viewFile.py | PrathikShirolkar/AutomaticImageColization | 981a011cbd32f741668738cafc1dd9ed44965402 | [
"Apache-2.0"
] | null | null | null | viewFile.py | PrathikShirolkar/AutomaticImageColization | 981a011cbd32f741668738cafc1dd9ed44965402 | [
"Apache-2.0"
] | null | null | null | viewFile.py | PrathikShirolkar/AutomaticImageColization | 981a011cbd32f741668738cafc1dd9ed44965402 | [
"Apache-2.0"
] | null | null | null | from tensorflow.python import pywrap_tensorflow
checkpoint_path = 'tmodel.ckpt-100'
#checkpoint_path = "deeplab_resnet_init.ckpt"
reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
var_to_shape_map = reader.get_variable_to_shape_map()
for key in var_to_shape_map:
print("tensor_name: ", key)
print(r... | 38.111111 | 63 | 0.816327 | from tensorflow.python import pywrap_tensorflow
checkpoint_path = 'tmodel.ckpt-100'
reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
var_to_shape_map = reader.get_variable_to_shape_map()
for key in var_to_shape_map:
print("tensor_name: ", key)
print(reader.get_tensor(key))
| true | true |
f73a2f0b8fa8c1b64a8d69888a568d2ea69714a7 | 176 | py | Python | Diverso4.py | Friedned/PC4 | 6feeee1240f95683d6dcdb7ddb6ea47d09c07832 | [
"Apache-2.0"
] | null | null | null | Diverso4.py | Friedned/PC4 | 6feeee1240f95683d6dcdb7ddb6ea47d09c07832 | [
"Apache-2.0"
] | null | null | null | Diverso4.py | Friedned/PC4 | 6feeee1240f95683d6dcdb7ddb6ea47d09c07832 | [
"Apache-2.0"
] | null | null | null | import re
s = '@robot9! @robot4& I have a good feeling that the show isgoing to be amazing! @robot9$ @robot7%'
encontrados=re.findall(r"@robot\d\W",s)
print(encontrados)
| 29.333333 | 101 | 0.704545 | import re
s = '@robot9! @robot4& I have a good feeling that the show isgoing to be amazing! @robot9$ @robot7%'
encontrados=re.findall(r"@robot\d\W",s)
print(encontrados)
| true | true |
f73a3077834965fc05f558a0496935737fe42672 | 9,619 | py | Python | fuzzers/046-clk-bufg-muxed-pips/top.py | rw1nkler/prjxray | aff076b47dcf6d653eb3ce791b41fd6cf4343edd | [
"ISC"
] | 583 | 2017-12-21T11:06:13.000Z | 2022-02-20T21:27:33.000Z | fuzzers/046-clk-bufg-muxed-pips/top.py | rw1nkler/prjxray | aff076b47dcf6d653eb3ce791b41fd6cf4343edd | [
"ISC"
] | 1,212 | 2017-12-22T15:05:06.000Z | 2022-02-19T13:04:59.000Z | fuzzers/046-clk-bufg-muxed-pips/top.py | mfkiwl/prjxray-xilinx-7-bitstream-fortmat | 5349556bc2c230801d6df0cf11bccb9cfd171639 | [
"ISC"
] | 134 | 2017-12-21T10:16:50.000Z | 2022-02-16T06:42:04.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
""" Emits top.v's for various BUFHCE ... | 27.640805 | 75 | 0.521156 |
import os
import random
random.seed(int(os.getenv("SEED"), 16))
from prjxray import util
from prjxray.lut_maker import LutMaker
from prjxray.db import Database
from io import StringIO
CMT_XY_FUN = util.create_xy_fun(prefix='')
BUFGCTRL_XY_FUN = util.create_xy_fun('BUFGCTRL_')
def read_site_to_cmt():
wi... | true | true |
f73a313155ef0145e6a34cd648f6ea35f544b056 | 1,545 | py | Python | source/FAST/Examples/Python/convert_video_to_image_frames.py | skn123/FAST | d66522260bf65c5ab74d75050131d5a353cbf602 | [
"BSD-2-Clause"
] | 1 | 2021-02-10T16:01:23.000Z | 2021-02-10T16:01:23.000Z | source/FAST/Examples/Python/convert_video_to_image_frames.py | skn123/FAST | d66522260bf65c5ab74d75050131d5a353cbf602 | [
"BSD-2-Clause"
] | null | null | null | source/FAST/Examples/Python/convert_video_to_image_frames.py | skn123/FAST | d66522260bf65c5ab74d75050131d5a353cbf602 | [
"BSD-2-Clause"
] | null | null | null | ## @example convert_video_to_image_frames.py
# This example loads a video and converts to a stream of image frames and display the
# individual frames with matplotlib.
#
# Note that additional dependencies are required to stream videos in FAST:
# Linux: sudo apt install ubuntu-restricted-extras libgstreamer1.0-dev libg... | 36.785714 | 168 | 0.700971 | as plt
import numpy as np
ists()
streamer = fast.MovieStreamer.New()
streamer.setFilename(fast.Config.getTestDataPath() + 'US/sagittal_spine.avi')
dataChannel = streamer.getOutputPort()
streamer.update()
frame_list = []
counter = 0
while True:
frame = dataChannel.getNextImage()
counter += 1
if frame.... | true | true |
f73a324ce6b0fc748fe4b1613d20bdd33eb89eb9 | 15,822 | py | Python | projects/TGS_salt/obsolete/train8_Unet_scSE_hyper_LR2.py | liaopeiyuan/ml-arsenal-public | f8938ce3cb58b35fc7cc20d096c39a85ec9780b2 | [
"Apache-2.0"
] | 280 | 2018-10-21T01:07:18.000Z | 2021-12-30T11:29:48.000Z | projects/TGS_salt/obsolete/train8_Unet_scSE_hyper_LR2.py | liaopeiyuan/ml-arsenal-public | f8938ce3cb58b35fc7cc20d096c39a85ec9780b2 | [
"Apache-2.0"
] | 3 | 2018-11-13T08:04:48.000Z | 2020-04-17T09:20:03.000Z | projects/TGS_salt/obsolete/train8_Unet_scSE_hyper_LR2.py | liaopeiyuan/ml-arsenal-public | f8938ce3cb58b35fc7cc20d096c39a85ec9780b2 | [
"Apache-2.0"
] | 59 | 2018-10-21T04:38:23.000Z | 2021-03-29T07:58:47.000Z | import os
import sys
sys.path.append('../../')
from dependencies import *
from settings import *
from reproducibility import *
from models.TGS_salt.Unet34_scSE_hyper import Unet_scSE_hyper as Net
SIZE = 101
PAD = 27
Y0, Y1, X0, X1 = PAD,PAD+SIZE,PAD,PAD+SIZE,
def time_to_str(time, str):
#if str == 'min':
# ... | 36.795349 | 142 | 0.518771 | import os
import sys
sys.path.append('../../')
from dependencies import *
from settings import *
from reproducibility import *
from models.TGS_salt.Unet34_scSE_hyper import Unet_scSE_hyper as Net
SIZE = 101
PAD = 27
Y0, Y1, X0, X1 = PAD,PAD+SIZE,PAD,PAD+SIZE,
def time_to_str(time, str):
return time
... | true | true |
f73a33c99ded24c0e514bf4a0dbf736ff72a6c4f | 251 | py | Python | output/models/nist_data/list_pkg/float_pkg/schema_instance/nistschema_sv_iv_list_float_white_space_1_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/float_pkg/schema_instance/nistschema_sv_iv_list_float_white_space_1_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/float_pkg/schema_instance/nistschema_sv_iv_list_float_white_space_1_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.list_pkg.float_pkg.schema_instance.nistschema_sv_iv_list_float_white_space_1_xsd.nistschema_sv_iv_list_float_white_space_1 import NistschemaSvIvListFloatWhiteSpace1
__all__ = [
"NistschemaSvIvListFloatWhiteSpace1",
]
| 41.833333 | 193 | 0.89243 | from output.models.nist_data.list_pkg.float_pkg.schema_instance.nistschema_sv_iv_list_float_white_space_1_xsd.nistschema_sv_iv_list_float_white_space_1 import NistschemaSvIvListFloatWhiteSpace1
__all__ = [
"NistschemaSvIvListFloatWhiteSpace1",
]
| true | true |
f73a351832d4fff1c6c577ae4418436252e29bfa | 395 | py | Python | WebServer/webserver/wsgi.py | dhairyaagrawal/SmartMirror | 7ffaf29a6ac31a710c9ae922d5d4fdaeb8025a88 | [
"MIT"
] | null | null | null | WebServer/webserver/wsgi.py | dhairyaagrawal/SmartMirror | 7ffaf29a6ac31a710c9ae922d5d4fdaeb8025a88 | [
"MIT"
] | null | null | null | WebServer/webserver/wsgi.py | dhairyaagrawal/SmartMirror | 7ffaf29a6ac31a710c9ae922d5d4fdaeb8025a88 | [
"MIT"
] | 5 | 2018-10-11T05:49:37.000Z | 2018-10-27T06:37:17.000Z | """
WSGI config for webserver project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webserver.settings')
application = get_wsgi_application()
| true | true |
f73a356fec902d8362ced3f8d2d9347e9796881a | 274 | py | Python | examples/sample_basilisk.py | larsbratholm/fragbuilder | e16cbcb190403b5fef49811abd11d16d7ef7fb30 | [
"BSD-2-Clause"
] | null | null | null | examples/sample_basilisk.py | larsbratholm/fragbuilder | e16cbcb190403b5fef49811abd11d16d7ef7fb30 | [
"BSD-2-Clause"
] | null | null | null | examples/sample_basilisk.py | larsbratholm/fragbuilder | e16cbcb190403b5fef49811abd11d16d7ef7fb30 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import print_function
from fragbuilder import Basilisk_DBN
from fragbuilder import set_seed
set_seed(12)
dbn = Basilisk_DBN()
chi, bb, ll = dbn.get_sample("K")
print("Chi angles: ", chi)
print("Phi/Psi angles: ", bb)
print("Log likelihood: ", ll)
| 19.571429 | 37 | 0.722628 | from __future__ import print_function
from fragbuilder import Basilisk_DBN
from fragbuilder import set_seed
set_seed(12)
dbn = Basilisk_DBN()
chi, bb, ll = dbn.get_sample("K")
print("Chi angles: ", chi)
print("Phi/Psi angles: ", bb)
print("Log likelihood: ", ll)
| true | true |
f73a36ef236a0195fe5a8771954b392d3e16858c | 22,339 | py | Python | tensor2tensor/models/video/savp.py | shankharaj29/tensor2tensor | b89ba51a6fa9e0c20009cfb57ee8de04f7138392 | [
"Apache-2.0"
] | 2 | 2020-03-02T13:49:11.000Z | 2020-06-18T09:48:35.000Z | tensor2tensor/models/video/savp.py | PedroLelis/tensor2tensor | 5a867d031bd493eeb7d2776e1118d1594ff0a623 | [
"Apache-2.0"
] | 1 | 2019-01-21T10:57:47.000Z | 2019-01-21T10:57:47.000Z | tensor2tensor/models/video/savp.py | PedroLelis/tensor2tensor | 5a867d031bd493eeb7d2776e1118d1594ff0a623 | [
"Apache-2.0"
] | 3 | 2019-02-10T11:12:30.000Z | 2022-02-23T20:43:48.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 39.74911 | 113 | 0.696316 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numbers
import numpy as np
from tensor2tensor.layers import common_layers
from tensor2tensor.layers import common_video
from tensor2tensor.models.video import savp_params
from tensor2te... | true | true |
f73a37620969906a2512d0cda3e81d2fb8bd9953 | 26,800 | py | Python | pycroscopy/analysis/fitter.py | ealopez/pycroscopy | 9f7c0543b67eaa0668296295fc5f492360c130a0 | [
"MIT"
] | null | null | null | pycroscopy/analysis/fitter.py | ealopez/pycroscopy | 9f7c0543b67eaa0668296295fc5f492360c130a0 | [
"MIT"
] | null | null | null | pycroscopy/analysis/fitter.py | ealopez/pycroscopy | 9f7c0543b67eaa0668296295fc5f492360c130a0 | [
"MIT"
] | null | null | null | """
Created on 7/17/16 10:08 AM
@author: Numan Laanait, Suhas Somnath, Chris Smith
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
import psutil
import scipy
import h5py
import time as tm
from .guess_methods import GuessMethods
from .fit_methods import Fit_Met... | 40.853659 | 121 | 0.600672 |
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
import psutil
import scipy
import h5py
import time as tm
from .guess_methods import GuessMethods
from .fit_methods import Fit_Methods
from ..core.io.pycro_data import PycroDataset
from ..core.io.io_utils import get_a... | true | true |
f73a398d7987e29ad476208066f2c4136bfffaee | 3,107 | py | Python | src/trunk/apps/python/inv2dlsv.py | kbouk/seiscomp3 | 2385e4197274135c70aaef93a0b7df65ed8fa6a6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 94 | 2015-02-04T13:57:34.000Z | 2021-11-01T15:10:06.000Z | src/trunk/apps/python/inv2dlsv.py | kbouk/seiscomp3 | 2385e4197274135c70aaef93a0b7df65ed8fa6a6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 233 | 2015-01-28T15:16:46.000Z | 2021-08-23T11:31:37.000Z | src/trunk/apps/python/inv2dlsv.py | kbouk/seiscomp3 | 2385e4197274135c70aaef93a0b7df65ed8fa6a6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 95 | 2015-02-13T15:53:30.000Z | 2021-11-02T14:54:54.000Z | #!/usr/bin/env seiscomp-python
############################################################################
# Copyright (C) by GFZ Potsdam #
# #
# You can redistribute and/or modify this program unde... | 31.704082 | 83 | 0.505311 | true | true | |
f73a3a299dc3ff7bc79edcc95e8f21c8011e2a3d | 1,795 | py | Python | flask-docker-master/apps/city_spelling_matcher.py | nephylum/city-data-comparison-ds | 286698a7137774dd5c9245a5180911a1e6c48720 | [
"MIT"
] | 2 | 2020-09-08T22:07:21.000Z | 2022-01-05T23:51:15.000Z | flask-docker-master/apps/city_spelling_matcher.py | nephylum/city-data-comparison-ds | 286698a7137774dd5c9245a5180911a1e6c48720 | [
"MIT"
] | null | null | null | flask-docker-master/apps/city_spelling_matcher.py | nephylum/city-data-comparison-ds | 286698a7137774dd5c9245a5180911a1e6c48720 | [
"MIT"
] | 2 | 2020-05-05T21:16:22.000Z | 2021-01-20T22:18:21.000Z | import difflib
import json
def data_loader():
"""This opens the JSON obj for all the city names."""
with open('apps/data/spellcheck/spell_check_opject2.json', 'r') as myfile:
data = myfile.read()
obj = json.loads(data)
return(obj)
def check_spelling(data, words):
"""This function tak... | 34.519231 | 127 | 0.583287 | import difflib
import json
def data_loader():
with open('apps/data/spellcheck/spell_check_opject2.json', 'r') as myfile:
data = myfile.read()
obj = json.loads(data)
return(obj)
def check_spelling(data, words):
jsn = {}
id_manager = []
for i in difflib.get_close_matches(words.lowe... | true | true |
f73a3d1c1a9dde921b8e4dcececf9b8829d7aa79 | 15,957 | py | Python | file_formats/wow_common_types.py | ihm-tswow/pywowlib | f4e49d2e3204e90046716bfb608275d7f4e40b81 | [
"MIT"
] | null | null | null | file_formats/wow_common_types.py | ihm-tswow/pywowlib | f4e49d2e3204e90046716bfb608275d7f4e40b81 | [
"MIT"
] | null | null | null | file_formats/wow_common_types.py | ihm-tswow/pywowlib | f4e49d2e3204e90046716bfb608275d7f4e40b81 | [
"MIT"
] | null | null | null | import struct
from ..io_utils.types import *
from io import SEEK_CUR, BytesIO
from collections.abc import Iterable
from typing import Optional, Protocol
__reload_order_index__ = 1
# TODO: temp declaration for compatibility
class Self:
pass
###### M2 file versions ######
@singleton
class M2VersionsManager:
... | 24.625 | 117 | 0.549414 | import struct
from ..io_utils.types import *
from io import SEEK_CUR, BytesIO
from collections.abc import Iterable
from typing import Optional, Protocol
__reload_order_index__ = 1
class Self:
pass
self.m2_version = version
@singleton
class M2ExternalSequenceCache:
def __init__(self, m2_header):
... | true | true |
f73a3d697cf912bb499a7d79997bcb8a20e19c51 | 4,137 | py | Python | exawind/prelude/cfg.py | sayerhs/py-exawind | 7adea1567bd58069774ca56a8a75be7e4d9eefd2 | [
"Apache-2.0"
] | null | null | null | exawind/prelude/cfg.py | sayerhs/py-exawind | 7adea1567bd58069774ca56a8a75be7e4d9eefd2 | [
"Apache-2.0"
] | null | null | null | exawind/prelude/cfg.py | sayerhs/py-exawind | 7adea1567bd58069774ca56a8a75be7e4d9eefd2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""\
Configuration manager
~~~~~~~~~~~~~~~~~~~~~
"""
import os
import abc
import inspect
import logging
from logging.config import dictConfig
from pathlib import Path
class ConfigManager(metaclass=abc.ABCMeta):
"""Base configuration manager utility"""
def __init__(self):
self... | 26.863636 | 77 | 0.60672 |
import os
import abc
import inspect
import logging
from logging.config import dictConfig
from pathlib import Path
class ConfigManager(metaclass=abc.ABCMeta):
def __init__(self):
self.cfg = None
@abc.abstractstaticmethod
def rc_type():
@abc.abstractstaticmethod
def rc_base():
@abc... | true | true |
f73a3e01d093316b44cfe41fff84e844a730cc1c | 1,165 | py | Python | src/spaceone/cost_analysis/info/budget_usage_info.py | whdalsrnt/cost-analysis | cf73e294bcd35fa47f988aab7f00ed4cd777aba5 | [
"Apache-2.0"
] | 2 | 2021-12-22T05:31:18.000Z | 2021-12-23T11:47:29.000Z | src/spaceone/cost_analysis/info/budget_usage_info.py | whdalsrnt/cost-analysis | cf73e294bcd35fa47f988aab7f00ed4cd777aba5 | [
"Apache-2.0"
] | 9 | 2022-02-10T00:58:28.000Z | 2022-03-23T11:12:47.000Z | src/spaceone/cost_analysis/info/budget_usage_info.py | spaceone-dev/cost-analysis | cf73e294bcd35fa47f988aab7f00ed4cd777aba5 | [
"Apache-2.0"
] | null | null | null | import functools
from spaceone.api.cost_analysis.v1 import budget_usage_pb2
from spaceone.core.pygrpc.message_type import *
from spaceone.core import utils
from spaceone.cost_analysis.model.budget_usage_model import BudgetUsage
__all__ = ['BudgetUsageInfo', 'BudgetUsagesInfo']
def BudgetUsageInfo(budget_usage_vo: Bu... | 36.40625 | 123 | 0.739056 | import functools
from spaceone.api.cost_analysis.v1 import budget_usage_pb2
from spaceone.core.pygrpc.message_type import *
from spaceone.core import utils
from spaceone.cost_analysis.model.budget_usage_model import BudgetUsage
__all__ = ['BudgetUsageInfo', 'BudgetUsagesInfo']
def BudgetUsageInfo(budget_usage_vo: Bu... | true | true |
f73a3e38ff3a2d2a801f286fdd178e73b7a5458c | 11,875 | py | Python | web-site/server/helpers/coco_eval.py | Maxew42/Trashedy | e7e43f172ef4a039e134cac26980f59fede24423 | [
"MIT"
] | null | null | null | web-site/server/helpers/coco_eval.py | Maxew42/Trashedy | e7e43f172ef4a039e134cac26980f59fede24423 | [
"MIT"
] | null | null | null | web-site/server/helpers/coco_eval.py | Maxew42/Trashedy | e7e43f172ef4a039e134cac26980f59fede24423 | [
"MIT"
] | null | null | null | import json
import tempfile
import numpy as np
import copy
import time
import torch
import torch._six
from pycocotools.cocoeval import COCOeval
from pycocotools.coco import COCO
import pycocotools.mask as mask_util
from collections import defaultdict
import helpers.utils as utils
class CocoEvaluator(object):
... | 34.025788 | 107 | 0.575663 | import json
import tempfile
import numpy as np
import copy
import time
import torch
import torch._six
from pycocotools.cocoeval import COCOeval
from pycocotools.coco import COCO
import pycocotools.mask as mask_util
from collections import defaultdict
import helpers.utils as utils
class CocoEvaluator(object):
... | true | true |
f73a3ec3b3edc3ad615b52890d9c828bb35cb31c | 2,835 | py | Python | config.py | federicoviola/ynitiumapp | 2ca3f4b27d2a032e18e856d691dcc02ec5bb2697 | [
"MIT"
] | null | null | null | config.py | federicoviola/ynitiumapp | 2ca3f4b27d2a032e18e856d691dcc02ec5bb2697 | [
"MIT"
] | null | null | null | config.py | federicoviola/ynitiumapp | 2ca3f4b27d2a032e18e856d691dcc02ec5bb2697 | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SSL_DISABLE = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
MAIL_SERVER = 'mail.messagingengine.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNA... | 31.5 | 75 | 0.670899 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SSL_DISABLE = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
MAIL_SERVER = 'mail.messagingengine.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNA... | true | true |
f73a3f8b14868e92a9505f7d1fba8a233fea96f3 | 221 | py | Python | anet/tasks/mnist/envs/mnist_env_senary.py | thomasaunger/Anet | 1d353f280a30c3207fa6d09af91a85c4955bbda4 | [
"BSD-3-Clause"
] | null | null | null | anet/tasks/mnist/envs/mnist_env_senary.py | thomasaunger/Anet | 1d353f280a30c3207fa6d09af91a85c4955bbda4 | [
"BSD-3-Clause"
] | null | null | null | anet/tasks/mnist/envs/mnist_env_senary.py | thomasaunger/Anet | 1d353f280a30c3207fa6d09af91a85c4955bbda4 | [
"BSD-3-Clause"
] | null | null | null | from anet.tasks.mnist.envs.mnist_env import MNISTEnv
class MNISTEnvSenary(MNISTEnv):
def __init__(self, procs=0, proc_id=-1, train=True):
MNISTEnv.__init__(self, 6, procs=procs, proc_id=proc_id, train=train)
| 36.833333 | 77 | 0.746606 | from anet.tasks.mnist.envs.mnist_env import MNISTEnv
class MNISTEnvSenary(MNISTEnv):
def __init__(self, procs=0, proc_id=-1, train=True):
MNISTEnv.__init__(self, 6, procs=procs, proc_id=proc_id, train=train)
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.