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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34bb3023981d75c4ed9878c12d2f210e657100e7 | 1,149 | py | Python | dfvfs/path/ewf_path_spec.py | Defense-Cyber-Crime-Center/dfvfs | da2ccbc4c989ced5ad651057bd8f5a4b18af6d37 | [
"Apache-2.0"
] | 2 | 2016-02-18T12:46:26.000Z | 2022-03-13T03:05:05.000Z | dfvfs/path/ewf_path_spec.py | Defense-Cyber-Crime-Center/dfvfs | da2ccbc4c989ced5ad651057bd8f5a4b18af6d37 | [
"Apache-2.0"
] | null | null | null | dfvfs/path/ewf_path_spec.py | Defense-Cyber-Crime-Center/dfvfs | da2ccbc4c989ced5ad651057bd8f5a4b18af6d37 | [
"Apache-2.0"
] | 5 | 2016-12-18T08:05:39.000Z | 2019-11-19T21:18:00.000Z | # -*- coding: utf-8 -*-
"""The EWF image path specification implementation."""
from dfvfs.lib import definitions
from dfvfs.path import factory
from dfvfs.path import path_spec
class EwfPathSpec(path_spec.PathSpec):
"""Class that implements the EWF image path specification."""
TYPE_INDICATOR = definitions.TYPE_... | 28.02439 | 72 | 0.716275 |
325706aa7641b5b10664ef56807efd5b8360ebe2 | 9,625 | py | Python | source/rttov_test/profile-datasets-py/div52_zen50deg/026.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | null | null | null | source/rttov_test/profile-datasets-py/div52_zen50deg/026.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | 1 | 2022-03-12T12:19:59.000Z | 2022-03-12T12:19:59.000Z | source/rttov_test/profile-datasets-py/div52_zen50deg/026.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | null | null | null | """
Profile ../profile-datasets-py/div52_zen50deg/026.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/div52_zen50deg/026.py"
self["Q"] = numpy.array([ 1.60776800e+00, 4.80482400e+00, 8.70589300e+00,
1.02248900e+01, 5.84469200e+00, 8.20133000e+0... | 53.77095 | 92 | 0.580883 |
778c6355a585cc812f634e4d63d26aa0a0cbad31 | 3,199 | py | Python | backend/groups/models.py | nikifkon/ChatApp | 1b34e25dca63db7389cec87d7fb1099d95a6308a | [
"MIT"
] | 6 | 2019-09-15T09:35:09.000Z | 2020-03-21T04:10:39.000Z | backend/groups/models.py | nikifkon/ChatApp | 1b34e25dca63db7389cec87d7fb1099d95a6308a | [
"MIT"
] | 6 | 2019-09-14T11:09:19.000Z | 2021-06-10T18:49:50.000Z | backend/groups/models.py | nikifkon/ChatApp | 1b34e25dca63db7389cec87d7fb1099d95a6308a | [
"MIT"
] | 2 | 2019-10-17T21:11:53.000Z | 2021-02-04T02:52:29.000Z | from django.contrib.auth import get_user_model
from django.db import models
from PIL import Image
User = get_user_model()
class ChatGroup(models.Model):
""" Room for >2 people """
name = models.CharField("Name", max_length=100)
slug = models.SlugField("Unique name", max_length=100, unique=True)
img ... | 27.817391 | 80 | 0.612691 |
e6523217f7db3a9e772f5958671ef980dc3d72bf | 251 | py | Python | f1-bot/Core/__init__.py | weyh/py-discord-bot-f1 | 00285ff469599634b1e1bca52567745462dda9f5 | [
"MIT"
] | 1 | 2021-07-22T16:45:51.000Z | 2021-07-22T16:45:51.000Z | f1-bot/Core/__init__.py | weyh/py-discord-bot-f1 | 00285ff469599634b1e1bca52567745462dda9f5 | [
"MIT"
] | null | null | null | f1-bot/Core/__init__.py | weyh/py-discord-bot-f1 | 00285ff469599634b1e1bca52567745462dda9f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from Core.console import Console
from Core.start import Start
import Core.converter
from Core.user_cfg import UserConfig
from Core.cache_manager import CacheManager
from Core.cache_manager import Cache
import Core.EDAW as EDAW
| 27.888889 | 43 | 0.812749 |
81389625ca68960082e2b39cff8570db2db400c4 | 1,504 | py | Python | tests/ecosystem/deployment/test_deployment.py | ypersky1980/ocs-ci | c2d50d8edbec4f0cc608334716768a97b3e7ce75 | [
"MIT"
] | null | null | null | tests/ecosystem/deployment/test_deployment.py | ypersky1980/ocs-ci | c2d50d8edbec4f0cc608334716768a97b3e7ce75 | [
"MIT"
] | null | null | null | tests/ecosystem/deployment/test_deployment.py | ypersky1980/ocs-ci | c2d50d8edbec4f0cc608334716768a97b3e7ce75 | [
"MIT"
] | null | null | null | import logging
from ocs_ci.framework import config
from ocs_ci.framework.testlib import deployment, polarion_id
from ocs_ci.ocs.resources.storage_cluster import ocs_install_verification
from ocs_ci.utility.reporting import get_polarion_id
from ocs_ci.utility.utils import is_cluster_running
from ocs_ci.helpers.sanity_h... | 40.648649 | 80 | 0.722074 |
92510e9ef144ebc2f9d45680dc17c30c8bda8398 | 1,591 | py | Python | models/enemy/base.py | AeonFlor/HYU_CSE2024 | ec499fccbb93cb1497baae56e77c40d27c7d0041 | [
"MIT"
] | null | null | null | models/enemy/base.py | AeonFlor/HYU_CSE2024 | ec499fccbb93cb1497baae56e77c40d27c7d0041 | [
"MIT"
] | null | null | null | models/enemy/base.py | AeonFlor/HYU_CSE2024 | ec499fccbb93cb1497baae56e77c40d27c7d0041 | [
"MIT"
] | null | null | null | import os
from random import randint
from pygame.sprite import Sprite
from models import Entity, Bullet
WIDTH = 640
HEIGHT = 480
class Enemy(Entity):
DEFAULT_COUNT = 1
def __init__(self, name):
super().__init__(os.path.join('enemy', name))
self.explosion = None
self.score = 10
... | 26.081967 | 106 | 0.555625 |
064a6b39b167922fa76115d5c2323cd586ea0975 | 1,040 | py | Python | realping.py | jfbilodeau/ansible-module-example | adcb86aaa4262dd7e3d1781fed84f94e5d8c85d8 | [
"BSD-3-Clause"
] | null | null | null | realping.py | jfbilodeau/ansible-module-example | adcb86aaa4262dd7e3d1781fed84f94e5d8c85d8 | [
"BSD-3-Clause"
] | null | null | null | realping.py | jfbilodeau/ansible-module-example | adcb86aaa4262dd7e3d1781fed84f94e5d8c85d8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
DOCUMENTATION = """
---
module: custom
author: J-F Bilodeau
description:
- This is a sample module that calls the ping command
options:
count:
description: Number of pings to perform
default: 1
timeout:
description: Seconds to wait before abandonning response
default: 1
ho... | 21.22449 | 86 | 0.636538 |
d5cdd90752128acf697605604b534b1976dce39f | 2,442 | gyp | Python | o3d/breakpad/breakpad.gyp | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 2 | 2017-09-02T19:08:28.000Z | 2021-11-15T15:15:14.000Z | o3d/breakpad/breakpad.gyp | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | null | null | null | o3d/breakpad/breakpad.gyp | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 1 | 2020-04-13T05:45:10.000Z | 2020-04-13T05:45:10.000Z | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/branding.gypi',
'../build/common.gypi',
'../build/version.gypi',
... | 24.42 | 82 | 0.448403 |
1c6a8f158815d92ca877a3b82a08ccadabfb0efd | 1,517 | py | Python | application/models/datastore/crash_model.py | kelp404/Victory | 132f186f18ea6a709afb003e38ed1d6de3c0579f | [
"MIT"
] | 15 | 2015-02-15T16:40:19.000Z | 2021-02-01T21:31:26.000Z | application/models/datastore/crash_model.py | kelp404/Victory | 132f186f18ea6a709afb003e38ed1d6de3c0579f | [
"MIT"
] | null | null | null | application/models/datastore/crash_model.py | kelp404/Victory | 132f186f18ea6a709afb003e38ed1d6de3c0579f | [
"MIT"
] | 1 | 2015-06-02T07:48:30.000Z | 2015-06-02T07:48:30.000Z |
from google.appengine.ext import db
import json
class CrashModel(db.Model):
# victory
app_id = db.IntegerProperty()
group_tag = db.StringProperty()
# app uuid in crash report
app_uuid = db.StringProperty()
name = db.TextProperty()
title = db.TextProperty()
email = db.TextProperty()
... | 28.622642 | 87 | 0.584047 |
d509163f94bc3ba693e192ec5edd7a74231e7f15 | 4,044 | py | Python | llgeo/utilities/files.py | lauralunacabrera/LLGEO | 166daf7417071ec9a8ffb90824f5687c5d69d096 | [
"MIT"
] | 2 | 2021-01-06T16:38:52.000Z | 2021-07-06T02:16:14.000Z | llgeo/utilities/files.py | lauralunacabrera/LLGEO | 166daf7417071ec9a8ffb90824f5687c5d69d096 | [
"MIT"
] | null | null | null | llgeo/utilities/files.py | lauralunacabrera/LLGEO | 166daf7417071ec9a8ffb90824f5687c5d69d096 | [
"MIT"
] | null | null | null | ''' I'm lazy with Pickle files hehe
DESCRIPTION:
This module contains super simple functions that handle files and directories.
'''
import os
import inspect
import pickle as pkl
from datetime import datetime
# ------------------------------------------------------------------------------
# Functions for handling Pi... | 31.107692 | 80 | 0.560089 |
dff87913f77fe2b19ff3974bd0fe1e85a9e77174 | 2,754 | py | Python | tests/test_utils.py | bilson/qpanel | 4002545cab06c787281d8c04f471bf39401e7606 | [
"MIT"
] | null | null | null | tests/test_utils.py | bilson/qpanel | 4002545cab06c787281d8c04f471bf39401e7606 | [
"MIT"
] | null | null | null | tests/test_utils.py | bilson/qpanel | 4002545cab06c787281d8c04f471bf39401e7606 | [
"MIT"
] | 2 | 2019-11-12T23:16:45.000Z | 2021-03-16T12:28:49.000Z | import unittest
from qpanel.utils import clean_str_to_div_id, underscore_to_camelcase, \
timedelta_from_field_dict
from qpanel.convert import convert_time_when_param
import time
import datetime
class UtilsTestClass(unittest.TestCase):
def test_clean_str_to_div(self):
div = 'ro/.d. i _@l_k/d_@'
... | 42.369231 | 101 | 0.639797 |
0e0739725c143c54fa96fe4857419fc6c92aea97 | 26,268 | py | Python | tenable/io/workbenches.py | menri005/pyTenable | 8a5091719d0f4d821bded10135ef0e15c8141f2a | [
"MIT"
] | null | null | null | tenable/io/workbenches.py | menri005/pyTenable | 8a5091719d0f4d821bded10135ef0e15c8141f2a | [
"MIT"
] | null | null | null | tenable/io/workbenches.py | menri005/pyTenable | 8a5091719d0f4d821bded10135ef0e15c8141f2a | [
"MIT"
] | null | null | null | '''
workbenches
===========
The following methods allow for interaction into the Tenable.io
:devportal:`workbenches <workbenches>` API endpoints.
.. note::
Workbenches API endpoints have an upper bound on the amount of data that
they will return, so for larger result sets, it may make more sense to use
t... | 42.642857 | 101 | 0.577851 |
1fa54c287b5b8e68e83daa0fc6d5f954e11fd85a | 8,982 | py | Python | tempest/api/volume/v2/test_volumes_list.py | ssameerr/tempest | e413f28661c2aab3f8da8d005db1fa5c59cc6b68 | [
"Apache-2.0"
] | null | null | null | tempest/api/volume/v2/test_volumes_list.py | ssameerr/tempest | e413f28661c2aab3f8da8d005db1fa5c59cc6b68 | [
"Apache-2.0"
] | null | null | null | tempest/api/volume/v2/test_volumes_list.py | ssameerr/tempest | e413f28661c2aab3f8da8d005db1fa5c59cc6b68 | [
"Apache-2.0"
] | 2 | 2015-04-30T08:46:29.000Z | 2020-03-01T17:05:23.000Z | # Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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/LIC... | 41.583333 | 79 | 0.580272 |
ae9cab435bb43b137905e2d6856295f181558381 | 3,574 | py | Python | lbrynet/dht/msgformat.py | Akshay-Gupta/lbry | 3b5978992c6e03269564c9bb69ebb7102e501469 | [
"MIT"
] | 1 | 2018-12-08T04:42:11.000Z | 2018-12-08T04:42:11.000Z | lbrynet/dht/msgformat.py | mrlucky9/lbry | bf6bc02828ed55e98a3002f487041acbd7841883 | [
"MIT"
] | null | null | null | lbrynet/dht/msgformat.py | mrlucky9/lbry | bf6bc02828ed55e98a3002f487041acbd7841883 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# This library is free software, distributed under the terms of
# the GNU Lesser General Public License Version 3, or any later version.
# See the COPYING file included in this archive
#
# The docstrings in this module contain epytext markup; API documentation
# may be created by processing this... | 42.547619 | 99 | 0.633744 |
c21d91b43e19e33eb167f47131d637b6caebdee5 | 4,960 | py | Python | test/neo4j_rel_cast_test.py | pombreda/py2neo | 7a07767242809ba4086cbc1b73a078a7de1ba283 | [
"Apache-2.0"
] | null | null | null | test/neo4j_rel_cast_test.py | pombreda/py2neo | 7a07767242809ba4086cbc1b73a078a7de1ba283 | [
"Apache-2.0"
] | null | null | null | test/neo4j_rel_cast_test.py | pombreda/py2neo | 7a07767242809ba4086cbc1b73a078a7de1ba283 | [
"Apache-2.0"
] | null | null | null | #/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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 ... | 28.342857 | 74 | 0.658669 |
aa208fb36d73929886933ff0a842f0853e2f9e6e | 6,595 | py | Python | weixin/views.py | augustand/phodaldev | d67ee67775bb33dffd093125b9a8d2b6bd1d19b5 | [
"MIT"
] | null | null | null | weixin/views.py | augustand/phodaldev | d67ee67775bb33dffd093125b9a8d2b6bd1d19b5 | [
"MIT"
] | null | null | null | weixin/views.py | augustand/phodaldev | d67ee67775bb33dffd093125b9a8d2b6bd1d19b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http.response import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from mezzanine.blog.models import BlogPost
from wechat_sdk import WechatBasic
from wechat_sdk.exceptions import ParseError
from wec... | 37.259887 | 122 | 0.602426 |
f1a38208cbbed4b30262d2e61a74f05471ec66d6 | 191 | py | Python | tests/test_crypto_backend_ecpy.py | potehinre/genesis-blockchain-tools | e4cd434593ae5db4c6d6dd3fee54ed4b84617aa5 | [
"MIT"
] | null | null | null | tests/test_crypto_backend_ecpy.py | potehinre/genesis-blockchain-tools | e4cd434593ae5db4c6d6dd3fee54ed4b84617aa5 | [
"MIT"
] | null | null | null | tests/test_crypto_backend_ecpy.py | potehinre/genesis-blockchain-tools | e4cd434593ae5db4c6d6dd3fee54ed4b84617aa5 | [
"MIT"
] | 1 | 2021-09-14T14:48:33.000Z | 2021-09-14T14:48:33.000Z | try:
import ecpy
run_main_part = True
except ImportError as e:
run_main_part = False
if run_main_part:
def test_dummy():
pass
else:
print("ECpy backend skipped")
| 15.916667 | 33 | 0.664921 |
0a044fa43d719483dda381af6170a7e8894d7527 | 2,659 | py | Python | api/api/routers/booking_router.py | marzmehr/court-interpreter-scheduling | c45467a26ba8ec588818bd94987c212e6fa224cf | [
"Apache-2.0"
] | null | null | null | api/api/routers/booking_router.py | marzmehr/court-interpreter-scheduling | c45467a26ba8ec588818bd94987c212e6fa224cf | [
"Apache-2.0"
] | null | null | null | api/api/routers/booking_router.py | marzmehr/court-interpreter-scheduling | c45467a26ba8ec588818bd94987c212e6fa224cf | [
"Apache-2.0"
] | 1 | 2022-03-18T18:47:23.000Z | 2022-03-18T18:47:23.000Z | from typing import List
from fastapi import APIRouter, status, HTTPException, Depends, Request
from core.multi_database_middleware import get_db_session
from sqlalchemy.orm import Session
from api.schemas.booking_schema import BookingRequestSchema, BookingResponseSchema, BookingSearchRequestSchema
from models.booking_m... | 39.686567 | 147 | 0.781497 |
d559bbb59a87b7745f5faad4fca0c7a0ba258cfe | 932 | py | Python | breviar/cli/main.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | 1 | 2020-04-13T12:14:50.000Z | 2020-04-13T12:14:50.000Z | breviar/cli/main.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | null | null | null | breviar/cli/main.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | null | null | null | import os.path as path
import json
import click
from ..core.providers import bitly
from .text import BITLY_CONFIGURE_PROMPT
from .constants import CONFIGS_PATH, BITLY_CONFIG_PATH
from .utils import create_cli_config_files, get_bitly_config, ErrorHandlingGroup
from .errors import NotConfigured
@click.group(cls=Error... | 26.628571 | 80 | 0.752146 |
c9a9a99d21148b41b87d578a6c06a087238e1997 | 1,985 | py | Python | app/display_modules/display_wrangler.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/display_modules/display_wrangler.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/display_modules/display_wrangler.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | """The base Display Module Wrangler module."""
class DisplayModuleWrangler:
"""The base Display Module Wrangler module."""
@classmethod
def run_sample(cls, sample_id, sample):
"""Gather single sample and process."""
pass
@classmethod
def help_run_sample(cls, sample, module):
... | 36.090909 | 90 | 0.696725 |
93aa1d0c878c03a8ffc54a0fbcd4c3e8bfd26116 | 50,106 | py | Python | huaweicloud-sdk-ims/huaweicloudsdkims/v2/model/update_image_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/update_image_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/update_image_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 UpdateImageResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 29.807258 | 1,137 | 0.638806 |
0312aa80a6ee718a347b6cfa7082dc2a4a1467be | 3,112 | py | Python | ratio.py | Chaowu88/nmrratios | 3c713d45af4078e9873d40b58b4602cca68d3c26 | [
"MIT"
] | null | null | null | ratio.py | Chaowu88/nmrratios | 3c713d45af4078e9873d40b58b4602cca68d3c26 | [
"MIT"
] | null | null | null | ratio.py | Chaowu88/nmrratios | 3c713d45af4078e9873d40b58b4602cca68d3c26 | [
"MIT"
] | null | null | null | #!/usr/bin/env pyhton
# -*- coding: UTF-8 -*-
__author__ = 'Chao Wu'
__date__ = '08/29/2021'
__version__ = '1.0'
from sympy import Symbol, lambdify
from sympy.parsing.sympy_parser import parse_expr
class Ratio:
def __init__(self, name, formula, variables):
'''
Parameters
name: str
ratio name
for... | 24.896 | 115 | 0.677378 |
4a01cfe44a15d157be41d37b367cd1564f18b3f9 | 917 | py | Python | apps/tasks/urls.py | Sravanksk/fyle-qbo-api | 53f595170a073f245b9930bfce2ca07bdf998ce3 | [
"MIT"
] | null | null | null | apps/tasks/urls.py | Sravanksk/fyle-qbo-api | 53f595170a073f245b9930bfce2ca07bdf998ce3 | [
"MIT"
] | null | null | null | apps/tasks/urls.py | Sravanksk/fyle-qbo-api | 53f595170a073f245b9930bfce2ca07bdf998ce3 | [
"MIT"
] | null | null | null | """fyle_qbo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 36.68 | 87 | 0.718648 |
3e8e50ed13a711a205db1c0be0a23c950396666e | 432 | py | Python | examples/wish_export.py | rushkii/genshinstats | 27e519ab00cbe96c376abb0927634650babd1d45 | [
"MIT"
] | 1 | 2021-08-10T03:20:08.000Z | 2021-08-10T03:20:08.000Z | examples/wish_export.py | rushkii/genshinstats | 27e519ab00cbe96c376abb0927634650babd1d45 | [
"MIT"
] | null | null | null | examples/wish_export.py | rushkii/genshinstats | 27e519ab00cbe96c376abb0927634650babd1d45 | [
"MIT"
] | null | null | null | import csv
import genshinstats as gs
with open('export.csv', 'w', newline='', encoding='utf-8') as file:
fieldnames = ['time', 'name', 'type', 'rarity', 'banner']
writer = csv.DictWriter(file, fieldnames, extrasaction='ignore')
writer.writeheader()
print('preparing data...', end='\r')
for i, pull i... | 36 | 68 | 0.638889 |
d616b6ad670491d6512624835f4967233efe0d23 | 947 | py | Python | homeassistant/components/websocket_api/messages.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 4 | 2019-01-10T14:47:54.000Z | 2021-04-22T02:06:27.000Z | homeassistant/components/websocket_api/messages.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 6 | 2021-02-08T21:02:40.000Z | 2022-03-12T00:52:16.000Z | homeassistant/components/websocket_api/messages.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 3 | 2018-08-29T19:26:20.000Z | 2020-01-19T11:58:22.000Z | """Message templates for websocket commands."""
import voluptuous as vol
from homeassistant.helpers import config_validation as cv
from . import const
# Minimal requirements of a message
MINIMAL_MESSAGE_SCHEMA = vol.Schema({
vol.Required('id'): cv.positive_int,
vol.Required('type'): cv.string,
}, extra=vol... | 22.023256 | 57 | 0.624076 |
8ab73fcf6a63b5e906d19e0eb670d76ceb1c4fa9 | 4,952 | py | Python | aio_dashboard.py | rvoogd/StepperGauge | 81a513ac8508e387a081c2c0fc02140d4f37100d | [
"MIT"
] | null | null | null | aio_dashboard.py | rvoogd/StepperGauge | 81a513ac8508e387a081c2c0fc02140d4f37100d | [
"MIT"
] | null | null | null | aio_dashboard.py | rvoogd/StepperGauge | 81a513ac8508e387a081c2c0fc02140d4f37100d | [
"MIT"
] | null | null | null | # Raspberry Pi Physical Dashboard & Adafruit IO Example
# Author: Tony DiCola
# License: Public domain
#
# This example will display three feeds from Adafruit IO on a dashboard. The
# feeds are:
# - pi-dashboard-slider: Will display a slider with values from 0-100 on a
# dashboard 7-segment di... | 47.161905 | 92 | 0.696284 |
cd1e22e3be9b6560e9b234b216dae45e88467797 | 598 | py | Python | tests/test.py | brightblaze9/term2048 | 6f2d7fce0bbbf00a217a907dd72db3f95d54c6b3 | [
"MIT"
] | 278 | 2015-01-12T00:53:55.000Z | 2022-03-12T04:26:48.000Z | tests/test.py | brightblaze9/term2048 | 6f2d7fce0bbbf00a217a907dd72db3f95d54c6b3 | [
"MIT"
] | 9 | 2015-07-14T16:17:41.000Z | 2022-03-02T18:19:56.000Z | tests/test.py | brightblaze9/term2048 | 6f2d7fce0bbbf00a217a907dd72db3f95d54c6b3 | [
"MIT"
] | 111 | 2015-01-07T11:07:19.000Z | 2022-02-08T22:39:44.000Z | # -*- coding: UTF-8 -*-
import sys
import platform
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
from os.path import dirname
import keypress_mock as kp
if __name__ == '__main__':
here = dirname(__file__)
sys.path.insert(0, here+'/..')
# keypress mock
... | 23 | 53 | 0.677258 |
57a600a76c125d6ea5868a13f2838c9f3ef0f0f8 | 807 | py | Python | easyaudit_utils/views.py | ubuviz/django-easyaudit-utils | 75dd00e4fe516d8e5adc97d953b9b12d9eadb9ec | [
"MIT"
] | null | null | null | easyaudit_utils/views.py | ubuviz/django-easyaudit-utils | 75dd00e4fe516d8e5adc97d953b9b12d9eadb9ec | [
"MIT"
] | null | null | null | easyaudit_utils/views.py | ubuviz/django-easyaudit-utils | 75dd00e4fe516d8e5adc97d953b9b12d9eadb9ec | [
"MIT"
] | 2 | 2020-06-06T10:03:06.000Z | 2021-03-04T15:13:40.000Z | from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import ListView, TemplateView
from easyaudit.models import CRUDEvent, LoginEvent, RequestEvent
from .mixins import PaginationMixin, UserDateSearchMixin
class IndexView(LoginRequiredMixin, UserDateSearchMixin, TemplateView):
temp... | 31.038462 | 95 | 0.811648 |
87d49613cb46cd6438683e51d2bd6ca405a1aa67 | 16,475 | py | Python | ob_inner_table_schema_constants.py | raywill/automation.py | 5b33affd313a4aade7688daae3b086dcc244127f | [
"Apache-2.0"
] | 1 | 2021-01-15T04:28:23.000Z | 2021-01-15T04:28:23.000Z | ob_inner_table_schema_constants.py | raywill/automation.py | 5b33affd313a4aade7688daae3b086dcc244127f | [
"Apache-2.0"
] | null | null | null | ob_inner_table_schema_constants.py | raywill/automation.py | 5b33affd313a4aade7688daae3b086dcc244127f | [
"Apache-2.0"
] | 1 | 2021-01-15T04:28:27.000Z | 2021-01-15T04:28:27.000Z | table_id_map = {
1: "__all_core_table",
2: "__all_root_table",
3: "__all_table",
4: "__all_column",
5: "__all_ddl_operation",
101: "__all_meta_table",
102: "__all_user",
103: "__all_user_history",
104: "__all_database",
105: "__all_database_history",
106: "__all_tablegroup",
107: "__all_tablegro... | 34.611345 | 60 | 0.764127 |
18f556bacdb3809d10f18c72bf5708f493fd7d97 | 19,961 | py | Python | hydra/_internal/utils.py | jhrmnn/hydra | 30a8c8a070166ac2d3b19c4ca29af7aa500dc269 | [
"MIT"
] | 5,847 | 2019-10-03T04:20:44.000Z | 2022-03-31T17:07:46.000Z | hydra/_internal/utils.py | jhrmnn/hydra | 30a8c8a070166ac2d3b19c4ca29af7aa500dc269 | [
"MIT"
] | 1,393 | 2019-10-04T01:03:38.000Z | 2022-03-31T20:29:35.000Z | hydra/_internal/utils.py | jhrmnn/hydra | 30a8c8a070166ac2d3b19c4ca29af7aa500dc269 | [
"MIT"
] | 505 | 2019-10-03T19:41:42.000Z | 2022-03-31T11:40:16.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import inspect
import logging.config
import os
import sys
from dataclasses import dataclass
from os.path import dirname, join, normpath, realpath
from traceback import print_exc, print_exception
from types import FrameType, Traceback... | 32.562806 | 102 | 0.582536 |
1517c8c4a73a3455047356303ddbb980974c0bd6 | 7,286 | py | Python | saltred/saltheadtime.py | apodemus/pysalt3 | 97bb790ad7bcf1137e3ffd2a7b32840ae7167358 | [
"BSD-3-Clause"
] | null | null | null | saltred/saltheadtime.py | apodemus/pysalt3 | 97bb790ad7bcf1137e3ffd2a7b32840ae7167358 | [
"BSD-3-Clause"
] | null | null | null | saltred/saltheadtime.py | apodemus/pysalt3 | 97bb790ad7bcf1137e3ffd2a7b32840ae7167358 | [
"BSD-3-Clause"
] | 1 | 2021-07-15T19:43:59.000Z | 2021-07-15T19:43:59.000Z | #!/usr/bin/env python
#
# Author Version Date
# -----------------------------------------------
# A. Gulbis (SAAO) 0.4 11 May 2011
# A. Gulbis (SAAO) 0.3 09 May 2011
# Amanda Gulbis (SAAO) 0.2 24 May 2010
# Amanda Gulbis (SAAO) 0.1 17 May 201... | 44.157576 | 152 | 0.528822 |
c577090c61d15177fa0cae4a8e60b5ac21103173 | 395 | py | Python | py_client/delete.py | heroescovid/- | a67a57a8d9f55700559cc78c1b847cf463c96ea5 | [
"MIT"
] | 37 | 2022-02-11T04:33:57.000Z | 2022-03-30T11:28:30.000Z | py_client/delete.py | boyabenyathil/Django-Rest-Framework-Tutorial | 2ee606fb8b6053134d686a4b0dffe1374d778c7c | [
"MIT"
] | null | null | null | py_client/delete.py | boyabenyathil/Django-Rest-Framework-Tutorial | 2ee606fb8b6053134d686a4b0dffe1374d778c7c | [
"MIT"
] | 21 | 2022-02-26T09:37:54.000Z | 2022-03-22T10:46:33.000Z | import requests
product_id = input("WHat is the product id you want to use?\n")
try:
product_id = int(product_id)
except:
product_id = None
print(f'{product_id} not a valid id')
if product_id:
endpoint = f"http://localhost:8000/api/products/{product_id}/delete/"
get_response = requests.delete(en... | 28.214286 | 74 | 0.724051 |
3e6c197f96a44251b9ead9184782a8138472227b | 1,507 | py | Python | setup.py | cprieto/seqlog | 8c4763286522dc334adb9955212a87ce88959a4c | [
"MIT"
] | null | null | null | setup.py | cprieto/seqlog | 8c4763286522dc334adb9955212a87ce88959a4c | [
"MIT"
] | null | null | null | setup.py | cprieto/seqlog | 8c4763286522dc334adb9955212a87ce88959a4c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'python_dateutil>=2.5.3',
'requests>=2.10.0',
'PyYAML>=3.11',
]
... | 23.920635 | 61 | 0.585932 |
68d89cb083e8570e57f03d9aed856787557426b2 | 11,219 | py | Python | tensorboard/plugins/mesh/mesh_plugin.py | Digitaltransform/tensorboard | 75a3c4a8edaa64860951b5fec830accf53993510 | [
"Apache-2.0"
] | 6,139 | 2017-06-13T02:43:20.000Z | 2022-03-30T23:56:28.000Z | tensorboard/plugins/mesh/mesh_plugin.py | Digitaltransform/tensorboard | 75a3c4a8edaa64860951b5fec830accf53993510 | [
"Apache-2.0"
] | 3,239 | 2017-06-14T15:49:50.000Z | 2022-03-31T23:43:15.000Z | tensorboard/plugins/mesh/mesh_plugin.py | admariner/tensorboard | 931fdb84ed125efe5ef6cb0bad869c52da73e18f | [
"Apache-2.0"
] | 1,882 | 2017-06-15T01:33:54.000Z | 2022-03-30T15:27:25.000Z | # Copyright 2019 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.290102 | 83 | 0.626526 |
879a0471def80f3d781f8f7f9b47e9d53c6b2b98 | 1,141 | py | Python | tests/journal.ext/warning_example_fatal.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | null | null | null | tests/journal.ext/warning_example_fatal.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | 1 | 2021-06-10T23:42:13.000Z | 2021-06-10T23:42:13.000Z | tests/journal.ext/warning_example_fatal.py | jlmaurer/pyre | 6af38a83621d7d6228d147b4bb94f97fbb10f6e2 | [
"BSD-3-Clause"
] | 2 | 2020-08-31T18:07:52.000Z | 2021-12-10T08:54:39.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2020 all rights reserved
def test():
"""
Exercise a fatal warning channel with a realistic example
"""
# get the trash can
from journal.ext.journal import Trash as trash
# and the... | 21.942308 | 61 | 0.62752 |
81785bd85f0c9a20d6999d9b934ce55f2dda0af2 | 1,776 | py | Python | salt/modules/rest_package.py | lyft/salt | 2715908423a412f736253d0e5d3cfe185a0179a2 | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | salt/modules/rest_package.py | lyft/salt | 2715908423a412f736253d0e5d3cfe185a0179a2 | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/modules/rest_package.py | lyft/salt | 2715908423a412f736253d0e5d3cfe185a0179a2 | [
"Apache-2.0"
] | 1 | 2017-01-27T21:33:36.000Z | 2017-01-27T21:33:36.000Z | # -*- coding: utf-8 -*-
'''
Service support for the REST example
'''
from __future__ import absolute_import
# Import python libs
import logging
log = logging.getLogger(__name__)
__proxyenabled__ = ['rest_sample']
# Define the module's virtual name
__virtualname__ = 'pkg'
def __virtual__():
'''
Only work o... | 23.368421 | 81 | 0.635135 |
904f5ef4431c061ed2f676bc6bb528f0f33aa481 | 669 | py | Python | ttsx/tt_order/models.py | Highsir/ttsx | a141120bba39083b9c443cd00af9702add403065 | [
"MIT"
] | null | null | null | ttsx/tt_order/models.py | Highsir/ttsx | a141120bba39083b9c443cd00af9702add403065 | [
"MIT"
] | null | null | null | ttsx/tt_order/models.py | Highsir/ttsx | a141120bba39083b9c443cd00af9702add403065 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class OrderInfo(models.Model):
oid = models.CharField(max_length=20, primary_key=True)
user = models.ForeignKey('tt_user.UserInfo')
odate = models.DateTimeField(auto_now_add=True)
# 0待支付,1已支付待收货,2已收货待评论,3完成
oStatus = models.IntegerField(defau... | 33.45 | 64 | 0.747384 |
6b804ac8cc66301b4bce5e836ee0ecbeffe4e358 | 1,273 | py | Python | src/objcenter.py | KeaganChasenski/SpyCam_Demonstrator | d244818d99f481700e3961a26ac20fc13a8a2b77 | [
"BSD-3-Clause"
] | null | null | null | src/objcenter.py | KeaganChasenski/SpyCam_Demonstrator | d244818d99f481700e3961a26ac20fc13a8a2b77 | [
"BSD-3-Clause"
] | null | null | null | src/objcenter.py | KeaganChasenski/SpyCam_Demonstrator | d244818d99f481700e3961a26ac20fc13a8a2b77 | [
"BSD-3-Clause"
] | null | null | null | # Inspired by Adrian Rosebrock of PyImageSearch.com
# Luca Barbas and Keagan Chasenski
# 1 October 2020
# Design Project
# import packages
import imutils # image utitlity package
import cv2 # openCV package
# this class is intended to process the face detection and computer vision
# calculations that are used in the... | 31.04878 | 74 | 0.724273 |
f4bfd168b1a5467cca2089ceba227b855002cb6a | 6,230 | py | Python | detectron2/evaluation/evaluator.py | JosephKJ/iOD | 7fae556667b45cf98769f0997540c60549c018a2 | [
"Apache-2.0"
] | 38 | 2021-10-24T01:54:41.000Z | 2022-03-29T14:31:26.000Z | detectron2/evaluation/evaluator.py | JosephKJ/iOD | 7fae556667b45cf98769f0997540c60549c018a2 | [
"Apache-2.0"
] | 6 | 2021-12-10T09:42:51.000Z | 2022-03-01T01:19:04.000Z | detectron2/evaluation/evaluator.py | JosephKJ/iOD | 7fae556667b45cf98769f0997540c60549c018a2 | [
"Apache-2.0"
] | 6 | 2021-12-22T12:09:46.000Z | 2022-03-31T07:11:11.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import datetime
import logging
import time
from collections import OrderedDict
from contextlib import contextmanager
import torch
from detectron2.utils.comm import is_main_process
from detectron2.utils.logger import log_every_n_seconds
class Data... | 35 | 98 | 0.617657 |
a9bee3e558f49ecd3447054c0ceb2b3d64c41aa6 | 14,882 | py | Python | private/templates/SandyRelief/menus.py | arnavsharma93/eden | 2e559a277c4144ba4f4cdcd108460d025923671d | [
"MIT"
] | null | null | null | private/templates/SandyRelief/menus.py | arnavsharma93/eden | 2e559a277c4144ba4f4cdcd108460d025923671d | [
"MIT"
] | null | null | null | private/templates/SandyRelief/menus.py | arnavsharma93/eden | 2e559a277c4144ba4f4cdcd108460d025923671d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from gluon import *
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
class S3MainMenu(default.S3MainMenu):
"""
Custom Application Main Menu:
The main menu consists of several sub-menus, each of ... | 42.52 | 83 | 0.396116 |
005338d41324cc88926ee2996ac59d938ff83aae | 1,176 | py | Python | users/migrations/0002_auto_20191205_1835.py | MisterLenivec/django-online-store | 56f0496ef68e9580772f91f31b94182dc81858c5 | [
"MIT"
] | 1 | 2021-07-05T18:45:58.000Z | 2021-07-05T18:45:58.000Z | users/migrations/0002_auto_20191205_1835.py | MisterLenivec/django-online-store | 56f0496ef68e9580772f91f31b94182dc81858c5 | [
"MIT"
] | 9 | 2019-12-27T21:03:29.000Z | 2022-03-12T00:10:27.000Z | users/migrations/0002_auto_20191205_1835.py | MisterLenivec/django-online-store | 56f0496ef68e9580772f91f31b94182dc81858c5 | [
"MIT"
] | 1 | 2022-03-14T10:05:17.000Z | 2022-03-14T10:05:17.000Z | # Generated by Django 2.2.4 on 2019-12-05 15:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
... | 32.666667 | 142 | 0.637755 |
5001252c243fb875749c67eda5be524d85cf238c | 1,267 | py | Python | sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/057_update_region_config_flag.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/057_update_region_config_flag.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/057_update_region_config_flag.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 1 | 2021-01-05T16:24:58.000Z | 2021-01-05T16:24:58.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from sqlalchemy import MetaData, Table
from sysinv.openstack.common import log
import json
ENGINE = 'InnoDB'
CHARSET = 'utf8'
LOG = log.getLogger(__name__)
def upgrade(migrate_engi... | 26.395833 | 74 | 0.66614 |
4ac2913d1dd9d3f31a73bc00250a41f92dac760c | 2,061 | py | Python | doc/figures/nodes-box.py | johnnovak/twyg | d125d651e2d737f0825a9be948b5c4d6a202d3da | [
"MIT"
] | 9 | 2016-01-07T04:17:38.000Z | 2021-07-30T09:48:38.000Z | doc/figures/nodes-box.py | johnnovak/twyg | d125d651e2d737f0825a9be948b5c4d6a202d3da | [
"MIT"
] | null | null | null | doc/figures/nodes-box.py | johnnovak/twyg | d125d651e2d737f0825a9be948b5c4d6a202d3da | [
"MIT"
] | 2 | 2017-05-25T13:34:54.000Z | 2017-09-21T21:34:39.000Z | import os, sys
from fig import *
from twyg.cairowrapper import context as ctx
config1 = r"""
[layout]
style layout
[node]
style box
fontName $FONTNAME
fontSize $FONTSIZE
textBaselineCorrection $BASELINE_CORR
strokeWidth ... | 20.818182 | 44 | 0.489568 |
810ef73c6b8725bf37045137a1f82f857dcd5301 | 3,823 | py | Python | PyFlow/Packages/PyFlowBase/UI/UIGetVarNode.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 1,463 | 2019-07-29T15:45:22.000Z | 2022-03-31T23:32:13.000Z | PyFlow/Packages/PyFlowBase/UI/UIGetVarNode.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 58 | 2019-07-31T07:58:57.000Z | 2022-02-23T05:46:08.000Z | PyFlow/Packages/PyFlowBase/UI/UIGetVarNode.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 169 | 2019-08-03T16:38:57.000Z | 2022-03-31T14:20:12.000Z | ## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera
## 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... | 34.754545 | 104 | 0.673032 |
67a56936fa0626173596acd1628cd0794181131f | 8,120 | py | Python | cifar10_resnet50/cifar10_resnet50_after_step_11.py | adiprasad/tutorials | 68404e549f911d7d5c1e244ed428f38ce5eed6bd | [
"Apache-2.0"
] | null | null | null | cifar10_resnet50/cifar10_resnet50_after_step_11.py | adiprasad/tutorials | 68404e549f911d7d5c1e244ed428f38ce5eed6bd | [
"Apache-2.0"
] | null | null | null | cifar10_resnet50/cifar10_resnet50_after_step_11.py | adiprasad/tutorials | 68404e549f911d7d5c1e244ed428f38ce5eed6bd | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import argparse
import keras
from tensorflow.compat.v1.keras import backend as K
from keras.preprocessing import image
from keras.datasets import cifar10
import numpy as np
import tensorflow.compat.v1 as tf
import os
import horovod.keras as hvd
from keras import applications
pars... | 43.891892 | 118 | 0.691502 |
021c6d7f3c6b57b498625ca385de51052d7e8755 | 3,826 | py | Python | qa/rpc-tests/p2p-autoinstantsend.py | CoinStaging/SharkByte | 3eb3b3ff2250e2433235c7a45d0bbac8784d8617 | [
"MIT"
] | 2 | 2019-11-23T09:36:18.000Z | 2019-11-23T09:48:29.000Z | qa/rpc-tests/p2p-autoinstantsend.py | CoinStaging/SharkByte | 3eb3b3ff2250e2433235c7a45d0bbac8784d8617 | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-autoinstantsend.py | CoinStaging/SharkByte | 3eb3b3ff2250e2433235c7a45d0bbac8784d8617 | [
"MIT"
] | 1 | 2019-11-28T02:55:30.000Z | 2019-11-28T02:55:30.000Z | #!/usr/bin/env python3
# Copyright (c) 2018 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import sharkbyteTestFramework
from test_... | 38.26 | 112 | 0.703607 |
076947bac7aa34a7e9e212fc7ac7fbb64caed472 | 10,600 | py | Python | match_two.py | carson-sky/Patch-NetVLAD | 7b913626b34dbbe250d6921a6a093512ee513eac | [
"MIT"
] | 278 | 2021-03-02T06:29:35.000Z | 2022-03-31T14:50:15.000Z | match_two.py | carson-sky/Patch-NetVLAD | 7b913626b34dbbe250d6921a6a093512ee513eac | [
"MIT"
] | 49 | 2021-03-04T00:58:19.000Z | 2022-02-10T00:36:03.000Z | match_two.py | carson-sky/Patch-NetVLAD | 7b913626b34dbbe250d6921a6a093512ee513eac | [
"MIT"
] | 45 | 2021-03-04T00:13:45.000Z | 2022-03-29T06:17:01.000Z | #!/usr/bin/env python
'''
Copyright (c) 2021 Stephen Hausler, Sourav Garg, Ming Xu, Michael Milford and Tobias Fischer
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, includi... | 46.086957 | 151 | 0.713113 |
d210c02e8479ab11e8aea14b6f3f1f7f9e35a45d | 1,546 | py | Python | chapter07/load_testing/locustfile.py | PacktPublishing/Getting-Started-with-Amazon-SageMaker-Studio | 68cb477b22c58a79dca020e93298bb7bef58a7a1 | [
"MIT"
] | null | null | null | chapter07/load_testing/locustfile.py | PacktPublishing/Getting-Started-with-Amazon-SageMaker-Studio | 68cb477b22c58a79dca020e93298bb7bef58a7a1 | [
"MIT"
] | null | null | null | chapter07/load_testing/locustfile.py | PacktPublishing/Getting-Started-with-Amazon-SageMaker-Studio | 68cb477b22c58a79dca020e93298bb7bef58a7a1 | [
"MIT"
] | 1 | 2022-03-24T16:12:20.000Z | 2022-03-24T16:12:20.000Z | from locust import task, between, events, User
import sagemaker
from sagemaker.serializers import JSONSerializer
from sagemaker.deserializers import JSONDeserializer
import json
import os, sys
import time
import numpy as np
endpoint_name=os.environ['ENDPOINT_NAME']
predictor = sagemaker.predictor.Predictor(endpoint_na... | 32.893617 | 74 | 0.615136 |
94951d5e3e214bb0da62eaf1b336b42cc7114dec | 1,641 | py | Python | tests/test_api/test_routes/test_main/test_reset_password.py | kucera-lukas/ImageSecrets | d7720886b215c5a40b94d4f06cb10d3c106dfcde | [
"MIT"
] | null | null | null | tests/test_api/test_routes/test_main/test_reset_password.py | kucera-lukas/ImageSecrets | d7720886b215c5a40b94d4f06cb10d3c106dfcde | [
"MIT"
] | 74 | 2021-08-09T11:50:51.000Z | 2022-03-30T21:23:24.000Z | tests/test_api/test_routes/test_main/test_reset_password.py | kucera-lukas/imagesecrets | d7720886b215c5a40b94d4f06cb10d3c106dfcde | [
"MIT"
] | null | null | null | """Test the reset password post request."""
from __future__ import annotations
from typing import TYPE_CHECKING
from sqlalchemy.exc import NoReferenceError
if TYPE_CHECKING:
from fastapi.testclient import TestClient
from imagesecrets.database.token.services import TokenService
URL = "api/users/reset-passwo... | 26.467742 | 76 | 0.677636 |
6574ad1e9ed53e4febf563e4003658165bbbb9e7 | 1,119 | py | Python | local_group_support/utils/nextcloud.py | martijnmartijnmartijnmartijn/rebel_management_utilities | 5f4e06a74cb737b12c9593e7e713a100fe94036c | [
"MIT"
] | null | null | null | local_group_support/utils/nextcloud.py | martijnmartijnmartijnmartijn/rebel_management_utilities | 5f4e06a74cb737b12c9593e7e713a100fe94036c | [
"MIT"
] | null | null | null | local_group_support/utils/nextcloud.py | martijnmartijnmartijnmartijn/rebel_management_utilities | 5f4e06a74cb737b12c9593e7e713a100fe94036c | [
"MIT"
] | null | null | null | import os
import requests
from dotenv import load_dotenv
from local_group_support.utils.excel import append_df_to_excel
BASE_URL = 'https://cloud.extinctionrebellion.nl/remote.php/dav/files/'
INTEGRATION_DIRECTORY = '/CloudXRNL/AppSpecific/Integrators_AN_Home/Integrators_FromLGs/'
def get_nextcloud_user():
loa... | 25.431818 | 118 | 0.714924 |
20de0effc30e1a35606cb9be887612c6951fcaa5 | 18,343 | py | Python | dist/Platform.app/Contents/Resources/lib/python3.7/pandas/tests/scalar/test_nat.py | njalloul90/Genomics_Oncology_Platform | 9bf6d0edca5df783f4e371fa1bc46b7b1576fe70 | [
"MIT"
] | 6 | 2019-12-21T21:15:54.000Z | 2021-04-20T17:35:24.000Z | dist/Platform.app/Contents/Resources/lib/python3.7/pandas/tests/scalar/test_nat.py | njalloul90/Genomics_Oncology_Platform | 9bf6d0edca5df783f4e371fa1bc46b7b1576fe70 | [
"MIT"
] | 3 | 2021-08-30T16:30:50.000Z | 2022-03-01T23:15:44.000Z | dist/Platform.app/Contents/Resources/lib/python3.7/pandas/tests/scalar/test_nat.py | njalloul90/Genomics_Oncology_Platform | 9bf6d0edca5df783f4e371fa1bc46b7b1576fe70 | [
"MIT"
] | 3 | 2021-03-28T16:13:00.000Z | 2021-07-16T10:27:25.000Z | from datetime import datetime, timedelta
import operator
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs import iNaT
import pandas.compat as compat
from pandas.core.dtypes.common import is_datetime64_any_dtype
from pandas import (
DatetimeIndex,
DatetimeTZDtype,
Index,
NaT,
... | 28.176651 | 88 | 0.582838 |
42c8e0431b566bfc7df7fc34bc243ebc99b24354 | 435 | py | Python | parsl/tests/test_python_apps/test_memoize_joinapp.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 323 | 2017-07-28T21:31:27.000Z | 2022-03-05T13:06:05.000Z | parsl/tests/test_python_apps/test_memoize_joinapp.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 1,286 | 2017-06-01T16:50:00.000Z | 2022-03-31T16:45:14.000Z | parsl/tests/test_python_apps/test_memoize_joinapp.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 113 | 2017-06-03T11:38:40.000Z | 2022-03-26T16:43:05.000Z | from parsl.app.app import join_app, python_app
@join_app(cache=True)
def random_uuid(x):
import uuid
return const(str(uuid.uuid4()))
@python_app
def const(x):
return x
def test_join_memoization():
"""Testing python memoization disable
"""
x = random_uuid(0)
x.result()
for i in ran... | 18.125 | 75 | 0.645977 |
25b87735354c2f97b9590cbd0f54ff84f7efbb59 | 21,808 | py | Python | autodiffpy/autodiffmod.py | rajayuco/cs207-FinalProject | 433cdfcf24243e6617843fa363ec13f370b94e03 | [
"MIT"
] | 2 | 2018-12-12T05:40:14.000Z | 2018-12-12T15:55:29.000Z | autodiffpy/autodiffmod.py | rajayuco/cs207-FinalProject | 433cdfcf24243e6617843fa363ec13f370b94e03 | [
"MIT"
] | 20 | 2018-10-08T20:40:58.000Z | 2018-12-12T00:30:04.000Z | autodiffpy/autodiffmod.py | rajayuco/cs207-FinalProject | 433cdfcf24243e6617843fa363ec13f370b94e03 | [
"MIT"
] | 1 | 2020-10-18T10:17:10.000Z | 2020-10-18T10:17:10.000Z | import numpy as np
import pandas as pd
#from autodiff_math import *
from autodiffpy.autodiff_math import *
class autodiff():
def __init__(self,name,val,der=1):
self.name = name
# set val attribute
if isinstance(val, np.ndarray):
self.val = val
elif isinstance(val, list):... | 36.10596 | 204 | 0.576807 |
efde4b24fee1feb3bbed09313ef3635b19141712 | 22,379 | py | Python | tests/python/kaolin/render/mesh/test_deftet.py | tovacinni/kaolin | 0236fbce9c44bd9818de1603aeae38c5f3ac58f5 | [
"ECL-2.0",
"Apache-2.0"
] | 3,747 | 2019-11-13T02:18:16.000Z | 2022-03-31T21:12:31.000Z | tests/python/kaolin/render/mesh/test_deftet.py | tovacinni/kaolin | 0236fbce9c44bd9818de1603aeae38c5f3ac58f5 | [
"ECL-2.0",
"Apache-2.0"
] | 371 | 2019-11-13T14:50:59.000Z | 2022-03-22T19:40:06.000Z | tests/python/kaolin/render/mesh/test_deftet.py | tovacinni/kaolin | 0236fbce9c44bd9818de1603aeae38c5f3ac58f5 | [
"ECL-2.0",
"Apache-2.0"
] | 482 | 2019-11-13T05:04:38.000Z | 2022-03-31T10:20:26.000Z | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES.
# 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 req... | 45.952772 | 101 | 0.549176 |
4bbbd0ba9d37354c5b03d5ccb2f3bcb9847bc8e4 | 1,080 | py | Python | temfpy/linear_equations.py | OpenSourceEconomics/tespy | 2bf3e6dda867514a04d5816609010bf09e436d44 | [
"MIT"
] | null | null | null | temfpy/linear_equations.py | OpenSourceEconomics/tespy | 2bf3e6dda867514a04d5816609010bf09e436d44 | [
"MIT"
] | null | null | null | temfpy/linear_equations.py | OpenSourceEconomics/tespy | 2bf3e6dda867514a04d5816609010bf09e436d44 | [
"MIT"
] | null | null | null | """Linear equations.
We provide a variety of linear equations.
"""
import sys
import numpy as np
def get_ill_cond_lin_eq(n):
r"""Create ill-conditioned system of linear equations given a 1-D solution array of ones.
.. math:: Ax=b
Parameters
----------
n : non-negative integer
Dimens... | 20 | 93 | 0.567593 |
f697f2a6dae3ea3b93326c73dbf14dced0ab336a | 696 | py | Python | advent_of_code_2021__day_6_1/test_swarm.py | MaRNG/advent-of-code-2021 | fae73c4f0bf886588281d9636119f9a32f2dfadd | [
"MIT"
] | null | null | null | advent_of_code_2021__day_6_1/test_swarm.py | MaRNG/advent-of-code-2021 | fae73c4f0bf886588281d9636119f9a32f2dfadd | [
"MIT"
] | null | null | null | advent_of_code_2021__day_6_1/test_swarm.py | MaRNG/advent-of-code-2021 | fae73c4f0bf886588281d9636119f9a32f2dfadd | [
"MIT"
] | null | null | null | import unittest
from swarm import Swarm
class TestSwarm(unittest.TestCase):
def test_create_swarm_from_template(self):
swarm = Swarm.create_swarm_fishes_from_template([
3, 4, 3, 1, 2
])
self.assertEqual(len(swarm.fishes), 5)
self.assertEqual(swarm.fishes[0].time_to_bir... | 24 | 60 | 0.617816 |
fe5f9e4d102c793a23c7e6cb2e54b3d63c609997 | 4,291 | py | Python | pyamg/krylov/_gmres.py | nschloe/pyamg | 005a71754015f050ac3d39241365cbfa4998c374 | [
"MIT"
] | null | null | null | pyamg/krylov/_gmres.py | nschloe/pyamg | 005a71754015f050ac3d39241365cbfa4998c374 | [
"MIT"
] | null | null | null | pyamg/krylov/_gmres.py | nschloe/pyamg | 005a71754015f050ac3d39241365cbfa4998c374 | [
"MIT"
] | 2 | 2022-01-03T00:20:22.000Z | 2022-03-01T12:02:54.000Z | """Generalized Minimum Residual Method (GMRES) Krylov solver."""
from ._gmres_mgs import gmres_mgs
from ._gmres_householder import gmres_householder
def gmres(A, b, x0=None, tol=1e-5, restrt=None, maxiter=None,
M=None, callback=None, residuals=None, orthog='householder',
**kwargs):
"""General... | 38.657658 | 85 | 0.607784 |
f4cf16bcd6f6115a4339fd6544429cb13e20c8dc | 987 | py | Python | tests/test_duplicates.py | kkaris/bioregistry | e8cdaf8e8c5670873ce10a5a67d7850b76e5eff7 | [
"MIT"
] | 17 | 2021-09-14T17:58:16.000Z | 2022-03-11T06:22:11.000Z | tests/test_duplicates.py | kkaris/bioregistry | e8cdaf8e8c5670873ce10a5a67d7850b76e5eff7 | [
"MIT"
] | 148 | 2021-09-18T08:52:46.000Z | 2022-03-23T15:57:35.000Z | tests/test_duplicates.py | kkaris/bioregistry | e8cdaf8e8c5670873ce10a5a67d7850b76e5eff7 | [
"MIT"
] | 9 | 2021-09-28T20:18:53.000Z | 2022-03-14T17:23:35.000Z | # -*- coding: utf-8 -*-
"""Tests to make sure there are no duplicates."""
import unittest
from more_itertools import pairwise
import bioregistry
from bioregistry.utils import norm
class TestDuplicates(unittest.TestCase):
"""Tests for duplicates."""
def test_unique_keys(self):
"""Test that all pre... | 29.909091 | 74 | 0.639311 |
abc251a642ffd0c531ebe7d86df7fb5d156e2eaf | 11,819 | py | Python | simplecv/module/_resnets.py | Bobholamovic/SimpleCV | f4edacf088d0155725a469e227de847820bdfa53 | [
"MIT"
] | 44 | 2019-05-12T10:02:23.000Z | 2022-01-26T07:30:45.000Z | simplecv/module/_resnets.py | Z-Zheng/simplecv | 4fa67581441ad150e82b3aa2c394a921f74e4ecd | [
"MIT"
] | 6 | 2019-11-05T02:23:18.000Z | 2021-06-15T07:06:41.000Z | simplecv/module/_resnets.py | Bobholamovic/SimpleCV | f4edacf088d0155725a469e227de847820bdfa53 | [
"MIT"
] | 8 | 2019-07-07T08:58:20.000Z | 2022-03-19T08:57:33.000Z | import torch.nn as nn
from torch.utils.model_zoo import load_url as load_state_dict_from_url
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x4d', 'resnext101_32x8d']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resn... | 39.006601 | 127 | 0.619511 |
0d1788ec70e5eaf743f34d550eb7acf72190983e | 2,903 | py | Python | setup.py | lixfz/HyperGBM | a7b929f2665c590afff5eae5dd4f14d8cd20bb70 | [
"Apache-2.0"
] | 687 | 2020-10-22T04:18:35.000Z | 2022-03-31T10:16:32.000Z | setup.py | lixfz/HyperGBM | a7b929f2665c590afff5eae5dd4f14d8cd20bb70 | [
"Apache-2.0"
] | 34 | 2020-11-02T02:15:51.000Z | 2022-03-30T10:26:44.000Z | setup.py | lixfz/HyperGBM | a7b929f2665c590afff5eae5dd4f14d8cd20bb70 | [
"Apache-2.0"
] | 136 | 2020-10-22T06:38:40.000Z | 2022-03-20T08:00:20.000Z | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from setuptools import find_packages
from setuptools import setup
import os
from os import path as P
def read_requirements(file_path='requirements.txt'):
if not os.path.exists(file_path):
return []
with open(file_path, 'r')as f:
... | 27.913462 | 79 | 0.641061 |
5098271e0e937de3b8cee2322e0db1ddb4adb331 | 887 | py | Python | setup.py | shanshanhsieh/cea-osm-gwr-mapper | 5f85a108a084dfcf7cfd33a97f953bbec8dbfeae | [
"MIT"
] | null | null | null | setup.py | shanshanhsieh/cea-osm-gwr-mapper | 5f85a108a084dfcf7cfd33a97f953bbec8dbfeae | [
"MIT"
] | null | null | null | setup.py | shanshanhsieh/cea-osm-gwr-mapper | 5f85a108a084dfcf7cfd33a97f953bbec8dbfeae | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
__author__ = "Daren Thomas"
__copyright__ = "Copyright 2020, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Daren Thomas"]
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Daren Thomas"
__email__ = "cea@arch.ethz.ch"
__status__ = "Production"
set... | 36.958333 | 117 | 0.72717 |
66ad29e2f47f8d488f7cb811d7627b9b4252a038 | 1,653 | py | Python | src/vmware/azext_vmware/vendored_sdks/models/private_cloud_update_py3.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | 2 | 2021-06-05T17:51:26.000Z | 2021-11-17T11:17:56.000Z | src/vmware/azext_vmware/vendored_sdks/models/private_cloud_update_py3.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | 1 | 2020-06-12T01:39:40.000Z | 2020-06-12T01:39:40.000Z | src/vmware/azext_vmware/vendored_sdks/models/private_cloud_update_py3.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | 1 | 2019-05-02T00:55:30.000Z | 2019-05-02T00:55:30.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 43.5 | 118 | 0.638234 |
a63db4386e85177016f2027551855f5fddae5975 | 2,072 | py | Python | calculator/calculator.py | Ersoy-Kardesler/python-examples | dcadf5edca37ffc17cbb09fcbea22ea0a86020c3 | [
"CC0-1.0"
] | null | null | null | calculator/calculator.py | Ersoy-Kardesler/python-examples | dcadf5edca37ffc17cbb09fcbea22ea0a86020c3 | [
"CC0-1.0"
] | null | null | null | calculator/calculator.py | Ersoy-Kardesler/python-examples | dcadf5edca37ffc17cbb09fcbea22ea0a86020c3 | [
"CC0-1.0"
] | null | null | null | # Author: Ercan Ersoy
import math
while True:
print()
print("Calculator")
print()
print("1- Addition")
print("2- Substraction")
print("3- Multiplication")
print("4- Division")
print("5- Remainder")
print("6- Exponentiation")
print("7- nth Root")
print("8- Logarithm")
pr... | 35.118644 | 89 | 0.562259 |
b6726f023c7ebfa4506dcf19b9a8270df00cf89e | 1,650 | py | Python | games/management/commands/bggranking.py | recommend-games/recommend-games-server | 700e4039d8f72e77ac988b02476f84d701fd5225 | [
"MIT"
] | 1 | 2021-01-28T18:16:11.000Z | 2021-01-28T18:16:11.000Z | games/management/commands/bggranking.py | MarkusShepherd/ludoj-server | 6cfb218029e6e1cf520eed1ccab2576c990cd287 | [
"MIT"
] | 6 | 2019-12-10T14:03:23.000Z | 2021-08-22T13:23:36.000Z | games/management/commands/bggranking.py | MarkusShepherd/ludoj-server | 6cfb218029e6e1cf520eed1ccab2576c990cd287 | [
"MIT"
] | 2 | 2019-10-11T11:52:06.000Z | 2022-01-18T21:56:48.000Z | # -*- coding: utf-8 -*-
"""Saves a snapshot of the BGG rankings."""
import csv
import logging
import sys
from django.core.management.base import BaseCommand
from ...models import Game
csv.field_size_limit(sys.maxsize)
LOGGER = logging.getLogger(__name__)
def _write_games(games, output):
writer = csv.writer(... | 30 | 88 | 0.626061 |
9904dbfa7ee932ad45eca908ddf023caa262a52e | 712 | py | Python | remindtowater/migrations/0001_initial.py | patrickdhopkins/Plant-Reminder | 55bcea94634575712bbda62176203ca55cef33a4 | [
"MIT"
] | null | null | null | remindtowater/migrations/0001_initial.py | patrickdhopkins/Plant-Reminder | 55bcea94634575712bbda62176203ca55cef33a4 | [
"MIT"
] | 7 | 2020-02-11T23:40:35.000Z | 2022-03-11T23:39:26.000Z | remindtowater/migrations/0001_initial.py | patrickdhopkins/Plant-Reminder | 55bcea94634575712bbda62176203ca55cef33a4 | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2019-01-02 23:53
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Plant',
fields=[
('id', models.AutoField(auto... | 27.384615 | 114 | 0.553371 |
8b9ca39dcac37808e72d8627a3e36ced67b7cd1f | 4,246 | py | Python | examples/tests/ppapi_vars/genrpc.py | suraj-testing2/YouTube_Clock | 7a183af4d9543077bfaab61a92faae1d98dde961 | [
"BSD-3-Clause"
] | 122 | 2015-01-08T13:53:11.000Z | 2022-02-16T03:12:32.000Z | examples/tests/ppapi_vars/genrpc.py | mcanthony/pepper.js | 7a183af4d9543077bfaab61a92faae1d98dde961 | [
"BSD-3-Clause"
] | 3 | 2017-04-05T00:41:45.000Z | 2020-04-04T00:44:24.000Z | examples/tests/ppapi_vars/genrpc.py | mcanthony/pepper.js | 7a183af4d9543077bfaab61a92faae1d98dde961 | [
"BSD-3-Clause"
] | 41 | 2015-02-24T10:09:55.000Z | 2021-10-12T03:20:10.000Z | #!/usr/bin/python
import cStringIO
import json
class Interface(object):
def __init__(self):
self.methods = []
def method(self, name):
m = Method(name)
m.uid = len(self.methods)
self.methods.append(m)
return m
class Method(object):
def __init__(self, name):
self.name = name
self.ui... | 23.853933 | 79 | 0.625059 |
09314c77f0f45994969bacd6b2bc4e8873e2dbcc | 4,934 | py | Python | analytics/lib/line_plot.py | Genometric/ToolVisibilityQuantifier | 82572a678c27820ec1a8dbbc54dcee18ee601096 | [
"MIT"
] | 3 | 2020-04-03T02:00:10.000Z | 2020-06-18T01:39:22.000Z | analytics/lib/line_plot.py | Genometric/ToolVisibilityQuantifier | 82572a678c27820ec1a8dbbc54dcee18ee601096 | [
"MIT"
] | 1 | 2020-07-14T06:39:02.000Z | 2020-07-14T06:39:02.000Z | analytics/lib/line_plot.py | Genometric/ToolVisibilityQuantifier | 82572a678c27820ec1a8dbbc54dcee18ee601096 | [
"MIT"
] | 1 | 2020-05-22T20:12:47.000Z | 2020-05-22T20:12:47.000Z | """
TODO: Add doc string.
"""
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
from scipy.interpolate import make_interp_spline, BSpline
STEP_SIZE = 10
BACKGROND_COLOR = (0.9, 0.9, 0.9)
GRID_COLOR = (0.95, 0.95, 0.95)
def read_input(filename):
before_x = []
before_median = []
befo... | 32.460526 | 95 | 0.629104 |
3d34bda295574df2342f4044ffa3b6999c4749cf | 696 | py | Python | tp1/ejercicio1.py | NicoGallegos/fiuba-simulacion-grupo6 | c904eed4f1e8c07716ba38d44e83449c2ac5acd9 | [
"MIT"
] | null | null | null | tp1/ejercicio1.py | NicoGallegos/fiuba-simulacion-grupo6 | c904eed4f1e8c07716ba38d44e83449c2ac5acd9 | [
"MIT"
] | null | null | null | tp1/ejercicio1.py | NicoGallegos/fiuba-simulacion-grupo6 | c904eed4f1e8c07716ba38d44e83449c2ac5acd9 | [
"MIT"
] | null | null | null | import util.generador as generador
import matplotlib.pyplot as plt
g = generador.GeneradorLinealCongruente()
print("######################################################")
print("EJERCICIO 1")
print("######################################################")
print("\n")
print("IMPRIMIR PRIMEROS 6 NUMEROS GENERADOS")
... | 27.84 | 63 | 0.623563 |
66c5e5a44da1390c40a90f066b5a3ee03ac7f7e5 | 15,588 | py | Python | hummingbot/core/data_type/order_candidate.py | pecuniafinance/hummingbot | 2cbb19c187a429d3e6000dc938617ca2a1f9f357 | [
"Apache-2.0"
] | 542 | 2021-12-17T22:34:31.000Z | 2022-03-31T14:36:23.000Z | hummingbot/core/data_type/order_candidate.py | pecuniafinance/hummingbot | 2cbb19c187a429d3e6000dc938617ca2a1f9f357 | [
"Apache-2.0"
] | 291 | 2021-12-17T20:07:53.000Z | 2022-03-31T11:07:23.000Z | hummingbot/core/data_type/order_candidate.py | pecuniafinance/hummingbot | 2cbb19c187a429d3e6000dc938617ca2a1f9f357 | [
"Apache-2.0"
] | 220 | 2021-12-17T12:41:23.000Z | 2022-03-31T23:03:22.000Z | import typing
from collections import defaultdict
from dataclasses import dataclass, field
from decimal import Decimal
from typing import Dict, List, Optional
from hummingbot.connector.utils import combine_to_hb_trading_pair, split_hb_trading_pair
from hummingbot.core.data_type.trade_fee import TokenAmount, TradeFeeBa... | 42.590164 | 112 | 0.673403 |
a16569ddbec9de19043e025df623b539bbaaca37 | 1,787 | py | Python | cogbot/cogs/robo_mod/conditions/message_contains_any_of.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 8 | 2016-12-26T14:10:38.000Z | 2021-01-02T03:50:05.000Z | cogbot/cogs/robo_mod/conditions/message_contains_any_of.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 28 | 2016-12-12T04:06:53.000Z | 2020-04-23T06:18:55.000Z | cogbot/cogs/robo_mod/conditions/message_contains_any_of.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 9 | 2017-06-03T00:33:57.000Z | 2020-10-29T18:16:02.000Z | import unicodedata
from typing import Any, Dict, Set
from cogbot.cogs.robo_mod.robo_mod_condition import RoboModCondition
from cogbot.cogs.robo_mod.robo_mod_trigger import RoboModTrigger
class MessageContainsAnyOfCondition(RoboModCondition):
def __init__(self):
self.matches: Set[str] = None
self.... | 34.365385 | 69 | 0.6385 |
35383193cfa611546de9cac1a1f195bfb8ed82db | 12,311 | py | Python | FRcnn_pytorch/lib/model/utils/config.py | Ourwlsg/stomatal-index | 0895cf21346d8b7662f2b9f1d2c725f65f21a397 | [
"BSD-3-Clause"
] | null | null | null | FRcnn_pytorch/lib/model/utils/config.py | Ourwlsg/stomatal-index | 0895cf21346d8b7662f2b9f1d2c725f65f21a397 | [
"BSD-3-Clause"
] | null | null | null | FRcnn_pytorch/lib/model/utils/config.py | Ourwlsg/stomatal-index | 0895cf21346d8b7662f2b9f1d2c725f65f21a397 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path as osp
import numpy as np
# `pip install easydict` if you don't have it
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config im... | 30.472772 | 91 | 0.70831 |
cdf74229e648e2542bf33667943705029b8d0e6b | 289 | py | Python | orchestra/bots/assignment_policies.py | code-review-doctor/orchestra | 1ba58d26c508e89d2050dc9b0c8439eb1eadd014 | [
"Apache-2.0"
] | 444 | 2016-07-25T05:24:30.000Z | 2022-02-21T08:12:29.000Z | orchestra/bots/assignment_policies.py | code-review-doctor/orchestra | 1ba58d26c508e89d2050dc9b0c8439eb1eadd014 | [
"Apache-2.0"
] | 395 | 2016-07-26T20:49:59.000Z | 2022-03-15T20:58:45.000Z | orchestra/bots/assignment_policies.py | code-review-doctor/orchestra | 1ba58d26c508e89d2050dc9b0c8439eb1eadd014 | [
"Apache-2.0"
] | 63 | 2016-07-26T04:10:21.000Z | 2022-03-29T03:32:19.000Z | from orchestra.bots.staffbot import StaffBot
from orchestra.models import StaffBotRequest
def staffbot_autoassign(task, **kwargs):
request_cause = StaffBotRequest.RequestCause.TASK_POLICY.value
bot = StaffBot()
bot.staff(task.id, request_cause=request_cause)
return task
| 28.9 | 66 | 0.788927 |
0e4fd7df51d4bd5618a66e893d47134c8320c7fd | 1,119 | py | Python | plot/plot_overview_origin.py | seizuresmiley/seiyuu-insights | d1a45c90cb6566df7a86dc1d23cfd5dc8e1167aa | [
"MIT"
] | null | null | null | plot/plot_overview_origin.py | seizuresmiley/seiyuu-insights | d1a45c90cb6566df7a86dc1d23cfd5dc8e1167aa | [
"MIT"
] | 1 | 2018-12-08T04:01:12.000Z | 2018-12-08T11:20:51.000Z | plot/plot_overview_origin.py | seizuresmiley/ml-seiyuu-analysis | 161fb6658019209cda778fae843339323df5d2d9 | [
"MIT"
] | null | null | null | import collections
import pygal
import json
import os
import collections as col
import re
#This script intends to graph favourites accumulation through 3200 tweets.
def plot(read_dir):
filelist = os.listdir(read_dir)
result = col.Counter()
for file in filelist:
with open('%s%s' % (read_dir,file),"r... | 33.909091 | 106 | 0.643432 |
090d3bfb40d4713e83c0657a32b5f5f0b0cbf777 | 5,074 | py | Python | chalicelib/storage.py | jmespath/jmespath-playground | 238b634dc8fdc26456a6c3cd1d98d881181794de | [
"Apache-2.0"
] | 8 | 2018-01-02T12:36:09.000Z | 2021-11-24T14:33:45.000Z | chalicelib/storage.py | jmespath/jmespath-playground | 238b634dc8fdc26456a6c3cd1d98d881181794de | [
"Apache-2.0"
] | null | null | null | chalicelib/storage.py | jmespath/jmespath-playground | 238b634dc8fdc26456a6c3cd1d98d881181794de | [
"Apache-2.0"
] | 4 | 2019-09-15T23:16:31.000Z | 2021-04-11T19:19:08.000Z | import os
import json
import logging
from uuid import uuid4
# We're using a fixed name here because chalice will
# configure the appropriate handlers for the logger that
# matches the app name.
LOG = logging.getLogger('jmespath-playground.storage')
MAX_BODY_SIZE = 1024 * 100
# Make disk space allowed for cache data.
... | 33.163399 | 79 | 0.624951 |
cd16b5a63db1bfb3c348aeb244895004b5efc216 | 3,368 | py | Python | models/layers/linear.py | xuanqing94/NeuralSDE | f3511799cfc9c3d6b95ff9bcb07563df88715e0c | [
"MIT"
] | 5 | 2020-06-28T07:15:35.000Z | 2022-01-20T01:52:31.000Z | models/layers/linear.py | xuanqing94/NeuralSDE | f3511799cfc9c3d6b95ff9bcb07563df88715e0c | [
"MIT"
] | null | null | null | models/layers/linear.py | xuanqing94/NeuralSDE | f3511799cfc9c3d6b95ff9bcb07563df88715e0c | [
"MIT"
] | null | null | null | import math
import torch
import torch.nn as nn
from torch.nn import Parameter
import torch.nn.functional as F
from .weight_noise import noise_fn
class RandLinear(nn.Module):
def __init__(
self, in_features, out_features, bias=True, **rand_args,
):
"""Linear layer with random weights.
A... | 35.083333 | 83 | 0.566211 |
716011b15fd2eb82db0bff2d4da8d5c31605d856 | 280 | py | Python | sqlinj.py | cancer525/pythontest | 9ee09797697f615ca2ee47b54eebb7da766b7c93 | [
"Apache-2.0"
] | null | null | null | sqlinj.py | cancer525/pythontest | 9ee09797697f615ca2ee47b54eebb7da766b7c93 | [
"Apache-2.0"
] | null | null | null | sqlinj.py | cancer525/pythontest | 9ee09797697f615ca2ee47b54eebb7da766b7c93 | [
"Apache-2.0"
] | null | null | null | from django.db import connection
def user_contacts(request):
user = request.GET['username']
sql = "SELECT * FROM user_contacts WHERE username = %s;"
cursor = connection.cursor()
cursor.execute(sql, user)
# ... do something with the results
user_contacts(a);
| 25.454545 | 60 | 0.692857 |
0188a8c740cac0bb36ab557de1384f0e5d00840c | 11,459 | py | Python | SLHCUpgradeSimulations/Configuration/python/aging.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | SLHCUpgradeSimulations/Configuration/python/aging.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | SLHCUpgradeSimulations/Configuration/python/aging.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
# handle normal mixing or premixing
def getHcalDigitizer(process):
if hasattr(process,'mixData'):
return process.mixData
if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'hcal'):
return process.mix.digiti... | 44.243243 | 176 | 0.709922 |
6228b1469f5cca8fd6ad78c47c64193988c2617f | 5,920 | py | Python | onlinecourse/views.py | mbakoG90210/final-cloud-app-with-database | 3ccdf2dd52ce6f7247e61009269479a5c325c389 | [
"Apache-2.0"
] | null | null | null | onlinecourse/views.py | mbakoG90210/final-cloud-app-with-database | 3ccdf2dd52ce6f7247e61009269479a5c325c389 | [
"Apache-2.0"
] | null | null | null | onlinecourse/views.py | mbakoG90210/final-cloud-app-with-database | 3ccdf2dd52ce6f7247e61009269479a5c325c389 | [
"Apache-2.0"
] | 2 | 2022-01-28T15:50:50.000Z | 2022-01-29T11:17:35.000Z | from django.shortcuts import render
from django.http import HttpResponseRedirect
# <HINT> Import any new Models here
from .models import Course, Enrollment, Question, Choice, Submission
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404, render, redirect
from django.urls import r... | 37.948718 | 129 | 0.69223 |
e60e862a24ba355f68b939b74dc7e4deebab4541 | 42,267 | py | Python | v2.5.7/toontown/battle/RewardPanel.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v2.5.7/toontown/battle/RewardPanel.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v2.5.7/toontown/battle/RewardPanel.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from panda3d.core import *
from direct.gui.DirectGui import *
from panda3d.core import *
from direct.interval.IntervalGlobal import *
from toontown.toonbase import ToontownBattleGlobals
import BattleBase
from direct.directnotify import DirectNotifyGlobal
import random, string
from toontown.quest import Quests
import co... | 48.976825 | 229 | 0.541676 |
43adda21ecf6812b2db62fa5ef389ae252003422 | 3,523 | py | Python | jsonical3.py | LanetheGreat/jsonical3 | 9da5d68aa216b38dd1515e429a1edf76a85f4719 | [
"MIT"
] | null | null | null | jsonical3.py | LanetheGreat/jsonical3 | 9da5d68aa216b38dd1515e429a1edf76a85f4719 | [
"MIT"
] | null | null | null | jsonical3.py | LanetheGreat/jsonical3 | 9da5d68aa216b38dd1515e429a1edf76a85f4719 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2009 New England Biolabs <davisp@neb.com>
#
# This file is part of the nebgbhist package released under the MIT license.
#
r"""Canonical JSON serialization.
Basic approaches for implementing canonical JSON serialization.
Encoding basic Python object hierarchies::
>>> import jso... | 27.960317 | 80 | 0.608288 |
43a8ce8381fcf85870175b3334bf695e220aace5 | 3,098 | py | Python | backend/misc/setup.py | xunzhaotech/Icarus | 51f1d445226346a2e52231a9a31680e38480358c | [
"Zlib"
] | null | null | null | backend/misc/setup.py | xunzhaotech/Icarus | 51f1d445226346a2e52231a9a31680e38480358c | [
"Zlib"
] | null | null | null | backend/misc/setup.py | xunzhaotech/Icarus | 51f1d445226346a2e52231a9a31680e38480358c | [
"Zlib"
] | 1 | 2018-12-21T11:46:51.000Z | 2018-12-21T11:46:51.000Z | import sys
import time
sys.path.insert(0, '.')
import binascii
import os
from typing import Optional
main_path = os.path.abspath(os.path.join(__file__, '../..'))
private_path = os.path.join(main_path, 'private.py')
def is_already_setup() -> Optional[bool]:
if os.path.exists(private_path):
return True
... | 26.478632 | 105 | 0.585539 |
bc502ce300cd6f8cd1dcf7cb58fc58a63b694283 | 17,476 | py | Python | mips_revisit/huggingface/modeling_transfo_xl_utilities.py | vlad17/mips_revisit | 0777b37d9727d785487379e5b1f6dcd146d8b17c | [
"Apache-2.0"
] | null | null | null | mips_revisit/huggingface/modeling_transfo_xl_utilities.py | vlad17/mips_revisit | 0777b37d9727d785487379e5b1f6dcd146d8b17c | [
"Apache-2.0"
] | null | null | null | mips_revisit/huggingface/modeling_transfo_xl_utilities.py | vlad17/mips_revisit | 0777b37d9727d785487379e5b1f6dcd146d8b17c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 36.714286 | 132 | 0.52615 |
201f8a0e12be111d9ebc62d04bf0877220098a31 | 17,368 | py | Python | OpenPNM/Geometry/models/pore_volume.py | Eng-RSMY/OpenPNM | a0a057d0f6346c515792459b1da97f05bab383c1 | [
"MIT"
] | 1 | 2021-03-30T21:38:26.000Z | 2021-03-30T21:38:26.000Z | OpenPNM/Geometry/models/pore_volume.py | Eng-RSMY/OpenPNM | a0a057d0f6346c515792459b1da97f05bab383c1 | [
"MIT"
] | null | null | null | OpenPNM/Geometry/models/pore_volume.py | Eng-RSMY/OpenPNM | a0a057d0f6346c515792459b1da97f05bab383c1 | [
"MIT"
] | null | null | null | r"""
===============================================================================
pore_volume --
===============================================================================
"""
import scipy as _sp
import numpy as np
from scipy.spatial import Delaunay
from scipy.spatial import ConvexHull
import OpenPNM.Utilities... | 39.38322 | 85 | 0.581069 |
aa19cc77dc524dcb21817e2829cb2b0ca7064938 | 6,092 | py | Python | finalists/yc14600/PyTorch-Encoding/encoding/datasets/cityscapes.py | lrzpellegrini/cvpr_clvision_challenge | cc783a9a4f80ab72062ef40368e4eed6b10c7bc9 | [
"CC-BY-4.0"
] | 2,190 | 2018-09-11T11:44:50.000Z | 2022-03-30T15:20:11.000Z | finalists/yc14600/PyTorch-Encoding/encoding/datasets/cityscapes.py | lrzpellegrini/cvpr_clvision_challenge | cc783a9a4f80ab72062ef40368e4eed6b10c7bc9 | [
"CC-BY-4.0"
] | 374 | 2017-10-05T09:25:08.000Z | 2022-03-11T06:03:53.000Z | finalists/yc14600/PyTorch-Encoding/encoding/datasets/cityscapes.py | lrzpellegrini/cvpr_clvision_challenge | cc783a9a4f80ab72062ef40368e4eed6b10c7bc9 | [
"CC-BY-4.0"
] | 531 | 2018-09-12T06:46:10.000Z | 2022-03-30T13:14:28.000Z | ###########################################################################
# Created by: Hang Zhang
# Email: zhang.hang@rutgers.edu
# Copyright (c) 2018
###########################################################################
import os
import sys
import random
import numpy as np
from tqdm import tqdm, trange
from ... | 42.901408 | 95 | 0.574688 |
7e2810b40028e3e9a95320635bf2f6bcb470e6a4 | 2,328 | py | Python | html-muncher/muncher/varfactory.py | danthewolfe/drapes | 1b57c48654a6437d08c763ab010e13d43bfa2217 | [
"Apache-2.0"
] | null | null | null | html-muncher/muncher/varfactory.py | danthewolfe/drapes | 1b57c48654a6437d08c763ab010e13d43bfa2217 | [
"Apache-2.0"
] | 1 | 2019-02-19T17:25:27.000Z | 2019-02-19T17:25:27.000Z | html-muncher/muncher/varfactory.py | ndlib/drapes | 1b57c48654a6437d08c763ab010e13d43bfa2217 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2011 Craig Campbell
#
# 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... | 25.866667 | 101 | 0.601375 |
bd612ae8389c880601dc8ad42b3cea5281c1be34 | 2,036 | py | Python | lib/utils/load_model.py | Amberrferr/Faster_RCNN_for_DOTA | 6cd0407052f3d9cc095f8ac2e1cea9d4c3adafc5 | [
"Apache-2.0"
] | 344 | 2018-04-30T05:33:35.000Z | 2022-03-30T15:38:13.000Z | lib/utils/load_model.py | Amberrferr/Faster_RCNN_for_DOTA | 6cd0407052f3d9cc095f8ac2e1cea9d4c3adafc5 | [
"Apache-2.0"
] | 39 | 2018-05-03T12:51:40.000Z | 2021-10-18T12:40:55.000Z | lib/utils/load_model.py | Amberrferr/Faster_RCNN_for_DOTA | 6cd0407052f3d9cc095f8ac2e1cea9d4c3adafc5 | [
"Apache-2.0"
] | 113 | 2018-04-30T03:34:42.000Z | 2021-11-27T09:57:43.000Z | import mxnet as mx
def load_checkpoint(prefix, epoch):
"""
Load model checkpoint from file.
:param prefix: Prefix of model name.
:param epoch: Epoch number of model we would like to load.
:return: (arg_params, aux_params)
arg_params : dict of str to NDArray
Model parameter, dict of nam... | 33.377049 | 76 | 0.63998 |
db5011140e6a560bc2a21e8c4f576bc635778902 | 4,316 | py | Python | augs.py | narain1/banshee | 1a37b64ef81b18d361cf258b3d1ae0fbf7f0ff62 | [
"MIT"
] | null | null | null | augs.py | narain1/banshee | 1a37b64ef81b18d361cf258b3d1ae0fbf7f0ff62 | [
"MIT"
] | null | null | null | augs.py | narain1/banshee | 1a37b64ef81b18d361cf258b3d1ae0fbf7f0ff62 | [
"MIT"
] | null | null | null | import albumentations as A
def get_light_augmentations(img_sz):
return A.Compose([
A.ShiftScaleRotate(shift_limit=0.05, scale_limit=0.1,
rotate_limit=15,
border_mode= cv2.BORDER_CONSTANT, value=0),
A.RandomSizedCrop(min_max_height=(int(img_sz[0]... | 33.984252 | 88 | 0.465709 |
aed0ba1fbd08f942401f5ef224d4156ecdb80a64 | 1,824 | py | Python | flask_blog/models.py | HOZH/flask_blog_hozh | 5ef97a85f7a13d2b978d89bb7094eb44ee3c9927 | [
"MIT"
] | null | null | null | flask_blog/models.py | HOZH/flask_blog_hozh | 5ef97a85f7a13d2b978d89bb7094eb44ee3c9927 | [
"MIT"
] | null | null | null | flask_blog/models.py | HOZH/flask_blog_hozh | 5ef97a85f7a13d2b978d89bb7094eb44ee3c9927 | [
"MIT"
] | null | null | null | from flask_blog import db, login_manager
from datetime import datetime
from flask_login import UserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model,U... | 28.952381 | 94 | 0.669408 |
b546ba2b70319d66ed95eb0844dd879d80ef5484 | 4,213 | py | Python | DataPresentation/lass_pm25_to_thingspeak.py | taipeihackerspace/LASS | b2be935b7e4f968cce467146c3951c284b70b06a | [
"MIT"
] | null | null | null | DataPresentation/lass_pm25_to_thingspeak.py | taipeihackerspace/LASS | b2be935b7e4f968cce467146c3951c284b70b06a | [
"MIT"
] | null | null | null | DataPresentation/lass_pm25_to_thingspeak.py | taipeihackerspace/LASS | b2be935b7e4f968cce467146c3951c284b70b06a | [
"MIT"
] | 1 | 2020-06-11T07:55:09.000Z | 2020-06-11T07:55:09.000Z | #!/usr/bin/env python
#
# Version: 0.2.0
#
# Objctive: This program will do the followings:
# 1. work as a MQTT subscriber for the PM25 version of LASS
# 2. submit the MQTT content to ThingSpeak.com
#
# To Run:
# chmod 755 lass_pm25_to_thingspeak.py
# ./lass_pm25_to_thingspeak.py LASS_DEVICE_ID ThingSpeak_API_KEY
#
# ... | 33.436508 | 93 | 0.642772 |
684d1a456b67dc89479bd85fe5c5426cd5dbb4db | 1,671 | py | Python | tests/common/test_term.py | aaronbrighton/edgedb | 4aacd1d4e248ae0d483c075ba93fc462da291ef4 | [
"Apache-2.0"
] | 7,302 | 2018-05-10T18:36:31.000Z | 2022-03-31T17:49:36.000Z | tests/common/test_term.py | aaronbrighton/edgedb | 4aacd1d4e248ae0d483c075ba93fc462da291ef4 | [
"Apache-2.0"
] | 1,602 | 2018-05-10T17:45:38.000Z | 2022-03-31T23:46:19.000Z | tests/common/test_term.py | aaronbrighton/edgedb | 4aacd1d4e248ae0d483c075ba93fc462da291ef4 | [
"Apache-2.0"
] | 236 | 2018-05-13T14:15:29.000Z | 2022-03-29T19:39:19.000Z | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2011-present MagicStack Inc. and the EdgeDB 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... | 29.839286 | 74 | 0.674446 |
170bbc22f849c542574ae25eb2c6271632488aff | 9,502 | py | Python | docs/conf.py | anoited007/country-dashboard | 577bbcc4992e24c484650895fabbcdf4343e1bdb | [
"MIT"
] | 16 | 2017-10-19T03:36:41.000Z | 2022-03-03T11:46:20.000Z | docs/conf.py | anoited007/country-dashboard | 577bbcc4992e24c484650895fabbcdf4343e1bdb | [
"MIT"
] | 66 | 2016-02-15T08:59:29.000Z | 2017-09-21T14:00:43.000Z | docs/conf.py | anoited007/country-dashboard | 577bbcc4992e24c484650895fabbcdf4343e1bdb | [
"MIT"
] | 18 | 2017-10-06T12:26:37.000Z | 2021-08-30T01:38:37.000Z | # -*- coding: utf-8 -*-
#
# Wazimap documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 14 11:24:45 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | 32.652921 | 79 | 0.709535 |
1eb0eacf7ff2ae30965e51bdebbd0b48b0410439 | 5,221 | py | Python | alipay/aop/api/domain/KoubeiCateringQueueShopinfoSyncModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/KoubeiCateringQueueShopinfoSyncModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/KoubeiCateringQueueShopinfoSyncModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class KoubeiCateringQueueShopinfoSyncModel(object):
def __init__(self):
self._discard_off = None
self._discount_desc = None
self._distance_limit = None
self._notice = No... | 32.428571 | 91 | 0.611952 |
b51fc18e9150081da5461387ce55b7087ee094fb | 1,410 | py | Python | yaql/language/conventions.py | nzlosh/yaql | bb65fc64026d431ffb866d02825deb3a0e4b5943 | [
"Apache-2.0"
] | 112 | 2015-10-18T02:57:41.000Z | 2022-03-28T18:26:36.000Z | yaql/language/conventions.py | nzlosh/yaql | bb65fc64026d431ffb866d02825deb3a0e4b5943 | [
"Apache-2.0"
] | 3 | 2020-06-09T11:54:38.000Z | 2021-04-30T06:12:37.000Z | yaql/language/conventions.py | nzlosh/yaql | bb65fc64026d431ffb866d02825deb3a0e4b5943 | [
"Apache-2.0"
] | 27 | 2015-12-10T00:10:02.000Z | 2022-03-20T21:51:01.000Z | # Copyright (c) 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 28.77551 | 78 | 0.699291 |
85fb25b4fe85d7786e7e0bf00b8b6e07b9eb1d00 | 5,178 | py | Python | bot/utils/retriever.py | christianbernasconi96/clothing_recommendation | d8f9dae291172f4606bbb6c855fb170f725543ff | [
"MIT"
] | null | null | null | bot/utils/retriever.py | christianbernasconi96/clothing_recommendation | d8f9dae291172f4606bbb6c855fb170f725543ff | [
"MIT"
] | null | null | null | bot/utils/retriever.py | christianbernasconi96/clothing_recommendation | d8f9dae291172f4606bbb6c855fb170f725543ff | [
"MIT"
] | null | null | null | from annoy import AnnoyIndex
import os
import configparser
# TODO: valutare se può servire get_nns_by_item per feedback retrieval
class Retriever():
def __init__(self, indexes_path, load_all=False):
self.indexes_path = indexes_path
self.load_all = load_all
self.indexes = {}
# creat... | 42.442623 | 124 | 0.659521 |
7e75d46e3456b0ab5e882bd3accf418ea9cd3c1b | 3,002 | py | Python | src/sas/sasgui/guiframe/data_state.py | andyfaff/sasview | c00a797ab9c4ddc60f0fa8a64ae8a2067c225921 | [
"BSD-3-Clause"
] | null | null | null | src/sas/sasgui/guiframe/data_state.py | andyfaff/sasview | c00a797ab9c4ddc60f0fa8a64ae8a2067c225921 | [
"BSD-3-Clause"
] | null | null | null | src/sas/sasgui/guiframe/data_state.py | andyfaff/sasview | c00a797ab9c4ddc60f0fa8a64ae8a2067c225921 | [
"BSD-3-Clause"
] | null | null | null | ################################################################################
#This software was developed by the University of Tennessee as part of the
#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
#project funded by the US National Science Foundation.
#
#See the license text in license.txt
... | 27.796296 | 80 | 0.490007 |
5b57af5e1f35930dceb46bcbbd6e55330133b9a3 | 1,459 | py | Python | crafters/audio/AudioReader/__init__.py | julianpetrich/jina-hub | a7703282462ae3bac226249365426b3998949f8f | [
"Apache-2.0"
] | null | null | null | crafters/audio/AudioReader/__init__.py | julianpetrich/jina-hub | a7703282462ae3bac226249365426b3998949f8f | [
"Apache-2.0"
] | null | null | null | crafters/audio/AudioReader/__init__.py | julianpetrich/jina-hub | a7703282462ae3bac226249365426b3998949f8f | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from jina.executors.crafters import BaseCrafter
class AudioReader(BaseCrafter):
"""
Read and resample the audio signal on doc-level.
:class:`AudioReader` loads an audio file as `ndarray` and resamples the audio signal to the target sampling rate
(default 22050Hz).
:param... | 33.159091 | 116 | 0.64976 |
e1b81a01afbb74c7e49977437862c1c15a747837 | 515 | py | Python | elyzer/envDefault.py | o19s/elyzer | d67f6c581951bc7cf39c272e2da0f85f9d9dee49 | [
"Apache-2.0"
] | 146 | 2015-09-17T03:51:36.000Z | 2022-03-31T21:09:41.000Z | elyzer/envDefault.py | o19s/elyzer | d67f6c581951bc7cf39c272e2da0f85f9d9dee49 | [
"Apache-2.0"
] | 15 | 2015-12-09T21:42:42.000Z | 2020-08-01T10:50:06.000Z | elyzer/envDefault.py | o19s/elyzer | d67f6c581951bc7cf39c272e2da0f85f9d9dee49 | [
"Apache-2.0"
] | 17 | 2015-12-07T11:48:04.000Z | 2020-09-24T21:46:12.000Z | import argparse
import os
class EnvDefault(argparse.Action):
def __init__(self, envvar, required=True, default=None, **kwargs):
if envvar in os.environ:
default = os.environ[envvar]
if required and default:
required = False
super(EnvDefault, self).__init__(default=de... | 34.333333 | 76 | 0.623301 |
5ee009085ea7b346ee60ba0be69c792718f425dd | 2,204 | py | Python | setup.py | jpmarques66/operator-service | 061e6b07f928f1ed6d1401e3cfef8a089c9f4dad | [
"Apache-2.0"
] | 3 | 2021-10-04T09:23:39.000Z | 2022-02-26T21:20:21.000Z | setup.py | jpmarques66/operator-service | 061e6b07f928f1ed6d1401e3cfef8a089c9f4dad | [
"Apache-2.0"
] | null | null | null | setup.py | jpmarques66/operator-service | 061e6b07f928f1ed6d1401e3cfef8a089c9f4dad | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
# Copyright 2018 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
from setuptools import find_packages, setup
with open('README.md') as readme_file:
readme = readme_file.read()
with open('CHANGELOG.md') as history_file:
h... | 26.554217 | 71 | 0.635209 |
31a27335c82c2d67528b6906cce51b748dfd6c98 | 10,917 | py | Python | recipe_modules/bot_update/api.py | funyoung/depop_tool | 6f830d75c683dad1905cfc92ce819cdb2e15c75d | [
"BSD-3-Clause"
] | null | null | null | recipe_modules/bot_update/api.py | funyoung/depop_tool | 6f830d75c683dad1905cfc92ce819cdb2e15c75d | [
"BSD-3-Clause"
] | null | null | null | recipe_modules/bot_update/api.py | funyoung/depop_tool | 6f830d75c683dad1905cfc92ce819cdb2e15c75d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Recipe module to ensure a checkout is consistant on a bot."""
from recipe_engine import recipe_api
# This is just for testing, to indicate if a master... | 38.989286 | 80 | 0.655949 |
28f91a75d812729eb4521549973e0286e9e74bd0 | 28,992 | py | Python | tests/sagemaker/test_deployment.py | vividmachines/mlflow | 278e6ca6234de66f60321389ac5bfde441f07233 | [
"Apache-2.0"
] | 1 | 2021-12-13T20:52:08.000Z | 2021-12-13T20:52:08.000Z | tests/sagemaker/test_deployment.py | imrancharania/mlflow | 6e4b64bd3b7beadbdb243f6921d9ebedb10a1dbd | [
"Apache-2.0"
] | 9 | 2021-08-04T06:41:49.000Z | 2022-01-10T10:10:52.000Z | tests/sagemaker/test_deployment.py | imrancharania/mlflow | 6e4b64bd3b7beadbdb243f6921d9ebedb10a1dbd | [
"Apache-2.0"
] | 1 | 2022-03-10T22:09:42.000Z | 2022-03-10T22:09:42.000Z | import os
import pytest
import time
from collections import namedtuple
from unittest import mock
import boto3
import botocore
import numpy as np
from click.testing import CliRunner
from sklearn.linear_model import LogisticRegression
import mlflow
import mlflow.pyfunc
import mlflow.sklearn
import mlflow.sagemaker as m... | 37.457364 | 100 | 0.733996 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.