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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9e753862cc3ef00579e170691aaf73fbfde8e02b | 1,228 | py | Python | cogbot/cogs/robo_mod/conditions/author_has_been_member_for.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 8 | 2016-12-26T14:10:38.000Z | 2021-01-02T03:50:05.000Z | cogbot/cogs/robo_mod/conditions/author_has_been_member_for.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 28 | 2016-12-12T04:06:53.000Z | 2020-04-23T06:18:55.000Z | cogbot/cogs/robo_mod/conditions/author_has_been_member_for.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 9 | 2017-06-03T00:33:57.000Z | 2020-10-29T18:16:02.000Z | from datetime import datetime, timedelta
from typing import Optional
from cogbot.cogs.robo_mod.robo_mod_condition import RoboModCondition
from cogbot.cogs.robo_mod.robo_mod_trigger import RoboModTrigger
class AuthorHasBeenMemberForCondition(RoboModCondition):
def __init__(self):
self.more_than: Optional[... | 38.375 | 80 | 0.692182 |
9e753c0af077a9a6946a29f3d2396ae9649d2241 | 16,893 | py | Python | main.py | lukemelas/mt-cgcnn | d70b70eda49fbda88148c844e799cb3b41ad8df7 | [
"MIT"
] | null | null | null | main.py | lukemelas/mt-cgcnn | d70b70eda49fbda88148c844e799cb3b41ad8df7 | [
"MIT"
] | null | null | null | main.py | lukemelas/mt-cgcnn | d70b70eda49fbda88148c844e799cb3b41ad8df7 | [
"MIT"
] | null | null | null | import argparse
import sys
import os
import shutil
import time
import warnings
from random import sample
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.optim.lr_scheduler import MultiStepLR
from model import CrystalGraphConvNet
from dat... | 40.221429 | 85 | 0.57367 |
9e7541a6d8727948af3e11ec02d489b91ec43f2b | 660 | py | Python | earlier-2020/pytorch/torch_ones_like.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:09:33.000Z | 2018-06-18T12:09:33.000Z | earlier-2020/pytorch/torch_ones_like.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | null | null | null | earlier-2020/pytorch/torch_ones_like.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:13:21.000Z | 2018-06-18T12:13:21.000Z | import torch
from torch.distributions import Bernoulli
# zz = torch.zeros((3,4,5))
# oo = torch.ones(zz.size())
# oo = torch.ones_like(zz)
# print(oo)
#
# # test scatter
bs = 3
hw = 4
c = 3
rads = torch.randint(0, hw * hw, (bs,)).long()
print(rads)
rads = torch.randint(0, hw * hw, (1,)).long().repeat(bs)
print(rads)
#... | 21.290323 | 61 | 0.648485 |
9e7583265c3397b18d8475946a9881e7b7a4b290 | 1,647 | py | Python | noxfile.py | fossabot/cmarkgfm | d17098f3b5b2fc38f2e931059ca2977a483a7338 | [
"MIT"
] | null | null | null | noxfile.py | fossabot/cmarkgfm | d17098f3b5b2fc38f2e931059ca2977a483a7338 | [
"MIT"
] | 1 | 2020-04-08T14:28:08.000Z | 2020-04-08T14:28:08.000Z | noxfile.py | fossabot/cmarkgfm | d17098f3b5b2fc38f2e931059ca2977a483a7338 | [
"MIT"
] | 1 | 2020-03-30T15:48:20.000Z | 2020-03-30T15:48:20.000Z | import os
import platform
import shutil
import nox
@nox.session(py=['2.7', '2.7-32', '3.4', '3.5', '3.6', '3.7', '3.8'])
def unit(session):
session.install('pytest', 'pytest-cov')
session.install('.')
session.run(
'pytest',
'--cov-report', '',
'--cov', 'cmarkgfm',
... | 32.94 | 85 | 0.616879 |
9e758a839e922b6e2ad34fe4292a6c603c019ff7 | 9,647 | py | Python | flexget/tests/test_metainfo.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | 1 | 2018-05-02T21:14:50.000Z | 2018-05-02T21:14:50.000Z | flexget/tests/test_metainfo.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | flexget/tests/test_metainfo.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import pytest
class TestMetainfo(object):
config = """
tasks:
test_content_size:
mock:
- {title: 'size 10MB', description: 'met... | 46.603865 | 133 | 0.566705 |
9e758d10b573546c220e0026901e40a9e4f654f4 | 3,829 | py | Python | pyrtools/tools/compare_matpyrtools.py | drwalton/pyrtools | 00c055639d2dc887c94bf5adddb7adaa8960fb5f | [
"MIT"
] | 54 | 2019-04-18T06:32:31.000Z | 2022-03-24T02:38:08.000Z | pyrtools/tools/compare_matpyrtools.py | drwalton/pyrtools | 00c055639d2dc887c94bf5adddb7adaa8960fb5f | [
"MIT"
] | 10 | 2020-05-18T05:00:56.000Z | 2021-10-05T15:07:44.000Z | pyrtools/tools/compare_matpyrtools.py | drwalton/pyrtools | 00c055639d2dc887c94bf5adddb7adaa8960fb5f | [
"MIT"
] | 14 | 2019-05-09T21:00:26.000Z | 2022-01-02T14:31:15.000Z | import numpy as np
import math
from ..pyramids import convert_pyr_coeffs_to_pyr
def comparePyr(matPyr, pyPyr, rtol=1e-5, atol=1e-8):
'''compare two pyramids
returns True if they are the same with in desired precision and False if not.
written for unit testing code.
'''
# compare two pyramids - ... | 36.466667 | 96 | 0.564638 |
9e75a1d2a790744acaa7f21c22fc05f31a1df318 | 11,520 | py | Python | sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_settings_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_settings_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_settings_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"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 may ... | 43.308271 | 243 | 0.684809 |
9e7607ff9484279132e7a29f7e5e9cd9ccb10383 | 272 | py | Python | SOSAT/constraints/__init__.py | pnnl/SOSAT | 610f99e0bb80f2f5e7836e7e3b6b816e029838bb | [
"BSD-3-Clause"
] | null | null | null | SOSAT/constraints/__init__.py | pnnl/SOSAT | 610f99e0bb80f2f5e7836e7e3b6b816e029838bb | [
"BSD-3-Clause"
] | 1 | 2021-03-22T18:59:05.000Z | 2021-03-22T18:59:05.000Z | SOSAT/constraints/__init__.py | pnnl/SOSAT | 610f99e0bb80f2f5e7836e7e3b6b816e029838bb | [
"BSD-3-Clause"
] | null | null | null | from .fault_constraint import FaultConstraint
from .faulting_regime_constraint import FaultingRegimeConstraint, SU
from .breakout_constraint import BreakoutConstraint
from .DITF_constraint import DITFConstraint
from .stress_measurement_constraint import StressMeasurement
| 45.333333 | 68 | 0.900735 |
9e765b8780e5f60cf5c378a43e6f76eec329dff9 | 6,261 | py | Python | tools/metrics/common/models.py | 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 | tools/metrics/common/models.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | tools/metrics/common/models.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright 2015 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.
"""Model types for describing description xml models."""
from xml.dom import minidom
import sys
import os
import pretty_print_xml
def GetComments(node):... | 27.826667 | 80 | 0.678166 |
9e765cef273091358bff4dc3d6c77f84a14ea1d1 | 62,118 | py | Python | salt/cloud/clouds/gce.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | null | null | null | salt/cloud/clouds/gce.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | 1 | 2015-09-02T12:49:48.000Z | 2015-09-02T19:22:58.000Z | salt/cloud/clouds/gce.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Copyright 2013 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 applic... | 27.632562 | 114 | 0.592244 |
9e76acb8807940758a66a76bdbe8fbe552f40d99 | 49,379 | py | Python | data/transcoder_evaluation_gfg/python/CIRCULAR_MATRIX_CONSTRUCT_A_MATRIX_WITH_NUMBERS_1_TO_MN_IN_SPIRAL_WAY.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/CIRCULAR_MATRIX_CONSTRUCT_A_MATRIX_WITH_NUMBERS_1_TO_MN_IN_SPIRAL_WAY.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/CIRCULAR_MATRIX_CONSTRUCT_A_MATRIX_WITH_NUMBERS_1_TO_MN_IN_SPIRAL_WAY.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( m , n , a ) :
val = 1
k , l = 0 , 0
while ( k < m and l < n ) :
for i in range ( l , n ) :
... | 771.546875 | 5,910 | 0.420503 |
9e76b6effddcd92cac60d811e11f6737fa40949b | 1,196 | py | Python | products/urls.py | tiagocordeiro/zumaq-partners | ba2c5d4257438ec062ef034096cd203efe58ef4a | [
"MIT"
] | 1 | 2019-02-13T11:01:25.000Z | 2019-02-13T11:01:25.000Z | products/urls.py | tiagocordeiro/zumaq-partners | ba2c5d4257438ec062ef034096cd203efe58ef4a | [
"MIT"
] | 619 | 2018-11-26T06:11:05.000Z | 2022-03-31T22:56:13.000Z | products/urls.py | tiagocordeiro/zumaq-partners | ba2c5d4257438ec062ef034096cd203efe58ef4a | [
"MIT"
] | 1 | 2020-03-12T16:34:13.000Z | 2020-03-12T16:34:13.000Z | from django.urls import path
from . import views
urlpatterns = [
path('products/list/', views.product_list, name='product_list'),
path('products/list/atacado/', views.product_atacado_list, name='product_list_atacado'),
path('products/product/add/', views.product_add, name='product_add'),
path('product... | 62.947368 | 117 | 0.751672 |
9e76c7575dde05574dfd83eb20c6933fc9c77860 | 22,567 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_delegation_settings_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_delegation_settings_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_delegation_settings_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 42.339587 | 215 | 0.686799 |
9e76e34c5a4adc58e8f551ede72bd579e5696dc1 | 35,561 | py | Python | ai4water/hyperopt/utils.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 12 | 2020-10-13T08:23:17.000Z | 2021-01-22T04:36:21.000Z | ai4water/hyperopt/utils.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 1 | 2020-10-15T02:42:52.000Z | 2020-10-15T02:51:07.000Z | ai4water/hyperopt/utils.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 2 | 2020-11-23T04:45:38.000Z | 2020-11-26T10:12:34.000Z | import os
import json
from itertools import islice
from pickle import PicklingError
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
try:
from hyperopt import space_eval, hp
from hyperopt.base import miscs_to_idxs_vals # todo main_plot_1D_attachment
except Impor... | 33.77113 | 123 | 0.571609 |
9e770916771577dac0393af71a00fe5bafea7eb5 | 2,243 | py | Python | portal/apps/adzone/form.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 8 | 2020-12-15T17:11:08.000Z | 2021-12-13T22:08:33.000Z | portal/apps/adzone/form.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 28 | 2020-12-15T17:34:03.000Z | 2022-02-01T04:09:10.000Z | portal/apps/adzone/form.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 7 | 2020-12-15T19:59:17.000Z | 2021-11-24T16:47:06.000Z | # -*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext_lazy as _
from adzone.models import BannerAd
# 150kb - 150165
MAX_UPLOAD_SIZE = "150165"
class UploadFileForm(forms.ModelForm):
def clean(self):
self.check_file(self)
return self.cleaned_data
def... | 40.781818 | 94 | 0.626839 |
9e771f0a8fe37a4e47d20821a86612a0f8ad2efb | 533 | py | Python | workflow/ignite/metrics/reduce_metrics_lambda.py | Aiwizo/ml-workflow | 88e104fce571dd3b76914626a52f9001342c07cc | [
"Apache-2.0"
] | 4 | 2020-09-23T15:39:24.000Z | 2021-09-12T22:11:00.000Z | workflow/ignite/metrics/reduce_metrics_lambda.py | Aiwizo/ml-workflow | 88e104fce571dd3b76914626a52f9001342c07cc | [
"Apache-2.0"
] | 4 | 2020-09-23T15:07:39.000Z | 2020-10-30T10:26:24.000Z | workflow/ignite/metrics/reduce_metrics_lambda.py | Aiwizo/ml-workflow | 88e104fce571dd3b76914626a52f9001342c07cc | [
"Apache-2.0"
] | null | null | null | import numpy as np
from ignite.metrics import MetricsLambda
class ReduceMetricsLambda(MetricsLambda):
def __init__(self, reduce_fn, f, *args, **kwargs):
super().__init__(f, *args, **kwargs)
self.reduce_fn = reduce_fn
self.reduced_value = None
def compute(self):
value = super()... | 28.052632 | 74 | 0.651032 |
9e773d404b979dda9d14740049fb4e229509a2df | 430 | py | Python | chapter2/intogen-arrays/lib/intogen/repository/__init__.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | 1 | 2015-12-22T00:53:18.000Z | 2015-12-22T00:53:18.000Z | chapter2/intogen-arrays/lib/intogen/repository/__init__.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | null | null | null | chapter2/intogen-arrays/lib/intogen/repository/__init__.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | null | null | null | import rpath
def compose_url(repo_name, *path):
return "{0}:{1}".format(repo_name, rpath.absolute(rpath.join(*path)))
def decompose_url(url):
pos = url.index(":")
repo_name = url[0:pos]
path = rpath.absolute(url[pos + 1:])
return (repo_name, path)
class Repository(object):
def __init__(self, name):
self._nam... | 21.5 | 70 | 0.695349 |
9e775f6cc296882b4c992694d74162a5915a5928 | 31,642 | py | Python | SCRAPE/Lib/site-packages/twisted/protocols/basic.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 4,612 | 2015-01-01T12:57:23.000Z | 2022-03-30T01:08:23.000Z | SCRAPE/Lib/site-packages/twisted/protocols/basic.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1,243 | 2015-01-23T17:23:59.000Z | 2022-03-28T13:46:17.000Z | SCRAPE/Lib/site-packages/twisted/protocols/basic.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1,236 | 2015-01-13T14:41:26.000Z | 2022-03-17T07:12:36.000Z | # -*- test-case-name: twisted.protocols.test.test_basic -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Basic protocols, such as line-oriented, netstring, and int prefixed strings.
"""
import math
# System imports
import re
from io import BytesIO
from struct import calcsize, pack, u... | 34.657174 | 88 | 0.637728 |
9e77672dd5e57a55e469abb56675f10440e13a27 | 4,039 | py | Python | alipay/aop/api/request/AlipayPayPaysharingprodSharepeerpayApplyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayPayPaysharingprodSharepeerpayApplyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayPayPaysharingprodSharepeerpayApplyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/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.AlipayPayPaysharingprodSharepeerpayApplyModel import AlipayPayPaysharingprodSharepeerpayApplyModel
class AlipayPayPaysharingprodShar... | 27.855172 | 148 | 0.650656 |
9e7791ae23291af1258591af944e7c07fe801421 | 1,437 | py | Python | stocky-devel/stocky/qailib/common/serversocketbase.py | cfe-lab/stocky | 6c4114551d9b61c5ba3db2c237e995fecdd2f6b3 | [
"Apache-2.0"
] | 1 | 2020-05-13T17:39:59.000Z | 2020-05-13T17:39:59.000Z | stocky-devel/stocky/qailib/common/serversocketbase.py | cfe-lab/stocky | 6c4114551d9b61c5ba3db2c237e995fecdd2f6b3 | [
"Apache-2.0"
] | 1 | 2018-09-18T19:39:24.000Z | 2019-02-04T23:52:59.000Z | stocky-devel/stocky/qailib/common/serversocketbase.py | cfe-lab/stocky | 6c4114551d9b61c5ba3db2c237e995fecdd2f6b3 | [
"Apache-2.0"
] | null | null | null | """Provide an abstract base class for a websocket connection on the webclient side
that is also a base_obj.
This module is designed to be compiled by both Cpython and Transcrypt.
"""
import typing
import qailib.common.base as base
class base_server_socket(base.base_obj):
def __init__(self, idstr):
... | 34.214286 | 83 | 0.663883 |
9e77977e0a42aa20a7935ec123dc25904116f6e6 | 6,188 | py | Python | data/userfiles.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | 1 | 2020-10-16T19:30:41.000Z | 2020-10-16T19:30:41.000Z | data/userfiles.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | 15 | 2020-06-18T15:32:06.000Z | 2022-03-03T23:06:24.000Z | data/userfiles.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | null | null | null | import os
import logging
import urlparse
from uuid import uuid4
from _pyio import BufferedReader
import magic
from flask import url_for, request, send_file, make_response, abort
from flask.views import View
from util import get_app_url
logger = logging.getLogger(__name__)
class UserfilesHandlers(View):
metho... | 34.187845 | 100 | 0.629606 |
9e779d7b5d8f11512dd15b4aedf8583be72141fa | 2,787 | py | Python | oscar/lib/python2.7/site-packages/django/db/models/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/db/models/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/db/models/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from django.core.exceptions import ObjectDoesNotExist
from django.db.models import signals
from django.db.models.aggregates import * # NOQA
from django.db.models.aggregates import __all__ as aggregates_all
from django.db.models.deletion import (
CASCADE, DO_NOTHING, PROTECT, SET, SET_DEFAULT, SET_NULL, Protec... | 37.662162 | 82 | 0.701112 |
9e77ebd4491f5b8d5365368aa85fc0277979d1d0 | 2,815 | py | Python | tests/unit/plugins/openstack/scenarios/nova/test_hypervisors.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 1 | 2018-01-01T00:43:41.000Z | 2018-01-01T00:43:41.000Z | tests/unit/plugins/openstack/scenarios/nova/test_hypervisors.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/scenarios/nova/test_hypervisors.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 1 | 2020-06-05T10:06:37.000Z | 2020-06-05T10:06:37.000Z | # Copyright 2013 Cisco Systems 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 requir... | 42.651515 | 78 | 0.746359 |
9e77ffa3e5b2ce9a8a65da3e83c76e3cbd4a1ea5 | 397 | py | Python | migrations/versions/0051_set_job_status.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | migrations/versions/0051_set_job_status.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | migrations/versions/0051_set_job_status.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | """empty message
Revision ID: 0051_set_job_status
Revises: 0050_index_for_stats
Create Date: 2016-08-24 13:21:51.744526
"""
# revision identifiers, used by Alembic.
revision = "0051_set_job_status"
down_revision = "0050_index_for_stats"
from alembic import op
def upgrade():
op.execute("update jobs set job_sta... | 17.26087 | 78 | 0.75063 |
9e780aab0097c2d7ca5bd6fa681a6547a9642975 | 14,175 | py | Python | numerous/engine/simulation/solvers/numerous_solver/solver_methods.py | fossilfree/Numerous | 121cd00456f263cab9def10cb99a21655f5832c9 | [
"BSD-3-Clause"
] | null | null | null | numerous/engine/simulation/solvers/numerous_solver/solver_methods.py | fossilfree/Numerous | 121cd00456f263cab9def10cb99a21655f5832c9 | [
"BSD-3-Clause"
] | null | null | null | numerous/engine/simulation/solvers/numerous_solver/solver_methods.py | fossilfree/Numerous | 121cd00456f263cab9def10cb99a21655f5832c9 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from numba import njit
from scipy import linalg
import logging
from .linalg.lapack.lapack_python import lapack_solve_triangular, lapack_cholesky
class BaseMethod:
def __init__(self, numerous_solver, **options):
raise NotImplementedError
def get_solver_state(self, *args, **kwargs):
... | 32.289294 | 134 | 0.461799 |
9e78550d0b62de6b21ff5f4b0941a8c32624f73a | 846 | py | Python | rest_api/videogame.py | giusdp/pandascore-API-python | 50c912ba5f4d63711bc94436a4da529becbe7311 | [
"MIT"
] | 1 | 2017-12-01T19:39:05.000Z | 2017-12-01T19:39:05.000Z | rest_api/videogame.py | giusdp/pandascore-API-python | 50c912ba5f4d63711bc94436a4da529becbe7311 | [
"MIT"
] | null | null | null | rest_api/videogame.py | giusdp/pandascore-API-python | 50c912ba5f4d63711bc94436a4da529becbe7311 | [
"MIT"
] | null | null | null | from rest_api.apimediator import PandaRestAPI
class GenericCallsSet(object):
def __init__(self, query_prefix=None):
self.rest_api = PandaRestAPI()
self.query_prefix = query_prefix
def build_base_query(self, query, some_id=None, follow_up_query=None):
s = ''
if self.query_pref... | 33.84 | 122 | 0.664303 |
9e786c15428b6ff329ba751c3d8c4788080715ea | 1,298 | py | Python | src/9/defining_a_decorator_with_user_adjustable_attributes/example2.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 14 | 2017-05-20T04:06:46.000Z | 2022-01-23T06:48:45.000Z | src/9/defining_a_decorator_with_user_adjustable_attributes/example2.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | src/9/defining_a_decorator_with_user_adjustable_attributes/example2.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 15 | 2017-03-29T17:57:33.000Z | 2021-08-24T02:20:08.000Z | # Alternate formulation using function attributes directly
from functools import wraps
import logging
def logged(level, name=None, message=None):
'''
Add logging to a function. level is the logging
level, name is the logger name, and message is the
log message. If name and message aren't specified,
... | 24.961538 | 58 | 0.646379 |
9e787293f1f37148c001750ecff53e94f835e493 | 7,038 | py | Python | frontend/routes/api/challenges.py | acasi-ctf/ctf | 1136185c359252d80f5dd4ebd4ce4cc404cd4ea3 | [
"Apache-2.0"
] | 4 | 2021-03-13T04:45:23.000Z | 2022-03-22T06:45:04.000Z | frontend/routes/api/challenges.py | acasi-ctf/ctf | 1136185c359252d80f5dd4ebd4ce4cc404cd4ea3 | [
"Apache-2.0"
] | 207 | 2021-03-09T22:36:46.000Z | 2022-03-28T13:49:50.000Z | frontend/routes/api/challenges.py | acasi-ctf/ctf | 1136185c359252d80f5dd4ebd4ce4cc404cd4ea3 | [
"Apache-2.0"
] | 2 | 2021-03-13T01:07:37.000Z | 2021-12-23T00:01:40.000Z | """
Routes that relate to fetching challenge sets and challenges.
"""
import datetime
from flask import Blueprint, jsonify, Response
from sqlalchemy import func
from frontend.extensions import db
from frontend.model.challenges import (
ChallengeSet,
Challenge,
Documentation,
UserChallenges,
Comple... | 30.206009 | 91 | 0.669082 |
9e78dd213d8533ac0f5c9c3e634095319f3b3846 | 1,366 | py | Python | src/Arduino_node.py | rdilare/ros_bot | 64f87eadf20dcaec66713329553cbe48bf512715 | [
"MIT"
] | null | null | null | src/Arduino_node.py | rdilare/ros_bot | 64f87eadf20dcaec66713329553cbe48bf512715 | [
"MIT"
] | null | null | null | src/Arduino_node.py | rdilare/ros_bot | 64f87eadf20dcaec66713329553cbe48bf512715 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import rospy
from serial import Serial
from geometry_msgs.msg import Twist
s = Serial("/dev/ttyUSB0",115200,timeout=0.1)
pre_time = 0
pre_v = 0
pre_w = 0
a_max = .25
alpha_max = 2.5
def runBot(msg):
global pre_time, pre_v, pre_w, a_max, alpha_max
curr_time = rospy.Time().now().to_sec()
... | 20.38806 | 58 | 0.643485 |
9e79051ada2e9a65746d220d148480849f830f8a | 17,051 | py | Python | yt_dlp/downloader/http.py | damianoamatruda/yt-dlp | 705e7c2005dfe67a905e18736c9f6345ee9d386b | [
"Unlicense"
] | 1 | 2022-01-03T19:13:33.000Z | 2022-01-03T19:13:33.000Z | yt_dlp/downloader/http.py | XkaV/yt-dlp | fee3f44f5f58274c637499f077aa0312e650f493 | [
"Unlicense"
] | null | null | null | yt_dlp/downloader/http.py | XkaV/yt-dlp | fee3f44f5f58274c637499f077aa0312e650f493 | [
"Unlicense"
] | null | null | null | from __future__ import unicode_literals
import errno
import os
import socket
import time
import random
import re
from .common import FileDownloader
from ..compat import (
compat_str,
compat_urllib_error,
)
from ..utils import (
ContentTooShortError,
encodeFilename,
int_or_none,
sanitize_open,
... | 44.636126 | 144 | 0.518503 |
9e790814de091557213e3a4315d13d52ddade216 | 2,997 | py | Python | ExpSettings/ParameterSettings.py | gokhangg/Uncertainix | feb86dc9a8152bc133f99c56d8f15bf760754218 | [
"Apache-2.0"
] | null | null | null | ExpSettings/ParameterSettings.py | gokhangg/Uncertainix | feb86dc9a8152bc133f99c56d8f15bf760754218 | [
"Apache-2.0"
] | null | null | null | ExpSettings/ParameterSettings.py | gokhangg/Uncertainix | feb86dc9a8152bc133f99c56d8f15bf760754218 | [
"Apache-2.0"
] | null | null | null | # *=========================================================================
# *
# * Copyright Erasmus MC Rotterdam and contributors
# * This software is licensed under the Apache 2 license, quoted below.
# * Copyright 2019 Erasmus MC Rotterdam.
# * Copyright 2019 Gokhan Gunay <g.gunay@erasmsumc.nl>
# * Licensed... | 33.674157 | 82 | 0.605939 |
9e793b48e38ad139a3fd2566b005642576eb7497 | 88 | py | Python | youtube_dl_gui/version.py | Sofronio/youtube-dl-gui | cf1d7d682e941473028b182cea6ea8d8dc5ed779 | [
"Unlicense"
] | null | null | null | youtube_dl_gui/version.py | Sofronio/youtube-dl-gui | cf1d7d682e941473028b182cea6ea8d8dc5ed779 | [
"Unlicense"
] | null | null | null | youtube_dl_gui/version.py | Sofronio/youtube-dl-gui | cf1d7d682e941473028b182cea6ea8d8dc5ed779 | [
"Unlicense"
] | 1 | 2021-09-19T22:54:37.000Z | 2021-09-19T22:54:37.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.8'
| 14.666667 | 39 | 0.681818 |
9e79588da71c2f7b333c2fe518bf8fdff735ec20 | 1,716 | py | Python | Projects/7.Milestone_2_json/app.py | jkuatdsc/Python101 | b724606c920fb0e563a6a6df34c97ec30b77aa98 | [
"MIT"
] | 2 | 2020-02-11T10:19:23.000Z | 2020-02-18T08:25:51.000Z | Projects/7.Milestone_2_json/app.py | jkuatdsc/Python101 | b724606c920fb0e563a6a6df34c97ec30b77aa98 | [
"MIT"
] | null | null | null | Projects/7.Milestone_2_json/app.py | jkuatdsc/Python101 | b724606c920fb0e563a6a6df34c97ec30b77aa98 | [
"MIT"
] | 1 | 2020-02-08T19:08:04.000Z | 2020-02-08T19:08:04.000Z | """ The controller module for that handles user interaction"""
from utils import json_storage
User_Choice = """
Enter:
- 'a' to add a new book
- 'l' to list books
- 's' to search for a book
- 'r' to mark book as read
- 'd' to delete a book
- 'q' to quit the application
Your choice: """
def... | 22.88 | 62 | 0.620629 |
9e7980cc94de4c107639359ffdca5101310b3888 | 3,974 | py | Python | improver_tests/utilities/cube_manipulation/test_get_filtered_attributes.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 77 | 2017-04-26T07:47:40.000Z | 2022-03-31T09:40:49.000Z | improver_tests/utilities/cube_manipulation/test_get_filtered_attributes.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 1,440 | 2017-03-29T10:04:15.000Z | 2022-03-28T10:11:29.000Z | improver_tests/utilities/cube_manipulation/test_get_filtered_attributes.py | MoseleyS/improver | ca028e3a1c842e3ff00b188c8ea6eaedd0a07149 | [
"BSD-3-Clause"
] | 72 | 2017-03-17T16:53:45.000Z | 2022-02-16T09:41:37.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 41.395833 | 86 | 0.712884 |
9e79943ce0a287e6979a19889ea3a078c1c3b966 | 588 | py | Python | board/admin.py | pycrawling/SimpleDjangoBBS | 055e3b4b57f5e344e76fcbb4db3aeb4ca70b9384 | [
"MIT"
] | null | null | null | board/admin.py | pycrawling/SimpleDjangoBBS | 055e3b4b57f5e344e76fcbb4db3aeb4ca70b9384 | [
"MIT"
] | null | null | null | board/admin.py | pycrawling/SimpleDjangoBBS | 055e3b4b57f5e344e76fcbb4db3aeb4ca70b9384 | [
"MIT"
] | null | null | null | # board/admin.py
from django.contrib import admin
from .models import Article
class ArticleAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'author', 'content', 'created_at', 'modified_at')
list_display_links = ('id', 'title', 'author')
search_fields = ('title', 'author', 'content')
readonly_... | 29.4 | 84 | 0.664966 |
9e7994a2f39c1b376c3b26f0238efe84ccbd6467 | 6,026 | py | Python | google-cloud-sdk/.install/.backup/lib/surface/compute/instance_groups/managed/set_autoscaling.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/compute/instance_groups/managed/set_autoscaling.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/compute/instance_groups/managed/set_autoscaling.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2015 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 ag... | 36.521212 | 107 | 0.750083 |
9e79e8c727029bb9b92085428ef06582f020d9c3 | 23 | py | Python | public_datasets/stac/tests/__init__.py | developmentseed/public-datasets | e559f3e7af34f248fc9850320d434b19fe102c5c | [
"MIT"
] | 5 | 2020-11-11T18:49:09.000Z | 2020-11-24T20:06:00.000Z | public_datasets/stac/tests/__init__.py | developmentseed/public-datasets | e559f3e7af34f248fc9850320d434b19fe102c5c | [
"MIT"
] | 8 | 2020-11-11T18:09:06.000Z | 2020-12-09T03:44:39.000Z | public_datasets/stac/tests/__init__.py | developmentseed/public-datasets | e559f3e7af34f248fc9850320d434b19fe102c5c | [
"MIT"
] | null | null | null | """public-datasets."""
| 11.5 | 22 | 0.608696 |
9e79eca744c3c43dd289be1b662964caa5cf2ff1 | 56,094 | py | Python | tripolpy/core.py | ysBach/TRIPOLpy | d3f4c32525c28db54af717cbf54ef4bdb76e3309 | [
"MIT"
] | null | null | null | tripolpy/core.py | ysBach/TRIPOLpy | d3f4c32525c28db54af717cbf54ef4bdb76e3309 | [
"MIT"
] | 1 | 2018-05-17T02:14:57.000Z | 2018-05-17T02:14:57.000Z | tripolpy/core.py | ysBach/TRIPOLpy | d3f4c32525c28db54af717cbf54ef4bdb76e3309 | [
"MIT"
] | null | null | null | # import warnings
from warnings import warn
from pathlib import Path
import shutil
import os
import numpy as np
import pandas as pd
from scipy.stats import itemfreq
from astropy.io import fits
from astropy.io.fits import Card
from astropy import units as u
from astropy.coordinates import EarthLocation, A... | 37.222296 | 112 | 0.571362 |
9e7a119301e23bf56b90eab435fc185a093b3dd7 | 7,261 | py | Python | django_project/settings.py | juliandehne/whowhatwhy | fa4c89158e65d90b1cea62838f3d12f7c14e59fb | [
"MIT"
] | null | null | null | django_project/settings.py | juliandehne/whowhatwhy | fa4c89158e65d90b1cea62838f3d12f7c14e59fb | [
"MIT"
] | 6 | 2021-08-18T11:09:25.000Z | 2021-10-04T08:23:43.000Z | django_project/settings.py | juliandehne/whowhatwhy | fa4c89158e65d90b1cea62838f3d12f7c14e59fb | [
"MIT"
] | null | null | null | """
Django settings for django_project project.
Generated by 'django-admin startproject' using Django 2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import l... | 26.694853 | 107 | 0.645779 |
9e7a13cbd74cf413866030c88e383d3e3bcd7264 | 7,151 | py | Python | monai/networks/nets/unet.py | albarqounilab/MONAI | bb0b307d68021a243011a58fd82a1d275f00a51a | [
"Apache-2.0"
] | null | null | null | monai/networks/nets/unet.py | albarqounilab/MONAI | bb0b307d68021a243011a58fd82a1d275f00a51a | [
"Apache-2.0"
] | null | null | null | monai/networks/nets/unet.py | albarqounilab/MONAI | bb0b307d68021a243011a58fd82a1d275f00a51a | [
"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... | 36.484694 | 120 | 0.59684 |
9e7a392404af114fd3dd62ab03858af10d3dbd3f | 127,546 | py | Python | nova/network/neutronv2/api.py | mariusleu/nova | b19e37cbfddfce0839dbeeb0d556ed1ffae664ad | [
"Apache-2.0"
] | null | null | null | nova/network/neutronv2/api.py | mariusleu/nova | b19e37cbfddfce0839dbeeb0d556ed1ffae664ad | [
"Apache-2.0"
] | null | null | null | nova/network/neutronv2/api.py | mariusleu/nova | b19e37cbfddfce0839dbeeb0d556ed1ffae664ad | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# All Rights Reserved
# Copyright (c) 2012 NEC Corporation
#
# 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/lic... | 47.169379 | 79 | 0.592202 |
9e7a3d34a2a1d205b5fa428ea62e8ed70cd439ab | 169 | py | Python | Python-Study/Study/Day1/datetime.py | Qiaozhi94/Python-Projects | aefc6cf49c1f4f2cc9beba8dbe80cfa826ba75c4 | [
"MIT"
] | null | null | null | Python-Study/Study/Day1/datetime.py | Qiaozhi94/Python-Projects | aefc6cf49c1f4f2cc9beba8dbe80cfa826ba75c4 | [
"MIT"
] | null | null | null | Python-Study/Study/Day1/datetime.py | Qiaozhi94/Python-Projects | aefc6cf49c1f4f2cc9beba8dbe80cfa826ba75c4 | [
"MIT"
] | null | null | null | import datetime
import time
timestr = time.strftime("%Y.%m.%d.%H.%M.%S",time.localtime())
# dt = time.asctime(time.localtime(time.time()))
# print(dt)
print(timestr)
| 16.9 | 61 | 0.680473 |
9e7a4ccd5715f86cbff964b31cec96522e7d4aff | 475 | py | Python | earlier-2020/python_mod_tutorials/mlutiprocess/tsubprocess.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:09:33.000Z | 2018-06-18T12:09:33.000Z | earlier-2020/python_mod_tutorials/mlutiprocess/tsubprocess.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | null | null | null | earlier-2020/python_mod_tutorials/mlutiprocess/tsubprocess.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:13:21.000Z | 2018-06-18T12:13:21.000Z | import subprocess
import time
# obj = subprocess.Popen(['python' ,'tsleep.py'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
obj = subprocess.Popen(['python' ,'tsleep.py'])
# out,err = obj.communicate()
# print(out)
# obj.wait(2)
# print(obj.poll())
# time.sleep(2)
while True:
time.slee... | 21.590909 | 120 | 0.621053 |
9e7a555d74abf432a6836696b82004e292b1baf4 | 426 | py | Python | sdk/identity/azure-identity/azure/__init__.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/__init__.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/__init__.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint:d... | 53.25 | 80 | 0.502347 |
9e7a700ebb98169655b0498df98dd363076a7d68 | 11,291 | py | Python | appengine/components/components/net.py | hixio-mh/luci-py | 5e2606b0db8f5dac25e9f84fdf71d103da393894 | [
"Apache-2.0"
] | 74 | 2015-04-01T02:35:15.000Z | 2021-12-17T22:10:56.000Z | appengine/components/components/net.py | luci/luci-py | 41e206ef47e42122a6343147f65e4d0e4b0165de | [
"Apache-2.0"
] | 123 | 2015-04-01T04:02:57.000Z | 2022-03-02T12:49:55.000Z | appengine/components/components/net.py | luci/luci-py | 41e206ef47e42122a6343147f65e4d0e4b0165de | [
"Apache-2.0"
] | 32 | 2015-04-03T01:40:47.000Z | 2021-11-13T15:20:13.000Z | # Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Wrapper around urlfetch to call REST API with service account credentials."""
import json
import logging
from six.moves import urllib
from go... | 34.741538 | 80 | 0.68497 |
9e7a7191bb3ac65e0dffa865c59bdf3ff5e56d60 | 23,011 | py | Python | compare_gan/datasets.py | Octavian-ai/compare_gan | c1edbc353028cddf6de74743524ef09c21ee1136 | [
"Apache-2.0"
] | 3 | 2019-06-06T04:37:46.000Z | 2021-02-03T20:41:10.000Z | compare_gan/datasets.py | Octavian-ai/compare_gan | c1edbc353028cddf6de74743524ef09c21ee1136 | [
"Apache-2.0"
] | null | null | null | compare_gan/datasets.py | Octavian-ai/compare_gan | c1edbc353028cddf6de74743524ef09c21ee1136 | [
"Apache-2.0"
] | 3 | 2019-06-24T22:15:00.000Z | 2021-02-03T20:41:15.000Z | # coding=utf-8
# Copyright 2018 Google LLC & Hwalsuk Lee.
#
# 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 ... | 35.401538 | 80 | 0.699839 |
9e7a802a42050de0f7cd3aa827213a09adb1de79 | 204 | py | Python | functions/main.py | rdlauer/notecard-heatmap | e03cc1c95a88643fe8734c88ed96377bed3d811a | [
"MIT"
] | 2 | 2021-04-04T11:08:34.000Z | 2021-05-31T17:08:41.000Z | functions/main.py | rdlauer/notecard-heatmap | e03cc1c95a88643fe8734c88ed96377bed3d811a | [
"MIT"
] | null | null | null | functions/main.py | rdlauer/notecard-heatmap | e03cc1c95a88643fe8734c88ed96377bed3d811a | [
"MIT"
] | null | null | null | from google.cloud import firestore
def add_data(request):
request_json = request.get_json()
db = firestore.Client()
db.collection(u'mapdata').document().set(request_json)
return '', 200
| 22.666667 | 58 | 0.705882 |
9e7abd872c0a4d124b78d8a1c568b51b3e47a4e9 | 20,449 | py | Python | distributed/semaphore.py | vepadulano/distributed | 1da51994cc84c0897589a4476cd24073147054b6 | [
"BSD-3-Clause"
] | null | null | null | distributed/semaphore.py | vepadulano/distributed | 1da51994cc84c0897589a4476cd24073147054b6 | [
"BSD-3-Clause"
] | null | null | null | distributed/semaphore.py | vepadulano/distributed | 1da51994cc84c0897589a4476cd24073147054b6 | [
"BSD-3-Clause"
] | null | null | null | import asyncio
import logging
import uuid
import warnings
from asyncio import TimeoutError
from collections import defaultdict, deque
from tornado.ioloop import PeriodicCallback
import dask
from dask.utils import parse_timedelta
from distributed.metrics import time
from distributed.utils import SyncMethodMixin, log_... | 36.386121 | 118 | 0.586728 |
9e7ae76fb1edfd72103b556aba98b2af97cad43c | 9,518 | py | Python | ctypesgen/processor/operations.py | bingqingsuimeng/ctypesgen | 5ddc80e89abe8b02591a9baa1d857ce1f55bdee6 | [
"BSD-2-Clause"
] | 200 | 2015-05-12T03:02:39.000Z | 2021-08-10T23:24:44.000Z | ctypesgen/processor/operations.py | bingqingsuimeng/ctypesgen | 5ddc80e89abe8b02591a9baa1d857ce1f55bdee6 | [
"BSD-2-Clause"
] | 88 | 2015-05-11T15:49:11.000Z | 2021-08-19T22:02:12.000Z | ctypesgen/processor/operations.py | bingqingsuimeng/ctypesgen | 5ddc80e89abe8b02591a9baa1d857ce1f55bdee6 | [
"BSD-2-Clause"
] | 87 | 2015-05-11T19:09:51.000Z | 2021-08-19T17:11:07.000Z | """
The operations module contains various functions to process the
DescriptionCollection and prepare it for output.
ctypesgen.processor.pipeline calls the operations module.
"""
import re
import os
import keyword
from ctypesgen import libraryloader
from ctypesgen.descriptions import (
EnumDescription,
Struct... | 33.992857 | 100 | 0.568817 |
9e7ae7710a65453a8c2eb7b38cb8b8d3fcac58e6 | 2,861 | py | Python | appengine/monorail/tools/ml/trainer2/dataset.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | appengine/monorail/tools/ml/trainer2/dataset.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | appengine/monorail/tools/ml/trainer2/dataset.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2020 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.
# Or at https://developers.google.com/open-source/licenses/bsd
from __future__ import print_function
from __future__ import division
from __future__ import a... | 29.802083 | 79 | 0.724921 |
9e7b2404714d869c70c3e1115627149157bd8ebb | 5,392 | py | Python | example/smile.py | dayHRResearch/VideoCover | ccbf31df89563779b3fd006ee878ca8ab337a2a6 | [
"Apache-2.0"
] | 2 | 2019-07-16T08:08:23.000Z | 2019-07-22T14:50:27.000Z | example/smile.py | dayHRResearch/VideoCover | ccbf31df89563779b3fd006ee878ca8ab337a2a6 | [
"Apache-2.0"
] | null | null | null | example/smile.py | dayHRResearch/VideoCover | ccbf31df89563779b3fd006ee878ca8ab337a2a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 DayHR 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 applicable l... | 32.678788 | 190 | 0.593657 |
9e7b456f4706bb0ad196b7369176fabc1fd28fa1 | 324 | py | Python | settings.py | VictorLeP/Education4Climate | 7d419c96c759da2215504ac9051dd6f61d940b96 | [
"MIT"
] | null | null | null | settings.py | VictorLeP/Education4Climate | 7d419c96c759da2215504ac9051dd6f61d940b96 | [
"MIT"
] | null | null | null | settings.py | VictorLeP/Education4Climate | 7d419c96c759da2215504ac9051dd6f61d940b96 | [
"MIT"
] | 1 | 2022-03-13T08:18:29.000Z | 2022-03-13T08:18:29.000Z | from os import path
CRAWLING_OUTPUT_FOLDER = path.join('data', 'crawling-output', '')
SCORING_OUTPUT_FOLDER = path.join('data', 'scoring-output', '')
WEB_INPUT_FOLDER = path.join('docs', 'data', '')
PATTERNS_PATH = path.join('data', 'patterns', 'themes_patterns.json')
YEAR = 2021
ACCEPTED_LANGUAGES = ['fr', 'nl', 'e... | 29.454545 | 69 | 0.697531 |
9e7b5283381dd7bc0725e1ab6fb9d7d13153f02d | 61,051 | py | Python | tensorflow/python/kernel_tests/fifo_queue_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/python/kernel_tests/fifo_queue_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/kernel_tests/fifo_queue_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 26 | 2017-04-12T16:25:44.000Z | 2018-10-30T10:10:15.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.383194 | 80 | 0.636058 |
9e7b84013ea946533c95c17aa7e9b222e9036aa9 | 800 | py | Python | test/io_tests/request_response_test.py | M-o-a-T/xknx | 0cf07a01a44c76478d916884437f3f4769a4ddd5 | [
"MIT"
] | null | null | null | test/io_tests/request_response_test.py | M-o-a-T/xknx | 0cf07a01a44c76478d916884437f3f4769a4ddd5 | [
"MIT"
] | null | null | null | test/io_tests/request_response_test.py | M-o-a-T/xknx | 0cf07a01a44c76478d916884437f3f4769a4ddd5 | [
"MIT"
] | null | null | null | """Unit test for KNX/IP Disconnect Request/Response."""
import asyncio
import unittest
import pytest
pytestmark = pytest.mark.asyncio
from xknx import XKNX
from xknx.io import RequestResponse, UDPClient
from xknx.knxip import DisconnectResponse
class TestConnectResponse(unittest.TestCase):
"""Test class for xkn... | 32 | 80 | 0.72625 |
9e7b8bc280cf9e2def50c67da99ce9ca89809a20 | 1,928 | py | Python | barry/datasets/dataset_correlation_function.py | minaskar/Barry | ee9417e6464c13a23cce6982ad8bf650f013c5b2 | [
"MIT"
] | 2 | 2019-12-05T11:17:35.000Z | 2020-02-17T22:50:45.000Z | barry/datasets/dataset_correlation_function.py | minaskar/Barry | ee9417e6464c13a23cce6982ad8bf650f013c5b2 | [
"MIT"
] | null | null | null | barry/datasets/dataset_correlation_function.py | minaskar/Barry | ee9417e6464c13a23cce6982ad8bf650f013c5b2 | [
"MIT"
] | null | null | null | import logging
from barry.datasets.dataset_correlation_function_abc import CorrelationFunction
class CorrelationFunction_SDSS_DR12_Z061_NGC(CorrelationFunction):
""" Correlation function for SDSS BOSS DR12 sample for the NGC with mean redshift z = 0.61 """
def __init__(self, name=None, min_dist=30, max_d... | 38.56 | 158 | 0.614627 |
9e7bb6a56a7056363a59e15f4b986d66046bdc71 | 7,621 | py | Python | tensorflow/contrib/factorization/python/ops/gmm.py | smarthi/tensorflow | 55b01593515817992821423fec19733bca91c918 | [
"Apache-2.0"
] | 2 | 2019-10-09T08:06:48.000Z | 2021-01-07T03:16:09.000Z | tensorflow/contrib/factorization/python/ops/gmm.py | gjmulder/tensorflow | 55b01593515817992821423fec19733bca91c918 | [
"Apache-2.0"
] | 1 | 2017-02-06T08:12:22.000Z | 2017-02-06T08:12:22.000Z | tensorflow/contrib/factorization/python/ops/gmm.py | gjmulder/tensorflow | 55b01593515817992821423fec19733bca91c918 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.995146 | 86 | 0.684162 |
9e7bec79b83fcab3aa042e56740ad7e67ede090a | 2,691 | py | Python | tasty_alpha/test_strategy.py | jzajpt/tasty_alpha | 2f4969bc5b29a4d4ea19d8e11cc37ecbcff782c3 | [
"MIT"
] | 1 | 2020-10-19T08:07:26.000Z | 2020-10-19T08:07:26.000Z | tasty_alpha/test_strategy.py | jzajpt/tasty_alpha | 2f4969bc5b29a4d4ea19d8e11cc37ecbcff782c3 | [
"MIT"
] | null | null | null | tasty_alpha/test_strategy.py | jzajpt/tasty_alpha | 2f4969bc5b29a4d4ea19d8e11cc37ecbcff782c3 | [
"MIT"
] | 1 | 2022-02-13T07:58:03.000Z | 2022-02-13T07:58:03.000Z | import pytest
from aiopubsub import Hub, Publisher
from tasty_alpha.asset import Asset
from tasty_alpha.broker import BacktestBroker
from tasty_alpha.market import Markets
from tasty_alpha.strategy import Strategy, MultiStrategy
from tasty_alpha.trade import Trade
from tasty_alpha.sampling.bar import Bar
class NewBarT... | 32.817073 | 81 | 0.679673 |
9e7bffecbf4d3e1e85c046def9c298e4303057b8 | 3,577 | py | Python | train.py | no-brainer/asr-homework | 5fafd51ea2ca90da54dad335dd8fd3c44f6f97b5 | [
"MIT"
] | null | null | null | train.py | no-brainer/asr-homework | 5fafd51ea2ca90da54dad335dd8fd3c44f6f97b5 | [
"MIT"
] | null | null | null | train.py | no-brainer/asr-homework | 5fafd51ea2ca90da54dad335dd8fd3c44f6f97b5 | [
"MIT"
] | null | null | null | import argparse
import collections
import warnings
import numpy as np
import torch
import hw_asr.loss as module_loss
import hw_asr.metric as module_metric
import hw_asr.model as module_arch
from hw_asr.datasets.utils import get_dataloaders
from hw_asr.text_encoder.ctc_bpe_text_encoder import CTCBPETextEncoder
from hw... | 31.377193 | 114 | 0.686888 |
9e7c0a325fd4c09a3ab31ade065a7127bc54b353 | 3,224 | py | Python | Code/16S Analysis/CST_Clustering.py | Gscorreia89/desims-cst-analysis | d390e9658e3e2f06b05115fbc162c7390d70477a | [
"MIT"
] | null | null | null | Code/16S Analysis/CST_Clustering.py | Gscorreia89/desims-cst-analysis | d390e9658e3e2f06b05115fbc162c7390d70477a | [
"MIT"
] | null | null | null | Code/16S Analysis/CST_Clustering.py | Gscorreia89/desims-cst-analysis | d390e9658e3e2f06b05115fbc162c7390d70477a | [
"MIT"
] | null | null | null | import pandas as pds
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import distance
from scipy.cluster import hierarchy
from matplotlib.colors import ListedColormap
import seaborn as sns
from sklearn.metrics import silhouette_score, silhouette_samples, davies_bouldin_score
def cluster16SMatri... | 42.421053 | 136 | 0.727667 |
9e7c20309e2d06f934c0379a3dbd1fed14cff285 | 5,598 | py | Python | tests/test_parser_primary_expression.py | mvisat/kopyt | 48e59ed4196cb80c5498cca62ecffbcb27e6599b | [
"MIT"
] | 2 | 2021-07-21T10:24:30.000Z | 2022-01-11T11:25:25.000Z | tests/test_parser_primary_expression.py | mvisat/kopyt | 48e59ed4196cb80c5498cca62ecffbcb27e6599b | [
"MIT"
] | null | null | null | tests/test_parser_primary_expression.py | mvisat/kopyt | 48e59ed4196cb80c5498cca62ecffbcb27e6599b | [
"MIT"
] | 1 | 2021-07-28T05:47:28.000Z | 2021-07-28T05:47:28.000Z | from typing import Iterable
import unittest
from kopyt import Parser
from kopyt import node
from . import TestParserBase
class TestParserPrimaryExpression(TestParserBase):
def do_test(self,
codes: Iterable[str],
expected_type: type,
test_str: bool = True) -> node.P... | 29.776596 | 75 | 0.537871 |
9e7c30e664d272126321b10e7257508002ee7060 | 14,902 | py | Python | RLlib/SAC/sac.py | Cogito2012/DRIVE | dba7e72ae3d1a5c2841d39d8fc51af48dd161f9e | [
"MIT"
] | 10 | 2021-11-15T07:35:45.000Z | 2022-03-30T07:09:48.000Z | RLlib/SAC/sac.py | Cogito2012/DRIVE | dba7e72ae3d1a5c2841d39d8fc51af48dd161f9e | [
"MIT"
] | null | null | null | RLlib/SAC/sac.py | Cogito2012/DRIVE | dba7e72ae3d1a5c2841d39d8fc51af48dd161f9e | [
"MIT"
] | null | null | null | import os
import torch
import torch.nn.functional as F
from torch.optim import Adam
from torch.nn.utils import clip_grad_norm_
from .utils import soft_update, hard_update
from .agents import AccidentPolicy, FixationPolicy, QNetwork, StateDecoder
from src.data_transform import scales_to_point, norm_fix
from metrics.loss... | 49.181518 | 154 | 0.656959 |
9e7c31dc60696682dbec7833fae4de850de77239 | 1,361 | py | Python | practice/python/py-classes/class-1-dealing-with-complex-numbers/class-1-dealing-with-complex-numbers.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | 4 | 2017-01-18T17:51:58.000Z | 2019-10-20T12:14:37.000Z | practice/python/py-classes/class-1-dealing-with-complex-numbers/class-1-dealing-with-complex-numbers.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | null | null | null | practice/python/py-classes/class-1-dealing-with-complex-numbers/class-1-dealing-with-complex-numbers.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | 8 | 2016-03-14T17:16:59.000Z | 2021-06-26T10:11:33.000Z | import math
class Complex:
def __init__(self, real, imag):
self.real = real
self.imag = imag
def __str__(self):
str = ''
if self.real != 0:
str = "%.2f"%self.real;
if self.imag > 0:
str += ' + ' + "%.2f"%self.imag + 'i'
elif se... | 32.404762 | 104 | 0.498163 |
9e7c44016d141de58d1c884a426fb658d5bb2af0 | 6,287 | py | Python | my_configs/_base_/models/cascade_rcnn_r50_fpn.py | Daniel-xsy/MMDet_VisDrone2021 | 668d10b61a4b99dda0163b67b093cad2e699ee3b | [
"Apache-2.0"
] | null | null | null | my_configs/_base_/models/cascade_rcnn_r50_fpn.py | Daniel-xsy/MMDet_VisDrone2021 | 668d10b61a4b99dda0163b67b093cad2e699ee3b | [
"Apache-2.0"
] | null | null | null | my_configs/_base_/models/cascade_rcnn_r50_fpn.py | Daniel-xsy/MMDet_VisDrone2021 | 668d10b61a4b99dda0163b67b093cad2e699ee3b | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='CascadeRCNN',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
... | 34.927778 | 79 | 0.445363 |
9e7c5958291764a0570c724ec56f4a52e7267bf8 | 2,301 | py | Python | sila_cetoni/io/sila/io_service/generated/analoginchannelprovider/analoginchannelprovider_base.py | CETONI-Software/sila_cetoni_io | aa7849a8c609cc7842d31b5848d33dce39f03989 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T13:39:55.000Z | 2022-03-08T13:39:55.000Z | sila_cetoni/io/sila/io_service/generated/analoginchannelprovider/analoginchannelprovider_base.py | CETONI-Software/sila_cetoni_io | aa7849a8c609cc7842d31b5848d33dce39f03989 | [
"BSD-3-Clause"
] | null | null | null | sila_cetoni/io/sila/io_service/generated/analoginchannelprovider/analoginchannelprovider_base.py | CETONI-Software/sila_cetoni_io | aa7849a8c609cc7842d31b5848d33dce39f03989 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from abc import ABC, abstractmethod
from queue import Queue
from typing import Any, Dict, List, Optional, Union
from sila2.framework import Command, Feature, FullyQualifiedIdentifier, Property
from sila2.server import FeatureImplementationBase
class AnalogInChannelProviderBase(Fea... | 34.343284 | 148 | 0.677532 |
9e7c6f88f9e05663fe8b724fac24aa8e3a84beb9 | 5,852 | py | Python | backend/src/viasp/asp/justify.py | glaserL/viasp | 740cb13c9d71c76b9a702597083b5b75b5a5eafb | [
"MIT"
] | null | null | null | backend/src/viasp/asp/justify.py | glaserL/viasp | 740cb13c9d71c76b9a702597083b5b75b5a5eafb | [
"MIT"
] | 9 | 2022-03-15T12:10:58.000Z | 2022-03-23T19:33:51.000Z | backend/src/viasp/asp/justify.py | glaserL/viasp | 740cb13c9d71c76b9a702597083b5b75b5a5eafb | [
"MIT"
] | null | null | null | """This module is concerned with finding reasons for why a stable model is found."""
from collections import defaultdict
from typing import List, Collection, Dict, Iterable, Union
import networkx as nx
from clingo import Control, Symbol, Model
from clingo.ast import AST, Function
from networkx import DiGraph
from .... | 38 | 113 | 0.660971 |
9e7c7513fa8d467d2093050cab8937d398938a70 | 5,998 | py | Python | src/duplicate_file_finder/find_dupes.py | dougthor42/duplicate-file-finder | d02495feac35cca47fbd29bf809e2bdefe841f24 | [
"MIT"
] | null | null | null | src/duplicate_file_finder/find_dupes.py | dougthor42/duplicate-file-finder | d02495feac35cca47fbd29bf809e2bdefe841f24 | [
"MIT"
] | null | null | null | src/duplicate_file_finder/find_dupes.py | dougthor42/duplicate-file-finder | d02495feac35cca47fbd29bf809e2bdefe841f24 | [
"MIT"
] | null | null | null | """
Find duplicate files.
"""
import os
import sqlite3
import subprocess
from datetime import datetime
from pathlib import Path
from typing import List
import click
from loguru import logger
from more_itertools import chunked
from tqdm import tqdm
def add_timestamp_to_fn(fn: Path) -> Path:
"""
Append a times... | 28.42654 | 87 | 0.593698 |
9e7c8cdef5428b802b7805d00291ec2e232d08ae | 8,127 | py | Python | ghp/cli.py | alissa-huskey/gh-pages-cli | fd413c24dfefd47c9c071e59141da6defcdd81d6 | [
"MIT"
] | null | null | null | ghp/cli.py | alissa-huskey/gh-pages-cli | fd413c24dfefd47c9c071e59141da6defcdd81d6 | [
"MIT"
] | null | null | null | ghp/cli.py | alissa-huskey/gh-pages-cli | fd413c24dfefd47c9c071e59141da6defcdd81d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Github Pages CLI
"""
from pathlib import Path
from pprint import pprint
import click
from click import style
import tabulate as tabulate_module
from tabulate import tabulate
from .app import App
from .objects import LogLine
from .requests import (CommitRequest, DeploysRequest, JobsRequest,
... | 29.660584 | 132 | 0.597145 |
9e7c953125ee40f177cb2f2d79e15760f4919373 | 11,494 | py | Python | examples/development_TD3/variants.py | JiazhengChai/synergy_DRL | c08e78e5fe39d9d46213e1bf07b8dafc2195b05a | [
"MIT"
] | 2 | 2020-01-07T04:12:42.000Z | 2021-12-21T22:25:31.000Z | examples/development_TD3/variants.py | JiazhengChai/synergy_DRL | c08e78e5fe39d9d46213e1bf07b8dafc2195b05a | [
"MIT"
] | 11 | 2019-11-29T02:59:34.000Z | 2022-03-12T00:07:28.000Z | examples/development_TD3/variants.py | JiazhengChai/synergy_DRL | c08e78e5fe39d9d46213e1bf07b8dafc2195b05a | [
"MIT"
] | 1 | 2020-04-28T12:06:40.000Z | 2020-04-28T12:06:40.000Z | from ray import tune
import numpy as np
from softlearning.misc.utils import deep_update
M=256
M2=256
REPARAMETERIZE = True
NUM_COUPLING_LAYERS = 2
GAUSSIAN_POLICY_PARAMS_BASE = {
'type': 'GaussianPolicy',
'kwargs': {
'hidden_layer_sizes': (M, M),
'squash': True,
}
}
DETERMINISTICS_P... | 26.545035 | 143 | 0.533061 |
9e7c9bde6d610e52c35849b2897bedd405175507 | 4,653 | py | Python | src/spacexpython/ships.py | EmonCodingBackEndf/alshapton8 | 28baa090d88e51d1a84598f232c933ff68920d2e | [
"MIT"
] | 7 | 2019-09-02T11:15:16.000Z | 2020-10-30T21:28:04.000Z | src/spacexpython/ships.py | EmonCodingBackEndf/alshapton8 | 28baa090d88e51d1a84598f232c933ff68920d2e | [
"MIT"
] | 195 | 2019-08-18T23:03:17.000Z | 2022-03-31T20:56:31.000Z | src/spacexpython/ships.py | alshapton/SpacePY-X4 | c3279e1b13f6f72bf1f43c55b0d130ba5da35481 | [
"MIT"
] | 4 | 2019-08-18T23:36:10.000Z | 2021-09-12T19:52:05.000Z | """Ships module
This is a module which allows wrapper access to the functions within
the SpaceX API to return information about SpaceX fleet of ships.
This includes support and recovery vessels as well as the drone ships
This file is imported as a module and contains the following
functions:
* ships - returns al... | 28.03012 | 69 | 0.644315 |
9e7d04486943735596e5a2375add9aeffe491264 | 6,765 | py | Python | server/lib/exporters/bag.py | eliasmarkc/girder_wholetale | 7e6f117309c97c24756d5663e89d2c213a4a9978 | [
"BSD-3-Clause"
] | null | null | null | server/lib/exporters/bag.py | eliasmarkc/girder_wholetale | 7e6f117309c97c24756d5663e89d2c213a4a9978 | [
"BSD-3-Clause"
] | null | null | null | server/lib/exporters/bag.py | eliasmarkc/girder_wholetale | 7e6f117309c97c24756d5663e89d2c213a4a9978 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime, timezone
from hashlib import sha256, md5
import json
from girder.models.folder import Folder
from girder.utility import JsonEncoder
from . import TaleExporter
from gwvolman.constants import REPO2DOCKER_VERSION
bag_profile = (
"https://raw.githubusercontent.com/fair-research/bdbag/"
... | 35.234375 | 89 | 0.563045 |
9e7d3a4c387c82b3e347b121d33b439867201da9 | 6,000 | py | Python | alipay/aop/api/response/KoubeiTradeTicketTicketcodeQueryResponse.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/response/KoubeiTradeTicketTicketcodeQueryResponse.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/response/KoubeiTradeTicketTicketcodeQueryResponse.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.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.TicketTransInfo import TicketTransInfo
class KoubeiTradeTicketTicketcodeQueryResponse(AlipayResponse):
def __init__(self):
super(KoubeiTradeTicketTicketc... | 31.088083 | 113 | 0.657333 |
9e7d5632b505ac2963f2d8a805f3e75c4ff7bacc | 2,226 | py | Python | glibc/nptl/test-condattr-printers.py | chyidl/mirror-glibc | 3b17633afc85a9fb8cba0edc365d19403158c5a0 | [
"BSD-3-Clause"
] | null | null | null | glibc/nptl/test-condattr-printers.py | chyidl/mirror-glibc | 3b17633afc85a9fb8cba0edc365d19403158c5a0 | [
"BSD-3-Clause"
] | null | null | null | glibc/nptl/test-condattr-printers.py | chyidl/mirror-glibc | 3b17633afc85a9fb8cba0edc365d19403158c5a0 | [
"BSD-3-Clause"
] | null | null | null | # Common tests for the ConditionVariablePrinter and
# ConditionVariableAttributesPrinter classes.
#
# Copyright (C) 2016-2020 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | 30.916667 | 80 | 0.730907 |
9e7d5b1b47fc1e791735ff5ec2a4a47025420d3c | 942 | py | Python | public_data/migrations/0006_auto_20210816_1723.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | null | null | null | public_data/migrations/0006_auto_20210816_1723.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | 3 | 2022-02-10T11:47:58.000Z | 2022-02-23T18:50:24.000Z | public_data/migrations/0006_auto_20210816_1723.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-16 17:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("public_data", "0005_auto_20210816_1721"),
]
operations = [
migrations.AlterField(
model_name="enveloppeurbaine2018",
... | 26.914286 | 68 | 0.555202 |
9e7d7b995e267b1e024b791f817ad42c128e66a0 | 5,495 | py | Python | functions.py | charlessutton/OLMAR | fb9e95083d4d7d568708d3025e2f23fd32271468 | [
"MIT"
] | 8 | 2016-12-04T15:42:43.000Z | 2021-06-17T19:20:53.000Z | functions.py | charlessutton/OLMAR | fb9e95083d4d7d568708d3025e2f23fd32271468 | [
"MIT"
] | null | null | null | functions.py | charlessutton/OLMAR | fb9e95083d4d7d568708d3025e2f23fd32271468 | [
"MIT"
] | 6 | 2018-09-12T12:06:27.000Z | 2021-10-12T20:59:39.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 21 10:24:15 2016
@author: charles sutton
In this file, you will find the main filters
and basics function for time series operations
"""
# Filters
# Every filter has to produce a filtered time serie of prices from a sequence of price relatives
"""
Documentation for all... | 33.506098 | 177 | 0.697907 |
9e7db2ea9297dc6ffb758c3fa047419b2033f8b3 | 929 | py | Python | shutil_tool.py | ZHUXUHAN/Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | 1 | 2019-11-20T12:16:21.000Z | 2019-11-20T12:16:21.000Z | shutil_tool.py | ZHUXUHAN/Python-Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | null | null | null | shutil_tool.py | ZHUXUHAN/Python-Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/python
#test_copyfile.py
import os,shutil
def mymovefile(srcfile,dstfile):
if not os.path.isfile(srcfile):
print "%s not exist!"%(srcfile)
else:
fpath,fname=os.path.split(dstfile) #分离文件名和路径
if not os.path.exists(fpath):
os.makedirs(fp... | 29.03125 | 55 | 0.593111 |
9e7db961334665fa063e673aeebcf77f1cd9a641 | 7,349 | py | Python | final_experiment_qmcpack.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | final_experiment_qmcpack.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | final_experiment_qmcpack.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | 1 | 2022-02-11T23:22:41.000Z | 2022-02-11T23:22:41.000Z | import os
import sys
import numpy as np
configpath=sys.argv[1]
ckptpath=sys.argv[2]
blocksize=int(sys.argv[3])
coeff=float(sys.argv[4])#0.1 for default
output=sys.argv[5]
compress_mode=0# 0 is all, 1 is NN, 2 is lorenzo,3 is only latent cr, 4 is unbounded, 5 is sz3 latent cr
if len(sys.argv)>=7:
compress_mode=int... | 37.494898 | 238 | 0.504831 |
9e7dbdc4efdb3ebb67e14a58e3dd55dea46c794a | 2,639 | py | Python | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_log_prob_bonus.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_log_prob_bonus.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_log_prob_bonus.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import rlkit.misc.hyperparameter as hyp
from multiworld.envs.pygame.point2d import Point2DWallEnv
from rlkit.data_management.online_vae_log_prob_exploration_replay_buffer import \
OnlineVaeLogProbExplorationRelabelingBuffer
from rlkit.launchers.experiments.murtaza.vae_exploration_bonus import vae_exploration_bonus_... | 30.686047 | 102 | 0.618037 |
9e7dd6fb0fe7944896166222bd04b7cbd0c53ab8 | 2,083 | py | Python | tests/test_middleware.py | CSCfi/swift-sharing-request | 8ccb155b0ec168644c1724890e8088bf4e0fe4a0 | [
"MIT"
] | null | null | null | tests/test_middleware.py | CSCfi/swift-sharing-request | 8ccb155b0ec168644c1724890e8088bf4e0fe4a0 | [
"MIT"
] | 7 | 2019-12-10T19:25:44.000Z | 2021-07-26T22:03:42.000Z | tests/test_middleware.py | CSCfi/swift-sharing-request | 8ccb155b0ec168644c1724890e8088bf4e0fe4a0 | [
"MIT"
] | 1 | 2019-12-24T03:14:35.000Z | 2019-12-24T03:14:35.000Z | """Module for testing the service middleware."""
from types import SimpleNamespace
import asynctest
import aiohttp.web
from asyncpg import UniqueViolationError
from swift_sharing_request.db import DBConn
from swift_sharing_request.middleware import (
add_cors,
check_db_conn,
catch_uniqueness_error
)
... | 31.089552 | 72 | 0.644743 |
9e7deee4628cfc80b63979dbf9cb04dcbacafa04 | 6,582 | py | Python | src/pykeen/experiments/validate.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/experiments/validate.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/experiments/validate.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""A validator for experimental settings."""
import inspect
import json
import pathlib
from typing import Callable, Iterable, Optional, Set, Tuple, Type, Union
import torch
from class_resolver import Hint
from torch import nn
from .cli import HERE
from ..datasets import dataset_resolver
from... | 33.242424 | 94 | 0.629444 |
9e7df53c11f6b3cc879f3495c5b5577538bcd6e4 | 2,375 | py | Python | python-midonetclient/src/midonetclient/tenant.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | python-midonetclient/src/midonetclient/tenant.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | python-midonetclient/src/midonetclient/tenant.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | 1 | 2018-10-25T05:52:05.000Z | 2018-10-25T05:52:05.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Midokura PTE LTD.
# 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/LICENS... | 33.450704 | 75 | 0.665684 |
9e7df549fdb0238edc52111dd170e0eb599950f1 | 98 | py | Python | colossalai/nn/layer/parallel_1d/__init__.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | 1 | 2021-11-02T14:00:27.000Z | 2021-11-02T14:00:27.000Z | colossalai/nn/layer/parallel_1d/__init__.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | null | null | null | colossalai/nn/layer/parallel_1d/__init__.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | null | null | null | from .layers import Linear1D_Col, Linear1D_Row
__all__ = [
'Linear1D_Col', 'Linear1D_Row',
]
| 16.333333 | 46 | 0.72449 |
9e7e1349e376a763cd254a9ffd0ce428cf54183a | 2,613 | py | Python | test_pong_ai.py | Sopitta/RL-Pong | 8b389856d0492dac1d0fc5f4d5459809948fb14a | [
"MIT"
] | null | null | null | test_pong_ai.py | Sopitta/RL-Pong | 8b389856d0492dac1d0fc5f4d5459809948fb14a | [
"MIT"
] | null | null | null | test_pong_ai.py | Sopitta/RL-Pong | 8b389856d0492dac1d0fc5f4d5459809948fb14a | [
"MIT"
] | null | null | null | """
This is an example on how to use the two player Wimblepong environment with one
agent and the SimpleAI
"""
import matplotlib.pyplot as plt
from random import randint
import pickle
import gym
import numpy as np
import argparse
import wimblepong
import src.agents.ppo_agent
from src.agents import ppo_agent, ppo_agent_... | 34.381579 | 141 | 0.674703 |
9e7e7458a72ca121d8b4f2eb39f622fc37ff0815 | 2,667 | py | Python | taro/hostinfo.py | PetrSixta/taro | afe0caf0e0feb6948c4cc80217b5c5d11418859b | [
"MIT"
] | null | null | null | taro/hostinfo.py | PetrSixta/taro | afe0caf0e0feb6948c4cc80217b5c5d11418859b | [
"MIT"
] | 26 | 2021-04-05T12:32:21.000Z | 2022-03-22T12:53:44.000Z | taro/hostinfo.py | PetrSixta/taro | afe0caf0e0feb6948c4cc80217b5c5d11418859b | [
"MIT"
] | 1 | 2021-04-16T21:04:53.000Z | 2021-04-16T21:04:53.000Z | import configparser
import functools
import json
import logging
import subprocess
from collections import OrderedDict
from configparser import ParsingError
from subprocess import SubprocessError
from typing import Dict
import urllib3
from urllib3.exceptions import HTTPError
from taro import paths
log = logging.getLo... | 33.3375 | 115 | 0.658793 |
9e7e8697e8f6cf2331bd6ac72044eec8bd2932b0 | 15,850 | py | Python | attas_sp_3.py | dimasad/marg-max-fem-code | 0b6bb3403d50e0753b78947e321631e29c07880d | [
"MIT"
] | null | null | null | attas_sp_3.py | dimasad/marg-max-fem-code | 0b6bb3403d50e0753b78947e321631e29c07880d | [
"MIT"
] | null | null | null | attas_sp_3.py | dimasad/marg-max-fem-code | 0b6bb3403d50e0753b78947e321631e29c07880d | [
"MIT"
] | null | null | null | """Tests with the ATTAS aircraft short-period mode estimation.
Decision variables: x, wn, vn.
Steady-state KF and marginalization gains obtained with equality constraints.
Cholesky square roots used.
"""
import collections
import importlib
import inspect
import os
import jax
import jax.numpy as jnp
import numpy as... | 31.636727 | 79 | 0.548139 |
9e7e9f908f2814a649a9730b66a92d8a19bbc9d1 | 22,027 | py | Python | sharkdata_core/exportformat_utils/export_dwca_manager.py | markusSMHI/sharkdata_py3 | 129a250e1729cfef10994f0778d1243a05f9cf8a | [
"MIT"
] | null | null | null | sharkdata_core/exportformat_utils/export_dwca_manager.py | markusSMHI/sharkdata_py3 | 129a250e1729cfef10994f0778d1243a05f9cf8a | [
"MIT"
] | null | null | null | sharkdata_core/exportformat_utils/export_dwca_manager.py | markusSMHI/sharkdata_py3 | 129a250e1729cfef10994f0778d1243a05f9cf8a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Copyright (c) 2013-present SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import pathlib
import traceback
import datetime
from django.conf import settings
import sharkdat... | 51.464953 | 152 | 0.515958 |
9e7ea35aa5fde4a8ab8ba14a94d781e684a3f58c | 141 | py | Python | clrfterm/error.py | SayHelloRoman/clrflterm | 0748cb936df4ea02cdf63c165eb2b20a968586d1 | [
"MIT"
] | 3 | 2021-08-18T20:58:03.000Z | 2022-02-07T15:59:24.000Z | clrfterm/error.py | SayHelloRoman/clrflterm | 0748cb936df4ea02cdf63c165eb2b20a968586d1 | [
"MIT"
] | null | null | null | clrfterm/error.py | SayHelloRoman/clrflterm | 0748cb936df4ea02cdf63c165eb2b20a968586d1 | [
"MIT"
] | 3 | 2021-08-17T11:15:12.000Z | 2021-08-19T00:55:04.000Z | class PlatformError(Exception):
"""
The error is thrown when you try to use function
that are only available for windows
"""
| 23.5 | 52 | 0.680851 |
9e7ec014ab3d903b70a4a0c36a3e4ca47c4f22fe | 1,843 | py | Python | scripts/practice/Amazon/numberofIslands.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | scripts/practice/Amazon/numberofIslands.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | 8 | 2020-09-05T16:04:31.000Z | 2022-02-27T09:57:51.000Z | scripts/practice/Amazon/numberofIslands.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | """
Number of Islands
Given an m x n 2D binary grid grid which represents a map of
'1's (land) and '0's (water), return the number of islands.
An island is surrounded by water and is formed by connecting
adjacent lands horizontally or vertically. You may assume all
four edges of the grid are all surrounded by wat... | 22.753086 | 75 | 0.469343 |
9e7eea4029d6233456d24bf33fb95667ee5fa1c3 | 2,521 | py | Python | sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_iot_central_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_iot_central_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_iot_central_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"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 may ... | 29.313953 | 101 | 0.667196 |
9e7eefbff066ffe4a9182027b8aa274be231be49 | 865 | py | Python | Django Projects/mysite/mysite/urls.py | shouryam/Python-Projects | 4cf6171c6e389a91594363277bf77ea6f8b99b80 | [
"MIT"
] | null | null | null | Django Projects/mysite/mysite/urls.py | shouryam/Python-Projects | 4cf6171c6e389a91594363277bf77ea6f8b99b80 | [
"MIT"
] | null | null | null | Django Projects/mysite/mysite/urls.py | shouryam/Python-Projects | 4cf6171c6e389a91594363277bf77ea6f8b99b80 | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 37.608696 | 77 | 0.708671 |
9e7f09e2d75a0796abf3cbdf8991feb11090fc75 | 1,526 | py | Python | similarityPy/measure/numerical_data/normalized_squared_euclidean_distance.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 23 | 2015-01-21T01:39:11.000Z | 2019-08-27T09:43:39.000Z | similarityPy/measure/numerical_data/normalized_squared_euclidean_distance.py | cenkbircanoglu/similarityPy | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 1 | 2021-07-24T19:55:47.000Z | 2021-07-24T19:55:47.000Z | similarityPy/measure/numerical_data/normalized_squared_euclidean_distance.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 6 | 2015-03-23T16:58:18.000Z | 2019-03-12T06:31:56.000Z | # coding=utf-8
"""
Created on 18 January 2014
@author: Cenk Bircanoglu
"""
import operator
from similarityPy.algorithms.mean import Mean
from similarityPy.measure.similarity_measure import SimilarityMeasure
from similarityPy.measure.similarity_measure_type import SimilarityMeasureType
class NormalizedSquaredEuclidea... | 41.243243 | 109 | 0.593054 |
9e7f1497011901f9971327581a5eb5ec656cb578 | 1,846 | py | Python | models/translate_acas_model.py | 95616ARG/SyReNN | 19abf589e84ee67317134573054c648bb25c244d | [
"MIT"
] | 36 | 2019-08-19T06:17:52.000Z | 2022-03-11T09:02:40.000Z | models/translate_acas_model.py | 95616ARG/SyReNN | 19abf589e84ee67317134573054c648bb25c244d | [
"MIT"
] | 8 | 2020-04-09T20:59:04.000Z | 2022-03-11T23:56:50.000Z | models/translate_acas_model.py | 95616ARG/SyReNN | 19abf589e84ee67317134573054c648bb25c244d | [
"MIT"
] | 4 | 2021-01-13T11:17:55.000Z | 2021-06-28T19:36:04.000Z | """Helper code to translate an ACAS model in .nnet format to that used by ERAN.
The resulting .eran files can be used with Network.from_file in our code.
"""
import numpy as np
import sys
from_file = sys.argv[1]
values = []
with open(from_file) as nnet:
for line in nnet.readlines():
if line.startswith("//... | 29.774194 | 79 | 0.547671 |
9e7f2803a29f065599b4cd59cde66cdf6e8d5297 | 5,965 | py | Python | build.py | DervishD/sacamantecas | 5d32b0ecfd08636bf49dae5c16ee468f1f4bf6e8 | [
"MIT"
] | null | null | null | build.py | DervishD/sacamantecas | 5d32b0ecfd08636bf49dae5c16ee468f1f4bf6e8 | [
"MIT"
] | null | null | null | build.py | DervishD/sacamantecas | 5d32b0ecfd08636bf49dae5c16ee468f1f4bf6e8 | [
"MIT"
] | 1 | 2022-02-22T11:37:34.000Z | 2022-02-22T11:37:34.000Z | """
Build sacamantecas.
Builds sacamantecas executable for Win32 in a virtual environment.
Creates the virtual environment first if it does not exist, installs the needed
requirements inside and then runs the building process.
"""
import sys
import os
import venv
import subprocess
import zipfile
# Set to 'True' if ... | 36.820988 | 111 | 0.645599 |
9e7f29522216f92e4a29609ed1f67c32c0646b43 | 1,767 | py | Python | chapter-6/app/app_template/consumers.py | PacktPublishing/Real-time-Django | 07480a089fc0880d752d4ee5740ae6587de93aee | [
"MIT"
] | null | null | null | chapter-6/app/app_template/consumers.py | PacktPublishing/Real-time-Django | 07480a089fc0880d752d4ee5740ae6587de93aee | [
"MIT"
] | null | null | null | chapter-6/app/app_template/consumers.py | PacktPublishing/Real-time-Django | 07480a089fc0880d752d4ee5740ae6587de93aee | [
"MIT"
] | null | null | null | # app/app_template/consumers.py
from channels.generic.websocket import JsonWebsocketConsumer
import app.app_template.actions as actions
class ExampleConsumer(JsonWebsocketConsumer):
def connect(self):
"""Event when client connects"""
# Accept the connection
self.accept()
# Make se... | 32.127273 | 65 | 0.554046 |
9e7f2b8fe26bfabd779a57b925926ca294c83b44 | 2,208 | py | Python | adamacs/subject.py | SFB1089/database-main | bbafbd3c499655c5532628a36611b1bb335fb4e6 | [
"MIT"
] | null | null | null | adamacs/subject.py | SFB1089/database-main | bbafbd3c499655c5532628a36611b1bb335fb4e6 | [
"MIT"
] | 1 | 2021-10-05T15:56:40.000Z | 2021-10-05T15:56:40.000Z | adamacs/subject.py | SFB1089/database-main | bbafbd3c499655c5532628a36611b1bb335fb4e6 | [
"MIT"
] | null | null | null | import datajoint as dj
schema = dj.schema()
@schema
class Lab(dj.Manual):
definition = """
lab : varchar(8) # short lab name
---
lab_name : varchar(255)
institution : varchar(255)
address : varchar(255)
"""
@schema
class Protocol(dj.Manual):
defini... | 20.444444 | 71 | 0.505435 |
9e7f4cdbccfa1e29f0b1a87b43f9ce5dedbf0af1 | 194 | py | Python | mkgu/__init__.py | jjpr-mit/mkgu | 4773cd2ebb3370449fa2ff32c9f17a695c0138c9 | [
"MIT"
] | null | null | null | mkgu/__init__.py | jjpr-mit/mkgu | 4773cd2ebb3370449fa2ff32c9f17a695c0138c9 | [
"MIT"
] | 1 | 2018-01-17T16:24:56.000Z | 2018-01-17T16:24:56.000Z | mkgu/__init__.py | jjpr-mit/mkgu | 4773cd2ebb3370449fa2ff32c9f17a695c0138c9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = """Jon Prescott-Roy"""
__email__ = 'jjpr@mit.edu'
__version__ = '0.1.0'
from . import fetch
def get_assembly(name):
return fetch.get_assembly(name)
| 14.923077 | 35 | 0.659794 |
9e7f6f6b9d053844ca65ecb5e586ccb66580bb87 | 2,125 | py | Python | project5/data/main.py | HoliestCow/ece692_deeplearning | 638c27e0d9c01ec9b0a8be8a85e54937645a897e | [
"MIT"
] | null | null | null | project5/data/main.py | HoliestCow/ece692_deeplearning | 638c27e0d9c01ec9b0a8be8a85e54937645a897e | [
"MIT"
] | null | null | null | project5/data/main.py | HoliestCow/ece692_deeplearning | 638c27e0d9c01ec9b0a8be8a85e54937645a897e | [
"MIT"
] | null | null | null |
import numpy as np
import glob
import h5py
def main():
f = h5py.File('spectral_data.h5', 'w')
# f['/'].create_dataset(
# filelist = glob.glob('./integrations/bg_spectra_only*.npy')
binno = 1024
# use 0-3 for training, 4-5 for validation
# 3 for testing i think would be good
training_files ... | 37.946429 | 95 | 0.691294 |
9e7f82c11614a85e8b355f3bc6b62a866fb5bb35 | 2,952 | py | Python | google-cloud-sdk/.install/.backup/lib/surface/compute/instance_groups/unmanaged/get_named_ports.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/compute/instance_groups/unmanaged/get_named_ports.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/compute/instance_groups/unmanaged/get_named_ports.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2015 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 ag... | 38.842105 | 93 | 0.76084 |
9e7f868cf86f91731bfde28c8363d15c80b86ea6 | 854 | py | Python | fintf/live_forecasts/data_utils.py | alybel/fintf | 823b3a62595d2db10955d51f62b3e30d77fa3353 | [
"MIT"
] | null | null | null | fintf/live_forecasts/data_utils.py | alybel/fintf | 823b3a62595d2db10955d51f62b3e30d77fa3353 | [
"MIT"
] | null | null | null | fintf/live_forecasts/data_utils.py | alybel/fintf | 823b3a62595d2db10955d51f62b3e30d77fa3353 | [
"MIT"
] | null | null | null | from .. import utils
import os
from .. import settings
import datetime
times = {
'SPY': datetime.date(1994, 1, 1),
'GLD': datetime.date(1990, 1, 1),
'VXX': datetime.date(2000, 1, 1),
'XIV': datetime.date(2000, 1, 1),
'^VIX': datetime.date(1980, 1, 1),
'EURUSD=x': datetime.date(1994, 1, 1),
... | 26.6875 | 95 | 0.642857 |
9e7f9253c4aec5352c0b6e04786bc02f27f6eaeb | 46 | py | Python | src/mop/__init__.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | 1 | 2020-01-14T21:38:10.000Z | 2020-01-14T21:38:10.000Z | src/mop/__init__.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | null | null | null | src/mop/__init__.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | 1 | 2020-01-30T03:12:59.000Z | 2020-01-30T03:12:59.000Z | __version__ = "0.3.1.dev50+gdbd712f.d20200623" | 46 | 46 | 0.782609 |
9e7fbd9200ee32e4e803370324fa41fd426a5c22 | 2,030 | py | Python | ProGED/examples/oeis/fibonacci.py | smeznar/ProGED | 191cfd2b7b1fece819109a4b61e3f7533332fd74 | [
"BSD-3-Clause"
] | 5 | 2021-02-04T10:53:10.000Z | 2022-03-29T11:14:29.000Z | ProGED/examples/oeis/fibonacci.py | smeznar/ProGED | 191cfd2b7b1fece819109a4b61e3f7533332fd74 | [
"BSD-3-Clause"
] | 8 | 2021-02-04T10:11:36.000Z | 2022-03-04T13:35:16.000Z | ProGED/examples/oeis/fibonacci.py | smeznar/ProGED | 191cfd2b7b1fece819109a4b61e3f7533332fd74 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from ProGED.equation_discoverer import EqDisco
oeis = [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,
1597,2584,4181,6765,10946,17711,28657,46368,75025,
121393,196418,317811,514229,832040,1346269,
2178309,3524578,5702887,9227465,14930352,24157817,
39088169,63245986,102334155]
# oeis_primes = ... | 31.230769 | 97 | 0.591133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.