hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12847286497fe413df154f88641d5f6a8d63a883 | 27,389 | py | Python | misc/config_tools/launch_config/com.py | rliu88/acrn-hypervisor | 3db4491e1c930982a5368a996c7904c31c8675c6 | [
"BSD-3-Clause"
] | null | null | null | misc/config_tools/launch_config/com.py | rliu88/acrn-hypervisor | 3db4491e1c930982a5368a996c7904c31c8675c6 | [
"BSD-3-Clause"
] | null | null | null | misc/config_tools/launch_config/com.py | rliu88/acrn-hypervisor | 3db4491e1c930982a5368a996c7904c31c8675c6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import scenario_cfg_lib
import launch_cfg_lib
import common
import pt
def is_nuc_whl_linux(names, vmid):
uos_type = names['uos_types'][vmid]
board_name = names['board_name']
if launch_cfg_lib.is_linu... | 40.042398 | 144 | 0.58874 |
100cce2b0e22ae04a0b9959d6ff3ae88d2b6ade4 | 2,451 | py | Python | tech_project/lib/python2.7/site-packages/js_asset/js.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 3 | 2021-01-24T13:14:33.000Z | 2022-01-25T22:17:59.000Z | tech_project/lib/python2.7/site-packages/js_asset/js.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 13 | 2020-03-24T17:53:51.000Z | 2022-02-10T20:01:14.000Z | tech_project/lib/python2.7/site-packages/js_asset/js.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 1 | 2020-07-22T17:39:42.000Z | 2020-07-22T17:39:42.000Z | from __future__ import unicode_literals
import json
from django import VERSION
from django.apps import apps
from django.forms.utils import flatatt
from django.templatetags.static import static
from django.utils.html import format_html, mark_safe
__all__ = ("JS", "static")
if VERSION < (1, 10): # pragma: no cover... | 29.178571 | 83 | 0.597715 |
1a395b6e12f0ef64f0b60693502a48bda8519001 | 150,412 | py | Python | youtube_dl/extractor/youtube.py | the-robots/youtube-dl | 7d509c613ba66492ede723188d4254bb1427f4a2 | [
"Unlicense"
] | 2 | 2021-01-18T04:36:09.000Z | 2021-04-02T14:56:03.000Z | youtube_dl/extractor/youtube.py | the-robots/youtube-dl | 7d509c613ba66492ede723188d4254bb1427f4a2 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/youtube.py | the-robots/youtube-dl | 7d509c613ba66492ede723188d4254bb1427f4a2 | [
"Unlicense"
] | 1 | 2021-01-18T04:36:11.000Z | 2021-01-18T04:36:11.000Z | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import os.path
import random
import re
import time
import traceback
from .common import InfoExtractor, SearchInfoExtractor
from ..jsinterp import JSInterpreter
from ..swfinterp import SWFInterpreter
from ..compat import (
compa... | 44.939349 | 348 | 0.520018 |
9fcbddba093afca5e7a58b2bc1490e3accd2a4c4 | 18,070 | py | Python | src/organisations/tests/test_views.py | jmfer1/flagsmith-api | e7de1b5ebbcb58197e9545dc760c4b80c86a6836 | [
"BSD-3-Clause"
] | 1 | 2021-01-06T17:32:26.000Z | 2021-01-06T17:32:26.000Z | src/organisations/tests/test_views.py | agiannelli/flagsmith-api | e7de1b5ebbcb58197e9545dc760c4b80c86a6836 | [
"BSD-3-Clause"
] | null | null | null | src/organisations/tests/test_views.py | agiannelli/flagsmith-api | e7de1b5ebbcb58197e9545dc760c4b80c86a6836 | [
"BSD-3-Clause"
] | null | null | null | import json
from datetime import datetime, timedelta
from unittest import TestCase, mock
from django.test.utils import override_settings
import pytest
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core import mail
from django.urls import reverse
from pytz import UTC
from r... | 33.966165 | 111 | 0.62601 |
5e0325bcdbe6217db9c9f7b6be3375c142c3cb08 | 3,941 | py | Python | hypernets/tests/tabular/tb_dask/persitence_test.py | lyhue1991/Hypernets | d726bd297869eacb0cba84376fbac30206bbb60a | [
"Apache-2.0"
] | 3 | 2022-03-25T23:27:44.000Z | 2022-03-27T01:32:28.000Z | hypernets/tests/tabular/tb_dask/persitence_test.py | lyhue1991/Hypernets | d726bd297869eacb0cba84376fbac30206bbb60a | [
"Apache-2.0"
] | null | null | null | hypernets/tests/tabular/tb_dask/persitence_test.py | lyhue1991/Hypernets | d726bd297869eacb0cba84376fbac30206bbb60a | [
"Apache-2.0"
] | null | null | null | import glob
import os
from hypernets.tabular.datasets import dsutils
from hypernets.tests import test_output_dir
from hypernets.utils import fs
from . import if_dask_ready, is_dask_installed, setup_dask
if is_dask_installed:
import dask.dataframe as dd
import dask.array as da
from hypernets.tabular.dask_e... | 34.876106 | 83 | 0.640954 |
f67f7d47053fe0afdcfcb0c79f6cf6e911bedf74 | 890 | py | Python | pandas_dev_flaker/_ast_helpers.py | mgmanzella/pandas-dev-flaker | 0808097632b02add3a9be0f5a49861452ddb62ed | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas_dev_flaker/_ast_helpers.py | mgmanzella/pandas-dev-flaker | 0808097632b02add3a9be0f5a49861452ddb62ed | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas_dev_flaker/_ast_helpers.py | mgmanzella/pandas-dev-flaker | 0808097632b02add3a9be0f5a49861452ddb62ed | [
"MIT",
"BSD-3-Clause"
] | null | null | null | import ast
import warnings
from typing import Container, Dict, Set
def ast_parse(contents_text: str) -> ast.Module:
# intentionally ignore warnings, we might be fixing warning-ridden syntax
with warnings.catch_warnings():
warnings.simplefilter("ignore")
return ast.parse(contents_text.encode())... | 25.428571 | 77 | 0.64382 |
ee780737af7e3e5cc84ec731366a30602a78e9e5 | 79 | py | Python | Curso de Python 3 - Mundo 1 - Curso em Video/ex001.py | HebertFB/Curso-de-Python-Mundo-1-Curso-em-Video | 885e3efe4227dd610a70f13b2260612249b48865 | [
"MIT"
] | null | null | null | Curso de Python 3 - Mundo 1 - Curso em Video/ex001.py | HebertFB/Curso-de-Python-Mundo-1-Curso-em-Video | 885e3efe4227dd610a70f13b2260612249b48865 | [
"MIT"
] | null | null | null | Curso de Python 3 - Mundo 1 - Curso em Video/ex001.py | HebertFB/Curso-de-Python-Mundo-1-Curso-em-Video | 885e3efe4227dd610a70f13b2260612249b48865 | [
"MIT"
] | null | null | null | """Crie um program aque escreva 'Olá, Mundo!' na tela"""
print("Olá, Mundo!")
| 19.75 | 56 | 0.64557 |
e9bf247f4157e845b851169ccbe7b8afc115c181 | 1,876 | py | Python | other/greedy.py | MKiperszmid/Python | 6b368e6ab2fa1a839b029fd45e127521bbe76005 | [
"MIT"
] | 1 | 2020-08-28T18:25:45.000Z | 2020-08-28T18:25:45.000Z | other/greedy.py | MKiperszmid/Python | 6b368e6ab2fa1a839b029fd45e127521bbe76005 | [
"MIT"
] | 1 | 2020-08-28T18:24:31.000Z | 2020-08-28T19:35:47.000Z | other/greedy.py | MKiperszmid/Python | 6b368e6ab2fa1a839b029fd45e127521bbe76005 | [
"MIT"
] | null | null | null | class things:
def __init__(self, name, value, weight):
self.name = name
self.value = value
self.weight = weight
def __repr__(self):
return f"{self.__class__.__name__}({self.name}, {self.value}, {self.weight})"
def get_value(self):
return self.value
def get_name... | 30.754098 | 85 | 0.598081 |
8c0ecc766bb10f734e7180e7c60d58f7df39786b | 12,387 | py | Python | flopy/modflow/mfbas.py | ritchie46/flopy | 8e7284dcb3aaf5c12293d442248c2c2d9959f835 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/modflow/mfbas.py | ritchie46/flopy | 8e7284dcb3aaf5c12293d442248c2c2d9959f835 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/modflow/mfbas.py | ritchie46/flopy | 8e7284dcb3aaf5c12293d442248c2c2d9959f835 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | """
mfbas module. Contains the ModflowBas class. Note that the user can access
the ModflowBas class as `flopy.modflow.ModflowBas`.
Additional information for this MODFLOW package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?bas6.htm>`_.
"""
imp... | 34.03022 | 83 | 0.547429 |
774e2ac34468540dee4a152295586512b8e2fffb | 55,140 | py | Python | lib/installed_clients/SampleServiceClient.py | Tianhao-Gu/sample_uploader | 3c5bfa86c52721444b4af7702ca2df4d51bd3243 | [
"MIT"
] | null | null | null | lib/installed_clients/SampleServiceClient.py | Tianhao-Gu/sample_uploader | 3c5bfa86c52721444b4af7702ca2df4d51bd3243 | [
"MIT"
] | 43 | 2020-06-05T17:14:44.000Z | 2022-03-30T23:17:25.000Z | lib/installed_clients/SampleServiceClient.py | Tianhao-Gu/sample_uploader | 3c5bfa86c52721444b4af7702ca2df4d51bd3243 | [
"MIT"
] | 9 | 2019-12-12T22:28:22.000Z | 2021-12-09T17:27:27.000Z | # -*- coding: utf-8 -*-
############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
from __future__ import print_function
# the following is a hack to get the basec... | 68.327138 | 102 | 0.649057 |
83d769cb2112c2f2eda555642ec591f0c79ea4ce | 16,957 | py | Python | example/ui/dw_inputs_no_fields_qtpy_ui.py | chunkified/QDarkStyleSheet | 84905d8ec7df62cee2121067ac961477c6b0055e | [
"MIT"
] | 1 | 2020-10-29T17:04:51.000Z | 2020-10-29T17:04:51.000Z | example/ui/dw_inputs_no_fields_qtpy_ui.py | chunkified/QDarkStyleSheet | 84905d8ec7df62cee2121067ac961477c6b0055e | [
"MIT"
] | null | null | null | example/ui/dw_inputs_no_fields_qtpy_ui.py | chunkified/QDarkStyleSheet | 84905d8ec7df62cee2121067ac961477c6b0055e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'dw_inputs_no_fields.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from qtpy import QtCore, QtGui, QtWidgets
class Ui_DockWidget(object):
def setupUi(self, DockWidget):
... | 62.571956 | 113 | 0.70779 |
486497ff12bf94518c85c29aa0649101ab539838 | 75 | py | Python | omnetpy/bindings/pyopp/_cqueue.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 31 | 2020-06-23T13:53:47.000Z | 2022-03-28T08:09:00.000Z | omnetpy/bindings/pyopp/_cqueue.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2020-11-01T21:35:47.000Z | 2021-08-29T11:40:50.000Z | omnetpy/bindings/pyopp/_cqueue.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2021-03-22T15:32:22.000Z | 2022-02-02T14:57:56.000Z | """Bindings for cQueue."""
from . import _pybind
cQueue = _pybind._cQueue
| 15 | 26 | 0.72 |
1063497682dc0916b942de609f982ece4ebd9cbb | 1,706 | py | Python | src/updates/models.py | Suryabist/REST-API | b5e4afe61ae1f21cb4928bf1f15be546d9252a5d | [
"MIT"
] | 277 | 2017-12-10T19:47:15.000Z | 2022-03-27T06:27:57.000Z | src/updates/models.py | avanish981/REST-API | b5e4afe61ae1f21cb4928bf1f15be546d9252a5d | [
"MIT"
] | 8 | 2020-02-12T03:21:26.000Z | 2022-01-13T01:51:42.000Z | src/updates/models.py | hmtanbir/django-angular-ionic | 2984ce6bdf7a54290671095e60d3bd7bb39b14a8 | [
"MIT"
] | 160 | 2017-12-10T19:19:17.000Z | 2022-03-27T06:27:58.000Z | import json
from django.core.serializers import serialize
from django.conf import settings
from django.db import models
def upload_update_image(instance, filename):
return "updates/{user}/{filename}".format(user=instance.user, filename=filename)
class UpdateQuerySet(models.QuerySet):
# def serialize(self):... | 27.516129 | 93 | 0.601993 |
8669e947d505d97203174e7d5df0f4a9422f67d7 | 5,995 | py | Python | scripts/e176.py | JackKelly/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | 38 | 2015-08-14T14:38:52.000Z | 2021-12-15T03:21:04.000Z | scripts/e176.py | VidipG/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | null | null | null | scripts/e176.py | VidipG/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | 26 | 2015-09-24T20:55:26.000Z | 2021-12-07T15:42:09.000Z | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import crossentropy, mse... | 23.326848 | 93 | 0.644037 |
86d2e8a7f3e6847ab9202802f6c8f11b8aac9e12 | 1,221 | py | Python | google/cloud/aiplatform_v1beta1/services/prediction_service/transports/__init__.py | dizcology/python-aiplatform | 1a135775966c8a2303ded529eba514dcf9db7205 | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | google/cloud/aiplatform_v1beta1/services/prediction_service/transports/__init__.py | pompipo/python-aiplatform | 3612b05c62dfb46822cd2c1798fd47349dba33bc | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | google/cloud/aiplatform_v1beta1/services/prediction_service/transports/__init__.py | pompipo/python-aiplatform | 3612b05c62dfb46822cd2c1798fd47349dba33bc | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.911765 | 88 | 0.791974 |
3ea241f5584271000b8136d1dd27eecba17ff9d1 | 1,884 | py | Python | RMDataAnalysis/scripts/rmd_common.py | tkolar/mel | b6fed75fd136e2af0e90100838274c17034bfea3 | [
"CC0-1.0"
] | null | null | null | RMDataAnalysis/scripts/rmd_common.py | tkolar/mel | b6fed75fd136e2af0e90100838274c17034bfea3 | [
"CC0-1.0"
] | null | null | null | RMDataAnalysis/scripts/rmd_common.py | tkolar/mel | b6fed75fd136e2af0e90100838274c17034bfea3 | [
"CC0-1.0"
] | null | null | null | import sys
import csv
import datetime
import json
ROOTDIR="/Users/tkolar/mel/RMDataAnalysis/"
#
# items.csv fields
#
# 'Resource Type', 'Title', 'Section', 'Author', 'Publisher',
# 'Status', '# times Checked Out', 'Accession Date', 'Barcode'
#
def rmd_get_items():
items = {}
csvfile = open(ROOTDIR+"items.cs... | 25.459459 | 71 | 0.644904 |
5bfdd3a6db045322dcd1512ed1ac196454443861 | 1,064 | py | Python | openks/models/pytorch/mmd_modules/HOI/datasets/__init__.py | vivym/OpenKS | ea380782162de2e4c1a413f37ad12b85ccb7048a | [
"Apache-2.0"
] | null | null | null | openks/models/pytorch/mmd_modules/HOI/datasets/__init__.py | vivym/OpenKS | ea380782162de2e4c1a413f37ad12b85ccb7048a | [
"Apache-2.0"
] | null | null | null | openks/models/pytorch/mmd_modules/HOI/datasets/__init__.py | vivym/OpenKS | ea380782162de2e4c1a413f37ad12b85ccb7048a | [
"Apache-2.0"
] | 2 | 2021-11-18T06:55:55.000Z | 2021-12-29T15:21:07.000Z | import torch.utils.data
import torchvision
from .coco import build as build_coco
from .hico import build as build_hico
from .vcoco import build as build_vcoco
def get_coco_api_from_dataset(dataset):
for _ in range(10):
# if isinstance(dataset, torchvision.datasets.CocoDetection):
# break
... | 34.322581 | 69 | 0.710526 |
fe71f5d5a4ac036940daab05683966096f9cc3c5 | 2,283 | py | Python | flexget/plugins/output/list_add.py | gauravssnl/Flexget | 87fa5184b55c0573c558ad5ceb93516e991c756e | [
"MIT"
] | 1 | 2021-03-24T11:54:01.000Z | 2021-03-24T11:54:01.000Z | flexget/plugins/output/list_add.py | gauravssnl/Flexget | 87fa5184b55c0573c558ad5ceb93516e991c756e | [
"MIT"
] | null | null | null | flexget/plugins/output/list_add.py | gauravssnl/Flexget | 87fa5184b55c0573c558ad5ceb93516e991c756e | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugin import PluginError
log = logging.getLogger('list_add')
class ListAdd(objec... | 38.05 | 119 | 0.590013 |
d6b6faf34f7419b6cdf5149891ece942fa1c9fda | 11,410 | py | Python | doxygen/siphon/generate.py | ydy1234/vpp | 9f9e969f149e40044fee9d2e47b7dd96f3ae4dfa | [
"Apache-2.0"
] | 9 | 2018-07-25T07:43:09.000Z | 2022-03-11T09:55:03.000Z | doxygen/siphon/generate.py | fantastic2085/vpp | c599c6f001bc28e1023fb5e74a27db37b1aae847 | [
"Apache-2.0"
] | 2 | 2021-03-20T05:38:00.000Z | 2021-06-02T03:49:49.000Z | doxygen/siphon/generate.py | fantastic2085/vpp | c599c6f001bc28e1023fb5e74a27db37b1aae847 | [
"Apache-2.0"
] | 17 | 2017-06-05T08:54:27.000Z | 2021-08-29T14:19:12.000Z | # Copyright (c) 2016 Comcast Cable Communications Management, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 37.409836 | 83 | 0.467397 |
eef4c97fa84488ec83ff6b1fb088e65791756524 | 1,211 | py | Python | denguefever_tw/dengue_linebot/urls.py | NCKU-CCS/line_bot_server | 954ac77640466f625cc52c2ca8bacd37e87517a3 | [
"MIT"
] | 3 | 2016-12-31T15:06:44.000Z | 2017-10-14T16:25:02.000Z | denguefever_tw/dengue_linebot/urls.py | NCKU-CCS/line_bot_server | 954ac77640466f625cc52c2ca8bacd37e87517a3 | [
"MIT"
] | 8 | 2017-06-02T14:21:59.000Z | 2021-06-09T17:41:54.000Z | denguefever_tw/dengue_linebot/urls.py | NCKU-CCS/line_bot_server | 954ac77640466f625cc52c2ca8bacd37e87517a3 | [
"MIT"
] | 3 | 2017-05-26T06:32:59.000Z | 2017-07-18T01:27:03.000Z | from django.conf.urls import url
from .views import *
urlpatterns = [
url(r'^reply/$', reply),
url(r'^$', index),
url(r'^show_fsm/$', show_fsm, name='Show FSM'),
url(r'^reload_fsm/$', reload_fsm, name='Reload FSM'),
url(r'^user_list/$', user_list, name='User List'),
url(r'^(?P<uid>\S+)/user_d... | 43.25 | 76 | 0.648225 |
43448144a378d14e12c75f3aea40fe3b570c2fd6 | 2,082 | py | Python | pypodman/lib/actions/import_action.py | TomSweeneyRedHat/python-pypodman | 4c9cdda859417d636f598993fea3578fc4036b7e | [
"Apache-2.0"
] | 1 | 2020-01-24T00:52:50.000Z | 2020-01-24T00:52:50.000Z | pypodman/lib/actions/import_action.py | TomSweeneyRedHat/python-pypodman | 4c9cdda859417d636f598993fea3578fc4036b7e | [
"Apache-2.0"
] | 2 | 2019-03-28T10:21:33.000Z | 2019-05-10T16:55:59.000Z | pypodman/lib/actions/import_action.py | TomSweeneyRedHat/python-pypodman | 4c9cdda859417d636f598993fea3578fc4036b7e | [
"Apache-2.0"
] | 5 | 2019-03-27T18:04:05.000Z | 2020-11-18T17:20:44.000Z | """Remote client command to import tarball as image filesystem."""
import sys
import podman
from pypodman.lib import AbstractActionBase, ChangeAction
class Import(AbstractActionBase):
"""Class for importing tarball as image filesystem."""
@classmethod
def subparser(cls, parent):
"""Add Import co... | 29.742857 | 77 | 0.526897 |
559d2178fee98c5b1f207be823f4387e6c101abb | 2,935 | py | Python | research/object_detection/predictors/rfcn_keras_box_predictor_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/object_detection/predictors/rfcn_keras_box_predictor_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/object_detection/predictors/rfcn_keras_box_predictor_test.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"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... | 37.628205 | 82 | 0.696082 |
15a03b76927fdec3d87fb06802c0edbe8b5f4c38 | 7,895 | py | Python | tests/components/modbus/test_binary_sensor.py | randellhodges/core | 1c0365a72b5a0a15f2dc6a3c0fad2a7fb4e42bc3 | [
"Apache-2.0"
] | 1 | 2022-02-26T04:02:47.000Z | 2022-02-26T04:02:47.000Z | tests/components/modbus/test_binary_sensor.py | randellhodges/core | 1c0365a72b5a0a15f2dc6a3c0fad2a7fb4e42bc3 | [
"Apache-2.0"
] | 13 | 2021-12-16T06:18:53.000Z | 2022-03-31T06:26:03.000Z | tests/components/modbus/test_binary_sensor.py | randellhodges/core | 1c0365a72b5a0a15f2dc6a3c0fad2a7fb4e42bc3 | [
"Apache-2.0"
] | null | null | null | """Thetests for the Modbus sensor component."""
import pytest
from homeassistant.components.binary_sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.modbus.const import (
CALL_TYPE_COIL,
CALL_TYPE_DISCRETE,
CONF_INPUT_TYPE,
CONF_LAZY_ERROR,
CONF_SLAVE_COUNT,
)
from homeassistant.c... | 24.671875 | 87 | 0.502217 |
b548743be4d717ad446fefa663e8b6a231178cc2 | 715 | py | Python | item.py | Zerenl/text_adventure-game | 8a7bdfa9d9c79173de792616032d266fb0a5abf3 | [
"MIT"
] | null | null | null | item.py | Zerenl/text_adventure-game | 8a7bdfa9d9c79173de792616032d266fb0a5abf3 | [
"MIT"
] | null | null | null | item.py | Zerenl/text_adventure-game | 8a7bdfa9d9c79173de792616032d266fb0a5abf3 | [
"MIT"
] | null | null | null | class Item:
#Initialises an item.
def __init__(self, name, short, skill_bonus, will_bonus):
self.name = name
self.short = short
self.skill_bonus = skill_bonus
self.will_bonus = will_bonus
#Returns an item's name.
def get_name(self):
return self.name
#Returns an item's short name.
def get_short(self)... | 23.064516 | 66 | 0.724476 |
0bd1c737f2bdbd63c6f6caa2c4214eaf285ca186 | 1,641 | py | Python | apps/webguacamole/views.py | systemime/devops | 7552b0a8f5cdb1a6af6afa91486b9318874a71f9 | [
"MIT"
] | null | null | null | apps/webguacamole/views.py | systemime/devops | 7552b0a8f5cdb1a6af6afa91486b9318874a71f9 | [
"MIT"
] | null | null | null | apps/webguacamole/views.py | systemime/devops | 7552b0a8f5cdb1a6af6afa91486b9318874a71f9 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from server.models import RemoteUserBindHost
from util.tool import login_required, post_required
from django.http import JsonResponse
from django.db.models import Q
from .forms import HostForm
from ratelimit.decorators import ratelimit # 限速
from ratelimit impo... | 38.162791 | 85 | 0.659354 |
b3282004849d3bd930e7bc5f43905e728f746ee9 | 350 | py | Python | desafios/Mundo 2/Ex066.py | duartecgustavo/Python---Estudos- | 13a47f115dd24ef475addaed7b0c860a7b3817ca | [
"MIT"
] | 6 | 2021-01-20T20:43:39.000Z | 2021-08-13T15:44:10.000Z | desafios/Mundo 2/Ex066.py | duartecgustavo/PythonProgress | 13a47f115dd24ef475addaed7b0c860a7b3817ca | [
"MIT"
] | null | null | null | desafios/Mundo 2/Ex066.py | duartecgustavo/PythonProgress | 13a47f115dd24ef475addaed7b0c860a7b3817ca | [
"MIT"
] | 1 | 2020-09-06T03:34:19.000Z | 2020-09-06T03:34:19.000Z | # Desasfio 66 - Aula 15 : Programa que vá lendo numeros ate chegar na condição e parada que é 999. (usar BREAK)
count = soma = 0
while True: # cria uma repetição infinita
numero = int(input('Digite um numero: '))
if numero == 999:
break
count+=1
soma += numero
print(f'A soma dos {count} numeros... | 35 | 111 | 0.662857 |
d76b81ebb94f96c1d233934e6d163a4cc05b7f59 | 1,398 | py | Python | HyperNews Portal/task/news/views.py | AlexandruPopa88/HyperNews-Portal | 34fb7df4b686880915f9b288da1bba049d8fedcd | [
"MIT"
] | null | null | null | HyperNews Portal/task/news/views.py | AlexandruPopa88/HyperNews-Portal | 34fb7df4b686880915f9b288da1bba049d8fedcd | [
"MIT"
] | 5 | 2021-04-08T22:02:15.000Z | 2022-02-10T14:53:45.000Z | HyperNews Portal/task/news/views.py | AlexandruPopa88/HyperNews-Portal | 34fb7df4b686880915f9b288da1bba049d8fedcd | [
"MIT"
] | null | null | null | from django.views import View
from django.shortcuts import render, redirect
from json import load
from django.conf import settings
from datetime import datetime
with open(settings.NEWS_JSON_PATH, 'r') as f:
posts = load(f)
class CreateNews(View):
def get(self, request):
return render(request, "news/cr... | 33.285714 | 110 | 0.585837 |
5f07dea796769773189d8db930330db7cef83b7a | 5,417 | py | Python | SSDEventGenerator-1.0.0/ssd_event_generator.py | hyu1834/SSDEventGenerator | b9d8fad099644937b0ea786bbbbcba21d2c1c769 | [
"Apache-2.0"
] | null | null | null | SSDEventGenerator-1.0.0/ssd_event_generator.py | hyu1834/SSDEventGenerator | b9d8fad099644937b0ea786bbbbcba21d2c1c769 | [
"Apache-2.0"
] | null | null | null | SSDEventGenerator-1.0.0/ssd_event_generator.py | hyu1834/SSDEventGenerator | b9d8fad099644937b0ea786bbbbcba21d2c1c769 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import random
import io_utils
import bash_utils
import trim_simulator_utils
def help(terminate = True):
io_utils.usage("python ssd_event_generator -r <duration(second)>")
io_utils.usage("python ssd_event_generator --real <duration(second)>")
io_utils.usage("python ssd_event_generator -s <durat... | 36.601351 | 193 | 0.705741 |
59d6c83f21f264170aecb1e0bc71fa357d0a637a | 2,999 | py | Python | codigo/03 - Classification/5 - Naive Bayes/naive_bayes.py | MartinSantaGitHub/machinelearning-az | d672073e63eb09e5f3ba7cc8bdc6980d7e21c291 | [
"MIT"
] | null | null | null | codigo/03 - Classification/5 - Naive Bayes/naive_bayes.py | MartinSantaGitHub/machinelearning-az | d672073e63eb09e5f3ba7cc8bdc6980d7e21c291 | [
"MIT"
] | null | null | null | codigo/03 - Classification/5 - Naive Bayes/naive_bayes.py | MartinSantaGitHub/machinelearning-az | d672073e63eb09e5f3ba7cc8bdc6980d7e21c291 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 28 15:15:42 2020
@author: msantamaria
"""
# Naive Bayes
# Cómo importar las librerías
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importar el data set
dataset = pd.read_csv("Social_Network_Ads.csv")
X = dataset.iloc[:,[2,3]].values # iloc ... | 37.4875 | 105 | 0.687229 |
52a79be9560f5028809aa48ea201c272fc6832c8 | 18,024 | py | Python | tests/lib/common.py | premandfriends/boardfarm-1 | 3c952c94507fff25ba9955cad993610ea4a95e2e | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/lib/common.py | premandfriends/boardfarm-1 | 3c952c94507fff25ba9955cad993610ea4a95e2e | [
"BSD-3-Clause-Clear"
] | 1 | 2019-02-03T17:06:21.000Z | 2019-02-03T17:06:21.000Z | tests/lib/common.py | mgualco-contractor/boardfarm | 6a033e5dc84c7368fdd8ec2738b08b35ca7b07e7 | [
"BSD-3-Clause-Clear"
] | null | null | null | # Copyright (c) 2015
#
# All rights reserved.
#
# This file is distributed under the Clear BSD license.
# The full text can be found in LICENSE in the root directory.
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import json
import pexpect
import sys
import subprocess
import time
import unittest2
import urllib... | 39.353712 | 175 | 0.604916 |
e005155dda191363244f24dc428bb37841f43ac3 | 2,075 | py | Python | src/run/validation.py | yizumi1012xxx/cookpad | 48bafd2e5dc7d99fc79df43d95ae46a7cb08bb14 | [
"MIT"
] | null | null | null | src/run/validation.py | yizumi1012xxx/cookpad | 48bafd2e5dc7d99fc79df43d95ae46a7cb08bb14 | [
"MIT"
] | null | null | null | src/run/validation.py | yizumi1012xxx/cookpad | 48bafd2e5dc7d99fc79df43d95ae46a7cb08bb14 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
validation.py
'''
import os
import logging
from chainer import Variable
from chainer import cuda
import numpy as np
import pandas as pd
import sklearn.metrics
def __forward(dataset, model, batch_size, device_id):
predictions = []
model.train = False
if device_id > -1:
... | 25.9375 | 74 | 0.604819 |
6e2b2979905d1e23678c1d9681e902d479d0bcac | 256 | py | Python | ooq/ooq_utils.py | otosense/ooq | 3593013afaf303bc19f22e48fefc77e3e5736aac | [
"MIT"
] | 1 | 2020-11-05T18:15:06.000Z | 2020-11-05T18:15:06.000Z | ooq/ooq_utils.py | otosense/ooq | 3593013afaf303bc19f22e48fefc77e3e5736aac | [
"MIT"
] | 1 | 2021-02-16T04:12:49.000Z | 2021-04-20T00:18:03.000Z | ooq/ooq_utils.py | otosense/ooq | 3593013afaf303bc19f22e48fefc77e3e5736aac | [
"MIT"
] | null | null | null | class ModuleNotFoundIgnore:
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
if exc_type is ModuleNotFoundError:
pass
return True
module_not_found_ignore = ModuleNotFoundIgnore()
| 23.272727 | 50 | 0.683594 |
025d46b4b9fb9137f2a42e00cb4c7b04153f2734 | 978 | py | Python | kioskoproy/urls.py | Knd9/kioskoproy | 46683501287a9d7d6de5ddacdb87c00861b9eb56 | [
"MIT"
] | null | null | null | kioskoproy/urls.py | Knd9/kioskoproy | 46683501287a9d7d6de5ddacdb87c00861b9eb56 | [
"MIT"
] | 5 | 2021-04-08T18:41:15.000Z | 2021-09-22T17:59:11.000Z | kioskoproy/urls.py | Knd9/kioskoproy | 46683501287a9d7d6de5ddacdb87c00861b9eb56 | [
"MIT"
] | null | null | null | """kioskoproy URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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-ba... | 33.724138 | 77 | 0.731084 |
93a9b0099dc622e543dda94ab67915c4fd9285cd | 773 | py | Python | functional_tests/test_layout_and_styling.py | benosment/tdd_django | 0add015e96d583999ac82aa9e13fa9ddef731668 | [
"MIT"
] | null | null | null | functional_tests/test_layout_and_styling.py | benosment/tdd_django | 0add015e96d583999ac82aa9e13fa9ddef731668 | [
"MIT"
] | null | null | null | functional_tests/test_layout_and_styling.py | benosment/tdd_django | 0add015e96d583999ac82aa9e13fa9ddef731668 | [
"MIT"
] | null | null | null | from .base import FunctionalTest
class LayoutAndStylingTest(FunctionalTest):
def test_layout_and_styling(self):
# Edith goes to the home page
self.browser.get(self.server_url)
self.browser.set_window_size(1024, 768)
# She notices the input box is nicely centered
inputbox ... | 35.136364 | 83 | 0.631307 |
0fbb7779ba2070e91385212019c3a00228e40bb7 | 6,456 | py | Python | bin/data.py | SaschaMann/python | e34801a4c647635e5eb3fd4e2c41c68784b19ec7 | [
"MIT"
] | null | null | null | bin/data.py | SaschaMann/python | e34801a4c647635e5eb3fd4e2c41c68784b19ec7 | [
"MIT"
] | null | null | null | bin/data.py | SaschaMann/python | e34801a4c647635e5eb3fd4e2c41c68784b19ec7 | [
"MIT"
] | null | null | null | from enum import Enum
from dataclasses import dataclass, asdict
from itertools import chain
import json
from pathlib import Path
from typing import List, Any
@dataclass
class TrackStatus:
concept_exercises: bool = False
test_runner: bool = False
representer: bool = False
analyzer: bool = False
class... | 25.21875 | 96 | 0.584263 |
42c454ca82719514c54450b4723a0b5365c41b77 | 13,683 | py | Python | SFigure_area_picks.py | TAdeJong/figures-imaging-moire-deformations | fec3f675a143529775a4166bab565185e3beb323 | [
"MIT"
] | 1 | 2021-11-25T16:38:00.000Z | 2021-11-25T16:38:00.000Z | SFigure_area_picks.py | TAdeJong/figures-imaging-moire-deformations | fec3f675a143529775a4166bab565185e3beb323 | [
"MIT"
] | null | null | null | SFigure_area_picks.py | TAdeJong/figures-imaging-moire-deformations | fec3f675a143529775a4166bab565185e3beb323 | [
"MIT"
] | 1 | 2022-02-22T12:02:18.000Z | 2022-02-22T12:02:18.000Z | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.12.0
# kernelspec:
# display_name: Python [conda env:moire-figures]
# language: python... | 39.206304 | 121 | 0.61982 |
6fb3ca5a9cb3b85e32124ae6825a70f283d00c9d | 820 | py | Python | src/dgutils/__init__.py | expertanalytics/digeeg | 147d2afbab3618de75ccc2ddb49fd4ec44f5c3a9 | [
"MIT"
] | null | null | null | src/dgutils/__init__.py | expertanalytics/digeeg | 147d2afbab3618de75ccc2ddb49fd4ec44f5c3a9 | [
"MIT"
] | null | null | null | src/dgutils/__init__.py | expertanalytics/digeeg | 147d2afbab3618de75ccc2ddb49fd4ec44f5c3a9 | [
"MIT"
] | null | null | null | from .utils import (
angles_in_contour,
indices_in_window,
rectangle_aspect_ratio,
contour_interior,
match_contours,
match_square,
filter_contours,
remove_contours,
filter_image,
get_contour_interior,
get_contour_max_value,
get_contour_mean_value,
get_contours,
im... | 18.222222 | 67 | 0.740244 |
b211001a7ad42f2d3b93b44071bba2c8480af281 | 823 | py | Python | userbot/plugins/sql_helper/ghdb_sql.py | KerabatOnline/TeleBot | af21ad44d53261aa7b9b5dac70ecabd0c7a40212 | [
"MIT"
] | 7 | 2020-10-17T05:16:18.000Z | 2020-12-03T04:32:09.000Z | userbot/plugins/sql_helper/ghdb_sql.py | sppidy/TeleBot | 8a6aad339d18b64c41aeb5e8891f191c922eaf64 | [
"MIT"
] | 4 | 2020-11-07T07:39:51.000Z | 2020-11-10T03:46:41.000Z | userbot/plugins/sql_helper/ghdb_sql.py | sppidy/TeleBot | 8a6aad339d18b64c41aeb5e8891f191c922eaf64 | [
"MIT"
] | 9 | 2020-10-19T07:43:28.000Z | 2020-12-01T18:22:23.000Z | from sqlalchemy import Column, String
from userbot.plugins.sql_helper import SESSION, BASE
class ghdb(BASE):
__tablename__ = "channels"
chat_id = Column(String(14), primary_key=True)
def __init__(self, chat_id):
self.chat_id = chat_id
ghdb.__table__.create(checkfirst=True)
def in_channels(cha... | 19.595238 | 77 | 0.664642 |
a30edcb2fed1a60cee2b5756063f6c7d007ce0ea | 2,476 | py | Python | test_sundial.py | dps/sundial | ad3e6e812c123426e30b480fbd5190b04399ab3e | [
"BSD-2-Clause"
] | null | null | null | test_sundial.py | dps/sundial | ad3e6e812c123426e30b480fbd5190b04399ab3e | [
"BSD-2-Clause"
] | null | null | null | test_sundial.py | dps/sundial | ad3e6e812c123426e30b480fbd5190b04399ab3e | [
"BSD-2-Clause"
] | null | null | null | from sundial import SundialGenerator
def test_sanfrancisco():
# Equivalent to sundial.py --lat=37.7749 --lng=-122.4194 -d=24 -t=0.125 --adapt_for_meridian=-8
sd = SundialGenerator(37.7749, -122.4194, 24, 0.125,
dst=False, adapt_for_meridian=True, utc_offset_hrs=-8)
svg = sd.genera... | 45.851852 | 100 | 0.581179 |
a38d11bf4913e61dbe1334d814b6d3f9bca596bd | 1,095 | py | Python | ollivanders/product/migrations/0003_unitimage.py | paradox-particle/diagon-alley | 184a58da34046319c96b6d5535646497d80c4970 | [
"MIT"
] | null | null | null | ollivanders/product/migrations/0003_unitimage.py | paradox-particle/diagon-alley | 184a58da34046319c96b6d5535646497d80c4970 | [
"MIT"
] | null | null | null | ollivanders/product/migrations/0003_unitimage.py | paradox-particle/diagon-alley | 184a58da34046319c96b6d5535646497d80c4970 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-03-24 09:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0002_rename_update_at_product_updated_at_and_more'),
]
operations = [
migrations.CreateModel(
... | 35.322581 | 136 | 0.585388 |
699f6527c9ee67aaca8b7ddd01b29f9d69047e97 | 2,074 | py | Python | app/blueprints/api/user.py | deb17/moneycare | 0f67142bd63079b473d80e26845341ef2763a283 | [
"MIT"
] | null | null | null | app/blueprints/api/user.py | deb17/moneycare | 0f67142bd63079b473d80e26845341ef2763a283 | [
"MIT"
] | null | null | null | app/blueprints/api/user.py | deb17/moneycare | 0f67142bd63079b473d80e26845341ef2763a283 | [
"MIT"
] | null | null | null | from flask import jsonify
from flask.views import MethodView
from flask_smorest import Blueprint, abort
from flask_jwt_extended import (
create_access_token, jwt_required, get_jwt_identity, get_jwt
)
from app.extensions import db
from app.models import User
from .schemas.user import UserSchema, LoginSchema
bp = B... | 25.925 | 64 | 0.655738 |
2576d7c652242001ea9d2302fa2636c226ffffab | 8,645 | py | Python | client/tinychain/graph/__init__.py | mukahraman/tinychain | 65bb87cf2f86bb33772458743c7f18c2ec5ebb2f | [
"Apache-2.0"
] | null | null | null | client/tinychain/graph/__init__.py | mukahraman/tinychain | 65bb87cf2f86bb33772458743c7f18c2ec5ebb2f | [
"Apache-2.0"
] | null | null | null | client/tinychain/graph/__init__.py | mukahraman/tinychain | 65bb87cf2f86bb33772458743c7f18c2ec5ebb2f | [
"Apache-2.0"
] | null | null | null | from tinychain.collection import Column
from tinychain.collection.table import Table
from tinychain.collection.tensor import Sparse
from tinychain.error import BadRequest
from tinychain.decorators import closure, get_op, post_op, put_op, delete_op
from tinychain.ref import After, Get, If, MethodSubject, Put, While, Wit... | 38.766816 | 120 | 0.60347 |
dc2c6a3c9cc0d025cc8d48f42a293a8977fb6372 | 8,668 | py | Python | survey/groups/question_groups/multi_choice_question_group.py | vahndi/quant-survey | 1a0fcf0c22e2c7306cba0218f82d24c97d28ee1f | [
"MIT"
] | 2 | 2021-04-10T21:50:36.000Z | 2022-03-26T16:46:52.000Z | survey/groups/question_groups/multi_choice_question_group.py | vahndi/quant-survey | 1a0fcf0c22e2c7306cba0218f82d24c97d28ee1f | [
"MIT"
] | 11 | 2020-08-30T18:47:14.000Z | 2021-09-09T15:57:19.000Z | survey/groups/question_groups/multi_choice_question_group.py | vahndi/quant-survey | 1a0fcf0c22e2c7306cba0218f82d24c97d28ee1f | [
"MIT"
] | null | null | null | from copy import copy
from typing import Dict, List, Optional, Union
from numpy import nan
from pandas import concat, Index, MultiIndex, DataFrame, Series
from survey.constants import CATEGORY_SPLITTER
from survey.mixins.categorical_group_mixin import CategoricalGroupMixin
from survey.mixins.containers.question_conta... | 40.504673 | 84 | 0.570489 |
97e9aa437abdda0a8ff6e75a26ccdcedd7555013 | 3,633 | py | Python | extensions/premium.py | yiays/merely | 0c4b1952ec164cf6901a483a1eb44db9239f8eb7 | [
"MIT"
] | null | null | null | extensions/premium.py | yiays/merely | 0c4b1952ec164cf6901a483a1eb44db9239f8eb7 | [
"MIT"
] | null | null | null | extensions/premium.py | yiays/merely | 0c4b1952ec164cf6901a483a1eb44db9239f8eb7 | [
"MIT"
] | 1 | 2020-03-05T11:30:18.000Z | 2020-03-05T11:30:18.000Z | import discord
from discord.ext import commands
import asyncio
class Premium(commands.cog.Cog):
def __init__(self, bot:commands.Bot):
self.bot = bot
# ensure config file has required data
if not bot.config.has_section('premium'):
bot.config.add_section('premium')
if 'icon' not in bot.config['pr... | 45.987342 | 139 | 0.660336 |
a0bf0700e5815552012a8fa5f16cfc10c6247c9b | 140 | py | Python | tests/test_sphinx_argparse_cli.py | jugmac00/sphinx-argparse-cli | 2e0b6bbffa78bdf4d4bb7bfc4b250e66a182f1eb | [
"MIT"
] | 10 | 2021-02-05T04:04:42.000Z | 2021-05-20T18:41:30.000Z | tests/test_sphinx_argparse_cli.py | jugmac00/sphinx-argparse-cli | 2e0b6bbffa78bdf4d4bb7bfc4b250e66a182f1eb | [
"MIT"
] | 10 | 2021-02-05T12:06:27.000Z | 2021-08-07T09:29:53.000Z | tests/test_sphinx_argparse_cli.py | jugmac00/sphinx-argparse-cli | 2e0b6bbffa78bdf4d4bb7bfc4b250e66a182f1eb | [
"MIT"
] | 4 | 2021-10-12T23:31:53.000Z | 2022-02-16T11:56:44.000Z | from __future__ import annotations
def test_version() -> None:
import sphinx_argparse_cli
assert sphinx_argparse_cli.__version__
| 17.5 | 42 | 0.792857 |
2fba64e040ccd1e33a706a0d963656a63a1a11e9 | 20,801 | py | Python | src/mask_rcnn_ros/coco.py | aashizpoudel/mask_rcnn_ros | 547392d5b9865ed872959e45becb95da1f7a9bd6 | [
"MIT"
] | null | null | null | src/mask_rcnn_ros/coco.py | aashizpoudel/mask_rcnn_ros | 547392d5b9865ed872959e45becb95da1f7a9bd6 | [
"MIT"
] | null | null | null | src/mask_rcnn_ros/coco.py | aashizpoudel/mask_rcnn_ros | 547392d5b9865ed872959e45becb95da1f7a9bd6 | [
"MIT"
] | null | null | null | """
Mask R-CNN
Configurations and data loading code for MS COCO.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run fr... | 40.078998 | 124 | 0.588289 |
5cd05de97b7c98222f806a9e208c64427dfadc99 | 389 | py | Python | notes.py | ramushetty/Ubuntu-Python-Cheetsheet | 6e04c0a07db4b6abdd5dba88f4f5e2776497b1b6 | [
"MIT"
] | null | null | null | notes.py | ramushetty/Ubuntu-Python-Cheetsheet | 6e04c0a07db4b6abdd5dba88f4f5e2776497b1b6 | [
"MIT"
] | null | null | null | notes.py | ramushetty/Ubuntu-Python-Cheetsheet | 6e04c0a07db4b6abdd5dba88f4f5e2776497b1b6 | [
"MIT"
] | null | null | null | # generating random hex string
import secrets
print(secrets.token_hex(12)) # 001cb8ef4da7b9ae57d27d38
# context shell processor
# export FLASK_APP=main.py
# flask shell
# create tables in db = db.create_all()
#flask migrate
# https://flask-migrate.readthedocs.io/en/latest/
# pipenv install flask_migrate
# flask db ... | 20.473684 | 55 | 0.763496 |
a3b5e80a648dc8849b28668c62ceea6fdd1bc310 | 6,042 | py | Python | tensorflow/python/compat/compat.py | changlan/tensorflow | df4e6ca72c0c2e9d8c1e1220c2f2127af4ebfd0c | [
"Apache-2.0"
] | null | null | null | tensorflow/python/compat/compat.py | changlan/tensorflow | df4e6ca72c0c2e9d8c1e1220c2f2127af4ebfd0c | [
"Apache-2.0"
] | null | null | null | tensorflow/python/compat/compat.py | changlan/tensorflow | df4e6ca72c0c2e9d8c1e1220c2f2127af4ebfd0c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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... | 35.751479 | 82 | 0.743462 |
ae52f8d79c3d12d5ed53e23e1f48e932e59b1fa2 | 6,071 | py | Python | khal/utils.py | pjkaufman/khal | 969d27ea7c877dd0d8439dce7d74645cf7901c0a | [
"MIT"
] | null | null | null | khal/utils.py | pjkaufman/khal | 969d27ea7c877dd0d8439dce7d74645cf7901c0a | [
"MIT"
] | null | null | null | khal/utils.py | pjkaufman/khal | 969d27ea7c877dd0d8439dce7d74645cf7901c0a | [
"MIT"
] | 1 | 2022-02-25T08:27:17.000Z | 2022-02-25T08:27:17.000Z | # Copyright (c) 2013-2021 khal contributors
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publi... | 32.121693 | 94 | 0.653764 |
57864c1068511a5043ae347bfecf582bc8dafe19 | 43,828 | py | Python | Scripts/calc_fitness.py | jsa-aerial/aerobio | 9d845355874c304b5e739c81ca3a7b7cd78dbbd9 | [
"MIT"
] | 3 | 2018-01-23T16:08:30.000Z | 2020-11-17T19:40:12.000Z | Scripts/calc_fitness.py | jsa-aerial/aerobio | 9d845355874c304b5e739c81ca3a7b7cd78dbbd9 | [
"MIT"
] | 13 | 2017-06-08T19:17:52.000Z | 2020-09-04T21:26:30.000Z | Scripts/calc_fitness.py | jsa-aerial/aerobio | 9d845355874c304b5e739c81ca3a7b7cd78dbbd9 | [
"MIT"
] | 1 | 2022-03-03T02:18:02.000Z | 2022-03-03T02:18:02.000Z | # A translation of calc_fitness.pl into python! For analysis of Tn-Seq.
# This script requires BioPython, which in turn has a good number of dependencies (some optional but very helpful).
# How to install BioPython and a list of its dependencies can be found here: http://biopython.org/DIST/docs/install/Installation.htm... | 58.593583 | 313 | 0.31343 |
6c07cba0178817c875dc93353c66ec217fc996e9 | 125,365 | py | Python | src/238. Product of Array Except Self.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/238. Product of Array Except Self.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/238. Product of Array Except Self.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | class Solution(object):
def productExceptSelf(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
N = len(nums)
# print 'N', N
res = [1] * N
p = 1
for i, num in enumerate(nums):
res[i] = p
p = p * num
p = 1
for i in xrange(N-1, -1, -1):
res[i] *= p
num = nums[i]
p = p *... | 5,014.6 | 125,025 | 0.400455 |
30f1a139218cb57fb6d1627b080669746b771808 | 83 | py | Python | tests/config.py | jaebradley/nba_data | 30d817bbc1c5474774f97f3800354492e382d206 | [
"MIT"
] | 8 | 2017-01-07T13:32:16.000Z | 2019-08-08T17:36:26.000Z | tests/config.py | jaebradley/nba_data | 30d817bbc1c5474774f97f3800354492e382d206 | [
"MIT"
] | 72 | 2016-09-01T01:21:07.000Z | 2021-03-25T21:41:38.000Z | tests/config.py | jaebradley/nba_data | 30d817bbc1c5474774f97f3800354492e382d206 | [
"MIT"
] | 4 | 2016-12-06T10:30:59.000Z | 2021-09-08T21:23:43.000Z | import os
ROOT_DIRECTORY = root_path = os.path.dirname(os.path.dirname(__file__)) | 20.75 | 71 | 0.783133 |
c40bb890dbb6394f3a47a42b92b4fcaf899c1254 | 1,010 | py | Python | Week-3/fitness.py | andredosreis/BYU-Programming-with-fuctions | bfdeb410bc7f0f4ccff16db3667df578c23139ce | [
"MIT"
] | 1 | 2021-11-17T11:26:54.000Z | 2021-11-17T11:26:54.000Z | Week-3/fitness.py | andredosreis/BYU-Programming-with-fuctions | bfdeb410bc7f0f4ccff16db3667df578c23139ce | [
"MIT"
] | null | null | null | Week-3/fitness.py | andredosreis/BYU-Programming-with-fuctions | bfdeb410bc7f0f4ccff16db3667df578c23139ce | [
"MIT"
] | null | null | null | from datetime import datetime
def main():
gender = str(input('Please enter your gender (M or F): ')).strip().upper()[0]
bir_date = str(input('Please enter your Birthdate (YYYY-MM-DD): '))
lb = float(input('Enter your wight is US pounds:'))
inches = float(input('Enter your height is US inches: '))... | 28.857143 | 102 | 0.646535 |
ce2e76d511fcafe19d2813e9aeeb840110b77048 | 88 | py | Python | spirit/comment/__init__.py | Ke-xueting/Spirit | 346d9a0db125ee8995ba5d0ab0fd8b43aa8c5dc7 | [
"MIT"
] | 974 | 2015-01-02T12:56:00.000Z | 2022-03-24T00:01:54.000Z | spirit/comment/__init__.py | Ke-xueting/Spirit | 346d9a0db125ee8995ba5d0ab0fd8b43aa8c5dc7 | [
"MIT"
] | 247 | 2015-01-07T02:59:26.000Z | 2022-02-23T08:27:57.000Z | spirit/comment/__init__.py | BinaryTree0/fer3 | 85c3bbf2f328e69ad4d7c01b6e2c8d4ef1d9e0a3 | [
"MIT"
] | 366 | 2015-01-08T10:22:25.000Z | 2022-02-21T12:58:31.000Z | # -*- coding: utf-8 -*-
default_app_config = 'spirit.comment.apps.SpiritCommentConfig'
| 22 | 62 | 0.727273 |
9e93a38d5205c381740304ddf81c4d8107350c8b | 34,618 | py | Python | mendeleev/models.py | lmmentel/mendeleev | f6ac866c831e3041910ae97a7177301b1be5b3e7 | [
"MIT"
] | 105 | 2019-08-25T22:59:22.000Z | 2022-03-29T07:18:01.000Z | mendeleev/models.py | lmmentel/mendeleev | f6ac866c831e3041910ae97a7177301b1be5b3e7 | [
"MIT"
] | 32 | 2019-08-25T23:03:19.000Z | 2022-01-29T19:32:46.000Z | mendeleev/models.py | lmmentel/mendeleev | f6ac866c831e3041910ae97a7177301b1be5b3e7 | [
"MIT"
] | 29 | 2019-09-30T16:20:15.000Z | 2022-03-09T02:28:55.000Z | # -*- coding: utf-8 -*-
"""module specifying the database models"""
from typing import Any, Callable, Dict, List, Tuple, Union
from operator import attrgetter
import numpy as np
from sqlalchemy import Column, Boolean, Integer, String, Float, ForeignKey
from sqlalchemy.orm import relationship, reconstructor
from sqla... | 34.757028 | 109 | 0.620169 |
e92febf41350fd8291ef341f94e92c98338e02c9 | 256 | py | Python | odoo-13.0/addons/l10n_mx/models/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/l10n_mx/models/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/l10n_mx/models/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # coding: utf-8
# Copyright 2016 Vauxoo (https://www.vauxoo.com) <info@vauxoo.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import account
from . import res_bank
from . import res_config_settings
from . import chart_template
| 28.444444 | 66 | 0.75 |
b843d3fbbdd85bdcd25f452130b1630cc2697975 | 2,205 | py | Python | backend/instaff_34140/urls.py | crowdbotics-apps/instaff-34140 | a151d84be18b8c704fb3a1ac631dd19d22902ca8 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/instaff_34140/urls.py | crowdbotics-apps/instaff-34140 | a151d84be18b8c704fb3a1ac631dd19d22902ca8 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/instaff_34140/urls.py | crowdbotics-apps/instaff-34140 | a151d84be18b8c704fb3a1ac631dd19d22902ca8 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """instaff_34140 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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... | 35 | 87 | 0.711565 |
1b7d57af694421f98ba5da57ae3cc212fda0aa53 | 15,999 | py | Python | src/Ufd/Ufd.py | emboiko/Ufd | 4f49340af858afd64c0d33e2aefd0a193af3a1ce | [
"MIT"
] | null | null | null | src/Ufd/Ufd.py | emboiko/Ufd | 4f49340af858afd64c0d33e2aefd0a193af3a1ce | [
"MIT"
] | null | null | null | src/Ufd/Ufd.py | emboiko/Ufd | 4f49340af858afd64c0d33e2aefd0a193af3a1ce | [
"MIT"
] | null | null | null | from tkinter import (
Tk,
PanedWindow,
Listbox,
Button,
Scrollbar,
PhotoImage,
messagebox
)
from tkinter.ttk import Treeview, Style
from os.path import normpath, dirname, isdir, isfile, split as path_split
from re import findall, sub, split as re_split
from platform import system
from subpro... | 28.11775 | 81 | 0.534846 |
b76e74560696d67e9e974f45966b3484630d6c78 | 2,720 | py | Python | test/test_ssh_extension.py | traversaro/rocker | 4b813025ac9a0de5bc6904dbd2b2510a4733986b | [
"Apache-2.0"
] | 259 | 2019-01-09T06:39:04.000Z | 2022-03-30T11:29:04.000Z | test/test_ssh_extension.py | traversaro/rocker | 4b813025ac9a0de5bc6904dbd2b2510a4733986b | [
"Apache-2.0"
] | 150 | 2019-01-03T00:06:16.000Z | 2022-03-17T01:44:20.000Z | test/test_ssh_extension.py | traversaro/rocker | 4b813025ac9a0de5bc6904dbd2b2510a4733986b | [
"Apache-2.0"
] | 37 | 2019-02-21T20:39:00.000Z | 2022-01-03T20:02:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.260274 | 121 | 0.711397 |
616b5946e0ec9d53da6faed413ccf2b473187ece | 3,249 | py | Python | scripts/india_census/primary_census_abstract_houseless_population/preprocess.py | thejeshgn/data | 945af2e1269b914ff1e3169880169161f4137a58 | [
"Apache-2.0"
] | 25 | 2020-07-18T04:44:57.000Z | 2022-03-03T14:44:20.000Z | scripts/india_census/primary_census_abstract_houseless_population/preprocess.py | thejeshgn/data | 945af2e1269b914ff1e3169880169161f4137a58 | [
"Apache-2.0"
] | 276 | 2020-05-09T00:57:50.000Z | 2022-03-29T23:27:38.000Z | scripts/india_census/primary_census_abstract_houseless_population/preprocess.py | thejeshgn/data | 945af2e1269b914ff1e3169880169161f4137a58 | [
"Apache-2.0"
] | 59 | 2020-05-09T00:45:30.000Z | 2022-03-28T16:03:53.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.703297 | 76 | 0.714374 |
7617005f1768d511a7cb1e653025ac9e641d68a7 | 256 | py | Python | CursoEmVideo/Mundo1_Fundamentos/desafio014.py | jacksontenorio8/python | a484f019960faa5aa29177eff44a1bb1e3f3b9d0 | [
"MIT"
] | null | null | null | CursoEmVideo/Mundo1_Fundamentos/desafio014.py | jacksontenorio8/python | a484f019960faa5aa29177eff44a1bb1e3f3b9d0 | [
"MIT"
] | null | null | null | CursoEmVideo/Mundo1_Fundamentos/desafio014.py | jacksontenorio8/python | a484f019960faa5aa29177eff44a1bb1e3f3b9d0 | [
"MIT"
] | null | null | null | """@jacksontenorio8
Escreva um programa que converta uma temperatura
digitada em ºC e converta para ºF
"""
tc = float(input('Informe a temperatura em ºC: '))
tf = float((tc * 1.8) + 32)
print('A temperatura de {}ºC corresponde a {:.1f}ºF!'.format(tc, tf)) | 36.571429 | 69 | 0.699219 |
8c7afb49711fdccebdbf95cc9e21371fb3e4dd0f | 3,245 | py | Python | test/templaters_test.py | ryantuck/sqlfluff | 323d99d6ea3bd5d401944b7dd08a230b0fad32dc | [
"MIT"
] | null | null | null | test/templaters_test.py | ryantuck/sqlfluff | 323d99d6ea3bd5d401944b7dd08a230b0fad32dc | [
"MIT"
] | null | null | null | test/templaters_test.py | ryantuck/sqlfluff | 323d99d6ea3bd5d401944b7dd08a230b0fad32dc | [
"MIT"
] | null | null | null | """Tests for templaters."""
import pytest
from sqlfluff.templaters import (RawTemplateInterface, templater_selector,
PythonTemplateInterface, JinjaTemplateInterface)
from sqlfluff.linter import Linter
from sqlfluff.config import FluffConfig
from sqlfluff.errors import SQLTemplaterErro... | 33.453608 | 126 | 0.712173 |
52cd8cd19eb019f9f5366148bd0ce7e2ff83224a | 1,410 | py | Python | venv/lib/python2.7/dist-packages/landscape/monitor/networkdevice.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/dist-packages/landscape/monitor/networkdevice.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/dist-packages/landscape/monitor/networkdevice.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | """
A monitor plugin that collects data on a machine's network devices.
"""
from landscape.monitor.plugin import DataWatcher
from landscape.lib.network import get_active_device_info
class NetworkDevice(DataWatcher):
message_type = "network-device"
message_key = "devices"
persist_name = message_type
... | 35.25 | 74 | 0.642553 |
8b46aa854c740f5416fa2e2882f47f5fe2863127 | 1,865 | py | Python | model_sqlite.py | rodolphedescorraille/pythonProjetIpsii | c380d1f5cdb3e38240063c6d7ca8975e27304cf8 | [
"MIT"
] | null | null | null | model_sqlite.py | rodolphedescorraille/pythonProjetIpsii | c380d1f5cdb3e38240063c6d7ca8975e27304cf8 | [
"MIT"
] | null | null | null | model_sqlite.py | rodolphedescorraille/pythonProjetIpsii | c380d1f5cdb3e38240063c6d7ca8975e27304cf8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from string import ascii_letters, digits
from itertools import chain
from random import choice
import os
import os, sys
import sqlite3
def create_uid(n=9):
'''Génère une chaîne de caractères alétoires de longueur n
en évitant 0, O, I, l pour être sympa.'''
chrs = [ c for c in chain(as... | 27.426471 | 98 | 0.57748 |
5668f0e231e9e1c5219d3645188bb2a5bfd854ca | 434 | py | Python | Source Code/28_system_details.py | insanecodes/Python | e3e022fa5ff83e418dae32c661296224fc8ded36 | [
"MIT"
] | 22 | 2020-10-11T13:56:25.000Z | 2021-11-10T12:53:10.000Z | Source Code/28_system_details.py | insanecodes/Python | e3e022fa5ff83e418dae32c661296224fc8ded36 | [
"MIT"
] | null | null | null | Source Code/28_system_details.py | insanecodes/Python | e3e022fa5ff83e418dae32c661296224fc8ded36 | [
"MIT"
] | 8 | 2020-10-16T12:58:29.000Z | 2021-12-30T01:28:16.000Z | import platform
# displaying OS name
print('system :', platform.system())
# display node name
print('node :', platform.node())
# display system’s release
print('release :', platform.release())
# display system’s release version
print('version :', platform.version())
# display the machine type
print... | 31 | 41 | 0.691244 |
16541b8f282be92b445dc97dcfd8c82f9769192f | 12,333 | py | Python | train_symp.py | kage08/CAMul | 79f8a27f472943229fb087bae8e405e38e5e0b47 | [
"MIT"
] | null | null | null | train_symp.py | kage08/CAMul | 79f8a27f472943229fb087bae8e405e38e5e0b47 | [
"MIT"
] | null | null | null | train_symp.py | kage08/CAMul | 79f8a27f472943229fb087bae8e405e38e5e0b47 | [
"MIT"
] | 3 | 2021-10-10T19:53:29.000Z | 2021-12-04T15:53:23.000Z | import pickle
from optparse import OptionParser
import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
from numpy.core.fromnumeric import mean
import pandas as pd
import torch
import torch.optim as optim
import torch.nn as nn
from sklearn.preprocessing import StandardScaler
from symp_extract.consts i... | 33.153226 | 88 | 0.70437 |
fe91c93580407fb9871f81c41d70b85675094aba | 266 | py | Python | myapp/models.py | heet9201/healing-hands | 8473ccfce4f08b2327bccc19702938802609a27a | [
"MIT"
] | null | null | null | myapp/models.py | heet9201/healing-hands | 8473ccfce4f08b2327bccc19702938802609a27a | [
"MIT"
] | null | null | null | myapp/models.py | heet9201/healing-hands | 8473ccfce4f08b2327bccc19702938802609a27a | [
"MIT"
] | null | null | null | import email
from sqlite3 import Timestamp
from django.db import models
# Create your models here.
class Join(models.Model):
email = models.EmailField()
Timestamp = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.email
| 19 | 55 | 0.733083 |
64de09e02d6f3ba06b33c7a9e1725eb6e6065aa0 | 18,991 | py | Python | TrainingExtensions/tensorflow/test/python/test_batch_norm_fold.py | Rohan-Chaudhury/aimet | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | [
"BSD-3-Clause"
] | 945 | 2020-04-30T02:23:55.000Z | 2022-03-31T08:44:32.000Z | TrainingExtensions/tensorflow/test/python/test_batch_norm_fold.py | Rohan-Chaudhury/aimet | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | [
"BSD-3-Clause"
] | 563 | 2020-05-01T03:07:22.000Z | 2022-03-30T05:35:58.000Z | TrainingExtensions/tensorflow/test/python/test_batch_norm_fold.py | Rohan-Chaudhury/aimet | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | [
"BSD-3-Clause"
] | 186 | 2020-04-30T00:55:26.000Z | 2022-03-30T09:54:51.000Z | #!/usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2019,2020, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifica... | 43.960648 | 120 | 0.654363 |
6a26877bccb41243ed37ced475f9b37c3191c541 | 8,712 | py | Python | NeuralEvolution/network.py | onildojoao/SpaceInvaders-with-NEAT | 724789605b0ddf0820968b32ec26c2e6c06ac7c8 | [
"MIT"
] | null | null | null | NeuralEvolution/network.py | onildojoao/SpaceInvaders-with-NEAT | 724789605b0ddf0820968b32ec26c2e6c06ac7c8 | [
"MIT"
] | null | null | null | NeuralEvolution/network.py | onildojoao/SpaceInvaders-with-NEAT | 724789605b0ddf0820968b32ec26c2e6c06ac7c8 | [
"MIT"
] | null | null | null | from NeuralEvolution.neuron import Neuron
from NeuralEvolution.gene import Gene
import NeuralEvolution.config as config
from copy import deepcopy
import numpy as np
import math
from sklearn import preprocessing
class Network(object):
def __init__(self, topology, innovation):
# Neural Net meta data
... | 35.851852 | 119 | 0.599174 |
36ea1f9c7f370cf50d7366240a968c3ea4c851af | 235 | py | Python | load_test.py | frezik/Bodgery-Slack-Gaming | dc9388702f47707f1f0800b2df1896b7b30303e3 | [
"BSD-2-Clause"
] | null | null | null | load_test.py | frezik/Bodgery-Slack-Gaming | dc9388702f47707f1f0800b2df1896b7b30303e3 | [
"BSD-2-Clause"
] | null | null | null | load_test.py | frezik/Bodgery-Slack-Gaming | dc9388702f47707f1f0800b2df1896b7b30303e3 | [
"BSD-2-Clause"
] | null | null | null | import unittest
import diceroll
import mentionrouter
class TestLoad(unittest.TestCase):
'''ensure we can load our classes'''
def test_load(self):
self.assertTrue( True )
if __name__ == '__main__':
unittest.main()
| 19.583333 | 40 | 0.702128 |
31a8285615835044434bf226afcce2ac40f9a7d8 | 4,424 | py | Python | isi_sdk_8_0/isi_sdk_8_0/models/worm_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_0/isi_sdk_8_0/models/worm_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_0/isi_sdk_8_0/models/worm_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 3
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class WormCreateParams(object):
... | 30.937063 | 109 | 0.613472 |
c34f4c0d01064878df6a778b6753d34a9c91d429 | 7,484 | py | Python | sebs/local/storage.py | opal-mimuw/serverless-benchmarks | 16ac3988b3891a6ad2ae91e7c7175315d924c70c | [
"BSD-3-Clause"
] | 35 | 2020-12-30T19:31:30.000Z | 2022-03-28T11:10:00.000Z | sebs/local/storage.py | opal-mimuw/serverless-benchmarks | 16ac3988b3891a6ad2ae91e7c7175315d924c70c | [
"BSD-3-Clause"
] | 24 | 2021-01-04T15:37:05.000Z | 2022-03-14T00:45:20.000Z | sebs/local/storage.py | opal-mimuw/serverless-benchmarks | 16ac3988b3891a6ad2ae91e7c7175315d924c70c | [
"BSD-3-Clause"
] | 10 | 2021-06-13T13:13:39.000Z | 2021-12-20T22:05:50.000Z | import json
import os
import secrets
import uuid
from typing import List, Optional
import docker
import minio
from sebs.cache import Cache
from ..faas.storage import PersistentStorage
class Minio(PersistentStorage):
@staticmethod
def typename() -> str:
return "Local.Minio"
@staticmethod
def... | 39.808511 | 98 | 0.618653 |
8afa0707cd9bf5186110c1955c4b66c89d908eed | 36,321 | py | Python | dVRL_simulator/PsmEnv_Position_rail_target_obs.py | Cladett/rlman | fe3ab769ed7cdb45bd950c1c93bda19a8e6d6eea | [
"MIT"
] | null | null | null | dVRL_simulator/PsmEnv_Position_rail_target_obs.py | Cladett/rlman | fe3ab769ed7cdb45bd950c1c93bda19a8e6d6eea | [
"MIT"
] | null | null | null | dVRL_simulator/PsmEnv_Position_rail_target_obs.py | Cladett/rlman | fe3ab769ed7cdb45bd950c1c93bda19a8e6d6eea | [
"MIT"
] | null | null | null | """
@brief Script used to control the main steps of the pick of the PAF rail
and place it over the red circular target.
@author Claudia D'Ettorre (c.dettorre@ucl.ac.uk)
@date 03 Sep 2020
"""
import time
import numpy as np
from numpy.linalg import inv
from scipy.spatial.transform import Rotation as R
# My... | 42.431075 | 108 | 0.586713 |
991f793dca2bd3cabeeae9a99a7d98205f344577 | 1,779 | py | Python | loss.py | simplerick/GANs | cef3cee7b316b563981f4c1a5e553410d103b70b | [
"MIT"
] | 3 | 2020-10-14T03:16:42.000Z | 2022-01-21T21:18:26.000Z | loss.py | simplerick/stylegan2_pytorch | cef3cee7b316b563981f4c1a5e553410d103b70b | [
"MIT"
] | null | null | null | loss.py | simplerick/stylegan2_pytorch | cef3cee7b316b563981f4c1a5e553410d103b70b | [
"MIT"
] | null | null | null | import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
def G_logistic_ns(fake_logits):
return -F.logsigmoid(fake_logits).mean() # -log(D(G(z)))
def D_logistic(real_logits, fake_logits):
return torch.mean(-F.logsigmoid(real_logits) + F.softplus(fake_logits)) # -log(D(x)) - log(... | 30.672414 | 123 | 0.614952 |
31ef48379ba16768860a30044b2e51a0d9ad49d4 | 2,558 | py | Python | common/HtmlUtils.py | loveflycforever/TypeY | a002dc46be1d6f458abfbc27c3e5763ae739487f | [
"MIT"
] | null | null | null | common/HtmlUtils.py | loveflycforever/TypeY | a002dc46be1d6f458abfbc27c3e5763ae739487f | [
"MIT"
] | null | null | null | common/HtmlUtils.py | loveflycforever/TypeY | a002dc46be1d6f458abfbc27c3e5763ae739487f | [
"MIT"
] | null | null | null | import datetime
import os
import certifi
import urllib3
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
# 写入文件
def write_file(file_path, text_content):
with open(file_path, 'w', encoding='utf-8') as f:
f.write(datetime.datetime.now().strftime('<!-- [store... | 28.10989 | 117 | 0.652463 |
cb1f7967f0fd252afa3b5bb507ca8039f56d8659 | 808 | py | Python | grid.py | zengxinzhy/HiDT | 3a223d727e6888dfcdfd5e81bd83df428d3a5596 | [
"BSD-3-Clause"
] | null | null | null | grid.py | zengxinzhy/HiDT | 3a223d727e6888dfcdfd5e81bd83df428d3a5596 | [
"BSD-3-Clause"
] | null | null | null | grid.py | zengxinzhy/HiDT | 3a223d727e6888dfcdfd5e81bd83df428d3a5596 | [
"BSD-3-Clause"
] | null | null | null | import torch
import sys
import coremltools as ct
class Grid(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, content):
[c, h, w] = content.shape
h = h // 4
w = w // 4
return content.reshape(c, h * 4, w, 4).transpose(2, 3).reshape(c, h, 4*4, w)... | 28.857143 | 109 | 0.581683 |
413a0d0e48ced45980a24dbd303a8c1d33a7b819 | 23,270 | py | Python | venv/lib/python3.8/site-packages/azureml/_vendor/azure_network/operations/_virtual_wans_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azureml/_vendor/azure_network/operations/_virtual_wans_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azureml/_vendor/azure_network/operations/_virtual_wans_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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.
# C... | 47.200811 | 167 | 0.65303 |
1648691838c6f8039aec52555a45ef4790e698de | 15,946 | py | Python | bikeshed/htmlhelpers.py | dontcallmedom/bikeshed | ae3b4eaa941e5ea380931f30ba9a0086026a44aa | [
"CC0-1.0"
] | 2 | 2016-07-21T16:44:51.000Z | 2019-04-29T15:04:51.000Z | bikeshed/htmlhelpers.py | dontcallmedom/bikeshed | ae3b4eaa941e5ea380931f30ba9a0086026a44aa | [
"CC0-1.0"
] | null | null | null | bikeshed/htmlhelpers.py | dontcallmedom/bikeshed | ae3b4eaa941e5ea380931f30ba9a0086026a44aa | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import hashlib
import html5lib
from html5lib import treewalkers
from html5lib.serializer import htmlserializer
from lxml import html
from lxml import etree
from lxml.cssselect import CSSSelector
from collections import Counter
import re
import HT... | 32.67623 | 130 | 0.614072 |
0d62446a124cc06803f7a735b24780e7d67c5c15 | 31,793 | py | Python | haystack/document_stores/faiss.py | OmniscienceAcademy/haystack | 46fa166c36d4b2fb0f428041fb048e50613553a9 | [
"Apache-2.0"
] | null | null | null | haystack/document_stores/faiss.py | OmniscienceAcademy/haystack | 46fa166c36d4b2fb0f428041fb048e50613553a9 | [
"Apache-2.0"
] | null | null | null | haystack/document_stores/faiss.py | OmniscienceAcademy/haystack | 46fa166c36d4b2fb0f428041fb048e50613553a9 | [
"Apache-2.0"
] | null | null | null | from typing import TYPE_CHECKING, Any, Union, List, Optional, Dict, Generator
if TYPE_CHECKING:
from haystack.nodes.retriever import BaseRetriever
import json
import logging
import warnings
import numpy as np
from copy import deepcopy
from pathlib import Path
from tqdm.auto import tqdm
from inspect import Signatu... | 48.987673 | 200 | 0.625358 |
bb729580583bf5b76851765a5e4db12d97600926 | 4,012 | py | Python | parl/framework/tests/policy_distribution_test.py | alexqdh/PARL | e91150b84c631ed58a3f53232d463f8193f43dee | [
"Apache-2.0"
] | null | null | null | parl/framework/tests/policy_distribution_test.py | alexqdh/PARL | e91150b84c631ed58a3f53232d463f8193f43dee | [
"Apache-2.0"
] | null | null | null | parl/framework/tests/policy_distribution_test.py | alexqdh/PARL | e91150b84c631ed58a3f53232d463f8193f43dee | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle 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 app... | 37.495327 | 79 | 0.648554 |
887ece87e2337a5db568e49b1d5ee7fbcd3682ef | 3,440 | py | Python | tests/integration/netapi/test_client.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | tests/integration/netapi/test_client.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | tests/integration/netapi/test_client.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 1 | 2018-04-19T16:57:27.000Z | 2018-04-19T16:57:27.000Z | # encoding: utf-8
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
from integration import TMP_CONF_DIR
from salttesting import TestCase
# Import Salt libs
import salt.config
import salt.netapi
class NetapiClientTest(TestCase):
eauth_creds = {
'username':... | 29.913043 | 81 | 0.55843 |
65ab889e68f2c545d4aeba2035033f683dd723ba | 2,273 | py | Python | pyBAScloudAPI/tests/tenant_tests.py | bascloud/BASCloudAPI | 6a06d430720e99204f84f5362b4f22d7d4a72b76 | [
"MIT"
] | 3 | 2021-04-30T07:44:11.000Z | 2021-05-03T06:35:01.000Z | pyBAScloudAPI/tests/tenant_tests.py | bascloud/BASCloudAPI | 6a06d430720e99204f84f5362b4f22d7d4a72b76 | [
"MIT"
] | 9 | 2021-06-23T04:21:51.000Z | 2022-01-17T04:15:06.000Z | pyBAScloudAPI/tests/tenant_tests.py | bascloud/BAScloudAPI | 6a06d430720e99204f84f5362b4f22d7d4a72b76 | [
"MIT"
] | null | null | null | import unittest
import time
import datetime
from definitions import *
import pyBAScloudAPI as api
BCAPI = api.EntityContext(BASCLOUD_TEST_URL)
def errorHandler(e, j):
raise e
def authenticate():
currentDateTime = int(time.time())
print("CURRENT DATETIME: ", currentDateTime)
currentDateTimeString... | 29.141026 | 118 | 0.698196 |
5aa6e72026e62471b4589b6775e7703bd5073612 | 8,018 | py | Python | sdk/python/pulumi_azure_nextgen/sqlvirtualmachine/get_sql_virtual_machine_group.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/sqlvirtualmachine/get_sql_virtual_machine_group.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/sqlvirtualmachine/get_sql_virtual_machine_group.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 38 | 249 | 0.663881 |
1fe8c231e48c7dbb97254c41accfeb0d346e6e30 | 3,866 | py | Python | src/executor.py | Softaria/math-processor | 3e7939412a41eac69cf37e87833ab2c323cc11a9 | [
"BSD-3-Clause"
] | 1 | 2020-04-14T04:42:31.000Z | 2020-04-14T04:42:31.000Z | src/executor.py | softaria/math-processor | 3e7939412a41eac69cf37e87833ab2c323cc11a9 | [
"BSD-3-Clause"
] | 2 | 2020-04-02T07:30:10.000Z | 2020-04-02T18:47:15.000Z | src/executor.py | softaria/math-processor | 3e7939412a41eac69cf37e87833ab2c323cc11a9 | [
"BSD-3-Clause"
] | null | null | null | from sympy import *
import json
import sys
from sympy.integrals.manualintegrate import integral_steps
from sympy.parsing.sympy_parser import parse_expr
from enum import Enum
class Equiv(str,Enum):
identical = "identical"
equiv = "equiv"
equivCalc = "equivCalc"
different = "different"
class Simpler(str... | 33.327586 | 147 | 0.542162 |
c7e05fe05d75f39132e5e08828bfe3976b8dad30 | 8,119 | py | Python | lib_hyp/utils/utils.py | anupam312nwd/DCRNN_PyTorch | 7a0703ddb28036d223993079bf8f849b8c6f11ea | [
"MIT"
] | null | null | null | lib_hyp/utils/utils.py | anupam312nwd/DCRNN_PyTorch | 7a0703ddb28036d223993079bf8f849b8c6f11ea | [
"MIT"
] | null | null | null | lib_hyp/utils/utils.py | anupam312nwd/DCRNN_PyTorch | 7a0703ddb28036d223993079bf8f849b8c6f11ea | [
"MIT"
] | null | null | null | #!/usr/bin/env/python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from collections import defaultdict
import os
import pickle
import json
import torch.nn as nn
import ... | 30.637736 | 105 | 0.681611 |
93e4d07598edb77622167b3b0a75cfd93dd90e43 | 4,491 | py | Python | profiles_api/views.py | armstrongq22/profiles-rest-api | e371997bc7006f19c4e5a2073651df2ecd47a128 | [
"MIT"
] | 1 | 2020-04-24T04:40:55.000Z | 2020-04-24T04:40:55.000Z | profiles_api/views.py | armstrongq22/profiles-rest-api | e371997bc7006f19c4e5a2073651df2ecd47a128 | [
"MIT"
] | 4 | 2020-04-04T20:48:56.000Z | 2021-06-10T19:58:04.000Z | profiles_api/views.py | armstrongq22/profiles-rest-api | e371997bc7006f19c4e5a2073651df2ecd47a128 | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from res... | 34.546154 | 76 | 0.663772 |
06e98a4d373614b8b4f6bd2707fde76cd1a9c586 | 289 | py | Python | src/training/Core2/Chapter15RegularExpressions/exercise15_25.py | MagicForest/Python | 8af56e9384061504f05b229467c922ba71a433cb | [
"Apache-2.0"
] | null | null | null | src/training/Core2/Chapter15RegularExpressions/exercise15_25.py | MagicForest/Python | 8af56e9384061504f05b229467c922ba71a433cb | [
"Apache-2.0"
] | null | null | null | src/training/Core2/Chapter15RegularExpressions/exercise15_25.py | MagicForest/Python | 8af56e9384061504f05b229467c922ba71a433cb | [
"Apache-2.0"
] | null | null | null | import re
def get_username_domain1_domain2(a_string):
return re.findall('(\w+)@(\w+)\.(\w+)', a_string)
if __name__ == '__main__':
assert [('abc', '126', 'com'), ('a', '133', 'com')] == get_username_domain1_domain2('abc@126.com xx a@133.com b')
print 'all passed.'
| 28.9 | 118 | 0.602076 |
f8aa7d821e7b761f6689cb93e43d0f5137785888 | 8,457 | py | Python | Bot/cogs/log.py | Shuri2060/Nurevam | 6008f1d1732617762481899faae98d4478216d51 | [
"MIT"
] | 145 | 2016-05-17T12:49:23.000Z | 2022-03-02T14:04:45.000Z | Bot/cogs/log.py | Shuri2060/Nurevam | 6008f1d1732617762481899faae98d4478216d51 | [
"MIT"
] | 5 | 2016-04-13T11:10:59.000Z | 2021-01-13T23:50:17.000Z | Bot/cogs/log.py | Shuri2060/Nurevam | 6008f1d1732617762481899faae98d4478216d51 | [
"MIT"
] | 15 | 2016-04-13T11:16:45.000Z | 2020-07-16T15:22:07.000Z | from discord.ext import commands
from .utils import utils
from PIL import Image
import datetime
import asyncio
import discord
import aiohttp
import logging
import io
log = logging.getLogger(__name__)
class Log(commands.Cog):
def __init__(self,bot):
self.bot = bot
self.redis = bot.db.redis
... | 44.277487 | 178 | 0.547475 |
3f7951345c7b68068eabd5b801ef22794cc1f443 | 2,007 | py | Python | dev_tools/run_simple_checks.py | viathor/OpenFermion-Cirq | b4b7f8d82c40f0a6282873b5d2867e9d8778cea6 | [
"Apache-2.0"
] | 278 | 2018-07-18T23:43:16.000Z | 2022-01-02T21:38:08.000Z | dev_tools/run_simple_checks.py | viathor/OpenFermion-Cirq | b4b7f8d82c40f0a6282873b5d2867e9d8778cea6 | [
"Apache-2.0"
] | 131 | 2018-07-18T19:04:58.000Z | 2020-08-04T21:05:42.000Z | dev_tools/run_simple_checks.py | viathor/OpenFermion-Cirq | b4b7f8d82c40f0a6282873b5d2867e9d8778cea6 | [
"Apache-2.0"
] | 101 | 2018-07-18T21:43:50.000Z | 2022-03-04T09:51:02.000Z | #!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 27.875 | 80 | 0.632287 |
d5fd2eb6317040a1abff16656e8af02a5fbba37b | 636 | py | Python | olm_tasks/predictor_utils.py | DFKI-NLP/OLM | ec6d281e77a980e6f8f89ba3be2e8d034031b22c | [
"MIT"
] | 8 | 2020-04-21T10:25:06.000Z | 2022-03-08T18:46:04.000Z | olm_tasks/predictor_utils.py | DFKI-NLP/OLM | ec6d281e77a980e6f8f89ba3be2e8d034031b22c | [
"MIT"
] | null | null | null | olm_tasks/predictor_utils.py | DFKI-NLP/OLM | ec6d281e77a980e6f8f89ba3be2e8d034031b22c | [
"MIT"
] | 2 | 2020-04-27T07:49:58.000Z | 2020-08-11T17:56:25.000Z | from typing import Optional
from os.path import join
from allennlp.predictors import Predictor
from allennlp.models.archival import load_archive
def load_predictor(model_dir: str,
predictor_name: str,
cuda_device: int = -1,
archive_filename: str = "model.tar.g... | 37.411765 | 78 | 0.671384 |
fbf555969c5e2014488b5b499aab51272a941e91 | 1,283 | py | Python | addons/Sprytile-6b68d00/rx/linq/observable/select.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | 733 | 2017-08-22T09:47:54.000Z | 2022-03-27T23:56:52.000Z | rx/linq/observable/select.py | asheraryam/Sprytile | c63be50d14b07192ff134ceab256f0d69b9c4c92 | [
"MIT"
] | 74 | 2017-08-16T09:13:05.000Z | 2022-03-15T02:31:49.000Z | rx/linq/observable/select.py | asheraryam/Sprytile | c63be50d14b07192ff134ceab256f0d69b9c4c92 | [
"MIT"
] | 77 | 2017-09-14T16:56:11.000Z | 2022-03-27T13:55:16.000Z | from rx import Observable, AnonymousObservable
from rx.internal.utils import adapt_call
from rx.internal import extensionmethod
@extensionmethod(Observable, alias="map")
def select(self, selector):
"""Project each element of an observable sequence into a new form
by incorporating the element's index.
1 -... | 31.292683 | 80 | 0.667966 |
66028e24a018765b0ca80f71eb20e7d9400f496b | 1,365 | py | Python | tests/test_utils.py | andrlik/django-quotes | 414ed25f93944ed3402eb86c5051e5acf1594efe | [
"BSD-3-Clause"
] | null | null | null | tests/test_utils.py | andrlik/django-quotes | 414ed25f93944ed3402eb86c5051e5acf1594efe | [
"BSD-3-Clause"
] | 7 | 2022-03-02T21:18:57.000Z | 2022-03-29T05:36:38.000Z | tests/test_utils.py | andrlik/django-quotes | 414ed25f93944ed3402eb86c5051e5acf1594efe | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
import re
import pytest
from django.contrib.auth import get_user_model
from django_quotes.models import SourceGroup
from django_quotes.utils import generate_unique_slug_for_model
pytestmark = pytest.mark.django_db(transaction=True)
User = get_user_model()
def test_unique_genera... | 29.673913 | 88 | 0.731868 |
d3cd2c3dc5d4bbcce07ef585ea82d0756539043f | 4,405 | py | Python | configs/restorers/tdan/tdan_vimeo90k_bdx4_ft_lr5e-5_800k.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | 1 | 2021-09-16T08:55:47.000Z | 2021-09-16T08:55:47.000Z | configs/restorers/tdan/tdan_vimeo90k_bdx4_ft_lr5e-5_800k.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | 1 | 2021-08-05T16:20:39.000Z | 2021-08-05T16:20:39.000Z | configs/restorers/tdan/tdan_vimeo90k_bdx4_ft_lr5e-5_800k.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | null | null | null | exp_name = 'tdan_vimeo90k_bdx4_ft_lr5e-5_800k'
# model settings
model = dict(
type='TDAN',
generator=dict(type='TDANNet'),
pixel_loss=dict(type='MSELoss', loss_weight=1.0, reduction='mean'),
lq_pixel_loss=dict(type='MSELoss', loss_weight=0.01, reduction='mean'))
# model training and testing settings
tr... | 31.241135 | 79 | 0.621112 |
056c7e8ae693dd0a4ad64d889ca1b0cdf5167e05 | 3,797 | py | Python | yt/utilities/configure.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | 1 | 2020-06-22T10:17:01.000Z | 2020-06-22T10:17:01.000Z | yt/utilities/configure.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | 2 | 2020-02-10T22:55:35.000Z | 2020-02-19T21:01:20.000Z | yt/utilities/configure.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | 2 | 2020-05-16T15:29:37.000Z | 2020-06-22T10:17:08.000Z | # -*- coding: UTF-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2016, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------... | 34.834862 | 84 | 0.65183 |
3aa4f00e8fd0b4f80fc348b6290eb950a640f2fe | 17,339 | py | Python | Full_connected_networks/fc_net.py | MilesWQ/MachineLearning | 9ab84607c502681f9c7765a526b7b8d3ad6c8791 | [
"MIT"
] | null | null | null | Full_connected_networks/fc_net.py | MilesWQ/MachineLearning | 9ab84607c502681f9c7765a526b7b8d3ad6c8791 | [
"MIT"
] | null | null | null | Full_connected_networks/fc_net.py | MilesWQ/MachineLearning | 9ab84607c502681f9c7765a526b7b8d3ad6c8791 | [
"MIT"
] | null | null | null | from builtins import range
from builtins import object
import numpy as np
from layers import *
from layer_utils import affine_relu_forward, affine_relu_backward
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network with ReLU nonlinearity and
softmax loss that uses a modular layer desi... | 51.758209 | 90 | 0.502913 |
3e0afd1dd8f300294bc9ecb89b5bb98fbdbc3cf2 | 3,682 | py | Python | lib_Partage_BSS/services/COSService.py | DSI-Universite-Rennes2/libPythonBssApi | 80477806238f0e98cc962ed0f346660a3f2bfbaf | [
"Apache-2.0"
] | 3 | 2018-05-02T09:37:29.000Z | 2022-02-09T07:58:09.000Z | lib_Partage_BSS/services/COSService.py | DSI-Universite-Rennes2/libPythonBssApi | 80477806238f0e98cc962ed0f346660a3f2bfbaf | [
"Apache-2.0"
] | 12 | 2018-05-14T13:17:28.000Z | 2022-03-29T08:21:06.000Z | lib_Partage_BSS/services/COSService.py | DSI-Universite-Rennes2/libPythonBssApi | 80477806238f0e98cc962ed0f346660a3f2bfbaf | [
"Apache-2.0"
] | 7 | 2018-05-02T09:38:15.000Z | 2022-02-09T13:03:01.000Z | # -*-coding:utf-8 -*
"""
Module contenant les méthodes permettant d'appeler les services de l'API BSS concernant les classes de service
"""
import re
from collections import OrderedDict
from time import time
from lib_Partage_BSS import models, utils, services
from lib_Partage_BSS.exceptions import NameException, Domai... | 39.591398 | 135 | 0.658881 |
ebe3c5b1bc212675e3a248d70551a5e1b85cc41a | 10,360 | py | Python | tests/test_acl.py | timgates42/ramses | ea2e1e896325b7256cdf5902309e05fd98e0c14c | [
"Apache-2.0"
] | 178 | 2016-01-29T10:59:56.000Z | 2021-09-17T18:28:24.000Z | tests/test_acl.py | timgates42/ramses | ea2e1e896325b7256cdf5902309e05fd98e0c14c | [
"Apache-2.0"
] | 35 | 2015-03-31T19:52:23.000Z | 2016-01-11T22:44:30.000Z | tests/test_acl.py | timgates42/ramses | ea2e1e896325b7256cdf5902309e05fd98e0c14c | [
"Apache-2.0"
] | 24 | 2016-02-12T02:38:28.000Z | 2020-06-20T23:35:38.000Z | import pytest
from mock import Mock, patch, call
from pyramid.security import (
Allow, Deny,
Everyone, Authenticated,
ALL_PERMISSIONS)
from ramses import acl
from .fixtures import config_mock
class TestACLHelpers(object):
def test_validate_permissions_all_perms(self):
perms = ALL_PERMISSIONS... | 35.972222 | 73 | 0.616023 |
d1a7d366c8239f1b296eafe1f29da7c5d9a22b49 | 40,898 | py | Python | models/language_modeling/tensorflow/bert_large/training/fp32/modeling.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | models/language_modeling/tensorflow/bert_large/training/fp32/modeling.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | models/language_modeling/tensorflow/bert_large/training/fp32/modeling.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 39.629845 | 95 | 0.67727 |
42ad5ed4d91003fb238ec12c4e7e0ee13a87f6d3 | 8,933 | py | Python | wandb/run-20210410_021052-2hk51gm2/files/code/main.py | ccoltong1215/simple-lenet5-torch-mnist | 3eaa25160525f89dd6b9fe1db5de26a2bfda2fea | [
"MIT"
] | null | null | null | wandb/run-20210410_021052-2hk51gm2/files/code/main.py | ccoltong1215/simple-lenet5-torch-mnist | 3eaa25160525f89dd6b9fe1db5de26a2bfda2fea | [
"MIT"
] | 5 | 2021-09-08T03:09:50.000Z | 2022-03-12T00:56:43.000Z | wandb/run-20210410_021052-2hk51gm2/files/code/main.py | ccoltong1215/simple-lenet5-torch-mnist | 3eaa25160525f89dd6b9fe1db5de26a2bfda2fea | [
"MIT"
] | null | null | null |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from dataset import Dataset
from model import LeNet5, CustomMLP
import numpy as np
import matplotlib.pyplot as plt
import wandb
def train(model, trn_loader, device, criterion, optimizer,epoch,modelname):
""" Tr... | 40.420814 | 164 | 0.619949 |
8c8e3904420318de6674a8e6e9081444efe03631 | 43,454 | py | Python | simulator/simp_py/tft_lib.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null | simulator/simp_py/tft_lib.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null | simulator/simp_py/tft_lib.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null | try:
from simp_py.Ubuntu16 import tft_Ubuntu16
from simp_py.DefaultFont import tft_DefaultFont
from simp_py.comic24 import tft_Comic24
from simp_py.def_small import tft_def_small
from simp_py.DejaVuSans18 import tft_Dejavu18
from simp_py.DejaVuSans24 import tft_Dejavu24
from simp_py.minya24 ... | 30.972202 | 172 | 0.474065 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.