max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
rses/__init__.py | iScrE4m/RSES | 1 | 5400 | # coding=utf-8
"""RSES :)"""
| # coding=utf-8
"""RSES :)"""
| en | 0.843858 | # coding=utf-8 RSES :) | 1.117321 | 1 |
sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py | adewaleo/azure-sdk-for-python | 2 | 5401 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | en | 0.434922 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ... | 1.701875 | 2 |
homeassistant/components/tasmota/discovery.py | yura505/core | 0 | 5402 | """Support for MQTT discovery."""
import asyncio
import logging
from hatasmota.discovery import (
TasmotaDiscovery,
get_device_config as tasmota_get_device_config,
get_entities_for_platform as tasmota_get_entities_for_platform,
get_entity as tasmota_get_entity,
has_entities_with_platform as tasmota... | """Support for MQTT discovery."""
import asyncio
import logging
from hatasmota.discovery import (
TasmotaDiscovery,
get_device_config as tasmota_get_device_config,
get_entities_for_platform as tasmota_get_entities_for_platform,
get_entity as tasmota_get_entity,
has_entities_with_platform as tasmota... | en | 0.78353 | Support for MQTT discovery. Clear entry in ALREADY_DISCOVERED list. Set entry in ALREADY_DISCOVERED list. Start MQTT Discovery. Load a Tasmota platform if not already done. Handle adding or updating a discovered entity. # Entity disabled, clean up entity registry Process the received message. | 2.092224 | 2 |
tfx/components/infra_validator/executor.py | TimoKerr/tfx | 1 | 5403 | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | en | 0.828105 | # Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a... | 1.25896 | 1 |
learning_python/org/allnix/util.py | ykyang/org.allnix.python | 0 | 5404 | def write(message: str):
print("org.allnix", message)
def read() -> str:
"""Returns a string"""
return "org.allnix"
| def write(message: str):
print("org.allnix", message)
def read() -> str:
"""Returns a string"""
return "org.allnix"
| fa | 0.058127 | Returns a string | 2.805273 | 3 |
metr-la/model/Double_C_STTN.py | happys2333/DL-2021-fall | 1 | 5405 | <filename>metr-la/model/Double_C_STTN.py<gh_stars>1-10
# from folder workMETRLA
# MODEL CODE
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 10:28:06 2020
@author: wb
"""
import torch
import torch.nn as nn
import math
# from GCN_models import GCN
# from One_hot_encoder import One_hot_encoder
impor... | <filename>metr-la/model/Double_C_STTN.py<gh_stars>1-10
# from folder workMETRLA
# MODEL CODE
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 10:28:06 2020
@author: wb
"""
import torch
import torch.nn as nn
import math
# from GCN_models import GCN
# from One_hot_encoder import One_hot_encoder
impor... | en | 0.416407 | # from folder workMETRLA # MODEL CODE # -*- coding: utf-8 -*- Created on Mon Sep 28 10:28:06 2020
@author: wb # from GCN_models import GCN # from One_hot_encoder import One_hot_encoder # 线性层改变one hot编码维度 # onehot = onehot.repeat(N, 1, 1) Attention 基础代码
ScaledDotProductAttention 是通用的
解释dk:
数据进来的时候是B,N,T,C,做at... | 2.122863 | 2 |
tetrisanim3.py | daniel-chuang/tetris | 0 | 5406 | <reponame>daniel-chuang/tetris
# animation for medium article
from termcolor import colored
import time
import imageio
import pyautogui
pyautogui.FAILSAFE = True
matrix = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, ... | # animation for medium article
from termcolor import colored
import time
import imageio
import pyautogui
pyautogui.FAILSAFE = True
matrix = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0... | en | 0.810182 | # animation for medium article # takes a screenshot | 2.91891 | 3 |
inventories/models.py | destodasoftware/kately_api | 0 | 5407 | from django.db import models
from products.models import Product
from utils.models import Utility
class Inventory(Utility):
inventory_number = models.CharField(unique=True, max_length=100, blank=True, null=True)
supplier = models.CharField(max_length=100, blank=True, null=True)
user = models.ForeignKey('... | from django.db import models
from products.models import Product
from utils.models import Utility
class Inventory(Utility):
inventory_number = models.CharField(unique=True, max_length=100, blank=True, null=True)
supplier = models.CharField(max_length=100, blank=True, null=True)
user = models.ForeignKey('... | none | 1 | 2.269321 | 2 | |
hierarchical_app/views.py | stephken/Hierarchical_assessment | 0 | 5408 | from django.shortcuts import render
from hierarchical_app.models import Folder
# Create your views here.
def index_view(request):
return render(request, 'index.html', {'welcome': "Welcome to Kens Hierarchical Data and You assessment", 'folders': Folder.objects.all()})
| from django.shortcuts import render
from hierarchical_app.models import Folder
# Create your views here.
def index_view(request):
return render(request, 'index.html', {'welcome': "Welcome to Kens Hierarchical Data and You assessment", 'folders': Folder.objects.all()})
| en | 0.968116 | # Create your views here. | 1.859562 | 2 |
bin/train_vit.py | ramizdundar/Chexpert | 0 | 5409 | import sys
import os
import argparse
import logging
import json
import time
import subprocess
from shutil import copyfile
import numpy as np
from sklearn import metrics
from easydict import EasyDict as edict
import torch
from torch.utils.data import DataLoader
import torch.nn.functional as F
from torch.nn import DataP... | import sys
import os
import argparse
import logging
import json
import time
import subprocess
from shutil import copyfile
import numpy as np
from sklearn import metrics
from easydict import EasyDict as edict
import torch
from torch.utils.data import DataLoader
import torch.nn.functional as F
from torch.nn import DataP... | en | 0.52701 | # noqa # noqa # noqa # noqa # output, logit_map = model(image) # different number of tasks # different number of tasks # AUC # model = Classifier(cfg) | 1.923953 | 2 |
Sets/the capaint s room.py | AndreasGeiger/hackerrank-python | 0 | 5410 | groupSize = input()
groups = list(map(int,input().split(' ')))
tmpArray1 = set()
tmpArray2 = set()
for i in groups:
if i in tmpArray1:
tmpArray2.discard(i)
else:
tmpArray1.add(i)
tmpArray2.add(i)
for i in tmpArray2:
print(i)
| groupSize = input()
groups = list(map(int,input().split(' ')))
tmpArray1 = set()
tmpArray2 = set()
for i in groups:
if i in tmpArray1:
tmpArray2.discard(i)
else:
tmpArray1.add(i)
tmpArray2.add(i)
for i in tmpArray2:
print(i)
| none | 1 | 3.246157 | 3 | |
tests/testsoma.py | gtmadureira/Python | 4 | 5411 | import unittest
from hf_src.main import soma
class TestSoma(unittest.TestCase):
def test_retorno_soma_15_30(self):
self.assertEqual(soma(15, 30), 45)
| import unittest
from hf_src.main import soma
class TestSoma(unittest.TestCase):
def test_retorno_soma_15_30(self):
self.assertEqual(soma(15, 30), 45)
| none | 1 | 2.365788 | 2 | |
src/oictest/setup.py | rohe/oictest | 32 | 5412 | import copy
import json
from oic.utils.authn.client import CLIENT_AUTHN_METHOD
from oic.utils.keyio import KeyJar
from oic.utils.keyio import KeyBundle
__author__ = 'roland'
import logging
logger = logging.getLogger(__name__)
class OIDCError(Exception):
pass
def flow2sequence(operations, item):
flow = o... | import copy
import json
from oic.utils.authn.client import CLIENT_AUTHN_METHOD
from oic.utils.keyio import KeyJar
from oic.utils.keyio import KeyBundle
__author__ = 'roland'
import logging
logger = logging.getLogger(__name__)
class OIDCError(Exception):
pass
def flow2sequence(operations, item):
flow = o... | en | 0.630487 | :param config: Imported configuration module :return: Instantiate a _client instance :param: Keyword arguments Keys are ["srv_discovery_url", "client_info", "client_registration", "provider_info". "keys] :return: _client instance # The behaviour parameter is not signific... | 2.226102 | 2 |
HLTrigger/Configuration/python/HLT_75e33/modules/hltPFPuppiNoLep_cfi.py | PKUfudawei/cmssw | 1 | 5413 | <gh_stars>1-10
import FWCore.ParameterSet.Config as cms
hltPFPuppiNoLep = cms.EDProducer("PuppiProducer",
DeltaZCut = cms.double(0.1),
DeltaZCutForChargedFromPUVtxs = cms.double(0.2),
EtaMaxCharged = cms.double(99999.0),
EtaMaxPhotons = cms.double(2.5),
EtaMinUseDeltaZ = cms.double(-1.0),
MinPu... | import FWCore.ParameterSet.Config as cms
hltPFPuppiNoLep = cms.EDProducer("PuppiProducer",
DeltaZCut = cms.double(0.1),
DeltaZCutForChargedFromPUVtxs = cms.double(0.2),
EtaMaxCharged = cms.double(99999.0),
EtaMaxPhotons = cms.double(2.5),
EtaMinUseDeltaZ = cms.double(-1.0),
MinPuppiWeight = cms... | none | 1 | 1.005846 | 1 | |
wizbin/build.py | RogueScholar/debreate | 97 | 5414 | # -*- coding: utf-8 -*-
## \package wizbin.build
# MIT licensing
# See: docs/LICENSE.txt
import commands, os, shutil, subprocess, traceback, wx
from dbr.functions import FileUnstripped
from dbr.language import GT
from dbr.log import DebugEnabled
from dbr.log import Logger
from dbr.md5 import WriteMD5
from ... | # -*- coding: utf-8 -*-
## \package wizbin.build
# MIT licensing
# See: docs/LICENSE.txt
import commands, os, shutil, subprocess, traceback, wx
from dbr.functions import FileUnstripped
from dbr.language import GT
from dbr.log import DebugEnabled
from dbr.log import Logger
from dbr.md5 import WriteMD5
from ... | en | 0.716669 | # -*- coding: utf-8 -*- ## \package wizbin.build # MIT licensing # See: docs/LICENSE.txt ## Build page ## Constructor # # \param parent # Parent <b><i>wx.Window</i></b> instance # ----- Extra Options # The » character denotes that an alternate tooltip should be shown if the control is disabled # Option to strip binari... | 1.504754 | 2 |
__main__.py | maelstromdat/YOSHI | 6 | 5415 | from YoshiViz import Gui
if __name__ == '__main__':
#file director
gui = Gui.Gui()
"""
report_generator.\
generate_pdf_report(fileDirectory, repositoryName, tempCommunityType)
"""
print('the type of', repositoryName, 'is', tempCommunityType, '\n"check .\YoshiViz\output"')
| from YoshiViz import Gui
if __name__ == '__main__':
#file director
gui = Gui.Gui()
"""
report_generator.\
generate_pdf_report(fileDirectory, repositoryName, tempCommunityType)
"""
print('the type of', repositoryName, 'is', tempCommunityType, '\n"check .\YoshiViz\output"')
| en | 0.355691 | #file director report_generator.\ generate_pdf_report(fileDirectory, repositoryName, tempCommunityType) | 1.833065 | 2 |
hpotter/src/lazy_init.py | LarsenClose/dr.hpotter | 1 | 5416 | ''' Wrap an __init__ function so that I don't have to assign all the
parameters to a self. variable. '''
# https://stackoverflow.com/questions/5048329/python-decorator-for-automatic-binding-init-arguments
import inspect
from functools import wraps
def lazy_init(init):
''' Create an annotation to assign all the p... | ''' Wrap an __init__ function so that I don't have to assign all the
parameters to a self. variable. '''
# https://stackoverflow.com/questions/5048329/python-decorator-for-automatic-binding-init-arguments
import inspect
from functools import wraps
def lazy_init(init):
''' Create an annotation to assign all the p... | en | 0.61791 | Wrap an __init__ function so that I don't have to assign all the parameters to a self. variable. # https://stackoverflow.com/questions/5048329/python-decorator-for-automatic-binding-init-arguments Create an annotation to assign all the parameters to a self. variable. # pylint: disable=E1101 | 3.354123 | 3 |
main.py | technojam/MLian | 1 | 5417 | # def register_feed():
import os
import cv2
path = '/UserImage'
cam = cv2.VideoCapture(0)
name=input("Name: ")
cv2.namedWindow("test")
img_counter = 0
while True:
ret, frame = cam.read()
if not ret:
print("failed to grab frame")
break
else:
cv2.imshow("test", frame)
k = c... | # def register_feed():
import os
import cv2
path = '/UserImage'
cam = cv2.VideoCapture(0)
name=input("Name: ")
cv2.namedWindow("test")
img_counter = 0
while True:
ret, frame = cam.read()
if not ret:
print("failed to grab frame")
break
else:
cv2.imshow("test", frame)
k = c... | en | 0.404915 | # def register_feed(): # ESC pressed # SPACE pressed # img_name = "opencv_frame_{}.png".format(img_counter) # print("{} written!".format(img_name)) | 3.037725 | 3 |
models/train.py | Hiwyl/keras_cnn_finetune | 1 | 5418 | # -*- encoding: utf-8 -*-
'''
@Author : lance
@Email : <EMAIL>
'''
import time
from model_cx.inceptionresnet import inceptionresnet
from model_cx.vgg19two import vgg19_all_lr
from model_cx.inceptionv3 import inceptionv3
from model_cx.densenet import densenet
from model_cx.nasnet import nasnet
from ... | # -*- encoding: utf-8 -*-
'''
@Author : lance
@Email : <EMAIL>
'''
import time
from model_cx.inceptionresnet import inceptionresnet
from model_cx.vgg19two import vgg19_all_lr
from model_cx.inceptionv3 import inceptionv3
from model_cx.densenet import densenet
from model_cx.nasnet import nasnet
from ... | en | 0.673904 | # -*- encoding: utf-8 -*- @Author : lance
@Email : <EMAIL> # # try: # print("densenet") # densenet(classes, epochs, steps_per_epoch, validation_steps, shape) # except Exception as e: # print(e) # try: # print("bcnn") # bilinearnet(classes, epochs, steps_per_epoch, validation_steps, shape) ... | 2.180175 | 2 |
src/probnum/randprocs/markov/integrator/_preconditioner.py | alpiges/probnum | 0 | 5419 | """Coordinate changes in state space models."""
import abc
try:
# cached_property is only available in Python >=3.8
from functools import cached_property
except ImportError:
from cached_property import cached_property
import numpy as np
import scipy.special # for vectorised factorial
from probnum impor... | """Coordinate changes in state space models."""
import abc
try:
# cached_property is only available in Python >=3.8
from functools import cached_property
except ImportError:
from cached_property import cached_property
import numpy as np
import scipy.special # for vectorised factorial
from probnum impor... | en | 0.850613 | Coordinate changes in state space models. # cached_property is only available in Python >=3.8 # for vectorised factorial # public (because it is needed in some integrator implementations), # but not exposed to the 'randprocs' namespace # (i.e. not imported in any __init__.py). # There is no way of checking whether `rv`... | 2.111959 | 2 |
allauth/socialaccount/providers/linkedin/provider.py | mina-gaid/scp | 1 | 5420 | <filename>allauth/socialaccount/providers/linkedin/provider.py
from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth.provider import OAuthProvider
from allauth.socialaccount import app_settings
class LinkedInAccount(Pro... | <filename>allauth/socialaccount/providers/linkedin/provider.py
from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth.provider import OAuthProvider
from allauth.socialaccount import app_settings
class LinkedInAccount(Pro... | en | 0.837888 | # try to return the higher res picture-urls::(original) first # if we can't get higher res for any reason, we'll just return the # low res # picture-urls::(original) is higher res | 2.483574 | 2 |
game2048/myNew.py | CCTQL/2048-api | 0 | 5421 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets
from torch.autograd import Variable
from sklearn.model_selection import train_test_split
import time
import pandas as pd
import numpy as np
import csv
batch_size = 128
NUM_EPOC... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets
from torch.autograd import Variable
from sklearn.model_selection import train_test_split
import time
import pandas as pd
import numpy as np
import csv
batch_size = 128
NUM_EPOC... | en | 0.142986 | # 继承RNN #------------------读入数据----------------------------- # X = np.log2(X) # 转置后拼接 #------------------------------------------------------- # test_dataset = torch.utils.data.TensorDataset(X_test,Y_test) # test_loader = torch.utils.data.DataLoader(dataset=test_dataset, # batch_size=batch_size, #... | 2.691888 | 3 |
HW2/dbsys-hw2/Database.py | yliu120/dbsystem | 0 | 5422 | import json, io, os, os.path
from Catalog.Schema import DBSchema, DBSchemaEncoder, DBSchemaDecoder
from Query.Plan import PlanBuilder
from Storage.StorageEngine import StorageEngine
class Database:
"""
A top-level database engine class.
For now, this primarily maintains a simple catalog,
... | import json, io, os, os.path
from Catalog.Schema import DBSchema, DBSchemaEncoder, DBSchemaDecoder
from Query.Plan import PlanBuilder
from Storage.StorageEngine import StorageEngine
class Database:
"""
A top-level database engine class.
For now, this primarily maintains a simple catalog,
... | en | 0.782709 | A top-level database engine class. For now, this primarily maintains a simple catalog, mapping relation names to schema objects. Also, it provides the ability to construct query plan objects, as well as wrapping the storage layer methods. # Database internal components # User API # Catalog methods # DDL sta... | 2.564631 | 3 |
tests/test_arr_add_value.py | dboyliao/TaipeiPy-pybind11-buffer-array | 1 | 5423 | <reponame>dboyliao/TaipeiPy-pybind11-buffer-array
import numpy as np
import mylib
def test_arr_add_value():
for _ in range(10):
shape = np.random.randint(1, 10, size=np.random.randint(3, 10)).tolist()
in_arr = np.random.rand(*shape).astype(np.double)
ok = np.allclose(mylib.array_add_value... | import numpy as np
import mylib
def test_arr_add_value():
for _ in range(10):
shape = np.random.randint(1, 10, size=np.random.randint(3, 10)).tolist()
in_arr = np.random.rand(*shape).astype(np.double)
ok = np.allclose(mylib.array_add_value(in_arr, np.pi), in_arr + np.pi)
if not ok... | none | 1 | 2.745089 | 3 | |
moderngl_window/resources/data.py | DavideRuzza/moderngl-window | 142 | 5424 | <reponame>DavideRuzza/moderngl-window
"""
Registry general data files
"""
from typing import Any
from moderngl_window.resources.base import BaseRegistry
from moderngl_window.meta import DataDescription
class DataFiles(BaseRegistry):
"""Registry for requested data files"""
settings_attr = "DATA_LOADERS"
... | """
Registry general data files
"""
from typing import Any
from moderngl_window.resources.base import BaseRegistry
from moderngl_window.meta import DataDescription
class DataFiles(BaseRegistry):
"""Registry for requested data files"""
settings_attr = "DATA_LOADERS"
def load(self, meta: DataDescription) ... | en | 0.453567 | Registry general data files Registry for requested data files Load data file with the configured loaders. Args: meta (:py:class:`~moderngl_window.meta.data.DataDescription`): the resource description Returns: Any: The loaded resource | 1.978983 | 2 |
tests/test_units/test_mapper_str.py | frewsxcv/routes | 1 | 5425 | import unittest
from routes import Mapper
class TestMapperStr(unittest.TestCase):
def test_str(self):
m = Mapper()
m.connect('/{controller}/{action}')
m.connect('entries', '/entries', controller='entry', action='index')
m.connect('entry', '/entries/{id}', controller='entry',... | import unittest
from routes import Mapper
class TestMapperStr(unittest.TestCase):
def test_str(self):
m = Mapper()
m.connect('/{controller}/{action}')
m.connect('entries', '/entries', controller='entry', action='index')
m.connect('entry', '/entries/{id}', controller='entry',... | en | 0.553844 | \
Route name Methods Path
/{controller}/{action}
entries /entries
entry /entries/{id} | 3.377294 | 3 |
quarkchain/tools/config_slave.py | HAOYUatHZ/pyquarkchain | 1 | 5426 | <gh_stars>1-10
"""
python config_slave.py 127.0.0.1 38000 38006 127.0.0.2 18999 18002
will generate 4 slave server configs accordingly. will be used in deployment automation to configure a cluster.
usage: python config_slave.py <host1> <port1> <port2> <host2> <port3> ...
"""
import argparse
import collections
impo... | """
python config_slave.py 127.0.0.1 38000 38006 127.0.0.2 18999 18002
will generate 4 slave server configs accordingly. will be used in deployment automation to configure a cluster.
usage: python config_slave.py <host1> <port1> <port2> <host2> <port3> ...
"""
import argparse
import collections
import json
import ... | en | 0.566772 | python config_slave.py 127.0.0.1 38000 38006 127.0.0.2 18999 18002 will generate 4 slave server configs accordingly. will be used in deployment automation to configure a cluster. usage: python config_slave.py <host1> <port1> <port2> <host2> <port3> ... ############### # parse hosts and ports to form a slave list #####... | 2.712562 | 3 |
python-function-files-dictionaries/week4-assignment1.py | MauMendes/python3-programming-specialization | 0 | 5427 | <filename>python-function-files-dictionaries/week4-assignment1.py
#1) Write a function, sublist, that takes in a list of numbers as the parameter. In the function, use a while loop to return a sublist of the input list.
# The sublist should contain the same values of the original list up until it reaches the number 5 ... | <filename>python-function-files-dictionaries/week4-assignment1.py
#1) Write a function, sublist, that takes in a list of numbers as the parameter. In the function, use a while loop to return a sublist of the input list.
# The sublist should contain the same values of the original list up until it reaches the number 5 ... | en | 0.875714 | #1) Write a function, sublist, that takes in a list of numbers as the parameter. In the function, use a while loop to return a sublist of the input list. # The sublist should contain the same values of the original list up until it reaches the number 5 (it should not contain the number 5). #2) Write a function called c... | 4.226132 | 4 |
saas/backend/apps/group/views.py | Canway-shiisa/bk-iam-saas | 0 | 5428 | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | zh | 0.530023 | # -*- coding: utf-8 -*- TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Li... | 1.349403 | 1 |
towers.py | fillest/7drl2013 | 1 | 5429 | <filename>towers.py<gh_stars>1-10
import util
import libtcodpy as tcod
import enemies
import operator
class Missile (util.Entity):
sym = '*'
color = tcod.white
class BasicMissile (Missile):
color = tcod.yellow
class IceMissile (Missile):
color = tcod.light_blue
class AoeMissile (Missile):
color = tcod.red
c... | <filename>towers.py<gh_stars>1-10
import util
import libtcodpy as tcod
import enemies
import operator
class Missile (util.Entity):
sym = '*'
color = tcod.white
class BasicMissile (Missile):
color = tcod.yellow
class IceMissile (Missile):
color = tcod.light_blue
class AoeMissile (Missile):
color = tcod.red
c... | en | 0.486982 | # dist_min = None # target = None # for e in self.state.entities.enemies(): # d = util.dist(self.x, self.y, e.x, e.y) # if d < (self.radius + 1) and ((dist_min is None) or (d < dist_min)): # dist_min = d # target = e # if True: #TODO copypaste | 2.887058 | 3 |
python/mandelbrot.py | lukasjoc/random | 1 | 5430 | #!/usr/bin/python3
from PIL import Image
from numpy import complex, array
from tqdm import tqdm
import colorsys
W=512
#W=142
def mandelbrot(x, y):
def get_colors(i):
color = 255 * array(colorsys.hsv_to_rgb(i / 255.0, 1.0, 0.5))
return tuple(color.astype(int))
c, cc = 0, complex(x, y)
fo... | #!/usr/bin/python3
from PIL import Image
from numpy import complex, array
from tqdm import tqdm
import colorsys
W=512
#W=142
def mandelbrot(x, y):
def get_colors(i):
color = 255 * array(colorsys.hsv_to_rgb(i / 255.0, 1.0, 0.5))
return tuple(color.astype(int))
c, cc = 0, complex(x, y)
fo... | fr | 0.368578 | #!/usr/bin/python3 #W=142 | 2.95792 | 3 |
tests/unit/commands/test_deploy.py | tonyreina/mlt | 1 | 5431 | <reponame>tonyreina/mlt
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | en | 0.831792 | # # -*- coding: utf-8 -*- # # Copyright (c) 2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app... | 1.828734 | 2 |
packages/mccomponents/tests/mccomponentsbpmodule/sample/Broadened_E_Q_Kernel_TestCase.py | mcvine/mcvine | 5 | 5432 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# California Institute of Technology
# (C) 2006-2010 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# California Institute of Technology
# (C) 2006-2010 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | pl | 0.272044 | #!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # <NAME> # California Institute of Technology # (C) 2006-2010 All Rights Reserved # # {LicenseText} # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 1.973093 | 2 |
baseline/ns-vqa/reason/options/test_options.py | robinzixuan/Video-Question-Answering-HRI | 52 | 5433 | from .base_options import BaseOptions
class TestOptions(BaseOptions):
"""Test Option Class"""
def __init__(self):
super(TestOptions, self).__init__()
self.parser.add_argument('--load_checkpoint_path', required=True, type=str, help='checkpoint path')
self.parser.add_argument('--save_re... | from .base_options import BaseOptions
class TestOptions(BaseOptions):
"""Test Option Class"""
def __init__(self):
super(TestOptions, self).__init__()
self.parser.add_argument('--load_checkpoint_path', required=True, type=str, help='checkpoint path')
self.parser.add_argument('--save_re... | en | 0.676832 | Test Option Class | 2.384103 | 2 |
Model_setup/NEISO_data_file/downsampling_generators_v1.py | keremakdemir/ISONE_UCED | 0 | 5434 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 24 18:45:34 2020
@author: kakdemi
"""
import pandas as pd
#importing generators
all_generators = pd.read_excel('generators2.xlsx', sheet_name='NEISO generators (dispatch)')
#getting all oil generators
all_oil = all_generators[all_generators['typ']=='oil'].copy()
#gett... | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 24 18:45:34 2020
@author: kakdemi
"""
import pandas as pd
#importing generators
all_generators = pd.read_excel('generators2.xlsx', sheet_name='NEISO generators (dispatch)')
#getting all oil generators
all_oil = all_generators[all_generators['typ']=='oil'].copy()
#gett... | en | 0.835557 | # -*- coding: utf-8 -*- Created on Fri Apr 24 18:45:34 2020 @author: kakdemi #importing generators #getting all oil generators #getting all generators in every zone #defining zones #getting all slack generators #getting generators other than slack and oil #defining a function to downsample oil generators #copying the ... | 2.54618 | 3 |
GUI1.py | otmanabdoun/IHM-Python | 3 | 5435 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 16 19:47:41 2021
@author: User
"""
import tkinter as tk
racine = tk . Tk ()
label = tk . Label ( racine , text ="J ' adore Python !")
bouton = tk . Button ( racine , text =" Quitter ", command = racine . destroy )
label . pack ()
bouton . pack ... | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 16 19:47:41 2021
@author: User
"""
import tkinter as tk
racine = tk . Tk ()
label = tk . Label ( racine , text ="J ' adore Python !")
bouton = tk . Button ( racine , text =" Quitter ", command = racine . destroy )
label . pack ()
bouton . pack () | en | 0.790161 | # -*- coding: utf-8 -*- Created on Tue Nov 16 19:47:41 2021
@author: User | 3.119309 | 3 |
app/routes/v1/endpoints/clickup.py | ertyurk/bugme | 0 | 5436 | from fastapi import APIRouter, status, Body, HTTPException
from fastapi.encoders import jsonable_encoder
from starlette.responses import JSONResponse
from app.models.common import *
from app.models.clickup import *
from app.database.crud.clickup import *
router = APIRouter()
@router.get("/", response_description="C... | from fastapi import APIRouter, status, Body, HTTPException
from fastapi.encoders import jsonable_encoder
from starlette.responses import JSONResponse
from app.models.common import *
from app.models.clickup import *
from app.database.crud.clickup import *
router = APIRouter()
@router.get("/", response_description="C... | none | 1 | 2.559575 | 3 | |
cellfinder_core/main.py | npeschke/cellfinder-core | 5 | 5437 | <filename>cellfinder_core/main.py<gh_stars>1-10
"""
N.B imports are within functions to prevent tensorflow being imported before
it's warnings are silenced
"""
import os
import logging
from imlib.general.logging import suppress_specific_logs
tf_suppress_log_messages = [
"multiprocessing can interact badly with Te... | <filename>cellfinder_core/main.py<gh_stars>1-10
"""
N.B imports are within functions to prevent tensorflow being imported before
it's warnings are silenced
"""
import os
import logging
from imlib.general.logging import suppress_specific_logs
tf_suppress_log_messages = [
"multiprocessing can interact badly with Te... | en | 0.830926 | N.B imports are within functions to prevent tensorflow being imported before it's warnings are silenced # logging.info("Saving classified cells") # save_cells(points, classified_points_path) Prevents many lines of logs such as: "2019-10-24 16:54:41.363978: I tensorflow/stream_executor/platform/default /dso_load... | 1.709537 | 2 |
server.py | rezist-ro/rezistenta.tv | 0 | 5438 | # coding=utf-8
import dateutil.parser
import flask
import json
import os
import time
import urllib
import yaml
EPISODES = yaml.load(open("episodes.yaml").read())
app = flask.Flask(__name__,
static_path="/assets",
static_folder="assets")
app.jinja_env.filters["strftime"] = \
... | # coding=utf-8
import dateutil.parser
import flask
import json
import os
import time
import urllib
import yaml
EPISODES = yaml.load(open("episodes.yaml").read())
app = flask.Flask(__name__,
static_path="/assets",
static_folder="assets")
app.jinja_env.filters["strftime"] = \
... | en | 0.644078 | # coding=utf-8 | 2.541776 | 3 |
problem020.py | mazayus/ProjectEuler | 0 | 5439 | #!/usr/bin/env python3
from functools import *
import operator
def factorial(number):
assert number >= 1
return reduce(operator.mul, range(1, number+1))
def digits(number):
yield from (int(digit) for digit in str(number))
print(sum(digits(factorial(100))))
| #!/usr/bin/env python3
from functools import *
import operator
def factorial(number):
assert number >= 1
return reduce(operator.mul, range(1, number+1))
def digits(number):
yield from (int(digit) for digit in str(number))
print(sum(digits(factorial(100))))
| fr | 0.221828 | #!/usr/bin/env python3 | 3.988093 | 4 |
transformer.py | ghafran/KerasPersonLab | 0 | 5440 | <reponame>ghafran/KerasPersonLab
import numpy as np
from math import cos, sin, pi
import cv2
import random
from config import config, TransformationParams
from data_prep import map_coco_to_personlab
class AugmentSelection:
def __init__(self, flip=False, degree = 0., crop = (0,0), scale = 1.):
self.flip =... | import numpy as np
from math import cos, sin, pi
import cv2
import random
from config import config, TransformationParams
from data_prep import map_coco_to_personlab
class AugmentSelection:
def __init__(self, flip=False, degree = 0., crop = (0,0), scale = 1.):
self.flip = flip
self.degree = degre... | en | 0.817682 | #rotate #shift actually # the main idea: we will do all image transformations with one affine matrix. # this saves lot of cpu and make code significantly shorter # same affine matrix could be used to transform joint coordinates afterwards # scale_size = TransformationParams.target_dist / scale_self * self.scale # order... | 2.814692 | 3 |
enan/__init__.py | mizuno-group/enan | 0 | 5441 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 25 15:46:32 2019
@author: tadahaya
"""
from .binom import BT
from .connect import Connect
from .fet import FET
from .gsea import GSEA
from .ssgsea import ssGSEA
__copyright__ = 'Copyright (C) 2020 MIZUNO Tadahaya'
__version__ = '1.0.3'
__license__... | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 25 15:46:32 2019
@author: tadahaya
"""
from .binom import BT
from .connect import Connect
from .fet import FET
from .gsea import GSEA
from .ssgsea import ssGSEA
__copyright__ = 'Copyright (C) 2020 MIZUNO Tadahaya'
__version__ = '1.0.3'
__license__... | en | 0.801 | # -*- coding: utf-8 -*- Created on Wed Dec 25 15:46:32 2019
@author: tadahaya | 1.260017 | 1 |
app/helpers/__init__.py | Hacker-1202/Selfium | 14 | 5442 | <filename>app/helpers/__init__.py
"""
Selfium Helper Files
~~~~~~~~~~~~~~~~~~~
All Helper Files used in Selfium project;
:copyright: (c) 2021 - Caillou and ZeusHay;
:license: MIT, see LICENSE for more details.
"""
from .getUser import *
from .getGuild import *
from .params import *
from .notify import *
from .sendEmb... | <filename>app/helpers/__init__.py
"""
Selfium Helper Files
~~~~~~~~~~~~~~~~~~~
All Helper Files used in Selfium project;
:copyright: (c) 2021 - Caillou and ZeusHay;
:license: MIT, see LICENSE for more details.
"""
from .getUser import *
from .getGuild import *
from .params import *
from .notify import *
from .sendEmb... | en | 0.558642 | Selfium Helper Files ~~~~~~~~~~~~~~~~~~~ All Helper Files used in Selfium project; :copyright: (c) 2021 - Caillou and ZeusHay; :license: MIT, see LICENSE for more details. | 1.063285 | 1 |
NLP/UNIMO/src/finetune/visual_entailment.py | zhangyimi/Research | 1,319 | 5443 | <gh_stars>1000+
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | en | 0.721851 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app... | 1.600173 | 2 |
src/records.py | oth-datapipeline/ingestion-scripts | 0 | 5444 | <filename>src/records.py
from faust import Record
class RssFeed(Record, serializer='json'):
feed_source: str
title: str
link: str
published: str = None
author: str = None
summary: str = None
published_parsed: list = None
authors: list = None
tags: list = None
comments: str = No... | <filename>src/records.py
from faust import Record
class RssFeed(Record, serializer='json'):
feed_source: str
title: str
link: str
published: str = None
author: str = None
summary: str = None
published_parsed: list = None
authors: list = None
tags: list = None
comments: str = No... | none | 1 | 2.569619 | 3 | |
leetcode/102-Medium-Binary-Tree-Level-Order-Traversal/answer.py | vaishali-bariwal/Practice-Coding-Questions | 25 | 5445 | #!/usr/bin/python3
#------------------------------------------------------------------------------
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def levelOrder(self, root):
... | #!/usr/bin/python3
#------------------------------------------------------------------------------
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def levelOrder(self, root):
... | en | 0.220593 | #!/usr/bin/python3 #------------------------------------------------------------------------------ # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None :type root: TreeNode :rtype: List[List[int]] #-----... | 4.095963 | 4 |
setup.py | shirayu/fitbit-dumper | 0 | 5446 | <gh_stars>0
#!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name="",
version="0.01",
packages=find_packages(),
install_requires=[
"fitbit"
],
dependency_links=[
],
extras_require={
"tests": [
"flake8",
"autopep8",
... | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name="",
version="0.01",
packages=find_packages(),
install_requires=[
"fitbit"
],
dependency_links=[
],
extras_require={
"tests": [
"flake8",
"autopep8",
]
}
) | fr | 0.221828 | #!/usr/bin/env python3 | 1.164762 | 1 |
src/main.py | mtnmunuklu/SigmaToExcel | 10 | 5447 | <filename>src/main.py
import sys
sys.path.append("../")
from src.app.sigma import SigmaConverter
if __name__ == "__main__":
sigmaconverter = SigmaConverter()
sigmaconverter.read_from_file()
sigmaconverter.write_to_excel()
| <filename>src/main.py
import sys
sys.path.append("../")
from src.app.sigma import SigmaConverter
if __name__ == "__main__":
sigmaconverter = SigmaConverter()
sigmaconverter.read_from_file()
sigmaconverter.write_to_excel()
| none | 1 | 1.860716 | 2 | |
server/processes/migrations/0132_auto_20201108_0540.py | CloudReactor/task_manager | 0 | 5448 | # Generated by Django 2.2.14 on 2020-11-08 05:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('processes', '0131_auto_20201107_2316'),
]
operations = [
migrations.RunSQL(
"UPDATE processes_workflow SET run_environ... | # Generated by Django 2.2.14 on 2020-11-08 05:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('processes', '0131_auto_20201107_2316'),
]
operations = [
migrations.RunSQL(
"UPDATE processes_workflow SET run_environ... | en | 0.858617 | # Generated by Django 2.2.14 on 2020-11-08 05:40 | 1.518535 | 2 |
sparsely_lstmvae_main.py | pengkangzaia/usad | 0 | 5449 | <gh_stars>0
from model.sparsely_lstm_vae import *
import torch.utils.data as data_utils
from sklearn import preprocessing
from utils.eval_methods import *
device = get_default_device()
# Read data
# normal = pd.read_csv("data/SWaT_Dataset_Normal_v1.csv") # , nrows=1000)
normal = pd.read_csv("data/SWaT/SWaT_Dataset_N... | from model.sparsely_lstm_vae import *
import torch.utils.data as data_utils
from sklearn import preprocessing
from utils.eval_methods import *
device = get_default_device()
# Read data
# normal = pd.read_csv("data/SWaT_Dataset_Normal_v1.csv") # , nrows=1000)
normal = pd.read_csv("data/SWaT/SWaT_Dataset_Normal_v1.csv... | en | 0.232935 | # Read data # normal = pd.read_csv("data/SWaT_Dataset_Normal_v1.csv") # , nrows=1000) # , nrows=1000) # normal.shape # Transform all columns into float64 # 数据预处理 # Read data # attack = pd.read_csv("data/SWaT_Dataset_Attack_v0.csv", sep=";") # , nrows=1000) # , nrows=1000) # Transform all columns into float64 ########... | 2.516218 | 3 |
src/demo/tasks.py | MexsonFernandes/AsynchronousTasks-Django-Celery-RabbitMQ-Redis | 1 | 5450 | from __future__ import absolute_import, unicode_literals
from dcs.celeryconf import app
import time
from django.core.mail import EmailMessage
@app.task(bind=True, ignore_result=False, max_retries=3)
def demo_task1(self):
result = {
'val1': 1,
'val2': 2,
'val3': 3,
}
print("hellp")
... | from __future__ import absolute_import, unicode_literals
from dcs.celeryconf import app
import time
from django.core.mail import EmailMessage
@app.task(bind=True, ignore_result=False, max_retries=3)
def demo_task1(self):
result = {
'val1': 1,
'val2': 2,
'val3': 3,
}
print("hellp")
... | none | 1 | 1.938115 | 2 | |
pytorch_translate/models/__init__.py | Ayansam1152/translate | 748 | 5451 | <reponame>Ayansam1152/translate
#!/usr/bin/env python3
import importlib
import os
# automatically import any Python files in the models/ directory
for file in sorted(os.listdir(os.path.dirname(__file__))):
if file.endswith(".py") and not file.startswith("_"):
model_name = file[: file.find(".py")]
... | #!/usr/bin/env python3
import importlib
import os
# automatically import any Python files in the models/ directory
for file in sorted(os.listdir(os.path.dirname(__file__))):
if file.endswith(".py") and not file.startswith("_"):
model_name = file[: file.find(".py")]
importlib.import_module("pytorc... | en | 0.233884 | #!/usr/bin/env python3 # automatically import any Python files in the models/ directory | 2.335612 | 2 |
app/config/secure.py | mapeimapei/awesome-flask-webapp | 2 | 5452 | # -*- coding: utf-8 -*-
__author__ = '带土'
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:mapei123@127.0.0.1:3306/awesome'
SECRET_KEY = <KEY>'
# Email 配置
MAIL_SERVER = 'smtp.exmail.qq.com'
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USE_TSL = False
MAIL_USERNAME = '<EMAIL>'
MAIL_PASSWORD = '<PASSWORD>'
MAIL_SUBJECT_PREF... | # -*- coding: utf-8 -*-
__author__ = '带土'
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:mapei123@127.0.0.1:3306/awesome'
SECRET_KEY = <KEY>'
# Email 配置
MAIL_SERVER = 'smtp.exmail.qq.com'
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USE_TSL = False
MAIL_USERNAME = '<EMAIL>'
MAIL_PASSWORD = '<PASSWORD>'
MAIL_SUBJECT_PREF... | ja | 0.266841 | # -*- coding: utf-8 -*- # Email 配置 # 开启数据库查询性能测试 # 性能测试的阀值 # PERMANENT_SESSION_LIFETIME = 3600 | 1.994561 | 2 |
src/users/migrations/0014_auto_20200801_1008.py | aliharby12/Simple-vezeeta-project | 0 | 5453 | <reponame>aliharby12/Simple-vezeeta-project<gh_stars>0
# Generated by Django 2.2 on 2020-08-01 08:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0013_auto_20200731_1810'),
]
operations = [
m... | # Generated by Django 2.2 on 2020-08-01 08:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0013_auto_20200731_1810'),
]
operations = [
migrations.AlterField(
model_name='profile',... | en | 0.766526 | # Generated by Django 2.2 on 2020-08-01 08:08 | 1.692031 | 2 |
caller_v3/app/api/v1/docker.py | tienthegainz/pipeline_executor_docker_call | 0 | 5454 | from typing import Any, List, Callable
from fastapi import APIRouter, HTTPException, status, BackgroundTasks
from app import schemas
from app.core import docker_client
import json
from copy import deepcopy
router = APIRouter()
@router.get("/images", response_model=schemas.DockerImageRespond)
def get_docker_image(... | from typing import Any, List, Callable
from fastapi import APIRouter, HTTPException, status, BackgroundTasks
from app import schemas
from app.core import docker_client
import json
from copy import deepcopy
router = APIRouter()
@router.get("/images", response_model=schemas.DockerImageRespond)
def get_docker_image(... | none | 1 | 2.314794 | 2 | |
keras/models.py | kalyc/keras-apache-mxnet | 300 | 5455 | <filename>keras/models.py
"""Model-related utilities.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import backend as K
from .utils.generic_utils import has_arg
from .utils.generic_utils import to_list
from .engine.input_layer import Input
from ... | <filename>keras/models.py
"""Model-related utilities.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import backend as K
from .utils.generic_utils import has_arg
from .utils.generic_utils import to_list
from .engine.input_layer import Input
from ... | en | 0.752316 | Model-related utilities. Clone a functional `Model` instance. Model cloning is similar to calling a model on new inputs, except that it creates new layers (and thus new weights) instead of sharing the weights of the existing layers. # Arguments model: Instance of `Model`. input_tensors... | 2.503848 | 3 |
pythonFiles/tests/testing_tools/adapter/test_functional.py | erinxocon/vscode-python | 0 | 5456 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from __future__ import unicode_literals
import json
import os
import os.path
import subprocess
import sys
import unittest
import pytest
from ...__main__ import TESTING_TOOLS_ROOT
CWD = os.getcwd()
DATA_DIR = os.path.join... | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from __future__ import unicode_literals
import json
import os
import os.path
import subprocess
import sys
import unittest
import pytest
from ...__main__ import TESTING_TOOLS_ROOT
CWD = os.getcwd()
DATA_DIR = os.path.join... | en | 0.218484 | # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # Re-run pytest but print out stdout & stderr this time # add in doctests from test suite # add in doctests from non-test module # TODO: Expect the following instead? #self.assertEqual(result, [{ # 'root': projroot, # 'r... | 1.914177 | 2 |
mmgp/kernels/wavelet_slice.py | axdahl/SC-MMGP | 0 | 5457 | '''
Wavelet kernel
slice allows kernel operation on feature subset
active_dims is iterable of feature dimensions to extract
input_dim must equal dimension defined by active_dims
'''
import numpy as np
import tensorflow as tf
from .. import util
from . import kernel
from .kernel_extras import *
class WaveletSlice(ke... | '''
Wavelet kernel
slice allows kernel operation on feature subset
active_dims is iterable of feature dimensions to extract
input_dim must equal dimension defined by active_dims
'''
import numpy as np
import tensorflow as tf
from .. import util
from . import kernel
from .kernel_extras import *
class WaveletSlice(ke... | en | 0.575827 | Wavelet kernel slice allows kernel operation on feature subset active_dims is iterable of feature dimensions to extract input_dim must equal dimension defined by active_dims # Zhang wavelet #return tf.cos(1.75*x)*tf.exp(-0.5*x**2) # mexican hat wavelet # Zhang wavelet # mexican hat wavelet #return (1-x**2)*tf.exp(-0.5*... | 2.67985 | 3 |
transform.py | latenite4/python3 | 0 | 5458 |
#!/usr/bin/python3
#program to parse png images and change images
# cmd: python3 transform.py
# you must have local input/ and output/ directories
#
# name: <NAME>
# date: 12/27/20
# cmdline: python transform.py cmd show image='city.png' --ulx=1 --uly=2 --brx=0 --bry=9
# python transform.py show city.png
# ... |
#!/usr/bin/python3
#program to parse png images and change images
# cmd: python3 transform.py
# you must have local input/ and output/ directories
#
# name: <NAME>
# date: 12/27/20
# cmdline: python transform.py cmd show image='city.png' --ulx=1 --uly=2 --brx=0 --bry=9
# python transform.py show city.png
# ... | en | 0.640953 | #!/usr/bin/python3 #program to parse png images and change images # cmd: python3 transform.py # you must have local input/ and output/ directories # # name: <NAME> # date: 12/27/20 # cmdline: python transform.py cmd show image='city.png' --ulx=1 --uly=2 --brx=0 --bry=9 # python transform.py show city.png # ... | 3.499297 | 3 |
plugins/wyr.py | Jeglet/pcbot | 0 | 5459 | <gh_stars>0
""" Would you rather? This plugin includes would you rather functionality
"""
import asyncio
import random
import re
import discord
import bot
import plugins
from pcbot import Config
client = plugins.client # type: bot.Client
db = Config("would-you-rather", data=dict(timeout=10, responses=["**{name}** ... | """ Would you rather? This plugin includes would you rather functionality
"""
import asyncio
import random
import re
import discord
import bot
import plugins
from pcbot import Config
client = plugins.client # type: bot.Client
db = Config("would-you-rather", data=dict(timeout=10, responses=["**{name}** would **{cho... | en | 0.920244 | Would you rather? This plugin includes would you rather functionality # type: bot.Client # All running would you rather's are in this set Command argument for receiving two options. Get the chosen option. This accept 1 and 2 as numbers. # Go through all words in the given message, and find any words unique to a choice ... | 3.275981 | 3 |
suit_tool/argparser.py | bergzand/suit-manifest-generator | 16 | 5460 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright 2019-2020 ARM Limited or its affiliates
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the... | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright 2019-2020 ARM Limited or its affiliates
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the... | en | 0.606281 | # -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright 2019-2020 ARM Limited or its affiliates # # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the... | 2.007823 | 2 |
python/process/process_pool.py | y2ghost/study | 0 | 5461 | <reponame>y2ghost/study
import random
import time
from multiprocessing import Pool
def worker(name: str) -> None:
print(f'Started worker {name}')
worker_time = random.choice(range(1, 5))
time.sleep(worker_time)
print(f'{name} worker finished in {worker_time} seconds')
if __name__ == '__main__':
... | import random
import time
from multiprocessing import Pool
def worker(name: str) -> None:
print(f'Started worker {name}')
worker_time = random.choice(range(1, 5))
time.sleep(worker_time)
print(f'{name} worker finished in {worker_time} seconds')
if __name__ == '__main__':
process_names = [f'compu... | en | 0.372389 | # pool.terminate() | 3.169688 | 3 |
Project/Support-NotSourced/generic_pydicom_ns.py | mazalgarab-git/OSICpypy | 1 | 5462 | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 7 11:48:59 2020
@author: mazal
"""
"""
=========================================
Support functions of pydicom (Not sourced)
=========================================
Purpose: Create support functions for the pydicom project
"""
"""
Test mode 1 | Basics... | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 7 11:48:59 2020
@author: mazal
"""
"""
=========================================
Support functions of pydicom (Not sourced)
=========================================
Purpose: Create support functions for the pydicom project
"""
"""
Test mode 1 | Basics... | en | 0.629894 | # -*- coding: utf-8 -*- Created on Mon Sep 7 11:48:59 2020
@author: mazal =========================================
Support functions of pydicom (Not sourced)
=========================================
Purpose: Create support functions for the pydicom project Test mode 1 | Basics
testMode = True
reportMode = Fa... | 2.483071 | 2 |
paperscraper/scrapers/keywords.py | ahmed-shariff/scraper | 1 | 5463 | <gh_stars>1-10
import re
regex = re.compile(r'[\n\r\t]')
def acm_digital_library(soup):
try:
keywords = set()
keywords_parent_ol = soup.find('ol', class_="rlist organizational-chart")
keywords_divs = keywords_parent_ol.findChildren('div', recursive=True)
for kw_parent in keywords_... | import re
regex = re.compile(r'[\n\r\t]')
def acm_digital_library(soup):
try:
keywords = set()
keywords_parent_ol = soup.find('ol', class_="rlist organizational-chart")
keywords_divs = keywords_parent_ol.findChildren('div', recursive=True)
for kw_parent in keywords_divs:
... | en | 0.778964 | # e.g. CASE 1: ['Categories and Subject Descriptors (according to ACM CCS): I.4.1 [Image Processing and Computer Vision]: Enhancement-Filtering I.3.3 [Computer Graphics]: Picture/Image Generation-Bitmap and framebuffer operations'] # e.g. CASE 2 [TODO: Not taken care of yet] Categories and Subject Descriptors (accordin... | 2.747279 | 3 |
topobank/publication/models.py | ContactEngineering/TopoBank | 3 | 5464 | from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.safestring import mark_safe
from django.conf import settings
MAX_LEN_AUTHORS_FIELD = 512
CITATION_FORMAT_FLAVORS = ['html', 'ris', 'bibtex', 'biblatex']
DEFAULT_KEYWORDS = ['surface', 'topography']
class... | from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.safestring import mark_safe
from django.conf import settings
MAX_LEN_AUTHORS_FIELD = 512
CITATION_FORMAT_FLAVORS = ['html', 'ris', 'bibtex', 'biblatex']
DEFAULT_KEYWORDS = ['surface', 'topography']
class... | en | 0.523544 | # 16 digits including 3 dashes # see http://refdb.sourceforge.net/manual-0.9.6/sect1-ris-format.html # or https://en.wikipedia.org/wiki/RIS_(file_format) # or https://web.archive.org/web/20120526103719/http://refman.com/support/risformat_intro.asp # https://web.archive.org/web/20120717122530/http://refman.com/sup... | 2.111165 | 2 |
vendor/migrations/0003_store_password.py | rayhu-osu/vcube | 1 | 5465 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-07-24 19:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vendor', '0002_store_image'),
]
operations = [
migrations.AddField(
... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-07-24 19:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vendor', '0002_store_image'),
]
operations = [
migrations.AddField(
... | en | 0.71897 | # -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-07-24 19:36 | 1.569032 | 2 |
lec2.py | widnerlr/isat252 | 0 | 5466 | <gh_stars>0
"""
Your module description
"""
"""
this is my second py code
for my second lecture
"""
#print ('hello world') # this is a single line commment
# this is my second line comment
#print(type("123."))
#print ("Hello World".upper())
#print("Hello World".lower())
#print("hello" + "world" + ".")
#print(2... | """
Your module description
"""
"""
this is my second py code
for my second lecture
"""
#print ('hello world') # this is a single line commment
# this is my second line comment
#print(type("123."))
#print ("Hello World".upper())
#print("Hello World".lower())
#print("hello" + "world" + ".")
#print(2**3)
#my_st... | en | 0.430798 | Your module description this is my second py code for my second lecture #print ('hello world') # this is a single line commment # this is my second line comment #print(type("123.")) #print ("Hello World".upper()) #print("Hello World".lower()) #print("hello" + "world" + ".") #print(2**3) #my_str = "hello world" #print(... | 3.838675 | 4 |
day_22_b.py | Gyaha/AOC2020 | 0 | 5467 | <reponame>Gyaha/AOC2020<filename>day_22_b.py
def play_recursively_combat(p1: list, p2: list) -> bool:
rounds = set()
winner = None
while len(p1) > 0 and len(p2) > 0:
r = tuple(p1 + [-1] + p2)
if r in rounds:
return True
else:
rounds.add(r)
c1 = p1.pop... | def play_recursively_combat(p1: list, p2: list) -> bool:
rounds = set()
winner = None
while len(p1) > 0 and len(p2) > 0:
r = tuple(p1 + [-1] + p2)
if r in rounds:
return True
else:
rounds.add(r)
c1 = p1.pop(0)
c2 = p2.pop(0)
if c1 <= ... | en | 0.51645 | Player 1: 9 2 6 3 1 Player 2: 5 8 4 7 10 Player 1: 43 19 Player 2: 2 29 14 | 3.294097 | 3 |
Auth/Constants/LoginOpCode.py | sundayz/idewave-core | 0 | 5468 | <reponame>sundayz/idewave-core
from enum import Enum
class LoginOpCode(Enum):
''' Opcodes during login process '''
LOGIN_CHALL = 0x00
LOGIN_PROOF = 0x01
RECON_CHALL = 0x02 # currently do not in use
RECON_PROOF = 0x03 # currently do not in use
REALMLIST = 0x10
class LoginResult(Enum):
... | from enum import Enum
class LoginOpCode(Enum):
''' Opcodes during login process '''
LOGIN_CHALL = 0x00
LOGIN_PROOF = 0x01
RECON_CHALL = 0x02 # currently do not in use
RECON_PROOF = 0x03 # currently do not in use
REALMLIST = 0x10
class LoginResult(Enum):
''' Error codes '''
SUCC... | en | 0.954938 | Opcodes during login process # currently do not in use # currently do not in use Error codes | 2.654264 | 3 |
LINETOKEN/__init__.py | pratannaimjoi/tokenIpad | 0 | 5469 | <reponame>pratannaimjoi/tokenIpad
# -*- coding: utf-8 -*-
from .LineApi import LINE
from .lib.Gen.ttypes import *
| # -*- coding: utf-8 -*-
from .LineApi import LINE
from .lib.Gen.ttypes import * | en | 0.769321 | # -*- coding: utf-8 -*- | 0.987998 | 1 |
main.py | seton-develops/PDF-Camelot-Folder-Executable | 0 | 5470 | <filename>main.py
'''
Created on Jun 17, 2021
@author: Sean
'''
import PDF2CSV_GUI
def main():
j = PDF2CSV_GUI.Convert_GUI()
if __name__ == "__main__":
main() | <filename>main.py
'''
Created on Jun 17, 2021
@author: Sean
'''
import PDF2CSV_GUI
def main():
j = PDF2CSV_GUI.Convert_GUI()
if __name__ == "__main__":
main() | en | 0.795415 | Created on Jun 17, 2021
@author: Sean | 1.913199 | 2 |
Part1/bot_read.py | Mildlyoffbeat/RedditBot-1 | 0 | 5471 | #!/usr/bin/python
import praw
reddit = praw.Reddit('mob-secondbot')
subreddit = reddit.subreddit("learnpython")
for submission in subreddit.hot(limit=5):
print("Title: ", submission.title)
print("Text: ", submission.selftext)
print("Score: ", submission.score)
print("---------------------------------... | #!/usr/bin/python
import praw
reddit = praw.Reddit('mob-secondbot')
subreddit = reddit.subreddit("learnpython")
for submission in subreddit.hot(limit=5):
print("Title: ", submission.title)
print("Text: ", submission.selftext)
print("Score: ", submission.score)
print("---------------------------------... | ru | 0.258958 | #!/usr/bin/python | 2.901429 | 3 |
17/kazuate_liar.cpp.py | Siketyan/Programming-I | 0 | 5472 | <filename>17/kazuate_liar.cpp.py
from subprocess import Popen, PIPE, call
name = "kazuate_liar.o"
src = """
#include <iostream>
#include <random>
using namespace std;
int main()
{
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> randfive(0, 4);
uniform_int_distribution<int> randint(... | <filename>17/kazuate_liar.cpp.py
from subprocess import Popen, PIPE, call
name = "kazuate_liar.o"
src = """
#include <iostream>
#include <random>
using namespace std;
int main()
{
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> randfive(0, 4);
uniform_int_distribution<int> randint(... | ja | 0.146064 | #include <iostream> #include <random> using namespace std; int main() { random_device rd; mt19937 mt(rd()); uniform_int_distribution<int> randfive(0, 4); uniform_int_distribution<int> randint(1, 100); int count = 0; int num = randint(mt); while (1) { int i; cout << "数... | 2.667252 | 3 |
src/terrafort/main.py | silvercar/terrafort | 1 | 5473 | <gh_stars>1-10
"""
Terrafort
Generate terraform templates for specific resources
"""
import click
from .providers.aws import Aws
@click.group()
@click.option('--commands',
is_flag=True,
help="Output import commands instead of a terraform template")
@click.version_option()
@click.pass_con... | """
Terrafort
Generate terraform templates for specific resources
"""
import click
from .providers.aws import Aws
@click.group()
@click.option('--commands',
is_flag=True,
help="Output import commands instead of a terraform template")
@click.version_option()
@click.pass_context
def cli(ct... | en | 0.339901 | Terrafort Generate terraform templates for specific resources # pylint: disable=unexpected-keyword-arg,no-value-for-parameter | 2.252612 | 2 |
src/ping.py | jnsougata/rich-embed | 0 | 5474 | <gh_stars>0
import discord
import app_util
class Ping(app_util.Cog):
def __init__(self, bot: app_util.Bot):
self.bot = bot
@app_util.Cog.command(
command=app_util.SlashCommand(
name='ping', description='shows avg ping of client'
),
guild_id=877399405056102431
... | import discord
import app_util
class Ping(app_util.Cog):
def __init__(self, bot: app_util.Bot):
self.bot = bot
@app_util.Cog.command(
command=app_util.SlashCommand(
name='ping', description='shows avg ping of client'
),
guild_id=877399405056102431
)
async ... | none | 1 | 2.477218 | 2 | |
2020/24/visualization.py | AlbertVeli/AdventOfCode | 0 | 5475 | #!/usr/bin/env python3
import sys
import re
import numpy as np
from PIL import Image
moves = { 'e': (2, 0), 'se': (1, 2), 'sw': (-1, 2), 'w': (-2, 0), 'nw': (-1, -2), 'ne': (1, -2) }
# Save (x, y): True/False in tiles. True = black, False = white.
tiles = {}
for line in open(sys.argv[1]).read().splitlines():
po... | #!/usr/bin/env python3
import sys
import re
import numpy as np
from PIL import Image
moves = { 'e': (2, 0), 'se': (1, 2), 'sw': (-1, 2), 'w': (-2, 0), 'nw': (-1, -2), 'ne': (1, -2) }
# Save (x, y): True/False in tiles. True = black, False = white.
tiles = {}
for line in open(sys.argv[1]).read().splitlines():
po... | en | 0.712337 | #!/usr/bin/env python3 # Save (x, y): True/False in tiles. True = black, False = white. # Part 1 # -- Part 2 -- # take a chance on how wide it needs to be # Fill in tiles, move to center # Don't do outer edge (to avoid special cases) # black # white | 3.059455 | 3 |
experimental/tracing/bin/diff_heap_profiler.py | BearerPipelineTest/catapult | 1,894 | 5476 | #!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
from __future__ import print_function
import argparse
import gzip
import json
import os
import s... | #!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
from __future__ import print_function
import argparse
import gzip
import json
import os
import s... | en | 0.840614 | #!/usr/bin/env python # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Retrieve process informations. # Look for a detailed memory dump event. # Check for a memory dump V1. # Get the first memory dump. # C... | 2.193238 | 2 |
mne_bids/commands/mne_bids_raw_to_bids.py | kingjr/mne-bids | 0 | 5477 | """Write raw files to BIDS format.
example usage: $ mne_bids raw_to_bids --subject_id sub01 --task rest
--raw data.edf --bids_root new_path
"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import mne_bids
from mne_bids import write_raw_bids, BIDSPath
from mne_bids.read import _... | """Write raw files to BIDS format.
example usage: $ mne_bids raw_to_bids --subject_id sub01 --task rest
--raw data.edf --bids_root new_path
"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import mne_bids
from mne_bids import write_raw_bids, BIDSPath
from mne_bids.read import _... | en | 0.401622 | Write raw files to BIDS format. example usage: $ mne_bids raw_to_bids --subject_id sub01 --task rest --raw data.edf --bids_root new_path # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) Run the raw_to_bids command. | 2.387025 | 2 |
lab1oop.py | NastiaK/NewRepository | 0 | 5478 | <gh_stars>0
class Calculations:
def __init__(self, first, second):
self.first = first
self.second = second
def add(self):
print(self.first + self.second)
def subtract(self):
print(self.first - self.second)
def multiply(self):
print(self.first * self... | class Calculations:
def __init__(self, first, second):
self.first = first
self.second = second
def add(self):
print(self.first + self.second)
def subtract(self):
print(self.first - self.second)
def multiply(self):
print(self.first * self.second)
... | none | 1 | 4.134129 | 4 | |
Arrays/cyclic_rotation.py | Jeans212/codility-dev-training | 0 | 5479 | <reponame>Jeans212/codility-dev-training
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
'''
Rotate an array A to the right by a given number of steps K.
Covert the array to a deque
Apply the rotate() method the rotate the deque in positive K steps
Convert... | # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
'''
Rotate an array A to the right by a given number of steps K.
Covert the array to a deque
Apply the rotate() method the rotate the deque in positive K steps
Convert the deque to array
'''
from collec... | en | 0.772375 | # you can write to stdout for debugging purposes, e.g. # print("this is a debug message") Rotate an array A to the right by a given number of steps K. Covert the array to a deque Apply the rotate() method the rotate the deque in positive K steps Convert the deque to array # write your code in Python 3.... | 3.841726 | 4 |
tests/test_apis.py | hatzel/markdown-spoilers | 2 | 5480 | # -*- coding: utf-8 -*-
"""
Python Markdown
A Python implementation of <NAME>'s Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by <NAME> (http://www.dwerg.net/).
Maintained for a few years by <NAME> (ht... | # -*- coding: utf-8 -*-
"""
Python Markdown
A Python implementation of <NAME>'s Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by <NAME> (http://www.dwerg.net/).
Maintained for a few years by <NAME> (ht... | en | 0.690564 | # -*- coding: utf-8 -*- Python Markdown A Python implementation of <NAME>'s Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by <NAME> (http://www.dwerg.net/). Maintained for a few years by <NAME> (http:/... | 2.182668 | 2 |
nervous/utility/config.py | csxeba/nervous | 1 | 5481 | import os
class StressedNetConfig:
def __init__(self,
synaptic_environmental_constraint=0.8,
group_environmental_constraint=0.6,
stress_factor=0.8,
save_folder=os.path.expanduser("~/.nervous/models/")):
self._synaptic_environmental_const... | import os
class StressedNetConfig:
def __init__(self,
synaptic_environmental_constraint=0.8,
group_environmental_constraint=0.6,
stress_factor=0.8,
save_folder=os.path.expanduser("~/.nervous/models/")):
self._synaptic_environmental_const... | none | 1 | 2.554267 | 3 | |
mindspore/nn/optim/ftrl.py | XinYao1994/mindspore | 2 | 5482 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | en | 0.742572 | # Copyright 2020 Huawei Technologies Co., Ltd # # 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... | 1.926231 | 2 |
aws_utils/region_selector.py | skimhub/aws-utils | 0 | 5483 | <gh_stars>0
import datetime
import boto3
US_EAST_REGION = {'us-east-1'}
US_EAST_AVAILABILITY_ZONES = {'us-east-1a', 'us-east-1b', 'us-east-1c', 'us-east-1e'} # note d is missing
INSTANCE_VERSION = 'Linux/UNIX (Amazon VPC)'
def fetch_spot_prices(region, start_time, end_time, instance_type, instance_version=INSTANC... | import datetime
import boto3
US_EAST_REGION = {'us-east-1'}
US_EAST_AVAILABILITY_ZONES = {'us-east-1a', 'us-east-1b', 'us-east-1c', 'us-east-1e'} # note d is missing
INSTANCE_VERSION = 'Linux/UNIX (Amazon VPC)'
def fetch_spot_prices(region, start_time, end_time, instance_type, instance_version=INSTANCE_VERSION):
... | en | 0.722261 | # note d is missing Fetches prices of EC2 spot instances from AWS. Args: region (str): region to look for instances in start_time (datetime.datetime): end_time (datetime.datetime): instance_type (str): instance_version (str): the types of instances that we wish to return pri... | 2.59518 | 3 |
pynn/__init__.py | jkae/knn-exercise | 0 | 5484 |
from .nearest_neighbor_index import NearestNeighborIndex
from .kd_tree import *
|
from .nearest_neighbor_index import NearestNeighborIndex
from .kd_tree import *
| none | 1 | 1.042671 | 1 | |
tests/test_try.py | threecifanggen/python-functional-programming | 3 | 5485 | '''
Author: huangbaochen<<EMAIL>>
Date: 2021-12-11 20:04:19
LastEditTime: 2021-12-11 21:46:16
LastEditors: huangbaochen<<EMAIL>>
Description: 测试Try单子
No MERCY
'''
import pytest
from fppy.try_monad import Try, Success, Fail
from fppy.option import Just, Nothing
@pytest.mark.try_monad
def test_try_apply():
assert Tr... | '''
Author: huangbaochen<<EMAIL>>
Date: 2021-12-11 20:04:19
LastEditTime: 2021-12-11 21:46:16
LastEditors: huangbaochen<<EMAIL>>
Description: 测试Try单子
No MERCY
'''
import pytest
from fppy.try_monad import Try, Success, Fail
from fppy.option import Just, Nothing
@pytest.mark.try_monad
def test_try_apply():
assert Tr... | en | 0.410737 | Author: huangbaochen<<EMAIL>> Date: 2021-12-11 20:04:19 LastEditTime: 2021-12-11 21:46:16 LastEditors: huangbaochen<<EMAIL>> Description: 测试Try单子 No MERCY # pylint: disable=no-member | 2.697036 | 3 |
app/internal/daily_quotes.py | yammesicka/calendar | 0 | 5486 | <reponame>yammesicka/calendar<filename>app/internal/daily_quotes.py
from datetime import date
from typing import Dict, Optional
from sqlalchemy.orm import Session
from sqlalchemy.sql.expression import func
from app.database.models import Quote
TOTAL_DAYS = 366
def create_quote_object(quotes_fields: Dict[str, Optio... | from datetime import date
from typing import Dict, Optional
from sqlalchemy.orm import Session
from sqlalchemy.sql.expression import func
from app.database.models import Quote
TOTAL_DAYS = 366
def create_quote_object(quotes_fields: Dict[str, Optional[str]]) -> Quote:
"""This function create a quote object from... | en | 0.860782 | This function create a quote object from given fields dictionary. It is used for adding the data from the json into the db This function provides a daily quote, relevant to the current day of the year. The quote is randomally selected from a set of quotes matching to the given day | 3.252411 | 3 |
src/789A.py | viing937/codeforces | 2 | 5487 | n, k = map(int, input().split())
w = list(map(int, input().split()))
r = sum(map(lambda x: (x+k-1)//k, w))
print((r+1)//2)
| n, k = map(int, input().split())
w = list(map(int, input().split()))
r = sum(map(lambda x: (x+k-1)//k, w))
print((r+1)//2)
| none | 1 | 2.651132 | 3 | |
platform/server/detect.py | leyyin/godot | 24 | 5488 | <reponame>leyyin/godot<gh_stars>10-100
import os
import sys
def is_active():
return True
def get_name():
return "Server"
def can_build():
if (os.name!="posix"):
return False
return True # enabled
def get_opts():
return [
('use_llvm','Use llvm compiler','no'),
('force_32_bits','Force 32 bits binary','... | import os
import sys
def is_active():
return True
def get_name():
return "Server"
def can_build():
if (os.name!="posix"):
return False
return True # enabled
def get_opts():
return [
('use_llvm','Use llvm compiler','no'),
('force_32_bits','Force 32 bits binary','no')
]
def get_flags():
return [
('... | en | 0.300687 | # enabled #if (env["tools"]=="no"): # #no tools suffix # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] #TODO detect linux/BSD! | 2.176157 | 2 |
telemetry/Truck.py | SnipsMine/ETS2-Speedrun-Tool | 0 | 5489 | <reponame>SnipsMine/ETS2-Speedrun-Tool<filename>telemetry/Truck.py
from telemetry.TruckConstants import ConstantValues
from telemetry.TruckCurrent import CurrentValues
from telemetry.TruckPositioning import Positioning
class TruckValues:
constant_values = None
current_values = None
positioning = None
... | from telemetry.TruckConstants import ConstantValues
from telemetry.TruckCurrent import CurrentValues
from telemetry.TruckPositioning import Positioning
class TruckValues:
constant_values = None
current_values = None
positioning = None
def __init__(self):
self.current_values = CurrentValues()... | none | 1 | 2.421186 | 2 | |
IntroToSpark/Assign4_Q1-6_action.py | petersontylerd/spark-courses | 0 | 5490 |
import csv
from pyspark.sql import SparkSession
from pyspark.sql.types import IntegerType
spark = SparkSession.builder.appName("Assignment4").getOrCreate()
sc = spark.sparkContext
# load data to dataframe
path = 'fake_data.csv'
df = spark.read.format('csv').option('header','true').load(path)
# cast income as an int... |
import csv
from pyspark.sql import SparkSession
from pyspark.sql.types import IntegerType
spark = SparkSession.builder.appName("Assignment4").getOrCreate()
sc = spark.sparkContext
# load data to dataframe
path = 'fake_data.csv'
df = spark.read.format('csv').option('header','true').load(path)
# cast income as an int... | en | 0.804041 | # load data to dataframe # cast income as an integer # Question 1 # Question 2 # Question 3 # Question 4 # Question 5 # Question 6 | 3.484349 | 3 |
src/firebot/tests/factories.py | zipmex/fire | 52 | 5491 | <reponame>zipmex/fire<gh_stars>10-100
import factory
from django.contrib.auth import get_user_model
class UserFactory(factory.DjangoModelFactory):
class Meta:
model = get_user_model()
first_name = factory.Faker('name')
last_name = factory.Faker('name')
email = factory.Faker('email')
| import factory
from django.contrib.auth import get_user_model
class UserFactory(factory.DjangoModelFactory):
class Meta:
model = get_user_model()
first_name = factory.Faker('name')
last_name = factory.Faker('name')
email = factory.Faker('email') | none | 1 | 2.301784 | 2 | |
reamber/o2jam/O2JHold.py | Bestfast/reamberPy | 0 | 5492 | <filename>reamber/o2jam/O2JHold.py
from dataclasses import dataclass, field
from reamber.base.Hold import Hold, HoldTail
from reamber.o2jam.O2JNoteMeta import O2JNoteMeta
@dataclass
class O2JHoldTail(HoldTail, O2JNoteMeta):
pass
@dataclass
class O2JHold(Hold, O2JNoteMeta):
""" Defines the O2Jam Bpm Object
... | <filename>reamber/o2jam/O2JHold.py
from dataclasses import dataclass, field
from reamber.base.Hold import Hold, HoldTail
from reamber.o2jam.O2JNoteMeta import O2JNoteMeta
@dataclass
class O2JHoldTail(HoldTail, O2JNoteMeta):
pass
@dataclass
class O2JHold(Hold, O2JNoteMeta):
""" Defines the O2Jam Bpm Object
... | en | 0.359705 | Defines the O2Jam Bpm Object The O2Jam Bpm Object is stored in binary file .ojn | 2.782821 | 3 |
peacebot/core/plugins/Miscellaneous/__init__.py | Peacebot-Development/Peacebot-v2 | 3 | 5493 | <filename>peacebot/core/plugins/Miscellaneous/__init__.py<gh_stars>1-10
import lightbulb
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from peacebot.core.utils.time import TimeConverter
def fetch_scheduler(ctx: lightbulb.Context) -> AsyncIOScheduler:
return ctx.bot.d.scheduler
async def convert_t... | <filename>peacebot/core/plugins/Miscellaneous/__init__.py<gh_stars>1-10
import lightbulb
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from peacebot.core.utils.time import TimeConverter
def fetch_scheduler(ctx: lightbulb.Context) -> AsyncIOScheduler:
return ctx.bot.d.scheduler
async def convert_t... | none | 1 | 2.061282 | 2 | |
example/android/python/msite_simple_default_browser.py | laichimirum/docker-appium-emulator | 8 | 5494 | import unittest
from appium import webdriver
class MSiteDefaultBrowserAndroidUITests(unittest.TestCase):
def setUp(self):
# Default browser does not exist for android >= 6.0
desired_caps = {
'platformName': 'Android',
'deviceName': 'Android Emulator',
'appPac... | import unittest
from appium import webdriver
class MSiteDefaultBrowserAndroidUITests(unittest.TestCase):
def setUp(self):
# Default browser does not exist for android >= 6.0
desired_caps = {
'platformName': 'Android',
'deviceName': 'Android Emulator',
'appPac... | en | 0.676678 | # Default browser does not exist for android >= 6.0 | 2.710672 | 3 |
src/nn/dataset_utils/types_processing.py | sola-st/Nalin | 0 | 5495 | <gh_stars>0
"""
Created on 17-June-2020
@author <NAME>
The types extracted during runtime usually look something like --> <class 'numpy.ndarray'> or
<class 'seaborn.palettes._ColorPalette'> change them to --> ndarray, ColorPalette
"""
import re
remove_chars = re.compile(r'>|\'|<|(class )|_|(type)')
def process_ty... | """
Created on 17-June-2020
@author <NAME>
The types extracted during runtime usually look something like --> <class 'numpy.ndarray'> or
<class 'seaborn.palettes._ColorPalette'> change them to --> ndarray, ColorPalette
"""
import re
remove_chars = re.compile(r'>|\'|<|(class )|_|(type)')
def process_types(tp: str)... | en | 0.792529 | Created on 17-June-2020 @author <NAME> The types extracted during runtime usually look something like --> <class 'numpy.ndarray'> or <class 'seaborn.palettes._ColorPalette'> change them to --> ndarray, ColorPalette | 2.847246 | 3 |
src/canvas.py | soootaleb/spare | 1 | 5496 | <filename>src/canvas.py<gh_stars>1-10
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from matplotlib import pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import matplotlib.ticker as ticker
import ... | <filename>src/canvas.py<gh_stars>1-10
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from matplotlib import pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import matplotlib.ticker as ticker
import ... | en | 0.593452 | This class is used to plt the histogram of the two objects in the main module. the values are computed in one of the descriptors. #TODO : Add the names of the objects (fname - extention ?) #TODO : refractor this ugly-but-working code # self.axes.plot(list(histogram.values.keys()), list(histogram.gaussian), color="... | 2.515184 | 3 |
src/cpg_scpi/test/__init__.py | GeorgBraun/cpg_scpi_python | 0 | 5497 | '''Functional tests for CPG'''
from .. import CircuitPlayground
from .. import __version__ as CircuitPlaygroundVersion
import time
def funcTest(timestamps: bool = False) -> None:
cpg = CircuitPlayground()
if timestamps:
_printFuncTestHeadingWithDeliLine(f'cpg_scpi v{CircuitPlaygroundVersion}\nRUNNING... | '''Functional tests for CPG'''
from .. import CircuitPlayground
from .. import __version__ as CircuitPlaygroundVersion
import time
def funcTest(timestamps: bool = False) -> None:
cpg = CircuitPlayground()
if timestamps:
_printFuncTestHeadingWithDeliLine(f'cpg_scpi v{CircuitPlaygroundVersion}\nRUNNING... | en | 0.81975 | Functional tests for CPG # test_led(cpg) # test_buttonAny(cpg, timestamps) # test_switch(cpg, timestamps) Flash LEDs and run a short chasing light. # print('| val | LEDs |') # print(f'| {value:4} | {value:010b} |') # shift 1 bit to the left # shift 1 bit to the right # print(f'| {value:4} | {value:010b} |') Flas... | 2.596991 | 3 |
main/models.py | yejun1060/SbjctSclctn | 0 | 5498 | from django.db import models
class Account(models.Model):
clsNb = models.IntegerField()
Name = models.CharField(max_length=10)
pw = models.IntegerField()
def __str__(self):
return self.Name | from django.db import models
class Account(models.Model):
clsNb = models.IntegerField()
Name = models.CharField(max_length=10)
pw = models.IntegerField()
def __str__(self):
return self.Name | none | 1 | 2.419242 | 2 | |
test/utils/test_geodesic.py | shrey-bansal/pytorch_geometric | 2 | 5499 | from math import sqrt
import torch
from torch_geometric.utils import geodesic_distance
def test_geodesic_distance():
pos = torch.Tensor([[0, 0, 0], [2, 0, 0], [0, 2, 0], [2, 2, 0]])
face = torch.tensor([[0, 1, 3], [0, 2, 3]]).t()
out = geodesic_distance(pos, face)
expected = [
[0, 1, 1, sqrt... | from math import sqrt
import torch
from torch_geometric.utils import geodesic_distance
def test_geodesic_distance():
pos = torch.Tensor([[0, 0, 0], [2, 0, 0], [0, 2, 0], [2, 2, 0]])
face = torch.tensor([[0, 1, 3], [0, 2, 3]]).t()
out = geodesic_distance(pos, face)
expected = [
[0, 1, 1, sqrt... | none | 1 | 2.503422 | 3 |