hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f12c86492c425f89243d27fa7d64f664758658 | 2,216 | py | Python | api/team/tests/test_model.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | null | null | null | api/team/tests/test_model.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | 5 | 2020-06-05T17:31:08.000Z | 2022-03-11T23:16:12.000Z | api/team/tests/test_model.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | null | null | null | from django.test import TestCase
from django.utils.translation import activate
from api.accounts.models import MyUser
from api.players.models import Player
from api.team.models import Team
from api.tournaments.models import Tournament
activate('en-us')
class Tournaments(TestCase):
tournament = None
team = N... | 32.588235 | 80 | 0.563177 | from django.test import TestCase
from django.utils.translation import activate
from api.accounts.models import MyUser
from api.players.models import Player
from api.team.models import Team
from api.tournaments.models import Tournament
activate('en-us')
class Tournaments(TestCase):
tournament = None
team = N... | true | true |
f7f12ce127210aee7340b8bbc3ea68dbb5c0792e | 6,449 | py | Python | lib/sqlalchemy/orm/evaluator.py | karlicoss/sqlalchemy | 402cca8f2ac42a08fba7a200c4e1e086e2081aad | [
"MIT"
] | 1 | 2021-04-04T10:13:08.000Z | 2021-04-04T10:13:08.000Z | lib/sqlalchemy/orm/evaluator.py | karlicoss/sqlalchemy | 402cca8f2ac42a08fba7a200c4e1e086e2081aad | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/evaluator.py | karlicoss/sqlalchemy | 402cca8f2ac42a08fba7a200c4e1e086e2081aad | [
"MIT"
] | null | null | null | # orm/evaluator.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator
from .. import inspect
from .. import util
from ..sql import and_
... | 28.535398 | 79 | 0.534812 |
import operator
from .. import inspect
from .. import util
from ..sql import and_
from ..sql import operators
class UnevaluatableError(Exception):
pass
_straight_ops = set(
getattr(operators, op)
for op in (
"add",
"mul",
"sub",
"div",
"mod",
"true... | true | true |
f7f12d8c53013db5df8d68563b03a1d0243425d4 | 23,315 | py | Python | pytos/securetrack/xml_objects/rest/security_policy.py | geewrd/pytos | 2379b3c61c47d03166638250a7622303e2a78a14 | [
"Apache-2.0"
] | 61 | 2017-03-27T07:06:54.000Z | 2022-03-02T12:13:00.000Z | pytos/securetrack/xml_objects/rest/security_policy.py | geewrd/pytos | 2379b3c61c47d03166638250a7622303e2a78a14 | [
"Apache-2.0"
] | 38 | 2017-06-14T02:53:05.000Z | 2022-03-11T12:51:10.000Z | pytos/securetrack/xml_objects/rest/security_policy.py | geewrd/pytos | 2379b3c61c47d03166638250a7622303e2a78a14 | [
"Apache-2.0"
] | 25 | 2017-07-10T18:08:14.000Z | 2021-12-30T22:01:01.000Z |
import logging
from pytos.common.base_types import XML_Object_Base, XML_List
from pytos.common.definitions.xml_tags import Elements, Attributes
from pytos.common.logging.definitions import XML_LOGGER_NAME
from pytos.common.definitions import xml_tags
from pytos.common.functions.xml import get_xml_text_value, get_xml_... | 46.077075 | 124 | 0.701265 |
import logging
from pytos.common.base_types import XML_Object_Base, XML_List
from pytos.common.definitions.xml_tags import Elements, Attributes
from pytos.common.logging.definitions import XML_LOGGER_NAME
from pytos.common.definitions import xml_tags
from pytos.common.functions.xml import get_xml_text_value, get_xml_... | true | true |
f7f12e03e0e706851009eff343125f197b2d844a | 1,409 | py | Python | users/models.py | maxweis/Web-App | f2df73bbc6da88d2d42713de9b72b0d1a799db6e | [
"Apache-2.0"
] | 2 | 2019-03-26T17:43:16.000Z | 2019-04-01T01:18:16.000Z | users/models.py | maxweis/Web-App | f2df73bbc6da88d2d42713de9b72b0d1a799db6e | [
"Apache-2.0"
] | 1 | 2019-03-29T11:33:56.000Z | 2019-03-29T11:33:56.000Z | users/models.py | maxweis/Resumania | f2df73bbc6da88d2d42713de9b72b0d1a799db6e | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.core.files.uploadedfile import InMemoryUploadedFile
from PIL import Image
from io import BytesIO
import sys
MAX_IMAGE_WIDTH = 160
MAX_IMAGE_HEIGHT = 160
class Member(AbstractUser):
ACAD_YEAR_CHOICES = [
'Fresh... | 37.078947 | 171 | 0.673527 | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.core.files.uploadedfile import InMemoryUploadedFile
from PIL import Image
from io import BytesIO
import sys
MAX_IMAGE_WIDTH = 160
MAX_IMAGE_HEIGHT = 160
class Member(AbstractUser):
ACAD_YEAR_CHOICES = [
'Fresh... | true | true |
f7f12ee82445e4ea957d25df97836047d604c09b | 2,674 | py | Python | sdk/anomalydetector/azure-ai-anomalydetector/setup.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/anomalydetector/azure-ai-anomalydetector/setup.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/anomalydetector/azure-ai-anomalydetector/setup.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 33.848101 | 91 | 0.603964 |
import re
import os.path
from io import open
from setuptools import find_packages, setup
PACKAGE_NAME = "azure-ai-anomalydetector"
PACKAGE_PPRINT_NAME = "Cognitive Services Anomaly Detector"
package_folder_path = PACKAGE_NAME.replace('-', '/')
namespace_name = PACKAGE_NAME.replace('-', '.')
with open(os... | true | true |
f7f12f0a1c7a7285058379e7a3c1ddf2f0b7fe6a | 5,861 | py | Python | python/GafferUITest/PathListingWidgetTest.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUITest/PathListingWidgetTest.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUITest/PathListingWidgetTest.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | 30.367876 | 96 | 0.652619 | true | true | |
f7f12f8a44994daa22c59cc16c6b9a5cb6fef512 | 24 | py | Python | plugin/src/test/resources/joinLines/StatementCommentStatement-after.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | null | null | null | plugin/src/test/resources/joinLines/StatementCommentStatement-after.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | 11 | 2017-02-27T22:35:32.000Z | 2021-12-24T08:07:40.000Z | plugin/src/test/resources/joinLines/StatementCommentStatement-after.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | null | null | null | a = 1 # surprise!
b = 2
| 8 | 17 | 0.5 | a = 1
b = 2
| true | true |
f7f12f9a2ed2a0a33827e3077f47d34e69b89d5b | 7,786 | py | Python | examples/mcpo_rlbench.py | id9502/RLFrame | a6fe99c6578e74f74767720b9212365e10f0cefd | [
"MIT"
] | 8 | 2020-02-09T03:33:50.000Z | 2022-01-05T06:35:28.000Z | examples/mcpo_rlbench.py | id9502/RLFrame | a6fe99c6578e74f74767720b9212365e10f0cefd | [
"MIT"
] | null | null | null | examples/mcpo_rlbench.py | id9502/RLFrame | a6fe99c6578e74f74767720b9212365e10f0cefd | [
"MIT"
] | 2 | 2020-02-10T03:21:31.000Z | 2020-03-22T15:40:37.000Z | #!/usr/bin/env python3
import os
import sys
import torch
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from core.logger import Logger
from core.filter.zfilter import ZFilter
from core.algorithm.mcpo import mcpo_step
from core.agent import Agent_sync as Agent
from core.model import Po... | 43.016575 | 139 | 0.645004 |
import os
import sys
import torch
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from core.logger import Logger
from core.filter.zfilter import ZFilter
from core.algorithm.mcpo import mcpo_step
from core.agent import Agent_sync as Agent
from core.model import PolicyWithValue as Polic... | true | true |
f7f12f9b37ff28dcb6eceb6ea5e07ae839731954 | 5,193 | py | Python | tests/test_kennitala.py | hringduehf/python-kennitala | d8ea06d83297ec8bce143ce27f8a2307aaf1e516 | [
"MIT"
] | null | null | null | tests/test_kennitala.py | hringduehf/python-kennitala | d8ea06d83297ec8bce143ce27f8a2307aaf1e516 | [
"MIT"
] | null | null | null | tests/test_kennitala.py | hringduehf/python-kennitala | d8ea06d83297ec8bce143ce27f8a2307aaf1e516 | [
"MIT"
] | null | null | null | """Tests for kennitala.Kennitala class"""
from datetime import date
import pytest
from kennitala import Kennitala
valid_kennitalas = (
"140543-3229", # kennitala of Icelandic president
"1203753509", # kennitala of Icelandic prime minister
"6503760649", # kennitala of Þjóðskrá Íslands (Registry Iceland... | 29.844828 | 69 | 0.714231 | from datetime import date
import pytest
from kennitala import Kennitala
valid_kennitalas = (
"140543-3229",
"1203753509",
"6503760649",
)
birth_dates = (date(1943, 5, 14), date(1975, 3, 12))
invalid_kennitalas = (
"1234567890",
"1503-760649",
"2513760649",
"0503760648",
"05037... | true | true |
f7f13026278e20724c76ffbd9122a4164e208673 | 5,658 | py | Python | ltr/models/target_classifier/residual_modules.py | sehomi/pyCFTrackers | 4dbd550fbac78f4e7e35fdb4a1761b5b0cf9b096 | [
"MIT"
] | null | null | null | ltr/models/target_classifier/residual_modules.py | sehomi/pyCFTrackers | 4dbd550fbac78f4e7e35fdb4a1761b5b0cf9b096 | [
"MIT"
] | null | null | null | ltr/models/target_classifier/residual_modules.py | sehomi/pyCFTrackers | 4dbd550fbac78f4e7e35fdb4a1761b5b0cf9b096 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import math
import ltr.models.layers.filter as filter_layer
import ltr.models.layers.activation as activation
from ltr.models.layers.distance import DistanceMap
from pytracking import TensorList
class LinearFilterLearnGen(nn.Module):
def __init__(self, feat_stride=16, init_filte... | 42.863636 | 141 | 0.671969 | import torch
import torch.nn as nn
import math
import ltr.models.layers.filter as filter_layer
import ltr.models.layers.activation as activation
from ltr.models.layers.distance import DistanceMap
from pytracking import TensorList
class LinearFilterLearnGen(nn.Module):
def __init__(self, feat_stride=16, init_filte... | true | true |
f7f13098e786af8b71d1a577bf31ffbf820ae447 | 768 | py | Python | sql.py | scvnc/travel-graph | bb0e2e52ce79ffc430c18f8e4b2e849856c4ec60 | [
"MIT"
] | null | null | null | sql.py | scvnc/travel-graph | bb0e2e52ce79ffc430c18f8e4b2e849856c4ec60 | [
"MIT"
] | null | null | null | sql.py | scvnc/travel-graph | bb0e2e52ce79ffc430c18f8e4b2e849856c4ec60 | [
"MIT"
] | null | null | null | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, create_engine
from sqlalchemy.orm import sessionmaker
engine = create_engine('sqlite:///:memory:')
Session = sessionmaker(bind=engine)
session = Session()
Base = declarative_ba... | 24 | 92 | 0.671875 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, create_engine
from sqlalchemy.orm import sessionmaker
engine = create_engine('sqlite:///:memory:')
Session = sessionmaker(bind=engine)
session = Session()
Base = declarative_ba... | true | true |
f7f131667974e8aae11cada89330943afeef4d92 | 252 | py | Python | pixi/errors.py | voroneril/pixi | aefe0e4d6b8799f98c959487d3501c17ecec42d8 | [
"Apache-2.0"
] | 1 | 2020-11-09T00:03:04.000Z | 2020-11-09T00:03:04.000Z | pixi/errors.py | voroneril/pixi | aefe0e4d6b8799f98c959487d3501c17ecec42d8 | [
"Apache-2.0"
] | 1 | 2019-08-05T15:52:27.000Z | 2019-08-05T15:52:27.000Z | pixi/errors.py | voroneril/pixi | aefe0e4d6b8799f98c959487d3501c17ecec42d8 | [
"Apache-2.0"
] | 1 | 2020-11-10T03:33:06.000Z | 2020-11-10T03:33:06.000Z | class PixiError(Exception):
pass
class GoAuthenticate(PixiError):
pass
class InvalidConfig(PixiError):
pass
class InvalidURL(PixiError):
pass
class DownloadFailed(PixiError):
pass
class DuplicateImage(PixiError):
pass
| 10.956522 | 32 | 0.722222 | class PixiError(Exception):
pass
class GoAuthenticate(PixiError):
pass
class InvalidConfig(PixiError):
pass
class InvalidURL(PixiError):
pass
class DownloadFailed(PixiError):
pass
class DuplicateImage(PixiError):
pass
| true | true |
f7f131a8b33de945f9ef5514b1ef439c9d634fbf | 97 | py | Python | Frontend web dev/HTML/Django-Python-Full-Stack-Web-Developer-Material/Django-Python-Full-Stack-Web-Devloper-master/djangostuff/first_proect2/first_app/apps.py | aattaran/data_analysis | 57dc9564ac53452043325c1362937f64cdbf74a4 | [
"BSD-3-Clause"
] | 1 | 2021-08-14T14:48:37.000Z | 2021-08-14T14:48:37.000Z | Frontend web dev/HTML/Django-Python-Full-Stack-Web-Developer-Material/Django-Python-Full-Stack-Web-Devloper-master/djangostuff/first_proect2/first_app/apps.py | aattaran/data_analysis | 57dc9564ac53452043325c1362937f64cdbf74a4 | [
"BSD-3-Clause"
] | 72 | 2020-10-26T16:08:59.000Z | 2022-03-02T08:03:41.000Z | Frontend web dev/HTML/Django-Python-Full-Stack-Web-Developer-Material/Django-Python-Full-Stack-Web-Devloper-master/djangostuff/first_proect2/first_app/apps.py | aattaran/data_analysis | 57dc9564ac53452043325c1362937f64cdbf74a4 | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class FirstAppConfig(AppConfig):
name = 'first_app'
| 16.166667 | 34 | 0.721649 | from django.apps import AppConfig
class FirstAppConfig(AppConfig):
name = 'first_app'
| true | true |
f7f132e078d9fcf8d0457fe831f47adccd24ff06 | 25,689 | py | Python | modules/s3/s3delete.py | Slovakiadragon/eden | f6851b394c1c5754132b402b50f1966d7ca90217 | [
"MIT"
] | null | null | null | modules/s3/s3delete.py | Slovakiadragon/eden | f6851b394c1c5754132b402b50f1966d7ca90217 | [
"MIT"
] | null | null | null | modules/s3/s3delete.py | Slovakiadragon/eden | f6851b394c1c5754132b402b50f1966d7ca90217 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" S3 Record Deletion
@copyright: 2018-2019 (c) Sahana Software Foundation
@license: MIT
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
... | 33.536554 | 87 | 0.484176 |
import json
import sys
from gluon import current
from gluon.tools import callback
from s3dal import original_tablename, Row
from s3utils import s3_get_last_record_id, s3_has_foreign_key, s3_remove_last_record_id
__all__ = ("S3Delete",
)
DELETED = "deleted"
class S3Delete(object):
def __init__(s... | true | true |
f7f13301f31d6197d4a78f3f095df1b20cbde21b | 1,012 | py | Python | Python/decornamedir.py | sockduct/Hackerrank | 3f73370fe5e477701e1bb30b116a77b4a2efc888 | [
"MIT"
] | null | null | null | Python/decornamedir.py | sockduct/Hackerrank | 3f73370fe5e477701e1bb30b116a77b4a2efc888 | [
"MIT"
] | null | null | null | Python/decornamedir.py | sockduct/Hackerrank | 3f73370fe5e477701e1bb30b116a77b4a2efc888 | [
"MIT"
] | null | null | null | from collections import namedtuple
from functools import wraps
from operator import itemgetter
def dirfmt(func):
@wraps(func)
def inner(directory):
new_directory = []
for person in directory:
title = 'Mr.' if person.sex == 'M' else 'Ms.'
new_directory.append((title, pe... | 23.534884 | 77 | 0.61166 | from collections import namedtuple
from functools import wraps
from operator import itemgetter
def dirfmt(func):
@wraps(func)
def inner(directory):
new_directory = []
for person in directory:
title = 'Mr.' if person.sex == 'M' else 'Ms.'
new_directory.append((title, pe... | true | true |
f7f134185a3efc608b564fefd8338370088a9dd1 | 582 | py | Python | check/core/migrations/0004_recebido_cliente.py | gabrielnaoto/man_check_control | ab594d2059460820aeacc84062444f1720ed52f9 | [
"MIT"
] | null | null | null | check/core/migrations/0004_recebido_cliente.py | gabrielnaoto/man_check_control | ab594d2059460820aeacc84062444f1720ed52f9 | [
"MIT"
] | 3 | 2020-02-12T00:23:10.000Z | 2021-06-10T20:03:03.000Z | check/core/migrations/0004_recebido_cliente.py | gabrielnaoto/checkapp | ab594d2059460820aeacc84062444f1720ed52f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-25 18:57
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20171125_1404'),
]
operations = ... | 25.304348 | 114 | 0.646048 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20171125_1404'),
]
operations = [
migrations.AddField(
model_name='recebido',
... | true | true |
f7f1351165219489c2c55789410a05c5c806e2b6 | 388 | py | Python | shiSock-0.2.0/test_one/client.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | null | null | null | shiSock-0.2.0/test_one/client.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | null | null | null | shiSock-0.2.0/test_one/client.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | 1 | 2021-10-31T13:47:42.000Z | 2021-10-31T13:47:42.000Z | import PySock
run = True
def sample_func(data):
# global run
print(data)
# run = False
c = PySock.client(
client_name= "shikhar",
DSP_enable= True,
file = r'client.yaml',
debug = True,
rememberServer = True
)
c.CLIENT("localhost",1234)
c.CREATE_CHANNEL("test")
c.SEND(channel = "test", ... | 17.636364 | 48 | 0.641753 | import PySock
run = True
def sample_func(data):
print(data)
c = PySock.client(
client_name= "shikhar",
DSP_enable= True,
file = r'client.yaml',
debug = True,
rememberServer = True
)
c.CLIENT("localhost",1234)
c.CREATE_CHANNEL("test")
c.SEND(channel = "test", data = "Hello, World!")
w... | true | true |
f7f135297a4af0ca3c844df09378e7f0dbe1393a | 1,564 | py | Python | test/test_verve_response_comment_list.py | iEngage/python-sdk | 76cc6ed697d7599ce9af74124c12d33ad5aff419 | [
"Apache-2.0"
] | null | null | null | test/test_verve_response_comment_list.py | iEngage/python-sdk | 76cc6ed697d7599ce9af74124c12d33ad5aff419 | [
"Apache-2.0"
] | null | null | null | test/test_verve_response_comment_list.py | iEngage/python-sdk | 76cc6ed697d7599ce9af74124c12d33ad5aff419 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
iEngage 2.0 API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 2.0
Generated by: https://github.com/swagger-api/swagge... | 28.962963 | 186 | 0.742967 |
from __future__ import absolute_import
import os
import sys
import unittest
import iengage_client
from iengage_client.rest import ApiException
from iengage_client.models.verve_response_comment_list import VerveResponseCommentList
class TestVerveResponseCommentList(unittest.TestCase):
def setUp(self):
... | true | true |
f7f1359f4a320784e9307830362dc9f924160eaf | 2,980 | py | Python | ClinicalTrials/ClinicalTrialsDriverScriptSolutionQ5.py | nikunjpansari/stochastic-optimization | a01e95e9168dd8f87751c29f94bb382f83567e71 | [
"MIT"
] | 92 | 2019-05-08T15:12:03.000Z | 2022-03-31T08:47:57.000Z | ClinicalTrials/ClinicalTrialsDriverScriptSolutionQ5.py | nikunjpansari/stochastic-optimization | a01e95e9168dd8f87751c29f94bb382f83567e71 | [
"MIT"
] | 1 | 2020-12-15T22:24:45.000Z | 2020-12-15T22:24:45.000Z | ClinicalTrials/ClinicalTrialsDriverScriptSolutionQ5.py | nikunjpansari/stochastic-optimization | a01e95e9168dd8f87751c29f94bb382f83567e71 | [
"MIT"
] | 50 | 2019-03-04T21:12:18.000Z | 2022-03-23T05:06:09.000Z | """
Clinical Trials Driver Script class
Raluca Cobzaru (c) 2018
"""
from collections import namedtuple
import numpy as np
import scipy
import pandas as pd
from ClinicalTrialsModel import ClinicalTrialsModel
from ClinicalTrialsPolicy import ClinicalTrialsPolicy
import matplotlib.pyplot as plt
import time
if __name__... | 33.483146 | 135 | 0.642953 |
from collections import namedtuple
import numpy as np
import scipy
import pandas as pd
from ClinicalTrialsModel import ClinicalTrialsModel
from ClinicalTrialsPolicy import ClinicalTrialsPolicy
import matplotlib.pyplot as plt
import time
if __name__ == "__main__":
time_total = time.time()
np.random.seed(2345678173)
... | true | true |
f7f135a8e2a64b1a9ef7f13ad423fdb202f8dd9b | 13,573 | py | Python | Controller/node.py | iandouglas96/swarm-thesis | dbafa2343a75c4de26b0ae19d08a033b34570287 | [
"MIT"
] | null | null | null | Controller/node.py | iandouglas96/swarm-thesis | dbafa2343a75c4de26b0ae19d08a033b34570287 | [
"MIT"
] | null | null | null | Controller/node.py | iandouglas96/swarm-thesis | dbafa2343a75c4de26b0ae19d08a033b34570287 | [
"MIT"
] | null | null | null | import sympy
from sympy import symbols, Matrix
import numpy as np
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty
from constants import *
from serialinterface import SerialInterface
import struct
import pdb
#IMPORTANT: Import AFTER kivy stuff
from UKF... | 36.098404 | 119 | 0.570544 | import sympy
from sympy import symbols, Matrix
import numpy as np
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty
from constants import *
from serialinterface import SerialInterface
import struct
import pdb
from UKFFilter import UnscentedKalmanFilter... | false | true |
f7f136eb415720c0c4cf31867f9bdbdf564cfe0e | 637 | py | Python | contests_atcoder/abc175/abc175_c.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | null | null | null | contests_atcoder/abc175/abc175_c.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | 1 | 2021-01-02T06:36:51.000Z | 2021-01-02T06:36:51.000Z | contests_atcoder/abc175/abc175_c.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | null | null | null | from itertools import accumulate,chain,combinations,groupby,permutations,product
from collections import deque,Counter
from bisect import bisect_left,bisect_right
from math import gcd,sqrt,sin,cos,tan,degrees,radians
from fractions import Fraction
from decimal import Decimal
import sys
input = lambda: sys.stdin.readlin... | 27.695652 | 80 | 0.679749 | from itertools import accumulate,chain,combinations,groupby,permutations,product
from collections import deque,Counter
from bisect import bisect_left,bisect_right
from math import gcd,sqrt,sin,cos,tan,degrees,radians
from fractions import Fraction
from decimal import Decimal
import sys
input = lambda: sys.stdin.readlin... | true | true |
f7f13730ffa24a2d77b095d69207c4060d324383 | 1,628 | py | Python | bench/createFig8.py | aditi2795/NOPaxos | c650eda207090534b34f6521ed3d420f36ba186f | [
"MIT"
] | 3 | 2018-09-23T23:29:33.000Z | 2020-04-28T03:07:20.000Z | bench/createFig8.py | aditi2795/NOPaxos | c650eda207090534b34f6521ed3d420f36ba186f | [
"MIT"
] | null | null | null | bench/createFig8.py | aditi2795/NOPaxos | c650eda207090534b34f6521ed3d420f36ba186f | [
"MIT"
] | 1 | 2020-04-07T17:31:34.000Z | 2020-04-07T17:31:34.000Z | # Arguments in order: protocol, #replicas, #threads per client, #client machines
# EX: python ./bench/runBench.py unreplicated 5 1 1
# To run with batching, use protocol "batch"
import sys, string
import subprocess
import os
from runBench import runTest
import matplotlib.pyplot as plt
from matplotlib.ticker import Form... | 37 | 84 | 0.665848 | ot as plt
from matplotlib.ticker import FormatStrFormatter
clientMachines = 5
averageRuns = 3
protocols = ["nopaxos", "unreplicated", "vr", "batch", "fastpaxos"]
maxThreads = {"unreplicated": 12, "vr": 5, "batch": 20, "fastpaxos": 4,
"nopaxos": 12}
legend = {"nopaxos": "NOPaxos", "unreplicated": "Unreplicated... | true | true |
f7f13767030af4354230b7bb859784c3bdfb21a1 | 2,072 | py | Python | tests/threadfix/scans_test.py | matt-fevold/webbreaker | b500fc620ebba03a27321c8f832ab77bb760b9c5 | [
"MIT"
] | 7 | 2018-12-20T19:18:43.000Z | 2019-12-10T15:03:41.000Z | tests/threadfix/scans_test.py | matt-fevold/webbreaker | b500fc620ebba03a27321c8f832ab77bb760b9c5 | [
"MIT"
] | 5 | 2019-04-02T17:07:44.000Z | 2020-02-17T07:08:11.000Z | tests/threadfix/scans_test.py | matt-fevold/webbreaker | b500fc620ebba03a27321c8f832ab77bb760b9c5 | [
"MIT"
] | 7 | 2019-01-10T10:40:55.000Z | 2022-03-13T14:08:37.000Z | import mock
import pytest
from webbreaker.threadfix.scans import ThreadFixScans
from threadfixproapi.threadfixpro import ThreadFixProResponse
@mock.patch('webbreaker.threadfix.scans.ThreadFixHelper')
@mock.patch('webbreaker.threadfix.scans.threadfixloghelper')
def test_threadfix_scans_successful_list(log_mock, helper... | 49.333333 | 161 | 0.802606 | import mock
import pytest
from webbreaker.threadfix.scans import ThreadFixScans
from threadfixproapi.threadfixpro import ThreadFixProResponse
@mock.patch('webbreaker.threadfix.scans.ThreadFixHelper')
@mock.patch('webbreaker.threadfix.scans.threadfixloghelper')
def test_threadfix_scans_successful_list(log_mock, helper... | true | true |
f7f13849e20cfea0f0d1de3e37931b87c6be36b7 | 22,232 | py | Python | var/spack/repos/builtin/packages/intel-parallel-studio/package.py | ttroy50/spack | adffa45264b0079a79aded048fff35f7b2c3ede6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/intel-parallel-studio/package.py | ttroy50/spack | adffa45264b0079a79aded048fff35f7b2c3ede6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/intel-parallel-studio/package.py | ttroy50/spack | adffa45264b0079a79aded048fff35f7b2c3ede6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class IntelParallelStudio(IntelPackage):
"""Intel Parallel Studio."""
homepage = "https://s... | 102.925926 | 242 | 0.793001 |
from spack import *
class IntelParallelStudio(IntelPackage):
homepage = "https://software.intel.com/en-us/intel-parallel-studio-xe"
version('cluster.2019.5', sha256='c03421de616bd4e640ed25ce4103ec9c5c85768a940a5cb5bd1e97b45be33904', url='http://registrationcent... | true | true |
f7f1386f8868b6512b06e02dda64a8fddef99b68 | 2,157 | py | Python | mayatools/playblast/core.py | westernx/mayatools | 47c91050cb54167268d456e130ffce2d55373381 | [
"BSD-3-Clause"
] | 47 | 2015-01-07T17:38:39.000Z | 2022-03-22T02:42:39.000Z | mayatools/playblast/core.py | westernx/mayatools | 47c91050cb54167268d456e130ffce2d55373381 | [
"BSD-3-Clause"
] | 1 | 2016-04-25T09:02:57.000Z | 2016-04-25T13:55:13.000Z | mayatools/playblast/core.py | westernx/mayatools | 47c91050cb54167268d456e130ffce2d55373381 | [
"BSD-3-Clause"
] | 12 | 2015-07-13T12:32:35.000Z | 2020-04-29T02:58:49.000Z | import tempfile
from maya import cmds
from .. import context
settings = {
'attrs': {
'defaultRenderGlobals.imageFormat': 8, # JPEG.
'defaultResolution.width': 1280,
'defaultResolution.height': 720,
'defaultResolution.deviceAspectRatio': 1280.0 / 720,
'defaultResolution.pi... | 31.26087 | 110 | 0.634678 | import tempfile
from maya import cmds
from .. import context
settings = {
'attrs': {
'defaultRenderGlobals.imageFormat': 8,
'defaultResolution.width': 1280,
'defaultResolution.height': 720,
'defaultResolution.deviceAspectRatio': 1280.0 / 720,
'defaultResolution.pixelAspe... | true | true |
f7f138ab14b909b506e77252bee64f331b9b9b92 | 532 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/restuff-31572 | ee434d445442f6ce930ce5d7a38dde0aaf6cccf7 | [
"FTL",
"AML",
"RSA-MD"
] | 1 | 2021-11-08T10:23:16.000Z | 2021-11-08T10:23:16.000Z | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/restuff-31572 | ee434d445442f6ce930ce5d7a38dde0aaf6cccf7 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/restuff-31572 | ee434d445442f6ce930ce5d7a38dde0aaf6cccf7 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "restuff-31572.botics.co"
site_params = {
"name": "ReStuff",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_create(d... | 20.461538 | 61 | 0.654135 | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "restuff-31572.botics.co"
site_params = {
"name": "ReStuff",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_create(d... | true | true |
f7f139a5d88694f5008b1711937fccc4af254589 | 1,245 | py | Python | src/flake8/main/vcs.py | brianv0/flake8 | 93ad9617b0a192836cbc9a591b5abe74e2c85ba7 | [
"MIT"
] | 2 | 2020-02-15T22:03:20.000Z | 2021-04-09T16:30:14.000Z | src/flake8/main/vcs.py | brianv0/flake8 | 93ad9617b0a192836cbc9a591b5abe74e2c85ba7 | [
"MIT"
] | 12 | 2020-02-12T00:39:47.000Z | 2022-03-02T14:58:49.000Z | src/flake8/main/vcs.py | brianv0/flake8 | 93ad9617b0a192836cbc9a591b5abe74e2c85ba7 | [
"MIT"
] | 1 | 2019-06-04T10:25:26.000Z | 2019-06-04T10:25:26.000Z | """Module containing some of the logic for our VCS installation logic."""
from flake8 import exceptions as exc
from flake8.main import git
from flake8.main import mercurial
# NOTE(sigmavirus24): In the future, we may allow for VCS hooks to be defined
# as plugins, e.g., adding a flake8.vcs entry-point. In that case, ... | 33.648649 | 77 | 0.721285 | from flake8 import exceptions as exc
from flake8.main import git
from flake8.main import mercurial
_INSTALLERS = {"git": git.install, "mercurial": mercurial.install}
def install(option, option_string, value, parser):
installer = _INSTALLERS.get(value)
errored = False
successful = False
try:
... | true | true |
f7f139df7ad99c12dc2fc523e50bb2e44ec93923 | 103 | py | Python | loginlimiter/admin.py | bsarsgard/django-loginlimiter | 58fcd69be58d92b3a1eefb7065bd3d924598f51d | [
"Apache-2.0"
] | 1 | 2016-08-09T22:13:07.000Z | 2016-08-09T22:13:07.000Z | loginlimiter/admin.py | bsarsgard/django-loginlimiter | 58fcd69be58d92b3a1eefb7065bd3d924598f51d | [
"Apache-2.0"
] | null | null | null | loginlimiter/admin.py | bsarsgard/django-loginlimiter | 58fcd69be58d92b3a1eefb7065bd3d924598f51d | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import LoginAttempt
admin.site.register(LoginAttempt)
| 14.714286 | 33 | 0.825243 | from django.contrib import admin
from .models import LoginAttempt
admin.site.register(LoginAttempt)
| true | true |
f7f13a28fa5b109215a2d9d14d1642d376ea2060 | 1,446 | py | Python | NotionFlash/ankiservice/ankiCard.py | furiiibond/NotionFlash | 8f6abe30af4df8da0c84d20079c5a64a50c0d823 | [
"MIT"
] | 8 | 2021-11-30T08:59:57.000Z | 2022-03-10T20:36:06.000Z | NotionFlash/ankiservice/ankiCard.py | furiiibond/NotionFlash | 8f6abe30af4df8da0c84d20079c5a64a50c0d823 | [
"MIT"
] | 8 | 2021-12-06T04:05:24.000Z | 2021-12-15T20:22:42.000Z | NotionFlash/ankiservice/ankiCard.py | furiiibond/NotionFlash | 8f6abe30af4df8da0c84d20079c5a64a50c0d823 | [
"MIT"
] | 2 | 2022-01-11T09:46:50.000Z | 2022-02-01T06:26:06.000Z | class ankiCard:
"""
A class to represent an Anki Flash Card.
Attributes
----------
payload : JSON[]
JSON payload for sending card via AnkiConnect
Methods
-------
addContent(question, answer):
Adds question and answer to
"""
def __init__(self, deck, tag, questi... | 28.92 | 69 | 0.427386 | class ankiCard:
def __init__(self, deck, tag, question, answer) -> None:
self.payload = {
"note": {
"deckName": deck,
"modelName": "Basic",
"fields": {
"Front": "",
"Back": ""
},
... | true | true |
f7f13b0d222acbdec07494c9955780cc75bb698c | 3,796 | py | Python | pyecharts/charts/geo.py | MiracleXYZ/pyecharts | 68856b9631340cbf9393bbc3178cb2f72b3eb3c2 | [
"MIT"
] | 1 | 2019-09-05T08:15:12.000Z | 2019-09-05T08:15:12.000Z | pyecharts/charts/geo.py | MiracleXYZ/pyecharts | 68856b9631340cbf9393bbc3178cb2f72b3eb3c2 | [
"MIT"
] | null | null | null | pyecharts/charts/geo.py | MiracleXYZ/pyecharts | 68856b9631340cbf9393bbc3178cb2f72b3eb3c2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#coding=utf-8
from pyecharts.base import Base
from pyecharts.option import get_all_options
class Geo(Base):
"""
<<< Geo component >>>
Geographic coorinate system component.
Geographic coorinate system component is used to draw maps, which also supports scatter series, and line se... | 36.854369 | 116 | 0.478398 |
from pyecharts.base import Base
from pyecharts.option import get_all_options
class Geo(Base):
def __init__(self, title="", subtitle="", **kwargs):
super(Geo, self).__init__(title, subtitle, **kwargs)
def add(self, *args, **kwargs):
self.__add(*args, **kwargs)
def __add(self, name, attr... | true | true |
f7f13b15ebbd568ce477463cc58f6dd6c4d6c596 | 291 | py | Python | Cogs/Nullify.py | Damiian1/techwizardshardware | 97ceafc15036be4136e860076d73d74f1887f041 | [
"MIT"
] | 6 | 2017-01-24T02:03:53.000Z | 2022-03-16T12:39:19.000Z | Cogs/Nullify.py | Damiian1/techwizardshardware | 97ceafc15036be4136e860076d73d74f1887f041 | [
"MIT"
] | null | null | null | Cogs/Nullify.py | Damiian1/techwizardshardware | 97ceafc15036be4136e860076d73d74f1887f041 | [
"MIT"
] | null | null | null | def setup(bot):
# This module isn't actually a cog
return
def clean(string):
# A helper script to strip out @here and @everyone mentions
zerospace = ""
return string.replace("@everyone", "@{}everyone".format(zerospace)).replace("@here", "@{}here".format(zerospace)) | 36.375 | 117 | 0.659794 | def setup(bot):
return
def clean(string):
# A helper script to strip out @here and @everyone mentions
zerospace = ""
return string.replace("@everyone", "@{}everyone".format(zerospace)).replace("@here", "@{}here".format(zerospace)) | true | true |
f7f13b27f3f5754a0ea630e5cecf2f0d7dc31242 | 716 | py | Python | multidoc-stave/simple-backend/nlpviewer_backend/utils.py | adithya7/cdec-ann-tool | 263137960d01babdddae48faef9cfef5efef6826 | [
"Apache-2.0"
] | null | null | null | multidoc-stave/simple-backend/nlpviewer_backend/utils.py | adithya7/cdec-ann-tool | 263137960d01babdddae48faef9cfef5efef6826 | [
"Apache-2.0"
] | null | null | null | multidoc-stave/simple-backend/nlpviewer_backend/utils.py | adithya7/cdec-ann-tool | 263137960d01babdddae48faef9cfef5efef6826 | [
"Apache-2.0"
] | null | null | null | import hashlib
from pathlib import PurePath
# return a mapping from external id to file names
def read_index_file(index_file):
extid_to_name = {}
with open(index_file) as f:
for line in f:
pairs = line.strip().split()
external_id = int(pairs[0])
file_name = PurePath(... | 25.571429 | 57 | 0.675978 | import hashlib
from pathlib import PurePath
def read_index_file(index_file):
extid_to_name = {}
with open(index_file) as f:
for line in f:
pairs = line.strip().split()
external_id = int(pairs[0])
file_name = PurePath(pairs[1]).stem
extid_to_name[external... | true | true |
f7f13b652296220e74ceb55ddb624ccb8585b1d2 | 804 | py | Python | tests/kubernetes/checks/test_ImageDigest.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 1 | 2021-02-13T15:24:42.000Z | 2021-02-13T15:24:42.000Z | tests/kubernetes/checks/test_ImageDigest.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 7 | 2021-04-12T06:54:07.000Z | 2022-03-21T14:04:14.000Z | tests/kubernetes/checks/test_ImageDigest.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 1 | 2021-12-16T03:09:55.000Z | 2021-12-16T03:09:55.000Z | import os
import unittest
from checkov.kubernetes.checks.resource.k8s.ImageDigest import check
from checkov.kubernetes.runner import Runner
from checkov.runner_filter import RunnerFilter
class TestImageDigest(unittest.TestCase):
def test_summary(self):
runner = Runner()
current_dir = os.path.dir... | 29.777778 | 101 | 0.717662 | import os
import unittest
from checkov.kubernetes.checks.resource.k8s.ImageDigest import check
from checkov.kubernetes.runner import Runner
from checkov.runner_filter import RunnerFilter
class TestImageDigest(unittest.TestCase):
def test_summary(self):
runner = Runner()
current_dir = os.path.dir... | true | true |
f7f13ccbd95ad2ec641219edef63254f82bb79ac | 6,893 | py | Python | evok/unipi2.py | rijowc/david | ef7d0ceb3366246e764d14d3319128a2ad988ed8 | [
"Apache-2.0"
] | null | null | null | evok/unipi2.py | rijowc/david | ef7d0ceb3366246e764d14d3319128a2ad988ed8 | [
"Apache-2.0"
] | null | null | null | evok/unipi2.py | rijowc/david | ef7d0ceb3366246e764d14d3319128a2ad988ed8 | [
"Apache-2.0"
] | null | null | null | '''
UniPi2 primitive devices (DI, DO, AI, AO)
------------------------------------------
'''
import struct
import time
import datetime
#import atexit
from math import isnan, floor
from tornado import gen
from tornado.ioloop import IOLoop
import devents
from devices import *
import config
from spiarm import ProxyReg... | 30.365639 | 121 | 0.597273 |
import struct
import time
import datetime
from math import isnan, floor
from tornado import gen
from tornado.ioloop import IOLoop
import devents
from devices import *
import config
from spiarm import ProxyRegister
class Relay(object):
pending_id = 0
def __init__(self, circuit, arm, coil, reg, mask):
... | true | true |
f7f13d3a92c5d155d4a8d9fb5e84d3a0fab6a9e2 | 36,261 | py | Python | bindings/python/cntk/ops/tests/reshaping_test.py | chunxiaosz/CNTK | a7453ed0791ae797bcf9e8d8fbc287332a430db4 | [
"MIT"
] | null | null | null | bindings/python/cntk/ops/tests/reshaping_test.py | chunxiaosz/CNTK | a7453ed0791ae797bcf9e8d8fbc287332a430db4 | [
"MIT"
] | null | null | null | bindings/python/cntk/ops/tests/reshaping_test.py | chunxiaosz/CNTK | a7453ed0791ae797bcf9e8d8fbc287332a430db4 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
"""
Unit tests for reshaping operations.
"""
from __future__ import division
impor... | 39.803513 | 153 | 0.6015 |
from __future__ import division
import numpy as np
import cntk as C
import pytest
from .ops_test_utils import unittest_helper, _test_unary_op, _test_binary_op, \
AA, precision, PRECISION_TO_TYPE, cntk_device
import cntk as C
from cntk import Value
from cntk.axis import Axis
from cntk.... | true | true |
f7f13de6dc2c76a2e959640aacb9090ea5c9b69d | 5,167 | py | Python | manila/api/views/shares.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 1 | 2015-05-28T22:28:08.000Z | 2015-05-28T22:28:08.000Z | manila/api/views/shares.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 5 | 2015-08-13T15:17:28.000Z | 2016-08-02T02:55:01.000Z | manila/api/views/shares.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 2 | 2015-08-29T08:19:58.000Z | 2016-08-02T02:46:10.000Z | # Copyright 2013 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 37.442029 | 78 | 0.617186 |
from manila.api import common
class ViewBuilder(common.ViewBuilder):
_collection_name = 'shares'
_detail_version_modifiers = [
"add_snapshot_support_field",
"add_consistency_group_fields",
"add_task_state_field",
"modify_share_type_field",
"remove_export... | true | true |
f7f13e1f6102a135a549d32ca3975f99e3ad612d | 327 | py | Python | modules/ai-codes/modules/preprocessing/src/noise_removal_4whitespaces.py | drigols/estudos | 3bf2a35d4f874526f792b4850b25da3f5c7c4cb1 | [
"MIT"
] | 1 | 2020-09-06T22:17:19.000Z | 2020-09-06T22:17:19.000Z | modules/ai-codes/modules/preprocessing/src/noise_removal_4whitespaces.py | drigols/studies | 3bf2a35d4f874526f792b4850b25da3f5c7c4cb1 | [
"MIT"
] | null | null | null | modules/ai-codes/modules/preprocessing/src/noise_removal_4whitespaces.py | drigols/studies | 3bf2a35d4f874526f792b4850b25da3f5c7c4cb1 | [
"MIT"
] | null | null | null | ########################################################
# Rodrigo Leite - drigols #
# Last update: 29/12/2021 #
########################################################
import re
text = " This is a paragraph"
result = re.sub(r'\s{4}', '', text)
print(r... | 27.25 | 56 | 0.287462 | true | true | |
f7f13e35e6d7b8e1d2fb3daebce5ed8715321f3a | 2,962 | py | Python | docs/conf.py | juanpsenn/django-afip | 3eb2231201fc5b34c7530592b29657bbea126b90 | [
"0BSD"
] | 27 | 2018-10-08T12:49:11.000Z | 2022-02-21T23:22:39.000Z | docs/conf.py | juanpsenn/django-afip | 3eb2231201fc5b34c7530592b29657bbea126b90 | [
"0BSD"
] | 60 | 2018-08-21T22:26:30.000Z | 2022-03-15T17:19:18.000Z | docs/conf.py | juanpsenn/django-afip | 3eb2231201fc5b34c7530592b29657bbea126b90 | [
"0BSD"
] | 15 | 2018-08-23T09:40:25.000Z | 2021-11-10T12:24:00.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If exte... | 31.510638 | 79 | 0.683997 |
import os
import sys
from os.path import abspath
from os.path import dirname
from os.path import join
import django
import django_afip
BASE_DIR = dirname(dirname(abspath(__file__)))
sys.path.insert(0, abspath(join(dirname(__file__), "_ext")))
sys.path.insert(0, abspath(join(BASE_DIR, "testapp")))
os.envi... | true | true |
f7f13f276ffdc4b98d274c4393ad1dde525eaf0a | 49,444 | py | Python | Leg-UP/models/recommender/Recommender.py | sharanmayank/ShillingAttack | 783f135a4fcc709e7ce478c2e6f2e7e6c5ad2ace | [
"MIT"
] | null | null | null | Leg-UP/models/recommender/Recommender.py | sharanmayank/ShillingAttack | 783f135a4fcc709e7ce478c2e6f2e7e6c5ad2ace | [
"MIT"
] | null | null | null | Leg-UP/models/recommender/Recommender.py | sharanmayank/ShillingAttack | 783f135a4fcc709e7ce478c2e6f2e7e6c5ad2ace | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/11/27 17:20
# @Author : chensi
# @File : Recommender.py
# @Software : PyCharm
# @Desciption : None
import os
# os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"
# def available_GPU():
# import subprocess
# import numpy as np
# nDevice = int(subprocess.getou... | 39.777957 | 127 | 0.583913 |
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "1, 2, 3"
import random
import numpy as np
import torch
tf = None
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
seed = 1234
random.se... | true | true |
f7f1403ecdbfd3c917f18b22b147ae420cf8970b | 1,819 | py | Python | tests/trainer/flags/test_check_val_every_n_epoch.py | KyleGoyette/pytorch-lightning | d6470bf1937e51e037a7f94a55ad76898e5ae103 | [
"Apache-2.0"
] | 3 | 2021-04-09T14:03:03.000Z | 2021-04-10T02:58:23.000Z | tests/trainer/flags/test_check_val_every_n_epoch.py | KyleGoyette/pytorch-lightning | d6470bf1937e51e037a7f94a55ad76898e5ae103 | [
"Apache-2.0"
] | null | null | null | tests/trainer/flags/test_check_val_every_n_epoch.py | KyleGoyette/pytorch-lightning | d6470bf1937e51e037a7f94a55ad76898e5ae103 | [
"Apache-2.0"
] | 1 | 2021-09-16T15:14:11.000Z | 2021-09-16T15:14:11.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.685185 | 100 | 0.713579 |
import pytest
from pytorch_lightning.trainer import Trainer
from pytorch_lightning.trainer.states import TrainerState
from tests.helpers import BoringModel
@pytest.mark.parametrize(
'max_epochs,expected_val_loop_calls,expected_val_batches', [
(1, 0, [0]),
(4, 2, [0, 2, 0, 2]),
... | true | true |
f7f141c5656fe6aaf0b12d41b5b35ee58651f873 | 167 | py | Python | smallscript.py | Pgaskins/mycode.py | ba5bbe5a6bb727d535ff5c984f7e6ac9429bbf24 | [
"MIT"
] | null | null | null | smallscript.py | Pgaskins/mycode.py | ba5bbe5a6bb727d535ff5c984f7e6ac9429bbf24 | [
"MIT"
] | null | null | null | smallscript.py | Pgaskins/mycode.py | ba5bbe5a6bb727d535ff5c984f7e6ac9429bbf24 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
This is the pylint best practices
"""
def main():
""" Our main Program"""
mynote = 'print this string'
print(mynote)
main()
| 16.7 | 33 | 0.60479 |
def main():
mynote = 'print this string'
print(mynote)
main()
| true | true |
f7f143642d96b6c83ffa8cc183b944f9ee509f5a | 13,169 | py | Python | ml_studio/services/validation/builders/canvas.py | john-james-ai/ml-studio | 2230fcd6579d2291c761e559ec93b18ddd7a96e6 | [
"BSD-3-Clause"
] | 1 | 2020-01-30T09:37:00.000Z | 2020-01-30T09:37:00.000Z | ml_studio/services/validation/builders/canvas.py | john-james-ai/ml-studio | 2230fcd6579d2291c761e559ec93b18ddd7a96e6 | [
"BSD-3-Clause"
] | 3 | 2019-12-05T19:37:59.000Z | 2020-03-31T05:49:53.000Z | ml_studio/services/validation/builders/canvas.py | john-james-ai/ml-studio | 2230fcd6579d2291c761e559ec93b18ddd7a96e6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# =========================================================================== #
# VALIDATION: BUILDERS #
# =========================================================================== #
# =======================================================... | 40.645062 | 98 | 0.678639 |
from abc import ABC, abstractmethod, abstractproperty
import builtins
from collections.abc import Iterable, Iterator
from datetime import datetime
import getpass
import textwrap
import time
from uuid import uuid4
import numpy as np
import pandas as pd
from ml_studio.utils.misc import format_text
from ml_studio.visu... | true | true |
f7f143b78f6baa6b5e2a5bcf3f29e70894cb9263 | 17,327 | py | Python | kanban/lib/python2.7/site-packages/django/contrib/auth/hashers.py | ecrespo/django_kanban-agile | 2601410d911d8822eb485e761e150dfcefaf0655 | [
"MIT"
] | 39 | 2016-12-05T14:36:37.000Z | 2021-07-29T18:22:34.000Z | kanban/lib/python2.7/site-packages/django/contrib/auth/hashers.py | ecrespo/django_kanban-agile | 2601410d911d8822eb485e761e150dfcefaf0655 | [
"MIT"
] | 68 | 2016-12-12T20:38:47.000Z | 2020-07-26T18:28:49.000Z | kanban/lib/python2.7/site-packages/django/contrib/auth/hashers.py | ecrespo/django_kanban-agile | 2601410d911d8822eb485e761e150dfcefaf0655 | [
"MIT"
] | 120 | 2016-08-18T14:53:03.000Z | 2020-06-16T13:27:20.000Z | from __future__ import unicode_literals
import base64
import binascii
import hashlib
import importlib
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import receiver
from d... | 33.710117 | 106 | 0.653893 | from __future__ import unicode_literals
import base64
import binascii
import hashlib
import importlib
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import receiver
from d... | true | true |
f7f14425e16e9236508d3b0cf28177422805a79f | 3,567 | py | Python | scripts/check-tests.py | Luthaf/Chemharp.f03 | 75c94d8ff58d192107037d32974c5e96d619ec53 | [
"BSD-3-Clause"
] | 1 | 2022-03-21T05:04:25.000Z | 2022-03-21T05:04:25.000Z | scripts/check-tests.py | Luthaf/Chemharp.f03 | 75c94d8ff58d192107037d32974c5e96d619ec53 | [
"BSD-3-Clause"
] | 4 | 2015-10-08T18:51:04.000Z | 2018-09-13T14:16:01.000Z | scripts/check-tests.py | Luthaf/Chemharp.f03 | 75c94d8ff58d192107037d32974c5e96d619ec53 | [
"BSD-3-Clause"
] | 3 | 2017-10-23T18:24:02.000Z | 2022-03-21T05:04:28.000Z | #!/usr/bin/env python
# coding=utf-8
"""
This script check that all the functions are effectively tested. It does so by
reading the tests and parsing declarations to get the variables types.
This script is not robust, and can not parse all fortran declarations, but
should be good enough for our usage.
"""
import sys
i... | 33.971429 | 78 | 0.474348 |
import sys
import os
import re
from functions import all_functions
ERROR = False
ROOT = os.path.join(os.path.dirname(__file__), "..")
VARIABLE_DECLARATION = re.compile(r"type\((.*?)\) :: (.*)")
TYPE_BOUND_SUBROUTINE = re.compile(r"call (.*?)\%(.*?)\(.*status=status\)")
FREE_SUBROUTINE = re.compile(r"call (.*?)\%(... | true | true |
f7f146266d12b96fd4e5f0f55b66758655f38792 | 89 | py | Python | azblobexplorer/__init__.py | akshaybabloo/azure-blob-explorer-python | ef28e8ac44984629276001803b763855ffd9209e | [
"MIT"
] | null | null | null | azblobexplorer/__init__.py | akshaybabloo/azure-blob-explorer-python | ef28e8ac44984629276001803b763855ffd9209e | [
"MIT"
] | 23 | 2019-05-06T07:10:27.000Z | 2021-06-25T15:19:06.000Z | azblobexplorer/__init__.py | akshaybabloo/azure-blob-explorer-python | ef28e8ac44984629276001803b763855ffd9209e | [
"MIT"
] | 1 | 2019-06-10T23:56:47.000Z | 2019-06-10T23:56:47.000Z | from .delete import *
from .download import *
from .upload import *
__version__ = "2.0"
| 14.833333 | 23 | 0.707865 | from .delete import *
from .download import *
from .upload import *
__version__ = "2.0"
| true | true |
f7f1464000e18fed759b53d82c0c419935b3e977 | 33 | py | Python | interpret/__init__.py | haochunchang/explain-ECG-diagnosis | 6799ad38a71e2392192919d123548bdce5059541 | [
"MIT"
] | null | null | null | interpret/__init__.py | haochunchang/explain-ECG-diagnosis | 6799ad38a71e2392192919d123548bdce5059541 | [
"MIT"
] | null | null | null | interpret/__init__.py | haochunchang/explain-ECG-diagnosis | 6799ad38a71e2392192919d123548bdce5059541 | [
"MIT"
] | 1 | 2022-02-07T20:03:11.000Z | 2022-02-07T20:03:11.000Z | from .Explainer import Explainer
| 16.5 | 32 | 0.848485 | from .Explainer import Explainer
| true | true |
f7f146a0ea565677587c67d1454f5a5def62448c | 935 | py | Python | greedy.py | Nelias/CS50-pset6 | 645a9cceabb08cc674ee84a0294380777f0b55b9 | [
"BSD-3-Clause"
] | null | null | null | greedy.py | Nelias/CS50-pset6 | 645a9cceabb08cc674ee84a0294380777f0b55b9 | [
"BSD-3-Clause"
] | null | null | null | greedy.py | Nelias/CS50-pset6 | 645a9cceabb08cc674ee84a0294380777f0b55b9 | [
"BSD-3-Clause"
] | null | null | null | import sys
import math
def main():
change_owed = float(input("How much change is owed?: "))
while change_owed < 0:
change_owed = float(input("How much change is owed?: "))
greed(change_owed)
return(0)
def greed(y): # a function that calculates and prints the number of coins owe... | 24.605263 | 100 | 0.634225 | import sys
import math
def main():
change_owed = float(input("How much change is owed?: "))
while change_owed < 0:
change_owed = float(input("How much change is owed?: "))
greed(change_owed)
return(0)
def greed(y):
change_in_cents = round(y*100)
owed_coins = 0
... | true | true |
f7f147e4ab3150ea92c449cb8c138416caa89095 | 5,887 | py | Python | hand_eye_calibration/bin/tf_to_csv.py | MatthewRicks/hand_eye_calibration | 1454db380aee79139cae185d288d7450dedf52e4 | [
"BSD-3-Clause"
] | null | null | null | hand_eye_calibration/bin/tf_to_csv.py | MatthewRicks/hand_eye_calibration | 1454db380aee79139cae185d288d7450dedf52e4 | [
"BSD-3-Clause"
] | null | null | null | hand_eye_calibration/bin/tf_to_csv.py | MatthewRicks/hand_eye_calibration | 1454db380aee79139cae185d288d7450dedf52e4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import argparse
import math
import sys
import time
import numpy as np
import rosbag
import rospy
import tf
from tf2_msgs.msg import TFMessage
import warnings
import tf.transformations as tfs
def write_transformation_to_csv_file(bag_file, target_frame, source_frame,
... | 39.246667 | 110 | 0.602344 |
import argparse
import math
import sys
import time
import numpy as np
import rosbag
import rospy
import tf
from tf2_msgs.msg import TFMessage
import warnings
import tf.transformations as tfs
def write_transformation_to_csv_file(bag_file, target_frame, source_frame,
csv_file_na... | true | true |
f7f14857c271dc6ae01b5502a8085297322a1943 | 8,428 | py | Python | scrape.py | lvillis/telegram-bot-api-spec | c171d76b0b95c150c6a28f4255a906881b74c397 | [
"MIT"
] | null | null | null | scrape.py | lvillis/telegram-bot-api-spec | c171d76b0b95c150c6a28f4255a906881b74c397 | [
"MIT"
] | null | null | null | scrape.py | lvillis/telegram-bot-api-spec | c171d76b0b95c150c6a28f4255a906881b74c397 | [
"MIT"
] | null | null | null | import json
import re
import string
from typing import List, Dict
import requests
from bs4 import BeautifulSoup
TG_CORE_TYPES = ["String", "Boolean", "Integer", "Float"]
API_URL = "https://core.telegram.org/bots/api"
METHODS = "methods"
TYPES = "types"
def retrieve_api_info() -> Dict:
r = requests.get(API_URL)... | 32.045627 | 109 | 0.562055 | import json
import re
import string
from typing import List, Dict
import requests
from bs4 import BeautifulSoup
TG_CORE_TYPES = ["String", "Boolean", "Integer", "Float"]
API_URL = "https://core.telegram.org/bots/api"
METHODS = "methods"
TYPES = "types"
def retrieve_api_info() -> Dict:
r = requests.get(API_URL)... | true | true |
f7f148da6d6e94f61fcc9d4c82f941fa7a140b99 | 140 | py | Python | videotime/semantic_extractors/image_extractor.py | curlG0/videotime | 4eba44d148ba2d11f9bf2e9ba3ea9a3ecac70721 | [
"MIT"
] | null | null | null | videotime/semantic_extractors/image_extractor.py | curlG0/videotime | 4eba44d148ba2d11f9bf2e9ba3ea9a3ecac70721 | [
"MIT"
] | 1 | 2020-01-21T21:58:14.000Z | 2020-01-21T21:58:14.000Z | videotime/semantic_extractors/image_extractor.py | curlG0/videotime | 4eba44d148ba2d11f9bf2e9ba3ea9a3ecac70721 | [
"MIT"
] | 1 | 2020-01-15T23:25:51.000Z | 2020-01-15T23:25:51.000Z | from videotime.self_critical.wrapper_single_image import analyze_image
def extract(image_file: str):
return analyze_image(image_file)
| 20 | 70 | 0.835714 | from videotime.self_critical.wrapper_single_image import analyze_image
def extract(image_file: str):
return analyze_image(image_file)
| true | true |
f7f148e31d29779822f9a6627c5c8756556d980a | 715 | py | Python | tests/test_pgtest.py | aiidateam/pgsu | 2149c6f73343cc30fb72ae7ef1cc1bfb703ac334 | [
"MIT"
] | null | null | null | tests/test_pgtest.py | aiidateam/pgsu | 2149c6f73343cc30fb72ae7ef1cc1bfb703ac334 | [
"MIT"
] | 11 | 2020-04-05T18:24:46.000Z | 2021-08-31T08:41:52.000Z | tests/test_pgtest.py | ltalirz/pgsu | 17c2c5472223235225e5a753f70e03fb9cda2cac | [
"MIT"
] | 1 | 2020-11-02T19:19:34.000Z | 2020-11-02T19:19:34.000Z | # -*- coding: utf-8 -*-
"""Test compatibility with pgtest.
"""
from pgtest.pgtest import PGTest, which
import pytest
from pgsu import PGSU, PostgresConnectionMode
try:
PG_CTL = which('pg_ctl')
except FileNotFoundError:
PG_CTL = None
@pytest.mark.skipif(not PG_CTL, reason='pg_ctl not found in PATH')
def test_... | 27.5 | 69 | 0.692308 |
from pgtest.pgtest import PGTest, which
import pytest
from pgsu import PGSU, PostgresConnectionMode
try:
PG_CTL = which('pg_ctl')
except FileNotFoundError:
PG_CTL = None
@pytest.mark.skipif(not PG_CTL, reason='pg_ctl not found in PATH')
def test_pgtest_compatibility():
with PGTest() as cluster:
... | true | true |
f7f149803f104be5423c02ef19e6c6fa943093b0 | 953 | py | Python | common.py | jeffdshen/oneshotNN | d50be01032336a17e07b80752bbdd7a8d716b0ab | [
"MIT"
] | null | null | null | common.py | jeffdshen/oneshotNN | d50be01032336a17e07b80752bbdd7a8d716b0ab | [
"MIT"
] | null | null | null | common.py | jeffdshen/oneshotNN | d50be01032336a17e07b80752bbdd7a8d716b0ab | [
"MIT"
] | null | null | null | from abc import abstractmethod
from abc import ABCMeta
import prettytensor as pt
import tensorflow as tf
class Model(metaclass=ABCMeta):
def __init__(self, inputs, labels):
self.inputs = inputs
self.labels = labels
self.model = self._make(inputs, labels)
self.softmax = self.model.softmax
self.lo... | 25.078947 | 95 | 0.689402 | from abc import abstractmethod
from abc import ABCMeta
import prettytensor as pt
import tensorflow as tf
class Model(metaclass=ABCMeta):
def __init__(self, inputs, labels):
self.inputs = inputs
self.labels = labels
self.model = self._make(inputs, labels)
self.softmax = self.model.softmax
self.lo... | true | true |
f7f1499792c5e6180aaf18f04cf4bb2b8bb562e2 | 5,048 | py | Python | tests/test_search.py | realfastvla/rfpipe | 47ae24972d8aace0d44c6be2bced8b4768e5efa2 | [
"BSD-3-Clause"
] | 7 | 2019-02-21T15:49:11.000Z | 2021-04-01T17:50:58.000Z | tests/test_search.py | realfastvla/rfpipe | 47ae24972d8aace0d44c6be2bced8b4768e5efa2 | [
"BSD-3-Clause"
] | 62 | 2016-09-10T20:12:24.000Z | 2020-12-10T04:18:23.000Z | tests/test_search.py | realfastvla/rfpipe | 47ae24972d8aace0d44c6be2bced8b4768e5efa2 | [
"BSD-3-Clause"
] | 4 | 2017-10-11T20:02:43.000Z | 2021-04-01T08:13:10.000Z | from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import bytes, dict, object, range, map, input, str
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import rfpipe, rfpipe.search
import pytest
from astropy import time
im... | 34.575342 | 85 | 0.641838 | from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import bytes, dict, object, range, map, input, str
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import rfpipe, rfpipe.search
import pytest
from astropy import time
im... | true | true |
f7f14cccd21562f4c4d3965018b188376ac2bc60 | 5,873 | py | Python | pioneer/das/api/samples/annotations/box_3d.py | leddartech/pioneer.das.api | 35f2c541ea8d1768d5f4612ea8d29cb2ba8345b7 | [
"BSD-3-Clause"
] | 8 | 2021-02-19T16:24:18.000Z | 2021-10-01T17:51:22.000Z | pioneer/das/api/samples/annotations/box_3d.py | leddartech/pioneer.das.api | 35f2c541ea8d1768d5f4612ea8d29cb2ba8345b7 | [
"BSD-3-Clause"
] | 8 | 2021-02-25T08:56:37.000Z | 2021-10-20T20:58:26.000Z | pioneer/das/api/samples/annotations/box_3d.py | leddartech/pioneer.das.api | 35f2c541ea8d1768d5f4612ea8d29cb2ba8345b7 | [
"BSD-3-Clause"
] | 2 | 2021-03-01T07:47:31.000Z | 2021-07-07T20:50:27.000Z | from pioneer.common import platform, linalg, IoU3d
from pioneer.common.logging_manager import LoggingManager
from pioneer.common import platform as platform_utils
from pioneer.das.api import categories
from pioneer.das.api.samples.sample import Sample
from transforms3d import euler
import numpy as np
class Box3d(Sam... | 45.882813 | 155 | 0.610591 | from pioneer.common import platform, linalg, IoU3d
from pioneer.common.logging_manager import LoggingManager
from pioneer.common import platform as platform_utils
from pioneer.das.api import categories
from pioneer.das.api.samples.sample import Sample
from transforms3d import euler
import numpy as np
class Box3d(Sam... | true | true |
f7f14dd40242c4fa9119bd8940acfb22cfd4ca5f | 7,435 | py | Python | pkgs/ops-pkg/src/genie/libs/ops/interface/iosxr/tests/test_interface.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | null | null | null | pkgs/ops-pkg/src/genie/libs/ops/interface/iosxr/tests/test_interface.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | null | null | null | pkgs/ops-pkg/src/genie/libs/ops/interface/iosxr/tests/test_interface.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | null | null | null | # Python
import unittest
from copy import deepcopy
from unittest.mock import Mock
# ATS
from ats.topology import Device
# Genie
from genie.libs.ops.interface.iosxr.interface import Interface
from genie.libs.ops.interface.iosxr.tests.interface_output import InterfaceOutput
# nxos show_interface
from genie.libs.parser... | 40.189189 | 108 | 0.675992 |
import unittest
from copy import deepcopy
from unittest.mock import Mock
from ats.topology import Device
from genie.libs.ops.interface.iosxr.interface import Interface
from genie.libs.ops.interface.iosxr.tests.interface_output import InterfaceOutput
from genie.libs.parser.iosxr.show_interface import ShowInterfac... | true | true |
f7f14e3a2cedc0194f29c9f979f131c03c7b1752 | 747 | py | Python | profiles_api/permissions.py | kindise/profiles-rest-api | a65d4522953f862a77db712c5ae1891b5ed5ff00 | [
"MIT"
] | null | null | null | profiles_api/permissions.py | kindise/profiles-rest-api | a65d4522953f862a77db712c5ae1891b5ed5ff00 | [
"MIT"
] | null | null | null | profiles_api/permissions.py | kindise/profiles-rest-api | a65d4522953f862a77db712c5ae1891b5ed5ff00 | [
"MIT"
] | null | null | null | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
"""Allow users to edit their own profile"""
def has_object_permission(self, request, view, obj):
"""Check user is trying to edit their own profile"""
if request.method in permissions.SAFE_METHODS:
... | 33.954545 | 65 | 0.686747 | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS:
return True
return obj.id == request.user.id
class UpdateOwnStatus(permissions.BasePe... | true | true |
f7f14f224806c7b990985af97d0e154d2d9f62c2 | 2,653 | py | Python | Sepal-Width.py | darrenkeenan/Iris-Flower-Data-Set | 7c6e58d7fb2da04f3abc420b0e7bcd4330c8052e | [
"Apache-2.0"
] | null | null | null | Sepal-Width.py | darrenkeenan/Iris-Flower-Data-Set | 7c6e58d7fb2da04f3abc420b0e7bcd4330c8052e | [
"Apache-2.0"
] | null | null | null | Sepal-Width.py | darrenkeenan/Iris-Flower-Data-Set | 7c6e58d7fb2da04f3abc420b0e7bcd4330c8052e | [
"Apache-2.0"
] | null | null | null | # Calculating min & max sepal width per species of iris data set
# Darren Keenan - finalized 2018-04-29
columnname = "Sepal Width", "Species/Class" # naming two columns
print(columnname) # printing named columns
with open("data/iris.csv") as iris: ... | 75.8 | 197 | 0.571052 |
columnname = "Sepal Width", "Species/Class"
print(columnname)
with open("data/iris.csv") as iris:
for cmandname in iris:
i = cmandname.split(",")
... | true | true |
f7f14fb56f6d1ababb4f82eb8a90c7ae1651a593 | 168 | py | Python | scrapy_xlsx/__init__.py | chenyaoBOYqu/jesuslosada1 | 97587af3c6703f1375446eb3a7feeeaa45ef217a | [
"MIT"
] | 14 | 2019-12-14T02:22:58.000Z | 2022-01-12T21:24:08.000Z | scrapy_xlsx/__init__.py | chenyaoBOYqu/jesuslosada1 | 97587af3c6703f1375446eb3a7feeeaa45ef217a | [
"MIT"
] | 1 | 2022-03-02T14:58:28.000Z | 2022-03-02T14:58:28.000Z | scrapy_xlsx/__init__.py | chenyaoBOYqu/jesuslosada1 | 97587af3c6703f1375446eb3a7feeeaa45ef217a | [
"MIT"
] | 4 | 2019-11-18T09:30:47.000Z | 2022-02-20T21:59:42.000Z | from .exporters import XlsxItemExporter
__version__ = "0.1.1"
__author__ = "Jesús Losada Novo"
__license__ = "MIT"
__copyright__ = "Copyright 2019 Jesús Losada Novo"
| 21 | 50 | 0.767857 | from .exporters import XlsxItemExporter
__version__ = "0.1.1"
__author__ = "Jesús Losada Novo"
__license__ = "MIT"
__copyright__ = "Copyright 2019 Jesús Losada Novo"
| true | true |
f7f14fd160e28bed64394c612fdf5eff78214b0e | 10,730 | py | Python | tests/ut/python/dataset/test_random_horizontal_flip_bbox.py | shaolei-wang/mindspore | 2d50a43be9d17269f6adb41e51b8f7a540ebc9f1 | [
"Apache-2.0"
] | 1 | 2020-06-20T06:22:41.000Z | 2020-06-20T06:22:41.000Z | tests/ut/python/dataset/test_random_horizontal_flip_bbox.py | shaolei-wang/mindspore | 2d50a43be9d17269f6adb41e51b8f7a540ebc9f1 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/dataset/test_random_horizontal_flip_bbox.py | shaolei-wang/mindspore | 2d50a43be9d17269f6adb41e51b8f7a540ebc9f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.187266 | 100 | 0.630662 |
from enum import Enum
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
import mindspore.log as logger
import mindspore.dataset as ds
import mindspore.dataset.transforms.vision.c_transforms as c_vision
GENERATE_GOLDEN = False
DATA_DIR = "../data/dataset/testVOC2012_... | true | true |
f7f14fec5baae73e83e68e66371876c06ed12e39 | 3,652 | py | Python | palette/core/palette_selection.py | tody411/PaletteSelection | 8e8f4192557dad7075f1539b0cfe816541bf9874 | [
"MIT"
] | 23 | 2015-08-25T12:31:44.000Z | 2021-12-15T03:18:12.000Z | palette/core/palette_selection.py | tody411/PaletteSelection | 8e8f4192557dad7075f1539b0cfe816541bf9874 | [
"MIT"
] | null | null | null | palette/core/palette_selection.py | tody411/PaletteSelection | 8e8f4192557dad7075f1539b0cfe816541bf9874 | [
"MIT"
] | 7 | 2017-07-27T10:57:36.000Z | 2022-02-22T06:51:44.000Z | # -*- coding: utf-8 -*-
## @package palette.core.palette_selection
#
# Implementation of automatic color palette selection.
# @author tody
# @date 2015/08/20
import os
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from palette.np.norm import normVectors
## Implementation of automatic pal... | 33.504587 | 77 | 0.672234 |
pl_toolkits.mplot3d import Axes3D
from palette.np.norm import normVectors
f __init__(self, color_coordinates, color_densities, rgb_colors,
num_colors=7, sigma=70.0):
self._color_coordinates = color_coordinates
self._color_densities = color_densities
self._rgb_colors = rgb_co... | true | true |
f7f1529ff3d7a82b2fb9ea17170cea8e041ff667 | 5,573 | py | Python | pibrew/main.py | MrLeeh/pibrew | a2dc764e1ebfc5945d542e8f3e3b18251223974b | [
"MIT"
] | null | null | null | pibrew/main.py | MrLeeh/pibrew | a2dc764e1ebfc5945d542e8f3e3b18251223974b | [
"MIT"
] | null | null | null | pibrew/main.py | MrLeeh/pibrew | a2dc764e1ebfc5945d542e8f3e3b18251223974b | [
"MIT"
] | null | null | null | import logging
from flask import jsonify
from flask_wtf import FlaskForm
from wtforms import DecimalField, SubmitField, StringField, BooleanField
from wtforms.validators import NumberRange, Length, InputRequired
from flask import Blueprint, render_template, redirect, url_for, request
from . import brew_controller, db
f... | 32.976331 | 79 | 0.633052 | import logging
from flask import jsonify
from flask_wtf import FlaskForm
from wtforms import DecimalField, SubmitField, StringField, BooleanField
from wtforms.validators import NumberRange, Length, InputRequired
from flask import Blueprint, render_template, redirect, url_for, request
from . import brew_controller, db
f... | true | true |
f7f152c61a8cf8b5facaa9b0f584d3fed8bcf5c4 | 454 | py | Python | Ene-Jun-2019/José Peralta/Extraordinario/Ejercicio3_creartabla.py | Andremm303/DAS_Sistemas | 0163505737e2b24365ea8b4e8135773a6801add4 | [
"MIT"
] | null | null | null | Ene-Jun-2019/José Peralta/Extraordinario/Ejercicio3_creartabla.py | Andremm303/DAS_Sistemas | 0163505737e2b24365ea8b4e8135773a6801add4 | [
"MIT"
] | null | null | null | Ene-Jun-2019/José Peralta/Extraordinario/Ejercicio3_creartabla.py | Andremm303/DAS_Sistemas | 0163505737e2b24365ea8b4e8135773a6801add4 | [
"MIT"
] | null | null | null | import sqlite3
def crear_tabla_paises(archivo_bd = 'paises.db'):
conexion = sqlite3.connect(archivo_bd)
cursor = conexion.cursor()
cursor.execute('''CREATE TABLE Paises (
Nombre STRING PRIMARY KEY,
Lenguajes STRING,
Continente STRING,
Capital STRING,
Zona STRING)... | 22.7 | 50 | 0.625551 | import sqlite3
def crear_tabla_paises(archivo_bd = 'paises.db'):
conexion = sqlite3.connect(archivo_bd)
cursor = conexion.cursor()
cursor.execute('''CREATE TABLE Paises (
Nombre STRING PRIMARY KEY,
Lenguajes STRING,
Continente STRING,
Capital STRING,
Zona STRING)... | true | true |
f7f15304d0c65e9583a8c7ba290ad22c475036b8 | 2,523 | py | Python | acceptability/modules/early_stopping.py | nyu-mll/CoLA-baselines | dd095d3646ed05a315280aaa8ed4ec84ba435b3e | [
"MIT"
] | 54 | 2018-05-31T22:57:28.000Z | 2022-03-17T13:25:49.000Z | acceptability/modules/early_stopping.py | nyu-mll/CoLA-baselines | dd095d3646ed05a315280aaa8ed4ec84ba435b3e | [
"MIT"
] | 4 | 2018-06-06T14:15:10.000Z | 2020-08-07T16:35:50.000Z | acceptability/modules/early_stopping.py | nyu-mll/CoLA-baselines | dd095d3646ed05a315280aaa8ed4ec84ba435b3e | [
"MIT"
] | 18 | 2018-07-10T12:18:17.000Z | 2022-03-02T22:19:22.000Z | from __future__ import print_function
import os
import numpy as np
import torch
from acceptability.utils import Checkpoint
class EarlyStopping:
"""
Provides early stopping functionality. Keeps track of model metrics,
and if it doesn't improve over time restores last best performing
parameters.
""... | 32.346154 | 88 | 0.613555 | from __future__ import print_function
import os
import numpy as np
import torch
from acceptability.utils import Checkpoint
class EarlyStopping:
def __init__(self, model: torch.nn.Module, checkpoint_instance: Checkpoint,
patience=100, minimize=False):
self.minimize = minimize
sel... | true | true |
f7f1538b2df73e22f99b2eec1d97e3a8ab46cb67 | 3,902 | py | Python | views/sprite_views/movement_sprite.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | 1 | 2020-08-03T07:54:59.000Z | 2020-08-03T07:54:59.000Z | views/sprite_views/movement_sprite.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | null | null | null | views/sprite_views/movement_sprite.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | null | null | null | from enum import Enum
from functools import reduce
from views.sprite_views.animated_sprite import AnimatedSprite, Update_Type
class State(Enum):
STANDING = 1
WALKING = 2
RUNNING = 3
ATTACK = 4
RUNNING_ATTACK = 5
BEATEN = 6
FALL_TO_DEAD = 7
DEAD = 8
class Direction(Enum):
RIGHT =... | 29.560606 | 96 | 0.602255 | from enum import Enum
from functools import reduce
from views.sprite_views.animated_sprite import AnimatedSprite, Update_Type
class State(Enum):
STANDING = 1
WALKING = 2
RUNNING = 3
ATTACK = 4
RUNNING_ATTACK = 5
BEATEN = 6
FALL_TO_DEAD = 7
DEAD = 8
class Direction(Enum):
RIGHT =... | true | true |
f7f15441b2e2f80b332bb865c559243d9175e040 | 1,171 | py | Python | contrib/ACE2P/utils/palette.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 56 | 2021-01-31T02:19:12.000Z | 2022-03-12T12:39:21.000Z | contrib/ACE2P/utils/palette.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-07-21T02:36:01.000Z | 2021-07-21T02:37:45.000Z | contrib/ACE2P/utils/palette.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2021-02-03T11:18:36.000Z | 2022-03-07T08:18:53.000Z | ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: RainbowSecret
## Microsoft Research
## yuyua@microsoft.com
## Copyright (c) 2018
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##++++++++++++... | 29.275 | 75 | 0.475662 | i = 0
while lab:
palette[j * 3 + 0] |= (((lab >> 0) & 1) << (7 - i))
palette[j * 3 + 1] |= (((lab >> 1) & 1) << (7 - i))
palette[j * 3 + 2] |= (((lab >> 2) & 1) << (7 - i))
i += 1
lab >>= 3
return palette
| true | true |
f7f154f9bb488c4ef865226ae9ae3933519f6ff9 | 366 | py | Python | djangular/scrumboard/serializers.py | suryamurugan/SCRUMBAORD-APP | 2ac2bfef331b8a53fe417afcfaf42718b2664be6 | [
"MIT"
] | null | null | null | djangular/scrumboard/serializers.py | suryamurugan/SCRUMBAORD-APP | 2ac2bfef331b8a53fe417afcfaf42718b2664be6 | [
"MIT"
] | null | null | null | djangular/scrumboard/serializers.py | suryamurugan/SCRUMBAORD-APP | 2ac2bfef331b8a53fe417afcfaf42718b2664be6 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import List, Card
class CardSerializer(serializers.ModelSerializer):
class Meta:
model = Card
fields = '__all__'
class ListSerializer(serializers.ModelSerializer):
cards = CardSerializer(read_only=True, many=True)
class Meta:
... | 15.25 | 53 | 0.685792 | from rest_framework import serializers
from .models import List, Card
class CardSerializer(serializers.ModelSerializer):
class Meta:
model = Card
fields = '__all__'
class ListSerializer(serializers.ModelSerializer):
cards = CardSerializer(read_only=True, many=True)
class Meta:
... | true | true |
f7f155184f5ff585b1f7d0bfbea345bcfe6f500a | 731 | py | Python | pymaclab/filters/cffilter.py | radovankavicky/pymaclab | 21da758f64ed0b62969c9289576f677e977cfd98 | [
"Apache-2.0"
] | 96 | 2015-01-25T05:59:56.000Z | 2021-12-29T14:05:22.000Z | pymaclab/filters/cffilter.py | 1zinnur9/pymaclab | 21da758f64ed0b62969c9289576f677e977cfd98 | [
"Apache-2.0"
] | 3 | 2015-12-17T19:25:46.000Z | 2018-06-19T07:05:20.000Z | pymaclab/filters/cffilter.py | 1zinnur9/pymaclab | 21da758f64ed0b62969c9289576f677e977cfd98 | [
"Apache-2.0"
] | 36 | 2016-01-31T15:22:01.000Z | 2021-03-29T07:03:07.000Z | from pymaclab.filters._cffilter import cffilter as cff
import numpy as np
def cffilter(data=None,low=6,high=32,drift=True):
if type(data) == type(np.matlib.matrix([1,2,3])) and len(data.shape) == 2:
if data.shape[0] < data.shape[1]: data = data.__array__().T
else: data = data.__array__()
elif t... | 45.6875 | 78 | 0.611491 | from pymaclab.filters._cffilter import cffilter as cff
import numpy as np
def cffilter(data=None,low=6,high=32,drift=True):
if type(data) == type(np.matlib.matrix([1,2,3])) and len(data.shape) == 2:
if data.shape[0] < data.shape[1]: data = data.__array__().T
else: data = data.__array__()
elif t... | true | true |
f7f157f44d11faa49cc709064083e10b480ddb38 | 76,010 | py | Python | sdks/python/apache_beam/transforms/ptransform_test.py | ravwojdyla/beam | fbcde4cdc7d68de8734bf540c079b2747631a854 | [
"Apache-2.0"
] | 1 | 2020-07-14T16:30:12.000Z | 2020-07-14T16:30:12.000Z | sdks/python/apache_beam/transforms/ptransform_test.py | kavyasmj/beam0.6 | d59dfeb339bd56feb7569531e5c421a297b0d3dc | [
"Apache-2.0"
] | 2 | 2017-04-24T20:32:25.000Z | 2022-03-29T12:59:55.000Z | sdks/python/apache_beam/transforms/ptransform_test.py | kavyasmj/beam0.6 | d59dfeb339bd56feb7569531e5c421a297b0d3dc | [
"Apache-2.0"
] | 2 | 2019-03-04T02:12:46.000Z | 2021-08-10T20:29:37.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 39.140062 | 80 | 0.632535 |
"""Unit tests for the PTransform and descendants."""
from __future__ import absolute_import
import operator
import re
import unittest
import hamcrest as hc
from nose.plugins.attrib import attr
import apache_beam as beam
from apache_beam.test_pipeline import TestPipeline
import apache_beam.pvalue as... | false | true |
f7f15994fcef0eb714441d58bd5912711a61b3f1 | 1,109 | py | Python | src/difference_checker.py | otuva/Lecture-Sender-Bot-py | a41c143d0dbb6c93f34fc146f5ce35eeaa6bac91 | [
"MIT"
] | null | null | null | src/difference_checker.py | otuva/Lecture-Sender-Bot-py | a41c143d0dbb6c93f34fc146f5ce35eeaa6bac91 | [
"MIT"
] | null | null | null | src/difference_checker.py | otuva/Lecture-Sender-Bot-py | a41c143d0dbb6c93f34fc146f5ce35eeaa6bac91 | [
"MIT"
] | null | null | null | import notification_bot
def main():
"""checking if lectures are updated"""
# brute forced the solution it's a mess under here
# I wouldn't recommend checking it
file_path = "lectures.txt" # change this
cache_path = "cache.txt" # and this
file = open(file_path, "r")
current_length = len(f... | 27.725 | 84 | 0.622182 | import notification_bot
def main():
# I wouldn't recommend checking it
file_path = "lectures.txt"
cache_path = "cache.txt"
file = open(file_path, "r")
current_length = len(file.read())
file.close()
cache_file = open(cache_path, "r")
cache = cache_file.read().strip()
... | true | true |
f7f159d135c7dc52f4cafad36627658caf03d94b | 5,588 | py | Python | ask-sdk-model/ask_sdk_model/interfaces/amazonpay/model/v1/seller_order_attributes.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | 2 | 2021-10-30T06:52:48.000Z | 2021-11-16T12:34:16.000Z | ask-sdk-model/ask_sdk_model/interfaces/amazonpay/model/v1/seller_order_attributes.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | ask-sdk-model/ask_sdk_model/interfaces/amazonpay/model/v1/seller_order_attributes.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 42.984615 | 277 | 0.656586 |
import pprint
import re
import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
class SellerOrderAttributes(object):
deserialized_types = {
'seller_order_id': 'str',
'store_name'... | true | true |
f7f15bdbb2b950b3ab5b6baf0058c2b64362edd0 | 10,251 | py | Python | reana_server/rest/users.py | VMois/reana-server | b666bfa0edbf18bc6bf26e0dd63c82e89c76aa1f | [
"MIT"
] | null | null | null | reana_server/rest/users.py | VMois/reana-server | b666bfa0edbf18bc6bf26e0dd63c82e89c76aa1f | [
"MIT"
] | null | null | null | reana_server/rest/users.py | VMois/reana-server | b666bfa0edbf18bc6bf26e0dd63c82e89c76aa1f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018, 2019, 2020, 2021 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Reana-Server User Endpoints."""
import logging
import traceback
from br... | 31.158055 | 81 | 0.446395 |
import logging
import traceback
from bravado.exception import HTTPError
from flask import Blueprint, jsonify
from reana_db.models import AuditLogAction
from reana_commons.email import send_email
from reana_commons.errors import REANAEmailNotificationError
from reana_server import __version__
from reana_serve... | true | true |
f7f15c3ccd8f4596ec4853297b3850ac24b4853b | 2,225 | py | Python | tensorflow/lite/testing/op_tests/embedding_lookup.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/lite/testing/op_tests/embedding_lookup.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/lite/testing/op_tests/embedding_lookup.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.035088 | 80 | 0.664719 |
import tensorflow.compat.v1 as tf
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
from tensorflow.lite.testing.zip_test_utils import register_make_test_function
@register_make_test_function()
def make_embedding_lo... | true | true |
f7f15dcf4b3f8bd8d5bb5514997cb9ce1d45bc42 | 1,807 | py | Python | Reflection_symmetry_axes_detection/DNet/code/libs/load_model.py | dongkwonjin/Semantic-Line-DRM | 0f20ca85ca80bc9e7c9157932343dfad6f7fdbd5 | [
"MIT"
] | 31 | 2020-08-13T04:34:10.000Z | 2022-03-30T17:56:06.000Z | Reflection_symmetry_axes_detection/DNet/code/libs/load_model.py | dongkwonjin/Semantic-Line-DRM | 0f20ca85ca80bc9e7c9157932343dfad6f7fdbd5 | [
"MIT"
] | null | null | null | Reflection_symmetry_axes_detection/DNet/code/libs/load_model.py | dongkwonjin/Semantic-Line-DRM | 0f20ca85ca80bc9e7c9157932343dfad6f7fdbd5 | [
"MIT"
] | 2 | 2020-11-25T10:44:56.000Z | 2021-03-03T08:15:57.000Z | import torch
from networks.detector import DNet
from networks.loss import *
def load_DNet_for_test(cfg, dict_DB):
if cfg.run_mode == 'test_paper':
checkpoint = torch.load(cfg.paper_weight_dir + 'checkpoint_DNet_paper')
else:
# select ckpt from output_dir
checkpoint = torch.load(cfg.wei... | 35.431373 | 88 | 0.568899 | import torch
from networks.detector import DNet
from networks.loss import *
def load_DNet_for_test(cfg, dict_DB):
if cfg.run_mode == 'test_paper':
checkpoint = torch.load(cfg.paper_weight_dir + 'checkpoint_DNet_paper')
else:
checkpoint = torch.load(cfg.weight_dir + '')
model = D... | true | true |
f7f15e2d7325219161153d5165741493a537f886 | 1,596 | py | Python | dj_diabetes/forms/appointments.py | foxmask/dj-diabetes | f19487cb1d4a251f03c1ba3772a01d7666b194a4 | [
"BSD-3-Clause"
] | 57 | 2015-10-30T17:09:25.000Z | 2022-02-21T01:25:08.000Z | dj_diabetes/forms/appointments.py | shuvro-zz/dj-diabetes | 999f55421b2ca9e4170df1f1c974393f657e9b53 | [
"BSD-3-Clause"
] | 11 | 2015-04-09T19:33:04.000Z | 2018-01-26T10:33:47.000Z | dj_diabetes/forms/appointments.py | foxmask/dj-diabetes | f19487cb1d4a251f03c1ba3772a01d7666b194a4 | [
"BSD-3-Clause"
] | 14 | 2016-04-04T21:05:17.000Z | 2022-02-15T07:20:06.000Z | # coding: utf-8
from dj_diabetes.models.appointments import Appointments
from django import forms
class AppointmentsForm(forms.ModelForm):
"""
Appointments Form
"""
# to " suit " the HTML textearea
title = forms.CharField(widget=forms.TextInput(
attrs={'class': 'form-control'}))
b... | 40.923077 | 79 | 0.64787 |
from dj_diabetes.models.appointments import Appointments
from django import forms
class AppointmentsForm(forms.ModelForm):
title = forms.CharField(widget=forms.TextInput(
attrs={'class': 'form-control'}))
body = forms.CharField(widget=forms.Textarea(
attrs={'class': 'form-control', 'row... | true | true |
f7f15f117b0f1cfb48980cd50e8b0c3050ce5beb | 4,556 | py | Python | numcodecs/compat.py | Czaki/numcodecs | 673b7b4f2ae5b15a624404e65fbed9704ebf6fc5 | [
"MIT"
] | 1 | 2020-12-22T08:50:25.000Z | 2020-12-22T08:50:25.000Z | numcodecs/compat.py | Czaki/numcodecs | 673b7b4f2ae5b15a624404e65fbed9704ebf6fc5 | [
"MIT"
] | 2 | 2020-05-21T00:16:45.000Z | 2020-05-28T15:56:51.000Z | numcodecs/compat.py | Czaki/numcodecs | 673b7b4f2ae5b15a624404e65fbed9704ebf6fc5 | [
"MIT"
] | null | null | null | # flake8: noqa
import sys
import codecs
import array
from functools import reduce
import numpy as np
def ensure_ndarray(buf):
"""Convenience function to coerce `buf` to a numpy array, if it is not already a
numpy array.
Parameters
----------
buf : array-like or bytes-like
A numpy array o... | 27.95092 | 89 | 0.648376 |
import sys
import codecs
import array
from functools import reduce
import numpy as np
def ensure_ndarray(buf):
if isinstance(buf, np.ndarray):
arr = buf
elif isinstance(buf, array.array) and buf.typecode in 'cu':
raise TypeError('array.array with char or... | true | true |
f7f15f95272ae3e36203fa79774894513f30cb28 | 6,533 | py | Python | scripts/model/rf.py | dimang777/CalorieEstimator | f4be77e789790785ba9394e4e66e5a18a678b0be | [
"Apache-2.0"
] | null | null | null | scripts/model/rf.py | dimang777/CalorieEstimator | f4be77e789790785ba9394e4e66e5a18a678b0be | [
"Apache-2.0"
] | null | null | null | scripts/model/rf.py | dimang777/CalorieEstimator | f4be77e789790785ba9394e4e66e5a18a678b0be | [
"Apache-2.0"
] | null | null | null | import time
import pickle
from sklearn.metrics import accuracy_score
import numpy as np
from sklearn.model_selection import RandomizedSearchCV
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier
###########################################################################... | 34.935829 | 79 | 0.514006 | import time
import pickle
from sklearn.metrics import accuracy_score
import numpy as np
from sklearn.model_selection import RandomizedSearchCV
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier
| true | true |
f7f16010aa730f0c93988b9fa89ae2a45844f905 | 340 | py | Python | optimade/server/mappers/structures.py | CasperWA/optimade-python-tools | 3bde2a01e2af468bbac054d63acb237e17ed63f4 | [
"MIT"
] | null | null | null | optimade/server/mappers/structures.py | CasperWA/optimade-python-tools | 3bde2a01e2af468bbac054d63acb237e17ed63f4 | [
"MIT"
] | 13 | 2020-06-15T05:46:12.000Z | 2020-07-03T23:03:29.000Z | optimade/server/mappers/structures.py | CasperWA/optimade-python-tools | 3bde2a01e2af468bbac054d63acb237e17ed63f4 | [
"MIT"
] | null | null | null | from .entries import BaseResourceMapper
__all__ = ("StructureMapper",)
class StructureMapper(BaseResourceMapper):
ENDPOINT = "structures"
LENGTH_ALIASES = (
("elements", "nelements"),
("element_ratios", "nelements"),
("cartesian_site_positions", "nsites"),
("species_at_sites... | 21.25 | 47 | 0.644118 | from .entries import BaseResourceMapper
__all__ = ("StructureMapper",)
class StructureMapper(BaseResourceMapper):
ENDPOINT = "structures"
LENGTH_ALIASES = (
("elements", "nelements"),
("element_ratios", "nelements"),
("cartesian_site_positions", "nsites"),
("species_at_sites... | true | true |
f7f163a414b1d5a448b0ebd07c6839f4483bc0d3 | 1,797 | py | Python | qiskit/pulse/library/sample_pulse.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/pulse/library/sample_pulse.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/pulse/library/sample_pulse.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# 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 modif... | 39.065217 | 89 | 0.667223 |
import warnings
from typing import Union, List, Optional
import numpy as np
from .waveform import Waveform
class SamplePulse(Waveform):
def __init__(self, samples: Union[np.ndarray, List[complex]],
name: Optional[str] = None,
epsilon: float = 1e-7):
warnin... | true | true |
f7f16485084b6fc8f038c7855a34148a817a1058 | 3,653 | py | Python | py/test/pytests/keyboard_smt.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/test/pytests/keyboard_smt.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/test/pytests/keyboard_smt.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | # Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests keyboard pin connectivity in SMT factory test.
Unlike keyboard test, it only expects a key sequence where keys are the keyboard
scan lines' row-... | 35.466019 | 80 | 0.705721 |
from cros.factory.test.fixture import bft_fixture
from cros.factory.test import session
from cros.factory.test import test_case
from cros.factory.test.utils import evdev_utils
from cros.factory.utils.arg_utils import Arg
from cros.factory.external import evdev
class KeyboardSMTTest(test_case.TestCase):
ARGS =... | true | true |
f7f164c3155239fc7c74227edb7466565722bf93 | 1,279 | py | Python | src/models.py | savyasachi16/CVE-data-model | 827a857dcce562b21bebb52825942ea0e939c5e3 | [
"Apache-2.0"
] | null | null | null | src/models.py | savyasachi16/CVE-data-model | 827a857dcce562b21bebb52825942ea0e939c5e3 | [
"Apache-2.0"
] | 1 | 2020-04-25T20:35:24.000Z | 2020-04-25T20:35:24.000Z | src/models.py | savyasachi16/CVE-data-model | 827a857dcce562b21bebb52825942ea0e939c5e3 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Date, Float, ForeignKey
Base = declarative_base()
class CVE(Base):
__tablename__ = "cves"
cve_id = Column(String, primary_key=True)
description = Column(String)
base_score_v2 = Column(Float)
ba... | 34.567568 | 250 | 0.695856 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Date, Float, ForeignKey
Base = declarative_base()
class CVE(Base):
__tablename__ = "cves"
cve_id = Column(String, primary_key=True)
description = Column(String)
base_score_v2 = Column(Float)
ba... | true | true |
f7f165c85189c3916106eba7446bf3552eb00ea1 | 230 | py | Python | examples/pylab_examples/print_stdout.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-04-15T09:40:53.000Z | 2019-04-15T09:40:53.000Z | examples/pylab_examples/print_stdout.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | 2 | 2021-05-10T17:57:41.000Z | 2021-07-26T16:23:09.000Z | examples/pylab_examples/print_stdout.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2015-12-21T07:24:54.000Z | 2015-12-21T07:24:54.000Z | #!/usr/bin/env python
# -*- noplot -*-
# print png to standard out
# usage: python print_stdout.py > somefile.png
import sys
import matplotlib
matplotlib.use('Agg')
from pylab import *
plot([1, 2, 3])
savefig(sys.stdout)
show()
| 16.428571 | 46 | 0.7 |
import sys
import matplotlib
matplotlib.use('Agg')
from pylab import *
plot([1, 2, 3])
savefig(sys.stdout)
show()
| true | true |
f7f16657ae4aa499e8ac510ce0b699da0898cc91 | 1,096 | py | Python | src/preprocess_vacancy.py | danilpolkov/jooble | 0f29498bc9bdd76179695886024207079f07dacf | [
"MIT"
] | null | null | null | src/preprocess_vacancy.py | danilpolkov/jooble | 0f29498bc9bdd76179695886024207079f07dacf | [
"MIT"
] | null | null | null | src/preprocess_vacancy.py | danilpolkov/jooble | 0f29498bc9bdd76179695886024207079f07dacf | [
"MIT"
] | null | null | null | import pandas as pd
from pathlib import Path
import sys
import datetime
PATH = '/Users/danil/Documents/github/jooble'
sys.path.append(str(PATH))
from src.jooble import prepare_csv, preprocess
start = datetime.datetime.now()
# open train dataset
train_features = prepare_csv(path = PATH + '/data/raw/train.tsv')
print... | 29.621622 | 114 | 0.780109 | import pandas as pd
from pathlib import Path
import sys
import datetime
PATH = '/Users/danil/Documents/github/jooble'
sys.path.append(str(PATH))
from src.jooble import prepare_csv, preprocess
start = datetime.datetime.now()
train_features = prepare_csv(path = PATH + '/data/raw/train.tsv')
print('train dataset shap... | true | true |
f7f1669d778e9bb8e30bc7ec4d963c03cf15fe59 | 4,599 | py | Python | vize/160401058/sunucu.py | hasan-se/blm304 | 893d15282497a426ff96b0c8b6c77d57c406742e | [
"Unlicense"
] | 2 | 2021-04-01T18:51:44.000Z | 2021-06-13T19:46:20.000Z | vize/160401058/sunucu.py | hasan-se/blm304 | 893d15282497a426ff96b0c8b6c77d57c406742e | [
"Unlicense"
] | null | null | null | vize/160401058/sunucu.py | hasan-se/blm304 | 893d15282497a426ff96b0c8b6c77d57c406742e | [
"Unlicense"
] | 1 | 2020-05-26T16:51:14.000Z | 2020-05-26T16:51:14.000Z | import os
import socket
import sys
from threading import Thread
HOST = "127.0.0.1"
#Enes Delibalta 160401058
PORT=int(input("PORT giriniz"))
def create_socket():
try:
global HOST
global PORT
global sd
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
excep... | 28.214724 | 71 | 0.455969 | import os
import socket
import sys
from threading import Thread
HOST = "127.0.0.1"
PORT=int(input("PORT giriniz"))
def create_socket():
try:
global HOST
global PORT
global sd
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error as e:
... | true | true |
f7f166b4b0856489150b31ef5556aff9b29e6bdd | 19,001 | py | Python | ibis/impala/tests/test_udf.py | joy-rosie/ibis | 67bca4e41ac6f99c8ebceedd9b0a3902f8b62b8b | [
"Apache-2.0"
] | 1 | 2021-06-15T07:28:59.000Z | 2021-06-15T07:28:59.000Z | ibis/impala/tests/test_udf.py | joy-rosie/ibis | 67bca4e41ac6f99c8ebceedd9b0a3902f8b62b8b | [
"Apache-2.0"
] | 1 | 2020-10-02T23:51:48.000Z | 2020-10-03T00:54:29.000Z | ibis/impala/tests/test_udf.py | datapythonista/ibis | d5b19398f4fdbcf33e1da88d8fcf9e34c64680b7 | [
"Apache-2.0"
] | 1 | 2020-10-01T18:48:01.000Z | 2020-10-01T18:48:01.000Z | import unittest
from decimal import Decimal
import numpy as np
import pandas as pd
import pytest
from posixpath import join as pjoin
import ibis
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.rules as rules
import ibis.expr.types as ir
import ibis.impala as api # noqa: E402
im... | 29.782132 | 78 | 0.592337 | import unittest
from decimal import Decimal
import numpy as np
import pandas as pd
import pytest
from posixpath import join as pjoin
import ibis
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.rules as rules
import ibis.expr.types as ir
import ibis.impala as api
import ibis.ut... | true | true |
f7f166e3000597fb84f4ed5de9193eea0d553e0d | 212 | py | Python | batchout/columns/base.py | ilia-khaustov/batchout | e916a1b0bfac771e6c96d0ff2478dc3f44804a94 | [
"MIT"
] | 8 | 2019-11-05T06:54:30.000Z | 2021-12-14T14:52:24.000Z | batchout/columns/base.py | ilia-khaustov/batchout | e916a1b0bfac771e6c96d0ff2478dc3f44804a94 | [
"MIT"
] | null | null | null | batchout/columns/base.py | ilia-khaustov/batchout | e916a1b0bfac771e6c96d0ff2478dc3f44804a94 | [
"MIT"
] | 1 | 2020-05-05T09:31:14.000Z | 2020-05-05T09:31:14.000Z | import abc
from batchout.extractors import Extractor
class Column(object):
@abc.abstractmethod
def value(self, extractor: Extractor, payload: bytes, **indexes: str):
raise NotImplementedError
| 19.272727 | 74 | 0.735849 | import abc
from batchout.extractors import Extractor
class Column(object):
@abc.abstractmethod
def value(self, extractor: Extractor, payload: bytes, **indexes: str):
raise NotImplementedError
| true | true |
f7f166e8e7c46f36e7939d2777399b9717bc9181 | 72,466 | py | Python | cloud/endagaweb/models.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | null | null | null | cloud/endagaweb/models.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | 3 | 2021-03-20T00:02:37.000Z | 2022-02-11T03:46:59.000Z | cloud/endagaweb/models.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | null | null | null | """Models for the endagaweb django app.
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same direct... | 40.825915 | 95 | 0.635733 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import calendar
import datetime
import decimal
import json
import logging
import time
import uuid
from django.conf import settings
from django.contrib.auth.models impor... | true | true |
f7f167de4b16a1cfe00c6a2d32cd58a628664ab9 | 3,667 | py | Python | csv_to_modelica.py | LiborKudela/pipe_physics | 73774d3d9a2fea3f253bdc9842dd899a74c03c34 | [
"MIT"
] | null | null | null | csv_to_modelica.py | LiborKudela/pipe_physics | 73774d3d9a2fea3f253bdc9842dd899a74c03c34 | [
"MIT"
] | null | null | null | csv_to_modelica.py | LiborKudela/pipe_physics | 73774d3d9a2fea3f253bdc9842dd899a74c03c34 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
def write_lookup_function(name, x_key, y_key):
code = f"""
function {name}
input Real x;
output Real y;
algorithm
for i in 1:size({x_key}, 1) loop
if {x_key}[i+1] > x then
y := {y_key}[i] + (x - {x_key}[i]) * ({y_key}[i] - {y_key}[i + 1]) / ({x_key}[i] - {x_ke... | 31.612069 | 105 | 0.477502 | import pandas as pd
import numpy as np
def write_lookup_function(name, x_key, y_key):
code = f"""
function {name}
input Real x;
output Real y;
algorithm
for i in 1:size({x_key}, 1) loop
if {x_key}[i+1] > x then
y := {y_key}[i] + (x - {x_key}[i]) * ({y_key}[i] - {y_key}[i + 1]) / ({x_key}[i] - {x_ke... | true | true |
f7f16855c752e028460508b6d2dc0846805a9607 | 9,698 | py | Python | python/tvm/script/context_maintainer.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | python/tvm/script/context_maintainer.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2,863 | 2017-08-17T19:55:50.000Z | 2019-11-04T17:18:41.000Z | python/tvm/script/context_maintainer.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.484127 | 99 | 0.611157 |
from typing import List, Mapping, Union, Optional, Dict, Callable
import synr
import tvm
from tvm.ir import Span
from tvm.ir.expr import Range
from tvm.tir import Var, Buffer, PrimExpr, Stmt, MatchBufferRegion
from tvm.runtime import Object
from tvm.tir.expr import IterVar
from .tir.node import Buffe... | true | true |
f7f1698512e2ecff7f1a908400ac8aa795a3c66f | 1,434 | py | Python | source/machine-connector/m2c2-slmp-connector/m2c2_post_handler.py | guikcd/machine-to-cloud-connectivity-framework | 83de873d4df58224f73c6263239681fdd5246186 | [
"Apache-2.0",
"MIT"
] | null | null | null | source/machine-connector/m2c2-slmp-connector/m2c2_post_handler.py | guikcd/machine-to-cloud-connectivity-framework | 83de873d4df58224f73c6263239681fdd5246186 | [
"Apache-2.0",
"MIT"
] | null | null | null | source/machine-connector/m2c2-slmp-connector/m2c2_post_handler.py | guikcd/machine-to-cloud-connectivity-framework | 83de873d4df58224f73c6263239681fdd5246186 | [
"Apache-2.0",
"MIT"
] | null | null | null | ## Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
## SPDX-License-Identifier: Apache-2.0
import json
import logging
import uuid
import datetime
from datetime import date
import greengrasssdk
import m2c2_globals as var
import m2c2_utils as utils
logger = logging.getLogger()
logger.setLevel(l... | 29.265306 | 83 | 0.626918 | rt m2c2_globals as var
import m2c2_utils as utils
logger = logging.getLogger()
logger.setLevel(logging.INFO)
iot_client = greengrasssdk.client('iot-data')
def to_user(type, job_data, msg):
job_name = utils.get_metadata("name", job_data, 0)
job_version = utils.get_metadata("version", job_data, 0)
topic =... | true | true |
f7f16bcd7a28d86c27c0a7a97dac6fac50014778 | 1,478 | py | Python | eegbci/fetch_data.py | neergaard/eegbci-data | d3270d500b5eba452ed6647ec42a9af404e17b0a | [
"MIT"
] | null | null | null | eegbci/fetch_data.py | neergaard/eegbci-data | d3270d500b5eba452ed6647ec42a9af404e17b0a | [
"MIT"
] | null | null | null | eegbci/fetch_data.py | neergaard/eegbci-data | d3270d500b5eba452ed6647ec42a9af404e17b0a | [
"MIT"
] | null | null | null | import argparse
import logging
import sys
from .fetch import download_fns
logger = logging.getLogger("mne")
AVAILABLE_DATASETS = set(download_fns.keys())
def download_dataset(output_dir, n_first=None, cohort="eegbci"):
download_fns[cohort](output_dir, n_first)
if __name__ == "__main__":
parser = argpa... | 28.980392 | 123 | 0.624493 | import argparse
import logging
import sys
from .fetch import download_fns
logger = logging.getLogger("mne")
AVAILABLE_DATASETS = set(download_fns.keys())
def download_dataset(output_dir, n_first=None, cohort="eegbci"):
download_fns[cohort](output_dir, n_first)
if __name__ == "__main__":
parser = argpa... | true | true |
f7f16d8c9685047f92138871781f645a29cdca7d | 3,627 | py | Python | configs/_base_/models/faster_rcnn_r50_fpn_relation_visdrone.py | Fanzhongjie/ARFE | 4b96b8c5bc0895d3d30acec2a490f81a860fe860 | [
"Apache-2.0"
] | null | null | null | configs/_base_/models/faster_rcnn_r50_fpn_relation_visdrone.py | Fanzhongjie/ARFE | 4b96b8c5bc0895d3d30acec2a490f81a860fe860 | [
"Apache-2.0"
] | null | null | null | configs/_base_/models/faster_rcnn_r50_fpn_relation_visdrone.py | Fanzhongjie/ARFE | 4b96b8c5bc0895d3d30acec2a490f81a860fe860 | [
"Apache-2.0"
] | null | null | null | model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style='pytorch'... | 31.267241 | 77 | 0.528812 | model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style='pytorch'... | true | true |
f7f16e10dada31a698c17d327796cce472f2a4d3 | 1,552 | py | Python | easygui_qt/calendar_widget.py | KGerring/easygui_qt_crypto | b3b8e0c32420f16d70fc4be6e507eb26b3f0e1bb | [
"BSD-3-Clause"
] | null | null | null | easygui_qt/calendar_widget.py | KGerring/easygui_qt_crypto | b3b8e0c32420f16d70fc4be6e507eb26b3f0e1bb | [
"BSD-3-Clause"
] | null | null | null | easygui_qt/calendar_widget.py | KGerring/easygui_qt_crypto | b3b8e0c32420f16d70fc4be6e507eb26b3f0e1bb | [
"BSD-3-Clause"
] | null | null | null |
try:
from PyQt4 import QtGui, QtCore
except ImportError:
from PyQt5 import QtGui, QtCore # untested
class CalendarWidget(QtGui.QWidget):
"""Creates a calendar widget allowing the user to select a date."""
def __init__(self, title="Calendar"):
super(CalendarWidget, self).__init__()
se... | 30.431373 | 72 | 0.646907 |
try:
from PyQt4 import QtGui, QtCore
except ImportError:
from PyQt5 import QtGui, QtCore
class CalendarWidget(QtGui.QWidget):
def __init__(self, title="Calendar"):
super(CalendarWidget, self).__init__()
self.setWindowTitle(title)
layout = QtGui.QGridLayout()
layout.setCo... | true | true |
f7f16eeb361cc2b31a1a4de075da9f3838956556 | 8,020 | py | Python | myconnectome/timeseries/mk_phenomewide_graph.py | poldrack/myconnectome | 201f414b3165894d6fe0be0677c8a58f6d161948 | [
"MIT"
] | 28 | 2015-04-02T16:43:14.000Z | 2020-06-17T20:04:26.000Z | myconnectome/timeseries/mk_phenomewide_graph.py | poldrack/myconnectome | 201f414b3165894d6fe0be0677c8a58f6d161948 | [
"MIT"
] | 11 | 2015-05-19T02:57:22.000Z | 2017-03-17T17:36:16.000Z | myconnectome/timeseries/mk_phenomewide_graph.py | poldrack/myconnectome | 201f414b3165894d6fe0be0677c8a58f6d161948 | [
"MIT"
] | 10 | 2015-05-21T17:01:26.000Z | 2020-11-11T04:28:08.000Z | """
mk graph showing relations between differen variables
"""
#import pydot
import networkx as nx
import re
import os,glob
import numpy
basedir=os.environ['MYCONNECTOME_DIR']
filter_negatives=False
exclude_metab=False
exclude_metab_metab=True
exclude_gene_gene=True
filter_gene_modules=False # only include first clus... | 36.289593 | 157 | 0.61808 | """
mk graph showing relations between differen variables
"""
import networkx as nx
import re
import os,glob
import numpy
basedir=os.environ['MYCONNECTOME_DIR']
filter_negatives=False
exclude_metab=False
exclude_metab_metab=True
exclude_gene_gene=True
filter_gene_modules=False
thresh=0.05
degree_thresh=1
use_inf... | false | true |
f7f16ef8df2d7197a16444516e59e6aebbe3ec67 | 5,839 | py | Python | lazy-cseq2.0/generate_benchmark.py | GiuseppeDiPalma/LazyCseq-LockFree-benchmak-generator | f0e945672d69209a4103e0f37330a328482d1ffd | [
"MIT"
] | null | null | null | lazy-cseq2.0/generate_benchmark.py | GiuseppeDiPalma/LazyCseq-LockFree-benchmak-generator | f0e945672d69209a4103e0f37330a328482d1ffd | [
"MIT"
] | null | null | null | lazy-cseq2.0/generate_benchmark.py | GiuseppeDiPalma/LazyCseq-LockFree-benchmak-generator | f0e945672d69209a4103e0f37330a328482d1ffd | [
"MIT"
] | 2 | 2020-12-29T13:31:08.000Z | 2020-12-29T23:14:14.000Z | from io import SEEK_SET
from os import write
import sys
import subprocess
from itertools import product
from optparse import OptionParser
import analyze_trace
import time
num_thread = 0
num_op = 0
data_structure_type = ""
interface_path = ""
include_params = ""
name = ""
rounds = 1
benchmark_dir = ""
# Function to co... | 34.146199 | 147 | 0.594622 | from io import SEEK_SET
from os import write
import sys
import subprocess
from itertools import product
from optparse import OptionParser
import analyze_trace
import time
num_thread = 0
num_op = 0
data_structure_type = ""
interface_path = ""
include_params = ""
name = ""
rounds = 1
benchmark_dir = ""
def listToStrin... | true | true |
f7f16f1bffa309025e57967ca294a06aee62515b | 3,685 | py | Python | tweet_news.py | hiraki-uk/wows-news-twitter | eaca13ed20021b2c79112315d9b10974a6615cbf | [
"MIT"
] | null | null | null | tweet_news.py | hiraki-uk/wows-news-twitter | eaca13ed20021b2c79112315d9b10974a6615cbf | [
"MIT"
] | null | null | null | tweet_news.py | hiraki-uk/wows-news-twitter | eaca13ed20021b2c79112315d9b10974a6615cbf | [
"MIT"
] | null | null | null | import asyncio
import twitter
from twitter.twitter_utils import calc_expected_status_length as calc_status_length
from database import Database
from logger import Logger
class Tweet_news:
def __init__(self, key, secret_key, token, token_secret, db_path, logger=None):
self.latest_id = 0
self.database = Database... | 26.510791 | 91 | 0.686296 | import asyncio
import twitter
from twitter.twitter_utils import calc_expected_status_length as calc_status_length
from database import Database
from logger import Logger
class Tweet_news:
def __init__(self, key, secret_key, token, token_secret, db_path, logger=None):
self.latest_id = 0
self.database = Database... | true | true |
f7f1705ff1a5d6faba22698b514bd4869b35d246 | 3,142 | py | Python | netbox/ipam/tests/test_models.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | 6 | 2017-12-01T05:13:39.000Z | 2020-01-23T13:04:43.000Z | netbox/ipam/tests/test_models.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | 8 | 2021-04-16T01:38:00.000Z | 2022-01-04T21:27:27.000Z | netbox/ipam/tests/test_models.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | 3 | 2017-11-18T01:28:22.000Z | 2018-05-17T14:04:43.000Z | import netaddr
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
from ipam.constants import IPADDRESS_ROLE_VIP
from ipam.models import IPAddress, Prefix, VRF
class TestPrefix(TestCase):
@override_settings(ENFORCE_GLOBAL_UNIQUE=False)
def test_duplicate_gl... | 47.606061 | 100 | 0.725334 | import netaddr
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
from ipam.constants import IPADDRESS_ROLE_VIP
from ipam.models import IPAddress, Prefix, VRF
class TestPrefix(TestCase):
@override_settings(ENFORCE_GLOBAL_UNIQUE=False)
def test_duplicate_gl... | true | true |
f7f1715d3ebdd91f314c62b3192fe79d3f556685 | 3,373 | py | Python | peyps/run_utils.py | scphall/peyps | c801187461b9d7d13a62ea8fc384a89a7522290a | [
"MIT"
] | null | null | null | peyps/run_utils.py | scphall/peyps | c801187461b9d7d13a62ea8fc384a89a7522290a | [
"MIT"
] | null | null | null | peyps/run_utils.py | scphall/peyps | c801187461b9d7d13a62ea8fc384a89a7522290a | [
"MIT"
] | null | null | null | import argparse
import re
from collections import namedtuple
from datetime import date, timedelta, datetime
from dateutil.relativedelta import relativedelta
DateRange = namedtuple('DateRange', ['from_', 'upto'])
def makedate(date_str):
"""
Make a `datetime.date` from an ISO formatted string.
Parameters... | 32.12381 | 72 | 0.60925 | import argparse
import re
from collections import namedtuple
from datetime import date, timedelta, datetime
from dateutil.relativedelta import relativedelta
DateRange = namedtuple('DateRange', ['from_', 'upto'])
def makedate(date_str):
return datetime.strptime(date_str, '%Y-%m-%d').date()
def str2date(date_st... | true | true |
f7f1721f1ea141cd4704fbc8f098accd58eabbf1 | 10,478 | py | Python | mmdet3d/core/bbox/structures/lidar_box3d.py | chence17/fcaf3d | 636aaa0410430deedd7bd4979e8c1bc307424a84 | [
"MIT"
] | 217 | 2021-12-10T09:44:33.000Z | 2022-03-31T16:17:35.000Z | mmdet3d/core/bbox/structures/lidar_box3d.py | chence17/fcaf3d | 636aaa0410430deedd7bd4979e8c1bc307424a84 | [
"MIT"
] | 22 | 2021-12-29T08:57:31.000Z | 2022-03-31T11:21:53.000Z | mmdet3d/core/bbox/structures/lidar_box3d.py | chence17/fcaf3d | 636aaa0410430deedd7bd4979e8c1bc307424a84 | [
"MIT"
] | 23 | 2021-12-13T06:56:38.000Z | 2022-03-28T02:02:13.000Z | import numpy as np
import torch
from mmdet3d.core.points import BasePoints
from mmdet3d.ops.roiaware_pool3d import points_in_boxes_gpu
from .base_box3d import BaseInstance3DBoxes
from .utils import limit_period, rotation_3d_in_axis
class LiDARInstance3DBoxes(BaseInstance3DBoxes):
"""3D boxes of instances in LIDA... | 38.807407 | 79 | 0.531876 | import numpy as np
import torch
from mmdet3d.core.points import BasePoints
from mmdet3d.ops.roiaware_pool3d import points_in_boxes_gpu
from .base_box3d import BaseInstance3DBoxes
from .utils import limit_period, rotation_3d_in_axis
class LiDARInstance3DBoxes(BaseInstance3DBoxes):
@property
def gravity_cente... | true | true |
f7f17349c2a8b9f097f794debdedb6a6024f15c6 | 5,008 | py | Python | getsub/downloader/zimuzu.py | bread22/GetSubtitles | d2e0895a0bd6956698fc4afa7f29e5ba285b2d3e | [
"MIT"
] | null | null | null | getsub/downloader/zimuzu.py | bread22/GetSubtitles | d2e0895a0bd6956698fc4afa7f29e5ba285b2d3e | [
"MIT"
] | null | null | null | getsub/downloader/zimuzu.py | bread22/GetSubtitles | d2e0895a0bd6956698fc4afa7f29e5ba285b2d3e | [
"MIT"
] | null | null | null | # coding: utf-8
from collections import OrderedDict as order_dict
from contextlib import closing
import json
import requests
from bs4 import BeautifulSoup
from getsub.downloader.downloader import Downloader
from getsub.constants import PREFIX
from getsub.util import ProgressBar
""" Zimuzu 字幕下载器
"""
class ZimuzuD... | 36.289855 | 87 | 0.511981 |
from collections import OrderedDict as order_dict
from contextlib import closing
import json
import requests
from bs4 import BeautifulSoup
from getsub.downloader.downloader import Downloader
from getsub.constants import PREFIX
from getsub.util import ProgressBar
class ZimuzuDownloader(Downloader):
name = "... | true | true |
f7f1743562b6ae06f92e4a98aa2c8831ab5deeec | 6,092 | py | Python | hebsafeharbor/common/date_utils.py | ayabel/HebSafeHarbor | 4198503d2265f1eb12b5c31d2e1b5db64296229f | [
"MIT"
] | null | null | null | hebsafeharbor/common/date_utils.py | ayabel/HebSafeHarbor | 4198503d2265f1eb12b5c31d2e1b5db64296229f | [
"MIT"
] | null | null | null | hebsafeharbor/common/date_utils.py | ayabel/HebSafeHarbor | 4198503d2265f1eb12b5c31d2e1b5db64296229f | [
"MIT"
] | null | null | null | import re
from typing import List
from hebsafeharbor.common.date_regex import HEB_DATE_REGEX, LATIN_DATE_REGEX
MIN_DATE_LENGTH = 6
class DateMentionComponent:
"""
This class stores the information on the certain date component - its value (text) and its offset the date mention
"""
def __init__(self, t... | 42.305556 | 132 | 0.659225 | import re
from typing import List
from hebsafeharbor.common.date_regex import HEB_DATE_REGEX, LATIN_DATE_REGEX
MIN_DATE_LENGTH = 6
class DateMentionComponent:
def __init__(self, text: str, start: int, end:int):
self.text = text
self.start = start
self.end = end
class DateMention:
de... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.