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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f9702934d7e09019e94b2b0b41f466123194df | 4,770 | py | Python | lib/django-1.5/django/core/mail/__init__.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.5/django/core/mail/__init__.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.5/django/core/mail/__init__.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | """
Tools for sending email.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be... | 42.589286 | 84 | 0.685744 | from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from django.core.mail.utils import CachedDnsName, DNS_NAME
from django.core.mail.message import (
EmailMessage, EmailMultiAlternatives,
... | true | true |
08f970a5265a37cf9f4858ba7eedf17abb757485 | 2,945 | py | Python | analysis/explainshell/web/debugviews.py | lizhi16/dockerfile_analysis_framework | eb35105c8bbbc93d83129a6ab435c6e9acd4fab9 | [
"Apache-2.0"
] | 3 | 2021-05-10T05:55:46.000Z | 2021-12-15T13:36:09.000Z | analysis/explainshell/web/debugviews.py | QQQQM/dockerfile_analysis_framework | eb35105c8bbbc93d83129a6ab435c6e9acd4fab9 | [
"Apache-2.0"
] | null | null | null | analysis/explainshell/web/debugviews.py | QQQQM/dockerfile_analysis_framework | eb35105c8bbbc93d83129a6ab435c6e9acd4fab9 | [
"Apache-2.0"
] | 1 | 2021-09-03T07:24:55.000Z | 2021-09-03T07:24:55.000Z | import logging
from flask import render_template, request, abort, redirect, url_for, json
from explainshell import manager, config, store
from explainshell.web import app, helpers
logger = logging.getLogger(__name__)
@app.route('/debug')
def debug():
s = store.store('explainshell', config.MONGO_URI)
d = {'m... | 34.244186 | 88 | 0.561969 | import logging
from flask import render_template, request, abort, redirect, url_for, json
from explainshell import manager, config, store
from explainshell.web import app, helpers
logger = logging.getLogger(__name__)
@app.route('/debug')
def debug():
s = store.store('explainshell', config.MONGO_URI)
d = {'m... | true | true |
08f970e7a83f836eedf3d83aaac20a7ddaa8dc0c | 545 | py | Python | PYSTUDY/__init__.py | shi-cong/review | c8da7128ea18ecaa5849f2066d321e70d6f97f70 | [
"Apache-2.0"
] | 8 | 2017-10-22T00:24:42.000Z | 2017-11-24T01:23:52.000Z | PYSTUDY/__init__.py | shi-cong/review | c8da7128ea18ecaa5849f2066d321e70d6f97f70 | [
"Apache-2.0"
] | 2 | 2017-10-12T22:04:25.000Z | 2017-10-12T23:43:48.000Z | PYSTUDY/__init__.py | shi-cong/review | c8da7128ea18ecaa5849f2066d321e70d6f97f70 | [
"Apache-2.0"
] | null | null | null | """
看书,学习,慢慢积累,不作重复的事情
"""
__title__ = 'PYSTUDY'
__version__ = '0.7.3'
__author__ = 'shi-cong'
__license__ = 'Apache License'
__copyright__ = 'Copyright 2017 shi-cong'
__docformat__ = 'html'
def version():
return __version__
__all__ = ['collectionslib', 'ddoslib', 'debuglib', 'encodelib', 'encryptlib',
... | 27.25 | 80 | 0.627523 |
__title__ = 'PYSTUDY'
__version__ = '0.7.3'
__author__ = 'shi-cong'
__license__ = 'Apache License'
__copyright__ = 'Copyright 2017 shi-cong'
__docformat__ = 'html'
def version():
return __version__
__all__ = ['collectionslib', 'ddoslib', 'debuglib', 'encodelib', 'encryptlib',
'html_parserlib', 'json... | true | true |
08f971ecef7070f74af9ec9dd87028c740be6187 | 398 | py | Python | fireNation/wsgi.py | Janice-M/fireNation | dfd37d96bfbb4cc18a5bd68b9fabd592a17a8e20 | [
"MIT"
] | null | null | null | fireNation/wsgi.py | Janice-M/fireNation | dfd37d96bfbb4cc18a5bd68b9fabd592a17a8e20 | [
"MIT"
] | 9 | 2021-03-19T01:23:55.000Z | 2022-03-11T23:59:05.000Z | fireNation/wsgi.py | Janice-M/fireNation | dfd37d96bfbb4cc18a5bd68b9fabd592a17a8e20 | [
"MIT"
] | null | null | null | """
WSGI config for fireNation project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | 23.411765 | 78 | 0.788945 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fireNation.settings")
application = get_wsgi_application()
| true | true |
08f97239ac5e8fdc93e803adf736edff7cf5714e | 1,220 | py | Python | sample.py | vippool/storage | 06fa55e21f4099f25b0b65470b728e7989235861 | [
"MIT"
] | 11 | 2019-03-19T15:49:35.000Z | 2019-10-03T15:04:00.000Z | sample.py | vippool/storage | 06fa55e21f4099f25b0b65470b728e7989235861 | [
"MIT"
] | 7 | 2019-03-22T09:24:26.000Z | 2021-01-21T07:49:50.000Z | sample.py | vippool/storage | 06fa55e21f4099f25b0b65470b728e7989235861 | [
"MIT"
] | 3 | 2019-03-20T02:44:36.000Z | 2020-09-02T12:10:30.000Z | #========================================================#
# #
# sample.py - サンプルプログラム #
# #
# (C) 2019-2021 VIPPOOL Inc. #
# ... | 43.571429 | 102 | 0.515574 |
import os
from vippool.storage import vippool_storage
vs = vippool_storage( coind_type = 'monacoind_test' )
print( vs.privKey() ) print( vs.address() )
if os.getenv( 'PRIVKEY', None ) is None:
vs = vippool_storage( privKey = '74657a79fd323d5072ca81c6b99e2ffb5f0735d16fd5963289ba6f837c0413ef' )
else:
vs = ... | false | true |
08f9724a6466adade8ea79f7401c42c61de15030 | 2,570 | py | Python | pandasbt/build_timeframe.py | Janderson/pandasbt | e3f6826d55be05330928750209297a014976a8c5 | [
"Apache-2.0"
] | 1 | 2021-07-19T21:09:20.000Z | 2021-07-19T21:09:20.000Z | pandasbt/build_timeframe.py | Janderson/pandasbt | e3f6826d55be05330928750209297a014976a8c5 | [
"Apache-2.0"
] | null | null | null | pandasbt/build_timeframe.py | Janderson/pandasbt | e3f6826d55be05330928750209297a014976a8c5 | [
"Apache-2.0"
] | 1 | 2021-07-19T21:09:23.000Z | 2021-07-19T21:09:23.000Z | import pandas as pd
import numpy as np
def build_timeframe(dataframe,
timeframe="D1",
datetime_column="time",
filter_at_end=True):
"""
function: build_timeframe
This function should build a highertimeframe like D1,
using a lower t... | 48.490566 | 232 | 0.601167 | import pandas as pd
import numpy as np
def build_timeframe(dataframe,
timeframe="D1",
datetime_column="time",
filter_at_end=True):
dataframe["time"] = pd.to_datetime(dataframe["time"])
dataframe.sort_values(["time"], ascending=True, inplace=True)
... | true | true |
08f9724add2a18fb173480c40598fd33abc18539 | 4,930 | py | Python | grr/endtoend_tests/filesystem.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | 5 | 2017-03-17T08:25:09.000Z | 2022-02-22T05:28:14.000Z | grr/endtoend_tests/filesystem.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | null | null | null | grr/endtoend_tests/filesystem.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | 3 | 2018-12-07T07:04:37.000Z | 2022-02-22T05:28:16.000Z | #!/usr/bin/env python
"""End to end tests for lib.flows.general.filesystem."""
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib.aff4_objects import standard
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import paths as rdf_paths
####################
# Linux and Da... | 32.222222 | 78 | 0.644422 |
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib.aff4_objects import standard
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import paths as rdf_paths
class TestListDirectoryOSLinuxDarwin(base.TestVFSPathExists):
platforms = ["Linux", "Darwin"]
flow = "ListDi... | true | true |
08f9742e472a5f48d54d80cf42ac70baa1f8ef47 | 165 | py | Python | flash/vision/segmentation/__init__.py | testinggg-art/lightning-flash | 87bdb0996c365485bbf26c03b0a7e6a4c91c5484 | [
"Apache-2.0"
] | null | null | null | flash/vision/segmentation/__init__.py | testinggg-art/lightning-flash | 87bdb0996c365485bbf26c03b0a7e6a4c91c5484 | [
"Apache-2.0"
] | null | null | null | flash/vision/segmentation/__init__.py | testinggg-art/lightning-flash | 87bdb0996c365485bbf26c03b0a7e6a4c91c5484 | [
"Apache-2.0"
] | null | null | null | from flash.vision.segmentation.data import SemanticSegmentationData, SemanticSegmentationPreprocess
from flash.vision.segmentation.model import SemanticSegmentation
| 55 | 99 | 0.90303 | from flash.vision.segmentation.data import SemanticSegmentationData, SemanticSegmentationPreprocess
from flash.vision.segmentation.model import SemanticSegmentation
| true | true |
08f9743275b9aa33873c5dd10607e5d1735109fb | 3,192 | py | Python | swd/tools/leave.py | heisen-bug/swd_django | 991ee48eb69b35a586069d90177ebe6910291aa0 | [
"MIT"
] | null | null | null | swd/tools/leave.py | heisen-bug/swd_django | 991ee48eb69b35a586069d90177ebe6910291aa0 | [
"MIT"
] | null | null | null | swd/tools/leave.py | heisen-bug/swd_django | 991ee48eb69b35a586069d90177ebe6910291aa0 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from .dev_info import leaves
def index(request):
from django.contrib.auth.models import User
from main.models import Warden, Leave, Student
from django.http import HttpResponse
import datetime
from django.utils.timezone import make_aware
hostels = ['ah1', '... | 44.957746 | 286 | 0.588346 | from django.http import HttpResponse
from .dev_info import leaves
def index(request):
from django.contrib.auth.models import User
from main.models import Warden, Leave, Student
from django.http import HttpResponse
import datetime
from django.utils.timezone import make_aware
hostels = ['ah1', '... | true | true |
08f97491d45773680d031ee72cfefcbbd093479f | 394 | py | Python | src/genie/libs/parser/iosxe/tests/ShowlispIpv4RouteImportMapCache/cli/equal/golden_output17_expected.py | hooligan-sa/genieparser | c0ce90ecb42a57c7ca299b633a62c461937c54c7 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowlispIpv4RouteImportMapCache/cli/equal/golden_output17_expected.py | hooligan-sa/genieparser | c0ce90ecb42a57c7ca299b633a62c461937c54c7 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowlispIpv4RouteImportMapCache/cli/equal/golden_output17_expected.py | hooligan-sa/genieparser | c0ce90ecb42a57c7ca299b633a62c461937c54c7 | [
"Apache-2.0"
] | null | null | null | expected_output = {
"lisp_id": {
0: {
"instance_id": {
102: {
"eid_table": "blue",
"config": 2,
"entries": 1,
"limit": 5000,
"eid": {
"50.1.1.0/24": {
"uptime": "23:08:05",
"source": "static",
"ca... | 18.761905 | 35 | 0.312183 | expected_output = {
"lisp_id": {
0: {
"instance_id": {
102: {
"eid_table": "blue",
"config": 2,
"entries": 1,
"limit": 5000,
"eid": {
"50.1.1.0/24": {
"uptime": "23:08:05",
"source": "static",
"ca... | true | true |
08f975417b85f452c841c1dcd1cc8f5b2d7d6d36 | 4,173 | py | Python | benchmark/startQiskit1090.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1090.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1090.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=50
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 31.854962 | 82 | 0.607477 | import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def build_oracle(n: int, f) -> ... | true | true |
08f975ba14107784939869f8787b839f88ba7e78 | 2,419 | py | Python | zerver/management/commands/generate_invite_links.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 6 | 2019-05-09T20:43:20.000Z | 2022-03-29T05:53:50.000Z | zerver/management/commands/generate_invite_links.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 2 | 2016-10-18T04:01:56.000Z | 2016-10-20T18:19:09.000Z | zerver/management/commands/generate_invite_links.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 7 | 2016-08-10T02:24:32.000Z | 2022-03-28T15:14:18.000Z | from argparse import ArgumentParser
from typing import Any
from django.core.management.base import CommandError
from confirmation.models import Confirmation, create_confirmation_link
from zerver.lib.email_validation import email_allowed_for_realm
from zerver.lib.management import ZulipBaseCommand
from zerver.models i... | 41 | 93 | 0.582472 | from argparse import ArgumentParser
from typing import Any
from django.core.management.base import CommandError
from confirmation.models import Confirmation, create_confirmation_link
from zerver.lib.email_validation import email_allowed_for_realm
from zerver.lib.management import ZulipBaseCommand
from zerver.models i... | true | true |
08f975f94854906dd0a38b31ee21b0043cbdbad1 | 2,961 | py | Python | Lib/site-packages/unittest2/util.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 1,016 | 2015-05-21T09:45:52.000Z | 2022-03-30T07:42:25.000Z | Lib/site-packages/unittest2/util.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 1,713 | 2015-05-19T14:32:45.000Z | 2022-03-29T10:05:48.000Z | Lib/site-packages/unittest2/util.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 640 | 2015-05-20T02:53:52.000Z | 2022-03-31T09:55:23.000Z | """Various utility functions."""
from os.path import commonprefix
__unittest = True
_MAX_LENGTH = 80
_PLACEHOLDER_LEN = 12
_MIN_BEGIN_LEN = 5
_MIN_END_LEN = 5
_MIN_COMMON_LEN = 5
_MIN_DIFF_LEN = _MAX_LENGTH - \
(_MIN_BEGIN_LEN + _PLACEHOLDER_LEN + _MIN_COMMON_LEN +
_PLACEHOLDER_LEN + ... | 28.2 | 81 | 0.60385 |
from os.path import commonprefix
__unittest = True
_MAX_LENGTH = 80
_PLACEHOLDER_LEN = 12
_MIN_BEGIN_LEN = 5
_MIN_END_LEN = 5
_MIN_COMMON_LEN = 5
_MIN_DIFF_LEN = _MAX_LENGTH - \
(_MIN_BEGIN_LEN + _PLACEHOLDER_LEN + _MIN_COMMON_LEN +
_PLACEHOLDER_LEN + _MIN_END_LEN)
assert _MIN_DIFF_LE... | true | true |
08f97797bc4a70473bcb414f7b1cd44c32fa2c3d | 2,854 | py | Python | backend/pyrogram/raw/functions/messages/upload_imported_media.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/raw/functions/messages/upload_imported_media.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/raw/functions/messages/upload_imported_media.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.021739 | 103 | 0.629643 |
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Union, Any
class UploadImportedMedia(TLObject):
__slots__: List[str] = ["peer", "import_id",... | true | true |
08f977e0b97d7535d823102e0cc006740d076eaa | 1,302 | py | Python | pastebin/pastes/viewsets.py | amirasaad/pastebin | dba0617337a61646cba3bed7f35f4afa1618a49e | [
"MIT"
] | null | null | null | pastebin/pastes/viewsets.py | amirasaad/pastebin | dba0617337a61646cba3bed7f35f4afa1618a49e | [
"MIT"
] | 192 | 2020-01-07T12:10:04.000Z | 2022-03-27T17:32:32.000Z | pastebin/pastes/viewsets.py | amirasaad/pastebin | dba0617337a61646cba3bed7f35f4afa1618a49e | [
"MIT"
] | null | null | null | """
Module: pastebin.pastes.viewsets
Contains API for pastes app.
"""
from rest_framework.decorators import action
from rest_framework.renderers import StaticHTMLRenderer
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from pastebin.pastes import serializers
from pastebin... | 31 | 63 | 0.738863 | from rest_framework.decorators import action
from rest_framework.renderers import StaticHTMLRenderer
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from pastebin.pastes import serializers
from pastebin.pastes.filters import PasteFilter
from pastebin.pastes.models import P... | true | true |
08f978128baaa214d51f34a4e91d7edb71826df9 | 6,182 | py | Python | app/v/project/rest/projectTaskParticipatedRst.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | app/v/project/rest/projectTaskParticipatedRst.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | app/v/project/rest/projectTaskParticipatedRst.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 ProjectV 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 requi... | 46.134328 | 120 | 0.586542 |
from flask_restful import Resource
from flask import request, g
from v.tools.exception import ExceptionRest
from v.tools.v import processing_rest_exception, processing_rest_success, type_of_insert_rest, type_of_update_rest
from v.tools.validate import validate_rest
from v.project.model.projectTaskParticipatedMdl impor... | false | true |
08f9781e7371a395433eee7c02e774d977c69a4b | 65,465 | py | Python | tests_tf/test_attacks.py | aam-at/cleverhans_tf2 | b5a122a8c8bd81c5f3cbaa58d63c4eb4dc5e344e | [
"MIT"
] | null | null | null | tests_tf/test_attacks.py | aam-at/cleverhans_tf2 | b5a122a8c8bd81c5f3cbaa58d63c4eb4dc5e344e | [
"MIT"
] | null | null | null | tests_tf/test_attacks.py | aam-at/cleverhans_tf2 | b5a122a8c8bd81c5f3cbaa58d63c4eb4dc5e344e | [
"MIT"
] | 1 | 2020-10-29T14:13:21.000Z | 2020-10-29T14:13:21.000Z | # pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import unittest
import numpy as np
from nose.plugins.skip import SkipTest
import tensorflow as tf
# pylint bug on ne... | 38.194282 | 98 | 0.631971 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import unittest
import numpy as np
from nose.plugins.skip import SkipTest
import tensorflow as tf
import tensorflow.contrib.slim as slim
from cleverha... | true | true |
08f978351cecb6c26516659da89c5050ff902753 | 361 | py | Python | tasks.py | ekohl/pycares | f718c3b79b5acfaf1e7e29170ecf3cb83e9956c5 | [
"MIT"
] | 1 | 2021-02-28T15:51:38.000Z | 2021-02-28T15:51:38.000Z | tasks.py | ekohl/pycares | f718c3b79b5acfaf1e7e29170ecf3cb83e9956c5 | [
"MIT"
] | null | null | null | tasks.py | ekohl/pycares | f718c3b79b5acfaf1e7e29170ecf3cb83e9956c5 | [
"MIT"
] | 1 | 2021-02-26T08:02:48.000Z | 2021-02-26T08:02:48.000Z |
import re
from invoke import task
def get_version():
return re.search(r"""__version__\s+=\s+(?P<quote>['"])(?P<version>.+?)(?P=quote)""", open('src/pycares/_version.py').read()).group('version')
@task
def release(c):
version = get_version()
c.run("git tag -a pycares-{0} -m \"pycares {0} release\"".forma... | 25.785714 | 145 | 0.626039 |
import re
from invoke import task
def get_version():
return re.search(r"""__version__\s+=\s+(?P<quote>['"])(?P<version>.+?)(?P=quote)""", open('src/pycares/_version.py').read()).group('version')
@task
def release(c):
version = get_version()
c.run("git tag -a pycares-{0} -m \"pycares {0} release\"".forma... | true | true |
08f9796c1c1eb2d3a13e0e7f1e0c547969ca479d | 863 | py | Python | SUIBE_DID_Data_Manager/blueprints/blockchain/models.py | SUIBE-Blockchain/SUIBE_DID_Data_Manager | d38f3f37463f36802eb6acb578f8e17faf878c79 | [
"MIT"
] | null | null | null | SUIBE_DID_Data_Manager/blueprints/blockchain/models.py | SUIBE-Blockchain/SUIBE_DID_Data_Manager | d38f3f37463f36802eb6acb578f8e17faf878c79 | [
"MIT"
] | 2 | 2020-10-21T07:05:43.000Z | 2020-10-22T17:10:53.000Z | SUIBE_DID_Data_Manager/blueprints/blockchain/models.py | SUIBE-Blockchain/SUIBE_DID_Data_Manager | d38f3f37463f36802eb6acb578f8e17faf878c79 | [
"MIT"
] | null | null | null | import datetime as dt
from SUIBE_DID_Data_Manager.database import (
Column,
Model,
db,
)
from SUIBE_DID_Data_Manager.extensions import db
class CredentialPojo(db.Model):
__tablename__ = "credential_pojo"
credentialID = db.Column(db.String(88), primary_key=True,nullable=False)
cptId = db.Colum... | 35.958333 | 76 | 0.711472 | import datetime as dt
from SUIBE_DID_Data_Manager.database import (
Column,
Model,
db,
)
from SUIBE_DID_Data_Manager.extensions import db
class CredentialPojo(db.Model):
__tablename__ = "credential_pojo"
credentialID = db.Column(db.String(88), primary_key=True,nullable=False)
cptId = db.Colum... | true | true |
08f97a35bc2c3fca6135d57d517659bd19cb4ad6 | 3,149 | py | Python | tests/test_stream.py | FRidh/scintillations | 848aa0a6e7424cbc67bbabec129f05c0e6d4935a | [
"BSD-2-Clause"
] | null | null | null | tests/test_stream.py | FRidh/scintillations | 848aa0a6e7424cbc67bbabec129f05c0e6d4935a | [
"BSD-2-Clause"
] | null | null | null | tests/test_stream.py | FRidh/scintillations | 848aa0a6e7424cbc67bbabec129f05c0e6d4935a | [
"BSD-2-Clause"
] | null | null | null | import scintillations
from scintillations.stream import *
from acoustics import Signal
@pytest.fixture(params=[1.0, 10.0, 100.0])
def speed(request):
return request.param
@pytest.fixture(params=[1.0, 10.0])
def correlation_length(request):
return request.param
@pytest.fixture(params=[None, 100, 200])
def se... | 28.116071 | 126 | 0.702445 | import scintillations
from scintillations.stream import *
from acoustics import Signal
@pytest.fixture(params=[1.0, 10.0, 100.0])
def speed(request):
return request.param
@pytest.fixture(params=[1.0, 10.0])
def correlation_length(request):
return request.param
@pytest.fixture(params=[None, 100, 200])
def se... | true | true |
08f97a66e7915c36669601d3db7be5b50a09ffee | 1,545 | py | Python | crawler.py | Spinkelben/remote-radio | 666f26d5a5cea247962ed0068d561ca1e3cca740 | [
"MIT"
] | null | null | null | crawler.py | Spinkelben/remote-radio | 666f26d5a5cea247962ed0068d561ca1e3cca740 | [
"MIT"
] | null | null | null | crawler.py | Spinkelben/remote-radio | 666f26d5a5cea247962ed0068d561ca1e3cca740 | [
"MIT"
] | null | null | null | import requests
from html.parser import HTMLParser
import re
import json
class IndexParser(HTMLParser):
def __init__(self):
super().__init__()
self.ids = set()
def handle_starttag(self, tag, attrs):
if tag == "a":
for attr in attrs:
if attr[0] == "href":
... | 34.333333 | 173 | 0.566343 | import requests
from html.parser import HTMLParser
import re
import json
class IndexParser(HTMLParser):
def __init__(self):
super().__init__()
self.ids = set()
def handle_starttag(self, tag, attrs):
if tag == "a":
for attr in attrs:
if attr[0] == "href":
... | true | true |
08f97a7570e66ff14d950c231a8a4165739b67ad | 256 | py | Python | database/users.py | SonicRift/VestaboardCalendar | e1810df86a58488ecd3190e6a7a368f2cc10e8ac | [
"MIT"
] | null | null | null | database/users.py | SonicRift/VestaboardCalendar | e1810df86a58488ecd3190e6a7a368f2cc10e8ac | [
"MIT"
] | null | null | null | database/users.py | SonicRift/VestaboardCalendar | e1810df86a58488ecd3190e6a7a368f2cc10e8ac | [
"MIT"
] | null | null | null | from database.firestore import db
userRef = db.collection('users')
class User(object):
@staticmethod
def getAll():
return userRef.get()
@staticmethod
def addUser(user):
r = userRef.document(user['subscriptionId']).set(user)
print(r) | 18.285714 | 58 | 0.695313 | from database.firestore import db
userRef = db.collection('users')
class User(object):
@staticmethod
def getAll():
return userRef.get()
@staticmethod
def addUser(user):
r = userRef.document(user['subscriptionId']).set(user)
print(r) | true | true |
08f97b92295c3c29eff10b9ee0006f0dca2d439f | 1,286 | py | Python | commerce/admin.py | PrestonMonteWest/comp-mart | e7699f3c4ac1d77c447cd9300fb9912f4840d2a9 | [
"Apache-2.0"
] | 1 | 2018-04-09T02:06:30.000Z | 2018-04-09T02:06:30.000Z | commerce/admin.py | PrestonMonteWest/compmart | e7699f3c4ac1d77c447cd9300fb9912f4840d2a9 | [
"Apache-2.0"
] | 1 | 2018-07-04T21:08:58.000Z | 2018-07-09T02:34:50.000Z | commerce/admin.py | PrestonMonteWest/compmart | e7699f3c4ac1d77c447cd9300fb9912f4840d2a9 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from . import models
class OrderItemInline(admin.TabularInline):
fields = ('product', 'quantity')
raw_id_fields = ('product',)
model = models.OrderItem
extra = 1
class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'price', 'description', 'stock', 'discont... | 36.742857 | 80 | 0.66874 | from django.contrib import admin
from . import models
class OrderItemInline(admin.TabularInline):
fields = ('product', 'quantity')
raw_id_fields = ('product',)
model = models.OrderItem
extra = 1
class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'price', 'description', 'stock', 'discont... | true | true |
08f97ba3f3c40bcb631778d4a123baa7ba1a302c | 15,597 | py | Python | src/keras_layers/keras_layer_DecodeDetections1.py | mohamed-ezz/tflite_workshop_guc | 9a201072e9cc6ad1c849dc88e541900398e036c5 | [
"Apache-2.0"
] | null | null | null | src/keras_layers/keras_layer_DecodeDetections1.py | mohamed-ezz/tflite_workshop_guc | 9a201072e9cc6ad1c849dc88e541900398e036c5 | [
"Apache-2.0"
] | null | null | null | src/keras_layers/keras_layer_DecodeDetections1.py | mohamed-ezz/tflite_workshop_guc | 9a201072e9cc6ad1c849dc88e541900398e036c5 | [
"Apache-2.0"
] | null | null | null | '''
A custom Keras layer to decode the raw SSD prediction output. Corresponds to the
`DetectionOutput` layer type in the original Caffe implementation of SSD.
Copyright (C) 2018 Pierluigi Ferrari
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... | 54.534965 | 257 | 0.577739 |
from __future__ import division
import numpy as np
import tensorflow as tf
import keras.backend as K
from keras.engine.topology import InputSpec
from keras.engine.topology import Layer
class DecodeDetections(Layer):
def __init__(self,
confidence_thresh=0.01,
iou_threshold=0.45,
... | true | true |
08f97baa45e714d56b93739e450ec3477b7867ad | 13,345 | py | Python | plugins/Seen/plugin.py | Supybot/Supybot | 8d16953e1dcbb455ec75bc30c9950e64879a8d8a | [
"BSD-3-Clause"
] | 40 | 2015-01-28T22:16:36.000Z | 2021-12-15T02:22:56.000Z | plugins/Seen/plugin.py | DalavanCloud/supybot | 159c1e7cd886cb5f8c68d1ba703b1d302a716e5d | [
"BSD-3-Clause"
] | 17 | 2015-01-05T21:06:22.000Z | 2015-12-07T20:45:44.000Z | plugins/Seen/plugin.py | DalavanCloud/supybot | 159c1e7cd886cb5f8c68d1ba703b1d302a716e5d | [
"BSD-3-Clause"
] | 28 | 2015-01-03T23:53:58.000Z | 2021-06-01T05:27:20.000Z | ###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2010-2011, 2013, James McCoy
# 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 ... | 39.365782 | 88 | 0.579693 |
import re
import time
import supybot.log as log
import supybot.conf as conf
import supybot.utils as utils
import supybot.world as world
import supybot.ircdb as ircdb
from supybot.commands import *
import supybot.irclib as irclib
import supybot.ircmsgs as ircmsgs
import supybot.plugins as plugins
import supybot.ircuti... | true | true |
08f97c076c5b57b448187649d41a6480f058b346 | 19,359 | py | Python | couchjs/scons/scons-local-2.0.1/SCons/Tool/intelc.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 73 | 2015-03-19T04:04:52.000Z | 2021-08-16T10:45:11.000Z | couchjs/scons/scons-local-2.0.1/SCons/Tool/intelc.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 5 | 2016-04-26T13:19:25.000Z | 2017-03-11T14:11:22.000Z | couchjs/scons/scons-local-2.0.1/SCons/Tool/intelc.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 13 | 2015-03-27T05:21:42.000Z | 2017-05-22T11:45:30.000Z | """SCons.Tool.icl
Tool-specific initialization for the Intel C/C++ compiler.
Supports Linux and Windows compilers, v7 and up.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 200... | 40.080745 | 146 | 0.563614 | """SCons.Tool.icl
Tool-specific initialization for the Intel C/C++ compiler.
Supports Linux and Windows compilers, v7 and up.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 200... | false | true |
08f97c151c7b558e177590345300cbad8a887607 | 12,903 | py | Python | utils/defaultAttrState.py | fsanges/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 165 | 2015-01-26T05:22:04.000Z | 2022-03-22T02:50:41.000Z | utils/defaultAttrState.py | qeeji/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 5 | 2015-12-02T02:39:44.000Z | 2020-12-09T02:45:54.000Z | utils/defaultAttrState.py | qeeji/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 83 | 2015-02-10T17:18:24.000Z | 2022-02-10T07:16:47.000Z | import maya.cmds as mc
import glTools.utils.reference
def addDefaultAttrState(objList):
'''
Add a default attribute state multi attribute that will be used to store specified attribute values which can be restored on command.
@param objList: List of objects to add the default attribute state multi attribute to.
@... | 32.2575 | 158 | 0.706115 | import maya.cmds as mc
import glTools.utils.reference
def addDefaultAttrState(objList):
if not objList: return
defAttr = 'defaultAttrState'
attrList = []
for obj in objList:
if not mc.objExists(obj):
raise Exception('Object "'+obj+'" does not exist!')
if not mc.attributeQuery(defAttr,n=obj... | true | true |
08f97e485566a2136924701b37dfe2414d2bc57d | 2,610 | py | Python | shot_detector/utils/collections/smart_dict.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 18 | 2015-09-27T21:34:18.000Z | 2022-03-24T12:14:51.000Z | shot_detector/utils/collections/smart_dict.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 6 | 2021-03-18T21:21:35.000Z | 2022-03-11T23:32:55.000Z | shot_detector/utils/collections/smart_dict.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 3 | 2017-09-14T20:53:26.000Z | 2021-12-18T19:18:18.000Z | # -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
import six
# noinspection PyPep8
class SmartDict(dict):
"""
Simple object that implements `dict` behavior.
You can see it... | 26.363636 | 71 | 0.500383 |
from __future__ import absolute_import, division, print_function
import six
class SmartDict(dict):
__marker__ = object()
def __init__(self, arg=None, __internal_class__=dict, **kwargs):
i_cls = __internal_class__
self.__dict__ = i_cls()
self.__dict__.update(i_cls([(key, value) for ... | true | true |
08f97ec0e389eaba05c418699e717a637191a7a7 | 3,674 | py | Python | raspi_codes/publisher.py | Kalkulus1/ashesi-iot-terraform-presentation-demo | a268860f0e4c8cafcb7fe5d642224a239aa43d83 | [
"MIT"
] | null | null | null | raspi_codes/publisher.py | Kalkulus1/ashesi-iot-terraform-presentation-demo | a268860f0e4c8cafcb7fe5d642224a239aa43d83 | [
"MIT"
] | null | null | null | raspi_codes/publisher.py | Kalkulus1/ashesi-iot-terraform-presentation-demo | a268860f0e4c8cafcb7fe5d642224a239aa43d83 | [
"MIT"
] | null | null | null | # importing libraries
import paho.mqtt.client as paho
import os
import socket
import ssl
import random
import string
import json
from time import sleep
from random import uniform
connflag = False
def on_connect(client, userdata, flags, rc): # func for making connection
global connflag
print("C... | 33.706422 | 131 | 0.632825 | import paho.mqtt.client as paho
import os
import socket
import ssl
import random
import string
import json
from time import sleep
from random import uniform
connflag = False
def on_connect(client, userdata, flags, rc): global connflag
print("Connected to AWS")
connflag = True
print("Co... | true | true |
08f97ed532cb6a221e2c8e68719aff1e46f970c7 | 21 | py | Python | mixel/__init__.py | lpang36/Mixel | c12fba3c81c08ba54bdce03e4aa41d8879e1c244 | [
"MIT"
] | 1 | 2019-05-17T03:10:51.000Z | 2019-05-17T03:10:51.000Z | mixel/__init__.py | lpang36/Mixel | c12fba3c81c08ba54bdce03e4aa41d8879e1c244 | [
"MIT"
] | null | null | null | mixel/__init__.py | lpang36/Mixel | c12fba3c81c08ba54bdce03e4aa41d8879e1c244 | [
"MIT"
] | 1 | 2020-07-12T17:57:51.000Z | 2020-07-12T17:57:51.000Z | from main import mix
| 10.5 | 20 | 0.809524 | from main import mix
| true | true |
08f97f5c22e1c4bc768475a00b6d94d7a17179de | 114 | py | Python | python/testData/stubs/TypingNamedTupleFieldsChain.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/stubs/TypingNamedTupleFieldsChain.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/stubs/TypingNamedTupleFieldsChain.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from typing import NamedTuple
fields0 = [("x", str), ("y", int)]
fields = fields0
nt = NamedTuple("name", fields) | 22.8 | 34 | 0.666667 | from typing import NamedTuple
fields0 = [("x", str), ("y", int)]
fields = fields0
nt = NamedTuple("name", fields) | true | true |
08f97f9e6571ab0aba708e98ac2f97114023705e | 6,944 | py | Python | tests/_dao/TestRTKSurvival.py | rakhimov/rtk | adc35e218ccfdcf3a6e3082f6a1a1d308ed4ff63 | [
"BSD-3-Clause"
] | null | null | null | tests/_dao/TestRTKSurvival.py | rakhimov/rtk | adc35e218ccfdcf3a6e3082f6a1a1d308ed4ff63 | [
"BSD-3-Clause"
] | null | null | null | tests/_dao/TestRTKSurvival.py | rakhimov/rtk | adc35e218ccfdcf3a6e3082f6a1a1d308ed4ff63 | [
"BSD-3-Clause"
] | 2 | 2020-04-03T04:14:42.000Z | 2021-02-22T05:30:35.000Z | #!/usr/bin/env python -O
# -*- coding: utf-8 -*-
#
# tests.unit._dao.TestRTKSurvival.py is part of The RTK Project
#
# All rights reserved.
"""
This is the test class for testing the RTKSurvival module algorithms and
models.
"""
import sys
from os.path import dirname
sys.path.insert(0, dirname(dirname(dirname... | 39.68 | 101 | 0.586838 |
import sys
from os.path import dirname
sys.path.insert(0, dirname(dirname(dirname(dirname(__file__)))) + "/rtk", )
from datetime import date, timedelta
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
import unittest
from nose.plugins.attrib import attr
from dao.RTKSu... | true | true |
08f97fad1d36c6fce8cbc831f63ea5284fbfaf83 | 4,374 | py | Python | book_collector.py | MakowToms/BookRecommender | ae011a8cd8b6285285559b0c965b2b5d439c1e68 | [
"BSD-2-Clause"
] | 1 | 2021-01-19T21:01:25.000Z | 2021-01-19T21:01:25.000Z | book_collector.py | MakowToms/BookRecommender | ae011a8cd8b6285285559b0c965b2b5d439c1e68 | [
"BSD-2-Clause"
] | null | null | null | book_collector.py | MakowToms/BookRecommender | ae011a8cd8b6285285559b0c965b2b5d439c1e68 | [
"BSD-2-Clause"
] | null | null | null | import spacy
from sparql.query import QueryExecutor
from wordnet import bag_words, rank_categories, detect_language
from wordnet.category import bag_bag_similarity
from wordnet.detect_hyponym import detect_person, detect_work_of_art
nlp = spacy.load('en_core_web_sm')
def compute_list_score(scores: list):
result... | 39.053571 | 122 | 0.653635 | import spacy
from sparql.query import QueryExecutor
from wordnet import bag_words, rank_categories, detect_language
from wordnet.category import bag_bag_similarity
from wordnet.detect_hyponym import detect_person, detect_work_of_art
nlp = spacy.load('en_core_web_sm')
def compute_list_score(scores: list):
result... | true | true |
08f9815e25498f1ec1ac33ea2bd8d08767a13dc4 | 641 | py | Python | utils/translate.py | bekcoder/testbot | fbd2855bc338c2929922dd59c9546147633bfcbf | [
"MIT"
] | null | null | null | utils/translate.py | bekcoder/testbot | fbd2855bc338c2929922dd59c9546147633bfcbf | [
"MIT"
] | 2 | 2020-05-04T14:26:01.000Z | 2020-05-04T14:28:27.000Z | utils/translate.py | bekcoder/testbot | fbd2855bc338c2929922dd59c9546147633bfcbf | [
"MIT"
] | null | null | null | from googletrans import Translator
trans = Translator()
def to_ru(words):
t = trans.translate(words, src='uz', dest='ru')
return t.text
def to_de(words):
t = trans.translate(words, src='uz', dest='de')
return t.text
def to_pl(words):
t = trans.translate(words, src='uz', dest='en')
return t.text
def to_es... | 17.805556 | 78 | 0.664587 | from googletrans import Translator
trans = Translator()
def to_ru(words):
t = trans.translate(words, src='uz', dest='ru')
return t.text
def to_de(words):
t = trans.translate(words, src='uz', dest='de')
return t.text
def to_pl(words):
t = trans.translate(words, src='uz', dest='en')
return t.text
def to_es... | true | true |
08f98231fdadff83e46eef63d804abda684028cb | 4,354 | py | Python | experiment/build/gcb_build.py | chenju2k6/fuzzbench-1 | be6d1f2590337e81ede7057ba2028d8b658f9a14 | [
"Apache-2.0"
] | null | null | null | experiment/build/gcb_build.py | chenju2k6/fuzzbench-1 | be6d1f2590337e81ede7057ba2028d8b658f9a14 | [
"Apache-2.0"
] | null | null | null | experiment/build/gcb_build.py | chenju2k6/fuzzbench-1 | be6d1f2590337e81ede7057ba2028d8b658f9a14 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.983471 | 80 | 0.673174 |
import tempfile
from typing import Dict
from common import logs
from common import new_process
from common import utils
from common import yaml_utils
from experiment.build import build_utils
from experiment.build import docker_images
from experiment.build import generate_cloudbuild
BUILDER_STEP_IDS = [
'build-fu... | true | true |
08f9824f583fb91c872f3efb9cd15f7e082f5935 | 440 | gyp | Python | binding.gyp | ymrdf/socketjs | 683cc160f2dd2a2ac638af04ad801e46b6ebeea2 | [
"MIT"
] | 1 | 2021-03-01T07:19:26.000Z | 2021-03-01T07:19:26.000Z | binding.gyp | ymrdf/socketjs | 683cc160f2dd2a2ac638af04ad801e46b6ebeea2 | [
"MIT"
] | null | null | null | binding.gyp | ymrdf/socketjs | 683cc160f2dd2a2ac638af04ad801e46b6ebeea2 | [
"MIT"
] | null | null | null | {
"targets": [
{
"target_name": "socket",
"sources": [ "src/socket.cc" ],
"include_dirs": [
"<!(node -p \"require('node-addon-api').include_dir\")",
"<!(node -e \"require('nan')\")"
],
"cflags!": ["-fno-exceptions"],
"cflags_cc!": ["-fno-exceptions"],
"def... | 24.444444 | 64 | 0.484091 | {
"targets": [
{
"target_name": "socket",
"sources": [ "src/socket.cc" ],
"include_dirs": [
"<!(node -p \"require('node-addon-api').include_dir\")",
"<!(node -e \"require('nan')\")"
],
"cflags!": ["-fno-exceptions"],
"cflags_cc!": ["-fno-exceptions"],
"def... | true | true |
08f98250cf73f99231b47dcd39c3961115aa13c8 | 545 | py | Python | server/author/urls.py | C404TEAMW21/CMPUT404_PROJECT | 0b5e7e5e37ff265e843056457bd00ab77f4373f7 | [
"W3C-20150513"
] | null | null | null | server/author/urls.py | C404TEAMW21/CMPUT404_PROJECT | 0b5e7e5e37ff265e843056457bd00ab77f4373f7 | [
"W3C-20150513"
] | 81 | 2021-02-14T02:35:52.000Z | 2021-04-10T21:14:27.000Z | server/author/urls.py | C404TEAMW21/CMPUT404_PROJECT | 0b5e7e5e37ff265e843056457bd00ab77f4373f7 | [
"W3C-20150513"
] | 4 | 2021-02-14T19:44:23.000Z | 2021-04-06T22:35:35.000Z | from django.urls import path
from author import views
app_name = 'author'
urlpatterns = [
path('author/create/', views.CreateAuthorView.as_view(), name='create'),
path('author/auth/', views.AuthAuthorView.as_view(), name='auth'),
path('author/me/', views.MyProfileView.as_view(), name = 'me'),
path('a... | 38.928571 | 83 | 0.684404 | from django.urls import path
from author import views
app_name = 'author'
urlpatterns = [
path('author/create/', views.CreateAuthorView.as_view(), name='create'),
path('author/auth/', views.AuthAuthorView.as_view(), name='auth'),
path('author/me/', views.MyProfileView.as_view(), name = 'me'),
path('a... | true | true |
08f982885d7a59091e12cf77f56a1a6303671fc4 | 5,147 | py | Python | secure-web/helpers/app_helper.py | ongzhixian/gcp-zxsh | 3b476c67c05ea12a0f2f01a4bc3715fdf44c67ad | [
"MIT"
] | null | null | null | secure-web/helpers/app_helper.py | ongzhixian/gcp-zxsh | 3b476c67c05ea12a0f2f01a4bc3715fdf44c67ad | [
"MIT"
] | null | null | null | secure-web/helpers/app_helper.py | ongzhixian/gcp-zxsh | 3b476c67c05ea12a0f2f01a4bc3715fdf44c67ad | [
"MIT"
] | null | null | null | ################################################################################
# Modules and functions import statements
################################################################################
import logging
import sys
from datetime import datetime
from flask import url_for, get_flashed_messages, request,... | 42.53719 | 103 | 0.5374 |
import logging
import sys
from datetime import datetime
from flask import url_for, get_flashed_messages, request, redirect
from helpers.app_runtime import jinja2_env, app_settings
from modules.security import aes_decrypt_from_hex
def get_model(cookie_json=None):
caller = sys._getframe(1) ... | true | true |
08f982ab154dcdd1ad0e0aae2b905df7af05e561 | 577 | py | Python | xmodels/iso8601/__init__.py | berndca/xmodels | 8265522229a1ce482a2866cdbd1938293a74bb67 | [
"BSD-3-Clause"
] | 1 | 2016-05-05T08:33:41.000Z | 2016-05-05T08:33:41.000Z | xmodels/iso8601/__init__.py | berndca/xmodels | 8265522229a1ce482a2866cdbd1938293a74bb67 | [
"BSD-3-Clause"
] | 1 | 2016-03-29T20:16:41.000Z | 2016-03-29T20:16:41.000Z | xmodels/iso8601/__init__.py | berndca/xmodels | 8265522229a1ce482a2866cdbd1938293a74bb67 | [
"BSD-3-Clause"
] | null | null | null | from .utility import ParseError
from .datetimestamps import parse_date, parse_time
from .timezones import Timezone
__all__ = ['parse',
'parse_date',
'parse_time',
'Timezone',
'ParseError']
def parse(representation):
"""Attempts to parse an ISO8601 formatted ``represent... | 27.47619 | 72 | 0.67591 | from .utility import ParseError
from .datetimestamps import parse_date, parse_time
from .timezones import Timezone
__all__ = ['parse',
'parse_date',
'parse_time',
'Timezone',
'ParseError']
def parse(representation):
representation = str(representation).upper().strip()
... | true | true |
08f9832d5bebf27f4ae786af30ce7fa230bfff22 | 30,468 | py | Python | tests/test_jams_utils.py | BirdVox/mirdata | 42d9fddb5b84ad95b6fb15a56f1b572c77db9eb3 | [
"BSD-3-Clause"
] | null | null | null | tests/test_jams_utils.py | BirdVox/mirdata | 42d9fddb5b84ad95b6fb15a56f1b572c77db9eb3 | [
"BSD-3-Clause"
] | null | null | null | tests/test_jams_utils.py | BirdVox/mirdata | 42d9fddb5b84ad95b6fb15a56f1b572c77db9eb3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import pytest
import jams
from mirdata import jams_utils, utils
def get_jam_data(jam, namespace, annot_numb):
time = []
duration = []
value = []
confidence = []
for obs in jam.search(namespace=namespace)[annot_numb]['data']:
time.append(obs.time... | 31.089796 | 87 | 0.473612 |
import numpy as np
import pytest
import jams
from mirdata import jams_utils, utils
def get_jam_data(jam, namespace, annot_numb):
time = []
duration = []
value = []
confidence = []
for obs in jam.search(namespace=namespace)[annot_numb]['data']:
time.append(obs.time)
duration.appen... | true | true |
08f983eaec96e7138c5b5303b54f14eb23797f50 | 3,754 | py | Python | lib/public/dut_connect.py | tenddy/fhprojects | bdcf73cb7524f164e7d37bc45df601b42e802cd5 | [
"Apache-2.0"
] | null | null | null | lib/public/dut_connect.py | tenddy/fhprojects | bdcf73cb7524f164e7d37bc45df601b42e802cd5 | [
"Apache-2.0"
] | null | null | null | lib/public/dut_connect.py | tenddy/fhprojects | bdcf73cb7524f164e7d37bc45df601b42e802cd5 | [
"Apache-2.0"
] | null | null | null | import logging
import telnetlib
import time
from functools import wraps
from lib.public.fhlog import logger
# Fiberhome OLT telnet 登录提示符,用户名及密码
fh_olt_promot = {'Login': 'GEPON', 'Password': 'GEPON', 'User>': 'enable'}
def dut_connect_telnet(host: str, port=23, login_promot=fh_olt_promot, promot=None):
... | 31.283333 | 116 | 0.555408 | import logging
import telnetlib
import time
from functools import wraps
from lib.public.fhlog import logger
fh_olt_promot = {'Login': 'GEPON', 'Password': 'GEPON', 'User>': 'enable'}
def dut_connect_telnet(host: str, port=23, login_promot=fh_olt_promot, promot=None):
if 'User>' not in login_promot... | true | true |
08f98403ddfd6e32795d5185573619783612ffff | 2,253 | py | Python | examples/adspygoogle/dfp/v201204/deactivate_placements.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201204/deactivate_placements.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201204/deactivate_placements.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2012 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... | 33.626866 | 80 | 0.706613 |
"""This code example deactivates all active placements. To determine which
placements exist, run get_all_placements.py."""
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)'
import os
import sys
sys.path.insert(0, os.path.join('..', '..', '..', '..'))
from adspygoogle import DfpClient
from adspygoogle.dfp import Dfp... | false | true |
08f9858bd5de5845437fe62c7d6164cbf46555f4 | 22,302 | py | Python | google/dataflow/v1beta3/dataflow-v1beta3-py/google/cloud/dataflow_v1beta3/services/jobs_v1_beta3/async_client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/dataflow/v1beta3/dataflow-v1beta3-py/google/cloud/dataflow_v1beta3/services/jobs_v1_beta3/async_client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/dataflow/v1beta3/dataflow-v1beta3-py/google/cloud/dataflow_v1beta3/services/jobs_v1_beta3/async_client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.825 | 134 | 0.630078 | from collections import OrderedDict
import functools
import re
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources
import google.api_core.client_options as ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.... | true | true |
08f985b67caf1a5785e57c0f8a0bd67cf8e966a6 | 3,231 | py | Python | python/cendalytics/wikipedia/ingest/dmo/dbpedia_page_finder.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/wikipedia/ingest/dmo/dbpedia_page_finder.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/wikipedia/ingest/dmo/dbpedia_page_finder.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from typing import Optional
import wikipedia
from wikipedia import WikipediaPage
from base import BaseObject
class DBpediaPageFinder(BaseObject):
""" make a wire call to dbPedia to find a page """
__d_disambiguation = { # TODO: this should be list injected
... | 33.65625 | 103 | 0.530486 |
from typing import Optional
import wikipedia
from wikipedia import WikipediaPage
from base import BaseObject
class DBpediaPageFinder(BaseObject):
__d_disambiguation = { 'cell': 'Cellular organizational structure',
'substance': 'chemical substance',
'condition': 'medical condition',
... | true | true |
08f9865990dab9a3bf82b04742a3d6ff9e5c8dbd | 7,101 | py | Python | DQM/SiPixelCommon/test/client_template_calib_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | DQM/SiPixelCommon/test/client_template_calib_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | DQM/SiPixelCommon/test/client_template_calib_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
process = cms.Process("SIPIXELDQM")
process.load("Geometry.TrackerSimData.trackerSimGeometryXML_cfi")
process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
process.load("Geometry.TrackerNumberingBuilder.tr... | 45.229299 | 134 | 0.786368 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
process = cms.Process("SIPIXELDQM")
process.load("Geometry.TrackerSimData.trackerSimGeometryXML_cfi")
process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
process.load("Geometry.TrackerNumberingBuilder.tr... | false | true |
08f98738ea156f0ecd36c16fcade7cc037b7719b | 22,178 | py | Python | tfx/orchestration/experimental/core/pipeline_ops_test.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/experimental/core/pipeline_ops_test.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/experimental/core/pipeline_ops_test.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 43.486275 | 80 | 0.708269 |
import copy
import os
import threading
import time
from absl.testing.absltest import mock
import tensorflow as tf
from tfx.orchestration import metadata
from tfx.orchestration.experimental.core import async_pipeline_task_gen
from tfx.orchestration.experimental.core import pipeline_ops
from tfx.orchestration.experimen... | true | true |
08f987c2b5bd2e08ac78058c7b0803ced962386f | 72,594 | py | Python | pycqed/measurement/openql_experiments/multi_qubit_oql.py | oschusler/PycQED_py3 | a24c81684ff22f11a62dfe191817029749115e10 | [
"MIT"
] | null | null | null | pycqed/measurement/openql_experiments/multi_qubit_oql.py | oschusler/PycQED_py3 | a24c81684ff22f11a62dfe191817029749115e10 | [
"MIT"
] | null | null | null | pycqed/measurement/openql_experiments/multi_qubit_oql.py | oschusler/PycQED_py3 | a24c81684ff22f11a62dfe191817029749115e10 | [
"MIT"
] | null | null | null | import numpy as np
import openql.openql as ql
import pycqed.measurement.openql_experiments.openql_helpers as oqh
from pycqed.utilities.general import int2base, suppress_stdout
from os.path import join
from pycqed.instrument_drivers.meta_instrument.LutMans.flux_lutman import _def_lm as _def_lm_flux
def single_flux_puls... | 35.567859 | 141 | 0.546257 | import numpy as np
import openql.openql as ql
import pycqed.measurement.openql_experiments.openql_helpers as oqh
from pycqed.utilities.general import int2base, suppress_stdout
from os.path import join
from pycqed.instrument_drivers.meta_instrument.LutMans.flux_lutman import _def_lm as _def_lm_flux
def single_flux_puls... | true | true |
08f987fed46866aa60c4c638af7152bb8a615ca6 | 1,048 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/monitor/models/RuleState.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/monitor/models/RuleState.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/monitor/models/RuleState.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 32.75 | 75 | 0.704198 |
class RuleState(object):
def __init__(self, resourceId=None, ruleCount=None, state=None):
self.resourceId = resourceId
self.ruleCount = ruleCount
self.state = state
| true | true |
08f988bf13ee3cfff7e841b27a5da2f4f80890b7 | 3,165 | py | Python | absoluteCLF/valid.py | horoiwa/VisionML | 95fa454a4c309f5e985dff1d067dd8341d260a3c | [
"MIT"
] | null | null | null | absoluteCLF/valid.py | horoiwa/VisionML | 95fa454a4c309f5e985dff1d067dd8341d260a3c | [
"MIT"
] | 16 | 2019-06-27T08:00:35.000Z | 2019-07-08T15:29:43.000Z | valid.py | horoiwa/absoluteCLF | f1507b3acbb696a39d46037c1653fe2ca5702a0b | [
"MIT"
] | null | null | null | import os
import glob
import pandas as pd
import pathlib
import shutil
import sys
from PIL import Image
import numpy as np
from skimage.segmentation import mark_boundaries
import matplotlib.pyplot as plt
import lime
from lime import lime_image
from src.models import load_model
from src.util import get_latestname
from... | 31.029412 | 78 | 0.602212 | import os
import glob
import pandas as pd
import pathlib
import shutil
import sys
from PIL import Image
import numpy as np
from skimage.segmentation import mark_boundaries
import matplotlib.pyplot as plt
import lime
from lime import lime_image
from src.models import load_model
from src.util import get_latestname
from... | true | true |
08f988f255502b3495728f3d5934fee9b751d8f4 | 1,168 | py | Python | app/com_ss_android_ugc_aweme/180101/find_user.py | zhangxdnw/pc_remote_android | 325b982e8690a6b4928ca59921bfef32e523fbdc | [
"MIT"
] | null | null | null | app/com_ss_android_ugc_aweme/180101/find_user.py | zhangxdnw/pc_remote_android | 325b982e8690a6b4928ca59921bfef32e523fbdc | [
"MIT"
] | null | null | null | app/com_ss_android_ugc_aweme/180101/find_user.py | zhangxdnw/pc_remote_android | 325b982e8690a6b4928ca59921bfef32e523fbdc | [
"MIT"
] | 1 | 2021-12-02T19:37:55.000Z | 2021-12-02T19:37:55.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : find_user.py
@Contact : 379327479@qq.com
@License : MIT
@Modify Time @Author @Version @Description
------------ ------- -------- -----------
2021/10/25 17:43 zxd 1.0 None
"""
import sys
import uiautomator2... | 29.2 | 103 | 0.673801 |
import sys
import uiautomator2 as u2
from uiautomator2 import Device
from app.com_ss_android_ugc_aweme import constant
from app.com_ss_android_ugc_aweme.common import search_common
sys.path.append('app/com_ss_android_ugc_aweme/180101')
from constant180101 import *
def main(device: Device, params: str):
keywo... | true | true |
08f98a9087b3a4efb3b7acca76db5f77f7aa6ea4 | 181 | py | Python | license_emailing_api/admin.py | Max635/under-test | 04c1125612135b9e298253ab8cdccd1cb051f75a | [
"PostgreSQL"
] | 1 | 2021-02-11T18:10:27.000Z | 2021-02-11T18:10:27.000Z | license_emailing_api/admin.py | Max635/under-test | 04c1125612135b9e298253ab8cdccd1cb051f75a | [
"PostgreSQL"
] | null | null | null | license_emailing_api/admin.py | Max635/under-test | 04c1125612135b9e298253ab8cdccd1cb051f75a | [
"PostgreSQL"
] | null | null | null | from django.contrib import admin
from .models import CustomerLicenseModel
class CustomerAdmin(admin.ModelAdmin):
fields = '__all__'
admin.site.register(CustomerLicenseModel)
| 20.111111 | 41 | 0.812155 | from django.contrib import admin
from .models import CustomerLicenseModel
class CustomerAdmin(admin.ModelAdmin):
fields = '__all__'
admin.site.register(CustomerLicenseModel)
| true | true |
08f98bedf4004473bb9dd348238b8ee0fc7dba7a | 2,145 | py | Python | socialdistribution/api/tests/tests_post.py | CMPUT404-Project-Group/CMPUT404-Group-Project | e541cc609f260d7221fe0be8975c5b2444d74af0 | [
"W3C-20150513"
] | null | null | null | socialdistribution/api/tests/tests_post.py | CMPUT404-Project-Group/CMPUT404-Group-Project | e541cc609f260d7221fe0be8975c5b2444d74af0 | [
"W3C-20150513"
] | 44 | 2021-10-14T15:44:46.000Z | 2021-12-05T00:57:23.000Z | socialdistribution/api/tests/tests_post.py | CMPUT404-Project-Group/Social-Distribution-CMPUT404-Group-Project | e541cc609f260d7221fe0be8975c5b2444d74af0 | [
"W3C-20150513"
] | 1 | 2021-12-07T01:14:14.000Z | 2021-12-07T01:14:14.000Z |
from django.test import TestCase
from ..models import Post, PostBuilder, User
from .utils import TestUtils
class PostBuilderTest(TestCase):
def setUp(self):
self.post_builder = PostBuilder()
def test_initializes_with_id(self):
self.assertIsNotNone(self.post_builder.id)
def test_initia... | 30.211268 | 94 | 0.622844 |
from django.test import TestCase
from ..models import Post, PostBuilder, User
from .utils import TestUtils
class PostBuilderTest(TestCase):
def setUp(self):
self.post_builder = PostBuilder()
def test_initializes_with_id(self):
self.assertIsNotNone(self.post_builder.id)
def test_initia... | true | true |
08f98d12d3e6ca0e23e0ebb10fe75a8434afaaba | 1,524 | py | Python | website/addons/googledrive/tests/test_serializer.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | website/addons/googledrive/tests/test_serializer.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | 13 | 2020-03-24T15:29:41.000Z | 2022-03-11T23:15:28.000Z | website/addons/googledrive/tests/test_serializer.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Serializer tests for the Box addon."""
import mock
from nose.tools import * # noqa (PEP8 asserts)
from website.addons.base.testing.serializers import StorageAddonSerializerTestSuiteMixin
from website.addons.googledrive.model import GoogleDriveProvider
from website.addons.googledrive.tests.f... | 42.333333 | 89 | 0.76378 | import mock
from nose.tools import *
from website.addons.base.testing.serializers import StorageAddonSerializerTestSuiteMixin
from website.addons.googledrive.model import GoogleDriveProvider
from website.addons.googledrive.tests.factories import GoogleDriveAccountFactory
from website.addons.googledrive.serializer imp... | true | true |
08f98d32f073c8a759a51d5a1b5fc9a27ec1c07c | 1,927 | py | Python | python/http_request.py | MrVallentin/http_request | b21cb23ead1e3bc7176f09804f9cc9287b9f0168 | [
"MIT"
] | null | null | null | python/http_request.py | MrVallentin/http_request | b21cb23ead1e3bc7176f09804f9cc9287b9f0168 | [
"MIT"
] | null | null | null | python/http_request.py | MrVallentin/http_request | b21cb23ead1e3bc7176f09804f9cc9287b9f0168 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Author: Christian Vallentin <mail@vallentinsource.com>
# Website: http://vallentinsource.com
# Repository: https://github.com/MrVallentin/http_request
#
# Date Created: February 28, 2016
# Last Modified: February 29, 2016
#
# Developed and tested using Python 3.5.1
import http.client, urllib.... | 23.790123 | 65 | 0.694862 |
import http.client, urllib.parse
def http_request(url, data = None, method = "GET", headers = {}):
parsed = urllib.parse.urlparse(url)
scheme, netloc, path = parsed.scheme, parsed.netloc, parsed.path
if not method:
method = "GET"
method = method.upper()
if not headers:
headers = {}
if data:
data =... | true | true |
08f98e987a10b1737f8ef057c793045b7b91efed | 355 | py | Python | ganb_personal_client/api/__init__.py | k0uki/gmo-aozora-api-python | 3715f4c16957d239a82313d904e29a64998196f0 | [
"MIT"
] | 8 | 2019-05-21T05:10:35.000Z | 2021-08-11T04:59:42.000Z | ganb_personal_client/api/__init__.py | k0uki/gmo-aozora-api-python | 3715f4c16957d239a82313d904e29a64998196f0 | [
"MIT"
] | 2 | 2019-05-24T09:42:06.000Z | 2020-06-05T02:49:29.000Z | ganb_personal_client/api/__init__.py | k0uki/gmo-aozora-api-python | 3715f4c16957d239a82313d904e29a64998196f0 | [
"MIT"
] | 6 | 2019-05-22T01:57:19.000Z | 2021-12-16T13:33:58.000Z | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from ganb_personal_client.api.account_api import AccountApi
from ganb_personal_client.api.bulk_transfer_api import BulkTransferApi
from ganb_personal_client.api.transfer_api import TransferApi
from ganb_personal_client.api.virtual_ac... | 35.5 | 74 | 0.88169 | from __future__ import absolute_import
from ganb_personal_client.api.account_api import AccountApi
from ganb_personal_client.api.bulk_transfer_api import BulkTransferApi
from ganb_personal_client.api.transfer_api import TransferApi
from ganb_personal_client.api.virtual_account_api import VirtualAccountApi
| true | true |
08f98f86765ba1cbc69b5487bcfbefff1183ed51 | 2,127 | py | Python | config/urls.py | bhargava-kush/djangoGeo | 849c85488f3ad4863dcc6bc7e6f5ba09f991957f | [
"MIT"
] | null | null | null | config/urls.py | bhargava-kush/djangoGeo | 849c85488f3ad4863dcc6bc7e6f5ba09f991957f | [
"MIT"
] | null | null | null | config/urls.py | bhargava-kush/djangoGeo | 849c85488f3ad4863dcc6bc7e6f5ba09f991957f | [
"MIT"
] | null | null | null | from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from django.conf.urls import url
from rest_framework import routers
from pol... | 32.723077 | 85 | 0.663376 | from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from django.conf.urls import url
from rest_framework import routers
from pol... | true | true |
08f98fbba0c959953e15cd2ad387273a388033b7 | 1,596 | py | Python | openslides_proxyvoting/apps.py | jwinzer/openslides-proxyvoting | 7d7b400ebde7cfb222d73c03ee6cc55d2789e221 | [
"MIT"
] | null | null | null | openslides_proxyvoting/apps.py | jwinzer/openslides-proxyvoting | 7d7b400ebde7cfb222d73c03ee6cc55d2789e221 | [
"MIT"
] | null | null | null | openslides_proxyvoting/apps.py | jwinzer/openslides-proxyvoting | 7d7b400ebde7cfb222d73c03ee6cc55d2789e221 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from . import __description__, __verbose_name__, __version__
class ProxyVotingAppConfig(AppConfig):
name = 'openslides_proxyvoting'
verbose_name = __verbose_name__
description = __description__
version = __version__
angular_site_module = True
angular_projecto... | 36.272727 | 100 | 0.713033 | from django.apps import AppConfig
from . import __description__, __verbose_name__, __version__
class ProxyVotingAppConfig(AppConfig):
name = 'openslides_proxyvoting'
verbose_name = __verbose_name__
description = __description__
version = __version__
angular_site_module = True
angular_projecto... | true | true |
08f990593b06697815dab0aa728da33ed10338c7 | 29,943 | py | Python | ummeli/opportunities/migrations/0016_auto__add_field_job_category.py | praekelt/ummeli | c09731ed9a3a40359e81dcf6ed365797606ae9e2 | [
"BSD-3-Clause"
] | null | null | null | ummeli/opportunities/migrations/0016_auto__add_field_job_category.py | praekelt/ummeli | c09731ed9a3a40359e81dcf6ed365797606ae9e2 | [
"BSD-3-Clause"
] | null | null | null | ummeli/opportunities/migrations/0016_auto__add_field_job_category.py | praekelt/ummeli | c09731ed9a3a40359e81dcf6ed365797606ae9e2 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Job.category'
db.add_column('opportunities_job', 'category', self.gf('django.db.models.fie... | 88.327434 | 197 | 0.561233 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column('opportunities_job', 'category', self.gf('django.db.models.fields.PositiveIntegerField')(default=0), keep_defa... | true | true |
08f9913ec605458ba2a74c28ab667767c13c0a47 | 8,677 | py | Python | arquivos/GUI/home/home.py | Gui25Reis/DIferenca-de-datas-em-dias | 06782dd22047769cec46a648848ed6dbebabf047 | [
"MIT"
] | null | null | null | arquivos/GUI/home/home.py | Gui25Reis/DIferenca-de-datas-em-dias | 06782dd22047769cec46a648848ed6dbebabf047 | [
"MIT"
] | 1 | 2021-06-21T19:15:07.000Z | 2021-06-21T19:18:15.000Z | arquivos/GUI/home/home.py | Gui25Reis/DIferenca-de-datas-em-dias | 06782dd22047769cec46a648848ed6dbebabf047 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '_principal.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, Q... | 50.74269 | 221 | 0.688487 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Gui(object):
def setupUi(self, Gui):
Gui.setObjectName("Gui")
Gui.resize(280, 180)
self.root = QtWidgets.QWidget(Gui)
self.root.setObjectName("root")
self.dt_Inicial = QtWidgets.QDateEdit(self.root)
self.dt_Inic... | true | true |
08f9919767810d3283cdeeb9771083497928bbb8 | 1,110 | py | Python | helix/transforms/strip/strip.py | HELIX-Datasets/helix | 7b89b4139e580518b58e109a96ef70f2a71bb780 | [
"MIT"
] | 7 | 2021-12-15T03:22:29.000Z | 2022-03-09T16:11:08.000Z | helix/transforms/strip/strip.py | HELIX-Datasets/helix | 7b89b4139e580518b58e109a96ef70f2a71bb780 | [
"MIT"
] | 10 | 2021-09-14T16:39:31.000Z | 2021-09-14T21:41:49.000Z | helix/transforms/strip/strip.py | HELIX-Datasets/helix | 7b89b4139e580518b58e109a96ef70f2a71bb780 | [
"MIT"
] | 1 | 2022-01-31T00:01:58.000Z | 2022-01-31T00:01:58.000Z | import os
import magic
from ... import transform
from ... import utils
class StripError(Exception):
"""Raised when strip fails."""
class StripTransform(transform.Transform):
"""The linux strip binutil."""
name = "strip"
verbose_name = "Strip"
type = transform.Transform.TYPE_ARTIFACT
versio... | 22.653061 | 63 | 0.617117 | import os
import magic
from ... import transform
from ... import utils
class StripError(Exception):
class StripTransform(transform.Transform):
name = "strip"
verbose_name = "Strip"
type = transform.Transform.TYPE_ARTIFACT
version = "1.0.0"
description = "The linux strip binutil"
dependenc... | true | true |
08f991f45ea98f906f71b5ea9d73f36f2a0db760 | 32,172 | py | Python | xnmt/preproc.py | msperber/misc | ac33cd9d1672b59b25b11c1c9d3a46e97c057525 | [
"Apache-2.0"
] | null | null | null | xnmt/preproc.py | msperber/misc | ac33cd9d1672b59b25b11c1c9d3a46e97c057525 | [
"Apache-2.0"
] | null | null | null | xnmt/preproc.py | msperber/misc | ac33cd9d1672b59b25b11c1c9d3a46e97c057525 | [
"Apache-2.0"
] | null | null | null | import time
import sys
import os.path
import subprocess
from collections import defaultdict
import unicodedata
import re
import math
from typing import Dict, List, Optional, Sequence, Union
import numbers
import numpy as np
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore", lineno=36)
... | 39.426471 | 321 | 0.66474 | import time
import sys
import os.path
import subprocess
from collections import defaultdict
import unicodedata
import re
import math
from typing import Dict, List, Optional, Sequence, Union
import numbers
import numpy as np
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore", lineno=36)
... | true | true |
08f992626f6e23ddaa9284dafd3c3fe3f2a3c49c | 46 | py | Python | Exercicios/ex016/teste1.py | Carlos-Allison/Curso_de_HTML5_e_CCS3 | 20f2a639d792cd9e49ff9b54eeb69de44ba418e9 | [
"MIT"
] | null | null | null | Exercicios/ex016/teste1.py | Carlos-Allison/Curso_de_HTML5_e_CCS3 | 20f2a639d792cd9e49ff9b54eeb69de44ba418e9 | [
"MIT"
] | null | null | null | Exercicios/ex016/teste1.py | Carlos-Allison/Curso_de_HTML5_e_CCS3 | 20f2a639d792cd9e49ff9b54eeb69de44ba418e9 | [
"MIT"
] | null | null | null | def carro():
print('oi, mundo do caralho') | 23 | 33 | 0.630435 | def carro():
print('oi, mundo do caralho') | true | true |
08f9933cba63bea6505714c442def7d5e1fa07b3 | 1,779 | py | Python | tests/support/event_type_use_case_data.py | staciekith/mental-unload | 93d2ff29e159020c270b8c97b0d6dc97a1ad16e7 | [
"MIT"
] | null | null | null | tests/support/event_type_use_case_data.py | staciekith/mental-unload | 93d2ff29e159020c270b8c97b0d6dc97a1ad16e7 | [
"MIT"
] | null | null | null | tests/support/event_type_use_case_data.py | staciekith/mental-unload | 93d2ff29e159020c270b8c97b0d6dc97a1ad16e7 | [
"MIT"
] | null | null | null | from app.domains.event_type import EventType
def list_result():
event_type = {
'id': 1,
'name': "event type 1",
'description': "event type 1",
'unit_label': "g",
'unit_quantity': 170,
'unit_duration': 12,
'reminder_delay': 24,
'user': 'user1'
}
... | 23.72 | 72 | 0.527825 | from app.domains.event_type import EventType
def list_result():
event_type = {
'id': 1,
'name': "event type 1",
'description': "event type 1",
'unit_label': "g",
'unit_quantity': 170,
'unit_duration': 12,
'reminder_delay': 24,
'user': 'user1'
}
... | true | true |
08f993b13f7bf148f0093c8d50783f03b1713841 | 3,802 | py | Python | dresses/migrations/0001_initial.py | IvanDeveloperPro/happy_dress | 9dd8ad3a5b5290afb708955d474a266abceff00b | [
"MIT"
] | null | null | null | dresses/migrations/0001_initial.py | IvanDeveloperPro/happy_dress | 9dd8ad3a5b5290afb708955d474a266abceff00b | [
"MIT"
] | null | null | null | dresses/migrations/0001_initial.py | IvanDeveloperPro/happy_dress | 9dd8ad3a5b5290afb708955d474a266abceff00b | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-11-29 17:01
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import dresses.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER... | 53.549296 | 192 | 0.61415 |
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import dresses.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('sessions', '0001_initial'),
... | true | true |
08f994d5edd7faf88fd81cf8a0beac22320b8eac | 14,387 | py | Python | gaea-platform/src/resources/organization_api.py | h3copen/baas | 7fae7bf10be5a4109d809bad68358fb67335a9fe | [
"Apache-2.0"
] | null | null | null | gaea-platform/src/resources/organization_api.py | h3copen/baas | 7fae7bf10be5a4109d809bad68358fb67335a9fe | [
"Apache-2.0"
] | null | null | null | gaea-platform/src/resources/organization_api.py | h3copen/baas | 7fae7bf10be5a4109d809bad68358fb67335a9fe | [
"Apache-2.0"
] | null | null | null | # Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
import logging
import os
import sys
import datetime
from uuid import uuid4
from flask import jsonify, Blueprint, render_template
from flask import request as r
from modules.organization import organizationHandler as org_handler
from ... | 37.175711 | 110 | 0.526239 | import logging
import os
import sys
import datetime
from uuid import uuid4
from flask import jsonify, Blueprint, render_template
from flask import request as r
from modules.organization import organizationHandler as org_handler
from common.api_exception import UnsupportedMediaType, InternalServerError
from common.api... | true | true |
08f99501d3014df73a63d7d87d245c7fc9c15363 | 86 | py | Python | cardea/featurization/__init__.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | cardea/featurization/__init__.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | cardea/featurization/__init__.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from cardea.featurization.featurization import Featurization
| 21.5 | 60 | 0.755814 |
from cardea.featurization.featurization import Featurization
| true | true |
08f9952408c8e0bb38b17c10e2089e900ed418c2 | 10,341 | py | Python | mmcv/image/colorspace.py | imabackstabber/mmcv | b272c09b463f00fd7fdd455f7bd4a055f9995521 | [
"Apache-2.0"
] | null | null | null | mmcv/image/colorspace.py | imabackstabber/mmcv | b272c09b463f00fd7fdd455f7bd4a055f9995521 | [
"Apache-2.0"
] | null | null | null | mmcv/image/colorspace.py | imabackstabber/mmcv | b272c09b463f00fd7fdd455f7bd4a055f9995521 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from typing import Callable, Union
import cv2
import numpy as np
def imconvert(img: np.ndarray, src: str, dst: str) -> np.ndarray:
"""Convert an image from the src colorspace to dst colorspace.
Args:
img (ndarray): The input image.
src (str): T... | 33.358065 | 79 | 0.625568 | from typing import Callable, Union
import cv2
import numpy as np
def imconvert(img: np.ndarray, src: str, dst: str) -> np.ndarray:
code = getattr(cv2, f'COLOR_{src.upper()}2{dst.upper()}')
out_img = cv2.cvtColor(img, code)
return out_img
def bgr2gray(img: np.ndarray, keepdim: bool = False) -> np.ndarra... | true | true |
08f9957b9f83e5ed6249de01a9d9e2caa7b1d292 | 2,220 | py | Python | mosfit/modules/seds/multiblackbody.py | SSantosLab/notMOSFiT | 58cc4a271ef1f1bbf8ae3eb2fc847d2d82c103f0 | [
"MIT"
] | null | null | null | mosfit/modules/seds/multiblackbody.py | SSantosLab/notMOSFiT | 58cc4a271ef1f1bbf8ae3eb2fc847d2d82c103f0 | [
"MIT"
] | null | null | null | mosfit/modules/seds/multiblackbody.py | SSantosLab/notMOSFiT | 58cc4a271ef1f1bbf8ae3eb2fc847d2d82c103f0 | [
"MIT"
] | null | null | null | """Definitions for the `MultiBlackbody` class."""
from math import pi
import numexpr as ne
import numpy as np
from astropy import constants as c
from mosfit.constants import DAY_CGS, FOUR_PI, KM_CGS, M_SUN_CGS # noqa: F401
from mosfit.modules.seds.sed import SED
# Important: Only define one ``Module`` class per fil... | 37.627119 | 78 | 0.602252 | from math import pi
import numexpr as ne
import numpy as np
from astropy import constants as c
from mosfit.constants import DAY_CGS, FOUR_PI, KM_CGS, M_SUN_CGS from mosfit.modules.seds.sed import SED
class MultiBlackbody(SED):
FLUX_CONST = FOUR_PI * (2.0 * c.h / (c.c ** 2) * pi).cgs.value
X_CONST = (c.h ... | true | true |
08f995ab7178bb2efd5731e0131ffb826a6b8cfb | 849 | py | Python | monasca/dispatcher/__init__.py | TeamZenith/python-monasca | badc86fbe2c4424deb15b84eabd3248e899ef4ee | [
"Apache-2.0"
] | null | null | null | monasca/dispatcher/__init__.py | TeamZenith/python-monasca | badc86fbe2c4424deb15b84eabd3248e899ef4ee | [
"Apache-2.0"
] | null | null | null | monasca/dispatcher/__init__.py | TeamZenith/python-monasca | badc86fbe2c4424deb15b84eabd3248e899ef4ee | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 IBM Corp
#
# Author: Tong Li <litong01@us.ibm.com>
#
# 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 ... | 28.3 | 75 | 0.726737 |
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class Base(object):
def __init__(self, conf):
self.conf = conf
@abc.abstractmethod
def define_routes(self, app):
| true | true |
08f995c9f86ff92a3c6023e589aca9308ab21935 | 3,975 | py | Python | rdr_service/tools/tool_libs/bq_participant_fix.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 39 | 2017-10-13T19:16:27.000Z | 2021-09-24T16:58:21.000Z | rdr_service/tools/tool_libs/bq_participant_fix.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | rdr_service/tools/tool_libs/bq_participant_fix.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 19 | 2017-09-15T13:58:00.000Z | 2022-02-07T18:33:20.000Z | #! /bin/env python
#
# Template for RDR tool python program.
#
import argparse
# pylint: disable=superfluous-parens
# pylint: disable=broad-except
import datetime
import json
import logging
import sys
from rdr_service.services.system_utils import setup_logging, setup_i18n, print_progress_bar
from rdr_service.tools.t... | 33.974359 | 119 | 0.638491 |
import argparse
import datetime
import json
import logging
import sys
from rdr_service.services.system_utils import setup_logging, setup_i18n, print_progress_bar
from rdr_service.tools.tool_libs import GCPProcessContext, GCPEnvConfigObject
_logger = logging.getLogger("rdr_logger")
tool_cmd = "bq-participant-fix"
t... | true | true |
08f9964ef61189575072c516d4d56d671432f6b6 | 2,117 | py | Python | Python Exercicios/teste3.py | candido00/Python | 4b6721d55828191ca2ede0c5a0c36f6f5afdad55 | [
"MIT"
] | null | null | null | Python Exercicios/teste3.py | candido00/Python | 4b6721d55828191ca2ede0c5a0c36f6f5afdad55 | [
"MIT"
] | null | null | null | Python Exercicios/teste3.py | candido00/Python | 4b6721d55828191ca2ede0c5a0c36f6f5afdad55 | [
"MIT"
] | null | null | null | import tkinter #importando o tkinter
janela = tkinter.Tk() #instanciando o objeto da classe TK
janela.geometry("400x300")#definindo o tamanho da janela
janela.title("Cálculo do IMC") #alterando o texto da barra de titulos da janela
titulo = tkinter.Label(janela,text = "Cálculo IMC")#inserindo o título da página
titul... | 43.204082 | 94 | 0.663203 | import tkinter
janela = tkinter.Tk() janela.geometry("400x300")janela.title("Cálculo do IMC")
titulo = tkinter.Label(janela,text = "Cálculo IMC")titulo.pack()
framePeso = tkinter.Frame(janela)framePeso.pack()labelPeso = tkinter.Label(framePeso,text="Peso: ")labelPeso.pack(side="left")#Inserindo o label na tela, e, de... | true | true |
08f99690438241afce3b5fe2e15aa44a7c049c47 | 3,307 | py | Python | rally_ovs/plugins/ovs/deployment/sandbox.py | linup2011/ovn-scale-test | a2a42359e4e3ccdcfbc85d649bcf9dcfb60a10f3 | [
"Apache-2.0"
] | null | null | null | rally_ovs/plugins/ovs/deployment/sandbox.py | linup2011/ovn-scale-test | a2a42359e4e3ccdcfbc85d649bcf9dcfb60a10f3 | [
"Apache-2.0"
] | 3 | 2020-05-15T17:08:26.000Z | 2020-07-15T09:03:32.000Z | rally_ovs/plugins/ovs/deployment/sandbox.py | linup2011/ovn-scale-test | a2a42359e4e3ccdcfbc85d649bcf9dcfb60a10f3 | [
"Apache-2.0"
] | 1 | 2020-07-02T01:45:59.000Z | 2020-07-02T01:45:59.000Z | # Copyright 2016 Ebay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 31.798077 | 88 | 0.66072 |
import sys
from six.moves.urllib import parse
from rally.deployment import engine
from rally_ovs.plugins.ovs.deployment.engines import get_script
from rally_ovs.plugins.ovs.deployment.engines import get_script_path
from rally_ovs.plugins.ovs.deployment.engines import get_updated_server
from rally_ovs.plugins.ovs.d... | true | true |
08f997528b71959a27469226103df96e16b03055 | 12,661 | py | Python | test/unit/tools/test_parameter_parsing.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | test/unit/tools/test_parameter_parsing.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | test/unit/tools/test_parameter_parsing.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | from unittest import TestCase
from galaxy.tools.parameters import basic
from galaxy.util import bunch
from xml.etree.ElementTree import XML
import tools_support
class BaseParameterTestCase( TestCase, tools_support.UsesApp ):
def setUp(self):
self.setup_app( mock_model=False )
self.mock_tool = b... | 35.169444 | 130 | 0.566306 | from unittest import TestCase
from galaxy.tools.parameters import basic
from galaxy.util import bunch
from xml.etree.ElementTree import XML
import tools_support
class BaseParameterTestCase( TestCase, tools_support.UsesApp ):
def setUp(self):
self.setup_app( mock_model=False )
self.mock_tool = b... | true | true |
08f99759d63225668f7c4bcc5c70245fcdb4cbae | 1,214 | py | Python | hypha/apply/projects/migrations/0049_add_fields_for_finance_integrations.py | OpenTechFund/opentech.fund | 701b17f36ea27f891cd7e8a6743007302a52f34d | [
"BSD-3-Clause"
] | 14 | 2018-10-05T14:34:21.000Z | 2020-01-17T17:45:44.000Z | hypha/apply/projects/migrations/0049_add_fields_for_finance_integrations.py | OpenTechFund/WebApp | d6e2bb21a39d1fa7566cb60fe19f372dabfa5f0f | [
"BSD-3-Clause"
] | 1,098 | 2017-12-15T11:23:03.000Z | 2020-01-24T07:58:07.000Z | hypha/apply/projects/migrations/0049_add_fields_for_finance_integrations.py | OpenTechFund/WebApp | d6e2bb21a39d1fa7566cb60fe19f372dabfa5f0f | [
"BSD-3-Clause"
] | 7 | 2018-01-09T10:13:06.000Z | 2019-08-12T16:38:59.000Z | # Generated by Django 3.2.12 on 2022-03-17 03:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application_projects', '0048_alter_project_value'),
]
operations = [
migrations.AddField(
model_name='deliverable',
... | 35.705882 | 129 | 0.637562 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application_projects', '0048_alter_project_value'),
]
operations = [
migrations.AddField(
model_name='deliverable',
name='external_id',
field=models.Cha... | true | true |
08f997f4077403397620d509c1a0304e99da2f7c | 5,006 | py | Python | test/network_attacks/test_mitm_attack.py | Daveonwave/DHALSIM | c8739e45b87b1b1a9879e2694c94e3d6a0218b59 | [
"MIT"
] | 17 | 2021-02-03T15:48:03.000Z | 2022-03-25T11:40:12.000Z | test/network_attacks/test_mitm_attack.py | Daveonwave/DHALSIM | c8739e45b87b1b1a9879e2694c94e3d6a0218b59 | [
"MIT"
] | 3 | 2022-01-13T15:34:04.000Z | 2022-02-01T15:18:42.000Z | test/network_attacks/test_mitm_attack.py | Daveonwave/DHALSIM | c8739e45b87b1b1a9879e2694c94e3d6a0218b59 | [
"MIT"
] | 19 | 2021-01-13T07:15:45.000Z | 2022-03-08T10:29:50.000Z | import subprocess
import threading
from pathlib import Path
import pytest
import yaml
from dhalsim.network_attacks.mitm_attack import SyncedAttack, MitmAttack
@pytest.fixture
def intermediate_yaml_path():
return Path("test/auxilary_testing_files/intermediate_yaml_network_attacks.yaml")
@pytest.fixture
def yam... | 30.711656 | 100 | 0.722932 | import subprocess
import threading
from pathlib import Path
import pytest
import yaml
from dhalsim.network_attacks.mitm_attack import SyncedAttack, MitmAttack
@pytest.fixture
def intermediate_yaml_path():
return Path("test/auxilary_testing_files/intermediate_yaml_network_attacks.yaml")
@pytest.fixture
def yam... | true | true |
08f998b8aeba2f3c098332a8d169031c04f2a970 | 6,543 | py | Python | mmdetection/mmdet/models/detectors/double_head_rcnn.py | nuannuanhcc/DMRNet | 717003ea64585c3ecbde7b1448e7570bc448bbef | [
"MIT"
] | 87 | 2020-07-24T01:28:39.000Z | 2021-08-29T08:40:18.000Z | mmdet/models/detectors/double_head_rcnn.py | giorking/mmdetection | e6e2315219aac9146f55b37481d0c287f624dd7a | [
"Apache-2.0"
] | 6 | 2020-03-17T03:53:53.000Z | 2022-03-30T07:57:40.000Z | mmdet/models/detectors/double_head_rcnn.py | giorking/mmdetection | e6e2315219aac9146f55b37481d0c287f624dd7a | [
"Apache-2.0"
] | 20 | 2020-09-05T04:37:19.000Z | 2021-12-13T02:25:48.000Z | import torch
from mmdet.core import bbox2roi, build_assigner, build_sampler
from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module
class DoubleHeadRCNN(TwoStageDetector):
def __init__(self, reg_roi_scale_factor, **kwargs):
super().__init__(**kwargs)
s... | 42.212903 | 77 | 0.519334 | import torch
from mmdet.core import bbox2roi, build_assigner, build_sampler
from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module
class DoubleHeadRCNN(TwoStageDetector):
def __init__(self, reg_roi_scale_factor, **kwargs):
super().__init__(**kwargs)
s... | true | true |
08f999b9af8d52810297e69496da7cca44675b15 | 3,170 | py | Python | examples/python/robust_models_0.py | madhushree14/statsmodels | 04f00006a7aeb1c93d6894caa420698400da6c33 | [
"BSD-3-Clause"
] | 2 | 2020-04-13T15:45:38.000Z | 2020-06-01T14:41:04.000Z | examples/python/robust_models_0.py | madhushree14/statsmodels | 04f00006a7aeb1c93d6894caa420698400da6c33 | [
"BSD-3-Clause"
] | 1 | 2015-06-16T04:16:40.000Z | 2015-06-16T04:16:40.000Z | examples/python/robust_models_0.py | madhushree14/statsmodels | 04f00006a7aeb1c93d6894caa420698400da6c33 | [
"BSD-3-Clause"
] | 4 | 2020-04-07T00:06:17.000Z | 2021-06-17T15:11:36.000Z | # coding: utf-8
# DO NOT EDIT
# Autogenerated from the notebook robust_models_0.ipynb.
# Edit the notebook and then sync the output with this file.
#
# flake8: noqa
# DO NOT EDIT
# # Robust Linear Models
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
from statsmodels.sandbox.regressi... | 25.983607 | 74 | 0.69653 |
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
from statsmodels.sandbox.regression.predstd import wls_prediction_std
data = sm.datasets.stackloss.load()
data.exog = sm.add_constant(data.exog)
huber_t = sm.RLM(data.endog, data.exog, M=sm.robust.norms.HuberT())
hub_results = huber_... | true | true |
08f999e36b7192b2361ded0f80150f19cb02f3e3 | 553 | py | Python | Examples/Session09/capitalize/scripts/cap_script.py | Sharmila8/intropython2016 | a69aa6f6d0cd28c6a29d0b8adb9ef1ff9e2e8479 | [
"Unlicense"
] | null | null | null | Examples/Session09/capitalize/scripts/cap_script.py | Sharmila8/intropython2016 | a69aa6f6d0cd28c6a29d0b8adb9ef1ff9e2e8479 | [
"Unlicense"
] | null | null | null | Examples/Session09/capitalize/scripts/cap_script.py | Sharmila8/intropython2016 | a69aa6f6d0cd28c6a29d0b8adb9ef1ff9e2e8479 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""
A really simple script just to demonstrate disutils
"""
import sys, os
from capitalize import capital_mod
if __name__ == "__main__":
try:
infilename = sys.argv[1]
except IndexError:
print "you need to pass in a file to process"
root, ext = os.path.splitext(infi... | 22.12 | 75 | 0.65642 |
"""
A really simple script just to demonstrate disutils
"""
import sys, os
from capitalize import capital_mod
if __name__ == "__main__":
try:
infilename = sys.argv[1]
except IndexError:
print "you need to pass in a file to process"
root, ext = os.path.splitext(infilename)
outfilenam... | false | true |
08f99a4d97817da142a4e8486d6639f1fbd64933 | 668 | py | Python | src/data/839.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/839.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/839.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | from collections import deque
def resolve():
N, Q = map(int, input().split())
G = [[] for i in range(N)]
color = [0 for i in range(N)]
for i in range(N - 1):
a, b = map(int, input().split())
G[a - 1].append(b - 1)
G[b - 1].append(a - 1)
que = deque([0])
color[0] = 1
... | 21.548387 | 40 | 0.434132 | from collections import deque
def resolve():
N, Q = map(int, input().split())
G = [[] for i in range(N)]
color = [0 for i in range(N)]
for i in range(N - 1):
a, b = map(int, input().split())
G[a - 1].append(b - 1)
G[b - 1].append(a - 1)
que = deque([0])
color[0] = 1
... | true | true |
08f99a6ee60112dbfbe3c53b6161d47366ced353 | 424 | py | Python | wesp32_light_dweet/get-ip-uid.py | ocdtrekkie/wesp32-demos | d1340c555488011db12cebfa7e110fe6f233bd75 | [
"MIT"
] | 18 | 2018-10-16T19:14:16.000Z | 2021-11-29T21:58:55.000Z | wesp32_light_dweet/get-ip-uid.py | ocdtrekkie/wesp32-demos | d1340c555488011db12cebfa7e110fe6f233bd75 | [
"MIT"
] | 4 | 2019-02-11T20:59:30.000Z | 2021-05-23T03:13:08.000Z | wesp32_light_dweet/get-ip-uid.py | ocdtrekkie/wesp32-demos | d1340c555488011db12cebfa7e110fe6f233bd75 | [
"MIT"
] | 5 | 2019-02-11T17:27:58.000Z | 2021-09-25T10:08:02.000Z | # Print the current LAN IP address and unique ID
import machine
# Get the ESP32 unique ID as a string
uid = ''.join(['{:02x}'.format(x) for x in machine.unique_id()])
# Print the IP address
print("IP address: {}".format(lan.ifconfig()[0]))
# Print the unique ID
print("Unique ID: {}".format(uid))
# Print dweet.io upda... | 32.615385 | 96 | 0.695755 | import machine
uid = ''.join(['{:02x}'.format(x) for x in machine.unique_id()])
print("IP address: {}".format(lan.ifconfig()[0]))
print("Unique ID: {}".format(uid))
print("Dweet.io URL: https://dweet.io/dweet/for/wesp32-light-demo-{}?light=<value>".format(uid))
| true | true |
08f99b35eb630832a98f35a13f65eff6d3fc1a7d | 1,856 | py | Python | dnnet/training/loss_function.py | daichi-yoshikawa/dnnet | 95a33d73b201faed7ab98aa629e2aeb94c19ac18 | [
"BSD-3-Clause"
] | 6 | 2019-04-25T10:33:13.000Z | 2020-07-24T10:20:20.000Z | dnnet/training/loss_function.py | daichi-yoshikawa/dnnet | 95a33d73b201faed7ab98aa629e2aeb94c19ac18 | [
"BSD-3-Clause"
] | null | null | null | dnnet/training/loss_function.py | daichi-yoshikawa/dnnet | 95a33d73b201faed7ab98aa629e2aeb94c19ac18 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Daichi Yoshikawa <daichi.yoshikawa@gmail.com>
# License: BSD 3 clause
from dnnet.ext_mathlibs import cp, np
class LossFunction:
"""Base class for loss functions.
Warning
-------
This class should not be used directly.
Use derived classes instead.
Parameters
----------
ep ... | 26.140845 | 76 | 0.596983 |
from dnnet.ext_mathlibs import cp, np
class LossFunction:
ep = 1e-5
def get_type(self):
raise NotImplementedError('LossFunction.get_type is called.')
def get(self, y, t):
raise NotImplementedError('LossFunction.get is called.')
class MultinomialCrossEntropy(LossFunction):
def get_... | true | true |
08f99bf099b509bb037360e36725eb363dadd17f | 20,670 | py | Python | tests/test_pipeline_grid_search.py | sakamotosan/pipeline_grid_search | bcae3e8320f4fbe6cd016c4899a2418cac077abc | [
"BSD-3-Clause"
] | 6 | 2015-07-26T15:52:15.000Z | 2021-08-28T10:09:27.000Z | tests/test_pipeline_grid_search.py | tkerola/pipeline_grid_search | bcae3e8320f4fbe6cd016c4899a2418cac077abc | [
"BSD-3-Clause"
] | 1 | 2015-06-20T11:25:16.000Z | 2015-06-20T11:25:16.000Z | tests/test_pipeline_grid_search.py | tkerola/pipeline_grid_search | bcae3e8320f4fbe6cd016c4899a2418cac077abc | [
"BSD-3-Clause"
] | null | null | null | """
Testing for pipeline_grid_search module.
"""
from __future__ import print_function
from __future__ import division
import time
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin, ClassifierMixin
from sklearn.cross_validation import StratifiedKFold
from sklearn.datasets import make_class... | 37.109515 | 176 | 0.614756 |
from __future__ import print_function
from __future__ import division
import time
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin, ClassifierMixin
from sklearn.cross_validation import StratifiedKFold
from sklearn.datasets import make_classification
from sklearn.decomposition import PCA
f... | true | true |
08f99c045da91c12043e84a837103d46866610b6 | 2,219 | py | Python | src/htrun/host_tests_plugins/module_copy_stprogrammer.py | ARMmbed/greentea | c7884c64a7ab39ce7b5987149e63b8fdad252630 | [
"Apache-2.0"
] | 37 | 2015-09-10T13:52:40.000Z | 2021-11-17T11:53:30.000Z | src/htrun/host_tests_plugins/module_copy_stprogrammer.py | ARMmbed/greentea | c7884c64a7ab39ce7b5987149e63b8fdad252630 | [
"Apache-2.0"
] | 270 | 2015-09-09T13:00:53.000Z | 2021-12-16T17:39:05.000Z | src/htrun/host_tests_plugins/module_copy_stprogrammer.py | ARMmbed/greentea | c7884c64a7ab39ce7b5987149e63b8fdad252630 | [
"Apache-2.0"
] | 51 | 2015-09-04T13:16:47.000Z | 2021-11-18T15:40:03.000Z | #
# Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Implements a plugin to flash ST devices using STM32CubeProgrammer.
https://www.st.com/en/development-tools/stm32cubeprog.html
"""
import os
from .host_test_plugins import HostTestPluginBase
class Ho... | 28.818182 | 78 | 0.584948 |
import os
from .host_test_plugins import HostTestPluginBase
class HostTestPluginCopyMethod_STProgrammer(HostTestPluginBase):
name = "HostTestPluginCopyMethod_STProgrammer"
type = "CopyMethod"
capabilities = ["stprog"]
required_parameters = ["image_path"]
def __init__(self):
HostTes... | true | true |
08f99eaa5db9e34d003ee96896d340ac0be87c19 | 5,106 | py | Python | fewshot/models/nets/online_proto_sigmoid_net.py | sebamenabar/oc-fewshot-public | 2dad8c9f24cb1bfe72d8b13b33d28f6788d86ca8 | [
"MIT"
] | null | null | null | fewshot/models/nets/online_proto_sigmoid_net.py | sebamenabar/oc-fewshot-public | 2dad8c9f24cb1bfe72d8b13b33d28f6788d86ca8 | [
"MIT"
] | null | null | null | fewshot/models/nets/online_proto_sigmoid_net.py | sebamenabar/oc-fewshot-public | 2dad8c9f24cb1bfe72d8b13b33d28f6788d86ca8 | [
"MIT"
] | null | null | null | """Online prototypical network. This one uses sigmoid probability to indicate
unknowns.
Author: Mengye Ren (mren@cs.toronto.edu)
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import tensorflow as tf
from fewshot.models.nets.episode_recurrent_sigmoid_... | 31.134146 | 107 | 0.610262 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import tensorflow as tf
from fewshot.models.nets.episode_recurrent_sigmoid_net import EpisodeRecurrentSigmoidNet from fewshot.models.registry import RegisterModel
from fewshot.utils.logger import get as get_l... | true | true |
08f99ebfe267dd872cc99ce9df1a499ccfddf974 | 98 | py | Python | pantry/admin.py | rocktavious/larder | b48f965335b012a375a420334ff54df143833a4d | [
"MIT"
] | null | null | null | pantry/admin.py | rocktavious/larder | b48f965335b012a375a420334ff54df143833a4d | [
"MIT"
] | null | null | null | pantry/admin.py | rocktavious/larder | b48f965335b012a375a420334ff54df143833a4d | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Ingredient
admin.site.register(Ingredient)
| 16.333333 | 32 | 0.826531 | from django.contrib import admin
from .models import Ingredient
admin.site.register(Ingredient)
| true | true |
08f99f78bc9db07a255c899e2e6fadfc9840cfb0 | 540 | py | Python | argentum-api/manage.py | devium/argentum | 2bbb0f663fe9be78d106b1afa409b094da449519 | [
"MIT"
] | 1 | 2019-10-07T09:47:08.000Z | 2019-10-07T09:47:08.000Z | argentum-api/manage.py | devium/argentum | 2bbb0f663fe9be78d106b1afa409b094da449519 | [
"MIT"
] | null | null | null | argentum-api/manage.py | devium/argentum | 2bbb0f663fe9be78d106b1afa409b094da449519 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'argentum.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are... | 33.75 | 73 | 0.687037 | import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'argentum.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's install... | true | true |
08f9a01c19c6367d38d7b6636d53d3e2085c38e7 | 2,954 | py | Python | gibson2/render/mesh_renderer/mesh_renderer_settings.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 3 | 2021-02-07T14:00:38.000Z | 2021-07-03T19:40:59.000Z | gibson2/render/mesh_renderer/mesh_renderer_settings.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | null | null | null | gibson2/render/mesh_renderer/mesh_renderer_settings.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 2 | 2021-04-01T12:14:59.000Z | 2021-06-18T13:04:39.000Z | import os
import gibson2
import platform
class MeshRendererSettings(object):
def __init__(
self,
use_fisheye=False,
msaa=False,
enable_shadow=False,
enable_pbr=True,
env_texture_filename=os.path.join(gibson2.ig_dataset_path, 'scenes', 'background',
... | 38.363636 | 97 | 0.639472 | import os
import gibson2
import platform
class MeshRendererSettings(object):
def __init__(
self,
use_fisheye=False,
msaa=False,
enable_shadow=False,
enable_pbr=True,
env_texture_filename=os.path.join(gibson2.ig_dataset_path, 'scenes', 'background',
... | true | true |
08f9a14c767ee26491a85aa641e88e792ec71ad2 | 9,656 | py | Python | scripts/rabbitmq-api.py | JaccyLi/zabbix | d306ba996e425ff280dee3232dba0c17c8e542bd | [
"MIT"
] | 8 | 2016-08-03T08:30:43.000Z | 2019-12-28T10:14:37.000Z | scripts/rabbitmq-api.py | xiaomatech/zabbix | d306ba996e425ff280dee3232dba0c17c8e542bd | [
"MIT"
] | null | null | null | scripts/rabbitmq-api.py | xiaomatech/zabbix | d306ba996e425ff280dee3232dba0c17c8e542bd | [
"MIT"
] | 6 | 2017-11-18T07:17:29.000Z | 2019-12-28T10:14:39.000Z | #!/usr/bin/env /usr/bin/python
'''Python module to query the RabbitMQ Management Plugin REST API and get
results that can then be used by Zabbix.
https://github.com/jasonmcintosh/rabbitmq-zabbix
'''
import json
import optparse
import socket
import urllib2
import subprocess
import tempfile
import os
import logging
logg... | 39.412245 | 84 | 0.579536 | '''Python module to query the RabbitMQ Management Plugin REST API and get
results that can then be used by Zabbix.
https://github.com/jasonmcintosh/rabbitmq-zabbix
'''
import json
import optparse
import socket
import urllib2
import subprocess
import tempfile
import os
import logging
logging.basicConfig(
filename='... | false | true |
08f9a1bcf35022b1785bc5ca1b504a9bddcf676f | 2,916 | py | Python | samples/cli/accelbyte_py_sdk_cli/platform/_query_rewards_1.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | samples/cli/accelbyte_py_sdk_cli/platform/_query_rewards_1.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | samples/cli/accelbyte_py_sdk_cli/platform/_query_rewards_1.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template_file: python-cli-command.j2
# justice-platform-service (4.10.0)
# pylint: disable=duplicate-co... | 33.136364 | 88 | 0.709877 |
import json
import yaml
from typing import Optional
import click
from .._utils import login_as as login_as_internal
from .._utils import to_dict
from accelbyte_py_sdk.api.platform import query_rewards_1 as query_rewards_1_internal
from accelbyte_py_sdk.api.platform.models import RewardPagingSlicedResult
from acce... | true | true |
08f9a2a745178dd735ce710861146d6f282503c1 | 1,685 | py | Python | tutorials/4.MdiApplication/Core/BaseWindow.py | sunj1/my_pyforms | d92c37cbddb3ff34fe1ace3874e0116c09e7c0cf | [
"MIT"
] | null | null | null | tutorials/4.MdiApplication/Core/BaseWindow.py | sunj1/my_pyforms | d92c37cbddb3ff34fe1ace3874e0116c09e7c0cf | [
"MIT"
] | null | null | null | tutorials/4.MdiApplication/Core/BaseWindow.py | sunj1/my_pyforms | d92c37cbddb3ff34fe1ace3874e0116c09e7c0cf | [
"MIT"
] | null | null | null | import pyforms
from pyforms import BaseWidget
from pyforms.Controls import ControlText
from pyforms.Controls import ControlButton
from pyforms.Controls import ControlDockWidget
from pyforms.Controls import ControlMdiArea
from Core.SimpleExample1 import SimpleExample1
from Core.Controllers.ProjectTree import ProjectT... | 28.559322 | 114 | 0.579822 | import pyforms
from pyforms import BaseWidget
from pyforms.Controls import ControlText
from pyforms.Controls import ControlButton
from pyforms.Controls import ControlDockWidget
from pyforms.Controls import ControlMdiArea
from Core.SimpleExample1 import SimpleExample1
from Core.Controllers.ProjectTree import ProjectT... | true | true |
08f9a300db2918c8ee506d6a8eeabe9d38f4844b | 72 | py | Python | pts/modules/distribution/__init__.py | devmofl/M5_Accuracy_3rd | b02bd4333520d71ff01b66c0446bb07324cfb0d1 | [
"Apache-2.0",
"MIT"
] | 9 | 2021-06-17T11:00:41.000Z | 2021-12-14T06:09:40.000Z | pts/modules/distribution/__init__.py | devmofl/M5_Accuracy_3rd | b02bd4333520d71ff01b66c0446bb07324cfb0d1 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-12-01T17:42:23.000Z | 2021-12-13T12:57:51.000Z | pts/modules/distribution/__init__.py | devmofl/M5_Accuracy_3rd | b02bd4333520d71ff01b66c0446bb07324cfb0d1 | [
"Apache-2.0",
"MIT"
] | 5 | 2021-06-17T11:00:43.000Z | 2022-03-18T13:50:52.000Z | from .constant import ConstantDistribution
from .tweedie import Tweedie
| 24 | 42 | 0.861111 | from .constant import ConstantDistribution
from .tweedie import Tweedie
| true | true |
08f9a3f40f39549cbda9bf74df2ddea4b70529c0 | 284 | py | Python | checkers_game/player.py | aleattene/checkers | 5de76646e0183f71e2eea1f44f1575339934da87 | [
"MIT"
] | null | null | null | checkers_game/player.py | aleattene/checkers | 5de76646e0183f71e2eea1f44f1575339934da87 | [
"MIT"
] | 7 | 2021-08-12T12:50:12.000Z | 2021-08-18T14:07:39.000Z | checkers_game/player.py | aleattene/checkers | 5de76646e0183f71e2eea1f44f1575339934da87 | [
"MIT"
] | null | null | null |
class Player:
def __init__(self, username, pieces_color):
self.username = username
self.pieces_color = pieces_color
self.pieces_quantity = 12
def __str__(self):
return f"{self.username}: \"{self.pieces_color}\" - {self.pieces_quantity}"
| 18.933333 | 83 | 0.644366 |
class Player:
def __init__(self, username, pieces_color):
self.username = username
self.pieces_color = pieces_color
self.pieces_quantity = 12
def __str__(self):
return f"{self.username}: \"{self.pieces_color}\" - {self.pieces_quantity}"
| true | true |
08f9a43b36f59e3af567f250ef1d520b324bfe36 | 6,662 | py | Python | vit/formatter/__init__.py | kinifwyne/vit | e2cbafce922b1e09c4a66e7dc9592c51fe628e9d | [
"MIT"
] | 179 | 2020-07-28T08:21:51.000Z | 2022-03-30T21:39:37.000Z | vit/formatter/__init__.py | kinifwyne/vit | e2cbafce922b1e09c4a66e7dc9592c51fe628e9d | [
"MIT"
] | 83 | 2020-07-27T21:39:05.000Z | 2022-03-22T16:43:43.000Z | vit/formatter/__init__.py | kinifwyne/vit | e2cbafce922b1e09c4a66e7dc9592c51fe628e9d | [
"MIT"
] | 16 | 2020-08-05T13:13:04.000Z | 2022-03-05T17:35:32.000Z | import math
from datetime import datetime
from pytz import timezone
TIME_UNIT_MAP = {
'seconds': {
'label': 's',
'divisor': 1,
'threshold': 60,
},
'minutes': {
'label': 'm',
'divisor': 60,
'threshold': 3600,
},
'hours': {
'label': 'h',
... | 30.700461 | 124 | 0.582408 | import math
from datetime import datetime
from pytz import timezone
TIME_UNIT_MAP = {
'seconds': {
'label': 's',
'divisor': 1,
'threshold': 60,
},
'minutes': {
'label': 'm',
'divisor': 60,
'threshold': 3600,
},
'hours': {
'label': 'h',
... | true | true |
08f9a528b8c93c89c18c7b60424fba81db9a2a8f | 11,726 | py | Python | convlab2/dst/evaluate_sumbt.py | nikitacs16/ConvLab-2 | 5bd4c6154957ac9c5a28db151b4724431355b258 | [
"Apache-2.0"
] | null | null | null | convlab2/dst/evaluate_sumbt.py | nikitacs16/ConvLab-2 | 5bd4c6154957ac9c5a28db151b4724431355b258 | [
"Apache-2.0"
] | null | null | null | convlab2/dst/evaluate_sumbt.py | nikitacs16/ConvLab-2 | 5bd4c6154957ac9c5a28db151b4724431355b258 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Evaluating sumbt p
"""
import random
import numpy
import torch
import sys
from tqdm import tqdm
import copy
import jieba
import json
from convlab2.dst.sumbt.multiwoz.sumbt import SUMBTTracker
multiwoz_en_slot_list = [
'attraction-area', 'attraction-name', 'attraction-type', 'hotel-day',... | 42.028674 | 402 | 0.562255 | """
Evaluating sumbt p
"""
import random
import numpy
import torch
import sys
from tqdm import tqdm
import copy
import jieba
import json
from convlab2.dst.sumbt.multiwoz.sumbt import SUMBTTracker
multiwoz_en_slot_list = [
'attraction-area', 'attraction-name', 'attraction-type', 'hotel-day', 'hotel-people',
'ho... | false | true |
08f9a54a11438babb7dbdc89de8f047d7d642f60 | 5,376 | py | Python | edf_processor/edf_processor/edf.py | Pennsieve/timeseries-processor | 85766afa76182503fd66cec8382c22e757743f01 | [
"Apache-2.0"
] | null | null | null | edf_processor/edf_processor/edf.py | Pennsieve/timeseries-processor | 85766afa76182503fd66cec8382c22e757743f01 | [
"Apache-2.0"
] | null | null | null | edf_processor/edf_processor/edf.py | Pennsieve/timeseries-processor | 85766afa76182503fd66cec8382c22e757743f01 | [
"Apache-2.0"
] | null | null | null | import sys
import struct
import re
import numpy as np
from datetime import datetime
second_to_usecond = 1000000
def twosComp(val, bits):
"""compute the 2's complement of int value val"""
if (val & (1 << (bits - 1))) != 0: # if sign bit is set e.g., 8bit: 128-255
val = val - (1 << bits) # comput... | 41.353846 | 209 | 0.587798 | import sys
import struct
import re
import numpy as np
from datetime import datetime
second_to_usecond = 1000000
def twosComp(val, bits):
if (val & (1 << (bits - 1))) != 0: val = val - (1 << bits) return val
def transformValue(val, phys_min, phys_max, dig_min, dig_max, b... | true | true |
08f9a556473d4145cf1655c4865e9ac66cadf0a1 | 20,298 | py | Python | detectron2/evaluation/coco_evaluation.py | bruce1408/detectron2_modify | 815df8c3cd68b1450e039fbafc27c6ab302d620b | [
"Apache-2.0"
] | 344 | 2020-04-18T18:33:33.000Z | 2020-12-04T08:34:30.000Z | detectron2/evaluation/coco_evaluation.py | ZhanqiZhang66/detectron2 | be0d7283297f6314c8e683e0d1ff80b668aa9f4a | [
"Apache-2.0"
] | 40 | 2020-05-20T23:45:21.000Z | 2020-11-30T04:46:45.000Z | detectron2/evaluation/coco_evaluation.py | ZhanqiZhang66/detectron2 | be0d7283297f6314c8e683e0d1ff80b668aa9f4a | [
"Apache-2.0"
] | 66 | 2020-04-20T08:30:49.000Z | 2020-12-06T12:55:12.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import contextlib
import copy
import io
import itertools
import json
import logging
import numpy as np
import os
import pickle
from collections import OrderedDict
import pycocotools.mask as mask_util
import torch
from fvcore.common.file_io import Pa... | 39.567251 | 168 | 0.609863 | import contextlib
import copy
import io
import itertools
import json
import logging
import numpy as np
import os
import pickle
from collections import OrderedDict
import pycocotools.mask as mask_util
import torch
from fvcore.common.file_io import PathManager
from pycocotools.coco import COCO
from pycocotools.cocoeval i... | true | true |
08f9a5dc9977d9b83bf779284d8ec4bfe3e904b4 | 197,766 | py | Python | yt_dlp/utils.py | selfisekai/yt-dlp | ec11a9f4a26e8225b195e5f91bd0b72b008d0c3a | [
"Unlicense"
] | null | null | null | yt_dlp/utils.py | selfisekai/yt-dlp | ec11a9f4a26e8225b195e5f91bd0b72b008d0c3a | [
"Unlicense"
] | null | null | null | yt_dlp/utils.py | selfisekai/yt-dlp | ec11a9f4a26e8225b195e5f91bd0b72b008d0c3a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals
import base64
import binascii
import calendar
import codecs
import collections
import contextlib
import ctypes
import datetime
import email.utils
import email.header
import errno
import functools
import gzip
import hashlib
import hmac
impo... | 30.346172 | 282 | 0.521819 |
from __future__ import unicode_literals
import base64
import binascii
import calendar
import codecs
import collections
import contextlib
import ctypes
import datetime
import email.utils
import email.header
import errno
import functools
import gzip
import hashlib
import hmac
import importlib.util
import io
import iter... | true | true |
08f9a7e109808b004548f59c05d1b738031d1948 | 1,975 | py | Python | tests/backends/test_ddp.py | DKandrew/pytorch-lightning | 1f8ff7c48c1b173928f5dcd652a81d1c4a7ab273 | [
"Apache-2.0"
] | null | null | null | tests/backends/test_ddp.py | DKandrew/pytorch-lightning | 1f8ff7c48c1b173928f5dcd652a81d1c4a7ab273 | [
"Apache-2.0"
] | null | null | null | tests/backends/test_ddp.py | DKandrew/pytorch-lightning | 1f8ff7c48c1b173928f5dcd652a81d1c4a7ab273 | [
"Apache-2.0"
] | null | null | null | import pytest
import torch
import os
from tests.backends import ddp_model
from tests.utilities.dist import call_training_script
@pytest.mark.parametrize('cli_args', [
pytest.param('--max_epochs 1 --gpus 2 --distributed_backend ddp'),
])
@pytest.mark.skipif(torch.cuda.device_count() < 2, reason="test requires mult... | 34.051724 | 92 | 0.721013 | import pytest
import torch
import os
from tests.backends import ddp_model
from tests.utilities.dist import call_training_script
@pytest.mark.parametrize('cli_args', [
pytest.param('--max_epochs 1 --gpus 2 --distributed_backend ddp'),
])
@pytest.mark.skipif(torch.cuda.device_count() < 2, reason="test requires mult... | true | true |
08f9a904f1ec038a1d72d5e29dd1fff30329078a | 524 | py | Python | PM/BPM.py | DocTorH123/PM_Checker | 84e8ba09104d005b67549012b4f4e95de20f94f2 | [
"MIT"
] | null | null | null | PM/BPM.py | DocTorH123/PM_Checker | 84e8ba09104d005b67549012b4f4e95de20f94f2 | [
"MIT"
] | null | null | null | PM/BPM.py | DocTorH123/PM_Checker | 84e8ba09104d005b67549012b4f4e95de20f94f2 | [
"MIT"
] | null | null | null | import librosa;import sys;import matplotlib.pyplot as plt
try:
filename = input("Input your File Name")
y, sr = librosa.load("Test_Music/"+filename)
tempo, beat_frames = librosa.beat.beat_track(y=y,sr=sr)
print('{:.2f}BPM'.format(tempo))
beat_times = librosa.frames_to_time(beat_frames, sr=sr);
... | 32.75 | 60 | 0.698473 | import librosa;import sys;import matplotlib.pyplot as plt
try:
filename = input("Input your File Name")
y, sr = librosa.load("Test_Music/"+filename)
tempo, beat_frames = librosa.beat.beat_track(y=y,sr=sr)
print('{:.2f}BPM'.format(tempo))
beat_times = librosa.frames_to_time(beat_frames, sr=sr);
... | true | true |
08f9a9254703547c18b41e51aee99d08b57a7bb4 | 11,730 | py | Python | src/toil/lib/ec2nodes.py | ngs-mstb/toil | e14b41e7552e2aa7c161e01f93b8260299590e2d | [
"Apache-2.0"
] | null | null | null | src/toil/lib/ec2nodes.py | ngs-mstb/toil | e14b41e7552e2aa7c161e01f93b8260299590e2d | [
"Apache-2.0"
] | null | null | null | src/toil/lib/ec2nodes.py | ngs-mstb/toil | e14b41e7552e2aa7c161e01f93b8260299590e2d | [
"Apache-2.0"
] | 1 | 2021-11-13T10:31:33.000Z | 2021-11-13T10:31:33.000Z | # Copyright (C) 2015-2018 Regents of the University of California
#
# 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 app... | 40.309278 | 144 | 0.614066 | from __future__ import absolute_import
import requests
import os
import json
import datetime
import logging
from toil.wdl.wdl_functions import heredoc_wdl
logger = logging.getLogger( __name__ )
EC2Regions = {'us-west-1': 'US West (N. California)',
'us-west-2': 'US West (Oregon)',
'us-east... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.