hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 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 3 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23b81a22671d52b1359c10338e7c30c196d461e2 | 5,602 | py | Python | RELEASE_ScaleNet_minimal/utils/data_utils.py | Jerrypiglet/scalenet | 6a5db480e650d10d1e575e93b6cee366d1912c8a | [
"Adobe-2006",
"Adobe-Glyph"
] | 33 | 2020-08-27T09:06:19.000Z | 2022-03-10T02:27:31.000Z | RELEASE_ScaleNet_minimal/utils/data_utils.py | Jerrypiglet/scalenet | 6a5db480e650d10d1e575e93b6cee366d1912c8a | [
"Adobe-2006",
"Adobe-Glyph"
] | 2 | 2020-12-28T04:41:55.000Z | 2021-04-07T06:03:36.000Z | RELEASE_ScaleNet_minimal/utils/data_utils.py | Jerrypiglet/scalenet | 6a5db480e650d10d1e575e93b6cee366d1912c8a | [
"Adobe-2006",
"Adobe-Glyph"
] | 5 | 2020-12-22T03:02:35.000Z | 2021-12-08T09:46:01.000Z | # import shutil
import torch
# import torch.nn as nn
# import torch.optim as optim
import numpy as np
# import torchvision
from torchvision import datasets, models, transforms
# import argparse
# import time
# import os, sys
# import copy
# from torch.optim.lr_scheduler import MultiStepLR, ReduceLROnPlateau
# from tens... | 37.851351 | 196 | 0.69136 |
1d510cdfa952c6a6383bcd4fbe3ff042b440f046 | 3,193 | py | Python | tensorflow/g3doc/how_tos/reading_data/convert_to_records.py | vsilyaev/tensorflow | f41959ccb2d9d4c722fe8fc3351401d53bcf4900 | [
"Apache-2.0"
] | 2 | 2021-06-11T19:21:06.000Z | 2021-08-17T07:55:32.000Z | tensorflow/g3doc/how_tos/reading_data/convert_to_records.py | vsilyaev/tensorflow | f41959ccb2d9d4c722fe8fc3351401d53bcf4900 | [
"Apache-2.0"
] | null | null | null | tensorflow/g3doc/how_tos/reading_data/convert_to_records.py | vsilyaev/tensorflow | f41959ccb2d9d4c722fe8fc3351401d53bcf4900 | [
"Apache-2.0"
] | 2 | 2015-11-13T21:11:49.000Z | 2015-11-29T04:13:49.000Z | """Converts MNIST data to TFRecords file format with Example protos."""
import os
import tensorflow.python.platform
import numpy
import tensorflow as tf
from tensorflow.g3doc.tutorials.mnist import input_data
TRAIN_IMAGES = 'train-images-idx3-ubyte.gz' # MNIST filenames
TRAIN_LABELS = 'train-labels-idx1-ubyte.gz'
... | 36.284091 | 79 | 0.697463 |
a2a3537da057f51ed3a74d8124a77b308e551279 | 2,371 | py | Python | annlite/profile.py | jina-ai/pqlite | 2ce1ec2283b381f5153ea60141a6bb474bbf0f0c | [
"Apache-2.0"
] | 45 | 2021-12-10T07:39:39.000Z | 2022-02-20T22:58:28.000Z | annlite/profile.py | jina-ai/pqlite | 2ce1ec2283b381f5153ea60141a6bb474bbf0f0c | [
"Apache-2.0"
] | 30 | 2021-12-10T07:46:28.000Z | 2022-02-18T09:27:48.000Z | annlite/profile.py | jina-ai/annlite | e4e706e313ba5cbfb7083a5dea9e75b8d2813394 | [
"Apache-2.0"
] | null | null | null | import cProfile
import pstats
import random
from functools import wraps
random.seed(20)
try:
import builtins
line_profile = builtins.profile
except AttributeError:
# No line profiler, provide a pass-through version
def profile(func):
return func
line_profile = profile
def time_profile(... | 33.394366 | 82 | 0.614509 |
2861c9206a9e9ff302b92687b6ef25f2f1b0c85c | 768 | py | Python | Level1/Lessons12931/yang_12931.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level1/Lessons12931/yang_12931.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level1/Lessons12931/yang_12931.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | 1 | 2021-04-05T07:35:59.000Z | 2021-04-05T07:35:59.000Z | # 자릿수 더하기
def solution(n):
answer = 0
n = list(str(n))
for idx in n:
answer += int(idx)
return answer
# 테스트 1 〉 통과 (0.02ms, 10.3MB)
# 테스트 2 〉 통과 (0.02ms, 10.4MB)
# 테스트 3 〉 통과 (0.02ms, 10.3MB)
# 테스트 4 〉 통과 (0.02ms, 10.4MB)
# 테스트 5 〉 통과 (0.03ms, 10.3MB)
# 테스트 6 〉 통과 (0.02ms, 10.3MB)
# 테스트 7 〉 통과 ... | 26.482759 | 30 | 0.540365 |
c4d401479a7d893732b7558f5861106225ae0b46 | 247 | py | Python | appointment/appointment/doctype/visitor_appointment/test_visitor_appointment.py | barkota/AppointmentFinal | 567e43623e447ed19c52397b473ae7e120490d1a | [
"MIT"
] | null | null | null | appointment/appointment/doctype/visitor_appointment/test_visitor_appointment.py | barkota/AppointmentFinal | 567e43623e447ed19c52397b473ae7e120490d1a | [
"MIT"
] | null | null | null | appointment/appointment/doctype/visitor_appointment/test_visitor_appointment.py | barkota/AppointmentFinal | 567e43623e447ed19c52397b473ae7e120490d1a | [
"MIT"
] | 1 | 2021-11-23T07:40:43.000Z | 2021-11-23T07:40:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, the QU and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestVisitorAppointment(unittest.TestCase):
pass
| 22.454545 | 49 | 0.781377 |
f4a6d21695e181ba2e79451ca55b0400b85805d1 | 2,457 | py | Python | evb9064x/evb9064x.py | melexis-fir/mlx90641-driver-evb9064x-py | 06245aadb8d549c794913d8d394f7dd0353dcb19 | [
"Apache-2.0"
] | null | null | null | evb9064x/evb9064x.py | melexis-fir/mlx90641-driver-evb9064x-py | 06245aadb8d549c794913d8d394f7dd0353dcb19 | [
"Apache-2.0"
] | null | null | null | evb9064x/evb9064x.py | melexis-fir/mlx90641-driver-evb9064x-py | 06245aadb8d549c794913d8d394f7dd0353dcb19 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import ctypes
import serial.tools.list_ports
from mlx90641 import *
USB_VID = 1001
USB_PID = 32
def load_driver():
dev = MLX90641()
cfp = os.path.dirname(os.path.realpath(__file__))
machine = 'windows'
shared_lib_file = 'mlx90641_driver_evb9064x.dll'
if os.environ.get('OS','... | 28.241379 | 111 | 0.6337 |
4baa9a1b5bfa39f9bdedd15ac3e33994ac01a2ed | 6,373 | py | Python | Hub/ecointeraction/scripts/routines.py | maximedaniel/ITAME | ca820337911695fa3625b32dcad5d87ff0b192d0 | [
"MIT"
] | null | null | null | Hub/ecointeraction/scripts/routines.py | maximedaniel/ITAME | ca820337911695fa3625b32dcad5d87ff0b192d0 | [
"MIT"
] | 1 | 2021-06-10T23:19:09.000Z | 2021-06-10T23:19:09.000Z | Hub/ecointeraction/scripts/routines.py | maximedaniel/ITAME | ca820337911695fa3625b32dcad5d87ff0b192d0 | [
"MIT"
] | null | null | null | from CairnFORM.models import EnergyUsage
from CairnFORM.EpicesParser import EpicesParser
from django.utils import timezone
import datetime
import numpy as np
debug = True
def raw_variations(usages):
variations = [0]
for i in range(1, len(usages)-1):
prev_production = usages[i-1].production
curr... | 44.566434 | 142 | 0.649616 |
74625ac4c39827deceb9d4950c49b9762c1abf83 | 1,004 | py | Python | db/models/publicacao_original.py | JonKoala/diariobot-scraper | 8f1a44dc19d666139f5650ee64a8b14ab7c77b9a | [
"MIT"
] | null | null | null | db/models/publicacao_original.py | JonKoala/diariobot-scraper | 8f1a44dc19d666139f5650ee64a8b14ab7c77b9a | [
"MIT"
] | null | null | null | db/models/publicacao_original.py | JonKoala/diariobot-scraper | 8f1a44dc19d666139f5650ee64a8b14ab7c77b9a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from . import Base
from sqlalchemy import Column, Integer, String, Numeric, Date, ForeignKey
from sqlalchemy.orm import relationship, synonym
class Publicacao_Original(Base):
__tablename__ = 'Publicacao_Original'
id = Column(Integer, primary_key=True)
edic... | 33.466667 | 180 | 0.676295 |
dd5308e1dc4412652ab9400d25afc4097e9e9e79 | 3,892 | py | Python | huaweicloud-sdk-ims/huaweicloudsdkims/v2/model/glance_list_image_members_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-ims/huaweicloudsdkims/v2/model/glance_list_image_members_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-ims/huaweicloudsdkims/v2/model/glance_list_image_members_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class GlanceListImageMembersResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 27.408451 | 81 | 0.574255 |
ea032ab091f563e3f8a0d0a04c6419625273f87f | 5,793 | py | Python | aioredis_timeseries.py | ryananguiano/aioredis-timeseries | 97ae0709df97df90fad76ffa9dd0c0fef3f8f92e | [
"MIT"
] | 1 | 2021-03-03T18:47:56.000Z | 2021-03-03T18:47:56.000Z | aioredis_timeseries.py | ryananguiano/aioredis-timeseries | 97ae0709df97df90fad76ffa9dd0c0fef3f8f92e | [
"MIT"
] | null | null | null | aioredis_timeseries.py | ryananguiano/aioredis-timeseries | 97ae0709df97df90fad76ffa9dd0c0fef3f8f92e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'Ryan Anguiano'
__email__ = 'ryan.anguiano@gmail.com'
__version__ = '0.0.1'
import calendar
import functools
import operator
from datetime import datetime
try:
import pytz
except ImportError: # pragma: no cover
pytz = None
__all__ = ['AsyncTimeSeries', 'seconds', 'min... | 32.005525 | 84 | 0.621785 |
b2328b7ee1e46595cfb0a634a022f5ebc467ade7 | 154 | py | Python | lidi/problem/apps.py | campovski/lidi | 9699e62e70e679970816e29ca7618c9ed0146c7e | [
"Apache-2.0"
] | null | null | null | lidi/problem/apps.py | campovski/lidi | 9699e62e70e679970816e29ca7618c9ed0146c7e | [
"Apache-2.0"
] | 21 | 2017-06-03T14:16:14.000Z | 2018-05-29T07:28:27.000Z | lidi/problem/apps.py | campovski/lidi | 9699e62e70e679970816e29ca7618c9ed0146c7e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ProblemConfig(AppConfig):
name = 'problem'
| 17.111111 | 39 | 0.733766 |
a054b8fd447fd5fc940ec0ed25c1c2c2d6d861d3 | 14,782 | py | Python | blog/views.py | kaushalmeena1996/myapp-blog | 6567371477d0c423050218397b242440cee6936b | [
"MIT"
] | null | null | null | blog/views.py | kaushalmeena1996/myapp-blog | 6567371477d0c423050218397b242440cee6936b | [
"MIT"
] | null | null | null | blog/views.py | kaushalmeena1996/myapp-blog | 6567371477d0c423050218397b242440cee6936b | [
"MIT"
] | null | null | null | """Contains views for blog app."""
from blog import db, login_manager
from blog.forms import CommentForm, PostForm, SignInForm, SignUpForm
from blog.models import Comment, Post, User, func, likes
from flask import (
Blueprint,
current_app,
flash,
redirect,
render_template,
request,
url_for... | 29.862626 | 87 | 0.612366 |
d0ae2c5c972804fc9fbf4626f49cce1ed7a223cb | 2,798 | py | Python | server/djangoappSCD/models.py | SCD346/agfzb-CloudAppDevelopment_Capstone | 137c8cb4daaf32ed76b25d21070215ae6350004e | [
"Apache-2.0"
] | null | null | null | server/djangoappSCD/models.py | SCD346/agfzb-CloudAppDevelopment_Capstone | 137c8cb4daaf32ed76b25d21070215ae6350004e | [
"Apache-2.0"
] | null | null | null | server/djangoappSCD/models.py | SCD346/agfzb-CloudAppDevelopment_Capstone | 137c8cb4daaf32ed76b25d21070215ae6350004e | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.utils.timezone import now
from django.db import models
from django.utils.timezone import now
# Create your models here.
# <HINT> Create a Car Make model `class CarMake(models.Model)`:
# - Name
# - Description
# - Any other fields you would like to include in car make model
... | 30.747253 | 107 | 0.653681 |
940ad5e0ec84e83ca1c281941781d154a61aa5f3 | 988 | py | Python | Python-For-Everyone-Horstmann/Chapter10-Inheritance/question.py | islayy/Books-solutions | 5fe05deb4e9f65875284d8af43bd383bf9ae145b | [
"MIT"
] | null | null | null | Python-For-Everyone-Horstmann/Chapter10-Inheritance/question.py | islayy/Books-solutions | 5fe05deb4e9f65875284d8af43bd383bf9ae145b | [
"MIT"
] | null | null | null | Python-For-Everyone-Horstmann/Chapter10-Inheritance/question.py | islayy/Books-solutions | 5fe05deb4e9f65875284d8af43bd383bf9ae145b | [
"MIT"
] | 1 | 2021-01-30T22:19:07.000Z | 2021-01-30T22:19:07.000Z | class Question():
def __init__(self):
self._text = ""
self._answer = ""
def get_text(self):
return self._text
def get_answer(self):
return self._answer
def set_text(self, questionText):
self._text = questionText
def set_answer(self, correctResponse):
... | 24.097561 | 62 | 0.592105 |
e6a83cd34b6be025c2e2f8418b48da72b00edc7a | 1,075 | py | Python | venv/Lib/site-packages/IPython/extensions/sympyprinting.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | venv/Lib/site-packages/IPython/extensions/sympyprinting.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | venv/Lib/site-packages/IPython/extensions/sympyprinting.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """
**DEPRECATED**
A print function that pretty prints sympy Basic objects.
:moduleauthor: Brian Granger
Usage
=====
Once the extension is loaded, Sympy Basic objects are automatically
pretty-printed.
As of SymPy 0.7.2, maintenance of this extension has moved to SymPy under
sympy.interactive.ipythonprinting, any m... | 32.575758 | 78 | 0.545116 |
06ca0f60c98377b6b01f07ba91b00e0c1f7ba8cc | 1,964 | py | Python | backend/account/forms.py | CS178A-B/final-project-bjls | aebb8042f2d958caac00e31b27b445b9079901d0 | [
"MIT"
] | null | null | null | backend/account/forms.py | CS178A-B/final-project-bjls | aebb8042f2d958caac00e31b27b445b9079901d0 | [
"MIT"
] | 20 | 2020-10-21T19:16:15.000Z | 2021-09-03T05:48:20.000Z | backend/account/forms.py | CS178A-B/R-Finder | aebb8042f2d958caac00e31b27b445b9079901d0 | [
"MIT"
] | 1 | 2020-10-22T04:49:45.000Z | 2020-10-22T04:49:45.000Z | from django import forms
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordResetForm, SetPasswordForm
# from .models import User, Student, Faculty
from .models import User, Student, Faculty
class UserForm(UserCreationForm):
class Meta:
model = User
# model.... | 37.056604 | 111 | 0.634929 |
a99a32bb9501abbe02c576a0c87412a5706ecbef | 281 | py | Python | script/scaffold/templates/integration/error.py | psicot/home-assistant | 60f0988435ac104f83ace36fa762bb27cb093509 | [
"Apache-2.0"
] | null | null | null | script/scaffold/templates/integration/error.py | psicot/home-assistant | 60f0988435ac104f83ace36fa762bb27cb093509 | [
"Apache-2.0"
] | null | null | null | script/scaffold/templates/integration/error.py | psicot/home-assistant | 60f0988435ac104f83ace36fa762bb27cb093509 | [
"Apache-2.0"
] | null | null | null | """Errors for the NEW_NAME integration."""
from homeassistant.exceptions import HomeAssistantError
class CannotConnect(HomeAssistantError):
"""Error to indicate we cannot connect."""
class InvalidAuth(HomeAssistantError):
"""Error to indicate there is invalid auth."""
| 25.545455 | 55 | 0.765125 |
6a3ae3b20c11ebcd9d9454e0f65659cb5c8d6bdd | 32,089 | py | Python | tensorflow/python/keras/_impl/keras/engine/saving.py | ashuven63/tf_audio | bc561b81069001da01a1c7df4c16f6b9ba9a400b | [
"Apache-2.0"
] | 1 | 2018-05-30T00:34:05.000Z | 2018-05-30T00:34:05.000Z | tensorflow/python/keras/_impl/keras/engine/saving.py | timctho/tensorflow | 015c72eac3f4e448dd8ab852843e902771496532 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/_impl/keras/engine/saving.py | timctho/tensorflow | 015c72eac3f4e448dd8ab852843e902771496532 | [
"Apache-2.0"
] | 1 | 2021-11-16T19:59:48.000Z | 2021-11-16T19:59:48.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... | 36.464773 | 117 | 0.657048 |
2b3a74f0a278f0367f939dc97a7aea15ad50edfd | 4,531 | py | Python | src/qrl/core/txs/SlaveTransaction.py | scottdonaldau/QRL | fb78c1cdf227330ace46f590a36cc6a52c7af3fe | [
"MIT"
] | 1 | 2020-07-12T23:40:48.000Z | 2020-07-12T23:40:48.000Z | src/qrl/core/txs/SlaveTransaction.py | scottdonaldau/QRL | fb78c1cdf227330ace46f590a36cc6a52c7af3fe | [
"MIT"
] | null | null | null | src/qrl/core/txs/SlaveTransaction.py | scottdonaldau/QRL | fb78c1cdf227330ace46f590a36cc6a52c7af3fe | [
"MIT"
] | null | null | null | from pyqrllib.pyqrllib import bin2hstr
from qrl.core import config
from qrl.core.AddressState import AddressState
from qrl.core.misc import logger
from qrl.core.txs.Transaction import Transaction
class SlaveTransaction(Transaction):
def __init__(self, protobuf_transaction=None):
super(SlaveTransaction, ... | 40.097345 | 115 | 0.656147 |
3ed103db6b26b83a4b2559f91a628b46fea0a6a7 | 498 | py | Python | emails/migrations/0012_email_exclude_contacted_companies.py | Tookmund/hackerforce | d757910db1631e26e489a10a99fa67cd74292c4e | [
"Apache-2.0"
] | 11 | 2019-11-11T23:27:21.000Z | 2021-07-19T16:41:44.000Z | emails/migrations/0012_email_exclude_contacted_companies.py | Tookmund/hackerforce | d757910db1631e26e489a10a99fa67cd74292c4e | [
"Apache-2.0"
] | 11 | 2019-12-24T17:10:05.000Z | 2021-06-09T18:22:59.000Z | emails/migrations/0012_email_exclude_contacted_companies.py | hackumass/hackerforce | dfb6ac1304a7db21853765de9da795e8e9ef20bf | [
"Apache-2.0"
] | 7 | 2019-11-21T03:32:06.000Z | 2021-07-18T15:30:29.000Z | # Generated by Django 2.2.3 on 2019-08-07 05:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('emails', '0011_auto_20190805_1556'),
]
operations = [
migrations.AddField(
model_name='email',
name='exclude_contact... | 26.210526 | 145 | 0.656627 |
87b0e6b9fef10caf4532c41c3a903ce0094473c2 | 1,125 | py | Python | alien/AnsiFormatter.py | kimlab/GPyM | 34814be0176c31f1e85326750d187cbc2df41942 | [
"MIT"
] | 9 | 2016-09-02T14:13:10.000Z | 2020-08-31T11:57:49.000Z | alien/AnsiFormatter.py | kimlab/GPyM | 34814be0176c31f1e85326750d187cbc2df41942 | [
"MIT"
] | 1 | 2018-12-14T18:17:02.000Z | 2019-01-08T18:00:34.000Z | build/lib/GPyM/alien/AnsiFormatter.py | palexandremello/GPyM | 10daa25e4d68d527c799f6bf99225b4992e43319 | [
"MIT"
] | 6 | 2017-05-21T14:06:44.000Z | 2020-06-26T08:45:08.000Z | class AnsiFormatter( object ):
"""
c = AnsiFormatter( 'cyan' )
r = AnsiFormatter( 'red' )
y = AnsiFormatter( 'yellow' )
m = AnsiFormatter( 'magenta' )
c + 'hello ?'
prints 'hello ?' with cyan color
contribution by H.T. Kim @ 20120610
"""
FOREGROUND = dict(
black = ... | 25.568182 | 87 | 0.478222 |
ce69eda76bf72e86d948325cc580961079eefa1a | 7,419 | py | Python | dbReports/iondb/rundb/monitor/views.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 125 | 2015-01-22T05:43:23.000Z | 2022-03-22T17:15:59.000Z | dbReports/iondb/rundb/monitor/views.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 59 | 2015-02-10T09:13:06.000Z | 2021-11-11T02:32:38.000Z | dbReports/iondb/rundb/monitor/views.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 98 | 2015-01-17T01:25:10.000Z | 2022-03-18T17:29:42.000Z | # Copyright (C) 2012 Ion Torrent Systems, Inc. All Rights Reserved
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import render_to_response, render
from django.template.context import RequestContext
from django.core.paginator import Paginator, Invali... | 37.469697 | 122 | 0.640787 |
cabc3809dbeb927a92dba781caaea1e5760440d3 | 5,695 | py | Python | PN_GAN/script/viper_feature.py | aditya30394/Person-Re-Identification | 455e9984cd6e23f1b63161740ea260b799c17b50 | [
"MIT"
] | 11 | 2019-01-10T08:03:31.000Z | 2020-10-23T03:14:23.000Z | PN_GAN/script/viper_feature.py | rima1990/Person-Re-Identification | 455e9984cd6e23f1b63161740ea260b799c17b50 | [
"MIT"
] | 1 | 2020-11-13T08:20:53.000Z | 2021-01-12T23:06:55.000Z | PN_GAN/script/viper_feature.py | rima1990/Person-Re-Identification | 455e9984cd6e23f1b63161740ea260b799c17b50 | [
"MIT"
] | 8 | 2019-03-05T09:12:54.000Z | 2022-02-05T06:21:21.000Z | import numpy as np
import caffe
import os, random
import cv2
import pickle
import scipy.io as sio
def get_sort_file(path, idx):
files = os.listdir(path)
files = [i for i in files if int(i[0:3]) in idx]
files.sort(key=lambda x:int(x[0:3]))
return files
def Calculate_query_test_ID(query_dir, test_dir, t... | 38.47973 | 127 | 0.6518 |
ddcd091073d1951bab6be60013f22149298b5d65 | 1,000 | py | Python | tests/multicast.py | AjayMT/nodenet | 72f8e5a3b66fe0847aee93004f2013b426e64271 | [
"MIT"
] | null | null | null | tests/multicast.py | AjayMT/nodenet | 72f8e5a3b66fe0847aee93004f2013b426e64271 | [
"MIT"
] | null | null | null | tests/multicast.py | AjayMT/nodenet | 72f8e5a3b66fe0847aee93004f2013b426e64271 | [
"MIT"
] | null | null | null |
import sys
from os import path
# weird hack to be able to import nodenet normally
sys.path.append(
path.dirname(path.dirname(path.abspath(__file__)))
)
import nodenet
from preggy import expect
n1 = nodenet.Node()
n2 = nodenet.Node()
n3 = nodenet.Node()
n1.bind('127.0.0.1', 3000)
n2.bind('127.0.0.1', 3001)
n3.b... | 20.408163 | 63 | 0.598 |
1c91f0125b81606c20bec209723b87cef6615840 | 3,132 | py | Python | dns_cache/hosts.py | jayvdb/dns-cache | fc4a79584c11d939ecba5a57e501f237958492d2 | [
"MIT"
] | 16 | 2020-03-13T08:21:59.000Z | 2022-01-28T14:04:08.000Z | dns_cache/hosts.py | jayvdb/dns-cache | fc4a79584c11d939ecba5a57e501f237958492d2 | [
"MIT"
] | 18 | 2020-03-08T16:39:46.000Z | 2021-08-20T06:16:47.000Z | dns_cache/hosts.py | jayvdb/dns-cache | fc4a79584c11d939ecba5a57e501f237958492d2 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import os.path
import sys
from datetime import timedelta
from dns.name import from_text
from dns.rdataclass import IN
from dns.rdatatype import A, AAAA
from dns.resolver import Cache
from reconfigure.configs import HostsConfig
from .dnspython import create_answer, create_simp... | 24.857143 | 74 | 0.641762 |
48bdf58d0e1aca99663ea983a01e7b2511f13f26 | 5,458 | py | Python | rl/runner/local.py | xupei0610/ICCGAN | 2b8181fe530c48bffe10236ebb6d9e93ddb629ef | [
"MIT"
] | 3 | 2021-11-12T13:18:46.000Z | 2022-03-31T08:20:30.000Z | rl/runner/local.py | xupei0610/ICCGAN | 2b8181fe530c48bffe10236ebb6d9e93ddb629ef | [
"MIT"
] | null | null | null | rl/runner/local.py | xupei0610/ICCGAN | 2b8181fe530c48bffe10236ebb6d9e93ddb629ef | [
"MIT"
] | null | null | null | import os, time
import torch
import numpy as np
from fastdtw import fastdtw
from typing import Callable, Any, Optional, Iterable, Sequence, Mapping
import multiprocessing
from ..agent import Agent
Env = Any
from .. import utils
def worker_name(rank: int):
name = "Evaluator" if rank < 0 else "Worker"
return... | 34.987179 | 106 | 0.538109 |
9248b0ddeb4fd030b60c5e48517ec96b0a4f8365 | 1,770 | py | Python | server/auvsi_suas/models/gps_position.py | RMMichael/interop | b68a1b0b2324b5a1d9b2683b97299cb6f214cdb9 | [
"Apache-2.0"
] | 175 | 2015-09-15T15:37:06.000Z | 2022-02-14T23:21:48.000Z | server/auvsi_suas/models/gps_position.py | RMMichael/interop | b68a1b0b2324b5a1d9b2683b97299cb6f214cdb9 | [
"Apache-2.0"
] | 376 | 2015-09-16T19:34:15.000Z | 2022-02-19T12:55:55.000Z | server/auvsi_suas/models/gps_position.py | RMMichael/interop | b68a1b0b2324b5a1d9b2683b97299cb6f214cdb9 | [
"Apache-2.0"
] | 109 | 2015-09-16T17:05:14.000Z | 2022-01-26T12:49:38.000Z | """GPS position model."""
import logging
from auvsi_suas.models import distance
from django.contrib import admin
from django.core import validators
from django.db import models
logger = logging.getLogger(__name__)
class GpsPositionMixin(models.Model):
"""GPS position mixin for adding a latitude and longitude de... | 27.65625 | 78 | 0.655367 |
c19cf958f7896a228b0f7bc63e14125c4ed98f44 | 2,441 | py | Python | pcdet/datasets/__init__.py | AmirGaniev/thesis_bayesod3d_pointpillars | 610bb1f22e84d3123199dee05cb31ef3e4ad6a16 | [
"Apache-2.0"
] | 26 | 2021-07-14T10:55:14.000Z | 2022-02-25T05:46:42.000Z | pcdet/datasets/__init__.py | AmirGaniev/thesis_bayesod3d_pointpillars | 610bb1f22e84d3123199dee05cb31ef3e4ad6a16 | [
"Apache-2.0"
] | 2 | 2021-07-12T09:58:00.000Z | 2021-12-14T13:04:47.000Z | pcdet/datasets/__init__.py | AmirGaniev/thesis_bayesod3d_pointpillars | 610bb1f22e84d3123199dee05cb31ef3e4ad6a16 | [
"Apache-2.0"
] | 4 | 2021-08-22T16:41:35.000Z | 2022-03-18T06:54:52.000Z | import torch
from torch.utils.data import DataLoader
from torch.utils.data import DistributedSampler as _DistributedSampler
from pcdet.utils import common_utils
from .dataset import DatasetTemplate
from .kitti.kitti_dataset import KittiDataset
from .nuscenes.nuscenes_dataset import NuScenesDataset
from .waymo.waymo_d... | 33.438356 | 101 | 0.700533 |
98963ee8fbf0f436744c3675a372891b78050044 | 3,982 | py | Python | third_party/conan/recipes/grpc_codegen/conanfile.py | tufeigunchu/orbit | 407354cf7c9159ff7e3177c603a6850b95509e3a | [
"BSD-2-Clause"
] | 2 | 2020-07-31T08:18:58.000Z | 2021-12-26T06:43:07.000Z | third_party/conan/recipes/grpc_codegen/conanfile.py | tufeigunchu/orbit | 407354cf7c9159ff7e3177c603a6850b95509e3a | [
"BSD-2-Clause"
] | null | null | null | third_party/conan/recipes/grpc_codegen/conanfile.py | tufeigunchu/orbit | 407354cf7c9159ff7e3177c603a6850b95509e3a | [
"BSD-2-Clause"
] | 1 | 2021-03-10T15:21:19.000Z | 2021-03-10T15:21:19.000Z | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os
import time
import platform
class grpcConan(ConanFile):
name = "grpc_codegen"
version = "1.27.3"
description = "Google's RPC library and framework."
topics = ("conan", "grpc", "rpc")
url = "htt... | 37.92381 | 130 | 0.658212 |
c1e530228c86c6dbe0174202f498cbd3526d2914 | 3,290 | py | Python | hack/boskos.py | Priyankasaggu11929/community-edition | b2c539e85f17e2a7d0e419d6ed83884964028671 | [
"Apache-2.0"
] | null | null | null | hack/boskos.py | Priyankasaggu11929/community-edition | b2c539e85f17e2a7d0e419d6ed83884964028671 | [
"Apache-2.0"
] | null | null | null | hack/boskos.py | Priyankasaggu11929/community-edition | b2c539e85f17e2a7d0e419d6ed83884964028671 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 29.115044 | 105 | 0.675684 |
b16e40254d0e7739e83c204cc2cfb46531c02acd | 67 | py | Python | tests/views.py | mmcclelland1002/django-auth-adfs | e716f9d8c1be7afcf67e3296f3d340a25a8f1810 | [
"BSD-2-Clause"
] | 123 | 2016-02-10T19:55:59.000Z | 2021-01-13T03:52:05.000Z | tests/views.py | mmcclelland1002/django-auth-adfs | e716f9d8c1be7afcf67e3296f3d340a25a8f1810 | [
"BSD-2-Clause"
] | 117 | 2016-02-17T09:51:22.000Z | 2021-01-14T09:02:02.000Z | tests/views.py | mmcclelland1002/django-auth-adfs | e716f9d8c1be7afcf67e3296f3d340a25a8f1810 | [
"BSD-2-Clause"
] | 56 | 2016-02-21T04:07:28.000Z | 2021-01-14T07:42:17.000Z | def test_failed_response(request, error_message, status):
pass
| 22.333333 | 57 | 0.791045 |
7c4764461427f4fa95d2235fdd511ec7e30b838a | 39 | py | Python | templatio/__init__.py | marcobellaccini/templatio | 25457c2052db551ccc1ef015c1470cee298428be | [
"Apache-2.0"
] | null | null | null | templatio/__init__.py | marcobellaccini/templatio | 25457c2052db551ccc1ef015c1470cee298428be | [
"Apache-2.0"
] | null | null | null | templatio/__init__.py | marcobellaccini/templatio | 25457c2052db551ccc1ef015c1470cee298428be | [
"Apache-2.0"
] | null | null | null | from .templatiofun import parseInToOut
| 19.5 | 38 | 0.871795 |
37fb6a0c470addf5ee635a3051d64790a98eaed0 | 2,205 | py | Python | groot/main.py | TeamNameBE/G.R.O.O.T | 5b47a15585ddd2e256ab3bc30bdcdf7d314fed18 | [
"MIT"
] | null | null | null | groot/main.py | TeamNameBE/G.R.O.O.T | 5b47a15585ddd2e256ab3bc30bdcdf7d314fed18 | [
"MIT"
] | null | null | null | groot/main.py | TeamNameBE/G.R.O.O.T | 5b47a15585ddd2e256ab3bc30bdcdf7d314fed18 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow import keras
import numpy as np
import redis
import json
def load_settings():
f = open("settings.json")
return json.load(f)
def main():
settings = load_settings()
database = redis.Redis(host=settings["db_host"], port=6379, db=0)
while True:
# * W... | 30.205479 | 118 | 0.595465 |
a9e58e5ff333bb6a70efdce52c5c76a960d07a9e | 3,499 | py | Python | myblog/settings.py | guilhermegouw/DjangoBlog | 274e4085ab0b6617332fb14328b92b7511ba12a0 | [
"MIT"
] | null | null | null | myblog/settings.py | guilhermegouw/DjangoBlog | 274e4085ab0b6617332fb14328b92b7511ba12a0 | [
"MIT"
] | null | null | null | myblog/settings.py | guilhermegouw/DjangoBlog | 274e4085ab0b6617332fb14328b92b7511ba12a0 | [
"MIT"
] | null | null | null | """
Django settings for myblog project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib im... | 25.727941 | 91 | 0.706488 |
e38dafedce812e3a6912f214e748de758d9902ba | 371 | py | Python | earlier-2020/python_mod_tutorials/_logging/logging1.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:09:33.000Z | 2018-06-18T12:09:33.000Z | earlier-2020/python_mod_tutorials/_logging/logging1.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | null | null | null | earlier-2020/python_mod_tutorials/_logging/logging1.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:13:21.000Z | 2018-06-18T12:13:21.000Z | # -*- coding: utf-8 -*-
"""
# Log record to a file
logging.basicConfig(filename='logging.txt')
# more complex
logging.getLogger() # etc
"""
import logging
logging.basicConfig(level=logging.INFO)
# Logging rank
logging.debug('Hello world!')
logging.info('Hello world!')
logging.warning('Hello world!')
logging.err... | 16.863636 | 43 | 0.71159 |
daeb05302c79e465485f80fce99ff5184d100269 | 27,313 | py | Python | discord/player.py | ThatGenZGamer48/Texus | 96cdee4544f3bbb873620ba7a8926d6f7dc5a672 | [
"MIT"
] | null | null | null | discord/player.py | ThatGenZGamer48/Texus | 96cdee4544f3bbb873620ba7a8926d6f7dc5a672 | [
"MIT"
] | null | null | null | discord/player.py | ThatGenZGamer48/Texus | 96cdee4544f3bbb873620ba7a8926d6f7dc5a672 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-2021 Pycord Development
Copyright (c) 2021-present Texus
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 restri... | 32.788715 | 119 | 0.592648 |
52874aadb114be9fb7150218b2c143a0160822b2 | 25,564 | py | Python | dragonfire/conversational/textdata.py | kameranis/Dragonfire | 8ba4e588d3fd40257ed4e7ac9138f88d2bc0b3da | [
"MIT"
] | 1 | 2018-07-12T11:55:15.000Z | 2018-07-12T11:55:15.000Z | dragonfire/conversational/textdata.py | kameranis/Dragonfire | 8ba4e588d3fd40257ed4e7ac9138f88d2bc0b3da | [
"MIT"
] | null | null | null | dragonfire/conversational/textdata.py | kameranis/Dragonfire | 8ba4e588d3fd40257ed4e7ac9138f88d2bc0b3da | [
"MIT"
] | 1 | 2019-01-16T05:10:38.000Z | 2019-01-16T05:10:38.000Z | """
Loads the dialogue corpus, builds the vocabulary
"""
import numpy as np
import nltk # For tokenize
from tqdm import tqdm # Progress bar
import pickle # Saving the data
import math # For float comparison
import os # Checking file existance
import random
import string
import collections
from dragonfire.convers... | 40.77193 | 162 | 0.605383 |
49d995d84a532efb512433c478f511ff594b1c7d | 1,734 | py | Python | cms/toolbar_pool.py | mightyiam/django-cms | 09bf76d2f3d81fdaebcfb7e9ed4ecd4769fa8c25 | [
"BSD-3-Clause"
] | 2 | 2018-05-17T02:49:49.000Z | 2019-08-20T02:07:44.000Z | cms/toolbar_pool.py | mightyiam/django-cms | 09bf76d2f3d81fdaebcfb7e9ed4ecd4769fa8c25 | [
"BSD-3-Clause"
] | 2 | 2019-02-13T07:58:23.000Z | 2019-02-13T07:58:27.000Z | cms/toolbar_pool.py | mightyiam/django-cms | 09bf76d2f3d81fdaebcfb7e9ed4ecd4769fa8c25 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from cms.exceptions import ToolbarAlreadyRegistered
from cms.utils.conf import get_cms_setting
from cms.utils.django_load import load, iterload_objects
from django.core.exceptions import ImproperlyConfigured
class ToolbarPool(object):
def __init__(self):
self.toolbars = {}
... | 32.716981 | 104 | 0.615917 |
fba77e0e02d2c95ccc579825325fed0c68b28870 | 598 | py | Python | yield().py | DickLiu/Python_Note | f103b5f97ea22e2af7e4847a85b1f75f3a6f20a8 | [
"MIT"
] | null | null | null | yield().py | DickLiu/Python_Note | f103b5f97ea22e2af7e4847a85b1f75f3a6f20a8 | [
"MIT"
] | null | null | null | yield().py | DickLiu/Python_Note | f103b5f97ea22e2af7e4847a85b1f75f3a6f20a8 | [
"MIT"
] | null | null | null | from itertools import chain
def foo_yield(x):
i = 1
while i <= x:
yield range(0, i)
i += 1
'''
if you call foo_yield(4)
you will get a generator object
then you can call
for i in chain.from_iterable(foo_yield(4)):
print(i)
and you will get evaluated result below:
0
0
1
0
1
2
0
1
2
3
'''
''... | 14.585366 | 71 | 0.632107 |
e3761cf7c5ee8d059deb5d9027ac7353e35c664b | 3,177 | py | Python | tests/test_dedoppler.py | Biswajit1999/blimpy | ae252399f5edcd69e997117085cd0b7b94bf7fb6 | [
"BSD-3-Clause"
] | 36 | 2018-04-18T01:33:30.000Z | 2022-02-26T13:58:09.000Z | tests/test_dedoppler.py | Biswajit1999/blimpy | ae252399f5edcd69e997117085cd0b7b94bf7fb6 | [
"BSD-3-Clause"
] | 215 | 2017-03-22T22:09:35.000Z | 2022-03-30T20:44:58.000Z | tests/test_dedoppler.py | Biswajit1999/blimpy | ae252399f5edcd69e997117085cd0b7b94bf7fb6 | [
"BSD-3-Clause"
] | 93 | 2017-04-28T21:53:23.000Z | 2022-03-30T19:53:22.000Z | from os.path import dirname
import numpy as np
from astropy import units as u
import setigen as stg
import matplotlib.pyplot as plt
from blimpy.signal_processing.dedoppler import dedoppler_1
from blimpy import Waterfall
from blimpy.plotting import plot_waterfall
from tests.data import voyager_fil
PLOT_DIR = dirname(v... | 29.971698 | 97 | 0.626377 |
136134fb20963b186b769d879c3bd6318e05af83 | 22,236 | py | Python | modules/slice.py | wisstock/trans_scripts | aa09984ab1aeab2c0fdc306508cba046d89a790c | [
"MIT"
] | 2 | 2020-07-04T07:37:57.000Z | 2020-11-13T20:23:50.000Z | modules/slice.py | wisstock/trans_scripts | aa09984ab1aeab2c0fdc306508cba046d89a790c | [
"MIT"
] | null | null | null | modules/slice.py | wisstock/trans_scripts | aa09984ab1aeab2c0fdc306508cba046d89a790c | [
"MIT"
] | 3 | 2020-10-13T11:00:20.000Z | 2021-09-13T14:20:12.000Z | #!/usr/bin/env python3
""" Copyright © 2020 Borys Olifirov
Functions for extract pixel values by line.
"""
import sys
import os
import logging
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from skimage.external import tifffile
from skimage import data, img_as_float
def lineSli... | 27.588089 | 109 | 0.535843 |
bdfd915f71ab458294a6deadc1b776b1d4999815 | 1,462 | py | Python | pyjokes/pyjokes.py | r0d0dendr0n/pyjokes | 382065cba91007302be7fd04c5c35a9957e173b2 | [
"BSD-3-Clause"
] | null | null | null | pyjokes/pyjokes.py | r0d0dendr0n/pyjokes | 382065cba91007302be7fd04c5c35a9957e173b2 | [
"BSD-3-Clause"
] | null | null | null | pyjokes/pyjokes.py | r0d0dendr0n/pyjokes | 382065cba91007302be7fd04c5c35a9957e173b2 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import random
from .jokes_en import jokes_en
from .jokes_de import jokes_de
from .jokes_es import jokes_es
from .jokes_gl import jokes_gl
from .jokes_eu import jokes_eu
from .jokes_it import jokes_it
from .jokes_pl import jokes_pl
all_jokes = {
'en': jokes_en,
'de': joke... | 20.305556 | 96 | 0.615595 |
1cc0591b92eafc931b8a4e958acd849301cd859e | 1,372 | py | Python | nomadgram3/users/models.py | always-awake/cloning-instagram | 1e468a89d01700f4d9c5098b958ffac9f0d5e369 | [
"MIT"
] | 1 | 2018-07-15T06:43:39.000Z | 2018-07-15T06:43:39.000Z | nomadgram3/users/models.py | always-awake/Cloning-instagram-python | 1e468a89d01700f4d9c5098b958ffac9f0d5e369 | [
"MIT"
] | 5 | 2020-06-05T18:22:33.000Z | 2021-09-07T23:59:53.000Z | nomadgram3/users/models.py | always-awake/Cloning-instagram-python | 1e468a89d01700f4d9c5098b958ffac9f0d5e369 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
from django.urls import reverse
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@python_2_unicode_compatible
class User(AbstractUser):
""" User Model """
GEN... | 31.906977 | 108 | 0.701895 |
092d64e2d1542afd43fc83eb0894195b252533cd | 11,539 | py | Python | venv/lib/python3.6/site-packages/sphinx/builders/gettext.py | harishbalakrishnan3/Visual-Categorization | 28c5fc4695fca931bb2a49697cf1776dae1e8259 | [
"MIT"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | venv/Lib/site-packages/sphinx/builders/gettext.py | albert-lii/py-spiderman | 8ef46274b791ebf23569860719a6c669a34fd6e0 | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | venv/Lib/site-packages/sphinx/builders/gettext.py | albert-lii/py-spiderman | 8ef46274b791ebf23569860719a6c669a34fd6e0 | [
"MIT"
] | 5 | 2019-04-27T01:19:47.000Z | 2020-09-20T15:15:19.000Z | """
sphinx.builders.gettext
~~~~~~~~~~~~~~~~~~~~~~~
The MessageCatalogBuilder class.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from codecs import open
from collections import defaultdict, OrderedDict
from datetime import datetime,... | 35.179878 | 91 | 0.591299 |
ba6e18bce174bf6953b4bcf6c34c3efa326434ba | 33,766 | py | Python | Lib/site-packages/ipywidgets/widgets/widget.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/ipywidgets/widgets/widget.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/ipywidgets/widgets/widget.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | # coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Base Widget class. Allows user to create widgets in the back-end that render
in the IPython notebook front-end.
"""
import os
from contextlib import contextmanager
try:
from collections.abc im... | 40.007109 | 282 | 0.583516 |
ebc2d67a1cc7278b9409082b2cc47caf571c83f9 | 1,784 | py | Python | setup.py | dhilipsiva/choices | e76391722bb761fa81402dcf0668eb0b93b486b3 | [
"MIT"
] | 13 | 2015-11-26T09:37:30.000Z | 2021-12-07T04:17:49.000Z | setup.py | dhilipsiva/choices | e76391722bb761fa81402dcf0668eb0b93b486b3 | [
"MIT"
] | 4 | 2019-01-09T07:38:55.000Z | 2021-07-30T11:23:39.000Z | setup.py | dhilipsiva/choices | e76391722bb761fa81402dcf0668eb0b93b486b3 | [
"MIT"
] | 2 | 2019-01-09T07:41:06.000Z | 2019-09-10T06:40:17.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# vim: fenc=utf-8
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
#
"""
File name: setup.py
Version: 0.1
Author: dhilipsiva <dhilipsiva@gmail.com>
A helpful decorator for choice fields (Django choices or SQLAlchemy ChoiceType)
"""
from setuptools import setup, ... | 28.774194 | 79 | 0.63565 |
0183a2a0e17a5fd4b670ac0e6b158b76cc419953 | 723 | py | Python | backend/datasets/migrations/0002_auto_20190705_0833.py | hpi-dhc/alps | 6f6ab641f5486fc9de6ab42d74fbb0b90b702cdf | [
"MIT"
] | 12 | 2020-08-12T09:30:02.000Z | 2022-01-17T11:38:48.000Z | backend/datasets/migrations/0002_auto_20190705_0833.py | hpi-dhc/alps | 6f6ab641f5486fc9de6ab42d74fbb0b90b702cdf | [
"MIT"
] | 3 | 2020-08-12T09:04:16.000Z | 2022-02-28T01:42:44.000Z | backend/datasets/migrations/0002_auto_20190705_0833.py | hpi-dhc/alps | 6f6ab641f5486fc9de6ab42d74fbb0b90b702cdf | [
"MIT"
] | 1 | 2021-01-12T05:56:03.000Z | 2021-01-12T05:56:03.000Z | # Generated by Django 2.2.2 on 2019-07-05 08:33
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('datasets', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='signal',
name='first_t... | 26.777778 | 97 | 0.596127 |
cdef0eb34ec07351b36d0a71820df8605ff9996c | 685 | py | Python | tags/blocks/delete.py | TheGuywithTheHat/phen-cogs | b5de04bf0ec4dccd545e968a163d3f89f917db24 | [
"MIT"
] | 1 | 2021-08-03T00:11:33.000Z | 2021-08-03T00:11:33.000Z | tags/blocks/delete.py | TheGuywithTheHat/phen-cogs | b5de04bf0ec4dccd545e968a163d3f89f917db24 | [
"MIT"
] | null | null | null | tags/blocks/delete.py | TheGuywithTheHat/phen-cogs | b5de04bf0ec4dccd545e968a163d3f89f917db24 | [
"MIT"
] | null | null | null | from typing import Optional
from TagScriptEngine import Interpreter, adapter
from TagScriptEngine.block.helpers import helper_parse_if
from TagScriptEngine.interface import Block
class DeleteBlock(Block):
def will_accept(self, ctx: Interpreter.Context) -> bool:
dec = ctx.verb.declaration.lower()
... | 31.136364 | 65 | 0.667153 |
976e6e876c238f68b349d93659f6a68bd61905f0 | 5,003 | py | Python | doc/scripts/langevin_2.py | joepatmckenna/fem | 18b3e3cb0b83f7a4eb464c84f09f00673ea2fcb3 | [
"MIT"
] | null | null | null | doc/scripts/langevin_2.py | joepatmckenna/fem | 18b3e3cb0b83f7a4eb464c84f09f00673ea2fcb3 | [
"MIT"
] | null | null | null | doc/scripts/langevin_2.py | joepatmckenna/fem | 18b3e3cb0b83f7a4eb464c84f09f00673ea2fcb3 | [
"MIT"
] | 1 | 2018-07-27T15:30:00.000Z | 2018-07-27T15:30:00.000Z | import numpy as np
import numpy.linalg as nplin
import scipy as sp
from scipy.special import erf as sperf
from scipy.linalg import pinv as spinv
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
import multiprocessing
import os
import sys
dt, T, N_var = 0.1, 30000, 30 #float(sys.arg... | 32.914474 | 108 | 0.551669 |
977dcc68fbe66053c9e86c144fd92d459d9222dd | 546 | py | Python | scrapy_demo/test2.py | wordenfan/crawler_assemble | a60f64cd43cf6a05ca60b627dd2ce19cecad25b8 | [
"MIT"
] | 1 | 2018-06-25T10:22:13.000Z | 2018-06-25T10:22:13.000Z | scrapy_demo/test2.py | wordenfan/crawler_assemble | a60f64cd43cf6a05ca60b627dd2ce19cecad25b8 | [
"MIT"
] | null | null | null | scrapy_demo/test2.py | wordenfan/crawler_assemble | a60f64cd43cf6a05ca60b627dd2ce19cecad25b8 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import threading
import time
class myThread(threading.Thread):
def __init__(self, threadname):
threading.Thread.__init__(self, name=threadname)
self.st = 2
def run(self):
time.sleep(self.st)
print(self.getName())
def setSt(self, t):
self.st... | 15.166667 | 56 | 0.604396 |
aa3bde1bcbbae7d10d3ffa0f68da712828d86936 | 11,277 | py | Python | apitalker/resources.py | bednaJedna/att | 8947c40db20447dc94199074bda2d0fb0dcd13c9 | [
"MIT"
] | null | null | null | apitalker/resources.py | bednaJedna/att | 8947c40db20447dc94199074bda2d0fb0dcd13c9 | [
"MIT"
] | null | null | null | apitalker/resources.py | bednaJedna/att | 8947c40db20447dc94199074bda2d0fb0dcd13c9 | [
"MIT"
] | null | null | null | """This module provides convenient mappings of currently existing API resources provided by Apitalks.
Resources are mapped using classes, to be able to use `.` [dot] notation (and IntelliSense of IDE of your choice.)
**All resources were NOT tested to be functional**. They were just taken from the documentation.
Exa... | 32.405172 | 123 | 0.700541 |
19481e1dae0220ed69fce6d376db33e14ac170ff | 2,870 | py | Python | test/test_dag_array_output_alias.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 2 | 2020-01-30T23:28:59.000Z | 2020-05-06T16:43:47.000Z | test/test_dag_array_output_alias.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 1 | 2020-10-02T18:00:25.000Z | 2020-10-02T18:00:25.000Z | test/test_dag_array_output_alias.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
pollination-server
Pollination Server OpenAPI Definition # noqa: E501
The version of the OpenAPI document: 0.16.0
Contact: info@pollination.cloud
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import... | 31.195652 | 99 | 0.487805 |
447bfbb386c438bfe15715a832812ddfca9e19ba | 20,302 | py | Python | test/functional/test_framework/test_framework.py | CrystalizeCity/XaitenCoin | 2f8fa4651d7470b5c589cf502632416e6403ff54 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_framework.py | CrystalizeCity/XaitenCoin | 2f8fa4651d7470b5c589cf502632416e6403ff54 | [
"MIT"
] | 1 | 2020-12-25T11:56:33.000Z | 2020-12-25T11:56:33.000Z | test/functional/test_framework/test_framework.py | CrystalizeCity/XaitenCoin | 2f8fa4651d7470b5c589cf502632416e6403ff54 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
from enum import Enum
import logging
import optparse
import os
import p... | 42.2079 | 310 | 0.622599 |
45a1fccdbb528ec4f2880b636841989f960b173b | 350 | py | Python | src/django/api/migrations/0085_remove_facilityindex_custom_text.py | azavea/open-apparel-registry | 20f7a6d502d9152c85ee7f2696b25b6badf98924 | [
"MIT"
] | null | null | null | src/django/api/migrations/0085_remove_facilityindex_custom_text.py | azavea/open-apparel-registry | 20f7a6d502d9152c85ee7f2696b25b6badf98924 | [
"MIT"
] | null | null | null | src/django/api/migrations/0085_remove_facilityindex_custom_text.py | azavea/open-apparel-registry | 20f7a6d502d9152c85ee7f2696b25b6badf98924 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.24 on 2022-02-18 15:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0084_facilityindex_custom_text_array'),
]
operations = [
migrations.RemoveField(
model_name='facilityindex',
name='c... | 19.444444 | 56 | 0.617143 |
acfcafa9a6c01cde5afc9d2ac749343f8f6e1b38 | 1,535 | py | Python | Calendar.py | ValentinChareyre/adventofcode-2020 | 8b223ee4511dd4578e68f2adfe1c962185ef70d4 | [
"MIT"
] | null | null | null | Calendar.py | ValentinChareyre/adventofcode-2020 | 8b223ee4511dd4578e68f2adfe1c962185ef70d4 | [
"MIT"
] | null | null | null | Calendar.py | ValentinChareyre/adventofcode-2020 | 8b223ee4511dd4578e68f2adfe1c962185ef70d4 | [
"MIT"
] | null | null | null | import os
import glob
from os import system, name
from typing import List
def clear():
if name == 'nt': # windows
_ = system('cls')
else: # for mac and linux(here, os.name is 'posix')
_ = system('clear')
def get_calendar_directory() -> str:
calendar_file:str = os.path.realpath(__file_... | 34.886364 | 99 | 0.624756 |
5f186864d194ed025978a8adec957541814afe3b | 1,470 | py | Python | ml_service/model_process.py | ssalb/prediction-api-example | f13d266449aab7b6311fa378742b64403a1289b4 | [
"Apache-2.0"
] | null | null | null | ml_service/model_process.py | ssalb/prediction-api-example | f13d266449aab7b6311fa378742b64403a1289b4 | [
"Apache-2.0"
] | null | null | null | ml_service/model_process.py | ssalb/prediction-api-example | f13d266449aab7b6311fa378742b64403a1289b4 | [
"Apache-2.0"
] | null | null | null | import json
import config
import time
import redis
import numpy as np
from src.model import PreTrainedModel
db = redis.StrictRedis(host=config.DB_HOST, port=config.DB_PORT, db=config.DB_NAME)
if __name__ == "__main__":
model = PreTrainedModel()
while True:
queue = db.lrange(config.DB_Q... | 30 | 84 | 0.438095 |
1750e81f33dd032082f4e5745d6633bd8d2be32e | 1,773 | py | Python | aws/resources/serverless/devfest/devfest.py | empathyco/ops-spark-cloudproviders | 4669c42a618840ae76bedca537b227d934b8e449 | [
"MIT"
] | null | null | null | aws/resources/serverless/devfest/devfest.py | empathyco/ops-spark-cloudproviders | 4669c42a618840ae76bedca537b227d934b8e449 | [
"MIT"
] | null | null | null | aws/resources/serverless/devfest/devfest.py | empathyco/ops-spark-cloudproviders | 4669c42a618840ae76bedca537b227d934b8e449 | [
"MIT"
] | null | null | null | import json
from botocore.vendored import requests
import os
def lambda_handler(event, context):
if os.environ['args2'] == "":
data = {
'queue': os.environ['queue'],
'numExecutors': int(os.environ['numExecutors']),
'executorCores': int(os.environ['execut... | 39.4 | 136 | 0.551043 |
40079fb76bacf77a6f5b7b6c67cad20baba2135a | 719 | py | Python | hypothesisapi/examples/create_simple.py | Bubblbu/public-knowledge-annotations | 05a498c61728410a67583949478e1c430b95927d | [
"CC-BY-4.0"
] | null | null | null | hypothesisapi/examples/create_simple.py | Bubblbu/public-knowledge-annotations | 05a498c61728410a67583949478e1c430b95927d | [
"CC-BY-4.0"
] | null | null | null | hypothesisapi/examples/create_simple.py | Bubblbu/public-knowledge-annotations | 05a498c61728410a67583949478e1c430b95927d | [
"CC-BY-4.0"
] | null | null | null | import os
import sys
import argparse
import requests
from hypothesisapi import *
parser = argparse.ArgumentParser()
parser.add_argument('-u', dest='user', action='store',
help='hypothes.is user')
parser.add_argument('-k', dest='api_key', action='store',
help='hypothes.is api_... | 19.432432 | 58 | 0.630042 |
7dc4e833259b848783ae6cb671a54cb4fc84ff8b | 6,984 | py | Python | dm_control/entities/manipulators/base.py | h8907283/dm_control | fe4449606742a7b8bec81930790b98244cddc538 | [
"Apache-2.0"
] | 1 | 2022-03-22T11:53:38.000Z | 2022-03-22T11:53:38.000Z | dm_control/entities/manipulators/base.py | krakhit/dm_control | 4e1a35595124742015ae0c7a829e099a5aa100f5 | [
"Apache-2.0"
] | null | null | null | dm_control/entities/manipulators/base.py | krakhit/dm_control | 4e1a35595124742015ae0c7a829e099a5aa100f5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 36 | 80 | 0.69831 |
258f116b0343ada5cbc9db615f0d936be644717a | 966 | py | Python | conn_test.py | goderik01/PACE2018 | c9cd01e8bb2f798989af04de28223a6f19ebd2b7 | [
"BSL-1.0"
] | 1 | 2019-01-21T13:47:07.000Z | 2019-01-21T13:47:07.000Z | conn_test.py | goderik01/PACE2018 | c9cd01e8bb2f798989af04de28223a6f19ebd2b7 | [
"BSL-1.0"
] | null | null | null | conn_test.py | goderik01/PACE2018 | c9cd01e8bb2f798989af04de28223a6f19ebd2b7 | [
"BSL-1.0"
] | null | null | null | #!/usr/bin/env python3
import utils.gr2nx as gr2nx
import argparse
import networkx as nx
parser = argparse.ArgumentParser(description='Connection checker of SteinerTreeHeuristic (CUiB).')
parser.add_argument('graphfile', metavar='INPUTFILE', type=str, nargs=1,
help='file containing input graph')
... | 33.310345 | 98 | 0.682195 |
8f6fb50f2593e8b5a0c008c3e96622212d100901 | 1,884 | py | Python | scripts/fb/CoinChangeCount.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | scripts/fb/CoinChangeCount.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | 8 | 2020-09-05T16:04:31.000Z | 2022-02-27T09:57:51.000Z | scripts/fb/CoinChangeCount.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | """
Coin Change 2 - Count
You are given an integer array coins representing coins of different
denominations and an integer amount representing a total amount of money.
Return the number of combinations that make up that amount.
If that amount of money cannot be made up by any combination of the coins, return 0.
... | 23.55 | 84 | 0.582803 |
4abe32d298d1da4fc05e1b290e211aab9f31c45f | 31,557 | py | Python | IPython/external/path/_path.py | ivanov/ipython | 62cc379d3b454923cb48e94663f385f54ec806cc | [
"BSD-3-Clause-Clear"
] | 2 | 2015-04-21T12:12:43.000Z | 2015-04-21T12:12:54.000Z | IPython/external/path.py | 08saikiranreddy/ipython | 3498382180ad409592f46a9dd0d190ca917bfbff | [
"BSD-3-Clause-Clear"
] | 1 | 2015-07-16T22:26:53.000Z | 2015-07-16T22:26:53.000Z | IPython/external/path.py | 08saikiranreddy/ipython | 3498382180ad409592f46a9dd0d190ca917bfbff | [
"BSD-3-Clause-Clear"
] | null | null | null | """ path.py - An object representing a path to a file or directory.
Example:
from IPython.external.path import path
d = path('/home/guido/bin')
for f in d.files('*.py'):
f.chmod(0755)
This module requires Python 2.5 or later.
URL: http://www.jorendorff.com/articles/python/path
Author: Jason Orendorff <jas... | 33.393651 | 97 | 0.555883 |
7e03c49707c6bbdca28f5f83be3d8f780b3f2c5c | 2,898 | py | Python | ufile/python/test_ufile/test_postfile.py | spero002/yoyo | 3a19221cdd7d7e6c99d5ed3be831f2ce9908d6a7 | [
"Apache-2.0"
] | null | null | null | ufile/python/test_ufile/test_postfile.py | spero002/yoyo | 3a19221cdd7d7e6c99d5ed3be831f2ce9908d6a7 | [
"Apache-2.0"
] | null | null | null | ufile/python/test_ufile/test_postfile.py | spero002/yoyo | 3a19221cdd7d7e6c99d5ed3be831f2ce9908d6a7 | [
"Apache-2.0"
] | 2 | 2016-07-06T03:59:07.000Z | 2021-10-12T10:02:00.000Z | # -*- coding: utf-8 -*-
import unittest
import os
from ucloud.ufile import postufile
from ucloud.compact import b
from ucloud.logger import logger, set_log_file
from ucloud.ufile.config import BLOCKSIZE, get_default
from ucloud.compact import BytesIO
set_log_file()
public_key = '' #添加自己的账户公钥
private_key = '' #添加自己的账户... | 37.636364 | 100 | 0.716701 |
f948d6845e436df8797e56793716e05b42a19b25 | 7,119 | py | Python | icrawler/builtin/google.py | zluo/icrawler | 18e7426ff25e639eeb4377e7f5baff964930a104 | [
"MIT"
] | null | null | null | icrawler/builtin/google.py | zluo/icrawler | 18e7426ff25e639eeb4377e7f5baff964930a104 | [
"MIT"
] | null | null | null | icrawler/builtin/google.py | zluo/icrawler | 18e7426ff25e639eeb4377e7f5baff964930a104 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import json
from bs4 import BeautifulSoup
from six.moves.urllib.parse import urlencode
from icrawler import Crawler, Feeder, Parser, ImageDownloader
from icrawler.builtin.filter import Filter
class GoogleFeeder(Feeder):
def get_filter(self):
search_filter = Filt... | 35.242574 | 79 | 0.486445 |
facdd72d1fd7cfc75e1941f543bd7bc6eb3ace12 | 36,104 | py | Python | sdk/python/pulumi_aws_native/lambda_/function.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws_native/lambda_/function.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws_native/lambda_/function.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 50.922426 | 485 | 0.673333 |
bb39bc8d5c5891d3aac0a9fc5f7746a1d2d6507d | 12,709 | py | Python | test/test_metric.py | zuoxingdong/lagom | 3b6710804dbc79c6dffb369ac87c68f4055ab6cd | [
"MIT"
] | 383 | 2018-07-11T17:43:10.000Z | 2022-01-24T08:46:23.000Z | test/test_metric.py | mikepsn/lagom | 3b6710804dbc79c6dffb369ac87c68f4055ab6cd | [
"MIT"
] | 90 | 2018-07-11T23:51:45.000Z | 2021-12-16T08:56:42.000Z | test/test_metric.py | mikepsn/lagom | 3b6710804dbc79c6dffb369ac87c68f4055ab6cd | [
"MIT"
] | 32 | 2018-07-12T18:21:03.000Z | 2021-09-15T05:47:48.000Z | import pytest
import numpy as np
import torch
import gym
from gym.wrappers import TimeLimit
from lagom import RandomAgent
from lagom import EpisodeRunner
from lagom import StepRunner
from lagom.utils import numpify
from lagom.metric import returns
from lagom.metric import bootstrapped_returns
from lagom.metric impor... | 43.975779 | 127 | 0.561807 |
ebf6c729f69cd048ba1543bd55280a52de9c2429 | 3,890 | py | Python | rotkehlchen/tests/unit/test_zerion.py | VoR0220/rotki | 0ba3073c3d71ff8bf0800841c5e1097243f46b66 | [
"BSD-3-Clause"
] | 1 | 2020-12-12T01:41:19.000Z | 2020-12-12T01:41:19.000Z | rotkehlchen/tests/unit/test_zerion.py | VoR0220/rotki | 0ba3073c3d71ff8bf0800841c5e1097243f46b66 | [
"BSD-3-Clause"
] | null | null | null | rotkehlchen/tests/unit/test_zerion.py | VoR0220/rotki | 0ba3073c3d71ff8bf0800841c5e1097243f46b66 | [
"BSD-3-Clause"
] | null | null | null | import warnings as test_warnings
import pytest
from rotkehlchen.chain.ethereum.zerion import Zerion
from rotkehlchen.fval import FVal
@pytest.mark.parametrize('mocked_current_prices', [{
'SNX': FVal('1'),
'cUSDT': FVal('1'),
'USDT': FVal('1'),
}])
def test_query_all_protocol_balances_for_account(
... | 29.469697 | 95 | 0.660411 |
214067a99304a792834baab8b2f557fcf535a987 | 262 | py | Python | rrd/utils/__init__.py | Xuexiang825/dashboard | fbecab2986e4e97ef9b7016aa7bec72b4b27b67f | [
"Apache-2.0"
] | 1 | 2019-01-08T01:46:51.000Z | 2019-01-08T01:46:51.000Z | rrd/utils/__init__.py | Xuexiang825/dashboard | fbecab2986e4e97ef9b7016aa7bec72b4b27b67f | [
"Apache-2.0"
] | null | null | null | rrd/utils/__init__.py | Xuexiang825/dashboard | fbecab2986e4e97ef9b7016aa7bec72b4b27b67f | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8 -*-
import random
import string
def randbytes(bytes_):
return ''.join(random.sample(string.ascii_letters + string.digits, bytes_))
def random_string (length):
return ''.join(random.choice(string.letters) for ii in range (length + 1))
| 26.2 | 79 | 0.71374 |
9ec0f7f6372d524d4e154c8ebf86da45a6be8df6 | 3,936 | py | Python | lambda/tools/bulkEmail.py | epicfaace/GCMW | b06b41c1629866e334c8b2cd94d008bbc2028cdf | [
"Apache-2.0"
] | 2 | 2021-08-09T07:50:37.000Z | 2022-03-15T17:23:37.000Z | lambda/tools/bulkEmail.py | ksankara/CFF | 70f10bb7abc0f381fa309379a85d2782ed6c36b8 | [
"Apache-2.0"
] | 114 | 2019-06-20T15:27:13.000Z | 2020-08-30T21:15:56.000Z | lambda/tools/bulkEmail.py | epicfaace/GCMW | b06b41c1629866e334c8b2cd94d008bbc2028cdf | [
"Apache-2.0"
] | 7 | 2019-07-20T06:11:19.000Z | 2020-06-28T15:23:14.000Z | from pynliner import Pynliner
import json
import boto3
from boto3.dynamodb.conditions import Key
from chalicelib.util import get_all_responses
from chalicelib.main import TABLES
"""
python tools/bulkEmail.py
python -m unittest tools.bulkEmail
"""
from tests.integration.constants import _
from chalicelib.util.formSubmi... | 35.781818 | 215 | 0.686484 |
f1eed6fb1bc37c51acf2455050914187d7745dff | 7,987 | py | Python | treetime/branch_len_interpolator.py | stevenweaver/treetime | 2f6ab5dd3666d92f4d9411fbc44635a28982748c | [
"MIT"
] | null | null | null | treetime/branch_len_interpolator.py | stevenweaver/treetime | 2f6ab5dd3666d92f4d9411fbc44635a28982748c | [
"MIT"
] | null | null | null | treetime/branch_len_interpolator.py | stevenweaver/treetime | 2f6ab5dd3666d92f4d9411fbc44635a28982748c | [
"MIT"
] | null | null | null | from __future__ import print_function, division, absolute_import
import numpy as np
from treetime import config as ttconf
from .distribution import Distribution
class BranchLenInterpolator (Distribution):
"""
Tjis class defines the methods to manipulate the branch length probability
distributions.
"""... | 48.70122 | 134 | 0.583448 |
721a6e2eaf3c973b84e4e2ea2befd5730fec551e | 1,177 | py | Python | setup.py | frillip/tsl2561 | b974c6b6efced92dd3e63ec423ee72190420a931 | [
"BSD-3-Clause"
] | null | null | null | setup.py | frillip/tsl2561 | b974c6b6efced92dd3e63ec423ee72190420a931 | [
"BSD-3-Clause"
] | null | null | null | setup.py | frillip/tsl2561 | b974c6b6efced92dd3e63ec423ee72190420a931 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from os.path import join, dirname
from setuptools import setup, find_packages
import sys
import os
VERSION = (1, 0)
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION))
f = open(join(dirname(__file__), 'README.rst'))
long_description = f.read().strip()
f.close()
install_requires... | 26.75 | 85 | 0.642311 |
1c5153dfd9c1788853799f265ebcbdf72897314d | 135 | py | Python | changelog/__init__.py | automation-liberation/deployment-helper | 9a048e03a8c9648f37f8936065eaacfa60c6c5ca | [
"Apache-2.0"
] | null | null | null | changelog/__init__.py | automation-liberation/deployment-helper | 9a048e03a8c9648f37f8936065eaacfa60c6c5ca | [
"Apache-2.0"
] | null | null | null | changelog/__init__.py | automation-liberation/deployment-helper | 9a048e03a8c9648f37f8936065eaacfa60c6c5ca | [
"Apache-2.0"
] | null | null | null | from changelog.daos import ChangelogDAO
def parse_build_params(path):
dao = ChangelogDAO.parse_yaml(path)
dao.send_entries()
| 19.285714 | 39 | 0.77037 |
f2206e00c9b237101203a1b2b0419c5f21b8f252 | 805 | py | Python | contas/migrations/0002_transacao.py | AndersonRodr/Django-CRUD-Basico | c90c3b314d78583c663e19e735f610f7e16702a4 | [
"MIT"
] | null | null | null | contas/migrations/0002_transacao.py | AndersonRodr/Django-CRUD-Basico | c90c3b314d78583c663e19e735f610f7e16702a4 | [
"MIT"
] | null | null | null | contas/migrations/0002_transacao.py | AndersonRodr/Django-CRUD-Basico | c90c3b314d78583c663e19e735f610f7e16702a4 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-08-03 00:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contas', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Transaca... | 32.2 | 118 | 0.580124 |
798f82f0509ba354e95ab6178cd59f8b6b4c7424 | 11,554 | py | Python | Authlib-0.14.3/authlib/jose/rfc7515/jws.py | yishan1331/heroku-yishan-paas | bd46bc8c067999b1dfb83b863b5ba64e76933d0a | [
"MIT"
] | null | null | null | Authlib-0.14.3/authlib/jose/rfc7515/jws.py | yishan1331/heroku-yishan-paas | bd46bc8c067999b1dfb83b863b5ba64e76933d0a | [
"MIT"
] | 4 | 2021-03-19T08:17:59.000Z | 2021-06-10T19:34:36.000Z | Authlib-0.14.3/authlib/jose/rfc7515/jws.py | yishan1331/heroku-yishan-paas | bd46bc8c067999b1dfb83b863b5ba64e76933d0a | [
"MIT"
] | null | null | null | from authlib.common.encoding import (
to_bytes,
to_unicode,
urlsafe_b64encode,
json_b64encode,
json_loads,
)
from authlib.jose.util import (
prepare_algorithm_key,
extract_header,
extract_segment,
)
from authlib.jose.errors import (
DecodeError,
MissingAlgorithmError,
Unsuppo... | 35.550769 | 78 | 0.63874 |
b3ee2bebd1dceed26649161caa975c959efeb540 | 2,585 | py | Python | examples/full-screen/calculator.py | chouette254/quo | 8979afd118e77d3d0f93f9fbe8711efada7158c5 | [
"MIT"
] | 1 | 2021-02-15T03:56:00.000Z | 2021-02-15T03:56:00.000Z | examples/full-screen/calculator.py | chouette254/quo | 8979afd118e77d3d0f93f9fbe8711efada7158c5 | [
"MIT"
] | 3 | 2021-02-22T11:49:23.000Z | 2021-02-28T06:47:41.000Z | examples/full-screen/calculator.py | secretuminc/quo | c4f77d52f015c612d32ed0fc2fc79545af598f10 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
A simple example of a calculator program.
This could be used as inspiration for a REPL.
"""
import quo
from quo.filters import has_focus
from quo.styles import Style
help_text = """
Type any expression (e.g. "4 + 4") followed by enter to execute.
Press Control-C to exit.
"""
def main():
... | 27.210526 | 83 | 0.597679 |
7d984da0cfb963f7f6b386769ac6c6d0eff058f2 | 4,302 | py | Python | neural-navigation-with-lstm/MARCO/nltk/test/__init__.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | 14 | 2016-04-03T19:25:13.000Z | 2022-01-05T07:03:07.000Z | neural-navigation-with-lstm/MARCO/nltk/test/__init__.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | null | null | null | neural-navigation-with-lstm/MARCO/nltk/test/__init__.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | 5 | 2018-06-21T12:58:58.000Z | 2020-02-15T05:33:39.000Z | # Natural Language Toolkit: Unit Tests
#
# Copyright (C) 2001 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: __init__.py,v 1.1.1.2 2004/09/29 21:58:13 adastra Exp $
"""
Unit tests for the NLTK modules. ... | 30.510638 | 72 | 0.59112 |
18a50d0d1acc618c102aa0dd7cc97421c95f5322 | 3,850 | py | Python | tempest/api/identity/admin/v3/test_default_project_id.py | Hybrid-Cloud/hybrid-tempest | 319e90c6fa6e46925b495c93cd5258f088a30ec0 | [
"Apache-2.0"
] | 3 | 2016-07-15T12:27:23.000Z | 2021-04-23T04:41:10.000Z | tempest/api/identity/admin/v3/test_default_project_id.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/v3/test_default_project_id.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | 12 | 2016-07-14T18:13:05.000Z | 2017-07-08T18:45:42.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 42.777778 | 78 | 0.659481 |
ecb6d18331f21a7eeec07c78fa856149e2056bfb | 5,178 | py | Python | mt_with_external_memory/train.py | xiaoyeye1117/models | 16a2509e34c692e19ccd6b876a0fae1f3c06fa7a | [
"Apache-2.0"
] | null | null | null | mt_with_external_memory/train.py | xiaoyeye1117/models | 16a2509e34c692e19ccd6b876a0fae1f3c06fa7a | [
"Apache-2.0"
] | null | null | null | mt_with_external_memory/train.py | xiaoyeye1117/models | 16a2509e34c692e19ccd6b876a0fae1f3c06fa7a | [
"Apache-2.0"
] | 1 | 2019-01-22T15:40:57.000Z | 2019-01-22T15:40:57.000Z | """
Contains training script for machine translation with external memory.
"""
import argparse
import sys
import gzip
import distutils.util
import random
import paddle.v2 as paddle
from external_memory import ExternalMemory
from model import memory_enhanced_seq2seq
from data_utils import reader_append_wrapper
par... | 32.161491 | 80 | 0.655852 |
e0cfeee2cff9819eb771020bdb8cc538e1fa70da | 97 | py | Python | gimmebio/seqtalk/gimmebio/seqtalk/binary_neurons/__init__.py | Chandrima-04/gimmebio | cb3e66380006d5c5c00ff70bfb87317dd252c312 | [
"MIT"
] | 3 | 2020-01-21T23:49:55.000Z | 2020-07-29T17:02:30.000Z | gimmebio/seqtalk/gimmebio/seqtalk/binary_neurons/__init__.py | Chandrima-04/gimmebio | cb3e66380006d5c5c00ff70bfb87317dd252c312 | [
"MIT"
] | null | null | null | gimmebio/seqtalk/gimmebio/seqtalk/binary_neurons/__init__.py | Chandrima-04/gimmebio | cb3e66380006d5c5c00ff70bfb87317dd252c312 | [
"MIT"
] | 4 | 2020-01-21T16:48:17.000Z | 2020-03-13T15:34:52.000Z |
from .activations import (
StochasticBinaryActivation,
DeterministicBinaryActivation,
)
| 16.166667 | 34 | 0.783505 |
f2d4d667f4d27847a263bbd83391460d72cff74b | 1,214 | py | Python | tests/conftest.py | dan-armstrong/amrrt | 84d063a45adafc317c141bbad7306aa1dbca9b69 | [
"Apache-2.0"
] | 2 | 2021-07-15T09:49:02.000Z | 2022-03-27T07:44:20.000Z | tests/conftest.py | dan-armstrong/amrrt | 84d063a45adafc317c141bbad7306aa1dbca9b69 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | dan-armstrong/amrrt | 84d063a45adafc317c141bbad7306aa1dbca9b69 | [
"Apache-2.0"
] | 1 | 2022-03-03T13:42:59.000Z | 2022-03-03T13:42:59.000Z | #Copyright (c) 2020 Ocado. All Rights Reserved.
import pytest, sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)))
from amrrt.space import StateSpace
from amrrt.grid_graph import GridGraph
from amrrt.diffusion_map import DiffusionMap
from amrrt.metrics import... | 39.16129 | 118 | 0.761944 |
21f0d7b0894afd69f862b5a2e95c7faa2f344dcf | 950 | py | Python | tests/transforms/augmentation/test_oneof.py | OeslleLucena/torchio | 4c09bc78a15464f9bf0f0eec487828cf5fe566c1 | [
"MIT"
] | 1 | 2021-01-22T21:49:30.000Z | 2021-01-22T21:49:30.000Z | tests/transforms/augmentation/test_oneof.py | neuronflow/torchio | 1d0a5ad069c59d74ec56ed6f340c87e9636a1488 | [
"MIT"
] | null | null | null | tests/transforms/augmentation/test_oneof.py | neuronflow/torchio | 1d0a5ad069c59d74ec56ed6f340c87e9636a1488 | [
"MIT"
] | null | null | null | import torchio
from torchio.transforms import OneOf, RandomAffine, RandomElasticDeformation
from ...utils import TorchioTestCase
class TestOneOf(TorchioTestCase):
"""Tests for `OneOf`."""
def test_wrong_input_type(self):
with self.assertRaises(ValueError):
OneOf(1)
def test_negative_p... | 31.666667 | 76 | 0.667368 |
bccc3f6413c723524db0679bf4224c638fa00be0 | 7,533 | py | Python | finetune.py | xxxupeng/PSMNet | 6b992d7fba1bc003ca21568fd4ef573e27051a6c | [
"MIT"
] | null | null | null | finetune.py | xxxupeng/PSMNet | 6b992d7fba1bc003ca21568fd4ef573e27051a6c | [
"MIT"
] | null | null | null | finetune.py | xxxupeng/PSMNet | 6b992d7fba1bc003ca21568fd4ef573e27051a6c | [
"MIT"
] | null | null | null | from __future__ import print_function
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as F
import skimage
import ski... | 35.533019 | 122 | 0.628169 |
5061bca65653c73499bd12db7e57ba403e70b482 | 86 | py | Python | textadventure/books.py | ToEndThePeace/Intro-Python-II | fdf0c1ab3b7e897c1af4421317ad1f7fd278a13c | [
"MIT"
] | 1 | 2021-06-05T23:55:16.000Z | 2021-06-05T23:55:16.000Z | textadventure/books.py | ToEndThePeace/Intro-Python-II | fdf0c1ab3b7e897c1af4421317ad1f7fd278a13c | [
"MIT"
] | null | null | null | textadventure/books.py | ToEndThePeace/Intro-Python-II | fdf0c1ab3b7e897c1af4421317ad1f7fd278a13c | [
"MIT"
] | 3 | 2021-01-16T00:35:00.000Z | 2021-06-05T23:54:25.000Z | import json
with open("data/books.json") as book_data:
books = json.load(book_data) | 21.5 | 42 | 0.744186 |
7f44ec7a5a5901246a9cd40bcb066b1652c2a264 | 436 | py | Python | zoo/public/swin/swin_small_patch4_window7_224.py | megvii-research/basecls | 6b395a0a888370b4523764afb78a5a7634a3f6cd | [
"Apache-2.0"
] | 23 | 2021-12-08T02:35:01.000Z | 2022-03-16T02:23:19.000Z | zoo/public/swin/swin_small_patch4_window7_224.py | megvii-research/basecls | 6b395a0a888370b4523764afb78a5a7634a3f6cd | [
"Apache-2.0"
] | 4 | 2021-12-23T11:31:17.000Z | 2022-02-28T01:35:31.000Z | zoo/public/swin/swin_small_patch4_window7_224.py | megvii-research/basecls | 6b395a0a888370b4523764afb78a5a7634a3f6cd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
from basecls.configs import SwinConfig
_cfg = dict(
batch_size=128,
model=dict(
name="swin_small_patch4_window7_224",
),
solver=dict(
accumulation_steps=1,
),
)
class Cfg(SwinConfig):
def __init_... | 21.8 | 58 | 0.662844 |
f9e070c428c98f0814ba86e50b399454e874b618 | 273 | py | Python | hellocherry.py | shantanuo/Quillpad-Server | 01adcf05d4d5712eb01c8ed4d5eff338378ee73e | [
"BSD-3-Clause"
] | 101 | 2016-11-02T13:03:09.000Z | 2022-01-14T07:45:41.000Z | hellocherry.py | ammerender/Quillpad-Server | 938671f65cdc02004c4bcf934e7085e1e0e13f72 | [
"BSD-3-Clause"
] | 17 | 2016-10-26T19:38:46.000Z | 2020-07-09T17:06:05.000Z | hellocherry.py | ammerender/Quillpad-Server | 938671f65cdc02004c4bcf934e7085e1e0e13f72 | [
"BSD-3-Clause"
] | 67 | 2016-10-23T07:24:46.000Z | 2022-02-14T09:10:16.000Z | # -*- coding: utf-8 -*-
# @Date : Jan 25, 2013
# @Author : Ram Prakash, Sharath Puranik
# @Version : 1
import cherrypy
class HelloWorld:
def index(self):
return "Hello World!"
index.exposed = True
cherrypy.root = HelloWorld()
cherrypy.server.start()
| 18.2 | 41 | 0.641026 |
e463a09b47f55ce6552b90616ed9e93a940bf131 | 10,257 | py | Python | instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py | epsagon/opentelemetry-python-contrib | 2671ff53c8643ad55dcf78dad072f2f0b82e84e1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2019-11-26T14:31:09.000Z | 2020-01-09T23:04:49.000Z | instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py | epsagon/opentelemetry-python-contrib | 2671ff53c8643ad55dcf78dad072f2f0b82e84e1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 16 | 2020-02-07T10:01:02.000Z | 2020-04-06T22:03:31.000Z | instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py | epsagon/opentelemetry-python-contrib | 2671ff53c8643ad55dcf78dad072f2f0b82e84e1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2020-02-05T14:59:12.000Z | 2020-04-03T15:34:16.000Z | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 33.851485 | 203 | 0.667349 |
f18da3785d5bae17fc66ffaea595968627db8e7d | 326 | py | Python | tests/fixtures/defxmlschema/chapter18/example18042.py | nimish/xsdata | 7afe2781b66982428cc1731f53c065086acd35c1 | [
"MIT"
] | null | null | null | tests/fixtures/defxmlschema/chapter18/example18042.py | nimish/xsdata | 7afe2781b66982428cc1731f53c065086acd35c1 | [
"MIT"
] | null | null | null | tests/fixtures/defxmlschema/chapter18/example18042.py | nimish/xsdata | 7afe2781b66982428cc1731f53c065086acd35c1 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Optional
@dataclass
class DescriptionGroup:
"""
:ivar description:
"""
description: Optional[str] = field(
default=None,
metadata=dict(
type="Element",
namespace="",
required=True
)
... | 18.111111 | 40 | 0.570552 |
3ed252300bb51a9b9cd7e715e96b731216eeb121 | 556 | py | Python | python/http/websocket-greeting-b.py | orri93/examples | ef9e4ed535f7ccc4264bb55096efa6b4e8162184 | [
"Apache-2.0"
] | null | null | null | python/http/websocket-greeting-b.py | orri93/examples | ef9e4ed535f7ccc4264bb55096efa6b4e8162184 | [
"Apache-2.0"
] | 7 | 2020-09-09T12:12:24.000Z | 2020-09-09T12:37:56.000Z | python/http/websocket-greeting-b.py | orri93/examples | ef9e4ed535f7ccc4264bb55096efa6b4e8162184 | [
"Apache-2.0"
] | null | null | null | import websocket
import _thread
import time
def ws_message(ws, message):
print("WebSocket message: %s" % message)
def ws_open(ws):
print("WebSocket Opened sending message")
ws.send('{"name": "Orri"}')
ws = websocket.WebSocketApp("ws://localhost:8080/name", on_open = ws_open, on_message = ws_message)
def ws_th... | 21.384615 | 99 | 0.730216 |
d470777facec44284da9a962cf11226320e308c1 | 683 | py | Python | 501-600/501-510/502-IPO/IPO.py | xuychen/Leetcode | c8bf33af30569177c5276ffcd72a8d93ba4c402a | [
"MIT"
] | null | null | null | 501-600/501-510/502-IPO/IPO.py | xuychen/Leetcode | c8bf33af30569177c5276ffcd72a8d93ba4c402a | [
"MIT"
] | null | null | null | 501-600/501-510/502-IPO/IPO.py | xuychen/Leetcode | c8bf33af30569177c5276ffcd72a8d93ba4c402a | [
"MIT"
] | null | null | null | import heapq
class Solution(object):
def findMaximizedCapital(self, k, w, profits, capital):
"""
:type k: int
:type w: int
:type profits: List[int]
:type capital: List[int]
:rtype: int
"""
cap_profit = sorted(zip(capital, profits))
length = l... | 24.392857 | 68 | 0.508053 |
cadd3a082789ddca14ce41bd59b6c2f395b8f196 | 226 | py | Python | katas/kyu_6/cryptography_1_viva_cesare.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | katas/kyu_6/cryptography_1_viva_cesare.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | katas/kyu_6/cryptography_1_viva_cesare.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | from string import ascii_letters as az, maketrans, translate
def caesar_crypto_encode(text, shift):
if not text:
return ''
sh = shift % 52
return translate(text, maketrans(az, az[sh:] + az[:sh])).strip()
| 25.111111 | 68 | 0.663717 |
ff87a8c4b8eaaeda8d3b4a463548f0c063ae1a5f | 3,120 | py | Python | services/nudge_server/server.py | djrobinson/nudge | 6be746a312e21f095e2c1004e69a43d8edec50c5 | [
"MIT"
] | null | null | null | services/nudge_server/server.py | djrobinson/nudge | 6be746a312e21f095e2c1004e69a43d8edec50c5 | [
"MIT"
] | 7 | 2020-09-04T16:50:48.000Z | 2022-02-26T09:59:13.000Z | services/nudge_server/server.py | djrobinson/nudge | 6be746a312e21f095e2c1004e69a43d8edec50c5 | [
"MIT"
] | 1 | 2019-03-04T14:24:55.000Z | 2019-03-04T14:24:55.000Z | import os
import json
import logging
import faust
import asyncio
import codecs
from datetime import datetime
from aiohttp import web
import websockets
from mode import Service
from websockets.exceptions import ConnectionClosed
from websockets.server import WebSocketServerProtocol
from sockets.exchanges.poloniex_so... | 24.186047 | 70 | 0.625321 |
554fde6a455b8908733828ad801c398f2a8f8bc1 | 4,353 | py | Python | service/flavours/mlflow/interfaces/modzy/grpc_model/src/utils.py | modzy/chassis | a147411c5a27dfee371b75d4cba8d12171d89255 | [
"Apache-2.0"
] | 29 | 2021-07-27T15:59:31.000Z | 2022-03-24T17:22:17.000Z | service/flavours/mlflow/interfaces/modzy/grpc_model/src/utils.py | modzy/chassis | a147411c5a27dfee371b75d4cba8d12171d89255 | [
"Apache-2.0"
] | 46 | 2021-07-29T08:47:21.000Z | 2022-03-28T01:59:24.000Z | service/flavours/mlflow/interfaces/modzy/grpc_model/src/utils.py | modzy/chassis | a147411c5a27dfee371b75d4cba8d12171d89255 | [
"Apache-2.0"
] | 2 | 2021-12-06T20:33:38.000Z | 2022-03-11T15:47:48.000Z | import os
from typing import Any, Dict, List, Tuple
import yaml
from ...grpc_model import __VERSION__, ASSET_BUNDLE, MODEL_YAML
class InputOutputMismatchException(Exception):
pass
class ModelVersionNotSynchronizedException(Exception):
pass
# TODO: the two following functions should probably be removed i... | 37.525862 | 118 | 0.717436 |
6bc0094864f1fb0fb710fdd375b5b5ea15c8e573 | 31 | py | Python | tests/conftest.py | ermakov-oleg/tox-pipenv-install | 669c2cbe2eae86bc018ed498c13ecde3d356fd90 | [
"MIT"
] | 5 | 2019-07-18T08:50:28.000Z | 2021-03-19T00:09:46.000Z | tests/conftest.py | ermakov-oleg/tox-pipenv-install | 669c2cbe2eae86bc018ed498c13ecde3d356fd90 | [
"MIT"
] | 1 | 2019-07-08T07:53:33.000Z | 2019-07-08T07:53:33.000Z | tests/conftest.py | ermakov-oleg/tox-pipenv-install | 669c2cbe2eae86bc018ed498c13ecde3d356fd90 | [
"MIT"
] | 1 | 2019-07-08T07:41:34.000Z | 2019-07-08T07:41:34.000Z | from tox._pytestplugin import * | 31 | 31 | 0.83871 |
cc4792ba70b2d2493d2fd72604c25d48db2a5ebd | 400 | py | Python | setup.py | waynenilsen/python-c3 | 90f242cf788912284eb4fe8d1ae7f8431b417386 | [
"MIT"
] | 8 | 2015-11-28T02:32:09.000Z | 2021-01-09T11:49:44.000Z | setup.py | waynenilsen/python-c3 | 90f242cf788912284eb4fe8d1ae7f8431b417386 | [
"MIT"
] | 1 | 2016-07-27T11:01:00.000Z | 2016-07-27T11:01:00.000Z | setup.py | waynenilsen/python-c3 | 90f242cf788912284eb4fe8d1ae7f8431b417386 | [
"MIT"
] | 1 | 2016-10-21T06:45:43.000Z | 2016-10-21T06:45:43.000Z | __author__ = 'wnilsen'
from setuptools import setup
long_descr = open('README.MD').read()
setup(
name='python-c3',
version='0.0.1',
description="Python wrapper for the C3js D3 plotting library.",
long_description=long_descr,
author='Wayne Nilsen',
author_email='waynenilsen@gmail.com',
lic... | 22.222222 | 67 | 0.6775 |
bf6a147e0fdd5789f92a003a14708ecda2551cf4 | 1,013 | py | Python | book/src/ch05/tests/test_class_decorator.py | zangyuchen2008/Clean-Code-in-Python-Second-Edition | 0be2e41f6cf7322e12ec55d76135ff398df61b4a | [
"MIT"
] | 133 | 2016-07-22T15:16:16.000Z | 2022-03-29T22:39:40.000Z | book/src/ch05/tests/test_class_decorator.py | zangyuchen2008/Clean-Code-in-Python-Second-Edition | 0be2e41f6cf7322e12ec55d76135ff398df61b4a | [
"MIT"
] | 137 | 2021-01-05T11:21:04.000Z | 2022-03-31T11:10:11.000Z | book/src/ch05/tests/test_class_decorator.py | zangyuchen2008/Clean-Code-in-Python-Second-Edition | 0be2e41f6cf7322e12ec55d76135ff398df61b4a | [
"MIT"
] | 41 | 2020-12-29T04:46:14.000Z | 2022-03-20T22:36:17.000Z | """Clean Code in Python - Chapter 5: Decorators
Unit tests for class decorators
"""
import unittest
from datetime import datetime
from decorator_class_1 import LoginEvent as LoginEvent1
from decorator_class_2 import LoginEvent as LoginEvent2
class TestLoginEventSerialized(unittest.TestCase):
classes_under_test = ... | 30.69697 | 61 | 0.550839 |
809c6c62fb84a224746049794f725e3b744f88e9 | 137 | py | Python | harnessed_jobs/fe55_analysis_BOT/v0/validator_fe55_analysis_BOT.py | duncanwood/EO-analysis-jobs | 26d22e49c0d2e32fbf2759f504048754f66ecc45 | [
"BSD-3-Clause-LBNL"
] | 2 | 2018-07-26T09:32:46.000Z | 2019-05-28T20:57:43.000Z | harnessed_jobs/fe55_analysis_BOT/v0/validator_fe55_analysis_BOT.py | duncanwood/EO-analysis-jobs | 26d22e49c0d2e32fbf2759f504048754f66ecc45 | [
"BSD-3-Clause-LBNL"
] | 3 | 2018-03-18T21:55:07.000Z | 2019-04-18T18:26:06.000Z | harnessed_jobs/fe55_analysis_BOT/v0/validator_fe55_analysis_BOT.py | duncanwood/EO-analysis-jobs | 26d22e49c0d2e32fbf2759f504048754f66ecc45 | [
"BSD-3-Clause-LBNL"
] | 2 | 2020-11-12T19:47:42.000Z | 2022-02-25T21:43:03.000Z | #!/usr/bin/env ipython
"""
Validator script for BOT Fe55 analysis.
"""
from bot_eo_validators import run_validator
run_validator('fe55')
| 19.571429 | 43 | 0.773723 |
8b7ca4af4d71db6d5d32f5bf3f65c8f1f546ad01 | 892 | py | Python | main.py | joro2404/ApacheDeployment | 8c208d4ed012438345a0a4ab1454c365acd51ffe | [
"MIT"
] | null | null | null | main.py | joro2404/ApacheDeployment | 8c208d4ed012438345a0a4ab1454c365acd51ffe | [
"MIT"
] | null | null | null | main.py | joro2404/ApacheDeployment | 8c208d4ed012438345a0a4ab1454c365acd51ffe | [
"MIT"
] | null | null | null | from flask import Flask, redirect, render_template, request, url_for, Blueprint
from database import DB
import os
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'GET':
with DB() as db:
values = db.execute('SELECT * FROM calc').fetchall()... | 24.777778 | 113 | 0.570628 |
c3ab4135d4c100ba017a11b4525936a81ceaff89 | 1,684 | py | Python | config_example.py | g4b1nagy/flask-boilerplate | 011aff15d981522ccc09c6a0c34b0d20050fa20b | [
"Unlicense"
] | 4 | 2015-04-25T08:11:31.000Z | 2016-11-15T05:45:14.000Z | config_example.py | g4b1nagy/flask-boilerplate | 011aff15d981522ccc09c6a0c34b0d20050fa20b | [
"Unlicense"
] | null | null | null | config_example.py | g4b1nagy/flask-boilerplate | 011aff15d981522ccc09c6a0c34b0d20050fa20b | [
"Unlicense"
] | 1 | 2022-01-07T16:03:17.000Z | 2022-01-07T16:03:17.000Z | from authomatic.providers import oauth1, oauth2
# =========================================================================
# Authomatic
# =========================================================================
AUTHOMATIC = {
'facebook': {
'class_': oauth2.Facebook,
'consumer_key': '',
'... | 31.185185 | 98 | 0.336698 |
7219f28973f2932fc6d659236e245918674bb8aa | 29,650 | py | Python | enaml/qt/docking/q_dock_bar.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 1,080 | 2015-01-04T14:29:34.000Z | 2022-03-29T05:44:51.000Z | enaml/qt/docking/q_dock_bar.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 308 | 2015-01-05T22:44:13.000Z | 2022-03-30T21:19:18.000Z | enaml/qt/docking/q_dock_bar.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 123 | 2015-01-25T16:33:48.000Z | 2022-02-25T19:57:10.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013-2021, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------... | 31.813305 | 79 | 0.549342 |
f977cdae0c314f7c62b154c458615ded06ce0d37 | 547 | py | Python | opensfm/commands/__init__.py | colbyguan/crap-opensfm | dd74797433f1049e8e46f8c3887536eceb6281dc | [
"BSD-2-Clause"
] | null | null | null | opensfm/commands/__init__.py | colbyguan/crap-opensfm | dd74797433f1049e8e46f8c3887536eceb6281dc | [
"BSD-2-Clause"
] | null | null | null | opensfm/commands/__init__.py | colbyguan/crap-opensfm | dd74797433f1049e8e46f8c3887536eceb6281dc | [
"BSD-2-Clause"
] | 1 | 2019-08-23T10:53:15.000Z | 2019-08-23T10:53:15.000Z |
import extract_metadata
import detect_features
import match_features
import create_tracks
import reconstruct
import mesh
import undistort
import compute_depthmaps
import export_ply
import export_openmvs
import export_visualsfm
import create_submodels
import align_submodels
opensfm_commands = [
extract_metadata,
... | 17.645161 | 24 | 0.793419 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.