hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7ded778c29259e2a89bf5a9a9ac772ebb515972 | 25,965 | py | Python | samples/client/petstore/python-experimental/petstore_api/models/xml_item.py | malymato/openapi-generator | 47e2c0d027d867de67633bbc9c0a5d7e1054a778 | [
"Apache-2.0"
] | 2 | 2019-12-08T12:00:11.000Z | 2022-01-02T13:47:52.000Z | samples/client/petstore/python-experimental/petstore_api/models/xml_item.py | malymato/openapi-generator | 47e2c0d027d867de67633bbc9c0a5d7e1054a778 | [
"Apache-2.0"
] | 8 | 2021-03-01T21:18:19.000Z | 2022-02-27T07:56:15.000Z | samples/client/petstore/python-experimental/petstore_api/models/xml_item.py | malymato/openapi-generator | 47e2c0d027d867de67633bbc9c0a5d7e1054a778 | [
"Apache-2.0"
] | 1 | 2020-03-08T12:31:09.000Z | 2020-03-08T12:31:09.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 35.135318 | 174 | 0.605507 | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 0 | 12,077 | 0 | 13,050 | 0 | 0 | 0 | 339 | 178 |
9cc0213534d4746545b92434c9c6e16f37a99b1a | 4,745 | py | Python | Grundgeruest/models.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | Grundgeruest/models.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | Grundgeruest/models.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | """
Die Modelle fr Projektweite Daten: Nutzer/Profile
"""
from django.urls import reverse
def knoepfe_kopf(user):
""" gibt Knpfe fr Kopfleiste als Liste von Tupeln zurck """
anmelden = (reverse('userena_signin'), 'Anmelden')
registrieren = (reverse('userena_signup'), 'Registrieren')
abmelden = (rev... | 32.278912 | 100 | 0.616228 | """
Die Modelle für Projektweite Daten: Nutzer/Profile
"""
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
from django.utils.translation import ugettext as _
from userena.models import UserenaBaseProfile
from django.core.validators import RegexValidato... | 48 | 0 | 0 | 2,713 | 0 | 0 | 0 | 158 | 269 |
b3e937dcb8ac9e14cc91bc39a1395544f1f257fb | 8,595 | py | Python | dataset/datasets.py | notplus/FaceLandmark_PFLD_UltraLight | 89aa36d5369f7d8d6661eb67d8490c774ea4685a | [
"Apache-2.0"
] | 38 | 2021-05-10T01:22:44.000Z | 2022-03-30T06:54:39.000Z | dataset/datasets.py | notplus/FaceLandmark_PFLD_UltraLight | 89aa36d5369f7d8d6661eb67d8490c774ea4685a | [
"Apache-2.0"
] | 7 | 2021-06-01T06:39:47.000Z | 2022-03-16T05:43:50.000Z | dataset/datasets.py | notplus/FaceLandmark_PFLD_UltraLight | 89aa36d5369f7d8d6661eb67d8490c774ea4685a | [
"Apache-2.0"
] | 14 | 2021-05-10T01:22:46.000Z | 2022-03-30T06:54:42.000Z | import sys
sys.path.append('..')
from torch.utils.data import DataLoader
if __name__ == '__main__':
file_list = './data/test_data/list.txt'
wlfwdataset = WLFWDatasets(file_list)
dataloader = DataLoader(wlfwdataset, batch_size=256, shuffle=True, num_workers=0, drop_last=False)
for img, lan... | 33.705882 | 166 | 0.601745 | import numpy as np
import cv2
import sys
import torch
sys.path.append('..')
from torch.utils import data
from torch.utils.data import DataLoader
def flip(img, annotation):
# parse
img = np.fliplr(img).copy()
h, w = img.shape[:2]
x_min, y_min, x_max, y_max = annotation[0:4]
landmark_x = annotati... | 0 | 0 | 0 | 1,868 | 0 | 5,836 | 0 | -16 | 365 |
30737425867bb55a2af14436ac1b6d6839ca34e3 | 16,368 | py | Python | modules/exploit/use/petitpotam.py | astar-security/MaeGeri | b28b37fe1cb8c4f650b8a4c9019636c540262fda | [
"Apache-2.0"
] | null | null | null | modules/exploit/use/petitpotam.py | astar-security/MaeGeri | b28b37fe1cb8c4f650b8a4c9019636c540262fda | [
"Apache-2.0"
] | null | null | null | modules/exploit/use/petitpotam.py | astar-security/MaeGeri | b28b37fe1cb8c4f650b8a4c9019636c540262fda | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Author: GILLES Lionel aka topotam (@topotam77)
#
# Greetz : grenadine(@Greynardine), skar(@__skar), didakt(@inf0sec1), plissken, pixis(@HackAndDo), shutd0wn(@ _nwodtuhs)
# "Most of" the code stolen from dementor.py from @3xocyte ;)
show_banner = '''
... | 36.454343 | 243 | 0.574047 | #!/usr/bin/env python
#
# Author: GILLES Lionel aka topotam (@topotam77)
#
# Greetz : grenadine(@Greynardine), skar(@__skar), didakt(@inf0sec1), plissken, pixis(@HackAndDo), shutd0wn(@ _nwodtuhs)
# "Most of" the code stolen from dementor.py from @3xocyte ;)
import sys
import argparse
from impacket import system_er... | 0 | 0 | 0 | 9,176 | 0 | 2,669 | 0 | 181 | 1,175 |
2d3ca8371c21a92681fe90abff723c44bebc3c0d | 3,045 | py | Python | game2048/RNN_training.py | fuuuyuuu/2048-api | d96aa0bc7099e8ce7b792ec2b1051a44b4325eec | [
"Apache-2.0"
] | null | null | null | game2048/RNN_training.py | fuuuyuuu/2048-api | d96aa0bc7099e8ce7b792ec2b1051a44b4325eec | [
"Apache-2.0"
] | null | null | null | game2048/RNN_training.py | fuuuyuuu/2048-api | d96aa0bc7099e8ce7b792ec2b1051a44b4325eec | [
"Apache-2.0"
] | null | null | null | import torchvision.transforms as transforms
# torch.manual_seed(1) # reproducible
# Hyper Parameters
EPOCH = 20 # train the training data n times, to save time, we just train 1 epoch
BATCH_SIZE = 6400
TIME_STEP = 4 # rnn time step / image height
INPUT_SIZE = 4 # rnn input size / ima... | 31.71875 | 110 | 0.587521 | import torch
from torch import nn
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from data_loader import data_load
from torch.autograd import Variable
import numpy as np
# torch.manual_seed(1) # reproducible
# Hyper Parameters
EPOCH = 20 # train the training data n times... | 0 | 0 | 0 | 394 | 0 | 2,003 | 0 | 23 | 201 |
ce512afce118edf2c22282a539009707e00c705b | 1,877 | py | Python | apps/iiif/serializers/annotation_list.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 18 | 2017-06-12T09:58:02.000Z | 2021-10-01T11:14:34.000Z | apps/iiif/serializers/annotation_list.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 276 | 2019-04-26T20:13:01.000Z | 2022-03-31T10:26:28.000Z | apps/iiif/serializers/annotation_list.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 7 | 2018-03-13T23:44:26.000Z | 2021-09-15T17:54:55.000Z | # pylint: disable = attribute-defined-outside-init, too-few-public-methods
"""Module for serializing IIIF Annotation Lists"""
from django.contrib.auth import get_user_model
USER = get_user_model()
| 36.096154 | 90 | 0.583378 | # pylint: disable = attribute-defined-outside-init, too-few-public-methods
"""Module for serializing IIIF Annotation Lists"""
import json
from django.core.serializers import serialize
from django.core.serializers.base import SerializerDoesNotExist
from .base import Serializer as JSONSerializer
from django.contrib.auth ... | 0 | 0 | 0 | 1,392 | 0 | 0 | 0 | 109 | 178 |
6ace6f1e7b2b5d4ff7aa95d88b4bbe251e459eca | 575 | py | Python | FOMMS_integrate/stochastic.py | nschieber/FOMMS_integrate | 87456d476ecee45b8a06782da12baa1ce4c08e88 | [
"BSD-3-Clause"
] | null | null | null | FOMMS_integrate/stochastic.py | nschieber/FOMMS_integrate | 87456d476ecee45b8a06782da12baa1ce4c08e88 | [
"BSD-3-Clause"
] | null | null | null | FOMMS_integrate/stochastic.py | nschieber/FOMMS_integrate | 87456d476ecee45b8a06782da12baa1ce4c08e88 | [
"BSD-3-Clause"
] | null | null | null | """
This function implements 1d Monte Carlo integration
"""
import numpy as np
def monte_1d(x, f, trials):
"""
Compute a 1D definite integral
Parameters
----------
f : function
User defined function.
x : numpy array
Integration domain.
trials : integer
Total numb... | 19.166667 | 52 | 0.553043 | """
This function implements 1d Monte Carlo integration
"""
import numpy as np
def monte_1d(x, f, trials):
"""
Compute a 1D definite integral
Parameters
----------
f : function
User defined function.
x : numpy array
Integration domain.
trials : integer
Total numb... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
138fa2e645bcd4f89b72e76fa68172d58825add1 | 3,047 | py | Python | snip/train.py | 3846chs/SNIP | de1771cf4c90edeaa9924ed406293b48ceece7a2 | [
"MIT"
] | null | null | null | snip/train.py | 3846chs/SNIP | de1771cf4c90edeaa9924ed406293b48ceece7a2 | [
"MIT"
] | null | null | null | snip/train.py | 3846chs/SNIP | de1771cf4c90edeaa9924ed406293b48ceece7a2 | [
"MIT"
] | null | null | null | # np.random._bit_generator = np.random.bit_generator
| 45.477612 | 99 | 0.596652 | import os
import tensorflow.compat.v1 as tf
import time
import numpy as np
# np.random._bit_generator = np.random.bit_generator
from augment import augment
def train(args, model, sess, dataset):
print('|========= START TRAINING =========|')
if not os.path.isdir(args.path_summary): os.makedirs(args.path_summa... | 0 | 0 | 0 | 0 | 0 | 2,866 | 0 | -7 | 134 |
0e58e67d4649d5ef878008d9074dacf7645f53e2 | 4,768 | py | Python | m1_resnet.py | VinGPan/Kaggle-HumanProtein | 4d1abcc7f46774355644d30428ed6c73b28fd782 | [
"Apache-2.0"
] | null | null | null | m1_resnet.py | VinGPan/Kaggle-HumanProtein | 4d1abcc7f46774355644d30428ed6c73b28fd782 | [
"Apache-2.0"
] | null | null | null | m1_resnet.py | VinGPan/Kaggle-HumanProtein | 4d1abcc7f46774355644d30428ed6c73b28fd782 | [
"Apache-2.0"
] | null | null | null | from keras_retinanet.bin.train import train_main
import os
if __name__ == '__main__':
os.chdir("../")
model_name = 'resnet101'
train_main(0, None, ["csv", "data/trn1.csv", "data/classes.csv",
"--val-annotations", "data/val1.csv"])
# model_name = 'resnet50'
# h5s = glob.glob(... | 103.652174 | 3,138 | 0.676594 | from keras_retinanet.bin.train import train_main
from keras_retinanet import models
import glob
import numpy as np
from sklearn.metrics import f1_score
import os
if __name__ == '__main__':
os.chdir("../")
model_name = 'resnet101'
train_main(0, None, ["csv", "data/trn1.csv", "data/classes.csv",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 88 |
27d6a355d2304d3fc689d470c15bce5dbf127caf | 5,795 | py | Python | sdk/python/pulumi_aws_native/customerprofiles/_enums.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/customerprofiles/_enums.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/customerprofiles/_enums.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
__all__ = [
'IntegrationConnectorType',
'IntegrationMarketoConnectorOperator',
'IntegrationOperatorPropertiesKeys',
'IntegrationS3Conne... | 30.025907 | 80 | 0.718033 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'IntegrationConnectorType',
'IntegrationMarketoConnectorOperator',
'IntegrationOperatorPropertiesKeys',
... | 0 | 0 | 0 | 4,820 | 0 | 0 | 0 | 0 | 299 |
2d12ec7f50c3d061e4b79a9ffffcc034bd787b1d | 2,104 | py | Python | Dataset/split_data.py | atmacvit/meronymnet | 47e1a7caadc0f770439bb26a93b885f790f62804 | [
"MIT"
] | 1 | 2021-11-02T05:13:12.000Z | 2021-11-02T05:13:12.000Z | Dataset/split_data.py | atmacvit/meronymnet | 47e1a7caadc0f770439bb26a93b885f790f62804 | [
"MIT"
] | 1 | 2021-12-17T14:29:18.000Z | 2021-12-17T14:29:18.000Z | Dataset/split_data.py | atmacvit/meronymnet | 47e1a7caadc0f770439bb26a93b885f790f62804 | [
"MIT"
] | null | null | null | import pickle
objects = ['cow', 'dog', 'person', 'horse', 'sheep', 'aeroplane', 'bird', 'bicycle', 'cat', 'motorbike', 'car']
for object_name in objects:
with open(object_name + '_part_separated_labels', 'rb') as f:
label = pickle.load(f)
with open(object_name + '_part_separated_bbx', 'rb') as f:
... | 41.254902 | 112 | 0.661122 | import numpy as np
import pickle
objects = ['cow', 'dog', 'person', 'horse', 'sheep', 'aeroplane', 'bird', 'bicycle', 'cat', 'motorbike', 'car']
for object_name in objects:
with open(object_name + '_part_separated_labels', 'rb') as f:
label = pickle.load(f)
with open(object_name + '_part_separated_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
ae765890a283e1cafc55cfc222fa3eddff1f2a46 | 2,302 | py | Python | neutron/extensions/providernet.py | MultipleCrashes/neutron | fb268d7e91b22192a6e42f78b0057b4ebd3033ef | [
"Apache-2.0"
] | 1 | 2019-06-02T06:15:39.000Z | 2019-06-02T06:15:39.000Z | neutron/extensions/providernet.py | MultipleCrashes/neutron | fb268d7e91b22192a6e42f78b0057b4ebd3033ef | [
"Apache-2.0"
] | null | null | null | neutron/extensions/providernet.py | MultipleCrashes/neutron | fb268d7e91b22192a6e42f78b0057b4ebd3033ef | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation.
# 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... | 32.885714 | 78 | 0.728931 | # Copyright (c) 2012 OpenStack Foundation.
# 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... | 0 | 220 | 0 | 787 | 0 | 0 | 0 | 17 | 45 |
8d7f3685a45adea2ebce073ffebe24607e61fa6d | 3,181 | py | Python | tests/test_consumer_api.py | tysongg/essential-cosmic | 1bd21b4ed246dfda983c6e49b0967a4a1a289d63 | [
"MIT"
] | null | null | null | tests/test_consumer_api.py | tysongg/essential-cosmic | 1bd21b4ed246dfda983c6e49b0967a4a1a289d63 | [
"MIT"
] | 9 | 2020-01-27T02:08:04.000Z | 2020-01-27T02:46:53.000Z | tests/test_consumer_api.py | tysongg/essential-cosmic | 1bd21b4ed246dfda983c6e49b0967a4a1a289d63 | [
"MIT"
] | null | null | null | import os
import sys
# Workaround so we don't have to create a setup.py file for the project and
# install an editable version
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
| 31.186275 | 85 | 0.607042 | import pytest
import asyncio
import os
import sys
# Workaround so we don't have to create a setup.py file for the project and
# install an editable version
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
from essential_cosmic.app import make_app
class TestConsumer:
@pytest.fixture(scope="fun... | 0 | 690 | 1,905 | -2 | 0 | 0 | 0 | 5 | 386 |
d04c8eff07c31a44f0aef8503a211c69268b39fd | 8,889 | py | Python | nuke_stubs/nukescripts/precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | 1 | 2022-01-12T01:29:16.000Z | 2022-01-12T01:29:16.000Z | nuke_stubs/nukescripts/precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | nuke_stubs/nukescripts/precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | # Copyright (c) 2009 The Foundry Visionmongers Ltd. All Rights Reserved.
| 28.399361 | 167 | 0.623242 | # Copyright (c) 2009 The Foundry Visionmongers Ltd. All Rights Reserved.
import nuke
import os, re, sys, math, time
from nukescripts import execute_panel
from nukescripts import panels
class PrecompOptionsDialog( panels.PythonPanel ):
def __init__( self ):
panels.PythonPanel.__init__( self, "Precomp Nodes", "uk... | 0 | 0 | 0 | 2,282 | 0 | 6,260 | 0 | 24 | 249 |
71db7646b48f42a2dbbfeaf06ad12d63c39123bf | 72,149 | py | Python | MonteCarloMarginalizeCode/Code/RIFT/misc/dag_utils.py | spfanning/research-projects-RIT | 34afc69ccb502825c81285733dac8ff993f79503 | [
"MIT"
] | 8 | 2019-10-23T01:18:44.000Z | 2021-07-09T18:24:36.000Z | MonteCarloMarginalizeCode/Code/RIFT/misc/dag_utils.py | spfanning/research-projects-RIT | 34afc69ccb502825c81285733dac8ff993f79503 | [
"MIT"
] | 7 | 2020-01-03T14:38:26.000Z | 2022-01-17T16:57:02.000Z | MonteCarloMarginalizeCode/Code/RIFT/misc/dag_utils.py | spfanning/research-projects-RIT | 34afc69ccb502825c81285733dac8ff993f79503 | [
"MIT"
] | 11 | 2019-10-23T01:19:50.000Z | 2021-11-20T23:35:39.000Z | # Copyright (C) 2013 Evan Ochsner
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in ... | 40.149694 | 465 | 0.665526 | # Copyright (C) 2013 Evan Ochsner
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in ... | 0 | 0 | 0 | 0 | 0 | 423 | 0 | 0 | 68 |
175a3b4d2739554618c982905727d9731a509a3f | 934 | py | Python | boot.py | Ca11MeE/easy_frame | c3ec3069e3f61d1c01e5bd7ebbdf28e953a8ffa8 | [
"Apache-2.0"
] | null | null | null | boot.py | Ca11MeE/easy_frame | c3ec3069e3f61d1c01e5bd7ebbdf28e953a8ffa8 | [
"Apache-2.0"
] | null | null | null | boot.py | Ca11MeE/easy_frame | c3ec3069e3f61d1c01e5bd7ebbdf28e953a8ffa8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from flask import Flask
import mysql
from mysql import Pool
import properties
# WEB(jsonascii)
app=Flask(__name__)
app.config['JSON_AS_ASCII'] = False
#
# dir_path,routes,'/routes'
print('')
mysql.pool = Pool.Pool()
# print('')
print('')
for path in properties.blueprint_path:
map_apps(path)
| 22.780488 | 96 | 0.639186 | # coding: utf-8
from flask import Flask
import mysql,os,re
from mysql import Pool
import properties
# 定义WEB容器(同时防止json以ascii解码返回)
app=Flask(__name__)
app.config['JSON_AS_ASCII'] = False
# 处理各模块中的自动注入以及组装各蓝图
# dir_path中为蓝图模块路径,例如需要引入的蓝图都在routes文件夹中,则传入参数'/routes'
def map_apps(dir_path):
path=os.getcwd()+dir_path
... | 258 | 0 | 0 | 0 | 0 | 479 | 0 | 6 | 45 |
84eea4a37f53204b935d3f1eece7e1963b816b5c | 1,893 | py | Python | setup.py | bastian-src/SysMonTask | 95868e230efa130e820f91893a3c8d5664632ac4 | [
"BSD-3-Clause"
] | 1 | 2021-05-20T09:31:26.000Z | 2021-05-20T09:31:26.000Z | setup.py | bastian-src/SysMonTask | 95868e230efa130e820f91893a3c8d5664632ac4 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bastian-src/SysMonTask | 95868e230efa130e820f91893a3c8d5664632ac4 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
import os
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='sysmontask',
version='1.3.9',
description='System Monitor With UI Like Windows',
url='https://github.com/KrispyCamel4u/SysMonTask',
author='Neeraj Kumar',
auth... | 39.4375 | 159 | 0.692552 | from setuptools import setup, find_packages
import os
with open("README.md", "r") as fh:
long_description = fh.read()
def get_data_files():
data_files = [('/usr/share/sysmontask/glade_files', ['glade_files/disk.glade','glade_files/diskSidepane.glade','glade_files/gpu.glade',
'glade_files/gpuSidepane.glade... | 0 | 0 | 0 | 0 | 0 | 603 | 0 | 0 | 23 |
210a678a3c714cdead1544323597dcdb1cff8f70 | 323 | py | Python | day8/d8p2.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | 2 | 2021-12-22T07:43:14.000Z | 2021-12-24T12:07:33.000Z | day8/d8p2.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | null | null | null | day8/d8p2.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | 1 | 2021-12-22T07:43:26.000Z | 2021-12-22T07:43:26.000Z |
result = non_start('Hello', 'There')
print(result)
result = non_start('java', 'code')
print(result)
result = non_start('shotl', '')
print(result) | 24.846154 | 54 | 0.616099 | def non_start(str1, str2):
if len(str1) >= 1 and len(str2) >= 1:
newstr = str1[1:len(str1)] + str2[1:len(str2)]
return newstr
else:
return False
result = non_start('Hello', 'There')
print(result)
result = non_start('java', 'code')
print(result)
result = non_start('shotl', '')
print(resu... | 0 | 0 | 0 | 0 | 0 | 155 | 0 | 0 | 22 |
a1b5ff50c9c782fea188c9b6fb9e25d0a0c8232c | 705 | py | Python | port.py | hawk-0fcx/port | 223024c4ca7b95c34182b74d8116280f9371fc53 | [
"Apache-2.0"
] | 1 | 2022-03-12T11:33:16.000Z | 2022-03-12T11:33:16.000Z | port.py | hawk-unity/port | 223024c4ca7b95c34182b74d8116280f9371fc53 | [
"Apache-2.0"
] | null | null | null | port.py | hawk-unity/port | 223024c4ca7b95c34182b74d8116280f9371fc53 | [
"Apache-2.0"
] | null | null | null | import socket
import os
os.system("clear")
from colorama import Fore
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(5)
print("""
_ _
| |__ __ ___ _| | __ _
| '_ \ / _` \ \ /\ / / |/ /| |_
| | | | (_| |\ V V /| <_ _|
|_| |_|\__,_| \_/\_/ |_... | 26.111111 | 68 | 0.537589 | import socket
import os
os.system("clear")
import colorama
from colorama import Fore, Back, Style, init
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(5)
print("""
_ _
| |__ __ ___ _| | __ _
| '_ \ / _` \ \ /\ / / |/ /| |_
| | | | (_| |\ V V /| ... | 26 | 0 | 0 | 0 | 0 | 133 | 0 | 13 | 45 |
09bff90f642cffe4743a7a3613eb947ba5cade52 | 156 | py | Python | _solved/solutions/01-introduction-geospatial-data19.py | lleondia/geopandas-tutorial | 5128fd6865bbd979a7b4e5b8cb4d0de51bead029 | [
"BSD-3-Clause"
] | 341 | 2018-04-26T08:46:05.000Z | 2022-03-01T08:13:39.000Z | _solved/solutions/01-introduction-geospatial-data19.py | lleondia/geopandas-tutorial | 5128fd6865bbd979a7b4e5b8cb4d0de51bead029 | [
"BSD-3-Clause"
] | 24 | 2020-09-30T19:57:14.000Z | 2021-10-05T07:21:09.000Z | _solved/solutions/01-introduction-geospatial-data19.py | lleondia/geopandas-tutorial | 5128fd6865bbd979a7b4e5b8cb4d0de51bead029 | [
"BSD-3-Clause"
] | 128 | 2018-05-07T07:30:29.000Z | 2022-02-19T17:53:39.000Z | # As comparison, the misleading plot when not turning the population number into a density
districts.plot(column='population', figsize=(12, 6), legend=True) | 78 | 90 | 0.788462 | # As comparison, the misleading plot when not turning the population number into a density
districts.plot(column='population', figsize=(12, 6), legend=True) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
15c549b448318131afb3c0205f8085e21f227080 | 9,494 | py | Python | update_headers.py | simoncozens/pysilfont | bb8a9fc58a83e074bbcc466ba058841845b9107e | [
"MIT"
] | 41 | 2015-05-21T21:12:26.000Z | 2022-02-17T17:23:14.000Z | update_headers.py | simoncozens/pysilfont | bb8a9fc58a83e074bbcc466ba058841845b9107e | [
"MIT"
] | 63 | 2015-05-15T10:25:55.000Z | 2021-02-23T04:51:17.000Z | update_headers.py | simoncozens/pysilfont | bb8a9fc58a83e074bbcc466ba058841845b9107e | [
"MIT"
] | 12 | 2015-06-12T11:52:08.000Z | 2020-09-23T10:40:59.000Z | #!/usr/bin/env python
'Checks for standard headers and update version and copyright info in python files'
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2016 SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
__auth... | 48.192893 | 123 | 0.425637 | #!/usr/bin/env python
'Checks for standard headers and update version and copyright info in python files'
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2016 SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
__auth... | 0 | 0 | 0 | 0 | 0 | 8,728 | 0 | -8 | 68 |
83d2715a3c28310e7a615f390760361ca9c50fc6 | 1,976 | py | Python | rapidtest/executors/__init__.py | yehzhang/RapidTest | 2302fc10ddafba1d16ef1d7448d46c66f5a05da2 | [
"MIT"
] | null | null | null | rapidtest/executors/__init__.py | yehzhang/RapidTest | 2302fc10ddafba1d16ef1d7448d46c66f5a05da2 | [
"MIT"
] | null | null | null | rapidtest/executors/__init__.py | yehzhang/RapidTest | 2302fc10ddafba1d16ef1d7448d46c66f5a05da2 | [
"MIT"
] | null | null | null | import atexit
import logging
logger = logging.getLogger(__name__)
atexit.register(_close_executors)
del _close_executors
| 30.875 | 97 | 0.674089 | import atexit
import logging
from inspect import isclass
from .common_executors import BaseExecutor
from .externel_executors import ExternalExecutorFabric
from .java import *
from .operations import Operation, Operations
from .python import *
from ..utils import isstring
logger = logging.getLogger(__name__)
class B... | 0 | 259 | 0 | 1,256 | 0 | 21 | 0 | 89 | 224 |
5855a718f19fd271a7d90653c654f8cb39f399af | 83 | py | Python | src/polls/forLoop5.py | Prince-linux/python-learning | 75335ed497081b557400a05320b52b8889c3e1f4 | [
"MIT"
] | 1 | 2015-08-27T13:03:27.000Z | 2015-08-27T13:03:27.000Z | src/polls/forLoop5.py | Prince-linux/python-learning | 75335ed497081b557400a05320b52b8889c3e1f4 | [
"MIT"
] | 22 | 2015-08-23T18:17:30.000Z | 2015-09-16T13:38:36.000Z | src/polls/forLoop5.py | Prince-linux/python-learning | 75335ed497081b557400a05320b52b8889c3e1f4 | [
"MIT"
] | null | null | null | for i in range(201, 0, -2):
print(i)
for i in range(100, 0, -1):
print(i)
| 13.833333 | 27 | 0.53012 | for i in range(201, 0, -2):
print(i)
for i in range(100, 0, -1):
print(i)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ca4f6f3248cffb86968c72e3aaf6cc6ec45f47c6 | 430 | py | Python | Vars & Data Entry/exercicio 3.py | SkaarlK/Learning-Python | bbf011182fb5bf876aa9a274400c41a266a0e8c7 | [
"MIT"
] | 2 | 2022-01-01T19:31:56.000Z | 2022-01-01T19:32:54.000Z | Vars & Data Entry/exercicio 3.py | SkaarlK/Learning-Python | bbf011182fb5bf876aa9a274400c41a266a0e8c7 | [
"MIT"
] | null | null | null | Vars & Data Entry/exercicio 3.py | SkaarlK/Learning-Python | bbf011182fb5bf876aa9a274400c41a266a0e8c7 | [
"MIT"
] | null | null | null | dias = int(input("Insira os dias para virarem segundos: "))
horas = int(input("Insira as horas para virarem segundos: "))
minutos = int(input("Insira os minutos para virarem segundos: "))
segundos = int(input("Insira os segundos para serem somados aos anteriores: "))
segundos += (dias * 86400) + (horas * 3600) + (minut... | 71.666667 | 101 | 0.711628 | dias = int(input("Insira os dias para virarem segundos: "))
horas = int(input("Insira as horas para virarem segundos: "))
minutos = int(input("Insira os minutos para virarem segundos: "))
segundos = int(input("Insira os segundos para serem somados aos anteriores: "))
segundos += (dias * 86400) + (horas * 3600) + (minut... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c06c9c6d5402fedf403bcb579088899fc6cd9baf | 748 | py | Python | motivate_gui.py | neesara/motivate | 36cfb2a3502d48b99189841f35b9693e40dd8532 | [
"MIT"
] | null | null | null | motivate_gui.py | neesara/motivate | 36cfb2a3502d48b99189841f35b9693e40dd8532 | [
"MIT"
] | null | null | null | motivate_gui.py | neesara/motivate | 36cfb2a3502d48b99189841f35b9693e40dd8532 | [
"MIT"
] | null | null | null | import tkinter as tk
import os
import random
import datetime
root = tk.Tk()
root.title("Motivation")
root.configure(background='white')
command=os.getcwd()+'/motivate/motivate.py'
quote=os.popen(command).read()
color=random.choice(['green','blue','purple','red','orange','brown','magenta','violet','maroon','olive','lim... | 39.368421 | 165 | 0.71123 | import tkinter as tk
import os
import random
import datetime
root = tk.Tk()
root.title("Motivation")
root.configure(background='white')
command=os.getcwd()+'/motivate/motivate.py'
quote=os.popen(command).read()
color=random.choice(['green','blue','purple','red','orange','brown','magenta','violet','maroon','olive','lim... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
57bdb73e1704842d0766817fd5391f99486fe936 | 2,062 | py | Python | tests/test_normalization.py | learniotai/iotai-sensor-classifications | ba2527cb317afa30a5c495d1cddc16f7dc2936ed | [
"Apache-2.0"
] | null | null | null | tests/test_normalization.py | learniotai/iotai-sensor-classifications | ba2527cb317afa30a5c495d1cddc16f7dc2936ed | [
"Apache-2.0"
] | null | null | null | tests/test_normalization.py | learniotai/iotai-sensor-classifications | ba2527cb317afa30a5c495d1cddc16f7dc2936ed | [
"Apache-2.0"
] | null | null | null | """Test normalizing gesture recording data."""
SAMPLES_PER_RECORDING = 160
| 54.263158 | 113 | 0.727934 | """Test normalizing gesture recording data."""
import os
import numpy as np
from iotai_sensor_classification.recording import read_recordings
from iotai_sensor_classification.normalization import normalize_mean_std_dict
from data.gestures import linear_accelerometer
from iotai_sensor_classification.plot_util import co... | 0 | 0 | 0 | 0 | 0 | 1,621 | 0 | 207 | 156 |
fb9c84f69582b895624fd919a820ac62d428a59c | 4,791 | py | Python | examples/book_view/benchmark.py | toluaina/essync | 4a0119d99760eaa193f4ae60abd2b5f38482b280 | [
"BSD-3-Clause"
] | 1 | 2019-09-26T21:05:37.000Z | 2019-09-26T21:05:37.000Z | examples/book_view/benchmark.py | toluaina/essync | 4a0119d99760eaa193f4ae60abd2b5f38482b280 | [
"BSD-3-Clause"
] | null | null | null | examples/book_view/benchmark.py | toluaina/essync | 4a0119d99760eaa193f4ae60abd2b5f38482b280 | [
"BSD-3-Clause"
] | 1 | 2019-08-27T16:19:09.000Z | 2019-08-27T16:19:09.000Z |
FIELDS = {
"isbn": "isbn13",
"title": "sentence",
"description": "text",
"copyright": "word",
}
if __name__ == "__main__":
main()
| 29.757764 | 77 | 0.529743 | import json
from random import choice
from typing import Set
import click
import sqlalchemy as sa
from faker import Faker
from schema import Book
from sqlalchemy.orm import sessionmaker
from pgsync.base import pg_engine
from pgsync.constants import DELETE, INSERT, TG_OP, TRUNCATE, UPDATE
from pgsync.utils import get_... | 0 | 1,070 | 0 | 0 | 0 | 3,123 | 0 | 105 | 336 |
b388ad646acdaff30e3ae11dca9c423ac5dc3c80 | 794 | py | Python | resources/ArchivesSpace post-migration scripts/TitleCapitalization.py | smith-special-collections/aspace-migration | 0ad6f1346df52e12739f27b54570586af4362559 | [
"MIT"
] | 2 | 2016-09-14T12:31:40.000Z | 2018-05-25T02:45:37.000Z | resources/ArchivesSpace post-migration scripts/TitleCapitalization.py | smith-special-collections/aspace-migration | 0ad6f1346df52e12739f27b54570586af4362559 | [
"MIT"
] | 1 | 2017-04-13T16:24:59.000Z | 2017-04-18T19:30:08.000Z | resources/ArchivesSpace post-migration scripts/TitleCapitalization.py | smith-special-collections/aspace-migration | 0ad6f1346df52e12739f27b54570586af4362559 | [
"MIT"
] | null | null | null | import requests
import json
aspace_url = 'http://localhost:8089'
username = 'admin'
password = 'admin'
repo_num = '2'
auth = requests.post(aspace_url+'/users/'+username+'/login?password='+password).json()
session = auth["session"]
headers = {'X-ArchivesSpace-Session':session}
for d in range(1,6):
resource_json = re... | 37.809524 | 133 | 0.730479 | import requests
import json
aspace_url = 'http://localhost:8089'
username = 'admin'
password = 'admin'
repo_num = '2'
auth = requests.post(aspace_url+'/users/'+username+'/login?password='+password).json()
session = auth["session"]
headers = {'X-ArchivesSpace-Session':session}
for d in range(1,6):
resource_json = re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2abcfcc2281955e4ae7cbe49ec5370d4ae3c495c | 540 | py | Python | Node.py | akshaykamath/Bayes-Network-Inference-Algorithms | 3a0867130dd74bf2444a7ce4f972fff6b1a989dc | [
"MIT"
] | null | null | null | Node.py | akshaykamath/Bayes-Network-Inference-Algorithms | 3a0867130dd74bf2444a7ce4f972fff6b1a989dc | [
"MIT"
] | null | null | null | Node.py | akshaykamath/Bayes-Network-Inference-Algorithms | 3a0867130dd74bf2444a7ce4f972fff6b1a989dc | [
"MIT"
] | null | null | null | __author__ = 'Akshay'
| 21.6 | 48 | 0.625926 | __author__ = 'Akshay'
class Node:
initial_time = 0
finish_time = 0
name = None
child_nodes = None
parent_nodes = None
conditional_probability_table = {}
def __init__(self, nm):
self.name = nm
self.parent_distance = 0
self.child_nodes = []
self.parent_nodes ... | 0 | 0 | 0 | 493 | 0 | 0 | 0 | 0 | 23 |
90d1a8e84d85bc7f4e6d8664cd0c5d4332376007 | 38,126 | py | Python | conpaas-services/src/conpaas/services/xtreemfs/manager/manager.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 1 | 2015-09-20T18:20:01.000Z | 2015-09-20T18:20:01.000Z | conpaas-services/src/conpaas/services/xtreemfs/manager/manager.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 1 | 2020-07-27T11:56:18.000Z | 2020-07-27T11:56:18.000Z | conpaas-services/src/conpaas/services/xtreemfs/manager/manager.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 3 | 2018-09-14T16:54:14.000Z | 2020-07-26T03:14:56.000Z | # -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
| 38.864424 | 138 | 0.577087 | # -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
from conpaas.core.expose import expose
from conpaas.core.manager import BaseManager
from conpaas.core.manager import ManagerException
from conpaas.core.https.server import HttpJsonResponse, HttpErrorR... | 0 | 20,025 | 0 | 17,521 | 0 | 109 | 0 | 134 | 250 |
a3c424cf728d4c2ef3a50ff9cfcd26a82c1360fa | 505 | py | Python | Python/delete_empty_folders/script.py | Ian-Yy/code-n-stitch | 20fc8784bf51bd3e36329d1ca44b0be6dc66fae6 | [
"MIT"
] | 50 | 2020-09-19T16:40:21.000Z | 2022-02-05T05:48:42.000Z | Python/delete_empty_folders/script.py | Ian-Yy/code-n-stitch | 20fc8784bf51bd3e36329d1ca44b0be6dc66fae6 | [
"MIT"
] | 266 | 2020-09-25T17:24:04.000Z | 2021-11-29T07:17:57.000Z | Python/delete_empty_folders/script.py | Ian-Yy/code-n-stitch | 20fc8784bf51bd3e36329d1ca44b0be6dc66fae6 | [
"MIT"
] | 113 | 2020-09-26T10:28:11.000Z | 2021-10-15T06:58:53.000Z | import os
import sys
# enter path to the directory with the files
x = input('Absolute path of folder, from which empty subfolders are to be removed: ')
# check if path is valid
if not os.path.exists(x):
print('Invalid path\nTerminating program')
sys.exit()
# cleanup of empty subfolders
walk = list(os.walk('/home/n... | 26.578947 | 85 | 0.720792 | import os
import sys
# enter path to the directory with the files
x = input('Absolute path of folder, from which empty subfolders are to be removed: ')
# check if path is valid
if not os.path.exists(x):
print('Invalid path\nTerminating program')
sys.exit()
# cleanup of empty subfolders
walk = list(os.walk('/home/n... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a5858e6445232a1bc20db7f822c0cac94845b29 | 21,764 | py | Python | test/unit/test_file_copy.py | networktocode/pynxos | 6ee22d52e5a0f0ae2e6b96b0c1ce158c30eb75e9 | [
"Apache-2.0"
] | 14 | 2016-04-17T19:03:15.000Z | 2021-04-06T13:04:23.000Z | test/unit/test_file_copy.py | networktocode/pynxos | 6ee22d52e5a0f0ae2e6b96b0c1ce158c30eb75e9 | [
"Apache-2.0"
] | 8 | 2016-02-02T23:44:12.000Z | 2019-02-15T20:20:20.000Z | test/unit/test_file_copy.py | networktocode/pynxos | 6ee22d52e5a0f0ae2e6b96b0c1ce158c30eb75e9 | [
"Apache-2.0"
] | 17 | 2016-04-17T19:03:17.000Z | 2021-04-05T09:55:43.000Z | import unittest
if __name__ == "__main__":
unittest.main() | 91.445378 | 3,856 | 0.66826 | import unittest
import mock
from tempfile import NamedTemporaryFile
from pynxos.features.file_copy import FileCopy, FileTransferError
class FileCopyTestCase(unittest.TestCase):
@mock.patch('pynxos.device.Device', autospec=True)
def setUp(self, mock_device):
self.device = mock_device
self.devi... | 0 | 16,132 | 0 | 5,426 | 0 | 0 | 0 | 52 | 90 |
1ba7e9d00ac9ddde32d332f71e982fac582852a8 | 1,154 | py | Python | lcd-numbers/pylint/checkers/__init__.py | kelesi/coedcop | 2bdbac207cf6f81de70b92c644c40663bbea8c8a | [
"MIT"
] | 1 | 2017-12-08T15:55:17.000Z | 2017-12-08T15:55:17.000Z | lcd-numbers/pylint/checkers/__init__.py | kelesi/coedcop | 2bdbac207cf6f81de70b92c644c40663bbea8c8a | [
"MIT"
] | null | null | null | lcd-numbers/pylint/checkers/__init__.py | kelesi/coedcop | 2bdbac207cf6f81de70b92c644c40663bbea8c8a | [
"MIT"
] | null | null | null | """Jeff Bay's Object Calisthenics Rules."""
# 1. One level of indentation per method
# * Pylint's "checkers.refactoring", max-nested-blocks=1
# * Pylint's "checkers.design_analysis", max-branches=1
# * DONE
# 2. Don't use the ELSE keyword
import checkers.no_else
# * also Pylint's "checkers.refactoring", max-nested-bl... | 26.837209 | 89 | 0.738302 | """Jeff Bay's Object Calisthenics Rules."""
# 1. One level of indentation per method
# * Pylint's "checkers.refactoring", max-nested-blocks=1
# * Pylint's "checkers.design_analysis", max-branches=1
# * DONE
# 2. Don't use the ELSE keyword
import checkers.no_else
# * also Pylint's "checkers.refactoring", max-nested-bl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 22 |
0892a02aefb143a24befa8f3ebf7c11b8155f8f2 | 1,794 | py | Python | args.py | stevievb/sagemaker-labeljob-scoreboard | 038456cd2d83ba4bf365ecb305bf443cdc1aa404 | [
"Apache-2.0"
] | null | null | null | args.py | stevievb/sagemaker-labeljob-scoreboard | 038456cd2d83ba4bf365ecb305bf443cdc1aa404 | [
"Apache-2.0"
] | null | null | null | args.py | stevievb/sagemaker-labeljob-scoreboard | 038456cd2d83ba4bf365ecb305bf443cdc1aa404 | [
"Apache-2.0"
] | null | null | null | # 2020 Amgen 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 agree... | 32.618182 | 105 | 0.672241 | # © 2020 Amgen 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 agre... | 2 | 0 | 0 | 0 | 0 | 1,062 | 0 | 0 | 23 |
ae7b9a5ad2f42b1085d8218767395ee08e327173 | 5,994 | py | Python | gui.py | kratantjain/SQLiVS | 6b91cc454742c753ef002ac52c01ddf09bdcf8ed | [
"MIT"
] | null | null | null | gui.py | kratantjain/SQLiVS | 6b91cc454742c753ef002ac52c01ddf09bdcf8ed | [
"MIT"
] | null | null | null | gui.py | kratantjain/SQLiVS | 6b91cc454742c753ef002ac52c01ddf09bdcf8ed | [
"MIT"
] | 1 | 2018-10-28T17:47:24.000Z | 2018-10-28T17:47:24.000Z |
Home()
| 41.625 | 127 | 0.656823 | from Tkinter import *
from tkMessageBox import *
from tkFileDialog import *
from SQLinjector import *
import time
import websitedata
def checkvuln(wsite,name):
inject=[]
global result
for x in name:
sqlinject=x
inject.append(wsite.replace("FUZZ",sqlinject))
showinfo('Wait'," Checking we... | 0 | 0 | 0 | 0 | 0 | 5,646 | 0 | 1 | 331 |
1f013a9bb78006e16890563e1f2078779f4852ab | 3,131 | py | Python | src/pybind/matrix/kaldi_matrix_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | src/pybind/matrix/kaldi_matrix_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | src/pybind/matrix/kaldi_matrix_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2019 Mobvoi AI Lab, Beijing, China (author: Fangjun Kuang)
# Apache 2.0
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
import unittest
if __name__ == '__main__':
unittest.main()
| 29.537736 | 71 | 0.545513 | #!/usr/bin/env python3
# Copyright 2019 Mobvoi AI Lab, Beijing, China (author: Fangjun Kuang)
# Apache 2.0
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
import unittest
import numpy as np
import kaldi
class TestFloatSubMatrix(unittest.TestCase):
def test_from_nu... | 0 | 0 | 0 | 2,758 | 0 | 0 | 0 | -12 | 115 |
17e2ec4a244bb94a85b8daab658bef83ab4ca1af | 1,982 | py | Python | src/controllers/supporting_lists/controller.py | MaxVanHoucke/esp-uantwerp | 6f2129d60954b198f233e75956a4f5c675a03cbc | [
"MIT"
] | null | null | null | src/controllers/supporting_lists/controller.py | MaxVanHoucke/esp-uantwerp | 6f2129d60954b198f233e75956a4f5c675a03cbc | [
"MIT"
] | null | null | null | src/controllers/supporting_lists/controller.py | MaxVanHoucke/esp-uantwerp | 6f2129d60954b198f233e75956a4f5c675a03cbc | [
"MIT"
] | null | null | null | from flask import Blueprint
bp = Blueprint('manage_lists', __name__)
| 33.033333 | 89 | 0.701816 | from flask import Blueprint, request, render_template, jsonify
from flask_login import current_user
from src.controllers.supporting_lists.manage_lists import manage, update_item
from src.models.type import TypeDataAccess
from src.models.tag import TagDataAccess
from src.models.research_group import *
from src.models.st... | 0 | 1,462 | 0 | 0 | 0 | 0 | 0 | 202 | 245 |
5e309a053528b67904d5d5112db0bd96f00b89b5 | 1,204 | py | Python | makerbean/PDFBot.py | AndersonBY/python-makerbean | c7713a019217e7f2eb42010af8f4f6c8a15fa910 | [
"MIT"
] | 8 | 2020-12-28T12:49:50.000Z | 2021-04-12T13:49:19.000Z | makerbean/PDFBot.py | AndersonBY/python-makerbean | c7713a019217e7f2eb42010af8f4f6c8a15fa910 | [
"MIT"
] | null | null | null | makerbean/PDFBot.py | AndersonBY/python-makerbean | c7713a019217e7f2eb42010af8f4f6c8a15fa910 | [
"MIT"
] | 4 | 2021-01-12T07:48:11.000Z | 2021-04-12T13:49:21.000Z | # -*- coding: utf-8 -*-
# @Author: ander
# @Date: 2020-12-22 16:19:51
# @Last Modified by: ander
# @Last Modified time: 2020-12-22 16:25:49
| 30.1 | 85 | 0.649502 | # -*- coding: utf-8 -*-
# @Author: ander
# @Date: 2020-12-22 16:19:51
# @Last Modified by: ander
# @Last Modified time: 2020-12-22 16:25:49
import pdfplumber
from PyPDF2 import PdfFileReader, PdfFileWriter, PdfFileMerger
import os.path
from .utilities import mkdir
class PDFBot(object):
"""docstring for ExcelB... | 0 | 0 | 0 | 911 | 0 | 0 | 0 | 37 | 111 |
7d8042e0a0e082248ae3fb8d16b1773619abf452 | 3,510 | py | Python | tests/unit/resources/settings/test_backups.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | tests/unit/resources/settings/test_backups.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | tests/unit/resources/settings/test_backups.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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
#... | 35.454545 | 118 | 0.74188 | # -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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
#... | 0 | 2,244 | 0 | 399 | 0 | 0 | 0 | 89 | 136 |
4bc85f8092188613ab654a4c3765404fe3fb867c | 672 | py | Python | airbnb/system/region_revenue.py | mpresh/airbnb-tools | 6f1884082e91ec810ea5667a1b2041ad246ebf7b | [
"MIT"
] | 1 | 2017-07-12T16:44:02.000Z | 2017-07-12T16:44:02.000Z | airbnb/system/region_revenue.py | mpresh/airbnb-tools | 6f1884082e91ec810ea5667a1b2041ad246ebf7b | [
"MIT"
] | null | null | null | airbnb/system/region_revenue.py | mpresh/airbnb-tools | 6f1884082e91ec810ea5667a1b2041ad246ebf7b | [
"MIT"
] | null | null | null | import zipcodes
if __name__ == "__main__":
region_average_revenue(zipcodes.get_all_cape_cod_zip_codes)
| 33.6 | 80 | 0.733631 | import zipcodes
import listings
import bnbcalendar
import finance
from pprint import pprint
def region_average_revenue(zipcodes_func, adults=16, state="MA"):
rooms = listings.get_all_listings(zipcodes_func, adults=adults, state=state)
#rooms = ["4914702", "16042826"]
for room in rooms:
print("Getti... | 0 | 0 | 0 | 0 | 0 | 455 | 0 | -12 | 111 |
2b4944225389f356c9da74143b2cea6864e7e5f4 | 2,458 | py | Python | conveniences/demo_mnbc.py | mateusnbm/ai-conveniences | 4a0cd0d761f1d534149f9f0ab03f5f94e4290580 | [
"MIT"
] | null | null | null | conveniences/demo_mnbc.py | mateusnbm/ai-conveniences | 4a0cd0d761f1d534149f9f0ab03f5f94e4290580 | [
"MIT"
] | null | null | null | conveniences/demo_mnbc.py | mateusnbm/ai-conveniences | 4a0cd0d761f1d534149f9f0ab03f5f94e4290580 | [
"MIT"
] | null | null | null | #
# demo_spam_classifier.py
#
# Multinomial Naive Bays Classifier.
#
# Based-on:
#
# https://www.udemy.com/data-science-and-machine-learning-with-python-hands-on/
# http://blog.datumbox.com/machine-learning-tutorial-the-naive-bayes-text-classifier/
#
from pandas import DataFrame
from sklearn.feature_extraction.text imp... | 27.931818 | 107 | 0.684703 | #
# demo_spam_classifier.py
#
# Multinomial Naive Bays Classifier.
#
# Based-on:
#
# https://www.udemy.com/data-science-and-machine-learning-with-python-hands-on/
# http://blog.datumbox.com/machine-learning-tutorial-the-naive-bayes-text-classifier/
#
import os
import io
import numpy
from pandas import DataFrame
from s... | 0 | 0 | 0 | 0 | 494 | 241 | 0 | -33 | 113 |
e5ab48881e462aa904536ebf91d486c500e7719a | 115 | py | Python | testing_focus_session/01_unit_tests/03_pytest/02_fixtures/05_request_fixture/test_module.py | netanelrevah/testing-focus-session | ce1ef76afa444ee50a1d20f0855ae5073ee2c2d9 | [
"MIT"
] | 1 | 2020-06-26T12:40:38.000Z | 2020-06-26T12:40:38.000Z | testing_focus_session/01_unit_tests/03_pytest/02_fixtures/05_request_fixture/test_module.py | netanelrevah/testing-focus-session | ce1ef76afa444ee50a1d20f0855ae5073ee2c2d9 | [
"MIT"
] | null | null | null | testing_focus_session/01_unit_tests/03_pytest/02_fixtures/05_request_fixture/test_module.py | netanelrevah/testing-focus-session | ce1ef76afa444ee50a1d20f0855ae5073ee2c2d9 | [
"MIT"
] | 1 | 2021-10-05T10:29:19.000Z | 2021-10-05T10:29:19.000Z | ports = [80, 433, 8080, 8000]
| 16.428571 | 34 | 0.652174 | ports = [80, 433, 8080, 8000]
def test_connections(connections):
for c in connections:
print(c.port)
| 0 | 0 | 0 | 0 | 0 | 61 | 0 | 0 | 23 |
3f2201b86a9fcb9ecd7c3f12b0c04d9a9eeca535 | 6,660 | py | Python | src/commoncode/filetype.py | Pratikrocks/commoncode | 02fb544869708607997bbf3440e1b402c68a3164 | [
"Apache-2.0"
] | 2 | 2020-09-28T10:12:28.000Z | 2021-01-15T11:16:44.000Z | src/commoncode/filetype.py | Pratikrocks/commoncode | 02fb544869708607997bbf3440e1b402c68a3164 | [
"Apache-2.0"
] | 28 | 2020-11-13T01:39:37.000Z | 2022-03-28T20:14:50.000Z | src/commoncode/filetype.py | Pratikrocks/commoncode | 02fb544869708607997bbf3440e1b402c68a3164 | [
"Apache-2.0"
] | 6 | 2020-11-18T00:16:18.000Z | 2021-09-01T09:01:11.000Z | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/commoncode for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
import ... | 29.469027 | 86 | 0.666066 | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/commoncode for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
import ... | 0 | 1,031 | 0 | 0 | 0 | 0 | 0 | 20 | 45 |
05aeadad29492f4792dc64b4e5f1e4699b3a1866 | 1,522 | py | Python | object_detection/serving_script/predict.py | qq2016/kubeflow_learning | 930706686108f997aab42ccf2fe455dcf09a4afc | [
"Apache-2.0"
] | 1,165 | 2018-03-01T01:47:14.000Z | 2022-03-31T08:35:00.000Z | object_detection/serving_script/predict.py | arki1/examples | c93b792d67c8c52bc91d4ccf5fbaead4e2324331 | [
"Apache-2.0"
] | 929 | 2018-02-04T18:20:16.000Z | 2022-03-31T18:20:43.000Z | object_detection/serving_script/predict.py | arki1/examples | c93b792d67c8c52bc91d4ccf5fbaead4e2324331 | [
"Apache-2.0"
] | 687 | 2018-02-01T21:35:30.000Z | 2022-03-29T07:47:47.000Z | """ Script to send prediction request.
Usage:
python predict.py --url=YOUR_KF_HOST/models/coco --input_image=YOUR_LOCAL_IMAGE
--output_image=OUTPUT_IMAGE_NAME.
This will save the prediction result as OUTPUT_IMAGE_NAME.
The output image is the input image with the detected bounding boxes.
"""
WIDTH = 1024
HEIGH... | 27.178571 | 81 | 0.729304 | """ Script to send prediction request.
Usage:
python predict.py --url=YOUR_KF_HOST/models/coco --input_image=YOUR_LOCAL_IMAGE
--output_image=OUTPUT_IMAGE_NAME.
This will save the prediction result as OUTPUT_IMAGE_NAME.
The output image is the input image with the detected bounding boxes.
"""
import argparse
imp... | 0 | 0 | 0 | 0 | 0 | 1,009 | 0 | -8 | 156 |
835a69e7ee6ae96c62b6be6b24e176d61f9beb24 | 151 | py | Python | src/polls/tests/functional_tests.py | ikos289/docker-django | 6fa50df751e357b82b686d15b16891210e506430 | [
"MIT"
] | null | null | null | src/polls/tests/functional_tests.py | ikos289/docker-django | 6fa50df751e357b82b686d15b16891210e506430 | [
"MIT"
] | null | null | null | src/polls/tests/functional_tests.py | ikos289/docker-django | 6fa50df751e357b82b686d15b16891210e506430 | [
"MIT"
] | null | null | null | from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://0.0.0.0:8000')
print(browser.title)
assert 'Django' in browser.title
| 21.571429 | 34 | 0.761589 | from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://0.0.0.0:8000')
print(browser.title)
assert 'Django' in browser.title
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a72428b374da27389d79bf99ef277a86b1fa5dd6 | 509 | py | Python | src/olympia/stats/migrations/0005_create_switch_bigquery_download_stats_cron_tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/stats/migrations/0005_create_switch_bigquery_download_stats_cron_tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/stats/migrations/0005_create_switch_bigquery_download_stats_cron_tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | # Generated by Django 2.2.13 on 2020-07-23 16:13
| 25.45 | 61 | 0.707269 | # Generated by Django 2.2.13 on 2020-07-23 16:13
from django.db import migrations
def create_waffle_switch(apps, schema_editor):
Switch = apps.get_model('waffle', 'Switch')
Switch.objects.create(
name='use-bigquery-for-download-stats-cron',
active=False,
note='Use BigQuery in download... | 0 | 0 | 0 | 139 | 0 | 239 | 0 | 11 | 69 |
800e3537aea3f08140b4b85867fd724bf0b52669 | 1,055 | py | Python | mmaction/models/losses/__init__.py | ovshake/mmaction2 | 71e92e9d4c28190d485ba153aae5200bf71f70b1 | [
"Apache-2.0"
] | null | null | null | mmaction/models/losses/__init__.py | ovshake/mmaction2 | 71e92e9d4c28190d485ba153aae5200bf71f70b1 | [
"Apache-2.0"
] | null | null | null | mmaction/models/losses/__init__.py | ovshake/mmaction2 | 71e92e9d4c28190d485ba153aae5200bf71f70b1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .base import BaseWeightedLoss
from .binary_logistic_regression_loss import BinaryLogisticRegressionLoss
from .bmn_loss import BMNLoss
from .cross_entropy_loss import BCELossWithLogits, CrossEntropyLoss
from .hvu_loss import HVULoss
from .nll_loss import NLLLoss
from ... | 50.238095 | 149 | 0.842654 | # Copyright (c) OpenMMLab. All rights reserved.
from .base import BaseWeightedLoss
from .binary_logistic_regression_loss import BinaryLogisticRegressionLoss
from .bmn_loss import BMNLoss
from .cross_entropy_loss import BCELossWithLogits, CrossEntropyLoss
from .hvu_loss import HVULoss
from .nll_loss import NLLLoss
from ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
77e0586d04fc6b5bd498ff7eda396fdc0f889dc1 | 96 | py | Python | venv/lib/python3.8/site-packages/poetry/utils/password_manager.py | Retraces/UkraineBot | 3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/poetry/utils/password_manager.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/poetry/utils/password_manager.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/3a/e8/d9/6b866f26f3d0047a518cb59b619be509f29a97d30cbaa9657343abd771 | 96 | 96 | 0.895833 | /home/runner/.cache/pip/pool/3a/e8/d9/6b866f26f3d0047a518cb59b619be509f29a97d30cbaa9657343abd771 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b7060bcb1857418d2ea9deaaa1621e5bdb64a900 | 25,094 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/user_api/accounts/serializers.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/user_api/accounts/serializers.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/user_api/accounts/serializers.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """
Django REST Framework serializers for the User API Accounts sub-application
"""
import json
import logging
from django.conf import settings
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api.models import UserPreference
from . import (AC... | 39.64297 | 124 | 0.676895 | """
Django REST Framework serializers for the User API Accounts sub-application
"""
import json
import logging
import re
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.exceptions import ObjectDoesNotExist
from django.u... | 0 | 613 | 0 | 19,924 | 0 | 0 | 0 | 706 | 684 |
c14b091cf5862855f63fbbe263409ba8262d2632 | 12,598 | py | Python | cclp/neuralnet/trainers/trainers.py | Kamnitsask/ssl_compact_clustering | 19938d295493f6c9f2c19a60ccb1bb9a3596906c | [
"Apache-2.0"
] | 61 | 2019-06-06T19:22:14.000Z | 2022-03-24T01:38:59.000Z | cclp/neuralnet/trainers/trainers.py | Kamnitsask/ssl_compact_clustering | 19938d295493f6c9f2c19a60ccb1bb9a3596906c | [
"Apache-2.0"
] | 3 | 2019-07-22T14:24:55.000Z | 2020-09-30T09:15:34.000Z | cclp/neuralnet/trainers/trainers.py | Kamnitsask/ssl_compact_clustering | 19938d295493f6c9f2c19a60ccb1bb9a3596906c | [
"Apache-2.0"
] | 10 | 2019-06-06T18:41:27.000Z | 2022-03-24T01:39:13.000Z | #!/usr/bin/env python
# Copyright (c) 2018, Konstantinos Kamnitsas
#
# This program is free software; you can redistribute and/or modify
# it under the terms of the Apache License, Version 2.0. See the
# accompanying LICENSE file or read the terms at:
# http://www.apache.org/licenses/LICENSE-2.0
from __future__ impo... | 54.301724 | 230 | 0.656057 | #!/usr/bin/env python
# Copyright (c) 2018, Konstantinos Kamnitsas
#
# This program is free software; you can redistribute and/or modify
# it under the terms of the Apache License, Version 2.0. See the
# accompanying LICENSE file or read the terms at:
# http://www.apache.org/licenses/LICENSE-2.0
from __future__ impo... | 0 | 0 | 0 | 12,018 | 0 | 0 | 0 | 60 | 91 |
69e1c7f030fdae6cc022477307bb6b668d3bc021 | 2,726 | py | Python | api/Random_positions.py | TeaBreak-Tech/funtube_be | c244739fb4b9cced244cea4717bde3f09f8d86cf | [
"MIT"
] | null | null | null | api/Random_positions.py | TeaBreak-Tech/funtube_be | c244739fb4b9cced244cea4717bde3f09f8d86cf | [
"MIT"
] | null | null | null | api/Random_positions.py | TeaBreak-Tech/funtube_be | c244739fb4b9cced244cea4717bde3f09f8d86cf | [
"MIT"
] | null | null | null | #import util_preparation as up
PREVENT_DURATION = 60
START_PREVENT_DURATION = 120
END_PREVENT_DURATION = 120
| 29.956044 | 100 | 0.573001 | #import util_preparation as up
import pandas as pd
import random
import os
import csv
from .models import *
PREVENT_DURATION = 60
START_PREVENT_DURATION = 120
END_PREVENT_DURATION = 120
def generagte_random_ads(video_id,N_ADS=3):
# 确定插入的广告
# 可用广告在 ad_urls.csv 里查询
ads = []
ads = [[ad.ad_id, ad.href,... | 222 | 0 | 0 | 0 | 0 | 2,440 | 0 | -33 | 134 |
5f7d6c5925fe4e52b86831fe3e20e0cbb51570a3 | 4,646 | py | Python | temboo/core/Library/Box/Files/ZipFile.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Box/Files/ZipFile.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Box/Files/ZipFile.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# ZipFile
# Creates a zipped version of the specified Box file and returns a link to the new compressed file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License... | 40.754386 | 206 | 0.674774 | # -*- coding: utf-8 -*-
###############################################################################
#
# ZipFile
# Creates a zipped version of the specified Box file and returns a link to the new compressed file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License... | 0 | 0 | 0 | 3,428 | 0 | 0 | 0 | 104 | 204 |
68408fe7a5c1690df451641f4565f48305c8e19c | 830 | py | Python | src/compas_ghpython/artists/pointartist.py | GeneKao/compas | eb6b5dc928236477d5d0fa1561e26dda6296f019 | [
"MIT"
] | null | null | null | src/compas_ghpython/artists/pointartist.py | GeneKao/compas | eb6b5dc928236477d5d0fa1561e26dda6296f019 | [
"MIT"
] | null | null | null | src/compas_ghpython/artists/pointartist.py | GeneKao/compas | eb6b5dc928236477d5d0fa1561e26dda6296f019 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
| 23.714286 | 68 | 0.659036 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas_ghpython
from compas.artists import PrimitiveArtist
from .artist import GHArtist
class PointArtist(GHArtist, PrimitiveArtist):
"""Artist for drawing points.
Parameters
----------
... | 0 | 62 | 0 | 539 | 0 | 0 | 0 | 29 | 90 |
9ec102cb665e7539c5fa44c0ec648ab7542b5df8 | 167 | py | Python | imagetext.py | downthecrop/python-text-from-image | d4c79e38ad7a938c17ad94554a5d5dad59991930 | [
"BSD-2-Clause"
] | null | null | null | imagetext.py | downthecrop/python-text-from-image | d4c79e38ad7a938c17ad94554a5d5dad59991930 | [
"BSD-2-Clause"
] | null | null | null | imagetext.py | downthecrop/python-text-from-image | d4c79e38ad7a938c17ad94554a5d5dad59991930 | [
"BSD-2-Clause"
] | null | null | null | ##Requires PIL (Pillow), and pytesseract
from PIL import Image
from pytesseract import image_to_string
img=Image.open('test.png')
print(image_to_string(img)) | 20.875 | 41 | 0.760479 | ##Requires PIL (Pillow), and pytesseract
from PIL import Image
from pytesseract import image_to_string
img=Image.open('test.png')
print(image_to_string(img)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5e646af002eec7affa6c340d69f3649382ec6a9a | 17,625 | py | Python | shape_recognition/libraries/UR10/UR10.py | ys1998/tactile-shape-recognition | b5ab6f1cdf04ff23e14b467a590533e7ee740b52 | [
"MIT"
] | null | null | null | shape_recognition/libraries/UR10/UR10.py | ys1998/tactile-shape-recognition | b5ab6f1cdf04ff23e14b467a590533e7ee740b52 | [
"MIT"
] | null | null | null | shape_recognition/libraries/UR10/UR10.py | ys1998/tactile-shape-recognition | b5ab6f1cdf04ff23e14b467a590533e7ee740b52 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
#-------------------------------------------------------------------------------
# NATIONAL UNIVERSITY OF SINGAPORE - NUS
# SINGAPORE INSTITUTE FOR NEUROTECHNOLOGY - SINAPSE
# Singapore
# URL: http://www.sinapseinstitute.org
#-----------------------------------------------------------... | 31.756757 | 198 | 0.549787 | # -*- coding: utf-8 -*-
'''
#-------------------------------------------------------------------------------
# NATIONAL UNIVERSITY OF SINGAPORE - NUS
# SINGAPORE INSTITUTE FOR NEUROTECHNOLOGY - SINAPSE
# Singapore
# URL: http://www.sinapseinstitute.org
#-----------------------------------------------------------... | 0 | 0 | 0 | 13,301 | 0 | 0 | 0 | -34 | 210 |
072d2914c7508a4a27885c88e7923aafdfe723a6 | 4,133 | py | Python | src/rlmamr/my_env/capture_target_MA_core.py | yuchen-x/CoRL2019 | d482a90441bc8eb0461f1f22fbd65d96584f6914 | [
"MIT"
] | 2 | 2020-02-05T04:17:03.000Z | 2021-05-24T04:07:36.000Z | src/rlmamr/my_env/capture_target_MA_core.py | yuchen-x/CoRL2019 | d482a90441bc8eb0461f1f22fbd65d96584f6914 | [
"MIT"
] | null | null | null | src/rlmamr/my_env/capture_target_MA_core.py | yuchen-x/CoRL2019 | d482a90441bc8eb0461f1f22fbd65d96584f6914 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import numpy as np
NORTH = np.array([0, 1])
SOUTH = np.array([0, -1])
WEST = np.array([-1, 0])
EAST = np.array([1, 0])
STAY = np.array([0, 0])
TRANSLATION_TABLE = [
# [left, intended_direction, right]
[WEST, NORTH, EAST],
[EAST, SOUTH, WEST],
[SOUTH, WEST, NORTH],
[NORTH, EAS... | 33.064 | 140 | 0.581176 | #!/usr/bin/python
import numpy as np
import IPython
from IPython.core.debugger import set_trace
NORTH = np.array([0, 1])
SOUTH = np.array([0, -1])
WEST = np.array([-1, 0])
EAST = np.array([1, 0])
STAY = np.array([0, 0])
TRANSLATION_TABLE = [
# [left, intended_direction, right]
[WEST, NORTH, EAST],
[EAS... | 0 | 115 | 0 | 3,379 | 0 | 0 | 0 | 15 | 91 |
87af048da678fa17419acdfe0ee36bfcb3064335 | 4,026 | py | Python | src/python/packages/study/__main__.py | djrlj694/nyc-taxi-analysis | 0d62cc56594ef9260580c9e6c203e9fbde6fee24 | [
"MIT"
] | null | null | null | src/python/packages/study/__main__.py | djrlj694/nyc-taxi-analysis | 0d62cc56594ef9260580c9e6c203e9fbde6fee24 | [
"MIT"
] | null | null | null | src/python/packages/study/__main__.py | djrlj694/nyc-taxi-analysis | 0d62cc56594ef9260580c9e6c203e9fbde6fee24 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
__main__.py - The main module for processing data and creating visual summaries
for this study.
"""
import os
import sys
from pathlib import Path
import ui.cli as cli
from file import YAMLFile
# =========================================================================== #
# METADATA
# =====... | 22.617978 | 79 | 0.513164 | #!/usr/bin/env python3
"""
__main__.py - The main module for processing data and creating visual summaries
for this study.
"""
import os
import sys
from pathlib import Path
import etl
import pandas as pd
import ui.cli as cli
from file import YAMLFile
# ================================================================... | 0 | 0 | 0 | 0 | 0 | 871 | 0 | -13 | 160 |
dcfb93be50b868f85e2e53dee2d5dd941c95ec50 | 4,100 | py | Python | ssa_sim_v2/simulator/modules/auction_attributes/auction_attributes_base_module.py | donghun2018/adclick-simulator-v2 | ade886e9dcbde9fcea218a19f0130cc09f81e55e | [
"MIT"
] | null | null | null | ssa_sim_v2/simulator/modules/auction_attributes/auction_attributes_base_module.py | donghun2018/adclick-simulator-v2 | ade886e9dcbde9fcea218a19f0130cc09f81e55e | [
"MIT"
] | null | null | null | ssa_sim_v2/simulator/modules/auction_attributes/auction_attributes_base_module.py | donghun2018/adclick-simulator-v2 | ade886e9dcbde9fcea218a19f0130cc09f81e55e | [
"MIT"
] | null | null | null | # Fix paths for imports to work in unit tests ----------------
if __name__ == "__main__":
from _fix_paths import fix_paths
fix_paths()
# ------------------------------------------------------------
# Load libraries ---------------------------------------------
# --------------------------------------------... | 33.606557 | 152 | 0.596098 | # Fix paths for imports to work in unit tests ----------------
if __name__ == "__main__":
from _fix_paths import fix_paths
fix_paths()
# ------------------------------------------------------------
# Load libraries ---------------------------------------------
from typing import Dict
import numpy as np
f... | 0 | 0 | 0 | 3,367 | 0 | 0 | 0 | 64 | 142 |
348061fbd3722432b2a2937544c82aef93786355 | 232 | py | Python | src/cloudio/exception/invalid_cloudio_attribute_type_exception.py | michaelFavre/cloudio-endpoint-python | c00f7cc0578d1974d47fbab5a97a3239fcb99084 | [
"MIT"
] | null | null | null | src/cloudio/exception/invalid_cloudio_attribute_type_exception.py | michaelFavre/cloudio-endpoint-python | c00f7cc0578d1974d47fbab5a97a3239fcb99084 | [
"MIT"
] | null | null | null | src/cloudio/exception/invalid_cloudio_attribute_type_exception.py | michaelFavre/cloudio-endpoint-python | c00f7cc0578d1974d47fbab5a97a3239fcb99084 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*- | 46.4 | 122 | 0.732759 | # -*- coding: utf-8 -*-
class InvalidCloudioAttributeTypeException(Exception):
def __init__(self, type):
super(InvalidCloudioAttributeTypeException, self).__init__(str(type) + ' is not a valid cloud.io attribute type!') | 0 | 0 | 0 | 186 | 0 | 0 | 0 | 0 | 23 |
b11059298c8234b3e10476c7c2a4e80a7072ec74 | 1,085 | py | Python | src/account/migrations/0002_auto_20200412_1356.py | kravchenko89/test | 9eb43e6e96ec198fa433c775f1ffa0f02022e6e4 | [
"MIT"
] | null | null | null | src/account/migrations/0002_auto_20200412_1356.py | kravchenko89/test | 9eb43e6e96ec198fa433c775f1ffa0f02022e6e4 | [
"MIT"
] | 6 | 2021-03-19T10:08:06.000Z | 2022-02-10T14:03:57.000Z | src/account/migrations/0002_auto_20200412_1356.py | kravchenko89/test | 9eb43e6e96ec198fa433c775f1ffa0f02022e6e4 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-04-12 13:56
| 30.138889 | 191 | 0.582488 | # Generated by Django 2.2.10 on 2020-04-12 13:56
import django.core.validators
from django.db import migrations, models
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
migrations.AddField(
m... | 0 | 0 | 0 | 909 | 0 | 0 | 0 | 36 | 90 |
d34c7fe1bde2e41f49f5f3ca9ebb728a7f0a3605 | 1,570 | py | Python | model_lstm/setup.py | ofbennett/sentiment-analysis-app | 94362ae3e638daeec29e09065549fd4078af8a1a | [
"MIT"
] | 2 | 2020-10-04T16:58:54.000Z | 2021-10-04T13:51:10.000Z | model_lstm/setup.py | ofbennett/sentiment-analysis-app | 94362ae3e638daeec29e09065549fd4078af8a1a | [
"MIT"
] | null | null | null | model_lstm/setup.py | ofbennett/sentiment-analysis-app | 94362ae3e638daeec29e09065549fd4078af8a1a | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
from pathlib import Path
NAME = 'model_lstm'
DESCRIPTION = 'LSTM model which classifies the sentiment of English sentences.'
URL = 'https://github.com/ofbennett/sentiment-analysis-app'
EMAIL = 'contact.me.ob@gmail.com'
AUTHOR = 'Oscar Bennett'
REQUIRES_PYTHON = '>=3.7.0'
ROO... | 34.130435 | 82 | 0.652229 | from setuptools import find_packages, setup
from pathlib import Path
NAME = 'model_lstm'
DESCRIPTION = 'LSTM model which classifies the sentiment of English sentences.'
URL = 'https://github.com/ofbennett/sentiment-analysis-app'
EMAIL = 'contact.me.ob@gmail.com'
AUTHOR = 'Oscar Bennett'
REQUIRES_PYTHON = '>=3.7.0'
ROO... | 0 | 0 | 0 | 0 | 0 | 85 | 0 | 0 | 23 |
d720558039425b7b46dedfcf73d7c8783c9496cd | 579 | py | Python | Python/Fundamentals/io_switch.py | Gjacquenot/training-material | 16b29962bf5683f97a1072d961dd9f31e7468b8d | [
"CC-BY-4.0"
] | 115 | 2015-03-23T13:34:42.000Z | 2022-03-21T00:27:21.000Z | Python/Fundamentals/io_switch.py | Gjacquenot/training-material | 16b29962bf5683f97a1072d961dd9f31e7468b8d | [
"CC-BY-4.0"
] | 56 | 2015-02-25T15:04:26.000Z | 2022-01-03T07:42:48.000Z | Python/Fundamentals/io_switch.py | Gjacquenot/training-material | 16b29962bf5683f97a1072d961dd9f31e7468b8d | [
"CC-BY-4.0"
] | 59 | 2015-11-26T11:44:51.000Z | 2022-03-21T00:27:22.000Z | #!/usr/bin/env python
if __name__ == '__main__':
from argparse import ArgumentParser
from io import StringIO
import sys
arg_parser = ArgumentParser(description='I/O test')
arg_parser.add_argument('-o', dest='output', help='output file')
options = arg_parser.parse_args()
str_io = StringIO()
... | 28.95 | 68 | 0.632124 | #!/usr/bin/env python
if __name__ == '__main__':
from argparse import ArgumentParser
from io import StringIO
import sys
arg_parser = ArgumentParser(description='I/O test')
arg_parser.add_argument('-o', dest='output', help='output file')
options = arg_parser.parse_args()
str_io = StringIO()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9df7df112f519136b1e342846112fa1c98437980 | 4,102 | py | Python | app.py | banana-breads/SmartOven | d5a79a77ceca6269252d27b350d6d6ccd76f3000 | [
"MIT"
] | 3 | 2022-01-30T18:00:26.000Z | 2022-01-30T18:03:34.000Z | app.py | banana-breads/SmartOven | d5a79a77ceca6269252d27b350d6d6ccd76f3000 | [
"MIT"
] | 10 | 2022-01-30T21:06:40.000Z | 2022-02-03T09:42:36.000Z | app.py | banana-breads/SmartOven | d5a79a77ceca6269252d27b350d6d6ccd76f3000 | [
"MIT"
] | 1 | 2022-02-01T12:48:05.000Z | 2022-02-01T12:48:05.000Z | import argparse
swagger = None
# TODO have blueprints in a spepparate module
# Arguments
parser = argparse.ArgumentParser(description="SmartOven Flask server")
parser.add_argument('-t', '--test',
help='Run the server in testing mode',
action="store_true"
)
if __name__ == "__main__":
ar... | 29.941606 | 75 | 0.627986 | import json
from flask import Flask
from flasgger import Swagger
from globals import connected_devices, Oven
import os
import recipes
import ovens
import recipe_search_online
import db
from mqtt_shared import mqtt_manager, mqtt_topics
from constants import MONGO_URI, MONGO_URI_TEST
import argparse
fro... | 0 | 0 | 0 | 0 | 0 | 3,227 | 0 | 88 | 380 |
cfebce4ce5effba03e6fe213972dd94622cfecd1 | 511 | py | Python | msg_90s_celular_20_02_2019/converte_num_letra.py | python-joinville/dojo-puzzles | 412d8d3443b2cdb492fa9a77c08a876a182994ee | [
"MIT"
] | 3 | 2018-07-31T19:49:43.000Z | 2019-06-28T20:52:58.000Z | msg_90s_celular_20_02_2019/converte_num_letra.py | python-joinville/dojo-puzzles | 412d8d3443b2cdb492fa9a77c08a876a182994ee | [
"MIT"
] | null | null | null | msg_90s_celular_20_02_2019/converte_num_letra.py | python-joinville/dojo-puzzles | 412d8d3443b2cdb492fa9a77c08a876a182994ee | [
"MIT"
] | 1 | 2018-07-28T19:36:48.000Z | 2018-07-28T19:36:48.000Z | tabela = {'2': 'a',
'3':'d',
'5':'j',
'4':'g',
'6':'m',
'7':'p',
'8':'t',
'9': 'w',
'0': ' ',
}
| 22.217391 | 47 | 0.403131 | tabela = {'2': 'a',
'3':'d',
'5':'j',
'4':'g',
'6':'m',
'7':'p',
'8':'t',
'9': 'w',
'0': ' ',
}
def converte_num_letra(digitos):
palavra = ''
letra = ''
sequencia = ''
for digito in digitos:
if letra != '' and digi... | 0 | 0 | 0 | 0 | 0 | 311 | 0 | 0 | 23 |
494aaca2f4ace6c6bc7d69520a23e5deddd3db65 | 720 | py | Python | src/Chapter 3/Exercise 7.py | group9BSE1/BSE-2021 | bea904fce079b856c26f8c06bd734176bdc4d70d | [
"MIT"
] | 1 | 2021-03-27T19:01:49.000Z | 2021-03-27T19:01:49.000Z | src/Chapter 3/Exercise 7.py | group9BSE1/BSE-2021 | bea904fce079b856c26f8c06bd734176bdc4d70d | [
"MIT"
] | null | null | null | src/Chapter 3/Exercise 7.py | group9BSE1/BSE-2021 | bea904fce079b856c26f8c06bd734176bdc4d70d | [
"MIT"
] | null | null | null | # location
location = input("Job Location:\n")
pay = input("Payment:\n")
# Prints For decisions
no = "No thanks,I can find something Better"
doubt = "Without a doubt I'll take it"
sure = "Sure, I can work with that"
no_way = "No way!"
# Try and Except
try:
location = str(location)
pay = float(pay)
except:
... | 21.176471 | 44 | 0.594444 | # location
location = input("Job Location:\n")
pay = input("Payment:\n")
# Prints For decisions
no = "No thanks,I can find something Better"
doubt = "Without a doubt I'll take it"
sure = "Sure, I can work with that"
no_way = "No way!"
# Try and Except
try:
location = str(location)
pay = float(pay)
except:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c64480096569db772606bfc626022fbec11fab93 | 1,753 | py | Python | broker-manager/SearchDate.py | victor-prado/broker-manager | b056cf59247e41e890b1443c0c9e44832b79c51a | [
"MIT"
] | null | null | null | broker-manager/SearchDate.py | victor-prado/broker-manager | b056cf59247e41e890b1443c0c9e44832b79c51a | [
"MIT"
] | null | null | null | broker-manager/SearchDate.py | victor-prado/broker-manager | b056cf59247e41e890b1443c0c9e44832b79c51a | [
"MIT"
] | null | null | null |
#Arrumar!
#root = tk.Tk()
#app = SearchDate(master=root)
#app.mainloop()
#data = Data()
#data.db.close()
| 28.274194 | 77 | 0.541928 | import tkinter as tk
from Data import Data
from EditClient import EditClient
class SearchDate(tk.Frame, Data):
def __init__(self, master=None):
super().__init__(master)
self.frame = tk.Frame(self.master)
self.frame.grid()
self.create_table()
def create_entry(self, row_value, m... | 0 | 0 | 0 | 1,546 | 0 | 0 | 0 | 11 | 89 |
2d82e8a5afd34b19a82dd079954acdf19ab0b1a0 | 467 | py | Python | lego-catalog/backend/resources/scripts/populate_dynamodb.py | neovasili/101_serverless_workshop | a005ab4af620c3c1a522aab8d201378ea7840ab5 | [
"MIT"
] | 4 | 2019-11-13T17:58:15.000Z | 2020-03-12T12:24:10.000Z | lego-catalog/backend/resources/scripts/populate_dynamodb.py | neovasili/101_serverless_workshop | a005ab4af620c3c1a522aab8d201378ea7840ab5 | [
"MIT"
] | null | null | null | lego-catalog/backend/resources/scripts/populate_dynamodb.py | neovasili/101_serverless_workshop | a005ab4af620c3c1a522aab8d201378ea7840ab5 | [
"MIT"
] | null | null | null | import boto3
import json
session = boto3.session.Session( profile_name= 'jmcore' )
dynamodb = session.resource( 'dynamodb', region_name= 'eu-west-1' )
table = dynamodb.Table( 'serverless_workshop' )
with open( "user-sets-data.json" ) as json_file:
users = json.load( json_file )
for user in users:
userID = use... | 24.578947 | 67 | 0.631692 | import boto3
import json
session = boto3.session.Session( profile_name= 'jmcore' )
dynamodb = session.resource( 'dynamodb', region_name= 'eu-west-1' )
table = dynamodb.Table( 'serverless_workshop' )
with open( "user-sets-data.json" ) as json_file:
users = json.load( json_file )
for user in users:
userID = use... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9beda75cf8f601813cb1e0106a06881bcd28dbb | 4,306 | py | Python | ml/sarsa/gym-minigrid/tests.py | AlinMH/C-Projects | 1e11b4fd1b96045b4b810d5892b2be73c1d5d886 | [
"MIT"
] | null | null | null | ml/sarsa/gym-minigrid/tests.py | AlinMH/C-Projects | 1e11b4fd1b96045b4b810d5892b2be73c1d5d886 | [
"MIT"
] | null | null | null | ml/sarsa/gym-minigrid/tests.py | AlinMH/C-Projects | 1e11b4fd1b96045b4b810d5892b2be73c1d5d886 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
plot_softmax("MiniGrid-Empty-6x6-v0")
| 46.804348 | 105 | 0.51974 | from sarsa_skel import *
def plot_egreedy(map):
c1 = 0.5
lr1 = 0.1
d1 = 0.99
q01 = 0
steps1, avg_lengths1, avg_returns1 = sarsa_egreedy(map_file=map, learning_rate=lr1,
discount=d1, const=c1, train_episodes=500, q0=q01,
... | 0 | 0 | 0 | 0 | 0 | 4,162 | 0 | 3 | 68 |
47b9a30e8798f592988d1d728ccd51bd10f6cb58 | 958 | py | Python | Python3/146.lru-cache.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/146.lru-cache.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/146.lru-cache.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=146 lang=python3
#
# [146] LRU Cache
#
# @lc code=start
# Your LRUCache object will be instantiated and called as such:
# obj = LRUCache(capacity)
# param_1 = obj.get(key)
# obj.put(key,value)
# @lc code=end
| 22.809524 | 63 | 0.538622 | #
# @lc app=leetcode id=146 lang=python3
#
# [146] LRU Cache
#
# @lc code=start
class LRUCache:
def __init__(self, capacity: int):
self.cap = capacity
self.d = dict()
self.stack = []
def get(self, key: int):
if key not in self.d:
return -1
self.stack.remove(... | 0 | 0 | 0 | 700 | 0 | 0 | 0 | 0 | 22 |
019902fd823def4e117ea65ffc273ad7678112be | 7,817 | py | Python | mergejs.py | tmcw/OpenLayerer | 44212b0f9a8aae71f6f96f6357671e89f6ea6cc5 | [
"Apache-2.0",
"BSD-2-Clause"
] | 1 | 2015-07-17T19:01:07.000Z | 2015-07-17T19:01:07.000Z | mergejs.py | tmcw/OpenLayerer | 44212b0f9a8aae71f6f96f6357671e89f6ea6cc5 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | mergejs.py | tmcw/OpenLayerer | 44212b0f9a8aae71f6f96f6357671e89f6ea6cc5 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | 32.707113 | 102 | 0.612639 | #!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | 0 | 0 | 0 | 2,220 | 0 | 0 | 0 | 4 | 46 |
37506a8286c5b05402cb22c60eb6b8354ead4f28 | 5,955 | py | Python | test/core/dnn/transformer_test.py | ClaudioBorges/ehrudite | 8633995d3bf795fffeccabd7d20be522241f3bb5 | [
"Apache-2.0"
] | null | null | null | test/core/dnn/transformer_test.py | ClaudioBorges/ehrudite | 8633995d3bf795fffeccabd7d20be522241f3bb5 | [
"Apache-2.0"
] | null | null | null | test/core/dnn/transformer_test.py | ClaudioBorges/ehrudite | 8633995d3bf795fffeccabd7d20be522241f3bb5 | [
"Apache-2.0"
] | 1 | 2022-03-18T09:26:05.000Z | 2022-03-18T09:26:05.000Z | """The test file for transformer DNN"""
import ehrudite.core.dnn.transformer as transformer
| 34.224138 | 87 | 0.674559 | """The test file for transformer DNN"""
import ehrudite.core.dnn.transformer as transformer
import random
import tensorflow as tf
def test_transformer_encoder_decoder_layer():
batch_size = random.randint(8, 64)
d_model = 2 ** random.randint(7, 9)
dff = random.randint(512, 2048)
input_seq_len = random... | 0 | 0 | 0 | 0 | 0 | 5,656 | 0 | -6 | 205 |
8e54067c74c3efbad693b3983718ac2e603e8a34 | 9,858 | py | Python | pymdwizard/core/fgdc_utils.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 53 | 2017-05-01T05:03:33.000Z | 2022-03-13T04:49:15.000Z | pymdwizard/core/fgdc_utils.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 109 | 2017-05-17T15:15:40.000Z | 2022-03-24T21:12:45.000Z | pymdwizard/core/fgdc_utils.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 17 | 2017-02-08T16:18:18.000Z | 2021-01-28T19:38:09.000Z | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | 33.993103 | 79 | 0.582674 | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa35d2742f0af2fece6c31ef5a0689b9bda6cc31 | 898 | py | Python | localflavor/dk/forms.py | int2k/django-localflavor | fcda7f3aa3685f15f031b7d9b78f02e19ac5fb0b | [
"BSD-3-Clause"
] | 1 | 2020-07-12T23:24:38.000Z | 2020-07-12T23:24:38.000Z | localflavor/dk/forms.py | KonstantinKlepikov/django-localflavor | 87133f6cea1799e0b5e073dbc727dc88746f8fa8 | [
"BSD-3-Clause"
] | null | null | null | localflavor/dk/forms.py | KonstantinKlepikov/django-localflavor | 87133f6cea1799e0b5e073dbc727dc88746f8fa8 | [
"BSD-3-Clause"
] | 1 | 2020-01-17T16:26:54.000Z | 2020-01-17T16:26:54.000Z | """Denmark specific Form helpers."""
| 33.259259 | 94 | 0.759465 | """Denmark specific Form helpers."""
from django.core.exceptions import ValidationError
from django.forms import fields, widgets
from django.utils.translation import gettext_lazy as _
from .dk_municipalities import DK_MUNICIPALITIES
from .dk_postalcodes import DK_POSTALCODES
def postal_code_validator(value):
if... | 0 | 0 | 0 | 400 | 0 | 148 | 0 | 129 | 181 |
b8de9676b1c3db948ce6ca35eb77076d04fa3617 | 3,445 | py | Python | test/unit/test_browser.py | sanAkdam/chime | 1adbddbdddcdc2669086dee60d1bfb2f97535cff | [
"BSD-3-Clause"
] | 8 | 2015-02-05T22:12:41.000Z | 2015-05-15T16:15:14.000Z | test/unit/test_browser.py | sanAkdam/chime | 1adbddbdddcdc2669086dee60d1bfb2f97535cff | [
"BSD-3-Clause"
] | 168 | 2015-02-02T23:02:52.000Z | 2015-05-15T21:54:07.000Z | test/unit/test_browser.py | codeforamerica/bizarro-cms | 1adbddbdddcdc2669086dee60d1bfb2f97535cff | [
"BSD-3-Clause"
] | 5 | 2016-11-20T15:51:32.000Z | 2021-04-16T09:44:08.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 37.043011 | 116 | 0.613933 | import unittest
from unittest import TestCase
from acceptance.browser import Browser
class TestBrowser(TestCase):
def test_creation(self):
browser = Browser('Windows', '7', "IE", '8.0')
self.assertEqual('Windows', browser.os)
self.assertEqual('7', browser.os_version)
self.assertEq... | 0 | 0 | 0 | 3,286 | 0 | 0 | 0 | 25 | 68 |
23198638402b93bfa4324851435640a23d8cb61f | 4,889 | py | Python | logplayer/r2files.py | rug/robosoc2d | 7a018f8ef6974f96a44df018b8adb185e2c07c63 | [
"MIT"
] | null | null | null | logplayer/r2files.py | rug/robosoc2d | 7a018f8ef6974f96a44df018b8adb185e2c07c63 | [
"MIT"
] | null | null | null | logplayer/r2files.py | rug/robosoc2d | 7a018f8ef6974f96a44df018b8adb185e2c07c63 | [
"MIT"
] | null | null | null | # (c) 2021 Ruggero Rossi
# Load a Robosoc2d game state log
# supported version: 1.0.0 | 36.214815 | 77 | 0.55676 | # (c) 2021 Ruggero Rossi
# Load a Robosoc2d game state log
# supported version: 1.0.0
def load_state_log(file_name):
history = None
with open(file_name, 'r') as f:
game={}
version=f.readline()
if len(version)==0 :
return None
game['ver']=version
game['team1... | 0 | 0 | 0 | 0 | 0 | 4,781 | 0 | 0 | 23 |
6d78cbb20f53042b0737e27a57734137bf0a0e4c | 8,198 | py | Python | theano/sandbox/mkl/tests/test_conv.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 64 | 2016-10-02T20:41:56.000Z | 2020-03-11T14:59:40.000Z | theano/sandbox/mkl/tests/test_conv.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 4 | 2017-06-12T05:12:38.000Z | 2018-03-15T03:16:30.000Z | theano/sandbox/mkl/tests/test_conv.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 30 | 2016-10-27T21:59:00.000Z | 2021-02-20T09:55:14.000Z | import theano
import unittest
import numpy
from nose.plugins.skip import SkipTest
from theano.sandbox import mkl
numpy.random.seed(123)
if not mkl.mkl_available:
raise SkipTest('Optional package MKL disabled')
if theano.config.mode == 'FAST_COMPILE':
mode_with_mkl = theano.compile.mode.get_mode('FAST_RUN').i... | 44.797814 | 123 | 0.639302 | import theano
import unittest
import numpy
from nose.plugins.skip import SkipTest
from theano import tensor as T
from theano.tensor.nnet import conv2d
from theano.sandbox import mkl
from theano.sandbox.mkl.basic_ops import U2IConv, I2U
from theano.sandbox.mkl.mkl_conv import Conv2D
numpy.random.seed(123)
if not mkl.m... | 0 | 0 | 0 | 7,353 | 0 | 0 | 0 | 82 | 134 |
0a99668876349e7b2f9a56a2f17351b4ba01af2a | 3,837 | py | Python | tests/python_tests.py | reasoned-ai/norm | 5e45d5917ce8745c9a757a0c6b5e689ea0cac19f | [
"Apache-2.0"
] | 8 | 2019-07-22T08:57:20.000Z | 2021-03-26T13:51:02.000Z | tests/python_tests.py | xumiao/norm | 5e45d5917ce8745c9a757a0c6b5e689ea0cac19f | [
"Apache-2.0"
] | null | null | null | tests/python_tests.py | xumiao/norm | 5e45d5917ce8745c9a757a0c6b5e689ea0cac19f | [
"Apache-2.0"
] | 1 | 2019-11-16T13:37:35.000Z | 2019-11-16T13:37:35.000Z | """Unit tests for embedding Python code"""
| 30.696 | 70 | 0.484754 | """Unit tests for embedding Python code"""
import datetime
from pandas import DataFrame
from tests.utils import NormTestCase
class PythonTestCase(NormTestCase):
def test_python_declaration(self):
script = """
test := {{
from datetime import datetime
test = datetime.utcno... | 0 | 0 | 0 | 3,686 | 0 | 0 | 0 | 16 | 91 |
0a67f4076fdfe5bc717c7292a9258ff71ce35595 | 10,696 | py | Python | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/network/bitcoin_transaction.py | SabheeR/hobbits | 8bfb997940c73467af2ceb0275c470b763d2c1bf | [
"MIT"
] | 304 | 2020-02-07T21:05:22.000Z | 2022-03-24T05:30:37.000Z | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/network/bitcoin_transaction.py | SabheeR/hobbits | 8bfb997940c73467af2ceb0275c470b763d2c1bf | [
"MIT"
] | 2,107 | 2019-11-05T09:26:16.000Z | 2022-02-14T13:35:36.000Z | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/network/bitcoin_transaction.py | SabheeR/hobbits | 8bfb997940c73467af2ceb0275c470b763d2c1bf | [
"MIT"
] | 30 | 2020-03-11T14:36:43.000Z | 2022-03-07T04:45:17.000Z | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but y... | 50.691943 | 164 | 0.553291 | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
import collections
from enum import Enum
if parse_version(kaitaistruct.__version__) < parse_versi... | 0 | 0 | 0 | 10,206 | 0 | 0 | 0 | 36 | 89 |
3a917aec646616b14d05103f2a853a51a6359d7f | 459 | py | Python | gitup/test/test_bookmarks.py | hr157/git-repo-updater | 4ad20a6979226bf066740287accc8239d82a89ec | [
"MIT"
] | 772 | 2015-01-17T09:11:07.000Z | 2022-03-23T08:50:31.000Z | gitup/test/test_bookmarks.py | hr157/git-repo-updater | 4ad20a6979226bf066740287accc8239d82a89ec | [
"MIT"
] | 50 | 2015-03-12T14:33:51.000Z | 2022-03-10T07:58:54.000Z | gitup/test/test_bookmarks.py | hr157/git-repo-updater | 4ad20a6979226bf066740287accc8239d82a89ec | [
"MIT"
] | 110 | 2015-01-30T07:27:23.000Z | 2021-12-15T07:22:20.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2018 Ben Kurtovic <ben.kurtovic@gmail.com>
# Released under the terms of the MIT License. See LICENSE for details.
from __future__ import print_function, unicode_literals
| 30.6 | 71 | 0.736383 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2018 Ben Kurtovic <ben.kurtovic@gmail.com>
# Released under the terms of the MIT License. See LICENSE for details.
from __future__ import print_function, unicode_literals
from gitup import config
def test_empty_list(tmpdir, capsys):
config_path = tmpdir / "config"
... | 0 | 0 | 0 | 0 | 0 | 190 | 0 | 3 | 46 |
8d619e7f57b45654b3e4b1e082e471adaafd8081 | 596 | py | Python | benchmark/matrix_product.py | xu3kev/bril | 7d21628621b584e1ec09b3960bf9909276ba7f25 | [
"MIT"
] | null | null | null | benchmark/matrix_product.py | xu3kev/bril | 7d21628621b584e1ec09b3960bf9909276ba7f25 | [
"MIT"
] | null | null | null | benchmark/matrix_product.py | xu3kev/bril | 7d21628621b584e1ec09b3960bf9909276ba7f25 | [
"MIT"
] | null | null | null | from random import randint
cg = CG()
n=20
c = [[Var("int") for i in range(n)] for i in range(n)]
a = [[Var("int") for i in range(n)] for i in range(n)]
b = [[Var("int") for i in range(n)] for i in range(n)]
m=100
for vs in a:
for v in vs:
cg.init(v, randint(0,m))
for vs in b:
for v in vs:
c... | 19.225806 | 54 | 0.510067 | from cg import *
from random import randint
cg = CG()
n=20
c = [[Var("int") for i in range(n)] for i in range(n)]
a = [[Var("int") for i in range(n)] for i in range(n)]
b = [[Var("int") for i in range(n)] for i in range(n)]
m=100
for vs in a:
for v in vs:
cg.init(v, randint(0,m))
for vs in b:
for v... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 22 |
d00adb83565673cb264520ebee0b3eda48e2f0c5 | 2,523 | py | Python | weighted_mean_prediction/random_forest/tuned_rf_model.py | fegb-dataset22/dataset22 | 6642a01ca7ab9948c9b5ffc3aae1201cd8c72f0b | [
"MIT"
] | null | null | null | weighted_mean_prediction/random_forest/tuned_rf_model.py | fegb-dataset22/dataset22 | 6642a01ca7ab9948c9b5ffc3aae1201cd8c72f0b | [
"MIT"
] | null | null | null | weighted_mean_prediction/random_forest/tuned_rf_model.py | fegb-dataset22/dataset22 | 6642a01ca7ab9948c9b5ffc3aae1201cd8c72f0b | [
"MIT"
] | null | null | null | import os.path
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import metrics
from sklearn.ensemble import RandomForestRegressor
from hyperparameter_tuning.study_functions import load_study
from root import ROOT_DIR
from weighted_mean_prediction.data_setup import get_encoded_split_data
from weighted_... | 37.656716 | 100 | 0.738407 | import os.path
from typing import Dict
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import metrics
from sklearn.ensemble import RandomForestRegressor
from hyperparameter_tuning.study_functions import load_study
from root import ROOT_DIR
from weighted_mean_prediction.data_setup import get_encoded_s... | 0 | 0 | 0 | 0 | 0 | 464 | 0 | 80 | 90 |
0278f07d5c4fcf43dea6388a703c9cfa378a80f3 | 4,464 | py | Python | Evaluation_Protocol/Task2_VideoTextSpotting/utils/Annotation_Deal/vis.py | weijiawu/BOVText-Benchmark | 375cc1c72e20fb751e17a33c74fc4ca5c1557389 | [
"CC-BY-4.0"
] | 24 | 2021-10-12T04:02:31.000Z | 2022-03-31T07:19:17.000Z | Evaluation_Protocol/Task2_VideoTextSpotting/utils/Annotation_Deal/vis.py | maoxiaofei99/BOVText-Benchmark | 880342867704f8be78fb8f8e1615a234a287a574 | [
"CC-BY-4.0"
] | 1 | 2021-10-12T04:06:14.000Z | 2021-10-12T04:06:14.000Z | Evaluation_Protocol/Task2_VideoTextSpotting/utils/Annotation_Deal/vis.py | maoxiaofei99/BOVText-Benchmark | 880342867704f8be78fb8f8e1615a234a287a574 | [
"CC-BY-4.0"
] | 5 | 2021-11-29T05:18:36.000Z | 2022-02-27T02:22:47.000Z | # -*- coding: utf-8 -*-
import cv2
import os
import numpy as np
# import Levenshtein
from cv2 import VideoWriter_fourcc
from tqdm import tqdm
import shutil
def Frames2Video(frames_dir=""):
''' frames_dir '''
img_root = frames_dir #'E:\\KSText\\videos_frames\\video_14_6'
image = cv2.imread(os.path.jo... | 35.428571 | 144 | 0.600582 | # -*- coding: utf-8 -*-
import cv2
import os
import copy
import numpy as np
import math
# import Levenshtein
from cv2 import VideoWriter, VideoWriter_fourcc
import json
from tqdm import tqdm
from PIL import Image, ImageDraw, ImageFont
import shutil
def Frames2Video(frames_dir=""):
''' 将frames_dir下面的所有视频帧合成一个视频 '... | 168 | 0 | 0 | 0 | 0 | 686 | 0 | 5 | 138 |
132e0421e9b24a450962f82bb4efb1ae59d84d80 | 5,814 | py | Python | vnpy_tinysoft/tinysoft_datafeed.py | noranhe/vnpy_tinysoft | aaa00679adf93b40710e03113411adc24a98a038 | [
"MIT"
] | null | null | null | vnpy_tinysoft/tinysoft_datafeed.py | noranhe/vnpy_tinysoft | aaa00679adf93b40710e03113411adc24a98a038 | [
"MIT"
] | 1 | 2021-10-30T05:32:06.000Z | 2021-11-01T11:36:15.000Z | vnpy_tinysoft/tinysoft_datafeed.py | vnpy/vnpy_tinysoft | 0d97a91251c02f1b2a7e4afd707a2157056605c6 | [
"MIT"
] | null | null | null | from datetime import timedelta
from typing import Dict
from pytz import timezone
from vnpy.trader.constant import Exchange, Interval
EXCHANGE_MAP: Dict[Exchange, str] = {
Exchange.SSE: "SH",
Exchange.SZSE: "SZ"
}
INTERVAL_MAP: Dict[Interval, str] = {
Interval.MINUTE: "cy_1m",
Interval.HOUR: "cy_60m",... | 31.945055 | 133 | 0.491916 | from datetime import datetime, timedelta
from typing import Dict, List, Optional
from pytz import timezone
from vnpy.trader.setting import SETTINGS
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import BarData, TickData, HistoryRequest
from vnpy.trader.utility import extract_vt_symbol
from... | 120 | 0 | 0 | 4,959 | 0 | 0 | 0 | 162 | 135 |
e2d1dcb2354936fd158943bcf5fefb6597f1fd28 | 1,203 | py | Python | d8.py | sdamashek/adventofcode | 68b50d16246657313ce491b1b1b047e743f687fa | [
"Unlicense"
] | null | null | null | d8.py | sdamashek/adventofcode | 68b50d16246657313ce491b1b1b047e743f687fa | [
"Unlicense"
] | null | null | null | d8.py | sdamashek/adventofcode | 68b50d16246657313ce491b1b1b047e743f687fa | [
"Unlicense"
] | null | null | null | inp = open('input_d8.txt').read()
arr = [[0 for i in range(50)] for j in range(6)]
for i in inp.split('\n')[:-1]:
if i.startswith('rotate row'):
rotaterow(int(i.split('y=')[1].split(' ')[0]), int(i.split('by ')[1]))
elif i.startswith('rotate column'):
print(i)
rotatecol(int(i.split('x... | 23.134615 | 78 | 0.47714 | inp = open('input_d8.txt').read()
arr = [[0 for i in range(50)] for j in range(6)]
def rect(x,y):
global arr
for i in range(x):
for j in range(y):
print(i,j)
arr[j][i] = 1
def rotatecol(x,n):
global arr
for _ in range(n):
first = arr[5][x]
for i in rang... | 0 | 0 | 0 | 0 | 0 | 584 | 0 | 0 | 92 |
3d85f4be772c1a036395de1aa5c734416e429682 | 11,772 | py | Python | core/tenhou/log.py | SakuraSa/TenhouLoggerX | 7d6bcfb7e22d631673c61321f3af1c05ec011db5 | [
"MIT"
] | 2 | 2016-09-19T16:33:29.000Z | 2017-12-09T01:02:39.000Z | core/tenhou/log.py | SakuraSa/TenhouLoggerX | 7d6bcfb7e22d631673c61321f3af1c05ec011db5 | [
"MIT"
] | null | null | null | core/tenhou/log.py | SakuraSa/TenhouLoggerX | 7d6bcfb7e22d631673c61321f3af1c05ec011db5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
"""
core.tenhou.log
"""
__author__ = 'Rnd495'
import os
import json
import datetime
import urllib
from core.configs import Configs
configs = Configs.instance()
def get_results(ref_list, player_name):
"""
do statistics on given refs for given player
result dict f... | 29.802532 | 116 | 0.569147 | #!/usr/bin/env python
# coding=utf-8
"""
core.tenhou.log
"""
__author__ = 'Rnd495'
import os
import json
import datetime
import urllib
from core.configs import Configs
configs = Configs.instance()
class Log(object):
"""
Log
"""
def __init__(self, ref):
with open(Log.get_file_name(ref), 'r... | 30 | 2,357 | 0 | 4,883 | 0 | 185 | 0 | 0 | 73 |
b97e642f766dedecd2b8dc7fbaf1c4aba0a274fb | 5,267 | py | Python | tests/parser/features/test_assert.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 1 | 2021-12-20T16:19:47.000Z | 2021-12-20T16:19:47.000Z | tests/parser/features/test_assert.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 1 | 2022-03-19T00:45:47.000Z | 2022-03-19T00:45:47.000Z | tests/parser/features/test_assert.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | null | null | null |
# web3 returns f"execution reverted: {err_str}"
# TODO move exception string parsing logic into assert_tx_failed
invalid_code = [
"""
@external
def test(a: int128) -> int128:
assert a > 1, ""
return 1 + a
""",
"""
@external
def test(a: int128) -> int128:
raise ""
""",
"""
@external... | 25.444444 | 94 | 0.65806 | import pytest
from eth_abi import decode_single
from eth_tester.exceptions import TransactionFailed
# web3 returns f"execution reverted: {err_str}"
# TODO move exception string parsing logic into assert_tx_failed
def _fixup_err_str(s):
return s.replace("execution reverted: ", "")
def test_assert_refund(w3, get_... | 0 | 244 | 0 | 0 | 0 | 3,754 | 0 | 34 | 272 |
3f29ebd88cd6558019edc58f99d89c4d08dc0aae | 8,654 | py | Python | netl2api/l2api/__init__.py | locaweb/netl2api | f84c0362d1676c8771015b7cc48461e44a21c34d | [
"Apache-2.0"
] | 3 | 2015-04-08T18:50:02.000Z | 2019-06-05T22:40:45.000Z | netl2api/l2api/__init__.py | locaweb/netl2api | f84c0362d1676c8771015b7cc48461e44a21c34d | [
"Apache-2.0"
] | null | null | null | netl2api/l2api/__init__.py | locaweb/netl2api | f84c0362d1676c8771015b7cc48461e44a21c34d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8; -*-
#
# 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
#
# Unles... | 40.064815 | 122 | 0.605616 | #!/usr/bin/python
# -*- coding: utf-8; -*-
#
# 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
#
# Unles... | 0 | 0 | 0 | 7,694 | 0 | 0 | 0 | 79 | 110 |
53e3d50dfd8819a70c242ed90be54300221236ee | 12,531 | py | Python | pymeasure/instruments/agilent/agilent8257D.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | pymeasure/instruments/agilent/agilent8257D.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | pymeasure/instruments/agilent/agilent8257D.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2022 PyMeasure Developers
#
# 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 limit... | 36.533528 | 100 | 0.615194 | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2022 PyMeasure Developers
#
# 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 limit... | 0 | 0 | 0 | 11,223 | 0 | 0 | 0 | 83 | 68 |
dec7d6d3d15ea5d55e90e3e5423d903170fe436f | 12,428 | py | Python | lib/googlecloudsdk/command_lib/storage/resources/s3_resource_reference.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/command_lib/storage/resources/s3_resource_reference.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/storage/resources/s3_resource_reference.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2020 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 requir... | 38.716511 | 89 | 0.745735 | # -*- coding: utf-8 -*- #
# Copyright 2020 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 requir... | 0 | 0 | 0 | 1,152 | 0 | 0 | 0 | 54 | 68 |
d66df52d49ff61c5175e83fab8cd02546b04169c | 1,982 | py | Python | apistar_sentry.py | LeadPages/apistar_sentry | f718784b256399ae04f4e8bf82b177f9cc3b1008 | [
"MIT"
] | 2 | 2018-06-10T14:37:04.000Z | 2018-06-16T22:33:46.000Z | apistar_sentry.py | LeadPages/apistar_sentry | f718784b256399ae04f4e8bf82b177f9cc3b1008 | [
"MIT"
] | 3 | 2020-03-24T17:19:55.000Z | 2021-02-02T22:08:44.000Z | apistar_sentry.py | LeadPages/apistar_sentry | f718784b256399ae04f4e8bf82b177f9cc3b1008 | [
"MIT"
] | 1 | 2018-04-16T18:44:33.000Z | 2018-04-16T18:44:33.000Z |
__version__ = "0.2.0"
| 26.426667 | 72 | 0.590817 | import typing
from apistar import Settings
from apistar.interfaces import Auth
from apistar.types import ReturnValue
from raven import Client
__version__ = "0.2.0"
class Sentry:
def __init__(self, settings: Settings) -> None:
self.client = Client(
settings["SENTRY_DSN"],
environm... | 0 | 398 | 0 | 1,123 | 0 | 199 | 0 | 32 | 203 |
460ed8df205faa3ecff6b37fb600ecfce371a297 | 7,121 | py | Python | app.py | tanasijevich/project3 | cd4870727e31bad47868625a59a565f4b96d80a5 | [
"MIT"
] | null | null | null | app.py | tanasijevich/project3 | cd4870727e31bad47868625a59a565f4b96d80a5 | [
"MIT"
] | null | null | null | app.py | tanasijevich/project3 | cd4870727e31bad47868625a59a565f4b96d80a5 | [
"MIT"
] | null | null | null | # import necessary libraries
# from models import create_classes
from sqlalchemy.ext.automap import automap_base
from sqlalchemy import create_engine
from flask import (Flask)
# Read data from csv
#csv_file = "data/Chicago Health Atlas.csv"
#df = pd.read_csv(csv_file)
#df.head()
#df.rename(columns={"VRDIBR_2015-2019"... | 42.136095 | 576 | 0.72869 | # import necessary libraries
# from models import create_classes
import pandas as pd
import os
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from sqlite3 import connect
import json
from flask import (
Flask,
rend... | 0 | 5,028 | 0 | 0 | 0 | 0 | 0 | 76 | 314 |
e202b3b1b0dd6517b189261d661038ca7be2cad9 | 2,377 | py | Python | lambda/extract_yelp/extract.py | Rdbaker/barfinder | 63c75dc99f2371371aa8072078175558d1917864 | [
"BSD-3-Clause"
] | null | null | null | lambda/extract_yelp/extract.py | Rdbaker/barfinder | 63c75dc99f2371371aa8072078175558d1917864 | [
"BSD-3-Clause"
] | null | null | null | lambda/extract_yelp/extract.py | Rdbaker/barfinder | 63c75dc99f2371371aa8072078175558d1917864 | [
"BSD-3-Clause"
] | null | null | null | import logging
from models import business as Business
logging.getLogger().setLevel(logging.INFO)
def business_exists(yelp_id, conn):
"""Return True if the business exists."""
return conn.execute(Business.select().where(Business.c.yelp_id == yelp_id))\
.first() is not None
def delete_business(yel... | 32.561644 | 80 | 0.640303 | import logging
from models import tag as Tag, business as Business, business_tag_join_table
logging.getLogger().setLevel(logging.INFO)
def parse_yelp_business(business):
return {
'source': 'yelp',
'raw_yelp_data': business,
'yelp_id': business.get('id'),
'name': business.get('nam... | 0 | 0 | 0 | 0 | 0 | 1,706 | 0 | 37 | 161 |
5ddcfbd5c5a68beee52f20bf25f10cc164269d23 | 14,652 | py | Python | doubling_agent/motility_functions.py | lkmartin90/doubling_agent | 73a7f06aa43c5fa51ea1263b72ebe6f8319bf894 | [
"MIT"
] | 1 | 2020-12-03T15:47:24.000Z | 2020-12-03T15:47:24.000Z | doubling_agent/motility_functions.py | lkmartin90/doubling_agent | 73a7f06aa43c5fa51ea1263b72ebe6f8319bf894 | [
"MIT"
] | null | null | null | doubling_agent/motility_functions.py | lkmartin90/doubling_agent | 73a7f06aa43c5fa51ea1263b72ebe6f8319bf894 | [
"MIT"
] | null | null | null |
###
# Broadly the same as "basic_functions.py" but updated to include motility
# intentionally trying to keep them separate so as not to slow down the basic version
###
| 36.35732 | 115 | 0.574597 | from random import random
from random import choice
import numpy as np
import plotly.express as px
import struct
import operator
###
# Broadly the same as "basic_functions.py" but updated to include motility
# intentionally trying to keep them separate so as not to slow down the basic version
###
class MotilityParam... | 0 | 0 | 0 | 1,247 | 0 | 12,698 | 0 | -3 | 523 |
7c713c20032eec8a8f8dbf77f8cd9a9bca904c31 | 1,454 | py | Python | TSP.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | 1 | 2020-12-10T17:36:39.000Z | 2020-12-10T17:36:39.000Z | TSP.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | null | null | null | TSP.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | 1 | 2021-01-05T13:08:07.000Z | 2021-01-05T13:08:07.000Z | """ TSP SIMULATED ANNEALING """
# Imports
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# read data from file
filename = "eil51.tsp"
f = open(f"TSP-configurations/{filename}.txt", "r")
network = f.readlines()[6:-1]
# create dictionary to store coordinates
nodes = dict()
# split data and pu... | 25.508772 | 209 | 0.636176 | """ TSP SIMULATED ANNEALING """
# Imports
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# read data from file
filename = "eil51.tsp"
f = open(f"TSP-configurations/{filename}.txt", "r")
network = f.readlines()[6:-1]
# create dictionary to store coordinates
nodes = dict()
# split data and pu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
35b4a123604f3ad39f518c8cd7cd58c05193a395 | 7,579 | py | Python | common-python/rest_wrappers/oc/oc/upload_storage_object.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 28 | 2016-11-07T14:03:25.000Z | 2022-02-01T08:46:52.000Z | common-python/rest_wrappers/oc/oc/upload_storage_object.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 3 | 2016-11-09T13:23:03.000Z | 2018-04-05T15:49:22.000Z | common-python/rest_wrappers/oc/oc/upload_storage_object.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 13 | 2016-10-27T17:59:38.000Z | 2022-02-18T04:38:38.000Z | #!/usr/bin/python
# Copyright (c) 2013, 2014-2017 Oracle and/or its affiliates. All rights reserved.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = "Andrew Hopkinson (Oracle Cloud Solutions A-Team)"
__copyright__ = "Copyright (... | 35.919431 | 197 | 0.613933 | #!/usr/bin/python
# Copyright (c) 2013, 2014-2017 Oracle and/or its affiliates. All rights reserved.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = "Andrew Hopkinson (Oracle Cloud Solutions A-Team)"
__copyright__ = "Copyright (... | 0 | 0 | 0 | 0 | 0 | 6,118 | 0 | -2 | 601 |
70aa394b1e7534f0761f177159418f6363ceeb78 | 14,891 | py | Python | snpy/get_osc.py | emirkmo/snpy | 2a0153c84477ba8a30310d7dbca3d5a8f24de3c6 | [
"MIT"
] | 6 | 2019-01-14T19:40:45.000Z | 2021-06-05T12:19:39.000Z | snpy/get_osc.py | emirkmo/snpy | 2a0153c84477ba8a30310d7dbca3d5a8f24de3c6 | [
"MIT"
] | 3 | 2017-04-25T20:06:22.000Z | 2021-06-09T20:46:41.000Z | snpy/get_osc.py | emirkmo/snpy | 2a0153c84477ba8a30310d7dbca3d5a8f24de3c6 | [
"MIT"
] | 8 | 2017-04-25T19:57:57.000Z | 2021-11-12T11:54:19.000Z | '''
Module for SNooPy to download/parse data from the Open Supernova Catalog.
'''
from __future__ import print_function
import six
import json
if six.PY3:
import urllib.request as urllib
else:
import urllib
from astropy.coordinates import Angle
from snpy import sn, lc, fset
from numpy import array, log10
import ... | 36.05569 | 92 | 0.555906 | '''
Module for SNooPy to download/parse data from the Open Supernova Catalog.
'''
from __future__ import print_function
import six
import json
if six.PY3:
import urllib.request as urllib
else:
import urllib
from astropy.coordinates import Angle
from snpy import sn,lc,fset
from numpy import array,log10
import ast... | 0 | 0 | 0 | 0 | 0 | 476 | 0 | -3 | 23 |
b838c3e4fd3bce1a2cc716eb2ba8a849168a9356 | 744 | py | Python | Day 15 - OOP/main.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 1 | 2022-01-28T13:55:39.000Z | 2022-01-28T13:55:39.000Z | Day 15 - OOP/main.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 1 | 2022-02-02T00:13:18.000Z | 2022-02-03T11:32:53.000Z | Day 15 - OOP/main.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 2 | 2022-02-07T20:49:36.000Z | 2022-02-19T21:22:15.000Z | from menu import Menu
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine
money_machine = MoneyMachine()
coffee_maker = CoffeeMaker()
menu = Menu()
coffee_maker.report()
money_machine.report()
coffee_machine_is_on = True
while coffee_machine_is_on:
choices = menu.get_items()
user_ord... | 24.8 | 97 | 0.717742 | from menu import Menu, MenuItem
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine
money_machine = MoneyMachine()
coffee_maker = CoffeeMaker()
menu = Menu()
coffee_maker.report()
money_machine.report()
coffee_machine_is_on = True
while coffee_machine_is_on:
choices = menu.get_items()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0 |
fc8a2c85d00bef3bd3bd075b7a046a93e1e9c68c | 4,269 | py | Python | intera_interface/src/intera_interface/digital_io.py | thinclab/intera_sdk | 556de67a88049687404734404e16b147943cde3c | [
"Apache-2.0"
] | 38 | 2017-01-20T15:44:22.000Z | 2022-01-28T15:15:40.000Z | intera_interface/src/intera_interface/digital_io.py | thinclab/intera_sdk | 556de67a88049687404734404e16b147943cde3c | [
"Apache-2.0"
] | 47 | 2016-12-16T19:41:03.000Z | 2022-03-21T14:04:04.000Z | intera_interface/src/intera_interface/digital_io.py | thinclab/intera_sdk | 556de67a88049687404734404e16b147943cde3c | [
"Apache-2.0"
] | 52 | 2017-02-03T13:26:23.000Z | 2021-03-16T14:25:51.000Z | # Copyright (c) 2013-2018, Rethink Robotics 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 ag... | 29.853147 | 79 | 0.606699 | # Copyright (c) 2013-2018, Rethink Robotics 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 ag... | 0 | 465 | 0 | 3,049 | 0 | 0 | 0 | 44 | 115 |
07a2a8bad2c82e238b18e385c8b1b2d9e1a12999 | 2,535 | py | Python | tests/models/mysql_dumps_test.py | ywlianghang/mysql_streamer | 7fc85efaca3db6a387ea4b791632c2df2d04cb3e | [
"Apache-2.0"
] | 419 | 2016-11-17T18:41:47.000Z | 2022-03-14T02:50:02.000Z | tests/models/mysql_dumps_test.py | ywlianghang/mysql_streamer | 7fc85efaca3db6a387ea4b791632c2df2d04cb3e | [
"Apache-2.0"
] | 19 | 2016-11-30T18:09:00.000Z | 2019-04-02T06:20:02.000Z | tests/models/mysql_dumps_test.py | ywlianghang/mysql_streamer | 7fc85efaca3db6a387ea4b791632c2df2d04cb3e | [
"Apache-2.0"
] | 90 | 2016-11-23T06:26:20.000Z | 2022-01-22T09:24:42.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ag... | 28.483146 | 77 | 0.672189 | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ag... | 0 | 1,756 | 0 | 0 | 0 | 0 | 0 | 32 | 69 |
0ec5fc82f6363d39869fe20305aa7077435f30d4 | 1,232 | py | Python | WORK/working/crime_vis/crime.py | jessicagtz/WorkingFolder | 4791618e1ec12b9cc38a6ceb1ff03bab1799b0bc | [
"MIT"
] | null | null | null | WORK/working/crime_vis/crime.py | jessicagtz/WorkingFolder | 4791618e1ec12b9cc38a6ceb1ff03bab1799b0bc | [
"MIT"
] | null | null | null | WORK/working/crime_vis/crime.py | jessicagtz/WorkingFolder | 4791618e1ec12b9cc38a6ceb1ff03bab1799b0bc | [
"MIT"
] | 1 | 2018-12-06T21:33:44.000Z | 2018-12-06T21:33:44.000Z | # import dependencies
from flask import Flask
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine
# database setup using automap
engine = create_engine("sqlite:///chi_db.sqlite")
Base = automap_base()
# reflect the tables
Base.prepare(engine, refle... | 27.377778 | 117 | 0.730519 | # import dependencies
from flask import Flask, jsonify, render_template, request, redirect
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
import pandas as pd
import numpy as np
import datetime as dt
# database setup using au... | 0 | 449 | 0 | 0 | 0 | 0 | 0 | 55 | 95 |