hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8b9f52988b8506d1eb0785b2864f23355a95bc22 | 1,098 | py | Python | alipay/aop/api/response/AlipayUserCertinfoMaskedQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayUserCertinfoMaskedQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayUserCertinfoMaskedQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.MaskedUserCertView import MaskedUserCertView
class AlipayUserCertinfoMaskedQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayU... | 33.272727 | 110 | 0.684882 |
3895bb42085142c7617be2fe829c2f4c12d07740 | 5,234 | py | Python | tfmiss/keras/callbacks/lrfind.py | shkarupa-alex/tfmiss | 4fe1bb3a47327c07711f910ee53319167032b6af | [
"MIT"
] | 1 | 2019-06-25T15:58:20.000Z | 2019-06-25T15:58:20.000Z | tfmiss/keras/callbacks/lrfind.py | shkarupa-alex/tfmiss | 4fe1bb3a47327c07711f910ee53319167032b6af | [
"MIT"
] | 1 | 2021-11-11T12:56:51.000Z | 2021-11-11T12:56:51.000Z | tfmiss/keras/callbacks/lrfind.py | shkarupa-alex/tfmiss | 4fe1bb3a47327c07711f910ee53319167032b6af | [
"MIT"
] | 2 | 2020-02-11T15:46:58.000Z | 2021-11-21T02:47:36.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import tempfile
from keras import backend, callbacks
from keras.utils.generic_utils import register_keras_serializable
@register_keras_serializable(package='Miss')
c... | 36.096552 | 111 | 0.619985 |
10322f3467a2b9cbebec8237a571a55f8704fcb2 | 186 | py | Python | flaskrestful/FlaskProject/App/views/__init__.py | riverstation/project-all | c56f1879e1303d561e95a3ff3a70f94fb5fa2191 | [
"Apache-2.0"
] | null | null | null | flaskrestful/FlaskProject/App/views/__init__.py | riverstation/project-all | c56f1879e1303d561e95a3ff3a70f94fb5fa2191 | [
"Apache-2.0"
] | null | null | null | flaskrestful/FlaskProject/App/views/__init__.py | riverstation/project-all | c56f1879e1303d561e95a3ff3a70f94fb5fa2191 | [
"Apache-2.0"
] | null | null | null | from App.views.MovieView import movie
from App.views.UserView import user
def init_views(app):
app.register_blueprint(blueprint=user)
app.register_blueprint(blueprint=movie)
| 18.6 | 43 | 0.790323 |
edb8a8b13cd64f1d686aff3cb249685039d73c20 | 44,023 | py | Python | examples/plotter.py | Guo-Jian-Wang/cmbNNCS | cd55e0a2344aa5182d099cf559bc986ae0351cb7 | [
"MIT"
] | null | null | null | examples/plotter.py | Guo-Jian-Wang/cmbNNCS | cd55e0a2344aa5182d099cf559bc986ae0351cb7 | [
"MIT"
] | null | null | null | examples/plotter.py | Guo-Jian-Wang/cmbNNCS | cd55e0a2344aa5182d099cf559bc986ae0351cb7 | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
sys.path.append('../..')
sys.path.append('../../..')
import coplot.plots as pl
import coplot.plot_settings as pls
import cmbnncs.simulator as simulator
import cmbnncs.utils as utils
import cmbnncs.spherical as spherical
import loader
import numpy as np
import matplotlib.pyplot as plt
im... | 43.287119 | 188 | 0.595416 |
e09a57fdeb86422c954754b01621e7ae486fc69c | 232 | py | Python | ersilia/db/hubdata/tables.py | ersilia-os/ersilia | eded117d6c7029ce4a497effdb514c21edfe3673 | [
"MIT"
] | 32 | 2020-07-30T20:31:05.000Z | 2022-03-31T17:27:14.000Z | ersilia/db/hubdata/tables.py | ersilia-os/ersilia | eded117d6c7029ce4a497effdb514c21edfe3673 | [
"MIT"
] | 59 | 2022-03-21T10:00:04.000Z | 2022-03-31T23:03:14.000Z | ersilia/db/hubdata/tables.py | ersilia-os/ersilia | eded117d6c7029ce4a497effdb514c21edfe3673 | [
"MIT"
] | 44 | 2022-03-17T13:11:07.000Z | 2022-03-31T19:44:16.000Z | import boto3
class DynamoDbTable(object):
def __init__(self):
pass
class PredictionsTable(DynamoDbTable):
def __init__(self):
pass
class ModelsTable(DynamoDbTable):
def __init__(self):
pass
| 13.647059 | 38 | 0.668103 |
d86b61afcee259774ea259045eeddfe085769f3f | 1,325 | py | Python | Thief Detection System/Model-1/detect.py | sams14/PropTech-Hackathon | b4d750918d4bc1f141f3778647d1a928fd37266d | [
"MIT"
] | 1 | 2021-07-31T14:55:04.000Z | 2021-07-31T14:55:04.000Z | Thief Detection System/Model-1/detect.py | sams14/PropTech-Hackathon | b4d750918d4bc1f141f3778647d1a928fd37266d | [
"MIT"
] | null | null | null | Thief Detection System/Model-1/detect.py | sams14/PropTech-Hackathon | b4d750918d4bc1f141f3778647d1a928fd37266d | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import matplotlib.pyplot as plt
from keras.models import load_model
print('model loading...')
model = load_model('face_CET.h5')
print('model loaded')
def preprocess(img):
img = cv2.resize(img,(200,200))
img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
img = img.reshape(1,200,200,1... | 31.547619 | 95 | 0.669434 |
3e89da075e1e7b0f70bbbb82fd91e99a6cf0b25a | 3,301 | py | Python | templates.py | jha8/cgi-lab | 1229f8ccb5036c76ba9bc6bbf55e00921fa5d822 | [
"Apache-2.0"
] | null | null | null | templates.py | jha8/cgi-lab | 1229f8ccb5036c76ba9bc6bbf55e00921fa5d822 | [
"Apache-2.0"
] | null | null | null | templates.py | jha8/cgi-lab | 1229f8ccb5036c76ba9bc6bbf55e00921fa5d822 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca>
#
# 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/licens... | 25.007576 | 97 | 0.557104 |
04027b722b61e15a71dcfaebab56da5c07e9ab62 | 9,249 | py | Python | projects/PanopticFCN_cityscapes/data/cityscapes/dataset_mapper.py | fatihyildiz-cs/detectron2 | 700b1e6685ca95a60e27cb961f363a2ca7f30d3c | [
"Apache-2.0"
] | 4 | 2021-07-13T13:36:38.000Z | 2022-01-27T09:51:26.000Z | projects/PanopticFCN_cityscapes/data/cityscapes/dataset_mapper.py | fatihyildiz-cs/detectron2 | 700b1e6685ca95a60e27cb961f363a2ca7f30d3c | [
"Apache-2.0"
] | null | null | null | projects/PanopticFCN_cityscapes/data/cityscapes/dataset_mapper.py | fatihyildiz-cs/detectron2 | 700b1e6685ca95a60e27cb961f363a2ca7f30d3c | [
"Apache-2.0"
] | 2 | 2021-09-10T11:26:26.000Z | 2022-01-27T09:51:40.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# Adapted from detectron2/data/dataset_mapper.py
import copy
import logging
import numpy as np
from typing import Callable, List, Union
import torch
import pycocotools
from detectron2.config import configurable
from detectron2.data import MetadataCatalog
from detectr... | 41.290179 | 113 | 0.697048 |
d8448caeba16b979c9ff5707d328b907fc2e7114 | 95 | py | Python | code_gazay/salt/src/components/TernausNetV2/abn/__init__.py | artyompal/kaggle_salt | 3c323755730745ac7bbfd106f1f20919cceef0ee | [
"MIT"
] | null | null | null | code_gazay/salt/src/components/TernausNetV2/abn/__init__.py | artyompal/kaggle_salt | 3c323755730745ac7bbfd106f1f20919cceef0ee | [
"MIT"
] | 1 | 2021-03-25T23:31:26.000Z | 2021-03-25T23:31:28.000Z | code_gazay/salt/src/components/TernausNetV2/abn/__init__.py | artyompal/kaggle_salt | 3c323755730745ac7bbfd106f1f20919cceef0ee | [
"MIT"
] | 1 | 2018-11-08T09:30:38.000Z | 2018-11-08T09:30:38.000Z | from .bn import ABN, InPlaceABN, InPlaceABNWrapper
from .residual import IdentityResidualBlock
| 31.666667 | 50 | 0.852632 |
f7a1231e5ca25cb855f87d50eb014c851eddf4e0 | 1,253 | py | Python | ML/Minor/code/common/generate_images_labels.py | SIgnlngX/Minor-Project | f000e16c67f8ce738af96556c161e9087d7bee0f | [
"MIT"
] | 4 | 2017-10-09T19:00:08.000Z | 2019-02-04T14:05:58.000Z | ML/Minor/code/common/generate_images_labels.py | SIgnlngX/Minor-Project | f000e16c67f8ce738af96556c161e9087d7bee0f | [
"MIT"
] | 6 | 2017-10-07T05:46:59.000Z | 2017-12-17T06:57:43.000Z | ML/Minor/code/common/generate_images_labels.py | SIgnlngX/sign-language-interpreter | f000e16c67f8ce738af96556c161e9087d7bee0f | [
"MIT"
] | 8 | 2017-10-06T11:21:07.000Z | 2021-05-02T18:40:41.000Z | #!/usr/bin/env python
from os import walk
from os.path import join, splitext
from ntpath import basename
def get_images_labels_list(images_dir_path):
"""
Recursively iterates through a directory and its subdirectories to list the info all the images found in it.
Returns a list of dictionary where each dic... | 36.852941 | 112 | 0.676776 |
b718ae114d6a000b2b381425892ed83ec8453ccc | 1,317 | py | Python | profdispatch.py | morepath/reg | 0ba834088c74f5478dd66e9eab771d1e09fbeb97 | [
"BSD-3-Clause"
] | 48 | 2015-01-10T02:32:25.000Z | 2021-12-16T15:17:25.000Z | profdispatch.py | morepath/reg | 0ba834088c74f5478dd66e9eab771d1e09fbeb97 | [
"BSD-3-Clause"
] | 42 | 2015-01-06T12:06:30.000Z | 2021-04-05T12:41:33.000Z | profdispatch.py | morepath/reg | 0ba834088c74f5478dd66e9eab771d1e09fbeb97 | [
"BSD-3-Clause"
] | 6 | 2015-05-28T07:02:04.000Z | 2020-09-29T20:44:05.000Z | from cProfile import run
from reg import dispatch
from reg import LruCachingKeyLookup
def get_key_lookup(r):
return LruCachingKeyLookup(
r,
component_cache_size=5000,
all_cache_size=5000,
fallback_cache_size=5000,
)
@dispatch(get_key_lookup=get_key_lookup)
def args0():
ra... | 17.103896 | 60 | 0.671222 |
c4180077c94a1c9221fd49afd14c2fd6fa26a6f0 | 731 | py | Python | apps/articles/models.py | Pavel1114/blogger | 37e20d94b8d78d65d0a3ef7ce0f68cf71baf24fa | [
"MIT"
] | null | null | null | apps/articles/models.py | Pavel1114/blogger | 37e20d94b8d78d65d0a3ef7ce0f68cf71baf24fa | [
"MIT"
] | null | null | null | apps/articles/models.py | Pavel1114/blogger | 37e20d94b8d78d65d0a3ef7ce0f68cf71baf24fa | [
"MIT"
] | null | null | null | from django.db.models import SET_NULL, CharField, ForeignKey, ImageField, TextField
from django.urls import reverse
from model_utils.models import TimeStampedModel
class Article(TimeStampedModel):
title = CharField("Название", max_length=1000)
text = TextField("Текст")
image = ImageField("изображение", up... | 33.227273 | 106 | 0.704514 |
43cad4b8611d6a458b6df69e780e2b5bd2db5ff3 | 5,054 | py | Python | autosklearn/pipeline/components/classification/liblinear_svc.py | FelixNeutatz/auto-sklearn | b5d141603332041475ed746aa1640334f5561aea | [
"BSD-3-Clause"
] | 2 | 2020-02-22T15:00:49.000Z | 2020-06-28T08:20:19.000Z | autosklearn/pipeline/components/classification/liblinear_svc.py | FelixNeutatz/auto-sklearn | b5d141603332041475ed746aa1640334f5561aea | [
"BSD-3-Clause"
] | null | null | null | autosklearn/pipeline/components/classification/liblinear_svc.py | FelixNeutatz/auto-sklearn | b5d141603332041475ed746aa1640334f5561aea | [
"BSD-3-Clause"
] | null | null | null | from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformFloatHyperparameter, \
CategoricalHyperparameter, Constant
from ConfigSpace.forbidden import ForbiddenEqualsClause, \
ForbiddenAndConjunction
from autosklearn.pipeline.components.base import AutoSklear... | 39.795276 | 88 | 0.611199 |
ce80da60e0dec7923295a60d598ed9f8bace9c7e | 4,871 | py | Python | reporter.py | ubiquill/infiltration-detection | 687a64a0917a3f02eff9d7697cead247a0c933e0 | [
"Unlicense"
] | 2 | 2015-04-17T04:30:28.000Z | 2015-04-17T21:03:45.000Z | reporter.py | ubiquill/infiltration-detection | 687a64a0917a3f02eff9d7697cead247a0c933e0 | [
"Unlicense"
] | null | null | null | reporter.py | ubiquill/infiltration-detection | 687a64a0917a3f02eff9d7697cead247a0c933e0 | [
"Unlicense"
] | null | null | null | try:
from cStringIO import StringIO
except:
from StringIO import StringIO
class UserReport:
def __init__(self, user, suspicious_subs):
self.first = True
self.user = user
self.suspicious_subs = suspicious_subs
self.outString = None
def __str__(self):
return sel... | 39.601626 | 194 | 0.552864 |
7b72fd0b01526189ee9750690c5d5ba61691ce85 | 6,206 | py | Python | code/multiagent/scenarios/simple_tag_1v1.py | rahul-dhavalikar/dqn-predator-prey-dynamics | 58c26d71c87bcfaaf729d1f710b9c4458ca4f473 | [
"MIT"
] | 1 | 2021-12-15T10:58:09.000Z | 2021-12-15T10:58:09.000Z | code/multiagent/scenarios/simple_tag_1v1.py | rahul-dhavalikar/dqn-predator-prey-dynamics | 58c26d71c87bcfaaf729d1f710b9c4458ca4f473 | [
"MIT"
] | null | null | null | code/multiagent/scenarios/simple_tag_1v1.py | rahul-dhavalikar/dqn-predator-prey-dynamics | 58c26d71c87bcfaaf729d1f710b9c4458ca4f473 | [
"MIT"
] | 2 | 2018-10-04T02:39:23.000Z | 2021-12-15T10:59:16.000Z | import numpy as np
from multiagent.core import World, Agent, Landmark
from multiagent.scenario import BaseScenario
class Scenario(BaseScenario):
def make_world(self):
world = World()
# set any world properties first
world.dim_c = 2
num_good_agents = 1
num_adversaries = 1
... | 37.841463 | 109 | 0.573638 |
b2a47ed1a0312af5e9062703589654adce7be82f | 3,034 | py | Python | meiduo_29/meiduo_29/apps/oauth/serializers.py | Adolph-Anthony/Django_meiduo-shopping-mall | 4437ad1b9ed99ab9447b41406535fbfe2d0fa53c | [
"MIT"
] | null | null | null | meiduo_29/meiduo_29/apps/oauth/serializers.py | Adolph-Anthony/Django_meiduo-shopping-mall | 4437ad1b9ed99ab9447b41406535fbfe2d0fa53c | [
"MIT"
] | null | null | null | meiduo_29/meiduo_29/apps/oauth/serializers.py | Adolph-Anthony/Django_meiduo-shopping-mall | 4437ad1b9ed99ab9447b41406535fbfe2d0fa53c | [
"MIT"
] | null | null | null | from django_redis import get_redis_connection
from rest_framework import serializers
from rest_framework_jwt.settings import api_settings
from users.models import User
from .utils import OAuthQQ
from .models import OAuthQQUser
class OAuthQQUserSerializer(serializers.ModelSerializer):
'''
QQ登录绑定用户
'''
s... | 33.711111 | 90 | 0.614041 |
ebd2c853428dc5c72d2d6b84a3e5d7e2f29e500b | 2,890 | py | Python | sketch/sketch.py | jack1142/GrandeCogs-V3 | 3a92096c96c98abe5d34998b00dea4967a30647f | [
"MIT"
] | 3 | 2018-06-09T21:56:58.000Z | 2018-08-26T01:34:55.000Z | sketch/sketch.py | jack1142/GrandeCogs-V3 | 3a92096c96c98abe5d34998b00dea4967a30647f | [
"MIT"
] | 4 | 2018-10-06T16:37:57.000Z | 2020-12-01T14:16:11.000Z | sketch/sketch.py | jack1142/GrandeCogs-V3 | 3a92096c96c98abe5d34998b00dea4967a30647f | [
"MIT"
] | 8 | 2018-08-26T01:29:41.000Z | 2020-01-17T16:06:31.000Z | import discord, base64, re
from redbot.core import checks, commands
from redbot.core import Config
from redbot.core.data_manager import bundled_data_path
from PIL import Image, ImageDraw
from io import BytesIO
BaseCog = getattr(commands, "Cog", object)
class Sketch(BaseCog):
def __init__(self,bot):
self.b... | 35.243902 | 94 | 0.608997 |
b4da5739cc2e9098d28fae1b899ac67e0e4f633d | 3,393 | py | Python | train_with_manifold/train_mlp.py | CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding | 36151165f0ce23c168b893a9e916023b34630cf3 | [
"MIT"
] | null | null | null | train_with_manifold/train_mlp.py | CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding | 36151165f0ce23c168b893a9e916023b34630cf3 | [
"MIT"
] | null | null | null | train_with_manifold/train_mlp.py | CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding | 36151165f0ce23c168b893a9e916023b34630cf3 | [
"MIT"
] | null | null | null | from sklearn.neural_network import MLPClassifier
from sklearn.model_selection import train_test_split
import numpy as np
import random
import time
import argparse
##################################MAIN#####################################
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Tra... | 32.009434 | 149 | 0.714412 |
cdbd5f0d9f375d91b92b86c1a1fb2faef1528ffe | 11,332 | py | Python | legion/robot/legion/robot/libraries/utils.py | legion-platform/legion | db3a1d99f1005cb881b16af6075a806725123031 | [
"ECL-2.0",
"Apache-2.0"
] | 19 | 2018-05-20T17:06:55.000Z | 2022-01-04T14:15:09.000Z | legion/robot/legion/robot/libraries/utils.py | legion-platform/legion | db3a1d99f1005cb881b16af6075a806725123031 | [
"ECL-2.0",
"Apache-2.0"
] | 917 | 2018-05-18T18:54:54.000Z | 2021-09-01T10:41:56.000Z | legion/robot/legion/robot/libraries/utils.py | legion-platform/legion | db3a1d99f1005cb881b16af6075a806725123031 | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2018-07-23T18:09:51.000Z | 2019-08-05T15:37:30.000Z | #
# Copyright 2017 EPAM Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 31.131868 | 101 | 0.602277 |
aad951bf268fec1fadbc38a10c07a7a6e525dcc5 | 505 | py | Python | tests/test_wrapper_instance.py | shadowlion/transact_api | 101b05216ddcbf8ee6d4da6db28c3450499177d3 | [
"MIT"
] | null | null | null | tests/test_wrapper_instance.py | shadowlion/transact_api | 101b05216ddcbf8ee6d4da6db28c3450499177d3 | [
"MIT"
] | 4 | 2022-02-08T14:00:38.000Z | 2022-03-16T12:14:14.000Z | tests/test_wrapper_instance.py | shadowlion/transact_api | 101b05216ddcbf8ee6d4da6db28c3450499177d3 | [
"MIT"
] | null | null | null | import pytest
from transact_api import TransactApi
def test_class_instantiation_no_key():
with pytest.raises(TypeError):
TransactApi()
def test_class_instantiation_with_keys():
client = TransactApi(client_id="asdf", developer_api_key="qwer")
assert isinstance(client, TransactApi)
assert cli... | 28.055556 | 84 | 0.750495 |
2c45f0377e6d77fa983cef7cad5d0018c89fc638 | 575 | py | Python | Py/datastructures/queue.py | Zotyamester/datastructures | b743e203434138a2a12aa5cc876f59cbb338280d | [
"MIT"
] | null | null | null | Py/datastructures/queue.py | Zotyamester/datastructures | b743e203434138a2a12aa5cc876f59cbb338280d | [
"MIT"
] | null | null | null | Py/datastructures/queue.py | Zotyamester/datastructures | b743e203434138a2a12aa5cc876f59cbb338280d | [
"MIT"
] | null | null | null | class Queue:
def __init__(self):
self.data = []
def push(self, data):
self.data = [data] + self.data
def pop(self):
self.data.pop(-1)
def top(self):
self.data[-1]
def __len__(self):
return len(self.data)
def __str__(self):
if len(self.data) == 0:
... | 25 | 42 | 0.495652 |
d9c7b87c13b626d0ed0ea5af5677c3a0ffa0db2d | 235 | py | Python | appengine_config.py | SalamiArmy/InfoBoet | 71df751e50b4b458db44444ef7d6dfe6f68e648f | [
"Apache-2.0"
] | 1 | 2021-07-14T21:48:48.000Z | 2021-07-14T21:48:48.000Z | appengine_config.py | SalamiArmy/InfoBoet | 71df751e50b4b458db44444ef7d6dfe6f68e648f | [
"Apache-2.0"
] | 6 | 2017-11-27T06:04:34.000Z | 2020-02-19T05:15:02.000Z | appengine_config.py | SalamiArmy/InfoBoet | 71df751e50b4b458db44444ef7d6dfe6f68e648f | [
"Apache-2.0"
] | 2 | 2017-08-16T20:26:02.000Z | 2020-11-10T18:44:11.000Z | from google.appengine.ext import vendor
# Add any third-party libraries installed in the "lib" folder.
try:
vendor.add('lib')
except:
print('InfoBoet failed to add it\'s third-party libraries folder to app engine\'s vendor.')
| 29.375 | 95 | 0.73617 |
8f336e51322f2adfd73e2631f1db7c000d646b92 | 4,448 | py | Python | ocr.py | vanatteveldt/teletekst_scraper | f112319ff577cd62818f530696ff737b1e9dcc39 | [
"MIT"
] | null | null | null | ocr.py | vanatteveldt/teletekst_scraper | f112319ff577cd62818f530696ff737b1e9dcc39 | [
"MIT"
] | null | null | null | ocr.py | vanatteveldt/teletekst_scraper | f112319ff577cd62818f530696ff737b1e9dcc39 | [
"MIT"
] | null | null | null | import logging
import re
import sys
from io import StringIO
from pathlib import Path
from subprocess import check_call, check_output
from PIL import Image
LETTERPATH = Path.cwd()/"letters"
def get_letter_img(img, x, y):
return img.crop((6 + x*11, y*22, 6+(x+1)*11, (y+1)*22)).convert("L")
def get_headline_img(... | 27.974843 | 172 | 0.573741 |
4ad46ff3bce6f4d782cd8155e1d3dd750dc6e7c9 | 763 | py | Python | setup.py | namuyan/rpvm | 2137ae4c578287c4cf4edd6b53c32eefc54649d6 | [
"MIT"
] | 1 | 2019-07-18T06:56:46.000Z | 2019-07-18T06:56:46.000Z | setup.py | namuyan/rpvm | 2137ae4c578287c4cf4edd6b53c32eefc54649d6 | [
"MIT"
] | null | null | null | setup.py | namuyan/rpvm | 2137ae4c578287c4cf4edd6b53c32eefc54649d6 | [
"MIT"
] | null | null | null | #!/user/env python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
try:
readme = open('README.md', mode='r').read()
except Exception:
readme = ''
try:
install_requires = open('requirements.txt', mode='r').read()
except Exception:
install_requires = None
setup(
name="rpvm",
... | 23.121212 | 64 | 0.656619 |
81abdf559593ee6a303b493415aae3263255cb0e | 89,072 | py | Python | wandb/sdk/data_types.py | Qwasser/client | 15cc5baea4a6a8cfa3406111a4f6283917bb6e00 | [
"MIT"
] | null | null | null | wandb/sdk/data_types.py | Qwasser/client | 15cc5baea4a6a8cfa3406111a4f6283917bb6e00 | [
"MIT"
] | null | null | null | wandb/sdk/data_types.py | Qwasser/client | 15cc5baea4a6a8cfa3406111a4f6283917bb6e00 | [
"MIT"
] | null | null | null | import codecs
import hashlib
import json
import logging
import numbers
import os
import re
import shutil
import sys
import six
from six.moves.collections_abc import Sequence as SixSequence
import wandb
from wandb import util
from wandb._globals import _datatypes_callback
from wandb.compat import tempfile
from wandb.ut... | 36.92869 | 131 | 0.572627 |
eeb1e7a60d6ea1ffc91e6fc9a9c245ce02db42e3 | 543 | py | Python | week02/week02.py | duongoku/int3404 | 6dd3ec4566de848d529629eada6f4f167fd3de93 | [
"MIT"
] | 9 | 2021-09-09T08:17:49.000Z | 2022-02-21T09:25:12.000Z | week02/week02.py | duongoku/int3404 | 6dd3ec4566de848d529629eada6f4f167fd3de93 | [
"MIT"
] | 1 | 2021-09-21T04:48:53.000Z | 2021-09-21T04:48:53.000Z | week02/week02.py | duongoku/int3404 | 6dd3ec4566de848d529629eada6f4f167fd3de93 | [
"MIT"
] | 11 | 2021-09-14T02:57:51.000Z | 2021-10-14T14:40:04.000Z | """
Name:
Class:
MSSV:
You should understand the code you write.
"""
import numpy as np
import cv2
def q_0(input_file, output_file, delay=1):
"""
:param input_file:
:param output_file:
:param delay:
:return:
"""
img = cv2.imread(input_file, cv2.IMREAD_COLOR)
cv2.imshow('Test img', i... | 13.243902 | 50 | 0.607735 |
3fb5aaabb642b2c92b5f4ef0c5344a71bf3cdfd1 | 3,566 | py | Python | dingdang/client/WechatBot.py | Suhine/SmartAudioHome | d213c13fe00d75b51016c20c0167e8fde9f3b564 | [
"MIT"
] | null | null | null | dingdang/client/WechatBot.py | Suhine/SmartAudioHome | d213c13fe00d75b51016c20c0167e8fde9f3b564 | [
"MIT"
] | null | null | null | dingdang/client/WechatBot.py | Suhine/SmartAudioHome | d213c13fe00d75b51016c20c0167e8fde9f3b564 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8-*-
import time
import os
from client.wxbot import WXBot
from client import dingdangpath
from client.audio_utils import mp3_to_wav
from client import player
from client import config
class WechatBot(WXBot):
def __init__(self, brain):
WXBot.__init__(self)
... | 41.465116 | 79 | 0.508413 |
08c126ead859151881bca90ec834ec06152df06c | 3,206 | py | Python | jcvi/apps/vecscreen.py | l-Imoon/jcvi | db70bb98c7969bb0cc7b9941a2cc2dc8c5d1b783 | [
"BSD-2-Clause"
] | null | null | null | jcvi/apps/vecscreen.py | l-Imoon/jcvi | db70bb98c7969bb0cc7b9941a2cc2dc8c5d1b783 | [
"BSD-2-Clause"
] | null | null | null | jcvi/apps/vecscreen.py | l-Imoon/jcvi | db70bb98c7969bb0cc7b9941a2cc2dc8c5d1b783 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Run through NCBI vecscreen on a local machine.
"""
from __future__ import print_function
import os.path as op
import sys
from jcvi.utils.range import range_merge
from jcvi.formats.fasta import tidy
from jcvi.formats.blast import BlastLine
from jcvi.formats.base impor... | 29.145455 | 104 | 0.656893 |
9f95a1668deef85a1301b21ba0b51ce5f2d3631b | 749 | py | Python | build.py | pakit/test_recipes | aa5379e4a4ef2d4019f6e8e3a87a06d529e0f910 | [
"BSD-3-Clause"
] | null | null | null | build.py | pakit/test_recipes | aa5379e4a4ef2d4019f6e8e3a87a06d529e0f910 | [
"BSD-3-Clause"
] | null | null | null | build.py | pakit/test_recipes | aa5379e4a4ef2d4019f6e8e3a87a06d529e0f910 | [
"BSD-3-Clause"
] | null | null | null | """ Formula that always errors on build """
import os
from pakit import Git, Recipe
from pakit.exc import PakitCmdError
import tests.common as tc
class Build(Recipe):
"""
Formula that always errors on build
"""
def __init__(self):
super(Build, self).__init__()
self.src = os.path.join(... | 24.966667 | 50 | 0.580774 |
62fa1c2d112403eb5724618605cafbdd6ce6a72e | 2,220 | py | Python | lib/spack/spack/test/cmd/resource.py | whitfin/spack | aabd2be31a511d0e00c1017f7311a421659319d9 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | lib/spack/spack/test/cmd/resource.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | lib/spack/spack/test/cmd/resource.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 8 | 2015-10-16T13:51:49.000Z | 2021-10-18T13:58:03.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.main import SpackCommand
resource = SpackCommand('resource')
#: these are hashes used in mock packages
mock_... | 36.393443 | 98 | 0.775225 |
31e1c78b5394c0608171f94dccca164f3c8b6ad8 | 2,372 | py | Python | airbyte-integrations/connectors/source-zendesk-singer/source_zendesk_singer/source.py | psiva2020/airbyte | 1741a0252c2fc0bf72df2232379ed29b99ab8b51 | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-zendesk-singer/source_zendesk_singer/source.py | psiva2020/airbyte | 1741a0252c2fc0bf72df2232379ed29b99ab8b51 | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-zendesk-singer/source_zendesk_singer/source.py | psiva2020/airbyte | 1741a0252c2fc0bf72df2232379ed29b99ab8b51 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020 Airbyte
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distr... | 46.509804 | 133 | 0.747892 |
f71563a970e54d91f082ae73af7abad4a8b23fdf | 205 | py | Python | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | import random
n1 = str(input('nome 1='))
n2 = str(input('nome 2='))
n3 = str(input('nome 3='))
n4 = str(input('nome 4='))
lista = [n1, n2, n3, n4]
random.shuffle(lista)
print('nova ordem{}'.format(lista))
| 22.777778 | 35 | 0.62439 |
ee43322391dd2368e10ad2af8cf24b9f93de180d | 608 | py | Python | dramkit/_tmp/test_code.py | Genlovy-Hoo/dramkit | fa3d2f35ebe9effea88a19e49d876b43d3c5c4c7 | [
"MIT"
] | null | null | null | dramkit/_tmp/test_code.py | Genlovy-Hoo/dramkit | fa3d2f35ebe9effea88a19e49d876b43d3c5c4c7 | [
"MIT"
] | null | null | null | dramkit/_tmp/test_code.py | Genlovy-Hoo/dramkit | fa3d2f35ebe9effea88a19e49d876b43d3c5c4c7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == '__main__':
oath = '我爱妞'
print(type(oath))
print(len(oath))
oath1 = u'我爱妞'
print(type(oath1))
print(len(oath1))
print(oath==oath1)
utf8 = oath.encode('utf-8')
print(type(utf8))
print(len(utf8))
print(utf8)
gbk = oath.encode('g... | 16 | 49 | 0.550987 |
a96e575072862b75ddc6b7f07be271425ed4b375 | 6,573 | py | Python | certbot/tests/account_test.py | ccppuu/certbot | 9fead41aaf93dde0d36d4aef6fded8dd306c1ddc | [
"Apache-2.0"
] | 1 | 2017-12-20T20:06:11.000Z | 2017-12-20T20:06:11.000Z | certbot/tests/account_test.py | cpu/certbot | 9fead41aaf93dde0d36d4aef6fded8dd306c1ddc | [
"Apache-2.0"
] | null | null | null | certbot/tests/account_test.py | cpu/certbot | 9fead41aaf93dde0d36d4aef6fded8dd306c1ddc | [
"Apache-2.0"
] | null | null | null | """Tests for certbot.account."""
import datetime
import os
import shutil
import stat
import tempfile
import unittest
import mock
import pytz
from acme import jose
from acme import messages
from certbot import errors
from certbot.tests import test_util
KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key_2.pem... | 35.33871 | 79 | 0.659364 |
fc3b42ae0843a53a401c890e21e960a798adf8cf | 1,703 | py | Python | cape_privacy/pandas/registry.py | vismaya-Kalaiselvan/cape-python | 2b93696cec43c4bab9098c35eccf6f2f66d9e5c0 | [
"Apache-2.0"
] | 144 | 2020-06-23T21:31:49.000Z | 2022-02-25T15:51:00.000Z | cape_privacy/pandas/registry.py | vismaya-Kalaiselvan/cape-python | 2b93696cec43c4bab9098c35eccf6f2f66d9e5c0 | [
"Apache-2.0"
] | 44 | 2020-06-24T14:42:23.000Z | 2022-02-21T03:30:58.000Z | cape_privacy/pandas/registry.py | vismaya-Kalaiselvan/cape-python | 2b93696cec43c4bab9098c35eccf6f2f66d9e5c0 | [
"Apache-2.0"
] | 16 | 2020-06-26T20:05:51.000Z | 2022-01-12T05:23:58.000Z | from typing import Callable
from typing import Dict
from cape_privacy.pandas.transformations import ColumnRedact
from cape_privacy.pandas.transformations import DatePerturbation
from cape_privacy.pandas.transformations import DateTruncation
from cape_privacy.pandas.transformations import NumericPerturbation
from cape_... | 36.234043 | 75 | 0.825015 |
30ab50f2ef94955a33d9f8e68b5bbd31416ac595 | 2,368 | py | Python | server-reverse-shell.py | punyaslokdutta/Reverse-Shell-scripts | 8362c09243fd0578854512ecbe55403b66310392 | [
"MIT"
] | null | null | null | server-reverse-shell.py | punyaslokdutta/Reverse-Shell-scripts | 8362c09243fd0578854512ecbe55403b66310392 | [
"MIT"
] | null | null | null | server-reverse-shell.py | punyaslokdutta/Reverse-Shell-scripts | 8362c09243fd0578854512ecbe55403b66310392 | [
"MIT"
] | null | null | null |
# Notice that I've used 0.0.0.0 as the server IP address, this means all IPv4 addresses on the local machine. You may wonder, why we don't just use our local IP address or localhost or 127.0.0.1 ? Well, if the server has two IP addresses, let's say 192.168.1.101 on a network, and 10.0.1.1 on another, and the server l... | 45.538462 | 384 | 0.724662 |
70f58a864ad808722f1b9a459eee7eb12af34613 | 8,568 | py | Python | s3/replication/common/src/s3replicationcommon/aws_v4_signer.py | kaustubh-d/cortx-multisite | 125463bfd0f65df6aecff078b5ef1487451aac7d | [
"Apache-2.0"
] | null | null | null | s3/replication/common/src/s3replicationcommon/aws_v4_signer.py | kaustubh-d/cortx-multisite | 125463bfd0f65df6aecff078b5ef1487451aac7d | [
"Apache-2.0"
] | null | null | null | s3/replication/common/src/s3replicationcommon/aws_v4_signer.py | kaustubh-d/cortx-multisite | 125463bfd0f65df6aecff078b5ef1487451aac7d | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 35.7 | 79 | 0.602941 |
97eae18fd20d31a26c2ed3268bb7f7cd547b201c | 4,162 | py | Python | src/_pytest/stepwise.py | charlesaracil-ulti/pytest | dbd082af961871c59f2dbcda2fcb27faf4fa2ebc | [
"MIT"
] | null | null | null | src/_pytest/stepwise.py | charlesaracil-ulti/pytest | dbd082af961871c59f2dbcda2fcb27faf4fa2ebc | [
"MIT"
] | null | null | null | src/_pytest/stepwise.py | charlesaracil-ulti/pytest | dbd082af961871c59f2dbcda2fcb27faf4fa2ebc | [
"MIT"
] | null | null | null | from typing import List
from typing import Optional
import pytest
from _pytest import nodes
from _pytest.config import Config
from _pytest.config.argparsing import Parser
from _pytest.main import Session
from _pytest.reports import TestReport
def pytest_addoption(parser: Parser) -> None:
group = parser.getgroup(... | 33.837398 | 91 | 0.600913 |
2abcc90a1d83dc4d7537d08d2399dff19138b638 | 2,858 | py | Python | view.py | IDA-TUBS/MCC | bbc149796b09d0895d899f3f31e1da199950e85e | [
"BSD-3-Clause"
] | null | null | null | view.py | IDA-TUBS/MCC | bbc149796b09d0895d899f3f31e1da199950e85e | [
"BSD-3-Clause"
] | null | null | null | view.py | IDA-TUBS/MCC | bbc149796b09d0895d899f3f31e1da199950e85e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import GLib, Gio, Gtk
from viewer.window import Window
MENU_XML="""
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="app-menu">
<section>
<item>
<attribute name="action">app.open</attribute... | 30.084211 | 76 | 0.601819 |
601328b9b0235d26e1d3a3b855b272a0e4163020 | 5,774 | py | Python | textcatvis/distinctive_words.py | cod3licious/textcatvis | 2d1befbb27606bc9f965a0a76e205d8d56ee321a | [
"MIT"
] | 13 | 2017-06-18T18:02:39.000Z | 2021-02-15T17:04:15.000Z | textcatvis/distinctive_words.py | cod3licious/textcatvis | 2d1befbb27606bc9f965a0a76e205d8d56ee321a | [
"MIT"
] | null | null | null | textcatvis/distinctive_words.py | cod3licious/textcatvis | 2d1befbb27606bc9f965a0a76e205d8d56ee321a | [
"MIT"
] | 1 | 2018-09-03T14:52:27.000Z | 2018-09-03T14:52:27.000Z | from __future__ import unicode_literals, division, print_function, absolute_import
import sys
import numpy as np
from nlputils.dict_utils import invert_dict0, invert_dict2
from nlputils.features import FeatureTransform
def distinctive_fun_tpr(tpr, fpr):
# to get the development of word occurrences
return tpr
... | 47.327869 | 134 | 0.696571 |
0085a1c0b5552fdb22ff9f243bdfefa4c0c28bd7 | 7,192 | py | Python | tests/melody_tests/constraints_tests/test_fit_pitch_to_function_constraint.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | 1 | 2021-05-06T19:45:54.000Z | 2021-05-06T19:45:54.000Z | tests/melody_tests/constraints_tests/test_fit_pitch_to_function_constraint.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | null | null | null | tests/melody_tests/constraints_tests/test_fit_pitch_to_function_constraint.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | null | null | null | import unittest
import math
from function.generic_univariate_pitch_function import GenericUnivariatePitchFunction
from harmonicmodel.tertian_chord_template import TertianChordTemplate
from melody.constraints.contextual_note import ContextualNote
from melody.constraints.fit_pitch_to_function_constraint import FitPitch... | 43.587879 | 119 | 0.635011 |
815d4348248157beed179b0fc89a4d9c53490724 | 774 | py | Python | tests/functional/scripts/pyi_lib_PIL_img_conversion.py | BearerPipelineTest/pyinstaller | 0de9d6cf1701689c53161610acdab143a76d40b5 | [
"Apache-2.0"
] | null | null | null | tests/functional/scripts/pyi_lib_PIL_img_conversion.py | BearerPipelineTest/pyinstaller | 0de9d6cf1701689c53161610acdab143a76d40b5 | [
"Apache-2.0"
] | null | null | null | tests/functional/scripts/pyi_lib_PIL_img_conversion.py | BearerPipelineTest/pyinstaller | 0de9d6cf1701689c53161610acdab143a76d40b5 | [
"Apache-2.0"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2022, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | 32.25 | 78 | 0.600775 |
3e69033514e8d5f6e203cba88b6a9f4ba29668c6 | 4,029 | py | Python | t5/myip.py | LorhanSohaky/matias.exe | 367157ff330901f9b736d71315d92cab2ad7c50c | [
"MIT"
] | 2 | 2019-10-31T03:51:49.000Z | 2019-12-03T00:53:50.000Z | t3/myip.py | LorhanSohaky/matias.exe | 367157ff330901f9b736d71315d92cab2ad7c50c | [
"MIT"
] | null | null | null | t3/myip.py | LorhanSohaky/matias.exe | 367157ff330901f9b736d71315d92cab2ad7c50c | [
"MIT"
] | 3 | 2019-09-03T00:48:16.000Z | 2019-10-22T17:47:06.000Z | from myiputils import *
from mytcputils import *
from ipaddress import ip_network, ip_address
from random import randint
def make_icmp(datagrama):
unused = 0
checksum = 0
tipo = 11
codigo = 0
payload = datagrama[:28]
comprimento = 8 + len(payload)
icmp = struct.pack('!bbhi', tipo, codi... | 36.963303 | 131 | 0.610325 |
d60ce2f1f3161e3b514fd11f5a8f3593864a1864 | 908 | py | Python | Leetcode_palindrome.py | gouthi007/Problems-Solution | 281023be2025bfe865d26b3b7dc64c92d148a5cc | [
"MIT"
] | null | null | null | Leetcode_palindrome.py | gouthi007/Problems-Solution | 281023be2025bfe865d26b3b7dc64c92d148a5cc | [
"MIT"
] | null | null | null | Leetcode_palindrome.py | gouthi007/Problems-Solution | 281023be2025bfe865d26b3b7dc64c92d148a5cc | [
"MIT"
] | null | null | null | """
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.
Example 1:
Input: 121
Output: true
Example 2:
Input: -121
Output: false
Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palind... | 23.282051 | 119 | 0.575991 |
6f0160c082d00356898a61a7bc625c846aa32384 | 14,777 | py | Python | testtrail/examples/util.py | hongzhangMu/testrun | 39b573c26b24733383d840c6d89a6b22e758ad5d | [
"MIT"
] | null | null | null | testtrail/examples/util.py | hongzhangMu/testrun | 39b573c26b24733383d840c6d89a6b22e758ad5d | [
"MIT"
] | null | null | null | testtrail/examples/util.py | hongzhangMu/testrun | 39b573c26b24733383d840c6d89a6b22e758ad5d | [
"MIT"
] | null | null | null | #-*-coding:utf-8-*-
import json
from flask import make_response
import datetime,time
from math import sin, asin, cos, radians, fabs, sqrt
from testtrail.examples.allroadstime import *
from testtrail.models.trail import Trail
from testtrail.models.test_roads_name import TestRoadsName
from testtrail.models.roadna... | 35.016588 | 139 | 0.594708 |
7ead84f0155eb572ba2eaca1e4d1b676764cc320 | 309,753 | py | Python | python/phonenumbers/carrierdata/data0.py | CrHD/python-phonenumbers | e30be8952b4ad9d92902c27cafd7947b93225ce4 | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/carrierdata/data0.py | CrHD/python-phonenumbers | e30be8952b4ad9d92902c27cafd7947b93225ce4 | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/carrierdata/data0.py | CrHD/python-phonenumbers | e30be8952b4ad9d92902c27cafd7947b93225ce4 | [
"Apache-2.0"
] | 1 | 2020-09-08T14:45:34.000Z | 2020-09-08T14:45:34.000Z | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2018 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 30.90422 | 125 | 0.534352 |
853ce69d490231a61e4aa709851cc82f2604cd6d | 181 | py | Python | EvenOdd.py | rajatgarg149/Daily_python_practice | 2f077e9f6432cc1c2232377256743a7dbdc25a28 | [
"MIT"
] | null | null | null | EvenOdd.py | rajatgarg149/Daily_python_practice | 2f077e9f6432cc1c2232377256743a7dbdc25a28 | [
"MIT"
] | null | null | null | EvenOdd.py | rajatgarg149/Daily_python_practice | 2f077e9f6432cc1c2232377256743a7dbdc25a28 | [
"MIT"
] | null | null | null | '''This program defines a number as odd/even'''
print('Hello user!')
number = input('Type a number.\n')
if int(number)%2: print('\nNumber is ODD.')
else: print('\nNumber is Even.')
| 30.166667 | 47 | 0.674033 |
7eedcf135de978fae49476805aab413f0bea9ed2 | 2,056 | py | Python | asreview/models/feature_extraction/utils.py | BartJanBoverhof/asreview | 33894ebebf7bda2c552b707c3725c0287ac00369 | [
"Apache-2.0"
] | null | null | null | asreview/models/feature_extraction/utils.py | BartJanBoverhof/asreview | 33894ebebf7bda2c552b707c3725c0287ac00369 | [
"Apache-2.0"
] | null | null | null | asreview/models/feature_extraction/utils.py | BartJanBoverhof/asreview | 33894ebebf7bda2c552b707c3725c0287ac00369 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 The ASReview Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 30.235294 | 84 | 0.704767 |
b24eec5dd08d94581f27a930dd7a27380f32ff6b | 501 | py | Python | channelshowdown/event/migrations/0004_auto_20180405_2212.py | channelfix/cshowdown-backend | 4225ad4f2bd56112f627e6fe1f26c281484d804e | [
"MIT"
] | null | null | null | channelshowdown/event/migrations/0004_auto_20180405_2212.py | channelfix/cshowdown-backend | 4225ad4f2bd56112f627e6fe1f26c281484d804e | [
"MIT"
] | 6 | 2018-02-19T02:41:20.000Z | 2022-03-11T23:19:40.000Z | channelshowdown/event/migrations/0004_auto_20180405_2212.py | emilarran/channelshowdown_final | 0bcc8766af66719934bf744d0be2a90e96359761 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-05 14:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('event', '0003_auto_20180404_2245'),
]
operations = [
migrations.AlterField... | 23.857143 | 97 | 0.634731 |
bd0057fb1a0175a805a0f7a1e4dcaa2bdc3c435a | 5,721 | py | Python | tensorflow/contrib/eager/python/examples/densenet/densenet_graph_test.py | kekeblom/tensorflow | be8184f8e002576aa2ef3274436dea68e9173c5f | [
"Apache-2.0"
] | 3 | 2020-01-13T19:44:49.000Z | 2020-10-10T02:26:52.000Z | tensorflow/contrib/eager/python/examples/densenet/densenet_graph_test.py | AKIRA-MIYAKE/tensorflow | 89e06304aad35bfb019a8c10f39fc1ead83e0f99 | [
"Apache-2.0"
] | 4 | 2019-08-14T22:32:51.000Z | 2020-03-09T14:59:18.000Z | tensorflow/contrib/eager/python/examples/densenet/densenet_graph_test.py | AKIRA-MIYAKE/tensorflow | 89e06304aad35bfb019a8c10f39fc1ead83e0f99 | [
"Apache-2.0"
] | 1 | 2018-08-21T21:53:14.000Z | 2018-08-21T21:53:14.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.14 | 80 | 0.638 |
dcec7fb3361983d4752052a8876dec25290a247b | 3,032 | py | Python | Source/GUI_2/alertloop.py | sameertodkar/Car-Health-Monitor | ff43dbe513e2fd35e37909b0021c3e08e95cc959 | [
"RSA-MD"
] | null | null | null | Source/GUI_2/alertloop.py | sameertodkar/Car-Health-Monitor | ff43dbe513e2fd35e37909b0021c3e08e95cc959 | [
"RSA-MD"
] | null | null | null | Source/GUI_2/alertloop.py | sameertodkar/Car-Health-Monitor | ff43dbe513e2fd35e37909b0021c3e08e95cc959 | [
"RSA-MD"
] | null | null | null | from alertsys import checkcond
import time
import json
debug = True
def select_thresh():
"""This is a function to set thresholds of parameters
These would be used by the notification system to compare
with the sensor values and send an email.
Returns:
{(int,int,str)} -- (threshold 1, theresho... | 33.318681 | 100 | 0.634894 |
b260a16d32b75dfda3b55385801f3a27e2c6195e | 558 | py | Python | morango/migrations/0004_auto_20170520_2112.py | indirectlylit/morango | 380cab228a72a0ac6a20926ae6963cb76054b9e1 | [
"MIT"
] | 9 | 2016-09-16T03:13:41.000Z | 2021-07-23T20:48:50.000Z | docker/alpine/kolibri/dist/morango/migrations/0004_auto_20170520_2112.py | sanmoy/kolibri-azure | 9becf1c167225e6cf20f25b379f3d7f27486e56d | [
"MIT"
] | 117 | 2016-09-13T22:21:12.000Z | 2022-03-09T16:31:12.000Z | docker/alpine/kolibri/dist/morango/migrations/0004_auto_20170520_2112.py | sanmoy/kolibri-azure | 9becf1c167225e6cf20f25b379f3d7f27486e56d | [
"MIT"
] | 11 | 2016-09-13T20:13:58.000Z | 2022-02-03T07:59:41.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-05-20 21:12
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("morango", "0003_auto_20170519_0543")]
operations = [
migrations.RemoveField(model_name="scopedefini... | 31 | 80 | 0.715054 |
7d3ad3242f85e43b5cbae4ddb63f2cec498916c7 | 22,583 | py | Python | src/genie/libs/parser/iosxe/show_monitor.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/show_monitor.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/show_monitor.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | ''' show_monitor.py
IOSXE parsers for the following show commands:
* show monitor
* show monitor session {session}
* show monitor session all
* show monitor capture
'''
# Python
import re
import xmltodict
from netaddr import IPAddress, IPNetwork
# Metaparser
from genie.metaparser import MetaParser
... | 34.113293 | 122 | 0.48842 |
c680a27e700c14fb00ea4a0c4f05ca80be97f0bb | 15,886 | py | Python | visualize.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 14 | 2017-07-21T18:31:21.000Z | 2022-01-21T11:39:45.000Z | visualize.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 3 | 2019-06-02T13:00:58.000Z | 2020-04-24T14:40:50.000Z | visualize.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 6 | 2018-02-22T08:26:11.000Z | 2022-03-08T23:32:06.000Z | import matplotlib
#matplotlib.use('GTKAgg')
#matplotlib.rcParams['backend'] = 'GTKCairo'
import os
import loaddata
import numpy as np
#import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolk... | 40.943299 | 180 | 0.608586 |
125e451ea3f29a28fbe077f8b237dc7d79e4f4e0 | 6,466 | py | Python | benchmarks/f3_wrong_hints/scaling_nonlinear_software/6-19_19.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_nonlinear_software/6-19_19.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_nonlinear_software/6-19_19.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 33.502591 | 78 | 0.51562 |
da43a23c3b16dfd35a11b8a841eda16786cd693b | 91 | py | Python | bitmovin_api_sdk/encoding/inputs/local/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/encoding/inputs/local/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/encoding/inputs/local/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | from bitmovin_api_sdk.encoding.inputs.local.customdata.customdata_api import CustomdataApi
| 45.5 | 90 | 0.901099 |
7274648ac1f330e88d95a95b3df3b27f080eeb90 | 3,342 | py | Python | webapp/upload.py | CozyDoomer/deep-learning-webapp | eb0f432765459a1712080f5b25e8e01594336f4f | [
"BSD-3-Clause"
] | null | null | null | webapp/upload.py | CozyDoomer/deep-learning-webapp | eb0f432765459a1712080f5b25e8e01594336f4f | [
"BSD-3-Clause"
] | null | null | null | webapp/upload.py | CozyDoomer/deep-learning-webapp | eb0f432765459a1712080f5b25e8e01594336f4f | [
"BSD-3-Clause"
] | null | null | null | #!/venv/bin python
import os
from flask import Flask, flash, request, redirect, url_for, Blueprint, current_app, render_template, send_from_directory
from werkzeug.utils import secure_filename
from PIL import Image, ExifTags
import piexif
upload = Blueprint('upload', __name__)
ALLOWED_EXTENSIONS = set(['png', 'jpg'... | 36.326087 | 120 | 0.628366 |
1c3b1fd2feb6059341825a17cd39398395bdea6d | 864 | py | Python | python/509.fibonacci-number.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | 1 | 2019-04-11T12:34:55.000Z | 2019-04-11T12:34:55.000Z | python/509.fibonacci-number.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | python/509.fibonacci-number.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=509 lang=python3
#
# [509] Fibonacci Number
#
# https://leetcode-cn.com/problems/fibonacci-number/description/
#
# algorithms
# Easy (65.10%)
# Total Accepted: 5.9K
# Total Submissions: 9K
# Testcase Example: '2'
#
# 斐波那契数,通常用 F(n) 表示,形成的序列称为斐波那契数列。该数列由 0 和 1 开始,后面的每一项数字都是前面两项数字的和。也就是:
# ... | 13.292308 | 71 | 0.456019 |
0fd1cdf3068c926b67443c63ba5c2d072ed8e91f | 224 | py | Python | Curso/Challenges/URI/1958ScientificNotation.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | Curso/Challenges/URI/1958ScientificNotation.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | Curso/Challenges/URI/1958ScientificNotation.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | n = str(input())
negativo = False
if "-" in n:
negativo = True
entrada = float(n)
if entrada == 0:
if not negativo:
print("+", end="")
elif entrada > 0:
print("+", end="")
print(f"{entrada:.4e}".upper())
| 18.666667 | 31 | 0.549107 |
17b260187bb9ac1e93f51ec59045d06ead911848 | 5,911 | py | Python | auxiliar_constantes.py | lucasHashi/coleta-dados-acoes-bdrs-b3 | a2d2c3343378ee70a134bd0bbec11685d896971d | [
"MIT"
] | null | null | null | auxiliar_constantes.py | lucasHashi/coleta-dados-acoes-bdrs-b3 | a2d2c3343378ee70a134bd0bbec11685d896971d | [
"MIT"
] | null | null | null | auxiliar_constantes.py | lucasHashi/coleta-dados-acoes-bdrs-b3 | a2d2c3343378ee70a134bd0bbec11685d896971d | [
"MIT"
] | null | null | null |
# ---------------- ETFS ----------------
URL_LINKS_ETFS = 'https://sistemaswebb3-listados.b3.com.br/fundsPage/3'
# ---------------- FIIS ----------------
URL_LINKS_FIIS = 'https://fiis.com.br/lista-de-fundos-imobiliarios/'
# ---------------- ACOES ----------------
URL_BASE_DADOS_ACAO = 'https://sistemaswebb3-l... | 60.938144 | 184 | 0.792759 |
5a5cd2e4cc4fc8bf1d07367233754ca5833eed65 | 4,027 | py | Python | sdk/python/pulumi_aws/lambda_/get_invocation.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lambda_/get_invocation.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lambda_/get_invocation.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import ... | 35.017391 | 144 | 0.656072 |
6aab762e5367f0a9d47a441d4a731e5d7266ae92 | 92 | py | Python | pycl/Code/readfilel.py | dcavar/dcavar.github.io | bf96820f41563bab73ba35a98142da4ab5ad50a1 | [
"Apache-2.0"
] | 4 | 2018-01-11T22:14:11.000Z | 2019-06-13T09:56:18.000Z | pycl/Code/readfilel.py | dcavar/dcavar.github.io | bf96820f41563bab73ba35a98142da4ab5ad50a1 | [
"Apache-2.0"
] | null | null | null | pycl/Code/readfilel.py | dcavar/dcavar.github.io | bf96820f41563bab73ba35a98142da4ab5ad50a1 | [
"Apache-2.0"
] | 1 | 2020-01-25T02:16:38.000Z | 2020-01-25T02:16:38.000Z | file = open("readfilel.py")
text = file.readlines()
file.close()
for i in text:
print i,
| 15.333333 | 27 | 0.663043 |
6f04feb0bd64dca0c4623adcb00757414b5c66ff | 1,852 | py | Python | homeauto/views.py | 7ooL/web_home_auto | 66d1a96359154a2a8015fb8ebfabfedcf38f69a9 | [
"MIT"
] | null | null | null | homeauto/views.py | 7ooL/web_home_auto | 66d1a96359154a2a8015fb8ebfabfedcf38f69a9 | [
"MIT"
] | 8 | 2020-12-30T17:41:41.000Z | 2021-01-24T19:16:54.000Z | homeauto/views.py | 7ooL/HomeAuto | 66d1a96359154a2a8015fb8ebfabfedcf38f69a9 | [
"MIT"
] | null | null | null |
from django.shortcuts import render
#import homeauto.models as house
#import hue.models as hue
#import homeauto.models.wemo as device
from django.http import JsonResponse
import simplejson as json
def dashboard_index(request):
# persons = house.Person.objects.all()
# services = house.Service.objects.all()
# ... | 26.084507 | 59 | 0.707343 |
9dfaeecc26a59d83c868cee9e76cbb7f12f867da | 1,527 | py | Python | StupidBenchmark/PyTorch/upsample.py | tobyclh/StupidBenchmark | 0b4f821bdb54522b32de3e340f4f73597043e4f3 | [
"Apache-2.0"
] | null | null | null | StupidBenchmark/PyTorch/upsample.py | tobyclh/StupidBenchmark | 0b4f821bdb54522b32de3e340f4f73597043e4f3 | [
"Apache-2.0"
] | null | null | null | StupidBenchmark/PyTorch/upsample.py | tobyclh/StupidBenchmark | 0b4f821bdb54522b32de3e340f4f73597043e4f3 | [
"Apache-2.0"
] | null | null | null | import torch
from skimage import io, transform
from time import time
from torch import nn
from time import time
from torchvision.transforms.functional import resize
from PIL import Image
from torch.nn.functional import upsample
img = io.imread('data/britney.png')
def timereps(reps, func):
start = time()
[func()... | 37.243902 | 118 | 0.743287 |
027e03b517621cceeeeab1a769afd4c8ca57a3db | 3,408 | py | Python | bin/BuildSystem/PerlBuildSystem.py | Inokinoki/craft | dd09fb3ba0714ed19d9ab15bdd402fecf9c64405 | [
"BSD-2-Clause"
] | null | null | null | bin/BuildSystem/PerlBuildSystem.py | Inokinoki/craft | dd09fb3ba0714ed19d9ab15bdd402fecf9c64405 | [
"BSD-2-Clause"
] | null | null | null | bin/BuildSystem/PerlBuildSystem.py | Inokinoki/craft | dd09fb3ba0714ed19d9ab15bdd402fecf9c64405 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright Hannah von Reth <vonreth@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of condi... | 48.685714 | 113 | 0.656984 |
0b8904b5c7dce13fd933435d6f8cdb2b6dc63a18 | 1,182 | py | Python | src/stereo_cam/setup.py | frank20a/collaborative-sats | 9d26d3c8f66cf43bbd514f02434851439e746797 | [
"MIT"
] | null | null | null | src/stereo_cam/setup.py | frank20a/collaborative-sats | 9d26d3c8f66cf43bbd514f02434851439e746797 | [
"MIT"
] | 6 | 2022-03-22T18:54:38.000Z | 2022-03-31T16:42:37.000Z | src/stereo_cam/setup.py | frank20a/collaborative-sats | 9d26d3c8f66cf43bbd514f02434851439e746797 | [
"MIT"
] | null | null | null | from setuptools import setup
import os
from glob import glob
package_name = 'stereo_cam'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ... | 30.307692 | 82 | 0.615059 |
f85cbe392f54c51a5b9b02a9979eeca1002b0469 | 3,296 | py | Python | orgdown/paragraph.py | dcheno/orgdown | f67b2333413587fe27070ad7283101791bade374 | [
"MIT"
] | null | null | null | orgdown/paragraph.py | dcheno/orgdown | f67b2333413587fe27070ad7283101791bade374 | [
"MIT"
] | null | null | null | orgdown/paragraph.py | dcheno/orgdown | f67b2333413587fe27070ad7283101791bade374 | [
"MIT"
] | null | null | null | from paragraph_type import ParagraphType
from xmlobject import XmlObject
SCENE_BREAK_CHARACTER = "#"
ONE_THIRD_PAGE = 12
STANDARD_BUFFER = 2
# I imagine these might someday be better
# placed in their own configuration file.
LEVELS = {
ParagraphType.PART: 0,
ParagraphType.PROLOGUE: 1,
ParagraphType.CHAPT... | 25.550388 | 70 | 0.668083 |
5f14d8a7d511b2aba14538a318734e4f05a21590 | 322 | py | Python | awesome_template/__about__.py | enpaul/pyproject-template | 8abfe9aecd263ba5679532ccc5a6546473992e65 | [
"MIT"
] | null | null | null | awesome_template/__about__.py | enpaul/pyproject-template | 8abfe9aecd263ba5679532ccc5a6546473992e65 | [
"MIT"
] | null | null | null | awesome_template/__about__.py | enpaul/pyproject-template | 8abfe9aecd263ba5679532ccc5a6546473992e65 | [
"MIT"
] | null | null | null | """Programatically accessible project metadata"""
__title__ = "awesome-template"
__summary__ = "An awesome python template project that does nothing"
__version__ = "0.0.0"
__url__ = "https://github.com/enpaul/awesome-template/"
__license__ = "MIT"
__authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"... | 32.2 | 71 | 0.76087 |
5d1abb41d48ace514998d88e5113906d864a1544 | 2,380 | py | Python | src/waldur_openstack/openstack/tests/test_service.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 26 | 2017-10-18T13:49:58.000Z | 2021-09-19T04:44:09.000Z | src/waldur_openstack/openstack/tests/test_service.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 14 | 2018-12-10T14:14:51.000Z | 2021-06-07T10:33:39.000Z | src/waldur_openstack/openstack/tests/test_service.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 32 | 2017-09-24T03:10:45.000Z | 2021-10-16T16:41:09.000Z | from unittest.mock import patch
from django.core.exceptions import ValidationError
from rest_framework import status, test
from waldur_core.structure.models import ServiceSettings
from waldur_core.structure.tests import factories, fixtures
@patch('waldur_core.structure.models.ServiceSettings.get_backend')
class Ope... | 37.777778 | 83 | 0.668067 |
5522713a4190d3b4e6c3a9a428f18f3151dc36cb | 45,254 | py | Python | lib/aff4_objects/stats_store_test.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | null | null | null | lib/aff4_objects/stats_store_test.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | null | null | null | lib/aff4_objects/stats_store_test.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Tests for the stats_store classes."""
import math
import pandas
from grr.lib import aff4
from grr.lib import data_store
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import stats
from grr.lib import test_lib
from grr.lib.aff4_objects import stats_store
class StatsS... | 39.696491 | 79 | 0.671521 |
ee2f33b4342d24be437bad19986af1689bac8c69 | 396 | py | Python | ml_source/src/blocktorch/blocktorch/objectives/time_series_regression_objective.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | 1 | 2021-09-23T12:23:02.000Z | 2021-09-23T12:23:02.000Z | ml_source/src/blocktorch/blocktorch/objectives/time_series_regression_objective.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | null | null | null | ml_source/src/blocktorch/blocktorch/objectives/time_series_regression_objective.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | null | null | null | """Base class for all time series regression objectives."""
from .regression_objective import RegressionObjective
from blocktorch.problem_types import ProblemTypes
class TimeSeriesRegressionObjective(RegressionObjective):
"""Base class for all time series regression objectives."""
problem_types = [ProblemTy... | 33 | 63 | 0.80303 |
1bc06fbaf395428985b9e9527192910c089789f5 | 1,774 | py | Python | Python/eight_kyu/greet_welcome.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | 1 | 2019-12-20T04:09:56.000Z | 2019-12-20T04:09:56.000Z | Python/eight_kyu/greet_welcome.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | null | null | null | Python/eight_kyu/greet_welcome.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | null | null | null | # Python solution for 'Welcome!' codewars question.
# Level: 8 kyu
# Tags: FUNDAMENTALS, HASHES, DATA STRUCTURES, amd OBJECTS.
# Author: Jack Brokenshire
# Date: 22/05/2020
import unittest
def greet_welcome(language):
"""
Greets a given language in their language otherwise uses Welcome.
:param language: ... | 34.115385 | 117 | 0.583991 |
0c11823815c158eb4b0f7687322e3e1cd8d231bc | 10,748 | py | Python | learn/legacy/20211007/learn_record.py | Nyanyan/Egaroucid | f8a5a46466f59a528244f44d80b1aa2e6c76c651 | [
"MIT"
] | 2 | 2021-07-28T09:25:26.000Z | 2021-08-22T14:44:21.000Z | learn/legacy/20211007/learn_record.py | Nyanyan/Egaroucid | f8a5a46466f59a528244f44d80b1aa2e6c76c651 | [
"MIT"
] | null | null | null | learn/legacy/20211007/learn_record.py | Nyanyan/Egaroucid | f8a5a46466f59a528244f44d80b1aa2e6c76c651 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras.datasets import boston_housing
from tensorflow.keras.layers import Activation, Add, BatchNormalization, Conv2D, Dense, GlobalAveragePooling2D, Input, concatenate, Flatten
from tensorflow.keras.models import Sequential, Model, load_model
from tensorflow.keras.callbacks impor... | 33.275542 | 163 | 0.616208 |
803f9e3f10d501911693c45631e2bdf7b5aa8df2 | 75 | py | Python | stubs/3.2/docutils/parsers/rst/states.py | zyga/mypy | 5b7e222568cd20c31cde4e02adc9fd77d949197a | [
"PSF-2.0"
] | 1 | 2019-06-16T07:05:32.000Z | 2019-06-16T07:05:32.000Z | stubs/3.2/docutils/parsers/rst/states.py | zyga/mypy | 5b7e222568cd20c31cde4e02adc9fd77d949197a | [
"PSF-2.0"
] | null | null | null | stubs/3.2/docutils/parsers/rst/states.py | zyga/mypy | 5b7e222568cd20c31cde4e02adc9fd77d949197a | [
"PSF-2.0"
] | null | null | null | import typing
class Inliner:
def __init__(self) -> None:
pass
| 12.5 | 31 | 0.626667 |
d8c9f4be74baeeccd4f4cece950aab0dabc75ec7 | 666 | py | Python | pyqubo/utils/__init__.py | OpenJij/pyqubo | 47190d3391c83c1c84636ab8f8bff67c8f935dc0 | [
"Apache-2.0"
] | 1 | 2019-03-17T11:26:36.000Z | 2019-03-17T11:26:36.000Z | pyqubo/utils/__init__.py | OpenJij/pyqubo | 47190d3391c83c1c84636ab8f8bff67c8f935dc0 | [
"Apache-2.0"
] | null | null | null | pyqubo/utils/__init__.py | OpenJij/pyqubo | 47190d3391c83c1c84636ab8f8bff67c8f935dc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Recruit Communications Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.176471 | 74 | 0.765766 |
7ce111c4d336088ee4f892ab35bc06d16d99a309 | 1,526 | py | Python | client/migrations/0001_initial.py | My-Garage/resourceideaapi | b872a6f15277989870572ba6e523c9dc378b7a24 | [
"MIT"
] | 1 | 2021-01-20T14:40:06.000Z | 2021-01-20T14:40:06.000Z | client/migrations/0001_initial.py | My-Garage/resourceideaapi | b872a6f15277989870572ba6e523c9dc378b7a24 | [
"MIT"
] | null | null | null | client/migrations/0001_initial.py | My-Garage/resourceideaapi | b872a6f15277989870572ba6e523c9dc378b7a24 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.13 on 2020-07-17 22:42
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('client_industry', '__first__'),
('organization', '__first__'),
]
operation... | 40.157895 | 149 | 0.607471 |
bf698c1f8d3313f54f4608c07e3a403b891ab56b | 66,217 | py | Python | cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py | alexisries/openstack-cinder | 7cc6e45c5ddb8bf771bdb01b867628e41761ae11 | [
"Apache-2.0"
] | 2 | 2019-05-24T14:13:50.000Z | 2019-05-24T14:21:13.000Z | cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright (c) 2018 Dell Inc. or its subsidiaries.
# 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
#
# ... | 44.560565 | 79 | 0.553846 |
acbc77e6837d56f25fafc6c43bdf000553710645 | 3,161 | py | Python | test/tservers.py | codders/netlib | 137ae524c958cea9c96990587dafdd05b8d9cca0 | [
"MIT"
] | null | null | null | test/tservers.py | codders/netlib | 137ae524c958cea9c96990587dafdd05b8d9cca0 | [
"MIT"
] | null | null | null | test/tservers.py | codders/netlib | 137ae524c958cea9c96990587dafdd05b8d9cca0 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, print_function, division)
import threading
import queue
import io
import OpenSSL
from netlib import tcp, certutils
from . import tutils
class ServerThread(threading.Thread):
def __init__(self, server):
self.server = server
threading.Thread.__init__(self)
... | 29.268519 | 78 | 0.574818 |
719cc805ad781c57f52921d4eaf72b451f8fabf6 | 6,844 | py | Python | scripts/dataset.py | max-simon/master-thesis | b0db01008d52317bc036f8a0f20671ce49108a12 | [
"CC-BY-4.0"
] | 4 | 2021-01-03T06:57:47.000Z | 2022-02-05T15:31:44.000Z | scripts/dataset.py | max-simon/master-thesis | b0db01008d52317bc036f8a0f20671ce49108a12 | [
"CC-BY-4.0"
] | null | null | null | scripts/dataset.py | max-simon/master-thesis | b0db01008d52317bc036f8a0f20671ce49108a12 | [
"CC-BY-4.0"
] | 2 | 2021-03-20T18:39:39.000Z | 2022-01-17T12:55:28.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Max Simon
# Year: 2020
import sys
sys.path.append('/nfs/kryo/work/maxsimon/master-thesis/scripts')
import xarray as xr
import numpy as np
from datetime import timedelta as tdelta
from datetime import datetime
import argparse
from romstools.utils import parse... | 41.478788 | 178 | 0.598919 |
499142ce26609c0925531d306fde6effe88c8cb3 | 7,564 | py | Python | automation/devops_automation_infra/plugins/memsql.py | AnyVisionltd/devops-automation-infra | 7d6e75dc96ffa53d07e1dbd2c4ddb0fcdcf92cd1 | [
"MIT"
] | 2 | 2021-03-10T14:52:24.000Z | 2021-03-10T18:50:20.000Z | automation/devops_automation_infra/plugins/memsql.py | solganik/devops-automation-infra | 2ef2ac80a52d2f2abd037ad24cbf7f98b0c50bc6 | [
"MIT"
] | 4 | 2021-03-14T11:30:11.000Z | 2022-01-30T16:01:41.000Z | automation/devops_automation_infra/plugins/memsql.py | solganik/devops-automation-infra | 2ef2ac80a52d2f2abd037ad24cbf7f98b0c50bc6 | [
"MIT"
] | 5 | 2021-03-10T14:52:14.000Z | 2021-11-17T16:00:18.000Z | import logging
from contextlib import closing
import pymysql
from infra.model import plugins
from pytest_automation_infra import helpers
from pymysql.constants import CLIENT
import copy
from automation_infra.utils import waiter
import json
class Connection(object):
def __init__(self, memsql_connection):
... | 37.82 | 212 | 0.64146 |
0548191a889dcbb43909e44549def48dbb6af616 | 10,570 | py | Python | grimagents/tests/unit/test_parameter_search.py | PinataMostGrim/grimagents_cli | ad3461a6f331256586d9848a9eaa0a9095d65161 | [
"Apache-2.0"
] | 1 | 2019-08-18T21:00:22.000Z | 2019-08-18T21:00:22.000Z | grimagents/tests/unit/test_parameter_search.py | PinataMostGrim/grimagents_cli | ad3461a6f331256586d9848a9eaa0a9095d65161 | [
"Apache-2.0"
] | 6 | 2019-08-18T15:22:44.000Z | 2020-04-24T01:09:37.000Z | grimagents/tests/unit/test_parameter_search.py | PinataMostGrim/grimagents_cli | ad3461a6f331256586d9848a9eaa0a9095d65161 | [
"Apache-2.0"
] | null | null | null | import numpy
import pytest
from grimagents.parameter_search import (
GridSearch,
RandomSearch,
BayesianSearch,
InvalidGridSearchIndex,
)
@pytest.fixture
def search_config():
return {
'behavior_name': 'BEHAVIOR_NAME',
'search_parameters': {
'hyperparameters.beta': [1e-4... | 35.116279 | 178 | 0.609272 |
6786e272c3fb74cb1b2b4b2ccd42c7ef608e6d9e | 998 | py | Python | api/api_personal_pay/resources/baseApi.py | HJaycee/PersonalPay | 8999e9322a7739f3f736f89d5c984e296b19aa79 | [
"MIT"
] | 71 | 2018-05-23T02:29:06.000Z | 2022-02-28T16:37:54.000Z | api/api_personal_pay/resources/baseApi.py | HJaycee/PersonalPay | 8999e9322a7739f3f736f89d5c984e296b19aa79 | [
"MIT"
] | 4 | 2019-02-18T11:49:52.000Z | 2021-01-27T03:00:22.000Z | api/api_personal_pay/resources/baseApi.py | HJaycee/PersonalPay | 8999e9322a7739f3f736f89d5c984e296b19aa79 | [
"MIT"
] | 26 | 2018-05-29T03:35:21.000Z | 2022-02-28T16:37:53.000Z | from flask_restful import Resource
from flask import request, session, make_response
import os
import hashlib
from util.log import Logger
import json
from util.commonUtil import CommonUtil
import time
def output_json(data, code, headers=None):
"""Makes a Flask response with a JSON encoded body"""
# 如果是app接口,且不... | 35.642857 | 275 | 0.657315 |
957dc7bc64328fb9303f0831ae6396eca69e3dd3 | 32,834 | py | Python | extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py | enricorusso/incubator-ariatosca | 3748b1962697712bde29c9de781d867c6c5ffad1 | [
"Apache-2.0"
] | null | null | null | extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py | enricorusso/incubator-ariatosca | 3748b1962697712bde29c9de781d867c6c5ffad1 | [
"Apache-2.0"
] | null | null | null | extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py | enricorusso/incubator-ariatosca | 3748b1962697712bde29c9de781d867c6c5ffad1 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 44.793997 | 140 | 0.646312 |
796b9eba3d8b6666757a920bcbdf5f2634b908a4 | 1,518 | py | Python | acheron/model.py | superphy/acheron | cd9838f000085409e306a5f66b04276a1e4eb5f5 | [
"Apache-2.0"
] | 1 | 2022-01-07T17:23:14.000Z | 2022-01-07T17:23:14.000Z | acheron/model.py | superphy/acheron | cd9838f000085409e306a5f66b04276a1e4eb5f5 | [
"Apache-2.0"
] | null | null | null | acheron/model.py | superphy/acheron | cd9838f000085409e306a5f66b04276a1e4eb5f5 | [
"Apache-2.0"
] | 1 | 2021-06-18T17:36:08.000Z | 2021-06-18T17:36:08.000Z | import os
MAX_RAM = '1000G'
def build_model(arguments):
model_args = ''
for arg in vars(arguments):
attr = getattr(arguments,arg)
model_args += " {}={}".format(arg, attr)
if arg == 'hyperparam':
# hyperparameter optimizations require additional RAM
# subject to c... | 35.302326 | 105 | 0.581686 |
618a4307b39aa0012cfde0dcc662084fff55d450 | 726 | py | Python | kolibri/deployment/default/settings/test.py | FollonSaxBass/kolibri | 4cf820b14386aecc228fecff64c847bad407cbb1 | [
"MIT"
] | 2 | 2021-05-13T10:20:46.000Z | 2021-11-15T12:31:03.000Z | kolibri/deployment/default/settings/test.py | Priyaraj17/kolibri | 6d600213871e8a748209870b508dd97a505907c1 | [
"MIT"
] | 8 | 2021-05-21T15:31:24.000Z | 2022-02-24T15:02:14.000Z | kolibri/deployment/default/settings/test.py | Priyaraj17/kolibri | 6d600213871e8a748209870b508dd97a505907c1 | [
"MIT"
] | 4 | 2021-11-15T04:23:34.000Z | 2021-11-25T16:40:11.000Z | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import os
import tempfile
# If KOLIBRI_HOME isn't defined in the test env, it's okay to just set a
# temp directory for testing.
if "KOLIBRI_HOME" not in os.environ:
os.environ["KOLIBRI_HOME"] = te... | 25.034483 | 72 | 0.745179 |
0cc23b5c4c6ca9b398d269d41e764f07800d3eb1 | 11,242 | py | Python | src/syft/core/node/common/action/run_class_method_action.py | ariannmichael/PySyft | 0205898c3268b17ccebc5916f9aff370a1c48a25 | [
"Apache-2.0"
] | null | null | null | src/syft/core/node/common/action/run_class_method_action.py | ariannmichael/PySyft | 0205898c3268b17ccebc5916f9aff370a1c48a25 | [
"Apache-2.0"
] | null | null | null | src/syft/core/node/common/action/run_class_method_action.py | ariannmichael/PySyft | 0205898c3268b17ccebc5916f9aff370a1c48a25 | [
"Apache-2.0"
] | null | null | null | # stdlib
import functools
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# syft absolute
from syft.core.plan.plan import Plan
# syft relative
from .... | 38.108475 | 95 | 0.618929 |
e9590701c27469096ccecc4dd7234479d8177ad6 | 1,689 | py | Python | clowder/cli/checkout.py | JrGoodle/clowder | 864afacfc7122e937f7087e233c61d05fd007af2 | [
"MIT"
] | 12 | 2016-02-12T02:37:24.000Z | 2021-01-04T05:14:12.000Z | clowder/cli/checkout.py | JrGoodle/clowder | 864afacfc7122e937f7087e233c61d05fd007af2 | [
"MIT"
] | 370 | 2015-07-06T22:59:08.000Z | 2021-10-01T14:58:17.000Z | clowder/cli/checkout.py | JrGoodle/clowder | 864afacfc7122e937f7087e233c61d05fd007af2 | [
"MIT"
] | 3 | 2015-10-22T18:45:31.000Z | 2018-10-16T15:30:30.000Z | """Clowder command line checkout controller
.. codeauthor:: Joe DeCapo <joe@polka.cat>
"""
import argparse
import clowder.util.formatting as fmt
from clowder.clowder_controller import CLOWDER_CONTROLLER, print_clowder_name, valid_clowder_yaml_required
from clowder.config import Config
from clowder.git.clowder_repo ... | 35.1875 | 115 | 0.743635 |
a48e9561ef7bb9e6b36714ec206137625124c50f | 4,232 | py | Python | core/models.py | dongmokevin/ecomv1 | abb3dc5a5476c379c029b8299e820c1979d5eb14 | [
"MIT"
] | null | null | null | core/models.py | dongmokevin/ecomv1 | abb3dc5a5476c379c029b8299e820c1979d5eb14 | [
"MIT"
] | null | null | null | core/models.py | dongmokevin/ecomv1 | abb3dc5a5476c379c029b8299e820c1979d5eb14 | [
"MIT"
] | null | null | null | from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.shortcuts import reverse
from django.utils.text import slugify
# Create your models here.
class ProductManager(models.Manager):
def get_queryset(self):
return super(ProductManager, self).ge... | 36.482759 | 94 | 0.670369 |
85f9c68cad40d6a5b44dbc9ba7bf674212d40121 | 2,391 | py | Python | Code/CreatPath_Labeltxt.py | haoranD/FaceAntiSpoofing_DL | 40e12ee9db6fbaded03c7aff1f933fe8be5e4ff3 | [
"MIT"
] | 19 | 2018-10-30T22:24:54.000Z | 2022-01-11T05:14:38.000Z | Code/CreatPath_Labeltxt.py | coderwangson/FaceAntiSpoofing_DL | 40e12ee9db6fbaded03c7aff1f933fe8be5e4ff3 | [
"MIT"
] | 4 | 2018-11-21T06:09:13.000Z | 2019-04-14T15:09:37.000Z | Code/CreatPath_Labeltxt.py | coderwangson/FaceAntiSpoofing_DL | 40e12ee9db6fbaded03c7aff1f933fe8be5e4ff3 | [
"MIT"
] | 4 | 2018-11-06T00:31:25.000Z | 2021-01-30T12:37:35.000Z | import os
from os import listdir
TRAINING = 0
TESTING = 1
CASIA = 0
REPLAYATTACK = 1
def CreatLabelPath(PROCESSFLAG,DataBaseOpt):
print("In function CreatLabelPath, start processing!")
true_img_dir_CASIA = ['1.avi', '2.avi', 'HR_1.avi', 'HR_4.avi']
if DataBaseOpt == REPLAYATTACK:
path_train_root... | 40.525424 | 120 | 0.654538 |
d16dee5ec41ff6abda582add48de8c91e77f7912 | 2,301 | py | Python | backend/db/models/user.py | digitaltembo/stylobate | c22dbbb671612b2c95f84b7ee95dcb40f1fb6baa | [
"MIT"
] | 4 | 2020-07-29T02:01:41.000Z | 2022-02-19T13:11:30.000Z | backend/db/models/user.py | digitaltembo/stylobate | c22dbbb671612b2c95f84b7ee95dcb40f1fb6baa | [
"MIT"
] | 4 | 2021-03-11T02:00:08.000Z | 2022-02-19T05:07:33.000Z | backend/db/models/user.py | digitaltembo/stylobate | c22dbbb671612b2c95f84b7ee95dcb40f1fb6baa | [
"MIT"
] | null | null | null | import bcrypt
from sqlalchemy import Column, Boolean, Integer, String
import datetime
import jwt
from pydantic import BaseModel
from sql import Base
from utils.config import SECRET_KEY
TWO_WEEKS = datetime.timedelta(days=14)
# SQLAlchemy ORM Model
class User(Base):
__tablename__ = "users"
id = Column(Integ... | 28.060976 | 135 | 0.647545 |
a5baf58d61f2f70d00172aab1433ecf77f1b544c | 1,958 | py | Python | python3/day_003/day-003-dns-lookup-domain-details-info.py | king-md/100DaysOfCode | ab2e2495e804663ca35f72bbc8d8ec06cb202fac | [
"MIT"
] | null | null | null | python3/day_003/day-003-dns-lookup-domain-details-info.py | king-md/100DaysOfCode | ab2e2495e804663ca35f72bbc8d8ec06cb202fac | [
"MIT"
] | null | null | null | python3/day_003/day-003-dns-lookup-domain-details-info.py | king-md/100DaysOfCode | ab2e2495e804663ca35f72bbc8d8ec06cb202fac | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import dns.resolver
def main():
# print( len(sys.argv) )
# if( 2 == len(sys.argv) ):
# name_server = '8.8.8.8' #Google's DNS server
# ADDITIONAL_RDCLASS = 65535
# request = dns.message.make_query('google.com', dns.rdatatype.ANY)
# request.flags |=... | 26.459459 | 140 | 0.61287 |
8284571593ab09681ccd718ff781b6d0a9ce9dd5 | 720 | py | Python | tables.py | Mr-Hockatt/SIR-Model-Visualizer | 07f044810f46a3b6bc2cc981330b88cdac0446ab | [
"MIT"
] | null | null | null | tables.py | Mr-Hockatt/SIR-Model-Visualizer | 07f044810f46a3b6bc2cc981330b88cdac0446ab | [
"MIT"
] | null | null | null | tables.py | Mr-Hockatt/SIR-Model-Visualizer | 07f044810f46a3b6bc2cc981330b88cdac0446ab | [
"MIT"
] | null | null | null | from tkinter import *
import csv
def createStandardTable(f,window):
handle = csv.reader(f)
length = len(next(handle))
sizes = [0] * length
for record in handle:
for p,column in enumerate(record):
if len(column) > sizes[p]:
sizes[p] = len(colum... | 22.5 | 157 | 0.526389 |
e91375611f660eb4dd4bcc854be2e1245d7b6222 | 4,343 | py | Python | antlir/compiler/items/tests/common.py | baioc/antlir | e3b47407b72c4aee835adf4e68fccd9abff457f2 | [
"MIT"
] | 28 | 2020-08-11T16:22:46.000Z | 2022-03-04T15:41:52.000Z | antlir/compiler/items/tests/common.py | baioc/antlir | e3b47407b72c4aee835adf4e68fccd9abff457f2 | [
"MIT"
] | 137 | 2020-08-11T16:07:49.000Z | 2022-02-27T10:59:05.000Z | antlir/compiler/items/tests/common.py | baioc/antlir | e3b47407b72c4aee835adf4e68fccd9abff457f2 | [
"MIT"
] | 10 | 2020-09-10T00:01:28.000Z | 2022-03-08T18:00:28.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import subprocess
import tempfile
import unittest
from contextlib import contextmanager
from antlir.compiler... | 31.244604 | 79 | 0.660373 |
2a26f477047c190c66b985ec41373c5a603d1152 | 544 | py | Python | home/forms.py | akash-kd/Robotics_Club_Website | f8ec81a5afc0048bd32ff1f13e928ba9b31f3b97 | [
"MIT"
] | null | null | null | home/forms.py | akash-kd/Robotics_Club_Website | f8ec81a5afc0048bd32ff1f13e928ba9b31f3b97 | [
"MIT"
] | 20 | 2021-10-19T07:07:44.000Z | 2022-02-04T13:19:44.000Z | home/forms.py | akash-kd/Robotics_Club_Website | f8ec81a5afc0048bd32ff1f13e928ba9b31f3b97 | [
"MIT"
] | 3 | 2021-08-23T17:30:57.000Z | 2022-01-15T16:22:29.000Z | from django import forms
class ContactForm(forms.Form):
name=forms.CharField(max_length=100,label='Your Name',widget=forms.TextInput(attrs={'placeholder': 'Your Name'}))
email = forms.EmailField(label='Email',widget=forms.TextInput(attrs={'placeholder': 'Email'}))
body = forms.CharField(min_length=10,max_l... | 49.454545 | 146 | 0.737132 |
e2ae773e8d11fadc081d9f560eb98e2e1b230d16 | 899 | py | Python | happy-numbers.py | CoderEren/Python-Algorithms | 3100208f8ffddce537908cc4e2090ae125876327 | [
"MIT"
] | null | null | null | happy-numbers.py | CoderEren/Python-Algorithms | 3100208f8ffddce537908cc4e2090ae125876327 | [
"MIT"
] | null | null | null | happy-numbers.py | CoderEren/Python-Algorithms | 3100208f8ffddce537908cc4e2090ae125876327 | [
"MIT"
] | null | null | null | #input an integer
#square its digits and find the sum of squares
#continue with this number
#repeat until either answer is 1 -> happy
#or until you get trapped in a cycle -> unhappy
number = input("Enter a number: ")
numbers_in_recursive = []
def recursive(number):
if number in numbers_in_recursive:
print... | 25.685714 | 52 | 0.61624 |
6bcf40c06838225d160c5bd7ffc8ea98b5c1e4eb | 344 | py | Python | predavanje2/slozene_podatkovne_strukture.py | Miillky/uvod_u_programiranje | 209611e38c8fe84c727649df4b868a4278eb77c3 | [
"MIT"
] | null | null | null | predavanje2/slozene_podatkovne_strukture.py | Miillky/uvod_u_programiranje | 209611e38c8fe84c727649df4b868a4278eb77c3 | [
"MIT"
] | null | null | null | predavanje2/slozene_podatkovne_strukture.py | Miillky/uvod_u_programiranje | 209611e38c8fe84c727649df4b868a4278eb77c3 | [
"MIT"
] | null | null | null | import types
jabuka = types.SimpleNamespace(
vrsta="idared",
boja="crvena",
tezina=89
)
print(jabuka.vrsta)
print(jabuka.boja)
print(jabuka.tezina)
jabuka.versta = "granny smith"
del jabuka.boja
jabuka.tezina = 125
print(jabuka.vrsta)
print(jabuka.tezina)
print(type(jabuka))
print(type(jabuka.vrsta))
pr... | 16.380952 | 31 | 0.738372 |
5a1b1d7d8a9efbb14af89e5101a7f0ea47fe1ef9 | 3,375 | py | Python | package/zimagi/facade.py | zimagi/zima | d87b3f91e2fa669a77145413582d636d783a0c71 | [
"Apache-2.0"
] | null | null | null | package/zimagi/facade.py | zimagi/zima | d87b3f91e2fa669a77145413582d636d783a0c71 | [
"Apache-2.0"
] | null | null | null | package/zimagi/facade.py | zimagi/zima | d87b3f91e2fa669a77145413582d636d783a0c71 | [
"Apache-2.0"
] | null | null | null | from .command import client as command_api
from .data import client as data_api
class Client(object):
def __init__(self,
token,
host = 'localhost',
command_port = 5123,
data_port = 5323,
user = 'admin',
options_callback = None,
message_callback = None,
... | 29.605263 | 102 | 0.616593 |
313c7754ec52a77e1dcc6724c731baaaee8a2aac | 22,653 | py | Python | anomaly_detection/anomaly_detect_ts.py | kingbase/AnomalyDetection | 14e6d029adf906791fb5d4a6c06251c69e3ca20e | [
"Apache-2.0"
] | null | null | null | anomaly_detection/anomaly_detect_ts.py | kingbase/AnomalyDetection | 14e6d029adf906791fb5d4a6c06251c69e3ca20e | [
"Apache-2.0"
] | null | null | null | anomaly_detection/anomaly_detect_ts.py | kingbase/AnomalyDetection | 14e6d029adf906791fb5d4a6c06251c69e3ca20e | [
"Apache-2.0"
] | null | null | null | """
Description:
A technique for detecting anomalies in seasonal univariate time
series where the input is a series of <timestamp, count> pairs.
Usage:
anomaly_detect_ts(x, max_anoms=0.1, direction="pos", alpha=0.05, only_last=None,
threshold="None", e_value=False, longterm=Fals... | 38.656997 | 230 | 0.676378 |
957c620cab09a4b482748d713a28325a747b2f48 | 1,374 | py | Python | normalize_repos/branch_protections.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 14 | 2020-02-07T22:46:02.000Z | 2021-02-28T16:10:16.000Z | normalize_repos/branch_protections.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 83 | 2020-02-07T15:57:23.000Z | 2022-02-14T16:04:33.000Z | normalize_repos/branch_protections.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 32 | 2020-02-24T21:08:40.000Z | 2021-04-12T12:22:32.000Z | EXEMPT_REPOSITORIES = [
# non-engineering repo
"australian-chapter",
# non-engineering repo
"cc-cert-core",
# non-engineering repo
"cc-cert-edu",
# non-engineering repo
"cc-cert-gov",
# non-engineering repo
"cc-cert-lib",
# exempted to allow transifex updates
"cc.i18n",
... | 25.924528 | 77 | 0.604803 |
ec6c0199d717d542d550aa73d814ba9ee30b4a95 | 950 | py | Python | Engine/Tools/install_dependencies.py | ekokturk/ZeronEngine | b0b756a0c8eb0ac09ee288a936857bda607bb3ef | [
"MIT"
] | null | null | null | Engine/Tools/install_dependencies.py | ekokturk/ZeronEngine | b0b756a0c8eb0ac09ee288a936857bda607bb3ef | [
"MIT"
] | null | null | null | Engine/Tools/install_dependencies.py | ekokturk/ZeronEngine | b0b756a0c8eb0ac09ee288a936857bda607bb3ef | [
"MIT"
] | null | null | null | import os, sys, glob, subprocess
script_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
dependency_dir = os.path.join(script_dir, '../ThirdParty/')
os.chdir(dependency_dir)
print("\n================== UPDATING ENGINE DEPENDENCIES ==================\n")
thirdparty_dirs = glob.glob(os.path.realpath(f"{dependency_... | 35.185185 | 85 | 0.507368 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.