hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
218441167d887c094c999bf5081ba969ce293715 | 2,644 | py | Python | scripts/perf/load-up-forum.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | 1 | 2019-03-17T04:16:15.000Z | 2019-03-17T04:16:15.000Z | scripts/perf/load-up-forum.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | scripts/perf/load-up-forum.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 35.253333 | 90 | 0.667927 |
21846c81622b10843fe45b216b405b3666021d46 | 1,691 | py | Python | igibson/objects/pedestrian.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 360 | 2020-04-02T11:12:09.000Z | 2022-03-24T21:46:58.000Z | igibson/objects/pedestrian.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 169 | 2020-04-07T21:01:05.000Z | 2022-03-31T10:07:39.000Z | igibson/objects/pedestrian.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 94 | 2020-04-09T23:22:17.000Z | 2022-03-17T21:49:03.000Z | import os
import pybullet as p
import igibson
from igibson.objects.stateful_object import StatefulObject
class Pedestrian(StatefulObject):
"""
Pedestiran object
"""
def __init__(self, style="standing", pos=[0, 0, 0]):
super(Pedestrian, self).__init__()
self.collision_filename = os.p... | 31.314815 | 117 | 0.593732 |
21848258b6c9d3a954dbcc3c0675a41cd5d5f45b | 3,381 | py | Python | alipay/aop/api/domain/AlipayOverseasOpenAccountConsultModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOverseasOpenAccountConsultModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOverseasOpenAccountConsultModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOverseasOpenAccountConsultModel(object):
def __init__(self):
self._account_name = None
self._account_no = None
self._bank_code = None
self._country = None
... | 29.146552 | 75 | 0.58533 |
2184a60a1e75680dd6c4d07e8554e7f42899844a | 2,816 | py | Python | src/BayesPermus/figure/plot.py | ml-opt/BayesPermus | 34995d20dfd6c19dbcfc166605e9336667fbf68b | [
"MIT"
] | null | null | null | src/BayesPermus/figure/plot.py | ml-opt/BayesPermus | 34995d20dfd6c19dbcfc166605e9336667fbf68b | [
"MIT"
] | null | null | null | src/BayesPermus/figure/plot.py | ml-opt/BayesPermus | 34995d20dfd6c19dbcfc166605e9336667fbf68b | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import itertools
import pandas as pd
import numpy as np
class Plot:
def set_axis_style(self, ax, labels):
ax.xaxis.set_tick_params(direction='out')
ax.xaxis.set_ticks_position('bottom')
ax.set_xticks(np.arange(1, len(labels) + 1))
ax.set_xticklabels(labels)
ax.set... | 36.102564 | 91 | 0.631037 |
2184aa77b432d1eedbba42ee1a723c00b573db46 | 315 | py | Python | toontown/toon/DistributedNPCInvisible.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 1 | 2018-06-16T23:06:38.000Z | 2018-06-16T23:06:38.000Z | toontown/toon/DistributedNPCInvisible.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/toon/DistributedNPCInvisible.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from pandac.PandaModules import *
from toontown.toon.DistributedNPCToon import *
class DistributedNPCInvisible(DistributedNPCToon):
def __init__(self, cr):
DistributedNPCToon.__init__(self, cr)
self.npcType = "Vanished Shopkeeper"
def initPos(self):
self.setCheesyEffect(11, 0, 0) | 28.636364 | 50 | 0.726984 |
2184c22a48b334f46e09900833810f8fec0b261f | 9,596 | py | Python | tests/test_socks_transmitter.py | blogresponder/socks2file | 024d14fa7dc0cb2c6840bf4d50d6cbb6e7b85fba | [
"Apache-2.0"
] | 2 | 2019-11-07T10:38:35.000Z | 2019-11-07T12:13:37.000Z | tests/test_socks_transmitter.py | blogresponder/socks2file | 024d14fa7dc0cb2c6840bf4d50d6cbb6e7b85fba | [
"Apache-2.0"
] | null | null | null | tests/test_socks_transmitter.py | blogresponder/socks2file | 024d14fa7dc0cb2c6840bf4d50d6cbb6e7b85fba | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
import sockser.socks_transmitter as soc_transmitter
from sockser.filesocket.filesocket import filesocket
import socket
import os
import time
import threading
class TestServer(TestCase):
@classmethod
def setUpClass(self):
''' file socket creation '''
self.fsoc = f... | 35.672862 | 97 | 0.659962 |
2184c29b994b5835bee8760e226806a43662b1df | 13,819 | py | Python | tests/test_integration_workflows.py | myron/MONAI | 6e7b2d6ad9688b0418eee21efeea196da2ad054f | [
"Apache-2.0"
] | 1 | 2021-07-13T00:34:41.000Z | 2021-07-13T00:34:41.000Z | tests/test_integration_workflows.py | myron/MONAI | 6e7b2d6ad9688b0418eee21efeea196da2ad054f | [
"Apache-2.0"
] | null | null | null | tests/test_integration_workflows.py | myron/MONAI | 6e7b2d6ad9688b0418eee21efeea196da2ad054f | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 37.653951 | 118 | 0.649975 |
2184c6cd6cf1b325ee2475fb64facae60b9b0578 | 419 | py | Python | tests/pipe_proc_tests/em.py | genematx/nmrglue | 8a24cf6cbd18451e552fc0673b84c42d1dcb69a2 | [
"BSD-3-Clause"
] | 150 | 2015-01-16T12:24:13.000Z | 2022-03-03T18:01:18.000Z | tests/pipe_proc_tests/em.py | genematx/nmrglue | 8a24cf6cbd18451e552fc0673b84c42d1dcb69a2 | [
"BSD-3-Clause"
] | 129 | 2015-01-13T04:58:56.000Z | 2022-03-02T13:39:16.000Z | tests/pipe_proc_tests/em.py | genematx/nmrglue | 8a24cf6cbd18451e552fc0673b84c42d1dcb69a2 | [
"BSD-3-Clause"
] | 88 | 2015-02-16T20:04:12.000Z | 2022-03-10T06:50:30.000Z | #! /usr/bin/env python
""" Create files for em unit test """
import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p
# EM Testing
d, a = pipe.read("time_complex.fid")
d, a = p.em(d, a, lb=40, c=0.5, start=100, size=750, one=True)
pipe.write("em1.glue", d, a, overwrite=True)
d, a = pipe.read("time_co... | 27.933333 | 62 | 0.663484 |
2184f6fd1b14a3662158c4033e7d8573f9a320d6 | 352 | py | Python | apps/user/permissions/user_profile.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 19 | 2017-09-13T07:51:58.000Z | 2022-03-28T11:04:03.000Z | apps/user/permissions/user_profile.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 147 | 2017-09-14T13:45:30.000Z | 2022-03-14T15:54:09.000Z | apps/user/permissions/user_profile.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 5 | 2019-08-31T13:13:30.000Z | 2021-03-26T15:46:38.000Z | from rest_framework import permissions
class UserProfilePermission(permissions.IsAuthenticated):
def has_object_permission(self, request, view, obj) -> bool:
if request.method == 'GET':
return super().has_object_permission(request, view, obj)
else:
return request.user.is_st... | 35.2 | 68 | 0.698864 |
2184f82bc4b5e92a5e06f24bd20c08bb307c9160 | 7,596 | py | Python | nVidiaModel.py | scrambleegg7/CarND-Behavioral-Cloning-P3 | 882a0ffbee1ff9d622514407aa313c93bc7df2d7 | [
"MIT"
] | null | null | null | nVidiaModel.py | scrambleegg7/CarND-Behavioral-Cloning-P3 | 882a0ffbee1ff9d622514407aa313c93bc7df2d7 | [
"MIT"
] | null | null | null | nVidiaModel.py | scrambleegg7/CarND-Behavioral-Cloning-P3 | 882a0ffbee1ff9d622514407aa313c93bc7df2d7 | [
"MIT"
] | null | null | null | #
# nVidiaModel
#
import keras
from keras.models import Sequential, Model
from keras.layers import Flatten, Dense, Lambda, Convolution2D, Cropping2D, Conv2D
from keras.layers import Dropout, Activation
from keras.regularizers import l2 # activity_l2
from keras.layers.pooling import MaxPooling2D
from keras.optimizers i... | 45.48503 | 148 | 0.595577 |
21850e21cc13f0b6bc6d261b1cf37504f149b1bd | 2,468 | py | Python | projects/DensePose/train_net.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | projects/DensePose/train_net.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | projects/DensePose/train_net.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
"""
DensePose Training Script.
This script is similar to the training script in detectron2/tools.
It is an example of how a user might use detectron2 for a new project.
"""
from datetime import timedelta
import detectron.utils.comm as comm
f... | 30.469136 | 99 | 0.712723 |
2185132cb8f1f75e0faea2ad8444dcb14abc563e | 5,081 | py | Python | pygfunction/examples/bore_field_thermal_resistance.py | wouterpeere/pygfunction | 6ac885b8b8a9532ed4aa2a748a0561a55ee515c2 | [
"BSD-3-Clause"
] | null | null | null | pygfunction/examples/bore_field_thermal_resistance.py | wouterpeere/pygfunction | 6ac885b8b8a9532ed4aa2a748a0561a55ee515c2 | [
"BSD-3-Clause"
] | 2 | 2021-04-10T05:17:18.000Z | 2021-08-10T22:08:54.000Z | pygfunction/examples/bore_field_thermal_resistance.py | j-c-cook/pygfunction | 73cb9292fc39a068bd3d4ebe66b07ec9c8903c8d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
""" Example of calculation of effective bore field thermal resistance.
The effective bore field thermal resistance of fields of up to 5 boreholes
of equal lengths connected in series is calculated for various fluid flow
rates.
"""
import matplotlib.pyplot as plt
import numpy as np
... | 35.284722 | 79 | 0.525881 |
21854cf16fa298f988af289296451f6dfb6620a6 | 3,645 | py | Python | FITS_tools/fits_overlap.py | keflavich/FITS_tools | 8816856ab16f461b2c711a2345254554fe358a96 | [
"BSD-3-Clause"
] | 9 | 2015-11-12T15:56:30.000Z | 2019-03-15T06:46:27.000Z | FITS_tools/fits_overlap.py | keflavich/FITS_tools | 8816856ab16f461b2c711a2345254554fe358a96 | [
"BSD-3-Clause"
] | 8 | 2015-11-24T19:12:52.000Z | 2021-05-14T19:17:48.000Z | FITS_tools/fits_overlap.py | keflavich/FITS_tools | 8816856ab16f461b2c711a2345254554fe358a96 | [
"BSD-3-Clause"
] | 7 | 2015-03-10T18:59:39.000Z | 2021-08-06T06:26:33.000Z | import numpy as np
try:
import astropy.io.fits as pyfits
import astropy.wcs as pywcs
except ImportError:
import pyfits
import pywcs
def fits_overlap(file1,file2,**kwargs):
"""
Create a header containing the exact overlap region between two .fits files
Does NOT check to make sure the FITS f... | 31.695652 | 137 | 0.61893 |
2185560fd12a7046cce4567e8c6fef2773480d55 | 33,381 | py | Python | filter_design/audiofilter.py | ZeroCommits/digital-signal-processing-lecture | e1e65432a5617a309ec02327a14962e37a0f7ec5 | [
"MIT"
] | 630 | 2016-01-05T17:11:43.000Z | 2022-03-30T07:48:27.000Z | filter_design/audiofilter.py | alirezaopmc/digital-signal-processing-lecture | e1e65432a5617a309ec02327a14962e37a0f7ec5 | [
"MIT"
] | 12 | 2016-11-07T15:49:55.000Z | 2022-03-10T13:05:50.000Z | filter_design/audiofilter.py | alirezaopmc/digital-signal-processing-lecture | e1e65432a5617a309ec02327a14962e37a0f7ec5 | [
"MIT"
] | 172 | 2015-12-26T21:05:40.000Z | 2022-03-10T23:13:30.000Z | """Routines to create filter coefficients and plot filters.
for 1st / 2nd order audio biquads
this code is included in the open educational resource
"Sascha Spors, Digital Signal Processing - Lecture notes featuring
computational examples"
hosted at
URL = ('https://github.com/spatialaudio/'
'digital-signal-pr... | 33.718182 | 79 | 0.550493 |
21855e7e5f9241dd1516c3c4ac896bc5dbfd7cf5 | 1,339 | py | Python | end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py | JamesHinshelwood/openapi-python-client | 08bc2acf91d50d4fcdd7f0e50a8b0d3f00a187d9 | [
"MIT"
] | 172 | 2020-02-15T20:14:16.000Z | 2021-06-09T07:09:15.000Z | end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py | guioliveirabh/openapi-python-client | d8d9cecffe41c5dc1c43bc667598b90f0d9253ca | [
"MIT"
] | 410 | 2020-02-15T19:39:29.000Z | 2021-06-09T19:28:57.000Z | end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py | guioliveirabh/openapi-python-client | d8d9cecffe41c5dc1c43bc667598b90f0d9253ca | [
"MIT"
] | 38 | 2020-04-12T09:36:27.000Z | 2021-06-11T08:57:07.000Z | from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.validation_error import ValidationError
from ..types import UNSET, Unset
T = TypeVar("T", bound="HTTPValidationError")
@attr.s(auto_attribs=True)
class HTTPValidationError:
"""
Attributes:
detail (Union[Unset, List[V... | 26.254902 | 69 | 0.613144 |
218576c459f14dd5134718d4cf08cd5c1ab17ba0 | 6,627 | py | Python | 2. Introduction to Python/Project/All_steps/print_results.py | fstigler/AI-Programming-with-Python---Udacity---Nanodegree- | 5264435ee57b41df6995a890731d6bcb64b09284 | [
"MIT"
] | 2 | 2021-08-04T08:59:43.000Z | 2021-11-24T11:28:47.000Z | 2. Introduction to Python/Project/All_steps/print_results.py | fstigler/AI-Programming-with-Python---Udacity---Nanodegree- | 5264435ee57b41df6995a890731d6bcb64b09284 | [
"MIT"
] | 2 | 2021-11-11T08:11:24.000Z | 2022-03-21T14:05:38.000Z | 2. Introduction to Python/Project/All_steps/print_results.py | fstigler/AI_Programming_with_Python_Udacity_Nanodegree- | 5264435ee57b41df6995a890731d6bcb64b09284 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# */AIPND-revision/intropyproject-classify-pet-images/print_results.py
#
# PROGRAMMER:
# DATE CREATED:
# REVISED DATE:
# PURPOSE: Create a function print_results that prints the results statisti... | 55.225 | 101 | 0.617021 |
21859aad4f63978bb050b6adcc13ef1b25f21e50 | 242 | py | Python | configs/segmentation/eval.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | 1 | 2022-03-19T11:52:53.000Z | 2022-03-19T11:52:53.000Z | configs/segmentation/eval.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | null | null | null | configs/segmentation/eval.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | 1 | 2022-03-19T11:53:10.000Z | 2022-03-19T11:53:10.000Z | import matplotlib as mpl
mpl.use("Agg")
from theseus.opt import Opts
from theseus.segmentation.pipeline import Pipeline
if __name__ == "__main__":
opts = Opts().parse_args()
val_pipeline = Pipeline(opts)
val_pipeline.evaluate()
| 22 | 50 | 0.739669 |
2185a6be299b600cb859ebdf33bd674d3e64d350 | 71 | py | Python | oscar/lib/python2.7/site-packages/dateutil/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/dateutil/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/dateutil/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from ._version import VERSION as __version__
| 23.666667 | 45 | 0.676056 |
2185af02a4b11429f768be9ca76aed0da51ac4e8 | 8,176 | py | Python | dl/step2/utils/visualization_utils.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | 3 | 2018-10-16T09:36:12.000Z | 2019-04-15T03:12:49.000Z | dl/step2/utils/visualization_utils.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | dl/step2/utils/visualization_utils.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.677419 | 117 | 0.662549 |
2185bb700152bfd31250488dd93539e8af4f115e | 633 | py | Python | LeetCode/easy - Binary Tree/101. Symmetric Tree/recursion.py | vincent507cpu/Comprehensive-Algorithm-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | 4 | 2020-06-26T00:45:53.000Z | 2021-04-19T12:23:32.000Z | LeetCode/easy - Binary Tree/101. Symmetric Tree/recursion.py | vincent507cpu/LeetCode-Comprehensive-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | null | null | null | LeetCode/easy - Binary Tree/101. Symmetric Tree/recursion.py | vincent507cpu/LeetCode-Comprehensive-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isSymmetric(self, root: TreeNode) -> bool:
def dfs(node1, node2):
if not node1 and n... | 35.166667 | 62 | 0.541864 |
2185cae8dd03e89f0b27077d94d58df4adf44761 | 2,049 | py | Python | yeoboseyo/services/localstorage.py | foxmask/yeoboseyo-django | 8dc1df9373f4fc27502aa9097e3724a87a2b8ce6 | [
"BSD-3-Clause"
] | 2 | 2020-11-18T08:18:17.000Z | 2021-02-27T13:17:20.000Z | yeoboseyo/services/localstorage.py | foxmask/yeoboseyo-django | 8dc1df9373f4fc27502aa9097e3724a87a2b8ce6 | [
"BSD-3-Clause"
] | null | null | null | yeoboseyo/services/localstorage.py | foxmask/yeoboseyo-django | 8dc1df9373f4fc27502aa9097e3724a87a2b8ce6 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
여보세요 Service LocalStorage
"""
# std lib
from __future__ import unicode_literals
from django.conf import settings
from logging import getLogger
from pathlib import Path
# external lib
from jinja2 import Environment, PackageLoader
from slugify import slugify
# yeoboseyo
from yeoboseyo.services impo... | 27.689189 | 70 | 0.600781 |
2185d391562abc2f45a9a0c1ad300920121c042e | 11,563 | py | Python | eth_enr/sqlite3_db.py | ethereum/eth-enr | 80bd08a3be09a6a1f6cc3145e44851e1e1bf71d9 | [
"MIT"
] | 4 | 2020-09-01T07:46:51.000Z | 2021-11-04T14:09:02.000Z | eth_enr/sqlite3_db.py | ethereum/eth-enr | 80bd08a3be09a6a1f6cc3145e44851e1e1bf71d9 | [
"MIT"
] | 9 | 2020-09-02T01:56:09.000Z | 2020-11-30T16:00:01.000Z | eth_enr/sqlite3_db.py | ethereum/eth-enr | 80bd08a3be09a6a1f6cc3145e44851e1e1bf71d9 | [
"MIT"
] | 6 | 2020-08-31T22:31:47.000Z | 2022-03-28T18:50:04.000Z | import datetime
import logging
import operator
import sqlite3
from typing import Collection, Iterable, NamedTuple, Optional, Sequence, Tuple, Union
from eth_typing import NodeID
import rlp
from rlp.exceptions import DecodingError, DeserializationError, SerializationError
from eth_enr.abc import ENRAPI
from eth_enr.en... | 29.724936 | 144 | 0.644469 |
2185d5401ecb08ae545bf5db4a21caa04b07473e | 949 | py | Python | sdks/python/test/test_ExternalUserRequest.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_ExternalUserRequest.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_ExternalUserRequest.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 23.725 | 97 | 0.726027 |
218613f1f62d66c8b4505c671bf33a77fa553ec6 | 502 | py | Python | process.py | abhishek4747/imagenet2010-devkit | 6ad756179dc2f85aec65ee5ed3a94ef17f351d81 | [
"MIT"
] | 2 | 2017-11-28T14:58:46.000Z | 2020-05-05T04:43:43.000Z | process.py | abhishek4747/imagenet2010-devkit | 6ad756179dc2f85aec65ee5ed3a94ef17f351d81 | [
"MIT"
] | null | null | null | process.py | abhishek4747/imagenet2010-devkit | 6ad756179dc2f85aec65ee5ed3a94ef17f351d81 | [
"MIT"
] | 2 | 2020-05-05T04:43:47.000Z | 2021-11-27T16:49:35.000Z | from subprocess import call
import os
folders = ["val","train"]
for f in folders:
if not os.path.exists('../b'+f):
os.makedirs('../b'+f)
for f in folders:
r = open(f+".txt").readlines();
b = open("b"+f+'.txt', 'w')
for line in r:
ll = line.split(' ')
infile = ll[0]
label = ll[1].strip()
outfile = infi... | 22.818182 | 72 | 0.587649 |
218646eb8621cbc64453b5356cb1f0ab2fa391f7 | 38,769 | py | Python | fairseq/dataclass/configs.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | null | null | null | fairseq/dataclass/configs.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | null | null | null | fairseq/dataclass/configs.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
from dataclasses import _MISSING_TYPE, dataclass, field
from typing import Any, List, Optional
import torch
from fairseq.dataclas... | 34.990072 | 236 | 0.608734 |
21867e18f34a9e9ed2f67377445f825a942952db | 582 | py | Python | setup.py | annagav/edx-analytics-data-api-client | d26891b53be18490aff4e2d38a5c80efbf00626f | [
"Apache-2.0"
] | null | null | null | setup.py | annagav/edx-analytics-data-api-client | d26891b53be18490aff4e2d38a5c80efbf00626f | [
"Apache-2.0"
] | null | null | null | setup.py | annagav/edx-analytics-data-api-client | d26891b53be18490aff4e2d38a5c80efbf00626f | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
from analyticsclient import __version__ as VERSION
setup(
name='edx-analytics-data-api-client',
version=VERSION,
packages=['analyticsclient', 'analyticsclient.constants'],
url='https://github.com/edx/edx-analytics-data-api-client',
description='Client used to access edX... | 25.304348 | 69 | 0.637457 |
2186a99b1335a43322966ee65a4306f3a8743e5b | 44,646 | py | Python | hdmf_docutils/doctools/renderrst.py | NeurodataWithoutBorders/nwb-docutils | 96d381e7e84f7c5c526c2e6d69ae110d8f2c52d6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | hdmf_docutils/doctools/renderrst.py | NeurodataWithoutBorders/nwb-docutils | 96d381e7e84f7c5c526c2e6d69ae110d8f2c52d6 | [
"BSD-3-Clause-LBNL"
] | 27 | 2018-04-05T16:19:19.000Z | 2019-11-19T21:00:50.000Z | hdmf_docutils/doctools/renderrst.py | NeurodataWithoutBorders/nwb-docutils | 96d381e7e84f7c5c526c2e6d69ae110d8f2c52d6 | [
"BSD-3-Clause-LBNL"
] | 2 | 2018-04-19T23:02:38.000Z | 2019-05-16T05:31:18.000Z | """
Module with helper functions to render hdfm.spec format specifications to
RST documents.
"""
from hdmf.spec import GroupSpec, DatasetSpec, LinkSpec, AttributeSpec, RefSpec
from .output import PrintHelper
from collections import OrderedDict
from .rst import RSTDocument, RSTTable, RSTSectionLabelHelper
import os
cl... | 52.835503 | 120 | 0.582673 |
2186dcdaa8148a4038a1ebf7f2e84a33973af8ca | 1,253 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36.852941 | 81 | 0.619314 |
2186fef5d77b127d192f02d8db187c35b8294be8 | 3,233 | py | Python | code/part_b/db5_ninapro/inceptionv3db5_test_partb1.py | DSIP-UPatras/sEMG-based-gesture-recognition-mgeorgoula | a5f8f234aebad671b38296730f46f0b637fadc64 | [
"MIT"
] | 3 | 2019-08-22T11:24:09.000Z | 2020-06-09T07:16:45.000Z | code/part_b/db5_ninapro/inceptionv3db5_test_partb1.py | DSIP-UPatras/sEMG-based-gesture-recognition-mgeorgoula | a5f8f234aebad671b38296730f46f0b637fadc64 | [
"MIT"
] | 1 | 2019-08-24T06:25:24.000Z | 2019-08-24T06:25:24.000Z | code/part_b/db5_ninapro/inceptionv3db5_test_partb1.py | DSIP-UPatras/sEMG-based-gesture-recognition-mgeorgoula | a5f8f234aebad671b38296730f46f0b637fadc64 | [
"MIT"
] | 1 | 2020-05-25T02:21:35.000Z | 2020-05-25T02:21:35.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
"""Make prediction and compute confusion matrix for modified input data"""
"""PART B1 : Zero electrode column of emg data"""
import numpy as np
import tensorflow as tf
import random
import os
os.environ['PYTHONHASHSEED'] = '0'
# The below is necessary... | 27.168067 | 93 | 0.716672 |
218709de679e2166f7bbffb7e2aaf89f775f23bb | 3,662 | py | Python | chargebee/models/hosted_page.py | cloudtruth/chargebee-python | d72c45f0ff32170fd7d03fcfbc7c4f2b3a379324 | [
"MIT"
] | null | null | null | chargebee/models/hosted_page.py | cloudtruth/chargebee-python | d72c45f0ff32170fd7d03fcfbc7c4f2b3a379324 | [
"MIT"
] | null | null | null | chargebee/models/hosted_page.py | cloudtruth/chargebee-python | d72c45f0ff32170fd7d03fcfbc7c4f2b3a379324 | [
"MIT"
] | null | null | null | import json
from chargebee.model import Model
from chargebee import request
from chargebee import APIError
class HostedPage(Model):
fields = ["id", "type", "url", "state", "failure_reason", "pass_thru_content", "embed", \
"created_at", "expires_at", "updated_at", "resource_version", "checkout_info"]
@pro... | 43.082353 | 121 | 0.711087 |
21871762e12c6e860e726919b2d4e0c6528bb9b7 | 8,391 | py | Python | sdk/servicebus/azure-servicebus/samples/sync_samples/topic_subscription_with_rule_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/servicebus/azure-servicebus/samples/sync_samples/topic_subscription_with_rule_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/servicebus/azure-servicebus/samples/sync_samples/topic_subscription_with_rule_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 47.676136 | 148 | 0.724348 |
21871fc3d5e3e755aff25be94b8806faa3b4b162 | 1,032 | py | Python | spectrum/handlers/base.py | SpectrumApp/spectrum-python | 773516af1f89547b4a7afe555615247d7e44a393 | [
"BSD-3-Clause"
] | 6 | 2015-11-06T14:46:12.000Z | 2020-01-25T10:28:42.000Z | spectrum/handlers/base.py | SpectrumApp/spectrum-python | 773516af1f89547b4a7afe555615247d7e44a393 | [
"BSD-3-Clause"
] | 7 | 2015-11-04T23:40:56.000Z | 2018-12-07T11:31:43.000Z | spectrum/handlers/base.py | SpectrumApp/spectrum-python | 773516af1f89547b4a7afe555615247d7e44a393 | [
"BSD-3-Clause"
] | 2 | 2015-11-04T16:56:38.000Z | 2016-04-17T23:10:26.000Z | import datetime
import logging
import traceback
import uuid
class BaseSpectrumHandler(logging.Handler):
def __init__(self, sublevel=None, *args, **kwargs):
self.sublevel = sublevel
if self.sublevel is None:
self.sublevel = 'None'
super(BaseSpectrumHandler, self).__init__(*arg... | 30.352941 | 99 | 0.603682 |
21873522958521f6132d27c9c31f0f254439f93b | 366 | py | Python | cm4/vbox/__init__.py | swsachith/cm | d99837917f0dafe60c25829cf78ae77bbe02bd85 | [
"Apache-2.0"
] | null | null | null | cm4/vbox/__init__.py | swsachith/cm | d99837917f0dafe60c25829cf78ae77bbe02bd85 | [
"Apache-2.0"
] | null | null | null | cm4/vbox/__init__.py | swsachith/cm | d99837917f0dafe60c25829cf78ae77bbe02bd85 | [
"Apache-2.0"
] | null | null | null | from cloudmesh.common.Shell import Shell
def version(verbose=False):
result = Shell.execute("vagrant", ["version"])
if verbose:
return result
else:
lines = result.split("\n")
for line in lines:
if "Installed Version:" in line:
return line.replace("Instal... | 28.153846 | 69 | 0.592896 |
218757059c0b990e31e6eb2d3295104b4fa29246 | 46 | py | Python | modules/templates/RLPPTM/models/__init__.py | nursix/DRKCM | 09328289ff721c416494398aa751ff99906327cb | [
"MIT"
] | 3 | 2022-01-26T08:07:54.000Z | 2022-03-21T21:53:52.000Z | modules/templates/RLPPTM/models/__init__.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | modules/templates/RLPPTM/models/__init__.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | DEFAULT = lambda: None
from . import disease
| 11.5 | 22 | 0.73913 |
2187579ef85dbb636cde2f926291be5f80012cbf | 722 | py | Python | django_redis_prometheus/cache/backends/locmem.py | Zagrebelin/django-redis-prometheus | 971a81f1cab91d62bca6223feb32506a764c246b | [
"Apache-2.0"
] | null | null | null | django_redis_prometheus/cache/backends/locmem.py | Zagrebelin/django-redis-prometheus | 971a81f1cab91d62bca6223feb32506a764c246b | [
"Apache-2.0"
] | null | null | null | django_redis_prometheus/cache/backends/locmem.py | Zagrebelin/django-redis-prometheus | 971a81f1cab91d62bca6223feb32506a764c246b | [
"Apache-2.0"
] | 1 | 2021-12-27T09:56:59.000Z | 2021-12-27T09:56:59.000Z | from django.core.cache.backends import locmem
from django_redis_prometheus.cache.metrics import (
django_cache_get_total,
django_cache_hits_total,
django_cache_misses_total)
class LocMemCache(locmem.LocMemCache):
"""Inherit filebased cache to add metrics about hit/miss ratio"""
def get(self, key... | 34.380952 | 69 | 0.702216 |
218759e5453a7b4b4354c1680d6ad596c7406509 | 5,341 | py | Python | agentnet/target_network/__init__.py | mraihan19/AgentNet | 240b7ac351d5c7a156a6c9c25432d5a7afffe3cc | [
"MIT"
] | 337 | 2016-04-20T09:34:06.000Z | 2022-03-23T10:09:15.000Z | agentnet/target_network/__init__.py | 17minutes/AgentNet | a0df28f6110f0e492240e0264f8ccce6cde18f99 | [
"MIT"
] | 58 | 2016-04-04T10:21:10.000Z | 2017-08-09T07:47:37.000Z | agentnet/target_network/__init__.py | 17minutes/AgentNet | a0df28f6110f0e492240e0264f8ccce6cde18f99 | [
"MIT"
] | 88 | 2016-04-28T01:18:11.000Z | 2021-12-05T02:48:28.000Z | """
Implements the target network techniques in deep reinforcement learning.
In short, the idea is to estimate reference Qvalues not from the current agent state, but
from an earlier snapshot of weights. This is done to decorrelate target and predicted Qvalues/state_values
and increase stability of learning algorithm.
... | 43.778689 | 119 | 0.698746 |
218773be2f4f82daf34f793079ed5d0ecab58091 | 2,571 | py | Python | waterbutler/providers/figshare/metadata.py | laurenrevere/waterbutler | 4f358d94376997cd9592b18b67d13a7482c7aa2a | [
"Apache-2.0"
] | null | null | null | waterbutler/providers/figshare/metadata.py | laurenrevere/waterbutler | 4f358d94376997cd9592b18b67d13a7482c7aa2a | [
"Apache-2.0"
] | null | null | null | waterbutler/providers/figshare/metadata.py | laurenrevere/waterbutler | 4f358d94376997cd9592b18b67d13a7482c7aa2a | [
"Apache-2.0"
] | null | null | null | from waterbutler.core import metadata
class BaseFigshareMetadata:
@property
def provider(self):
return 'figshare'
class FigshareFileMetadata(BaseFigshareMetadata, metadata.BaseMetadata):
def __init__(self, raw, parent, child):
super().__init__(raw)
self.parent = parent
... | 22.552632 | 111 | 0.567872 |
21879d7bbf6a064979a4bdcf35300f83ce2c0bb3 | 855 | py | Python | atom/nucleus/python/test/test_page_budget.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_page_budget.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_page_budget.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nu... | 20.853659 | 79 | 0.692398 |
2187ac747c4a1ceb7c1285ce5d077765d1873f78 | 138 | py | Python | utility/monitor.py | ab3llini/News2Title | 80b5117d5495890425ddeaddd77ef64624df5855 | [
"MIT"
] | null | null | null | utility/monitor.py | ab3llini/News2Title | 80b5117d5495890425ddeaddd77ef64624df5855 | [
"MIT"
] | null | null | null | utility/monitor.py | ab3llini/News2Title | 80b5117d5495890425ddeaddd77ef64624df5855 | [
"MIT"
] | 1 | 2019-11-04T01:17:40.000Z | 2019-11-04T01:17:40.000Z | import psutil
def available_ram():
vm = psutil.virtual_memory()
return 'Free RAM: %.1f/%.1f GB' % (vm[1] / 10**9, vm[0] / 10**9)
| 23 | 68 | 0.586957 |
2187e4efcdfa8b5a85c2ef60128a9ba90e858e54 | 4,187 | py | Python | NaoBot/RedisManager/__init__.py | TheVinhLuong102/BlocksBot | ad8bb17f43ca72ab4511189d0f2abd02dec5478c | [
"Apache-2.0"
] | 2 | 2020-09-05T00:08:27.000Z | 2021-11-03T08:17:52.000Z | NaoBot/RedisManager/__init__.py | TheVinhLuong102/BlocksBot | ad8bb17f43ca72ab4511189d0f2abd02dec5478c | [
"Apache-2.0"
] | null | null | null | NaoBot/RedisManager/__init__.py | TheVinhLuong102/BlocksBot | ad8bb17f43ca72ab4511189d0f2abd02dec5478c | [
"Apache-2.0"
] | 2 | 2020-05-19T16:48:17.000Z | 2020-09-05T00:08:29.000Z | # coding : utf-8
'''
Copyright 2020-2021 Agnese Salutari.
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 ... | 30.122302 | 115 | 0.658944 |
2187f4d5fc7781e8587cc81efe24da838565ff52 | 6,693 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_cluster_role_binding_list.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_cluster_role_binding_list.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_cluster_role_binding_list.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1bet... | 33.80303 | 295 | 0.629912 |
2188000f34a28c96076fd0cc5b5a5b0f2f35277b | 2,910 | py | Python | analysis/buffered_leave_one_out.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | analysis/buffered_leave_one_out.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | analysis/buffered_leave_one_out.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Buffered leave-one-out cross validation."""
import gc
import logging
import sys
import warnings
from pathlib import Path
import matplotlib as mpl
import numpy as np
from loguru import logger as loguru_logger
from empirical_fire_modelling.configuration import Experiment
from empirical_fire_m... | 29.393939 | 98 | 0.681443 |
21880662fe0db6b150be0fad5865323edba18848 | 3,997 | py | Python | alipay/aop/api/request/AlipayOpenSpBlueseaactivityModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayOpenSpBlueseaactivityModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayOpenSpBlueseaactivityModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayOpenSpBlueseaactivityModifyModel import AlipayOpenSpBlueseaactivityModifyModel
class AlipayOpenSpBlueseaactivityModifyRequest(... | 27.565517 | 148 | 0.646985 |
21880b5b7205df8f7f5f9e4b120fecf7944a3b3d | 135 | bzl | Python | bazel/pip.bzl | Saildrone/cantools | 06d6bd8527259ace31fdfa68812f1991bf1bcb5b | [
"MIT"
] | 1 | 2021-12-28T07:02:34.000Z | 2021-12-28T07:02:34.000Z | bazel/pip.bzl | Saildrone/cantools | 06d6bd8527259ace31fdfa68812f1991bf1bcb5b | [
"MIT"
] | 3 | 2020-05-05T21:45:16.000Z | 2021-01-09T01:25:57.000Z | bazel/pip.bzl | Saildrone/cantools | 06d6bd8527259ace31fdfa68812f1991bf1bcb5b | [
"MIT"
] | null | null | null | load("@cantools_py//:requirements.bzl", cantools_pip_install = "pip_install")
def cantools_pips(**kwargs):
cantools_pip_install()
| 27 | 77 | 0.762963 |
2188427a2d8bcff60dba614a0932e1b40de5b2a0 | 925 | py | Python | apps/core/models/signals/block.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 19 | 2017-09-13T07:51:58.000Z | 2022-03-28T11:04:03.000Z | apps/core/models/signals/block.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 147 | 2017-09-14T13:45:30.000Z | 2022-03-14T15:54:09.000Z | apps/core/models/signals/block.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 5 | 2019-08-31T13:13:30.000Z | 2021-03-26T15:46:38.000Z | import time
from django.db import models
from django.dispatch import receiver
from django.utils import timezone
from apps.core.models import Block
from ara import redis
@receiver(models.signals.post_save, sender=Block)
def block_post_save_signal(created, instance, **kwargs):
def add_block_to_redis(block):
... | 28.90625 | 87 | 0.712432 |
218857c99f6fea2b80abb3e7274f4939b78f84b6 | 1,986 | py | Python | tests/unit/states/artifactory_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | tests/unit/states/artifactory_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | tests/unit/states/artifactory_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
from... | 30.553846 | 80 | 0.61279 |
2188a0a62a2d739f53fd534070677834666acd6d | 678 | py | Python | testproject/testapp/urls.py | movermeyer/django-firestone | e045089f6ff4a6686633f9c5909c314a010bd4a0 | [
"WTFPL"
] | 1 | 2017-03-08T22:58:35.000Z | 2017-03-08T22:58:35.000Z | testproject/testapp/urls.py | movermeyer/django-firestone | e045089f6ff4a6686633f9c5909c314a010bd4a0 | [
"WTFPL"
] | null | null | null | testproject/testapp/urls.py | movermeyer/django-firestone | e045089f6ff4a6686633f9c5909c314a010bd4a0 | [
"WTFPL"
] | 1 | 2018-03-05T17:40:55.000Z | 2018-03-05T17:40:55.000Z | from django.conf.urls import *
from firestone.proxy import Proxy
from handlers import DataHandler
from handlers import UserHandlerSessionAuth
from handlers import UserHandlerNoAuth
from handlers import ContactHandlerSessionAuth
datahandler_proxy = Proxy(DataHandler)
userhandler_proxy = Proxy(UserHandlerSessionAuth, Us... | 30.818182 | 68 | 0.752212 |
2188d8790c2d45b00069449b6e660c7efbb8dde0 | 2,728 | py | Python | aries-cloudagent-python/aries_cloudagent/protocols/issue_credential/v2_0/handlers/cred_request_handler.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | null | null | null | aries-cloudagent-python/aries_cloudagent/protocols/issue_credential/v2_0/handlers/cred_request_handler.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | null | null | null | aries-cloudagent-python/aries_cloudagent/protocols/issue_credential/v2_0/handlers/cred_request_handler.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | 1 | 2022-02-02T17:05:27.000Z | 2022-02-02T17:05:27.000Z | """Credential request message handler."""
from .....indy.issuer import IndyIssuerError
from .....ledger.error import LedgerError
from .....messaging.base_handler import BaseHandler, HandlerException
from .....messaging.request_context import RequestContext
from .....messaging.responder import BaseResponder
from .....s... | 36.864865 | 86 | 0.640029 |
21893ee73489e2966539897dfd6d1b8897a9c064 | 9,754 | py | Python | sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_link_resources_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_link_resources_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_link_resources_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.51269 | 216 | 0.66096 |
2189541b89f096710aa5f9198ec7459e1e337476 | 26,734 | py | Python | efficientnet/autoaugment.py | KellyHwong/semi-conductor-image-classification-first | 2c718e26f66bfe169562c70bbc41872a9621d436 | [
"MIT"
] | 1 | 2021-03-31T10:24:01.000Z | 2021-03-31T10:24:01.000Z | efficientnet/autoaugment.py | AI-Huang/semi-conductor-image-classification-first | 2c718e26f66bfe169562c70bbc41872a9621d436 | [
"MIT"
] | 2 | 2020-11-13T18:41:41.000Z | 2021-01-28T10:55:38.000Z | efficientnet/autoaugment.py | KellyHwong/semi-conductor-image-classification-first | 2c718e26f66bfe169562c70bbc41872a9621d436 | [
"MIT"
] | 1 | 2020-12-27T15:10:58.000Z | 2020-12-27T15:10:58.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.285914 | 87 | 0.644984 |
2189623acd171a80e455390f3935a647dfcaa7bc | 4,052 | py | Python | alipay/aop/api/request/AntMerchantExpandIotdeviceOnlinedataUploadRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AntMerchantExpandIotdeviceOnlinedataUploadRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AntMerchantExpandIotdeviceOnlinedataUploadRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AntMerchantExpandIotdeviceOnlinedataUploadModel import AntMerchantExpandIotdeviceOnlinedataUploadModel
class AntMerchantExpandIotdev... | 27.944828 | 148 | 0.65153 |
2189684e73319a3d195e0e65d4f66b5109cf5fed | 9,850 | py | Python | catpy/usfos/geometry.py | svortega/catpy | b4d32f43662b291c64f02edda51f7116818b71bb | [
"MIT"
] | null | null | null | catpy/usfos/geometry.py | svortega/catpy | b4d32f43662b291c64f02edda51f7116818b71bb | [
"MIT"
] | null | null | null | catpy/usfos/geometry.py | svortega/catpy | b4d32f43662b291c64f02edda51f7116818b71bb | [
"MIT"
] | null | null | null | # Copyright (c) 2019 CatPy
# Python stdlib imports
from typing import NamedTuple, Dict
# package imports
from catpy.usfos.headers import print_head_line, print_EOF
from catpy.usfos.loading import print_gravity
#
#
class Nodes(NamedTuple):
"""nodes coordiantes"""
x:float
y:float
z:float
#number:... | 31.369427 | 112 | 0.50335 |
21897ccce7fd183ffeffe62a6547b84626de35cb | 1,053 | py | Python | archer_tools/remote/source.py | kylecribbs/archer_tools | f819035f4c87d14a40725fd42d1aa942676e291f | [
"MIT"
] | null | null | null | archer_tools/remote/source.py | kylecribbs/archer_tools | f819035f4c87d14a40725fd42d1aa942676e291f | [
"MIT"
] | 186 | 2020-09-16T09:42:50.000Z | 2022-03-31T10:45:26.000Z | archer_tools/remote/source.py | kylecribbs/archer_tools | f819035f4c87d14a40725fd42d1aa942676e291f | [
"MIT"
] | null | null | null | """Base Source Abstract Class."""
import logging
from abc import ABCMeta, abstractmethod
from typing import List
class Source(metaclass=ABCMeta):
"""Generic Source abstract class.
Attributes:
__source_schema__ (marshmallow.Schema): Schema for Source yaml config
__destination_schema... | 25.071429 | 78 | 0.586895 |
2189808a2ac02f477f1f34e608891356574e07d2 | 2,759 | py | Python | LSTM/run.py | patmbee/ml_project_2 | 077c3cfeac160e615692aaf77a82dcfbc6c534b1 | [
"MIT"
] | null | null | null | LSTM/run.py | patmbee/ml_project_2 | 077c3cfeac160e615692aaf77a82dcfbc6c534b1 | [
"MIT"
] | null | null | null | LSTM/run.py | patmbee/ml_project_2 | 077c3cfeac160e615692aaf77a82dcfbc6c534b1 | [
"MIT"
] | null | null | null | import os
import json
import time
import math
import matplotlib.pyplot as plt
from core.data_processor import DataLoader
from core.model import Model
def plot_results(predicted_data, true_data):
fig = plt.figure(facecolor='white')
ax = fig.add_subplot(111)
ax.plot(true_data, label='True Data')
plt.plo... | 32.081395 | 130 | 0.665096 |
2189af9df9086d4eb32354cf05e9e9ec5830d1fc | 944 | py | Python | hs_access_control/management/commands/groups_with_public_resources.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_access_control/management/commands/groups_with_public_resources.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_access_control/management/commands/groups_with_public_resources.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | """
This prints a list of groups possessing public resources and thus having a product page.
"""
from django.core.management.base import BaseCommand
from hs_access_control.models import GroupAccess
def usage():
print("groups_with_public_resources usage:")
print(" groups_with_public_resources ")
def short... | 23.02439 | 88 | 0.646186 |
218a1cca8815987a2ebdb1bbc5b062967df48847 | 3,433 | py | Python | setup.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | setup.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | setup.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from glob import glob
import os
from setuptools import setup, find_packages, Extension
from setuptools.command.install import install
from setuptools.command.develop import develop
import sys
from maro import __version__
# root path to backend
... | 26.206107 | 82 | 0.610545 |
218a97795c8b32c8f59bfe05e7764426ed4b9cf2 | 14,717 | py | Python | pydmrs/mapping/mapping.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 14 | 2015-11-27T14:22:26.000Z | 2022-03-02T21:11:28.000Z | pydmrs/mapping/mapping.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 25 | 2015-11-27T16:08:19.000Z | 2019-08-28T10:13:06.000Z | pydmrs/mapping/mapping.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 8 | 2015-11-01T17:57:44.000Z | 2021-06-04T05:33:38.000Z | import copy
from pydmrs._exceptions import PydmrsError
from pydmrs.components import Pred, RealPred, GPred, Sortinfo, EventSortinfo, InstanceSortinfo
from pydmrs.core import Link, Node
from pydmrs.matching.exact_matching import dmrs_exact_matching
class AnchorNode(Node):
"""
A DMRS graph node with an addition... | 48.411184 | 442 | 0.634368 |
218ab3e23707b7d28ece61e0fa48acdb443f0af6 | 1,316 | py | Python | marqeta/response_models/direct_deposit_transition_request.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 21 | 2019-04-12T09:02:17.000Z | 2022-02-18T11:39:06.000Z | marqeta/response_models/direct_deposit_transition_request.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 1 | 2020-07-22T21:27:40.000Z | 2020-07-23T17:38:43.000Z | marqeta/response_models/direct_deposit_transition_request.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 10 | 2019-05-08T14:20:37.000Z | 2021-09-20T18:09:26.000Z | from datetime import datetime, date
from marqeta.response_models import datetime_object
import json
import re
class DirectDepositTransitionRequest(object):
def __init__(self, json_response):
self.json_response = json_response
def __str__(self):
return json.dumps(self.json_response, default=se... | 23.5 | 125 | 0.690729 |
218abf2110bef10be840db6d3e18914e6594c9d3 | 1,109 | py | Python | python/make_clobber.py | geoflows/geoclaw-4.x | c8879d25405017b38392aa3b1ea422ff3e3604ea | [
"BSD-3-Clause"
] | 7 | 2016-11-13T03:11:51.000Z | 2021-09-07T18:59:48.000Z | python/make_clobber.py | che-wenchao/D-Claw | 8ab5d971c9a7a7130e03a447a4b8642e292f4e88 | [
"BSD-3-Clause"
] | 11 | 2020-01-14T18:00:37.000Z | 2022-03-29T14:25:24.000Z | python/make_clobber.py | che-wenchao/D-Claw | 8ab5d971c9a7a7130e03a447a4b8642e292f4e88 | [
"BSD-3-Clause"
] | 6 | 2020-01-14T17:15:42.000Z | 2021-12-03T17:28:44.000Z | """
Performs 'make clobber' in each subdirectory of the specified directory.
"""
import os,sys,glob
def make_clobber(rootdir):
if rootdir==[]:
# if called from command line with no argument
clawdir = os.path.expandvars('$CLAW')
rootdir = clawdir
else:
# called with an argum... | 25.790698 | 72 | 0.558161 |
218acaf315f8226a17fb38495ea8ee58ee5cc14c | 1,774 | py | Python | python/mincut.py | shauryachawla/misc | e50eb7c8979f9b3f7ecc43464cf7ccc91bf4d0bb | [
"MIT"
] | null | null | null | python/mincut.py | shauryachawla/misc | e50eb7c8979f9b3f7ecc43464cf7ccc91bf4d0bb | [
"MIT"
] | null | null | null | python/mincut.py | shauryachawla/misc | e50eb7c8979f9b3f7ecc43464cf7ccc91bf4d0bb | [
"MIT"
] | 1 | 2019-10-07T08:22:09.000Z | 2019-10-07T08:22:09.000Z | import random, sys, copy
'''
def mincut(al):
adj_list = copy.deepcopy(al)
while len(adj_list) > 2:
v1 = random.choice(list(adj_list.keys()))
v2 = random.choice(list(adj_list[v1].keys()))
for key in adj_list[v2].keys():
if key in adj_list[v1].keys():
adj_list... | 25.342857 | 57 | 0.517475 |
218acb5d259dabc9ee4b64c175e86bd290e18915 | 706 | py | Python | app/main/forms.py | KageniJK/blog | 6ee3557bbad53198efbab1ccd02a82f3fa3b9864 | [
"MIT"
] | null | null | null | app/main/forms.py | KageniJK/blog | 6ee3557bbad53198efbab1ccd02a82f3fa3b9864 | [
"MIT"
] | null | null | null | app/main/forms.py | KageniJK/blog | 6ee3557bbad53198efbab1ccd02a82f3fa3b9864 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import Required
class PostForm(FlaskForm):
title = StringField('Post title', validators=[Required()])
post = TextAreaField('Blog post')
submit = SubmitField('Submit')
class UpdateProfile(F... | 29.416667 | 80 | 0.733711 |
218ae2981addbf7faf5d32f6f5cda688704fffa0 | 10,464 | py | Python | adaptdl/adaptdl/torch/parallel.py | odp/adaptdl | 8a0ad47da91ab4b8f5e13c819cb4701a2ebe8ca8 | [
"Apache-2.0"
] | 294 | 2020-08-24T19:49:09.000Z | 2022-03-28T02:42:13.000Z | adaptdl/adaptdl/torch/parallel.py | odp/adaptdl | 8a0ad47da91ab4b8f5e13c819cb4701a2ebe8ca8 | [
"Apache-2.0"
] | 79 | 2020-09-01T00:44:25.000Z | 2022-03-23T07:52:22.000Z | adaptdl/adaptdl/torch/parallel.py | odp/adaptdl | 8a0ad47da91ab4b8f5e13c819cb4701a2ebe8ca8 | [
"Apache-2.0"
] | 41 | 2020-08-25T17:02:08.000Z | 2022-02-27T21:39:48.000Z | # Copyright 2020 Petuum, 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 applicable law or... | 44.909871 | 79 | 0.672878 |
218b3aa11fa020d5d1737d9aa0126268ecc2954d | 1,781 | py | Python | src/olympia/hero/migrations/0014_auto_20200717_1120.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/hero/migrations/0014_auto_20200717_1120.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/hero/migrations/0014_auto_20200717_1120.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | # Generated by Django 2.2.14 on 2020-07-17 11:20
from django.db import migrations, models
import django.db.models.deletion
import olympia.hero.models
from olympia.amo.decorators import use_primary_db
from olympia.constants.promoted import NOT_PROMOTED, RECOMMENDED
@use_primary_db
def add_promoted_for_each_recommend... | 36.346939 | 125 | 0.68557 |
218b47c533466afb2a5e12e7f4933038041b2c9a | 7,845 | py | Python | scrapli/response.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | scrapli/response.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | scrapli/response.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | """scrapli.response"""
from collections import UserList
from datetime import datetime
from io import TextIOWrapper
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from scrapli.exceptions import ScrapliCommandFailure
from scrapli.helper import _textfsm_get_template, genie_parse, textfsm_parse, ttp_pa... | 24.984076 | 100 | 0.573996 |
218b6ab476ba9025de635354ddd1e7065dda59cf | 230 | py | Python | example/metrics.py | nickvasko/DLTrainer | eec9a54172ab803f75eb4861143913aa29e219d0 | [
"MIT"
] | null | null | null | example/metrics.py | nickvasko/DLTrainer | eec9a54172ab803f75eb4861143913aa29e219d0 | [
"MIT"
] | null | null | null | example/metrics.py | nickvasko/DLTrainer | eec9a54172ab803f75eb4861143913aa29e219d0 | [
"MIT"
] | null | null | null |
def calculate_metrics(model_outputs, gold_labels=None):
model_outputs = (model_outputs > 0.5).float()
correct = (model_outputs == gold_labels).sum()
acc = correct / gold_labels.shape[0]
return {'acc': acc.item()}
| 32.857143 | 55 | 0.686957 |
218bad93da8c36e325ba9bbb5cdf03e675415dea | 2,394 | py | Python | custodian/cli/run_nwchem.py | acrutt/custodian | 4d7cfecef0957bc8c2a6ec0cd24dd5855a6e7408 | [
"MIT"
] | null | null | null | custodian/cli/run_nwchem.py | acrutt/custodian | 4d7cfecef0957bc8c2a6ec0cd24dd5855a6e7408 | [
"MIT"
] | null | null | null | custodian/cli/run_nwchem.py | acrutt/custodian | 4d7cfecef0957bc8c2a6ec0cd24dd5855a6e7408 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Basic script to run nwchem job.
"""
from __future__ import division
__author__ = "shyuepingong"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__status__ = "Beta"
__date__ = "6/18/13"
import logging
from custodian.custodian import Custodian
from custo... | 30.303797 | 77 | 0.61863 |
218c0107a5a3190f0966333b63b31bd728fda1c3 | 14,610 | py | Python | tests/test_query_model_catalog_dev.py | KnowledgeCaptureAndDiscovery/OBA_sparql | 9c1c28902ab3d6561b3b6a0f8a7d284688d86326 | [
"Apache-2.0"
] | 5 | 2020-05-12T22:00:16.000Z | 2021-11-08T22:16:11.000Z | tests/test_query_model_catalog_dev.py | KnowledgeCaptureAndDiscovery/OBA_sparql | 9c1c28902ab3d6561b3b6a0f8a7d284688d86326 | [
"Apache-2.0"
] | 24 | 2019-09-26T23:20:11.000Z | 2022-01-14T14:19:14.000Z | tests/test_query_model_catalog_dev.py | KnowledgeCaptureAndDiscovery/OBA_sparql | 9c1c28902ab3d6561b3b6a0f8a7d284688d86326 | [
"Apache-2.0"
] | 1 | 2021-12-01T14:56:09.000Z | 2021-12-01T14:56:09.000Z | import unittest
import json
from typing import Dict
from obasparql import QueryManager
from obasparql.static import QUERY_TYPE_GET_ALL_USER, QUERY_TYPE_GET_ONE_USER
from tests.settings import model_catalog_queries_dev, model_catalog_context_dev, model_catalog_endpoint_dev, \
model_catalog_graph_base_dev, model_cat... | 36.343284 | 162 | 0.527789 |
218c0aad84a16fc4c3bd87f795cbc0ede835d214 | 899 | py | Python | pythia/Main.py | 5sigmapoint2/pythiaparser | 7ffbbe3460b62052fc3976bf26093a2bdb9297a7 | [
"MIT"
] | null | null | null | pythia/Main.py | 5sigmapoint2/pythiaparser | 7ffbbe3460b62052fc3976bf26093a2bdb9297a7 | [
"MIT"
] | null | null | null | pythia/Main.py | 5sigmapoint2/pythiaparser | 7ffbbe3460b62052fc3976bf26093a2bdb9297a7 | [
"MIT"
] | null | null | null | import time
import unittest
from pythia.Adapter import python_adapter
class TestAdapter(unittest.TestCase):
def testPingFunction(self):
self.assertEqual(
"['r', [3, 'long string', [5, 67, 8], -9.0]]",
python_adapter("['Pythia.ping', 3, 'long string', [5,67,8], -9.0]")
)
... | 24.972222 | 79 | 0.550612 |
218c165bdc526f3236e5893e919367ab09340572 | 842 | gyp | Python | ui/gfx/ipc/gfx_ipc.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | ui/gfx/ipc/gfx_ipc.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ui/gfx/ipc/gfx_ipc.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright 2014 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.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
# GN version: //ui/gfx/ipc
'target_name': 'gfx_ipc',
'type': '<(compo... | 23.388889 | 72 | 0.515439 |
218c19094afe2d3171e48747895cdd9ac2e359ba | 3,427 | py | Python | loaner/web_app/backend/lib/action_loader.py | riking/loaner | c131ee3ed543c018a0e039ae437fb8e83a912177 | [
"Apache-2.0"
] | null | null | null | loaner/web_app/backend/lib/action_loader.py | riking/loaner | c131ee3ed543c018a0e039ae437fb8e83a912177 | [
"Apache-2.0"
] | null | null | null | loaner/web_app/backend/lib/action_loader.py | riking/loaner | c131ee3ed543c018a0e039ae437fb8e83a912177 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.25 | 80 | 0.720163 |
218c5bd23069787fd0a0ecd1481481b4eadd114c | 4,606 | py | Python | RareVariants/Worker.py | afif-elghraoui/CorrelatedVariants | 4fc6722c78c9a03ad44a7d2f737ccece64d22c35 | [
"BSD-3-Clause"
] | null | null | null | RareVariants/Worker.py | afif-elghraoui/CorrelatedVariants | 4fc6722c78c9a03ad44a7d2f737ccece64d22c35 | [
"BSD-3-Clause"
] | null | null | null | RareVariants/Worker.py | afif-elghraoui/CorrelatedVariants | 4fc6722c78c9a03ad44a7d2f737ccece64d22c35 | [
"BSD-3-Clause"
] | null | null | null | #################################################################################
# Copyright (c) 2011-2013, Pacific Biosciences of California, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are me... | 38.705882 | 85 | 0.642423 |
218c89184d758f4e02ba9a128e4916651bb31512 | 88 | py | Python | oscar/lib/python2.7/site-packages/faker/providers/color/en_US/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/color/en_US/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/color/en_US/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from .. import Provider as ColorProvider
class Provider(ColorProvider):
pass
| 14.666667 | 41 | 0.715909 |
218cba5858d48c443d013ff45568b5ab0fbddaf2 | 3,492 | py | Python | clientsender.py | shintoo/DailyImage | 98790671ab927c8116247c99d209b93f9f0dd654 | [
"MIT"
] | null | null | null | clientsender.py | shintoo/DailyImage | 98790671ab927c8116247c99d209b93f9f0dd654 | [
"MIT"
] | null | null | null | clientsender.py | shintoo/DailyImage | 98790671ab927c8116247c99d209b93f9f0dd654 | [
"MIT"
] | null | null | null | #/usr/bin/python
# senderclient.py - this file is part of dailyimage
# Log in and send emails to clients
import sys # argv, exit
import smtplib # for email ...
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.mime.image import MIMEImage
from... | 33.257143 | 95 | 0.583333 |
218ccd4b16eec17583b349b76ac8e37422a7e7a3 | 5,305 | py | Python | wienerschnitzelgemeinschaft/src/shai/fastai/tools/load_external_data.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | wienerschnitzelgemeinschaft/src/shai/fastai/tools/load_external_data.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | wienerschnitzelgemeinschaft/src/shai/fastai/tools/load_external_data.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | import requests
import pandas as pd
from bs4 import BeautifulSoup
import numpy as np
import re
import os
from PIL import Image
import requests
from io import BytesIO
from joblib import Parallel, delayed
from glob import glob
from tqdm import tqdm_notebook
from itertools import chain
from collections import Counter
fr... | 28.521505 | 113 | 0.592648 |
218ce2fe60f109195fc5e921ba528e451cd2e764 | 55 | py | Python | src/test_project/test_app_1/__init__.py | davidslusser/django-signalcontrol | 800687c4f806837df35f4754aa2def7a0359853f | [
"Apache-2.0"
] | 2 | 2020-11-01T16:39:08.000Z | 2021-02-08T13:14:45.000Z | src/test_project/test_app_1/__init__.py | davidslusser/django-signalcontrol | 800687c4f806837df35f4754aa2def7a0359853f | [
"Apache-2.0"
] | null | null | null | src/test_project/test_app_1/__init__.py | davidslusser/django-signalcontrol | 800687c4f806837df35f4754aa2def7a0359853f | [
"Apache-2.0"
] | null | null | null |
default_app_config = 'test_app_1.apps.TestApp1Config'
| 18.333333 | 53 | 0.836364 |
218cef44155024d20205211bb086308cbb1abddf | 3,177 | py | Python | src/ggrc/utils/structures.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-03-30T11:28:48.000Z | 2018-03-30T11:28:48.000Z | src/ggrc/utils/structures.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc/utils/structures.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Collection if ggrc specific structures."""
import collections
class CaseInsensitiveDict(collections.MutableMapping):
"""Case insensitive default dict implementation.
This is a modification of requ... | 30.257143 | 79 | 0.700661 |
218cfcea758c15f8f5c9758412b99013f79ce85f | 2,210 | py | Python | test/test_task.py | leannmak/sakura | 22e3ceec7adebd01ba9056d1686182bdbe586eae | [
"MIT"
] | null | null | null | test/test_task.py | leannmak/sakura | 22e3ceec7adebd01ba9056d1686182bdbe586eae | [
"MIT"
] | null | null | null | test/test_task.py | leannmak/sakura | 22e3ceec7adebd01ba9056d1686182bdbe586eae | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Leann Mak, leannmak@139.com, (c) 2018.
# This is the autotest cases for task module.
#
import sys
sys.path.append('.')
import os
from nose.tools import with_setup, eq_
from mock import patch, Mock
from celery import Task
from sakura import app, config_a... | 30.273973 | 79 | 0.515385 |
218d32f49b8b88932ccb9eced4863da04f368418 | 4,232 | py | Python | src/backoffice/views/content.py | bornhack/bornhack-website | 40ed0875f5129a4c8ae1887e33e7dedb4981dadc | [
"BSD-3-Clause"
] | 7 | 2017-04-14T15:28:29.000Z | 2021-09-10T09:45:38.000Z | src/backoffice/views/content.py | bornhack/bornhack-website | 40ed0875f5129a4c8ae1887e33e7dedb4981dadc | [
"BSD-3-Clause"
] | 799 | 2016-04-28T09:31:50.000Z | 2022-03-29T09:05:02.000Z | src/backoffice/views/content.py | bornhack/bornhack-website | 40ed0875f5129a4c8ae1887e33e7dedb4981dadc | [
"BSD-3-Clause"
] | 35 | 2016-04-28T09:23:53.000Z | 2021-05-02T12:36:01.000Z | import logging
from django.contrib import messages
from django.forms import modelformset_factory
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic.edit import FormView
from camps.mixins import CampViewMixin
from program.models import Event, EventFeedback, Url, UrlType
fr... | 34.406504 | 102 | 0.636815 |
218d3eaeb7ea5aa2ef64e1f8b7c1b2f6bbdac252 | 2,473 | py | Python | datasets/mnist.py | e-hulten/maf | 2c0604ac8573ab14a6bc83dd51827d47a4266a96 | [
"MIT"
] | 12 | 2020-02-29T11:42:27.000Z | 2021-12-08T04:09:21.000Z | datasets/mnist.py | e-hulten/maf | 2c0604ac8573ab14a6bc83dd51827d47a4266a96 | [
"MIT"
] | 1 | 2021-01-22T07:02:22.000Z | 2021-01-22T07:02:22.000Z | datasets/mnist.py | e-hulten/maf | 2c0604ac8573ab14a6bc83dd51827d47a4266a96 | [
"MIT"
] | null | null | null | import torch
import torch.utils.data
import numpy as np
import gzip
import pickle
import matplotlib.pyplot as plt
import seaborn as sns
"""
This is a version of: https://github.com/gpapamak/maf/blob/master/datasets/mnist.py,
adapted to work with Python 3.x and PyTorch.
"""
batch_size = 100
class MNISTDataset:
... | 28.102273 | 85 | 0.567732 |
218d4ae1cab5b38ae1c94f4fab24057619a82bc1 | 445 | py | Python | binarysearch.io/remove_duplicate_numbers.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | binarysearch.io/remove_duplicate_numbers.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | binarysearch.io/remove_duplicate_numbers.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | class Solution:
def solve(self, nums):
# Write your code here
k = dict()
j = 0
new_nums = []
for i in nums:
if i not in k:
k[i] = 0
k[i] += 1
for i in nums:
if k[i] == 1:
new_nums.append(i)
... | 20.227273 | 34 | 0.292135 |
218d5dbe4a65f1259fd59f1dffd5124a2f70e60a | 344 | py | Python | syft/frameworks/torch/tensors/interpreters/__init__.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | 1 | 2019-07-09T09:57:23.000Z | 2019-07-09T09:57:23.000Z | syft/frameworks/torch/tensors/interpreters/__init__.py | souravs17031999/PySyft | cd0a134288ab041884537b04eb65358c4d53a471 | [
"Apache-2.0"
] | null | null | null | syft/frameworks/torch/tensors/interpreters/__init__.py | souravs17031999/PySyft | cd0a134288ab041884537b04eb65358c4d53a471 | [
"Apache-2.0"
] | 1 | 2021-04-18T15:27:15.000Z | 2021-04-18T15:27:15.000Z | from .native import TorchTensor # noqa: F401
from .precision import FixedPrecisionTensor # noqa: F401
from .additive_shared import AdditiveSharingTensor # noqa: F401
from .crt_precision import CRTPrecisionTensor # noqa: F401
from .large_precision import LargePrecisionTensor # noqa: F401
from .autograd import Autog... | 49.142857 | 64 | 0.80814 |
218d8e2910387226505ef85b9f0bcefc1939728c | 764 | py | Python | xschem/bandgap_opamp/test/bandgap_bmr_test_op.py | yrrapt/caravel_amsat_txrx_ic | 53bef4537447a623f93772092daeac67c4cb3d45 | [
"Apache-2.0"
] | 15 | 2020-12-13T12:33:15.000Z | 2022-02-17T18:09:25.000Z | xschem/bandgap_opamp/test/bandgap_bmr_test_op.py | yrrapt/caravel_amsat_txrx_ic | 53bef4537447a623f93772092daeac67c4cb3d45 | [
"Apache-2.0"
] | null | null | null | xschem/bandgap_opamp/test/bandgap_bmr_test_op.py | yrrapt/caravel_amsat_txrx_ic | 53bef4537447a623f93772092daeac67c4cb3d45 | [
"Apache-2.0"
] | 6 | 2021-01-02T05:52:21.000Z | 2022-03-28T06:55:07.000Z | import SpiceInterface
import TestUtilities
# create the test utility object
test_utilities_obj = TestUtilities.TestUtilities()
test_utilities_obj.netlist_generation('bandgap_opamp_test_op.sch', 'rundir')
# create the spice interface
spice_interface_obj = SpiceInterface.SpiceInterface(netlist_path="rundir/bandgap_opa... | 28.296296 | 102 | 0.789267 |
218db8ef54334b53aa543f08869afe57ef900918 | 6,780 | py | Python | WQ_tools/nwdmFunctions.py | lkschn/WQ_tools | 15c9a290794f00dc2b10b7b261a744bb11cdb9cb | [
"MIT"
] | null | null | null | WQ_tools/nwdmFunctions.py | lkschn/WQ_tools | 15c9a290794f00dc2b10b7b261a744bb11cdb9cb | [
"MIT"
] | null | null | null | WQ_tools/nwdmFunctions.py | lkschn/WQ_tools | 15c9a290794f00dc2b10b7b261a744bb11cdb9cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 10 09:46:54 2022
@author: linde_ae
"""
# load packages
# -----------------------------------------------------------------------------
import io
import pandas as pd
import urllib
import requests
from requests.auth import HTTPBasicAuth
from shapely.geometry import Point
... | 34.591837 | 137 | 0.561209 |
218dbe2185927e41f8940d6bf4515ee97dd2bb9f | 5,224 | py | Python | tests/integration/states/virtualenv.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 1 | 2018-02-03T17:30:56.000Z | 2018-02-03T17:30:56.000Z | tests/integration/states/virtualenv.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | tests/integration/states/virtualenv.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2012-2013 by the SaltStack Team, see AUTHORS for more details
:license: Apache 2.0, see LICENSE for more details.
tests.integration.states.virtualenv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import... | 36.027586 | 85 | 0.600115 |
218dd2c7f44d8dae510a23cbc61b3badb91762c2 | 940 | py | Python | tests/algorithms/test_hamming.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | tests/algorithms/test_hamming.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | tests/algorithms/test_hamming.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | import unittest
from algorithms.hamming import distance
class HammingTest(unittest.TestCase):
def test_no_difference_between_identical_strands(self):
self.assertEqual(0, distance('A', 'A'))
def test_complete_hamming_distance_of_for_single_nucleotide_strand(self):
self.assertEqual(1, distanc... | 29.375 | 77 | 0.724468 |
218deb574352db0ac5da55159f191fbb1ddab103 | 7,340 | py | Python | wtfml/engine/engine.py | Mo5mami/wtfml | afddec88d9c3a94e30ab2897525daf3f5cf8b774 | [
"MIT"
] | null | null | null | wtfml/engine/engine.py | Mo5mami/wtfml | afddec88d9c3a94e30ab2897525daf3f5cf8b774 | [
"MIT"
] | null | null | null | wtfml/engine/engine.py | Mo5mami/wtfml | afddec88d9c3a94e30ab2897525daf3f5cf8b774 | [
"MIT"
] | null | null | null | """
__author__: Abhishek Thakur
"""
import datetime
import torch
from tqdm.notebook import tqdm
from ..utils import AverageMeter
try:
from torch.cuda import amp
_amp_available = True
except ImportError:
_amp_available = False
try:
import torch_xla.core.xla_model as xm
import torch_xla.distributed... | 35.458937 | 111 | 0.518937 |
218df16e615ae75342909b7c61535ee6f397d64a | 814 | py | Python | demos/main_commands_os.system.py | taskcontrols/py-taskcontrols | 0f3f8d64cafc77dfbf23e70b0c86a91fea858ce4 | [
"MIT"
] | 1 | 2021-12-11T03:25:02.000Z | 2021-12-11T03:25:02.000Z | demos/main_commands_os.system.py | taskcontrols/py-taskcontrols | 0f3f8d64cafc77dfbf23e70b0c86a91fea858ce4 | [
"MIT"
] | 14 | 2021-11-26T15:18:05.000Z | 2021-12-12T03:05:31.000Z | demos/main_commands_os.system.py | taskcontrols/py-taskcontrols | 0f3f8d64cafc77dfbf23e70b0c86a91fea858ce4 | [
"MIT"
] | 1 | 2021-11-26T15:05:52.000Z | 2021-11-26T15:05:52.000Z |
from taskcontrol.lib import CommandsBase
c = CommandsBase()
# cmd = ["ssh", "-i", "./developers.pem", "user@192.168.0.1"]
# Comment following line out and change above cmd with your details or commands
from ctests import cmd
if cmd:
command = cmd.pop(0)
# # Access the resulting process after th... | 31.307692 | 127 | 0.669533 |
218e312c42ec392fede82d31ef96961df3e4e11e | 8,040 | py | Python | multiphenotype_utils.py | epierson9/multiphenotype_methods | 0cd350628c5e7a5dec9d50d160003a4db9062e6e | [
"MIT"
] | 4 | 2017-11-09T23:00:07.000Z | 2021-03-30T13:37:37.000Z | multiphenotype_utils.py | epierson9/multiphenotype_methods | 0cd350628c5e7a5dec9d50d160003a4db9062e6e | [
"MIT"
] | 1 | 2018-03-21T23:53:41.000Z | 2018-03-21T23:53:41.000Z | multiphenotype_utils.py | epierson9/multiphenotype_methods | 0cd350628c5e7a5dec9d50d160003a4db9062e6e | [
"MIT"
] | 4 | 2017-11-21T21:05:07.000Z | 2020-06-06T00:29:37.000Z | import pandas as pd
import numpy as np
import copy, math, random
import matplotlib.pyplot as plt
from scipy.stats import spearmanr, pearsonr
from scipy.cluster.hierarchy import linkage, dendrogram, fcluster
from scipy.spatial.distance import squareform
def move_last_col_to_first(df):
cols = df.columns.tolist()
... | 39.029126 | 154 | 0.664552 |
218e59f69339cabee1476e0e5e2811aa839b4f51 | 620 | py | Python | tests/megawing/spartan6/ram/_ram64.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 14 | 2017-10-08T09:16:10.000Z | 2021-11-27T19:12:24.000Z | tests/megawing/spartan6/ram/_ram64.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 7 | 2018-04-12T21:33:49.000Z | 2018-08-21T22:14:20.000Z | tests/megawing/spartan6/ram/_ram64.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 3 | 2018-07-24T04:55:02.000Z | 2019-12-30T08:12:39.000Z | import sys
from magma import *
from mantle.xilinx.spartan6.RAM import RAM64
from loam.shields.megawing import MegaWing
def bit(n):
return n * [0] + n * [1]
megawing = MegaWing()
megawing.Clock.on()
megawing.Switch.on(8)
megawing.LED.on(4)
main = megawing.main()
ram0 = RAM64(32 * bit(1))
ram1 = RAM64(16 * bit(2)... | 20 | 44 | 0.659677 |
218e5be0b8de21a3d5fe7150c5c42e304cf6c02f | 1,122 | py | Python | aoc-2019/day-16/day_16.py | bsamseth/advent-of-code-2018 | bdd3969e61fac3f1543c20983260aa9fda912e99 | [
"MIT"
] | 1 | 2021-01-03T17:09:13.000Z | 2021-01-03T17:09:13.000Z | aoc-2019/day-16/day_16.py | bsamseth/advent-of-code-2018 | bdd3969e61fac3f1543c20983260aa9fda912e99 | [
"MIT"
] | 3 | 2021-06-01T23:09:26.000Z | 2022-03-12T01:08:40.000Z | aoc-2019/day-16/day_16.py | bsamseth/advent-of-code | 65d40548057a86b6fda37aec8e7d5d473d627124 | [
"MIT"
] | null | null | null | import numpy as np
from numba import njit
def get_matrix(n):
pattern = np.array([0, 1, 0, -1])
matrix = np.zeros((n, n), dtype=int)
for i in range(n):
matrix[i] = np.roll(
np.tile(np.repeat(pattern, i + 1), n // (pattern.size * (i + 1)) + 1), -1
)[:n]
return matrix
def it... | 24.933333 | 85 | 0.574866 |
218e6e1f648c82e391c10f060f361ac2c9182569 | 4,441 | py | Python | scripts/configuration_generator.py | DavidNemeskey/emLam | 89359e7eee5b7b9c596dec8ab6654591d4039e3e | [
"MIT"
] | 2 | 2018-03-31T10:00:11.000Z | 2018-09-15T19:38:19.000Z | scripts/configuration_generator.py | DavidNemeskey/emLam | 89359e7eee5b7b9c596dec8ab6654591d4039e3e | [
"MIT"
] | 16 | 2017-02-28T13:58:28.000Z | 2018-03-14T11:42:01.000Z | scripts/configuration_generator.py | dlt-rilmta/emLam | 2b7274dcda4080445698e10b34a3db2e2eed5112 | [
"MIT"
] | 1 | 2017-01-30T15:06:37.000Z | 2017-01-30T15:06:37.000Z | #!/usr/bin/env python3
# vim: set fileencoding=utf-8 :
"""
Configuration file generator for the other scripts. Useful for experiments.
"""
from __future__ import absolute_import, division, print_function
from argparse import ArgumentParser
from builtins import str as text
from itertools import product
from operator i... | 37.319328 | 80 | 0.615177 |
218e6f0cd4ecdc206970f6b873bcc5d746dc86a8 | 14,230 | py | Python | post_quant_analysis/methods/epistasis.py | WormLabCaltech/alaska | 968475b77718263b7af2fd098b23c3e7cfa40546 | [
"MIT"
] | 6 | 2019-01-23T04:04:17.000Z | 2021-02-17T04:11:49.000Z | post_quant_analysis/methods/epistasis.py | WormLabCaltech/alaska | 968475b77718263b7af2fd098b23c3e7cfa40546 | [
"MIT"
] | 22 | 2018-10-30T03:28:53.000Z | 2020-01-28T07:56:57.000Z | post_quant_analysis/methods/epistasis.py | WormLabCaltech/alaska | 968475b77718263b7af2fd098b23c3e7cfa40546 | [
"MIT"
] | null | null | null | """
A script that contains useful functions to do RNA-seq epistasis analysis.
author: David Angeles-Albores
contact: davidaalbores@gmail.com
"""
import pandas as pd
import numpy as np
import copy
import scipy.odr as odr
# Graphics
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
# labe... | 35.222772 | 79 | 0.499719 |
218e791a6c2753d75ebc750ef4922d2d6da01009 | 241 | py | Python | sketch/drawing/utils.py | shrredd/sketch | eebcd5077ae355f914bc77ac44d06410f9caa132 | [
"MIT",
"Unlicense"
] | 2 | 2018-10-22T12:43:51.000Z | 2018-12-02T02:41:55.000Z | sketch/drawing/utils.py | shrredd/sketch | eebcd5077ae355f914bc77ac44d06410f9caa132 | [
"MIT",
"Unlicense"
] | null | null | null | sketch/drawing/utils.py | shrredd/sketch | eebcd5077ae355f914bc77ac44d06410f9caa132 | [
"MIT",
"Unlicense"
] | null | null | null | def htmlcolor_to_rgb(string):
if not (string.startswith('#') and len(string) == 7):
raise ValueError("Bad html color format. Expected: '#RRGGBB' ")
return [1.0*int(n, 16)/255 for n in (string[:2], string[2:4], string[4:])]
| 34.428571 | 78 | 0.626556 |
218e7ec1bb1d4fb24167444067e2f68fd0b05eae | 18 | py | Python | btd6_memory_info/generated/UnityEngine/Profiling/Memory/memory.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/Profiling/Memory/memory.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/Profiling/Memory/memory.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Memory: pass | 18 | 18 | 0.833333 |
218e818754fbd6321473d4133bc21cd65dcffcd1 | 1,013 | py | Python | detorch/config.py | goktug97/de-torch | 85195ca70a5f811ee75c91426a4c7b3cf0601f08 | [
"MIT"
] | 4 | 2021-05-13T15:42:47.000Z | 2021-05-14T10:49:42.000Z | detorch/config.py | goktug97/de-torch | 85195ca70a5f811ee75c91426a4c7b3cf0601f08 | [
"MIT"
] | 1 | 2022-02-16T17:23:03.000Z | 2022-02-17T13:10:37.000Z | detorch/config.py | goktug97/de-torch | 85195ca70a5f811ee75c91426a4c7b3cf0601f08 | [
"MIT"
] | 1 | 2021-12-23T18:28:12.000Z | 2021-12-23T18:28:12.000Z | from typing import Optional, Type, Callable, Any, Union, Tuple
import torch
from .de import Policy, DE, Strategy
from .dataclass_config import *
default_config = Config()
@default_config('policy')
class PolicyConfig():
"""**name: policy**
:ivar Required[Type[Policy]] policy: torch.nn.Module with a rollou... | 25.974359 | 87 | 0.695953 |
218eda6482e6e69b06cb1076de93d95657f507bd | 700 | py | Python | db.py | gpuma/chani | 7940f6aa511c62334facc7266802eb0aa58cc45a | [
"Apache-2.0"
] | null | null | null | db.py | gpuma/chani | 7940f6aa511c62334facc7266802eb0aa58cc45a | [
"Apache-2.0"
] | null | null | null | db.py | gpuma/chani | 7940f6aa511c62334facc7266802eb0aa58cc45a | [
"Apache-2.0"
] | null | null | null | import pymongo
from PriceItem import PriceItem
connection = pymongo.MongoClient("mongodb://localhost")
db = connection.chani
#todo: might need to refactor the name of this collection
items=db.items
def get_items(query={}):
"""returns all documents in 'items' collection
as a list of PriceItem objects in ascend... | 30.434783 | 110 | 0.684286 |
218edbcd071c3672fe626c5fba15757e9679bc43 | 287 | py | Python | thursday_dl/path.py | trungnt13/uef-summerschool2018 | 8ddf8297ab67bef991468fe40c556c18a2d620bb | [
"MIT"
] | null | null | null | thursday_dl/path.py | trungnt13/uef-summerschool2018 | 8ddf8297ab67bef991468fe40c556c18a2d620bb | [
"MIT"
] | null | null | null | thursday_dl/path.py | trungnt13/uef-summerschool2018 | 8ddf8297ab67bef991468fe40c556c18a2d620bb | [
"MIT"
] | 1 | 2018-08-16T11:36:00.000Z | 2018-08-16T11:36:00.000Z | # path the the Free-spoken digit dataset
FSDD_PATH = r'/tmp/free-spoken-digit-dataset/recordings'
# path to a file for caching acoustic features
# (make sure the folder is exist)
CACHE_PATH = r'/tmp/uefsummer18.pkl'
# path to save pdf figure for the results
FIG_PATH = r'/tmp/tmp.pdf'
| 28.7 | 56 | 0.752613 |
218ef1066ba5a6139d2fe63f50509c4d209cda9f | 52,634 | py | Python | run.py | soumye/dialog_without_dialog | 9f95d6fb457659f9007445d9036b94e639bddd8b | [
"MIT"
] | null | null | null | run.py | soumye/dialog_without_dialog | 9f95d6fb457659f9007445d9036b94e639bddd8b | [
"MIT"
] | null | null | null | run.py | soumye/dialog_without_dialog | 9f95d6fb457659f9007445d9036b94e639bddd8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import subprocess
from subprocess import Popen
import time
import tempfile
import socket
import argparse
import sys
import os
import os.path as pth
import glob
import shlex
import random
parser = argparse.ArgumentParser(description='Generic slurm run script')
parser.add_argument('EXP', type=str,... | 40.178626 | 127 | 0.5543 |
218f0fb319b8aec2187d991c84629489aa3cfc0b | 10,999 | py | Python | homeassistant/components/esphome/climate.py | marcelblijleven/core | 6d13466f8a9b157609227046e5ee542d1a261d0f | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/esphome/climate.py | marcelblijleven/core | 6d13466f8a9b157609227046e5ee542d1a261d0f | [
"Apache-2.0"
] | 58 | 2021-01-04T08:20:32.000Z | 2022-03-31T06:05:13.000Z | homeassistant/components/esphome/climate.py | Kirchoff/home-assistant | 3eb3c2824c409feb9e2c68859fa6c04dd2574a7c | [
"Apache-2.0"
] | 6 | 2018-02-04T03:48:55.000Z | 2022-01-24T20:37:04.000Z | """Support for ESPHome climate devices."""
from __future__ import annotations
from typing import Any, cast
from aioesphomeapi import (
ClimateAction,
ClimateFanMode,
ClimateInfo,
ClimateMode,
ClimatePreset,
ClimateState,
ClimateSwingMode,
)
from homeassistant.components.climate import Cli... | 33.229607 | 87 | 0.681335 |
218f1bd91b170cdd16bd0419fb53a11aea0b9a41 | 1,780 | py | Python | ansiblemetrics/ansible_metric.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | 1 | 2020-04-24T16:09:14.000Z | 2020-04-24T16:09:14.000Z | ansiblemetrics/ansible_metric.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | ansiblemetrics/ansible_metric.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | import yaml
class AnsibleMetric:
def __init__(self, script: str):
"""The class constructor.
Parameters
----------
script : str
A plain Ansible file
Raises
------
TypeError
If the script is empty or an invalid YAML file
"""
... | 23.116883 | 81 | 0.510112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.