hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73567b822ba92a6781d158f87b83b557c2b6a7b | 5,187 | py | Python | djangosige/apps/financeiro/models/lancamento.py | 3ysoftwarehouse/vcd-novo | 5181e93aa57e926af84332d76b7b0628637544e1 | [
"MIT"
] | null | null | null | djangosige/apps/financeiro/models/lancamento.py | 3ysoftwarehouse/vcd-novo | 5181e93aa57e926af84332d76b7b0628637544e1 | [
"MIT"
] | null | null | null | djangosige/apps/financeiro/models/lancamento.py | 3ysoftwarehouse/vcd-novo | 5181e93aa57e926af84332d76b7b0628637544e1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
from django.core.validators import MinValueValidator
from decimal import Decimal
from django.core.urlresolvers import reverse_lazy
from django.template.defaultfilters import date
import locale
locale.setlocale(locale.LC_ALL, '')
STATUS_CONTA_SAIDA_ESCOLHAS = (
... | 39.59542 | 129 | 0.658955 |
from django.db import models
from django.core.validators import MinValueValidator
from decimal import Decimal
from django.core.urlresolvers import reverse_lazy
from django.template.defaultfilters import date
import locale
locale.setlocale(locale.LC_ALL, '')
STATUS_CONTA_SAIDA_ESCOLHAS = (
(u'0', u'Paga'),
(... | true | true |
f73567edde1853a3919e05ddccb738e82af0155f | 3,861 | py | Python | tests/pytests/functional/states/file/test_rename.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 1 | 2022-03-12T00:03:19.000Z | 2022-03-12T00:03:19.000Z | tests/pytests/functional/states/file/test_rename.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 2 | 2022-03-02T16:11:35.000Z | 2022-03-03T08:04:30.000Z | tests/pytests/functional/states/file/test_rename.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | null | null | null | """
Tests for file.rename state function
"""
# nox -e pytest-zeromq-3.8(coverage=False) -- -vvv --run-slow --run-destructive tests\pytests\functional\states\file\test_rename.py
import pytest
import salt.utils.path
pytestmark = [
pytest.mark.windows_whitelisted,
]
@pytest.fixture(scope="module")
def file(states)... | 30.164063 | 131 | 0.673401 |
import pytest
import salt.utils.path
pytestmark = [
pytest.mark.windows_whitelisted,
]
@pytest.fixture(scope="module")
def file(states):
return states.file
@pytest.fixture(scope="function")
def source():
with pytest.helpers.temp_file(
name="old_name.txt", contents="Source content"
) as so... | true | true |
f735682a4455b157cc8cd531342908296c302379 | 108 | py | Python | django/models/customising_admin/apps.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | django/models/customising_admin/apps.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | django/models/customising_admin/apps.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CustomisingAdminConfig(AppConfig):
name = 'customising_admin'
| 18 | 40 | 0.796296 | from django.apps import AppConfig
class CustomisingAdminConfig(AppConfig):
name = 'customising_admin'
| true | true |
f73568592e3f9b63d56ec35c8be5d16ba89d76d3 | 1,904 | py | Python | Container-Root/src/python/lib/util/encode_decode_json.py | aws-samples/aws-do-pm | 17c8803d18e479e7e0d0b6e35ff2abe77079a61e | [
"MIT-0"
] | 4 | 2022-03-03T03:52:33.000Z | 2022-03-31T23:28:14.000Z | Container-Root/src/python/lib/util/encode_decode_json.py | aws-samples/aws-do-pm | 17c8803d18e479e7e0d0b6e35ff2abe77079a61e | [
"MIT-0"
] | null | null | null | Container-Root/src/python/lib/util/encode_decode_json.py | aws-samples/aws-do-pm | 17c8803d18e479e7e0d0b6e35ff2abe77079a61e | [
"MIT-0"
] | null | null | null | ######################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# SPDX-License-Identifier: MIT-0 #
######################################################################
import json
import base64
def utf_... | 34 | 79 | 0.655462 | true | true | |
f73568ba58dac4a9dd111036f4e127aea811cdfa | 45,214 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/appflow/appflowparam.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/appflow/appflowparam.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/appflow/appflowparam.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 32.135039 | 372 | 0.74384 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_excepti... | true | true |
f73568bb9aceccf782577788600b4d031e9caf26 | 2,459 | py | Python | kanban/lib/python2.7/site-packages/django/utils/version.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/utils/version.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/utils/version.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 datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... | 30.358025 | 79 | 0.660838 | from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
version = get_complete_version(version)
major = get_major_version(version)
sub = ''
if version[3] == 'alpha' and vers... | true | true |
f7356913d6ee4f01834b90c06eeafd81bc4cc467 | 589 | py | Python | Aniyom Ebenezer/phase 1/python 2 basis/Day27_Challenge_Solution/Ques 3 Sol.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Aniyom Ebenezer/phase 1/python 2 basis/Day27_Challenge_Solution/Ques 3 Sol.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Aniyom Ebenezer/phase 1/python 2 basis/Day27_Challenge_Solution/Ques 3 Sol.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | """
Write a Python program to check whether two given lines are parallel or not.
Note: Parallel lines are two or more lines that never intersect. Parallel Lines are like railroad tracks that never intersect.
The General Form of the equation of a straight line is: ax + by = c
The said straight line is represented in a l... | 36.8125 | 126 | 0.721562 | def parallel_lines(line1, line2):
return line1[0]/line1[1] == line2[0]/line2[1]
print(parallel_lines([2,3,4], [2,3,8]))
print(parallel_lines([2,3,4], [4,-3,8])) | true | true |
f73569d59f547d8ce45674644ef17e5f76dc2e6f | 7,924 | py | Python | readthedocs/search/utils.py | ank-forked/readthedocs.org | e4110e8db5d25b7e6c699dd2df1a580b04ee8d16 | [
"MIT"
] | 1 | 2019-01-05T09:49:52.000Z | 2019-01-05T09:49:52.000Z | readthedocs/search/utils.py | himynamesdave/readthedocs.org | 38e73cd73efb76461d28a5d9737731b7d7349297 | [
"MIT"
] | 4 | 2021-02-08T21:06:49.000Z | 2021-12-13T20:51:17.000Z | readthedocs/search/utils.py | himynamesdave/readthedocs.org | 38e73cd73efb76461d28a5d9737731b7d7349297 | [
"MIT"
] | 3 | 2016-08-04T12:53:13.000Z | 2016-11-02T14:17:55.000Z | # -*- coding: utf-8 -*-
import os
import fnmatch
import re
import codecs
import logging
import json
from pyquery import PyQuery
log = logging.getLogger(__name__)
def process_mkdocs_json(version, build_dir=True):
if build_dir:
full_path = version.project.full_json_path(version.slug)
else:
fu... | 32.743802 | 100 | 0.551111 |
import os
import fnmatch
import re
import codecs
import logging
import json
from pyquery import PyQuery
log = logging.getLogger(__name__)
def process_mkdocs_json(version, build_dir=True):
if build_dir:
full_path = version.project.full_json_path(version.slug)
else:
full_path = version.proje... | true | true |
f7356b3bba32f2fcd3678ee11ab6863786e3b137 | 4,511 | py | Python | fastestimator/backend/_iwd.py | DwijayDS/fastestimator | 9b288cb2bd870f971ec4cee09d0b3205e1316a94 | [
"Apache-2.0"
] | null | null | null | fastestimator/backend/_iwd.py | DwijayDS/fastestimator | 9b288cb2bd870f971ec4cee09d0b3205e1316a94 | [
"Apache-2.0"
] | null | null | null | fastestimator/backend/_iwd.py | DwijayDS/fastestimator | 9b288cb2bd870f971ec4cee09d0b3205e1316a94 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The FastEstimator 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 appl... | 49.571429 | 120 | 0.673022 |
import math
from typing import Optional, TypeVar
import numpy as np
import tensorflow as tf
import torch
from fastestimator.backend._maximum import maximum
from fastestimator.backend._reduce_sum import reduce_sum
from fastestimator.backend._reshape import reshape
from fastestimator.backend._tensor_pow i... | true | true |
f7356ec145250e7c0c4bc92e49c56d5c1c07160a | 66 | py | Python | tests/integration/test_commands.py | orotalt/kforce | f2a26dc53a8f364c9854bf32fcb59b6fb3aaa3d8 | [
"MIT"
] | 9 | 2018-02-21T00:48:43.000Z | 2020-02-15T06:21:58.000Z | tests/integration/test_commands.py | orotalt/kforce | f2a26dc53a8f364c9854bf32fcb59b6fb3aaa3d8 | [
"MIT"
] | 5 | 2018-03-02T06:19:24.000Z | 2021-03-25T21:58:51.000Z | tests/integration/test_commands.py | DomainGroupOSS/kforce | f2a26dc53a8f364c9854bf32fcb59b6fb3aaa3d8 | [
"MIT"
] | 5 | 2018-02-27T06:58:46.000Z | 2018-12-06T22:18:33.000Z | from unittest import TestCase
class TestNew(TestCase):
pass
| 11 | 29 | 0.757576 | from unittest import TestCase
class TestNew(TestCase):
pass
| true | true |
f7356fdd90f419efa0300e27fdfd55d90e10cc07 | 2,897 | py | Python | nanpy/bmp180.py | AFTC-1/Arduino-rpi | c46079f937d7e07cc0a930cc7ae278036f50a47d | [
"MIT"
] | 178 | 2015-01-03T11:56:49.000Z | 2021-12-23T14:47:55.000Z | nanpy/bmp180.py | AFTC-1/Arduino-rpi | c46079f937d7e07cc0a930cc7ae278036f50a47d | [
"MIT"
] | 88 | 2015-01-23T09:06:43.000Z | 2021-12-26T19:58:51.000Z | nanpy/bmp180.py | AFTC-1/Arduino-rpi | c46079f937d7e07cc0a930cc7ae278036f50a47d | [
"MIT"
] | 77 | 2015-02-18T17:26:11.000Z | 2021-09-28T02:47:25.000Z | from __future__ import division
import logging
from nanpy.i2c import I2C_Master
from nanpy.memo import memoized
import time
log = logging.getLogger(__name__)
def to_s16(n):
return (n + 2 ** 15) % 2 ** 16 - 2 ** 15
class Bmp180(object):
"""Control of BMP180 Digital pressure sensor (I2C)
calculation i... | 24.550847 | 67 | 0.491543 | from __future__ import division
import logging
from nanpy.i2c import I2C_Master
from nanpy.memo import memoized
import time
log = logging.getLogger(__name__)
def to_s16(n):
return (n + 2 ** 15) % 2 ** 16 - 2 ** 15
class Bmp180(object):
def __init__(self, wire, address=0x77, oss=3):
self.i2c = I2... | true | true |
f7357074d41b80404b727e210328e1a6fe909547 | 2,626 | py | Python | test/sconstool/clang/clang_shared_library.py | ptomulik/scons-tool-clang | c6410f96fde9a19e3964c6dd0d802d5be10a425c | [
"Unlicense"
] | 1 | 2017-02-13T02:06:08.000Z | 2017-02-13T02:06:08.000Z | test/sconstool/clang/clang_shared_library.py | ptomulik/scons-tool-clang | c6410f96fde9a19e3964c6dd0d802d5be10a425c | [
"Unlicense"
] | 5 | 2017-06-21T12:50:14.000Z | 2021-02-02T21:50:38.000Z | test/sconstool/clang/clang_shared_library.py | ptomulik/scons-tool-clang | c6410f96fde9a19e3964c6dd0d802d5be10a425c | [
"Unlicense"
] | 1 | 2018-03-24T15:55:34.000Z | 2018-03-24T15:55:34.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014-2020 by Paweł Tomulik <ptomulik@meil.pw.edu.pl>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, in... | 28.857143 | 84 | 0.718203 |
import TestSCons
import json
_exe = TestSCons._exe
test = TestSCons.TestSCons()
if not test.where_is('clang'):
test.skip_test("Could not find 'clang', skipping test.\n")
test.file_fixture('../../../__init__.py', 'site_scons/site_tools/clang/__init__.py')
test.write('SConstruct', """\
i... | true | true |
f735713a14eda3b9105cce638f1ac64b5f5e74b9 | 14,962 | py | Python | artifact_sdk/model/container/volume_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | artifact_sdk/model/container/volume_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | artifact_sdk/model/container/volume_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: volume.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... | 40.005348 | 1,346 | 0.744352 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
f7357140642f55ff5a3b3396580fc2a5411b1546 | 3,732 | py | Python | src/spaceone/identity/info/project_group_info.py | Jeoungseungho/identity | 8fa1c8d21952fb7b313624e632d98e99e5bf0def | [
"Apache-2.0"
] | null | null | null | src/spaceone/identity/info/project_group_info.py | Jeoungseungho/identity | 8fa1c8d21952fb7b313624e632d98e99e5bf0def | [
"Apache-2.0"
] | null | null | null | src/spaceone/identity/info/project_group_info.py | Jeoungseungho/identity | 8fa1c8d21952fb7b313624e632d98e99e5bf0def | [
"Apache-2.0"
] | null | null | null | import functools
from spaceone.api.core.v1 import tag_pb2
from spaceone.api.identity.v1 import project_group_pb2
from spaceone.core.pygrpc.message_type import *
from spaceone.identity.model.project_model import Project
from spaceone.identity.model.project_group_model import ProjectGroup
from spaceone.identity.info.role... | 41.010989 | 120 | 0.733923 | import functools
from spaceone.api.core.v1 import tag_pb2
from spaceone.api.identity.v1 import project_group_pb2
from spaceone.core.pygrpc.message_type import *
from spaceone.identity.model.project_model import Project
from spaceone.identity.model.project_group_model import ProjectGroup
from spaceone.identity.info.role... | true | true |
f7357204b9431e5eb3909f94e42769a597561c0a | 7,020 | py | Python | evennia/utils/tests/test_create_functions.py | lootcrawl/evennia | a5f736ca0ff89e4f7da7d3f89a8886f1ea3698aa | [
"BSD-3-Clause"
] | null | null | null | evennia/utils/tests/test_create_functions.py | lootcrawl/evennia | a5f736ca0ff89e4f7da7d3f89a8886f1ea3698aa | [
"BSD-3-Clause"
] | null | null | null | evennia/utils/tests/test_create_functions.py | lootcrawl/evennia | a5f736ca0ff89e4f7da7d3f89a8886f1ea3698aa | [
"BSD-3-Clause"
] | null | null | null | """
Tests of create functions
"""
from django.test import TestCase
from evennia.utils.test_resources import EvenniaTest
from evennia.scripts.scripts import DefaultScript
from evennia.utils import create
class TestCreateScript(EvenniaTest):
def test_create_script(self):
class TestScriptA(DefaultScript):
... | 37.945946 | 95 | 0.645442 |
from django.test import TestCase
from evennia.utils.test_resources import EvenniaTest
from evennia.scripts.scripts import DefaultScript
from evennia.utils import create
class TestCreateScript(EvenniaTest):
def test_create_script(self):
class TestScriptA(DefaultScript):
def at_script_creation(... | true | true |
f735721051aeee1950098b1b22a38efb71913410 | 855 | py | Python | setup.py | Tracardi/tracardi-zapier-webhook | becb6b8fc5815d35254f2cf9073417869202dbf0 | [
"MIT"
] | null | null | null | setup.py | Tracardi/tracardi-zapier-webhook | becb6b8fc5815d35254f2cf9073417869202dbf0 | [
"MIT"
] | null | null | null | setup.py | Tracardi/tracardi-zapier-webhook | becb6b8fc5815d35254f2cf9073417869202dbf0 | [
"MIT"
] | null | null | null | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='tracardi-zapier-webhook',
version='0.6.0.1',
description='This plugin calls zapier webhook.',
long_description=long_description,
long_description_content_type="text/markdown",
author='... | 27.580645 | 52 | 0.636257 | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='tracardi-zapier-webhook',
version='0.6.0.1',
description='This plugin calls zapier webhook.',
long_description=long_description,
long_description_content_type="text/markdown",
author='... | true | true |
f735728bd3c2525528a91c73c1dd2e6dfc3a12e2 | 749 | py | Python | app/management/commands/zombie_emails.py | marcusosso/uwhvz | c20303c117e8b2fcd04f5901326054296d3f3caf | [
"MIT"
] | 9 | 2018-09-08T06:59:02.000Z | 2022-03-23T08:12:02.000Z | app/management/commands/zombie_emails.py | marcusosso/uwhvz | c20303c117e8b2fcd04f5901326054296d3f3caf | [
"MIT"
] | 37 | 2020-01-22T02:36:32.000Z | 2020-10-06T15:05:37.000Z | app/management/commands/zombie_emails.py | marcusosso/uwhvz | c20303c117e8b2fcd04f5901326054296d3f3caf | [
"MIT"
] | 6 | 2019-03-07T02:55:27.000Z | 2019-11-10T23:26:44.000Z | from django.core.management.base import BaseCommand
from app.models import Player, PlayerRole, Spectator, Moderator, most_recent_game
class Command(BaseCommand):
help = 'Prints a list of all zombie emails'
def handle(self, *args, **options):
game = most_recent_game()
spectators = Spectator.o... | 39.421053 | 93 | 0.708945 | from django.core.management.base import BaseCommand
from app.models import Player, PlayerRole, Spectator, Moderator, most_recent_game
class Command(BaseCommand):
help = 'Prints a list of all zombie emails'
def handle(self, *args, **options):
game = most_recent_game()
spectators = Spectator.o... | true | true |
f735734fbcfa9b4dcd228604eb9c4689fe4646a8 | 464 | py | Python | recipes/deco/all/test_package/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-11T03:07:13.000Z | 2021-11-11T03:07:13.000Z | recipes/deco/all/test_package/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-22T13:54:48.000Z | 2021-11-22T14:09:45.000Z | recipes/deco/all/test_package/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | null | null | null | import os
from conans import ConanFile, CMake, tools
class DecoTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
... | 24.421053 | 53 | 0.62931 | import os
from conans import ConanFile, CMake, tools
class DecoTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
... | true | true |
f7357416d4422e2f506ea44d95ca0a69cba35815 | 380 | py | Python | socket_and_sntp/get_remote_machine_info.py | jwh5566/python_scripts | e1b53917421d358d4d0e18ada491605f62802128 | [
"Apache-2.0"
] | null | null | null | socket_and_sntp/get_remote_machine_info.py | jwh5566/python_scripts | e1b53917421d358d4d0e18ada491605f62802128 | [
"Apache-2.0"
] | null | null | null | socket_and_sntp/get_remote_machine_info.py | jwh5566/python_scripts | e1b53917421d358d4d0e18ada491605f62802128 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# This program is optimized for Python 2.7.
import socket
def get_remote_machine_info():
remote_host = 'www.python.org'
try:
print "IP address of %s: %s" %(remote_host,socket.gethostbyname(remote_host))
except socket.error, err_msg:
print "%s: %s" %(remote_host, err_ms... | 29.230769 | 85 | 0.686842 |
import socket
def get_remote_machine_info():
remote_host = 'www.python.org'
try:
print "IP address of %s: %s" %(remote_host,socket.gethostbyname(remote_host))
except socket.error, err_msg:
print "%s: %s" %(remote_host, err_msg)
if __name__ == '__main__':
get_remote_machine_info() | false | true |
f7357454568fceaf697bea82684aafa83f283390 | 6,230 | py | Python | backend/Layer/layer/aws/dynamodb/base.py | cvc-Fujii/line-api-use-case-reservation-Restaurant | 248ae2ed52d8325d17d2ddbbd2975068381193fe | [
"Unlicense"
] | 8 | 2021-05-21T03:10:12.000Z | 2022-01-09T10:10:26.000Z | backend/Layer/layer/aws/dynamodb/base.py | cvc-Fujii/line-api-use-case-reservation-Restaurant | 248ae2ed52d8325d17d2ddbbd2975068381193fe | [
"Unlicense"
] | null | null | null | backend/Layer/layer/aws/dynamodb/base.py | cvc-Fujii/line-api-use-case-reservation-Restaurant | 248ae2ed52d8325d17d2ddbbd2975068381193fe | [
"Unlicense"
] | 4 | 2021-05-28T09:57:52.000Z | 2021-09-27T12:25:54.000Z | """
DynamoDB操作用基底モジュール
"""
import boto3
from boto3.dynamodb.conditions import Key
import logging
from datetime import (datetime, timedelta)
# ログ出力の設定
logger = logging.getLogger()
logger.setLevel(logging.INFO)
class DynamoDB:
"""DynamoDB操作用基底クラス"""
__slots__ = ['_db', '_table_name']
de... | 22.98893 | 120 | 0.4626 | import boto3
from boto3.dynamodb.conditions import Key
import logging
from datetime import (datetime, timedelta)
logger = logging.getLogger()
logger.setLevel(logging.INFO)
class DynamoDB:
__slots__ = ['_db', '_table_name']
def __init__(self, table_name):
self._table_name = table_name
... | true | true |
f735745dff459be2423815031d82822f221659e6 | 8,149 | py | Python | maatpy/dataset.py | sanzgiri/MaatPy | 381a0d31f1afdd2c53b9ccbb410eb0df6b4b9965 | [
"MIT"
] | 11 | 2019-05-17T03:50:18.000Z | 2021-08-23T22:18:23.000Z | maatpy/dataset.py | sanzgiri/MaatPy | 381a0d31f1afdd2c53b9ccbb410eb0df6b4b9965 | [
"MIT"
] | 3 | 2021-04-08T14:01:15.000Z | 2021-06-21T15:41:31.000Z | maatpy/dataset.py | sanzgiri/MaatPy | 381a0d31f1afdd2c53b9ccbb410eb0df6b4b9965 | [
"MIT"
] | 7 | 2019-06-09T06:16:59.000Z | 2021-11-12T01:45:52.000Z | import warnings
import numpy as np
import pandas as pd
from collections import Counter
from sklearn.datasets import make_classification
from sklearn.utils import check_X_y
from sklearn.utils import Bunch
from sklearn.preprocessing import LabelEncoder
from imblearn.under_sampling.prototype_selection import RandomUnder... | 50.302469 | 120 | 0.647196 | import warnings
import numpy as np
import pandas as pd
from collections import Counter
from sklearn.datasets import make_classification
from sklearn.utils import check_X_y
from sklearn.utils import Bunch
from sklearn.preprocessing import LabelEncoder
from imblearn.under_sampling.prototype_selection import RandomUnder... | true | true |
f73574d2aecc0b6d1de391aa5eac4ec6d9dc1d37 | 17,721 | py | Python | maskrcnn_benchmark/config/.ipynb_checkpoints/defaults-checkpoint.py | Zhang-Jing-Xuan/MaskRCNN | 8f1719113847655607eb116d2cb632cc0461119e | [
"MIT"
] | 4 | 2021-03-16T02:39:26.000Z | 2021-07-02T08:25:28.000Z | maskrcnn_benchmark/config/defaults.py | Zhang-Jing-Xuan/MaskRCNN | 8f1719113847655607eb116d2cb632cc0461119e | [
"MIT"
] | null | null | null | maskrcnn_benchmark/config/defaults.py | Zhang-Jing-Xuan/MaskRCNN | 8f1719113847655607eb116d2cb632cc0461119e | [
"MIT"
] | 1 | 2021-06-12T17:11:45.000Z | 2021-06-12T17:11:45.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import os
from yacs.config import CfgNode as CN
# -----------------------------------------------------------------------------
# Convention about Training / Test specific parameters
# ------------------------------------------------------------... | 37.704255 | 83 | 0.644715 |
import os
from yacs.config import CfgNode as CN
_C = CN()
_C.MODEL = CN()
_C.MODEL.RPN_ONLY = False
_C.MODEL.MASK_ON = False
_C.MODEL.RETINANET_ON = False
_C.MODEL.KEYPOINT_ON = False
_C.MODEL.DEVICE = "cuda"
_C.MODEL.META_ARCHITECTURE = "GeneralizedRCNN"
_C.MODEL.CLS_AGNOSTIC_BBOX_REG = False
_C... | true | true |
f73574dea6f487ec48f1f14a66b63368c035037e | 7,807 | py | Python | examples/pwr_run/checkpointing/throughput/final4_new2/job48.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/throughput/final4_new2/job48.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/throughput/final4_new2/job48.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 32.940928 | 118 | 0.691175 |
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras.callbacks import ReduceLROn... | true | true |
f735756443eef240e21fb562830541755be870bb | 499 | py | Python | web/migrations/0014_auto_20160903_0626.py | acuestap/smarttools_test | caa8760be4dfd502d31f5e396392d1d455ebdca8 | [
"MIT"
] | null | null | null | web/migrations/0014_auto_20160903_0626.py | acuestap/smarttools_test | caa8760be4dfd502d31f5e396392d1d455ebdca8 | [
"MIT"
] | null | null | null | web/migrations/0014_auto_20160903_0626.py | acuestap/smarttools_test | caa8760be4dfd502d31f5e396392d1d455ebdca8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-03 06:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0013_auto_20160903_0624'),
]
operations = [
migrations.AlterField(
... | 23.761905 | 100 | 0.639279 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0013_auto_20160903_0624'),
]
operations = [
migrations.AlterField(
model_name='competition',
name='image',
... | true | true |
f7357669b03ff6955b8a67a2794bef50f3ba106e | 12,848 | py | Python | projDir/qc/scripts/PlotSelfConRuns.py | NCAR/lrose-uw-general | d317aad5e1250f131e24c83f4e17b9cd90605d13 | [
"BSD-2-Clause"
] | null | null | null | projDir/qc/scripts/PlotSelfConRuns.py | NCAR/lrose-uw-general | d317aad5e1250f131e24c83f4e17b9cd90605d13 | [
"BSD-2-Clause"
] | null | null | null | projDir/qc/scripts/PlotSelfConRuns.py | NCAR/lrose-uw-general | d317aad5e1250f131e24c83f4e17b9cd90605d13 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#===========================================================================
#
# Plot Ray details for KDP analysis
#
#===========================================================================
import os
import sys
import subprocess
from optparse import OptionParser
import numpy as np
import mat... | 30.810552 | 132 | 0.55316 |
import os
import sys
import subprocess
from optparse import OptionParser
import numpy as np
import matplotlib.pyplot as plt
import math
def main():
global options
global dirPath
global fileIndex
global fileList
global colHeaders
global colData
global rayTime
global eleva... | false | true |
f7357920e547b4be28ed27139ff673d4193773ae | 3,065 | py | Python | source/__init__.py | Mozzo1000/InstPakg | 994e608e1ec9ab465d5533f656f12b792191c8ba | [
"MIT"
] | null | null | null | source/__init__.py | Mozzo1000/InstPakg | 994e608e1ec9ab465d5533f656f12b792191c8ba | [
"MIT"
] | 10 | 2015-01-04T17:52:41.000Z | 2016-09-13T10:24:29.000Z | source/__init__.py | Mozzo1000/InstPakg | 994e608e1ec9ab465d5533f656f12b792191c8ba | [
"MIT"
] | null | null | null | import subprocess, os, glob, GlobalUtils, InstallUtil, Platform
from JsonUtil import *
from menu import cmenu
yes = set(["yes", "y"])
home = os.getenv("HOME")
JSON_LOCATION = home + "/.instpakg"
DEFAULT_JSON = JSON_LOCATION + "/DEFAULT.json"
jsonInstall = ""
markedInstall = []
markedRepo = []
markedCommand = []
def i... | 29.190476 | 151 | 0.685808 | import subprocess, os, glob, GlobalUtils, InstallUtil, Platform
from JsonUtil import *
from menu import cmenu
yes = set(["yes", "y"])
home = os.getenv("HOME")
JSON_LOCATION = home + "/.instpakg"
DEFAULT_JSON = JSON_LOCATION + "/DEFAULT.json"
jsonInstall = ""
markedInstall = []
markedRepo = []
markedCommand = []
def i... | true | true |
f7357a1b2dc90ab618025ec2ebb1d5489605bacc | 6,803 | py | Python | homeassistant/components/rachio/device.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/rachio/device.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 47 | 2020-07-23T07:14:33.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/rachio/device.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Adapter to wrap the rachiopy api for home assistant."""
import logging
from typing import Optional
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, HTTP_OK
from .const import (
KEY_DEVICES,
KEY_ENABLED,
KEY_EXTERNAL_ID,
KEY_FLEX_SCHEDULES,
KEY_ID,
KEY_MAC_ADDRESS,
KEY_MODEL,
... | 35.248705 | 99 | 0.619727 |
import logging
from typing import Optional
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, HTTP_OK
from .const import (
KEY_DEVICES,
KEY_ENABLED,
KEY_EXTERNAL_ID,
KEY_FLEX_SCHEDULES,
KEY_ID,
KEY_MAC_ADDRESS,
KEY_MODEL,
KEY_NAME,
KEY_SCHEDULES,
KEY_SERIAL_NUMBER,
... | true | true |
f7357a8b2241352c0879bff1d1c3197b6697f15c | 3,061 | py | Python | code/embedding/io_utils.py | WanzhengZhu/SHMM | 506ac565fcdea8176c616a9eb02853c4104ff1f0 | [
"MIT"
] | 11 | 2018-11-06T05:30:19.000Z | 2021-08-29T06:30:14.000Z | code/embedding/io_utils.py | WanzhengZhu/SHMM | 506ac565fcdea8176c616a9eb02853c4104ff1f0 | [
"MIT"
] | null | null | null | code/embedding/io_utils.py | WanzhengZhu/SHMM | 506ac565fcdea8176c616a9eb02853c4104ff1f0 | [
"MIT"
] | 3 | 2020-10-23T14:57:33.000Z | 2021-10-08T10:29:41.000Z | from tweet_handler import Tweet, POI
import paras
from random import *
from time import time, ctime
from collections import defaultdict
import numpy as np
from sys import platform
import multiprocessing
from multiprocessing import *
from functools import partial
import cPickle as pickle
class IO:
def __init__(self... | 39.24359 | 129 | 0.590983 | from tweet_handler import Tweet, POI
import paras
from random import *
from time import time, ctime
from collections import defaultdict
import numpy as np
from sys import platform
import multiprocessing
from multiprocessing import *
from functools import partial
import cPickle as pickle
class IO:
def __init__(self... | false | true |
f7357be79ed5cf787004c67c6e35b3966042133a | 659 | py | Python | ouch_server.py | jahinzee/theouchteam | 870767cae81ad37b4191ded64c3e83eb48be982a | [
"MIT"
] | 3 | 2022-01-09T02:40:31.000Z | 2022-02-01T03:57:40.000Z | ouch_server.py | jahinzee/theouchteam | 870767cae81ad37b4191ded64c3e83eb48be982a | [
"MIT"
] | null | null | null | ouch_server.py | jahinzee/theouchteam | 870767cae81ad37b4191ded64c3e83eb48be982a | [
"MIT"
] | 1 | 2022-01-21T08:05:27.000Z | 2022-01-21T08:05:27.000Z | import sys
from src.Exchange import Exchange
if __name__ == "__main__":
exchange = None
if len(sys.argv) == 2:
if sys.argv[1] == "debug":
# Exchange outputs using debug mode.
exchange = Exchange(debug="dump")
elif sys.argv[1] == "none":
# Exchange won't outp... | 32.95 | 86 | 0.608498 | import sys
from src.Exchange import Exchange
if __name__ == "__main__":
exchange = None
if len(sys.argv) == 2:
if sys.argv[1] == "debug":
exchange = Exchange(debug="dump")
elif sys.argv[1] == "none":
exchange = Exchange(debug="none")
el... | true | true |
f7357d01e959dfee06c677343477559f2ba68a03 | 77 | py | Python | form.py | kdvuong/cgi-lab | b1e3a68d60607fd93124dab4e9f1b396525fa361 | [
"Apache-2.0"
] | null | null | null | form.py | kdvuong/cgi-lab | b1e3a68d60607fd93124dab4e9f1b396525fa361 | [
"Apache-2.0"
] | null | null | null | form.py | kdvuong/cgi-lab | b1e3a68d60607fd93124dab4e9f1b396525fa361 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from templates import login_page
print(login_page())
| 15.4 | 32 | 0.779221 |
from templates import login_page
print(login_page())
| true | true |
f7357d5f9b4f7560bb8c442eea0df6889de78578 | 1,870 | py | Python | re/noasm/noasm.py | Enigmatrix/hats-ctf-2019 | 0dc1b9a5a4583c81b5f1b7bce0cbb9bd0fd2b192 | [
"MIT"
] | 5 | 2019-10-04T07:20:37.000Z | 2021-06-15T21:34:07.000Z | re/noasm/noasm.py | Enigmatrix/hats-ctf-2019 | 0dc1b9a5a4583c81b5f1b7bce0cbb9bd0fd2b192 | [
"MIT"
] | null | null | null | re/noasm/noasm.py | Enigmatrix/hats-ctf-2019 | 0dc1b9a5a4583c81b5f1b7bce0cbb9bd0fd2b192 | [
"MIT"
] | null | null | null | (lambda __print, __g, __y: [[[[[(lambda __after: (sys.stdout.write('Tell me the flag and I will let you know if you are right: '), [(lambda __after: (__print('WRONG'), (exit(0), __after())[1])[1] if (len(pw) != 19) else __after())(lambda: [(lambda __after: (__print('WRONG1'), (exit(0), __after())[1])[1] if (int(('0x' +... | 935 | 1,869 | 0.614439 | (lambda __print, __g, __y: [[[[[(lambda __after: (sys.stdout.write('Tell me the flag and I will let you know if you are right: '), [(lambda __after: (__print('WRONG'), (exit(0), __after())[1])[1] if (len(pw) != 19) else __after())(lambda: [(lambda __after: (__print('WRONG1'), (exit(0), __after())[1])[1] if (int(('0x' +... | true | true |
f7357e78f2b00cc46ec38e6ad37d15b3b25e3b9c | 11,240 | py | Python | src/fora/logger.py | oddlama/forge | d09b0f309ce7dcda79dc03765473b48732c71845 | [
"MIT"
] | 14 | 2021-12-17T10:38:27.000Z | 2022-03-02T01:20:01.000Z | src/fora/logger.py | oddlama/forge | d09b0f309ce7dcda79dc03765473b48732c71845 | [
"MIT"
] | 2 | 2022-01-11T13:31:09.000Z | 2022-02-03T15:41:43.000Z | src/fora/logger.py | oddlama/forge | d09b0f309ce7dcda79dc03765473b48732c71845 | [
"MIT"
] | 2 | 2022-02-03T15:20:51.000Z | 2022-02-03T15:45:11.000Z | """
Provides logging utilities.
"""
import argparse
import difflib
import os
from dataclasses import dataclass
import sys
from types import TracebackType
from typing import Any, Optional, Type, cast
import fora
@dataclass
class State:
"""Global state for logging."""
indentation_level: int = 0
"""The cur... | 35.68254 | 142 | 0.607117 |
import argparse
import difflib
import os
from dataclasses import dataclass
import sys
from types import TracebackType
from typing import Any, Optional, Type, cast
import fora
@dataclass
class State:
indentation_level: int = 0
state: State = State()
def use_color() -> bool:
if not isinstance(cast(Any, fora... | true | true |
f7357f096bc6406d31f3e33568491d295f5029c8 | 390 | py | Python | zipline/pipeline/data/__init__.py | colin1alexander/zipline | ba42e6d8b972dcce9271526562ceff0cddd3fa30 | [
"Apache-2.0"
] | null | null | null | zipline/pipeline/data/__init__.py | colin1alexander/zipline | ba42e6d8b972dcce9271526562ceff0cddd3fa30 | [
"Apache-2.0"
] | null | null | null | zipline/pipeline/data/__init__.py | colin1alexander/zipline | ba42e6d8b972dcce9271526562ceff0cddd3fa30 | [
"Apache-2.0"
] | null | null | null | from .buyback_auth import CashBuybackAuthorizations, ShareBuybackAuthorizations
from .earnings import EarningsCalendar
from .equity_pricing import USEquityPricing
from .dataset import DataSet, Column, BoundColumn
__all__ = [
'BoundColumn',
'CashBuybackAuthorizations',
'Column',
'DataSet',
'Earnings... | 26 | 79 | 0.769231 | from .buyback_auth import CashBuybackAuthorizations, ShareBuybackAuthorizations
from .earnings import EarningsCalendar
from .equity_pricing import USEquityPricing
from .dataset import DataSet, Column, BoundColumn
__all__ = [
'BoundColumn',
'CashBuybackAuthorizations',
'Column',
'DataSet',
'Earnings... | true | true |
f7357f33e672630577c0e02a2ed8598fe2a5e84e | 5,045 | py | Python | telepot/aio/api.py | francesconazzaro/telepota | 571b9fec6bedecf487df121644d8c673e6c5fd8f | [
"MIT"
] | 30 | 2020-07-27T07:11:44.000Z | 2022-03-20T19:01:22.000Z | telepot/aio/api.py | francesconazzaro/telepota | 571b9fec6bedecf487df121644d8c673e6c5fd8f | [
"MIT"
] | 5 | 2021-03-23T04:53:01.000Z | 2022-02-19T20:31:57.000Z | telepot/aio/api.py | francesconazzaro/telepota | 571b9fec6bedecf487df121644d8c673e6c5fd8f | [
"MIT"
] | 3 | 2021-04-01T12:42:21.000Z | 2022-03-20T18:33:02.000Z | import asyncio
import aiohttp
import async_timeout
import atexit
import re
import json
from .. import exception
from ..api import _methodurl, _which_pool, _fileurl, _guess_filename
_loop = asyncio.get_event_loop()
_pools = {
'default': aiohttp.ClientSession(
connector=aiohttp.TCPConnector(limit=10),
... | 27.872928 | 99 | 0.622002 | import asyncio
import aiohttp
import async_timeout
import atexit
import re
import json
from .. import exception
from ..api import _methodurl, _which_pool, _fileurl, _guess_filename
_loop = asyncio.get_event_loop()
_pools = {
'default': aiohttp.ClientSession(
connector=aiohttp.TCPConnector(limit=10),
... | true | true |
f7357f7d0603789b73ae269c01659bd14c34341d | 279 | py | Python | build/android/pylib/sdk/dexdump.py | TwistedCore/external_v8 | c6725dab9be251fbfc6fd7d53c3513a23e78c36c | [
"BSD-3-Clause"
] | 27 | 2016-04-27T01:02:03.000Z | 2021-12-13T08:53:19.000Z | build/android/pylib/sdk/dexdump.py | TwistedCore/external_v8 | c6725dab9be251fbfc6fd7d53c3513a23e78c36c | [
"BSD-3-Clause"
] | 2 | 2017-03-09T09:00:50.000Z | 2017-09-21T15:48:20.000Z | build/android/pylib/sdk/dexdump.py | TwistedCore/external_v8 | c6725dab9be251fbfc6fd7d53c3513a23e78c36c | [
"BSD-3-Clause"
] | 17 | 2016-04-27T02:06:39.000Z | 2019-12-18T08:07:00.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=unused-wildcard-import
# pylint: disable=wildcard-import
from devil.android.sdk.dexdump import *
| 31 | 72 | 0.777778 |
from devil.android.sdk.dexdump import *
| true | true |
f7357f866eb662ed69801854fd44d5c0190179f2 | 281 | py | Python | pypro/videos/admin.py | limberger/curso-django | 9b099a9934871c221be2018d2e80331e90bee40f | [
"Apache-2.0"
] | null | null | null | pypro/videos/admin.py | limberger/curso-django | 9b099a9934871c221be2018d2e80331e90bee40f | [
"Apache-2.0"
] | 1,012 | 2020-06-22T21:43:39.000Z | 2022-03-31T22:09:32.000Z | pypro/videos/admin.py | limberger/curso-django | 9b099a9934871c221be2018d2e80331e90bee40f | [
"Apache-2.0"
] | null | null | null | from django.contrib.admin import ModelAdmin, register
from pypro.videos.models import Video
@register(Video)
class VideoAdmin(ModelAdmin):
list_display = ('titulo', 'slug', 'creation', 'vimeo_id')
ordering = ('creation',)
prepopulated_fields = {'slug': ('titulo',)}
| 25.545455 | 61 | 0.708185 | from django.contrib.admin import ModelAdmin, register
from pypro.videos.models import Video
@register(Video)
class VideoAdmin(ModelAdmin):
list_display = ('titulo', 'slug', 'creation', 'vimeo_id')
ordering = ('creation',)
prepopulated_fields = {'slug': ('titulo',)}
| true | true |
f7357ff2a287f8a4fe49e760b1035fd94b80cf88 | 1,663 | py | Python | python2.7/site-packages/twisted/words/test/test_xmlstream.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 4 | 2020-10-31T19:52:05.000Z | 2021-09-22T11:39:27.000Z | python2.7/site-packages/twisted/words/test/test_xmlstream.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | null | null | null | python2.7/site-packages/twisted/words/test/test_xmlstream.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 2 | 2020-02-27T08:28:35.000Z | 2020-09-13T12:39:26.000Z | # Copyright (c) 2001-2005 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.words.xish import xmlstream
class XmlStreamTest(unittest.TestCase):
def setUp(self):
self.errorOccurred = False
self.streamStarted = False
self.streamEnded = Fa... | 31.980769 | 60 | 0.641612 |
from twisted.trial import unittest
from twisted.words.xish import xmlstream
class XmlStreamTest(unittest.TestCase):
def setUp(self):
self.errorOccurred = False
self.streamStarted = False
self.streamEnded = False
self.outlist = []
self.xmlstream = xmlstream.XmlStream()
... | true | true |
f73581a462f72f903e4554626bd267decbf52903 | 1,960 | py | Python | gluonfr/__init__.py | PistonY/gluon-face | 22f1e22de38fdee0873b4e58b6608029947176b8 | [
"MIT"
] | null | null | null | gluonfr/__init__.py | PistonY/gluon-face | 22f1e22de38fdee0873b4e58b6608029947176b8 | [
"MIT"
] | null | null | null | gluonfr/__init__.py | PistonY/gluon-face | 22f1e22de38fdee0873b4e58b6608029947176b8 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2018 Haoxintong
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | 40.833333 | 96 | 0.728571 |
mx_version = '1.3.0'
try:
import mxnet as mx
from distutils.version import LooseVersion
if LooseVersion(mx.__version__) < LooseVersion(mx_version):
msg = (
"Legacy mxnet=={} detected, some new modules may not work properly. "
"mxnet>={} is required. You... | true | true |
f735821d09b9dcf71de0937f5941d9f078d8ceaa | 337 | py | Python | evaluate/__init__.py | beesk135/ReID-Survey | d1467c0ce5d3ca78640196360a05df9ff9f9f42a | [
"MIT"
] | null | null | null | evaluate/__init__.py | beesk135/ReID-Survey | d1467c0ce5d3ca78640196360a05df9ff9f9f42a | [
"MIT"
] | null | null | null | evaluate/__init__.py | beesk135/ReID-Survey | d1467c0ce5d3ca78640196360a05df9ff9f9f42a | [
"MIT"
] | null | null | null | import torch
from .eval_reid import eval_func
def euclidean_dist(x, y):
m, n = x.size(0), y.size(0)
xx = torch.pow(x, 2).sum(1, keepdim=True).expand(m, n)
yy = torch.pow(y, 2).sum(1, keepdim=True).expand(n, m).t()
dist = xx + yy
dist.addmm_(1, -2, x, y.t())
dist = dist.clamp(min=1e-12).sqrt()... | 25.923077 | 62 | 0.593472 | import torch
from .eval_reid import eval_func
def euclidean_dist(x, y):
m, n = x.size(0), y.size(0)
xx = torch.pow(x, 2).sum(1, keepdim=True).expand(m, n)
yy = torch.pow(y, 2).sum(1, keepdim=True).expand(n, m).t()
dist = xx + yy
dist.addmm_(1, -2, x, y.t())
dist = dist.clamp(min=1e-12).sqrt()... | true | true |
f73583333cac8f652fd8a032023c0f6c9eec6ce6 | 4,328 | py | Python | airbyte-integrations/connectors/source-shopify/source_shopify/transform.py | darian-heede/airbyte | 504580d833582f8800b334f24e57a414d94389bf | [
"MIT"
] | 6,215 | 2020-09-21T13:45:56.000Z | 2022-03-31T21:21:45.000Z | airbyte-integrations/connectors/source-shopify/source_shopify/transform.py | darian-heede/airbyte | 504580d833582f8800b334f24e57a414d94389bf | [
"MIT"
] | 8,448 | 2020-09-21T00:43:50.000Z | 2022-03-31T23:56:06.000Z | airbyte-integrations/connectors/source-shopify/source_shopify/transform.py | darian-heede/airbyte | 504580d833582f8800b334f24e57a414d94389bf | [
"MIT"
] | 1,251 | 2020-09-20T05:48:47.000Z | 2022-03-31T10:41:29.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from decimal import Decimal
from typing import Any, Iterable, List, Mapping, MutableMapping
class DataTypeEnforcer:
"""
Transform class was implemented according to issue #4841
Shopify API returns price fields as a string and it should be conve... | 42.431373 | 108 | 0.644871 |
from decimal import Decimal
from typing import Any, Iterable, List, Mapping, MutableMapping
class DataTypeEnforcer:
def __init__(self, schema: Mapping[str, Any], **kwargs):
super().__init__(**kwargs)
self._schema = schema
@staticmethod
def _get_json_types(value_type: Any) -> List[str... | true | true |
f7358382ed2ef8f8d84e4774cf6e92ccc29c2f89 | 153 | py | Python | melenium/__init__.py | a-maliarov/melenium | c71b79e6533c16fd638e7a7b84afaf5d16620cf9 | [
"MIT"
] | 1 | 2020-11-01T01:40:32.000Z | 2020-11-01T01:40:32.000Z | melenium/__init__.py | a-maliarov/melenium | c71b79e6533c16fd638e7a7b84afaf5d16620cf9 | [
"MIT"
] | null | null | null | melenium/__init__.py | a-maliarov/melenium | c71b79e6533c16fd638e7a7b84afaf5d16620cf9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
melenium
~~~~~~~~
Routine automation.
"""
#-----------------------------------------------------------------------------
| 12.75 | 78 | 0.228758 | true | true | |
f7358511e96f3ea4c1daa0a9f0cf003f4b29702b | 1,400 | py | Python | eventstreamexamples/controllers/geventeventstream.py | nh2/eventstreamexamples | f8f7801e65c259c3b0dd625c54c92a48ddbe57ba | [
"MirOS"
] | 3 | 2016-05-24T18:41:55.000Z | 2019-01-24T22:49:19.000Z | eventstreamexamples/controllers/geventeventstream.py | nh2/eventstreamexamples | f8f7801e65c259c3b0dd625c54c92a48ddbe57ba | [
"MirOS"
] | null | null | null | eventstreamexamples/controllers/geventeventstream.py | nh2/eventstreamexamples | f8f7801e65c259c3b0dd625c54c92a48ddbe57ba | [
"MirOS"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Example controller for SSE (server-side events) with gevent.
Builds on the simple SSE controller.
"""
import sys
import time
import gevent.queue
from tg import expose, request, response
from tg import url
from tg.decorators import with_trailing_slash
from eventstream import EventstreamCo... | 28 | 101 | 0.742857 |
import sys
import time
import gevent.queue
from tg import expose, request, response
from tg import url
from tg.decorators import with_trailing_slash
from eventstream import EventstreamController
class GeventEventstreamController(EventstreamController):
client_queues = set()
@expose()
@with_trailing_slash
... | true | true |
f735867beaac222b21e732102f425ed101d44aac | 11,985 | py | Python | analysisAPI/scoringErrors.py | xujin1184104394/coco-analyze | fefe16025554dbf831e71d32d6601dd8f00286a8 | [
"MIT"
] | 212 | 2017-07-19T19:06:34.000Z | 2022-03-31T07:19:05.000Z | analysisAPI/scoringErrors.py | xujin1184104394/coco-analyze | fefe16025554dbf831e71d32d6601dd8f00286a8 | [
"MIT"
] | 23 | 2017-09-06T08:43:18.000Z | 2022-02-09T20:12:18.000Z | analysisAPI/scoringErrors.py | xujin1184104394/coco-analyze | fefe16025554dbf831e71d32d6601dd8f00286a8 | [
"MIT"
] | 56 | 2017-07-27T03:53:13.000Z | 2021-12-21T11:03:13.000Z | ## imports
import os, time
import numpy as np
import matplotlib.pyplot as plt
# package imports
from . import utilities
def scoringErrors( coco_analyze, oks, imgs_info, saveDir ):
loc_dir = saveDir + '/scoring_errors'
if not os.path.exists(loc_dir):
os.makedirs(loc_dir)
f = open('%s/std_out.txt'%... | 45.226415 | 146 | 0.607593 | s, time
import numpy as np
import matplotlib.pyplot as plt
from . import utilities
def scoringErrors( coco_analyze, oks, imgs_info, saveDir ):
loc_dir = saveDir + '/scoring_errors'
if not os.path.exists(loc_dir):
os.makedirs(loc_dir)
f = open('%s/std_out.txt'%loc_dir, 'w')
f.write("Running An... | true | true |
f7358708cd30b3f0af4b546e1d5910f83058771f | 2,827 | py | Python | check_c_compiles.py | jweinst1/pysimd | 62bf99f8b9f4ca3d06bf59add960ff408f5781f7 | [
"MIT"
] | 7 | 2020-09-13T22:18:28.000Z | 2022-02-12T09:03:07.000Z | check_c_compiles.py | jweinst1/pysimd | 62bf99f8b9f4ca3d06bf59add960ff408f5781f7 | [
"MIT"
] | 1 | 2020-09-13T22:20:21.000Z | 2021-11-20T16:47:03.000Z | check_c_compiles.py | jweinst1/pysimd | 62bf99f8b9f4ca3d06bf59add960ff408f5781f7 | [
"MIT"
] | null | null | null | import distutils.ccompiler
import os
import random
import subprocess
"""
These classes allow a test to see if source code with the C compiler actually
compiles.
"""
DEFAULT_COMPILER = distutils.ccompiler.get_default_compiler()
C_EXTENSION = ".c"
def create_file_with_rand_name(source):
cur_dir = os.getcwd()
... | 35.3375 | 98 | 0.600637 | import distutils.ccompiler
import os
import random
import subprocess
DEFAULT_COMPILER = distutils.ccompiler.get_default_compiler()
C_EXTENSION = ".c"
def create_file_with_rand_name(source):
cur_dir = os.getcwd()
rand_file = os.path.join(cur_dir, "c_" + str(random.getrandbits(72)))
while os.path.exists(r... | true | true |
f73588a79f039b8db733da153b11843e379f5638 | 38,694 | py | Python | test/functional/test_framework/messages.py | POPChainFoundation/Popchain | 4106c0eab2fe437ae8d12e9f8697e1b6a5bebeaa | [
"MIT"
] | 1 | 2019-05-13T01:58:35.000Z | 2019-05-13T01:58:35.000Z | test/functional/test_framework/messages.py | POPCHAINFoundation/POPCHAIN | 4106c0eab2fe437ae8d12e9f8697e1b6a5bebeaa | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | POPCHAINFoundation/POPCHAIN | 4106c0eab2fe437ae8d12e9f8697e1b6a5bebeaa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | 29.447489 | 262 | 0.596527 |
from codecs import encode
import copy
import hashlib
from io import BytesIO
import random
import socket
import struct
import time
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str
MIN_VERSION_SUPPORTED = 60001
MY_VERSION = 70914
MY_SUBVERSION = b"... | true | true |
f7358b894c9e2d136a400ac7dfc5cf2f4426b4be | 32,488 | py | Python | benchmarks/analysisScripts/VivadoGraphUtil.py | magic3007/AMF-Placer | b6fbc10c37c3259c2b4f99ce0bb03c9d96bc29bd | [
"Apache-2.0"
] | 37 | 2021-09-25T04:31:27.000Z | 2022-03-24T13:46:52.000Z | benchmarks/analysisScripts/VivadoGraphUtil.py | magic3007/AMF-Placer | b6fbc10c37c3259c2b4f99ce0bb03c9d96bc29bd | [
"Apache-2.0"
] | 5 | 2021-11-01T13:27:46.000Z | 2022-03-10T07:52:51.000Z | benchmarks/analysisScripts/VivadoGraphUtil.py | magic3007/AMF-Placer | b6fbc10c37c3259c2b4f99ce0bb03c9d96bc29bd | [
"Apache-2.0"
] | 7 | 2021-09-26T07:34:09.000Z | 2022-02-15T08:06:20.000Z | import networkx as nx
class VivadoCell(object):
def __init__(self, id, name, refType, pins, netStr, drivepinStr):
self.id = id
self.name = name
self.refType = refType
self.pins = pins
self.netStr = netStr
self.drivepinStr = drivepinStr
self.drivepins_fromOth... | 39.523114 | 151 | 0.566886 | import networkx as nx
class VivadoCell(object):
def __init__(self, id, name, refType, pins, netStr, drivepinStr):
self.id = id
self.name = name
self.refType = refType
self.pins = pins
self.netStr = netStr
self.drivepinStr = drivepinStr
self.drivepins_fromOth... | true | true |
f7358ba007f332d22e83dabe5d8ad657102b156a | 12,059 | py | Python | SegFault/CosmoNet.py | NERSC/CosmoFlow | 28937fad012b8bf854916527ebfc74f60de0ac26 | [
"BSD-2-Clause"
] | 15 | 2018-09-17T09:51:18.000Z | 2021-06-29T16:46:22.000Z | SegFault/CosmoNet.py | NERSC/CosmoFlow | 28937fad012b8bf854916527ebfc74f60de0ac26 | [
"BSD-2-Clause"
] | null | null | null | SegFault/CosmoNet.py | NERSC/CosmoFlow | 28937fad012b8bf854916527ebfc74f60de0ac26 | [
"BSD-2-Clause"
] | 7 | 2018-03-07T08:50:13.000Z | 2021-05-02T22:10:06.000Z | ## for this one, change the order between relu and batch
import tensorflow as tf
import numpy as np
from io_Cosmo import *
import hyper_parameters_Cosmo as hp
import time
from numpy import linalg as LA
def weight_variable(shape,name):
W = tf.get_variable(name,shape=shape, initializer=tf.contrib.layers.xavier_initia... | 49.625514 | 237 | 0.657434 | smo import *
import hyper_parameters_Cosmo as hp
import time
from numpy import linalg as LA
def weight_variable(shape,name):
W = tf.get_variable(name,shape=shape, initializer=tf.contrib.layers.xavier_initializer())
return W
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf... | false | true |
f7358caf50482925da5a23ef389374bc85f3fa4f | 623 | py | Python | streetteam/apps/twilio_integration/tests/factories.py | alysivji/street-team | fe891d738b449956d56fe5e53535b98fa04d9a3a | [
"MIT"
] | 2 | 2020-01-22T17:49:10.000Z | 2021-06-18T19:35:23.000Z | streetteam/apps/twilio_integration/tests/factories.py | alysivji/street-team | fe891d738b449956d56fe5e53535b98fa04d9a3a | [
"MIT"
] | 41 | 2019-11-08T18:28:16.000Z | 2022-03-12T00:28:51.000Z | streetteam/apps/twilio_integration/tests/factories.py | alysivji/street-team | fe891d738b449956d56fe5e53535b98fa04d9a3a | [
"MIT"
] | null | null | null | from faker_e164.providers import E164Provider
import factory
from apps.twilio_integration.models import PhoneNumber, ReceivedMessage
from apps.users.tests.factories import UserFactory
faker = factory.Faker._get_faker()
faker.add_provider(E164Provider)
class PhoneNumberFactory(factory.DjangoModelFactory):
class ... | 25.958333 | 71 | 0.788122 | from faker_e164.providers import E164Provider
import factory
from apps.twilio_integration.models import PhoneNumber, ReceivedMessage
from apps.users.tests.factories import UserFactory
faker = factory.Faker._get_faker()
faker.add_provider(E164Provider)
class PhoneNumberFactory(factory.DjangoModelFactory):
class ... | true | true |
f7358de2b3a85d446fdedfc665ba390ed788f26b | 9,066 | py | Python | themes/qutebrowser/themes/minimal/base16-black-metal-burzum.config.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | 95 | 2018-05-28T18:06:48.000Z | 2022-03-14T21:36:05.000Z | themes/qutebrowser/themes/minimal/base16-black-metal-burzum.config.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | 18 | 2018-08-26T00:57:20.000Z | 2022-02-19T08:29:29.000Z | themes/qutebrowser/themes/minimal/base16-black-metal-burzum.config.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | 20 | 2018-06-21T12:41:47.000Z | 2022-03-04T22:06:20.000Z | # base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova and Daniel Mulford
# Black Metal (Burzum) scheme by metalelf0 (https://github.com/metalelf0)
base00 = "#000000"
base01 = "#121212"
base02 = "#222222"
base03 = "#333333"
base04 = "#999999"
base05 = "#c1c1c1"
base... | 30.119601 | 95 | 0.771785 |
base00 = "#000000"
base01 = "#121212"
base02 = "#222222"
base03 = "#333333"
base04 = "#999999"
base05 = "#c1c1c1"
base06 = "#999999"
base07 = "#c1c1c1"
base08 = "#5f8787"
base09 = "#aaaaaa"
base0A = "#99bbaa"
base0B = "#ddeecc"
base0C = "#aaaaaa"
base0D = "#888888"
base0E = "#999999"
base0F = "#444444"
c.color... | true | true |
f7358e33875f1666cf2ed6367496e9ffeb2ca861 | 243 | py | Python | bootcamp/__init__.py | jmelloy/bootcamp | 3710324efd4dbc54bb37df13ee589ef8a71c6401 | [
"MIT"
] | null | null | null | bootcamp/__init__.py | jmelloy/bootcamp | 3710324efd4dbc54bb37df13ee589ef8a71c6401 | [
"MIT"
] | null | null | null | bootcamp/__init__.py | jmelloy/bootcamp | 3710324efd4dbc54bb37df13ee589ef8a71c6401 | [
"MIT"
] | null | null | null | __version__ = "2.1.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
import os
PHOTOLOGUE_APP_DIR = os.path.dirname(os.path.abspath(__file__))
| 22.090909 | 63 | 0.625514 | __version__ = "2.1.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
import os
PHOTOLOGUE_APP_DIR = os.path.dirname(os.path.abspath(__file__))
| true | true |
f7358e70170d77fd5aaed0097cbc37b6df6184c7 | 2,647 | py | Python | tests/core/test_configuration.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 81 | 2015-01-13T15:16:43.000Z | 2021-11-12T20:51:56.000Z | tests/core/test_configuration.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 1 | 2015-07-30T06:17:55.000Z | 2015-07-30T08:09:14.000Z | tests/core/test_configuration.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 30 | 2015-03-26T11:55:46.000Z | 2021-07-22T22:16:39.000Z | '''
Tests for intuition.core.configuration
'''
import unittest
from nose.tools import raises
import dna.test_utils as test_utils
import pandas as pd
import intuition.core.configuration as configuration
from dna.errors import DynamicImportFailed
from intuition.errors import InvalidConfiguration
class ConfigurationUti... | 33.506329 | 76 | 0.661504 |
import unittest
from nose.tools import raises
import dna.test_utils as test_utils
import pandas as pd
import intuition.core.configuration as configuration
from dna.errors import DynamicImportFailed
from intuition.errors import InvalidConfiguration
class ConfigurationUtilsTestCase(unittest.TestCase):
def test_lo... | true | true |
f7358ed7f0d201bb0afca8493fb1a699d5fdbefa | 1,892 | py | Python | pyheatmap/inc/cf.py | feixuexue731/pyheatmap | 5dcd774113e3fe65c5e891c8c686f991310f4835 | [
"MIT"
] | 90 | 2015-02-25T09:09:45.000Z | 2022-03-22T06:12:41.000Z | pyheatmap/inc/cf.py | feixuexue731/pyheatmap | 5dcd774113e3fe65c5e891c8c686f991310f4835 | [
"MIT"
] | 8 | 2016-01-17T12:30:45.000Z | 2021-02-20T02:19:42.000Z | pyheatmap/inc/cf.py | feixuexue731/pyheatmap | 5dcd774113e3fe65c5e891c8c686f991310f4835 | [
"MIT"
] | 45 | 2015-09-07T03:13:38.000Z | 2021-09-08T09:32:04.000Z | # -*- coding: utf-8 -*-
#
# author: oldj
# blog: http://oldj.net
# email: oldj.wu@gmail.com
#
def get_max_size(data):
max_w = 0
max_h = 0
for hit in data:
w = hit[0]
h = hit[1]
if w > max_w:
max_w = w
if h > max_h:
max_h = h
return max_w + 1, m... | 18.732673 | 72 | 0.415433 |
def get_max_size(data):
max_w = 0
max_h = 0
for hit in data:
w = hit[0]
h = hit[1]
if w > max_w:
max_w = w
if h > max_h:
max_h = h
return max_w + 1, max_h + 1
def mk_circle(r, w):
__tmp = {}
def c8(ix, iy, v=1):
... | true | true |
f7358f102d8b55267e43a51cd253bac4d62bfe84 | 11,512 | py | Python | aiodocker/images.py | truenas/aiodocker | 8edefe73832d62d70fa11a4846594bc74ae12244 | [
"Apache-2.0"
] | 330 | 2017-04-12T19:36:03.000Z | 2022-03-29T09:24:53.000Z | aiodocker/images.py | truenas/aiodocker | 8edefe73832d62d70fa11a4846594bc74ae12244 | [
"Apache-2.0"
] | 623 | 2017-04-13T02:49:16.000Z | 2022-03-29T12:21:48.000Z | aiodocker/images.py | truenas/aiodocker | 8edefe73832d62d70fa11a4846594bc74ae12244 | [
"Apache-2.0"
] | 76 | 2017-04-22T08:00:18.000Z | 2021-11-23T04:34:06.000Z | import io
import json
import warnings
from typing import (
Any,
AsyncIterator,
BinaryIO,
Dict,
List,
Mapping,
MutableMapping,
Optional,
Union,
overload,
)
from typing_extensions import Literal
from .jsonstream import json_stream_list, json_stream_stream
from .utils import clean... | 28.997481 | 88 | 0.54491 | import io
import json
import warnings
from typing import (
Any,
AsyncIterator,
BinaryIO,
Dict,
List,
Mapping,
MutableMapping,
Optional,
Union,
overload,
)
from typing_extensions import Literal
from .jsonstream import json_stream_list, json_stream_stream
from .utils import clean... | true | true |
f7358f1fc61f6b30105dd15fc7f8b44549bc1982 | 258 | py | Python | blob_upload/file_helpers.py | benchling/integration-examples | 450dc8b712cca9d037f65fd97b2f41ba2010cdc9 | [
"MIT"
] | 22 | 2019-08-01T13:30:34.000Z | 2021-07-05T18:39:48.000Z | blob_upload/file_helpers.py | benchling/integration-examples | 450dc8b712cca9d037f65fd97b2f41ba2010cdc9 | [
"MIT"
] | 6 | 2020-12-11T20:23:18.000Z | 2021-07-14T14:46:09.000Z | blob_upload/file_helpers.py | benchling/integration-examples | 450dc8b712cca9d037f65fd97b2f41ba2010cdc9 | [
"MIT"
] | 10 | 2019-10-24T20:13:04.000Z | 2022-03-07T23:48:53.000Z | import base64
import hashlib
def encode_base64(input: bytes, charset: str = "utf-8") -> str:
file_bytes = base64.encodebytes(input)
return str(file_bytes, charset)
def calculate_md5(input: bytes) -> str:
return hashlib.md5(input).hexdigest()
| 21.5 | 63 | 0.717054 | import base64
import hashlib
def encode_base64(input: bytes, charset: str = "utf-8") -> str:
file_bytes = base64.encodebytes(input)
return str(file_bytes, charset)
def calculate_md5(input: bytes) -> str:
return hashlib.md5(input).hexdigest()
| true | true |
f7359067e433351f05d256c61799cc63ae1d5082 | 838 | py | Python | src/hydratk/translation/lib/network/rpc/client/en/messages.py | hydratk/hydratk-lib-network | 79b698998bac9a04b5a345e5d3212c87b5564af3 | [
"BSD-3-Clause"
] | null | null | null | src/hydratk/translation/lib/network/rpc/client/en/messages.py | hydratk/hydratk-lib-network | 79b698998bac9a04b5a345e5d3212c87b5564af3 | [
"BSD-3-Clause"
] | null | null | null | src/hydratk/translation/lib/network/rpc/client/en/messages.py | hydratk/hydratk-lib-network | 79b698998bac9a04b5a345e5d3212c87b5564af3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""This code is a part of Hydra Toolkit
.. module:: hydratk.translation.lib.network.rpc.client.en.messages
:platform: Unix
:synopsis: English language translation for RPC client messages
.. moduleauthor:: Petr Rašek <bowman@hydratk.org>
"""
language = {
'name': 'English',
'ISO-... | 27.933333 | 83 | 0.663484 |
language = {
'name': 'English',
'ISO-639-1': 'en'
}
from hydratk.core import const
HIGHLIGHT_START = chr(27) + chr(91) + "1m"
HIGHLIGHT_US = chr(27) + chr(91) + "4m"
HIGHLIGHT_END = chr(27) + chr(91) + "0m"
msg = {
'htk_rpc_init_proxy': ["Initializing proxy remote object on URL: '{0}'"],
'htk_rpc_... | true | true |
f735914711797365715ac1d0348526c100afbf54 | 3,760 | py | Python | models/PS_FCN_run.py | rkripa/PS-FCN | eb8ddbd60964830c06432a734a2cf6dce34f70f0 | [
"MIT"
] | null | null | null | models/PS_FCN_run.py | rkripa/PS-FCN | eb8ddbd60964830c06432a734a2cf6dce34f70f0 | [
"MIT"
] | null | null | null | models/PS_FCN_run.py | rkripa/PS-FCN | eb8ddbd60964830c06432a734a2cf6dce34f70f0 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn.init import kaiming_normal_
from models import model_utils
class FeatExtractor(nn.Module):
def __init__(self, batchNorm=False, c_in=3, other={}):
super(FeatExtractor, self).__init__()
self.other = other
self.conv1 = model_utils.conv(batchNorm... | 40 | 98 | 0.573404 | import torch
import torch.nn as nn
from torch.nn.init import kaiming_normal_
from models import model_utils
class FeatExtractor(nn.Module):
def __init__(self, batchNorm=False, c_in=3, other={}):
super(FeatExtractor, self).__init__()
self.other = other
self.conv1 = model_utils.conv(batchNorm... | true | true |
f7359199ff6a7aec6e7054079162b69f2e952aac | 5,964 | py | Python | schema_salad/codegen.py | common-workflow-language/schema_salad | 4f7023a177e0fc575812ef5e6b997b575617d826 | [
"Apache-2.0"
] | 58 | 2015-09-08T03:06:59.000Z | 2022-01-26T21:04:54.000Z | schema_salad/codegen.py | common-workflow-language/schema_salad | 4f7023a177e0fc575812ef5e6b997b575617d826 | [
"Apache-2.0"
] | 396 | 2015-08-25T20:22:49.000Z | 2022-03-25T07:32:04.000Z | schema_salad/codegen.py | common-workflow-language/schema_salad | 4f7023a177e0fc575812ef5e6b997b575617d826 | [
"Apache-2.0"
] | 59 | 2015-12-02T16:22:00.000Z | 2022-02-13T19:16:24.000Z | """Generate langauge specific loaders for a particular SALAD schema."""
import sys
from io import TextIOWrapper
from typing import (
Any,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
TextIO,
Union,
)
from . import schema
from .codegen_base import CodeGenBase
from .exceptions i... | 34.275862 | 87 | 0.499497 | import sys
from io import TextIOWrapper
from typing import (
Any,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
TextIO,
Union,
)
from . import schema
from .codegen_base import CodeGenBase
from .exceptions import SchemaSaladException
from .java_codegen import JavaCodeGen
from .p... | true | true |
f7359261ef47ab64eabc1214f0c0236af27b2f49 | 546 | tac | Python | src/test/resources/fi/fmi/avi/converter/tac/swx/spacewx-invalid-forecast-hours.tac | fmidev/fmi-avi-messageconverter-tac | 32b9506a2608a975d7e7600e8be1fed86026f8c5 | [
"MIT"
] | null | null | null | src/test/resources/fi/fmi/avi/converter/tac/swx/spacewx-invalid-forecast-hours.tac | fmidev/fmi-avi-messageconverter-tac | 32b9506a2608a975d7e7600e8be1fed86026f8c5 | [
"MIT"
] | 72 | 2017-10-04T11:10:09.000Z | 2021-07-09T09:19:30.000Z | src/test/resources/fi/fmi/avi/converter/tac/swx/spacewx-invalid-forecast-hours.tac | spatineo/fmi-avi-messageconverter-tac | 9dc1f0be34ecbd63a31f7148e5e4e1009eafe9e9 | [
"MIT"
] | 3 | 2017-11-22T10:46:28.000Z | 2020-02-26T07:20:40.000Z | SWX ADVISORY
STATUS: TEST
DTG: 20200625/1605Z
SWXC: SWPC
ADVISORY NR: 2020/29
NR RPLC: 2020/28
SWX EFFECT: GNSS MOD
OBS SWX: 25/1605Z HNH HSH E180 - W180
FCST SWX +0 HR: 25/2300Z NO SWX EXP
FCST SWX +15 HR: 26/0500Z NO SWX EXP
FCST SWX +12 HR: 26/1100Z... | 39 | 135 | 0.6337 | SWX ADVISORY
STATUS: TEST
DTG: 20200625/1605Z
SWXC: SWPC
ADVISORY NR: 2020/29
NR RPLC: 2020/28
SWX EFFECT: GNSS MOD
OBS SWX: 25/1605Z HNH HSH E180 - W180
FCST SWX +0 HR: 25/2300Z NO SWX EXP
FCST SWX +15 HR: 26/0500Z NO SWX EXP
FCST SWX +12 HR: 26/1100Z... | false | true |
f73593201aaa44d50a228f9e03517ab39c039014 | 487 | py | Python | mepo.d/utilities/shellcmd.py | GEOS-ESM/mepo | 41c20c286e7a9a11995f48fb5f3036e469d935e6 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | null | null | null | mepo.d/utilities/shellcmd.py | GEOS-ESM/mepo | 41c20c286e7a9a11995f48fb5f3036e469d935e6 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 61 | 2020-01-08T20:01:16.000Z | 2022-03-24T19:44:38.000Z | mepo.d/utilities/shellcmd.py | GEOS-ESM/mepo | 41c20c286e7a9a11995f48fb5f3036e469d935e6 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-02-28T14:29:12.000Z | 2020-07-08T15:56:55.000Z | import subprocess as sp
def run(cmd, output=None, stdout=None, status=None):
result = sp.run(
cmd,
stdout = sp.PIPE,
stderr = sp.PIPE,
universal_newlines = True # result byte sequence -> string
)
if status:
return result.returncode
elif result.returncode != 0:
... | 23.190476 | 66 | 0.609856 | import subprocess as sp
def run(cmd, output=None, stdout=None, status=None):
result = sp.run(
cmd,
stdout = sp.PIPE,
stderr = sp.PIPE,
universal_newlines = True
)
if status:
return result.returncode
elif result.returncode != 0:
print(result.stderr)
... | true | true |
f735937b46eaaf17127373cb48ab6ef736904d0a | 752 | py | Python | ExploreDjango/mytestsite/mytestsite/urls.py | Devenc234/RecommenderSystem | dc64bdc132489c681aa672eb1baa1754c3ba5446 | [
"MIT"
] | null | null | null | ExploreDjango/mytestsite/mytestsite/urls.py | Devenc234/RecommenderSystem | dc64bdc132489c681aa672eb1baa1754c3ba5446 | [
"MIT"
] | null | null | null | ExploreDjango/mytestsite/mytestsite/urls.py | Devenc234/RecommenderSystem | dc64bdc132489c681aa672eb1baa1754c3ba5446 | [
"MIT"
] | null | null | null | """mytestsite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 34.181818 | 77 | 0.710106 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f7359403d676c6fc69eb4c7737770aa0243ffaac | 27,648 | py | Python | testflows/_core/contrib/pygments/lexers/basic.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | 3 | 2020-06-25T19:23:19.000Z | 2021-10-20T19:29:56.000Z | testflows/_core/contrib/pygments/lexers/basic.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | null | null | null | testflows/_core/contrib/pygments/lexers/basic.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | 1 | 2020-02-24T12:31:45.000Z | 2020-02-24T12:31:45.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.basic
~~~~~~~~~~~~~~~~~~~~~
Lexers for BASIC like languages (other than VB.net).
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from testflows._core.contrib.pygments.lexer import... | 41.890909 | 110 | 0.458731 |
import re
from testflows._core.contrib.pygments.lexer import RegexLexer, bygroups, default, words, include
from testflows._core.contrib.pygments.token import Comment, Error, Keyword, Name, Number, \
Punctuation, Operator, String, Text, Whitespace
from testflows._core.contrib.pygments.lexers import _vbscript_buil... | true | true |
f7359464763e4b55530c6e96bb22acbd33f087a1 | 375 | py | Python | onnx_tf/handlers/frontend/reduce_sum.py | jsigee87/onnx-tensorflow | 90a58bed24a18f5260ebe9f22bf4997f9d591f62 | [
"Apache-2.0"
] | 18 | 2020-02-03T07:14:40.000Z | 2021-12-20T18:45:43.000Z | onnx_tf/handlers/frontend/reduce_sum.py | jsigee87/onnx-tensorflow | 90a58bed24a18f5260ebe9f22bf4997f9d591f62 | [
"Apache-2.0"
] | 11 | 2020-01-28T23:16:25.000Z | 2022-02-10T01:04:56.000Z | onnx_tf/handlers/frontend/reduce_sum.py | jsigee87/onnx-tensorflow | 90a58bed24a18f5260ebe9f22bf4997f9d591f62 | [
"Apache-2.0"
] | 2 | 2020-08-20T08:15:09.000Z | 2021-02-23T07:30:40.000Z | from onnx_tf.handlers.frontend_handler import FrontendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_op
from .math_mixin import ReductionMixin
@onnx_op("ReduceSum")
@tf_op("Sum")
class ReduceSum(ReductionMixin, FrontendHandler):
@classmethod
def version_1(cls, node, ... | 26.785714 | 61 | 0.8 | from onnx_tf.handlers.frontend_handler import FrontendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_op
from .math_mixin import ReductionMixin
@onnx_op("ReduceSum")
@tf_op("Sum")
class ReduceSum(ReductionMixin, FrontendHandler):
@classmethod
def version_1(cls, node, ... | true | true |
f735949721e939de43ac48ed4c1dba57e72e9aed | 3,674 | py | Python | tests/test_words_grammar.py | piller-imre/exprail-python | 1b73a0993d399ef44ada232647845a253b821ecc | [
"MIT"
] | null | null | null | tests/test_words_grammar.py | piller-imre/exprail-python | 1b73a0993d399ef44ada232647845a253b821ecc | [
"MIT"
] | null | null | null | tests/test_words_grammar.py | piller-imre/exprail-python | 1b73a0993d399ef44ada232647845a253b821ecc | [
"MIT"
] | null | null | null | import unittest
from exprail.classifier import Classifier
from exprail.grammar import Grammar
from exprail.parser import Parser
from exprail.source import SourceString
class WsClassifier(Classifier):
"""Classify alphabetic characters and whitespaces"""
@staticmethod
def is_in_class(token_class, token):
... | 34.336449 | 86 | 0.629831 | import unittest
from exprail.classifier import Classifier
from exprail.grammar import Grammar
from exprail.parser import Parser
from exprail.source import SourceString
class WsClassifier(Classifier):
@staticmethod
def is_in_class(token_class, token):
if token.type == 'empty':
return Fals... | true | true |
f73594c6ed5d49a981b35e06fa1e6b1b78ca49b5 | 15,405 | py | Python | SurfaceTopography/Uniform/Filtering.py | ComputationalMechanics/SurfaceTopography | 6751be427c89d526ef4857300409596c79119029 | [
"MIT"
] | 5 | 2020-06-03T20:01:36.000Z | 2021-03-03T09:25:03.000Z | SurfaceTopography/Uniform/Filtering.py | ComputationalMechanics/SurfaceTopography | 6751be427c89d526ef4857300409596c79119029 | [
"MIT"
] | 44 | 2020-06-02T12:25:15.000Z | 2021-03-17T15:18:51.000Z | SurfaceTopography/Uniform/Filtering.py | ComputationalMechanics/SurfaceTopography | 6751be427c89d526ef4857300409596c79119029 | [
"MIT"
] | 1 | 2021-03-08T13:15:18.000Z | 2021-03-08T13:15:18.000Z | #
# Copyright 2020-2021 Lars Pastewka
# 2020-2021 Antoine Sanner
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitat... | 35.909091 | 94 | 0.6037 |
om scipy.signal import get_window
from ..FFTTricks import get_window_2D
from ..HeightContainer import UniformTopographyInterface
from ..UniformLineScanAndTopography import DecoratedUniformTopography
class WindowedUniformTopography(DecoratedUniformTopography):
name = 'windowed_topography'
def __init__(s... | true | true |
f73595bd73296f5a9f86ed94e3d8cb4509adbd1b | 1,762 | py | Python | samples/adexchangeseller/get_all_alerts.py | msaniscalchi/google-api-python-client | 5fdeffcdeb8934c6e3937852f47bbfcd1aad679b | [
"Apache-2.0"
] | 1 | 2022-03-28T23:51:23.000Z | 2022-03-28T23:51:23.000Z | samples/adexchangeseller/get_all_alerts.py | msaniscalchi/google-api-python-client | 5fdeffcdeb8934c6e3937852f47bbfcd1aad679b | [
"Apache-2.0"
] | null | null | null | samples/adexchangeseller/get_all_alerts.py | msaniscalchi/google-api-python-client | 5fdeffcdeb8934c6e3937852f47bbfcd1aad679b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 31.464286 | 77 | 0.695233 |
"""Gets all alerts available for the logged in user's account.
Tags: alerts.list
"""
__author__ = 'sgomes@google.com (Sérgio Gomes)'
import argparse
import sys
from googleapiclient import sample_tools
from oauth2client import client
def main(argv):
# Authenticate and construct service.
service... | false | true |
f73596d35f54a80081eb51834b2498b60a9102ed | 8,322 | py | Python | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 10 | 2019-05-11T18:07:14.000Z | 2021-08-20T03:02:47.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 1 | 2020-07-10T08:25:36.000Z | 2020-07-10T08:25:36.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/holiday_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 18 | 2019-08-19T12:11:00.000Z | 2021-10-12T09:36:27.000Z | from typing import List, Dict, Callable
from datetime import datetime
from recognizers_text.utilities import RegExpUtility
from ..utilities import DateUtils
from ..base_holiday import BaseHolidayParserConfiguration
from ...resources.french_date_time import FrenchDateTime
class FrenchHolidayParserConfiguration(BaseHo... | 36.340611 | 98 | 0.674718 | from typing import List, Dict, Callable
from datetime import datetime
from recognizers_text.utilities import RegExpUtility
from ..utilities import DateUtils
from ..base_holiday import BaseHolidayParserConfiguration
from ...resources.french_date_time import FrenchDateTime
class FrenchHolidayParserConfiguration(BaseHo... | true | true |
f73596d88c15690f02fa3a19c1a461cf4a7e91c2 | 2,282 | py | Python | ros/src/twist_controller/twist_controller.py | aresgtr/CarND-Capstone | 604e448972221e4770dbada9070c90717f2992ee | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | aresgtr/CarND-Capstone | 604e448972221e4770dbada9070c90717f2992ee | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | aresgtr/CarND-Capstone | 604e448972221e4770dbada9070c90717f2992ee | [
"MIT"
] | null | null | null | from pid import PID
from lowpass import LowPassFilter
from yaw_controller import YawController
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit,
accel_limit, wheel_radius, wheel_base, steer_ra... | 33.558824 | 109 | 0.643295 | from pid import PID
from lowpass import LowPassFilter
from yaw_controller import YawController
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit,
accel_limit, wheel_radius, wheel_base, steer_ra... | true | true |
f73597b85ba8ca40d9733200858fd68397b530e6 | 3,280 | py | Python | final_plots/read_aws.py | georgetown-analytics/DC-Bikeshare | 9f5a6a3256cff15a29f0dca6e9a9d8098ab2df28 | [
"MIT"
] | 11 | 2018-07-01T16:43:05.000Z | 2020-07-17T19:08:16.000Z | final_plots/read_aws.py | noahnewberger/Bikeshare-DC | 42676654d103cdaddfb76db76d1eece533251261 | [
"MIT"
] | 5 | 2021-02-08T20:21:12.000Z | 2021-12-13T19:47:04.000Z | final_plots/read_aws.py | noahnewberger/Bikeshare-DC | 42676654d103cdaddfb76db76d1eece533251261 | [
"MIT"
] | 5 | 2018-10-05T19:54:20.000Z | 2020-10-27T11:54:09.000Z | import psycopg2
import psycopg2.extras
import pandas as pd
import os
import time
from pathlib import Path
from dotenv import load_dotenv
def read_only_connect_aws():
env_path = 'env_readonly.env'
load_dotenv(dotenv_path=env_path)
host = "bikeshare-restored.cs9te7lm3pt2.us-east-1.rds.amazonaws.com"
por... | 32.475248 | 79 | 0.603659 | import psycopg2
import psycopg2.extras
import pandas as pd
import os
import time
from pathlib import Path
from dotenv import load_dotenv
def read_only_connect_aws():
env_path = 'env_readonly.env'
load_dotenv(dotenv_path=env_path)
host = "bikeshare-restored.cs9te7lm3pt2.us-east-1.rds.amazonaws.com"
por... | true | true |
f7359a48b1c8cf914b8fb141b4b2ed6ebf6ee390 | 4,053 | py | Python | tests/unit/cli/errors_test.py | Teino1978-Corp/compose | 05a5aae552be9de2ef99c30cc79bd7b0d8bfa62b | [
"Apache-2.0"
] | 1 | 2021-05-04T17:15:12.000Z | 2021-05-04T17:15:12.000Z | tests/unit/cli/errors_test.py | HamidOsouli/compose | 52d2fcc27479ffe3301c332fb971296ab686255a | [
"Apache-2.0"
] | null | null | null | tests/unit/cli/errors_test.py | HamidOsouli/compose | 52d2fcc27479ffe3301c332fb971296ab686255a | [
"Apache-2.0"
] | null | null | null | import pytest
from docker.errors import APIError
from requests.exceptions import ConnectionError
from compose.cli import errors
from compose.cli.errors import handle_connection_errors
from compose.const import IS_WINDOWS_PLATFORM
from tests import mock
@pytest.yield_fixture
def mock_logging():
with mock.patch('c... | 42.21875 | 104 | 0.695781 | import pytest
from docker.errors import APIError
from requests.exceptions import ConnectionError
from compose.cli import errors
from compose.cli.errors import handle_connection_errors
from compose.const import IS_WINDOWS_PLATFORM
from tests import mock
@pytest.yield_fixture
def mock_logging():
with mock.patch('c... | true | true |
f7359b0dca3a0c1fc4f8174997e46c89022028eb | 572 | py | Python | base.py | tomas-barros/speed-test | a95da7a24147f1845bb400c4e9db80a60e1b2df7 | [
"MIT"
] | null | null | null | base.py | tomas-barros/speed-test | a95da7a24147f1845bb400c4e9db80a60e1b2df7 | [
"MIT"
] | null | null | null | base.py | tomas-barros/speed-test | a95da7a24147f1845bb400c4e9db80a60e1b2df7 | [
"MIT"
] | null | null | null | from speedtest import Speedtest
# debugmode
debugmode = 0
st = Speedtest()
# debug
if debugmode:
print(f'Download: {st.download()}')
print(f'Upload: {st.upload()}')
st.get_best_server([])
print(f'Ping: {st.results.ping}')
# functons
def get_upload_speed():
print('UPLOAD SPEED: Wait a few seconds... | 21.185185 | 50 | 0.657343 | from speedtest import Speedtest
debugmode = 0
st = Speedtest()
if debugmode:
print(f'Download: {st.download()}')
print(f'Upload: {st.upload()}')
st.get_best_server([])
print(f'Ping: {st.results.ping}')
def get_upload_speed():
print('UPLOAD SPEED: Wait a few seconds...')
return int(st.uplo... | true | true |
f7359e65f7dea51a3e8a2bef0ce59b92e89fc7c6 | 508 | py | Python | pacote de dawload/projeto progamas em Python/Aula 19 Dicionarios parte 1.py | wagnersistemalima/Mundo-3-Python-Curso-em-Video | f78aef33e10a236f71850e05fdb9ae8ddbe155c3 | [
"MIT"
] | 1 | 2020-12-11T23:22:19.000Z | 2020-12-11T23:22:19.000Z | pacote de dawload/projeto progamas em Python/Aula 19 Dicionarios parte 1.py | wagnersistemalima/Mundo-3-Python-Curso-em-Video | f78aef33e10a236f71850e05fdb9ae8ddbe155c3 | [
"MIT"
] | null | null | null | pacote de dawload/projeto progamas em Python/Aula 19 Dicionarios parte 1.py | wagnersistemalima/Mundo-3-Python-Curso-em-Video | f78aef33e10a236f71850e05fdb9ae8ddbe155c3 | [
"MIT"
] | null | null | null | # Aula 19 Dicionarios. É assim que tratamos os dicionarios
pessoas = {'nome': 'Gustavo', 'sexo': 'M', 'idade': 22}
print(pessoas['nome'])
print(pessoas['idade'])
print(pessoas['sexo'])
print(f'{pessoas["nome"]} tem {pessoas["idade"]} anos') # Utilizar aspas duplas para a localização [" "]
print(pessoas.keys()) ... | 42.333333 | 105 | 0.608268 |
pessoas = {'nome': 'Gustavo', 'sexo': 'M', 'idade': 22}
print(pessoas['nome'])
print(pessoas['idade'])
print(pessoas['sexo'])
print(f'{pessoas["nome"]} tem {pessoas["idade"]} anos')
print(pessoas.keys())
print(pessoas.values())
print(pessoas.items())
| true | true |
f7359e904faa026a802269f620739354e64f4bbc | 62 | py | Python | app/tests.py | nibinn/Rnd | e306b3da3af5e9da66d11436bc7abf3a77f50573 | [
"MIT"
] | 1 | 2022-03-30T15:28:33.000Z | 2022-03-30T15:28:33.000Z | authentication/tests.py | piyushjain-pj/pneumonia_and_covid_prediction_tool | b5f503b1672b1093c4bd6f9e053d6024e4f73f9d | [
"MIT"
] | 14 | 2020-06-05T18:37:13.000Z | 2022-03-11T23:26:12.000Z | authentication/tests.py | piyushjain-pj/pneumonia_and_covid_prediction_tool | b5f503b1672b1093c4bd6f9e053d6024e4f73f9d | [
"MIT"
] | null | null | null |
from django.test import TestCase
# Create your tests here.
| 10.333333 | 32 | 0.758065 |
from django.test import TestCase
| true | true |
f7359f1229be3c3b9bf58d7e2c5d6d741c380e63 | 6,312 | py | Python | robucar_tele/scripts/tele_rpub.py | Ily4s/robucar | 379499bffce548cc02ac563b702caa49ce9acb44 | [
"MIT"
] | 1 | 2017-02-13T21:53:33.000Z | 2017-02-13T21:53:33.000Z | robucar_tele/scripts/tele_rpub.py | Ily4s/robucar | 379499bffce548cc02ac563b702caa49ce9acb44 | [
"MIT"
] | null | null | null | robucar_tele/scripts/tele_rpub.py | Ily4s/robucar | 379499bffce548cc02ac563b702caa49ce9acb44 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
import sys
import socket
import struct
from time import sleep
from threading import Thread
from nav_msgs.msg import Odometry
from tf.broadcaster import TransformBroadcaster
from robucar_driver.msg import SimpleRobotData
__author__ = "Ilyas M Abbas (ily4s.abbas@gmail.com)"
class ... | 26.410042 | 77 | 0.517427 |
import rospy
import sys
import socket
import struct
from time import sleep
from threading import Thread
from nav_msgs.msg import Odometry
from tf.broadcaster import TransformBroadcaster
from robucar_driver.msg import SimpleRobotData
__author__ = "Ilyas M Abbas (ily4s.abbas@gmail.com)"
class Tf_serv(Thread):
... | false | true |
f735a0bd714d0c11768957bfb5be71284da6fc0b | 4,802 | py | Python | tests/test_features.py | aka863/python-geojson | 9cda95ab0e226e01391325fede635983e6b7b207 | [
"BSD-3-Clause"
] | null | null | null | tests/test_features.py | aka863/python-geojson | 9cda95ab0e226e01391325fede635983e6b7b207 | [
"BSD-3-Clause"
] | null | null | null | tests/test_features.py | aka863/python-geojson | 9cda95ab0e226e01391325fede635983e6b7b207 | [
"BSD-3-Clause"
] | null | null | null | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import unittest
import geojson
class FeaturesTest(unittest.TestCase):
def test_protocol(self):
"""
A dictionary can satisfy the protocol
"""
f = {
'type': 'Feature',
'id'... | 40.016667 | 76 | 0.466264 | try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import unittest
import geojson
class FeaturesTest(unittest.TestCase):
def test_protocol(self):
f = {
'type': 'Feature',
'id': '1',
'geometry': {'type': 'Point', 'coordinates': [53, -... | true | true |
f735a0ee2e5e07217279bd25dd0d6ed4955441c8 | 872 | py | Python | core/serializers/review.py | NTUSA/fudez-app | 91c8d85238fb642488ef5616be441e4417f21d0a | [
"MIT"
] | 2 | 2017-04-13T08:52:19.000Z | 2018-05-07T12:14:34.000Z | core/serializers/review.py | NTUSA/fudez-app | 91c8d85238fb642488ef5616be441e4417f21d0a | [
"MIT"
] | null | null | null | core/serializers/review.py | NTUSA/fudez-app | 91c8d85238fb642488ef5616be441e4417f21d0a | [
"MIT"
] | 1 | 2018-07-28T16:09:59.000Z | 2018-07-28T16:09:59.000Z | from django.contrib.auth import get_user_model
from rest_framework import serializers
class Parent(object):
def __init__(self, func):
self.func = func
def set_context(self, serializer_field):
self.value = serializer_field.queryset.get(
pk=self.func(serializer_field.context))
... | 29.066667 | 97 | 0.741972 | from django.contrib.auth import get_user_model
from rest_framework import serializers
class Parent(object):
def __init__(self, func):
self.func = func
def set_context(self, serializer_field):
self.value = serializer_field.queryset.get(
pk=self.func(serializer_field.context))
... | true | true |
f735a1f81d5ca9884293312b3c8981cc9b7d982b | 3,437 | py | Python | src/pix2pix/data/unaligned_dataset.py | Stannislav/pytorch-CycleGAN-and-pix2pix | c6a4927f5d2c49c278694ae7e9ac148b83a3f2d5 | [
"BSD-3-Clause"
] | null | null | null | src/pix2pix/data/unaligned_dataset.py | Stannislav/pytorch-CycleGAN-and-pix2pix | c6a4927f5d2c49c278694ae7e9ac148b83a3f2d5 | [
"BSD-3-Clause"
] | null | null | null | src/pix2pix/data/unaligned_dataset.py | Stannislav/pytorch-CycleGAN-and-pix2pix | c6a4927f5d2c49c278694ae7e9ac148b83a3f2d5 | [
"BSD-3-Clause"
] | null | null | null | import os
import random
from PIL import Image
from .base_dataset import BaseDataset, get_transform
from .image_folder import make_dataset
class UnalignedDataset(BaseDataset):
"""
This dataset class can load unaligned/unpaired datasets.
It requires two directories to host training images from domain A '... | 39.056818 | 104 | 0.620017 | import os
import random
from PIL import Image
from .base_dataset import BaseDataset, get_transform
from .image_folder import make_dataset
class UnalignedDataset(BaseDataset):
def __init__(self, opt):
BaseDataset.__init__(self, opt)
self.dir_A = os.path.join(
opt.dataroot, opt.phase ... | true | true |
f735a217197b558e078812728fdb87b8c77d9e70 | 2,790 | py | Python | airflow/npmjs_dags3/npmjs_static_61.py | Yanivmd/maloss | af85ac202668da88d0b4a885386a1e56703e37c8 | [
"MIT"
] | 1 | 2022-01-29T16:13:06.000Z | 2022-01-29T16:13:06.000Z | airflow/npmjs_dags3/npmjs_static_61.py | Yanivmd/maloss | af85ac202668da88d0b4a885386a1e56703e37c8 | [
"MIT"
] | null | null | null | airflow/npmjs_dags3/npmjs_static_61.py | Yanivmd/maloss | af85ac202668da88d0b4a885386a1e56703e37c8 | [
"MIT"
] | 1 | 2022-01-29T16:13:07.000Z | 2022-01-29T16:13:07.000Z | import re
import pickle
import logging
import networkx
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2019, 1, 1),
'email': ['airflow@exampl... | 34.875 | 175 | 0.699283 | import re
import pickle
import logging
import networkx
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2019, 1, 1),
'email': ['airflow@exampl... | true | true |
f735a259c097fe08e9820d06e460b7e690f1af8c | 3,993 | py | Python | Sandbox/qemu-sgx-master/scripts/tracetool/backend/__init__.py | Maxul/sgx_vmx_protocol | b18dcdd6cbbf10c7d609649295676f0163dd9a5e | [
"MIT"
] | 8 | 2020-03-16T06:34:49.000Z | 2021-12-06T01:50:54.000Z | Sandbox/qemu-sgx-master/scripts/tracetool/backend/__init__.py | Maxul/sgx_vmx_protocol | b18dcdd6cbbf10c7d609649295676f0163dd9a5e | [
"MIT"
] | 3 | 2021-09-06T09:14:42.000Z | 2022-03-27T08:09:54.000Z | Sandbox/qemu-sgx-master/scripts/tracetool/backend/__init__.py | Maxul/sgx_vmx_protocol | b18dcdd6cbbf10c7d609649295676f0163dd9a5e | [
"MIT"
] | 1 | 2022-03-18T07:17:40.000Z | 2022-03-18T07:17:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Backend management.
Creating new backends
---------------------
A new backend named 'foo-bar' corresponds to Python module
'tracetool/backend/foo_bar.py'.
A backend module should provide a docstring, whose first non-empty line will be
considered its short descripti... | 32.201613 | 79 | 0.547959 |
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__email__ = "stefanha@linux.vnet.ibm.com"
import os
import tracetool... | true | true |
f735a2675ac8071006c4b3c0c51d104d738b5589 | 3,992 | py | Python | pygmt/tests/test_datasets_earth_relief.py | daroari/pygmt | e022851d62814a9255ed2bb63ae092b666b832b9 | [
"BSD-3-Clause"
] | 326 | 2019-02-13T09:33:39.000Z | 2022-03-25T17:24:05.000Z | pygmt/tests/test_datasets_earth_relief.py | daroari/pygmt | e022851d62814a9255ed2bb63ae092b666b832b9 | [
"BSD-3-Clause"
] | 1,153 | 2019-01-22T19:14:32.000Z | 2022-03-31T22:07:03.000Z | pygmt/tests/test_datasets_earth_relief.py | daroari/pygmt | e022851d62814a9255ed2bb63ae092b666b832b9 | [
"BSD-3-Clause"
] | 160 | 2019-02-10T15:24:19.000Z | 2022-03-31T09:07:41.000Z | """
Test basic functionality for loading Earth relief datasets.
"""
import numpy as np
import numpy.testing as npt
import pytest
from pygmt.datasets import load_earth_relief
from pygmt.exceptions import GMTInvalidInput
def test_earth_relief_fails():
"""
Make sure earth relief fails for invalid resolutions.
... | 31.936 | 80 | 0.665832 | import numpy as np
import numpy.testing as npt
import pytest
from pygmt.datasets import load_earth_relief
from pygmt.exceptions import GMTInvalidInput
def test_earth_relief_fails():
resolutions = "1m 1d bla 60d 001m 03".split()
resolutions.append(60)
for resolution in resolutions:
with pytest.rais... | true | true |
f735a3ebcec803e50af52d4d74ca775eb29ee26a | 11,273 | py | Python | smartRemotes/imports/bt-ble/gapAdvertise.py | HeadHodge/My-SmartHome-Projects | a5db1bf5d54f2840154e7cfb1044b3fb4ec9f77d | [
"MIT"
] | 1 | 2022-02-20T04:28:49.000Z | 2022-02-20T04:28:49.000Z | smartRemotes/imports/bt-ble/gapAdvertise.py | HeadHodge/smartRemotes-v0.2 | 9a3c671dc3c000a911b55ebe2f09e6278a874285 | [
"MIT"
] | null | null | null | smartRemotes/imports/bt-ble/gapAdvertise.py | HeadHodge/smartRemotes-v0.2 | 9a3c671dc3c000a911b55ebe2f09e6278a874285 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# SPDX-License-Identifier: LGPL-2.1-or-later
from __future__ import print_function
import argparse
import dbus
import dbus.exceptions
import dbus.mainloop.glib
import dbus.service
import time
import threading
try:
from gi.repository import GObject # python3
except ImportError:
import gobje... | 30.550136 | 79 | 0.665661 |
from __future__ import print_function
import argparse
import dbus
import dbus.exceptions
import dbus.mainloop.glib
import dbus.service
import time
import threading
try:
from gi.repository import GObject
except ImportError:
import gobject as GObject
mainloop = None
BLUEZ_SERVICE_NAME = 'org.bluez'
LE_... | true | true |
f735a4d7d2546a807d88f3af2e34e631513c4dc3 | 1,102 | py | Python | Trabalhando com Data e Hora/manipulando_data_hora.py | GlennSR/Curso-Python-Udemy | f97ae77deeed0c66607b3e1346a5fc20730e04a5 | [
"MIT"
] | null | null | null | Trabalhando com Data e Hora/manipulando_data_hora.py | GlennSR/Curso-Python-Udemy | f97ae77deeed0c66607b3e1346a5fc20730e04a5 | [
"MIT"
] | null | null | null | Trabalhando com Data e Hora/manipulando_data_hora.py | GlennSR/Curso-Python-Udemy | f97ae77deeed0c66607b3e1346a5fc20730e04a5 | [
"MIT"
] | null | null | null | '''
Manipulando Data e Hora
Python tem um módulo built-in para se trabalhar com data e hora chamado datetime
'''
import datetime
print(dir(datetime))
# Retorna a data e hora corrente
print(datetime.datetime.now())
# datetime.datetime(YYYY, MM, DD, Hour, Minute, Second, microsecond)
print(repr(datetime.datetime.now... | 25.045455 | 90 | 0.741379 |
import datetime
print(dir(datetime))
print(datetime.datetime.now())
print(repr(datetime.datetime.now()))
inicio = datetime.datetime.now()
print(inicio)
inicio = inicio.replace(hour=16, minute=0, second=0, microsecond=0)
print(inicio)
print()
nascimento = input('Digite a sua data de nascimento (DD/MM/AAAA): ... | true | true |
f735a6cbc7a8b59b969dc938e7b1436ece8b6720 | 2,387 | py | Python | Lab-5-SimulatedAnnealing/puzzle_utils.py | Abhishek-dev2/Artificial-Intelligence-Lab | c66778eefcabc6b21fa1f19f641987ac8a7a455a | [
"MIT"
] | 2 | 2020-12-16T07:43:03.000Z | 2021-11-06T12:45:18.000Z | Lab-5-SimulatedAnnealing/puzzle_utils.py | as2d3/Artificial-Intelligence-Lab | c66778eefcabc6b21fa1f19f641987ac8a7a455a | [
"MIT"
] | null | null | null | Lab-5-SimulatedAnnealing/puzzle_utils.py | as2d3/Artificial-Intelligence-Lab | c66778eefcabc6b21fa1f19f641987ac8a7a455a | [
"MIT"
] | 3 | 2020-12-16T07:44:31.000Z | 2021-09-14T17:44:09.000Z | import os
import math
def print_simulated_annealing(start, goal, parent_list, optimal_path_cost, string_to_matrix_mapping, number_states_explored):
if optimal_path_cost > 0:
print("Goal found successfully.")
else:
print("Goal NOT found")
print("Start state: ")
print_configuration(star... | 33.152778 | 125 | 0.645999 | import os
import math
def print_simulated_annealing(start, goal, parent_list, optimal_path_cost, string_to_matrix_mapping, number_states_explored):
if optimal_path_cost > 0:
print("Goal found successfully.")
else:
print("Goal NOT found")
print("Start state: ")
print_configuration(star... | true | true |
f735a947169f85c3ec07ebdedc271ad1cfae990a | 4,418 | py | Python | ckan/cli/user.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | 1 | 2020-02-08T16:16:51.000Z | 2020-02-08T16:16:51.000Z | ckan/cli/user.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | null | null | null | ckan/cli/user.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import logging
import sys
from pprint import pprint
import six
import click
from six import text_type
import ckan.logic as logic
import ckan.plugins as plugin
from ckan.cli import error_shout
log = logging.getLogger(__name__)
@click.group(name=u'user', short_help=u'Manage user commands')
@click.... | 30.054422 | 78 | 0.630602 |
import logging
import sys
from pprint import pprint
import six
import click
from six import text_type
import ckan.logic as logic
import ckan.plugins as plugin
from ckan.cli import error_shout
log = logging.getLogger(__name__)
@click.group(name=u'user', short_help=u'Manage user commands')
@click.help_option(u'-h'... | true | true |
f735a9e0967ace13566be5b598fd75aff4b94dba | 167 | py | Python | src/setup.py | nineinchnick/pystok-fdw | 47b94054e3d3f3c27ae0a43aac34f4af3c9e0216 | [
"MIT"
] | null | null | null | src/setup.py | nineinchnick/pystok-fdw | 47b94054e3d3f3c27ae0a43aac34f4af3c9e0216 | [
"MIT"
] | null | null | null | src/setup.py | nineinchnick/pystok-fdw | 47b94054e3d3f3c27ae0a43aac34f4af3c9e0216 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='pystok-fdw',
version='0.0.1',
author=u'Jan Waś',
license='MIT',
packages=['pystok-fdw']
)
| 15.181818 | 28 | 0.616766 |
from setuptools import setup
setup(
name='pystok-fdw',
version='0.0.1',
author=u'Jan Waś',
license='MIT',
packages=['pystok-fdw']
)
| true | true |
f735aa6deaafb3dd4088c283930aece8d645525f | 1,870 | py | Python | tests/test_likeness.py | herbeeg/famitracker-instrument-generator | c07f0cc97124195aeafbdfb248fb30d6e4e6c3f6 | [
"MIT"
] | null | null | null | tests/test_likeness.py | herbeeg/famitracker-instrument-generator | c07f0cc97124195aeafbdfb248fb30d6e4e6c3f6 | [
"MIT"
] | null | null | null | tests/test_likeness.py | herbeeg/famitracker-instrument-generator | c07f0cc97124195aeafbdfb248fb30d6e4e6c3f6 | [
"MIT"
] | null | null | null | import pytest
import wave.data.likeness as likeness
class TestLikenessFDS:
def testRoundedLikenessFDS(self):
likeness_instance = likeness.WaveLikeness(
base=[i for i in range(64)],
comparison=[0 for i in range(64)],
ceiling=64
)
assert 31.46 == likeness_... | 30.655738 | 62 | 0.606417 | import pytest
import wave.data.likeness as likeness
class TestLikenessFDS:
def testRoundedLikenessFDS(self):
likeness_instance = likeness.WaveLikeness(
base=[i for i in range(64)],
comparison=[0 for i in range(64)],
ceiling=64
)
assert 31.46 == likeness_... | true | true |
f735ab9b4b3d13ffd1e045001731cea5346ade5e | 475 | py | Python | tests/datasets/test_tafeng.py | shiodat/Sequential-Recommendation-Datasets | 198c43962e5f15a9d99d0b17c156a9603d91a1c2 | [
"Apache-2.0"
] | 74 | 2020-08-19T15:57:03.000Z | 2022-03-20T08:41:40.000Z | tests/datasets/test_tafeng.py | shiodat/Sequential-Recommendation-Datasets | 198c43962e5f15a9d99d0b17c156a9603d91a1c2 | [
"Apache-2.0"
] | null | null | null | tests/datasets/test_tafeng.py | shiodat/Sequential-Recommendation-Datasets | 198c43962e5f15a9d99d0b17c156a9603d91a1c2 | [
"Apache-2.0"
] | 18 | 2020-08-05T07:52:32.000Z | 2022-03-17T16:53:48.000Z | import os
from srdatasets.datasets import TaFeng
from srdatasets.utils import __warehouse__
def test_download_and_trandform():
rawdir = __warehouse__.joinpath("TaFeng", "raw")
os.makedirs(rawdir, exist_ok=True)
tafeng = TaFeng(rawdir)
tafeng.download()
assert all(rawdir.joinpath(cf).exists() for ... | 29.6875 | 76 | 0.717895 | import os
from srdatasets.datasets import TaFeng
from srdatasets.utils import __warehouse__
def test_download_and_trandform():
rawdir = __warehouse__.joinpath("TaFeng", "raw")
os.makedirs(rawdir, exist_ok=True)
tafeng = TaFeng(rawdir)
tafeng.download()
assert all(rawdir.joinpath(cf).exists() for ... | true | true |
f735ad0a59f3f1c340dc45bb136c4f80e6a41251 | 807 | py | Python | medium/python3/c0185_368_largest-divisible-subset/00_leetcode_0185.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python3/c0185_368_largest-divisible-subset/00_leetcode_0185.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python3/c0185_368_largest-divisible-subset/00_leetcode_0185.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | 3 | 2018-02-09T02:46:48.000Z | 2021-02-20T08:32:03.000Z | # DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#368. Largest Divisible Subset
#Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subse... | 33.625 | 163 | 0.696406 |
# :type nums: List[int]
# :rtype: List[int]
# """
| true | true |
f735ade660f32bb64e0d8d758d07b55ab389ad04 | 7,154 | py | Python | src/2_robot_picam_test_NCS2_mobilenet.py | lesliewright1977/RPi3_NCS2 | 8aad7a4869980798dcb800dcf1a35ee26ba93c61 | [
"Apache-2.0"
] | 44 | 2019-01-09T12:15:08.000Z | 2022-01-30T05:16:29.000Z | src/2_robot_picam_test_NCS2_mobilenet.py | lesliewright1977/RPi3_NCS2 | 8aad7a4869980798dcb800dcf1a35ee26ba93c61 | [
"Apache-2.0"
] | 3 | 2019-01-25T18:32:11.000Z | 2020-09-11T21:05:38.000Z | src/2_robot_picam_test_NCS2_mobilenet.py | lesliewright1977/RPi3_NCS2 | 8aad7a4869980798dcb800dcf1a35ee26ba93c61 | [
"Apache-2.0"
] | 16 | 2019-01-25T10:50:16.000Z | 2021-08-11T12:39:24.000Z | import cv2
import time
import numpy
import random
from multiprocessing import Process
from multiprocessing import Queue
from picamera.array import PiRGBArray
from picamera import PiCamera
#hacked from:
#https://software.intel.com/articles/OpenVINO-Install-RaspberryPI
#https://opencv2-python-tutroals.readthedocs.io/en/... | 24.087542 | 128 | 0.704082 | import cv2
import time
import numpy
import random
from multiprocessing import Process
from multiprocessing import Queue
from picamera.array import PiRGBArray
from picamera import PiCamera
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18,GPIO.OUT)
GPIO.setup(23,GPIO.OUT)
GPIO.setup(24,GPIO.OUT... | true | true |
f735aed00824c375e7c9692215548a31c8120db7 | 2,399 | py | Python | samples/client/petstore/python/client/models/User.py | cranberyxl/swagger-codegen | bae40ded74853583e18ac643876eb5beba04a874 | [
"Apache-2.0"
] | null | null | null | samples/client/petstore/python/client/models/User.py | cranberyxl/swagger-codegen | bae40ded74853583e18ac643876eb5beba04a874 | [
"Apache-2.0"
] | 1 | 2021-01-21T01:34:10.000Z | 2021-01-21T01:34:10.000Z | samples/client/petstore/python/client/models/User.py | cranberyxl/swagger-codegen | bae40ded74853583e18ac643876eb5beba04a874 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2015 Reverb Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless require... | 23.519608 | 97 | 0.457691 |
class User(object):
def __init__(self):
self.swaggerTypes = {
'id': 'long',
'username': 'str',
'firstName': 'str',
'lastName': 'str',
... | true | true |
f735afbf3acae6f5812aed3ea540a8ad6adf1015 | 6,656 | py | Python | source_server/video_stream/main4.py | caganselim/thermal-camera-assisted-baby-monitor | 7d1d948eb4c029777d1359ad9c53b5918e9753dd | [
"MIT"
] | null | null | null | source_server/video_stream/main4.py | caganselim/thermal-camera-assisted-baby-monitor | 7d1d948eb4c029777d1359ad9c53b5918e9753dd | [
"MIT"
] | null | null | null | source_server/video_stream/main4.py | caganselim/thermal-camera-assisted-baby-monitor | 7d1d948eb4c029777d1359ad9c53b5918e9753dd | [
"MIT"
] | 1 | 2019-08-15T00:24:08.000Z | 2019-08-15T00:24:08.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 10 16:45:42 2019
@author: ASUS PC
"""
from flask import Flask, render_template, Response
import time
from threading import Lock, Thread
import queue
import socket
from threading import Thread
# emulated camera
from camera3 import Camera
# Ras... | 27.618257 | 180 | 0.550631 |
from flask import Flask, render_template, Response
import time
from threading import Lock, Thread
import queue
import socket
from threading import Thread
from camera3 import Camera
None
connection_file = None
connection = None
frame_queue = queue.Queue(maxsize=5)
stream_entered = Fal... | true | true |
f735b007affed977c83d7016dcea7c249f5339c5 | 2,706 | py | Python | pytorch_ssim.py | minhmanho/rrdncnn | f09ef7d92e31bfd43a548bb476970cfe38d32508 | [
"X11"
] | 22 | 2019-10-07T07:54:46.000Z | 2022-03-22T14:22:52.000Z | pytorch_ssim.py | minhmanho/rrdncnn | f09ef7d92e31bfd43a548bb476970cfe38d32508 | [
"X11"
] | 2 | 2020-09-27T06:45:19.000Z | 2022-03-18T07:48:54.000Z | pytorch_ssim.py | minhmanho/rrdncnn | f09ef7d92e31bfd43a548bb476970cfe38d32508 | [
"X11"
] | 3 | 2021-01-18T03:46:14.000Z | 2021-09-07T09:24:58.000Z | import torch
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from math import exp
def gaussian(window_size, sigma):
gauss = torch.Tensor([exp(-(x - window_size//2)**2/float(2*sigma**2)) for x in range(window_size)])
return gauss/gauss.sum()
def create_window(wi... | 37.068493 | 105 | 0.629712 | import torch
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from math import exp
def gaussian(window_size, sigma):
gauss = torch.Tensor([exp(-(x - window_size//2)**2/float(2*sigma**2)) for x in range(window_size)])
return gauss/gauss.sum()
def create_window(wi... | true | true |
f735b19427ad7d8a33dc3bf0e10c2bd58c3010b7 | 2,766 | py | Python | tags/errors.py | Myst1c-a/phen-cogs | 672f9022ddbbd9a84b0a05357347e99e64a776fc | [
"MIT"
] | null | null | null | tags/errors.py | Myst1c-a/phen-cogs | 672f9022ddbbd9a84b0a05357347e99e64a776fc | [
"MIT"
] | null | null | null | tags/errors.py | Myst1c-a/phen-cogs | 672f9022ddbbd9a84b0a05357347e99e64a776fc | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-present phenom4n4n
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, pub... | 32.541176 | 92 | 0.754519 |
from typing import Optional
from redbot.core.commands import UserFeedbackCheckFailure
from redbot.core.utils.chat_formatting import humanize_number as hn
__all__ = (
"TagError",
"MissingTagPermissions",
"RequireCheckFailure",
"WhitelistCheckFailure",
"BlacklistCheckFailure",
"TagFeedbackError... | true | true |
f735b1c40eb715c9d12e3f92d00bc2e92e50fa58 | 4,754 | py | Python | src/converter/gen_boundary_data.py | Kento75/mozc | 0abed62d6f9cd9c6ce2142407a1f80e02a3230f1 | [
"BSD-3-Clause"
] | 1,144 | 2015-04-23T16:18:45.000Z | 2022-03-29T19:37:33.000Z | src/converter/gen_boundary_data.py | kirameister/mozc | 18b2b32b4d3fe585d38134606773239781b6be82 | [
"BSD-3-Clause"
] | 291 | 2015-05-04T07:53:37.000Z | 2022-03-22T00:09:05.000Z | src/converter/gen_boundary_data.py | kirameister/mozc | 18b2b32b4d3fe585d38134606773239781b6be82 | [
"BSD-3-Clause"
] | 301 | 2015-05-03T00:07:18.000Z | 2022-03-21T10:48:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | 30.670968 | 78 | 0.649769 |
from __future__ import absolute_import
from __future__ import print_function
import codecs
import optparse
import re
import struct
import sys
from six.moves import range
def PatternToRegexp(pattern):
return '^' + pattern.replace('*', '[^,]+')
def LoadPatterns(file):
prefix = []
... | true | true |
f735b38333c649bea49b0c547e0ecbe745f5c70d | 1,590 | py | Python | gym_minigrid/envs/blockedunlockpickup.py | kanaadp/gym-minigrid | b8e95a3b5ac86f791c529d12561f73e19b9b5192 | [
"Apache-2.0"
] | null | null | null | gym_minigrid/envs/blockedunlockpickup.py | kanaadp/gym-minigrid | b8e95a3b5ac86f791c529d12561f73e19b9b5192 | [
"Apache-2.0"
] | null | null | null | gym_minigrid/envs/blockedunlockpickup.py | kanaadp/gym-minigrid | b8e95a3b5ac86f791c529d12561f73e19b9b5192 | [
"Apache-2.0"
] | null | null | null | from gym_minigrid.minigrid import *
from gym_minigrid.roomgrid import RoomGrid
from gym_minigrid.register import register
class BlockedUnlockPickup(RoomGrid):
"""
Unlock a door blocked by a ball, then pick up a box
in another room
"""
def __init__(self, seed=None):
room_size = 6
s... | 29.444444 | 109 | 0.604403 | from gym_minigrid.minigrid import *
from gym_minigrid.roomgrid import RoomGrid
from gym_minigrid.register import register
class BlockedUnlockPickup(RoomGrid):
def __init__(self, seed=None):
room_size = 6
super().__init__(
num_rows=1,
num_cols=2,
room_size=room_... | true | true |
f735b3f97d1d978d00f3e1fa7e560ec79438faf4 | 35,417 | py | Python | python/ccxt/hitbtc.py | longniao/ccxt | 3af5494bd16865f9e141f902adbd1deba7a3135e | [
"MIT"
] | 1 | 2021-03-01T17:45:33.000Z | 2021-03-01T17:45:33.000Z | python/ccxt/hitbtc.py | longniao/ccxt | 3af5494bd16865f9e141f902adbd1deba7a3135e | [
"MIT"
] | 4 | 2020-09-06T22:46:57.000Z | 2021-05-10T08:35:02.000Z | python/ccxt/hitbtc.py | longniao/ccxt | 3af5494bd16865f9e141f902adbd1deba7a3135e | [
"MIT"
] | 1 | 2019-11-08T12:36:13.000Z | 2019-11-08T12:36:13.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Insufficient... | 37.008359 | 127 | 0.365926 |
ge import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import OrderNotFound
class hitbtc (Exchange):
def describe(self):
return self.deep_extend(super(hitbtc, self).desc... | true | true |
f735b3fb7909a46e6e9bc51be0a8832ba8df5746 | 554 | py | Python | esrt/engine/base_input_feed.py | PTYin/ESRT | 4d3e5c523cef7bd15ea8ce10e5cf8b7e05ad2d5c | [
"BSD-2-Clause"
] | null | null | null | esrt/engine/base_input_feed.py | PTYin/ESRT | 4d3e5c523cef7bd15ea8ce10e5cf8b7e05ad2d5c | [
"BSD-2-Clause"
] | null | null | null | esrt/engine/base_input_feed.py | PTYin/ESRT | 4d3e5c523cef7bd15ea8ce10e5cf8b7e05ad2d5c | [
"BSD-2-Clause"
] | null | null | null | import abc
import typing
class BaseInputFeed(abc.ABC):
"""
"""
def __init__(self, model, batch_size):
self.model = model
self.batch_size = batch_size
@abc.abstractmethod
def get_train_batch(self):
"""Defien a batch feed dictionary the model needs for training, each sub cl... | 25.181818 | 93 | 0.655235 | import abc
import typing
class BaseInputFeed(abc.ABC):
def __init__(self, model, batch_size):
self.model = model
self.batch_size = batch_size
@abc.abstractmethod
def get_train_batch(self):
@abc.abstractmethod
def get_test_batch(self):
| true | true |
f735b4d20caffd320fd7db03fafe6d0948d2456f | 4,370 | py | Python | conf.py | bcattoor/topohelper-docs | 63af3b365e5e3b7eac59d4c9bc574283c1d2177f | [
"Unlicense"
] | null | null | null | conf.py | bcattoor/topohelper-docs | 63af3b365e5e3b7eac59d4c9bc574283c1d2177f | [
"Unlicense"
] | null | null | null | conf.py | bcattoor/topohelper-docs | 63af3b365e5e3b7eac59d4c9bc574283c1d2177f | [
"Unlicense"
] | 1 | 2020-11-13T20:42:11.000Z | 2020-11-13T20:42:11.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 ex... | 29.931507 | 116 | 0.653089 |
project = "TopoHelper"
copyright = "2020, Bjorn Cattoor"
author = "Bjorn Cattoor"
company = "Infrabel"
release = "1.0"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.todo",
"sphinx.ext.viewcode",... | true | true |
f735b560281cfda6bec6bd167865c4a4301011a2 | 7,811 | py | Python | model/archival_gnns.py | kay-wong/DiscoBERT | 814c741e2a049de3afc489835e0df3ccf9fb4fe9 | [
"MIT"
] | 154 | 2020-04-22T07:14:36.000Z | 2022-03-20T06:16:39.000Z | model/archival_gnns.py | kay-wong/DiscoBERT | 814c741e2a049de3afc489835e0df3ccf9fb4fe9 | [
"MIT"
] | 13 | 2020-05-15T03:12:19.000Z | 2021-08-10T16:08:09.000Z | model/archival_gnns.py | kay-wong/DiscoBERT | 814c741e2a049de3afc489835e0df3ccf9fb4fe9 | [
"MIT"
] | 28 | 2020-04-23T12:54:56.000Z | 2022-02-09T11:48:12.000Z | # Graph Conv and Relational Graph Conv
import itertools
import torch
from typing import List, Union
import dgl
import torch.nn as nn
import torch.nn.functional as F
from allennlp.common import FromParams
from allennlp.common import Registrable
from allennlp.modules.encoder_base import _EncoderBase
from allennlp.module... | 38.860697 | 106 | 0.630137 |
import itertools
import torch
from typing import List, Union
import dgl
import torch.nn as nn
import torch.nn.functional as F
from allennlp.common import FromParams
from allennlp.common import Registrable
from allennlp.modules.encoder_base import _EncoderBase
from allennlp.modules.feedforward import FeedForward
from ... | true | true |
f735b5aac888d7a0bb6d2eff2c7545d190c58ac9 | 377 | py | Python | Python/Syntax/Else.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 148 | 2017-08-03T01:49:27.000Z | 2022-03-26T10:39:30.000Z | Python/Syntax/Else.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 3 | 2017-11-23T19:52:05.000Z | 2020-04-01T00:44:40.000Z | Python/Syntax/Else.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 59 | 2017-08-03T01:49:19.000Z | 2022-03-31T23:24:38.000Z | if carro == 'Peugeot':
c = 50
elif carro == 'C3':
c = 60
elif carro == 'Cruze':
c = 70
elif carro == 'CRV':
c = 75
else:
print('O carro digitado não está cadastrado no nosso sistema. Verifique se está digitado corretamente ou comunique a empresa.')
return #ou pode usar sys.exit() se quiser acaba... | 26.928571 | 131 | 0.65252 | if carro == 'Peugeot':
c = 50
elif carro == 'C3':
c = 60
elif carro == 'Cruze':
c = 70
elif carro == 'CRV':
c = 75
else:
print('O carro digitado não está cadastrado no nosso sistema. Verifique se está digitado corretamente ou comunique a empresa.')
return
| true | true |
f735b6a365a72a09f1f4baa82e51348f1b5803fc | 1,929 | py | Python | openprescribing/dmd/gen_models/gen_models.py | annapowellsmith/openpresc | cfa9fb07d6fc2ee304159c04fcc132cefcf78745 | [
"MIT"
] | 91 | 2015-10-14T09:10:32.000Z | 2022-03-10T22:09:21.000Z | openprescribing/dmd/gen_models/gen_models.py | annapowellsmith/openpresc | cfa9fb07d6fc2ee304159c04fcc132cefcf78745 | [
"MIT"
] | 1,828 | 2015-12-04T14:52:27.000Z | 2022-03-31T08:51:14.000Z | openprescribing/dmd/gen_models/gen_models.py | HDRUK/openprescribing | 510e8c07e841cd42284c109774d1730b6463f376 | [
"MIT"
] | 27 | 2015-12-03T18:26:56.000Z | 2021-01-09T21:58:53.000Z | # flake8: noqa
import csv
def model_name(table_name):
if table_name in ["vtm", "vpi", "vmp", "vmpp", "amp", "ampp", "gtin"]:
return table_name.upper()
else:
return "".join(tok.title() for tok in table_name.split("_"))
def quote(s):
assert '"' not in s
return '"' + s + '"'
with open... | 25.72 | 76 | 0.553136 |
import csv
def model_name(table_name):
if table_name in ["vtm", "vpi", "vmp", "vmpp", "amp", "ampp", "gtin"]:
return table_name.upper()
else:
return "".join(tok.title() for tok in table_name.split("_"))
def quote(s):
assert '"' not in s
return '"' + s + '"'
with open("schema.csv")... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.