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
1c067f84f976e3970340b1779dde12a52a0213b3
971
py
Python
neptune/internal/hardware/metrics/reports/metric_reporter_factory.py
Raalsky/neptune-client
24ac58581774e61056d49cd1a22727799c14ad54
[ "Apache-2.0" ]
254
2020-01-27T14:18:57.000Z
2022-03-31T21:40:33.000Z
neptune/internal/hardware/metrics/reports/metric_reporter_factory.py
Raalsky/neptune-client
24ac58581774e61056d49cd1a22727799c14ad54
[ "Apache-2.0" ]
160
2020-02-05T11:00:22.000Z
2022-03-31T08:50:24.000Z
neptune/internal/hardware/metrics/reports/metric_reporter_factory.py
Raalsky/neptune-client
24ac58581774e61056d49cd1a22727799c14ad54
[ "Apache-2.0" ]
23
2020-02-07T09:19:50.000Z
2022-02-15T09:52:56.000Z
# # Copyright (c) 2019, Neptune Labs Sp. z o.o. # # 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 agr...
35.962963
84
0.751802
from neptune.internal.hardware.metrics.reports.metric_reporter import MetricReporter class MetricReporterFactory(object): def __init__(self, reference_timestamp): self.__reference_timestamp = reference_timestamp def create(self, metrics): return MetricReporter( metrics=metrics, re...
true
true
1c0680135e94dbc5b3d2dddefdced980a7d4a5e0
5,652
py
Python
security_monkey/scheduler.py
bungoume/security_monkey
90c02638a315c78535869ab71a8859d17e011a6a
[ "Apache-2.0" ]
null
null
null
security_monkey/scheduler.py
bungoume/security_monkey
90c02638a315c78535869ab71a8859d17e011a6a
[ "Apache-2.0" ]
null
null
null
security_monkey/scheduler.py
bungoume/security_monkey
90c02638a315c78535869ab71a8859d17e011a6a
[ "Apache-2.0" ]
null
null
null
""" .. module: security_monkey.scheduler :platform: Unix :synopsis: Runs watchers, auditors, or reports on demand or on a schedule .. version:: $$VERSION$$ .. moduleauthor:: Patrick Kelley <pkelley@netflix.com> @monkeysecurity """ from apscheduler.threadpool import ThreadPool from apscheduler import events f...
35.325
114
0.676929
from apscheduler.threadpool import ThreadPool from apscheduler import events from apscheduler.scheduler import Scheduler from sqlalchemy.exc import OperationalError, InvalidRequestError, StatementError from security_monkey.datastore import Account, clear_old_exceptions, store_exception from security_monkey.monitors i...
true
true
1c0680c2374142a7c5a15de5d359080d9c532d39
1,914
py
Python
tests/conftest.py
beetrootpaul/corrscope
79f443da068efe3d83b871f226ff8b59083bc8b7
[ "BSD-2-Clause" ]
140
2020-03-12T16:05:35.000Z
2022-03-31T04:21:24.000Z
tests/conftest.py
N-SPC700/corrscope
9e85a33fbede1e53c20f4e05d71384d276c9f9a9
[ "BSD-2-Clause" ]
90
2020-03-21T07:52:33.000Z
2022-03-29T01:52:47.000Z
tests/conftest.py
N-SPC700/corrscope
9e85a33fbede1e53c20f4e05d71384d276c9f9a9
[ "BSD-2-Clause" ]
13
2020-04-20T14:51:33.000Z
2022-03-10T19:14:05.000Z
""" Integration tests found in: - test_cli.py - test_renderer.py - test_output.py """ import os import subprocess from pathlib import Path from typing import TYPE_CHECKING, Optional import pytest if TYPE_CHECKING: import pytest_mock # Pycharm sets cwd to /tests/. # To ensure tests can find WAV files (based on ...
29.446154
85
0.676071
import os import subprocess from pathlib import Path from typing import TYPE_CHECKING, Optional import pytest if TYPE_CHECKING: import pytest_mock os.chdir(Path(__file__).parent.parent) @pytest.fixture def Popen(mocker: "pytest_mock.MockFixture"): real_Popen = subprocess.Popen class MockPopen(real_P...
true
true
1c0680ca57586db1b9a240a6e15763744bb278e3
8,603
py
Python
utils/mcell4_runner/mcell4_runner.py
mcellteam/mcell
3920aec22c55013b78f7d6483b81f70a0d564d22
[ "MIT" ]
25
2015-03-25T16:36:01.000Z
2022-01-17T14:28:43.000Z
utils/mcell4_runner/mcell4_runner.py
mcellteam/mcell
3920aec22c55013b78f7d6483b81f70a0d564d22
[ "MIT" ]
31
2015-02-12T22:15:18.000Z
2022-03-30T22:43:24.000Z
utils/mcell4_runner/mcell4_runner.py
mcellteam/mcell
3920aec22c55013b78f7d6483b81f70a0d564d22
[ "MIT" ]
12
2016-01-15T23:20:19.000Z
2021-02-10T06:18:00.000Z
#!/usr/bin/env python """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdict...
31.862963
108
0.621644
import os import sys import shutil import glob import argparse import itertools import multiprocessing import re import subprocess MCELL_PATH = '' RUNNING_MARKER = 'running.marker' FINISHED_MARKER = 'finished.marker' LOGS_DIR = 'logs' class Options: def __init__(self): self.seeds_str = None self...
true
true
1c068143201f3e0e985d0bc7e347ccc8a0312be2
640
py
Python
18/Blog/blogs/models.py
liqiwa/python_work
3d1198d5616b28a37fee7dfba5bbef0e1d489c2d
[ "Apache-2.0" ]
null
null
null
18/Blog/blogs/models.py
liqiwa/python_work
3d1198d5616b28a37fee7dfba5bbef0e1d489c2d
[ "Apache-2.0" ]
null
null
null
18/Blog/blogs/models.py
liqiwa/python_work
3d1198d5616b28a37fee7dfba5bbef0e1d489c2d
[ "Apache-2.0" ]
null
null
null
from django.db import models from django.contrib.auth.models import User # Create your models here. class Title(models.Model): """bolog信息""" text = models.CharField(max_length=200) date_added = models.DateTimeField(auto_now_add=True) owner = models.ForeignKey(User) def __str__(self): """返回模型的字符串表示""" return se...
27.826087
60
0.734375
from django.db import models from django.contrib.auth.models import User class Title(models.Model): text = models.CharField(max_length=200) date_added = models.DateTimeField(auto_now_add=True) owner = models.ForeignKey(User) def __str__(self): return self.text class BlogPost(models.Model): title = models.Foreign...
true
true
1c06821841cb1ffeb9e908943e2b5698ad247ded
5,439
py
Python
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_backend_svg.py
AbdulHoffmann/carla_carissma
8d382769ffa02a6c61a22c57160285505f5ff0a4
[ "MIT" ]
366
2019-04-07T20:34:48.000Z
2022-03-29T07:35:38.000Z
venv/lib/python3.7/site-packages/matplotlib/tests/test_backend_svg.py
John1001Song/Big-Data-Robo-Adviser
9444dce96954c546333d5aecc92a06c3bfd19aa5
[ "MIT" ]
12
2018-12-06T22:06:49.000Z
2022-02-25T17:40:44.000Z
venv/lib/python3.7/site-packages/matplotlib/tests/test_backend_svg.py
John1001Song/Big-Data-Robo-Adviser
9444dce96954c546333d5aecc92a06c3bfd19aa5
[ "MIT" ]
64
2018-04-25T08:51:57.000Z
2022-01-29T14:13:57.000Z
import numpy as np from io import BytesIO import os import tempfile import xml.parsers.expat import pytest import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison import matplotlib from matplotlib import dviread needs_usetex = pytest.mark.skipif( not matplotlib.checkdep_usetex...
30.728814
79
0.637801
import numpy as np from io import BytesIO import os import tempfile import xml.parsers.expat import pytest import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison import matplotlib from matplotlib import dviread needs_usetex = pytest.mark.skipif( not matplotlib.checkdep_usetex...
true
true
1c06824e1a928947a4aa245340a3abce106604c0
385
py
Python
large.py
shivachoudhary/demo1
a8ee02e4d2d2ad28095afe173d7547f7b5849eca
[ "Apache-2.0" ]
null
null
null
large.py
shivachoudhary/demo1
a8ee02e4d2d2ad28095afe173d7547f7b5849eca
[ "Apache-2.0" ]
null
null
null
large.py
shivachoudhary/demo1
a8ee02e4d2d2ad28095afe173d7547f7b5849eca
[ "Apache-2.0" ]
null
null
null
#usr/bin/python a=int(raw_input("enter the 1st value:::")) b=int(raw_input("enter the 2nd value:::")) c=int(raw_input("enter the 3rd value:::")) if a>b : if a>c: print "1St value is larger than others::",a else: print "3rd is the largest among others:::",c else: if b>c: print "2nd value is larger than othe...
18.333333
46
0.651948
a=int(raw_input("enter the 1st value:::")) b=int(raw_input("enter the 2nd value:::")) c=int(raw_input("enter the 3rd value:::")) if a>b : if a>c: print "1St value is larger than others::",a else: print "3rd is the largest among others:::",c else: if b>c: print "2nd value is larger than others::",b else: ...
false
true
1c06829fb60efa62758386cc17fdd97d45447e8a
743
py
Python
profiles_api/permissions.py
tzox/profiles-rest-api
3dcd3a7a415a015139d317fd82efe0725cecc2ea
[ "MIT" ]
null
null
null
profiles_api/permissions.py
tzox/profiles-rest-api
3dcd3a7a415a015139d317fd82efe0725cecc2ea
[ "MIT" ]
null
null
null
profiles_api/permissions.py
tzox/profiles-rest-api
3dcd3a7a415a015139d317fd82efe0725cecc2ea
[ "MIT" ]
null
null
null
from rest_framework import permissions class UpdateOwnProfile(permissions.BasePermission): """ Allow user to edit their own profile """ def has_object_permission(self, request, view, obj): """ check user is trying to edit their own profile """ if request.method in permissions.SAFE_METHODS: ...
30.958333
65
0.685061
from rest_framework import permissions class UpdateOwnProfile(permissions.BasePermission): def has_object_permission(self, request, view, obj): if request.method in permissions.SAFE_METHODS: return True return obj.id == request.user.id class UpdateOwnStatus(permissions.BasePermiss...
true
true
1c0682f203f92ec213e123b6d472c553bfed0097
2,126
py
Python
python/bin/setup.py
MaterializeInc/pulumi-eks
d4b05f9370462c1a64a0e582e36ef2c1c0a04e77
[ "Apache-2.0" ]
null
null
null
python/bin/setup.py
MaterializeInc/pulumi-eks
d4b05f9370462c1a64a0e582e36ef2c1c0a04e77
[ "Apache-2.0" ]
null
null
null
python/bin/setup.py
MaterializeInc/pulumi-eks
d4b05f9370462c1a64a0e582e36ef2c1c0a04e77
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by pulumi-gen-eks. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import errno from setuptools import setup, find_packages from setuptools.command.install import install from subprocess import check_call class InstallPluginCo...
32.707692
182
0.579022
import errno from setuptools import setup, find_packages from setuptools.command.install import install from subprocess import check_call class InstallPluginCommand(install): def run(self): install.run(self) try: check_call(['pulumi', 'plugin', 'install', 'resource', 'eks', 'v0.34.0-r...
true
true
1c0687659c6e8cebd8e59d122573b0d66be3cd45
3,460
py
Python
pyadlml/dataset/plot/image.py
tcsvn/pyadlml
9b87d223ba0ef9814ba830263dd35fc6432fae87
[ "MIT" ]
4
2020-11-11T17:29:10.000Z
2021-01-08T20:55:47.000Z
pyadlml/dataset/plot/image.py
tcsvn/pyadlml
9b87d223ba0ef9814ba830263dd35fc6432fae87
[ "MIT" ]
null
null
null
pyadlml/dataset/plot/image.py
tcsvn/pyadlml
9b87d223ba0ef9814ba830263dd35fc6432fae87
[ "MIT" ]
5
2020-10-05T03:23:31.000Z
2022-01-25T19:15:34.000Z
from pyadlml.dataset.plot.util import heatmap, annotate_heatmap from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib.pyplot as plt import matplotlib import numpy as np def forceAspect(ax,aspect): im = ax.get_images() extent = im[0].get_extent() ax.set_aspect(abs((extent[1]-extent[0])/...
29.827586
82
0.574566
from pyadlml.dataset.plot.util import heatmap, annotate_heatmap from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib.pyplot as plt import matplotlib import numpy as np def forceAspect(ax,aspect): im = ax.get_images() extent = im[0].get_extent() ax.set_aspect(abs((extent[1]-extent[0])/...
true
true
1c06887dd3d53d4f083c650c0be0ebb5b80c14f0
1,913
py
Python
nova/api/openstack/compute/schemas/attach_interfaces.py
zjzh/nova
7bb21723171c59b93e28f5d508c2b6df39220f13
[ "Apache-2.0" ]
1,874
2015-01-04T05:18:34.000Z
2022-03-31T03:30:28.000Z
nova/api/openstack/compute/schemas/attach_interfaces.py
woraser/nova
fc3890667e4971e3f0f35ac921c2a6c25f72adec
[ "Apache-2.0" ]
132
2017-03-27T11:31:52.000Z
2022-03-30T08:45:02.000Z
nova/api/openstack/compute/schemas/attach_interfaces.py
woraser/nova
fc3890667e4971e3f0f35ac921c2a6c25f72adec
[ "Apache-2.0" ]
1,996
2015-01-04T15:11:51.000Z
2022-03-31T11:03:13.000Z
# Copyright 2014 NEC 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 ...
36.09434
78
0.560899
import copy from nova.api.validation import parameter_types create = { 'type': 'object', 'properties': { 'interfaceAttachment': { 'type': 'object', 'properties': { 'net_id': parameter_types.network_id, ...
true
true
1c068981b3c8de6032f0e46a05495b3fc444ff98
258,546
py
Python
instances/passenger_demand/pas-20210422-1717-int4e-1/30.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/passenger_demand/pas-20210422-1717-int4e-1/30.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/passenger_demand/pas-20210422-1717-int4e-1/30.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
""" PASSENGERS """ numPassengers = 7711 passenger_arriving = ( (4, 4, 1, 5, 4, 0, 0, 0, 0, 1, 3, 0, 0, 3, 1, 2, 0, 1, 0, 3, 0, 0, 2, 0, 0, 0), # 0 (0, 2, 1, 1, 3, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 3, 0, 3, 3, 0, 1, 1, 0, 1, 0, 0), # 1 (1, 3, 2, 2, 0, 2, 1, 1, 0, 0, 0, 0, 0, 2, 2, 1, 2, 1, 2, 2, 0, 1, 0, 0, 0, 0), #...
276.519786
500
0.769774
numPassengers = 7711 passenger_arriving = ( (4, 4, 1, 5, 4, 0, 0, 0, 0, 1, 3, 0, 0, 3, 1, 2, 0, 1, 0, 3, 0, 0, 2, 0, 0, 0), (0, 2, 1, 1, 3, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 3, 0, 3, 3, 0, 1, 1, 0, 1, 0, 0), (1, 3, 2, 2, 0, 2, 1, 1, 0, 0, 0, 0, 0, 2, 2, 1, 2, 1, 2, 2, 0, 1, 0, 0, 0, 0), (0, 2, 5, 2, 0, 0, 0, 1, 1, 0...
true
true
1c0689949538f3de1c27582697cf3dc858f19a31
71,892
py
Python
nenupy/observation/obs_config.py
AlanLoh/nenupy
5b9e6ae7cc28d0dc4ed450a408b124f71a1c9cc8
[ "MIT" ]
4
2018-10-02T16:32:32.000Z
2022-03-08T10:55:36.000Z
nenupy/observation/obs_config.py
AlanLoh/nenupy
5b9e6ae7cc28d0dc4ed450a408b124f71a1c9cc8
[ "MIT" ]
54
2018-10-16T14:48:29.000Z
2022-02-24T11:02:59.000Z
nenupy/observation/obs_config.py
AlanLoh/nenupy
5b9e6ae7cc28d0dc4ed450a408b124f71a1c9cc8
[ "MIT" ]
2
2020-10-12T14:29:17.000Z
2021-11-24T13:11:16.000Z
#! /usr/bin/python3 # -*- coding: utf-8 -*- """ ************************* Observation configuration ************************* `NenuFAR <https://nenufar.obs-nancay.fr/en/astronomer/>`_ is a versatile low-frequency radio telescope. Several observing modes are available, as represented by the ...
33.610098
151
0.468536
__author__ = 'Alan Loh, Baptiste Cecconi' __copyright__ = 'Copyright 2020, nenupy' __credits__ = ['Alan Loh'] __maintainer__ = 'Alan' __email__ = 'alan.loh@obspm.fr' __status__ = 'Production' __all__ = [ 'BSTConfig', 'NICKELConfig', 'TFConfig', 'RAWConfig', 'PulsarFoldConfig', 'PulsarWaveCon...
true
true
1c068b328c40fddf81491efa881bf2956f1ba62d
9,335
py
Python
cvpce/models/proposals.py
laitalaj/cvpce
7509e7d7783039f39a88edc6e411333bcf6fb2af
[ "MIT" ]
1
2021-10-06T17:51:52.000Z
2021-10-06T17:51:52.000Z
cvpce/models/proposals.py
laitalaj/cvpce
7509e7d7783039f39a88edc6e411333bcf6fb2af
[ "MIT" ]
null
null
null
cvpce/models/proposals.py
laitalaj/cvpce
7509e7d7783039f39a88edc6e411333bcf6fb2af
[ "MIT" ]
2
2021-10-02T10:16:20.000Z
2021-12-12T17:12:14.000Z
import torch from torch import nn from torch.nn import functional as nnf from torchvision import models as tmodels from torchvision.models.detection import RetinaNet from torchvision.models.detection.backbone_utils import BackboneWithFPN from torchvision.ops.feature_pyramid_network import ExtraFPNBlock, LastLevelP6P7 f...
45.759804
193
0.692126
import torch from torch import nn from torch.nn import functional as nnf from torchvision import models as tmodels from torchvision.models.detection import RetinaNet from torchvision.models.detection.backbone_utils import BackboneWithFPN from torchvision.ops.feature_pyramid_network import ExtraFPNBlock, LastLevelP6P7 f...
true
true
1c068c6ec4b8c9fc686f419e5f47c795883e7c6f
1,512
py
Python
rlpyt/experiments/scripts/mujoco/qpg/train/mujoco_td3_serial.py
vzhuang/rlpyt
3abf873e4bae0cd9cccbb9e5c9cc4c875710f6b6
[ "MIT" ]
2,122
2019-07-02T13:19:10.000Z
2022-03-22T09:59:42.000Z
rlpyt/experiments/scripts/mujoco/qpg/train/mujoco_td3_serial.py
vzhuang/rlpyt
3abf873e4bae0cd9cccbb9e5c9cc4c875710f6b6
[ "MIT" ]
206
2019-07-02T14:19:42.000Z
2022-02-15T02:34:28.000Z
rlpyt/experiments/scripts/mujoco/qpg/train/mujoco_td3_serial.py
vzhuang/rlpyt
3abf873e4bae0cd9cccbb9e5c9cc4c875710f6b6
[ "MIT" ]
369
2019-07-02T13:38:28.000Z
2022-03-28T11:16:39.000Z
import sys from rlpyt.utils.launching.affinity import affinity_from_code from rlpyt.samplers.serial.sampler import SerialSampler from rlpyt.samplers.parallel.cpu.collectors import CpuResetCollector from rlpyt.envs.gym import make as gym_make from rlpyt.algos.qpg.td3 import TD3 from rlpyt.agents.qpg.td3_agent import T...
32.170213
69
0.716931
import sys from rlpyt.utils.launching.affinity import affinity_from_code from rlpyt.samplers.serial.sampler import SerialSampler from rlpyt.samplers.parallel.cpu.collectors import CpuResetCollector from rlpyt.envs.gym import make as gym_make from rlpyt.algos.qpg.td3 import TD3 from rlpyt.agents.qpg.td3_agent import T...
true
true
1c068e154a4729ab650eeb6b808eefe158bc0866
3,301
py
Python
code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/test_fts_templates_get.py
jhkuang11/UniTrade
5f68b853926e167936b58c8543b8f95ebd6f5211
[ "MIT" ]
null
null
null
code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/test_fts_templates_get.py
jhkuang11/UniTrade
5f68b853926e167936b58c8543b8f95ebd6f5211
[ "MIT" ]
10
2020-06-05T19:42:26.000Z
2022-03-11T23:38:35.000Z
code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/test_fts_templates_get.py
jhkuang11/UniTrade
5f68b853926e167936b58c8543b8f95ebd6f5211
[ "MIT" ]
null
null
null
########################################################################## # # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2017, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # ########################################################################## from __future__ i...
40.753086
80
0.542866
from __future__ import print_function import uuid from pgadmin.browser.server_groups.servers.databases.schemas.tests import \ utils as schema_utils from pgadmin.browser.server_groups.servers.databases.tests import \ utils as database_utils from pgadmin.utils.route import BaseTestGenerator from regression imp...
true
true
1c068ed54a8e9f4fee11d31cdca4924f37f96905
1,359
py
Python
test/test_delete_contact_from_group.py
dariansk/python_training
47f22f09b955d2c148cd4759784861800b00ca43
[ "Apache-2.0" ]
null
null
null
test/test_delete_contact_from_group.py
dariansk/python_training
47f22f09b955d2c148cd4759784861800b00ca43
[ "Apache-2.0" ]
1
2017-12-01T05:47:50.000Z
2017-12-01T05:47:50.000Z
test/test_delete_contact_from_group.py
dariansk/python_training
47f22f09b955d2c148cd4759784861800b00ca43
[ "Apache-2.0" ]
null
null
null
from model.contact import Contact from model.group import Group import random from fixture.orm import ORMFixture from random import randrange orm = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="") def test_delete_contact_from_group(app): if len(orm.get_group_list()) == 0: app.g...
33.146341
110
0.680648
from model.contact import Contact from model.group import Group import random from fixture.orm import ORMFixture from random import randrange orm = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="") def test_delete_contact_from_group(app): if len(orm.get_group_list()) == 0: app.g...
true
true
1c068f333314e7322b6a39302c32df7e142e30a7
2,726
py
Python
jmeter_api/listeners/summary_report/elements.py
dashawn888/jmeter_api
1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd
[ "Apache-2.0" ]
11
2020-03-22T13:30:21.000Z
2021-12-25T06:23:44.000Z
jmeter_api/listeners/summary_report/elements.py
dashawn888/jmeter_api
1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd
[ "Apache-2.0" ]
37
2019-12-18T13:12:50.000Z
2022-02-10T10:52:37.000Z
jmeter_api/listeners/summary_report/elements.py
dashawn888/jmeter_api
1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd
[ "Apache-2.0" ]
5
2019-12-06T10:55:56.000Z
2020-06-01T19:32:32.000Z
from jmeter_api.basics.listener.elements import ResultCollector class SummaryReport(ResultCollector): TEMPLATE = '../../basics/listener/result_collector_template.xml' def __init__(self, *, error_logging: bool = False, filename: str = None, time: bool = ...
36.837838
90
0.518709
from jmeter_api.basics.listener.elements import ResultCollector class SummaryReport(ResultCollector): TEMPLATE = '../../basics/listener/result_collector_template.xml' def __init__(self, *, error_logging: bool = False, filename: str = None, time: bool = ...
true
true
1c06901f10f9d3b659803289cd0151ab4378eccc
15,253
py
Python
tests/RequestProcess.python/headerTests.py
IBMStreams/streamsx.inetserver
192b702e7667ba76c12f0efd3e683daeb4d6a2cd
[ "Apache-2.0" ]
null
null
null
tests/RequestProcess.python/headerTests.py
IBMStreams/streamsx.inetserver
192b702e7667ba76c12f0efd3e683daeb4d6a2cd
[ "Apache-2.0" ]
31
2018-11-09T15:11:09.000Z
2021-03-24T14:59:41.000Z
tests/RequestProcess.python/headerTests.py
IBMStreams/streamsx.inetserver
192b702e7667ba76c12f0efd3e683daeb4d6a2cd
[ "Apache-2.0" ]
2
2019-04-05T13:37:56.000Z
2019-04-19T20:30:29.000Z
import unittest from streamsx.topology.topology import * #from streamsx.topology.topology import Topology from streamsx.topology.tester import Tester from streamsx.topology.schema import * import streamsx.topology.context from streamsx import rest import streamsx.spl.op as op import streamsx.spl.toolkit as tk impor...
35.472093
210
0.572936
import unittest from streamsx.topology.topology import * from streamsx.topology.tester import Tester from streamsx.topology.schema import * import streamsx.topology.context from streamsx import rest import streamsx.spl.op as op import streamsx.spl.toolkit as tk import json import requests import time import argpars...
true
true
1c06906e106080620bbb1bc8ac6a361178a88485
10,138
py
Python
cumulusci/cli/task.py
davisagli/CumulusCI
fd74c324ad3ff662484b159395c639879011e711
[ "BSD-3-Clause" ]
109
2015-01-20T14:28:48.000Z
2018-08-31T12:12:39.000Z
cumulusci/cli/task.py
davisagli/CumulusCI
fd74c324ad3ff662484b159395c639879011e711
[ "BSD-3-Clause" ]
365
2015-01-07T19:54:25.000Z
2018-09-11T15:10:02.000Z
cumulusci/cli/task.py
davisagli/CumulusCI
fd74c324ad3ff662484b159395c639879011e711
[ "BSD-3-Clause" ]
125
2015-01-17T16:05:39.000Z
2018-09-06T19:05:00.000Z
import json from pathlib import Path import click from rich.console import Console from rst2ansi import rst2ansi from cumulusci.core.config import TaskConfig from cumulusci.core.exceptions import CumulusCIUsageError from cumulusci.core.utils import import_global from cumulusci.utils import doc_task from .runtime imp...
34.13468
130
0.599921
import json from pathlib import Path import click from rich.console import Console from rst2ansi import rst2ansi from cumulusci.core.config import TaskConfig from cumulusci.core.exceptions import CumulusCIUsageError from cumulusci.core.utils import import_global from cumulusci.utils import doc_task from .runtime imp...
true
true
1c0692290749c5dfae547f777db21a2488a477bc
4,120
py
Python
test/test_get_table.py
DavidKimDY/quandl-python
8aef8189b006199f10197925bfa399f4103bd57a
[ "MIT" ]
32
2015-01-11T16:24:06.000Z
2015-07-20T04:03:03.000Z
test/test_get_table.py
DavidKimDY/quandl-python
8aef8189b006199f10197925bfa399f4103bd57a
[ "MIT" ]
null
null
null
test/test_get_table.py
DavidKimDY/quandl-python
8aef8189b006199f10197925bfa399f4103bd57a
[ "MIT" ]
19
2015-01-06T15:45:30.000Z
2015-07-09T15:24:13.000Z
import re import unittest import httpretty import json from quandl.model.datatable import Datatable import pandas from mock import patch, call from test.factories.datatable import DatatableFactory from test.factories.datatable_data import DatatableDataFactory from test.factories.datatable_meta import DatatableMetaFacto...
39.615385
84
0.601942
import re import unittest import httpretty import json from quandl.model.datatable import Datatable import pandas from mock import patch, call from test.factories.datatable import DatatableFactory from test.factories.datatable_data import DatatableDataFactory from test.factories.datatable_meta import DatatableMetaFacto...
true
true
1c06923c0fb5e693e2d2ecd68002910414c667cd
1,737
py
Python
vscodenv/utils.py
AlexCovizzi/vscodenv
ddaf61c40a1278e923909201a5ec8ef62c5315f9
[ "Apache-2.0" ]
17
2018-04-29T21:14:24.000Z
2018-11-12T21:08:24.000Z
vscodenv/utils.py
AlexCovizzi/vscodenv
ddaf61c40a1278e923909201a5ec8ef62c5315f9
[ "Apache-2.0" ]
null
null
null
vscodenv/utils.py
AlexCovizzi/vscodenv
ddaf61c40a1278e923909201a5ec8ef62c5315f9
[ "Apache-2.0" ]
1
2019-02-07T15:25:31.000Z
2019-02-07T15:25:31.000Z
''' Some methods used in different modules ''' from os import environ, path, listdir, getcwd def get_global_extensions_dir(): ''' Get the global directory to store vscode extensions, by default it's ~/.vscode/extension. ''' default_global_extensions_dir = path.join(path.expanduser("~"), '.vscode', 'ex...
32.773585
93
0.687392
from os import environ, path, listdir, getcwd def get_global_extensions_dir(): default_global_extensions_dir = path.join(path.expanduser("~"), '.vscode', 'extensions') return default_global_extensions_dir def extension_base_name(extension): last_dot = extension.rfind('.') n = extension[last_dot+1...
true
true
1c0692662f5fd943f10c1c97f5874a5c278dfcb7
550
py
Python
accounts/migrations/0002_auto_20190312_2218.py
chengze2/404ProjectTest
c7a898d38ef902feea0bb9be60888455f55c95e9
[ "Apache-2.0" ]
null
null
null
accounts/migrations/0002_auto_20190312_2218.py
chengze2/404ProjectTest
c7a898d38ef902feea0bb9be60888455f55c95e9
[ "Apache-2.0" ]
null
null
null
accounts/migrations/0002_auto_20190312_2218.py
chengze2/404ProjectTest
c7a898d38ef902feea0bb9be60888455f55c95e9
[ "Apache-2.0" ]
null
null
null
# Generated by Django 2.1.7 on 2019-03-12 22:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0001_initial'), ] operations = [ migrations.AlterField( model_name='post', name='category', ...
22.916667
62
0.563636
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0001_initial'), ] operations = [ migrations.AlterField( model_name='post', name='category', field=models.CharField(default='', max_length=80...
true
true
1c0694e4cd537c6a14dbe4115abfa6e6da046699
32
py
Python
T10-07/program.py
maa76/SSof-Project1920
9b4ad9ac41a648c425fcfcd49cd52ff84e528bde
[ "MIT" ]
2
2019-11-20T19:26:07.000Z
2019-11-22T00:42:23.000Z
T10-07/program.py
maa76/SSof-Project1920
9b4ad9ac41a648c425fcfcd49cd52ff84e528bde
[ "MIT" ]
2
2019-11-28T05:21:24.000Z
2019-11-28T05:21:58.000Z
T10-07/program.py
maa76/SSof-Project1920
9b4ad9ac41a648c425fcfcd49cd52ff84e528bde
[ "MIT" ]
25
2019-11-27T01:40:56.000Z
2019-12-04T23:38:59.000Z
d = mark_safe(c) b = execute(a)
10.666667
16
0.625
d = mark_safe(c) b = execute(a)
true
true
1c06956f8aa12542e7d5923609fab9b71dd47efe
772
py
Python
src/logs/api.py
japesone/ontask_b
17af441f9893c521d2e14011e7790ba4077e3318
[ "MIT" ]
null
null
null
src/logs/api.py
japesone/ontask_b
17af441f9893c521d2e14011e7790ba4077e3318
[ "MIT" ]
null
null
null
src/logs/api.py
japesone/ontask_b
17af441f9893c521d2e14011e7790ba4077e3318
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from rest_framework import generics from rest_framework.permissions import IsAuthenticated, DjangoModelPermissions from ontask.permissions import IsOwner, UserIsInstructor from .models import Log from .serializers import LogSerializer class LogAPIList(generics.ListAPIView): """ Get ...
27.571429
78
0.727979
from rest_framework import generics from rest_framework.permissions import IsAuthenticated, DjangoModelPermissions from ontask.permissions import IsOwner, UserIsInstructor from .models import Log from .serializers import LogSerializer class LogAPIList(generics.ListAPIView): queryset = None serializer_cla...
true
true
1c0695b865502c13db602f82f28fd8fdaf01d50e
23,087
py
Python
resource/production_tests/lib/S3908-15.0.0/TestStudio/Scripts/ExtendedHighResistance.py
qmao/webds_api
ca5bf9ad3c1304be223b7e47c57ee10fb40d92e1
[ "BSD-3-Clause" ]
null
null
null
resource/production_tests/lib/S3908-15.0.0/TestStudio/Scripts/ExtendedHighResistance.py
qmao/webds_api
ca5bf9ad3c1304be223b7e47c57ee10fb40d92e1
[ "BSD-3-Clause" ]
null
null
null
resource/production_tests/lib/S3908-15.0.0/TestStudio/Scripts/ExtendedHighResistance.py
qmao/webds_api
ca5bf9ad3c1304be223b7e47c57ee10fb40d92e1
[ "BSD-3-Clause" ]
null
null
null
## DO NOT MODIFY ## 38a033ab94df08dff68592892f214de3308e89ec-1.0.0.11 ## DO NOT MODIFY ## Metadata: # <?xml version="1.0" encoding="utf-8"?> # <metadata name="Extended High Resistance Test" description="Extended High Resistance Test" bin="25" product="S3908"> # <parameter name="Limits" type="string[][]" des...
45.99004
119
0.585005
# isoptional="false"/> # </metadata> ## import sys import os import os.path import traceback import ctypes from struct import unpack from binascii import unhexlify import Comm2Functions import XMLTestResultGenerator class ExtendedHighResistance(object): class ExtHgResData(ctyp...
true
true
1c06961072e5b5b0e30bd90b9504d917f5d82384
443
py
Python
snippets/iso8601_date_string.py
l0kifs/code_snippets
f5048357037cb382cec022a5e13bf9a5ba8550cb
[ "MIT" ]
null
null
null
snippets/iso8601_date_string.py
l0kifs/code_snippets
f5048357037cb382cec022a5e13bf9a5ba8550cb
[ "MIT" ]
null
null
null
snippets/iso8601_date_string.py
l0kifs/code_snippets
f5048357037cb382cec022a5e13bf9a5ba8550cb
[ "MIT" ]
null
null
null
# Convert local datetime date to the ISO8601+TimeZone date string import datetime import time date = datetime.datetime.now() utc_offset_sec = time.altzone if time.localtime().tm_isdst else time.timezone utc_offset = datetime.timedelta(seconds=-utc_offset_sec) iso_date_str = date.replace(tzinfo=datetime.timezone(offset...
31.642857
84
0.819413
import datetime import time date = datetime.datetime.now() utc_offset_sec = time.altzone if time.localtime().tm_isdst else time.timezone utc_offset = datetime.timedelta(seconds=-utc_offset_sec) iso_date_str = date.replace(tzinfo=datetime.timezone(offset=utc_offset)).isoformat() import dateutil.parser datetime_date ...
true
true
1c06969a47c546ba6e2a70fc9843d71ed82d8a03
21,880
py
Python
src/biots.py
elstupido/primlife
c9f30152de0a10827dbcb55ca9d05944e849a096
[ "MIT" ]
3
2019-04-22T04:18:04.000Z
2021-12-06T23:16:46.000Z
src/biots.py
elstupido/primlife
c9f30152de0a10827dbcb55ca9d05944e849a096
[ "MIT" ]
null
null
null
src/biots.py
elstupido/primlife
c9f30152de0a10827dbcb55ca9d05944e849a096
[ "MIT" ]
null
null
null
import pygame import random import math from Box2D import b2Vec2 from biots.genes import genRandomBiotGene, mutate from biots.biot_paramaters import BiotParams global PIXEL_SCALE PIXEL_SCALE = 1 #just guessing here #BIOT MAX DEPTH MAX_DEPTH = 6 DEBUG = False bp = BiotParams() background_colour = (0,0,0) (width, ...
37.210884
146
0.535969
import pygame import random import math from Box2D import b2Vec2 from biots.genes import genRandomBiotGene, mutate from biots.biot_paramaters import BiotParams global PIXEL_SCALE PIXEL_SCALE = 1 MAX_DEPTH = 6 DEBUG = False bp = BiotParams() background_colour = (0,0,0) (width, height) = (1200, 700) gravity = (ma...
false
true
1c06981152e9896b6c97afbca925dbc93f26fadc
65
py
Python
urduhack/pipeline/__init__.py
cinfotech94/urduhackk
44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11
[ "MIT" ]
252
2018-08-20T16:16:45.000Z
2022-03-04T07:03:58.000Z
urduhack/pipeline/__init__.py
cinfotech94/urduhackk
44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11
[ "MIT" ]
111
2019-01-21T11:39:45.000Z
2021-09-30T07:26:50.000Z
urduhack/pipeline/__init__.py
cinfotech94/urduhackk
44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11
[ "MIT" ]
35
2019-02-09T14:29:36.000Z
2022-01-09T10:02:56.000Z
# coding: utf8 """Pipeline module""" from .core import Pipeline
13
26
0.707692
from .core import Pipeline
true
true
1c069a1da3ec5c52cca743f45d757eddf6500433
503
py
Python
blogproject/blog/feeds.py
AcerFeng/DjangoBlog
d77787361f017ce31cb6c743c76ebec0a78f74e0
[ "Apache-2.0" ]
null
null
null
blogproject/blog/feeds.py
AcerFeng/DjangoBlog
d77787361f017ce31cb6c743c76ebec0a78f74e0
[ "Apache-2.0" ]
null
null
null
blogproject/blog/feeds.py
AcerFeng/DjangoBlog
d77787361f017ce31cb6c743c76ebec0a78f74e0
[ "Apache-2.0" ]
null
null
null
from django.contrib.syndication.views import Feed from .models import Post class AllPostsRssFeed(Feed): # 显示在聚合阅读器上的标题 title = "LeonQin 的blog" # 通过聚合阅读器跳转到网站的地址 link = "/" # 显示在决和阅读器上的描述信息 description = "Django 测试文章" # 需要显示的内容条目 def items(self): return Post.objects.all() # ...
23.952381
54
0.650099
from django.contrib.syndication.views import Feed from .models import Post class AllPostsRssFeed(Feed): title = "LeonQin 的blog" link = "/" description = "Django 测试文章" def items(self): return Post.objects.all() def item_title(self, item): return "[%s] %s" % (item...
true
true
1c069aa32211bf2f7cec6b762132d99123d3d4e7
888
py
Python
apidoc/shunts.py
shannon-jia/nmi
ff9f26c4608e5862db34e5da1724329fb9bf0629
[ "MIT" ]
null
null
null
apidoc/shunts.py
shannon-jia/nmi
ff9f26c4608e5862db34e5da1724329fb9bf0629
[ "MIT" ]
null
null
null
apidoc/shunts.py
shannon-jia/nmi
ff9f26c4608e5862db34e5da1724329fb9bf0629
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # SHUNT def get_ashunt() """ @apiUse AShunt @apiUse Back @api {get} /shunt/alarms/:id 1 get alarm points @apiGroup Shunt @apiVersion 1.0.0 @apiParam {Number} id Unique alarm point. """ def patch_ashunt() """ @apiUse AShunt @apiUse Back @api {patch} /shunt/alarms 2 pa...
17.076923
56
0.716216
def get_ashunt() """ @apiUse AShunt @apiUse Back @api {get} /shunt/alarms/:id 1 get alarm points @apiGroup Shunt @apiVersion 1.0.0 @apiParam {Number} id Unique alarm point. """ def patch_ashunt() """ @apiUse AShunt @apiUse Back @api {patch} /shunt/alarms 2 patch alarm points status @apiGroup Shunt @apiVersion 1.0...
false
true
1c069b5619958fc00ee73a9df3a20a7dbd8b3c04
2,297
py
Python
tests/tasks/great_expectations/test_great_expectations_validation.py
vnsn/prefect
972345597975155dba9e3232bcc430d0a6258a37
[ "Apache-2.0" ]
1
2021-05-12T12:47:12.000Z
2021-05-12T12:47:12.000Z
tests/tasks/great_expectations/test_great_expectations_validation.py
vnsn/prefect
972345597975155dba9e3232bcc430d0a6258a37
[ "Apache-2.0" ]
7
2021-06-26T08:05:20.000Z
2022-03-26T08:05:32.000Z
tests/tasks/great_expectations/test_great_expectations_validation.py
ngriffiths13/prefect
7f5613abcb182494b7dc12159277c3bc5f3c9898
[ "Apache-2.0" ]
1
2021-10-16T08:33:56.000Z
2021-10-16T08:33:56.000Z
from unittest.mock import MagicMock import prefect from prefect import context from prefect.tasks.great_expectations import RunGreatExpectationsValidation from prefect.utilities.configuration import set_temporary_config import pytest import os import shutil import tempfile class TestInitialization: def test_inits...
35.338462
75
0.638659
from unittest.mock import MagicMock import prefect from prefect import context from prefect.tasks.great_expectations import RunGreatExpectationsValidation from prefect.utilities.configuration import set_temporary_config import pytest import os import shutil import tempfile class TestInitialization: def test_inits...
true
true
1c069b5f31027272fcad682392a5edb26928e734
1,446
py
Python
TWLight/users/migrations/0044_auto_20190801_1703.py
NicholusMuwonge/TWLight
522bda01f4e171c37e6b7ba4c9f19f749cd4a50b
[ "MIT" ]
1
2019-10-24T04:49:52.000Z
2019-10-24T04:49:52.000Z
TWLight/users/migrations/0044_auto_20190801_1703.py
NicholusMuwonge/TWLight
522bda01f4e171c37e6b7ba4c9f19f749cd4a50b
[ "MIT" ]
1
2019-03-29T15:29:45.000Z
2019-03-29T15:57:20.000Z
TWLight/users/migrations/0044_auto_20190801_1703.py
NicholusMuwonge/TWLight
522bda01f4e171c37e6b7ba4c9f19f749cd4a50b
[ "MIT" ]
1
2019-09-26T14:40:27.000Z
2019-09-26T14:40:27.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-08-01 17:03 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0043_auto_20190628_1551'), ] operations = [ migrations.AlterField...
68.857143
1,043
0.632089
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0043_auto_20190628_1551'), ] operations = [ migrations.AlterField( model_name='userprofile', name='lang', ...
true
true
1c069b990cea989ce67594f80b5a3b78bf27c691
4,652
py
Python
test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/_auto_rest_complex_test_service_async.py
Azure/autorest.azure-functions-python
b0896d8aec6b0fd6f0bcb12ea8e0489652dc2783
[ "MIT" ]
4
2020-10-22T20:35:38.000Z
2021-12-21T07:29:01.000Z
test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/_auto_rest_complex_test_service_async.py
Azure/autorest.azure-functions-python
b0896d8aec6b0fd6f0bcb12ea8e0489652dc2783
[ "MIT" ]
3
2020-09-09T15:16:15.000Z
2021-12-20T15:25:18.000Z
test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/_auto_rest_complex_test_service_async.py
Azure/autorest.azure-functions-python
b0896d8aec6b0fd6f0bcb12ea8e0489652dc2783
[ "MIT" ]
2
2020-11-10T07:16:23.000Z
2020-12-30T11:03:14.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
49.489362
129
0.741402
from typing import Any, Optional from azure.core import AsyncPipelineClient from msrest import Deserializer, Serializer from ._configuration_async import AutoRestComplexTestServiceConfiguration from .operations_async import BasicOperations from .operations_async import PrimitiveOperations from .operations_async impo...
true
true
1c069c1dee88cb4ffcc29b34c0745dbf4ffe3a4b
9,234
py
Python
sample/pytorch/encoder_sample.py
LiyuanLucasLiu/FasterTransformer
c28149096030286e87491c7648f5a020aed22cc9
[ "Apache-2.0" ]
null
null
null
sample/pytorch/encoder_sample.py
LiyuanLucasLiu/FasterTransformer
c28149096030286e87491c7648f5a020aed22cc9
[ "Apache-2.0" ]
null
null
null
sample/pytorch/encoder_sample.py
LiyuanLucasLiu/FasterTransformer
c28149096030286e87491c7648f5a020aed22cc9
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2020-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 ...
41.408072
125
0.598657
from __future__ import print_function import os import argparse import timeit import torch import torch.cuda.nvtx as nvtx import time from utils.encoder import EncoderWeights, CustomEncoder import threading def sequence_mask(lengths, max_len=None, is_2d=True): batch_size = lengths.numel() max_len = max_len ...
true
true
1c069c43a4cecd8cb75b7adc7371dcbc7997571c
946
py
Python
adv/kirsty.py
XenoXilus/dl
cdfce03835cd67aac553140d6d88bc4c5c5d60ff
[ "Apache-2.0" ]
null
null
null
adv/kirsty.py
XenoXilus/dl
cdfce03835cd67aac553140d6d88bc4c5c5d60ff
[ "Apache-2.0" ]
null
null
null
adv/kirsty.py
XenoXilus/dl
cdfce03835cd67aac553140d6d88bc4c5c5d60ff
[ "Apache-2.0" ]
null
null
null
from core.advbase import * def module(): return Kirsty class Kirsty(Adv): conf = {} conf['slots.a'] = [ 'Dragon_and_Tamer', 'Flash_of_Genius', 'Moonlight_Party', 'The_Plaguebringer', 'Dueling_Dancers' ] conf['acl'] = """ `dragon(c3-s-end), s4.check() `s3, not bu...
24.894737
61
0.588795
from core.advbase import * def module(): return Kirsty class Kirsty(Adv): conf = {} conf['slots.a'] = [ 'Dragon_and_Tamer', 'Flash_of_Genius', 'Moonlight_Party', 'The_Plaguebringer', 'Dueling_Dancers' ] conf['acl'] = """ `dragon(c3-s-end), s4.check() `s3, not bu...
true
true
1c069e10066dfe8a865b165119e8d9cdabd088c8
3,855
py
Python
python/ray/tests/test_runtime_context.py
77loopin/ray
9322f6aab53f4ca5baf5a3573e1ffde12feae519
[ "Apache-2.0" ]
3
2021-07-22T17:03:33.000Z
2021-09-20T15:46:25.000Z
python/ray/tests/test_runtime_context.py
77loopin/ray
9322f6aab53f4ca5baf5a3573e1ffde12feae519
[ "Apache-2.0" ]
77
2021-02-13T08:07:09.000Z
2022-03-19T07:08:45.000Z
python/ray/tests/test_runtime_context.py
77loopin/ray
9322f6aab53f4ca5baf5a3573e1ffde12feae519
[ "Apache-2.0" ]
2
2021-12-12T14:51:29.000Z
2022-01-23T00:14:00.000Z
import ray import os import signal import time import sys def test_was_current_actor_reconstructed(shutdown_only): ray.init() @ray.remote(max_restarts=10) class A(object): def __init__(self): self._was_reconstructed = ray.get_runtime_context( ).was_current_actor_reconstruc...
32.394958
77
0.664073
import ray import os import signal import time import sys def test_was_current_actor_reconstructed(shutdown_only): ray.init() @ray.remote(max_restarts=10) class A(object): def __init__(self): self._was_reconstructed = ray.get_runtime_context( ).was_current_actor_reconstruc...
true
true
1c069fdcac5483be8119dffaf726aa17bd023bba
2,006
py
Python
scripts/processes/import_apds_file.py
euctrl-pru/rt-python
da5d0040e250bd159845a0d43bf0b73eab368863
[ "MIT" ]
null
null
null
scripts/processes/import_apds_file.py
euctrl-pru/rt-python
da5d0040e250bd159845a0d43bf0b73eab368863
[ "MIT" ]
null
null
null
scripts/processes/import_apds_file.py
euctrl-pru/rt-python
da5d0040e250bd159845a0d43bf0b73eab368863
[ "MIT" ]
null
null
null
#!/usr/bin/env python # # Copyright (c) 2018 Via Technology Ltd. All Rights Reserved. # Consult your license regarding permissions and restrictions. """ Import an APDS file into PRU format flights, positions and events files. """ import sys import errno from pru.trajectory_fields import split_dual_date from pru.traje...
29.5
83
0.718843
import sys import errno from pru.trajectory_fields import split_dual_date from pru.trajectory_files import DEFAULT_STANDS_FILENAME, \ create_convert_apds_filenames from pru.filesystem.data_store_operations import get_apds, get_stands, \ put_processed, REFINED_APDS from apps.convert_apt_data import convert_apd...
true
true
1c06a1dfe055e9e51a1383016b327f37eadd27cb
5,211
py
Python
example/combined_build.py
gschivley/ElectricityLCI
1c1c1b69705d3ffab1e1e844aaf7379e4f51198e
[ "CC0-1.0" ]
1
2019-04-15T18:11:16.000Z
2019-04-15T18:11:16.000Z
example/combined_build.py
gschivley/ElectricityLCI
1c1c1b69705d3ffab1e1e844aaf7379e4f51198e
[ "CC0-1.0" ]
3
2019-05-07T19:04:22.000Z
2019-09-30T21:29:59.000Z
example/combined_build.py
gschivley/ElectricityLCI
1c1c1b69705d3ffab1e1e844aaf7379e4f51198e
[ "CC0-1.0" ]
null
null
null
# -*- coding: utf-8 -*- import electricitylci import pandas as pd import pickle as pkl use_cache = False subregion = "FERC" if use_cache is True: with open("upstream_dict.pickle", "rb") as handle: upstream_dict = pkl.load(handle) upstream_df=pd.read_csv(f"upstream_df.csv") upstream_dict = electri...
56.641304
116
0.784494
import electricitylci import pandas as pd import pickle as pkl use_cache = False subregion = "FERC" if use_cache is True: with open("upstream_dict.pickle", "rb") as handle: upstream_dict = pkl.load(handle) upstream_df=pd.read_csv(f"upstream_df.csv") upstream_dict = electricitylci.write_upstream_d...
true
true
1c06a2c40160995ee764817bb37ccec64fa33bcd
2,596
py
Python
03_regression/src/target_encoder.py
austinfrazer/GWU_data_mining
f7b999f47bd1e323baf97a40bb8e382e5e369023
[ "Apache-2.0", "MIT" ]
229
2016-01-22T01:45:19.000Z
2022-02-08T07:02:19.000Z
03_regression/src/target_encoder.py
austinfrazer/GWU_data_mining
f7b999f47bd1e323baf97a40bb8e382e5e369023
[ "Apache-2.0", "MIT" ]
1
2017-06-06T15:38:32.000Z
2017-06-06T15:38:32.000Z
03_regression/src/target_encoder.py
austinfrazer/GWU_data_mining
f7b999f47bd1e323baf97a40bb8e382e5e369023
[ "Apache-2.0", "MIT" ]
181
2016-01-22T01:05:12.000Z
2022-02-09T05:46:57.000Z
import numpy as np import pandas as pd import h2o def target_encoder(training_frame, test_frame, x, y, lambda_=0.15, threshold=150, test=False): """ Applies simple target encoding to categorical variables. :param training_frame: Training frame which to create target means and to be encoded. :par...
36.055556
95
0.641757
import numpy as np import pandas as pd import h2o def target_encoder(training_frame, test_frame, x, y, lambda_=0.15, threshold=150, test=False): """ Applies simple target encoding to categorical variables. :param training_frame: Training frame which to create target means and to be encoded. :par...
false
true
1c06a3f9db0acedd03917e363eedc1969aebaffd
354
py
Python
tests/test_import.py
cthenderson/zdesk
851611c13b4d530e9df31390b3ec709baf0a0188
[ "MIT" ]
89
2015-01-05T18:51:23.000Z
2022-02-09T19:16:06.000Z
tests/test_import.py
cthenderson/zdesk
851611c13b4d530e9df31390b3ec709baf0a0188
[ "MIT" ]
56
2015-01-09T19:25:20.000Z
2022-02-01T17:07:21.000Z
tests/test_import.py
cthenderson/zdesk
851611c13b4d530e9df31390b3ec709baf0a0188
[ "MIT" ]
87
2015-01-08T21:15:07.000Z
2022-03-31T22:15:19.000Z
def test_import_module(): try: import zdesk except: assert False assert True def test_import_class(): try: from zdesk import Zendesk except: assert False assert True def test_import_get_id(): try: from zdesk import get_id_from_url except: ...
14.16
41
0.607345
def test_import_module(): try: import zdesk except: assert False assert True def test_import_class(): try: from zdesk import Zendesk except: assert False assert True def test_import_get_id(): try: from zdesk import get_id_from_url except: ...
true
true
1c06a4002da1e355cc8ef3fc8176aa372b8a4fe3
53,247
py
Python
consoleme/celery_tasks/celery_tasks.py
init-8/consoleme
047dd5e28e3545f8ad7872eaf91307e283952dc4
[ "Apache-2.0" ]
null
null
null
consoleme/celery_tasks/celery_tasks.py
init-8/consoleme
047dd5e28e3545f8ad7872eaf91307e283952dc4
[ "Apache-2.0" ]
null
null
null
consoleme/celery_tasks/celery_tasks.py
init-8/consoleme
047dd5e28e3545f8ad7872eaf91307e283952dc4
[ "Apache-2.0" ]
null
null
null
""" This module controls defines celery tasks and their applicable schedules. The celery beat server and workers will start when invoked. Please add internal-only celery tasks to the celery_tasks plugin. When ran in development mode (CONFIG_LOCATION=<location of development.yaml configuration file. To run both the cel...
36.470548
120
0.643022
from __future__ import absolute_import import json import sys import time from datetime import datetime, timedelta from typing import Dict, Tuple, Union import celery import sentry_sdk import ujson from asgiref.sync import async_to_sync from billiard.exceptions import SoftTimeLimitExceeded from botocore.exceptions i...
true
true
1c06a57bda6cad0ee2aedb309f93ba151662c6f6
1,242
py
Python
diventi/accounts/migrations/0002_achievements.py
flavoi/diven
3173ca3ca3fbedc191b8eab3639a6bceb3c442c4
[ "Apache-2.0" ]
2
2019-06-27T16:00:17.000Z
2020-08-14T07:46:05.000Z
diventi/accounts/migrations/0002_achievements.py
flavoi/diven
3173ca3ca3fbedc191b8eab3639a6bceb3c442c4
[ "Apache-2.0" ]
26
2020-02-15T22:39:35.000Z
2022-02-19T21:09:01.000Z
diventi/accounts/migrations/0002_achievements.py
flavoi/diven
3173ca3ca3fbedc191b8eab3639a6bceb3c442c4
[ "Apache-2.0" ]
1
2021-11-12T22:30:15.000Z
2021-11-12T22:30:15.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-02-24 18:09 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0001_initial'), ] operations = [ ...
38.8125
234
0.585346
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0001_initial'), ] operations = [ migrations.CreateModel( name='Achievements', f...
true
true
1c06a57c0873ce0bc0518fed586006a8e31300fc
1,602
py
Python
Chapter 07/ch07_r06b.py
PacktPublishing/Modern-Python-Cookbook
40ff656c64421ddf6c288e058bb99a929f6d4c39
[ "MIT" ]
107
2016-11-30T02:13:39.000Z
2022-03-31T06:38:59.000Z
Chapter 07/ch07_r06b.py
fengfanzhiwu/Modern-Python-Cookbook
8eff962f6eae514d531beca9051aefa34941ef4d
[ "MIT" ]
2
2017-04-19T04:08:21.000Z
2019-03-09T16:18:33.000Z
Chapter 07/ch07_r06b.py
fengfanzhiwu/Modern-Python-Cookbook
8eff962f6eae514d531beca9051aefa34941ef4d
[ "MIT" ]
71
2017-01-16T06:35:17.000Z
2022-03-01T21:25:54.000Z
"""Python Cookbook Chapter 7, recipe 6b. """ from ch07_r06a import * import bisect class Hand: def __init__(self, card_iter): self.cards = list(card_iter) self.cards.sort() def add(self, aCard: Card): bisect.insort(self.cards, aCard) def index(self, aCard: Card): i = bis...
21.648649
72
0.543071
from ch07_r06a import * import bisect class Hand: def __init__(self, card_iter): self.cards = list(card_iter) self.cards.sort() def add(self, aCard: Card): bisect.insort(self.cards, aCard) def index(self, aCard: Card): i = bisect.bisect_left(self.cards, aCard) if ...
true
true
1c06a6880bae156bff9881b91aa26e05f848d3cb
4,158
py
Python
check_packages.py
opendatafit/sasview
c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39
[ "BSD-3-Clause" ]
null
null
null
check_packages.py
opendatafit/sasview
c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39
[ "BSD-3-Clause" ]
1
2021-09-20T13:20:35.000Z
2021-09-20T13:20:35.000Z
check_packages.py
opendatafit/sasview
c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39
[ "BSD-3-Clause" ]
null
null
null
""" Check the existing environment against expected values """ from __future__ import print_function import re import sys import subprocess try: import yaml from colorama import Fore, Style except ImportError: print("The PyYaml and colorama packages are required for this module. To " + "install t...
35.538462
80
0.649591
from __future__ import print_function import re import sys import subprocess try: import yaml from colorama import Fore, Style except ImportError: print("The PyYaml and colorama packages are required for this module. To " + "install them, please try one of the following:") print("\tAnaconda: ...
true
true
1c06a6aea5c85b8d357a6059413272a1df62c773
329
py
Python
src/spartan/utils/hpc/__init__.py
xguse/spartan
cb0cc345aaf66602752f57e48e93bb92d69e7dc5
[ "MIT" ]
1
2017-08-01T21:28:13.000Z
2017-08-01T21:28:13.000Z
src/spartan/utils/hpc/__init__.py
xguse/spartan
cb0cc345aaf66602752f57e48e93bb92d69e7dc5
[ "MIT" ]
null
null
null
src/spartan/utils/hpc/__init__.py
xguse/spartan
cb0cc345aaf66602752f57e48e93bb92d69e7dc5
[ "MIT" ]
null
null
null
# __init__.py is part of the 'spartan' package. # It was written by Gus Dunn and was created on 9/3/14. # # Please see the license info in the root folder of this package. """ ================================================= __init__.py ================================================= Purpose: """ __author__ = 'Gu...
21.933333
65
0.486322
__author__ = 'Gus Dunn'
true
true
1c06a6ce37f40aec2cf1d7b167f6535423788832
3,738
py
Python
.history/src/data/data_20191019124653.py
bkraft4257/kaggle_titanic
f29ea1773773109a867278c001dbd21a9f7b21dd
[ "MIT" ]
null
null
null
.history/src/data/data_20191019124653.py
bkraft4257/kaggle_titanic
f29ea1773773109a867278c001dbd21a9f7b21dd
[ "MIT" ]
null
null
null
.history/src/data/data_20191019124653.py
bkraft4257/kaggle_titanic
f29ea1773773109a867278c001dbd21a9f7b21dd
[ "MIT" ]
null
null
null
import pandas as pd from typing import Union from pathlib import Path from nameparser import HumanName class ExtractData: def __init__(self, filename: Union[str, Path], drop_columns=None): # """Extract Training Data from file or Path # Arguments: # filename {[str]} -- Filename of CSV...
29.666667
114
0.564205
import pandas as pd from typing import Union from pathlib import Path from nameparser import HumanName class ExtractData: def __init__(self, filename: Union[str, Path], drop_columns=None): # Arguments: # filename {[str]} -- Filename of CSV data file containing data. # dro...
false
true
1c06a7d4b031345c7c1770cf75c3fa1bfb8eccae
7,674
py
Python
gsm_layer3_protocol/enums.py
matan1008/gsm-layer3-protocol
6e5cff082b2726e8cd7065f34badea527a720a6b
[ "MIT" ]
null
null
null
gsm_layer3_protocol/enums.py
matan1008/gsm-layer3-protocol
6e5cff082b2726e8cd7065f34badea527a720a6b
[ "MIT" ]
null
null
null
gsm_layer3_protocol/enums.py
matan1008/gsm-layer3-protocol
6e5cff082b2726e8cd7065f34badea527a720a6b
[ "MIT" ]
null
null
null
from construct import * protocol_discriminator = Enum( Nibble, GROUP_CALL_CONTROL=0, BROADCAST_CALL_CONTROL=1, PDSS1=2, CALL_CONTROL=3, PDSS2=4, MOBILITY_MANAGEMENT=5, RADIO_RESOURCES=6, SMS=9, NON_CALL_RELATED_SS=0xb, EXTENSION_OF_PD=0xe, TEST_PROCEDURES=0xf ) message_...
34.106667
78
0.800365
from construct import * protocol_discriminator = Enum( Nibble, GROUP_CALL_CONTROL=0, BROADCAST_CALL_CONTROL=1, PDSS1=2, CALL_CONTROL=3, PDSS2=4, MOBILITY_MANAGEMENT=5, RADIO_RESOURCES=6, SMS=9, NON_CALL_RELATED_SS=0xb, EXTENSION_OF_PD=0xe, TEST_PROCEDURES=0xf ) message_...
true
true
1c06a7f1f9e241dfff326967faf2a0c263e599f6
606
py
Python
NewsRecommendation/src/metrics.py
ustcsky/recommenders
64f0dd4653cf7f1d687c45c61807841415e111c7
[ "MIT" ]
null
null
null
NewsRecommendation/src/metrics.py
ustcsky/recommenders
64f0dd4653cf7f1d687c45c61807841415e111c7
[ "MIT" ]
null
null
null
NewsRecommendation/src/metrics.py
ustcsky/recommenders
64f0dd4653cf7f1d687c45c61807841415e111c7
[ "MIT" ]
null
null
null
import numpy as np from sklearn.metrics import roc_auc_score def AUC(y_true, y_pred): return roc_auc_score(y_true, y_pred) def MRR(y_true, y_pred): index = np.argsort(y_pred)[::-1] y_true = np.take(y_true, index) score = y_true / (np.arange(len(y_true)) + 1) return np.sum(score) / np.sum(y_true) ...
30.3
67
0.650165
import numpy as np from sklearn.metrics import roc_auc_score def AUC(y_true, y_pred): return roc_auc_score(y_true, y_pred) def MRR(y_true, y_pred): index = np.argsort(y_pred)[::-1] y_true = np.take(y_true, index) score = y_true / (np.arange(len(y_true)) + 1) return np.sum(score) / np.sum(y_true) ...
true
true
1c06a83e71d91641d5b836b6733745c2d6acc91c
341
py
Python
Python/Strings/Capitalize.py
stripti/Hackerrank-solutions
28b0e35e5747d8efff5183ae9cece52d72253d31
[ "MIT" ]
null
null
null
Python/Strings/Capitalize.py
stripti/Hackerrank-solutions
28b0e35e5747d8efff5183ae9cece52d72253d31
[ "MIT" ]
null
null
null
Python/Strings/Capitalize.py
stripti/Hackerrank-solutions
28b0e35e5747d8efff5183ae9cece52d72253d31
[ "MIT" ]
null
null
null
#!/bin/python import math import os import random import re import sys def solve(s): for x in s.split(): s = s.replace(x, x.capitalize(), 1) return s if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') s = raw_input() result = solve(s) fptr.write(result + '\n...
14.208333
47
0.58651
import math import os import random import re import sys def solve(s): for x in s.split(): s = s.replace(x, x.capitalize(), 1) return s if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') s = raw_input() result = solve(s) fptr.write(result + '\n') fptr.c...
true
true
1c06a98490cee0eb3cd0cb851a8cf721d4cc8b8e
1,731
py
Python
legacy/functional_code/backprojection/constants.py
jjimmykang/bwsi-backprojection
440e21f90e2a1d0d1c28bfd9a0faaf97129378a5
[ "MIT" ]
1
2020-02-09T19:09:27.000Z
2020-02-09T19:09:27.000Z
legacy/functional_code/backprojection/constants.py
jjimmykang/bwsi-backprojection
440e21f90e2a1d0d1c28bfd9a0faaf97129378a5
[ "MIT" ]
null
null
null
legacy/functional_code/backprojection/constants.py
jjimmykang/bwsi-backprojection
440e21f90e2a1d0d1c28bfd9a0faaf97129378a5
[ "MIT" ]
null
null
null
__pyarmor__(__name__, __file__, b'\xeb\x50\x8c\x64\x26\x42\xd6\x01\x6f\x0f\x27\xa2\x64\x8d\x1e\xb5\x54\xd9\x61\x57\x2f\x56\x03\x35\x46\xfc\x25\x13\x9b\xa4\xd5\x79\x12\xdf\x07\xc8\x90\xe3\x6a\x8e\x9c\xc3\x2c\xef\xeb\x51\x2c\xd9\x53\x06\xf5\x41\x2c\xbb\x3d\xdb\xb5\xf7\xa6\xb1\x21\x95\x63\x51\x50\x56\x7c\x01\xc3\xb6\x7a\x...
1,731
1,731
0.749856
__pyarmor__(__name__, __file__, b'\xeb\x50\x8c\x64\x26\x42\xd6\x01\x6f\x0f\x27\xa2\x64\x8d\x1e\xb5\x54\xd9\x61\x57\x2f\x56\x03\x35\x46\xfc\x25\x13\x9b\xa4\xd5\x79\x12\xdf\x07\xc8\x90\xe3\x6a\x8e\x9c\xc3\x2c\xef\xeb\x51\x2c\xd9\x53\x06\xf5\x41\x2c\xbb\x3d\xdb\xb5\xf7\xa6\xb1\x21\x95\x63\x51\x50\x56\x7c\x01\xc3\xb6\x7a\x...
true
true
1c06aa9ceea93479b757c38cc0c2d1b7313d17a8
26,588
py
Python
apip/utils.py
parshakova/APIP2
011c78b97c86c6fc22535acb798c685d2736b7d7
[ "MIT" ]
2
2019-08-09T04:31:02.000Z
2020-06-02T08:49:52.000Z
apip/utils.py
parshakova/APIP2
011c78b97c86c6fc22535acb798c685d2736b7d7
[ "MIT" ]
null
null
null
apip/utils.py
parshakova/APIP2
011c78b97c86c6fc22535acb798c685d2736b7d7
[ "MIT" ]
1
2020-06-18T09:37:33.000Z
2020-06-18T09:37:33.000Z
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. import re import os import ...
42.00316
135
0.607831
import re import os import sys import random import string import logging import argparse, msgpack import torch import logging import pickle import pandas as pd from collections import Counter import torch import numpy as np from itertools import compress class AverageMeter(object): def __init__(self): ...
true
true
1c06abad1ab29a11b87f24673ea5d56ef52af635
3,002
py
Python
PythonAPI/carissma_project/lib/python3.5/site-packages/pandas/tests/indexes/timedeltas/test_timedelta_range.py
AbdulHoffmann/carla_carissma
8d382769ffa02a6c61a22c57160285505f5ff0a4
[ "MIT" ]
6,989
2017-07-18T06:23:18.000Z
2022-03-31T15:58:36.000Z
PythonAPI/carissma_project/lib/python3.5/site-packages/pandas/tests/indexes/timedeltas/test_timedelta_range.py
AbdulHoffmann/carla_carissma
8d382769ffa02a6c61a22c57160285505f5ff0a4
[ "MIT" ]
1,978
2017-07-18T09:17:58.000Z
2022-03-31T14:28:43.000Z
PythonAPI/carissma_project/lib/python3.5/site-packages/pandas/tests/indexes/timedeltas/test_timedelta_range.py
AbdulHoffmann/carla_carissma
8d382769ffa02a6c61a22c57160285505f5ff0a4
[ "MIT" ]
1,228
2017-07-18T09:03:13.000Z
2022-03-29T05:57:40.000Z
import numpy as np import pytest import pandas as pd from pandas import timedelta_range, to_timedelta import pandas.util.testing as tm from pandas.tseries.offsets import Day, Second class TestTimedeltas(object): def test_timedelta_range(self): expected = to_timedelta(np.arange(5), unit='D') re...
37.525
79
0.602265
import numpy as np import pytest import pandas as pd from pandas import timedelta_range, to_timedelta import pandas.util.testing as tm from pandas.tseries.offsets import Day, Second class TestTimedeltas(object): def test_timedelta_range(self): expected = to_timedelta(np.arange(5), unit='D') re...
true
true
1c06ae1c3672911b634f0a301d63fa855dc44593
350
py
Python
utils.py
gosiqueira/advent-of-code-2018
04e784afadd71adcce7c33c6e07ed116b4d0a350
[ "MIT" ]
null
null
null
utils.py
gosiqueira/advent-of-code-2018
04e784afadd71adcce7c33c6e07ed116b4d0a350
[ "MIT" ]
null
null
null
utils.py
gosiqueira/advent-of-code-2018
04e784afadd71adcce7c33c6e07ed116b4d0a350
[ "MIT" ]
null
null
null
def get_input(day=1): inputs = [] with open(f'inputs/input-{day:02d}.txt', 'r') as f: inputs = f.read().splitlines() try: inputs = [int(elem) for elem in inputs] except: inputs = inputs return inputs def manhatan_dist(point1, point2): return abs(point1[0] - point2[0])...
21.875
66
0.585714
def get_input(day=1): inputs = [] with open(f'inputs/input-{day:02d}.txt', 'r') as f: inputs = f.read().splitlines() try: inputs = [int(elem) for elem in inputs] except: inputs = inputs return inputs def manhatan_dist(point1, point2): return abs(point1[0] - point2[0])...
true
true
1c06ae5a1c2581d4982bd4d55429d87b45498ecd
1,072
py
Python
pcdet/models/__init__.py
TillBeemelmanns/OpenPCDet
b7553c879d0ba36477931efe07a55adbc39823b9
[ "Apache-2.0" ]
2
2020-08-04T08:39:28.000Z
2021-02-09T08:07:13.000Z
pcdet/models/__init__.py
TillBeemelmanns/OpenPCDet
b7553c879d0ba36477931efe07a55adbc39823b9
[ "Apache-2.0" ]
null
null
null
pcdet/models/__init__.py
TillBeemelmanns/OpenPCDet
b7553c879d0ba36477931efe07a55adbc39823b9
[ "Apache-2.0" ]
null
null
null
import torch import numpy as np from collections import namedtuple from .detectors import build_detector def build_network(model_cfg, num_class, dataset): model = build_detector( model_cfg=model_cfg, num_class=num_class, dataset=dataset ) return model def load_data_to_gpu(batch_dict): for ke...
27.487179
77
0.666978
import torch import numpy as np from collections import namedtuple from .detectors import build_detector def build_network(model_cfg, num_class, dataset): model = build_detector( model_cfg=model_cfg, num_class=num_class, dataset=dataset ) return model def load_data_to_gpu(batch_dict): for ke...
true
true
1c06aef57aea1cb1caf412ff9c9200f1cb09af1d
925
py
Python
setup.py
JeffCarpenter/qtoml
c7d318e60c860f781b775d6fbb15ccf29fcf5241
[ "MIT" ]
1
2019-04-17T19:33:15.000Z
2019-04-17T19:33:15.000Z
setup.py
JeffCarpenter/qtoml
c7d318e60c860f781b775d6fbb15ccf29fcf5241
[ "MIT" ]
null
null
null
setup.py
JeffCarpenter/qtoml
c7d318e60c860f781b775d6fbb15ccf29fcf5241
[ "MIT" ]
null
null
null
#!python from setuptools import setup with open('README.rst') as rm: long_description = rm.read() setup( name='qtoml', version='0.2.1', author="alethiophile", author_email="tomdicksonhunt@gmail.com", description="New TOML encoder/decoder", long_description=long_description, long_descr...
27.205882
70
0.629189
from setuptools import setup with open('README.rst') as rm: long_description = rm.read() setup( name='qtoml', version='0.2.1', author="alethiophile", author_email="tomdicksonhunt@gmail.com", description="New TOML encoder/decoder", long_description=long_description, long_description_co...
true
true
1c06aef84b8718592724ff6a7fa81443ede98054
24,413
py
Python
src/the_tale/the_tale/accounts/personal_messages/tests/test_requests.py
al-arz/the-tale
542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5
[ "BSD-3-Clause" ]
85
2017-11-21T12:22:02.000Z
2022-03-27T23:07:17.000Z
src/the_tale/the_tale/accounts/personal_messages/tests/test_requests.py
al-arz/the-tale
542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5
[ "BSD-3-Clause" ]
545
2017-11-04T14:15:04.000Z
2022-03-27T14:19:27.000Z
src/the_tale/the_tale/accounts/personal_messages/tests/test_requests.py
al-arz/the-tale
542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5
[ "BSD-3-Clause" ]
45
2017-11-11T12:36:30.000Z
2022-02-25T06:10:44.000Z
import smart_imports smart_imports.all() class BaseRequestsTests(utils_testcase.TestCase): def setUp(self): super(BaseRequestsTests, self).setUp() game_logic.create_test_map() self.account_1 = self.accounts_factory.create_account() self.account_2 = self.accounts_factory.create_...
47.129344
204
0.696105
import smart_imports smart_imports.all() class BaseRequestsTests(utils_testcase.TestCase): def setUp(self): super(BaseRequestsTests, self).setUp() game_logic.create_test_map() self.account_1 = self.accounts_factory.create_account() self.account_2 = self.accounts_factory.create_...
true
true
1c06af745ac2aaa90cfb2aebd6a53534a6c26ebc
3,064
py
Python
xos/synchronizer/model_policies/model_policy_ntt_workflow_driver_serviceinstance.py
opencord/ntt-workflow-driver
a7386ad4d0604c48ffe32e6ca70e2b98095f1227
[ "Apache-2.0" ]
null
null
null
xos/synchronizer/model_policies/model_policy_ntt_workflow_driver_serviceinstance.py
opencord/ntt-workflow-driver
a7386ad4d0604c48ffe32e6ca70e2b98095f1227
[ "Apache-2.0" ]
null
null
null
xos/synchronizer/model_policies/model_policy_ntt_workflow_driver_serviceinstance.py
opencord/ntt-workflow-driver
a7386ad4d0604c48ffe32e6ca70e2b98095f1227
[ "Apache-2.0" ]
null
null
null
# Copyright 2020-present Open Networking Foundation # # 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 ag...
39.792208
122
0.680157
from helpers import NttHelpers from xossynchronizer.model_policies.policy import Policy import os import sys sync_path = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) sys.path.append(sync_path) class DeferredException(Exception): pass class NttWorkflowDriverServiceInstanc...
true
true
1c06b06f553b946b93fcebdcb742436f67f78b2b
1,038
py
Python
arrays/find_lucky_int_in_arr.py
wtlow003/leetcode-daily
e1d9c74b55e5b3106731a324d70a510e03b3b21f
[ "MIT" ]
null
null
null
arrays/find_lucky_int_in_arr.py
wtlow003/leetcode-daily
e1d9c74b55e5b3106731a324d70a510e03b3b21f
[ "MIT" ]
null
null
null
arrays/find_lucky_int_in_arr.py
wtlow003/leetcode-daily
e1d9c74b55e5b3106731a324d70a510e03b3b21f
[ "MIT" ]
1
2022-01-05T17:52:41.000Z
2022-01-05T17:52:41.000Z
""" 1394. Find Lucky Integer in an Array Given an array of integers arr, a lucky integer is an integer which has a frequency in the array equal to its value. Return a lucky integer in the array. If there are multiple lucky integers return the largest of them. If there is no lucky integer return -1. Example: Input: ar...
30.529412
141
0.648362
class Solution: def findLucky(self, arr: List[int]) -> int: from collections import Counter valid = list(filter(lambda x: x[0] == x[1], Counter(arr).items())) if len(valid) == 0: return -1 else: valid_sort = sorted(valid, key=l...
true
true
1c06b09a860d08d0343ec309e0b8bada03ca3c09
769
py
Python
src/train_script.py
Tharun24/IRLI
eb03f60a822fb66f34bdbe028db66e55a2ad7c0c
[ "MIT" ]
null
null
null
src/train_script.py
Tharun24/IRLI
eb03f60a822fb66f34bdbe028db66e55a2ad7c0c
[ "MIT" ]
null
null
null
src/train_script.py
Tharun24/IRLI
eb03f60a822fb66f34bdbe028db66e55a2ad7c0c
[ "MIT" ]
null
null
null
import subprocess from config import train_config as config for r in range(config.R): command = 'export PYTHONPATH=util/; python3 train.py --repetition='+str(r)+' --gpu='+str(config.gpus[r//config.num_gpus])+' --load_epoch=0 --n_epochs=30>../logs/'+config.dataset_name+'/b_'+str(config.B)+'/terminal_log_'+str(r...
59.153846
238
0.651495
import subprocess from config import train_config as config for r in range(config.R): command = 'export PYTHONPATH=util/; python3 train.py --repetition='+str(r)+' --gpu='+str(config.gpus[r//config.num_gpus])+' --load_epoch=0 --n_epochs=30>../logs/'+config.dataset_name+'/b_'+str(config.B)+'/terminal_log_'+str(r...
true
true
1c06b1c9dfcfb93647cd858c68f30add06eee512
2,827
py
Python
data/models.py
schollz/twittermatic
b66cf1142b77788d485c8f0efed47aa1e41150cf
[ "Unlicense", "MIT" ]
8
2015-10-09T15:37:33.000Z
2022-01-03T10:15:21.000Z
data/models.py
schollz/twittermatic
b66cf1142b77788d485c8f0efed47aa1e41150cf
[ "Unlicense", "MIT" ]
9
2015-10-09T21:03:03.000Z
2016-03-12T14:00:20.000Z
data/models.py
schollz/twittermatic
b66cf1142b77788d485c8f0efed47aa1e41150cf
[ "Unlicense", "MIT" ]
3
2015-10-08T19:40:49.000Z
2019-12-17T19:16:37.000Z
import datetime from data.database import Base from sqlalchemy import ForeignKey from sqlalchemy.orm import relationship, backref from sqlalchemy import Column, Integer, String, DateTime class Handler(Base): __tablename__ = 'handlers' id = Column(Integer, primary_key=True) handle = Column(String(50), uniq...
38.202703
152
0.694729
import datetime from data.database import Base from sqlalchemy import ForeignKey from sqlalchemy.orm import relationship, backref from sqlalchemy import Column, Integer, String, DateTime class Handler(Base): __tablename__ = 'handlers' id = Column(Integer, primary_key=True) handle = Column(String(50), uniq...
true
true
1c06b23e3812e9a7c4852536786aab16ccc37655
2,079
py
Python
password.py
TuffBard/Chaines
c139e56402fba97a61d8841c2eded00d0c89317d
[ "MIT" ]
null
null
null
password.py
TuffBard/Chaines
c139e56402fba97a61d8841c2eded00d0c89317d
[ "MIT" ]
null
null
null
password.py
TuffBard/Chaines
c139e56402fba97a61d8841c2eded00d0c89317d
[ "MIT" ]
null
null
null
# coding: utf-8 def getNext(password): """ Série de tests exprimés en doctest >>> getNext('aaaaa') 'aaaab' >>> getNext('aaaaz') 'aaaba' >>> getNext('zzzzz') 'aaaaa' """ pwd = list(password) #1 pwd contient chaque lettre du lot de passe sous forme de liste found = False ...
27.72
131
0.539683
def getNext(password): pwd = list(password) found = False i=len(pwd)-1 if password == 'zzzzz': pwd = list('aaaaa') found = True while not found: if pwd[i] < 'z': pwd[i] = chr(ord(pwd[i])+1) found = True else: pwd[i] =...
true
true
1c06b34c3097b1bcd7c72ab2f6f0190ec6338ab5
10,345
py
Python
airflow/contrib/hooks/ssh_hook.py
suensummit/airflow
37a342d0e96a91ce2d34085e225a4e86f54c4e21
[ "Apache-2.0" ]
1
2021-11-04T20:11:58.000Z
2021-11-04T20:11:58.000Z
airflow/contrib/hooks/ssh_hook.py
suensummit/airflow
37a342d0e96a91ce2d34085e225a4e86f54c4e21
[ "Apache-2.0" ]
3
2020-07-07T20:39:24.000Z
2021-09-29T17:34:46.000Z
airflow/contrib/hooks/ssh_hook.py
suensummit/airflow
37a342d0e96a91ce2d34085e225a4e86f54c4e21
[ "Apache-2.0" ]
1
2020-11-04T03:17:51.000Z
2020-11-04T03:17:51.000Z
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
37.34657
97
0.61769
import getpass import os import warnings from io import StringIO from typing import Optional import paramiko from paramiko.config import SSH_PORT from sshtunnel import SSHTunnelForwarder from airflow.exceptions import AirflowException from airflow.hooks.base_hook import BaseHook class SSHHook(BaseHook): def __...
true
true
1c06b3ffe75dcc5a18a2bc95952cdc9ce10fd858
3,494
py
Python
dvc/command/checkout.py
mribeirodantas/dvc
63fe2893a8a41e8999f92193d165bc75590f9955
[ "Apache-2.0" ]
null
null
null
dvc/command/checkout.py
mribeirodantas/dvc
63fe2893a8a41e8999f92193d165bc75590f9955
[ "Apache-2.0" ]
null
null
null
dvc/command/checkout.py
mribeirodantas/dvc
63fe2893a8a41e8999f92193d165bc75590f9955
[ "Apache-2.0" ]
null
null
null
import argparse import logging import colorama from dvc.command.base import append_doc_link from dvc.command.base import CmdBase from dvc.exceptions import CheckoutError logger = logging.getLogger(__name__) def _human_join(words): words = list(words) if not words: return "" return ( "{...
25.50365
71
0.560675
import argparse import logging import colorama from dvc.command.base import append_doc_link from dvc.command.base import CmdBase from dvc.exceptions import CheckoutError logger = logging.getLogger(__name__) def _human_join(words): words = list(words) if not words: return "" return ( "{...
true
true
1c06b54debb640f1629ce2441532c9f903bad772
7,184
py
Python
aiida/orm/entities.py
joepvd/aiida_core
6e9711046753332933f982971db1d7ac7e7ade58
[ "BSD-2-Clause" ]
null
null
null
aiida/orm/entities.py
joepvd/aiida_core
6e9711046753332933f982971db1d7ac7e7ade58
[ "BSD-2-Clause" ]
null
null
null
aiida/orm/entities.py
joepvd/aiida_core
6e9711046753332933f982971db1d7ac7e7ade58
[ "BSD-2-Clause" ]
null
null
null
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
30.832618
115
0.598692
from __future__ import division from __future__ import print_function from __future__ import absolute_import from aiida.common import exceptions from aiida.common.utils import classproperty, type_check from . import backends __all__ = ('Entity', 'Collection') class Collection(object): def __init__(self, backe...
true
true
1c06b66fe18a36db4d36a0c5b7772ebe9277d966
1,221
py
Python
samples/tests/test_create_table_range_partitioned.py
KoffieLabs/python-bigquery
33b317abdc6d69f33722cb0504bb0b78c1c80e30
[ "Apache-2.0" ]
1
2022-03-25T21:07:44.000Z
2022-03-25T21:07:44.000Z
samples/tests/test_create_table_range_partitioned.py
abecerrilsalas/python-bigquery
8da4fa9e77bcfd2b68818b5d65b38ccc59899a01
[ "Apache-2.0" ]
null
null
null
samples/tests/test_create_table_range_partitioned.py
abecerrilsalas/python-bigquery
8da4fa9e77bcfd2b68818b5d65b38ccc59899a01
[ "Apache-2.0" ]
null
null
null
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
34.885714
74
0.760033
import typing from .. import create_table_range_partitioned if typing.TYPE_CHECKING: import pytest def test_create_table_range_partitioned( capsys: "pytest.CaptureFixture[str]", random_table_id: str ) -> None: table = create_table_range_partitioned.create_table_range_partitioned( random_table_i...
true
true
1c06b7e27da39961650de860c8fb86899e1a3876
588
py
Python
utils/update.py
BLUECARVIN/RL_baseline
436538f49ee505e14672a67ba3c1f60886cbbea8
[ "MIT" ]
null
null
null
utils/update.py
BLUECARVIN/RL_baseline
436538f49ee505e14672a67ba3c1f60886cbbea8
[ "MIT" ]
null
null
null
utils/update.py
BLUECARVIN/RL_baseline
436538f49ee505e14672a67ba3c1f60886cbbea8
[ "MIT" ]
null
null
null
import numpy as np import torch def hard_update(target, source): """ Copies the parameters from source network to target network """ for target_param, param in zip(target.parameters(), source.parameters()): target_param.data.copy_(param.data) def soft_update(target, source, tau): ...
30.947368
83
0.664966
import numpy as np import torch def hard_update(target, source): for target_param, param in zip(target.parameters(), source.parameters()): target_param.data.copy_(param.data) def soft_update(target, source, tau): for target_param, param in zip(target.parameters(), source.parameters()): ...
true
true
1c06b946580c11f69f0240c17f0e36af4c8067e2
457
py
Python
customer/migrations/0013_alter_customer_phone.py
RFNshare/StraightIntLtd
40b0aecbddeee193a6dd9439fad6c974dee979e0
[ "MIT" ]
null
null
null
customer/migrations/0013_alter_customer_phone.py
RFNshare/StraightIntLtd
40b0aecbddeee193a6dd9439fad6c974dee979e0
[ "MIT" ]
null
null
null
customer/migrations/0013_alter_customer_phone.py
RFNshare/StraightIntLtd
40b0aecbddeee193a6dd9439fad6c974dee979e0
[ "MIT" ]
1
2021-07-13T10:14:45.000Z
2021-07-13T10:14:45.000Z
# Generated by Django 3.2.5 on 2021-07-28 15:50 from django.db import migrations import phonenumber_field.modelfields class Migration(migrations.Migration): dependencies = [ ('customer', '0012_customer_owner'), ] operations = [ migrations.AlterField( model_name='customer', ...
22.85
94
0.649891
from django.db import migrations import phonenumber_field.modelfields class Migration(migrations.Migration): dependencies = [ ('customer', '0012_customer_owner'), ] operations = [ migrations.AlterField( model_name='customer', name='phone', field=phone...
true
true
1c06ba7656fcaec994fab449e5aa4a8426054c4b
998
py
Python
jacket/db/storage/sqlalchemy/migrate_repo/versions/036_add_provider_id_column_to_snapshots.py
bopopescu/jacket
d7ad3147fcb43131098c2a5210847634ff5fb325
[ "Apache-2.0" ]
null
null
null
jacket/db/storage/sqlalchemy/migrate_repo/versions/036_add_provider_id_column_to_snapshots.py
bopopescu/jacket
d7ad3147fcb43131098c2a5210847634ff5fb325
[ "Apache-2.0" ]
null
null
null
jacket/db/storage/sqlalchemy/migrate_repo/versions/036_add_provider_id_column_to_snapshots.py
bopopescu/jacket
d7ad3147fcb43131098c2a5210847634ff5fb325
[ "Apache-2.0" ]
2
2016-08-10T02:21:49.000Z
2020-07-24T01:57:21.000Z
# 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, software # d...
38.384615
78
0.731463
from sqlalchemy import Column from sqlalchemy import MetaData, String, Table def upgrade(migrate_engine): meta = MetaData() meta.bind = migrate_engine snapshots = Table('storage_snapshots', meta, autoload=True) provider_id = Column('provider_id', String(255)) snapshots.create_column(provider_id)...
true
true
1c06ba953a8a6899b9c145528b7bec560176402b
2,325
py
Python
blockchain.py
jake-billings/research-blockchain
7b167d9572a169566b9cf21f1a0bdc18086b877f
[ "MIT" ]
5
2017-07-20T19:46:42.000Z
2020-02-13T16:03:09.000Z
blockchain.py
jake-billings/research-blockchain
7b167d9572a169566b9cf21f1a0bdc18086b877f
[ "MIT" ]
null
null
null
blockchain.py
jake-billings/research-blockchain
7b167d9572a169566b9cf21f1a0bdc18086b877f
[ "MIT" ]
null
null
null
import hashlib import os import math from encode import encode, decode, encode_32, decode_32 HASH_ALGORITHM = 'sha512' HASHER = hashlib.new(HASH_ALGORITHM) NONCE_SIZE = 8 DIFFICULTY_ORDER = 1 ENCODING_ORDER = 32 DIFFICULTY = math.pow(ENCODING_ORDER, DIFFICULTY_ORDER) DIFFICULTY_PHRASE = 'dankmemes' for i in range(...
25.549451
139
0.611183
import hashlib import os import math from encode import encode, decode, encode_32, decode_32 HASH_ALGORITHM = 'sha512' HASHER = hashlib.new(HASH_ALGORITHM) NONCE_SIZE = 8 DIFFICULTY_ORDER = 1 ENCODING_ORDER = 32 DIFFICULTY = math.pow(ENCODING_ORDER, DIFFICULTY_ORDER) DIFFICULTY_PHRASE = 'dankmemes' for i in range(...
false
true
1c06bab4dd1bab540e6bddcac4f47811e213b7e8
4,929
py
Python
zeus/datasets/common/div2k.py
wnov/vega
bf51cbe389d41033c4ae4bc02e5078c3c247c845
[ "MIT" ]
6
2020-11-13T15:44:47.000Z
2021-12-02T08:14:06.000Z
zeus/datasets/common/div2k.py
JacobLee121/vega
19256aca4d047bfad3b461f0a927e1c2abb9eb03
[ "MIT" ]
null
null
null
zeus/datasets/common/div2k.py
JacobLee121/vega
19256aca4d047bfad3b461f0a927e1c2abb9eb03
[ "MIT" ]
2
2021-06-25T09:42:32.000Z
2021-08-06T18:00:09.000Z
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
40.073171
106
0.644756
import os import os.path from .utils import div2k_util as util from .. import transforms from .utils.dataset import Dataset from zeus.common import ClassFactory, ClassType from zeus.common import FileOps from zeus.datasets.conf.div2k import DIV2KConfig @ClassFactory.register(ClassType.DATASET) class DIV2K(Dataset):...
true
true
1c06bc1845172058f6253cbecb51085c4ed3119c
3,455
py
Python
echopype/convert/utils/set_groups_base.py
emiliom/echopype
3665faeb251d4db4bd8e1dfe05f41942c86f10ea
[ "Apache-2.0" ]
null
null
null
echopype/convert/utils/set_groups_base.py
emiliom/echopype
3665faeb251d4db4bd8e1dfe05f41942c86f10ea
[ "Apache-2.0" ]
null
null
null
echopype/convert/utils/set_groups_base.py
emiliom/echopype
3665faeb251d4db4bd8e1dfe05f41942c86f10ea
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import, division, print_function import os import numpy as np import netCDF4 import xarray as xr class SetGroupsBase: """Base class for setting groups in netCDF file. """ def __init__(self, file_path='test.nc'): self.file_path = file_path def set_toplevel(self...
34.89899
89
0.550507
from __future__ import absolute_import, division, print_function import os import numpy as np import netCDF4 import xarray as xr class SetGroupsBase: def __init__(self, file_path='test.nc'): self.file_path = file_path def set_toplevel(self, tl_dict): with netCDF4.Dataset(self.file_path, "w",...
true
true
1c06bcca8d631cdbbbf2fc213779591c8f2f3858
46,744
py
Python
Tests/test_GenomeDiagram.py
wwydmanski/biopython
77d56385aa1ba2e2156713feb8bac88bc0558862
[ "BSD-3-Clause" ]
null
null
null
Tests/test_GenomeDiagram.py
wwydmanski/biopython
77d56385aa1ba2e2156713feb8bac88bc0558862
[ "BSD-3-Clause" ]
null
null
null
Tests/test_GenomeDiagram.py
wwydmanski/biopython
77d56385aa1ba2e2156713feb8bac88bc0558862
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Tests for GenomeDiagram general functionality.""" import os import unittest import math # Do we have ReportLab? Raise erro...
43.281481
130
0.572031
import os import unittest import math from Bio import MissingPythonDependencyError try: from reportlab.lib import colors from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont from reportlab.lib.units import cm except ImportError: raise MissingPythonDependencyError...
true
true
1c06be87fef1e5f337a0779ec0e42e5eb1561327
15,856
py
Python
lib/datasets/coco_14_40_base.py
yangdb/RD-IOD
64beb2e1efe823185adc0feb338a900f1a7df7a7
[ "AFL-1.1" ]
1
2022-03-11T03:08:04.000Z
2022-03-11T03:08:04.000Z
lib/datasets/coco_14_40_base.py
yangdb/RD-IOD
64beb2e1efe823185adc0feb338a900f1a7df7a7
[ "AFL-1.1" ]
3
2022-03-07T03:04:34.000Z
2022-03-25T12:28:09.000Z
lib/datasets/coco_14_40_base.py
yangdb/RD-IOD
64beb2e1efe823185adc0feb338a900f1a7df7a7
[ "AFL-1.1" ]
null
null
null
from __future__ import print_function from __future__ import absolute_import # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # ----------------------------------------------------...
40.971576
114
0.544526
from __future__ import print_function from __future__ import absolute_import import xml.dom.minidom as minidom import os import numpy as np import scipy.sparse import subprocess import math import glob import uuid import scipy.io as sio import xml.etree.ElementTree as ET import pickle from .imdb import imdb from .imd...
true
true
1c06bf8a577be7cbe37ce8a24d664ca0d11a9093
15,295
py
Python
python_modules/dagster/dagster/core/definitions/solid_invocation.py
abkfenris/dagster
7f35164535200cf904a4fdb18af207ccad09ad68
[ "Apache-2.0" ]
null
null
null
python_modules/dagster/dagster/core/definitions/solid_invocation.py
abkfenris/dagster
7f35164535200cf904a4fdb18af207ccad09ad68
[ "Apache-2.0" ]
null
null
null
python_modules/dagster/dagster/core/definitions/solid_invocation.py
abkfenris/dagster
7f35164535200cf904a4fdb18af207ccad09ad68
[ "Apache-2.0" ]
null
null
null
import inspect from typing import TYPE_CHECKING, Any, Optional, Union, cast from dagster import check from dagster.core.errors import ( DagsterInvalidInvocationError, DagsterInvariantViolationError, DagsterTypeCheckDidNotPass, ) from .events import AssetMaterialization, DynamicOutput, ExpectationResult, M...
42.019231
153
0.649428
import inspect from typing import TYPE_CHECKING, Any, Optional, Union, cast from dagster import check from dagster.core.errors import ( DagsterInvalidInvocationError, DagsterInvariantViolationError, DagsterTypeCheckDidNotPass, ) from .events import AssetMaterialization, DynamicOutput, ExpectationResult, M...
true
true
1c06c052dcd1515cb4f2a791369a84c4e62d11be
1,351
py
Python
tests/test_ding_dong.py
wechaty/python-wechaty-puppet-mock
ffad481545b93d328f346b42bd7e9565f5dda88a
[ "Apache-2.0" ]
null
null
null
tests/test_ding_dong.py
wechaty/python-wechaty-puppet-mock
ffad481545b93d328f346b42bd7e9565f5dda88a
[ "Apache-2.0" ]
null
null
null
tests/test_ding_dong.py
wechaty/python-wechaty-puppet-mock
ffad481545b93d328f346b42bd7e9565f5dda88a
[ "Apache-2.0" ]
null
null
null
from random import choice from typing import cast import pytest from wechaty import WechatyOptions, Wechaty, Message from wechaty_puppet import Puppet, get_logger from wechaty_puppet_mock import EnvironmentMock, Mocker, PuppetMockOptions, \ PuppetMock # All test coroutines will be treated as marked. pytestmark =...
23.701754
77
0.706144
from random import choice from typing import cast import pytest from wechaty import WechatyOptions, Wechaty, Message from wechaty_puppet import Puppet, get_logger from wechaty_puppet_mock import EnvironmentMock, Mocker, PuppetMockOptions, \ PuppetMock pytestmark = pytest.mark.asyncio log = get_logger('TestDingD...
true
true
1c06c0bf75a3ae45310eef5495260ca1154b038c
7,202
py
Python
models/stackhourglass_prob.py
weihaosky/SMVmatching
814d00530026278f3582df3849ead46b3479cc57
[ "MIT" ]
2
2021-08-06T03:39:11.000Z
2021-08-09T06:32:18.000Z
models/stackhourglass_prob.py
weihaosky/SMVmatching
814d00530026278f3582df3849ead46b3479cc57
[ "MIT" ]
null
null
null
models/stackhourglass_prob.py
weihaosky/SMVmatching
814d00530026278f3582df3849ead46b3479cc57
[ "MIT" ]
1
2021-11-15T02:27:32.000Z
2021-11-15T02:27:32.000Z
from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math from .submodule import * class hourglass(nn.Module): def __init__(self, inplanes): super(hourglass, self).__init__() sel...
40.460674
158
0.544571
from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math from .submodule import * class hourglass(nn.Module): def __init__(self, inplanes): super(hourglass, self).__init__() sel...
true
true
1c06c0eb9d7922a9edc17612e5cd287f19c08712
82,433
py
Python
linepy/style.py
nima61/nimamaxi
194c7e9a7710499b4757c2df9a8eb896cd46c0fe
[ "MIT" ]
null
null
null
linepy/style.py
nima61/nimamaxi
194c7e9a7710499b4757c2df9a8eb896cd46c0fe
[ "MIT" ]
null
null
null
linepy/style.py
nima61/nimamaxi
194c7e9a7710499b4757c2df9a8eb896cd46c0fe
[ "MIT" ]
null
null
null
import livejson class autobots(object): ''' DONT CHANGE OR REMOVE IF YOU ARE NOT SURE WHAT YOU DO :) TEMPLATE BY : THE AUTOBOTS CORPORATION (STANDAR DESIGN) ''' def __init__(self): self.rname = livejson.File('data/key.json', True, False, 4)["rname"] if self.rname != "": ...
149.065099
5,194
0.551054
import livejson class autobots(object): def __init__(self): self.rname = livejson.File('data/key.json', True, False, 4)["rname"] if self.rname != "": self.rname = self.rname + " " self.pushMsg = "line://app/1655623470-81eDd9kM" self.badge = "https://imjustgood.com/img/...
true
true
1c06c1ea6949409eb507b0395e106bd28e24cfea
12,012
py
Python
python/coanlib.py
sarang2dan/git-coan2
0ae84adac82cb7b739ec1bad1fb9dab6ce38e3c3
[ "BSD-3-Clause" ]
4
2018-10-17T00:40:23.000Z
2021-03-08T11:19:08.000Z
python/coanlib.py
sarang2dan/git-coan2
0ae84adac82cb7b739ec1bad1fb9dab6ce38e3c3
[ "BSD-3-Clause" ]
null
null
null
python/coanlib.py
sarang2dan/git-coan2
0ae84adac82cb7b739ec1bad1fb9dab6ce38e3c3
[ "BSD-3-Clause" ]
2
2021-03-08T11:19:13.000Z
2021-12-16T11:58:40.000Z
#!/usr/bin/python # Module coanlib provides utility routines for the coan test harnesses import sys, os, subprocess, re, shutil, string, shlex, time, atexit, \ errno __progress = 0 __info = 1 __warning = 2 __error = 3 __fatal = 4 __severities_by_word = { 'progress' : __progress, 'info' : __info, 'warning' : __wa...
26.693333
86
0.699217
import sys, os, subprocess, re, shutil, string, shlex, time, atexit, \ errno __progress = 0 __info = 1 __warning = 2 __error = 3 __fatal = 4 __severities_by_word = { 'progress' : __progress, 'info' : __info, 'warning' : __warning, 'error' : __error, 'fatal' : __fatal } __severities_by_num = { __progress : 'pr...
false
true
1c06c28f5a63abcc86704d4a025ff7e1ea8244f6
24,300
py
Python
fmpy/ssp/ssd.py
CSchulzeTLK/FMPy
fde192346c36eb69dbaca60a96e80cdc8ef37b89
[ "CC-BY-3.0", "CC-BY-4.0" ]
225
2017-05-17T22:33:38.000Z
2022-03-29T12:41:52.000Z
fmpy/ssp/ssd.py
CSchulzeTLK/FMPy
fde192346c36eb69dbaca60a96e80cdc8ef37b89
[ "CC-BY-3.0", "CC-BY-4.0" ]
381
2017-05-20T13:31:52.000Z
2022-03-31T08:20:47.000Z
fmpy/ssp/ssd.py
CSchulzeTLK/FMPy
fde192346c36eb69dbaca60a96e80cdc8ef37b89
[ "CC-BY-3.0", "CC-BY-4.0" ]
90
2017-05-20T13:34:34.000Z
2022-03-31T05:14:57.000Z
from lxml import etree import zipfile import os # namespaces for XML parsing ns = { 'ssc': 'http://ssp-standard.org/SSP1/SystemStructureCommon', 'ssd': 'http://ssp-standard.org/SSP1/SystemStructureDescription', 'ssm': 'http://ssp-standard.org/SSP1/SystemStructureParameterMapping', 'ssv': 'http...
33.844011
229
0.616872
from lxml import etree import zipfile import os ns = { 'ssc': 'http://ssp-standard.org/SSP1/SystemStructureCommon', 'ssd': 'http://ssp-standard.org/SSP1/SystemStructureDescription', 'ssm': 'http://ssp-standard.org/SSP1/SystemStructureParameterMapping', 'ssv': 'http://ssp-standard.org/SSP1/Syste...
true
true
1c06c3eb3019d03ca46134003a1dd301b89576dc
3,497
py
Python
aleph_message/models/program.py
leirbag95/aleph-message
3b942e761a253126fb0240a3bce342db0a7333d2
[ "MIT" ]
null
null
null
aleph_message/models/program.py
leirbag95/aleph-message
3b942e761a253126fb0240a3bce342db0a7333d2
[ "MIT" ]
null
null
null
aleph_message/models/program.py
leirbag95/aleph-message
3b942e761a253126fb0240a3bce342db0a7333d2
[ "MIT" ]
null
null
null
from __future__ import annotations from abc import ABC, abstractmethod from enum import Enum from pydantic import Field, Extra, conint from typing import Optional, List, Union, Dict, Any from typing_extensions import Literal from .abstract import BaseContent, HashableModel class Encoding(str, Enum): plain = "p...
25.525547
118
0.709465
from __future__ import annotations from abc import ABC, abstractmethod from enum import Enum from pydantic import Field, Extra, conint from typing import Optional, List, Union, Dict, Any from typing_extensions import Literal from .abstract import BaseContent, HashableModel class Encoding(str, Enum): plain = "p...
true
true
1c06c42642084b22de1016fdc6f021f3295f5235
3,550
py
Python
ProbPaper/Uniform.py
Kouki706/Prob-Paper
01173d7f544cb274224a53ffc1ad1034a06084d6
[ "MIT" ]
2
2021-08-01T16:02:30.000Z
2021-08-01T16:02:32.000Z
ProbPaper/Uniform.py
Kouki706/ProbPaper
01173d7f544cb274224a53ffc1ad1034a06084d6
[ "MIT" ]
null
null
null
ProbPaper/Uniform.py
Kouki706/ProbPaper
01173d7f544cb274224a53ffc1ad1034a06084d6
[ "MIT" ]
null
null
null
#%% import numpy as np import math from scipy.stats import norm from scipy.optimize import curve_fit import matplotlib.pyplot as plt # 回帰式 def func(x, a, b): f = a*x + b return f # データの読み込み Qin=np.loadtxt('./Data.csv', delimiter=',',usecols=[0]) Qin = np.sort(Qin) # データサイズの取得 max = Qin.size print("データ数",max)...
23.509934
103
0.649859
import numpy as np import math from scipy.stats import norm from scipy.optimize import curve_fit import matplotlib.pyplot as plt def func(x, a, b): f = a*x + b return f Qin=np.loadtxt('./Data.csv', delimiter=',',usecols=[0]) Qin = np.sort(Qin) max = Qin.size print("データ数",max) Pin=np.empty(max) for i in rang...
true
true
1c06c4cca7e0989e774e1a23ae92929b18da9d7d
4,131
py
Python
third/mmdet/configs/faster_rcnn_r50_fpn_1x.py
fossabot/Video-to-Online-Platform
46019562f072a5dc2a92684986411d7f88758882
[ "Apache-2.0" ]
82
2019-10-04T05:40:45.000Z
2020-03-14T06:40:02.000Z
third/mmdet/configs/faster_rcnn_r50_fpn_1x.py
wangyongjie-ntu/Video-to-Online-Platform
b1230c8f702487225566b5be13947bd6f7904556
[ "Apache-2.0" ]
9
2020-06-04T19:31:59.000Z
2021-01-10T02:32:02.000Z
third/mmdet/configs/faster_rcnn_r50_fpn_1x.py
wangyongjie-ntu/Video-to-Online-Platform
b1230c8f702487225566b5be13947bd6f7904556
[ "Apache-2.0" ]
24
2019-10-04T05:46:46.000Z
2020-05-30T05:22:32.000Z
# model settings model = dict( type='FasterRCNN', pretrained='modelzoo://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, ...
27.912162
77
0.600339
model = dict( type='FasterRCNN', pretrained='modelzoo://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[256, 512, 1024, 2048],...
true
true
1c06c535ae87bd9931c8e280c33f591300c2b6fc
482
py
Python
odoo-13.0/addons/hr/models/__init__.py
VaibhavBhujade/Blockchain-ERP-interoperability
b5190a037fb6615386f7cbad024d51b0abd4ba03
[ "MIT" ]
null
null
null
odoo-13.0/addons/hr/models/__init__.py
VaibhavBhujade/Blockchain-ERP-interoperability
b5190a037fb6615386f7cbad024d51b0abd4ba03
[ "MIT" ]
null
null
null
odoo-13.0/addons/hr/models/__init__.py
VaibhavBhujade/Blockchain-ERP-interoperability
b5190a037fb6615386f7cbad024d51b0abd4ba03
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import hr_employee_base from . import hr_employee from . import hr_employee_category from . import hr_employee_public from . import hr_department from . import hr_job from . import hr_plan from . import mail_alia...
26.777778
74
0.788382
from . import hr_employee_base from . import hr_employee from . import hr_employee_category from . import hr_employee_public from . import hr_department from . import hr_job from . import hr_plan from . import mail_alias from . import mail_channel from . import res_config_settings from . import res_partner from . imp...
true
true
1c06c5dcccdf38f04b3b52b748935a2ddea83142
3,942
py
Python
objectModel/Python/cdm/persistence/syms/data_partition_pattern_persistence.py
mjohnst/CDM
6adbae0554f5cca0d6796558a85466f72d28b947
[ "CC-BY-4.0", "MIT" ]
1
2022-02-10T09:01:51.000Z
2022-02-10T09:01:51.000Z
objectModel/Python/cdm/persistence/syms/data_partition_pattern_persistence.py
mjohnst/CDM
6adbae0554f5cca0d6796558a85466f72d28b947
[ "CC-BY-4.0", "MIT" ]
null
null
null
objectModel/Python/cdm/persistence/syms/data_partition_pattern_persistence.py
mjohnst/CDM
6adbae0554f5cca0d6796558a85466f72d28b947
[ "CC-BY-4.0", "MIT" ]
null
null
null
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. import dateutil.parser from cdm.enums import CdmObjectType, CdmLogCode from cdm.objectmodel import CdmCorpusContext, CdmDataPartitionPatternDefinition from cdm.ut...
55.521127
151
0.696854
 import dateutil.parser from cdm.enums import CdmObjectType, CdmLogCode from cdm.objectmodel import CdmCorpusContext, CdmDataPartitionPatternDefinition from cdm.utilities import logger from cdm.persistence.syms.models import FormatType from . import utils from cdm.persistence.syms.models import StorageDescriptor _T...
false
true
1c06c5eccfcf48fede6216086e84b00dbbbbcd6d
1,792
py
Python
scripts/plot_exit_rate.py
SriramRamesh/traffic-signaling-networks
17fa5ed5e3cc935b0baa354bbfd6e6cd3030da64
[ "MIT" ]
null
null
null
scripts/plot_exit_rate.py
SriramRamesh/traffic-signaling-networks
17fa5ed5e3cc935b0baa354bbfd6e6cd3030da64
[ "MIT" ]
null
null
null
scripts/plot_exit_rate.py
SriramRamesh/traffic-signaling-networks
17fa5ed5e3cc935b0baa354bbfd6e6cd3030da64
[ "MIT" ]
2
2021-11-14T04:51:02.000Z
2022-02-18T03:05:02.000Z
import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt # provide as argument the exrates.txt file, which contains raw number # of cars exiting every sink every second inpath = sys.argv[1] #sinks_exrates = np.loadtxt(sys.argv[1], skiprows=2) sinks_exrates = pd.read_csv(inpath, comment='#', in...
35.84
114
0.6875
import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt inpath = sys.argv[1] sinks_exrates = pd.read_csv(inpath, comment='#', index_col=0) window = 60 window_minutes = window/60 radius = (window//2) freq = 10 savepath_fmt = inpath[:-4] + '_w{:03d}_s{:02d}_sink{{}}'.format(window, freq) ...
true
true
1c06c796c5e9218a8c58259c905eb5c2e706ae8b
2,849
py
Python
env/lib/python2.7/site-packages/django/contrib/flatpages/views.py
diego-d5000/MisValesMd
b641782bc2546776e9f55f452ec7fb48100dc482
[ "MIT" ]
null
null
null
env/lib/python2.7/site-packages/django/contrib/flatpages/views.py
diego-d5000/MisValesMd
b641782bc2546776e9f55f452ec7fb48100dc482
[ "MIT" ]
null
null
null
env/lib/python2.7/site-packages/django/contrib/flatpages/views.py
diego-d5000/MisValesMd
b641782bc2546776e9f55f452ec7fb48100dc482
[ "MIT" ]
null
null
null
from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.shortcuts import get_current_site from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404 from django.template import loader from djan...
39.027397
79
0.696736
from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.shortcuts import get_current_site from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404 from django.template import loader from djan...
true
true
1c06c79d938903f0d3e754124a22d0cd4bb023d0
24,266
py
Python
cefkivy/browser.py
rentouch/cefkivy
6dbfa292230628a9f9bfabe47bf245e464efb504
[ "MIT" ]
10
2015-05-16T17:38:41.000Z
2022-02-04T05:06:34.000Z
cefkivy/browser.py
rentouch/cefkivy
6dbfa292230628a9f9bfabe47bf245e464efb504
[ "MIT" ]
1
2020-03-27T17:11:40.000Z
2020-03-30T06:29:43.000Z
cefkivy/browser.py
rentouch/cefkivy
6dbfa292230628a9f9bfabe47bf245e464efb504
[ "MIT" ]
10
2017-05-13T19:31:23.000Z
2022-02-04T10:19:37.000Z
# Import cef as first module! (it's important) import ctypes import sys import os libcef_so = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'libcef.so') if os.path.exists(libcef_so): # Import local module ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL) if 0x02070000 <= sys.hexversion < 0x03000000: ...
35.580645
195
0.596308
import ctypes import sys import os libcef_so = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'libcef.so') if os.path.exists(libcef_so): # Import local module ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL) if 0x02070000 <= sys.hexversion < 0x03000000: import cefpython_py27 as cefpython el...
false
true
1c06c7c926de3f3963527c6f7a3dbf1d34dd33da
832
py
Python
group_and_zip.py
chadrick-kwag/getframesfromvideo
25a2b3d5dfd037f5f47ec3c37b1e41c41795e6a6
[ "Apache-2.0" ]
null
null
null
group_and_zip.py
chadrick-kwag/getframesfromvideo
25a2b3d5dfd037f5f47ec3c37b1e41c41795e6a6
[ "Apache-2.0" ]
null
null
null
group_and_zip.py
chadrick-kwag/getframesfromvideo
25a2b3d5dfd037f5f47ec3c37b1e41c41795e6a6
[ "Apache-2.0" ]
null
null
null
# zip in bunche # python 2 # fetch all jpg files import common import os import argparse import sys GROUP_SIZE=100 parser = argparse.ArgumentParser(description="zipping bunch of imagefiles into partial zip files") parser.add_argument('--zipbasename',action='store', default="outputzip", help="zip file base name")...
16
99
0.729567
import common import os import argparse import sys GROUP_SIZE=100 parser = argparse.ArgumentParser(description="zipping bunch of imagefiles into partial zip files") parser.add_argument('--zipbasename',action='store', default="outputzip", help="zip file base name") parseargs = parser.parse_args() print parsearg...
false
true
1c06c8f11dd970950f763ef31fc32381004f4610
18,204
py
Python
atc/atcd/atcd/backends/linux.py
thaingoc90/NATC
c44ca7a5c7577d9d1d37b71fa0d07f11219fe984
[ "BSD-3-Clause" ]
null
null
null
atc/atcd/atcd/backends/linux.py
thaingoc90/NATC
c44ca7a5c7577d9d1d37b71fa0d07f11219fe984
[ "BSD-3-Clause" ]
null
null
null
atc/atcd/atcd/backends/linux.py
thaingoc90/NATC
c44ca7a5c7577d9d1d37b71fa0d07f11219fe984
[ "BSD-3-Clause" ]
null
null
null
# # Copyright (c) 2014, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # import sys from atcd....
36.480962
118
0.558559
import sys from atcd.AtcdThriftHandlerTask import AtcdThriftHandlerTask from pyroute2 import IPRoute from pyroute2.netlink.rtnl import TC_H_ROOT from pyroute2.netlink.rtnl import RTM_NEWTCLASS from pyroute2.netlink.rtnl import RTM_DELTCLASS from pyroute2.netlink.rtnl import RTM_NEWQDISC from pyroute2.netlink.rtnl imp...
true
true
1c06c8f8cf04def1d2cf193280bc94d69850b948
4,355
py
Python
kubernetes/client/models/v1beta1_job_template_spec.py
craigtracey/python
177564c655c0ea3f9cf38e61ca275ef6c6256aab
[ "Apache-2.0" ]
null
null
null
kubernetes/client/models/v1beta1_job_template_spec.py
craigtracey/python
177564c655c0ea3f9cf38e61ca275ef6c6256aab
[ "Apache-2.0" ]
null
null
null
kubernetes/client/models/v1beta1_job_template_spec.py
craigtracey/python
177564c655c0ea3f9cf38e61ca275ef6c6256aab
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.9.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
28.096774
161
0.582319
from pprint import pformat from six import iteritems import re class V1beta1JobTemplateSpec(object): swagger_types = { 'metadata': 'V1ObjectMeta', 'spec': 'V1JobSpec' } attribute_map = { 'metadata': 'metadata', 'spec': 'spec' } def __init__(self, metadata=Non...
true
true
1c06c988fc01e5fcb5eec7ad1ae10ef1f56d0334
10,696
py
Python
src/obfuscapk/obfuscators/const_string_encryption/const_string_encryption.py
AkshayJainG/Obfuscapk
6f2e791dbc06afc17d69393b3e5064cc4821a582
[ "MIT" ]
12
2020-02-24T13:40:41.000Z
2021-05-05T12:41:43.000Z
src/obfuscapk/obfuscators/const_string_encryption/const_string_encryption.py
LoraxOfficial/Obfuscapk
6f2e791dbc06afc17d69393b3e5064cc4821a582
[ "MIT" ]
null
null
null
src/obfuscapk/obfuscators/const_string_encryption/const_string_encryption.py
LoraxOfficial/Obfuscapk
6f2e791dbc06afc17d69393b3e5064cc4821a582
[ "MIT" ]
3
2020-05-15T16:44:43.000Z
2021-07-31T03:21:14.000Z
#!/usr/bin/env python3.7 # coding: utf-8 import logging import os import re from binascii import hexlify from typing import List, Set from Crypto.Cipher import AES from Crypto.Protocol.KDF import PBKDF2 from Crypto.Util.Padding import pad from obfuscapk import obfuscator_category from obfuscapk import util from obfu...
53.48
119
0.574514
import logging import os import re from binascii import hexlify from typing import List, Set from Crypto.Cipher import AES from Crypto.Protocol.KDF import PBKDF2 from Crypto.Util.Padding import pad from obfuscapk import obfuscator_category from obfuscapk import util from obfuscapk.obfuscation import Obfuscation cl...
true
true
1c06c994a0d3e963aee558e29cb7ea380a2e930d
1,407
py
Python
onnxmltools/convert/sklearn/shape_calculators/LinearRegressor.py
Oewyn/onnxmltools
8dbd844dab77754971f59d4d533e6763ce0b03c2
[ "MIT" ]
null
null
null
onnxmltools/convert/sklearn/shape_calculators/LinearRegressor.py
Oewyn/onnxmltools
8dbd844dab77754971f59d4d533e6763ce0b03c2
[ "MIT" ]
null
null
null
onnxmltools/convert/sklearn/shape_calculators/LinearRegressor.py
Oewyn/onnxmltools
8dbd844dab77754971f59d4d533e6763ce0b03c2
[ "MIT" ]
null
null
null
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from ...c...
67
103
0.803838
from ...common._registration import register_shape_calculator from ...common.shape_calculator import calculate_linear_regressor_output_shapes register_shape_calculator('SklearnElasticNetRegressor', calculate_linear_regressor_output_shapes) register_shape_calculator('SklearnLinearRegressor', calculate_linear_regresso...
true
true
1c06ca1d4e991a7e62ccb2d0649f853b67ae6777
1,533
py
Python
beetles/ml_intuition/evaluation/time_metrics.py
ESA-PhiLab/hypernet
b33f7893d3dfcbbc2c10076fb61b2b1f1316402a
[ "MIT" ]
34
2018-11-14T09:38:00.000Z
2022-01-31T17:44:51.000Z
beetles/ml_intuition/evaluation/time_metrics.py
ESA-PhiLab/hypernet
b33f7893d3dfcbbc2c10076fb61b2b1f1316402a
[ "MIT" ]
5
2018-09-11T14:52:35.000Z
2022-03-24T09:32:01.000Z
beetles/ml_intuition/evaluation/time_metrics.py
ESA-PhiLab/hypernet
b33f7893d3dfcbbc2c10076fb61b2b1f1316402a
[ "MIT" ]
11
2018-10-24T12:42:59.000Z
2022-03-12T03:50:50.000Z
""" All metric utils regarding time measures. """ from time import time from tensorflow.keras.callbacks import Callback class TimeHistory(Callback): """ Custom keras callback logging duration of each epoch. """ def on_train_begin(self, logs: dict = {}): """ Initialize attributes. ...
25.131148
65
0.596869
from time import time from tensorflow.keras.callbacks import Callback class TimeHistory(Callback): def on_train_begin(self, logs: dict = {}): self.on_train_begin_time = time() self.times = [] self.average = [] def on_epoch_begin(self, batch: int, logs: dict = {}): self.epoc...
true
true
1c06cb2136a4edd614beafb0400bc2f670f507fa
4,166
py
Python
wordDetectorNN/src/eval - Copy.py
nivibilla/EfficientHTR
29b7df216cf4d051c533a48715d696b351377d09
[ "MIT" ]
null
null
null
wordDetectorNN/src/eval - Copy.py
nivibilla/EfficientHTR
29b7df216cf4d051c533a48715d696b351377d09
[ "MIT" ]
null
null
null
wordDetectorNN/src/eval - Copy.py
nivibilla/EfficientHTR
29b7df216cf4d051c533a48715d696b351377d09
[ "MIT" ]
null
null
null
import argparse from collections import namedtuple import numpy as np import torch from path import Path from aabb import AABB from aabb_clustering import cluster_aabbs from coding import decode, fg_by_cc from dataloader import DataLoaderIAM from dataset import DatasetIAM, DatasetIAMSplit from iou import compute_dist...
33.596774
110
0.667307
import argparse from collections import namedtuple import numpy as np import torch from path import Path from aabb import AABB from aabb_clustering import cluster_aabbs from coding import decode, fg_by_cc from dataloader import DataLoaderIAM from dataset import DatasetIAM, DatasetIAMSplit from iou import compute_dist...
true
true
1c06cb882e58463c93aae6d49712cfecd5c1ec6b
3,276
py
Python
huaweicloud-sdk-dns/huaweicloudsdkdns/v2/model/batch_hand_tags.py
wuchen-huawei/huaweicloud-sdk-python-v3
3683d703f4320edb2b8516f36f16d485cff08fc2
[ "Apache-2.0" ]
1
2021-04-16T07:59:28.000Z
2021-04-16T07:59:28.000Z
huaweicloud-sdk-dns/huaweicloudsdkdns/v2/model/batch_hand_tags.py
wuchen-huawei/huaweicloud-sdk-python-v3
3683d703f4320edb2b8516f36f16d485cff08fc2
[ "Apache-2.0" ]
null
null
null
huaweicloud-sdk-dns/huaweicloudsdkdns/v2/model/batch_hand_tags.py
wuchen-huawei/huaweicloud-sdk-python-v3
3683d703f4320edb2b8516f36f16d485cff08fc2
[ "Apache-2.0" ]
1
2022-01-17T02:24:18.000Z
2022-01-17T02:24:18.000Z
# coding: utf-8 import pprint import re import six class BatchHandTags: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is j...
24.088235
74
0.524725
import pprint import re import six class BatchHandTags: sensitive_list = [] openapi_types = { 'tags': 'list[Tag]', 'action': 'str' } attribute_map = { 'tags': 'tags', 'action': 'action' } def __init__(self, tags=None, action=None): ...
true
true
1c06cc0d3f6fb97f352d589f160a3b80719e561c
1,716
py
Python
_static/src/python/SignalProcessing/Digital/TimeFrequencyAnalysis/Classical/STFT/demo_stft_gauss_nfft.py
metai/aitrace
8e42001f5e3a187801764f413b6ee2f32476c6d1
[ "MIT" ]
1
2022-01-03T06:13:31.000Z
2022-01-03T06:13:31.000Z
_static/src/python/SignalProcessing/Digital/TimeFrequencyAnalysis/Classical/STFT/demo_stft_gauss_nfft.py
metai/aitrace
8e42001f5e3a187801764f413b6ee2f32476c6d1
[ "MIT" ]
null
null
null
_static/src/python/SignalProcessing/Digital/TimeFrequencyAnalysis/Classical/STFT/demo_stft_gauss_nfft.py
metai/aitrace
8e42001f5e3a187801764f413b6ee2f32476c6d1
[ "MIT" ]
1
2022-01-03T06:13:33.000Z
2022-01-03T06:13:33.000Z
import numpy as np from scipy import signal import matplotlib.pyplot as plt T = 5 Fs = 400.0 n = T * Fs f1 = 10 f2 = 25 f3 = 50 f4 = 100 t1 = np.linspace(0, T, n) x1 = np.cos(2 * np.pi * f1 * t1) t2 = np.linspace(T, 2 * T, n) x2 = np.cos(2 * np.pi * f2 * t2) t3 = np.linspace(2 * T, 3 * T, n) x3 = np.cos(2 * np.pi * ...
24.169014
163
0.583333
import numpy as np from scipy import signal import matplotlib.pyplot as plt T = 5 Fs = 400.0 n = T * Fs f1 = 10 f2 = 25 f3 = 50 f4 = 100 t1 = np.linspace(0, T, n) x1 = np.cos(2 * np.pi * f1 * t1) t2 = np.linspace(T, 2 * T, n) x2 = np.cos(2 * np.pi * f2 * t2) t3 = np.linspace(2 * T, 3 * T, n) x3 = np.cos(2 * np.pi * ...
true
true
1c06cc1e5002be513d43d8299688b821e3ebd8dc
2,649
py
Python
intake/cli/client/subcommands/config.py
gramhagen/intake
de4cbb5df78881dc166b1f02743d22067f2bbd78
[ "BSD-2-Clause" ]
null
null
null
intake/cli/client/subcommands/config.py
gramhagen/intake
de4cbb5df78881dc166b1f02743d22067f2bbd78
[ "BSD-2-Clause" ]
null
null
null
intake/cli/client/subcommands/config.py
gramhagen/intake
de4cbb5df78881dc166b1f02743d22067f2bbd78
[ "BSD-2-Clause" ]
null
null
null
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors # All rights reserved. # # The full license is in the LICENSE file, distributed with this software. #------------------------------------------------------------------------...
32.304878
95
0.542091
from __future__ import print_function import logging log = logging.getLogger(__name__) import os import yaml from intake.cli.util import Subcommand class Config(Subcommand): name = "config" def initialize(self): sub_parser = self.parser.add_subparsers() list = sub_parser.add_parser('li...
true
true
1c06cc490cb668d8ea5825c759ff34370c5300df
2,595
py
Python
mouse_move.py
ondrasouk/face-recognition-project
b315057264475e93186abb3360e6b9531d1de84c
[ "Unlicense" ]
null
null
null
mouse_move.py
ondrasouk/face-recognition-project
b315057264475e93186abb3360e6b9531d1de84c
[ "Unlicense" ]
null
null
null
mouse_move.py
ondrasouk/face-recognition-project
b315057264475e93186abb3360e6b9531d1de84c
[ "Unlicense" ]
null
null
null
import pyautogui as gui import math import time # in percent of diameter of active range RANGE_OF_INSENSITIVITY = 10 # scale of input movement SCALE = 0.5 # when none face is detected continue movement for n seconds TIME_TO_STOP = 0.5 """ Set mouse position from actual position of cursor. Move the cursor from previou...
28.206522
79
0.580347
import pyautogui as gui import math import time RANGE_OF_INSENSITIVITY = 10 SCALE = 0.5 TIME_TO_STOP = 0.5 def mouse_move(reference_point, center_face_position): global mov_x global mov_y if not('mouse_x' in globals()): global mouse_x global mouse_y global t mouse_x...
true
true
1c06cce188d2f11f9f84ae87c3d0c186375f9a3f
2,783
py
Python
cli/bincave.py
3lpsy/exutils
ce189a229b60aeda33374e438fca47338877fd98
[ "MIT" ]
5
2020-01-07T22:46:41.000Z
2020-03-09T16:00:24.000Z
cli/bincave.py
3lpsy/exutils
ce189a229b60aeda33374e438fca47338877fd98
[ "MIT" ]
null
null
null
cli/bincave.py
3lpsy/exutils
ce189a229b60aeda33374e438fca47338877fd98
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import sys from pathlib import Path from argparse import ArgumentParser, Namespace, _SubParsersAction from utils import shellcode_encoder from pefile import PE from cli.enums import SHELLCODE_HELP from capstone import Cs, CS_MODE_32, CS_MODE_64, CS_ARCH_X86 ARCHES = {"x86": CS_ARCH_X86} MODES = ...
30.25
88
0.566655
import sys from pathlib import Path from argparse import ArgumentParser, Namespace, _SubParsersAction from utils import shellcode_encoder from pefile import PE from cli.enums import SHELLCODE_HELP from capstone import Cs, CS_MODE_32, CS_MODE_64, CS_ARCH_X86 ARCHES = {"x86": CS_ARCH_X86} MODES = {"x32": CS_MODE_32, "x6...
true
true