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
1c09fb2fe22b1654eff94a1a5e7ddbff1aaf78dd
20,194
py
Python
napari/layers/labels/labels.py
arokem/napari
e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd
[ "BSD-3-Clause" ]
null
null
null
napari/layers/labels/labels.py
arokem/napari
e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd
[ "BSD-3-Clause" ]
1
2019-09-18T22:59:55.000Z
2019-09-23T16:41:08.000Z
napari/layers/labels/labels.py
arokem/napari
e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd
[ "BSD-3-Clause" ]
null
null
null
from typing import Union import warnings import numpy as np from copy import copy from scipy import ndimage as ndi from xml.etree.ElementTree import Element from base64 import b64encode from imageio import imwrite from ..base import Layer from ...util.colormaps import colormaps from ...util.event import Event from ......
33.939496
79
0.587006
from typing import Union import warnings import numpy as np from copy import copy from scipy import ndimage as ndi from xml.etree.ElementTree import Element from base64 import b64encode from imageio import imwrite from ..base import Layer from ...util.colormaps import colormaps from ...util.event import Event from ......
true
true
1c09fb39166c096702c71269f76652050c309e63
2,871
py
Python
py/testdir_0xdata_only/test_hdfs_cdh3_fvec.py
vkuznet/h2o
e08f7014f228cbaecfb21f57379970e6a3ac0756
[ "Apache-2.0" ]
null
null
null
py/testdir_0xdata_only/test_hdfs_cdh3_fvec.py
vkuznet/h2o
e08f7014f228cbaecfb21f57379970e6a3ac0756
[ "Apache-2.0" ]
null
null
null
py/testdir_0xdata_only/test_hdfs_cdh3_fvec.py
vkuznet/h2o
e08f7014f228cbaecfb21f57379970e6a3ac0756
[ "Apache-2.0" ]
null
null
null
import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): # assume we're at 0xdata with it's h...
36.341772
115
0.586904
import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): global localhost loc...
false
true
1c09fd8a7b55ce1df2955cbae44681a9946f7bd1
5,456
py
Python
Accounts/backend.py
Shreya549/AchieveVIT
4623f80a4e38914f2d759fc0c3591bd642486a5b
[ "MIT" ]
3
2020-08-29T20:23:27.000Z
2021-05-20T05:44:01.000Z
Accounts/backend.py
Shreya549/AchieveVIT
4623f80a4e38914f2d759fc0c3591bd642486a5b
[ "MIT" ]
1
2020-09-29T16:28:24.000Z
2020-09-29T16:28:24.000Z
Accounts/backend.py
Shreya549/AchieveVIT
4623f80a4e38914f2d759fc0c3591bd642486a5b
[ "MIT" ]
null
null
null
import jwt from django.conf import settings from rest_framework import authentication, exceptions from .models import Faculty, HR class JWTFacultyAuthentication(authentication.BaseAuthentication): authentication_header_prefix = 'Token' def authenticate(self, request): request.user = None ...
40.414815
82
0.620784
import jwt from django.conf import settings from rest_framework import authentication, exceptions from .models import Faculty, HR class JWTFacultyAuthentication(authentication.BaseAuthentication): authentication_header_prefix = 'Token' def authenticate(self, request): request.user = None ...
true
true
1c09fd8baaecb0ab720c8a5ea0f982067032e5c3
2,276
py
Python
tests/test_finding.py
SweetIQ/warmongo
062fcc345751a419660d055c44b17804d8bb2682
[ "Apache-2.0" ]
9
2015-02-24T04:46:34.000Z
2018-06-21T10:39:18.000Z
tests/test_finding.py
SweetIQ/warmongo
062fcc345751a419660d055c44b17804d8bb2682
[ "Apache-2.0" ]
null
null
null
tests/test_finding.py
SweetIQ/warmongo
062fcc345751a419660d055c44b17804d8bb2682
[ "Apache-2.0" ]
null
null
null
import unittest import warmongo class TestFinding(unittest.TestCase): def setUp(self): self.schema = { 'name': 'Country', 'properties': { 'name': {'type': 'string'}, 'abbreviation': {'type': 'string'}, 'languages': { ...
28.810127
71
0.532953
import unittest import warmongo class TestFinding(unittest.TestCase): def setUp(self): self.schema = { 'name': 'Country', 'properties': { 'name': {'type': 'string'}, 'abbreviation': {'type': 'string'}, 'languages': { ...
true
true
1c09fed63bb420f652ed38db151d104fd5ce3e87
6,906
py
Python
official/vision/beta/ops/mask_ops.py
thortom/models
57e263422b51032b424efd50e0501001052ea083
[ "Apache-2.0" ]
1
2020-09-23T05:56:17.000Z
2020-09-23T05:56:17.000Z
official/vision/beta/ops/mask_ops.py
thortom/models
57e263422b51032b424efd50e0501001052ea083
[ "Apache-2.0" ]
null
null
null
official/vision/beta/ops/mask_ops.py
thortom/models
57e263422b51032b424efd50e0501001052ea083
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
36.157068
137
0.630032
import math from cvx2 import latest as cv2 import numpy as np def paste_instance_masks(masks, detected_boxes, image_height, image_width): def expand_boxes(boxes, scale): w_half = boxes[:, 2] * .5 h_half = boxes[:, 3] * ...
true
true
1c09ff181fa12364e2749f9f4e422e9f7b862bb5
2,307
py
Python
Deney01KP.py
rafetdurgut/RL_TL
9a07b95b87fe02b7195dccdaf05073254cd3c1a8
[ "MIT" ]
null
null
null
Deney01KP.py
rafetdurgut/RL_TL
9a07b95b87fe02b7195dccdaf05073254cd3c1a8
[ "MIT" ]
null
null
null
Deney01KP.py
rafetdurgut/RL_TL
9a07b95b87fe02b7195dccdaf05073254cd3c1a8
[ "MIT" ]
null
null
null
from itertools import product from Problem import * from Operators import * from BinaryABC import BinaryABC from AOS import * from Utilities import Log import sys c = {"Method": "average", "W": 5, "Pmin": 0.1, "Alpha": 0.9} # c=dict() # c["Method"] = sys.argv[1] # c["W"] = int(sys.argv[2]) # c["Pmin"] = float(sys.argv[...
50.152174
121
0.643693
from itertools import product from Problem import * from Operators import * from BinaryABC import BinaryABC from AOS import * from Utilities import Log import sys c = {"Method": "average", "W": 5, "Pmin": 0.1, "Alpha": 0.9} problem = ZeroOneKnapsack('Data/01KP', 6) runtime = 2 operator_pool = [disABC(0.9, 0.1), ibinAB...
true
true
1c09ff48fea61f037769780b1446bd565e7f6d78
916
py
Python
blog/feeds.py
tsuyukimakoto/djblogkit
40e7d825fbbdd128ed5684c1027f72c4fb4538cd
[ "BSD-3-Clause" ]
null
null
null
blog/feeds.py
tsuyukimakoto/djblogkit
40e7d825fbbdd128ed5684c1027f72c4fb4538cd
[ "BSD-3-Clause" ]
null
null
null
blog/feeds.py
tsuyukimakoto/djblogkit
40e7d825fbbdd128ed5684c1027f72c4fb4538cd
[ "BSD-3-Clause" ]
null
null
null
# -*- encoding: utf8 -*- import re from django.conf import settings from django.contrib.syndication.feeds import Feed from djblogkit.blog.models import Entry class DjblogkitRss(Feed): title = settings.BLOG_TITLE link = settings.BLOG_BASE description = u"DjangoやらPloneやらJavaやら湘南やらのお話です。" tag = '' d...
27.757576
122
0.674672
import re from django.conf import settings from django.contrib.syndication.feeds import Feed from djblogkit.blog.models import Entry class DjblogkitRss(Feed): title = settings.BLOG_TITLE link = settings.BLOG_BASE description = u"DjangoやらPloneやらJavaやら湘南やらのお話です。" tag = '' def items(self): i...
true
true
1c09ff8eef89a36f46c159c02e45b6cb8d063973
1,841
py
Python
tests/test_02_actions/test_echo.py
primal100/aionetworking
a29cbb022cbae1a4ad1c3d44327e9d0b0c930227
[ "MIT" ]
null
null
null
tests/test_02_actions/test_echo.py
primal100/aionetworking
a29cbb022cbae1a4ad1c3d44327e9d0b0c930227
[ "MIT" ]
1
2018-12-23T00:50:33.000Z
2018-12-23T00:50:33.000Z
tests/test_02_actions/test_echo.py
primal100/aionetworking
a29cbb022cbae1a4ad1c3d44327e9d0b0c930227
[ "MIT" ]
null
null
null
import pytest # noinspection PyPackageRequirements import json from aionetworking.actions.echo import InvalidRequestError from aionetworking.utils import aone class TestEcho: @pytest.mark.asyncio async def test_00_do_one(self, echo_action, echo_request_object, echo_response): response = await echo_...
44.902439
112
0.740359
import pytest import json from aionetworking.actions.echo import InvalidRequestError from aionetworking.utils import aone class TestEcho: @pytest.mark.asyncio async def test_00_do_one(self, echo_action, echo_request_object, echo_response): response = await echo_action.do_one(echo_request_object) ...
true
true
1c0a0003c44de72cbd1ff3024f096574280f0d72
80
py
Python
server/flask/app/__init__.py
JeanExtreme002/Keylogger
bcb568818ca2c71f9cc1663d3858906ac660e778
[ "BSD-3-Clause" ]
4
2020-02-09T20:29:43.000Z
2021-11-08T08:48:05.000Z
server/flask/app/__init__.py
JeanExtreme002/Keylogger
bcb568818ca2c71f9cc1663d3858906ac660e778
[ "BSD-3-Clause" ]
null
null
null
server/flask/app/__init__.py
JeanExtreme002/Keylogger
bcb568818ca2c71f9cc1663d3858906ac660e778
[ "BSD-3-Clause" ]
null
null
null
from flask import Flask server = Flask(__name__) from app.controller import *
13.333333
28
0.775
from flask import Flask server = Flask(__name__) from app.controller import *
true
true
1c0a00f47219fd4c0d36aa3cdc6dbefa1aef41f6
522
py
Python
pyro/optim/__init__.py
ashishfarmer/pyro
54d48627a7c5c0575c2fe69d5b6c80f3c47b287b
[ "Apache-2.0" ]
2
2020-06-05T20:40:50.000Z
2020-09-05T15:39:48.000Z
pyro/optim/__init__.py
ashishfarmer/pyro
54d48627a7c5c0575c2fe69d5b6c80f3c47b287b
[ "Apache-2.0" ]
null
null
null
pyro/optim/__init__.py
ashishfarmer/pyro
54d48627a7c5c0575c2fe69d5b6c80f3c47b287b
[ "Apache-2.0" ]
1
2020-06-04T18:25:38.000Z
2020-06-04T18:25:38.000Z
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import pyro.optim.multi # noqa F403 from pyro.optim.lr_scheduler import PyroLRScheduler from pyro.optim.optim import AdagradRMSProp, ClippedAdam, DCTAdam, PyroOptim from pyro.optim.pytorch_optimizers import * # noqa F403 from pyr...
29
76
0.766284
import pyro.optim.multi from pyro.optim.lr_scheduler import PyroLRScheduler from pyro.optim.optim import AdagradRMSProp, ClippedAdam, DCTAdam, PyroOptim from pyro.optim.pytorch_optimizers import * from pyro.optim.pytorch_optimizers import __all__ as pytorch_optims __all__ = [ "AdagradRMSProp", "ClippedAdam"...
true
true
1c0a018b277c9c71fcc054388ec74257e7f0e690
1,957
py
Python
examples/example_gui.py
eager-dev/eagerx_gui
d7f4a0b4ac8604e6c61f213e1ab98626c5ef5dc0
[ "Apache-2.0" ]
1
2022-03-24T10:32:16.000Z
2022-03-24T10:32:16.000Z
examples/example_gui.py
eager-dev/eagerx_gui
d7f4a0b4ac8604e6c61f213e1ab98626c5ef5dc0
[ "Apache-2.0" ]
1
2022-03-29T14:19:27.000Z
2022-03-29T14:19:27.000Z
examples/example_gui.py
eager-dev/eagerx_gui
d7f4a0b4ac8604e6c61f213e1ab98626c5ef5dc0
[ "Apache-2.0" ]
null
null
null
# EAGERx imports import eagerx from eagerx.core.graph import Graph # Implementation specific import eagerx.bridges.openai_gym as eagerx_gym import eagerx.nodes if __name__ == "__main__": roscore = eagerx.initialize( "eagerx_core", anonymous=True, log_level=eagerx.log.INFO ) # Define rate (depends...
27.957143
99
0.620337
import eagerx from eagerx.core.graph import Graph import eagerx.bridges.openai_gym as eagerx_gym import eagerx.nodes if __name__ == "__main__": roscore = eagerx.initialize( "eagerx_core", anonymous=True, log_level=eagerx.log.INFO ) rate = 20 gym_id = "Acrobot-v1" name = gym_id.s...
true
true
1c0a019d092eeb4a268cf42a3fb10f936cc87a82
922
py
Python
Python-4-everyone/Exercises/Cap3/two.py
Daniel1404/Python-basic-problems
7a53eb5788d3c939bb6c698f7d4e814fd3c6c3fc
[ "MIT" ]
1
2020-12-02T05:03:40.000Z
2020-12-02T05:03:40.000Z
Python-4-everyone/Exercises/Cap3/two.py
Daniel1404/Python-basic-problems
7a53eb5788d3c939bb6c698f7d4e814fd3c6c3fc
[ "MIT" ]
null
null
null
Python-4-everyone/Exercises/Cap3/two.py
Daniel1404/Python-basic-problems
7a53eb5788d3c939bb6c698f7d4e814fd3c6c3fc
[ "MIT" ]
null
null
null
""" Program that returns a grade from a score from 0, to 1. The scale is: >= 0.9 A >= 0.8 B >= 0.7 C >= 0.6 D < 0.6 F """ class Score: def __init__(self, score): self.score = score def get_grade(self): try: correct_score = float(self.score) if 0 <= correct_score <= 1: ...
21.44186
55
0.465293
class Score: def __init__(self, score): self.score = score def get_grade(self): try: correct_score = float(self.score) if 0 <= correct_score <= 1: if correct_score >= 0.9: return "A" elif correct_score >= 0.8: ...
true
true
1c0a02cccdf85a22b14aa6f4cdb3c87817da1227
5,187
py
Python
configs/fast_mask_rcnn_r50_fpn_1x.py
AiLvv/mmdetection
2489aa4fc8df3b4c39c1cc72571a677e4451a44c
[ "Apache-2.0" ]
null
null
null
configs/fast_mask_rcnn_r50_fpn_1x.py
AiLvv/mmdetection
2489aa4fc8df3b4c39c1cc72571a677e4451a44c
[ "Apache-2.0" ]
null
null
null
configs/fast_mask_rcnn_r50_fpn_1x.py
AiLvv/mmdetection
2489aa4fc8df3b4c39c1cc72571a677e4451a44c
[ "Apache-2.0" ]
null
null
null
# model settings model = dict( type='FastRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch'), ne...
32.41875
77
0.612878
model = dict( type='FastRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch'), neck=dict( ...
true
true
1c0a02e8eb39cdb4d4db76241be1f816a84da38b
6,418
py
Python
lib/rucio/api/subscription.py
efajardo/rucio
460f394715568b937584ef671382b2b93add1758
[ "Apache-2.0" ]
1
2018-02-27T08:03:41.000Z
2018-02-27T08:03:41.000Z
lib/rucio/api/subscription.py
efajardo/rucio
460f394715568b937584ef671382b2b93add1758
[ "Apache-2.0" ]
null
null
null
lib/rucio/api/subscription.py
efajardo/rucio
460f394715568b937584ef671382b2b93add1758
[ "Apache-2.0" ]
null
null
null
""" Copyright European Organization for Nuclear Research (CERN) 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 Authors: - Vincent Gar...
41.947712
233
0.707074
from json import dumps from rucio.api.permission import has_permission from rucio.common.exception import InvalidObject, AccessDenied from rucio.common.schema import validate_schema from rucio.core import subscription def add_subscription(name, account, filter, replication_rules, comments, lifetime, retroactive, dr...
true
true
1c0a04ee47f6eb3984a50f2e370a03b0788e55b0
484
py
Python
cloudrunner/api/logs.py
CloudRunnerIO/cloudrunner
dc4712a6ccbe95fa552b5699d301de75928bcf08
[ "Apache-2.0" ]
5
2015-05-14T01:35:48.000Z
2021-12-21T14:46:28.000Z
cloudrunner/api/logs.py
CloudRunnerIO/cloudrunner
dc4712a6ccbe95fa552b5699d301de75928bcf08
[ "Apache-2.0" ]
1
2015-02-12T12:39:53.000Z
2015-02-12T12:40:06.000Z
cloudrunner/api/logs.py
CloudRunnerIO/cloudrunner
dc4712a6ccbe95fa552b5699d301de75928bcf08
[ "Apache-2.0" ]
1
2021-12-21T14:57:24.000Z
2021-12-21T14:57:24.000Z
from base import ApiObject, ResourceManager, RESTResource class Log(ApiObject): pass class Logs(RESTResource): get = ResourceManager('logs/get', Log, selector='group', wrapper='group') search = ResourceManager('logs/search', Log, wrapper='tasks.groups') latest = ResourceMa...
30.25
72
0.636364
from base import ApiObject, ResourceManager, RESTResource class Log(ApiObject): pass class Logs(RESTResource): get = ResourceManager('logs/get', Log, selector='group', wrapper='group') search = ResourceManager('logs/search', Log, wrapper='tasks.groups') latest = ResourceMa...
true
true
1c0a05d17fc94b8f3c2ee0b9b7206a0b594a0677
3,091
py
Python
src/sentry/api/bases/project.py
seukjung/sentry-custom
c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963
[ "BSD-3-Clause" ]
null
null
null
src/sentry/api/bases/project.py
seukjung/sentry-custom
c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963
[ "BSD-3-Clause" ]
6
2019-12-29T00:50:11.000Z
2022-02-10T13:27:24.000Z
src/sentry/api/bases/project.py
seukjung/sentry-custom
c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963
[ "BSD-3-Clause" ]
null
null
null
from __future__ import absolute_import from sentry.api.base import Endpoint from sentry.api.exceptions import ResourceDoesNotExist from sentry.app import raven from sentry.models import Project, ProjectStatus from .team import TeamPermission class ProjectPermission(TeamPermission): scope_map = { 'GET': ...
31.865979
86
0.626335
from __future__ import absolute_import from sentry.api.base import Endpoint from sentry.api.exceptions import ResourceDoesNotExist from sentry.app import raven from sentry.models import Project, ProjectStatus from .team import TeamPermission class ProjectPermission(TeamPermission): scope_map = { 'GET': ...
true
true
1c0a081a3eab89cabd63b475f3e696f3cc91b28f
645
py
Python
tests/test_pypkg.py
movermeyer/pypkg
c094dd2459a19fdb348805601987b9d9f4ff7214
[ "MIT" ]
null
null
null
tests/test_pypkg.py
movermeyer/pypkg
c094dd2459a19fdb348805601987b9d9f4ff7214
[ "MIT" ]
null
null
null
tests/test_pypkg.py
movermeyer/pypkg
c094dd2459a19fdb348805601987b9d9f4ff7214
[ "MIT" ]
null
null
null
import unittest from pypkg import core, utils class PypkgTest(unittest.TestCase): def test_true(self): self.assertTrue(True) class CoreTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_echo(self): self.assertEqual("ping", core.echo("ping")) self.assertEq...
18.970588
50
0.696124
import unittest from pypkg import core, utils class PypkgTest(unittest.TestCase): def test_true(self): self.assertTrue(True) class CoreTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_echo(self): self.assertEqual("ping", core.echo("ping")) self.assertEq...
true
true
1c0a084b8791c338adfde625c7a4d9334d5b8fe5
5,703
py
Python
model/lanenet/loss.py
yvonwin/lanenet-lane-detection-pytorch
b1a14c3123e988069034eaa783a2dbc6bc509065
[ "MIT" ]
null
null
null
model/lanenet/loss.py
yvonwin/lanenet-lane-detection-pytorch
b1a14c3123e988069034eaa783a2dbc6bc509065
[ "MIT" ]
null
null
null
model/lanenet/loss.py
yvonwin/lanenet-lane-detection-pytorch
b1a14c3123e988069034eaa783a2dbc6bc509065
[ "MIT" ]
null
null
null
# coding: utf-8 """ This is the implementation of following paper: https://arxiv.org/pdf/1802.05591.pdf """ from torch.nn.modules.loss import _Loss # from torch.autograd import Variable import torch import torch.nn as nn from torch.functional import F DEVICE = torch.device('cuda:0' if torch.cuda.is_available() else 'c...
37.27451
97
0.51131
from torch.nn.modules.loss import _Loss import torch import torch.nn as nn from torch.functional import F DEVICE = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') class FocalLoss(nn.Module): def __init__(self, gamma=2, alpha=[0.5, 0.5], n_class=2,...
true
true
1c0a09abf093bb6b6b0a8e9991f37284105016ec
718
py
Python
bpmn/tests/views/process_tests.py
VSSantana/SFDjango-BPMN
e5a3fb8da9282fd88f72a85a4b34d89d38391e36
[ "MIT" ]
1
2021-09-21T00:02:10.000Z
2021-09-21T00:02:10.000Z
bpmn/tests/views/process_tests.py
VSSantana/SFDjango-BPMN
e5a3fb8da9282fd88f72a85a4b34d89d38391e36
[ "MIT" ]
5
2021-09-22T13:54:06.000Z
2021-09-22T14:05:56.000Z
bpmn/tests/views/process_tests.py
marcelobbfonseca/SFDjango-BPMN
50565763414f52d9e84004494cf550c6fe2358fa
[ "MIT" ]
1
2021-09-18T01:22:25.000Z
2021-09-18T01:22:25.000Z
import pytest, json from bpmn.models import Ontology from SFDjango.settings import STATIC_ROOT @pytest.mark.django_db def test_hello_world(client): assert 1 == 1 @pytest.mark.django_db def test_ontology_suggestion(client): data = {"hello": "hi"} headers = {'Content-Type':'application/json'} domai...
26.592593
99
0.718663
import pytest, json from bpmn.models import Ontology from SFDjango.settings import STATIC_ROOT @pytest.mark.django_db def test_hello_world(client): assert 1 == 1 @pytest.mark.django_db def test_ontology_suggestion(client): data = {"hello": "hi"} headers = {'Content-Type':'application/json'} domai...
true
true
1c0a09ce120ab76a02fe7182ea0e511b533bb5d1
521
py
Python
app/crud/kit.py
Data4City/D4C_API
5f8e64550f5f601a4ad2ae558060d479cbfdcac1
[ "MIT" ]
null
null
null
app/crud/kit.py
Data4City/D4C_API
5f8e64550f5f601a4ad2ae558060d479cbfdcac1
[ "MIT" ]
null
null
null
app/crud/kit.py
Data4City/D4C_API
5f8e64550f5f601a4ad2ae558060d479cbfdcac1
[ "MIT" ]
null
null
null
from sqlalchemy.orm import Session from app.db_models.kit import Kit from typing import List, Optional, Tuple from app.db.helpers import get_or_create def get_single(db_session: Session, *, kit_id: int) -> Kit: return db_session.query(Kit).get(kit_id) def get_multi(db_session: Session, *, amount=10) -> List[Opt...
30.647059
75
0.746641
from sqlalchemy.orm import Session from app.db_models.kit import Kit from typing import List, Optional, Tuple from app.db.helpers import get_or_create def get_single(db_session: Session, *, kit_id: int) -> Kit: return db_session.query(Kit).get(kit_id) def get_multi(db_session: Session, *, amount=10) -> List[Opt...
true
true
1c0a0a308fd8f3653859663d9043e608a37f9fca
1,142
py
Python
2015/MAC0327/entrega3-4/p43.py
andredalton/bcc
188190e436615e2344d87b722856fa02e6eec9cc
[ "Apache-2.0" ]
1
2018-08-02T14:09:26.000Z
2018-08-02T14:09:26.000Z
2015/MAC0327/entrega3-4/p43.py
andredalton/bcc
188190e436615e2344d87b722856fa02e6eec9cc
[ "Apache-2.0" ]
null
null
null
2015/MAC0327/entrega3-4/p43.py
andredalton/bcc
188190e436615e2344d87b722856fa02e6eec9cc
[ "Apache-2.0" ]
1
2020-07-13T04:27:02.000Z
2020-07-13T04:27:02.000Z
# coding=utf-8 """ Nome: André Meneghelli Vale NUSP: 4898948 Problema P43 - B. Yaroslav and Two Strings """ def main(): n = int(raw_input()) s = list(raw_input()) w = list(raw_input()) maior = menor = igual = 1 possibilidades = 1 for i in xrange(n): if s[i] != "?" and w[i] != "?": ...
24.297872
63
0.458844
def main(): n = int(raw_input()) s = list(raw_input()) w = list(raw_input()) maior = menor = igual = 1 possibilidades = 1 for i in xrange(n): if s[i] != "?" and w[i] != "?": if int(s[i]) > int(w[i]): maior = 0 igual = 0 elif int...
true
true
1c0a0b3b483f55d39f0ca62a0356770b10dac804
3,015
py
Python
cloud.py
Llana13/Lyrics-NLP
d2b3ee0073863f4e6d1c0c621153411e9e0db9a4
[ "MIT" ]
1
2020-03-29T15:09:59.000Z
2020-03-29T15:09:59.000Z
cloud.py
Llana13/Lyrics-NLP
d2b3ee0073863f4e6d1c0c621153411e9e0db9a4
[ "MIT" ]
null
null
null
cloud.py
Llana13/Lyrics-NLP
d2b3ee0073863f4e6d1c0c621153411e9e0db9a4
[ "MIT" ]
null
null
null
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import json import json_lines from PIL import Image from collections import Counter from wordcloud import WordCloud, STOPWORDS #Read the file and set artist list df = pd.read_json (,lines=True) list_artists = ['Ed ...
41.875
1,029
0.599005
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import json import json_lines from PIL import Image from collections import Counter from wordcloud import WordCloud, STOPWORDS df = pd.read_json (,lines=True) list_artists = ['Ed Sheeran','Camila Cabello','Queen','E...
false
true
1c0a0cebaf8ea4dede50dfd6ab38d8a91e4f9e54
3,136
py
Python
train/prepare_release.py
taroushirani/ENUNU
d667b0c1980d880350af0e6c95e6520552c4ad7f
[ "MIT" ]
null
null
null
train/prepare_release.py
taroushirani/ENUNU
d667b0c1980d880350af0e6c95e6520552c4ad7f
[ "MIT" ]
null
null
null
train/prepare_release.py
taroushirani/ENUNU
d667b0c1980d880350af0e6c95e6520552c4ad7f
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2021 oatsu """ 配布用フォルダを準備する """ from glob import glob from os import makedirs from os.path import exists from shutil import copy2, copytree import yaml from send2trash import send2trash from tqdm import tqdm def copy_train_config(config_dir, release_dir): """ acoustic_...
26.803419
69
0.678253
from glob import glob from os import makedirs from os.path import exists from shutil import copy2, copytree import yaml from send2trash import send2trash from tqdm import tqdm def copy_train_config(config_dir, release_dir): print('copying config') copytree(config_dir, f'{release_dir}/{config_dir}') def co...
true
true
1c0a0e82072156db1b661344d03c44e4cdc04060
9,765
py
Python
src/d02_intermediate/preprocess_1_socioecon.py
cjsyzwsh/South_Australia_Transport_Econ
8c27f3015193113f8f479e7c0e0c3ff1ac42944e
[ "MIT" ]
1
2021-04-08T12:50:24.000Z
2021-04-08T12:50:24.000Z
src/d02_intermediate/preprocess_1_socioecon.py
cjsyzwsh/South_Australia_Transport_Econ
8c27f3015193113f8f479e7c0e0c3ff1ac42944e
[ "MIT" ]
null
null
null
src/d02_intermediate/preprocess_1_socioecon.py
cjsyzwsh/South_Australia_Transport_Econ
8c27f3015193113f8f479e7c0e0c3ff1ac42944e
[ "MIT" ]
1
2021-04-08T12:50:25.000Z
2021-04-08T12:50:25.000Z
# preprocessing the socioeconomic variables # inputs: five raw socio-demographcics data. # outputs: one combined socio-econ geopandas data frame. # import numpy as np import pandas as pd import matplotlib.pyplot as plt import geopandas as gpd # system path import sys import os # util path utility_path = os.path.join...
38.294118
125
0.713262
import pandas as pd import matplotlib.pyplot as plt import geopandas as gpd import sys import os utility_path = os.path.join(os.getcwd(),'src/d00_utils/') sys.path.append(utility_path) import utilities as util raw_data_path = os.path.join(os.getcwd(),'data/01_raw/') intermediate_data_path = os.path.join(os.getcwd()...
true
true
1c0a0f86af735303df9f7394f734468b3af71985
6,419
py
Python
src/represent_sl.py
lingluodlut/BioCreativeVII_DrugProt
b3ee015286d0168ccc30e62bdfaca5a341164401
[ "Apache-2.0" ]
null
null
null
src/represent_sl.py
lingluodlut/BioCreativeVII_DrugProt
b3ee015286d0168ccc30e62bdfaca5a341164401
[ "Apache-2.0" ]
null
null
null
src/represent_sl.py
lingluodlut/BioCreativeVII_DrugProt
b3ee015286d0168ccc30e62bdfaca5a341164401
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Mon Aug 30 19:54:17 2021 @author: luol2 """ import os, sys import numpy as np from tensorflow.keras.preprocessing.sequence import pad_sequences from transformers import AutoTokenizer class Hugface_RepresentationLayer(object): def __init__(self, token...
37.319767
170
0.590435
import os, sys import numpy as np from tensorflow.keras.preprocessing.sequence import pad_sequences from transformers import AutoTokenizer class Hugface_RepresentationLayer(object): def __init__(self, tokenizer_name_or_path, label_file,lowercase=True): ...
true
true
1c0a1063e1839031e99afef98b206f5e41277ed4
19,195
py
Python
multicurrency/peso.py
fscm/multicurrency
5eabdcbfbf427dcafe08d4d05cfce8c9348aeb91
[ "MIT" ]
2
2021-03-26T18:19:57.000Z
2021-07-27T01:15:50.000Z
multicurrency/peso.py
fscm/multicurrency
5eabdcbfbf427dcafe08d4d05cfce8c9348aeb91
[ "MIT" ]
null
null
null
multicurrency/peso.py
fscm/multicurrency
5eabdcbfbf427dcafe08d4d05cfce8c9348aeb91
[ "MIT" ]
null
null
null
# -*- coding: UTF-8 -*- # # copyright: 2020-2022, Frederico Martins # author: Frederico Martins <http://github.com/fscm> # license: SPDX-License-Identifier: MIT """Peso currency representation(s).""" from decimal import Decimal from typing import Optional, Union from .currency import Currency class ArgentinePeso(Cu...
36.080827
77
0.594217
from decimal import Decimal from typing import Optional, Union from .currency import Currency class ArgentinePeso(Currency): __slots__ = [] def __new__( cls, amount: Union[int, float, Decimal], decimal_places: Optional[int] = 2, decimal_sign: Optional[str] ...
true
true
1c0a10646077fc681446acfbfb3d26ab836454bc
3,981
py
Python
py_ses_auth/cli.py
ShenTengTu/py-ses-auth
f8a7678cdddb508a10726540177840eae760820d
[ "MIT" ]
null
null
null
py_ses_auth/cli.py
ShenTengTu/py-ses-auth
f8a7678cdddb508a10726540177840eae760820d
[ "MIT" ]
null
null
null
py_ses_auth/cli.py
ShenTengTu/py-ses-auth
f8a7678cdddb508a10726540177840eae760820d
[ "MIT" ]
null
null
null
""" https://gist.github.com/ShenTengTu/5e40217db8f7a218b28f365a13a14c00 """ __all__ = ["arg_meta", "CLI"] import argparse def arg_meta(*arg_flags, **arg_conf): """ Return a tuple `(arg_flags, arg_conf)` that contains argument flags & argument config. `arg_flags`: A tuple contains argument flags `ar...
32.631148
90
0.610902
__all__ = ["arg_meta", "CLI"] import argparse def arg_meta(*arg_flags, **arg_conf): return (arg_flags, arg_conf) class CLI(argparse.ArgumentParser): def __init__(self, version: str, main_params: dict, sub_params: dict): self._sub_dest_name = sub_params.get("dest") if self._sub_des...
true
true
1c0a108a34f280472032546ac39f1cbff914f16b
17,571
bzl
Python
bazel/robolectric.bzl
jin/robolectric
c7b82c71682403e062c329a3f4065be32bdf788f
[ "MIT" ]
null
null
null
bazel/robolectric.bzl
jin/robolectric
c7b82c71682403e062c329a3f4065be32bdf788f
[ "MIT" ]
null
null
null
bazel/robolectric.bzl
jin/robolectric
c7b82c71682403e062c329a3f4065be32bdf788f
[ "MIT" ]
null
null
null
def android_all_jars(): native.maven_jar( name = "org_robolectric_android_all_9_robolectric_r4799589", artifact = "org.robolectric:android-all:9-robolectric-4799589", ) native.maven_jar( name = "org_robolectric_android_all_8_1_0_robolectric_r4611349", artifact = "org.r...
35.932515
117
0.659951
def android_all_jars(): native.maven_jar( name = "org_robolectric_android_all_9_robolectric_r4799589", artifact = "org.robolectric:android-all:9-robolectric-4799589", ) native.maven_jar( name = "org_robolectric_android_all_8_1_0_robolectric_r4611349", artifact = "org.r...
true
true
1c0a1166317b0cab284b94b3c158e1b6a5ff90e9
497
py
Python
hh/connectToDb.py
armohamm/HH---POS-Accounting-and-ERP-Software
4bcb7be39e24ed648451d5ad2447fd0840820856
[ "MIT" ]
27
2020-04-13T09:05:51.000Z
2022-02-02T22:43:30.000Z
hh/connectToDb.py
armohamm/HH---POS-Accounting-and-ERP-Software
4bcb7be39e24ed648451d5ad2447fd0840820856
[ "MIT" ]
5
2018-07-20T13:17:23.000Z
2019-10-23T12:42:39.000Z
hh/connectToDb.py
armohamm/HH---POS-Accounting-and-ERP-Software
4bcb7be39e24ed648451d5ad2447fd0840820856
[ "MIT" ]
19
2018-07-20T18:21:17.000Z
2020-03-03T22:43:29.000Z
import pymysql.cursors # Connect to the database def connectToDB(): lines = [line.rstrip('\n') for line in open('data/db.txt')] connection = pymysql.connect(host=lines[0], user=lines[2], password=lines[3], ...
31.0625
73
0.44668
import pymysql.cursors def connectToDB(): lines = [line.rstrip('\n') for line in open('data/db.txt')] connection = pymysql.connect(host=lines[0], user=lines[2], password=lines[3], db=lines[4], ...
true
true
1c0a120fdd9a10f4707080d53373dda10c06f6e0
2,142
py
Python
leetcode/951.py
Cannizza-zzk/python_review
5a04b3dbc8baa835780c039386529e20e69af81c
[ "Apache-2.0" ]
null
null
null
leetcode/951.py
Cannizza-zzk/python_review
5a04b3dbc8baa835780c039386529e20e69af81c
[ "Apache-2.0" ]
null
null
null
leetcode/951.py
Cannizza-zzk/python_review
5a04b3dbc8baa835780c039386529e20e69af81c
[ "Apache-2.0" ]
null
null
null
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def flip_node(self, root): root.left , root.right = root.right, root.left return root ...
34.548387
66
0.526144
class Solution: def flip_node(self, root): root.left , root.right = root.right, root.left return root def node_equal(self, node1 , node2): if node2 == None and node1 == None: return True elif node1 == None or node2 == None: return False elif n...
true
true
1c0a1219dcce8e93c0bb36d7cedc1c848a725acb
3,968
py
Python
tests/tests_plots/test_render_img.py
juniors90/Flask-Plots
1ab233217dc37b1cd2ea727af5d3a7433184863c
[ "MIT" ]
1
2022-01-21T16:05:06.000Z
2022-01-21T16:05:06.000Z
tests/tests_plots/test_render_img.py
juniors90/Flask-Plots
1ab233217dc37b1cd2ea727af5d3a7433184863c
[ "MIT" ]
null
null
null
tests/tests_plots/test_render_img.py
juniors90/Flask-Plots
1ab233217dc37b1cd2ea727af5d3a7433184863c
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the # Flask-Plots Project # https://github.com/juniors90/Flask-Plots/ # Copyright (c) 2021, Ferreira Juan David # License: MIT # Full Text: # https://github.com/juniors90/Flask-Plots/blob/master/LICENSE # =================...
35.115044
78
0.57006
from flask import render_template_string from matplotlib.figure import Figure import pytest as pt def test_render_img(app, client, plots): @app.route("/render-image") def render_image(): fig = Figure() ax = fig.subplots() ax.plot([-1, 4]) ax.set_title("Linear Funct...
true
true
1c0a1233045bcc7da6b6d9d58b71fef3c069ef25
36,430
py
Python
mlflow/keras.py
jinzhang21/mlflow
e926be917795fd945ea347e02cf31214008d3f1e
[ "Apache-2.0" ]
null
null
null
mlflow/keras.py
jinzhang21/mlflow
e926be917795fd945ea347e02cf31214008d3f1e
[ "Apache-2.0" ]
null
null
null
mlflow/keras.py
jinzhang21/mlflow
e926be917795fd945ea347e02cf31214008d3f1e
[ "Apache-2.0" ]
null
null
null
""" The ``mlflow.keras`` module provides an API for logging and loading Keras models. This module exports Keras models with the following flavors: Keras (native) format This is the main flavor that can be loaded back into Keras. :py:mod:`mlflow.pyfunc` Produced for use by generic pyfunc-based deployment tools ...
44.157576
105
0.652402
import importlib import os import re import yaml import tempfile import shutil import warnings import pandas as pd from packaging.version import Version from mlflow import pyfunc from mlflow.models import Model from mlflow.models.model import MLMODEL_FILE_NAME import mlflow.tracking from mlflow.exceptions import Mlfl...
true
true
1c0a12ec183dda676d23bb5939a68d1052b3b0a9
2,372
py
Python
nose2/tests/unit/test_attrib_plugin.py
deeplow/nose2
eb0394160e24afe760e984d93dbece8351dbae7a
[ "BSD-2-Clause" ]
637
2015-01-12T02:02:53.000Z
2022-03-30T19:47:48.000Z
nose2/tests/unit/test_attrib_plugin.py
deeplow/nose2
eb0394160e24afe760e984d93dbece8351dbae7a
[ "BSD-2-Clause" ]
276
2015-01-02T19:14:06.000Z
2022-03-18T04:03:08.000Z
nose2/tests/unit/test_attrib_plugin.py
deeplow/nose2
eb0394160e24afe760e984d93dbece8351dbae7a
[ "BSD-2-Clause" ]
127
2015-01-08T12:02:10.000Z
2022-01-10T20:52:29.000Z
import unittest from nose2 import events, session from nose2.plugins import attrib from nose2.tests._common import TestCase class TestAttribPlugin(TestCase): tags = ["unit"] def setUp(self): class TC_1(TestCase): tags = ["a", "b"] def test_a(self): pass ...
37.650794
85
0.609612
import unittest from nose2 import events, session from nose2.plugins import attrib from nose2.tests._common import TestCase class TestAttribPlugin(TestCase): tags = ["unit"] def setUp(self): class TC_1(TestCase): tags = ["a", "b"] def test_a(self): pass ...
true
true
1c0a13dd5688268e59ad9e13a7796200064d7055
4,979
py
Python
download_atts/download.py
zpix1/vk_pm_downloader
0f4c338aa0d4a611c8f280174445a6089b808280
[ "MIT" ]
2
2019-08-31T19:14:14.000Z
2022-02-25T17:15:45.000Z
download_atts/download.py
zpix1/vk_pm_downloader
0f4c338aa0d4a611c8f280174445a6089b808280
[ "MIT" ]
1
2022-02-25T18:43:38.000Z
2022-02-26T13:22:47.000Z
download_atts/download.py
zpix1/vk_pm_downloader
0f4c338aa0d4a611c8f280174445a6089b808280
[ "MIT" ]
2
2021-12-14T23:42:43.000Z
2022-01-02T14:36:57.000Z
#! /usr/bin/env python3 import argparse import sys import os import asyncio import random from time import sleep from bs4 import BeautifulSoup import requests import aiohttp from urllib.parse import urlparse parser = argparse.ArgumentParser(description='Скачать все вложения из файлов VK PM Downloader') parser.add_ar...
38.3
161
0.648122
import argparse import sys import os import asyncio import random from time import sleep from bs4 import BeautifulSoup import requests import aiohttp from urllib.parse import urlparse parser = argparse.ArgumentParser(description='Скачать все вложения из файлов VK PM Downloader') parser.add_argument('--wait', type=in...
true
true
1c0a13e28dc019c1c6c0eb664d1f15698022a5c0
369
py
Python
testcase/locators/base_page_locators.py
sirbana/automation_practice
961d0d9c036064f256de6a25ca60da39d8828490
[ "MIT" ]
null
null
null
testcase/locators/base_page_locators.py
sirbana/automation_practice
961d0d9c036064f256de6a25ca60da39d8828490
[ "MIT" ]
null
null
null
testcase/locators/base_page_locators.py
sirbana/automation_practice
961d0d9c036064f256de6a25ca60da39d8828490
[ "MIT" ]
null
null
null
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait class BasePageLocators(object): def __init__(self, driver): self.driver = driver def wait_for_element_to_be_visible(driver, by, selector): return WebDriverWait(driver, 5).until(...
33.545455
91
0.794038
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait class BasePageLocators(object): def __init__(self, driver): self.driver = driver def wait_for_element_to_be_visible(driver, by, selector): return WebDriverWait(driver, 5).until(...
true
true
1c0a145f067c5841f277b262a8ea81d806baf73c
789
py
Python
labs/12_i2c_oled_display/convert.py
plazmer/stm32f0_ARM
26a81590875134d0752cead89e713bb22592e78b
[ "MIT" ]
114
2019-01-09T09:50:15.000Z
2022-03-19T18:36:56.000Z
labs/12_i2c_oled_display/convert.py
plazmer/stm32f0_ARM
26a81590875134d0752cead89e713bb22592e78b
[ "MIT" ]
2
2019-12-14T05:34:59.000Z
2021-02-23T12:39:54.000Z
labs/12_i2c_oled_display/convert.py
plazmer/stm32f0_ARM
26a81590875134d0752cead89e713bb22592e78b
[ "MIT" ]
64
2018-03-02T15:54:04.000Z
2022-03-27T00:03:02.000Z
import imageio import sys import os import numpy as np if (len(sys.argv) != 2): print("Format: python convert.py grayscale_image_name") sys.exit(1) try: data = imageio.imread(sys.argv[1]) except: print("Wrong image name!") sys.exit(1) if (len(data.shape) != 2): print("Image must be grayscale!...
21.324324
59
0.622307
import imageio import sys import os import numpy as np if (len(sys.argv) != 2): print("Format: python convert.py grayscale_image_name") sys.exit(1) try: data = imageio.imread(sys.argv[1]) except: print("Wrong image name!") sys.exit(1) if (len(data.shape) != 2): print("Image must be grayscale!...
true
true
1c0a15b6d729527e803762a4c621aaa5dbd1cbb2
2,111
py
Python
utils/prediction.py
Mehrad0711/HUBERT
2f13fd2f7f5a2ec13544f4007158b582ae7408c3
[ "MIT" ]
3
2021-05-22T08:25:17.000Z
2021-11-11T03:23:35.000Z
utils/prediction.py
Mehrad0711/HUBERT
2f13fd2f7f5a2ec13544f4007158b582ae7408c3
[ "MIT" ]
null
null
null
utils/prediction.py
Mehrad0711/HUBERT
2f13fd2f7f5a2ec13544f4007158b582ae7408c3
[ "MIT" ]
null
null
null
import logging import numpy as np import torch from tqdm import tqdm from utils.metrics import class_acc, reg_acc logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt='%m/%d/%Y %H:%M:%S', level=logging.INFO) logger = logging.getLogg...
33.507937
85
0.594031
import logging import numpy as np import torch from tqdm import tqdm from utils.metrics import class_acc, reg_acc logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt='%m/%d/%Y %H:%M:%S', level=logging.INFO) logger = logging.getLogg...
true
true
1c0a1655f9c71c968820a2fb37d11d911ce88397
6,062
py
Python
opennem/exporter/geojson.py
tourdownunder/opennem
deec3e2079db9d9d84171010fd0c239170d1e7ce
[ "MIT" ]
null
null
null
opennem/exporter/geojson.py
tourdownunder/opennem
deec3e2079db9d9d84171010fd0c239170d1e7ce
[ "MIT" ]
1
2020-09-06T04:17:59.000Z
2020-09-06T04:17:59.000Z
opennem/exporter/geojson.py
tourdownunder/opennem
deec3e2079db9d9d84171010fd0c239170d1e7ce
[ "MIT" ]
null
null
null
import logging from pydantic import ValidationError from geojson import Feature, FeatureCollection, Point, dumps from opennem.controllers.stations import get_stations from opennem.core.facility_duid_map import duid_is_retired from opennem.db import get_database_session from opennem.exporter.encoders import OpenNEMGeo...
32.591398
72
0.56615
import logging from pydantic import ValidationError from geojson import Feature, FeatureCollection, Point, dumps from opennem.controllers.stations import get_stations from opennem.core.facility_duid_map import duid_is_retired from opennem.db import get_database_session from opennem.exporter.encoders import OpenNEMGeo...
true
true
1c0a16790e9dacec0eade3d235a9befbbfc7977c
3,858
py
Python
search-cluster/scripts/create_kibana_index.py
backwardn/antiope
c869bc68ba88ab9dcb3a33e2d5d5ef2a18418373
[ "Apache-2.0" ]
210
2019-01-11T20:58:23.000Z
2022-03-16T18:51:17.000Z
search-cluster/scripts/create_kibana_index.py
backwardn/antiope
c869bc68ba88ab9dcb3a33e2d5d5ef2a18418373
[ "Apache-2.0" ]
13
2018-11-23T19:06:05.000Z
2020-08-19T20:05:28.000Z
search-cluster/scripts/create_kibana_index.py
backwardn/antiope
c869bc68ba88ab9dcb3a33e2d5d5ef2a18418373
[ "Apache-2.0" ]
44
2018-11-21T15:51:24.000Z
2022-03-11T01:21:24.000Z
#!/usr/bin/env python3 from dateutil import tz from elasticsearch import Elasticsearch, RequestsHttpConnection, ElasticsearchException, RequestError, NotFoundError from requests_aws4auth import AWS4Auth import boto3 import datetime import json import os import re import requests import time import logging logger = lo...
29.676923
120
0.678072
from dateutil import tz from elasticsearch import Elasticsearch, RequestsHttpConnection, ElasticsearchException, RequestError, NotFoundError from requests_aws4auth import AWS4Auth import boto3 import datetime import json import os import re import requests import time import logging logger = logging.getLogger() loggi...
true
true
1c0a1795d57f70ab33a3fec49c39ca1b1530a08d
2,609
py
Python
setup.py
0nebody/idle-redirector
6173e4ca2097ee1c249e798149130d4299b1eb38
[ "BSD-3-Clause" ]
null
null
null
setup.py
0nebody/idle-redirector
6173e4ca2097ee1c249e798149130d4299b1eb38
[ "BSD-3-Clause" ]
null
null
null
setup.py
0nebody/idle-redirector
6173e4ca2097ee1c249e798149130d4299b1eb38
[ "BSD-3-Clause" ]
null
null
null
""" idle-redirector setup """ import json from pathlib import Path from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, combine_commands, skip_if_exists ) import setuptools HERE = Path(__file__).parent.resolve() # The name of the project name = "idle-redirector" lab_path...
26.353535
79
0.662706
import json from pathlib import Path from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, combine_commands, skip_if_exists ) import setuptools HERE = Path(__file__).parent.resolve() name = "idle-redirector" lab_path = (HERE / name / "labextension") jstargets = [ str...
true
true
1c0a17a5f56048f1f35d2df32f48616faea6b995
556
py
Python
usermgmt/migrations/0004_auto_20201204_1105.py
hodeld/etiki-prototype1
bcae893423519f6ddfa4f67b980066e04062d9f3
[ "MIT" ]
1
2019-08-31T18:04:39.000Z
2019-08-31T18:04:39.000Z
usermgmt/migrations/0004_auto_20201204_1105.py
hodeld/etiki-prototype1
bcae893423519f6ddfa4f67b980066e04062d9f3
[ "MIT" ]
19
2019-12-12T01:38:49.000Z
2022-03-12T00:26:14.000Z
usermgmt/migrations/0004_auto_20201204_1105.py
hodeld/etiki-prototype1
bcae893423519f6ddfa4f67b980066e04062d9f3
[ "MIT" ]
null
null
null
# Generated by Django 2.2.9 on 2020-12-04 10:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('usermgmt', '0003_auto_20201012_1644'), ] operations = [ migrations.AddField( model_name='profile', name='aggree_priv...
23.166667
52
0.586331
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('usermgmt', '0003_auto_20201012_1644'), ] operations = [ migrations.AddField( model_name='profile', name='aggree_privacy', field=models.BooleanField(defa...
true
true
1c0a197acf4b988e48a82f7af649640a5f3d33d9
294
py
Python
__init__.py
EngSciMath-team/splashpage
18451457acb80e25c625560bbde31155052fdc36
[ "MIT" ]
null
null
null
__init__.py
EngSciMath-team/splashpage
18451457acb80e25c625560bbde31155052fdc36
[ "MIT" ]
2
2018-11-20T07:45:29.000Z
2018-11-20T08:30:27.000Z
__init__.py
EngSciMath-team/splashpage
18451457acb80e25c625560bbde31155052fdc36
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- __author__ = 'Eric Z. Eisberg' __copyright__ = 'Copyright 2018 Eric Z. Eisberg' __license__ = 'Licensed under MIT license' from flask import Flask from splashpage.config import Config app = Flask(__name__) app.config.from_object(Config) from splashpage import routes
22.615385
48
0.761905
__author__ = 'Eric Z. Eisberg' __copyright__ = 'Copyright 2018 Eric Z. Eisberg' __license__ = 'Licensed under MIT license' from flask import Flask from splashpage.config import Config app = Flask(__name__) app.config.from_object(Config) from splashpage import routes
true
true
1c0a1a0ca8d1d5347d333ce7fb5aa41110b6a377
4,396
py
Python
Python_Scripts/instagram/insta_heighlight.py
kaustubhsh/TIGMINT
c4147c94c23aa05bcb6b70e857d650aabcea54b8
[ "MIT" ]
177
2020-09-05T06:37:50.000Z
2022-03-31T16:15:37.000Z
Python_Scripts/instagram/insta_heighlight.py
kaustubhsh/TIGMINT
c4147c94c23aa05bcb6b70e857d650aabcea54b8
[ "MIT" ]
8
2020-09-08T19:36:51.000Z
2021-09-19T15:10:36.000Z
Python_Scripts/instagram/insta_heighlight.py
kaustubhsh/TIGMINT
c4147c94c23aa05bcb6b70e857d650aabcea54b8
[ "MIT" ]
41
2020-09-06T06:21:59.000Z
2022-03-20T18:12:23.000Z
import requests, urllib3 import os, re import user_info from tqdm import tqdm from sys import exit from html import unescape from bs4 import BeautifulSoup from datetime import datetime from urllib.parse import urlparse from urllib3.exceptions import InsecureRequestWarning class downloader(object): def __init__(sel...
33.815385
99
0.543449
import requests, urllib3 import os, re import user_info from tqdm import tqdm from sys import exit from html import unescape from bs4 import BeautifulSoup from datetime import datetime from urllib.parse import urlparse from urllib3.exceptions import InsecureRequestWarning class downloader(object): def __init__(sel...
true
true
1c0a1a11de01499fa9775c5389c3b4271739c68c
494
py
Python
materials/migrations/0003_auto_20171231_1626.py
mgovoni-devel/MatD3
5b68d147f886bce427f92bb560159e62cec2d4e7
[ "BSD-2-Clause-FreeBSD" ]
7
2019-09-14T07:24:09.000Z
2021-06-15T16:15:05.000Z
materials/migrations/0003_auto_20171231_1626.py
mgovoni-devel/MatD3
5b68d147f886bce427f92bb560159e62cec2d4e7
[ "BSD-2-Clause-FreeBSD" ]
14
2019-12-05T01:49:19.000Z
2021-06-23T18:34:51.000Z
materials/migrations/0003_auto_20171231_1626.py
mgovoni-devel/MatD3
5b68d147f886bce427f92bb560159e62cec2d4e7
[ "BSD-2-Clause-FreeBSD" ]
2
2019-11-06T21:16:57.000Z
2019-11-30T10:51:44.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-12-31 16:26 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('materials', '0002_auto_20171226_1609'), ] operations = [ migrations.AlterField( model_name='idinfo', ...
20.583333
50
0.576923
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('materials', '0002_auto_20171226_1609'), ] operations = [ migrations.AlterField( model_name='idinfo', name='temperature', field=models.CharField(max_len...
true
true
1c0a1a1cdece4df493ca1aa8f3364715b32cec79
15,422
py
Python
pyrex/kernel.py
abigailbishop/pyrex
10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5
[ "MIT" ]
6
2018-06-19T16:01:35.000Z
2020-05-21T20:02:53.000Z
pyrex/kernel.py
bhokansonfasig/pyrex
8b2abc954f2cf4945424042f33847b783c72dcfa
[ "MIT" ]
4
2018-01-19T14:52:33.000Z
2021-09-02T17:20:07.000Z
pyrex/kernel.py
abigailbishop/pyrex
10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5
[ "MIT" ]
5
2018-01-19T14:49:16.000Z
2021-01-21T12:34:59.000Z
""" Module for the simulation kernel. The simulation kernel is responsible for running through the simulation chain by controlling classes and objects which will independently produce neutrinos, create corresponding signals, propagate the signals to antennas, and handle antenna processing of the signals. """ from co...
46.035821
84
0.609843
from collections.abc import Sequence import logging import numpy as np from pyrex.internal_functions import normalize from pyrex.signals import EmptySignal from pyrex.askaryan import AskaryanSignal from pyrex.ray_tracing import RayTracer from pyrex.ice_model import ice logger = logging.getLogger(__name__) class Eve...
true
true
1c0a1a38910cf70d0f12ef55e3b2c0773ee2ba9f
243
py
Python
log/logger.py
waldisjr/web_notes
4c4026c4a127670ccac88cb64cdaa21fc1ca15a8
[ "MIT" ]
null
null
null
log/logger.py
waldisjr/web_notes
4c4026c4a127670ccac88cb64cdaa21fc1ca15a8
[ "MIT" ]
null
null
null
log/logger.py
waldisjr/web_notes
4c4026c4a127670ccac88cb64cdaa21fc1ca15a8
[ "MIT" ]
null
null
null
import logging from abc import ABC, abstractmethod class AbstractLogger(ABC): pass class Logger(AbstractLogger): def __init__(self, logger_config): # TODO pass if __name__ == '__main__': test = Logger('test')
14.294118
38
0.666667
import logging from abc import ABC, abstractmethod class AbstractLogger(ABC): pass class Logger(AbstractLogger): def __init__(self, logger_config): pass if __name__ == '__main__': test = Logger('test')
true
true
1c0a1b5cabe3cefbdf9e0fc60514641ecd697790
1,466
py
Python
main.py
vanashimko/digital-signals-modeling
31ec88759194c332a5fffeeba4f41126f59f307d
[ "MIT" ]
null
null
null
main.py
vanashimko/digital-signals-modeling
31ec88759194c332a5fffeeba4f41126f59f307d
[ "MIT" ]
null
null
null
main.py
vanashimko/digital-signals-modeling
31ec88759194c332a5fffeeba4f41126f59f307d
[ "MIT" ]
null
null
null
from math import pi import matplotlib.pyplot as plt import drawer from signals import HarmonicParameters, harmonic_signal, polyharmonic_signal, polyharmonic_linear def main(): results = [] for i, viewer in enumerate([show_phases, show_frequencies, show_amplitudes, show_polyharmonic_linear]): plt.sub...
27.148148
107
0.674625
from math import pi import matplotlib.pyplot as plt import drawer from signals import HarmonicParameters, harmonic_signal, polyharmonic_signal, polyharmonic_linear def main(): results = [] for i, viewer in enumerate([show_phases, show_frequencies, show_amplitudes, show_polyharmonic_linear]): plt.sub...
true
true
1c0a1d14c0d5a7c6c06c58e03b42b33fa6bbc367
489
py
Python
server/src/repository/query/i_query_repository.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
4
2021-12-31T10:06:34.000Z
2022-01-16T16:34:50.000Z
server/src/repository/query/i_query_repository.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
null
null
null
server/src/repository/query/i_query_repository.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod from model.query.entity.query import Query from model.query.request.query_request import QueryRequest class IQueryRepository(ABC): @abstractmethod def get_queries(self) -> list[Query]: ... @abstractmethod def create_query(self, query: QueryRequest) -> Query: ... ...
25.736842
78
0.711656
from abc import ABC, abstractmethod from model.query.entity.query import Query from model.query.request.query_request import QueryRequest class IQueryRepository(ABC): @abstractmethod def get_queries(self) -> list[Query]: ... @abstractmethod def create_query(self, query: QueryRequest) -> Query: ... ...
true
true
1c0a1d2fbc79b8dcc50dad71c84572bec1b0ef3c
550
py
Python
test/integration/plugin/test_azure_credentials_provider.py
daltonconley/amazon-redshift-python-driver
d862cccc75a521b68a4ba3f1cb5de3b83f9c072b
[ "Apache-2.0", "BSD-3-Clause" ]
1
2021-07-10T15:03:35.000Z
2021-07-10T15:03:35.000Z
test/integration/plugin/test_azure_credentials_provider.py
daltonconley/amazon-redshift-python-driver
d862cccc75a521b68a4ba3f1cb5de3b83f9c072b
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
test/integration/plugin/test_azure_credentials_provider.py
daltonconley/amazon-redshift-python-driver
d862cccc75a521b68a4ba3f1cb5de3b83f9c072b
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
import configparser import os from test import idp_arg import pytest # type: ignore import redshift_connector conf = configparser.ConfigParser() root_path = os.path.dirname(os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir)))) conf.read(root_path + "/config.ini") PROVIDER = ["azure_idp"] @pytest.m...
26.190476
96
0.756364
import configparser import os from test import idp_arg import pytest import redshift_connector conf = configparser.ConfigParser() root_path = os.path.dirname(os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir)))) conf.read(root_path + "/config.ini") PROVIDER = ["azure_idp"] @pytest.mark.parametrize...
true
true
1c0a1d3b155b8ce1b9b299b395c5bc55a038dc77
30,973
py
Python
supervised/utils/additional_metrics.py
stjordanis/mljar-supervised
8c3f9d1ed527dfcfdaef91cf82e2779c5832e294
[ "MIT" ]
2
2021-08-13T10:36:17.000Z
2021-11-15T12:17:30.000Z
supervised/utils/additional_metrics.py
stjordanis/mljar-supervised
8c3f9d1ed527dfcfdaef91cf82e2779c5832e294
[ "MIT" ]
null
null
null
supervised/utils/additional_metrics.py
stjordanis/mljar-supervised
8c3f9d1ed527dfcfdaef91cf82e2779c5832e294
[ "MIT" ]
null
null
null
import os import json import logging import copy import numpy as np import pandas as pd import time import uuid import warnings from supervised.algorithms.registry import ( BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION, ) from sklearn.metrics import ( f1_score, accuracy_score, pr...
39.708974
144
0.528041
import os import json import logging import copy import numpy as np import pandas as pd import time import uuid import warnings from supervised.algorithms.registry import ( BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION, ) from sklearn.metrics import ( f1_score, accuracy_score, pr...
true
true
1c0a1d80432248cfb008ef836ba70c6f1cadc937
573
py
Python
metrics.py
YuraLi88/dlcourse_assignment2
91f8125c88f2116d521cbcfaa72a21ca29d5f847
[ "MIT" ]
null
null
null
metrics.py
YuraLi88/dlcourse_assignment2
91f8125c88f2116d521cbcfaa72a21ca29d5f847
[ "MIT" ]
null
null
null
metrics.py
YuraLi88/dlcourse_assignment2
91f8125c88f2116d521cbcfaa72a21ca29d5f847
[ "MIT" ]
null
null
null
import numpy as np def count_true(array_binary): return np.sum(array_binary.astype('uint8')) def multiclass_accuracy(prediction, ground_truth): ''' Computes metrics for multiclass classification Arguments: prediction, np array of int (num_samples) - model predictions ground_truth, np array of...
27.285714
73
0.732984
import numpy as np def count_true(array_binary): return np.sum(array_binary.astype('uint8')) def multiclass_accuracy(prediction, ground_truth): accuracy = count_true(prediction==ground_truth)/ground_truth.shape[0] return accuracy
true
true
1c0a1d8865120ed0b658142cfd39906a7715a293
18,996
py
Python
src/ipycbm/plugins/foi/foi_panel.py
VP-GEO/cbm
4ed229f6b6455435b6d032deb8a39dba4ecee7a2
[ "BSD-3-Clause" ]
null
null
null
src/ipycbm/plugins/foi/foi_panel.py
VP-GEO/cbm
4ed229f6b6455435b6d032deb8a39dba4ecee7a2
[ "BSD-3-Clause" ]
null
null
null
src/ipycbm/plugins/foi/foi_panel.py
VP-GEO/cbm
4ed229f6b6455435b6d032deb8a39dba4ecee7a2
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of CbM (https://github.com/ec-jrc/cbm). # Author : Konstantinos Anastasakis # Credits : GTCAP Team # Copyright : 2021 European Commission, Joint Research Centre # License : 3-Clause BSD import os import glob from ipywidgets import (Text, Label...
33.151832
218
0.584439
import os import glob from ipywidgets import (Text, Label, HBox, VBox, Layout, Tab, Dropdown, ToggleButtons, Output, SelectMultiple, HTML, Button, FileUpload, Checkbox, Accordion, IntText, RadioButtons) from src.ipycbm.utils import config, settings from src.ipycbm.sou...
true
true
1c0a1da90af1e4f97fa29c229092f33e037a2a02
16,492
py
Python
todo_scheduler.py
grahamstockton/todo-scheduler
bc661b6092e1543c57a7aa718c800fe1818b6525
[ "MIT" ]
1
2021-08-28T18:13:06.000Z
2021-08-28T18:13:06.000Z
todo_scheduler.py
grahamstockton/todo-scheduler
bc661b6092e1543c57a7aa718c800fe1818b6525
[ "MIT" ]
4
2021-06-01T00:22:45.000Z
2021-06-10T01:49:03.000Z
todo_scheduler.py
grahamstockton/todo-scheduler
bc661b6092e1543c57a7aa718c800fe1818b6525
[ "MIT" ]
null
null
null
import os, time, json, operator, math from itertools import product OS_TYPE = os.name # This is for the flash invalid try: from termcolor import colored HAS_TERMCOLOR = True except: HAS_TERMCOLOR = False # This is for cropping the screen -- Thought about doing this with json, ini, or yaml, but we're gonna jus...
41.964377
234
0.611024
import os, time, json, operator, math from itertools import product OS_TYPE = os.name try: from termcolor import colored HAS_TERMCOLOR = True except: HAS_TERMCOLOR = False # I don't want to make people install things, and I don't want a whole file for what is right now one variable def CONST_START_TIME(): ret...
true
true
1c0a2043bab92849aa7d4b17e98553e2cc001b73
16,269
py
Python
mpf/devices/playfield.py
cloudjor/mpf
1cf6bf18b0d81120383b0b128b0ebbfa1c62717c
[ "MIT" ]
null
null
null
mpf/devices/playfield.py
cloudjor/mpf
1cf6bf18b0d81120383b0b128b0ebbfa1c62717c
[ "MIT" ]
null
null
null
mpf/devices/playfield.py
cloudjor/mpf
1cf6bf18b0d81120383b0b128b0ebbfa1c62717c
[ "MIT" ]
null
null
null
"""Contains the Playfield device class which represents the actual playfield in a pinball machine.""" import asyncio from mpf.core.device_monitor import DeviceMonitor from mpf.core.system_wide_device import SystemWideDevice from mpf.core.ball_search import BallSearch from mpf.core.delays import DelayManager from mpf.d...
39.487864
120
0.615649
import asyncio from mpf.core.device_monitor import DeviceMonitor from mpf.core.system_wide_device import SystemWideDevice from mpf.core.ball_search import BallSearch from mpf.core.delays import DelayManager from mpf.devices.ball_device.incoming_balls_handler import IncomingBall @DeviceMonitor("available_balls", "bal...
true
true
1c0a208b8f43d84cad22dd7df33cfedd89fd409b
8,062
py
Python
scripts/fixup_kms_v1_keywords.py
anukaal/python-kms
e28126d7ab1b2b44ee54c6a4a1ddc4d5c15a57b6
[ "Apache-2.0" ]
24
2020-07-07T03:17:32.000Z
2022-03-30T14:48:01.000Z
scripts/fixup_kms_v1_keywords.py
anukaal/python-kms
e28126d7ab1b2b44ee54c6a4a1ddc4d5c15a57b6
[ "Apache-2.0" ]
90
2020-02-05T22:20:20.000Z
2022-03-30T22:42:11.000Z
scripts/fixup_kms_v1_keywords.py
anukaal/python-kms
e28126d7ab1b2b44ee54c6a4a1ddc4d5c15a57b6
[ "Apache-2.0" ]
31
2020-02-08T13:51:41.000Z
2022-03-22T01:08:04.000Z
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
39.326829
138
0.630737
import argparse import os import libcst as cst import pathlib import sys from typing import (Any, Callable, Dict, List, Sequence, Tuple) def partition( predicate: Callable[[Any], bool], iterator: Sequence[Any] ) -> Tuple[List[Any], List[Any]]: results = ([], []) for i in iterator: results[int...
true
true
1c0a21bac4c2975f7101776db3c17e4e28e6f041
2,515
py
Python
archivebox/extractors/media.py
aggroskater/ArchiveBox
c25853969d6996ca5200f411b0e96dee6ec6908c
[ "MIT" ]
1
2021-03-21T03:51:08.000Z
2021-03-21T03:51:08.000Z
archivebox/extractors/media.py
aggroskater/ArchiveBox
c25853969d6996ca5200f411b0e96dee6ec6908c
[ "MIT" ]
null
null
null
archivebox/extractors/media.py
aggroskater/ArchiveBox
c25853969d6996ca5200f411b0e96dee6ec6908c
[ "MIT" ]
null
null
null
__package__ = 'archivebox.extractors' from pathlib import Path from typing import Optional from ..index.schema import Link, ArchiveResult, ArchiveOutput, ArchiveError from ..system import run, chmod_file from ..util import ( enforce_types, is_static_file, ) from ..config import ( MEDIA_TIMEOUT, SAVE_M...
31.049383
105
0.628628
__package__ = 'archivebox.extractors' from pathlib import Path from typing import Optional from ..index.schema import Link, ArchiveResult, ArchiveOutput, ArchiveError from ..system import run, chmod_file from ..util import ( enforce_types, is_static_file, ) from ..config import ( MEDIA_TIMEOUT, SAVE_M...
true
true
1c0a21f120e7165fd9146784e37272f9772046e2
665
py
Python
algorithms/Python/search/ice cream parlor.py
Kumbong/hackerrank
36125f3a17c3e0f1fa889495e8ad33b0aa424552
[ "MIT" ]
8
2019-09-19T19:38:09.000Z
2022-02-14T13:59:37.000Z
algorithms/Python/search/ice cream parlor.py
Kumbong/hacker-rank
36125f3a17c3e0f1fa889495e8ad33b0aa424552
[ "MIT" ]
null
null
null
algorithms/Python/search/ice cream parlor.py
Kumbong/hacker-rank
36125f3a17c3e0f1fa889495e8ad33b0aa424552
[ "MIT" ]
7
2019-09-23T13:17:27.000Z
2022-01-27T18:02:16.000Z
#!/bin/python3 import math import os import random import re import sys # Complete the icecreamParlor function below. def icecreamParlor(m, arr): for i in range(len(arr)-1): for j in range(i+1,len(arr)): if arr[i]+arr[j]==m: return [i+1,j+1] if __name__ == '__m...
19.558824
54
0.542857
import math import os import random import re import sys def icecreamParlor(m, arr): for i in range(len(arr)-1): for j in range(i+1,len(arr)): if arr[i]+arr[j]==m: return [i+1,j+1] if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') ...
true
true
1c0a2293e94f92ed3dfd2a4eca3c992f7826a72f
4,577
py
Python
a2dr/tests/test_precondition.py
anqif/a2dr
b101b13c17448f43c5c9bb3ec6bcdf18aca73a66
[ "Apache-2.0" ]
30
2019-08-20T21:31:51.000Z
2021-12-19T12:14:56.000Z
a2dr/tests/test_precondition.py
anqif/a2dr
b101b13c17448f43c5c9bb3ec6bcdf18aca73a66
[ "Apache-2.0" ]
3
2019-09-30T19:23:36.000Z
2021-03-22T15:48:49.000Z
a2dr/tests/test_precondition.py
anqif/a2dr
b101b13c17448f43c5c9bb3ec6bcdf18aca73a66
[ "Apache-2.0" ]
5
2020-01-09T09:19:56.000Z
2022-02-18T00:38:41.000Z
""" Copyright 2019 Anqi Fu, Junzi Zhang This file is part of A2DR. A2DR is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. A2DR is distribute...
39.456897
128
0.592309
import numpy as np import scipy as sp from scipy import sparse from a2dr import a2dr from a2dr.proximal import prox_norm1, prox_sum_squares_affine from a2dr.precondition import precondition from a2dr.tests.base_test import BaseTest class TestPrecondition(BaseTest): def setUp(self): np.random.seed(1) ...
true
true
1c0a22b9f758045ab44fc41e1b43621f4dd170e6
37,847
py
Python
pandas/core/reshape/reshape.py
tehunter/pandas
c57f883e24405fb4ee561ded1612acf4f4f2bdef
[ "BSD-3-Clause" ]
null
null
null
pandas/core/reshape/reshape.py
tehunter/pandas
c57f883e24405fb4ee561ded1612acf4f4f2bdef
[ "BSD-3-Clause" ]
null
null
null
pandas/core/reshape/reshape.py
tehunter/pandas
c57f883e24405fb4ee561ded1612acf4f4f2bdef
[ "BSD-3-Clause" ]
null
null
null
from __future__ import annotations import itertools from typing import TYPE_CHECKING import warnings import numpy as np import pandas._libs.reshape as libreshape from pandas._libs.sparse import IntIndex from pandas._typing import ( Dtype, npt, ) from pandas.errors import PerformanceWarning from pandas.util._...
33.22827
87
0.611224
from __future__ import annotations import itertools from typing import TYPE_CHECKING import warnings import numpy as np import pandas._libs.reshape as libreshape from pandas._libs.sparse import IntIndex from pandas._typing import ( Dtype, npt, ) from pandas.errors import PerformanceWarning from pandas.util._...
true
true
1c0a247db8202fcda10636a45aecb7a9c9281fac
838
py
Python
edb/common/enum.py
rongfengliang/edgedb-pg-expose
1ddc279511595b4b1a3a1532ea873ed4e05e8b01
[ "Apache-2.0" ]
null
null
null
edb/common/enum.py
rongfengliang/edgedb-pg-expose
1ddc279511595b4b1a3a1532ea873ed4e05e8b01
[ "Apache-2.0" ]
null
null
null
edb/common/enum.py
rongfengliang/edgedb-pg-expose
1ddc279511595b4b1a3a1532ea873ed4e05e8b01
[ "Apache-2.0" ]
null
null
null
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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...
29.928571
74
0.74105
import enum class StrEnum(str, enum.Enum): def __str__(self): return self._value_
true
true
1c0a24caf8d423e9eaa7c8fffe37ec7f5342e6a8
3,020
py
Python
filip/utils/datamodel_generator.py
dnikolay-ebc/FiLiP
9a84979da8dff4523cb91e40869070bd02aa91fe
[ "BSD-3-Clause" ]
6
2021-11-21T21:57:38.000Z
2022-02-22T08:20:30.000Z
filip/utils/datamodel_generator.py
RWTH-EBC/FiLiP
e294c5ef94b2b6ad9611316e50b5c550bcd77c1b
[ "BSD-3-Clause" ]
83
2021-04-08T18:34:20.000Z
2022-03-30T12:18:32.000Z
filip/utils/datamodel_generator.py
dnikolay-ebc/FiLiP
9a84979da8dff4523cb91e40869070bd02aa91fe
[ "BSD-3-Clause" ]
5
2021-10-04T08:39:21.000Z
2022-03-30T07:30:57.000Z
""" Code generator for data models from schema.json descriptions """ import os import shutil from pathlib import Path from tempfile import TemporaryDirectory from typing import Union, Dict from urllib import parse from datamodel_code_generator import InputFileType, generate def create_datamodel(*, ...
32.12766
76
0.557947
import os import shutil from pathlib import Path from tempfile import TemporaryDirectory from typing import Union, Dict from urllib import parse from datamodel_code_generator import InputFileType, generate def create_datamodel(*, output_path: Union[str, Path], filename: str, ...
true
true
1c0a24d16d5dfaa424da77de7cab5eba3af73c46
1,511
py
Python
move_text_context.py
r-stein/st-move-text
cec63f36440088b92c1ca2a3b2608c549d87f4fc
[ "MIT" ]
1
2017-11-05T02:10:20.000Z
2017-11-05T02:10:20.000Z
move_text_context.py
r-stein/st-move-text
cec63f36440088b92c1ca2a3b2608c549d87f4fc
[ "MIT" ]
null
null
null
move_text_context.py
r-stein/st-move-text
cec63f36440088b92c1ca2a3b2608c549d87f4fc
[ "MIT" ]
null
null
null
import operator import re import sublime import sublime_plugin def contains(a, b): """Check whether a contains b.""" return bool(re.search(b, a)) def match(a, b): """Check whether a matches b.""" return bool(re.match(b, a)) op_map = { sublime.OP_EQUAL: operator.eq, sublime.OP_NOT_EQUAL: o...
28.509434
73
0.589014
import operator import re import sublime import sublime_plugin def contains(a, b): return bool(re.search(b, a)) def match(a, b): return bool(re.match(b, a)) op_map = { sublime.OP_EQUAL: operator.eq, sublime.OP_NOT_EQUAL: operator.ne, sublime.OP_REGEX_CONTAINS: contains, sublime.OP_REGEX_M...
true
true
1c0a25b12b734b5cb026c40fdc162c01d63193fa
1,643
py
Python
ghi/ghilogging.py
maxwedwards/ghi
20140991a255e7151b133ed4bd4e1af1f2153e92
[ "MIT" ]
22
2019-01-22T20:35:09.000Z
2022-01-15T18:25:02.000Z
ghi/ghilogging.py
maxwedwards/ghi
20140991a255e7151b133ed4bd4e1af1f2153e92
[ "MIT" ]
19
2019-02-05T17:44:16.000Z
2022-02-20T14:34:04.000Z
ghi/ghilogging.py
maxwedwards/ghi
20140991a255e7151b133ed4bd4e1af1f2153e92
[ "MIT" ]
12
2019-01-24T11:42:59.000Z
2022-01-29T14:57:09.000Z
import logging import sys class SystemdHandler(logging.Handler): PREFIX = { # EMERG <0> # ALERT <1> logging.CRITICAL: "<2>", logging.ERROR: "<3>", logging.WARNING: "<4>", # NOTICE <5> logging.INFO: "<6>", logging.DEBUG: "<7>", logging.NOTSET:...
26.934426
74
0.562995
import logging import sys class SystemdHandler(logging.Handler): PREFIX = { logging.CRITICAL: "<2>", logging.ERROR: "<3>", logging.WARNING: "<4>", logging.INFO: "<6>", logging.DEBUG: "<7>", logging.NOTSET: "<7>" } def __init__(self, ...
true
true
1c0a270d8c64bbda29008dc1fa52a0886d2b93ca
6,930
py
Python
main.py
johnson7788/MAAC
466866534fc24ebfdc0968619f6ba7cabe0aac8b
[ "MIT" ]
null
null
null
main.py
johnson7788/MAAC
466866534fc24ebfdc0968619f6ba7cabe0aac8b
[ "MIT" ]
null
null
null
main.py
johnson7788/MAAC
466866534fc24ebfdc0968619f6ba7cabe0aac8b
[ "MIT" ]
null
null
null
import argparse import torch import os import numpy as np from gym.spaces import Box, Discrete from pathlib import Path from torch.autograd import Variable from tensorboardX import SummaryWriter from utils.make_env import make_env from utils.buffer import ReplayBuffer from utils.env_wrappers import SubprocVecEnv, Dummy...
47.793103
147
0.60202
import argparse import torch import os import numpy as np from gym.spaces import Box, Discrete from pathlib import Path from torch.autograd import Variable from tensorboardX import SummaryWriter from utils.make_env import make_env from utils.buffer import ReplayBuffer from utils.env_wrappers import SubprocVecEnv, Dummy...
true
true
1c0a2a38334827646c1ee8433d257b8ea0ea2fd9
1,231
py
Python
anomalyframework/tests/test_full.py
alliedel/anomalyframework_python
63c56d9fb2e1dc37dfca494805e7fa179e078623
[ "MIT" ]
15
2018-12-28T07:32:56.000Z
2022-02-20T00:17:34.000Z
anomalyframework/tests/test_full.py
alliedel/anomalyframework_python
63c56d9fb2e1dc37dfca494805e7fa179e078623
[ "MIT" ]
1
2018-04-06T18:14:12.000Z
2018-07-11T11:18:34.000Z
anomalyframework/tests/test_full.py
alliedel/anomalyframework_python
63c56d9fb2e1dc37dfca494805e7fa179e078623
[ "MIT" ]
5
2018-02-07T19:08:09.000Z
2019-07-01T23:17:23.000Z
import numpy as np import unittest import tempfile from anomalyframework import liblinear_utils from anomalyframework import run ONE_BASED = 1 class TestFull(unittest.TestCase): def easy_2d_test(self): prediction, ground_truth = easy_2d_test() self.assertListEqual(prediction.tolist(), ground_tru...
27.977273
99
0.712429
import numpy as np import unittest import tempfile from anomalyframework import liblinear_utils from anomalyframework import run ONE_BASED = 1 class TestFull(unittest.TestCase): def easy_2d_test(self): prediction, ground_truth = easy_2d_test() self.assertListEqual(prediction.tolist(), ground_tru...
true
true
1c0a2a89de9f0d657b604d70183ab4455caa8e99
2,842
py
Python
zobs/cmb_analysis.py
NMTHydro/Recharge
bbc1a05add92064acffeffb19f04e370b99a7918
[ "Apache-2.0" ]
7
2016-08-30T15:18:11.000Z
2021-08-22T00:28:10.000Z
zobs/cmb_analysis.py
NMTHydro/Recharge
bbc1a05add92064acffeffb19f04e370b99a7918
[ "Apache-2.0" ]
2
2016-06-08T06:41:45.000Z
2016-06-23T20:47:26.000Z
zobs/cmb_analysis.py
NMTHydro/Recharge
bbc1a05add92064acffeffb19f04e370b99a7918
[ "Apache-2.0" ]
1
2018-09-18T10:38:08.000Z
2018-09-18T10:38:08.000Z
# =============================================================================== # Copyright 2016 dgketchum # # 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...
43.723077
108
0.664673
import os from datetime import datetime from recharge.time_series_manager import get_etrm_time_series from recharge.dict_setup import cmb_sample_site_data from recharge.etrm_processes import Processes def get_cmb_data(cmb_shapefile, extract_path, simulation_period, save_csv, static_inputs, initial_path): cmb_di...
false
true
1c0a2ac2a530b427ee25da40f992a3615fb34d1b
33,372
py
Python
homeassistant/components/mqtt/climate.py
sroebert/core
ad7a0d799d221fe4515923c4821910b68b64cb2f
[ "Apache-2.0" ]
null
null
null
homeassistant/components/mqtt/climate.py
sroebert/core
ad7a0d799d221fe4515923c4821910b68b64cb2f
[ "Apache-2.0" ]
8
2022-01-26T06:25:34.000Z
2022-03-31T06:27:46.000Z
homeassistant/components/mqtt/climate.py
chiefdragon/home-assistant
acc974b26b40917ab4029cf700b3102d336e72d1
[ "Apache-2.0" ]
null
null
null
"""Support for MQTT climate devices.""" from __future__ import annotations import functools import logging import voluptuous as vol from homeassistant.components import climate from homeassistant.components.climate import ( PLATFORM_SCHEMA as CLIMATE_PLATFORM_SCHEMA, ClimateEntity, ) from homeassistant.compo...
36.156013
88
0.678593
from __future__ import annotations import functools import logging import voluptuous as vol from homeassistant.components import climate from homeassistant.components.climate import ( PLATFORM_SCHEMA as CLIMATE_PLATFORM_SCHEMA, ClimateEntity, ) from homeassistant.components.climate.const import ( ATTR_HV...
true
true
1c0a2b4a7b2652297870f920700fadbd18136144
4,965
py
Python
ops/tdn_net.py
ICME2022/R-S-R
0e938082a0ea381cff7f0348deb65826848c43e4
[ "Apache-2.0" ]
null
null
null
ops/tdn_net.py
ICME2022/R-S-R
0e938082a0ea381cff7f0348deb65826848c43e4
[ "Apache-2.0" ]
null
null
null
ops/tdn_net.py
ICME2022/R-S-R
0e938082a0ea381cff7f0348deb65826848c43e4
[ "Apache-2.0" ]
null
null
null
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.init import normal_, constant_ import torch.nn.functional as F from ops.base_module import * import torch.nn.functional as F import random import selfsupervision.MirrorSSB.RBRF_2 as rbrf import selfsupervision.shuffle.reverse_random_ba...
33.547297
139
0.624773
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.init import normal_, constant_ import torch.nn.functional as F from ops.base_module import * import torch.nn.functional as F import random import selfsupervision.MirrorSSB.RBRF_2 as rbrf import selfsupervision.shuffle.reverse_random_ba...
true
true
1c0a2d03664bc2b8693a140e4ab2ed794db30f7c
2,369
py
Python
packages/pyre/schemata/Time.py
rtburns-jpl/pyre
ffc4fc1b2936e355f709d084eb4055954960b3a2
[ "BSD-3-Clause" ]
null
null
null
packages/pyre/schemata/Time.py
rtburns-jpl/pyre
ffc4fc1b2936e355f709d084eb4055954960b3a2
[ "BSD-3-Clause" ]
1
2021-06-10T23:42:13.000Z
2021-06-10T23:42:13.000Z
packages/pyre/schemata/Time.py
jlmaurer/pyre
6af38a83621d7d6228d147b4bb94f97fbb10f6e2
[ "BSD-3-Clause" ]
2
2020-08-31T18:07:52.000Z
2021-12-10T08:54:39.000Z
# -*- coding: utf-8 -*- # # michael a.g. aïvázis # orthologue # (c) 1998-2020 all rights reserved # # externals import datetime # superclass from .Schema import Schema # my declaration class Time(Schema): """ A type declarator for timestamps """ # constants format = "%H:%M:%S" # the default fo...
25.202128
81
0.577037
import datetime from .Schema import Schema class Time(Schema): format = "%H:%M:%S" typename = 'time' complaint = 'could not coerce {0.value!r} into a time' def coerce(self, value, **kwds): if isinstance(value, datetime.time): return value ...
true
true
1c0a2d1a57a9198bd350afd1368437ed13ebced2
2,042
py
Python
setup.py
cnpls/pdappend
9f00fea5d9df072ab90d74c96ebaffe8033eb572
[ "MIT" ]
null
null
null
setup.py
cnpls/pdappend
9f00fea5d9df072ab90d74c96ebaffe8033eb572
[ "MIT" ]
10
2021-03-29T02:34:05.000Z
2021-03-30T00:24:37.000Z
setup.py
cnpls/pdappend
9f00fea5d9df072ab90d74c96ebaffe8033eb572
[ "MIT" ]
1
2020-11-11T23:29:41.000Z
2020-11-11T23:29:41.000Z
import io import os import re from setuptools import setup, find_packages CLASSIFIERS = """\ Intended Audience :: Science/Research Intended Audience :: Developers License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programmin...
27.972603
88
0.682664
import io import os import re from setuptools import setup, find_packages CLASSIFIERS = """\ Intended Audience :: Science/Research Intended Audience :: Developers License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programmin...
true
true
1c0a2d8c4f16125666d307c4c89a64b3f80275f5
21,963
py
Python
rally/plugins/openstack/cleanup/resources.py
amit0701/rally
1da36daea703d05fa1227c2e3675e08663e83726
[ "Apache-2.0" ]
null
null
null
rally/plugins/openstack/cleanup/resources.py
amit0701/rally
1da36daea703d05fa1227c2e3675e08663e83726
[ "Apache-2.0" ]
null
null
null
rally/plugins/openstack/cleanup/resources.py
amit0701/rally
1da36daea703d05fa1227c2e3675e08663e83726
[ "Apache-2.0" ]
null
null
null
# Copyright 2014: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
30.419668
79
0.662933
from boto import exception as boto_exception from neutronclient.common import exceptions as neutron_exceptions from saharaclient.api import base as saharaclient_base from rally.common import logging from rally.common.plugin import discover from rally.common import utils from rally.plugins.openstack.cleanup import bas...
true
true
1c0a2ed3dc3c51f00e93cf747da163d0eb629a57
2,888
py
Python
raspisump/todaychart.py
bdevy/raspi-sump
78d0101808e54ea091a43f9142cdc7d8c31804b0
[ "MIT" ]
null
null
null
raspisump/todaychart.py
bdevy/raspi-sump
78d0101808e54ea091a43f9142cdc7d8c31804b0
[ "MIT" ]
null
null
null
raspisump/todaychart.py
bdevy/raspi-sump
78d0101808e54ea091a43f9142cdc7d8c31804b0
[ "MIT" ]
null
null
null
'''Graph sump pit activity.''' # Raspi-sump, a sump pump monitoring system. # Al Audet # http://www.linuxnorth.org/raspi-sump/ # # All configuration changes should be done in raspisump.conf # MIT License -- http://www.linuxnorth.org/raspi-sump/license.html import time import numpy as np import matplotlib as mpl mpl.u...
31.736264
93
0.646814
import time import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import matplotlib.dates as mdates from matplotlib import rcParams rcParams.update({'figure.autolayout': True}) try: import ConfigParser as configparser except ImportError: import configparser config = confi...
true
true
1c0a2f7ba60fa02d831a63171ce1abce1f3b133f
2,179
py
Python
network/idanet.py
nitsaick/pytorch-kit
ebbbc228e2dbae37a055de0d40580140d5a51613
[ "MIT" ]
null
null
null
network/idanet.py
nitsaick/pytorch-kit
ebbbc228e2dbae37a055de0d40580140d5a51613
[ "MIT" ]
null
null
null
network/idanet.py
nitsaick/pytorch-kit
ebbbc228e2dbae37a055de0d40580140d5a51613
[ "MIT" ]
null
null
null
import torch import torch.nn as nn from .subnet import DoubleConv, PlainNode2 class IDANet(nn.Module): def __init__(self, in_ch, out_ch, base_ch=64): super(IDANet, self).__init__() self.maxpool = nn.MaxPool2d(kernel_size=2, stride=2) self.Conv2 = DoubleConv(in_ch=in_ch, out_ch=base_ch *...
32.522388
86
0.593391
import torch import torch.nn as nn from .subnet import DoubleConv, PlainNode2 class IDANet(nn.Module): def __init__(self, in_ch, out_ch, base_ch=64): super(IDANet, self).__init__() self.maxpool = nn.MaxPool2d(kernel_size=2, stride=2) self.Conv2 = DoubleConv(in_ch=in_ch, out_ch=base_ch *...
true
true
1c0a2f917e70dc164d1e70738e85c07e84a05311
92
py
Python
python/hello-world/tests/test_hello_world.py
jrpotter/flake-templates
82799f9fe3ee9d2cfc28550aef74e759a5d5534d
[ "Apache-2.0" ]
null
null
null
python/hello-world/tests/test_hello_world.py
jrpotter/flake-templates
82799f9fe3ee9d2cfc28550aef74e759a5d5534d
[ "Apache-2.0" ]
null
null
null
python/hello-world/tests/test_hello_world.py
jrpotter/flake-templates
82799f9fe3ee9d2cfc28550aef74e759a5d5534d
[ "Apache-2.0" ]
null
null
null
from hello_world import __version__ def test_version(): assert __version__ == '0.1.0'
15.333333
35
0.728261
from hello_world import __version__ def test_version(): assert __version__ == '0.1.0'
true
true
1c0a316115eb5128491f79a07389b1e6e45a538a
4,656
py
Python
pycytools/plots.py
BodenmillerGroup/pycytools
a79ed661a672fa15831830efa9c4c3bb7018b29d
[ "BSD-3-Clause" ]
null
null
null
pycytools/plots.py
BodenmillerGroup/pycytools
a79ed661a672fa15831830efa9c4c3bb7018b29d
[ "BSD-3-Clause" ]
null
null
null
pycytools/plots.py
BodenmillerGroup/pycytools
a79ed661a672fa15831830efa9c4c3bb7018b29d
[ "BSD-3-Clause" ]
null
null
null
import matplotlib.pyplot as plt import numpy as np from scipy.ndimage.filters import gaussian_filter import pycytools.library as lib def plot_rgb_imc(imc_img, metals, norm_perc=99.9, sigma=1, outlierthresh=30, saturation=1): plt.figure() imgstack = [imc_img.get_img_by_metal(m) for m in metals] imgstack =...
38.163934
126
0.637672
import matplotlib.pyplot as plt import numpy as np from scipy.ndimage.filters import gaussian_filter import pycytools.library as lib def plot_rgb_imc(imc_img, metals, norm_perc=99.9, sigma=1, outlierthresh=30, saturation=1): plt.figure() imgstack = [imc_img.get_img_by_metal(m) for m in metals] imgstack =...
true
true
1c0a34a924f1ff03e6a2c61e660939c624b7d3cf
4,755
py
Python
test/core/test_verify.py
SabineEmbacher/xcube
25863c713a27f1ecf6efb25ee0de8d322ab295bc
[ "MIT" ]
97
2018-06-26T13:02:55.000Z
2022-03-26T21:03:13.000Z
test/core/test_verify.py
SabineEmbacher/xcube
25863c713a27f1ecf6efb25ee0de8d322ab295bc
[ "MIT" ]
524
2018-11-09T12:00:08.000Z
2022-03-31T17:00:13.000Z
test/core/test_verify.py
SabineEmbacher/xcube
25863c713a27f1ecf6efb25ee0de8d322ab295bc
[ "MIT" ]
15
2019-07-09T08:46:03.000Z
2022-02-07T18:47:34.000Z
import unittest import numpy as np import xarray as xr from xcube.core.new import new_cube from xcube.core.verify import verify_cube, assert_cube class AssertAndVerifyCubeTest(unittest.TestCase): def test_assert_cube_ok(self): cube = new_cube(variables=dict(precipitation=0.5)) self.assertIs(cub...
49.53125
127
0.561094
import unittest import numpy as np import xarray as xr from xcube.core.new import new_cube from xcube.core.verify import verify_cube, assert_cube class AssertAndVerifyCubeTest(unittest.TestCase): def test_assert_cube_ok(self): cube = new_cube(variables=dict(precipitation=0.5)) self.assertIs(cub...
true
true
1c0a34f6a5f6b0c6eacb24d227a3ee8fb8e24df4
5,522
py
Python
supply-chain/example/tokenize-upsqv.py
ryjones/blockchain-carbon-accounting
02948f492be7d8c9018a79d467fb8730c8db11f9
[ "Apache-2.0" ]
null
null
null
supply-chain/example/tokenize-upsqv.py
ryjones/blockchain-carbon-accounting
02948f492be7d8c9018a79d467fb8730c8db11f9
[ "Apache-2.0" ]
null
null
null
supply-chain/example/tokenize-upsqv.py
ryjones/blockchain-carbon-accounting
02948f492be7d8c9018a79d467fb8730c8db11f9
[ "Apache-2.0" ]
null
null
null
import argparse import json from datetime import datetime import db import supply_chain_api from common import logging # Note: Quantum View is a UPS service, so all deliveries are from UPS and have a UPS tracking number CARRIER_PARTY_ID = "UPS" def tokenize_emissions(conn, from_date, thru_date, issuee): json_fil...
41.208955
109
0.551793
import argparse import json from datetime import datetime import db import supply_chain_api from common import logging CARRIER_PARTY_ID = "UPS" def tokenize_emissions(conn, from_date, thru_date, issuee): json_file_name = '/tmp/tokenize_qv_input.json' from_timestamp = datetime.strptime(from_date, '%Y-%m-%d %H...
true
true
1c0a35b7cba5444edbd498a344e3e22d9b6a058c
6,227
py
Python
tastypie/utils/validate_jsonp.py
gugu/django-tastypie
0dabd2e432ca167358139f0a610ecadb5368f8cc
[ "BSD-3-Clause" ]
null
null
null
tastypie/utils/validate_jsonp.py
gugu/django-tastypie
0dabd2e432ca167358139f0a610ecadb5368f8cc
[ "BSD-3-Clause" ]
null
null
null
tastypie/utils/validate_jsonp.py
gugu/django-tastypie
0dabd2e432ca167358139f0a610ecadb5368f8cc
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- # Placed into the Public Domain by tav <tav@espians.com> """Validate Javascript Identifiers for use as JSON-P callback parameters.""" import re from unicodedata import category # ------------------------------------------------------------------------------ # javascript identifier unicode c...
29.372642
80
0.548418
import re from unicodedata import category valid_jsid_categories_start = frozenset([ 'Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl' ]) valid_jsid_categories = frozenset([ 'Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', 'Mn', 'Mc', 'Nd', 'Pc' ]) valid_jsid_chars = ('$', '_') array_index_regex = re.compile(r'\[[0-9]+\]...
true
true
1c0a361bdb42958569ea25ebe4fa0f657ddd6ed3
7,250
py
Python
apps/ssd-object-detector/ssd-object-detector.py
zhang-xin/ncappzoo
3b46ae583556378eff27d08f545726507557cd38
[ "MIT" ]
null
null
null
apps/ssd-object-detector/ssd-object-detector.py
zhang-xin/ncappzoo
3b46ae583556378eff27d08f545726507557cd38
[ "MIT" ]
null
null
null
apps/ssd-object-detector/ssd-object-detector.py
zhang-xin/ncappzoo
3b46ae583556378eff27d08f545726507557cd38
[ "MIT" ]
null
null
null
#!/usr/bin/python3 # **************************************************************************** # Copyright(c) 2017 Intel Corporation. # License: MIT See LICENSE file in root directory. # **************************************************************************** # How to run Single Shot Multibox Detectors (SSD) ...
34.855769
89
0.54731
import os import sys import numpy import ntpath import argparse import skimage.io import skimage.transform import mvnc.mvncapi as mvnc curr_path = os.path.dirname(os.path.realpath(__file__)) util_path = curr_path.replace(os.path.basename(curr_path), 'utils') sys.path.append(util_path) import visualize_output impor...
true
true
1c0a366bc9de235dbe1de22f8d9c61661ee994e5
2,396
py
Python
_pysh/shell.py
etianen/py.sh
8172cc39508bd8ead68af20cdcfe96a6d2583fb5
[ "MIT" ]
3
2018-12-18T23:21:30.000Z
2021-12-24T05:37:18.000Z
_pysh/shell.py
etianen/py.sh
8172cc39508bd8ead68af20cdcfe96a6d2583fb5
[ "MIT" ]
35
2016-03-27T20:42:12.000Z
2017-10-17T10:57:27.000Z
_pysh/shell.py
etianen/py.sh
8172cc39508bd8ead68af20cdcfe96a6d2583fb5
[ "MIT" ]
6
2016-06-07T11:43:02.000Z
2021-12-24T05:37:24.000Z
import os import shlex import signal import subprocess from _pysh.config import CONFIG_PREFIX from _pysh.tasks import TaskError from _pysh.styles import apply_styles def create_env(opts): # Strip out py.sh config variables. env = { key: value for key, value in os.environ.items() ...
29.95
117
0.623122
import os import shlex import signal import subprocess from _pysh.config import CONFIG_PREFIX from _pysh.tasks import TaskError from _pysh.styles import apply_styles def create_env(opts): env = { key: value for key, value in os.environ.items() if not key.startswith(CONFIG_PREFI...
true
true
1c0a37dccdeb744a6b2ce63fb88453284f35a866
410
py
Python
scripts/transform_old_task_list.py
ROpdebee/CAA-Auditor
2fb33f792dcc9ee711ebaf6532e67b85ff79cd40
[ "MIT" ]
null
null
null
scripts/transform_old_task_list.py
ROpdebee/CAA-Auditor
2fb33f792dcc9ee711ebaf6532e67b85ff79cd40
[ "MIT" ]
null
null
null
scripts/transform_old_task_list.py
ROpdebee/CAA-Auditor
2fb33f792dcc9ee711ebaf6532e67b85ff79cd40
[ "MIT" ]
null
null
null
"""One-off script to transform an old task list.""" import json import os import sys from tqdm import tqdm SRC = sys.argv[1] OUT = sys.argv[2] with open(OUT, 'w') as out_f, open(SRC, 'r') as src_f: for line in tqdm(src_f): old_data = json.loads(line) new_data = {'state': 'active', 'id': old_data...
24.117647
87
0.643902
import json import os import sys from tqdm import tqdm SRC = sys.argv[1] OUT = sys.argv[2] with open(OUT, 'w') as out_f, open(SRC, 'r') as src_f: for line in tqdm(src_f): old_data = json.loads(line) new_data = {'state': 'active', 'id': old_data['release_gid'], 'data': old_data} out_f.wri...
true
true
1c0a39d828f6fdeb9dd74b82e1cbd1278b8c7e5f
8,332
py
Python
code/problem_set_03/problem_set_03.py
sabrina0601/SI506-2020Winter
197526b9d4b9dc4673aaabf1a2f2bf1055cccf7d
[ "BSD-3-Clause" ]
null
null
null
code/problem_set_03/problem_set_03.py
sabrina0601/SI506-2020Winter
197526b9d4b9dc4673aaabf1a2f2bf1055cccf7d
[ "BSD-3-Clause" ]
null
null
null
code/problem_set_03/problem_set_03.py
sabrina0601/SI506-2020Winter
197526b9d4b9dc4673aaabf1a2f2bf1055cccf7d
[ "BSD-3-Clause" ]
null
null
null
# START PROBLEM SET 03 # PROBLEM 1: # SETUP # You will work with a list of nintendo consoles for problem 1 and 2. The list # contains an element for each nintendo television console released, followed by # information on when that console was released. For example, the first element # of the <nintendo_consoles> list ...
41.044335
109
0.730557
# System" console, which was released in 1983. nintendo_consoles = ["Famicom/Nintendo Entertainment System (NES), released: 1983", "Super Famicom/Super Nintendo Entertainment System (SNES), released: 1990", "Nintendo 64 (N64), released: 1996", "GameCube, rel...
true
true
1c0a3a36a39c4a552d10e9b3276c235b8833c112
577
py
Python
tools/run_tests/xds_k8s_test_driver/tests/__init__.py
warlock135/grpc
81e13e4fa9c0cdf7dc131ce548e1604c895b738c
[ "Apache-2.0" ]
36,552
2015-02-26T17:30:13.000Z
2022-03-31T22:41:33.000Z
tools/run_tests/xds_k8s_test_driver/tests/__init__.py
SanjanaSingh897/grpc
2d858866eb95ce5de8ccc8c35189a12733d8ca79
[ "Apache-2.0" ]
23,536
2015-02-26T17:50:56.000Z
2022-03-31T23:39:42.000Z
tools/run_tests/xds_k8s_test_driver/tests/__init__.py
SanjanaSingh897/grpc
2d858866eb95ce5de8ccc8c35189a12733d8ca79
[ "Apache-2.0" ]
11,050
2015-02-26T17:22:10.000Z
2022-03-31T10:12:35.000Z
# Copyright 2020 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
41.214286
74
0.762565
true
true
1c0a3bd18ef0fadf25d6fa2407a8dbac580cfc3f
9,632
py
Python
nemo/collections/asr/parts/submodules/tdnn_attention.py
JMichaelStringer/NeMo
b5b29a69ccb0ec3d8c9ace2f33872ee99858a559
[ "Apache-2.0" ]
2
2021-06-23T19:16:59.000Z
2022-02-23T18:49:07.000Z
nemo/collections/asr/parts/submodules/tdnn_attention.py
JMichaelStringer/NeMo
b5b29a69ccb0ec3d8c9ace2f33872ee99858a559
[ "Apache-2.0" ]
null
null
null
nemo/collections/asr/parts/submodules/tdnn_attention.py
JMichaelStringer/NeMo
b5b29a69ccb0ec3d8c9ace2f33872ee99858a559
[ "Apache-2.0" ]
1
2022-01-07T03:39:11.000Z
2022-01-07T03:39:11.000Z
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
34.4
126
0.635797
from typing import List import torch from numpy import inf from torch import nn as nn from torch.nn import functional as F from nemo.collections.asr.parts.submodules.jasper import get_same_padding, init_weights class StatsPoolLayer(nn.Module): def __init__(self, feat_in: int, pool_mode: str = 'xvector'): ...
true
true
1c0a3bdad9d1549707a6c2d19adc64d3111c285c
4,699
py
Python
Tools/updateseeddatabase.py
steveknipmeyer/ModelRelief
a3d067e0ed39a3a8ca78896c21eaa3e7293b15a2
[ "MIT" ]
null
null
null
Tools/updateseeddatabase.py
steveknipmeyer/ModelRelief
a3d067e0ed39a3a8ca78896c21eaa3e7293b15a2
[ "MIT" ]
null
null
null
Tools/updateseeddatabase.py
steveknipmeyer/ModelRelief
a3d067e0ed39a3a8ca78896c21eaa3e7293b15a2
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ .. module:: UpdateSeedDatabase :synopsis: Update the JSON .. moduleauthor:: Steve Knipmeyer <steve@modelrelief.org> """ import argparse import ast import json import os import subprocess import sys from enum import Enum from typing import List from environment import EnvironmentNames, En...
32.184932
137
0.628219
import argparse import ast import json import os import subprocess import sys from enum import Enum from typing import List from environment import EnvironmentNames, Environment from logger import Logger from tools import Colors, Tools class UpdateSeedDatabase: def __init__(self, arguments): self.logger ...
true
true
1c0a3cae7c121b2402991c4a573ec52d07696257
7,367
py
Python
plaso/formatters/yaml_formatters_file.py
nflexfo/plaso
5da7aa51c39b593773687fdf20a93ba35fc492b4
[ "Apache-2.0" ]
1
2020-12-04T10:26:34.000Z
2020-12-04T10:26:34.000Z
plaso/formatters/yaml_formatters_file.py
nflexfo/plaso
5da7aa51c39b593773687fdf20a93ba35fc492b4
[ "Apache-2.0" ]
null
null
null
plaso/formatters/yaml_formatters_file.py
nflexfo/plaso
5da7aa51c39b593773687fdf20a93ba35fc492b4
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """YAML-based formatters file.""" from __future__ import unicode_literals import io import yaml from plaso.formatters import interface from plaso.lib import errors class YAMLFormattersFile(object): """YAML-based formatters file. A YAML-based formatters file contains one or more event f...
34.425234
79
0.711144
from __future__ import unicode_literals import io import yaml from plaso.formatters import interface from plaso.lib import errors class YAMLFormattersFile(object): _SUPPORTED_KEYS = frozenset([ 'data_type', 'enumeration_helpers', 'flags_helpers', 'message', 'separator', 'shor...
true
true
1c0a3cb7559e94b122c04b144cef7d7bbc7926ea
2,115
py
Python
simp_py_examples/m5stack/ex024_scope.py
kcfkwok2003/Simp_py
f75e66da01b45dc8688dda602f8b33d4258f0c31
[ "MIT" ]
null
null
null
simp_py_examples/m5stack/ex024_scope.py
kcfkwok2003/Simp_py
f75e66da01b45dc8688dda602f8b33d4258f0c31
[ "MIT" ]
null
null
null
simp_py_examples/m5stack/ex024_scope.py
kcfkwok2003/Simp_py
f75e66da01b45dc8688dda602f8b33d4258f0c31
[ "MIT" ]
null
null
null
# ex_scope.py # author: C.F.Kwok # date: 2018-2-23 from simp_py import tft from math import sin, radians VOLT_F=1.4/419 PCOLOR=0xffff class SCOPE: global tft, PCOLOR,VOLT_F def __init__(self,inp,ref): from machine import Pin,ADC,DAC self.out = Pin(ref,Pin.OUT) self.dac = DAC(self.out) ...
24.034091
66
0.498818
from simp_py import tft from math import sin, radians VOLT_F=1.4/419 PCOLOR=0xffff class SCOPE: global tft, PCOLOR,VOLT_F def __init__(self,inp,ref): from machine import Pin,ADC,DAC self.out = Pin(ref,Pin.OUT) self.dac = DAC(self.out) self.inp = ADC(Pin(inp,Pin.IN)) self...
true
true
1c0a3cf2a0fb591763b1fc12652f41bf10a41d11
4,474
py
Python
models/transformer/encoders.py
XuMengyaAmy/CIDACaptioning
1b5446e9db1aaea524fe3645da947eb5c33413cf
[ "BSD-3-Clause" ]
3
2022-02-01T12:54:03.000Z
2022-02-12T23:43:32.000Z
models/transformer/encoders.py
XuMengyaAmy/CIDACaptioning
1b5446e9db1aaea524fe3645da947eb5c33413cf
[ "BSD-3-Clause" ]
null
null
null
models/transformer/encoders.py
XuMengyaAmy/CIDACaptioning
1b5446e9db1aaea524fe3645da947eb5c33413cf
[ "BSD-3-Clause" ]
null
null
null
from torch.nn import functional as F from models.transformer.utils import PositionWiseFeedForward import torch from torch import nn from models.transformer.attention import MultiHeadAttention from models.transformer.gaussian_kernel import get_gaussian_filter class EncoderLayer(nn.Module): def __init__(self, d_mode...
39.245614
119
0.645731
from torch.nn import functional as F from models.transformer.utils import PositionWiseFeedForward import torch from torch import nn from models.transformer.attention import MultiHeadAttention from models.transformer.gaussian_kernel import get_gaussian_filter class EncoderLayer(nn.Module): def __init__(self, d_mode...
true
true
1c0a3d38a564a0a2a36870b4a59168fac6ed109e
897
py
Python
share/qt/clean_mac_info_plist.py
vahagnii/vologold-VLG
19ccbf60a426cdbc7e05e238223487a7deb2c5a7
[ "MIT" ]
null
null
null
share/qt/clean_mac_info_plist.py
vahagnii/vologold-VLG
19ccbf60a426cdbc7e05e238223487a7deb2c5a7
[ "MIT" ]
null
null
null
share/qt/clean_mac_info_plist.py
vahagnii/vologold-VLG
19ccbf60a426cdbc7e05e238223487a7deb2c5a7
[ "MIT" ]
null
null
null
#!/usr/bin/env python # Jonas Schnelli, 2013 # make sure the Vologold-Qt.app contains the right plist (including the right version) # fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267) from string import Template from datetime import date bitcoinDir = "./"; in...
29.9
109
0.725753
from string import Template from datetime import date bitcoinDir = "./"; inFile = bitcoinDir+"/share/qt/Info.plist" outFile = "Vologold-Qt.app/Contents/Info.plist" version = "unknown"; fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro" for line in open(fileForGrabbingVersion): lineArr = line.replace(" ...
false
true
1c0a3e00658fb196a2f778855bf54ccda2d7dfc9
4,719
py
Python
aw/settings.py
Kihara-tony/Awward
54649910b5706a75a7e881de04ae1ad2dc416885
[ "Unlicense" ]
null
null
null
aw/settings.py
Kihara-tony/Awward
54649910b5706a75a7e881de04ae1ad2dc416885
[ "Unlicense" ]
4
2020-02-12T03:04:06.000Z
2021-06-10T21:47:03.000Z
aw/settings.py
Kihara-tony/Awward
54649910b5706a75a7e881de04ae1ad2dc416885
[ "Unlicense" ]
null
null
null
""" Django settings for aw project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os import...
25.508108
91
0.689129
import os import django_heroku import dj_database_url from decouple import config,Csv BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) MODE=config("MODE", default="dev") SECRET_KEY = config('SECRET_KEY') DEBUG = config('DEBUG', default=False, cast=bool) if config('MODE')=="dev": DATABASES =...
true
true
1c0a3e84c674e6f6c66ef4c39d53278a1117f653
594
py
Python
gdsfactory/simulation/modes/test_find_modes_dispersion.py
gdsfactory/gdsfactory
e53b1f3415a81862d465e0443fc09fb35d14d1e0
[ "MIT" ]
42
2020-05-25T09:33:45.000Z
2022-03-29T03:41:19.000Z
gdsfactory/simulation/modes/test_find_modes_dispersion.py
gdsfactory/gdsfactory
ee761ae0b4429fbec7035bbea5d1e5206c66bea7
[ "MIT" ]
133
2020-05-28T18:29:04.000Z
2022-03-31T22:21:42.000Z
gdsfactory/simulation/modes/test_find_modes_dispersion.py
gdsfactory/gdsfactory
ee761ae0b4429fbec7035bbea5d1e5206c66bea7
[ "MIT" ]
17
2020-06-30T07:07:50.000Z
2022-03-17T15:45:27.000Z
import numpy as np from gdsfactory.simulation.modes.find_mode_dispersion import find_mode_dispersion from gdsfactory.simulation.modes.get_mode_solver_rib import get_mode_solver_rib def test_find_modes_dispersion(): ms = get_mode_solver_rib(wg_width=0.45) modes = find_mode_dispersion(mode_solver=ms) m1 = ...
24.75
81
0.740741
import numpy as np from gdsfactory.simulation.modes.find_mode_dispersion import find_mode_dispersion from gdsfactory.simulation.modes.get_mode_solver_rib import get_mode_solver_rib def test_find_modes_dispersion(): ms = get_mode_solver_rib(wg_width=0.45) modes = find_mode_dispersion(mode_solver=ms) m1 = ...
true
true
1c0a3e9e9b80903c31534ce8959d14997f48bc12
302
py
Python
cribbage/cribbage/player.py
ebenpack/laboratory
75b83be52e2cefc2050f243b9c036eb061714829
[ "MIT" ]
8
2015-03-23T15:36:06.000Z
2021-02-19T22:23:09.000Z
cribbage/cribbage/player.py
ebenpack/laboratory
75b83be52e2cefc2050f243b9c036eb061714829
[ "MIT" ]
null
null
null
cribbage/cribbage/player.py
ebenpack/laboratory
75b83be52e2cefc2050f243b9c036eb061714829
[ "MIT" ]
1
2019-06-07T22:51:19.000Z
2019-06-07T22:51:19.000Z
class Player(object): def __init__(self, name): self.name = name self.score = 0 self.hand = None def __repr__(self): return "Player: {}, score: {}, hand: {}".format(self.name, self.score, self.hand) def add_score(self, points): self.score += points
27.454545
89
0.576159
class Player(object): def __init__(self, name): self.name = name self.score = 0 self.hand = None def __repr__(self): return "Player: {}, score: {}, hand: {}".format(self.name, self.score, self.hand) def add_score(self, points): self.score += points
true
true
1c0a3f4cdabc175563a309611bc2c9f78226fc66
2,229
py
Python
src/size_comparison.py
StoneSwine/Segmentt
5bb1076b4ced3b108481994caf78461bcd60eb22
[ "MIT" ]
null
null
null
src/size_comparison.py
StoneSwine/Segmentt
5bb1076b4ced3b108481994caf78461bcd60eb22
[ "MIT" ]
null
null
null
src/size_comparison.py
StoneSwine/Segmentt
5bb1076b4ced3b108481994caf78461bcd60eb22
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import os import cv2 import matplotlib.pyplot as plt # finseg imports from Segmentt.flooding import segment_image def run_segment_image(): # The directory containing this file HERE = os.path.dirname(__file__) bh_maxv = [] bw_maxv = [] # The baseline images must be inspected manuall...
33.268657
112
0.674293
import os import cv2 import matplotlib.pyplot as plt from Segmentt.flooding import segment_image def run_segment_image(): HERE = os.path.dirname(__file__) bh_maxv = [] bw_maxv = [] print("#Baseline:") for filename in os.listdir(HERE + '/baseline/'): if filename.endswith(".jpg") or filename.endswi...
true
true
1c0a3f609efc4a6b56b6031c0ceadd1ca6b878e1
8,174
py
Python
custom_components/ble_monitor/bt_helpers.py
freemanix/ble_monitor
11190397d38adbb8cbf876ed111c5655c6e41e5f
[ "MIT" ]
null
null
null
custom_components/ble_monitor/bt_helpers.py
freemanix/ble_monitor
11190397d38adbb8cbf876ed111c5655c6e41e5f
[ "MIT" ]
null
null
null
custom_components/ble_monitor/bt_helpers.py
freemanix/ble_monitor
11190397d38adbb8cbf876ed111c5655c6e41e5f
[ "MIT" ]
null
null
null
"""Helpers for ble_monitor.""" import logging import subprocess import time _LOGGER = logging.getLogger(__name__) # Bluetooth interfaces available on the system def hci_get_mac(interface_list=[0]): """Get dict of available bluetooth interfaces, returns hci and mac.""" btaddress_dict = {} output = subproc...
35.385281
133
0.648153
import logging import subprocess import time _LOGGER = logging.getLogger(__name__) def hci_get_mac(interface_list=[0]): btaddress_dict = {} output = subprocess.run( ["hciconfig"], stdout=subprocess.PIPE, check=True ).stdout.decode("utf-8") for interface in interface_list: hci_id = "h...
true
true
1c0a3fee734261b75c81a2e89002c60a506a9807
4,170
py
Python
sdk/python/pulumi_azure_native/dataprotection/v20210701/get_backup_instance.py
polivbr/pulumi-azure-native
09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/dataprotection/v20210701/get_backup_instance.py
polivbr/pulumi-azure-native
09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/dataprotection/v20210701/get_backup_instance.py
polivbr/pulumi-azure-native
09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
34.180328
150
0.652518
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . import outputs __all__ = [ 'GetBackupInstanceResult', 'AwaitableGetBackupInstanceResult', 'get_backup_instance', ] @pulumi.output_type class GetBackup...
true
true
1c0a412a53dc547725c354803a630549e998e830
5,951
py
Python
layers/modules/multibox_loss.py
foreverxq/my_1conv
a42390c3854fee7ba733b3a7d8872c0ae4112c6e
[ "MIT" ]
null
null
null
layers/modules/multibox_loss.py
foreverxq/my_1conv
a42390c3854fee7ba733b3a7d8872c0ae4112c6e
[ "MIT" ]
null
null
null
layers/modules/multibox_loss.py
foreverxq/my_1conv
a42390c3854fee7ba733b3a7d8872c0ae4112c6e
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from data import coco as cfg # from ..box_utils import match, log_sum_exp from layers.box_utils import match, log_sum_exp class MultiBoxLoss(nn.Module): """SSD损失函数 计算目标: 1)对于目标...
45.776923
148
0.609982
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from data import coco as cfg from layers.box_utils import match, log_sum_exp class MultiBoxLoss(nn.Module): def __init__(self, num_classes, overlap_thresh, prior_for_matching, bkg_label, neg_min...
true
true
1c0a419b51694d0f4781cfebf7e3408628e3991b
9,159
py
Python
miper/wsgi/common.py
MountainWei/miper
4dd6df51cb0e7d041b8dc7decebbcfb47a79f210
[ "Apache-2.0" ]
1
2016-01-13T04:23:20.000Z
2016-01-13T04:23:20.000Z
miper/wsgi/common.py
MountainWei/miper
4dd6df51cb0e7d041b8dc7decebbcfb47a79f210
[ "Apache-2.0" ]
1
2015-12-17T09:58:04.000Z
2016-08-01T15:23:27.000Z
miper/wsgi/common.py
MountainWei/miper
4dd6df51cb0e7d041b8dc7decebbcfb47a79f210
[ "Apache-2.0" ]
null
null
null
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
32.136842
79
0.638934
import sys from oslo_config import cfg from oslo_log import log as logging from paste import deploy import routes.middleware import webob.dec import webob.exc from miper import exception from miper.i18n import _, _LE from miper import utils CONF = cfg.CONF LOG = logging.getLogger(__name__) class Request(webob.Re...
true
true
1c0a41fe818127c6f8f933bd9450fa8327a8afc4
3,647
py
Python
experiments/explorations/experiments/experiment_000109/repetition_000009/experiment_config.py
flowersteam/automated_discovery_of_lenia_patterns
97cc7cde2120fa95225d1e470e00b8aa8c034e97
[ "MIT" ]
10
2019-10-05T16:22:11.000Z
2021-12-30T14:09:42.000Z
experiments/explorations/experiments/experiment_000109/repetition_000009/experiment_config.py
flowersteam/automated_discovery_of_lenia_patterns
97cc7cde2120fa95225d1e470e00b8aa8c034e97
[ "MIT" ]
null
null
null
experiments/explorations/experiments/experiment_000109/repetition_000009/experiment_config.py
flowersteam/automated_discovery_of_lenia_patterns
97cc7cde2120fa95225d1e470e00b8aa8c034e97
[ "MIT" ]
2
2019-10-14T12:12:38.000Z
2020-09-16T11:18:26.000Z
import autodisc as ad def get_system_parameters(): system_parameters = ad.systems.Lenia.default_system_parameters() system_parameters.size_y = 256 system_parameters.size_x = 256 return system_parameters def get_explorer_config(): explorer_config = ad.explorers.GoalSpaceExplorer.default_config(...
38.797872
205
0.711544
import autodisc as ad def get_system_parameters(): system_parameters = ad.systems.Lenia.default_system_parameters() system_parameters.size_y = 256 system_parameters.size_x = 256 return system_parameters def get_explorer_config(): explorer_config = ad.explorers.GoalSpaceExplorer.default_config(...
true
true
1c0a42533a6a38396a3878d95dc7dd9ff2e39e67
10,360
py
Python
main.py
LucStrater/RusHourOnAutoPilot
cd599cafe6eb688342ede53416e5507f4ebee394
[ "MIT" ]
null
null
null
main.py
LucStrater/RusHourOnAutoPilot
cd599cafe6eb688342ede53416e5507f4ebee394
[ "MIT" ]
1
2021-06-10T12:56:37.000Z
2021-06-10T12:56:37.000Z
main.py
LucStrater/RusHourOnAutoPilot
cd599cafe6eb688342ede53416e5507f4ebee394
[ "MIT" ]
2
2021-06-01T08:57:33.000Z
2021-06-01T09:04:35.000Z
from code.classes.model import Model from code.classes.generate import Generate from code.output.pygame_viz import Visualizer from code.algorithms import depth_first as df from code.algorithms import breadth_first as bf from code.algorithms import iterative_deepening as itd from code.algorithms import randomise as rd f...
32.993631
176
0.618533
from code.classes.model import Model from code.classes.generate import Generate from code.output.pygame_viz import Visualizer from code.algorithms import depth_first as df from code.algorithms import breadth_first as bf from code.algorithms import iterative_deepening as itd from code.algorithms import randomise as rd f...
true
true
1c0a434bb68c8cc5cda6aa09e913034db59a3d3c
15,304
py
Python
pytest_testlink_adaptor.py
ichalkov/pytest-testlink-adaptor
dfd25066ccb36a482f57d0fe0fa08138202012e4
[ "MIT" ]
null
null
null
pytest_testlink_adaptor.py
ichalkov/pytest-testlink-adaptor
dfd25066ccb36a482f57d0fe0fa08138202012e4
[ "MIT" ]
7
2020-12-16T14:51:10.000Z
2020-12-23T17:35:49.000Z
pytest_testlink_adaptor.py
ichalkov/pytest-testlink-adaptor
dfd25066ccb36a482f57d0fe0fa08138202012e4
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ pytest-testlink-adaptor *********************** """ from __future__ import print_function import os import sys import re from collections import defaultdict from path import Path import pytest import testlink from testlink import TestLinkError import ssl if sys.version_info[0] < 3: ...
32.28692
96
0.573968
from __future__ import print_function import os import sys import re from collections import defaultdict from path import Path import pytest import testlink from testlink import TestLinkError import ssl if sys.version_info[0] < 3: import ConfigParser as configparser configparser.ConfigParser = configpars...
true
true