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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08fe6ec51571463631158324ad45bc03d57ffbee | 4,953 | py | Python | videodet/contrastive_retina_track/MV2_03weight.py | ktw361/mmdetection_impl | d09f5320290699cdae0817c9f6a52e8e07c1e098 | [
"Apache-2.0"
] | 2 | 2021-05-09T15:49:35.000Z | 2021-05-22T02:16:14.000Z | videodet/contrastive_retina_track/MV2_03weight.py | ktw361/mmdetection_impl | d09f5320290699cdae0817c9f6a52e8e07c1e098 | [
"Apache-2.0"
] | null | null | null | videodet/contrastive_retina_track/MV2_03weight.py | ktw361/mmdetection_impl | d09f5320290699cdae0817c9f6a52e8e07c1e098 | [
"Apache-2.0"
] | 1 | 2021-05-09T15:49:43.000Z | 2021-05-09T15:49:43.000Z | # same lr, full epoch, *loss weight 0.3*, no VID pretrain
import copy
# model settings
model = dict(
type='TrackSingleStageDetector',
pretrained='zoo/mobilenet_v2.pth.tar',
backbone=dict(
type='SSDMobileNetV2',
input_size=-1,
frozen_stages=3,
out_layers=('layer4', 'layer7', ... | 31.348101 | 97 | 0.626085 | import copy
model = dict(
type='TrackSingleStageDetector',
pretrained='zoo/mobilenet_v2.pth.tar',
backbone=dict(
type='SSDMobileNetV2',
input_size=-1,
frozen_stages=3,
out_layers=('layer4', 'layer7', 'layer14', 'layer19'),
with_extra=False,
norm_eval=True,
... | true | true |
08fe6f1340e1b9060e1c05aa57976fe1a4de310b | 620 | pyde | Python | listing_52/listing_52.pyde | tiranderel/2019-fall-polytech-cs | 67f0482a0f143381f9b494a4348d6436ce8f8c1e | [
"MIT"
] | null | null | null | listing_52/listing_52.pyde | tiranderel/2019-fall-polytech-cs | 67f0482a0f143381f9b494a4348d6436ce8f8c1e | [
"MIT"
] | null | null | null | listing_52/listing_52.pyde | tiranderel/2019-fall-polytech-cs | 67f0482a0f143381f9b494a4348d6436ce8f8c1e | [
"MIT"
] | null | null | null |
class FunnyRect:
cx =0.
cy=0.
fsize=0.
def setCenter (self, x, y):
self.cx = x
self.cy = y
def setSize (self, size):
self.fsize = size
def render (self):
rect (self.cx , self.cy , self.fsize , self.fsize )
funnyRectObj = FunnyRect ()
de... | 18.787879 | 60 | 0.543548 |
class FunnyRect:
cx =0.
cy=0.
fsize=0.
def setCenter (self, x, y):
self.cx = x
self.cy = y
def setSize (self, size):
self.fsize = size
def render (self):
rect (self.cx , self.cy , self.fsize , self.fsize )
funnyRectObj = FunnyRect ()
de... | true | true |
08fe6fb65b40d0ab66f402fc0f742264c67bae81 | 5,091 | py | Python | test/system/benchmark/initiator/manager.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | test/system/benchmark/initiator/manager.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | test/system/benchmark/initiator/manager.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | import json
import lib
import pos
import prerequisite
class Initiator:
def __init__(self, json):
self.json = json
self.name = json["NAME"]
self.id = json["ID"]
self.pw = json["PW"]
self.nic_ssh = json["NIC"]["SSH"]
try:
self.prereq = json["PREREQUISITE"]... | 46.281818 | 119 | 0.591239 | import json
import lib
import pos
import prerequisite
class Initiator:
def __init__(self, json):
self.json = json
self.name = json["NAME"]
self.id = json["ID"]
self.pw = json["PW"]
self.nic_ssh = json["NIC"]["SSH"]
try:
self.prereq = json["PREREQUISITE"]... | true | true |
08fe7006dc66b239d0ef088c455a1dadae99aaa0 | 530 | py | Python | images/urls.py | Hoofeycheng/Bookmarks | f2721633cd39393f0c92993579071679bb975ab0 | [
"MIT"
] | null | null | null | images/urls.py | Hoofeycheng/Bookmarks | f2721633cd39393f0c92993579071679bb975ab0 | [
"MIT"
] | null | null | null | images/urls.py | Hoofeycheng/Bookmarks | f2721633cd39393f0c92993579071679bb975ab0 | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*-
#程序员:Hoofey Cheng
#座右铭:人生苦短 我用Python!
#时间:2019/1/21 14:45
#文件名称:urls.py
#使用的IDE:PyCharm
from django.urls import path
from images.views import image_create,image_detail,image_list,image_like,image_ranking
app_name= "images"
urlpatterns = [
path("list/",image_list,name="image_list"),
path... | 20.384615 | 86 | 0.701887 |
from django.urls import path
from images.views import image_create,image_detail,image_list,image_like,image_ranking
app_name= "images"
urlpatterns = [
path("list/",image_list,name="image_list"),
path("create/",image_create,name="create"),
path("detail/<int:id>/<slug:slug>/",image_detail,name="detail"),
... | true | true |
08fe70093c7b78fadc32d72f080de7d439939c7d | 4,791 | py | Python | scripts/pyqtgraph-develop/examples/SpinBox.py | kuldeepaman/tf-pose | 8050912c52a7b4f3c8a2656f267d47ba21d093f6 | [
"Apache-2.0"
] | null | null | null | scripts/pyqtgraph-develop/examples/SpinBox.py | kuldeepaman/tf-pose | 8050912c52a7b4f3c8a2656f267d47ba21d093f6 | [
"Apache-2.0"
] | null | null | null | scripts/pyqtgraph-develop/examples/SpinBox.py | kuldeepaman/tf-pose | 8050912c52a7b4f3c8a2656f267d47ba21d093f6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This example demonstrates the SpinBox widget, which is an extension of
QDoubleSpinBox providing some advanced features:
* SI-prefixed units
* Non-linear stepping modes
* Bounded/unbounded values
"""
import initExample ## Add path to library (just for examples; you do not n... | 36.295455 | 133 | 0.632227 | import initExample
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
import ast
app = QtGui.QApplication([])
spins = [
("Floating-point spin box, min=0, no maximum.",
pg.SpinBox(value=5.0, bounds=[0, None])),
("Integer spin box, dec stepping<br>(1-9, 10-90, 1... | true | true |
08fe713e7ee2959a66c5f708097000e07bbd7ac3 | 4,176 | py | Python | tpcx_bb/queries/q25/tpcx_bb_query_25_sql.py | esoha-nvidia/tpcx-bb | 62a0833520e615f81316451cce7bad1fb019b37a | [
"Apache-2.0"
] | null | null | null | tpcx_bb/queries/q25/tpcx_bb_query_25_sql.py | esoha-nvidia/tpcx-bb | 62a0833520e615f81316451cce7bad1fb019b37a | [
"Apache-2.0"
] | null | null | null | tpcx_bb/queries/q25/tpcx_bb_query_25_sql.py | esoha-nvidia/tpcx-bb | 62a0833520e615f81316451cce7bad1fb019b37a | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
# Copyright (c) 2019-2020, BlazingSQL, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | 33.408 | 83 | 0.650862 |
import sys
from xbb_tools.cluster_startup import attach_to_cluster
from xbb_tools.utils import (
benchmark,
tpcxbb_argparser,
run_query,
train_clustering_model
)
from dask import delayed
q25_date = "2002-01-02"
N_CLUSTERS = 8
CLUSTER_ITERATIONS = 20
N_ITER = 5
def get_clusters(client, ml_input_d... | true | true |
08fe71768084fffcc02855e0125f2ea1a2b45bcb | 5,125 | py | Python | RecoJets/JetProducers/python/PileupJetIDCutParams_cfi.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoJets/JetProducers/python/PileupJetIDCutParams_cfi.py | gartung/cmssw | 3072dde3ce94dcd1791d778988198a44cde02162 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoJets/JetProducers/python/PileupJetIDCutParams_cfi.py | gartung/cmssw | 3072dde3ce94dcd1791d778988198a44cde02162 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
###########################################################
## Working points for the 81X training (completed in 80X with variable fixes)
###########################################################
full_81x_chs_wp = cms.PSet(
#4 Eta Categories 0-2.5 2.5-2.75 2.75-3.0 3.0-... | 43.432203 | 102 | 0.489951 | import FWCore.ParameterSet.Config as cms
full_81x_chs_wp = cms.PSet(
Pt010_Tight = cms.vdouble( 0.69, -0.35, -0.26, -0.21),
Pt1020_Tight = cms.vdouble( 0.69, -0.35, -0.26, -0.21),
Pt2030_Tight = cms.vdouble( 0.69, -0.35, -0.26, -0.21),
Pt3040_Tight = cms.vdouble( 0.86, -0.10, -0.05, ... | true | true |
08fe71e0027b588e3fc1a0d580230548b56af030 | 746 | py | Python | plateau.py | Elsword24/Python-Objet-B1 | da6cba74250544dd22f3db492aa951b22c28496e | [
"Apache-2.0"
] | 1 | 2021-03-08T08:17:24.000Z | 2021-03-08T08:17:24.000Z | plateau.py | Elsword24/Python-Objet-B1 | da6cba74250544dd22f3db492aa951b22c28496e | [
"Apache-2.0"
] | null | null | null | plateau.py | Elsword24/Python-Objet-B1 | da6cba74250544dd22f3db492aa951b22c28496e | [
"Apache-2.0"
] | null | null | null | def display_checkerboard(x = int , checkerboard = []):
for k in range(x):
if k >= 9:
print(" ", end="")
else:
print(" ",end="")
print(k+1, end="")
print("")
for ligne in range(x):
print(ligne + 1, end =" ")
for colone in... | 26.642857 | 62 | 0.418231 | def display_checkerboard(x = int , checkerboard = []):
for k in range(x):
if k >= 9:
print(" ", end="")
else:
print(" ",end="")
print(k+1, end="")
print("")
for ligne in range(x):
print(ligne + 1, end =" ")
for colone in... | true | true |
08fe72a81b8d2049aa557122c0c2620ee1296eac | 1,668 | py | Python | minmax_test.py | rcolomina/pythonchess | 1b12ea4a1668da6c47dd39ff16d1e48af33ea2f5 | [
"MIT"
] | null | null | null | minmax_test.py | rcolomina/pythonchess | 1b12ea4a1668da6c47dd39ff16d1e48af33ea2f5 | [
"MIT"
] | 2 | 2016-11-01T09:57:36.000Z | 2016-11-01T10:05:50.000Z | minmax_test.py | rcolomina/pythonchess | 1b12ea4a1668da6c47dd39ff16d1e48af33ea2f5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from piece import Piece
from gameNode import GameNode
from minmax import MinMax
from functions import *
listPiecesWhite=[]
listPiecesBlack=[]
w1=Piece('Q',[3,1])
w2=Piece('N',[3,2])
w3=Piece('N',[4,2])
w4=Piece('B',[1,3])
listPiecesWhite.append(w1)
listPiecesWhite.append(w2)
listPiecesWhite.append(... | 26.903226 | 166 | 0.697842 |
from piece import Piece
from gameNode import GameNode
from minmax import MinMax
from functions import *
listPiecesWhite=[]
listPiecesBlack=[]
w1=Piece('Q',[3,1])
w2=Piece('N',[3,2])
w3=Piece('N',[4,2])
w4=Piece('B',[1,3])
listPiecesWhite.append(w1)
listPiecesWhite.append(w2)
listPiecesWhite.append(w3)
listPiecesWhit... | false | true |
08fe72cc6dbd49bd8883d78a703c1f4456a4594d | 757 | py | Python | iridauploader/parsers/exceptions/validation_error.py | COMBAT-SARS-COV-2/irida-uploader | b9d04d187d6a5a9fdcaef5b27135965ffac99db0 | [
"Apache-2.0"
] | 7 | 2019-01-25T16:56:11.000Z | 2021-01-12T15:32:08.000Z | iridauploader/parsers/exceptions/validation_error.py | COMBAT-SARS-COV-2/irida-uploader | b9d04d187d6a5a9fdcaef5b27135965ffac99db0 | [
"Apache-2.0"
] | 80 | 2019-01-29T14:54:26.000Z | 2022-03-25T18:51:51.000Z | iridauploader/parsers/exceptions/validation_error.py | COMBAT-SARS-COV-2/irida-uploader | b9d04d187d6a5a9fdcaef5b27135965ffac99db0 | [
"Apache-2.0"
] | 9 | 2019-03-14T09:58:05.000Z | 2022-01-06T20:14:45.000Z | class ValidationError(Exception):
"""
An exception to be raised validation errors happen while parsing
includes a ValidationResult object with list of errors that occurred
"""
def __init__(self, message, validation_result):
"""Initialize a SampleError.
Args:
message: th... | 28.037037 | 90 | 0.672391 | class ValidationError(Exception):
def __init__(self, message, validation_result):
self._message = message
self._validation_result = validation_result
@property
def message(self):
return self._message
@property
def validation_result(self):
return self._validation_res... | true | true |
08fe7311a06be1bc98f2eaca48493fc71b17d78f | 533 | py | Python | src/main/apps/message_board/migrations/0003_user_post_likes.py | kid7960/Uni-board | 6a9525bef972a31576fc5dc190d9fe106e701c3e | [
"MIT"
] | null | null | null | src/main/apps/message_board/migrations/0003_user_post_likes.py | kid7960/Uni-board | 6a9525bef972a31576fc5dc190d9fe106e701c3e | [
"MIT"
] | null | null | null | src/main/apps/message_board/migrations/0003_user_post_likes.py | kid7960/Uni-board | 6a9525bef972a31576fc5dc190d9fe106e701c3e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-08 16:40
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('message_board', '0002_auto_20210307_1358'),
]
op... | 25.380952 | 91 | 0.662289 |
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('message_board', '0002_auto_20210307_1358'),
]
operations = [
migrations.AddField(
... | true | true |
08fe732e22d992de20bdb4a5b8f5d1ff26f9e487 | 1,105 | py | Python | Libs/Scripting/Python/Core/Testing/Cpp/PythonAttributes-test.py | Sunderlandkyl/CTK | 6c0eddaaf8b306c5cf553e8421bca7a5640e380a | [
"Apache-2.0"
] | 1 | 2019-04-20T06:37:26.000Z | 2019-04-20T06:37:26.000Z | Libs/Scripting/Python/Core/Testing/Cpp/PythonAttributes-test.py | Sunderlandkyl/CTK | 6c0eddaaf8b306c5cf553e8421bca7a5640e380a | [
"Apache-2.0"
] | 1 | 2019-02-13T00:53:39.000Z | 2019-02-13T00:54:32.000Z | Libs/Scripting/Python/Core/Testing/Cpp/PythonAttributes-test.py | Sunderlandkyl/CTK | 6c0eddaaf8b306c5cf553e8421bca7a5640e380a | [
"Apache-2.0"
] | 1 | 2020-05-05T14:52:44.000Z | 2020-05-05T14:52:44.000Z |
class Maths(object):
MATHS_CLASS_MEMBER=0.1
def __init__(self, num):
self.maths_instance_member = num
def maths_instance_method(self):
print("Hello from instance method")
class MultipleArg(object):
def __init__(self, num, str, other = 0):
self.multipleArg_instance_member_num = num + other
s... | 19.051724 | 54 | 0.712217 |
class Maths(object):
MATHS_CLASS_MEMBER=0.1
def __init__(self, num):
self.maths_instance_member = num
def maths_instance_method(self):
print("Hello from instance method")
class MultipleArg(object):
def __init__(self, num, str, other = 0):
self.multipleArg_instance_member_num = num + other
s... | true | true |
08fe741adb06d0188a827232f3eb7ec48fc65306 | 6,630 | py | Python | utilityhelper/loggingHelper.py | leileigong/utility-helper | 0494658440432554d100109b6e3c2ba044cd560a | [
"MIT"
] | null | null | null | utilityhelper/loggingHelper.py | leileigong/utility-helper | 0494658440432554d100109b6e3c2ba044cd560a | [
"MIT"
] | null | null | null | utilityhelper/loggingHelper.py | leileigong/utility-helper | 0494658440432554d100109b6e3c2ba044cd560a | [
"MIT"
] | 1 | 2019-01-29T06:37:38.000Z | 2019-01-29T06:37:38.000Z | #coding:utf-8
# !/usr/local/python/bin
from __future__ import (print_function, unicode_literals)
from utilityhelper.compatible import *
__author__ = "gongleilei"
__status__ = "Development"
# __all__ = ['set_logger', 'debug', 'info', 'warning', 'error',
# 'critical', 'exception']
import os
import sys
impo... | 34.175258 | 105 | 0.633635 |
from __future__ import (print_function, unicode_literals)
from utilityhelper.compatible import *
__author__ = "gongleilei"
__status__ = "Development"
import os
import sys
import logging import logging.handlers
COLOR_RED = '\033[1;31m'
COLOR_GREEN = '\033[1;32m'
COLOR_YELLOW = '\033[1;33m'
COLOR_BLUE = '\033[1;34m... | true | true |
08fe74e658502b9dff4bb7385eefadf45bdba9ed | 988 | py | Python | tests/test_config.py | Flared/pgcli | 123e00a086d91281a2ed8cfd84452a796f22ad91 | [
"BSD-3-Clause"
] | 9,135 | 2015-04-19T06:09:48.000Z | 2022-03-30T22:21:05.000Z | tests/test_config.py | Flared/pgcli | 123e00a086d91281a2ed8cfd84452a796f22ad91 | [
"BSD-3-Clause"
] | 1,121 | 2015-04-19T07:34:10.000Z | 2022-03-30T23:46:06.000Z | tests/test_config.py | Flared/pgcli | 123e00a086d91281a2ed8cfd84452a796f22ad91 | [
"BSD-3-Clause"
] | 533 | 2015-04-19T05:27:51.000Z | 2022-03-31T02:23:06.000Z | import io
import os
import stat
import pytest
from pgcli.config import ensure_dir_exists, skip_initial_comment
def test_ensure_file_parent(tmpdir):
subdir = tmpdir.join("subdir")
rcfile = subdir.join("rcfile")
ensure_dir_exists(str(rcfile))
def test_ensure_existing_dir(tmpdir):
rcfile = str(tmpdir... | 22.454545 | 67 | 0.690283 | import io
import os
import stat
import pytest
from pgcli.config import ensure_dir_exists, skip_initial_comment
def test_ensure_file_parent(tmpdir):
subdir = tmpdir.join("subdir")
rcfile = subdir.join("rcfile")
ensure_dir_exists(str(rcfile))
def test_ensure_existing_dir(tmpdir):
rcfile = str(tmpdir... | true | true |
08fe7854ff42213078f89952ab396e1e883432f4 | 4,763 | py | Python | gitlab_runner/datadog_checks/gitlab_runner/config_models/instance.py | tcpatterson/integrations-core | 3692601de09f8db60f42612b0d623509415bbb53 | [
"BSD-3-Clause"
] | null | null | null | gitlab_runner/datadog_checks/gitlab_runner/config_models/instance.py | tcpatterson/integrations-core | 3692601de09f8db60f42612b0d623509415bbb53 | [
"BSD-3-Clause"
] | null | null | null | gitlab_runner/datadog_checks/gitlab_runner/config_models/instance.py | tcpatterson/integrations-core | 3692601de09f8db60f42612b0d623509415bbb53 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# This file is autogenerated.
# To change this file you should edit assets/configuration/spec.yaml and then run the following commands:
# ddev -x validate config -s <INTEGRATION_NAME>
# ddev -x va... | 31.335526 | 110 | 0.732941 |
from __future__ import annotations
from typing import Any, Mapping, Optional, Sequence, Union
from pydantic import BaseModel, root_validator, validator
from datadog_checks.base.utils.functions import identity
from datadog_checks.base.utils.models import validation
from . import defaults, validators
class AuthTo... | true | true |
08fe7875f7a6bf10fd25a3041a760f103dcaab37 | 8,619 | py | Python | bin/binning.py | ruizca/xmmpzcat | 03938e96ff7cbb44adca6362f1b4492822d7e857 | [
"Unlicense"
] | null | null | null | bin/binning.py | ruizca/xmmpzcat | 03938e96ff7cbb44adca6362f1b4492822d7e857 | [
"Unlicense"
] | null | null | null | bin/binning.py | ruizca/xmmpzcat | 03938e96ff7cbb44adca6362f1b4492822d7e857 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Functions for the creation of bins based on
density of optical and X-ray sources.
"""
import os
from tqdm import tqdm
from astropy.table import Table, vstack
from astropy.coordinates import SkyCoord
from astropy import units as u
import numpy as np
#import matplotlib
#matplotlib.use("qt5ag... | 36.062762 | 84 | 0.621418 | import os
from tqdm import tqdm
from astropy.table import Table, vstack
from astropy.coordinates import SkyCoord
from astropy import units as u
import numpy as np
def calc_optstats(bin_sources, reg, density, gal_lat, nsrckey='NSRC_PS'):
region_stats = np.full((8), np.nan)
region_stats[0] = np.median(density... | true | true |
08fe7b235e238fa6c56b60dbd2473765b6607a76 | 2,949 | py | Python | birdsonganalysis/plot.py | gnouveau/birdsonganalysis | 58032538c63e9506d386e5fff5c2e8321c1d2983 | [
"MIT"
] | null | null | null | birdsonganalysis/plot.py | gnouveau/birdsonganalysis | 58032538c63e9506d386e5fff5c2e8321c1d2983 | [
"MIT"
] | null | null | null | birdsonganalysis/plot.py | gnouveau/birdsonganalysis | 58032538c63e9506d386e5fff5c2e8321c1d2983 | [
"MIT"
] | null | null | null | """Plotting function for birdsonganalysis."""
import numpy as np
import seaborn as sns
import matplotlib.patches as p
import matplotlib.pyplot as plt
from .songfeatures import spectral_derivs
from .constants import FREQ_RANGE
def spectral_derivs_plot(spec_der, contrast=0.1, ax=None, freq_range=None,
... | 38.802632 | 79 | 0.608342 |
import numpy as np
import seaborn as sns
import matplotlib.patches as p
import matplotlib.pyplot as plt
from .songfeatures import spectral_derivs
from .constants import FREQ_RANGE
def spectral_derivs_plot(spec_der, contrast=0.1, ax=None, freq_range=None,
fft_step=None, fft_size=None):
... | true | true |
08fe7b27a1fabe63a04cffc228ac1daae2b486eb | 17,817 | py | Python | tests/unit/plugins/openstack/scenarios/neutron/test_network.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | 1 | 2018-06-03T13:52:28.000Z | 2018-06-03T13:52:28.000Z | tests/unit/plugins/openstack/scenarios/neutron/test_network.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/scenarios/neutron/test_network.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014: Intel Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 42.93253 | 78 | 0.663355 |
import ddt
import mock
from rally.plugins.openstack.scenarios.neutron import network
from tests.unit import test
BASE = "rally.plugins.openstack.scenarios.neutron.network"
@ddt.ddt
class NeutronNetworksTestCase(test.ScenarioTestCase):
@ddt.data(
{"network_create_args": {}},
{"network_create_ar... | true | true |
08fe7bc11b2eb55cad701bdae4af0567ddfb7dd4 | 4,783 | py | Python | mantaray/__main__.py | ThePhilgrim/mantaray | 2b854eaae267ab3472eac28be12994cf31e1fc93 | [
"MIT"
] | null | null | null | mantaray/__main__.py | ThePhilgrim/mantaray | 2b854eaae267ab3472eac28be12994cf31e1fc93 | [
"MIT"
] | null | null | null | mantaray/__main__.py | ThePhilgrim/mantaray | 2b854eaae267ab3472eac28be12994cf31e1fc93 | [
"MIT"
] | null | null | null | from __future__ import annotations
import argparse
import functools
import sys
import tkinter
import traceback
from functools import partial
from pathlib import Path
from typing import Callable
from . import gui, config
try:
import appdirs
from ttkthemes import ThemedTk
except ImportError:
traceback.prin... | 34.912409 | 91 | 0.676981 | from __future__ import annotations
import argparse
import functools
import sys
import tkinter
import traceback
from functools import partial
from pathlib import Path
from typing import Callable
from . import gui, config
try:
import appdirs
from ttkthemes import ThemedTk
except ImportError:
traceback.prin... | true | true |
08fe7bdc5f9f6d1bd7a4306bd7836125793b072a | 1,095 | py | Python | discovery-infra/consts.py | nmagnezi/assisted-test-infra | a31dc4350d77681038a16c05d9a1e09fa992578a | [
"Apache-2.0"
] | null | null | null | discovery-infra/consts.py | nmagnezi/assisted-test-infra | a31dc4350d77681038a16c05d9a1e09fa992578a | [
"Apache-2.0"
] | null | null | null | discovery-infra/consts.py | nmagnezi/assisted-test-infra | a31dc4350d77681038a16c05d9a1e09fa992578a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
TF_FOLDER = "build/terraform"
TFVARS_JSON_FILE = os.path.join(TF_FOLDER, "terraform.tfvars.json")
IMAGE_FOLDER = "/tmp/images"
IMAGE_PATH = "%s/installer-image.iso" % IMAGE_FOLDER
STORAGE_PATH = "/var/lib/libvirt/openshift-images"
SSH_KEY = "ssh_key/key.pub"
NODES_REGISTERED_TIMEOUT =... | 26.071429 | 67 | 0.727854 | import os
TF_FOLDER = "build/terraform"
TFVARS_JSON_FILE = os.path.join(TF_FOLDER, "terraform.tfvars.json")
IMAGE_FOLDER = "/tmp/images"
IMAGE_PATH = "%s/installer-image.iso" % IMAGE_FOLDER
STORAGE_PATH = "/var/lib/libvirt/openshift-images"
SSH_KEY = "ssh_key/key.pub"
NODES_REGISTERED_TIMEOUT = 600
CLUSTER_INSTALLATIO... | true | true |
08fe7bfabdf99e2f102da543c9de05adeb0b75ad | 777 | py | Python | utils/model.py | luweishuang/rnnt-speech-recognition | cfa550495bf1a1cab3683f5196885d3bce8a90be | [
"MIT"
] | null | null | null | utils/model.py | luweishuang/rnnt-speech-recognition | cfa550495bf1a1cab3683f5196885d3bce8a90be | [
"MIT"
] | null | null | null | utils/model.py | luweishuang/rnnt-speech-recognition | cfa550495bf1a1cab3683f5196885d3bce8a90be | [
"MIT"
] | null | null | null | from absl import logging
import os
import json
import re
from model import build_keras_model
def load_hparams(model_dir):
with open(os.path.join(model_dir, 'hparams.json'), 'r') as f:
return json.load(f)
def save_hparams(hparams, model_dir):
with open(os.path.join(model_dir, 'hparams.json'), 'w') a... | 29.884615 | 78 | 0.720721 | from absl import logging
import os
import json
import re
from model import build_keras_model
def load_hparams(model_dir):
with open(os.path.join(model_dir, 'hparams.json'), 'r') as f:
return json.load(f)
def save_hparams(hparams, model_dir):
with open(os.path.join(model_dir, 'hparams.json'), 'w') a... | true | true |
08fe7c2ab671336140499ed57716a997a3603d91 | 2,189 | py | Python | frappe/utils/verified_command.py | ahmadRagheb/facefrappe | 9713aa2a3b4880f859b2da91091b72c1989d8e77 | [
"MIT"
] | 1 | 2020-12-07T22:35:21.000Z | 2020-12-07T22:35:21.000Z | frappe/utils/verified_command.py | ahmadRagheb/frappe-face | ace1675d7dec53f4fbbd476c4a5c375e48d0de09 | [
"MIT"
] | null | null | null | frappe/utils/verified_command.py | ahmadRagheb/frappe-face | ace1675d7dec53f4fbbd476c4a5c375e48d0de09 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import hmac
from six.moves.urllib.parse import urlencode
from frappe import _
import frappe
import frappe.utils
from six import string_types
def get_signed_params(params):
"""S... | 30.402778 | 104 | 0.744632 |
from __future__ import unicode_literals
import hmac
from six.moves.urllib.parse import urlencode
from frappe import _
import frappe
import frappe.utils
from six import string_types
def get_signed_params(params):
if not isinstance(params, string_types):
params = urlencode(params)
signature = hmac.new(params)
si... | true | true |
08fe7ca237c0242a9b3b655cec2bd1c23e361e09 | 3,527 | py | Python | carla_ros_bridge/src/carla_ros_bridge/communication.py | s-hillerk/ros-bridge | a096e936643273d73c68eea5e69bfc7c44ef26a3 | [
"MIT"
] | 205 | 2018-05-14T16:37:06.000Z | 2022-03-26T21:32:29.000Z | ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/communication.py | xmeng17/ALVNS | 8d891600af3d851add27a10ae45cf3c2108bb87c | [
"MIT"
] | 19 | 2018-05-27T21:06:52.000Z | 2021-09-08T00:37:46.000Z | ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/communication.py | xmeng17/ALVNS | 8d891600af3d851add27a10ae45cf3c2108bb87c | [
"MIT"
] | 73 | 2018-09-13T05:04:47.000Z | 2022-02-26T14:51:02.000Z | #!/usr/bin/env python
#
# Copyright (c) 2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
Handle communication of ROS topics
"""
import rospy
from rosgraph_msgs.msg import Clock
from tf2_msgs.msg import TFMessage
class... | 31.774775 | 92 | 0.616104 |
import rospy
from rosgraph_msgs.msg import Clock
from tf2_msgs.msg import TFMessage
class Communication(object):
def __init__(self):
self.tf_to_publish = []
self.msgs_to_publish = []
self.publishers = {}
self.subscribers = {}
self.ros_timestamp = rospy.Time()
... | true | true |
08fe7d1133a2927436b1426a0c49814e2dbf8bad | 223 | py | Python | katas/kyu_7/regexp_basics_is_eight_bit_number.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | katas/kyu_7/regexp_basics_is_eight_bit_number.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | katas/kyu_7/regexp_basics_is_eight_bit_number.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | from re import compile, match
REGEX = compile(r'(-[1-9]\d?|-1[0-1]\d|-12[0-8]|\d|[1-9]\d|1[0-1]\d|12[0-7])$')
def signed_eight_bit_number(number):
m = match(REGEX, number)
return bool(m) and m.group(0) == number
| 24.777778 | 79 | 0.609865 | from re import compile, match
REGEX = compile(r'(-[1-9]\d?|-1[0-1]\d|-12[0-8]|\d|[1-9]\d|1[0-1]\d|12[0-7])$')
def signed_eight_bit_number(number):
m = match(REGEX, number)
return bool(m) and m.group(0) == number
| true | true |
08fe7d23259ba932405156b138fbd8de99c3a5be | 1,032 | py | Python | pts/model/utils.py | StatMixedML/pytorch-ts | 4bc2d247c70c59479d359d13d2db5739227307e8 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-06-26T15:12:01.000Z | 2020-06-26T15:12:01.000Z | pts/model/utils.py | StatMixedML/pytorch-ts | 4bc2d247c70c59479d359d13d2db5739227307e8 | [
"Apache-2.0",
"MIT"
] | null | null | null | pts/model/utils.py | StatMixedML/pytorch-ts | 4bc2d247c70c59479d359d13d2db5739227307e8 | [
"Apache-2.0",
"MIT"
] | null | null | null | from typing import Optional
import inspect
import torch
import torch.nn as nn
def get_module_forward_input_names(module: nn.Module):
params = inspect.signature(module.forward).parameters
return list(params)
def copy_parameters(net_source: nn.Module, net_dest: nn.Module) -> None:
net_dest.load_state_dic... | 27.891892 | 74 | 0.675388 | from typing import Optional
import inspect
import torch
import torch.nn as nn
def get_module_forward_input_names(module: nn.Module):
params = inspect.signature(module.forward).parameters
return list(params)
def copy_parameters(net_source: nn.Module, net_dest: nn.Module) -> None:
net_dest.load_state_dic... | true | true |
08fe7d451660bcec5224f8dca653b4d48eff3433 | 287 | py | Python | src/main/python/main.py | Yamboy1/lbry-android | 41a0f44db264b7e66643e5fb8262a2838872b3f0 | [
"MIT"
] | null | null | null | src/main/python/main.py | Yamboy1/lbry-android | 41a0f44db264b7e66643e5fb8262a2838872b3f0 | [
"MIT"
] | null | null | null | src/main/python/main.py | Yamboy1/lbry-android | 41a0f44db264b7e66643e5fb8262a2838872b3f0 | [
"MIT"
] | null | null | null | __version__ = "0.12.2"
class ServiceApp(App):
def build(self):
from jnius import autoclass
Intent = autoclass('android.content.Intent')
LbrynetService = autoclass('io.lbry.browser.LbrynetService')
if __name__ == '__main__':
ServiceApp().run()
| 22.076923 | 68 | 0.644599 | __version__ = "0.12.2"
class ServiceApp(App):
def build(self):
from jnius import autoclass
Intent = autoclass('android.content.Intent')
LbrynetService = autoclass('io.lbry.browser.LbrynetService')
if __name__ == '__main__':
ServiceApp().run()
| true | true |
08fe7d8baf94d1044d638564057e4e39dc1e6fe3 | 1,432 | py | Python | common/html5lib/filters/rfc2046.py | westurner/nhs-social-web | 18e1bfa217284add514041db27efe9d6c58ac141 | [
"BSD-3-Clause"
] | 2 | 2016-05-09T04:23:27.000Z | 2019-04-16T08:54:07.000Z | third_party/html5lib/filters/rfc2046.py | dewitt/webfingerclient-dclinton | c13990378c8b0516c84f8507664e0a6ab8eefac5 | [
"Apache-2.0"
] | null | null | null | third_party/html5lib/filters/rfc2046.py | dewitt/webfingerclient-dclinton | c13990378c8b0516c84f8507664e0a6ab8eefac5 | [
"Apache-2.0"
] | 1 | 2019-08-12T16:21:22.000Z | 2019-08-12T16:21:22.000Z | # adapted from feedvalidator, original copyright license is
#
# Copyright (c) 2002-2006, Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Sof... | 47.733333 | 141 | 0.713687 |
import re
mime_re = re.compile('[^\s()<>,;:\\"/[\]?=]+/[^\s()<>,;:\\"/[\]?=]+(\s*;\s*[^\s()<>,;:\\"/[\]?=]+=("(\\"|[^"])*"|[^\s()<>,;:\\"/[\]?=]+))*$')
def isValidMIMEType(value):
return not not mime_re.match(value)
| true | true |
08fe7e2546aaeed9caa7b10245ba67ca61e49cce | 4,142 | py | Python | src/response/Response.py | alexandros44/UServer | 48fea5de4aa1eff7abf29641f11c675cf047999b | [
"MIT"
] | 1 | 2021-04-17T12:14:40.000Z | 2021-04-17T12:14:40.000Z | src/response/Response.py | alexandros44/UServer | 48fea5de4aa1eff7abf29641f11c675cf047999b | [
"MIT"
] | null | null | null | src/response/Response.py | alexandros44/UServer | 48fea5de4aa1eff7abf29641f11c675cf047999b | [
"MIT"
] | null | null | null | try:
import json
except:
import ujson
from response.HTTPResponseCodes import HTTP_STATUS_CODES
class Response:
'''
This class helps with the response of the server. It creates a basic template for the response.
The server can add extra things like headers, different type of responses and a... | 34.516667 | 117 | 0.605022 | try:
import json
except:
import ujson
from response.HTTPResponseCodes import HTTP_STATUS_CODES
class Response:
def __init__(self, client, request_method):
self.__request_method = request_method
self.HTTP_VERSION = "HTTP/1.1"
self.__client = client
self.__status = 200
... | true | true |
08fe7ec035561bef5a83436b64f6cc29b8892898 | 3,201 | py | Python | src/dataprovider/redisprovider.py | pipi2012/redis-monitor | 4ce9cf2fed8244b29fbb19d153613cf348ccf0e1 | [
"MIT"
] | 1 | 2020-03-25T06:24:38.000Z | 2020-03-25T06:24:38.000Z | src/dataprovider/redisprovider.py | pipi2012/redis-monitor | 4ce9cf2fed8244b29fbb19d153613cf348ccf0e1 | [
"MIT"
] | null | null | null | src/dataprovider/redisprovider.py | pipi2012/redis-monitor | 4ce9cf2fed8244b29fbb19d153613cf348ccf0e1 | [
"MIT"
] | null | null | null | from api.util import settings
from datetime import datetime, timedelta
import redis
import json
import ast
import time
import struct
def datetime2_unix_int(timestamp):
return (int)(time.mktime(timestamp.timetuple()))
class RedisStatsProvider(object):
def __init__(self):
stats_server = settings.get_red... | 36.375 | 101 | 0.574508 | from api.util import settings
from datetime import datetime, timedelta
import redis
import json
import ast
import time
import struct
def datetime2_unix_int(timestamp):
return (int)(time.mktime(timestamp.timetuple()))
class RedisStatsProvider(object):
def __init__(self):
stats_server = settings.get_red... | true | true |
08fe7f09be8bab944da7b4cdff4d33885ce2c3d1 | 2,701 | py | Python | share/qt/extract_strings_qt.py | raymaker/deft | 8d5d3f65828b52f5df6661786a271b6144b2cc32 | [
"MIT"
] | 7 | 2018-06-02T06:48:59.000Z | 2018-10-27T15:51:38.000Z | share/qt/extract_strings_qt.py | raymaker/deft | 8d5d3f65828b52f5df6661786a271b6144b2cc32 | [
"MIT"
] | 6 | 2018-06-01T13:59:13.000Z | 2019-07-27T10:12:19.000Z | share/qt/extract_strings_qt.py | deftchain/deft | 8d5d3f65828b52f5df6661786a271b6144b2cc32 | [
"MIT"
] | 5 | 2018-06-21T16:42:45.000Z | 2021-09-23T06:47:17.000Z | #!/usr/bin/env python
# Copyright (c) 2012-2016 The Deft developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt lingu... | 30.011111 | 106 | 0.641244 | from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import operator
import os
import sys
OUT_CPP="qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
messages = []
msgid = []
msgstr = []
in_msgid = False
in_msgstr = False
for line in text.spl... | true | true |
08fe7f14353d20fc261cf3b2743d63587b3b5a52 | 2,886 | py | Python | scripts/update_dreqs/update_dreqs_0217.py | jonseddon/primavera-dmt | 1239044e37f070b925a3d06db68351f285df780c | [
"BSD-3-Clause"
] | null | null | null | scripts/update_dreqs/update_dreqs_0217.py | jonseddon/primavera-dmt | 1239044e37f070b925a3d06db68351f285df780c | [
"BSD-3-Clause"
] | 49 | 2018-11-14T17:00:03.000Z | 2021-12-20T11:04:22.000Z | scripts/update_dreqs/update_dreqs_0217.py | jonseddon/primavera-dmt | 1239044e37f070b925a3d06db68351f285df780c | [
"BSD-3-Clause"
] | 2 | 2018-07-04T10:58:43.000Z | 2018-09-29T14:55:08.000Z | #!/usr/bin/env python
"""
update_dreqs_0217.py
Copy the MPI AMIP data that is about to be retracted to a single
directory structure that can be backed-up to tape.
"""
import argparse
import logging.config
import os
import shutil
import sys
import django
django.setup()
from pdata_app.models import ESGFDataset
from pda... | 26.722222 | 80 | 0.594248 | import argparse
import logging.config
import os
import shutil
import sys
import django
django.setup()
from pdata_app.models import ESGFDataset
from pdata_app.utils.common import construct_drs_path
__version__ = '0.1.0b1'
DEFAULT_LOG_LEVEL = logging.WARNING
DEFAULT_LOG_FORMAT = '%(levelname)s: %(message)s'
logger = ... | true | true |
08fe7f7d6f5d2990b34cf8fb7955d4e0b5f46c37 | 1,418 | py | Python | handlers/graph_for_period.py | Kvm99/Pressure-Bot- | 4dc5c850f12265dd89150891c2e383c9c32d421f | [
"BSD-3-Clause"
] | null | null | null | handlers/graph_for_period.py | Kvm99/Pressure-Bot- | 4dc5c850f12265dd89150891c2e383c9c32d421f | [
"BSD-3-Clause"
] | 208 | 2019-12-06T12:48:58.000Z | 2022-03-28T21:10:35.000Z | handlers/graph_for_period.py | Kvm99/Telegram-Pressurebot | 4dc5c850f12265dd89150891c2e383c9c32d421f | [
"BSD-3-Clause"
] | null | null | null | import telegramcalendar
from helpers.graph import make_graph
from buttons import markup_remove, start_markup
from states import States
def graph_for_period(update, context):
"""
Take two dates from user input in calendar.
send them to user,
take current-user data from postgreSQL
prepare data to gr... | 28.938776 | 66 | 0.66079 | import telegramcalendar
from helpers.graph import make_graph
from buttons import markup_remove, start_markup
from states import States
def graph_for_period(update, context):
selected, date = telegramcalendar.process_calendar_selection(
update, context
)
str_date = date.strftime("%Y-%m-%d")
... | true | true |
08fe83087e9008dedd53a59497071b78689294b7 | 2,986 | py | Python | wakebot/entities/user.py | alex13th/WakeBot | dd920d3bdcd82437191688fa361571e50cd9fc3f | [
"MIT"
] | null | null | null | wakebot/entities/user.py | alex13th/WakeBot | dd920d3bdcd82437191688fa361571e50cd9fc3f | [
"MIT"
] | 19 | 2020-07-23T04:30:44.000Z | 2020-08-05T08:37:32.000Z | wakebot/entities/user.py | alex13th/WakeBot | dd920d3bdcd82437191688fa361571e50cd9fc3f | [
"MIT"
] | 1 | 2020-07-27T08:19:09.000Z | 2020-07-27T08:19:09.000Z | from typing import Optional
class User:
"""User data class
Attributes:
firstname:
A user firstname
lastname:
A user lastname
middlename:
A user middlename
displayname:
A string value is joined by firstname, middlename, lastname.
... | 29.27451 | 76 | 0.559277 | from typing import Optional
class User:
firstname: str
lastname: Optional[str]
middlename: Optional[str]
_displayname: Optional[str]
phone_number: Optional[str]
telegram_id: Optional[int]
user_id: Optional[int]
is_admin: Optional[bool]
def __init__(self,
firstnam... | true | true |
08fe86077d186ee780ff0a10b2e2ba817fd288bf | 1,012 | py | Python | crud/migrations/0005_auto_20210629_0349.py | TownOneWheel/townonewheel | 9feb120b7541b31d99b63c95edc7949005ab7862 | [
"MIT"
] | null | null | null | crud/migrations/0005_auto_20210629_0349.py | TownOneWheel/townonewheel | 9feb120b7541b31d99b63c95edc7949005ab7862 | [
"MIT"
] | 18 | 2021-07-01T08:35:13.000Z | 2021-07-25T08:18:09.000Z | crud/migrations/0005_auto_20210629_0349.py | TownOneWheel/townonewheel | 9feb120b7541b31d99b63c95edc7949005ab7862 | [
"MIT"
] | 1 | 2021-07-13T05:12:14.000Z | 2021-07-13T05:12:14.000Z | # Generated by Django 3.2.4 on 2021-06-29 03:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crud', '0004_auto_20210629_0327'),
]
operations = [
migrations.AlterField(
model_name='cat',
name='color',
... | 34.896552 | 172 | 0.5583 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crud', '0004_auto_20210629_0327'),
]
operations = [
migrations.AlterField(
model_name='cat',
name='color',
field=models.CharField(blank=True, choices=[(... | true | true |
08fe862a7f5d5c1166f2b936fe181abda1b588ac | 270 | py | Python | tests/artificial/transf_Difference/trend_ConstantTrend/cycle_12/ar_12/test_artificial_128_Difference_ConstantTrend_12_12_0.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Difference/trend_ConstantTrend/cycle_12/ar_12/test_artificial_128_Difference_ConstantTrend_12_12_0.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Difference/trend_ConstantTrend/cycle_12/ar_12/test_artificial_128_Difference_ConstantTrend_12_12_0.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 12, transform = "Difference", sigma = 0.0, exog_count = 0, ar_order = 12); | 38.571429 | 170 | 0.737037 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 12, transform = "Difference", sigma = 0.0, exog_count = 0, ar_order = 12); | true | true |
08fe872f62a9c51cfe53e441242c711b3079091c | 25,021 | py | Python | second/data/kitti_common.py | neolixcn/nutonomy_pointpillars | 03f46f6de97c0c97d7bc98d7af3daee215d81a30 | [
"MIT"
] | 1 | 2021-06-11T00:54:48.000Z | 2021-06-11T00:54:48.000Z | second/data/kitti_common.py | neolixcn/nutonomy_pointpillars | 03f46f6de97c0c97d7bc98d7af3daee215d81a30 | [
"MIT"
] | null | null | null | second/data/kitti_common.py | neolixcn/nutonomy_pointpillars | 03f46f6de97c0c97d7bc98d7af3daee215d81a30 | [
"MIT"
] | null | null | null | import concurrent.futures as futures
import os
import pathlib
import re
from collections import OrderedDict
import numpy as np
from skimage import io
def area(boxes, add1=False):
"""Computes area of boxes.
Args:
boxes: Numpy array with shape [N, 4] holding N boxes
Returns:
a numpy array... | 34.896792 | 107 | 0.579793 | import concurrent.futures as futures
import os
import pathlib
import re
from collections import OrderedDict
import numpy as np
from skimage import io
def area(boxes, add1=False):
if add1:
return (boxes[:, 2] - boxes[:, 0] + 1.0) * (
boxes[:, 3] - boxes[:, 1] + 1.0)
else:
return (b... | true | true |
08fe878af61e4a9fff53aa37944753dfb49845a4 | 14,347 | py | Python | src/orgs.py | rgscherf/gainful | ad0c7a3a89bfabace97ba92de0f648a745ec5be1 | [
"MIT"
] | null | null | null | src/orgs.py | rgscherf/gainful | ad0c7a3a89bfabace97ba92de0f648a745ec5be1 | [
"MIT"
] | null | null | null | src/orgs.py | rgscherf/gainful | ad0c7a3a89bfabace97ba92de0f648a745ec5be1 | [
"MIT"
] | null | null | null | import json, datetime, requests
import dateutil.parser as dp
from bs4 import BeautifulSoup
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
################################################################################
# OUTPUT FORMAT:
# Job with fields: org[anization], [job] title, div[ision], [posting] date... | 33.917258 | 141 | 0.549313 | import json, datetime, requests
import dateutil.parser as dp
from bs4 import BeautifulSoup
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def log(t):
t = t.prettify().encode('utf-8')
with open("log.html", "wb") as FILE:
FILE.write(t)
def parse_date(date_string):
if date_string == "":
... | true | true |
08fe8ab8535e0c2a41ecf4575f0c62370ba777f3 | 1,459 | py | Python | Chapter02/config_syslog.py | PacktPublishing/Practical-Network-Automation-Second-Edition | c22b4b847ec2c5b2cc695e5da4bf592632920853 | [
"MIT"
] | 32 | 2018-12-21T01:03:11.000Z | 2022-01-06T02:16:05.000Z | Chapter02/config_syslog.py | Netlabbuilder/Practical-Network-Automation-Second-Edition | 92d15ac3c0eb883db8df915bd2233538e83d9d68 | [
"MIT"
] | null | null | null | Chapter02/config_syslog.py | Netlabbuilder/Practical-Network-Automation-Second-Edition | 92d15ac3c0eb883db8df915bd2233538e83d9d68 | [
"MIT"
] | 26 | 2018-12-18T09:08:21.000Z | 2022-02-20T05:49:51.000Z | from netmiko import ConnectHandler
template="""logging host 192.168.20.5 transport tcp port 514
logging trap 6
interface loopback 30
description "{rtr} loopback interface\""""
username = 'test'
password="test"
#step 1
#fetch the hostname of the router for the template
for n in range(1, 5):
ip="192.168.20.{0}".fo... | 31.042553 | 93 | 0.681289 | from netmiko import ConnectHandler
template="""logging host 192.168.20.5 transport tcp port 514
logging trap 6
interface loopback 30
description "{rtr} loopback interface\""""
username = 'test'
password="test"
for n in range(1, 5):
ip="192.168.20.{0}".format(n)
device = ConnectHandler(device_type='cisco_ios'... | true | true |
08fe8aca9b79d00bda5d5726e09719a5b7053e55 | 2,975 | py | Python | test/functional/feature_logging.py | VictorLux/ZiCEofficial | d451d5455e2c6e6ee66a41ed5594f31a2ab6ea8a | [
"MIT"
] | 37 | 2018-09-12T10:45:50.000Z | 2022-02-17T13:45:05.000Z | test/functional/feature_logging.py | VictorLux/ZiCEofficial | d451d5455e2c6e6ee66a41ed5594f31a2ab6ea8a | [
"MIT"
] | 12 | 2019-01-22T18:13:21.000Z | 2021-06-11T04:48:58.000Z | test/functional/feature_logging.py | VictorLux/ZiCEofficial | d451d5455e2c6e6ee66a41ed5594f31a2ab6ea8a | [
"MIT"
] | 18 | 2018-12-05T23:59:56.000Z | 2021-02-12T03:51:38.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test debug logging."""
import os
from test_framework.test_framework import BitcashTestFramework
from test_... | 39.144737 | 131 | 0.669244 |
import os
from test_framework.test_framework import BitcashTestFramework
from test_framework.test_node import ErrorMatch
class LoggingTest(BitcashTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
def relative_log_path(self, name):
return os.... | true | true |
08fe8ae65805bbc090e9a79cb84844d30e3933d5 | 123,524 | py | Python | tests/test_nodetypes.py | shrtcww/pymel | a453b6a545f19ec1b918495bd909f09a00959784 | [
"BSD-3-Clause"
] | 10 | 2018-03-30T16:09:02.000Z | 2021-12-07T07:29:19.000Z | tests/test_nodetypes.py | shrtcww/pymel | a453b6a545f19ec1b918495bd909f09a00959784 | [
"BSD-3-Clause"
] | null | null | null | tests/test_nodetypes.py | shrtcww/pymel | a453b6a545f19ec1b918495bd909f09a00959784 | [
"BSD-3-Clause"
] | 9 | 2018-06-02T09:18:49.000Z | 2021-12-20T09:24:35.000Z | import sys
import unittest
import itertools
import re
import platform
import inspect
import math
import maya.cmds as cmds
import pymel.core as pm
import pymel.api as api
from maintenance.pymelControlPanel import getClassHierarchy
import pymel.internal.factories as factories
import pymel.internal.apicache as apicache
i... | 44.5292 | 154 | 0.558224 | import sys
import unittest
import itertools
import re
import platform
import inspect
import math
import maya.cmds as cmds
import pymel.core as pm
import pymel.api as api
from maintenance.pymelControlPanel import getClassHierarchy
import pymel.internal.factories as factories
import pymel.internal.apicache as apicache
i... | false | true |
08fe8c4587dc7997e923e6db657d6fa9c449155a | 4,288 | py | Python | pma_api/routes/endpoints/api_1_0/dynamic.py | joeflack4/pma-api | de213833c93ad0c90b127188526c9eced31edc75 | [
"MIT"
] | 2 | 2018-08-24T14:27:25.000Z | 2020-05-11T18:59:24.000Z | pma_api/routes/endpoints/api_1_0/dynamic.py | joeflack4/pma-api | de213833c93ad0c90b127188526c9eced31edc75 | [
"MIT"
] | 36 | 2018-07-13T15:49:50.000Z | 2019-07-17T18:29:28.000Z | pma_api/routes/endpoints/api_1_0/dynamic.py | joeflack4/pma-api | de213833c93ad0c90b127188526c9eced31edc75 | [
"MIT"
] | 4 | 2018-07-12T19:24:52.000Z | 2021-03-09T16:08:38.000Z | """Dynamically resource-based routing
For any model resources that do not have explicit static routes created, this
route will attempt to return a standardized list of results for that model.
"""
import os
from typing import Union, List, Dict
from flask import request
from flask_sqlalchemy import Model
from pma_api.... | 34.304 | 79 | 0.671875 | import os
from typing import Union, List, Dict
from flask import request
from flask_sqlalchemy import Model
from pma_api.models import db
from pma_api.response import QuerySetApiResult
from pma_api.config import PROJECT_ROOT_PATH, \
SQLALCHEMY_MODEL_ATTR_QUERY_IGNORES as IGNORES
from pma_api.utils import get_db_m... | true | true |
08fe8c640dc2fd32227137a4a35e607b8e82d30e | 20,151 | py | Python | tf_utils.py | llecaroz/multihead_joint_entity_relation_extraction | 6cef17bb88700eda336d106b761352e65d8e4bea | [
"MIT"
] | null | null | null | tf_utils.py | llecaroz/multihead_joint_entity_relation_extraction | 6cef17bb88700eda336d106b761352e65d8e4bea | [
"MIT"
] | null | null | null | tf_utils.py | llecaroz/multihead_joint_entity_relation_extraction | 6cef17bb88700eda336d106b761352e65d8e4bea | [
"MIT"
] | null | null | null | import utils
import time
import eval
class model:
"""Set of classes and methods for training the model and computing the ner and head selection loss"""
def __init__(self,config,emb_mtx,sess):
""""Initialize data"""
self.config=config
self.emb_mtx=emb_mtx
self.sess=sess
de... | 43.057692 | 194 | 0.597638 | import utils
import time
import eval
class model:
def __init__(self,config,emb_mtx,sess):
self.config=config
self.emb_mtx=emb_mtx
self.sess=sess
def getEvaluator(self):
if self.config.evaluation_method == "strict" and self.config.ner_classes == "BIO": return eval... | true | true |
08fe8ca56511b4058c753af76243d8290f2bfa19 | 53 | py | Python | mne/datasets/hf_sef/__init__.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 1,953 | 2015-01-17T20:33:46.000Z | 2022-03-30T04:36:34.000Z | mne/datasets/hf_sef/__init__.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 8,490 | 2015-01-01T13:04:18.000Z | 2022-03-31T23:02:08.000Z | mne/datasets/hf_sef/__init__.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 1,130 | 2015-01-08T22:39:27.000Z | 2022-03-30T21:44:26.000Z | """HF-SEF dataset."""
from .hf_sef import data_path
| 13.25 | 29 | 0.698113 |
from .hf_sef import data_path
| true | true |
08fe8cd760fe1550ef483386d1b846a4ef01249b | 91,786 | py | Python | Lib/test/support/__init__.py | isaiah/jy3k | 0dea5518a698bf4167e80f84d2e5936ba4dda67e | [
"CNRI-Jython"
] | 2 | 2021-02-26T06:41:02.000Z | 2021-03-08T23:16:02.000Z | Lib/test/support/__init__.py | isaiah/jy3k | 0dea5518a698bf4167e80f84d2e5936ba4dda67e | [
"CNRI-Jython"
] | null | null | null | Lib/test/support/__init__.py | isaiah/jy3k | 0dea5518a698bf4167e80f84d2e5936ba4dda67e | [
"CNRI-Jython"
] | null | null | null | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import collections.abc
import contextlib
import errno
import faulthandler
import fnmatch
import functools
import gc
import importlib
import importlib.uti... | 35.059587 | 93 | 0.62394 |
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import collections.abc
import contextlib
import errno
import faulthandler
import fnmatch
import functools
import gc
import importlib
import importlib.util
import logging.handlers
import nntplib
import os
import plat... | true | true |
08fe8dce4e0e192f75e401593d85e0398e1ad281 | 543 | py | Python | manage.py | TimurMisharin/StagProject | c71996f583c1b31e47fc933c92207d8085d62545 | [
"MIT"
] | 2 | 2019-03-17T08:10:57.000Z | 2019-03-17T08:12:15.000Z | manage.py | TimurMisharin/StagProject | c71996f583c1b31e47fc933c92207d8085d62545 | [
"MIT"
] | null | null | null | manage.py | TimurMisharin/StagProject | c71996f583c1b31e47fc933c92207d8085d62545 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stagProject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. ... | 33.9375 | 75 | 0.688766 | import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stagProject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's inst... | true | true |
08fe8ef84e8efe6b513c869e2849da3f39eca04c | 2,917 | py | Python | zignal/music/spn.py | fspacheco/zignal | 19ac50157a276e9640e362b0472a5e209dfe6709 | [
"MIT"
] | null | null | null | zignal/music/spn.py | fspacheco/zignal | 19ac50157a276e9640e362b0472a5e209dfe6709 | [
"MIT"
] | null | null | null | zignal/music/spn.py | fspacheco/zignal | 19ac50157a276e9640e362b0472a5e209dfe6709 | [
"MIT"
] | null | null | null | '''
Created on 21 Feb 2015
@author: Ronny Andersson (ronny@andersson.tk)
@copyright: (c) 2015 Ronny Andersson
@license: MIT
Scientific pitch notation (also known as American Standard Pitch Notation
(ASPN) and International Pitch Notation (IPN))
'''
# standard library
from __future__ import division, print_function
i... | 23.524194 | 94 | 0.526568 |
from __future__ import division, print_function
import logging
import re
def key2index(key='A4'):
logger = logging.getLogger(__name__)
valid_chars = "ABCDEFGb#x-0123456789"
for c in key:
assert c in valid_chars, "Valid characters are: '%s'" %valid_chars
m = re.match(r"(?P<note>^[A-G])(?P<h... | true | true |
08fe90420b90c83046cc81e61ca9924d748f0b53 | 5,561 | py | Python | galaxy2galaxy/models/gan_utils.py | gitter-badger/galaxy2galaxy | 1374a32a6be252c1eb426ce21bf1e26ffb253bb9 | [
"MIT"
] | null | null | null | galaxy2galaxy/models/gan_utils.py | gitter-badger/galaxy2galaxy | 1374a32a6be252c1eb426ce21bf1e26ffb253bb9 | [
"MIT"
] | null | null | null | galaxy2galaxy/models/gan_utils.py | gitter-badger/galaxy2galaxy | 1374a32a6be252c1eb426ce21bf1e26ffb253bb9 | [
"MIT"
] | 1 | 2021-02-18T12:00:04.000Z | 2021-02-18T12:00:04.000Z | """ Spectral Norm GAN """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tensorflow_gan as tfgan
import tensorflow_hub as hub
from tensorflow_gan.python.estimator.gan_estimator import Optimizers, get_gan_model, get_train_est... | 36.827815 | 162 | 0.702212 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tensorflow_gan as tfgan
import tensorflow_hub as hub
from tensorflow_gan.python.estimator.gan_estimator import Optimizers, get_gan_model, get_train_estimator_spec, get_eval_esti... | true | true |
08fe90e2f1a53ff57e953858e545e7009c5e77b1 | 651 | gyp | Python | chrome/browser/performance_monitor/performance_monitor.gyp | junmin-zhu/chromium-rivertrail | eb1a57aca71fe68d96e48af8998dcfbe45171ee1 | [
"BSD-3-Clause"
] | 7 | 2015-05-20T22:41:35.000Z | 2021-11-18T19:07:59.000Z | chrome/browser/performance_monitor/performance_monitor.gyp | quisquous/chromium | b25660e05cddc9d0c3053b3514f07037acc69a10 | [
"BSD-3-Clause"
] | 1 | 2015-02-02T06:55:08.000Z | 2016-01-20T06:11:59.000Z | chrome/browser/performance_monitor/performance_monitor.gyp | jianglong0156/chromium.src | d496dfeebb0f282468827654c2b3769b3378c087 | [
"BSD-3-Clause"
] | 6 | 2016-11-14T10:13:35.000Z | 2021-01-23T15:29:53.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'performance_monitor',
'type': 'static_library',
'sources': [
'<@(json_schema_files)',
... | 24.111111 | 72 | 0.556068 |
{
'targets': [
{
'target_name': 'performance_monitor',
'type': 'static_library',
'sources': [
'<@(json_schema_files)',
],
'includes': [
'../../../build/json_schema_compile.gypi',
],
'variables': {
'chromium_code': 1,
'json_schema_files': [... | true | true |
08fe91a50a7c5d1cd94c2aed3787d589b505a1b2 | 5,617 | py | Python | scripts/plots/nora2012/distance_distributions_SI.py | simeoncarstens/ensemble_hic | abaec8972866b593e689e39419d1c2d7ab6788dc | [
"Unlicense",
"MIT"
] | 3 | 2020-07-23T20:50:42.000Z | 2021-03-16T04:38:07.000Z | scripts/plots/nora2012/distance_distributions_SI.py | simeoncarstens/ensemble_hic | abaec8972866b593e689e39419d1c2d7ab6788dc | [
"Unlicense",
"MIT"
] | null | null | null | scripts/plots/nora2012/distance_distributions_SI.py | simeoncarstens/ensemble_hic | abaec8972866b593e689e39419d1c2d7ab6788dc | [
"Unlicense",
"MIT"
] | null | null | null | import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
probes = (
('pEN1', 100423573, 100433412, 'Linx'),
('pEN2', 100622909, 100632521, 'Xite'),
('pLG1', 100456274, 100465704, 'Linx'),
('pLG10', 100641750, 100646253, 'Dxpas34'),
('pLG11', 10... | 36.953947 | 102 | 0.595514 | import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
probes = (
('pEN1', 100423573, 100433412, 'Linx'),
('pEN2', 100622909, 100632521, 'Xite'),
('pLG1', 100456274, 100465704, 'Linx'),
('pLG10', 100641750, 100646253, 'Dxpas34'),
('pLG11', 10... | true | true |
08fe931318f55e6aeeeb205aa6f324071bd255a3 | 22,993 | py | Python | psychopy_util.py | CSNLab/psychopy_util | 36b1b10c521fe81b0efef00b55cb2973f482e344 | [
"MIT"
] | 1 | 2022-02-10T08:42:24.000Z | 2022-02-10T08:42:24.000Z | psychopy_util.py | MetaD/PsychoPy-Starter-Kit | 36b1b10c521fe81b0efef00b55cb2973f482e344 | [
"MIT"
] | null | null | null | psychopy_util.py | MetaD/PsychoPy-Starter-Kit | 36b1b10c521fe81b0efef00b55cb2973f482e344 | [
"MIT"
] | 1 | 2018-08-19T06:47:51.000Z | 2018-08-19T06:47:51.000Z | #
# Utilities for PsychoPy experiments
# Author: Meng Du
# August 2018
#
import os
import json
import logging
from psychopy import gui, visual, core, event, info
def show_form_dialog(items, validation_func=None, reset_after_error=True, title='', order=(), tip={}, logger=None):
"""
Show a form to be filled wi... | 51.786036 | 125 | 0.617971 |
import os
import json
import logging
from psychopy import gui, visual, core, event, info
def show_form_dialog(items, validation_func=None, reset_after_error=True, title='', order=(), tip={}, logger=None):
log = logging.getLogger(logger)
while True:
original_items = items.copy()
dialog = gui.D... | true | true |
08fe935201d91b918aaffbc8321ab8dc1f814778 | 6,351 | py | Python | models/test/data.py | sundogrd/tensorflow_end2end_speech_recognition | 61e4a65fb5c9f3d9f690d713dcd77a48b1de0a14 | [
"MIT"
] | 351 | 2017-05-27T08:31:27.000Z | 2022-03-03T16:47:27.000Z | models/test/data.py | eLavin11/tensorflow_end2end_speech_recognition | 65b9728089d5e92b25b92384a67419d970399a64 | [
"MIT"
] | 19 | 2017-07-19T13:12:18.000Z | 2019-06-12T06:07:13.000Z | models/test/data.py | eLavin11/tensorflow_end2end_speech_recognition | 65b9728089d5e92b25b92384a67419d970399a64 | [
"MIT"
] | 127 | 2017-06-12T16:27:21.000Z | 2021-12-29T02:22:34.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from utils.io.inputs.splicing import do_splice
from utils.io.inputs.frame_stacking import stack_frame
from utils.io.inputs.feature_extraction import wav2feature
f... | 34.145161 | 77 | 0.605259 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from utils.io.inputs.splicing import do_splice
from utils.io.inputs.frame_stacking import stack_frame
from utils.io.inputs.feature_extraction import wav2feature
from utils.io.labels.phone import Phone2idx
SP... | true | true |
08fe94055e2e2c843b180ef0533a3500984c689a | 2,960 | py | Python | bot/exts/filters/webhook_remover.py | laundmo/bot | a43b11b3cf431cf358fff8a581276afa25fb3508 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2020-01-26T08:31:28.000Z | 2020-01-26T08:31:28.000Z | bot/exts/filters/webhook_remover.py | Ezamey/bot | 0b7a1be1dd57a464fc79fcb235b79d75bec43f99 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | bot/exts/filters/webhook_remover.py | Ezamey/bot | 0b7a1be1dd57a464fc79fcb235b79d75bec43f99 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2020-06-12T09:15:05.000Z | 2020-06-12T09:15:05.000Z | import logging
import re
from discord import Colour, Message, NotFound
from discord.ext.commands import Cog
from bot.bot import Bot
from bot.constants import Channels, Colours, Event, Icons
from bot.exts.moderation.modlog import ModLog
from bot.utils.messages import format_user
WEBHOOK_URL_RE = re.compile(r"((?:http... | 34.418605 | 106 | 0.651689 | import logging
import re
from discord import Colour, Message, NotFound
from discord.ext.commands import Cog
from bot.bot import Bot
from bot.constants import Channels, Colours, Event, Icons
from bot.exts.moderation.modlog import ModLog
from bot.utils.messages import format_user
WEBHOOK_URL_RE = re.compile(r"((?:http... | true | true |
08fe9451c29a6e83311a88a9adcf9ac18795b80d | 11,436 | py | Python | qiskit/aqua/operators/primitive_ops/primitive_op.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | 1 | 2020-08-01T21:07:54.000Z | 2020-08-01T21:07:54.000Z | qiskit/aqua/operators/primitive_ops/primitive_op.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/operators/primitive_ops/primitive_op.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 42.044118 | 100 | 0.654162 |
from typing import Optional, Union, Set, List
import logging
import numpy as np
from scipy.sparse import spmatrix
import scipy.linalg
from qiskit import QuantumCircuit
from qiskit.circuit import Instruction, ParameterExpression
from qiskit.quantum_info import Pauli, SparsePauliOp
from qiskit.quantum_info import Ope... | true | true |
08fe95a6c46fd1e736c912688851630bbdc06d94 | 7,563 | py | Python | corehq/ex-submodules/dimagi/utils/couch/debugdb/debugdatabase.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/ex-submodules/dimagi/utils/couch/debugdb/debugdatabase.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/ex-submodules/dimagi/utils/couch/debugdb/debugdatabase.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | __author__ = 'dmyung'
from datetime import datetime
from couchdbkit import Database
from dimagi.utils.couch.debugdb import tidy_stacktrace, SQL_WARNING_THRESHOLD, process_key, ms_from_timedelta
#taken from the django debug toolbar sql panel
import traceback
import couchdbkit
from couchdbkit import resource, ResourceNo... | 32.04661 | 109 | 0.566177 | __author__ = 'dmyung'
from datetime import datetime
from couchdbkit import Database
from dimagi.utils.couch.debugdb import tidy_stacktrace, SQL_WARNING_THRESHOLD, process_key, ms_from_timedelta
import traceback
import couchdbkit
from couchdbkit import resource, ResourceNotFound
from couchdbkit.client import ViewResult... | true | true |
08fe95cb85872188ec5efd686db84bf4a1bda4b2 | 8,706 | py | Python | handlers/kbeServer/Editor/Interface/interface_project.py | iamjing66/tornaodo_sdk | 242a852d3231e5798aa357a17e5638c7dc0567b9 | [
"MIT"
] | null | null | null | handlers/kbeServer/Editor/Interface/interface_project.py | iamjing66/tornaodo_sdk | 242a852d3231e5798aa357a17e5638c7dc0567b9 | [
"MIT"
] | null | null | null | handlers/kbeServer/Editor/Interface/interface_project.py | iamjing66/tornaodo_sdk | 242a852d3231e5798aa357a17e5638c7dc0567b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import logging
import time,Global
from handlers.kbeServer.Editor.Data import data_work
from methods.DBManager import DBManager
from handlers.kbeServer.Editor.Interface import interface_obj,interface_global,interface_project
from handlers.kbeServer.Editor.Interface import interface_... | 37.852174 | 961 | 0.582702 |
import logging
import time,Global
from handlers.kbeServer.Editor.Data import data_work
from methods.DBManager import DBManager
from handlers.kbeServer.Editor.Interface import interface_obj,interface_global,interface_project
from handlers.kbeServer.Editor.Interface import interface_account
from handlers.kbeServer.Edito... | true | true |
08fe9723be92aea7172e5849820561eeb9983d96 | 3,820 | py | Python | test/unit_tests/braket/device_schema/rigetti/test_rigetti_device_capabilities_v1.py | kjacky/amazon-braket-schemas-python | 42bfd211747d2bc26831085df17e295c65a04f6a | [
"Apache-2.0"
] | 17 | 2020-09-10T00:40:35.000Z | 2022-03-02T23:22:50.000Z | test/unit_tests/braket/device_schema/rigetti/test_rigetti_device_capabilities_v1.py | kjacky/amazon-braket-schemas-python | 42bfd211747d2bc26831085df17e295c65a04f6a | [
"Apache-2.0"
] | 60 | 2020-08-13T19:48:03.000Z | 2022-03-31T19:28:33.000Z | test/unit_tests/braket/device_schema/rigetti/test_rigetti_device_capabilities_v1.py | kjacky/amazon-braket-schemas-python | 42bfd211747d2bc26831085df17e295c65a04f6a | [
"Apache-2.0"
] | 20 | 2020-08-14T23:10:44.000Z | 2022-01-31T07:32:48.000Z | # Copyright Amazon.com Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompany... | 34.414414 | 100 | 0.620157 |
import json
import pytest
from pydantic import ValidationError
from braket.device_schema.rigetti.rigetti_device_capabilities_v1 import RigettiDeviceCapabilities
@pytest.fixture(scope="module")
def valid_input():
input = {
"braketSchemaHeader": {
"name": "braket.device_schema.rigetti.rigetti... | true | true |
08fe98f848b1c505de56c914df115f21585dc233 | 127,818 | py | Python | cryosat_toolkit/read_cryosat_L2I.py | outlk/read-cryosat-2 | 3ca032969f4cf5e9edde1e651d2c900bd84fba09 | [
"MIT"
] | 16 | 2018-08-11T08:32:44.000Z | 2022-01-07T08:39:23.000Z | cryosat_toolkit/read_cryosat_L2I.py | outlk/read-cryosat-2 | 3ca032969f4cf5e9edde1e651d2c900bd84fba09 | [
"MIT"
] | 5 | 2019-04-24T13:06:05.000Z | 2020-06-24T20:57:09.000Z | cryosat_toolkit/read_cryosat_L2I.py | outlk/read-cryosat-2 | 3ca032969f4cf5e9edde1e651d2c900bd84fba09 | [
"MIT"
] | 11 | 2018-06-04T08:03:53.000Z | 2022-01-07T08:39:27.000Z | #!/usr/bin/env python
u"""
read_cryosat_L2I.py
Written by Tyler Sutterley (05/2021)
Reads CryoSat Level-2 Intermediate data products from baselines A, B, BC and C
Reads CryoSat Level-2 netCDF4 data products from baseline D
Supported CryoSat Modes: LRM, SAR, SARin, FDM, SID, GDR
INPUTS:
full_filename: full path of... | 57.653586 | 99 | 0.66227 | from __future__ import print_function
from __future__ import division
import os
import re
import netCDF4
import numpy as np
import scipy.interpolate
def cryosat_baseline_AB(fid,record_size,n_records):
Location = {}
Location['Day'] = np.zeros((n_records),dtype=np.int32)
Location['Sec'] = np... | true | true |
08fe9a9cf1999c55e8b28cc0ae2c5740768d4639 | 4,200 | py | Python | keystone/tests/unit/test_hacking_checks.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 1 | 2019-05-08T06:09:35.000Z | 2019-05-08T06:09:35.000Z | keystone/tests/unit/test_hacking_checks.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 4 | 2018-08-22T14:51:02.000Z | 2018-10-17T14:04:26.000Z | keystone/tests/unit/test_hacking_checks.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 5 | 2018-08-03T17:19:34.000Z | 2019-01-11T15:54:42.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
# distributed under t... | 36.206897 | 75 | 0.708095 |
import textwrap
try:
import pep8
except ImportError:
import pycodestyle as pep8
from keystone.tests.hacking import checks
from keystone.tests import unit
from keystone.tests.unit.ksfixtures import hacking as hacking_fixtures
class BaseStyleCheck(unit.BaseTestCase):
def setUp(self):
... | true | true |
08fe9bc10cc289d93c5eaf364ffe2c798dc93d38 | 6,151 | py | Python | cloud_discovery/plugins/cloud_discovery_plugin_azure.py | pyToshka/cloud-discovery | c66eb8b5c5c9a0566994fe9436abea64d57dcf99 | [
"BSD-3-Clause"
] | 5 | 2021-01-14T14:02:05.000Z | 2022-01-18T10:29:00.000Z | cloud_discovery/plugins/cloud_discovery_plugin_azure.py | pyToshka/cloud-discovery | c66eb8b5c5c9a0566994fe9436abea64d57dcf99 | [
"BSD-3-Clause"
] | null | null | null | cloud_discovery/plugins/cloud_discovery_plugin_azure.py | pyToshka/cloud-discovery | c66eb8b5c5c9a0566994fe9436abea64d57dcf99 | [
"BSD-3-Clause"
] | 1 | 2021-01-26T19:37:50.000Z | 2021-01-26T19:37:50.000Z | # Copyright (c) 2021, Yuriy Medvedev
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and... | 44.89781 | 117 | 0.589172 | import ast
import pprint
import click
from azure.mgmt.compute import ComputeManagementClient
from azure.mgmt.network import NetworkManagementClient
from click import Option
from groundwork.patterns import GwCommandsPattern
from .utils import pprint_json, pprint_table, get_azure_credentials
class cloud_discovery_plu... | true | true |
08fe9bea3037999cbd4ddb10f97e8edcd045e487 | 51 | py | Python | src/profiles/__init__.py | triump0870/mdb | eb0cdbfbca3856b610037b0700a934ead9ad8506 | [
"MIT"
] | 875 | 2015-01-01T08:45:53.000Z | 2022-03-19T07:40:00.000Z | src/profiles/__init__.py | triump0870/mdb | eb0cdbfbca3856b610037b0700a934ead9ad8506 | [
"MIT"
] | 95 | 2016-12-07T19:13:51.000Z | 2017-03-10T16:16:16.000Z | src/profiles/__init__.py | triump0870/mdb | eb0cdbfbca3856b610037b0700a934ead9ad8506 | [
"MIT"
] | 341 | 2015-01-11T11:50:51.000Z | 2022-03-08T08:23:04.000Z | default_app_config = "profiles.apps.ProfileConfig"
| 25.5 | 50 | 0.843137 | default_app_config = "profiles.apps.ProfileConfig"
| true | true |
08fe9da72a9bc209e29d9d048f921aaa32b95633 | 240 | py | Python | roverpro/tests/burnin/conftest.py | RoverRobotics/openrover_python | bbbd24596db9f1c4e5a57d92fca048e289b668f0 | [
"BSD-3-Clause"
] | 1 | 2020-05-20T18:43:28.000Z | 2020-05-20T18:43:28.000Z | roverpro/tests/burnin/conftest.py | RoverRobotics/openrover_python | bbbd24596db9f1c4e5a57d92fca048e289b668f0 | [
"BSD-3-Clause"
] | 3 | 2019-04-22T21:48:07.000Z | 2020-06-17T19:10:04.000Z | roverpro/tests/burnin/conftest.py | RoverRobotics/openrover_python | bbbd24596db9f1c4e5a57d92fca048e289b668f0 | [
"BSD-3-Clause"
] | 1 | 2020-08-16T21:40:00.000Z | 2020-08-16T21:40:00.000Z | import pytest
@pytest.hookimpl(tryfirst=True)
def pytest_configure(config):
config.inicfg["log_cli"] = "true"
config.inicfg["log_cli_level"] = "NOTSET"
config.inicfg["log_cli_format"] = "%(asctime)s %(levelname)s %(message)s"
| 26.666667 | 77 | 0.704167 | import pytest
@pytest.hookimpl(tryfirst=True)
def pytest_configure(config):
config.inicfg["log_cli"] = "true"
config.inicfg["log_cli_level"] = "NOTSET"
config.inicfg["log_cli_format"] = "%(asctime)s %(levelname)s %(message)s"
| true | true |
08fe9dba86fd7df22b4a4986dfab1e4194cfa75c | 1,186 | py | Python | src/JapaneseParsers/parseRADKFILE.py | JapaneseDatabase/JapaneseDictionaryCollection | 9b1184b4c47d1c9a863c8e08c42e9e71bf245bda | [
"MIT"
] | null | null | null | src/JapaneseParsers/parseRADKFILE.py | JapaneseDatabase/JapaneseDictionaryCollection | 9b1184b4c47d1c9a863c8e08c42e9e71bf245bda | [
"MIT"
] | null | null | null | src/JapaneseParsers/parseRADKFILE.py | JapaneseDatabase/JapaneseDictionaryCollection | 9b1184b4c47d1c9a863c8e08c42e9e71bf245bda | [
"MIT"
] | null | null | null | import os
def main():
'''Example function for using the functions in this form
'''
for radical, strokes, kanji in parseRadK(os.path.join('data', 'kradzip', 'radkfilex')):
print(radical, strokes)
print(kanji)
print()
def parseRadK(fileName):
'''Parses all radicals and Kanji usi... | 29.65 | 91 | 0.572513 | import os
def main():
for radical, strokes, kanji in parseRadK(os.path.join('data', 'kradzip', 'radkfilex')):
print(radical, strokes)
print(kanji)
print()
def parseRadK(fileName):
currentRadical = ''
currentStrokes = ''
currentKanji = ''
with open(fileName, 'r', encoding='... | true | true |
08fe9dc60c95ed7c722a6bcf24881b5f30a784a5 | 8,200 | py | Python | code/Comments.py | EricRohlfs/AzureDevOpsSync | fdabf326bdddcf2f79126d064ac670a509398f35 | [
"MIT"
] | null | null | null | code/Comments.py | EricRohlfs/AzureDevOpsSync | fdabf326bdddcf2f79126d064ac670a509398f35 | [
"MIT"
] | 4 | 2019-05-17T18:10:25.000Z | 2019-05-17T18:20:13.000Z | code/Comments.py | EricRohlfs/vsts_to_neo4j | ec09e336540b9d68dcf8c304f1145836a8ea3af0 | [
"MIT"
] | null | null | null | '''
Comments.py
From VSTS imports the pull request comments and stores them in Neo4j linked to users and pull requests
'''
import logging
from multiprocessing import Pool
from VSTSInfo import VstsInfo
from models import GraphBuilder, PullRequest, Comment, PullRequestThread, Person
class CommentsWorker():
'''
G... | 36.444444 | 197 | 0.611463 | import logging
from multiprocessing import Pool
from VSTSInfo import VstsInfo
from models import GraphBuilder, PullRequest, Comment, PullRequestThread, Person
class CommentsWorker():
def __init__(self, vsts, exclude_system_comments=True):
self._exclude_system_comments = exclude_system_comments
sel... | true | true |
08fe9e21ed5432d696e3fe973dc954cc6af690a7 | 31,309 | py | Python | gmn/src/d1_gmn/tests/gmn_test_case.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 15 | 2016-10-28T13:56:52.000Z | 2022-01-31T19:07:49.000Z | gmn/src/d1_gmn/tests/gmn_test_case.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 56 | 2017-03-16T03:52:32.000Z | 2022-03-12T01:05:28.000Z | gmn/src/d1_gmn/tests/gmn_test_case.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 11 | 2016-05-31T16:22:02.000Z | 2020-10-05T14:37:10.000Z | # This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | 35.700114 | 123 | 0.6417 |
# stuck with a bit of a messy import section that isort and flake8 don't like.
import requests.exceptions
import d1_gmn.tests.gmn_test_case
import bz2
import contextlib
import copy
import datetime
import io
import logging
import os
import random
import shutil
import sys
import tempfile
import traceback
import django... | true | true |
08fe9e77d5acbc0307230855f33da54a3ae39a03 | 1,502 | py | Python | torch_glow/tests/nodes/add_test.py | dreamingleo/glow | 8f9649bf1e1244692f2e14bdf57720f683d82618 | [
"Apache-2.0"
] | 3 | 2019-06-12T22:05:33.000Z | 2020-02-20T22:21:50.000Z | torch_glow/tests/nodes/add_test.py | dreamingleo/glow | 8f9649bf1e1244692f2e14bdf57720f683d82618 | [
"Apache-2.0"
] | 1 | 2018-05-03T01:46:43.000Z | 2018-05-03T01:46:43.000Z | torch_glow/tests/nodes/add_test.py | dreamingleo/glow | 8f9649bf1e1244692f2e14bdf57720f683d82618 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
from tests.utils import jitVsGlow
def test_add_basic():
"""Basic test of the PyTorch add Node on Glow."""
def test_f(a, b):
c = a.add(b)
return c.add(c)
x = torch.randn(4)
y = torch.rand... | 21.15493 | 82 | 0.600533 | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
from tests.utils import jitVsGlow
def test_add_basic():
def test_f(a, b):
c = a.add(b)
return c.add(c)
x = torch.randn(4)
y = torch.randn(4)
jitVsGlow(test_f, x, y, expected_fused_ops={... | true | true |
08fe9f56fac7971377a5b669d75d9df75802346a | 3,861 | py | Python | docs/pyqt/kalkulator/kalkulator06a.py | sokol02/python101 | e06ad83f9eee285023b9c8e79ab1c00ad8bd67e5 | [
"MIT"
] | null | null | null | docs/pyqt/kalkulator/kalkulator06a.py | sokol02/python101 | e06ad83f9eee285023b9c8e79ab1c00ad8bd67e5 | [
"MIT"
] | null | null | null | docs/pyqt/kalkulator/kalkulator06a.py | sokol02/python101 | e06ad83f9eee285023b9c8e79ab1c00ad8bd67e5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QLabel, QGridLayout
from PyQt5.QtWidgets import QLineEdit, QPushButton, QHBoxLayout
from PyQt5.QtWidgets import QMessageBox
from ... | 29.7 | 78 | 0.595183 |
from __future__ import unicode_literals
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QLabel, QGridLayout
from PyQt5.QtWidgets import QLineEdit, QPushButton, QHBoxLayout
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtCore import Qt
class Kalkulator(... | true | true |
08fe9fc165301d29543e8637d242a0bb9d82fdc6 | 842 | py | Python | check_sudoku.py | OuedraogoAbdoul/python-review | 644cbfdd6f77d11241d0ca30d4717c3d9c8b7cc2 | [
"MIT"
] | null | null | null | check_sudoku.py | OuedraogoAbdoul/python-review | 644cbfdd6f77d11241d0ca30d4717c3d9c8b7cc2 | [
"MIT"
] | null | null | null | check_sudoku.py | OuedraogoAbdoul/python-review | 644cbfdd6f77d11241d0ca30d4717c3d9c8b7cc2 | [
"MIT"
] | null | null | null | correct = [[1,2,3],
[2,3,1],
[3,1,2]]
incorrect = [[1,2,3,4],
[2,3,1,3],
[3,1,2,3],
[4,4,4,4]]
incorrect2 = [[1,2,3,4],
[2,3,1,4],
[4,1,2,3],
[3,4,1,2]]
incorrect3 = [[1,2,3,4,5],
[2,3,1,5,6],
... | 16.192308 | 40 | 0.421615 | correct = [[1,2,3],
[2,3,1],
[3,1,2]]
incorrect = [[1,2,3,4],
[2,3,1,3],
[3,1,2,3],
[4,4,4,4]]
incorrect2 = [[1,2,3,4],
[2,3,1,4],
[4,1,2,3],
[3,4,1,2]]
incorrect3 = [[1,2,3,4,5],
[2,3,1,5,6],
... | true | true |
08fea1f2d9108cb092ecb1b2ae9e65131470a730 | 17,061 | py | Python | model1_supercomputer.py | zutn/incremental_breakdown | eefa5442502ebcf74f13ff3d802938e2a43188d3 | [
"Apache-2.0"
] | null | null | null | model1_supercomputer.py | zutn/incremental_breakdown | eefa5442502ebcf74f13ff3d802938e2a43188d3 | [
"Apache-2.0"
] | null | null | null | model1_supercomputer.py | zutn/incremental_breakdown | eefa5442502ebcf74f13ff3d802938e2a43188d3 | [
"Apache-2.0"
] | 1 | 2019-08-13T10:36:06.000Z | 2019-08-13T10:36:06.000Z | #!/usr/bin/env python
# coding: utf-8
"""
"""
from __future__ import division
import datetime
import cmf
import spotpy
from spotpy.parameter import Uniform as param
import sys
import os
import numpy as np
from datawriter_multi_objective import DataWriter
# Calibration time span
# 1979: Spin-Up
... | 39.86215 | 116 | 0.537249 |
from __future__ import division
import datetime
import cmf
import spotpy
from spotpy.parameter import Uniform as param
import sys
import os
import numpy as np
from datawriter_multi_objective import DataWriter
begin = 1980
end = 1985
prefix='model1'
runs = 10
fnQ = 'GrebenauQTagMittel__1979_1... | true | true |
08fea3328c2cc5522cc0900728226deb175fb3e9 | 3,704 | py | Python | reconcile/terraform_users.py | BumbleFeng/qontract-reconcile | a9f5bb221df5f92727d0582c5aa1a99822883782 | [
"Apache-2.0"
] | 21 | 2019-10-22T16:50:26.000Z | 2022-03-25T16:07:44.000Z | reconcile/terraform_users.py | BumbleFeng/qontract-reconcile | a9f5bb221df5f92727d0582c5aa1a99822883782 | [
"Apache-2.0"
] | 629 | 2018-12-13T12:46:53.000Z | 2022-03-31T20:46:02.000Z | reconcile/terraform_users.py | BumbleFeng/qontract-reconcile | a9f5bb221df5f92727d0582c5aa1a99822883782 | [
"Apache-2.0"
] | 50 | 2019-01-04T10:22:45.000Z | 2022-03-28T13:24:27.000Z | import sys
from reconcile.utils import gql
from reconcile.utils.smtp_client import SmtpClient
from reconcile import queries
from reconcile.utils.semver_helper import make_semver
from reconcile.utils.terrascript_client import TerrascriptClient as Terrascript
from reconcile.utils.terraform_client import TerraformClient... | 25.902098 | 79 | 0.647138 | import sys
from reconcile.utils import gql
from reconcile.utils.smtp_client import SmtpClient
from reconcile import queries
from reconcile.utils.semver_helper import make_semver
from reconcile.utils.terrascript_client import TerrascriptClient as Terrascript
from reconcile.utils.terraform_client import TerraformClient... | true | true |
08fea33d945b1bb68ef865a07d1ff35ae14c6c33 | 9,637 | py | Python | bot/seasons/valentines/be_my_valentine.py | Suhail6inkling/seasonalbot | 9daf007c4094b8ee09b4779f78ac9122d0ca4e7d | [
"MIT"
] | null | null | null | bot/seasons/valentines/be_my_valentine.py | Suhail6inkling/seasonalbot | 9daf007c4094b8ee09b4779f78ac9122d0ca4e7d | [
"MIT"
] | null | null | null | bot/seasons/valentines/be_my_valentine.py | Suhail6inkling/seasonalbot | 9daf007c4094b8ee09b4779f78ac9122d0ca4e7d | [
"MIT"
] | null | null | null | import logging
import random
import typing
from json import load
from pathlib import Path
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from bot.constants import Channels, Client, Colours, Lovefest
log = logging.getLogger(__name__)
HEART_EMOJIS = [":heart:", "... | 41.183761 | 120 | 0.643665 | import logging
import random
import typing
from json import load
from pathlib import Path
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from bot.constants import Channels, Client, Colours, Lovefest
log = logging.getLogger(__name__)
HEART_EMOJIS = [":heart:", "... | true | true |
08fea39eda9bbeeb9d22d3fed143ff24ba8dcce3 | 3,522 | py | Python | python/pyarmnn/test/test_quantize_and_dequantize.py | Project-Xtended/external_armnn | c5e1bbf9fc8ecbb8c9eb073a1550d4c8c15fce94 | [
"MIT"
] | 856 | 2018-03-09T17:26:23.000Z | 2022-03-24T21:31:33.000Z | python/pyarmnn/test/test_quantize_and_dequantize.py | Project-Xtended/external_armnn | c5e1bbf9fc8ecbb8c9eb073a1550d4c8c15fce94 | [
"MIT"
] | 623 | 2018-03-13T04:40:42.000Z | 2022-03-31T09:45:17.000Z | python/pyarmnn/test/test_quantize_and_dequantize.py | Project-Xtended/external_armnn | c5e1bbf9fc8ecbb8c9eb073a1550d4c8c15fce94 | [
"MIT"
] | 284 | 2018-03-09T23:05:28.000Z | 2022-03-29T14:42:28.000Z | # Copyright © 2020 Arm Ltd. All rights reserved.
# SPDX-License-Identifier: MIT
import pytest
import numpy as np
import pyarmnn as ann
# import generated so we can test for Dequantize_* and Quantize_*
# functions not available in the public API.
import pyarmnn._generated.pyarmnn as gen_ann
@pytest.mark.parametrize(... | 38.282609 | 84 | 0.486655 | import pytest
import numpy as np
import pyarmnn as ann
import pyarmnn._generated.pyarmnn as gen_ann
@pytest.mark.parametrize('method', ['Quantize_int8_t',
'Quantize_uint8_t',
'Quantize_int16_t',
'Quantize_int... | true | true |
08fea668c99c3198da0f230e512667fd01609914 | 4,036 | py | Python | tests/cpu/instruction/test_bitey_cpu_instruction_ldx.py | jgerrish/bitey | a393a83c19338d94116f3405f4b8a0f03ea84d79 | [
"MIT"
] | null | null | null | tests/cpu/instruction/test_bitey_cpu_instruction_ldx.py | jgerrish/bitey | a393a83c19338d94116f3405f4b8a0f03ea84d79 | [
"MIT"
] | null | null | null | tests/cpu/instruction/test_bitey_cpu_instruction_ldx.py | jgerrish/bitey | a393a83c19338d94116f3405f4b8a0f03ea84d79 | [
"MIT"
] | null | null | null | import pytest
# TODO Maybe refactor so these are not needed
from bitey.cpu.addressing_mode import (
AbsoluteAddressingMode,
ImmediateAddressingMode,
ZeroPageAddressingMode,
)
from bitey.computer.computer import Computer
from bitey.cpu.instruction.instruction import IncompleteInstruction
from bitey.cpu.inst... | 29.246377 | 80 | 0.719772 | import pytest
from bitey.cpu.addressing_mode import (
AbsoluteAddressingMode,
ImmediateAddressingMode,
ZeroPageAddressingMode,
)
from bitey.computer.computer import Computer
from bitey.cpu.instruction.instruction import IncompleteInstruction
from bitey.cpu.instruction.opcode import Opcode
from bitey.cpu.in... | true | true |
08fea76781ed5761c113f794e71f566e751e62ff | 982 | py | Python | generator/group.py | mycolam/python_training | eaca1908fe8de7cb09f216f3d387df1401621081 | [
"Apache-2.0"
] | null | null | null | generator/group.py | mycolam/python_training | eaca1908fe8de7cb09f216f3d387df1401621081 | [
"Apache-2.0"
] | null | null | null | generator/group.py | mycolam/python_training | eaca1908fe8de7cb09f216f3d387df1401621081 | [
"Apache-2.0"
] | null | null | null | from model.group import Group
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "data/groups.json"
for o, a in op... | 23.380952 | 113 | 0.649695 | from model.group import Group
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "data/groups.json"
for o, a in op... | true | true |
08fea85c5d585b20660332ad5a0a674cc16a2a7f | 231 | py | Python | ex15.py | KhaingNyoThein/python-exercises | 60fa59230a638619e0d9655fea2911563749562e | [
"MIT"
] | null | null | null | ex15.py | KhaingNyoThein/python-exercises | 60fa59230a638619e0d9655fea2911563749562e | [
"MIT"
] | null | null | null | ex15.py | KhaingNyoThein/python-exercises | 60fa59230a638619e0d9655fea2911563749562e | [
"MIT"
] | null | null | null | from sys import argv
script, filename = argv
txt = open (filename)
print(f"Here's ypur file {filename}:")
print(txt.read())
print("Type the filename again:")
file_again=input(">")
txt_again=open(file_again)
print(txt_again.read())
| 23.1 | 38 | 0.735931 | from sys import argv
script, filename = argv
txt = open (filename)
print(f"Here's ypur file {filename}:")
print(txt.read())
print("Type the filename again:")
file_again=input(">")
txt_again=open(file_again)
print(txt_again.read())
| true | true |
08fea8752bafec28e15913353ae7a3258433b84a | 711 | py | Python | AddTwoNum.py | cometdlut/leetcode_cometdlut | 38f932aa660324fe151eee6f0ca8e759bb6746a3 | [
"MIT"
] | null | null | null | AddTwoNum.py | cometdlut/leetcode_cometdlut | 38f932aa660324fe151eee6f0ca8e759bb6746a3 | [
"MIT"
] | null | null | null | AddTwoNum.py | cometdlut/leetcode_cometdlut | 38f932aa660324fe151eee6f0ca8e759bb6746a3 | [
"MIT"
] | null | null | null | # _*_ coding:utf-8 _*_
"""
You are given two non-empty linked lists representing two non-negative integers.
The digits are stored in reverse order and each of their nodes contain a single digit.
Add the two numbers and return it as a linked list.
You may assume the two numbers do not contain any leading zero, except... | 28.44 | 91 | 0.635724 |
class Solution(object):
def addTwoNumbers(self, l1, l2): | true | true |
08fea901e9e51344e5fdc9e30c387ad3a4f0e5ae | 107 | py | Python | src/heputils/cli/__init__.py | matthewfeickert/heputils | a810492b1bd8c67663810ba0e213dfc4e7c7d819 | [
"BSD-3-Clause"
] | 2 | 2020-11-12T13:07:16.000Z | 2020-12-01T16:53:12.000Z | src/heputils/cli/__init__.py | matthewfeickert/heputils | a810492b1bd8c67663810ba0e213dfc4e7c7d819 | [
"BSD-3-Clause"
] | 78 | 2020-08-27T08:15:55.000Z | 2022-03-07T19:49:58.000Z | src/heputils/cli/__init__.py | matthewfeickert/heputils | a810492b1bd8c67663810ba0e213dfc4e7c7d819 | [
"BSD-3-Clause"
] | null | null | null | """The heputils command line interface."""
from heputils.cli.cli import heputils as cli
__all__ = ["cli"]
| 21.4 | 44 | 0.728972 | from heputils.cli.cli import heputils as cli
__all__ = ["cli"]
| true | true |
08fea9c4e54657e63fe602b1af8e8fbb31dfdf88 | 240 | py | Python | gwcs/tags/__init__.py | jdavies-st/gwcs | 14a8c0b83603a4590a1fecb155467e6029fdc3e9 | [
"BSD-3-Clause"
] | 31 | 2015-04-21T21:40:38.000Z | 2022-03-30T20:03:08.000Z | gwcs/tags/__init__.py | jdavies-st/gwcs | 14a8c0b83603a4590a1fecb155467e6029fdc3e9 | [
"BSD-3-Clause"
] | 331 | 2015-01-23T17:57:55.000Z | 2022-03-11T22:54:43.000Z | gwcs/tags/__init__.py | jdavies-st/gwcs | 14a8c0b83603a4590a1fecb155467e6029fdc3e9 | [
"BSD-3-Clause"
] | 38 | 2015-01-13T21:22:54.000Z | 2021-09-01T01:52:19.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from astropy import units as u
def _parameter_to_value(param):
if param.unit is not None:
return u.Quantity(param)
return param.value
| 24 | 63 | 0.695833 | from astropy import units as u
def _parameter_to_value(param):
if param.unit is not None:
return u.Quantity(param)
return param.value
| true | true |
08feaa100f8cc4204dcf5dfd25e1926cb1b640d9 | 4,028 | py | Python | optaux/me_community/run_ALE_pairs.py | coltonlloyd/OptAux | 3ee1f8cdfa32f1a732ad41d5f854659159694160 | [
"MIT"
] | 1 | 2019-06-05T10:41:06.000Z | 2019-06-05T10:41:06.000Z | optaux/me_community/run_ALE_pairs.py | coltonlloyd/OptAux | 3ee1f8cdfa32f1a732ad41d5f854659159694160 | [
"MIT"
] | null | null | null | optaux/me_community/run_ALE_pairs.py | coltonlloyd/OptAux | 3ee1f8cdfa32f1a732ad41d5f854659159694160 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import json
import os
import pandas as pd
import cobra
from optaux.resources.possible_uptake import get_possible_uptake
from optaux.me_community.me_model_community import (
knock_out_reactions,
change_unmodeled_protein_fraction, change_secretion_keff,
scale... | 39.490196 | 82 | 0.66286 | from __future__ import print_function, division
import json
import os
import pandas as pd
import cobra
from optaux.resources.possible_uptake import get_possible_uptake
from optaux.me_community.me_model_community import (
knock_out_reactions,
change_unmodeled_protein_fraction, change_secretion_keff,
scale... | true | true |
08feaa270b0d4f3b5031f12227c7434d98c0be24 | 8,152 | py | Python | scripts/release.py | stickpin/pyatv | cb45bf5d303593a4e0be05215f21140e2fbbb03d | [
"MIT"
] | null | null | null | scripts/release.py | stickpin/pyatv | cb45bf5d303593a4e0be05215f21140e2fbbb03d | [
"MIT"
] | null | null | null | scripts/release.py | stickpin/pyatv | cb45bf5d303593a4e0be05215f21140e2fbbb03d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Helper script to make a release."""
import re
import os
import sys
import glob
import logging
import argparse
import subprocess
from pathlib import Path
from datetime import datetime
from packaging.version import Version, InvalidVersion
_LOGGER = logging.getLogger(__name__)
CHANGES_TEMPLATE... | 31.233716 | 70 | 0.607213 |
import re
import os
import sys
import glob
import logging
import argparse
import subprocess
from pathlib import Path
from datetime import datetime
from packaging.version import Version, InvalidVersion
_LOGGER = logging.getLogger(__name__)
CHANGES_TEMPLATE = """# CHANGES
## {version}
*Changes:*
REMOVE ME
*Notes:*... | true | true |
08feaa7a1a03a27bfdc0c8087ee642ba13a9bf0c | 1,511 | py | Python | code/newspaperclassifier/utils.py | dhlab-epfl-students/newspaper-image-classification | 35fd6ffacecad321abcb61a1fa2c93b8bd8d0e63 | [
"Unlicense"
] | 1 | 2022-01-12T13:51:21.000Z | 2022-01-12T13:51:21.000Z | code/newspaperclassifier/utils.py | dhlab-epfl-students/newspaper-image-classification | 35fd6ffacecad321abcb61a1fa2c93b8bd8d0e63 | [
"Unlicense"
] | null | null | null | code/newspaperclassifier/utils.py | dhlab-epfl-students/newspaper-image-classification | 35fd6ffacecad321abcb61a1fa2c93b8bd8d0e63 | [
"Unlicense"
] | null | null | null | import json
import os
def save_json(labels, output_file):
"""
Saves the given dictionary in a json file
Args:
labels:
output_file:
Returns:
"""
with open(output_file, 'w') as f:
json.dump(labels, f)
def _get_split_base_name(filepath):
"""
Given any file path... | 25.183333 | 88 | 0.665122 | import json
import os
def save_json(labels, output_file):
with open(output_file, 'w') as f:
json.dump(labels, f)
def _get_split_base_name(filepath):
return os.path.splitext(os.path.basename(filepath))[0]
def _get_json_path_from_id(directory, image_id):
return os.path.abspath(os.path.join(direc... | true | true |
08feaa93ad5de92c2152656db4b5fc8ff9b34355 | 2,489 | py | Python | .history/my_classes/FirstClassFunctions/First-ClassFunctions_20210703222345.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/First-ClassFunctions_20210703222345.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/First-ClassFunctions_20210703222345.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ First-Class Functions
can be passed to a function as an argument
can be returned from a function
can be assigned to a variable
can be stored in a data structure (such as list, tuple, dictionary, etc.)
Types such as INT, FLOAT, STRING, TUPLE, LIST and many more are first-class objects.
Functions... | 22.834862 | 148 | 0.613098 | """ First-Class Functions
can be passed to a function as an argument
can be returned from a function
can be assigned to a variable
can be stored in a data structure (such as list, tuple, dictionary, etc.)
Types such as INT, FLOAT, STRING, TUPLE, LIST and many more are first-class objects.
Functions... | false | true |
08feaada4420985d93d6ec867ad4033f6b7ddb05 | 1,855 | py | Python | 03Thread/day01/basic04.py | HaoZhang95/PythonAndMachineLearning | b897224b8a0e6a5734f408df8c24846a98c553bf | [
"MIT"
] | 937 | 2019-05-08T08:46:25.000Z | 2022-03-31T12:56:07.000Z | 03Thread/day01/basic04.py | Sakura-gh/Python24 | b97e18867264a0647d5645c7d757a0040e755577 | [
"MIT"
] | 47 | 2019-09-17T10:06:02.000Z | 2022-03-11T23:46:52.000Z | 03Thread/day01/basic04.py | Sakura-gh/Python24 | b97e18867264a0647d5645c7d757a0040e755577 | [
"MIT"
] | 354 | 2019-05-10T02:15:26.000Z | 2022-03-30T05:52:57.000Z | """
多线程下的全局变量共享问题
1- 互斥锁:就是为变量引入一个状态:锁定和非锁定状态,类似于上厕所的锁门
2- 多个线程互相互斥,只有厕所门开锁之后才能让下一个进去,多个线程**协同配合**
3- 互斥锁:保证每次只有一个线程读写变量
"""
import threading, time
global_num = 0
# 创建一把全局互斥锁
global_lock = threading.Lock()
def worker1():
global global_num
for i in range(100000):
# 修改资源前,尝试获取并加锁,如果没有... | 20.611111 | 82 | 0.62965 | import threading, time
global_num = 0
global_lock = threading.Lock()
def worker1():
global global_num
for i in range(100000):
global_lock.acquire()
global_num += 1
global_lock.release()
def worker2():
global global_num
for i in range(100000):
... | true | true |
08feac6dba76a860d472ae8c2b0ed920cee33ab2 | 4,020 | py | Python | telemetry/sensors/weatherPiArduino/Adafruit_Python_GPIO/test/test_PWM.py | WxOutside/software | f9df6c08cbe81dd9349cab86278b92b5905dbc97 | [
"Unlicense"
] | 1 | 2019-03-19T06:59:45.000Z | 2019-03-19T06:59:45.000Z | telemetry/sensors/weatherPiArduino/Adafruit_Python_GPIO/test/test_PWM.py | WxOutside/software | f9df6c08cbe81dd9349cab86278b92b5905dbc97 | [
"Unlicense"
] | null | null | null | telemetry/sensors/weatherPiArduino/Adafruit_Python_GPIO/test/test_PWM.py | WxOutside/software | f9df6c08cbe81dd9349cab86278b92b5905dbc97 | [
"Unlicense"
] | null | null | null | # Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... | 39.029126 | 96 | 0.699005 |
import unittest
from mock import Mock, patch
import Adafruit_GPIO.PWM as PWM
class TestRPi_PWM_Adapter(unittest.TestCase):
def test_setup(self):
rpi_gpio = Mock()
pwm = PWM.RPi_PWM_Adapter(rpi_gpio)
pwm.start(1, 50)
rpi_gpio.PWM.assert_called_with(1, 2000)
def test_set_duty... | true | true |
08feac7415e3c0ebcb1bea0094dfbd850ecf2692 | 4,311 | py | Python | spotify/track_search.py | HaydenPWoods/radio-stream-to-spotify | 748f4a8a08210edf916fafcad620dfa2e64fa940 | [
"MIT"
] | null | null | null | spotify/track_search.py | HaydenPWoods/radio-stream-to-spotify | 748f4a8a08210edf916fafcad620dfa2e64fa940 | [
"MIT"
] | 4 | 2020-09-26T13:45:00.000Z | 2021-03-20T18:31:02.000Z | spotify/track_search.py | HaydenPWoods/radio-stream-to-spotify | 748f4a8a08210edf916fafcad620dfa2e64fa940 | [
"MIT"
] | null | null | null | from spotify import spotify, exclusions, blacklisted_artists
def track_search(track_title, artist_name, include_remixes):
"""
Takes a track title and artist name as strings, searches for the song on Spotify, and then returns the URI of the
song if found. Attempts to exclude karaoke and 'cover tracks' from... | 41.451923 | 117 | 0.503595 | from spotify import spotify, exclusions, blacklisted_artists
def track_search(track_title, artist_name, include_remixes):
try:
tracks, = spotify.search(track_title, types=('track',), limit=5)
good_track = -1
if tracks.total > 0:
if tracks.total < 5:
tracks_searc... | true | true |
08feacec47d6cdd7e8d96dc8f46a45213f5ed934 | 23,147 | py | Python | HPOBenchExperimentUtils/optimizer/fabolas_optimizer.py | PhMueller/TrajectoryParser | 9c19d37a3ff29a593c9b6d3e7fd3857e8c2d724f | [
"Apache-2.0"
] | null | null | null | HPOBenchExperimentUtils/optimizer/fabolas_optimizer.py | PhMueller/TrajectoryParser | 9c19d37a3ff29a593c9b6d3e7fd3857e8c2d724f | [
"Apache-2.0"
] | 1 | 2021-09-01T16:35:21.000Z | 2021-11-05T19:53:25.000Z | HPOBenchExperimentUtils/optimizer/fabolas_optimizer.py | automl/HPOBenchExperimentUtils | 9c19d37a3ff29a593c9b6d3e7fd3857e8c2d724f | [
"Apache-2.0"
] | null | null | null | import logging
from pathlib import Path
from typing import Union, Dict, Tuple, Sequence
import sys
import numpy as np
from math import log2
import enum
from HPOBenchExperimentUtils.optimizer.base_optimizer import SingleFidelityOptimizer
from HPOBenchExperimentUtils.core.bookkeeper import Bookkeeper
from HPOBenchExperi... | 59.966321 | 128 | 0.662375 | import logging
from pathlib import Path
from typing import Union, Dict, Tuple, Sequence
import sys
import numpy as np
from math import log2
import enum
from HPOBenchExperimentUtils.optimizer.base_optimizer import SingleFidelityOptimizer
from HPOBenchExperimentUtils.core.bookkeeper import Bookkeeper
from HPOBenchExperi... | true | true |
08feae55928118318466be7602d00fa00669add5 | 14,465 | py | Python | sdk/python/pulumi_aws/kms/alias.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 260 | 2018-06-18T14:57:00.000Z | 2022-03-29T11:41:03.000Z | sdk/python/pulumi_aws/kms/alias.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 1,154 | 2018-06-19T20:38:20.000Z | 2022-03-31T19:48:16.000Z | sdk/python/pulumi_aws/kms/alias.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 115 | 2018-06-28T03:20:27.000Z | 2022-03-29T11:41:06.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 41.806358 | 148 | 0.633114 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['AliasArgs', 'Alias']
@pulumi.input_type
class AliasArgs:
def __init__(__self__, *,
target_key_id: pulumi.Input[str],
nam... | true | true |
08feae806015c5983c48561dff17d410524ea48c | 1,128 | py | Python | modules/contract_manage/send/delete_send.py | xuhuiliang-maybe/ace_office | 07fae18676a193206802e8fb9aa32a805b1da24c | [
"Apache-2.0"
] | 1 | 2018-11-27T08:08:07.000Z | 2018-11-27T08:08:07.000Z | modules/contract_manage/send/delete_send.py | xuhuiliang-maybe/ace_office | 07fae18676a193206802e8fb9aa32a805b1da24c | [
"Apache-2.0"
] | null | null | null | modules/contract_manage/send/delete_send.py | xuhuiliang-maybe/ace_office | 07fae18676a193206802e8fb9aa32a805b1da24c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from django.contrib.auth.decorators import login_required
from django.contrib.auth.decorators import permission_required
from django.contrib.messages.views import SuccessMessageMixin
from django.core.urlresolvers import reverse
from django.views.generic.edit import DeleteView
from modules.contract_manag... | 36.387097 | 103 | 0.805851 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.decorators import permission_required
from django.contrib.messages.views import SuccessMessageMixin
from django.core.urlresolvers import reverse
from django.views.generic.edit import DeleteView
from modules.contract_manage.models import... | true | true |
08feaf4c5bd640c10332b6ded484965ecb537ee3 | 14,659 | py | Python | tokenization.py | mananeau/ALBERT | 4409420b7aa3cd355078689e4963d8ad11000ee3 | [
"Apache-2.0"
] | null | null | null | tokenization.py | mananeau/ALBERT | 4409420b7aa3cd355078689e4963d8ad11000ee3 | [
"Apache-2.0"
] | null | null | null | tokenization.py | mananeau/ALBERT | 4409420b7aa3cd355078689e4963d8ad11000ee3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 31.592672 | 80 | 0.664234 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import unicodedata
import six
from six.moves import range
import tensorflow.compat.v1 as tf
import tensorflow_hub as hub
import sentencepiece as spm
SPIECE_UNDERLINE = u"▁".encode("utf-8")
... | true | true |
08feafe64f83e47d744cb1ef103c3664327ebed1 | 4,739 | py | Python | third_party/scons/scons-local/SCons/Scanner/C.py | bluebellzhy/chromium | 008c4fef2676506869a0404239da31e83fd6ccc7 | [
"BSD-3-Clause"
] | 1 | 2016-05-08T15:35:17.000Z | 2016-05-08T15:35:17.000Z | third_party/scons/scons-local/SCons/Scanner/C.py | bluebellzhy/chromium | 008c4fef2676506869a0404239da31e83fd6ccc7 | [
"BSD-3-Clause"
] | null | null | null | third_party/scons/scons-local/SCons/Scanner/C.py | bluebellzhy/chromium | 008c4fef2676506869a0404239da31e83fd6ccc7 | [
"BSD-3-Clause"
] | null | null | null | """SCons.Scanner.C
This module implements the depenency scanner for C/C++ code.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Sof... | 37.314961 | 94 | 0.645495 | """SCons.Scanner.C
This module implements the depenency scanner for C/C++ code.
"""
__revision__ = "src/engine/SCons/Scanner/C.py 3424 2008/09/15 11:22:20 scons"
import SCons.Node.FS
import SCons.Scanner
import SCons.Util
import SCons.cpp
class SConsCPPScanner(SCons.cpp.PreProcessor):
"""
SCons-specific... | false | true |
08feb1564f2589b79cca18602bee575543e16257 | 3,260 | py | Python | mysite/mysite/settings.py | michaelvdnest/django-mysite | 399798628a0c5bc744e6281d7c3e2746f287dad5 | [
"MIT"
] | null | null | null | mysite/mysite/settings.py | michaelvdnest/django-mysite | 399798628a0c5bc744e6281d7c3e2746f287dad5 | [
"MIT"
] | null | null | null | mysite/mysite/settings.py | michaelvdnest/django-mysite | 399798628a0c5bc744e6281d7c3e2746f287dad5 | [
"MIT"
] | null | null | null | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
fro... | 26.721311 | 92 | 0.672699 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
SECRET_KEY = '=b5%h27*botrr0isjn125!8y$(_h0(cwguli71(z2ov)&d$ow)'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'... | true | true |
08feb2c60f28b6765a072b15f27ab09ae08ec472 | 5,440 | py | Python | src/oci/database/models/update_external_container_database_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/database/models/update_external_container_database_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/database/models/update_external_container_database_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 36.510067 | 245 | 0.682721 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class UpdateExternalContainerDatabaseDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
'dis... | true | true |
08feb3153c561447491122fa506322ac7edda230 | 537 | py | Python | morelia/exceptions.py | ghostsquad/morelia | 18a9b32472fba8b3e85993402b88b36a41aa53b7 | [
"MIT"
] | null | null | null | morelia/exceptions.py | ghostsquad/morelia | 18a9b32472fba8b3e85993402b88b36a41aa53b7 | [
"MIT"
] | null | null | null | morelia/exceptions.py | ghostsquad/morelia | 18a9b32472fba8b3e85993402b88b36a41aa53b7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This module is a central location for all Morelia exceptions
"""
class MoreliaException(Exception):
"""
Base exception class; all Morelia-specific exceptions should subclass this
"""
strerror = None
def __init__(self, message=''):
super(MoreliaException, self).... | 25.571429 | 78 | 0.690875 |
class MoreliaException(Exception):
strerror = None
def __init__(self, message=''):
super(MoreliaException, self).__init__(message)
self.strerror = message
class InvalidOperationException(MoreliaException):
def __init__(self, *args, **kwargs):
super(InvalidOperationException, sel... | true | true |
08feb328603fde2edd5f631156227a8e396e7d97 | 5,133 | py | Python | homeassistant/components/zha/core/channels/smartenergy.py | ashkansad/home-assistant | c21db64296a63b384cdbae379eeaf7431858c9c3 | [
"Apache-2.0"
] | 1 | 2020-02-20T23:48:47.000Z | 2020-02-20T23:48:47.000Z | homeassistant/components/zha/core/channels/smartenergy.py | evergoodstudios/home-assistant | 1ee7c483a764b235b881c3918e8177b982a961e6 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/zha/core/channels/smartenergy.py | evergoodstudios/home-assistant | 1ee7c483a764b235b881c3918e8177b982a961e6 | [
"Apache-2.0"
] | null | null | null | """Smart energy channels module for Zigbee Home Automation."""
import logging
import zigpy.zcl.clusters.smartenergy as smartenergy
from homeassistant.core import callback
from .. import registries
from ..channels import AttributeListeningChannel, ZigbeeChannel
from ..const import REPORT_CONFIG_DEFAULT
_LOGGER = log... | 28.837079 | 88 | 0.677187 | import logging
import zigpy.zcl.clusters.smartenergy as smartenergy
from homeassistant.core import callback
from .. import registries
from ..channels import AttributeListeningChannel, ZigbeeChannel
from ..const import REPORT_CONFIG_DEFAULT
_LOGGER = logging.getLogger(__name__)
@registries.ZIGBEE_CHANNEL_REGISTRY.... | true | true |
08feb33fd572b81b69605540f8f599b4c525edc6 | 7,330 | py | Python | astroscrappy/tests/test_utils.py | cmccully/astro-scrappy | 3ed58dd537e40efed983ca049602af6e3e9f5ce7 | [
"BSD-3-Clause"
] | null | null | null | astroscrappy/tests/test_utils.py | cmccully/astro-scrappy | 3ed58dd537e40efed983ca049602af6e3e9f5ce7 | [
"BSD-3-Clause"
] | 2 | 2020-10-28T21:23:07.000Z | 2020-11-23T14:25:30.000Z | astroscrappy/tests/test_utils.py | cmccully/astro-scrappy | 3ed58dd537e40efed983ca049602af6e3e9f5ce7 | [
"BSD-3-Clause"
] | 2 | 2017-09-11T00:57:11.000Z | 2020-01-05T08:54:36.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from numpy.testing import assert_allclose
from ..utils import (median, optmed3, optmed5, optmed7, optmed9, optmed25,
... | 33.47032 | 79 | 0.573806 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from numpy.testing import assert_allclose
from ..utils import (median, optmed3, optmed5, optmed7, optmed9, optmed25,
medfilt3, medfilt5, medfilt7, sepmedfilt3, sepmedfilt... | true | true |
08feb3a07e131fadc97decf2167cbdd99e00626e | 21,225 | py | Python | tests/test_derivatives.py | ccuetom/devito | 3bd907bed50eff8608e36d83b92c706685a7d275 | [
"MIT"
] | null | null | null | tests/test_derivatives.py | ccuetom/devito | 3bd907bed50eff8608e36d83b92c706685a7d275 | [
"MIT"
] | null | null | null | tests/test_derivatives.py | ccuetom/devito | 3bd907bed50eff8608e36d83b92c706685a7d275 | [
"MIT"
] | null | null | null | import numpy as np
import pytest
from sympy import simplify, diff, Float
from devito import (Grid, Function, TimeFunction, Eq, Operator, NODE, cos, sin,
ConditionalDimension, left, right, centered, div, grad)
from devito.finite_differences import Derivative, Differentiable
from devito.finite_differ... | 43.228106 | 90 | 0.573616 | import numpy as np
import pytest
from sympy import simplify, diff, Float
from devito import (Grid, Function, TimeFunction, Eq, Operator, NODE, cos, sin,
ConditionalDimension, left, right, centered, div, grad)
from devito.finite_differences import Derivative, Differentiable
from devito.finite_differ... | true | true |
08feb3bb9b6dee5ede79cb5aff3bd9535f550575 | 7,410 | py | Python | src/fedAVG/server.py | Fra98/fed-learning-AML | 13a4cb3f240ea6ef4340aaf07cf352c7fe075d89 | [
"MIT"
] | null | null | null | src/fedAVG/server.py | Fra98/fed-learning-AML | 13a4cb3f240ea6ef4340aaf07cf352c7fe075d89 | [
"MIT"
] | null | null | null | src/fedAVG/server.py | Fra98/fed-learning-AML | 13a4cb3f240ea6ef4340aaf07cf352c7fe075d89 | [
"MIT"
] | null | null | null | from copy import deepcopy
import random
import numpy
import torch
import torch.nn as nn
import torch.optim as optim
from .client import Client
from ..models import *
from ..utils import get_class_priors, load_cifar, run_accuracy, generate_clients_sizes
from ..splits import indexes_split_IID, indexes_split_NON_IID
cl... | 45.740741 | 149 | 0.626046 | from copy import deepcopy
import random
import numpy
import torch
import torch.nn as nn
import torch.optim as optim
from .client import Client
from ..models import *
from ..utils import get_class_priors, load_cifar, run_accuracy, generate_clients_sizes
from ..splits import indexes_split_IID, indexes_split_NON_IID
cl... | true | true |
08feb518e9297e454cfc14d530dcd04df69130e5 | 3,969 | py | Python | alipay/aop/api/request/ZhimaCreditEpRoleGetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/ZhimaCreditEpRoleGetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/ZhimaCreditEpRoleGetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCreditEpRoleGetModel import ZhimaCreditEpRoleGetModel
class ZhimaCreditEpRoleGetRequest(object):
def __init_... | 27.372414 | 166 | 0.642479 | import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCreditEpRoleGetModel import ZhimaCreditEpRoleGetModel
class ZhimaCreditEpRoleGetRequest(object):
def __init__(self, biz_model=None):
self._biz_mod... | true | true |
08feb5f904447a11c08ebe4fd65cbea00b58bf05 | 2,348 | py | Python | utilities/plot_landing_point.py | cihuang123/Next-simulation | e8552a5804184b30022d103d47c8728fb242b5bc | [
"BSD-3-Clause"
] | null | null | null | utilities/plot_landing_point.py | cihuang123/Next-simulation | e8552a5804184b30022d103d47c8728fb242b5bc | [
"BSD-3-Clause"
] | null | null | null | utilities/plot_landing_point.py | cihuang123/Next-simulation | e8552a5804184b30022d103d47c8728fb242b5bc | [
"BSD-3-Clause"
] | 2 | 2021-05-05T14:59:37.000Z | 2021-06-17T03:19:45.000Z | import csv
import argparse
import matplotlib.pyplot as plt
def toFloat(str):
try:
return float(str)
except ValueError:
return str
parser = argparse.ArgumentParser(
description='Read some csv and output landing point.'
)
parser.add_argument('golden', help='Input the file position of golden ... | 33.070423 | 116 | 0.52385 | import csv
import argparse
import matplotlib.pyplot as plt
def toFloat(str):
try:
return float(str)
except ValueError:
return str
parser = argparse.ArgumentParser(
description='Read some csv and output landing point.'
)
parser.add_argument('golden', help='Input the file position of golden ... | true | true |
08feb6516edafc8d10d4467a9ae4bbaeea593aae | 464 | py | Python | account/migrations/0008_auto_20150402_1541.py | shmilyoo/ggxxBBS | cef6408e533bd0b0f57c3e2f5da4e93ea07c4331 | [
"MIT"
] | null | null | null | account/migrations/0008_auto_20150402_1541.py | shmilyoo/ggxxBBS | cef6408e533bd0b0f57c3e2f5da4e93ea07c4331 | [
"MIT"
] | null | null | null | account/migrations/0008_auto_20150402_1541.py | shmilyoo/ggxxBBS | cef6408e533bd0b0f57c3e2f5da4e93ea07c4331 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0007_auto_20150401_0916'),
]
operations = [
migrations.AlterField(
model_name='usergroup',
... | 22.095238 | 76 | 0.605603 | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0007_auto_20150401_0916'),
]
operations = [
migrations.AlterField(
model_name='usergroup',
name='icon',
... | true | true |
08feb6535ee4b276152cc6b2f2141cb74e865a51 | 68,793 | py | Python | versioneer.py | AWehrhahn/SME | 542e880ed779381f7cbbaaacb59475fa6a6d3537 | [
"BSD-3-Clause"
] | 14 | 2019-06-26T18:43:09.000Z | 2022-03-12T00:53:42.000Z | versioneer.py | AWehrhahn/SME | 542e880ed779381f7cbbaaacb59475fa6a6d3537 | [
"BSD-3-Clause"
] | 10 | 2020-03-01T15:21:23.000Z | 2021-09-01T15:28:37.000Z | versioneer.py | AWehrhahn/SME | 542e880ed779381f7cbbaaacb59475fa6a6d3537 | [
"BSD-3-Clause"
] | 6 | 2019-03-01T15:25:24.000Z | 2022-03-30T10:26:33.000Z | # Version: 0.18
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy
* [![Latest Version]
(... | 36.398413 | 88 | 0.62252 |
from __future__ import print_function
try:
import configparser
except ImportError:
import ConfigParser as configparser
import errno
import json
import os
import re
import subprocess
import sys
class VersioneerConfig:
def get_root():
root = os.path.realpath(os.path.abspath(os.getcwd()))
setup_py =... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.