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
f7698bdae76faf28a49142601752f7ff6cf4545b
1,230
py
Python
tests/test_utils.py
krunt/lean_transformer
90abdb87bb08566eaba0a45bc29ec6a3220333ac
[ "MIT" ]
11
2022-03-15T07:32:59.000Z
2022-03-31T13:10:09.000Z
tests/test_utils.py
krunt/lean_transformer
90abdb87bb08566eaba0a45bc29ec6a3220333ac
[ "MIT" ]
10
2022-03-15T06:27:53.000Z
2022-03-25T18:53:19.000Z
tests/test_utils.py
krunt/lean_transformer
90abdb87bb08566eaba0a45bc29ec6a3220333ac
[ "MIT" ]
1
2022-03-18T20:27:42.000Z
2022-03-18T20:27:42.000Z
import pytest import torch import torch.nn.functional as F from lean_transformer.utils import pad_to_multiple, GELU import numpy as np @pytest.mark.forked def test_pad_to_multiple(): x = torch.randn(3, 3) assert pad_to_multiple(x, multiple=3, dims=0) is x assert pad_to_multiple(x, multiple=3, dims=1) is ...
42.413793
105
0.693496
import pytest import torch import torch.nn.functional as F from lean_transformer.utils import pad_to_multiple, GELU import numpy as np @pytest.mark.forked def test_pad_to_multiple(): x = torch.randn(3, 3) assert pad_to_multiple(x, multiple=3, dims=0) is x assert pad_to_multiple(x, multiple=3, dims=1) is ...
true
true
f7698c27dfa521fba71ff1dc9043ce37e0a476f2
675
py
Python
components/google-cloud/google_cloud_pipeline_components/experimental/custom_job/__init__.py
tomar27/pipelines
fc6a2761b3770cb3b854115b841c1a50876665c3
[ "Apache-2.0" ]
1
2021-11-22T12:22:14.000Z
2021-11-22T12:22:14.000Z
components/google-cloud/google_cloud_pipeline_components/experimental/custom_job/__init__.py
tomar27/pipelines
fc6a2761b3770cb3b854115b841c1a50876665c3
[ "Apache-2.0" ]
13
2021-07-06T06:47:43.000Z
2022-03-08T23:35:13.000Z
components/google-cloud/google_cloud_pipeline_components/experimental/custom_job/__init__.py
tomar27/pipelines
fc6a2761b3770cb3b854115b841c1a50876665c3
[ "Apache-2.0" ]
1
2020-10-29T04:24:27.000Z
2020-10-29T04:24:27.000Z
# Copyright 2021 The Kubeflow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
45
74
0.764444
true
true
f7698d5b9fc03824409bc00b255d8a1eadcba365
62,024
py
Python
cla-backend/cla/routes.py
CareyLF/easycla
f251867abb012f98acb7451bdf21b1bc64ffe77e
[ "Apache-2.0", "CC-BY-4.0", "MIT" ]
1
2019-09-26T10:34:01.000Z
2019-09-26T10:34:01.000Z
cla-backend/cla/routes.py
CareyLF/easycla
f251867abb012f98acb7451bdf21b1bc64ffe77e
[ "Apache-2.0", "CC-BY-4.0", "MIT" ]
null
null
null
cla-backend/cla/routes.py
CareyLF/easycla
f251867abb012f98acb7451bdf21b1bc64ffe77e
[ "Apache-2.0", "CC-BY-4.0", "MIT" ]
null
null
null
# Copyright The Linux Foundation and each contributor to CommunityBridge. # SPDX-License-Identifier: MIT """ The entry point for the CLA service. Lays out all routes and controller functions. """ import hug from falcon import HTTP_401 from hug.middleware import LogMiddleware import cla import cla.auth import cla.con...
38.357452
133
0.643412
import hug from falcon import HTTP_401 from hug.middleware import LogMiddleware import cla import cla.auth import cla.controllers.company import cla.controllers.gerrit import cla.controllers.github import cla.controllers.project import cla.controllers.project_logo import cla.controllers.repository import cla.control...
true
true
f7698ee515c7b2f45a78ad5ce3016306729f3283
1,117
py
Python
build/lib/charts/DashChart.py
hakngrow/capstone
947901f3de3a2ebaf0de420268c30b600b6ec8a2
[ "MIT" ]
null
null
null
build/lib/charts/DashChart.py
hakngrow/capstone
947901f3de3a2ebaf0de420268c30b600b6ec8a2
[ "MIT" ]
null
null
null
build/lib/charts/DashChart.py
hakngrow/capstone
947901f3de3a2ebaf0de420268c30b600b6ec8a2
[ "MIT" ]
1
2020-08-27T09:16:43.000Z
2020-08-27T09:16:43.000Z
import dash from dash.dependencies import Output, Input import dash_core_components as dcc import dash_html_components as html import plotly import random import plotly.graph_objs as go from collections import deque X = deque(maxlen=20) X.append(1) Y = deque(maxlen=20) Y.append(1) app = dash.Dash(__name__) app.layou...
23.765957
84
0.582811
import dash from dash.dependencies import Output, Input import dash_core_components as dcc import dash_html_components as html import plotly import random import plotly.graph_objs as go from collections import deque X = deque(maxlen=20) X.append(1) Y = deque(maxlen=20) Y.append(1) app = dash.Dash(__name__) app.layou...
true
true
f7698f4e2937616fd62c655c6a88eb5f5fe48604
4,441
py
Python
src/oca_github_bot/config.py
sbidoul/oca-github-bot
ea9e526cd4a8964d3f2564e28cb5d560daf57f27
[ "MIT" ]
null
null
null
src/oca_github_bot/config.py
sbidoul/oca-github-bot
ea9e526cd4a8964d3f2564e28cb5d560daf57f27
[ "MIT" ]
null
null
null
src/oca_github_bot/config.py
sbidoul/oca-github-bot
ea9e526cd4a8964d3f2564e28cb5d560daf57f27
[ "MIT" ]
null
null
null
# Copyright (c) ACSONE SA/NV 2018 # Distributed under the MIT License (http://opensource.org/licenses/MIT). import ast import logging import os from functools import wraps from .pypi import MultiDistPublisher, RsyncDistPublisher, TwineDistPublisher _logger = logging.getLogger("oca_gihub_bot.tasks") def switchable(...
31.721429
87
0.702544
import ast import logging import os from functools import wraps from .pypi import MultiDistPublisher, RsyncDistPublisher, TwineDistPublisher _logger = logging.getLogger("oca_gihub_bot.tasks") def switchable(switch_name=None): def wrap(func): @wraps(func) def func_wrapper(*args, **kwargs): ...
true
true
f7698f7258388b568619be642ec7db1b436a9c63
2,450
py
Python
aiida/engine/processes/workchains/awaitable.py
pranavmodx/aiida-core
0edbbf82dfb97ab130914d1674a6f2217eba5971
[ "BSD-2-Clause", "MIT" ]
null
null
null
aiida/engine/processes/workchains/awaitable.py
pranavmodx/aiida-core
0edbbf82dfb97ab130914d1674a6f2217eba5971
[ "BSD-2-Clause", "MIT" ]
null
null
null
aiida/engine/processes/workchains/awaitable.py
pranavmodx/aiida-core
0edbbf82dfb97ab130914d1674a6f2217eba5971
[ "BSD-2-Clause", "MIT" ]
null
null
null
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
35.507246
106
0.611429
from enum import Enum from plumpy.utils import AttributesDict from aiida.orm import ProcessNode __all__ = ('Awaitable', 'AwaitableTarget', 'AwaitableAction', 'construct_awaitable') class Awaitable(AttributesDict): class AwaitableTarget(Enum): PROCESS = 'process' class AwaitableAction(Enum): ASSIGN = 'a...
true
true
f769921a505e0ab5cca66ddb333741e709100561
6,643
py
Python
see/context/test/context_test.py
marcobrandobh/Sandbox
587745121c6eed5b5c1adbda20911145ca960f0f
[ "Apache-2.0" ]
null
null
null
see/context/test/context_test.py
marcobrandobh/Sandbox
587745121c6eed5b5c1adbda20911145ca960f0f
[ "Apache-2.0" ]
null
null
null
see/context/test/context_test.py
marcobrandobh/Sandbox
587745121c6eed5b5c1adbda20911145ca960f0f
[ "Apache-2.0" ]
null
null
null
import sys import mock import unittest from see import Hook from see import context from see.hooks import HookParameters STATES = (context.NOSTATE, context.RUNNING, context.BLOCKED, context.PAUSED, context.SHUTDOWN, context.SHUTOFF, context.CRASHED, context.SUSPENDED) class TestHook(Hook): ...
40.260606
78
0.615987
import sys import mock import unittest from see import Hook from see import context from see.hooks import HookParameters STATES = (context.NOSTATE, context.RUNNING, context.BLOCKED, context.PAUSED, context.SHUTDOWN, context.SHUTOFF, context.CRASHED, context.SUSPENDED) class TestHook(Hook): ...
true
true
f76992e36edfcc4e695d525a55904b8554521bbb
4,294
py
Python
pydantic/dataclasses.py
henriklindgren/pydantic
830278b17b49acf279ccb071448a997070feb68c
[ "MIT" ]
null
null
null
pydantic/dataclasses.py
henriklindgren/pydantic
830278b17b49acf279ccb071448a997070feb68c
[ "MIT" ]
null
null
null
pydantic/dataclasses.py
henriklindgren/pydantic
830278b17b49acf279ccb071448a997070feb68c
[ "MIT" ]
null
null
null
import dataclasses from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, Optional, Type, Union from .class_validators import gather_validators from .error_wrappers import ValidationError from .errors import DataclassTypeError from .fields import Required from .main import create_model, validate_model from ...
33.286822
117
0.67769
import dataclasses from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, Optional, Type, Union from .class_validators import gather_validators from .error_wrappers import ValidationError from .errors import DataclassTypeError from .fields import Required from .main import create_model, validate_model from ...
true
true
f769934ca0b11a89064dba1a374281d46dfd5dd0
6,881
py
Python
scheduler/models.py
httpnotonly/django-rq-scheduler
54914f778392d409df557d9559ca303d08535929
[ "MIT" ]
null
null
null
scheduler/models.py
httpnotonly/django-rq-scheduler
54914f778392d409df557d9559ca303d08535929
[ "MIT" ]
null
null
null
scheduler/models.py
httpnotonly/django-rq-scheduler
54914f778392d409df557d9559ca303d08535929
[ "MIT" ]
null
null
null
from __future__ import unicode_literals import importlib from datetime import timedelta import croniter from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.templatetags.tz import utc from django.utils.translation import ugettext_lazy as _ impor...
29.659483
78
0.59628
from __future__ import unicode_literals import importlib from datetime import timedelta import croniter from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.templatetags.tz import utc from django.utils.translation import ugettext_lazy as _ impor...
true
true
f76993b726d8019723c093dee9da25bdcfd78883
1,113
py
Python
grpc/server.py
coreseekdev/mitmproxy
fe37a88a22601f83c45387479b25bbb2517551ec
[ "MIT" ]
null
null
null
grpc/server.py
coreseekdev/mitmproxy
fe37a88a22601f83c45387479b25bbb2517551ec
[ "MIT" ]
null
null
null
grpc/server.py
coreseekdev/mitmproxy
fe37a88a22601f83c45387479b25bbb2517551ec
[ "MIT" ]
null
null
null
#! /usr/bin/env python # -*- coding: utf-8 -*- import grpc import time from concurrent import futures import data_pb2 import data_pb2_grpc _ONE_DAY_IN_SECONDS = 60 * 60 * 24 _HOST = '0.0.0.0' _PORT = '8888' class FormatData(data_pb2_grpc.FormatDataServicer): def DoFormat(self, request, context): str = re...
25.883721
76
0.680144
import grpc import time from concurrent import futures import data_pb2 import data_pb2_grpc _ONE_DAY_IN_SECONDS = 60 * 60 * 24 _HOST = '0.0.0.0' _PORT = '8888' class FormatData(data_pb2_grpc.FormatDataServicer): def DoFormat(self, request, context): str = request.text return data_pb2.Data(text=st...
true
true
f769940489822209a12dddba0d2db1478d689d58
7,380
py
Python
zap/config/config.py
sreyasaju/zap
2cae79869e8713a5306a388a99db731449653ce9
[ "MIT" ]
1
2020-10-30T15:25:02.000Z
2020-10-30T15:25:02.000Z
zap/config/config.py
sreyasaju/zap
2cae79869e8713a5306a388a99db731449653ce9
[ "MIT" ]
null
null
null
zap/config/config.py
sreyasaju/zap
2cae79869e8713a5306a388a99db731449653ce9
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 """ MIT License Copyright (c) 2020 Srevin Saju Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, mo...
38.041237
79
0.610298
import json import os import appdirs import click from zap.constants import ZAP_PATH_RC_PATCH, MIRRORS def does_config_exist(): cfgpath = os.path.join(appdirs.user_config_dir('zap'), 'config.json') if os.path.exists(cfgpath): return True else: return False class ConfigManager: def ...
true
true
f7699481f3c3efda4df5a409244cf720e5849d39
386
py
Python
graphql_jwt/__init__.py
ibqn/django-graphql-jwt
dd92319071092bb517187904f3ac0610e8443edf
[ "MIT" ]
1
2020-07-08T04:59:20.000Z
2020-07-08T04:59:20.000Z
graphql_jwt/__init__.py
ibqn/django-graphql-jwt
dd92319071092bb517187904f3ac0610e8443edf
[ "MIT" ]
null
null
null
graphql_jwt/__init__.py
ibqn/django-graphql-jwt
dd92319071092bb517187904f3ac0610e8443edf
[ "MIT" ]
1
2021-03-10T17:53:41.000Z
2021-03-10T17:53:41.000Z
from . import relay from .mutations import ( DeleteJSONWebTokenCookie, DeleteRefreshTokenCookie, JSONWebTokenMutation, ObtainJSONWebToken, Refresh, Revoke, Verify, ) __all__ = [ 'relay', 'JSONWebTokenMutation', 'ObtainJSONWebToken', 'Verify', 'Refresh', 'Revoke', 'DeleteJSONWebToken...
20.315789
77
0.699482
from . import relay from .mutations import ( DeleteJSONWebTokenCookie, DeleteRefreshTokenCookie, JSONWebTokenMutation, ObtainJSONWebToken, Refresh, Revoke, Verify, ) __all__ = [ 'relay', 'JSONWebTokenMutation', 'ObtainJSONWebToken', 'Verify', 'Refresh', 'Revoke', 'DeleteJSONWebToken...
true
true
f7699549a9375a0062042c3264a92cc8d10a518b
348
py
Python
movieverse/viewer.py
KoenBaak/movieverse
2337a7338e350ebb59dec3119bd5ee4235268fc0
[ "MIT" ]
null
null
null
movieverse/viewer.py
KoenBaak/movieverse
2337a7338e350ebb59dec3119bd5ee4235268fc0
[ "MIT" ]
null
null
null
movieverse/viewer.py
KoenBaak/movieverse
2337a7338e350ebb59dec3119bd5ee4235268fc0
[ "MIT" ]
null
null
null
# ------ Python standard library imports --------------------------------------- # ------ External imports ------------------------------------------------------ # ------ Imports from own package or module ------------------------------------ #----------------------------------------------------------------------------...
43.5
80
0.25
class Viewer: pass
true
true
f769962e7919bd5bdd13ef01b46bd84585a5b850
8,508
py
Python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py
LianwMS/azure-sdk-for-python
612d7bca9de86ee1bd1fa59291d7bf897ba9213f
[ "MIT" ]
2
2019-05-17T21:24:53.000Z
2020-02-12T11:13:42.000Z
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py
LianwMS/azure-sdk-for-python
612d7bca9de86ee1bd1fa59291d7bf897ba9213f
[ "MIT" ]
15
2019-07-12T18:18:04.000Z
2019-07-25T20:55:51.000Z
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py
LianwMS/azure-sdk-for-python
612d7bca9de86ee1bd1fa59291d7bf897ba9213f
[ "MIT" ]
2
2020-05-21T22:51:22.000Z
2020-05-26T20:53:01.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
48.896552
218
0.677833
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse fro...
true
true
f7699674e07f5579fce6690cb891e4fcb3e77f77
1,487
py
Python
test.py
cvxgrp/sccf
3c5f65e1a6df1a1b9cf58b60dd2b41f5c46be42e
[ "Apache-2.0" ]
6
2019-10-29T08:48:31.000Z
2021-12-07T11:05:41.000Z
test.py
cvxgrp/sccf
3c5f65e1a6df1a1b9cf58b60dd2b41f5c46be42e
[ "Apache-2.0" ]
null
null
null
test.py
cvxgrp/sccf
3c5f65e1a6df1a1b9cf58b60dd2b41f5c46be42e
[ "Apache-2.0" ]
2
2020-03-18T16:16:31.000Z
2020-10-08T20:52:43.000Z
import unittest import sccf import cvxpy as cp import numpy as np class TestMinExpression(unittest.TestCase): def test(self): x = cp.Variable(10) x.value = np.zeros(10) expr = cp.sum_squares(x) with self.assertRaises(AssertionError): sccf.minimum(-expr, 1.0) mi...
30.346939
71
0.612643
import unittest import sccf import cvxpy as cp import numpy as np class TestMinExpression(unittest.TestCase): def test(self): x = cp.Variable(10) x.value = np.zeros(10) expr = cp.sum_squares(x) with self.assertRaises(AssertionError): sccf.minimum(-expr, 1.0) mi...
true
true
f769968e5239a8e41b4636dbb02501b725223de0
825
py
Python
utils/templatetags/common.py
ntucker/django-common-utils
f08dfab2848e356feba20bed644512868ffe49bd
[ "BSD-3-Clause" ]
null
null
null
utils/templatetags/common.py
ntucker/django-common-utils
f08dfab2848e356feba20bed644512868ffe49bd
[ "BSD-3-Clause" ]
null
null
null
utils/templatetags/common.py
ntucker/django-common-utils
f08dfab2848e356feba20bed644512868ffe49bd
[ "BSD-3-Clause" ]
null
null
null
from __future__ import unicode_literals import json as jsonencode from datetime import datetime import pytz from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe register = template.Library() @register.simple_tag(takes_context=True) def abs...
25.78125
65
0.780606
from __future__ import unicode_literals import json as jsonencode from datetime import datetime import pytz from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe register = template.Library() @register.simple_tag(takes_context=True) def abs...
true
true
f76996d53828ac8687b3e10542513d87f4402114
2,694
py
Python
packages/grid/apps/domain/src/main/core/model_centric/auth/federated.py
exityan/PySyft
35166c487a5be57f9ad28929ed88a8ba6bdd5aeb
[ "Apache-2.0" ]
425
2019-09-22T06:14:53.000Z
2022-03-30T02:17:34.000Z
packages/grid/apps/domain/src/main/core/model_centric/auth/federated.py
Metrix1010/PySyft
6477f64b63dc285059c3766deab3993653cead2e
[ "Apache-2.0" ]
352
2019-09-17T15:32:51.000Z
2022-03-12T01:07:35.000Z
packages/grid/apps/domain/src/main/core/model_centric/auth/federated.py
Metrix1010/PySyft
6477f64b63dc285059c3766deab3993653cead2e
[ "Apache-2.0" ]
208
2019-09-18T18:32:10.000Z
2022-03-24T01:10:11.000Z
# stdlib import base64 import json import logging import uuid # third party import jwt import requests # grid relative from ...codes import CYCLE from ...codes import MODEL_CENTRIC_FL_EVENTS from ...codes import MSG_FIELD from ...codes import RESPONSE_MSG from ..processes import process_manager def verify_token(aut...
32.457831
96
0.553823
import base64 import json import logging import uuid import jwt import requests from ...codes import CYCLE from ...codes import MODEL_CENTRIC_FL_EVENTS from ...codes import MSG_FIELD from ...codes import RESPONSE_MSG from ..processes import process_manager def verify_token(auth_token, model_name, model_version=None...
true
true
f76996df10f9eed5fe9483ab51bffc456a6601e3
1,562
py
Python
sixisles/types.py
teitei-tk/SixIsles
68ac3510bc35910c3822e36a309a4a7e179f60c7
[ "MIT" ]
null
null
null
sixisles/types.py
teitei-tk/SixIsles
68ac3510bc35910c3822e36a309a4a7e179f60c7
[ "MIT" ]
null
null
null
sixisles/types.py
teitei-tk/SixIsles
68ac3510bc35910c3822e36a309a4a7e179f60c7
[ "MIT" ]
null
null
null
#-*- coding: utf-8 -*- from bson import ObjectId as _ObjectId from datetime import datetime __all__ = ['ObjectId', 'String', 'Integer', 'Float', 'Long', 'List', 'Boolean', 'DateTime'] class TypeMixin(object): def is_valid(self, value): raise NotImplementedError def to_value(self): raise No...
19.525
91
0.642125
from bson import ObjectId as _ObjectId from datetime import datetime __all__ = ['ObjectId', 'String', 'Integer', 'Float', 'Long', 'List', 'Boolean', 'DateTime'] class TypeMixin(object): def is_valid(self, value): raise NotImplementedError def to_value(self): raise NotImplementedError cla...
true
true
f769980d009e961ad3909c9fa7c9baaa464faa4e
1,056
py
Python
domains/nav/problems/auto/problem52_SD.py
patras91/rae_release
0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30
[ "BSD-3-Clause" ]
1
2021-09-28T12:56:56.000Z
2021-09-28T12:56:56.000Z
domains/nav/problems/auto/problem52_SD.py
patras91/rae_release
0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30
[ "BSD-3-Clause" ]
null
null
null
domains/nav/problems/auto/problem52_SD.py
patras91/rae_release
0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30
[ "BSD-3-Clause" ]
1
2022-03-31T16:30:39.000Z
2022-03-31T16:30:39.000Z
__author__ = 'patras' from domain_springDoor import * from timer import DURATION from state import state DURATION.TIME = { 'unlatch1': 5, 'unlatch2': 5, 'holdDoor': 2, 'passDoor': 3, 'releaseDoor': 2, 'closeDoors': 3, 'move': 10, 'take': 2, 'put': 2, } DURATION.COUNTER = { 'un...
19.924528
71
0.498106
__author__ = 'patras' from domain_springDoor import * from timer import DURATION from state import state DURATION.TIME = { 'unlatch1': 5, 'unlatch2': 5, 'holdDoor': 2, 'passDoor': 3, 'releaseDoor': 2, 'closeDoors': 3, 'move': 10, 'take': 2, 'put': 2, } DURATION.COUNTER = { 'un...
true
true
f76998b85ec576a9d4353bc29afbbc1fc4de6391
2,719
py
Python
geonode/geonode/base/migrations/0029_auto_20171114_0341.py
ttungbmt/BecaGIS_GeoPortal
6c05f9fc020ec4ccf600ba2503a06c2231443920
[ "MIT" ]
null
null
null
geonode/geonode/base/migrations/0029_auto_20171114_0341.py
ttungbmt/BecaGIS_GeoPortal
6c05f9fc020ec4ccf600ba2503a06c2231443920
[ "MIT" ]
null
null
null
geonode/geonode/base/migrations/0029_auto_20171114_0341.py
ttungbmt/BecaGIS_GeoPortal
6c05f9fc020ec4ccf600ba2503a06c2231443920
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0028_resourcebase_is_approved'), ] operations = [ migrations.AlterField( model_name='resourcebase', name='language', fi...
135.95
2,395
0.549467
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0028_resourcebase_is_approved'), ] operations = [ migrations.AlterField( model_name='resourcebase', name='language', field=models.CharField(def...
true
true
f76999a0dbc323c69c418ef4c93e0aeeef00f764
18,587
py
Python
pandas/tests/arrays/test_datetimelike.py
YuliusDennyPrabowo/pandas
b74e2ce0f63f616474edc310897a67d501a9e32d
[ "BSD-3-Clause" ]
null
null
null
pandas/tests/arrays/test_datetimelike.py
YuliusDennyPrabowo/pandas
b74e2ce0f63f616474edc310897a67d501a9e32d
[ "BSD-3-Clause" ]
null
null
null
pandas/tests/arrays/test_datetimelike.py
YuliusDennyPrabowo/pandas
b74e2ce0f63f616474edc310897a67d501a9e32d
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- import numpy as np import pytest import pandas.compat as compat import pandas as pd from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray import pandas.util.testing as tm # TODO: more freq variants @pytest.fixture(params=['D', 'B', 'W', 'M', 'Q', 'Y']) def period_index(re...
34.293358
78
0.625599
import numpy as np import pytest import pandas.compat as compat import pandas as pd from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray import pandas.util.testing as tm @pytest.fixture(params=['D', 'B', 'W', 'M', 'Q', 'Y']) def period_index(request): freqstr = request.param pi = pd...
true
true
f76999b9e3cc3b1f8a75a0d15cbc712ee4a5422f
21,738
py
Python
models/resnet_BinAct.py
zhanzheng8585/biprop
ce6a364c8323f102bd41ebb332e1e841ec78c79d
[ "Apache-2.0" ]
28
2021-03-19T03:51:01.000Z
2022-03-19T20:51:00.000Z
models/resnet_BinAct.py
zhanzheng8585/biprop
ce6a364c8323f102bd41ebb332e1e841ec78c79d
[ "Apache-2.0" ]
3
2021-05-03T12:15:50.000Z
2021-09-09T01:32:28.000Z
models/resnet_BinAct.py
zhanzheng8585/biprop
ce6a364c8323f102bd41ebb332e1e841ec78c79d
[ "Apache-2.0" ]
9
2021-03-31T01:58:43.000Z
2022-03-29T16:26:40.000Z
import torch.nn as nn from utils.builder import get_builder from args import args from collections import OrderedDict # Binary activation function with gradient estimator import torch class F_BinAct(torch.autograd.Function): @staticmethod def forward(ctx, inp): # Save input for backward ctx.save_for_bac...
36.109635
116
0.611188
import torch.nn as nn from utils.builder import get_builder from args import args from collections import OrderedDict import torch class F_BinAct(torch.autograd.Function): @staticmethod def forward(ctx, inp): ctx.save_for_backward(inp) return torch.sign(inp) @staticmethod def backward(ctx, ...
true
true
f7699a04c22f15d6d3bcc1296e755158cf8f751f
431
py
Python
exam/migrations/0021_exam_available.py
albatros-21/django-exam
659792aa04b31d0ee4464db5744ddb974cfc475f
[ "MIT" ]
null
null
null
exam/migrations/0021_exam_available.py
albatros-21/django-exam
659792aa04b31d0ee4464db5744ddb974cfc475f
[ "MIT" ]
null
null
null
exam/migrations/0021_exam_available.py
albatros-21/django-exam
659792aa04b31d0ee4464db5744ddb974cfc475f
[ "MIT" ]
1
2021-05-23T09:27:25.000Z
2021-05-23T09:27:25.000Z
# Generated by Django 2.2.7 on 2021-02-23 18:48 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('exam', '0020_auto_20210223_1915'), ] operations = [ migrations.AddField( model_name='exam', ...
21.55
70
0.62413
from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('exam', '0020_auto_20210223_1915'), ] operations = [ migrations.AddField( model_name='exam', name='available', field=models....
true
true
f7699b0c5e2639b2d61cca61e8a068a20c87642c
11,617
py
Python
packages/aiohttp_socks/proto.py
John-Tonny/Electrum-vircle
c1eff12c706308d7dafa60bbe364b04efbcef5c5
[ "MIT" ]
2
2019-08-21T15:48:52.000Z
2019-08-27T21:46:56.000Z
packages/aiohttp_socks/proto.py
John-Tonny/Electrum-vircle
c1eff12c706308d7dafa60bbe364b04efbcef5c5
[ "MIT" ]
1
2021-06-02T00:43:25.000Z
2021-06-02T00:43:25.000Z
packages/aiohttp_socks/proto.py
John-Tonny/Electrum-vircle
c1eff12c706308d7dafa60bbe364b04efbcef5c5
[ "MIT" ]
1
2020-07-15T01:05:02.000Z
2020-07-15T01:05:02.000Z
# -*- coding: utf-8 -*- import asyncio import socket import struct from .errors import ( SocksConnectionError, InvalidServerReply, SocksError, InvalidServerVersion, NoAcceptableAuthMethods, LoginAuthenticationFailed, UnknownAuthMethod ) RSV = NULL = 0x00 SOCKS_VER4 = 0x04 SOCKS_VER5 = 0x05 ...
32.180055
78
0.571834
import asyncio import socket import struct from .errors import ( SocksConnectionError, InvalidServerReply, SocksError, InvalidServerVersion, NoAcceptableAuthMethods, LoginAuthenticationFailed, UnknownAuthMethod ) RSV = NULL = 0x00 SOCKS_VER4 = 0x04 SOCKS_VER5 = 0x05 SOCKS_CMD_CONNECT = 0x01...
true
true
f7699b1b810abdf4fa743579088c603c84b38651
5,662
py
Python
benchmarks/C/NAPL-dissolution/1D_NAPL-diss_trans/lin/1D_TPF_resS_trans.py
GeoStat-Framework/ogs5py_benchmarks
0b6db19b87cfad36459757f99ce2458f8e12b20b
[ "BSD-4-Clause" ]
3
2019-01-15T17:38:11.000Z
2020-01-07T23:44:12.000Z
benchmarks/C/NAPL-dissolution/1D_NAPL-diss_trans/lin/1D_TPF_resS_trans.py
GeoStat-Framework/ogs5py_benchmarks
0b6db19b87cfad36459757f99ce2458f8e12b20b
[ "BSD-4-Clause" ]
1
2020-05-12T09:18:09.000Z
2020-05-12T10:48:32.000Z
benchmarks/C/NAPL-dissolution/1D_NAPL-diss_trans/lin/1D_TPF_resS_trans.py
GeoStat-Framework/ogs5py_benchmarks
0b6db19b87cfad36459757f99ce2458f8e12b20b
[ "BSD-4-Clause" ]
1
2020-01-08T13:28:50.000Z
2020-01-08T13:28:50.000Z
# -*- coding: utf-8 -*- from ogs5py import OGS model = OGS( task_root='1D_TPF_resS_trans_root', task_id='1D_TPF_resS_trans', output_dir='out', ) model.msh.read_file('1D_TPF_resS_trans.msh') model.gli.read_file('1D_TPF_resS_trans.gli') model.pcs.add_block( main_key='PROCESS', PCS_TYPE='PS_GLOBAL', ...
23.890295
51
0.634052
from ogs5py import OGS model = OGS( task_root='1D_TPF_resS_trans_root', task_id='1D_TPF_resS_trans', output_dir='out', ) model.msh.read_file('1D_TPF_resS_trans.msh') model.gli.read_file('1D_TPF_resS_trans.gli') model.pcs.add_block( main_key='PROCESS', PCS_TYPE='PS_GLOBAL', NUM_TYPE='dPcdSwGradS...
true
true
f7699dc23c78f96d718ea0ac5d9216906e90850a
1,308
py
Python
CS-Notes/data-structure/array-and-matrix/Degree-of-an-Array-(Easy).py
huandrew99/LeetCode
aa36b48d06100ce5f0bc64c789a906ec29409440
[ "MIT" ]
36
2021-12-23T15:44:41.000Z
2022-03-31T04:26:26.000Z
CS-Notes/data-structure/array-and-matrix/Degree-of-an-Array-(Easy).py
wzy0766/LeetCode-1
3070e672c519e8af74966811b8058a9baef8c0bc
[ "MIT" ]
null
null
null
CS-Notes/data-structure/array-and-matrix/Degree-of-an-Array-(Easy).py
wzy0766/LeetCode-1
3070e672c519e8af74966811b8058a9baef8c0bc
[ "MIT" ]
11
2022-02-26T22:41:26.000Z
2022-03-02T07:18:41.000Z
""" LC 697 Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums. Example 1: Input: nums = [1,2,2,3,1] Out...
27.25
143
0.62844
from collections import defaultdict class Solution: def findShortestSubArray(self, nums) -> int: counter = defaultdict(int) for n in nums: counter[n] += 1 M = max(counter.values()) right = {n: i for i, n in enumerate(nums)} left = {n: i for i, n in zip(reversed(...
true
true
f7699e188453f32e282ace06267f63df3684b576
4,634
py
Python
notebooks/iris-dataset.py
ng-nicolas/ml-small-projects
92775fbee220f1e83d9891749c158a93aafc19ee
[ "MIT" ]
null
null
null
notebooks/iris-dataset.py
ng-nicolas/ml-small-projects
92775fbee220f1e83d9891749c158a93aafc19ee
[ "MIT" ]
null
null
null
notebooks/iris-dataset.py
ng-nicolas/ml-small-projects
92775fbee220f1e83d9891749c158a93aafc19ee
[ "MIT" ]
null
null
null
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2017 nicolas <nicolas@laptop> # # Distributed under terms of the MIT license. """ In this model it seek to predict the flower specie given measures of the petal and sepal. It uses the iris dataset, which one it is build a linear model to predict the species ...
32.405594
135
0.712128
""" In this model it seek to predict the flower specie given measures of the petal and sepal. It uses the iris dataset, which one it is build a linear model to predict the species of a plant given some measures of the leaf plant. """ from sklearn import datasets verbose = False print "[+] Working with the Iris Data...
false
true
f7699e502c86c3728c3c5ad0645a9ece501c6a9c
1,296
py
Python
Journal App/journalfunctions.py
rayjustinhuang/PythonApps
ba5572fbff38de71f806558c5d0be5827962aebb
[ "MIT" ]
null
null
null
Journal App/journalfunctions.py
rayjustinhuang/PythonApps
ba5572fbff38de71f806558c5d0be5827962aebb
[ "MIT" ]
null
null
null
Journal App/journalfunctions.py
rayjustinhuang/PythonApps
ba5572fbff38de71f806558c5d0be5827962aebb
[ "MIT" ]
null
null
null
import os def load(name): """ This method creates and loads a new journal. :param name: The base name of the journal to load. :return: A new journal data structure populated with the file data. """ data = [] filename = get_full_pathname(name) if os.path.exists(filename): with...
27.574468
112
0.638889
import os def load(name): data = [] filename = get_full_pathname(name) if os.path.exists(filename): with open(filename) as fin: for entry in fin.readlines(): data.append(entry.rstrip()) return data def save(name, journal_data): filename = get_full_pathname(n...
true
true
f7699ec81e11f407fff88588e9df083e0468a426
232
py
Python
erpnext_mfg/erpnext_mfg/doctype/replenishment_rule/test_replenishment_rule.py
bailabs/erpnext_mfg
de0146eebd5d1d0dbc4bfad78530d943f07e3253
[ "MIT" ]
1
2021-06-22T15:09:14.000Z
2021-06-22T15:09:14.000Z
erpnext_mfg/erpnext_mfg/doctype/replenishment_rule/test_replenishment_rule.py
bailabs/erpnext_mfg
de0146eebd5d1d0dbc4bfad78530d943f07e3253
[ "MIT" ]
null
null
null
erpnext_mfg/erpnext_mfg/doctype/replenishment_rule/test_replenishment_rule.py
bailabs/erpnext_mfg
de0146eebd5d1d0dbc4bfad78530d943f07e3253
[ "MIT" ]
4
2021-06-30T21:37:51.000Z
2022-02-16T21:47:32.000Z
# -*- coding: utf-8 -*- # Copyright (c) 2021, Bai Web and Mobile Lab and Contributors # See license.txt from __future__ import unicode_literals # import frappe import unittest class TestReplenishmentRule(unittest.TestCase): pass
21.090909
61
0.767241
from __future__ import unicode_literals import unittest class TestReplenishmentRule(unittest.TestCase): pass
true
true
f7699ef49faefc593bc7eff71d7acd60e29c9580
1,215
py
Python
src/forecastmgmt/model/fc_textmodel.py
vvladych/forecastmgmt
9eea272d00bb42031f49b5bb5af01388ecce31cf
[ "Unlicense" ]
null
null
null
src/forecastmgmt/model/fc_textmodel.py
vvladych/forecastmgmt
9eea272d00bb42031f49b5bb5af01388ecce31cf
[ "Unlicense" ]
37
2015-07-01T22:18:51.000Z
2016-03-11T21:17:12.000Z
src/forecastmgmt/model/fc_textmodel.py
vvladych/forecastmgmt
9eea272d00bb42031f49b5bb5af01388ecce31cf
[ "Unlicense" ]
null
null
null
''' Created on 17.03.2015 @author: vvladych ''' from forecastmgmt.dao.db_connection import get_db_connection import psycopg2.extras from MDO import MDO class FCTextModel(MDO): sql_dict={"get_all":"SELECT sid, textmodel_date, textmodel_uuid, forecast_sid FROM fc_textmodel", "delete":"DELET...
37.96875
135
0.697119
from forecastmgmt.dao.db_connection import get_db_connection import psycopg2.extras from MDO import MDO class FCTextModel(MDO): sql_dict={"get_all":"SELECT sid, textmodel_date, textmodel_uuid, forecast_sid FROM fc_textmodel", "delete":"DELETE FROM fc_textmodel WHERE sid=%s", ...
true
true
f7699ef766ed2f094fa32c00421991fe1d29d133
959
py
Python
ex044pagamento.py
wtomalves/exerciciopython
5c239521830cb8d092c7ff8646ff1f38c605509d
[ "MIT" ]
1
2020-09-04T22:36:21.000Z
2020-09-04T22:36:21.000Z
ex044pagamento.py
wtomalves/exerciciopython
5c239521830cb8d092c7ff8646ff1f38c605509d
[ "MIT" ]
null
null
null
ex044pagamento.py
wtomalves/exerciciopython
5c239521830cb8d092c7ff8646ff1f38c605509d
[ "MIT" ]
null
null
null
print('''Condições de pagamento: 1- À vista e/ou cheque com 10% de desconto; 2- À vista no cartão com 5% de desconto; 3- Em 2x sem juros no cartão; 4- A partir de 3x no cartão com 20% de juros;''') print('') opcao = int(input('Selecione a opão desejada e aperte enter: ')) preco = float(input('Digite o valor a...
43.590909
123
0.660063
print('''Condições de pagamento: 1- À vista e/ou cheque com 10% de desconto; 2- À vista no cartão com 5% de desconto; 3- Em 2x sem juros no cartão; 4- A partir de 3x no cartão com 20% de juros;''') print('') opcao = int(input('Selecione a opão desejada e aperte enter: ')) preco = float(input('Digite o valor a...
true
true
f7699efb24a11c37d4a88afeb1c9ef6ea0231808
3,181
py
Python
test/integration/ggrc/converters/test_import_assessment_with_map.py
pbedn/ggrc-core
12ae4720a430730835f1d02def62c0f6ef453521
[ "ECL-2.0", "Apache-2.0" ]
2
2020-08-26T06:56:01.000Z
2021-07-08T13:56:20.000Z
test/integration/ggrc/converters/test_import_assessment_with_map.py
pbedn/ggrc-core
12ae4720a430730835f1d02def62c0f6ef453521
[ "ECL-2.0", "Apache-2.0" ]
4
2021-02-02T23:04:30.000Z
2022-03-02T09:54:47.000Z
test/integration/ggrc/converters/test_import_assessment_with_map.py
pbedn/ggrc-core
12ae4720a430730835f1d02def62c0f6ef453521
[ "ECL-2.0", "Apache-2.0" ]
1
2016-08-23T10:51:19.000Z
2016-08-23T10:51:19.000Z
# Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Test to check assessment import with mapped regulation.""" from collections import OrderedDict from mock import patch from integration.ggrc import TestCase, read_imported_file from integration.ggrc.api_...
30.586538
78
0.652625
from collections import OrderedDict from mock import patch from integration.ggrc import TestCase, read_imported_file from integration.ggrc.api_helper import Api from integration.ggrc.query_helper import WithQueryApi from integration.ggrc.models import factories class TestImportAssessmentWithMap(TestCase, WithQuery...
true
true
f7699f5152f756220c63e425029bb6e760d80019
108,705
py
Python
django/db/models/fields/related.py
ulope/django
c5132382f081bd1b5a3618bbf23fa0cf720af14b
[ "BSD-3-Clause" ]
null
null
null
django/db/models/fields/related.py
ulope/django
c5132382f081bd1b5a3618bbf23fa0cf720af14b
[ "BSD-3-Clause" ]
null
null
null
django/db/models/fields/related.py
ulope/django
c5132382f081bd1b5a3618bbf23fa0cf720af14b
[ "BSD-3-Clause" ]
null
null
null
from __future__ import unicode_literals from operator import attrgetter from django.apps import apps from django.core import checks from django.db import connection, connections, router, transaction from django.db.backends import utils from django.db.models import signals, Q from django.db.models.deletion import SET_...
44.679408
119
0.589936
from __future__ import unicode_literals from operator import attrgetter from django.apps import apps from django.core import checks from django.db import connection, connections, router, transaction from django.db.backends import utils from django.db.models import signals, Q from django.db.models.deletion import SET_...
true
true
f7699f886f87af5575631180b5ef349bc9869724
15,986
py
Python
tensorflow_federated/python/core/backends/mapreduce/canonical_form_test.py
hartmanwilliam/federated
55e5fcbfde13ac4788f084e4c3c4714130cd19ec
[ "Apache-2.0" ]
1
2020-06-11T16:34:24.000Z
2020-06-11T16:34:24.000Z
tensorflow_federated/python/core/backends/mapreduce/canonical_form_test.py
hartmanwilliam/federated
55e5fcbfde13ac4788f084e4c3c4714130cd19ec
[ "Apache-2.0" ]
8
2019-08-06T06:12:07.000Z
2019-12-19T02:06:17.000Z
tensorflow_federated/python/core/backends/mapreduce/canonical_form_test.py
Junyangz/federated
ecf51cdf8b86cbd000f6edc5715dc904bce07540
[ "Apache-2.0" ]
1
2021-09-06T03:33:14.000Z
2021-09-06T03:33:14.000Z
# Lint as: python3 # Copyright 2019, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
37.971496
129
0.693357
from absl.testing import absltest import tensorflow as tf from tensorflow_federated.python.core.api import computation_types from tensorflow_federated.python.core.api import computations from tensorflow_federated.python.core.backends.mapreduce import canonical_form from tensorflow_federated.python.core.backends.mapre...
true
true
f769a017a4e35f452279f94770876b2266495819
16,514
py
Python
opensfm/pairs_selection.py
lioncorpo/sfm.lion-judge-corporation
95fb11bff263c3faab62269cc907eec18b527e22
[ "BSD-2-Clause" ]
1
2021-05-20T15:08:30.000Z
2021-05-20T15:08:30.000Z
opensfm/pairs_selection.py
lioncorpo/sfm.lion-judge-corporation
95fb11bff263c3faab62269cc907eec18b527e22
[ "BSD-2-Clause" ]
null
null
null
opensfm/pairs_selection.py
lioncorpo/sfm.lion-judge-corporation
95fb11bff263c3faab62269cc907eec18b527e22
[ "BSD-2-Clause" ]
null
null
null
import logging from collections import defaultdict import numpy as np import scipy.spatial as spatial from opensfm import bow, context, feature_loader, vlad from opensfm.dataset import DataSetBase logger = logging.getLogger(__name__) def has_gps_info(exif): return ( exif and "gps" in exif ...
30.809701
87
0.645573
import logging from collections import defaultdict import numpy as np import scipy.spatial as spatial from opensfm import bow, context, feature_loader, vlad from opensfm.dataset import DataSetBase logger = logging.getLogger(__name__) def has_gps_info(exif): return ( exif and "gps" in exif ...
true
true
f769a04fa608d6d96d5f0ffc0aa4cb29e75bfb5e
1,075
py
Python
polls/migrations/0001_initial.py
Marco-Meo/coursera
3bf3885526d5727aded5617714d5134b8d67b749
[ "MIT" ]
null
null
null
polls/migrations/0001_initial.py
Marco-Meo/coursera
3bf3885526d5727aded5617714d5134b8d67b749
[ "MIT" ]
null
null
null
polls/migrations/0001_initial.py
Marco-Meo/coursera
3bf3885526d5727aded5617714d5134b8d67b749
[ "MIT" ]
null
null
null
# Generated by Django 3.1.2 on 2020-11-04 15:50 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Question', fields=[ ...
32.575758
114
0.586047
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Question', fields=[ ('id', models.AutoField(auto_created=T...
true
true
f769a1e07c9e12a50bf24a292aeebe08e723055e
2,789
py
Python
main_pytorch.py
NickKaparinos/Kaggle-Dogs-vs.-Cats-Redux
8bc0296648f7e376c97dba3eeadf5872e7499656
[ "MIT" ]
1
2021-08-13T13:04:51.000Z
2021-08-13T13:04:51.000Z
main_pytorch.py
NickKaparinos/Kaggle-Dogs-vs.-Cats-Redux
8bc0296648f7e376c97dba3eeadf5872e7499656
[ "MIT" ]
null
null
null
main_pytorch.py
NickKaparinos/Kaggle-Dogs-vs.-Cats-Redux
8bc0296648f7e376c97dba3eeadf5872e7499656
[ "MIT" ]
null
null
null
""" Nick Kaparinos Dogs vs. Cats Kaggle Competition Grid Search using pytorch """ import pandas as pd from random import seed from utilities import * from torch.utils.data import DataLoader from torchvision.models import vgg16 from torch.utils.tensorboard import SummaryWriter import torch import time # Options pd.set...
25.824074
85
0.733955
import pandas as pd from random import seed from utilities import * from torch.utils.data import DataLoader from torchvision.models import vgg16 from torch.utils.tensorboard import SummaryWriter import torch import time pd.set_option('display.max_columns', None) pd.set_option('display.max_rows', None) do_preprocess =...
true
true
f769a20820d4e0117d05df245bb0bd9ad8c0e84f
5,299
py
Python
scansmb.py
hensur/scansmb
aa6f674af02c82e61b1b1f98dff1f3212e5a83dd
[ "MIT" ]
null
null
null
scansmb.py
hensur/scansmb
aa6f674af02c82e61b1b1f98dff1f3212e5a83dd
[ "MIT" ]
null
null
null
scansmb.py
hensur/scansmb
aa6f674af02c82e61b1b1f98dff1f3212e5a83dd
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 """ Script to automatically send e-mails if a new file was found on the scanner's sdcard """ import os import magic import re from collections import namedtuple from datetime import datetime import logging from apscheduler.schedulers.background import BlockingScheduler import smtplib from email....
33.967949
136
0.673712
import os import magic import re from collections import namedtuple from datetime import datetime import logging from apscheduler.schedulers.background import BlockingScheduler import smtplib from email.mime.nonmultipart import MIMENonMultipart from email.mime.text import MIMEText from email.mime.multipart import MIME...
true
true
f769a212aa6522392e606ac5a9e406267d7ba415
12,447
py
Python
qa/rpc-tests/util.py
blocknodetech/blocknode
5cdda801056b968c4f940c68fc6b3566b108a5cd
[ "MIT" ]
9
2018-12-06T09:43:00.000Z
2019-08-06T13:47:56.000Z
qa/rpc-tests/util.py
blocknodetech/blocknode
5cdda801056b968c4f940c68fc6b3566b108a5cd
[ "MIT" ]
5
2018-08-28T00:38:06.000Z
2021-03-06T09:37:15.000Z
qa/rpc-tests/util.py
blocknodetech/blocknode
5cdda801056b968c4f940c68fc6b3566b108a5cd
[ "MIT" ]
10
2018-07-07T06:33:24.000Z
2021-01-21T21:01:39.000Z
# Copyright (c) 2014 The Bitcoin Core developers # Copyright (c) 2014-2015 The Dash developers # Copyright (c) 2018 The Blocknode developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression te...
35.973988
109
0.648751
import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) from decimal import Decimal, ROUND_DOWN import json import random import shutil import subprocess import time import re from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util imp...
true
true
f769a267f17ea1028a806c2681b00792c0ae7dd2
2,579
py
Python
parquet_flask/utils/parallel_json_validator.py
wphyojpl/incubator-sdap-in-situ-data-services
20fe50e2ebe5b9b4d3b8e266be20ee5265aadab3
[ "Apache-2.0" ]
1
2021-11-07T20:27:13.000Z
2021-11-07T20:27:13.000Z
parquet_flask/utils/parallel_json_validator.py
wphyojpl/incubator-sdap-in-situ-data-services
20fe50e2ebe5b9b4d3b8e266be20ee5265aadab3
[ "Apache-2.0" ]
null
null
null
parquet_flask/utils/parallel_json_validator.py
wphyojpl/incubator-sdap-in-situ-data-services
20fe50e2ebe5b9b4d3b8e266be20ee5265aadab3
[ "Apache-2.0" ]
2
2021-11-07T20:27:05.000Z
2021-11-15T15:40:40.000Z
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
31.072289
74
0.689415
import fastjsonschema import logging from datetime import datetime from multiprocessing import Pool from parquet_flask.utils.singleton import Singleton LOGGER = logging.getLogger(__name__) def __validate_small_data(small_data): validator = ParallelJsonValidator() try: validator.schema(small_data) ...
true
true
f769a383bf27c5fec11ed594fa92e17de10b10e7
14,554
py
Python
NAS/AngleNAS/NAS-Bench-201/exps/algos/SPOS.py
naviocean/SimpleCVReproduction
61b43e3583977f42e6f91ef176ec5e1701e98d33
[ "Apache-2.0" ]
923
2020-01-11T06:36:53.000Z
2022-03-31T00:26:57.000Z
NAS/AngleNAS/NAS-Bench-201/exps/algos/SPOS.py
Twenty3hree/SimpleCVReproduction
9939f8340c54dbd69b0017cecad875dccf428f26
[ "Apache-2.0" ]
25
2020-02-27T08:35:46.000Z
2022-01-25T08:54:19.000Z
NAS/AngleNAS/NAS-Bench-201/exps/algos/SPOS.py
Twenty3hree/SimpleCVReproduction
9939f8340c54dbd69b0017cecad875dccf428f26
[ "Apache-2.0" ]
262
2020-01-02T02:19:40.000Z
2022-03-23T04:56:16.000Z
################################################## # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020 # ###################################################################################### # One-Shot Neural Architecture Search via Self-Evaluated Template Network, ICCV 2019 # ############################################...
55.762452
194
0.678233
import os, sys, time, glob, random, argparse import numpy as np from copy import deepcopy import torch import torch.nn as nn from pathlib import Path lib_dir = (Path(__file__).parent / '..' / '..' / 'lib').resolve() if str(lib_dir) not in sys.path: sys.path.insert(0, str(lib_dir)) from config_utils import load_config, ...
true
true
f769a3b8d3fef7513a8425141cf4b313d634801f
98,080
py
Python
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_deployments_operations.py
beltr0n/azure-sdk-for-python
2f7fb8bee881b0fc0386a0ad5385755ceedd0453
[ "MIT" ]
1
2021-09-07T18:35:49.000Z
2021-09-07T18:35:49.000Z
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_deployments_operations.py
beltr0n/azure-sdk-for-python
2f7fb8bee881b0fc0386a0ad5385755ceedd0453
[ "MIT" ]
4
2019-04-17T17:57:49.000Z
2020-04-24T21:11:22.000Z
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_deployments_operations.py
beltr0n/azure-sdk-for-python
2f7fb8bee881b0fc0386a0ad5385755ceedd0453
[ "MIT" ]
1
2019-04-05T18:17:43.000Z
2019-04-05T18:17:43.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
49.9389
216
0.663938
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpR...
true
true
f769a4c78268811ed11ecd7b4ab588f35b275d69
5,661
py
Python
bindings/python/ensmallen_graph/datasets/networkrepository/halfb.py
caufieldjh/ensmallen_graph
14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a
[ "MIT" ]
null
null
null
bindings/python/ensmallen_graph/datasets/networkrepository/halfb.py
caufieldjh/ensmallen_graph
14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a
[ "MIT" ]
null
null
null
bindings/python/ensmallen_graph/datasets/networkrepository/halfb.py
caufieldjh/ensmallen_graph
14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a
[ "MIT" ]
null
null
null
""" This file offers the methods to automatically retrieve the graph halfb. The graph is automatically retrieved from the NetworkRepository repository. Report --------------------- At the time of rendering these methods (please see datetime below), the graph had the following characteristics: Datetime: 2021-02-06...
31.625698
94
0.683625
from typing import Dict from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph from ...ensmallen_graph import EnsmallenGraph def Halfb( directed: bool = False, verbose: int = 2, cache_path: str = "graphs/networkrepository", **additional_graph_kwargs: Dict ) -> EnsmallenGraph: return...
true
true
f769a5087e94a68736c734e74bd0d7b673715b31
12,520
py
Python
instauto/api/actions/request.py
tibotix/instauto
66eebcee6ede74a1e9dbcfc78e756a7b96bbb3a5
[ "MIT" ]
null
null
null
instauto/api/actions/request.py
tibotix/instauto
66eebcee6ede74a1e9dbcfc78e756a7b96bbb3a5
[ "MIT" ]
null
null
null
instauto/api/actions/request.py
tibotix/instauto
66eebcee6ede74a1e9dbcfc78e756a7b96bbb3a5
[ "MIT" ]
null
null
null
import os import requests import time import json import urllib.parse import logging from typing import Dict, Callable, Union from instauto.api.structs import DeviceProfile, IGProfile, State, Method from instauto.api.constants import API_BASE_URL from instauto.api.exceptions import WrongMethodException, IncorrectLog...
45.527273
157
0.623882
import os import requests import time import json import urllib.parse import logging from typing import Dict, Callable, Union from instauto.api.structs import DeviceProfile, IGProfile, State, Method from instauto.api.constants import API_BASE_URL from instauto.api.exceptions import WrongMethodException, IncorrectLog...
true
true
f769a539be693d8dd8f869d9295f1cac1cc9ab88
2,481
py
Python
wiz/generator.py
MichaelYusko/wizi
bc891497eeeac0ff64ceba7938b57b99debfdf9d
[ "MIT" ]
2
2017-11-05T16:28:53.000Z
2017-11-11T23:48:04.000Z
wiz/generator.py
MichaelYusko/wizi
bc891497eeeac0ff64ceba7938b57b99debfdf9d
[ "MIT" ]
1
2018-01-05T14:05:29.000Z
2018-01-05T15:03:13.000Z
wiz/generator.py
MichaelYusko/wizi
bc891497eeeac0ff64ceba7938b57b99debfdf9d
[ "MIT" ]
2
2017-11-02T15:18:16.000Z
2018-02-26T20:41:01.000Z
"""Base generator file""" import abc import os import sys from .helpers import write_license_file class BaseGenerator: # pylint: disable=too-few-public-methods """Base generator class""" def __init__(self, project_name): self.project_name = project_name @abc.abstractmethod def create(self):...
32.220779
82
0.645707
import abc import os import sys from .helpers import write_license_file class BaseGenerator: def __init__(self, project_name): self.project_name = project_name @abc.abstractmethod def create(self): pass def _make_path(self, file_name): path = os.getcwd() return '{}/...
true
true
f769a67480e4eb1ad838ee38d8f5fc6a75c7d6bb
3,154
py
Python
superset/dashboards/commands/export.py
piyush-singhal/incubator-superset
cf4edf73a6ad1a61e7a65f05b6e4201db3a4b6e4
[ "Apache-2.0" ]
1
2020-10-30T05:59:42.000Z
2020-10-30T05:59:42.000Z
superset/dashboards/commands/export.py
piyush-singhal/incubator-superset
cf4edf73a6ad1a61e7a65f05b6e4201db3a4b6e4
[ "Apache-2.0" ]
1
2021-02-23T16:45:47.000Z
2021-04-24T23:15:03.000Z
superset/dashboards/commands/export.py
piyush-singhal/incubator-superset
cf4edf73a6ad1a61e7a65f05b6e4201db3a4b6e4
[ "Apache-2.0" ]
null
null
null
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
37.105882
78
0.707039
import json import logging from typing import Iterator, List, Tuple import yaml from superset.commands.base import BaseCommand from superset.charts.commands.export import ExportChartsCommand from superset.dashboards.commands.exceptions import DashboardNotFoundError from superset.dashboards.dao import DashboardDAO fr...
true
true
f769a6abc0a907954e61ce71ef6ee265993cdb32
4,049
py
Python
test.py
rameshnair007/SR-cycleGAN
a111131fadb2fca45c6655410107e040d6973351
[ "BSD-3-Clause" ]
11
2020-05-03T08:38:36.000Z
2021-07-21T09:27:19.000Z
test.py
rameshnair007/SR-cycleGAN
a111131fadb2fca45c6655410107e040d6973351
[ "BSD-3-Clause" ]
2
2020-06-08T19:29:11.000Z
2021-07-01T05:21:36.000Z
test.py
rameshnair007/SR-cycleGAN
a111131fadb2fca45c6655410107e040d6973351
[ "BSD-3-Clause" ]
5
2019-07-18T15:25:32.000Z
2021-10-30T23:34:39.000Z
"""General-purpose test script for image-to-image translation. Once you have trained your model with train.py, you can use this script to test the model. It will load a saved model from --checkpoints_dir and save the results to --results_dir. It first creates model and dataset given the option. It will hard-code some...
61.348485
148
0.724623
import os from options.test_options import TestOptions from data import create_dataset from models import create_model from util.visualizer import save_images from util import html if __name__ == '__main__': opt = TestOptions().parse() opt.num_threads = 1 opt.batch_size = 1 opt.serial_batche...
true
true
f769a725dc4b5fd73da98373114171aafe721497
39,910
py
Python
tools/third_party/pytest/testing/test_capture.py
shs96c/web-platform-tests
61acad6dd9bb99d32340eb41f5146de64f542359
[ "BSD-3-Clause" ]
1
2021-01-07T18:46:45.000Z
2021-01-07T18:46:45.000Z
tools/third_party/pytest/testing/test_capture.py
shs96c/web-platform-tests
61acad6dd9bb99d32340eb41f5146de64f542359
[ "BSD-3-Clause" ]
null
null
null
tools/third_party/pytest/testing/test_capture.py
shs96c/web-platform-tests
61acad6dd9bb99d32340eb41f5146de64f542359
[ "BSD-3-Clause" ]
1
2021-04-06T20:06:58.000Z
2021-04-06T20:06:58.000Z
from __future__ import absolute_import, division, print_function # note: py.io capture tests where copied from # pylib 1.4.20.dev2 (rev 13d9af95547e) from __future__ import with_statement import pickle import os import sys from io import UnsupportedOperation import _pytest._code import py import pytest import contextl...
31.301961
97
0.566625
from __future__ import absolute_import, division, print_function from __future__ import with_statement import pickle import os import sys from io import UnsupportedOperation import _pytest._code import py import pytest import contextlib from _pytest import capture from _pytest.capture import CaptureManager from _pyte...
true
true
f769a736347de41caac1e2dd4ed2f076d46bec5c
138
py
Python
swiss_snow/__init__.py
abibouba/swiss-snow
82848cc7c87394d9fe436aeac356edb9715ad3da
[ "Apache-2.0" ]
null
null
null
swiss_snow/__init__.py
abibouba/swiss-snow
82848cc7c87394d9fe436aeac356edb9715ad3da
[ "Apache-2.0" ]
null
null
null
swiss_snow/__init__.py
abibouba/swiss-snow
82848cc7c87394d9fe436aeac356edb9715ad3da
[ "Apache-2.0" ]
null
null
null
"""Python interface to Swiss snow conditions websites""" __version__ = "0.1.0" __author__ = "Sebastien Tr" from .Resorts import Resorts
19.714286
56
0.746377
__version__ = "0.1.0" __author__ = "Sebastien Tr" from .Resorts import Resorts
true
true
f769a73d28c0d242dfcd050e2aa6cb605df0bf79
5,396
py
Python
push_notifications/apns.py
BuddyHC/django-push-notifications
7b7799d9ee632953c1df7ace8b5b23800aafeb82
[ "MIT" ]
null
null
null
push_notifications/apns.py
BuddyHC/django-push-notifications
7b7799d9ee632953c1df7ace8b5b23800aafeb82
[ "MIT" ]
null
null
null
push_notifications/apns.py
BuddyHC/django-push-notifications
7b7799d9ee632953c1df7ace8b5b23800aafeb82
[ "MIT" ]
null
null
null
""" Apple Push Notification Service Documentation is available on the iOS Developer Library: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html """ import time from apns2 import client as apns2_client from apns2 import credentials as apns2_c...
33.104294
127
0.779466
import time from apns2 import client as apns2_client from apns2 import credentials as apns2_credentials from apns2 import errors as apns2_errors from apns2 import payload as apns2_payload from . import models from .conf import get_manager from .exceptions import NotificationError class APNSError(NotificationError)...
true
true
f769a7af1ab237d82211e21370ceb48cf469126b
3,195
py
Python
aalh_iit_vanderlipcollection/merge-title-columns.py
johndewees/iitmigration
4dadfbecda719d6e7d60af076a231aedec3c862f
[ "Unlicense" ]
null
null
null
aalh_iit_vanderlipcollection/merge-title-columns.py
johndewees/iitmigration
4dadfbecda719d6e7d60af076a231aedec3c862f
[ "Unlicense" ]
null
null
null
aalh_iit_vanderlipcollection/merge-title-columns.py
johndewees/iitmigration
4dadfbecda719d6e7d60af076a231aedec3c862f
[ "Unlicense" ]
null
null
null
from openpyxl import load_workbook #enter the source filename for the Excel worksheet in this variable filename = 'aalh_iit_vanderlipcollection.xlsx' wb = load_workbook(filename) ws = wb['Metadata Template'] #variables define the array of rows and columns minimumcol = 2 maximumcol = 2 minimumrow = 494 maxi...
42.6
583
0.643818
from openpyxl import load_workbook filename = 'aalh_iit_vanderlipcollection.xlsx' wb = load_workbook(filename) ws = wb['Metadata Template'] minimumcol = 2 maximumcol = 2 minimumrow = 494 maximumrow = 898 iterationrow = 494 targetcol = 2 locationcol = 13 datecol = 15 commaspace = ', ' space = ' ' o...
true
true
f769a7ca9298221638a4d2a37e0132833323e469
5,755
py
Python
test/functional/feature_nulldummy.py
anandsinha095/JDCOIN
f77d87e7ba2b3d34d8b7425d33cdd1cf8a09f821
[ "MIT" ]
null
null
null
test/functional/feature_nulldummy.py
anandsinha095/JDCOIN
f77d87e7ba2b3d34d8b7425d33cdd1cf8a09f821
[ "MIT" ]
null
null
null
test/functional/feature_nulldummy.py
anandsinha095/JDCOIN
f77d87e7ba2b3d34d8b7425d33cdd1cf8a09f821
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2016-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test NULLDUMMY softfork. Connect to a single node. Generate 2 blocks (save the coinbases for later). G...
43.270677
134
0.681842
from test_framework.test_framework import JdcoinTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, network_thread_start from test_framework.blocktools import create_coinbase, create_block, add_witness_commitment from test_framework.script import CScript from io import Byt...
true
true
f769a7cd3c2668bd8137109d50420abe4c5ea09a
1,392
py
Python
control/actor/gazebo_ros_actor_plugin/gazebo_ros_actor_cmd_plugin/src/catkin_generated/generate_cached_setup.py
lnexenl/XTDrone
f0402d44ac3b9a8435cfc67aea769ef659892010
[ "MIT" ]
null
null
null
control/actor/gazebo_ros_actor_plugin/gazebo_ros_actor_cmd_plugin/src/catkin_generated/generate_cached_setup.py
lnexenl/XTDrone
f0402d44ac3b9a8435cfc67aea769ef659892010
[ "MIT" ]
null
null
null
control/actor/gazebo_ros_actor_plugin/gazebo_ros_actor_cmd_plugin/src/catkin_generated/generate_cached_setup.py
lnexenl/XTDrone
f0402d44ac3b9a8435cfc67aea769ef659892010
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import print_function import os import stat import sys # find the import for catkin's python package - either from source space or from an installed underlay if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')): sys.path.insert(0, ...
44.903226
144
0.75
from __future__ import print_function import os import stat import sys if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')): sys.path.insert(0, os.path.join('/opt/ros/melodic/share/catkin/cmake', '..', 'python')) try: from catkin.environment_cache import generate_env...
true
true
f769a7fd954750a304f132deefa3d2c1d5ea2c55
2,881
py
Python
Scripts/image2py.py
i22guavc/PIL
481cc902930b9d9d7c9fca62fd9005eecb89bd0f
[ "Intel" ]
null
null
null
Scripts/image2py.py
i22guavc/PIL
481cc902930b9d9d7c9fca62fd9005eecb89bd0f
[ "Intel" ]
null
null
null
Scripts/image2py.py
i22guavc/PIL
481cc902930b9d9d7c9fca62fd9005eecb89bd0f
[ "Intel" ]
null
null
null
# # The Python Imaging Library # $Id: image2py.py 2134 2004-10-06 08:55:20Z fredrik $ # # convert an image to a Python module # # to use the module, import it and access the "IMAGE" variable # # import img1 # im = img1.IMAGE # # the variable name can be changed with the -n option # # note that the applicati...
22.865079
70
0.54009
import Image import getopt, string, StringIO, sys octdigits = "01234567" def usage(): print "image2py 0.1/97-01-03 -- convert image to python module" print print "Usage: image2py [options] imagefile pyfile" print print "Options:" print " -n <name> set variable name (default is 'IMAGE')" ...
false
true
f769a876f4f69a09bd542d44e71166626b115b47
5,228
py
Python
data/pre_process.py
Alexzsh/chinese_short_text_classification
de16359b4c83cc18c0478c33e211cc3f85b8e36b
[ "MIT" ]
1
2020-11-25T09:03:02.000Z
2020-11-25T09:03:02.000Z
data/pre_process.py
Alexzsh/chinese_short_text_classification
de16359b4c83cc18c0478c33e211cc3f85b8e36b
[ "MIT" ]
null
null
null
data/pre_process.py
Alexzsh/chinese_short_text_classification
de16359b4c83cc18c0478c33e211cc3f85b8e36b
[ "MIT" ]
null
null
null
# coding: utf-8 import sys from collections import Counter import gc import numpy as np import tensorflow.contrib.keras as kr import jieba import pandas as pd import re if sys.version_info[0] > 2: is_py3 = True else: #reload(sys) sys.setdefaultencoding("utf-8") is_py3 = False def native_word(word, enco...
32.271605
82
0.612089
import sys from collections import Counter import gc import numpy as np import tensorflow.contrib.keras as kr import jieba import pandas as pd import re if sys.version_info[0] > 2: is_py3 = True else: sys.setdefaultencoding("utf-8") is_py3 = False def native_word(word, encoding='utf-8'): if not is_...
true
true
f769a8817345f2af7e90aa67b7b0bfd5ca7c2e4e
3,117
py
Python
demo/apr_iteration_demo.py
mosaic-group/PyLibAPR
4b5af50c26b4770c460460f9491bd840af2537da
[ "Apache-2.0" ]
7
2021-07-02T11:08:30.000Z
2022-03-07T20:54:33.000Z
demo/apr_iteration_demo.py
mosaic-group/PyLibAPR
4b5af50c26b4770c460460f9491bd840af2537da
[ "Apache-2.0" ]
19
2020-12-17T09:32:09.000Z
2022-01-08T20:22:16.000Z
demo/apr_iteration_demo.py
mosaic-group/PyLibAPR
4b5af50c26b4770c460460f9491bd840af2537da
[ "Apache-2.0" ]
1
2021-01-19T14:23:36.000Z
2021-01-19T14:23:36.000Z
import pyapr import numpy as np from time import time def main(): """ This demo implements a piecewise constant reconstruction using the wrapped PyLinearIterator. The Python reconstruction is timed and compared to the internal C++ version. Note: The current Python reconstruction is very slow and need...
37.554217
122
0.641001
import pyapr import numpy as np from time import time def main(): io_int = pyapr.filegui.InteractiveIO() fpath_apr = io_int.get_apr_file_name() parts = pyapr.ShortParticles() apr = pyapr.APR() pyapr.io.read(fpath_apr, apr, parts) start = time() org_dims = apr.org_dims() ...
true
true
f769a914c4eafa918214b90def559d3aadff2e55
13,145
py
Python
pywikibot/userinterfaces/win32_unicode.py
npdoty/pywikibot
d0687ce7035401ffb63f4a95d225c27ed9ba722b
[ "MIT" ]
2
2019-03-14T09:30:13.000Z
2021-01-07T16:59:27.000Z
pywikibot/userinterfaces/win32_unicode.py
jayvdb/pywikibot-core
70be2ea5cb34c4a054f89200f18b4e4be05c3ba4
[ "MIT" ]
null
null
null
pywikibot/userinterfaces/win32_unicode.py
jayvdb/pywikibot-core
70be2ea5cb34c4a054f89200f18b4e4be05c3ba4
[ "MIT" ]
1
2018-08-23T16:46:05.000Z
2018-08-23T16:46:05.000Z
# -*- coding: utf-8 -*- """Stdout, stderr and argv support for unicode.""" # # (C) David-Sarah Hopwood, 2010 # (C) Pywikibot team, 2012-2015 # ############################################## # Support for unicode in windows cmd.exe # Posted on Stack Overflow [1], available under CC-BY-SA 3.0 [2] # # Question: "Windows c...
35.147059
115
0.583948
from __future__ import absolute_import, print_function, unicode_literals import codecs import sys from ctypes import Structure, byref, c_int, create_unicode_buffer, sizeof from ctypes import c_void_p as LPVOID from io import IOBase, UnsupportedOperation OSWIN32 = (sys.platform == "win32") if sys.version_info[0] > 2...
true
true
f769aa665bb59f5759da1405eeab830fc6771217
1,122
py
Python
civo/charges.py
alejandrojnm/client-python
e5e239594401c3ee902f58a5d33e200f032c9791
[ "MIT" ]
null
null
null
civo/charges.py
alejandrojnm/client-python
e5e239594401c3ee902f58a5d33e200f032c9791
[ "MIT" ]
null
null
null
civo/charges.py
alejandrojnm/client-python
e5e239594401c3ee902f58a5d33e200f032c9791
[ "MIT" ]
null
null
null
from datetime import datetime import requests class Charges: """ The system tracks usage of paid service on an hourly basis. It doesn't track how much to charge for any particular product, but it will report for each instance, IP address and snapshot the amount of hours it's in use for. """ ...
30.324324
105
0.606061
from datetime import datetime import requests class Charges: def __init__(self, headers, api_url): self.headers = headers self.url = 'https://{}/v2/charges'.format(api_url) def get(self, date_from: str = None, date_to: str = None) -> dict: payload = {} if date_from: ...
true
true
f769ac6c65697f3a2ef6396d1cb2c029ee1e3aa1
171
py
Python
tests/camera-test.py
naoned-makers/im-camera
b5a2ebef0f121cc1a5574cf1fc1a1ed5f79cc600
[ "MIT" ]
null
null
null
tests/camera-test.py
naoned-makers/im-camera
b5a2ebef0f121cc1a5574cf1fc1a1ed5f79cc600
[ "MIT" ]
1
2019-01-19T09:47:22.000Z
2019-01-19T09:47:22.000Z
tests/camera-test.py
naoned-makers/im-camera
b5a2ebef0f121cc1a5574cf1fc1a1ed5f79cc600
[ "MIT" ]
null
null
null
from picamera import PiCamera from time import sleep camera = PiCamera() #camera.capture('image-test.jpg') camera.start_preview() while True: sleep(1) #camera.close()
14.25
33
0.754386
from picamera import PiCamera from time import sleep camera = PiCamera() camera.start_preview() while True: sleep(1)
true
true
f769ac950a83907f722a1fdf768ca5325268caaf
227
py
Python
ex7_crop.py
Yasir323/Image-Processing
1301492444182ee89eb20f37571e2f18b58de8eb
[ "MIT" ]
null
null
null
ex7_crop.py
Yasir323/Image-Processing
1301492444182ee89eb20f37571e2f18b58de8eb
[ "MIT" ]
null
null
null
ex7_crop.py
Yasir323/Image-Processing
1301492444182ee89eb20f37571e2f18b58de8eb
[ "MIT" ]
null
null
null
import cv2 img = cv2.imread('data/image10.jpg') print(img.shape) img_cropped = img[0:200, 200:500] # Height comes first then the width cv2.imshow("Cropped image", img_cropped) cv2.imshow("Original image", img) cv2.waitKey(0)
25.222222
69
0.740088
import cv2 img = cv2.imread('data/image10.jpg') print(img.shape) img_cropped = img[0:200, 200:500] cv2.imshow("Cropped image", img_cropped) cv2.imshow("Original image", img) cv2.waitKey(0)
true
true
f769ad95b802de13d21d93ab9fadadcd431a4a7a
1,007
py
Python
main.py
ojizosan/iNAZO-notification
d7e908f9e6ba1b63da3861d28fdfd3c1cde29c79
[ "MIT" ]
2
2022-03-19T06:00:37.000Z
2022-03-19T10:47:59.000Z
main.py
ojizosan/iNAZO-notification
d7e908f9e6ba1b63da3861d28fdfd3c1cde29c79
[ "MIT" ]
null
null
null
main.py
ojizosan/iNAZO-notification
d7e908f9e6ba1b63da3861d28fdfd3c1cde29c79
[ "MIT" ]
null
null
null
from logging import getLogger from src import settings from src.utils import ( fetch_html, get_latest_year_term, get_year_terms, insert_year_term, is_new_term, ) # __name__では__main__になるので、直接srcを指定する。 logger = getLogger("src") def main(): try: html = fetch_html(settings.HOKUDAI_GRADE_...
21.425532
67
0.631579
from logging import getLogger from src import settings from src.utils import ( fetch_html, get_latest_year_term, get_year_terms, insert_year_term, is_new_term, ) logger = getLogger("src") def main(): try: html = fetch_html(settings.HOKUDAI_GRADE_URL) except Exception as e: ...
true
true
f769adc342db2b36a5f37ea6acc3c6efdff17f3a
7,241
py
Python
test/test_DuMBSwitcher.py
KyleS22/DuMBSwitcher
bbbf4ae80396cf9e37adc90768be9c63f533951b
[ "MIT" ]
1
2018-08-19T18:14:48.000Z
2018-08-19T18:14:48.000Z
test/test_DuMBSwitcher.py
KyleS22/DuMBSwitcher
bbbf4ae80396cf9e37adc90768be9c63f533951b
[ "MIT" ]
2
2022-01-13T00:50:35.000Z
2022-03-11T23:27:12.000Z
test/test_DuMBSwitcher.py
KyleS22/DuMBSwitcher
bbbf4ae80396cf9e37adc90768be9c63f533951b
[ "MIT" ]
null
null
null
from dumb_switcher import DuMBSwitcher as ds import pytest import os from PIL import Image import unittest from unittest import mock from dumb_switcher import controller TEST_IMAGE_NUM = 0 def test_parse_screen_properties_to_resolution_and_position(): """ Test cases for parsing the resolution from xrandr ...
35.150485
117
0.584173
from dumb_switcher import DuMBSwitcher as ds import pytest import os from PIL import Image import unittest from unittest import mock from dumb_switcher import controller TEST_IMAGE_NUM = 0 def test_parse_screen_properties_to_resolution_and_position(): resolutions = ["1600x900+0+0", "450x250+3+5"] expec...
true
true
f769ade662ddf844cf9b89f398b4dee62326533e
1,209
py
Python
src/sst/elements/simpleElementExample/tests/subcomponent_tests/test_sc_2u.py
feldergast/sst-elements
a7abc015aed709feb05821d269d233110569fd72
[ "BSD-3-Clause" ]
2
2019-06-10T15:32:03.000Z
2019-06-11T14:17:32.000Z
src/sst/elements/simpleElementExample/tests/subcomponent_tests/test_sc_2u.py
feldergast/sst-elements
a7abc015aed709feb05821d269d233110569fd72
[ "BSD-3-Clause" ]
39
2016-01-06T15:08:15.000Z
2020-06-03T18:12:31.000Z
src/sst/elements/simpleElementExample/tests/subcomponent_tests/test_sc_2u.py
feldergast/sst-elements
a7abc015aed709feb05821d269d233110569fd72
[ "BSD-3-Clause" ]
1
2017-06-13T13:50:58.000Z
2017-06-13T13:50:58.000Z
import sst # Define SST core options sst.setProgramOption("stopAtCycle", "10us") # Set up senders using user subcomponents loader0 = sst.Component("Loader0", "simpleElementExample.SubComponentLoader") loader0.addParam("clock", "1.5GHz") loader0.enableAllStatistics() sub0_0 = loader0.setSubComponent("mySubComp", "sim...
32.675676
87
0.777502
import sst sst.setProgramOption("stopAtCycle", "10us") loader0 = sst.Component("Loader0", "simpleElementExample.SubComponentLoader") loader0.addParam("clock", "1.5GHz") loader0.enableAllStatistics() sub0_0 = loader0.setSubComponent("mySubComp", "simpleElementExample.SubCompSender",0) sub0_0.addParam("sendCount", 15)...
true
true
f769ae6e5798456f050814a9846908c58e97ae95
1,590
py
Python
source/templatehandler.py
marctrommen/bloggenerator
5b4fed4cd12a899829261d492328dfc39a78153d
[ "MIT" ]
null
null
null
source/templatehandler.py
marctrommen/bloggenerator
5b4fed4cd12a899829261d492328dfc39a78153d
[ "MIT" ]
null
null
null
source/templatehandler.py
marctrommen/bloggenerator
5b4fed4cd12a899829261d492328dfc39a78153d
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os class TemplateHandler(object): def __init__(self): aPath = os.path.realpath(__file__) aPath = os.path.dirname(aPath) aPath = os.path.join(aPath, "..") aPath = os.path.normpath(aPath) self.templatePath = os.path.join(aPath, "templates") self.loadTe...
26.949153
78
0.718868
import os class TemplateHandler(object): def __init__(self): aPath = os.path.realpath(__file__) aPath = os.path.dirname(aPath) aPath = os.path.join(aPath, "..") aPath = os.path.normpath(aPath) self.templatePath = os.path.join(aPath, "templates") self.loadTemplates() def loadTemplates(self): fileNam...
true
true
f769ae9acaafe613bc0323965678fb8e0b5c85bd
6,784
py
Python
ops.py
khanfarhan10/gvae
a14fa36c5249373235c7cf339e26328791c6c8c4
[ "MIT" ]
null
null
null
ops.py
khanfarhan10/gvae
a14fa36c5249373235c7cf339e26328791c6c8c4
[ "MIT" ]
null
null
null
ops.py
khanfarhan10/gvae
a14fa36c5249373235c7cf339e26328791c6c8c4
[ "MIT" ]
null
null
null
import math import numpy as np import tensorflow as tf from tensorflow.python.framework import ops from tensorflow.contrib import slim from tensorflow.contrib import layers as tflayers @slim.add_arg_scope def conv2d_transpose( inputs, out_shape, kernel_size=(5, 5), stride=(1, 1), ...
34.436548
121
0.626179
import math import numpy as np import tensorflow as tf from tensorflow.python.framework import ops from tensorflow.contrib import slim from tensorflow.contrib import layers as tflayers @slim.add_arg_scope def conv2d_transpose( inputs, out_shape, kernel_size=(5, 5), stride=(1, 1), ...
true
true
f769af1cefe1b0cf53133f3b3d91efd7d20734b5
2,808
py
Python
python/taichi/lang/ast_checker.py
youyufeng92/taichi
c826de521d254745db556835e322dd2e0cfdbfa0
[ "MIT" ]
1
2020-07-17T08:59:53.000Z
2020-07-17T08:59:53.000Z
python/taichi/lang/ast_checker.py
youyufeng92/taichi
c826de521d254745db556835e322dd2e0cfdbfa0
[ "MIT" ]
null
null
null
python/taichi/lang/ast_checker.py
youyufeng92/taichi
c826de521d254745db556835e322dd2e0cfdbfa0
[ "MIT" ]
null
null
null
import ast class KernelSimplicityASTChecker(ast.NodeVisitor): class ScopeGuard: def __init__(self, checker): self.c = checker self._allows_for_loop = True self._allows_more_stmt = True @property def allows_for_loop(self): return self._allows_for_loop @property def allow...
29.557895
80
0.696937
import ast class KernelSimplicityASTChecker(ast.NodeVisitor): class ScopeGuard: def __init__(self, checker): self.c = checker self._allows_for_loop = True self._allows_more_stmt = True @property def allows_for_loop(self): return self._allows_for_loop @property def allow...
true
true
f769af996f50c39f9b46b6cb77728b5ca63a089e
146
py
Python
janusbackup/core/backup_providers/__init__.py
NikitosnikN/janus-backup
413d365663b532a0611575be16ea0a4f0c7ffd20
[ "MIT" ]
null
null
null
janusbackup/core/backup_providers/__init__.py
NikitosnikN/janus-backup
413d365663b532a0611575be16ea0a4f0c7ffd20
[ "MIT" ]
null
null
null
janusbackup/core/backup_providers/__init__.py
NikitosnikN/janus-backup
413d365663b532a0611575be16ea0a4f0c7ffd20
[ "MIT" ]
null
null
null
from .base_provider import BaseBackupProvider from .mongo_provider import MongoBackupProvider from .provider_manager import BackupProviderManager
36.5
51
0.89726
from .base_provider import BaseBackupProvider from .mongo_provider import MongoBackupProvider from .provider_manager import BackupProviderManager
true
true
f769af9d008d9e7d9b83ac4231ca07a6247248b6
28
py
Python
matcher/__init__.py
spbsamuel/Tradeit
cd710c80f708db7e7161443c7051f8b16f41a715
[ "MIT" ]
null
null
null
matcher/__init__.py
spbsamuel/Tradeit
cd710c80f708db7e7161443c7051f8b16f41a715
[ "MIT" ]
null
null
null
matcher/__init__.py
spbsamuel/Tradeit
cd710c80f708db7e7161443c7051f8b16f41a715
[ "MIT" ]
null
null
null
from match import find_match
28
28
0.892857
from match import find_match
true
true
f769afd46e02fdf2692000658652a1c8f5b9520e
24,359
py
Python
src/python/HTMLTestRunner.py
YFFY/SeleniumGridExample
1a83dc9cfebb046d8f592400d1bbd94d0fada686
[ "Apache-2.0" ]
2
2017-12-04T09:18:46.000Z
2018-06-08T20:18:16.000Z
src/python/HTMLTestRunner.py
YFFY/SeleniumGridExample
1a83dc9cfebb046d8f592400d1bbd94d0fada686
[ "Apache-2.0" ]
1
2016-06-29T22:52:28.000Z
2016-06-30T13:13:01.000Z
auctionTheory/tests/HTMLTestRunner.py
gullyy/auctionTheory
8edee30252234dee3ad4f6bf670f62edeb24e184
[ "MIT" ]
1
2020-10-16T11:04:23.000Z
2020-10-16T11:04:23.000Z
""" A TestRunner for use with the Python unit testing framework. It generates a HTML report to show the result at a glance. The simplest way to use this is to invoke its main method. E.g. import unittest import HTMLTestRunner ... define your tests ... if __name__ == '__main__': HTMLTestRunne...
29.561893
109
0.543495
__author__ = "Wai Yip Tung" __version__ = "0.8.2" import datetime import StringIO import sys import time import unittest from xml.sax import saxutils class OutputRedirector(object): def __init__(self, fp): self.fp = fp def write(self, s): self.fp.write(s) def writelines(self, line...
true
true
f769b04c826a3eef10abd2d08df9e31205dd6d10
2,534
py
Python
Projects/TempDataLogger/TempLogHostApp_Python/temp_log_config.py
marex/lufa
5ba628d10b54d58d445896290ba9799bd76a73b3
[ "MIT" ]
7
2019-08-25T03:41:10.000Z
2021-08-21T10:57:27.000Z
lufa/Projects/TempDataLogger/TempLogHostApp_Python/temp_log_config.py
k88097/Switch-Fightstick
2f82ccab26d1aa3e802bc03cff2744b75cee8d62
[ "MIT" ]
null
null
null
lufa/Projects/TempDataLogger/TempLogHostApp_Python/temp_log_config.py
k88097/Switch-Fightstick
2f82ccab26d1aa3e802bc03cff2744b75cee8d62
[ "MIT" ]
2
2019-10-12T15:48:38.000Z
2021-08-10T00:08:13.000Z
#!/usr/bin/env python """ LUFA Library Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org """ """ Front-end configuration app for the TempDataLogger project. This script configures the logger to the current system time and date, with a user ...
26.673684
109
0.689029
import sys from datetime import datetime import hid def get_hid_device_handle(): all_hid_devices = hid.enumerate() lufa_hid_devices = [d for d in all_hid_devices if d['vendor_id'] == 0x03EB and d['product_id'] == 0x2063] if len(lufa_hid_devices) is 0: return None device_handle = hid.devi...
true
true
f769b07ac359f19667f0169a4a94d846cddcaa91
6,827
py
Python
fts_scripts/run_openrave_tamp_fixed_base.py
nishadg246/stripstream-ivan-nishad
9a275ae5836ee289cd09cbe6bc0ff6fd4a381135
[ "MIT" ]
null
null
null
fts_scripts/run_openrave_tamp_fixed_base.py
nishadg246/stripstream-ivan-nishad
9a275ae5836ee289cd09cbe6bc0ff6fd4a381135
[ "MIT" ]
null
null
null
fts_scripts/run_openrave_tamp_fixed_base.py
nishadg246/stripstream-ivan-nishad
9a275ae5836ee289cd09cbe6bc0ff6fd4a381135
[ "MIT" ]
null
null
null
#!/usr/bin/env python2 import argparse import sys from openravepy import Environment, RaveDestroy from stripstream.algorithms.focused.simple_focused import simple_focused from stripstream.algorithms.search.fast_downward import get_fast_downward from robotics.openrave.utils import open_gripper, \ Conf, initialize_o...
33.79703
129
0.666764
import argparse import sys from openravepy import Environment, RaveDestroy from stripstream.algorithms.focused.simple_focused import simple_focused from stripstream.algorithms.search.fast_downward import get_fast_downward from robotics.openrave.utils import open_gripper, \ Conf, initialize_openrave, execute_viewer...
false
true
f769b0d41cd8389b6806a9698785a71a753641b5
4,635
py
Python
src/ggrc/services/resources/relationship.py
mrR2D2/ggrc-core
f4f92628de4490512fcc9511be28e6cf1b875e14
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
src/ggrc/services/resources/relationship.py
mrR2D2/ggrc-core
f4f92628de4490512fcc9511be28e6cf1b875e14
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
src/ggrc/services/resources/relationship.py
mrR2D2/ggrc-core
f4f92628de4490512fcc9511be28e6cf1b875e14
[ "ECL-2.0", "Apache-2.0" ]
1
2020-02-13T12:32:45.000Z
2020-02-13T12:32:45.000Z
# Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Custom Resource for Relationship that creates Snapshots when needed. When Audit-Snapshottable Relationship is POSTed, a Snapshot should be created instead. """ from werkzeug.exceptions import MethodNotA...
35.653846
78
0.705502
from werkzeug.exceptions import MethodNotAllowed, Forbidden from ggrc.builder import json as json_builder from ggrc import db import ggrc.services.common from ggrc.models.snapshot import Snapshot from ggrc.models import relationship from ggrc.models.mixins.with_readonly_access import WithReadOnlyAccess from ggrc.log...
true
true
f769b12a505966cd0b5fad4e8b9cb11b5f2d5fa4
1,167
py
Python
experiments/RobNet_large_v2_cifar10/config.py
Stonepia/RobNets
195a41f37ff278d7acf2f17543ec51b5f92993fb
[ "MIT" ]
121
2020-04-04T09:18:27.000Z
2022-03-24T10:32:52.000Z
experiments/RobNet_large_v2_cifar10/config.py
Stonepia/RobNets
195a41f37ff278d7acf2f17543ec51b5f92993fb
[ "MIT" ]
17
2020-06-14T02:27:04.000Z
2021-11-06T07:19:29.000Z
experiments/RobNet_large_v2_cifar10/config.py
Stonepia/RobNets
195a41f37ff278d7acf2f17543ec51b5f92993fb
[ "MIT" ]
17
2020-04-14T03:52:27.000Z
2022-03-17T11:06:27.000Z
# Model Params model = 'robnet_large_v2' model_param = dict(C=64, num_classes=10, layers=33, steps=4, multiplier=4, stem_multiplier=3, share=True, AdPoolSize=1) # Dataset Params dataset ...
31.540541
104
0.522708
model = 'robnet_large_v2' model_param = dict(C=64, num_classes=10, layers=33, steps=4, multiplier=4, stem_multiplier=3, share=True, AdPoolSize=1) dataset = 'cifar10' dataset_param = dict...
true
true
f769b17259aeaaa4d286daf5d703466195e01ce5
2,633
py
Python
effect_of_vanishing_photos/effect_of_vanishing_photos.py
gil9red/SimplePyScripts
c191ce08fbdeb29377639184579e392057945154
[ "CC-BY-4.0" ]
117
2015-12-18T07:18:27.000Z
2022-03-28T00:25:54.000Z
effect_of_vanishing_photos/effect_of_vanishing_photos.py
gil9red/SimplePyScripts
c191ce08fbdeb29377639184579e392057945154
[ "CC-BY-4.0" ]
8
2018-10-03T09:38:46.000Z
2021-12-13T19:51:09.000Z
effect_of_vanishing_photos/effect_of_vanishing_photos.py
gil9red/SimplePyScripts
c191ce08fbdeb29377639184579e392057945154
[ "CC-BY-4.0" ]
28
2016-08-02T17:43:47.000Z
2022-03-21T08:31:12.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' """Эффект исчезновения фотографии Кликая на области на фотографии запускаются процессы плавного увеличения прозрачности пикселей, эффект как круги воды, будут расходиться пока не закончатся непрозрачные пиксели""" import sys import traceback ...
22.698276
95
0.63008
__author__ = 'ipetrash' import sys import traceback try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * except: try: from PyQt4.QtGui import * from PyQt4.QtCore import * except: from PySide.QtGui import * from PySide.QtCore...
true
true
f769b184e489da2c4ca1affa940c0abc75aac06a
64,561
py
Python
grr/server/grr_response_server/export_test.py
JiYonG-Lee/grr
57fef67080ac6b8fd3de3ba0adfca064d34b7689
[ "Apache-2.0" ]
1
2020-06-25T14:25:51.000Z
2020-06-25T14:25:51.000Z
grr/server/grr_response_server/export_test.py
JiYonG-Lee/grr
57fef67080ac6b8fd3de3ba0adfca064d34b7689
[ "Apache-2.0" ]
3
2021-05-11T20:18:38.000Z
2022-03-02T09:33:56.000Z
grr/server/grr_response_server/export_test.py
JiYonG-Lee/grr
57fef67080ac6b8fd3de3ba0adfca064d34b7689
[ "Apache-2.0" ]
1
2020-06-25T14:25:54.000Z
2020-06-25T14:25:54.000Z
#!/usr/bin/env python # Lint as: python3 # -*- encoding: utf-8 -*- """Tests for export converters.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import binascii import os import socket from absl import app from absl.testing import absltest from grr_...
39.75431
80
0.702545
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import binascii import os import socket from absl import app from absl.testing import absltest from grr_response_core.lib import queues from grr_response_core.lib import rdfvalue from grr_response_core.lib....
true
true
f769b2087fe07d7dbd08d30c06814ae3caa02060
3,827
py
Python
supervised.py
pranav-dahiya/Twitter
f38d546d2dda69acb03abb2347e316578fc28a38
[ "MIT" ]
1
2020-08-11T06:43:14.000Z
2020-08-11T06:43:14.000Z
supervised.py
pranav-dahiya/Twitter
f38d546d2dda69acb03abb2347e316578fc28a38
[ "MIT" ]
null
null
null
supervised.py
pranav-dahiya/Twitter
f38d546d2dda69acb03abb2347e316578fc28a38
[ "MIT" ]
null
null
null
import pandas as pd import numpy as np from sklearn.svm import SVC, SVR from sklearn.model_selection import cross_validate from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import confusion_matrix from sklearn.metrics import make_scorer def cf_matrix_00(y_true, y_pred): cf_matr = co...
43
122
0.678077
import pandas as pd import numpy as np from sklearn.svm import SVC, SVR from sklearn.model_selection import cross_validate from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import confusion_matrix from sklearn.metrics import make_scorer def cf_matrix_00(y_true, y_pred): cf_matr = co...
true
true
f769b2443459fa33dde1b99618ba5d16bf902318
1,620
py
Python
tests/unit/test_group_wb.py
Machine-Hum/KiField
989509a2418787eff46c78114008a42cecfee842
[ "MIT" ]
null
null
null
tests/unit/test_group_wb.py
Machine-Hum/KiField
989509a2418787eff46c78114008a42cecfee842
[ "MIT" ]
null
null
null
tests/unit/test_group_wb.py
Machine-Hum/KiField
989509a2418787eff46c78114008a42cecfee842
[ "MIT" ]
null
null
null
""" test_group_wb ---------------------------------- Tests for the `kifield.group_wb` function """ import unittest import openpyxl as pyxl import hypothesis import hypothesis.strategies as st from kifield import kifield class TestGroupWb(unittest.TestCase): def test_groups(self): wb = pyxl.Workbook() ...
26.129032
53
0.464815
import unittest import openpyxl as pyxl import hypothesis import hypothesis.strategies as st from kifield import kifield class TestGroupWb(unittest.TestCase): def test_groups(self): wb = pyxl.Workbook() ws = wb.active header = ("Ref", "x", "y", "z") ws.append(header) ws....
true
true
f769b2b76613620366e358cc73c3cfad3a1f8b5e
4,843
py
Python
notebooks/ipynb/preproc.py
lazysimon/learning-apache-spark
7b950ba7c4fe77aa9f2d9ec5e136cea9c7f3e1c1
[ "MIT" ]
258
2017-04-28T09:58:56.000Z
2022-03-19T00:09:41.000Z
notebooks/ipynb/preproc.py
LTHODAVDOPL/learning-apache-spark
017820dec7a4fdadd2bffdfc0025a545a62c5705
[ "MIT" ]
2
2017-11-08T21:27:23.000Z
2017-11-08T21:52:13.000Z
notebooks/ipynb/preproc.py
LTHODAVDOPL/learning-apache-spark
017820dec7a4fdadd2bffdfc0025a545a62c5705
[ "MIT" ]
164
2017-05-23T17:35:11.000Z
2022-03-21T22:46:50.000Z
from nltk.stem.wordnet import WordNetLemmatizer from nltk.corpus import stopwords from nltk import pos_tag import string import re import langid # Convert to float format def string_to_float(x): return float(x) # Use langid module to classify the language to make sure we are applying the correct cleanup actions f...
34.592857
120
0.653108
from nltk.stem.wordnet import WordNetLemmatizer from nltk.corpus import stopwords from nltk import pos_tag import string import re import langid def string_to_float(x): return float(x) def check_lang(data_str): predict_lang = langid.classify(data_str) if predict_lang[1] >= .9: language = predict_l...
true
true
f769b723449c3d7e0fc80fb941ac2078450fff31
6,457
py
Python
evaluation/proc.py
pascscha/hydra
5c301ec9a7a91935f90497558326333afa7b179c
[ "BSD-3-Clause" ]
null
null
null
evaluation/proc.py
pascscha/hydra
5c301ec9a7a91935f90497558326333afa7b179c
[ "BSD-3-Clause" ]
null
null
null
evaluation/proc.py
pascscha/hydra
5c301ec9a7a91935f90497558326333afa7b179c
[ "BSD-3-Clause" ]
null
null
null
import math import os import re import sys exec(open(sys.argv[1], "r").read()) def gen_gnuplot(exp_name, exp_type): f = open("tmp_" + exp_name + "_" + exp_type + ".gnuplot", "w") print("set terminal postscript eps enhanced color size " + plot_config_exp[exp_name]["size"] + " font '" + plot_config_misc["font"]...
50.445313
224
0.516649
import math import os import re import sys exec(open(sys.argv[1], "r").read()) def gen_gnuplot(exp_name, exp_type): f = open("tmp_" + exp_name + "_" + exp_type + ".gnuplot", "w") print("set terminal postscript eps enhanced color size " + plot_config_exp[exp_name]["size"] + " font '" + plot_config_misc["font"]...
true
true
f769b99ac7015c77a917acbefbd14835aaebaac0
28,845
py
Python
b2sdk/transfer/emerge/planner/planner.py
phistrom/b2-sdk-python
b103939cc19020a5f7cae7a6e26f1073b5ba2232
[ "MIT" ]
null
null
null
b2sdk/transfer/emerge/planner/planner.py
phistrom/b2-sdk-python
b103939cc19020a5f7cae7a6e26f1073b5ba2232
[ "MIT" ]
null
null
null
b2sdk/transfer/emerge/planner/planner.py
phistrom/b2-sdk-python
b103939cc19020a5f7cae7a6e26f1073b5ba2232
[ "MIT" ]
null
null
null
###################################################################### # # File: b2sdk/transfer/emerge/planner/planner.py # # Copyright 2020 Backblaze Inc. All Rights Reserved. # # License https://www.backblaze.com/using_b2_code.html # ###################################################################### import hashl...
44.376923
135
0.652245
import hashlib import json from abc import ABCMeta, abstractmethod from collections import deque from itertools import chain import six from b2sdk.transfer.emerge.planner.part_definition import ( CopyEmergePartDefinition, UploadEmergePartDefinition, UploadSubpartsEmergePartDefinition, ) from b2sdk.trans...
true
true
f769b9b0d7b56d51e417ecd1f126600773c8b25a
298
py
Python
test_data/intermediate/expected/interface/basic/meta_model.py
gillistephan/aas-core-codegen
5b89ea2ee35aecaca9a1bed7ac81d420cc560f29
[ "MIT" ]
5
2021-12-29T12:55:34.000Z
2022-03-01T17:57:21.000Z
test_data/intermediate/expected/interface/basic/meta_model.py
gillistephan/aas-core-codegen
5b89ea2ee35aecaca9a1bed7ac81d420cc560f29
[ "MIT" ]
10
2021-12-29T02:15:55.000Z
2022-03-09T11:04:22.000Z
test_data/intermediate/expected/interface/basic/meta_model.py
gillistephan/aas-core-codegen
5b89ea2ee35aecaca9a1bed7ac81d420cc560f29
[ "MIT" ]
2
2021-12-29T01:42:12.000Z
2022-02-15T13:46:33.000Z
@abstract class Abstract: some_property: int @require(lambda some_property: some_property > 0) def __init__(self, some_property: int) -> None: self.some_property = some_property def some_func(self) -> None: pass __book_url__ = "dummy" __book_version__ = "dummy"
19.866667
53
0.684564
@abstract class Abstract: some_property: int @require(lambda some_property: some_property > 0) def __init__(self, some_property: int) -> None: self.some_property = some_property def some_func(self) -> None: pass __book_url__ = "dummy" __book_version__ = "dummy"
true
true
f769b9ca6994f236e06b2c1ff98a05883b7c7e68
2,737
py
Python
fabrikApi/plugins/CIR/views/plots/ARCHIV/beeplot.py
demokratiefabrik/fabrikApi
a56bb57d59a5e7cbbeeb77889c02d82f2a04c682
[ "MIT" ]
null
null
null
fabrikApi/plugins/CIR/views/plots/ARCHIV/beeplot.py
demokratiefabrik/fabrikApi
a56bb57d59a5e7cbbeeb77889c02d82f2a04c682
[ "MIT" ]
null
null
null
fabrikApi/plugins/CIR/views/plots/ARCHIV/beeplot.py
demokratiefabrik/fabrikApi
a56bb57d59a5e7cbbeeb77889c02d82f2a04c682
[ "MIT" ]
null
null
null
from io import StringIO import matplotlib.pyplot as p import numpy as np import pandas as pd import seaborn as s import mplcursors import matplotlib.collections from mpld3 import plugins # %matplotlib widget f = StringIO() # pip install matplotlib seaborn def beeplot(): # dataset # iris2 = pd.DataFrame(np....
30.752809
134
0.588235
from io import StringIO import matplotlib.pyplot as p import numpy as np import pandas as pd import seaborn as s import mplcursors import matplotlib.collections from mpld3 import plugins f = StringIO() def beeplot(): beta = 20 iris = pd.DataFrame(np.random.exponential(beta, 50), columns=['sepal_len...
true
true
f769ba58fb8fb22c94020c812804ba67d26d3c9e
7,589
py
Python
pjproject_android/pjsip-apps/src/py_pjsua/pjsua.py
WachterJud/qaul.net_legacy
9c2be0a38ad6e90fadc0d1150340e37d220997ae
[ "MIT", "BSD-2-Clause", "BSD-3-Clause" ]
4
2016-09-29T00:04:31.000Z
2021-12-02T08:39:51.000Z
pjproject_android/pjsip-apps/src/py_pjsua/pjsua.py
WachterJud/qaul.net_legacy
9c2be0a38ad6e90fadc0d1150340e37d220997ae
[ "MIT", "BSD-2-Clause", "BSD-3-Clause" ]
1
2020-02-20T06:58:16.000Z
2020-02-20T07:08:07.000Z
my_softphone/pjproject-2.9/pjsip-apps/src/py_pjsua/pjsua.py
sashkaseltsov1/reposCpp
3ff5ce2a14a368a36b1758099ce4f3e8c4cdf11d
[ "Unlicense" ]
5
2019-07-02T02:03:24.000Z
2022-03-30T09:58:52.000Z
import py_pjsua status = py_pjsua.create() print "py status " + `status` # # Create configuration objects # ua_cfg = py_pjsua.config_default() log_cfg = py_pjsua.logging_config_default() media_cfg = py_pjsua.media_config_default() # # Logging callback. # def logging_cb1(level, str, len): print str, # # Config...
28.637736
92
0.716036
import py_pjsua status = py_pjsua.create() print "py status " + `status` ua_cfg = py_pjsua.config_default() log_cfg = py_pjsua.logging_config_default() media_cfg = py_pjsua.media_config_default() def logging_cb1(level, str, len): print str, log_cfg.cb = logging_cb1 log_cfg.console_level = 4 status = py_pjsua...
false
true
f769bb2255ee0521a670e25b3f07f987f2e9b3ce
40,149
py
Python
gamestonk_terminal/cryptocurrency/technical_analysis/ta_controller.py
i2infinity/GamestonkTerminal
abf79a5249930e5a9f5d2a1c4ba64590888ecef5
[ "MIT" ]
null
null
null
gamestonk_terminal/cryptocurrency/technical_analysis/ta_controller.py
i2infinity/GamestonkTerminal
abf79a5249930e5a9f5d2a1c4ba64590888ecef5
[ "MIT" ]
null
null
null
gamestonk_terminal/cryptocurrency/technical_analysis/ta_controller.py
i2infinity/GamestonkTerminal
abf79a5249930e5a9f5d2a1c4ba64590888ecef5
[ "MIT" ]
null
null
null
"""Crypto Technical Analysis Controller Module""" __docformat__ = "numpy" # pylint:disable=too-many-lines import argparse import difflib from typing import List, Union from datetime import datetime from colorama import Style import pandas as pd from prompt_toolkit.completion import NestedCompleter from gamestonk_ter...
33.823926
117
0.543326
__docformat__ = "numpy" import argparse import difflib from typing import List, Union from datetime import datetime from colorama import Style import pandas as pd from prompt_toolkit.completion import NestedCompleter from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import ( ...
true
true
f769bb69bd559080f7cd565f1cdc33f8b85991de
2,997
py
Python
argtypes.py
CallumCameron/argtypes
4ac2caa5ddc57fa7a75feb252da5f6c0a4c8b9ba
[ "BSD-3-Clause" ]
null
null
null
argtypes.py
CallumCameron/argtypes
4ac2caa5ddc57fa7a75feb252da5f6c0a4c8b9ba
[ "BSD-3-Clause" ]
null
null
null
argtypes.py
CallumCameron/argtypes
4ac2caa5ddc57fa7a75feb252da5f6c0a4c8b9ba
[ "BSD-3-Clause" ]
null
null
null
"""Helper functions for the 'type' argument of argparse's add_argument method.""" import argparse import pytimeparse.timeparse import os.path class IntCmp(object): """Check that arg is an integer satisfying a condition""" def __init__(self, val, description): super(IntCmp, self).__init__() sel...
30.581633
112
0.644311
import argparse import pytimeparse.timeparse import os.path class IntCmp(object): def __init__(self, val, description): super(IntCmp, self).__init__() self.val = int(val) self.description = description def valid(self, arg): raise NotImplementedError def __call__(self, arg...
true
true
f769bcdc91ba7066273053dda1a9b3148418c5a1
7,233
py
Python
litex/build/gowin/gowin.py
motec-research/litex
0bd2abf68d3047e9bba09604b99b9019b02084fd
[ "ADSL" ]
1
2021-12-25T13:49:55.000Z
2021-12-25T13:49:55.000Z
litex/build/gowin/gowin.py
motec-research/litex
0bd2abf68d3047e9bba09604b99b9019b02084fd
[ "ADSL" ]
null
null
null
litex/build/gowin/gowin.py
motec-research/litex
0bd2abf68d3047e9bba09604b99b9019b02084fd
[ "ADSL" ]
1
2021-12-25T13:49:57.000Z
2021-12-25T13:49:57.000Z
# # This file is part of LiteX. # # Copyright (c) 2020 Pepijn de Vos <pepijndevos@gmail.com> # Copyright (c) 2015-2018 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause import os import sys import math import subprocess from shutil import which, copyfile from migen.fhdl.structure im...
35.985075
128
0.569197
import os import sys import math import subprocess from shutil import which, copyfile from migen.fhdl.structure import _Fragment from litex.build.generic_platform import * from litex.build import tools def _build_cst(named_sc, named_pc): cst = [] flat_sc = [] for name, pins, other, resource in named_s...
true
true
f769bd78b70970bf8100e604a86593d02083f6bb
7,729
py
Python
tests/test_cortex_model.py
sina-moammar/2021-neuroscience-project
6e7fa52e0496361d20253945633edaab79734e0b
[ "MIT" ]
null
null
null
tests/test_cortex_model.py
sina-moammar/2021-neuroscience-project
6e7fa52e0496361d20253945633edaab79734e0b
[ "MIT" ]
8
2021-12-24T09:00:32.000Z
2022-01-29T18:06:01.000Z
tests/test_cortex_model.py
sina-moammar/2021-neuroscience-project
6e7fa52e0496361d20253945633edaab79734e0b
[ "MIT" ]
null
null
null
import numpy as np import networkit as nk from collections import defaultdict from typing import Dict import pytest from cortex_model import cortex_model def default_params() -> Dict[str, any]: size = 4 graph = nk.graph.Graph(size, directed=True) graph.addEdge(0, 1) graph.addEdge(0, 2) graph.addE...
34.048458
110
0.620132
import numpy as np import networkit as nk from collections import defaultdict from typing import Dict import pytest from cortex_model import cortex_model def default_params() -> Dict[str, any]: size = 4 graph = nk.graph.Graph(size, directed=True) graph.addEdge(0, 1) graph.addEdge(0, 2) graph.addE...
true
true
f769bf35bc05d13f84bceab117a38ab631f0b720
7,654
py
Python
tests/__init__.py
keymanapp/sentry-native
d0b34d9000398cf9d4ea057de616aaac2e5f58e8
[ "MIT" ]
1
2020-09-17T17:26:12.000Z
2020-09-17T17:26:12.000Z
tests/__init__.py
keymanapp/sentry-native
d0b34d9000398cf9d4ea057de616aaac2e5f58e8
[ "MIT" ]
null
null
null
tests/__init__.py
keymanapp/sentry-native
d0b34d9000398cf9d4ea057de616aaac2e5f58e8
[ "MIT" ]
null
null
null
import subprocess import os import io import json import sys import urllib import pytest # https://docs.pytest.org/en/latest/assert.html#assert-details pytest.register_assert_rewrite("tests.assertions") def make_dsn(httpserver, auth="uiaeosnrtdy", id=123456): url = urllib.parse.urlsplit(httpserver.url_for("/{}"...
30.373016
137
0.557748
import subprocess import os import io import json import sys import urllib import pytest pytest.register_assert_rewrite("tests.assertions") def make_dsn(httpserver, auth="uiaeosnrtdy", id=123456): url = urllib.parse.urlsplit(httpserver.url_for("/{}".format(id))) return urllib.parse.urlunsplit( ( ...
true
true
f769bfe2a000412198e7c4a3573f3e0446343719
6,774
py
Python
accelbyte_py_sdk/api/iam/operations/clients/delete_client_by_namespace.py
AccelByte/accelbyte-python-sdk
dcd311fad111c59da828278975340fb92e0f26f7
[ "MIT" ]
null
null
null
accelbyte_py_sdk/api/iam/operations/clients/delete_client_by_namespace.py
AccelByte/accelbyte-python-sdk
dcd311fad111c59da828278975340fb92e0f26f7
[ "MIT" ]
1
2021-10-13T03:46:58.000Z
2021-10-13T03:46:58.000Z
accelbyte_py_sdk/api/iam/operations/clients/delete_client_by_namespace.py
AccelByte/accelbyte-python-sdk
dcd311fad111c59da828278975340fb92e0f26f7
[ "MIT" ]
null
null
null
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # # Code generated. DO NOT EDIT! # template file: justice_py_sdk_codegen/__main__.py # pylint: disable=duplicate-code # pylint: disable=li...
27.991736
120
0.621494
from __future__ import annotations from typing import Any, Dict, List, Optional, Tuple, Union from .....core import Operation from .....core import HeaderStr from .....core import HttpResponse class DeleteClientByNamespace(Operation): _url: str = "/iam/namespaces/{namespace}/clients/{clientId}" _me...
true
true
f769c08a512ef97dc6bef595035bc5aea1d44d28
6,814
py
Python
env/Lib/site-packages/pandas/tests/series/methods/test_isin.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
8a4707301d19c3826c31026c4077930bcd6a8182
[ "MIT" ]
28,899
2016-10-13T03:32:12.000Z
2022-03-31T21:39:05.000Z
env/Lib/site-packages/pandas/tests/series/methods/test_isin.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
8a4707301d19c3826c31026c4077930bcd6a8182
[ "MIT" ]
31,004
2016-10-12T23:22:27.000Z
2022-03-31T23:17:38.000Z
env/Lib/site-packages/pandas/tests/series/methods/test_isin.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
8a4707301d19c3826c31026c4077930bcd6a8182
[ "MIT" ]
15,149
2016-10-13T03:21:31.000Z
2022-03-31T18:46:47.000Z
import numpy as np import pytest import pandas as pd from pandas import ( Series, date_range, ) import pandas._testing as tm from pandas.core.arrays import PeriodArray class TestSeriesIsIn: def test_isin(self): s = Series(["A", "B", "C", "a", "B", "B", "A", "C"]) result = s.isin(["A", "C...
33.401961
86
0.589228
import numpy as np import pytest import pandas as pd from pandas import ( Series, date_range, ) import pandas._testing as tm from pandas.core.arrays import PeriodArray class TestSeriesIsIn: def test_isin(self): s = Series(["A", "B", "C", "a", "B", "B", "A", "C"]) result = s.isin(["A", "C...
true
true
f769c0af20443699d19a702b6492fbe210ee7eeb
474
py
Python
data/scripts/templates/object/draft_schematic/bio_engineer/dna_template/shared_dna_template_angler.py
obi-two/GameServer
7d37024e2291a97d49522610cd8f1dbe5666afc2
[ "MIT" ]
20
2015-02-23T15:11:56.000Z
2022-03-18T20:56:48.000Z
data/scripts/templates/object/draft_schematic/bio_engineer/dna_template/shared_dna_template_angler.py
apathyboy/swganh
665128efe9154611dec4cb5efc61d246dd095984
[ "MIT" ]
null
null
null
data/scripts/templates/object/draft_schematic/bio_engineer/dna_template/shared_dna_template_angler.py
apathyboy/swganh
665128efe9154611dec4cb5efc61d246dd095984
[ "MIT" ]
20
2015-04-04T16:35:59.000Z
2022-03-24T14:54:37.000Z
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/bio_engineer/dna_template/shared_dna_template_angler.iff" ...
27.882353
100
0.740506
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/bio_engineer/dna_template/shared_dna_template_angler.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") return result
true
true
f769c15c8ab336f61e3e912b636ac26c72ba9e77
1,230
py
Python
src/kvt/models/layers/pooling.py
Ynakatsuka/birdclef-2021
d7cf7b39e3164a75547ee50cc9a29bd5ed4c29bd
[ "BSD-2-Clause" ]
6
2021-06-02T01:40:27.000Z
2022-03-04T05:00:52.000Z
src/kvt/models/layers/pooling.py
Ynakatsuka/birdclef-2021
d7cf7b39e3164a75547ee50cc9a29bd5ed4c29bd
[ "BSD-2-Clause" ]
null
null
null
src/kvt/models/layers/pooling.py
Ynakatsuka/birdclef-2021
d7cf7b39e3164a75547ee50cc9a29bd5ed4c29bd
[ "BSD-2-Clause" ]
null
null
null
import torch from torch import nn from torch.nn import functional as F from torch.nn.parameter import Parameter AdaptiveAvgPool2d = nn.AdaptiveAvgPool2d class AdaptiveConcatPool2d(nn.Module): def __init__(self, sz=None): super().__init__() sz = sz or (1, 1) self.ap = nn.AdaptiveAvgPool2d(...
25.625
87
0.54878
import torch from torch import nn from torch.nn import functional as F from torch.nn.parameter import Parameter AdaptiveAvgPool2d = nn.AdaptiveAvgPool2d class AdaptiveConcatPool2d(nn.Module): def __init__(self, sz=None): super().__init__() sz = sz or (1, 1) self.ap = nn.AdaptiveAvgPool2d(...
true
true
f769c179dc4e7b113f7a7e8e2ed42a32988fc0a5
2,663
py
Python
tests/test_nestedscopes.py
ApoorvGuptaAi/pylint-protobuf
2d8d8041f238c0cbb7c4bafe3e372581ddfad8f3
[ "MIT" ]
null
null
null
tests/test_nestedscopes.py
ApoorvGuptaAi/pylint-protobuf
2d8d8041f238c0cbb7c4bafe3e372581ddfad8f3
[ "MIT" ]
null
null
null
tests/test_nestedscopes.py
ApoorvGuptaAi/pylint-protobuf
2d8d8041f238c0cbb7c4bafe3e372581ddfad8f3
[ "MIT" ]
null
null
null
import pytest import astroid import pylint.testutils import pylint_protobuf class TestNestedScopes(pylint.testutils.CheckerTestCase): CHECKER_CLASS = pylint_protobuf.ProtobufDescriptorChecker @pytest.mark.xfail(reason='scope and modules overwrite so last wins') def test_many_imports_no_aliasing(self): ...
32.47561
79
0.604581
import pytest import astroid import pylint.testutils import pylint_protobuf class TestNestedScopes(pylint.testutils.CheckerTestCase): CHECKER_CLASS = pylint_protobuf.ProtobufDescriptorChecker @pytest.mark.xfail(reason='scope and modules overwrite so last wins') def test_many_imports_no_aliasing(self): ...
true
true
f769c33b45e27521fc81dd8ff2bdb94d03932934
536
py
Python
img_roi.py
jfindleyderegt/au_trap
cc1d6a4001adb44a73cc64124c0853e6d899b1ba
[ "CC0-1.0" ]
null
null
null
img_roi.py
jfindleyderegt/au_trap
cc1d6a4001adb44a73cc64124c0853e6d899b1ba
[ "CC0-1.0" ]
null
null
null
img_roi.py
jfindleyderegt/au_trap
cc1d6a4001adb44a73cc64124c0853e6d899b1ba
[ "CC0-1.0" ]
null
null
null
import os, glob, cv2 import numpy import pylab path = '/home/faedrus/Documents/au_trap/20141027/' listing = os.listdir(path) listing = sorted (listing) count = 0 img = 0 amount = 0 for im_file in listing: new = cv2.imread(path+im_file) img = cv2.add(new, img) count += 1 if count > 9: amount...
20.615385
75
0.63806
import os, glob, cv2 import numpy import pylab path = '/home/faedrus/Documents/au_trap/20141027/' listing = os.listdir(path) listing = sorted (listing) count = 0 img = 0 amount = 0 for im_file in listing: new = cv2.imread(path+im_file) img = cv2.add(new, img) count += 1 if count > 9: amount...
false
true
f769c3a5c0583b075f63fd31bb5bdcfa195b00e3
890
py
Python
donor/migrations/0017_auto_20210404_0751.py
witty-technologies-empowerment/codeupblood
a0aa1725e5776d80e083b6d4e9e67476bb97e983
[ "MIT" ]
null
null
null
donor/migrations/0017_auto_20210404_0751.py
witty-technologies-empowerment/codeupblood
a0aa1725e5776d80e083b6d4e9e67476bb97e983
[ "MIT" ]
null
null
null
donor/migrations/0017_auto_20210404_0751.py
witty-technologies-empowerment/codeupblood
a0aa1725e5776d80e083b6d4e9e67476bb97e983
[ "MIT" ]
1
2022-01-19T11:09:13.000Z
2022-01-19T11:09:13.000Z
# Generated by Django 3.1.6 on 2021-04-04 14:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('donor', '0016_auto_20210403_1440'), ] operations = [ migrations.CreateModel( name='NewDonor', fields=[ ...
28.709677
114
0.541573
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('donor', '0016_auto_20210403_1440'), ] operations = [ migrations.CreateModel( name='NewDonor', fields=[ ('id', models.AutoField(auto_created=True, pr...
true
true
f769c451d9cb241129efe772a9d32e28bcf08658
944
py
Python
isi_sdk_8_1_1/test/test_worm_settings_extended.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
24
2018-06-22T14:13:23.000Z
2022-03-23T01:21:26.000Z
isi_sdk_8_1_1/test/test_worm_settings_extended.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
46
2018-04-30T13:28:22.000Z
2022-03-21T21:11:07.000Z
isi_sdk_8_1_1/test/test_worm_settings_extended.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
29
2018-06-19T00:14:04.000Z
2022-02-08T17:51:19.000Z
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 6 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_8_1_1 from i...
23.02439
98
0.71822
from __future__ import absolute_import import unittest import isi_sdk_8_1_1 from isi_sdk_8_1_1.models.worm_settings_extended import WormSettingsExtended from isi_sdk_8_1_1.rest import ApiException class TestWormSettingsExtended(unittest.TestCase): def setUp(self): pass def tearDown(self): ...
true
true
f769c56de5d2e8ef612bb3085aa87e5f2d9f3e6b
3,971
py
Python
ucsmsdk/mometa/cloud/CloudDeviceConnectorEp.py
Kego/ucsmsdk
244f283a5c295cf746110bb96686d079b19927ce
[ "Apache-2.0" ]
78
2015-11-30T14:10:05.000Z
2022-02-13T00:29:08.000Z
ucsmsdk/mometa/cloud/CloudDeviceConnectorEp.py
Kego/ucsmsdk
244f283a5c295cf746110bb96686d079b19927ce
[ "Apache-2.0" ]
113
2015-11-20T09:42:46.000Z
2022-03-16T16:53:29.000Z
ucsmsdk/mometa/cloud/CloudDeviceConnectorEp.py
Kego/ucsmsdk
244f283a5c295cf746110bb96686d079b19927ce
[ "Apache-2.0" ]
86
2015-12-12T08:22:18.000Z
2022-01-23T03:56:34.000Z
"""This module contains the general information for CloudDeviceConnectorEp ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class CloudDeviceConnectorEpConsts: CLAIM_STATE_CLAIMED = "claimed" CLAIM_STATE_NONE = "none" ...
56.728571
247
0.65097
from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class CloudDeviceConnectorEpConsts: CLAIM_STATE_CLAIMED = "claimed" CLAIM_STATE_NONE = "none" CLAIM_STATE_UNCLAIMED = "unclaimed" INT_ID_NONE = "none" POLICY_OWNER_LOCAL = "loca...
true
true
f769c61e855dcfab79ed99378a8d659b2aafd3b4
7,485
py
Python
hotspot/code/localization.py
FudanYuan/faultLocalization
5133ee5af48f7d4c8ba05ef9a545139a38f417da
[ "Apache-2.0" ]
13
2019-03-13T06:07:18.000Z
2022-02-22T03:34:35.000Z
hotspot/code/localization.py
FudanYuan/faultLocalization
5133ee5af48f7d4c8ba05ef9a545139a38f417da
[ "Apache-2.0" ]
null
null
null
hotspot/code/localization.py
FudanYuan/faultLocalization
5133ee5af48f7d4c8ba05ef9a545139a38f417da
[ "Apache-2.0" ]
4
2019-03-13T06:07:32.000Z
2019-06-11T11:35:52.000Z
## coding: utf-8 import pandas as pd import numpy as np import time import math from tqdm import tqdm import matplotlib.pyplot as plt from package.utils import KPIPoint from package.utils import KPISet from package.utils import Transformer from package.HotSpot import HotSpot def valid(): #### 加载数据集 # kSet_pre...
31.317992
115
0.602806
import pandas as pd import numpy as np import time import math from tqdm import tqdm import matplotlib.pyplot as plt from package.utils import KPIPoint from package.utils import KPISet from package.utils import Transformer from package.HotSpot import HotSpot def valid(): timestamp_start =...
true
true
f769c74510dec64d29e3fc116de853829130e82a
233
py
Python
sparkdq/repairs/transformers/complex_repairers/ComplexRepairer.py
PasaLab/SparkDQ
16d50210747ef7de03cf36d689ce26ff7445f63a
[ "Apache-2.0" ]
1
2021-02-08T07:49:54.000Z
2021-02-08T07:49:54.000Z
sparkdq/repairs/transformers/complex_repairers/ComplexRepairer.py
PasaLab/SparkDQ
16d50210747ef7de03cf36d689ce26ff7445f63a
[ "Apache-2.0" ]
null
null
null
sparkdq/repairs/transformers/complex_repairers/ComplexRepairer.py
PasaLab/SparkDQ
16d50210747ef7de03cf36d689ce26ff7445f63a
[ "Apache-2.0" ]
null
null
null
from abc import abstractmethod from sparkdq.repairs.transformers.Transformer import Transformer class ComplexRepairer(Transformer): @abstractmethod def transform(self, data, state_provider=None, check=True): pass
21.181818
64
0.776824
from abc import abstractmethod from sparkdq.repairs.transformers.Transformer import Transformer class ComplexRepairer(Transformer): @abstractmethod def transform(self, data, state_provider=None, check=True): pass
true
true
f769c809128f5206eb08fdc84b0bcf502a7754fd
1,769
py
Python
loss/triplet.py
SerafinH/triplet_loss_kws
a203f6063517fd5236c9df9ce28318fec7afb141
[ "MIT" ]
36
2021-02-09T05:38:02.000Z
2022-01-20T12:54:00.000Z
loss/triplet.py
SerafinH/triplet_loss_kws
a203f6063517fd5236c9df9ce28318fec7afb141
[ "MIT" ]
6
2021-02-08T06:43:06.000Z
2021-10-02T15:30:34.000Z
loss/triplet.py
SerafinH/triplet_loss_kws
a203f6063517fd5236c9df9ce28318fec7afb141
[ "MIT" ]
5
2021-03-11T06:01:32.000Z
2021-08-17T11:19:02.000Z
import torch import torch.nn.functional as F from nemo.backends.pytorch.nm import LossNM from nemo.core.neural_types import * from nemo.utils.decorators import add_port_docs class OnlineTripletLoss(LossNM): """ Online Triplet loss Takes a batch of embeddings and corresponding labels. Triplets are gene...
32.163636
111
0.644432
import torch import torch.nn.functional as F from nemo.backends.pytorch.nm import LossNM from nemo.core.neural_types import * from nemo.utils.decorators import add_port_docs class OnlineTripletLoss(LossNM): @property @add_port_docs() def input_ports(self): return { "embeds": NeuralTyp...
true
true