hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f708e2172ca4f1c9b05cfd9786cb97914a8c95b9 | 110 | py | Python | app/services/storage_service.py | jubbp/maker-hub | 93bde3bcde7869c8454613061c50c0dcb3d2f573 | [
"MIT"
] | 4 | 2021-09-28T04:55:16.000Z | 2021-12-11T03:33:01.000Z | app/services/storage_service.py | jubbp/maker-hub | 93bde3bcde7869c8454613061c50c0dcb3d2f573 | [
"MIT"
] | 92 | 2021-03-18T07:26:43.000Z | 2022-03-29T21:25:38.000Z | app/services/storage_service.py | jubbp/maker-hub | 93bde3bcde7869c8454613061c50c0dcb3d2f573 | [
"MIT"
] | 4 | 2021-02-27T16:31:41.000Z | 2021-07-25T02:20:09.000Z | async def get_location_count() -> int:
return 234
async def get_locations_used() -> int:
return 230
| 15.714286 | 38 | 0.690909 | async def get_location_count() -> int:
return 234
async def get_locations_used() -> int:
return 230
| true | true |
f708e25637b6e36499a5b132a0d4cc72da1b4e4b | 6,297 | py | Python | discordSuperUtils/ban.py | Heapy1337/discord-super-utils | be9d65fbc957d017df534ac502457f387594a9c8 | [
"MIT"
] | 91 | 2021-07-14T13:01:31.000Z | 2022-03-25T10:28:49.000Z | discordSuperUtils/ban.py | KortaPo/discord-super-utils | b8c1cd1a986bc5c78eaf472bb5caf44dd7b605e4 | [
"MIT"
] | 14 | 2021-08-13T14:23:54.000Z | 2022-03-25T09:57:12.000Z | discordSuperUtils/ban.py | KortaPo/discord-super-utils | b8c1cd1a986bc5c78eaf472bb5caf44dd7b605e4 | [
"MIT"
] | 42 | 2021-08-02T00:27:24.000Z | 2022-03-31T15:47:37.000Z | from __future__ import annotations
import asyncio
from datetime import datetime
from typing import TYPE_CHECKING, Union, Optional, List, Dict, Any
import discord
from .base import DatabaseChecker
from .punishments import Punisher
if TYPE_CHECKING:
from .punishments import Punishment
from discord.ext import ... | 29.018433 | 114 | 0.576147 | from __future__ import annotations
import asyncio
from datetime import datetime
from typing import TYPE_CHECKING, Union, Optional, List, Dict, Any
import discord
from .base import DatabaseChecker
from .punishments import Punisher
if TYPE_CHECKING:
from .punishments import Punishment
from discord.ext import ... | true | true |
f708e2e806370b31b4b855475a4664b8918bfc13 | 4,694 | py | Python | qa/rpc-tests/mempool_reorg.py | mirzaei-ce/core-javabit | bfc1f145268455ca788c8a0b70fb3f054e4287f9 | [
"MIT"
] | null | null | null | qa/rpc-tests/mempool_reorg.py | mirzaei-ce/core-javabit | bfc1f145268455ca788c8a0b70fb3f054e4287f9 | [
"MIT"
] | null | null | null | qa/rpc-tests/mempool_reorg.py | mirzaei-ce/core-javabit | bfc1f145268455ca788c8a0b70fb3f054e4287f9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly)... | 44.283019 | 119 | 0.684278 |
from test_framework.test_framework import JavabitTestFramework
from test_framework.util import *
class MempoolCoinbaseTest(JavabitTestFramework):
alert_filename = None
def setup_network(self):
args = ["-checkmempool", "-debug=mempool"]
self.nodes = []
self.nodes.append(start_node(0... | true | true |
f708e3a9dcf1d33165f200c2aec241d065dd8605 | 2,906 | py | Python | Homography/hw2-2/homography.py | Yfyangd/Computer_Vision_CS665 | 59dca3ce42f43b4aea446497a578f4a0eb93995d | [
"Apache-2.0"
] | 2 | 2019-11-06T03:40:08.000Z | 2019-11-06T03:40:19.000Z | Homography/hw2-2/homography.py | Yfyangd/Computer_Vision_CS665 | 59dca3ce42f43b4aea446497a578f4a0eb93995d | [
"Apache-2.0"
] | null | null | null | Homography/hw2-2/homography.py | Yfyangd/Computer_Vision_CS665 | 59dca3ce42f43b4aea446497a578f4a0eb93995d | [
"Apache-2.0"
] | 2 | 2022-02-14T05:02:36.000Z | 2022-02-21T16:02:23.000Z |
# coding: utf-8
# In[1]:
import numpy as np
def get_homograph(u,v):
A = np.array([[u[0][0], u[0][1], 1, 0, 0, 0, -1 * u[0][0] * v[0][0], -1 * u[0][1] * v[0][0]],
[0, 0, 0, u[0][0], u[0][1], 1, -1 * u[0][0] * v[0][1], -1 * u[0][1] * v[0][1]],
[u[1][0], u[1][1], 1, 0, 0, 0, -1 ... | 38.746667 | 97 | 0.419133 |
import numpy as np
def get_homograph(u,v):
A = np.array([[u[0][0], u[0][1], 1, 0, 0, 0, -1 * u[0][0] * v[0][0], -1 * u[0][1] * v[0][0]],
[0, 0, 0, u[0][0], u[0][1], 1, -1 * u[0][0] * v[0][1], -1 * u[0][1] * v[0][1]],
[u[1][0], u[1][1], 1, 0, 0, 0, -1 * u[1][0] * v[1][0], -1 *... | true | true |
f708e4a18c9e2a5f4a165c78f3009567fbd27a2d | 10,365 | py | Python | autotest/ogr/ogr_flatgeobuf.py | landam/gdal | 0232dcf743829e23268a2ae0c4fd10aaaeb14b3c | [
"MIT"
] | null | null | null | autotest/ogr/ogr_flatgeobuf.py | landam/gdal | 0232dcf743829e23268a2ae0c4fd10aaaeb14b3c | [
"MIT"
] | null | null | null | autotest/ogr/ogr_flatgeobuf.py | landam/gdal | 0232dcf743829e23268a2ae0c4fd10aaaeb14b3c | [
"MIT"
] | null | null | null | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: FlatGeobuf driver test suite.
# Author: Björn Harrtell <bjorn@wololo.org>
#
###############################################################... | 32.904762 | 127 | 0.608394 |
import os
from osgeo import ogr
from osgeo import gdal
import gdaltest
import ogrtest
import pytest
def verify_flatgeobuf_copy(name, fids, names):
if gdaltest.features is None:
print('Missing features collection')
return False
fname = os.path.join('tmp', name + '.fgb')
ds = ogr.Open(... | true | true |
f708e4e7c4120d37ff34dd3959cff2c61ac27f10 | 524 | py | Python | venv/lib/python3.6/site-packages/Sastrawi/Morphology/Disambiguator/DisambiguatorPrefixRule7.py | purwnt/customer-service-chatbot-app | 519caacc8557de04e1557456b852e66fea641ff4 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/Sastrawi/Morphology/Disambiguator/DisambiguatorPrefixRule7.py | purwnt/customer-service-chatbot-app | 519caacc8557de04e1557456b852e66fea641ff4 | [
"MIT"
] | 1 | 2021-05-14T23:07:45.000Z | 2021-05-14T23:07:45.000Z | venv/lib/python3.6/site-packages/Sastrawi/Morphology/Disambiguator/DisambiguatorPrefixRule7.py | purwnt/customer-service-chatbot-app | 519caacc8557de04e1557456b852e66fea641ff4 | [
"MIT"
] | null | null | null | import re
class DisambiguatorPrefixRule7(object):
"""Disambiguate Prefix Rule 7
Rule 7 : terCerv -> ter-CerV where C != 'r'
"""
def disambiguate(self, word):
"""Disambiguate Prefix Rule 7
Rule 7 : terCerv -> ter-CerV where C != 'r'
"""
matches = re.match(... | 30.823529 | 81 | 0.532443 | import re
class DisambiguatorPrefixRule7(object):
def disambiguate(self, word):
matches = re.match(r'^ter([bcdfghjklmnpqrstvwxyz])er([aiueo].*)$', word)
if matches:
if matches.group(1) == 'r':
return
return matches.group(1) + 'er' + matches.grou... | true | true |
f708e50db1f4c3784cacecdfda9d99df22227d9f | 2,340 | py | Python | sp.py | The-SocialLion/Speech-Emotion-Recognition-using-MLP-Classifier | 5c4101ebbe2b43db28dbb97f94dc3001bdf56ff8 | [
"Apache-2.0"
] | null | null | null | sp.py | The-SocialLion/Speech-Emotion-Recognition-using-MLP-Classifier | 5c4101ebbe2b43db28dbb97f94dc3001bdf56ff8 | [
"Apache-2.0"
] | null | null | null | sp.py | The-SocialLion/Speech-Emotion-Recognition-using-MLP-Classifier | 5c4101ebbe2b43db28dbb97f94dc3001bdf56ff8 | [
"Apache-2.0"
] | null | null | null | import librosa
import soundfile
import os, glob, pickle
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import accuracy_score
def extract_feature(file_name, mfcc, chroma, mel):
with soundfile.SoundFile(file_name)... | 36 | 130 | 0.658974 | import librosa
import soundfile
import os, glob, pickle
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import accuracy_score
def extract_feature(file_name, mfcc, chroma, mel):
with soundfile.SoundFile(file_name)... | true | true |
f708e557288c87be71ea0404a8bb00dc3767cf97 | 10,040 | py | Python | src/transformers/tokenization_auto.py | mariamabarham/transformers | d490b5d5003654f104af3abd0556e598335b5650 | [
"Apache-2.0"
] | 6 | 2020-06-22T01:42:20.000Z | 2021-12-24T02:55:51.000Z | src/transformers/tokenization_auto.py | mariamabarham/transformers | d490b5d5003654f104af3abd0556e598335b5650 | [
"Apache-2.0"
] | 3 | 2020-11-29T18:11:03.000Z | 2021-06-11T10:04:30.000Z | src/transformers/tokenization_auto.py | mariamabarham/transformers | d490b5d5003654f104af3abd0556e598335b5650 | [
"Apache-2.0"
] | 1 | 2020-11-29T16:37:16.000Z | 2020-11-29T16:37:16.000Z | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 50.964467 | 372 | 0.697211 |
import logging
from collections import OrderedDict
from .configuration_auto import (
AlbertConfig,
AutoConfig,
BertConfig,
CamembertConfig,
CTRLConfig,
DistilBertConfig,
FlaubertConfig,
GPT2Config,
OpenAIGPTConfig,
RobertaConfig,
T5Config,
TransfoXLConfig,
XLMConfi... | true | true |
f708e5c068545992b18a1ec51e23cff6cfb0e647 | 1,422 | py | Python | ifollow/wsgi.py | moe-szyslak/TheCondor | 8066202cfe2d972ad643e4b7c179be5089dbcc65 | [
"MIT"
] | 1 | 2015-10-27T04:02:41.000Z | 2015-10-27T04:02:41.000Z | ifollow/wsgi.py | moe-szyslak/TheCondor | 8066202cfe2d972ad643e4b7c179be5089dbcc65 | [
"MIT"
] | null | null | null | ifollow/wsgi.py | moe-szyslak/TheCondor | 8066202cfe2d972ad643e4b7c179be5089dbcc65 | [
"MIT"
] | null | null | null | """
WSGI config for ifollow project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | 43.090909 | 79 | 0.803094 | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ifollow.settings")
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(applicati... | true | true |
f708e5f4e21d0ec582297a904c5c3b950283833a | 5,230 | py | Python | examples/inverse/plot_lcmv_beamformer_volume.py | ragatti/mne-python | c6825a49c3452db616fc980d62d33f6dddf4cd65 | [
"BSD-3-Clause"
] | 1 | 2020-04-25T05:01:54.000Z | 2020-04-25T05:01:54.000Z | examples/inverse/plot_lcmv_beamformer_volume.py | ragatti/mne-python | c6825a49c3452db616fc980d62d33f6dddf4cd65 | [
"BSD-3-Clause"
] | null | null | null | examples/inverse/plot_lcmv_beamformer_volume.py | ragatti/mne-python | c6825a49c3452db616fc980d62d33f6dddf4cd65 | [
"BSD-3-Clause"
] | null | null | null | """
====================================================
Compute LCMV inverse solution in volume source space
====================================================
Compute LCMV beamformers on an auditory evoked dataset in a volume source
space, and show activation on ``fsaverage``.
"""
# Author: Alexandre Gramfort <ale... | 39.323308 | 79 | 0.630784 |
import mne
from mne.datasets import sample, fetch_fsaverage
from mne.beamformer import make_lcmv, apply_lcmv
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path + '/subjects'
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
fname_fwd = data_path + '/MEG/sample/sample_audvis-m... | true | true |
f708e6377e37447588e0d9fb8fda40d91bd7ea72 | 2,306 | py | Python | Contents/scripts/animmemo/_lib.py | mochio326/AnimMemo | 41cc0cd16056231a336d5e33fe7a6128fc11d50b | [
"MIT"
] | 8 | 2018-01-08T02:38:13.000Z | 2020-12-22T05:15:47.000Z | Contents/scripts/animmemo/_lib.py | mochio326/AnimMemo | 41cc0cd16056231a336d5e33fe7a6128fc11d50b | [
"MIT"
] | null | null | null | Contents/scripts/animmemo/_lib.py | mochio326/AnimMemo | 41cc0cd16056231a336d5e33fe7a6128fc11d50b | [
"MIT"
] | null | null | null | ## -*- coding: utf-8 -*-
from .vendor.Qt import QtCore, QtGui, QtWidgets
import maya.cmds as cmds
import maya.mel as mel
import maya.OpenMayaUI as OpenMayaUI
import maya.OpenMaya as OpenMaya
import json
import os
def maya_version():
return int(cmds.about(v=True)[:4])
def maya_api_version():
return int(cmds.ab... | 26.204545 | 83 | 0.561145 | from .vendor.Qt import QtCore, QtGui, QtWidgets
import maya.cmds as cmds
import maya.mel as mel
import maya.OpenMayaUI as OpenMayaUI
import maya.OpenMaya as OpenMaya
import json
import os
def maya_version():
return int(cmds.about(v=True)[:4])
def maya_api_version():
return int(cmds.about(api=True))
if 2017 <... | true | true |
f708e7b5f388dd6c976262da9d55674a512e7986 | 897 | py | Python | thumt/utils/distribute.py | THUNLP-MT/Copy4APE | 2e341f1bb31d0e25d7ff46cc31521ac3632eb746 | [
"BSD-3-Clause"
] | 12 | 2019-09-06T14:36:55.000Z | 2021-11-18T02:11:04.000Z | thumt/utils/distribute.py | THUNLP-MT/Copy4APE | 2e341f1bb31d0e25d7ff46cc31521ac3632eb746 | [
"BSD-3-Clause"
] | 4 | 2019-10-10T15:49:12.000Z | 2021-05-06T01:11:58.000Z | thumt/utils/distribute.py | THUNLP-MT/Copy4APE | 2e341f1bb31d0e25d7ff46cc31521ac3632eb746 | [
"BSD-3-Clause"
] | 3 | 2020-01-03T07:53:02.000Z | 2020-03-26T04:19:15.000Z | # coding=utf-8
# Copyright 2017-2019 The THUMT Authors
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
_ENGINE = None
def enable_distributed_training():
global _ENGINE
try:
import horovod.tensorflow as hvd
_ENGINE = hvd... | 19.085106 | 76 | 0.703456 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
_ENGINE = None
def enable_distributed_training():
global _ENGINE
try:
import horovod.tensorflow as hvd
_ENGINE = hvd
hvd.init()
except ImportError:
sys... | true | true |
f708e804af34c7cabb6dba3ee78730930ad65f23 | 827 | py | Python | tests/functional/dashboard/test_partner.py | iicc/django-oscar | 67ebe6bc21c242e9b0750b9f306b2f46a2758199 | [
"BSD-3-Clause"
] | 2 | 2019-07-27T23:00:28.000Z | 2021-09-08T14:25:30.000Z | tests/functional/dashboard/test_partner.py | iicc/django-oscar | 67ebe6bc21c242e9b0750b9f306b2f46a2758199 | [
"BSD-3-Clause"
] | 11 | 2019-12-21T06:06:48.000Z | 2022-01-13T01:41:33.000Z | tests/functional/dashboard/test_partner.py | iicc/django-oscar | 67ebe6bc21c242e9b0750b9f306b2f46a2758199 | [
"BSD-3-Clause"
] | 3 | 2019-03-20T16:17:58.000Z | 2022-02-25T09:38:38.000Z | from django.urls import reverse
from oscar.test.testcases import WebTestCase
from oscar.apps.partner import models
class TestPartnerDashboard(WebTestCase):
is_staff = True
def test_allows_a_partner_user_to_be_created(self):
partner = models.Partner.objects.create(
name="Acme Ltd")
... | 30.62963 | 65 | 0.649335 | from django.urls import reverse
from oscar.test.testcases import WebTestCase
from oscar.apps.partner import models
class TestPartnerDashboard(WebTestCase):
is_staff = True
def test_allows_a_partner_user_to_be_created(self):
partner = models.Partner.objects.create(
name="Acme Ltd")
... | true | true |
f708e8920634dfa425f8e6c30f8e45d04837f031 | 65 | py | Python | homedisplay/repeating_tasks/__init__.py | ojarva/home-info-display | 873d022308732baff94d0dc2381cf9dc7dce23b7 | [
"BSD-3-Clause"
] | 1 | 2016-11-28T04:35:06.000Z | 2016-11-28T04:35:06.000Z | homedisplay/repeating_tasks/__init__.py | ojarva/home-info-display | 873d022308732baff94d0dc2381cf9dc7dce23b7 | [
"BSD-3-Clause"
] | 160 | 2015-01-01T20:59:29.000Z | 2016-04-25T13:36:52.000Z | homedisplay/repeating_tasks/__init__.py | ojarva/home-info-display | 873d022308732baff94d0dc2381cf9dc7dce23b7 | [
"BSD-3-Clause"
] | 1 | 2015-02-25T21:24:01.000Z | 2015-02-25T21:24:01.000Z | default_app_config = 'repeating_tasks.apps.RepeatingTasksConfig'
| 32.5 | 64 | 0.876923 | default_app_config = 'repeating_tasks.apps.RepeatingTasksConfig'
| true | true |
f708e89ca606a4a520d3e1c51f3fc6199bdd4afb | 2,380 | py | Python | entertainment_center.py | guillermogfer/movie-trailer-website | be20ac83ce74867f6358936648e7863745d25be3 | [
"MIT"
] | 1 | 2015-03-30T22:43:02.000Z | 2015-03-30T22:43:02.000Z | entertainment_center.py | guillermogfer/movie-trailer-website | be20ac83ce74867f6358936648e7863745d25be3 | [
"MIT"
] | null | null | null | entertainment_center.py | guillermogfer/movie-trailer-website | be20ac83ce74867f6358936648e7863745d25be3 | [
"MIT"
] | null | null | null | import external_movie_data
import fresh_tomatoes
import json
import media
def validate_movie_info(movie_info):
# TODO: Aritmethic Error handling
# Convert and round rating range
rating = round(movie_info['rating'] * 5 / 10, 1)
# TODO: Supply the list to the view and loop through it
# Check if gen... | 41.754386 | 142 | 0.688655 | import external_movie_data
import fresh_tomatoes
import json
import media
def validate_movie_info(movie_info):
rating = round(movie_info['rating'] * 5 / 10, 1)
genres_list = movie_info['genres'] if movie_info['genres'] else ['Uncategorized']
overview = movie_info['overview'] if movie... | false | true |
f708e90b495e842e0c6fdb21da7bd73edf90dfca | 4,586 | py | Python | cottonwood/core/layers/dense.py | brohrer/nn_methods | acf3d1369e240971e5ee05696610c59c4c993a30 | [
"MIT"
] | 73 | 2019-10-15T22:02:52.000Z | 2022-03-18T20:33:58.000Z | cottonwood/core/layers/dense.py | brohrer/nn_methods | acf3d1369e240971e5ee05696610c59c4c993a30 | [
"MIT"
] | 7 | 2019-11-23T00:10:55.000Z | 2021-05-29T03:50:42.000Z | cottonwood/core/layers/dense.py | brohrer/nn_methods | acf3d1369e240971e5ee05696610c59c4c993a30 | [
"MIT"
] | 14 | 2019-10-16T02:39:42.000Z | 2019-12-08T07:02:07.000Z | import numpy as np
from cottonwood.core.activation import Tanh
from cottonwood.core.initializers import LSUV
from cottonwood.core.layers.generic_layer import GenericLayer
from cottonwood.core.optimizers import SGD
import cottonwood.core.toolbox as tb
class Dense(GenericLayer):
def __init__(
self,
... | 32.295775 | 79 | 0.597907 | import numpy as np
from cottonwood.core.activation import Tanh
from cottonwood.core.initializers import LSUV
from cottonwood.core.layers.generic_layer import GenericLayer
from cottonwood.core.optimizers import SGD
import cottonwood.core.toolbox as tb
class Dense(GenericLayer):
def __init__(
self,
... | true | true |
f708e95a3c98b6a895028e81a6372e1ef21c132a | 11,535 | py | Python | pyActLearn/sensors/sensor2vec.py | TinghuiWang/pyActLearn | d858136e86324fac51b0943765ef60bd405e31d1 | [
"BSD-3-Clause"
] | 3 | 2017-03-15T03:42:57.000Z | 2020-01-19T15:47:12.000Z | pyActLearn/sensors/sensor2vec.py | TinghuiWang/pyActLearn | d858136e86324fac51b0943765ef60bd405e31d1 | [
"BSD-3-Clause"
] | 2 | 2019-02-04T15:31:49.000Z | 2020-01-26T17:49:22.000Z | pyActLearn/sensors/sensor2vec.py | TinghuiWang/pyActLearn | d858136e86324fac51b0943765ef60bd405e31d1 | [
"BSD-3-Clause"
] | 3 | 2019-02-02T19:36:17.000Z | 2021-01-02T15:42:43.000Z | import math
import numpy as np
import tensorflow as tf
from ..learning.nn.injectors import SkipGramInjector
def sensor2vec(num_sensors, sensor_event_list, embedding_size=20,
batch_size=128, num_skips=8, skip_window=5,
num_neg_samples=64, learning_rate=1.0):
"""Sensor to Vector
""... | 45.77381 | 93 | 0.604335 | import math
import numpy as np
import tensorflow as tf
from ..learning.nn.injectors import SkipGramInjector
def sensor2vec(num_sensors, sensor_event_list, embedding_size=20,
batch_size=128, num_skips=8, skip_window=5,
num_neg_samples=64, learning_rate=1.0):
if num_neg_samples > num_s... | true | true |
f708e99111649f36ac940b6ac45ab557741cb43e | 694 | py | Python | week4_divide_and_conquer/2_majority_element/majority_element.py | sebas119/algorithmic-toolbox | 8b7e4d66b04f95f9aa159544e96bbe8765abfa56 | [
"MIT"
] | null | null | null | week4_divide_and_conquer/2_majority_element/majority_element.py | sebas119/algorithmic-toolbox | 8b7e4d66b04f95f9aa159544e96bbe8765abfa56 | [
"MIT"
] | null | null | null | week4_divide_and_conquer/2_majority_element/majority_element.py | sebas119/algorithmic-toolbox | 8b7e4d66b04f95f9aa159544e96bbe8765abfa56 | [
"MIT"
] | null | null | null | # Uses python3
import sys
""" def get_majority_element(a, left, right):
if left == right:
return -1
if left + 1 == right:
return a[left]
#write your code here
return -1 """
def get_majority_element_hash_approach(a, n):
new = {}
for e in a:
if e not in new:
... | 20.411765 | 52 | 0.520173 | import sys
def get_majority_element_hash_approach(a, n):
new = {}
for e in a:
if e not in new:
new[e] = 1
else:
new[e] += 1
for keys, val in new.items():
if val > n / 2:
return 1
return 0
if __name__ == '__main__':
n = int(input())
... | true | true |
f708e9a4590e61d74102e1c7483f7e1fb43ae436 | 1,710 | py | Python | button.py | qodzero/ukivy | d7179a83c2e6e357cf50113f53d24c780bf29789 | [
"MIT"
] | null | null | null | button.py | qodzero/ukivy | d7179a83c2e6e357cf50113f53d24c780bf29789 | [
"MIT"
] | null | null | null | button.py | qodzero/ukivy | d7179a83c2e6e357cf50113f53d24c780bf29789 | [
"MIT"
] | null | null | null | from kivy.uix.button import Button
from kivy.properties import StringProperty, BooleanProperty, NumericProperty, ObjectProperty
from kivy.graphics import Color, Rectangle, RoundedRectangle, Ellipse
from kivy.lang import Builder
Builder.load_string('''
<FlatButton>:
background_normal: ''
background_color: [0,0,... | 24.428571 | 92 | 0.623392 | from kivy.uix.button import Button
from kivy.properties import StringProperty, BooleanProperty, NumericProperty, ObjectProperty
from kivy.graphics import Color, Rectangle, RoundedRectangle, Ellipse
from kivy.lang import Builder
Builder.load_string('''
<FlatButton>:
background_normal: ''
background_color: [0,0,... | true | true |
f708ea3cdf88f21e1a5d732ac490535d1e427158 | 411 | py | Python | reportsmanagement/asgi.py | saadhaxxan/Reports-Management-Django | 9acbcaa89fa174b1bf7876eb40ccf5193eb9f653 | [
"MIT"
] | null | null | null | reportsmanagement/asgi.py | saadhaxxan/Reports-Management-Django | 9acbcaa89fa174b1bf7876eb40ccf5193eb9f653 | [
"MIT"
] | null | null | null | reportsmanagement/asgi.py | saadhaxxan/Reports-Management-Django | 9acbcaa89fa174b1bf7876eb40ccf5193eb9f653 | [
"MIT"
] | 1 | 2021-05-02T20:27:44.000Z | 2021-05-02T20:27:44.000Z | """
ASGI config for reportsmanagement project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJ... | 24.176471 | 78 | 0.79562 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'reportsmanagement.settings')
application = get_asgi_application()
| true | true |
f708ea3dd9f5758a8498ae276155cf1d472e275f | 3,230 | py | Python | app/app/settings.py | elmaraliyevdev/recipe-api | c5b5e8ae1454e1b568971b71a308e3cec930c353 | [
"MIT"
] | null | null | null | app/app/settings.py | elmaraliyevdev/recipe-api | c5b5e8ae1454e1b568971b71a308e3cec930c353 | [
"MIT"
] | null | null | null | app/app/settings.py | elmaraliyevdev/recipe-api | c5b5e8ae1454e1b568971b71a308e3cec930c353 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib imp... | 25.634921 | 91 | 0.69969 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-nao&q&bu0i4@-&!nep#b%6x=-_f@-4hu)tb!09w8nujq5nwma*'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.co... | true | true |
f708ea805e770aa48410e49e530f2410137eb6dd | 11,174 | py | Python | isi_sdk_8_2_1/isi_sdk_8_2_1/models/cluster_node_drive_d_config.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_1/isi_sdk_8_2_1/models/cluster_node_drive_d_config.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_1/isi_sdk_8_2_1/models/cluster_node_drive_d_config.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: 8
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_2_1.models.node_dr... | 34.91875 | 179 | 0.665205 |
import pprint
import re
import six
from isi_sdk_8_2_1.models.node_driveconfig_node_alert import NodeDriveconfigNodeAlert from isi_sdk_8_2_1.models.node_driveconfig_node_allow import NodeDriveconfigNodeAllow from isi_sdk_8_2_1.models.node_driveconfig_node_automatic_replacement_recognition import NodeDriveconfigN... | true | true |
f708eaec40c92aa56ad6fdfbd0430f325b24f5c8 | 10,137 | py | Python | FlaskApp/blog.py | j2B237/FlaskJoblogueur | 144b0ed8343e93cab715b034b6d477142ce9681a | [
"Apache-2.0"
] | null | null | null | FlaskApp/blog.py | j2B237/FlaskJoblogueur | 144b0ed8343e93cab715b034b6d477142ce9681a | [
"Apache-2.0"
] | null | null | null | FlaskApp/blog.py | j2B237/FlaskJoblogueur | 144b0ed8343e93cab715b034b6d477142ce9681a | [
"Apache-2.0"
] | null | null | null | # ******************* BLOG MODULE ****************************** #
# ** Created by Yossep
# ** github: https://github.com/j2B237/
# ** Project : Joblogueur
# ** Description:
#
# Within this module we have many functions designed to help display posts
# Methods such as :
# display all posts
# display posts per category
... | 38.397727 | 229 | 0.555687 |
from flask import Blueprint, render_template, flash, request, redirect, url_for
from flask_mail import Message
from FlaskApp.models import Post, Category, Moderator, Comment
from FlaskApp.forms import CommentForm
from . import db, ext, mail
bp = Blueprint('blog', __name__)
fake_Category = [
{
... | true | true |
f708eb4171dc8694530ffc022c1cc83d3407d688 | 14,078 | py | Python | comic_dl/honcho.py | PauuloG/comic-dl | 6d8b70751b5ae3388f28264d5c1dd9d7fbfeda4b | [
"MIT"
] | null | null | null | comic_dl/honcho.py | PauuloG/comic-dl | 6d8b70751b5ae3388f28264d5c1dd9d7fbfeda4b | [
"MIT"
] | null | null | null | comic_dl/honcho.py | PauuloG/comic-dl | 6d8b70751b5ae3388f28264d5c1dd9d7fbfeda4b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
import logging
from sites import foolSlide
from sites import readcomicOnlineto
from sites import comicNaver
from sites import mangaHere
from sites import rawSenManga
from sites... | 58.903766 | 126 | 0.573022 |
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
import logging
from sites import foolSlide
from sites import readcomicOnlineto
from sites import comicNaver
from sites import mangaHere
from sites import rawSenManga
from sites import mangaFox
from sites import omgBeauPeep... | true | true |
f708ebb2ee0deed992fca9ca8fb815c1304e74c9 | 1,065 | py | Python | colossus/apps/subscribers/urls.py | Beracah-Group/colossus | 7bce25039a223da7197cc8a969ec72ee26aeffa8 | [
"MIT"
] | 2 | 2018-08-14T14:06:54.000Z | 2018-09-10T16:57:18.000Z | colossus/apps/subscribers/urls.py | Beracah-Group/colossus | 7bce25039a223da7197cc8a969ec72ee26aeffa8 | [
"MIT"
] | null | null | null | colossus/apps/subscribers/urls.py | Beracah-Group/colossus | 7bce25039a223da7197cc8a969ec72ee26aeffa8 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'subscribers'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('manage/', views.manage, name='manage'),
path('goodbye/<uuid:mailing_list_uuid>/', views.goodbye, name='goodbye'),
path('subscribe/<uuid:mailing_list_uuid... | 53.25 | 145 | 0.734272 | from django.urls import path
from . import views
app_name = 'subscribers'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('manage/', views.manage, name='manage'),
path('goodbye/<uuid:mailing_list_uuid>/', views.goodbye, name='goodbye'),
path('subscribe/<uuid:mailing_list_uuid... | true | true |
f708ec0d4bcf6e7a2b03661fc934f58647505014 | 7,295 | py | Python | Chapter03/03_atari_gan.py | Yelloooowww/Deep-Reinforcement-Learning-Hands-On | d1a3a1272d7ceff8796fe412deb4e4d5bd6665a5 | [
"MIT"
] | null | null | null | Chapter03/03_atari_gan.py | Yelloooowww/Deep-Reinforcement-Learning-Hands-On | d1a3a1272d7ceff8796fe412deb4e4d5bd6665a5 | [
"MIT"
] | null | null | null | Chapter03/03_atari_gan.py | Yelloooowww/Deep-Reinforcement-Learning-Hands-On | d1a3a1272d7ceff8796fe412deb4e4d5bd6665a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import random
import argparse
import cv2
import torch
import torch.nn as nn
import torch.optim as optim
from tensorboardX import SummaryWriter
import torchvision.utils as vutils
import gym
import gym.spaces
import numpy as np
log = gym.logger
log.set_level(gym.logger.INFO)
LATENT_VECTOR_SIZE... | 38.193717 | 114 | 0.632625 | import random
import argparse
import cv2
import torch
import torch.nn as nn
import torch.optim as optim
from tensorboardX import SummaryWriter
import torchvision.utils as vutils
import gym
import gym.spaces
import numpy as np
log = gym.logger
log.set_level(gym.logger.INFO)
LATENT_VECTOR_SIZE = 100
DISCR_FILTERS =... | true | true |
f708ec34d94accf9803554eaf36443156e5d6531 | 2,126 | py | Python | sites/newbrandx/templates/rankx/reports/scripts/generate_seeds.py | jackytu/newbrandx | 19569a725bef86a77e94009353e7be5fc6f1b993 | [
"BSD-3-Clause"
] | null | null | null | sites/newbrandx/templates/rankx/reports/scripts/generate_seeds.py | jackytu/newbrandx | 19569a725bef86a77e94009353e7be5fc6f1b993 | [
"BSD-3-Clause"
] | null | null | null | sites/newbrandx/templates/rankx/reports/scripts/generate_seeds.py | jackytu/newbrandx | 19569a725bef86a77e94009353e7be5fc6f1b993 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import MySQLdb
import datetime
import random
brand_data = {}
today = datetime.date.today()
report_tittle = "milk/milk_{}.html".format(today.strftime("%Y_%m"))
first = today.replace(day=1)
last_year = first - datetime.timedelta(days=365)
rang_low = today.strftime... | 30.811594 | 190 | 0.597836 | import time
import MySQLdb
import datetime
import random
brand_data = {}
today = datetime.date.today()
report_tittle = "milk/milk_{}.html".format(today.strftime("%Y_%m"))
first = today.replace(day=1)
last_year = first - datetime.timedelta(days=365)
rang_low = today.strftime("%Y-01-01")
rang_high = today.strftime("%... | false | true |
f708ec7e3e680cdaf80ef8e90b01a7804d08b581 | 191 | py | Python | configs/gfl/gfl_r50_fpn_2x_coco.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | configs/gfl/gfl_r50_fpn_2x_coco.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | configs/gfl/gfl_r50_fpn_2x_coco.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | _base_ = './gfl_r50_fpn_1x_coco.py'
# learning policy
lr_config = dict(step=[16, 22])
runner = dict(type='EpochBasedRunner', max_epochs=24)
work_dir = 'work_dirs/coco/gfl/gfl_r50_fpn_2x_coco' | 38.2 | 53 | 0.769634 | _base_ = './gfl_r50_fpn_1x_coco.py'
lr_config = dict(step=[16, 22])
runner = dict(type='EpochBasedRunner', max_epochs=24)
work_dir = 'work_dirs/coco/gfl/gfl_r50_fpn_2x_coco' | true | true |
f708ecb93d42a17f5cc1be094b2d1fcf7bdec9be | 1,071 | py | Python | Solutions/Applications/timer.py | abefrandsen/numerical_computing | 90559f7c4f387885eb44ea7b1fa19bb602f496cb | [
"CC-BY-3.0"
] | null | null | null | Solutions/Applications/timer.py | abefrandsen/numerical_computing | 90559f7c4f387885eb44ea7b1fa19bb602f496cb | [
"CC-BY-3.0"
] | null | null | null | Solutions/Applications/timer.py | abefrandsen/numerical_computing | 90559f7c4f387885eb44ea7b1fa19bb602f496cb | [
"CC-BY-3.0"
] | 1 | 2020-10-21T23:06:27.000Z | 2020-10-21T23:06:27.000Z | import timeit
class timer(object):
def __init__(self, repeats=3, loops=1, gc=False):
self.repeats = repeats
self.loops = loops
self.gc = gc
def __enter__(self):
return self
def __exit__(self, type, value, traceback):
if type is not None:
return False
... | 29.75 | 190 | 0.591036 | import timeit
class timer(object):
def __init__(self, repeats=3, loops=1, gc=False):
self.repeats = repeats
self.loops = loops
self.gc = gc
def __enter__(self):
return self
def __exit__(self, type, value, traceback):
if type is not None:
return False
... | false | true |
f708ecc2659e7dad9f641b77c908e306e5f808bc | 3,029 | py | Python | watcher_dashboard/utils/utils.py | openstack/watcher-dashboard | 146e547da934c2464ec5f49326eabed0eecfda96 | [
"Apache-2.0"
] | 15 | 2016-02-12T07:33:42.000Z | 2019-01-28T22:13:27.000Z | watcher_dashboard/utils/utils.py | openstack/watcher-dashboard | 146e547da934c2464ec5f49326eabed0eecfda96 | [
"Apache-2.0"
] | null | null | null | watcher_dashboard/utils/utils.py | openstack/watcher-dashboard | 146e547da934c2464ec5f49326eabed0eecfda96 | [
"Apache-2.0"
] | 2 | 2017-08-11T02:25:37.000Z | 2017-10-10T09:59:40.000Z | # -*- coding: utf8 -*-
#
# 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... | 31.884211 | 78 | 0.621657 | import re
CAMEL_RE = re.compile(r'([A-Z][a-z]+|[A-Z]+(?=[A-Z\s]|$))')
def de_camel_case(text):
return ' '.join(w.strip() for w in CAMEL_RE.split(text) if w.strip())
def list_to_dict(object_list, key_attribute='id'):
return dict((getattr(o, key_attribute), o) for o in object_list)
def length(iterator):
... | true | true |
f708ecc7d0e54f2284d531ef1dd0316ffeddf396 | 6,204 | py | Python | CAGG-NAS/tools/nn/nn_visualise.py | csjtx1021/CAGG | 67fde2f1488ee6e2ff137e87860b5243c5b5fe7c | [
"MIT"
] | 7 | 2020-09-05T01:50:06.000Z | 2021-09-29T13:33:35.000Z | CAGG-NAS/tools/nn/nn_visualise.py | csjtx1021/CAND | 67fde2f1488ee6e2ff137e87860b5243c5b5fe7c | [
"MIT"
] | null | null | null | CAGG-NAS/tools/nn/nn_visualise.py | csjtx1021/CAND | 67fde2f1488ee6e2ff137e87860b5243c5b5fe7c | [
"MIT"
] | 1 | 2021-12-07T03:16:24.000Z | 2021-12-07T03:16:24.000Z | """
Harness for visualising a neural network.
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=invalid-name
import functools
import graphviz as gv
import os
import networkx as nx
import numpy as np
# Parameters for plotting
_SAVE_FORMAT = 'eps'
# _SAVE_FORMAT = 'png'
_LAYER_SHAPE = 'rectangle'
_IPOP_SHAPE = 'circle... | 31.175879 | 153 | 0.629433 |
import functools
import graphviz as gv
import os
import networkx as nx
import numpy as np
_SAVE_FORMAT = 'eps'
_LAYER_SHAPE = 'rectangle'
_IPOP_SHAPE = 'circle'
_LAYER_FONT = 'DejaVuSans'
_IPOP_FONT = 'Helvetica'
_LAYER_FONTSIZE = '16'
_FILLCOLOR = 'transparent'
_IPOP_FONTSIZE = '12'
_IPOP_FILLCOLOR = '#ffc0cb'
_DEC... | true | true |
f708ed2fb34b2811477e4d2bb6b9fda638b2306e | 814 | py | Python | django_api/serializers.py | KrishnaChandrapati/django_api1 | 3ce95318301c8d1b885041a3de1fae3b1fe52a73 | [
"MIT"
] | null | null | null | django_api/serializers.py | KrishnaChandrapati/django_api1 | 3ce95318301c8d1b885041a3de1fae3b1fe52a73 | [
"MIT"
] | null | null | null | django_api/serializers.py | KrishnaChandrapati/django_api1 | 3ce95318301c8d1b885041a3de1fae3b1fe52a73 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from .models import *
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ['url', 'username', 'email', 'groups']
class GroupSerializer(serializers.HyperlinkedMode... | 23.941176 | 65 | 0.708845 | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from .models import *
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ['url', 'username', 'email', 'groups']
class GroupSerializer(serializers.HyperlinkedMode... | true | true |
f708edcc42449148f4a71856e7c68b84c7f934c7 | 2,583 | py | Python | bfg9000/path.py | Mattlk13/bfg9000 | 2d897db09ea81a0ffef0a52f2e06cb9cb4a70a02 | [
"BSD-3-Clause"
] | 72 | 2015-06-23T02:35:13.000Z | 2021-12-08T01:47:40.000Z | bfg9000/path.py | jimporter/bfg9000 | c206646ecfed0d1a510e993b93e6a15677f45a14 | [
"BSD-3-Clause"
] | 139 | 2015-03-01T18:48:17.000Z | 2021-06-18T15:45:14.000Z | bfg9000/path.py | Mattlk13/bfg9000 | 2d897db09ea81a0ffef0a52f2e06cb9cb4a70a02 | [
"BSD-3-Clause"
] | 19 | 2015-12-23T21:24:33.000Z | 2022-01-06T04:04:41.000Z | import functools
import os
from contextlib import contextmanager
from .platforms.basepath import BasePath, Root, InstallRoot, DestDir # noqa
from .platforms.host import platform_info
Path = platform_info().Path
def abspath(path, type=Path, **kwargs):
return type.abspath(path, **kwargs)
def commonprefix(paths... | 23.916667 | 76 | 0.603562 | import functools
import os
from contextlib import contextmanager
from .platforms.basepath import BasePath, Root, InstallRoot, DestDir from .platforms.host import platform_info
Path = platform_info().Path
def abspath(path, type=Path, **kwargs):
return type.abspath(path, **kwargs)
def commonprefix(paths):
... | true | true |
f708ede6397fe9c30873a9c8fdff9588cddf90dd | 1,429 | py | Python | tests/shell/test_basic_commands.py | hn04147/pytorch-project-template | 4bbe17a61af8b2f47f7afa1c96e4ff347123bfb8 | [
"MIT",
"Unlicense"
] | 2 | 2020-11-05T18:56:32.000Z | 2020-11-12T22:38:32.000Z | tests/shell/test_basic_commands.py | hn04147/pytorch-project-template | 4bbe17a61af8b2f47f7afa1c96e4ff347123bfb8 | [
"MIT",
"Unlicense"
] | 19 | 2020-11-12T20:42:21.000Z | 2020-11-29T15:14:04.000Z | tests/shell/test_basic_commands.py | hn04147/pytorch-project-template | 4bbe17a61af8b2f47f7afa1c96e4ff347123bfb8 | [
"MIT",
"Unlicense"
] | 1 | 2020-11-12T20:19:51.000Z | 2020-11-12T20:19:51.000Z | import pytest
from tests.helpers.run_command import run_command
from tests.helpers.runif import RunIf
"""
A couple of sanity checks to make sure the model doesn't crash with different running options.
"""
def test_fast_dev_run():
"""Test running for 1 train, val and test batch."""
command = ["train.py", "++... | 24.220339 | 94 | 0.647306 | import pytest
from tests.helpers.run_command import run_command
from tests.helpers.runif import RunIf
def test_fast_dev_run():
command = ["train.py", "++trainer.fast_dev_run=true"]
run_command(command)
@pytest.mark.slow
def test_cpu():
command = ["train.py", "++trainer.max_epochs=1", "++trainer.gpus=0... | true | true |
f708ee95a7c0d97611564ac57312b30829517a80 | 4,323 | py | Python | inkfish/cmds.py | alanefl/vdf-competition | 84efc3aec180c43582c9421c6fb7fb2e22000635 | [
"Apache-2.0"
] | 97 | 2018-10-04T18:10:42.000Z | 2021-08-23T10:37:06.000Z | inkfish/cmds.py | alanefl/vdf-competition | 84efc3aec180c43582c9421c6fb7fb2e22000635 | [
"Apache-2.0"
] | 4 | 2018-10-04T18:20:49.000Z | 2021-05-03T07:13:14.000Z | inkfish/cmds.py | alanefl/vdf-competition | 84efc3aec180c43582c9421c6fb7fb2e22000635 | [
"Apache-2.0"
] | 17 | 2018-10-08T18:08:21.000Z | 2022-01-12T00:54:32.000Z | import argparse
import binascii
import sys
import time
from inkfish.proof_of_time import (create_proof_of_time_wesolowski,
create_proof_of_time_nwesolowski,
create_proof_of_time_pietrzak,
check_proof_of_time_wesolo... | 41.970874 | 88 | 0.623178 | import argparse
import binascii
import sys
import time
from inkfish.proof_of_time import (create_proof_of_time_wesolowski,
create_proof_of_time_nwesolowski,
create_proof_of_time_pietrzak,
check_proof_of_time_wesolo... | true | true |
f708eeacfbf6c4ebf00516f1ac9d10f8e5349ebe | 1,546 | py | Python | qhub/cli/validate.py | pierrotsmnrd/qhub | 399684c79f331923444b4fe46fae38ee02bfa2ac | [
"BSD-3-Clause"
] | 100 | 2020-05-06T14:36:51.000Z | 2022-03-31T20:09:29.000Z | qhub/cli/validate.py | pierrotsmnrd/qhub | 399684c79f331923444b4fe46fae38ee02bfa2ac | [
"BSD-3-Clause"
] | 778 | 2020-04-08T06:28:29.000Z | 2022-03-31T21:32:08.000Z | qhub/cli/validate.py | pierrotsmnrd/qhub | 399684c79f331923444b4fe46fae38ee02bfa2ac | [
"BSD-3-Clause"
] | 36 | 2020-08-19T21:03:32.000Z | 2022-03-18T17:04:50.000Z | import pathlib
from ruamel import yaml
from qhub.schema import verify
from qhub.provider.cicd.linter import comment_on_pr
def create_validate_subcommand(subparser):
subparser = subparser.add_parser("validate")
subparser.add_argument(
"configdeprecated",
help="qhub configuration yaml file (dep... | 30.92 | 128 | 0.674644 | import pathlib
from ruamel import yaml
from qhub.schema import verify
from qhub.provider.cicd.linter import comment_on_pr
def create_validate_subcommand(subparser):
subparser = subparser.add_parser("validate")
subparser.add_argument(
"configdeprecated",
help="qhub configuration yaml file (dep... | true | true |
f708eee42ccb35a6cc075bb1efa20fbf89f53cc0 | 5,340 | py | Python | server/extensions/json/__init__.py | ojengwa/zapcore | f9eace7dc8ab4bc8bc3bb9c212ba43395e0459c1 | [
"MIT"
] | null | null | null | server/extensions/json/__init__.py | ojengwa/zapcore | f9eace7dc8ab4bc8bc3bb9c212ba43395e0459c1 | [
"MIT"
] | 3 | 2020-09-05T08:03:34.000Z | 2021-05-07T20:03:30.000Z | server/extensions/json/__init__.py | ojengwa/zapcore | f9eace7dc8ab4bc8bc3bb9c212ba43395e0459c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import datetime
import decimal
import io
import uuid
from flask import current_app
from flask import json as _json
from flask import request
from sqlalchemy import types
import arrow
text_type = str
def _wrap_reader_for_text(fp, encoding):
if is... | 29.502762 | 79 | 0.626966 |
from __future__ import absolute_import
import datetime
import decimal
import io
import uuid
from flask import current_app
from flask import json as _json
from flask import request
from sqlalchemy import types
import arrow
text_type = str
def _wrap_reader_for_text(fp, encoding):
if isinstance(fp.read(0), byt... | true | true |
f708ef284ffde13b9c42794d15d4414bf0e90f92 | 5,765 | py | Python | matchzoo/layers/matching_layer.py | songzy12/MatchZoo | a43dc3b1d43b3f2a1b43b11d3fc4009616507e23 | [
"Apache-2.0"
] | null | null | null | matchzoo/layers/matching_layer.py | songzy12/MatchZoo | a43dc3b1d43b3f2a1b43b11d3fc4009616507e23 | [
"Apache-2.0"
] | null | null | null | matchzoo/layers/matching_layer.py | songzy12/MatchZoo | a43dc3b1d43b3f2a1b43b11d3fc4009616507e23 | [
"Apache-2.0"
] | null | null | null | """An implementation of Matching Layer."""
import typing
import tensorflow as tf
from tensorflow.keras import layers
class MatchingLayer(layers.Layer):
"""
Layer that computes a matching matrix between samples in two tensors.
:param normalize: Whether to L2-normalize samples along the
dot produc... | 40.886525 | 78 | 0.542411 | import typing
import tensorflow as tf
from tensorflow.keras import layers
class MatchingLayer(layers.Layer):
def __init__(self, normalize: bool = False,
matching_type: str = 'dot', **kwargs):
super().__init__(**kwargs)
self._normalize = normalize
self._validate_matching_... | true | true |
f708ef89a08aef7d612c148ff2981aa853e4aef5 | 3,386 | py | Python | test/noise.py | 738844605/DualResidualNetworks | 6d025e074d4c914fae86f51cd8b93569a2c05335 | [
"MIT"
] | 144 | 2019-04-08T02:22:00.000Z | 2022-02-13T09:11:33.000Z | test/noise.py | 738844605/DualResidualNetworks | 6d025e074d4c914fae86f51cd8b93569a2c05335 | [
"MIT"
] | 14 | 2019-05-09T09:07:08.000Z | 2020-07-20T15:45:41.000Z | test/noise.py | 738844605/DualResidualNetworks | 6d025e074d4c914fae86f51cd8b93569a2c05335 | [
"MIT"
] | 27 | 2019-07-19T03:09:20.000Z | 2021-12-13T07:48:57.000Z | # python 2.7, pytorch 0.3.1
import os, sys
sys.path.insert(1, '../')
import torch
import cv2
import shutil
import torchvision
import numpy as np
import itertools
import subprocess
import random
import matplotlib.pyplot as plt
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transform... | 33.196078 | 94 | 0.66775 |
import os, sys
sys.path.insert(1, '../')
import torch
import cv2
import shutil
import torchvision
import numpy as np
import itertools
import subprocess
import random
import matplotlib.pyplot as plt
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
import torch.nn.functional... | true | true |
f708f0c7bbe3d285c8aedcc6394fd2a3abb0e815 | 5,624 | py | Python | main.py | sayabiws/simple-image-recommender | 27162c544fc08b5774049039694f0fa7c7faac3f | [
"MIT"
] | null | null | null | main.py | sayabiws/simple-image-recommender | 27162c544fc08b5774049039694f0fa7c7faac3f | [
"MIT"
] | null | null | null | main.py | sayabiws/simple-image-recommender | 27162c544fc08b5774049039694f0fa7c7faac3f | [
"MIT"
] | null | null | null | # Simple image recommender
#
# required:
# data/images: a folder containing your images dataset
# data/users: can be empty, but the folder needs to exist (for now ?)
#
# optional:
# data/tags.csv: a comma-separated list containing the names of your
# images and the corresponding semicolon-separated tags
# (eg. "37.pn... | 29.914894 | 127 | 0.707681 |
from PIL import Image
from sklearn.cluster import MiniBatchKMeans
from operator import itemgetter
import pandas
from sklearn.ensemble import RandomForestClassifier
import numpy as np
import pandas as pd
import json
import math
import os
import json
import csv
def user_data_gathering():
name = input("Please enter yo... | true | true |
f708f23f4476ea85a0d78e7a4200c72925111a1e | 3,509 | py | Python | tensorflow/python/pywrap_tensorflow.py | Nickmeagan70/tensorflow | 6bfedde8466daced9f40a0e11840f5ce274abc7d | [
"Apache-2.0"
] | 7 | 2022-03-04T21:14:47.000Z | 2022-03-22T23:07:39.000Z | tensorflow/python/pywrap_tensorflow.py | Nickmeagan70/tensorflow | 6bfedde8466daced9f40a0e11840f5ce274abc7d | [
"Apache-2.0"
] | 1 | 2022-03-08T18:28:46.000Z | 2022-03-08T18:37:20.000Z | tensorflow/python/pywrap_tensorflow.py | Nickmeagan70/tensorflow | 6bfedde8466daced9f40a0e11840f5ce274abc7d | [
"Apache-2.0"
] | 1 | 2022-03-22T00:45:15.000Z | 2022-03-22T00:45:15.000Z | # Copyright 2020 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... | 40.333333 | 95 | 0.756341 |
import ctypes
import sys
import traceback
from tensorflow.python.platform import self_check
self_check.preload_check()
try:
from tensorflow.python import pywrap_dlopen_global_flags
_use_dlopen_global_flags = True
except ImportError:
_use_dlopen_global_flags = False
_can_set_rtld_local = (
hasattr(s... | true | true |
f708f2f0b553930c894e78d06a8b5edf7efb032f | 6,398 | py | Python | src/scipp/plotting/tools.py | nvaytet/scipp | f14f56ed19cccb4162d55b1123df7225eeedb395 | [
"BSD-3-Clause"
] | 43 | 2019-04-08T14:13:11.000Z | 2022-02-08T06:09:35.000Z | src/scipp/plotting/tools.py | nvaytet/scipp | f14f56ed19cccb4162d55b1123df7225eeedb395 | [
"BSD-3-Clause"
] | 1,342 | 2019-03-30T07:06:08.000Z | 2022-03-28T13:12:47.000Z | src/scipp/plotting/tools.py | nvaytet/scipp | f14f56ed19cccb4162d55b1123df7225eeedb395 | [
"BSD-3-Clause"
] | 12 | 2019-06-13T08:56:12.000Z | 2021-11-04T08:24:18.000Z | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2021 Scipp contributors (https://github.com/scipp)
# @author Neil Vaytet
from .. import config
from ..core import concatenate, values, dtype, units, nanmin, nanmax, histogram, \
full_like
from ..core import Variable, DataArray
from ..core import abs as ab... | 31.058252 | 82 | 0.586902 |
from .. import config
from ..core import concatenate, values, dtype, units, nanmin, nanmax, histogram, \
full_like
from ..core import Variable, DataArray
from ..core import abs as abs_
import numpy as np
from copy import copy
import io
def get_line_param(name=None, index=None):
param = getattr(config.plo... | true | true |
f708f31fda5291b510a4b006df811bd66c465bd9 | 85,439 | bzl | Python | tensorflow/tensorflow.bzl | ShaunHeNJU/DeepRec-1 | e280fb19de179f03dc05e1d8e3f4f7459796d96e | [
"Apache-2.0"
] | 1 | 2021-12-24T06:04:16.000Z | 2021-12-24T06:04:16.000Z | tensorflow/tensorflow.bzl | ShaunHeNJU/DeepRec-1 | e280fb19de179f03dc05e1d8e3f4f7459796d96e | [
"Apache-2.0"
] | null | null | null | tensorflow/tensorflow.bzl | ShaunHeNJU/DeepRec-1 | e280fb19de179f03dc05e1d8e3f4f7459796d96e | [
"Apache-2.0"
] | 1 | 2022-02-28T08:28:25.000Z | 2022-02-28T08:28:25.000Z | # -*- Python -*-
# Return the options to use for a C++ library or binary build.
# Uses the ":optmode" config_setting to pick the options.
load(
"//tensorflow/core/platform:default/build_config_root.bzl",
"if_dynamic_kernels",
"if_static",
"tf_additional_grpc_deps_py",
"tf_additional_xla_deps_py",
... | 33.180194 | 310 | 0.588373 |
load(
"//tensorflow/core/platform:default/build_config_root.bzl",
"if_dynamic_kernels",
"if_static",
"tf_additional_grpc_deps_py",
"tf_additional_xla_deps_py",
"tf_cuda_tests_tags",
"tf_exec_compatible_with",
"tf_gpu_tests_tags",
"tf_sycl_tests_tags",
)
load(
"@local_config_tens... | true | true |
f708f38157a3bbf5a76937de0696b8f45e77f048 | 5,275 | py | Python | controllers/assessments.py | dgerod/cb4oru | b5fb3bd52193ab21b30b6917232a799ac41b6c32 | [
"Apache-2.0"
] | 1 | 2018-01-22T20:23:27.000Z | 2018-01-22T20:23:27.000Z | controllers/assessments.py | dgerod/cb4oru | b5fb3bd52193ab21b30b6917232a799ac41b6c32 | [
"Apache-2.0"
] | null | null | null | controllers/assessments.py | dgerod/cb4oru | b5fb3bd52193ab21b30b6917232a799ac41b6c32 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 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 ... | 36.631944 | 79 | 0.676209 |
__author__ = 'pgbovine@google.com (Philip Guo)'
import datetime
import json
from models import models
from models import utils
from models.models import Student
from models.models import StudentAnswersEntity
from utils import BaseHandler
from google.appengine.ext import db
def store_score(student, assessment_type,... | true | true |
f708f4c7a59dd97c0a9b8754f56fc94ff4f5d026 | 10,035 | py | Python | src/nodemgr/main.py | zhongyangni/controller | 439032d46767dd033ba55c1e5c34e7f2213da8b3 | [
"Apache-2.0"
] | null | null | null | src/nodemgr/main.py | zhongyangni/controller | 439032d46767dd033ba55c1e5c34e7f2213da8b3 | [
"Apache-2.0"
] | 2 | 2018-12-04T02:20:52.000Z | 2018-12-22T06:16:30.000Z | src/nodemgr/main.py | zhongyangni/controller | 439032d46767dd033ba55c1e5c34e7f2213da8b3 | [
"Apache-2.0"
] | 1 | 2018-12-04T02:07:47.000Z | 2018-12-04T02:07:47.000Z | #
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
#!/usr/bin/python
doc = """\
Node manager listens to process state change events and
other flag value change events to provide advanced service
management functionality.
Rules files looks like following:
====================
{ "Rules": [
{"pro... | 40.792683 | 88 | 0.614748 |
doc = """\
Node manager listens to process state change events and
other flag value change events to provide advanced service
management functionality.
Rules files looks like following:
====================
{ "Rules": [
{"process_name": "contrail-query-engine",
"process_state": "PROCESS_STATE_FATAL",
... | false | true |
f708f4f7a69c96ae81bce8dac525d2845164097e | 1,608 | py | Python | modules/party/forms.py | BurraAbhishek/VirtualElections_v2 | db95f58d09ee5ed9755a3910aebcbfb48302b04e | [
"Apache-2.0"
] | 1 | 2022-01-30T19:55:47.000Z | 2022-01-30T19:55:47.000Z | modules/party/forms.py | BurraAbhishek/VirtualElections_v2 | db95f58d09ee5ed9755a3910aebcbfb48302b04e | [
"Apache-2.0"
] | null | null | null | modules/party/forms.py | BurraAbhishek/VirtualElections_v2 | db95f58d09ee5ed9755a3910aebcbfb48302b04e | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.forms.widgets import PasswordInput
from modules.common.id_choicefield import IdentificationField
class PartyForm(forms.Form):
error_messages = {
'password_mismatch': (
'The confirmation was different from that you chose.'
),
}
party_name =... | 24.738462 | 73 | 0.643657 | from django import forms
from django.forms.widgets import PasswordInput
from modules.common.id_choicefield import IdentificationField
class PartyForm(forms.Form):
error_messages = {
'password_mismatch': (
'The confirmation was different from that you chose.'
),
}
party_name =... | true | true |
f708f5aace0d5437314d23389d4db32b009a8935 | 8,265 | py | Python | horizon/workflows/views.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/horizon/workflows/views.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/horizon/workflows/views.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 38.44186 | 79 | 0.632184 |
import copy
import json
from django import forms
from django import http
from django import shortcuts
from django.views import generic
import six
from horizon import exceptions
from horizon.forms import views as hz_views
from horizon.forms.views import ADD_TO_FIELD_HEADER from horizon import messages
class Workf... | true | true |
f708f675d7c4e19130ddf6f100485d7b50c26946 | 711 | py | Python | PygFW/Builtin/Events/EntityClickEvent.py | shauncameron/PygFW | 970541d0c3fc6e1f306fe527d90834a620694804 | [
"MIT"
] | null | null | null | PygFW/Builtin/Events/EntityClickEvent.py | shauncameron/PygFW | 970541d0c3fc6e1f306fe527d90834a620694804 | [
"MIT"
] | 4 | 2021-04-15T00:12:14.000Z | 2021-04-18T20:46:09.000Z | build/lib/PygFW/Builtin/Events/EntityClickEvent.py | shauncameron/PygFW | 970541d0c3fc6e1f306fe527d90834a620694804 | [
"MIT"
] | null | null | null | from PygFW import Event
import pygame
class EntityClickEvent(Event):
def __init__(self, scene_surface):
Event.__init__(self, scene_surface, pygame.MOUSEBUTTONDOWN)
def executor(self, scene, event):
for entity in scene.entities._list_:
if entity.clickable:
if en... | 21.545455 | 67 | 0.651195 | from PygFW import Event
import pygame
class EntityClickEvent(Event):
def __init__(self, scene_surface):
Event.__init__(self, scene_surface, pygame.MOUSEBUTTONDOWN)
def executor(self, scene, event):
for entity in scene.entities._list_:
if entity.clickable:
if en... | true | true |
f708f82a32b1ca8094a66b729c31827022f652e8 | 1,690 | py | Python | examples/wait_terminated.py | gridengine/drmaa2-python | 36e84e8dc0079c9e3d772c1536f07ecb1e435684 | [
"Apache-2.0"
] | 10 | 2019-05-28T23:17:39.000Z | 2022-01-14T08:52:54.000Z | examples/wait_terminated.py | iamh2o/drmaa2-python | 36e84e8dc0079c9e3d772c1536f07ecb1e435684 | [
"Apache-2.0"
] | 5 | 2019-11-01T10:50:19.000Z | 2021-12-13T11:56:19.000Z | examples/wait_terminated.py | iamh2o/drmaa2-python | 36e84e8dc0079c9e3d772c1536f07ecb1e435684 | [
"Apache-2.0"
] | 2 | 2019-02-26T16:36:07.000Z | 2019-10-29T02:02:06.000Z | #!/usr/bin/env python
# ___INFO__MARK_BEGIN__
#######################################################################################
# Copyright 2008-2021 Univa Corporation (acquired and owned by Altair Engineering Inc.)
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file exc... | 38.409091 | 87 | 0.623669 |
import time
from drmaa2 import JobSession
from drmaa2 import JobInfo
from drmaa2 import Time
if __name__ == '__main__':
js = JobSession('js-01')
print('Created job session: %s' % js.name)
j = js.run_job({'remote_command': '/bin/sleep', 'args': ['100']})
print('Submitted job: %s, waiting on start' % j)... | true | true |
f708f85ee111c98d70db5adf69d738fcf803c184 | 1,991 | py | Python | tensorflow/predict.py | alishameli/CS231n-Sample-Code-1 | e47e593026c80530f7c387c4feca24f88c1618a2 | [
"BSD-2-Clause"
] | null | null | null | tensorflow/predict.py | alishameli/CS231n-Sample-Code-1 | e47e593026c80530f7c387c4feca24f88c1618a2 | [
"BSD-2-Clause"
] | null | null | null | tensorflow/predict.py | alishameli/CS231n-Sample-Code-1 | e47e593026c80530f7c387c4feca24f88c1618a2 | [
"BSD-2-Clause"
] | null | null | null | import argparse
import os
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
from PIL import Image
import models
def predict(model_data_path, image_path):
# Default input size
height = 228
width = 304
channels = 3
batch_size = 1
# Read image
img = Image.o... | 25.857143 | 82 | 0.616775 | import argparse
import os
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
from PIL import Image
import models
def predict(model_data_path, image_path):
height = 228
width = 304
channels = 3
batch_size = 1
img = Image.open(image_path)
img = img.resi... | true | true |
f708f8c29a2b935211377999a17a11f8c119f77c | 168 | py | Python | tests/model_control/detailed/transf_Logit/model_control_one_enabled_Logit_MovingAverage_Seasonal_DayOfMonth_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Logit/model_control_one_enabled_Logit_MovingAverage_Seasonal_DayOfMonth_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Logit/model_control_one_enabled_Logit_MovingAverage_Seasonal_DayOfMonth_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Logit'] , ['MovingAverage'] , ['Seasonal_DayOfMonth'] , ['LSTM'] ); | 42 | 90 | 0.761905 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Logit'] , ['MovingAverage'] , ['Seasonal_DayOfMonth'] , ['LSTM'] ); | true | true |
f708f8e5cdfa0014f95318bafc336ec46675c827 | 12,690 | py | Python | src/hpc/autoscale/job/demandprinter.py | hmeiland/cyclecloud-scalelib | f246737ddea631c7378d716a51431857eb6b06b3 | [
"MIT"
] | null | null | null | src/hpc/autoscale/job/demandprinter.py | hmeiland/cyclecloud-scalelib | f246737ddea631c7378d716a51431857eb6b06b3 | [
"MIT"
] | null | null | null | src/hpc/autoscale/job/demandprinter.py | hmeiland/cyclecloud-scalelib | f246737ddea631c7378d716a51431857eb6b06b3 | [
"MIT"
] | null | null | null | import inspect
import io
import json
import logging as logginglib
import sys
from datetime import datetime
from typing import Any, Callable, Dict, List, Optional, Set, TextIO, Tuple
from typing_extensions import Literal
from hpc.autoscale import hpclogging as logging
from hpc.autoscale.codeanalysis import hpcwrapclas... | 33.660477 | 104 | 0.545469 | import inspect
import io
import json
import logging as logginglib
import sys
from datetime import datetime
from typing import Any, Callable, Dict, List, Optional, Set, TextIO, Tuple
from typing_extensions import Literal
from hpc.autoscale import hpclogging as logging
from hpc.autoscale.codeanalysis import hpcwrapclas... | true | true |
f708f90566cd4035c61dccabe262ed5ac91bc040 | 418 | py | Python | setup.py | sluedtke/borg_hydro | ef856784191e21e98e7fe8dd906c0dd9f82fd4ff | [
"MIT"
] | null | null | null | setup.py | sluedtke/borg_hydro | ef856784191e21e98e7fe8dd906c0dd9f82fd4ff | [
"MIT"
] | null | null | null | setup.py | sluedtke/borg_hydro | ef856784191e21e98e7fe8dd906c0dd9f82fd4ff | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('LICENSE') as f:
license = f.read()
setup(
name='borg_hydro',
version='0.1.0',
author='Stefan Lüdtke',
url='https://git.gfz-potsdam.de:sluedtke/borg_hydro.git',
packages=find_packages(),
license=license,
in... | 20.9 | 61 | 0.655502 |
from setuptools import setup, find_packages
with open('LICENSE') as f:
license = f.read()
setup(
name='borg_hydro',
version='0.1.0',
author='Stefan Lüdtke',
url='https://git.gfz-potsdam.de:sluedtke/borg_hydro.git',
packages=find_packages(),
license=license,
include_package_data=True,... | true | true |
f708f90948cf6c550c9741e8d27b736df78d0e44 | 83,746 | py | Python | evennia/objects/objects.py | zeitkunst/evennia | 1f254b2542fbefe400c114b3d7029522cdcb37b7 | [
"BSD-3-Clause"
] | null | null | null | evennia/objects/objects.py | zeitkunst/evennia | 1f254b2542fbefe400c114b3d7029522cdcb37b7 | [
"BSD-3-Clause"
] | null | null | null | evennia/objects/objects.py | zeitkunst/evennia | 1f254b2542fbefe400c114b3d7029522cdcb37b7 | [
"BSD-3-Clause"
] | null | null | null | """
This module defines the basic `DefaultObject` and its children
`DefaultCharacter`, `DefaultAccount`, `DefaultRoom` and `DefaultExit`.
These are the (default) starting points for all in-game visible
entities.
"""
import time
import inflect
from builtins import object
from future.utils import with_metaclass
from col... | 39.042424 | 117 | 0.5889 | import time
import inflect
from builtins import object
from future.utils import with_metaclass
from collections import defaultdict
from django.conf import settings
from evennia.typeclasses.models import TypeclassBase
from evennia.typeclasses.attributes import NickHandler
from evennia.objects.manager import ObjectMana... | true | true |
f708f96bbfaa16617380f5df256668d0302deda9 | 204 | py | Python | pickeats/admin.py | PatrickKan/PickEats | 9d82a5fc1dfd0d329bf16f7fc60f1c3e7e676d53 | [
"MIT"
] | 1 | 2020-05-03T04:28:57.000Z | 2020-05-03T04:28:57.000Z | pickeats/admin.py | PatrickKan/PickEats | 9d82a5fc1dfd0d329bf16f7fc60f1c3e7e676d53 | [
"MIT"
] | null | null | null | pickeats/admin.py | PatrickKan/PickEats | 9d82a5fc1dfd0d329bf16f7fc60f1c3e7e676d53 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Preference, Profile, Allergy, Goal
admin.site.register(Preference)
admin.site.register(Profile)
admin.site.register(Allergy)
admin.site.register(Goal) | 29.142857 | 54 | 0.823529 | from django.contrib import admin
from .models import Preference, Profile, Allergy, Goal
admin.site.register(Preference)
admin.site.register(Profile)
admin.site.register(Allergy)
admin.site.register(Goal) | true | true |
f708f9c9fe0eba5341025819686777bb36f2107c | 1,440 | py | Python | contents/serializers.py | omaralbeik/omaralbeik.com-api | 03ce663fe2b3c52363520437d0f5b09cfcb121db | [
"MIT"
] | null | null | null | contents/serializers.py | omaralbeik/omaralbeik.com-api | 03ce663fe2b3c52363520437d0f5b09cfcb121db | [
"MIT"
] | 1 | 2018-04-05T13:44:13.000Z | 2018-04-05T14:45:32.000Z | contents/serializers.py | omaralbeik/omaralbeik.com-api | 03ce663fe2b3c52363520437d0f5b09cfcb121db | [
"MIT"
] | null | null | null | from rest_framework import serializers
import markdown2
from .models import Content
from omaralbeik import server_variables as sv
class ContentSerializer(serializers.ModelSerializer):
tags = serializers.SerializerMethodField()
html_text = serializers.SerializerMethodField()
website_url = serializers.Seria... | 28.8 | 77 | 0.596528 | from rest_framework import serializers
import markdown2
from .models import Content
from omaralbeik import server_variables as sv
class ContentSerializer(serializers.ModelSerializer):
tags = serializers.SerializerMethodField()
html_text = serializers.SerializerMethodField()
website_url = serializers.Seria... | true | true |
f708fae5236a29c52f4f67d0421e7b9ff03707cb | 3,962 | py | Python | Scripts/GenCode_Explore_106.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | 1 | 2021-08-16T14:49:04.000Z | 2021-08-16T14:49:04.000Z | Scripts/GenCode_Explore_106.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | null | null | null | Scripts/GenCode_Explore_106.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # GenCode Explore
#
# Explore the human RNA sequences from GenCode.
#
# Assume user downloaded files from GenCode 38 [FTP](http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_38/)
# to a subdirectory called data.
#
# Move the GenCodeLoader class to its own python... | 25.895425 | 122 | 0.702171 |
import time
def show_time():
t = time.time()
s = time.strftime('%Y-%m-%d %H:%M:%S %Z', time.localtime(t))
print(s)
show_time()
import numpy as np
import pandas as pd
import sys
try:
from google.colab import drive
IN_COLAB = True
print("On Google CoLab, mount cloud-local file, get our c... | true | true |
f708fb900227794707bf957d23d33551a3309da5 | 896 | py | Python | python/mxnet/gluon/contrib/__init__.py | Vikas-kum/incubator-mxnet | ba02bf2fe2da423caa59ddb3fd5e433b90b730bf | [
"Apache-2.0"
] | 64 | 2021-05-02T14:42:34.000Z | 2021-05-06T01:35:03.000Z | python/mxnet/gluon/contrib/__init__.py | Vikas-kum/incubator-mxnet | ba02bf2fe2da423caa59ddb3fd5e433b90b730bf | [
"Apache-2.0"
] | 187 | 2018-03-16T23:44:43.000Z | 2021-12-14T21:19:54.000Z | python/mxnet/gluon/contrib/__init__.py | Vikas-kum/incubator-mxnet | ba02bf2fe2da423caa59ddb3fd5e433b90b730bf | [
"Apache-2.0"
] | 51 | 2019-07-12T05:10:25.000Z | 2021-07-28T16:19:06.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... | 34.461538 | 62 | 0.761161 |
from . import nn
from . import rnn
from . import data
| true | true |
f708fca358a07d2554ea49c3a9e960e30af22afa | 4,693 | py | Python | spektral/datasets/delaunay.py | dbusbridge/spektral | 83eaa381a263d0a217692b6f1018388946e85c45 | [
"MIT"
] | 1 | 2020-06-25T03:29:30.000Z | 2020-06-25T03:29:30.000Z | spektral/datasets/delaunay.py | kprzybylapara/pylint | a95807603c2bb96c80f34d326f663273c72ca3fc | [
"MIT"
] | null | null | null | spektral/datasets/delaunay.py | kprzybylapara/pylint | a95807603c2bb96c80f34d326f663273c72ca3fc | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import numpy as np
from scipy.spatial import Delaunay
from spektral.utils import label_to_one_hot, numpy_to_nx
RETURN_TYPES = {'numpy', 'networkx'}
MAX_K = 7 # Maximum number of nodes in a graph
def generate_data(return_type='networkx', classes=0, n_samples_in_class=1000,
... | 39.436975 | 86 | 0.644364 | from __future__ import absolute_import
import numpy as np
from scipy.spatial import Delaunay
from spektral.utils import label_to_one_hot, numpy_to_nx
RETURN_TYPES = {'numpy', 'networkx'}
MAX_K = 7
def generate_data(return_type='networkx', classes=0, n_samples_in_class=1000,
n_nodes=7, support_lo... | true | true |
f708fe9ca7fe20dd9c734aeeb55a3dff1eb26bab | 12,442 | py | Python | .tox/scenario/lib/python2.7/site-packages/testrepository/ui/cli.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/testrepository/ui/cli.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/testrepository/ui/cli.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | 1 | 2020-07-21T02:18:23.000Z | 2020-07-21T02:18:23.000Z | #
# Copyright (c) 2009 Testrepository Contributors
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two lice... | 39.003135 | 80 | 0.578364 |
import io
import os
import signal
import subunit
import sys
from extras import try_import
v2_avail = try_import('subunit.ByteStreamToStreamResult')
import testtools
from testtools import ExtendedToStreamDecorator, StreamToExtendedDecorator
from testtools.compat import unicode_output_stream, _u
from testrepository i... | true | true |
f708ff0c051d3ee67c01661715510a72136a41d7 | 2,372 | py | Python | TWLight/users/migrations/0076_auto_20210624_1015.py | aacaldwell/TWLight | 68e6d0d81ddd52596025f15d2c9a75dcdf504734 | [
"MIT"
] | 67 | 2017-12-14T22:27:48.000Z | 2022-03-13T18:21:31.000Z | TWLight/users/migrations/0076_auto_20210624_1015.py | aacaldwell/TWLight | 68e6d0d81ddd52596025f15d2c9a75dcdf504734 | [
"MIT"
] | 433 | 2017-03-24T22:51:23.000Z | 2022-03-31T19:36:22.000Z | TWLight/users/migrations/0076_auto_20210624_1015.py | Mahuton/TWLight | 90b299d07b0479f21dc90e17b8d05f5a221b0de1 | [
"MIT"
] | 105 | 2017-06-23T03:53:41.000Z | 2022-03-30T17:24:29.000Z | # Generated by Django 3.1.12 on 2021-06-24 10:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("users", "0075_auto_20210607_1312"),
]
operations = [
migrations.AlterField(
model_name="userprofile",
name="lang",
... | 33.408451 | 53 | 0.29511 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("users", "0075_auto_20210607_1312"),
]
operations = [
migrations.AlterField(
model_name="userprofile",
name="lang",
field=models.CharField(
... | true | true |
f708ff486b81166cc40bc29b8b4461414fe460e6 | 5,443 | py | Python | samples/snippets/conftest.py | LaudateCorpus1/python-bigquery-datatransfer | babbaf7c6d4bb0c7485eb077b90303d99b32da30 | [
"Apache-2.0"
] | 58 | 2020-03-05T16:06:45.000Z | 2022-03-28T18:20:46.000Z | samples/snippets/conftest.py | LaudateCorpus1/python-bigquery-datatransfer | babbaf7c6d4bb0c7485eb077b90303d99b32da30 | [
"Apache-2.0"
] | 120 | 2020-02-05T09:56:10.000Z | 2022-03-23T00:19:09.000Z | samples/snippets/conftest.py | LaudateCorpus1/python-bigquery-datatransfer | babbaf7c6d4bb0c7485eb077b90303d99b32da30 | [
"Apache-2.0"
] | 21 | 2020-02-05T23:11:23.000Z | 2022-01-29T08:07:36.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 34.01875 | 88 | 0.756752 |
import datetime
import os
import random
import uuid
from google.api_core import client_options
import google.api_core.exceptions
import google.auth
from google.cloud import bigquery
from google.cloud import bigquery_datatransfer
from google.cloud import pubsub_v1
import pytest
RESOURCE_PREFIX = "python_bigquery_dat... | true | true |
f708ff6f7bc2862d008b44cf3e33e780b4f3c6fa | 6,442 | py | Python | pypeit/scripts/flux_setup.py | finagle29/PypeIt | 418d6d24d24054ad590d2f06c0b4688ea18f492e | [
"BSD-3-Clause"
] | null | null | null | pypeit/scripts/flux_setup.py | finagle29/PypeIt | 418d6d24d24054ad590d2f06c0b4688ea18f492e | [
"BSD-3-Clause"
] | null | null | null | pypeit/scripts/flux_setup.py | finagle29/PypeIt | 418d6d24d24054ad590d2f06c0b4688ea18f492e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import argparse
import os,time
import numpy as np
from astropy.io import fits
from astropy.table import Table
from pypeit import msgs
from pypeit.par.util import make_pypeit_file
class SmartFormatter(argparse.HelpFormatter):
def _split_lines(self, text, width):
if text.startswith('R... | 44.427586 | 127 | 0.586153 | import argparse
import os,time
import numpy as np
from astropy.io import fits
from astropy.table import Table
from pypeit import msgs
from pypeit.par.util import make_pypeit_file
class SmartFormatter(argparse.HelpFormatter):
def _split_lines(self, text, width):
if text.startswith('R|'):
retur... | true | true |
f70900170d8c9fcf57f9fec29511f5b14e33da5a | 8,192 | py | Python | doc/source/conf.py | bswartz/cinder | 6cfecade9e2ee86bbb7d95c3c401c9e4c70f6a96 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | bswartz/cinder | 6cfecade9e2ee86bbb7d95c3c401c9e4c70f6a96 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | bswartz/cinder | 6cfecade9e2ee86bbb7d95c3c401c9e4c70f6a96 | [
"Apache-2.0"
] | null | null | null | # cinder documentation build configuration file, created by
# sphinx-quickstart on Sat May 1 15:17:47 2010.
#
# This file is execfile()d with the current directory set
# to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values hav... | 32.63745 | 81 | 0.708252 |
import os
import subprocess
import sys
import warnings
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('./'))
extensions = ['sphinx.ext.autodoc',
'ext.cinder_todo',
'sphinx.ext.coverage',
'sphinx.e... | true | true |
f70900c8f30868cb2768c4bd7aab9e34ca82c6c6 | 3,322 | py | Python | Agrus/settings.py | GlugovGrGlib/CtrlStorageApp | 0da23c2d5e6d565ffecaa75e1deb47a789a37ff1 | [
"MIT"
] | null | null | null | Agrus/settings.py | GlugovGrGlib/CtrlStorageApp | 0da23c2d5e6d565ffecaa75e1deb47a789a37ff1 | [
"MIT"
] | null | null | null | Agrus/settings.py | GlugovGrGlib/CtrlStorageApp | 0da23c2d5e6d565ffecaa75e1deb47a789a37ff1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Django settings for Agrus project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/se... | 25.166667 | 91 | 0.681818 | from pytz import timezone
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'gz6=&2*879yuym!pf(d8kch*30ow*eh=ybb-f0qsg+%c4+$@3c'
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'Agrus',
'kurs',
'django.contrib.admin',
'd... | true | true |
f70901151625154350ab62aebeb639896e2c320e | 975 | py | Python | awards/urls.py | yareyaska/awwards | e9ccae3ea2fd9b36a6d6d0c3933de121ef5bf5ed | [
"MIT"
] | null | null | null | awards/urls.py | yareyaska/awwards | e9ccae3ea2fd9b36a6d6d0c3933de121ef5bf5ed | [
"MIT"
] | 5 | 2020-06-05T22:47:45.000Z | 2021-09-08T01:16:30.000Z | awards/urls.py | yareyaska/awwards | e9ccae3ea2fd9b36a6d6d0c3933de121ef5bf5ed | [
"MIT"
] | null | null | null | """awards URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | 37.5 | 79 | 0.692308 | from django.conf.urls import url,include
from django.contrib import admin
from django.contrib.auth import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^',include('award.urls')),
url(r'^accounts/', include('registration.backends.simple.urls')),
url(r'^logout/$', views.logout, {"next_pa... | true | true |
f70901607d092422ea629b22f328383db82a6532 | 1,384 | py | Python | library/aiohttp/__init__.py | RouganStriker/BDOBot | 51fddfab4c06c8593d1d63543285fdf32b26c4f8 | [
"MIT"
] | 5 | 2019-06-10T10:42:22.000Z | 2019-07-10T14:05:13.000Z | library/aiohttp/__init__.py | RouganStriker/BDOBot | 51fddfab4c06c8593d1d63543285fdf32b26c4f8 | [
"MIT"
] | 3 | 2018-08-29T01:15:46.000Z | 2018-08-29T15:12:38.000Z | library/aiohttp/__init__.py | RouganStriker/BDOBot | 51fddfab4c06c8593d1d63543285fdf32b26c4f8 | [
"MIT"
] | 2 | 2018-08-30T14:36:20.000Z | 2019-06-17T13:07:18.000Z | __version__ = '1.0.5'
# Deprecated, keep it here for a while for backward compatibility.
import multidict # noqa
# This relies on each of the submodules having an __all__ variable.
from multidict import * # noqa
from . import hdrs # noqa
from .protocol import * # noqa
from .connector import * # noqa
from .clien... | 32.952381 | 79 | 0.657514 | __version__ = '1.0.5'
import multidict
from multidict import * from . import hdrs from .protocol import * from .connector import * from .client import * from .client_reqrep import * from .errors import * from .helpers import * from .parsers import * from .streams import * from .multipart import * from .c... | true | true |
f7090240b3aff921b5983ce0da0f77c0d2b72c2b | 311 | py | Python | python/p153.py | forewing/lc | 314468a1a3bb7d38eccf1f34b0d1b7da04a34784 | [
"CC0-1.0"
] | null | null | null | python/p153.py | forewing/lc | 314468a1a3bb7d38eccf1f34b0d1b7da04a34784 | [
"CC0-1.0"
] | null | null | null | python/p153.py | forewing/lc | 314468a1a3bb7d38eccf1f34b0d1b7da04a34784 | [
"CC0-1.0"
] | null | null | null | class Solution:
def findMin(self, nums: List[int]) -> int:
l = 0
r = len(nums) - 1
while r - l > 3:
m = (l + r) // 2
if nums[m] > nums[l] and nums[m] > nums[r]:
l = m + 1
else:
r = m
return min(nums[l:r+1])
| 25.916667 | 55 | 0.366559 | class Solution:
def findMin(self, nums: List[int]) -> int:
l = 0
r = len(nums) - 1
while r - l > 3:
m = (l + r) // 2
if nums[m] > nums[l] and nums[m] > nums[r]:
l = m + 1
else:
r = m
return min(nums[l:r+1])
| true | true |
f709056acf3cbbb016b307580078e37cb63de811 | 5,247 | py | Python | lib/django-1.4/django/contrib/gis/admin/options.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.4/django/contrib/gis/admin/options.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.4/django/contrib/gis/admin/options.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.db import models
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographic models. Map settings
may be... | 40.361538 | 117 | 0.593673 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.db import models
class GeoModelAdmin(ModelAdmin):
default_lon = 0
default_lat = 0
default_zoom = 4
display_wkt = Fals... | true | true |
f709057a2d026d1629ccdc2f418c49b8caa8ddab | 21,226 | py | Python | sdk/python/pulumi_aws/imagebuilder/distribution_configuration.py | RafalSumislawski/pulumi-aws | 7c8a335d327c173aa32c8b3d98816e760db329fa | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-11-10T16:33:40.000Z | 2021-11-10T16:33:40.000Z | sdk/python/pulumi_aws/imagebuilder/distribution_configuration.py | RafalSumislawski/pulumi-aws | 7c8a335d327c173aa32c8b3d98816e760db329fa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/imagebuilder/distribution_configuration.py | RafalSumislawski/pulumi-aws | 7c8a335d327c173aa32c8b3d98816e760db329fa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 46.143478 | 284 | 0.664751 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['DistributionConfigurationArgs', 'DistributionConfiguration']
@pulumi.input_type
class DistributionConfigurationAr... | true | true |
f70906aedaf542b287443373bffe8401a5d3591e | 882 | py | Python | pyx12/map_override.py | arenius/pyx12 | 537493deaa0b8e18a3fa72eb1b3eeae9ef043b11 | [
"BSD-3-Clause"
] | 120 | 2015-01-30T07:17:26.000Z | 2022-03-25T16:42:15.000Z | pyx12/map_override.py | arenius/pyx12 | 537493deaa0b8e18a3fa72eb1b3eeae9ef043b11 | [
"BSD-3-Clause"
] | 43 | 2015-02-12T18:42:26.000Z | 2021-12-12T22:22:20.000Z | pyx12/map_override.py | arenius/pyx12 | 537493deaa0b8e18a3fa72eb1b3eeae9ef043b11 | [
"BSD-3-Clause"
] | 85 | 2015-02-12T16:44:28.000Z | 2022-03-24T20:20:46.000Z | ######################################################################
# Copyright
# John Holland <john@zoner.org>
# All rights reserved.
#
# This software is licensed as described in the file LICENSE.txt, which
# you should have received as part of this distribution.
#
##############################################... | 25.941176 | 82 | 0.578231 |
class map_override(object):
def __init__(self, map_root, override_file, icvn, vriic, fic):
pass
def _set_value(self, map_root, path, variable, value):
pass
def _append_value(self, map_root, path, variable, value):
pass
def _reset_list(self, map_root, path, variable, value):... | true | true |
f7090725fa81666eade7bf5f5d55c5e7ff18d8ce | 3,586 | bzl | Python | haskell/private/dependencies.bzl | joneshf/rules_haskell | 77cf42c30a424f7e701c72c5feb31f49b5230351 | [
"Apache-2.0"
] | null | null | null | haskell/private/dependencies.bzl | joneshf/rules_haskell | 77cf42c30a424f7e701c72c5feb31f49b5230351 | [
"Apache-2.0"
] | null | null | null | haskell/private/dependencies.bzl | joneshf/rules_haskell | 77cf42c30a424f7e701c72c5feb31f49b5230351 | [
"Apache-2.0"
] | null | null | null | load(
"//haskell:providers.bzl",
"HaskellInfo",
"HaskellLibraryInfo",
)
load(":private/set.bzl", "set")
def gather_dep_info(ctx, deps):
"""Collapse dependencies into a single `HaskellInfo`.
Args:
ctx: Rule context.
deps: deps attribute.
Returns:
HaskellInfo: Unified informat... | 33.514019 | 103 | 0.617959 | load(
"//haskell:providers.bzl",
"HaskellInfo",
"HaskellLibraryInfo",
)
load(":private/set.bzl", "set")
def gather_dep_info(ctx, deps):
package_databases = depset(transitive = [
dep[HaskellInfo].package_databases
for dep in deps
if HaskellInfo in dep
])
static_libraries... | true | true |
f709097e17db2a904f99b4edcbc7bf034dbc3f63 | 2,118 | py | Python | cvat/apps/engine/admin.py | netanelbarel/improvedCvat | ff2894d3b3757a5e080d3130d6875cfd14201bf5 | [
"MIT"
] | null | null | null | cvat/apps/engine/admin.py | netanelbarel/improvedCvat | ff2894d3b3757a5e080d3130d6875cfd14201bf5 | [
"MIT"
] | 6 | 2020-03-25T11:49:12.000Z | 2020-06-06T01:35:38.000Z | cvat/apps/engine/admin.py | netanelbarel/improvedCvat | ff2894d3b3757a5e080d3130d6875cfd14201bf5 | [
"MIT"
] | 1 | 2020-03-25T11:40:48.000Z | 2020-03-25T11:40:48.000Z |
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
from django.contrib import admin
from .models import Task, Segment, Job, Label, AttributeSpec
class JobInline(admin.TabularInline):
model = Job
can_delete = False
# Don't show extra lines to add an object
def has_ad... | 27.506494 | 90 | 0.663362 |
from django.contrib import admin
from .models import Task, Segment, Job, Label, AttributeSpec
class JobInline(admin.TabularInline):
model = Job
can_delete = False
def has_add_permission(self, request, object=None):
return False
class SegmentInline(admin.TabularInline):
mode... | true | true |
f70909e149d95c858ea8bf08919cce01258289e8 | 24 | py | Python | me/maurer/__init__.py | amaurer/alarmdecoder-implementation | 9b090064fd23f20ec707a8d388dc910dd260621a | [
"Apache-2.0"
] | 1 | 2018-03-08T04:25:31.000Z | 2018-03-08T04:25:31.000Z | me/maurer/__init__.py | amaurer/alarmdecoder-implementation | 9b090064fd23f20ec707a8d388dc910dd260621a | [
"Apache-2.0"
] | null | null | null | me/maurer/__init__.py | amaurer/alarmdecoder-implementation | 9b090064fd23f20ec707a8d388dc910dd260621a | [
"Apache-2.0"
] | null | null | null | __all__ = ['ZoneMapper'] | 24 | 24 | 0.708333 | __all__ = ['ZoneMapper'] | true | true |
f7090a9af584868b539a64c9c814074daf94e5d1 | 5,854 | py | Python | python/dazl/model/core.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/model/core.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/model/core.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
This module has been relocated to ``dazl.client``, ``dazl.damlast``, ``dazl.protocols``, or
``dazl.query``.
"""
from typing import TYPE_CHECKING, TypeVar, Union
import warnin... | 33.261364 | 102 | 0.65972 |
from typing import TYPE_CHECKING, TypeVar, Union
import warnings
from ..client.errors import ConfigurationError, DazlPartyMissingError, UnknownTemplateWarning
from ..client.state import (
ContractContextualData,
ContractContextualDataCollection,
ContractsHistoricalState,
ContractsState,
)
from ..damla... | true | true |
f7090b2aa80fae95376267bfcca6f9bcf9a9ac8a | 956 | py | Python | hand_net/unet/unet_model.py | clearsky767/examples | d6c744061ba5ed56088af43edb171990c6942efd | [
"BSD-3-Clause"
] | null | null | null | hand_net/unet/unet_model.py | clearsky767/examples | d6c744061ba5ed56088af43edb171990c6942efd | [
"BSD-3-Clause"
] | null | null | null | hand_net/unet/unet_model.py | clearsky767/examples | d6c744061ba5ed56088af43edb171990c6942efd | [
"BSD-3-Clause"
] | null | null | null | # full assembly of the sub-parts to form the complete net
import torch.nn.functional as F
from .unet_parts import *
class UNet(nn.Module):
def __init__(self, n_channels, n_classes):
super(UNet, self).__init__()
self.inc = inconv(n_channels, 64)
self.down1 = down(64, 128)
self.down... | 27.314286 | 57 | 0.535565 |
import torch.nn.functional as F
from .unet_parts import *
class UNet(nn.Module):
def __init__(self, n_channels, n_classes):
super(UNet, self).__init__()
self.inc = inconv(n_channels, 64)
self.down1 = down(64, 128)
self.down2 = down(128, 256)
self.down3 = down(256, 512)
... | true | true |
f7090b86c5ae735d7f01c2e87f2bb1515113d44d | 4,104 | py | Python | adafruit_register/i2c_struct.py | jepler/Adafruit_CircuitPython_Register | 9f86b5179936bcb81d9765de2fe25c140b42036f | [
"MIT"
] | 1 | 2020-09-27T20:08:57.000Z | 2020-09-27T20:08:57.000Z | adafruit_register/i2c_struct.py | jepler/Adafruit_CircuitPython_Register | 9f86b5179936bcb81d9765de2fe25c140b42036f | [
"MIT"
] | null | null | null | adafruit_register/i2c_struct.py | jepler/Adafruit_CircuitPython_Register | 9f86b5179936bcb81d9765de2fe25c140b42036f | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2016 Adafruit Industries
#
# 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, cop... | 36.972973 | 84 | 0.711014 |
try:
import struct
except ImportError:
import ustruct as struct
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Register.git"
class Struct:
def __init__(self, register_address, struct_format):
self.format = struct_format
self.buffer = bytearra... | true | true |
f7090cb598007accc88c9bed1656ea701bed8a44 | 2,682 | py | Python | dbaas/physical/tests/test_commands.py | amintasvrp/database-as-a-service | 8221df604f9252ddf877cd2216bdf1e3f76220ba | [
"BSD-3-Clause"
] | 303 | 2015-01-08T10:35:54.000Z | 2022-02-28T08:54:06.000Z | dbaas/physical/tests/test_commands.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 124 | 2015-01-14T12:56:15.000Z | 2022-03-22T20:45:11.000Z | dbaas/physical/tests/test_commands.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 110 | 2015-01-02T11:59:48.000Z | 2022-02-28T08:54:06.000Z | from unittest import TestCase
from model_mommy import mommy
from physical.commands import HostCommandOL6, HostCommandOL7
class CommandsBaseTestCase(object):
OS_VERSION = ''
HOST_COMMAND_CLASS = None
EXPECTED_CMD_TMPL = ''
def setUp(self):
self.host = mommy.make(
'Host',
... | 27.090909 | 72 | 0.58352 | from unittest import TestCase
from model_mommy import mommy
from physical.commands import HostCommandOL6, HostCommandOL7
class CommandsBaseTestCase(object):
OS_VERSION = ''
HOST_COMMAND_CLASS = None
EXPECTED_CMD_TMPL = ''
def setUp(self):
self.host = mommy.make(
'Host',
... | true | true |
f7090d5e70f2d61e6c69b57be05d5e8ab3aee55e | 3,566 | py | Python | test/test_art_resize.py | atavakoulnia/beets | 006d24c02e805bcabb4b99c7cf9945e3b109df15 | [
"MIT"
] | 1 | 2020-03-03T05:46:47.000Z | 2020-03-03T05:46:47.000Z | test/test_art_resize.py | atavakoulnia/beets | 006d24c02e805bcabb4b99c7cf9945e3b109df15 | [
"MIT"
] | 3 | 2020-07-12T01:22:23.000Z | 2020-07-12T01:22:25.000Z | test/test_art_resize.py | atavakoulnia/beets | 006d24c02e805bcabb4b99c7cf9945e3b109df15 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2020, David Swarbrick.
#
# 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 ... | 32.126126 | 79 | 0.659563 |
from __future__ import division, absolute_import, print_function
import unittest
import os
from test import _common
from test.helper import TestHelper
from beets.util import syspath
from beets.util.artresizer import (
pil_resize,
im_resize,
get_im_version,
get_pil_version,
)
class ArtResizerFileS... | true | true |
f7090d957aaa1b8c2a23b217a0554f11e14ef4db | 6,740 | py | Python | src/pacsanini/db/dcm2model.py | aachick/pacsanini | b54e4f222eede3c31b04373253e4de0b2c91217b | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 10 | 2021-07-05T16:59:03.000Z | 2022-02-09T11:13:03.000Z | src/pacsanini/db/dcm2model.py | aachick/pacsanini | b54e4f222eede3c31b04373253e4de0b2c91217b | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 51 | 2021-07-05T08:29:35.000Z | 2021-11-30T08:30:10.000Z | src/pacsanini/db/dcm2model.py | aachick/pacsanini | b54e4f222eede3c31b04373253e4de0b2c91217b | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 2 | 2021-07-06T06:35:37.000Z | 2021-07-09T10:26:38.000Z | # Copyright (C) 2019-2020, Therapixel SA.
# All rights reserved.
# This file is subject to the terms and conditions described in the
# LICENSE file distributed in this package.
"""The dcm2model module provides methods that can be used to convert pydicom.Dataset
instances to sqlalchemy instances.
"""
from typing import ... | 30.636364 | 86 | 0.586053 | from typing import Tuple, Union
from pydicom import Dataset, dcmread
from pacsanini.convert import agestr2years, dcm2dict, str2datetime
from pacsanini.db.models import Image, Patient, Series, Study, StudyFind
from pacsanini.parse import DicomTagGroup
def dcm2patient(dcm: Dataset, institution: str = None) -> Patient... | true | true |
f7090e45c95d43db13aff7af0aef357d0ac5fadb | 5,502 | py | Python | interact/agents/ddpg/td3.py | rystrauss/interact | 4fd8a5ffd2b712beb81bc43587745b29c715d754 | [
"MIT"
] | 1 | 2020-11-13T01:59:21.000Z | 2020-11-13T01:59:21.000Z | interact/agents/ddpg/td3.py | rystrauss/interact | 4fd8a5ffd2b712beb81bc43587745b29c715d754 | [
"MIT"
] | 2 | 2021-04-04T22:27:04.000Z | 2021-05-21T17:35:32.000Z | interact/agents/ddpg/td3.py | rystrauss/interact | 4fd8a5ffd2b712beb81bc43587745b29c715d754 | [
"MIT"
] | null | null | null | from typing import Callable, Optional
import gin
import gym
from interact.agents.ddpg.ddpg import DDPGAgent
from interact.agents.utils import register
@gin.configurable(name_or_fn="td3", denylist=["env_fn"])
@register("td3")
class TD3Agent(DDPGAgent):
"""The Twin Delayed DDPG (TD3) algorithm.
This algorith... | 42.651163 | 87 | 0.65667 | from typing import Callable, Optional
import gin
import gym
from interact.agents.ddpg.ddpg import DDPGAgent
from interact.agents.utils import register
@gin.configurable(name_or_fn="td3", denylist=["env_fn"])
@register("td3")
class TD3Agent(DDPGAgent):
def __init__(
self,
env_fn: Callable[[], gy... | true | true |
f7090e9c13d03314f33aa0f682190043f9d895fc | 4,679 | py | Python | Util/Latex_generator.py | LamannaLeonardo/OLAM | 7a6611912ebb40d39a934dd454efec4cbb7913d3 | [
"MIT"
] | null | null | null | Util/Latex_generator.py | LamannaLeonardo/OLAM | 7a6611912ebb40d39a934dd454efec4cbb7913d3 | [
"MIT"
] | null | null | null | Util/Latex_generator.py | LamannaLeonardo/OLAM | 7a6611912ebb40d39a934dd454efec4cbb7913d3 | [
"MIT"
] | null | null | null | # Copyright (c) 2022, Leonardo Lamanna
# All rights reserved.
# This source code is licensed under the MIT-style license found in the
# LICENSE file in the root directory of this source tree.
import pandas as pd
import os
pd.options.display.max_colwidth = 100
def generate_latex_table(data_file, labels, tab_name, ca... | 40.686957 | 119 | 0.593075 |
import pandas as pd
import os
pd.options.display.max_colwidth = 100
def generate_latex_table(data_file, labels, tab_name, caption, header):
with open(tab_name + ".tex", "w") as f:
df = pd.read_excel(data_file, sheet_name="Summary")
df_restricted = df[labels]
f.write(df_restricted.to_lat... | true | true |
f70910191fa2fdbdb515d1ee6223d72a37845ca7 | 1,398 | py | Python | tests/components_to_test/repeated_computed_layer.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 1,630 | 2021-10-30T01:00:27.000Z | 2022-03-31T23:02:41.000Z | tests/components_to_test/repeated_computed_layer.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 166 | 2021-10-30T01:03:01.000Z | 2022-03-31T14:19:07.000Z | tests/components_to_test/repeated_computed_layer.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 253 | 2021-10-30T06:10:29.000Z | 2022-03-31T13:30:06.000Z | #!/usr/bin/env python
import torch
import torch.nn as nn
from colossalai.nn import CheckpointModule
from .utils.dummy_data_generator import DummyDataGenerator
from .registry import non_distributed_component_funcs
class NetWithRepeatedlyComputedLayers(CheckpointModule):
"""
This model is to test with layers w... | 29.125 | 83 | 0.703147 |
import torch
import torch.nn as nn
from colossalai.nn import CheckpointModule
from .utils.dummy_data_generator import DummyDataGenerator
from .registry import non_distributed_component_funcs
class NetWithRepeatedlyComputedLayers(CheckpointModule):
def __init__(self, checkpoint=False) -> None:
super().__... | true | true |
f709111442b99e0d8ef6aa437399990e73061ef7 | 3,524 | py | Python | stable_nalu/layer/hard_softmax_nac.py | wlm2019/Neural-Arithmetic-Units | f9de9d004bb2dc2ee28577cd1760d0a00c185836 | [
"MIT"
] | 147 | 2019-10-07T11:01:54.000Z | 2021-11-16T02:51:18.000Z | stable_nalu/layer/hard_softmax_nac.py | wlm2019/Neural-Arithmetic-Units | f9de9d004bb2dc2ee28577cd1760d0a00c185836 | [
"MIT"
] | 1 | 2019-12-03T12:40:21.000Z | 2019-12-03T12:40:21.000Z | stable_nalu/layer/hard_softmax_nac.py | wlm2019/Neural-Arithmetic-Units | f9de9d004bb2dc2ee28577cd1760d0a00c185836 | [
"MIT"
] | 19 | 2019-12-21T15:58:44.000Z | 2021-09-03T08:32:38.000Z |
import math
import torch
from ..abstract import ExtendedTorchModule
from ..functional import sparsity_error
from ._abstract_recurrent_cell import AbstractRecurrentCell
class HardSoftmaxNACLayer(ExtendedTorchModule):
"""Implements the NAC (Neural Accumulator)
Arguments:
in_features: number of ingoing... | 40.976744 | 93 | 0.65437 |
import math
import torch
from ..abstract import ExtendedTorchModule
from ..functional import sparsity_error
from ._abstract_recurrent_cell import AbstractRecurrentCell
class HardSoftmaxNACLayer(ExtendedTorchModule):
def __init__(self, in_features, out_features, **kwargs):
super().__init__('nac', **kwarg... | true | true |
f7091180d1e1b7bbe848c16021d65d8ff26b81ff | 4,862 | py | Python | venv/lib/python3.8/site-packages/vsts/task_agent/v4_1/models/task_agent.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/task_agent/v4_1/models/task_agent.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/task_agent/v4_1/models/task_agent.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 58.578313 | 341 | 0.651172 |
from .task_agent_reference import TaskAgentReference
class TaskAgent(TaskAgentReference):
_attribute_map = {
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
'enabled': {'key': 'enabled', 'type': 'bool'},
'id': {'key': 'id', 'type': 'int'},
'name': {'key': 'name',... | true | true |
f70911869b080ad9966af907970ad157263cbb09 | 154,166 | py | Python | src/azure-cli/azure/cli/command_modules/resource/custom.py | wanlwanl/azure-cli | 3d89040f4f6e64784f66ed3ea9290530bd5c57b6 | [
"MIT"
] | 1 | 2020-08-10T23:50:16.000Z | 2020-08-10T23:50:16.000Z | src/azure-cli/azure/cli/command_modules/resource/custom.py | wanlwanl/azure-cli | 3d89040f4f6e64784f66ed3ea9290530bd5c57b6 | [
"MIT"
] | 2 | 2020-09-12T04:31:23.000Z | 2020-09-14T06:31:04.000Z | src/azure-cli/azure/cli/command_modules/resource/custom.py | hackathon-cli-recommendation/azure-cli | b9df3c9cfd400627912e5751bb6dcd429670b2c7 | [
"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.
# --------------------------------------------------------------------... | 50.184245 | 191 | 0.663564 |
from __future__ import print_function
from collections import OrderedDict
import codecs
import json
import os
import platform
import re
import ssl
import sys
import uuid
import base64
from six.moves.urllib.request import urlopen from six.moves.urllib.parse import urlparse
from msrestazure.tools import is_valid_re... | true | true |
f709121ec8d4532010013541f330e6a67735c286 | 251 | py | Python | nginx_router/backend/synth_app/views.py | BennettDixon/book_query_app | b1afd6967c432520540c0427948808ff7b5d8556 | [
"MIT"
] | 2 | 2019-08-22T00:49:16.000Z | 2022-01-21T21:27:53.000Z | nginx_router/backend/synth_app/views.py | BennettDixon/book_query_app | b1afd6967c432520540c0427948808ff7b5d8556 | [
"MIT"
] | 7 | 2020-09-06T23:47:51.000Z | 2022-02-26T16:47:58.000Z | nginx_router/backend/synth_app/views.py | BennettDixon/book_query_app | b1afd6967c432520540c0427948808ff7b5d8556 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
def index(request):
return HttpResponse('{"response": "Synth is running!"}')
def test(request):
return HttpResponse('ANOTHER RESPONSE YO')
| 19.307692 | 60 | 0.741036 | from django.http import HttpResponse
from django.shortcuts import render
def index(request):
return HttpResponse('{"response": "Synth is running!"}')
def test(request):
return HttpResponse('ANOTHER RESPONSE YO')
| true | true |
f7091272a083f663a8bf3500eec9312864fe379c | 9,761 | py | Python | pypy/module/_cffi_backend/test/test_re_python.py | ruby-compiler-survey/pypy | c76ed8d0979e13497786cf99eb427ef8f94ea816 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-07-19T17:42:42.000Z | 2021-07-19T17:42:42.000Z | pypy/module/_cffi_backend/test/test_re_python.py | CAS-Atlantic/pypy | 0988788dd911ff0d5b1cfcf0657412810168d37e | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/_cffi_backend/test/test_re_python.py | CAS-Atlantic/pypy | 0988788dd911ff0d5b1cfcf0657412810168d37e | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import py
import sys, shutil, os
from rpython.tool.udir import udir
from pypy.interpreter.gateway import interp2app
from pypy.module._cffi_backend.newtype import _clean_cache
if sys.platform == 'win32':
WIN32 = True
else:
WIN32 = False
class AppTestRecompilerPython:
spaceconfig = dict(usemodules=['_cffi_b... | 35.624088 | 87 | 0.595431 | import py
import sys, shutil, os
from rpython.tool.udir import udir
from pypy.interpreter.gateway import interp2app
from pypy.module._cffi_backend.newtype import _clean_cache
if sys.platform == 'win32':
WIN32 = True
else:
WIN32 = False
class AppTestRecompilerPython:
spaceconfig = dict(usemodules=['_cffi_b... | true | true |
f70913690bbeee6a5cd7e42289093722d0f892d5 | 3,080 | py | Python | app/app/settings.py | gonzales-juan/recipe-app-api | 6cf46737cd3b63e845ad3e5ade3c6e91ab156542 | [
"MIT"
] | null | null | null | app/app/settings.py | gonzales-juan/recipe-app-api | 6cf46737cd3b63e845ad3e5ade3c6e91ab156542 | [
"MIT"
] | null | null | null | app/app/settings.py | gonzales-juan/recipe-app-api | 6cf46737cd3b63e845ad3e5ade3c6e91ab156542 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
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 os
# Bu... | 25.454545 | 91 | 0.694156 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'h26q@cw!pa#7*jjx$sda&0*c0&u&alf4^a)hwoh4j+6)j5y*&_'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
f70913d332a19eeea3c8a155688731e9ab4da5b0 | 1,468 | py | Python | tests/test_models/test_engine/test_file_storage.py | arvicrin/AirBnB_clone | b851c48fabb85e942f57f9afdeca043e104bb6d1 | [
"MIT"
] | null | null | null | tests/test_models/test_engine/test_file_storage.py | arvicrin/AirBnB_clone | b851c48fabb85e942f57f9afdeca043e104bb6d1 | [
"MIT"
] | null | null | null | tests/test_models/test_engine/test_file_storage.py | arvicrin/AirBnB_clone | b851c48fabb85e942f57f9afdeca043e104bb6d1 | [
"MIT"
] | 1 | 2020-02-27T18:42:46.000Z | 2020-02-27T18:42:46.000Z | #!/usr/bin/python3
"""
Defines a class TestFileStorage.
"""
from models.engine.file_storage import FileStorage
import unittest
import models
import os
class TestFileStorage(unittest.TestCase):
"""Represent a TestFileStorage."""
def setUp(self):
"""SetUp method"""
self.file_storage = F... | 27.698113 | 78 | 0.658719 |
from models.engine.file_storage import FileStorage
import unittest
import models
import os
class TestFileStorage(unittest.TestCase):
def setUp(self):
self.file_storage = FileStorage()
def TearDown(self):
del self.file_storage
def test_docstring(self):
self.assertIsNotNone(... | true | true |
f7091472584e11aa0109b97212c5ff1f162ae32a | 15,488 | py | Python | Nested_Adversarial_Networks/NAN_rework/modeleag.py | ZhaoJ9014/Multi-Human-Parsing-MHP- | a24eae67e9b4e730c75bcd8aec3e2ed06cb4b046 | [
"MIT"
] | 481 | 2019-01-28T07:37:42.000Z | 2022-03-30T02:23:56.000Z | Nested_Adversarial_Networks/NAN_rework/modeleag.py | ZhaoJ9014/Multi-Human-Parsing-MHP- | a24eae67e9b4e730c75bcd8aec3e2ed06cb4b046 | [
"MIT"
] | 36 | 2019-02-06T15:14:27.000Z | 2022-02-08T18:04:17.000Z | Nested_Adversarial_Networks/NAN_rework/modeleag.py | ZhaoJ9014/Multi-Human-Parsing-MHP- | a24eae67e9b4e730c75bcd8aec3e2ed06cb4b046 | [
"MIT"
] | 70 | 2019-01-29T05:42:06.000Z | 2022-03-26T04:59:16.000Z | # Rework of model.py
# https://github.com/ddddwee1/sul
# This wrap-up is targeted for better touching low-level implementations
import layers2 as L
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth=True
tf.enable_eager_execution(config=config)
import numpy as np
import os
import ran... | 28.057971 | 169 | 0.688985 | import layers2 as L
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth=True
tf.enable_eager_execution(config=config)
import numpy as np
import os
import random
import time
PARAM_RELU = 0
PARAM_LRELU = 1
PARAM_ELU = 2
PARAM_TANH = 3
PARAM_MFM = 4
PARAM_MFM_FC = 5
PARAM_SIGMOID = 6
de... | true | true |
f70914ece766c06da0a91283d76e7f41f01c5ac6 | 7,440 | py | Python | tests/platform_tests/link_flap/test_cont_link_flap.py | Megathrone/sonic-mgmt | e319c0ad94c4773aa342e3777c67455d7e5b9bad | [
"Apache-2.0"
] | 1 | 2021-09-15T17:04:21.000Z | 2021-09-15T17:04:21.000Z | tests/platform_tests/link_flap/test_cont_link_flap.py | Megathrone/sonic-mgmt | e319c0ad94c4773aa342e3777c67455d7e5b9bad | [
"Apache-2.0"
] | 3 | 2021-10-06T19:48:49.000Z | 2021-11-18T17:11:19.000Z | tests/platform_tests/link_flap/test_cont_link_flap.py | Megathrone/sonic-mgmt | e319c0ad94c4773aa342e3777c67455d7e5b9bad | [
"Apache-2.0"
] | null | null | null | """
Tests the continuous link flap in SONiC.
Parameters:
--orch_cpu_threshold <port> (int): Which port you want the test to send traffic
to. Default is 3.
"""
import logging
import time
import pytest
from tests.common.helpers.assertions import pytest_assert, pytest_require
from tests.common import port_t... | 52.765957 | 169 | 0.638844 |
import logging
import time
import pytest
from tests.common.helpers.assertions import pytest_assert, pytest_require
from tests.common import port_toggle
from tests.platform_tests.link_flap.link_flap_utils import build_test_candidates, toggle_one_link, check_orch_cpu_utilization, check_bgp_routes, check_portchannel_sta... | true | true |
f70915190ac3245bfa14a9456d71f24c01cebe8c | 5,407 | py | Python | news_crawler/spiders/sputnik.py | andreeaiana/german-news | 39e879aca46dfb73b0a631de7c053daff451f63e | [
"MIT"
] | 1 | 2021-12-07T16:27:02.000Z | 2021-12-07T16:27:02.000Z | news_crawler/spiders/sputnik.py | andreeaiana/german-news | 39e879aca46dfb73b0a631de7c053daff451f63e | [
"MIT"
] | null | null | null | news_crawler/spiders/sputnik.py | andreeaiana/german-news | 39e879aca46dfb73b0a631de7c053daff451f63e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
from news_crawler.spiders import BaseSpider
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
from datetime import datetime
sys.path.insert(0, os.path.join(os.getcwd(), "..",))
from news_crawler.items import NewsCrawlerItem
from new... | 43.256 | 214 | 0.585352 |
import os
import sys
from news_crawler.spiders import BaseSpider
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
from datetime import datetime
sys.path.insert(0, os.path.join(os.getcwd(), "..",))
from news_crawler.items import NewsCrawlerItem
from news_crawler.utils import re... | true | true |
f709151bb9972f3f3a0ec505604bd40b159eeb29 | 435 | py | Python | z2.py | 12W300/Five | e5090153b207df71046df40d4054507d96d87207 | [
"MIT"
] | null | null | null | z2.py | 12W300/Five | e5090153b207df71046df40d4054507d96d87207 | [
"MIT"
] | null | null | null | z2.py | 12W300/Five | e5090153b207df71046df40d4054507d96d87207 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == "__main__":
def midlgeom(a):
if len(a) != 0:
res = 0
for i in range(len(a)):
res += 1/a[i]
return len(a) / res
else:
return None
raw = input('Введите последо... | 22.894737 | 63 | 0.485057 |
if __name__ == "__main__":
def midlgeom(a):
if len(a) != 0:
res = 0
for i in range(len(a)):
res += 1/a[i]
return len(a) / res
else:
return None
raw = input('Введите последовательность чисел через пробел: ')
mas = [int(i)... | true | true |
f7091608c502de23441376a9faa4ef4af8177aea | 1,816 | py | Python | kluctl/utils/yaml_utils.py | codablock/kluctl | a7069bf22bfe78c5529fe403c3b3c877f026d3c3 | [
"Apache-2.0"
] | 26 | 2021-08-18T11:18:46.000Z | 2022-03-16T09:28:43.000Z | kluctl/utils/yaml_utils.py | codablock/kluctl | a7069bf22bfe78c5529fe403c3b3c877f026d3c3 | [
"Apache-2.0"
] | 4 | 2021-09-07T09:55:29.000Z | 2022-03-03T09:05:01.000Z | kluctl/utils/yaml_utils.py | codablock/kluctl | a7069bf22bfe78c5529fe403c3b3c877f026d3c3 | [
"Apache-2.0"
] | 4 | 2021-09-04T11:52:33.000Z | 2022-03-16T09:18:20.000Z | import sys
import yaml
try:
from yaml import CSafeLoader as SafeLoader, CSafeDumper as SafeDumper
except ImportError:
print("Failed to load fast LibYAML bindings. You should install them to speed up kluctl.", file=sys.stderr)
from yaml import SafeLoader as SafeLoader, SafeDumper as SafeDumper
def constr... | 30.779661 | 111 | 0.696035 | import sys
import yaml
try:
from yaml import CSafeLoader as SafeLoader, CSafeDumper as SafeDumper
except ImportError:
print("Failed to load fast LibYAML bindings. You should install them to speed up kluctl.", file=sys.stderr)
from yaml import SafeLoader as SafeLoader, SafeDumper as SafeDumper
def constr... | true | true |
f709168738885702dd8ab877116a8ff2a483280b | 3,456 | py | Python | examples/tutorials/plot.py | carocamargo/pygmt | 6139c1735cff7f7d615d243145c21b1efef3f2c6 | [
"BSD-3-Clause"
] | null | null | null | examples/tutorials/plot.py | carocamargo/pygmt | 6139c1735cff7f7d615d243145c21b1efef3f2c6 | [
"BSD-3-Clause"
] | null | null | null | examples/tutorials/plot.py | carocamargo/pygmt | 6139c1735cff7f7d615d243145c21b1efef3f2c6 | [
"BSD-3-Clause"
] | null | null | null | """
Plotting data points
--------------------
GMT shines when it comes to plotting data on a map. We can use some sample data that is
packaged with GMT to try this out. PyGMT provides access to these datasets through the
:mod:`pygmt.datasets` package. If you don't have the data files already, they are
automatically do... | 36.765957 | 88 | 0.634838 |
import pygmt
# Japan (:func:`pygmt.datasets.load_japan_quakes`). The data is loaded as a
# :class:`pandas.DataFrame`.
data = pygmt.datasets.load_japan_quakes()
# Set the region for the plot to be slightly larger than the data bounds.
region = [
data.longitude.min() - 1,
data.longitude.max() + 1,
data.l... | true | true |
f7091944434db8d19ca5662d7bf98cc15182bb16 | 13,500 | py | Python | python/infra/DisplayCoverage.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-04-05T12:11:54.000Z | 2020-04-05T12:11:54.000Z | python/infra/DisplayCoverage.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | python/infra/DisplayCoverage.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-04-05T14:26:13.000Z | 2021-03-09T08:18:17.000Z | #!/usr/bin/env python
"""Copyright (c) 2005-2019, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in ... | 45.918367 | 143 | 0.616593 |
"""Copyright (c) 2005-2019, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary form... | false | true |
f70919c541c332631ac6a45b18d36f9f9c301bf5 | 4,662 | py | Python | epidose/back_end/ha_server.py | osnas/epidose | 061d4aff6386d571b1940d2f18359eef99dc2ea5 | [
"Apache-2.0"
] | 40 | 2020-05-08T17:22:15.000Z | 2020-06-18T13:21:25.000Z | epidose/back_end/ha_server.py | osnas/epidose | 061d4aff6386d571b1940d2f18359eef99dc2ea5 | [
"Apache-2.0"
] | 50 | 2020-06-27T08:34:13.000Z | 2021-04-20T10:18:25.000Z | epidose/back_end/ha_server.py | dspinellis/reference_implementation | 416cc0305141746d9fe39e3e8698cb152bb3124f | [
"Apache-2.0"
] | 10 | 2020-07-05T19:55:24.000Z | 2021-02-04T14:55:46.000Z | #!/usr/bin/env python3
""" Health authority back end REST and static content server """
__copyright__ = """
Copyright 2020 Diomidis Spinellis
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 L... | 27.104651 | 88 | 0.669884 |
__copyright__ = """
Copyright 2020 Diomidis Spinellis
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 ap... | true | true |
f7091a63c75da3469e8ce32bc0cd159841c0a7fd | 16,728 | py | Python | data/utils.py | cuis15/xorder | 6dde5a18552ffa07f29100038464a38c49495527 | [
"MIT"
] | null | null | null | data/utils.py | cuis15/xorder | 6dde5a18552ffa07f29100038464a38c49495527 | [
"MIT"
] | null | null | null | data/utils.py | cuis15/xorder | 6dde5a18552ffa07f29100038464a38c49495527 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.metrics import roc_auc_score
from numba import jit
def array2str(tmp_array, sep = " "):
str_list = ["{:.3f}".format(tmp_item) for tmp_item in tmp_array]
return sep.join(str_list)
def generate_sorted_groups(pred, y, a):
a_idx = np.where(a == 0)
b_idx = np.where(a == 1)... | 32.735812 | 151 | 0.519727 | import numpy as np
from sklearn.metrics import roc_auc_score
from numba import jit
def array2str(tmp_array, sep = " "):
str_list = ["{:.3f}".format(tmp_item) for tmp_item in tmp_array]
return sep.join(str_list)
def generate_sorted_groups(pred, y, a):
a_idx = np.where(a == 0)
b_idx = np.where(a == 1)... | true | true |
f7091b492b1c1ff7f7cbbe859004f6d63c441970 | 1,459 | py | Python | test/test_info_contact.py | spirit-87/python_training | f2e2389ba4e96139d666365abecf16a2db89cd6e | [
"Apache-2.0"
] | null | null | null | test/test_info_contact.py | spirit-87/python_training | f2e2389ba4e96139d666365abecf16a2db89cd6e | [
"Apache-2.0"
] | null | null | null | test/test_info_contact.py | spirit-87/python_training | f2e2389ba4e96139d666365abecf16a2db89cd6e | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
from random import randrange
def test_contacts_on_homepage(app, db):
contacts_from_homepage = sorted(app.contact.get_contact_list(), key = Contact.id_or_max)
contacts_from_db = sorted(db.get_contact_list(), key = Contact.id_or_max)
assert len(contacts_from_homepage) == l... | 56.115385 | 115 | 0.800548 | from model.contact import Contact
from random import randrange
def test_contacts_on_homepage(app, db):
contacts_from_homepage = sorted(app.contact.get_contact_list(), key = Contact.id_or_max)
contacts_from_db = sorted(db.get_contact_list(), key = Contact.id_or_max)
assert len(contacts_from_homepage) == l... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.