hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79601ca9f998987730f0ea58ee61def23fdcf351 | 21,893 | py | Python | models/networks.py | lukeandshuo/IR2CVI_journal | 3a7c0a469269535cd7050d5461759f9f8b538697 | [
"BSD-3-Clause"
] | null | null | null | models/networks.py | lukeandshuo/IR2CVI_journal | 3a7c0a469269535cd7050d5461759f9f8b538697 | [
"BSD-3-Clause"
] | null | null | null | models/networks.py | lukeandshuo/IR2CVI_journal | 3a7c0a469269535cd7050d5461759f9f8b538697 | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.autograd import Variable
from torch.optim import lr_scheduler
import numpy as np
import matplotlib.pyplot as plt
from util.visualizer import util
import cv2
##########################################################################... | 39.95073 | 151 | 0.604988 |
79601cb0888f16288bfb769a6735fd975d4f491a | 11,615 | py | Python | vyper/old_codegen/types/types.py | alex-sumner/vyper | 79759c590b2e0c381c03f3fdb33c50cb87b296b9 | [
"Apache-2.0"
] | 1,347 | 2019-11-22T06:49:38.000Z | 2022-03-31T19:49:32.000Z | vyper/old_codegen/types/types.py | alex-sumner/vyper | 79759c590b2e0c381c03f3fdb33c50cb87b296b9 | [
"Apache-2.0"
] | 915 | 2019-11-21T05:48:16.000Z | 2022-03-31T23:51:03.000Z | vyper/old_codegen/types/types.py | alex-sumner/vyper | 79759c590b2e0c381c03f3fdb33c50cb87b296b9 | [
"Apache-2.0"
] | 262 | 2019-11-28T01:44:04.000Z | 2022-03-31T21:33:43.000Z | import abc
import copy
import warnings
from collections import OrderedDict
from typing import Any
from vyper import ast as vy_ast
from vyper.exceptions import CompilerPanic, InvalidType
from vyper.utils import BASE_TYPES, ceil32
# Data structure for a type
class NodeType(abc.ABC):
def __eq__(self, other: Any) ->... | 33.091168 | 99 | 0.615928 |
79601da7c934c93174d6c551722e45b3ed561465 | 2,363 | py | Python | grasshopper/ssh.py | kmarburger/livestock3d | 767e6bd1b7658357f720e112d550416cb7c45226 | [
"MIT"
] | 1 | 2021-03-05T16:46:30.000Z | 2021-03-05T16:46:30.000Z | grasshopper/ssh.py | kmarburger/livestock3d | 767e6bd1b7658357f720e112d550416cb7c45226 | [
"MIT"
] | 1 | 2018-06-22T11:40:15.000Z | 2018-06-27T16:35:45.000Z | grasshopper/ssh.py | kmarburger/livestock3d | 767e6bd1b7658357f720e112d550416cb7c45226 | [
"MIT"
] | 4 | 2018-03-29T19:41:01.000Z | 2019-12-06T14:06:46.000Z | __author__ = "Christian Kongsgaard"
__license__ = "MIT"
# -------------------------------------------------------------------------------------------------------------------- #
# Imports
# Module imports
import os
# Livestock imports
from livestock3d import templates
# Grasshopper imports
import scriptcontext as sc... | 28.817073 | 120 | 0.581041 |
79601dbc74298cea722fa404a0ac13e5cb634652 | 9,258 | py | Python | usort/tests/types.py | zsol/usort | 103b74b04ce62b5527ad284a126a1d4ecef4b77b | [
"MIT"
] | 79 | 2020-10-05T17:55:16.000Z | 2022-02-25T18:01:14.000Z | usort/tests/types.py | zsol/usort | 103b74b04ce62b5527ad284a126a1d4ecef4b77b | [
"MIT"
] | 62 | 2020-10-06T23:47:16.000Z | 2022-03-16T20:48:07.000Z | usort/tests/types.py | creativemindplus/usort | b0d2b8b9268ae9dbbec04da48e58d89bc68b38f4 | [
"MIT"
] | 8 | 2020-10-07T18:39:13.000Z | 2022-01-18T20:34:52.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from textwrap import dedent
from .. import types
class TypesTest(unittest.TestCase):
maxDiff = None
def test_impor... | 33.182796 | 143 | 0.416613 |
79601fd3f4d5273290a853342b112ba082af1a2e | 2,255 | py | Python | tianshou/policy/a2c.py | DZ9/tianshou | 04208e6cce722b7a2353d9a5f4d6f0fc05797d67 | [
"MIT"
] | 1 | 2020-04-01T04:47:39.000Z | 2020-04-01T04:47:39.000Z | tianshou/policy/a2c.py | TommeyChang/tianshou | 4f843d3f51789f488169131a5b5decba8bab2b31 | [
"MIT"
] | null | null | null | tianshou/policy/a2c.py | TommeyChang/tianshou | 4f843d3f51789f488169131a5b5decba8bab2b31 | [
"MIT"
] | 1 | 2022-01-23T10:52:48.000Z | 2022-01-23T10:52:48.000Z | import torch
from torch import nn
import torch.nn.functional as F
from tianshou.data import Batch
from tianshou.policy import PGPolicy
class A2CPolicy(PGPolicy):
"""docstring for A2CPolicy"""
def __init__(self, actor, critic, optim,
dist_fn=torch.distributions.Categorical,
... | 38.220339 | 77 | 0.556541 |
7960206dcc90a8b5f9c3019e8b83275afb0380f8 | 2,717 | py | Python | model/page.py | yveskaufmann/SearchEngine | 517b3ddb596234309fcc0a8c66851b8638100fa2 | [
"CC0-1.0"
] | 3 | 2015-08-07T09:00:46.000Z | 2020-11-26T10:14:19.000Z | model/page.py | yveskaufmann/SearchEngine | 517b3ddb596234309fcc0a8c66851b8638100fa2 | [
"CC0-1.0"
] | 1 | 2021-12-13T19:40:09.000Z | 2021-12-13T19:40:09.000Z | model/page.py | yveskaufmann/SearchEngine | 517b3ddb596234309fcc0a8c66851b8638100fa2 | [
"CC0-1.0"
] | 1 | 2015-05-27T08:02:24.000Z | 2015-05-27T08:02:24.000Z | import os
from collections import UserList
from utils.string import StringUtil
class Page:
def __init__(self):
self.title = ""
self.content = ""
self.url = ""
self.out_links = []
self.out_pages = Pages()
self.page_rank = 0.0
def __str__(self):
"""
... | 29.215054 | 82 | 0.597718 |
796024184a0b0f170076326bb3f581dfafdc0509 | 681 | py | Python | test/solution_tests/CHK/test_chk.py | DPNT-Sourcecode/CHK-qqid01 | 6eb9c98934ba74507166e3fee679d399edb11b0f | [
"Apache-2.0"
] | null | null | null | test/solution_tests/CHK/test_chk.py | DPNT-Sourcecode/CHK-qqid01 | 6eb9c98934ba74507166e3fee679d399edb11b0f | [
"Apache-2.0"
] | null | null | null | test/solution_tests/CHK/test_chk.py | DPNT-Sourcecode/CHK-qqid01 | 6eb9c98934ba74507166e3fee679d399edb11b0f | [
"Apache-2.0"
] | null | null | null | from solutions.CHK import checkout_solution
class TestChk():
def test_chk(self):
assert checkout_solution.checkout('AAAABBCD') == 260
def test_chk_promoEB(self):
assert checkout_solution.checkout('AAAABBCDEE') == 325
def test_chk_promo9A(self):
assert checkout_solution.checkout('... | 29.608696 | 81 | 0.725404 |
796024d4d1115aa13eadfdd213628cdaffa660fc | 890 | py | Python | aldryn_events/migrations/0027_auto_20211221_1255.py | KEXP/aldryn-events | 2f654729906ccb65e2bcba7b1c337c628ecf9980 | [
"BSD-3-Clause"
] | null | null | null | aldryn_events/migrations/0027_auto_20211221_1255.py | KEXP/aldryn-events | 2f654729906ccb65e2bcba7b1c337c628ecf9980 | [
"BSD-3-Clause"
] | null | null | null | aldryn_events/migrations/0027_auto_20211221_1255.py | KEXP/aldryn-events | 2f654729906ccb65e2bcba7b1c337c628ecf9980 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.2.10 on 2021-12-21 20:55
from django.db import migrations
import django.db.models.deletion
import parler.fields
class Migration(migrations.Migration):
dependencies = [
('aldryn_events', '0026_auto_20180112_1738'),
]
operations = [
migrations.AlterField(
... | 34.230769 | 189 | 0.685393 |
79602884ebc690d9b5f6340b9c06c5adea62a3a7 | 5,915 | py | Python | pybind/slxos/v16r_1_00b/routing_system/ip/dhcp/relay/information/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/routing_system/ip/dhcp/relay/information/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/routing_system/ip/dhcp/relay/information/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 45.852713 | 458 | 0.708369 |
796029aa32bd4185fe42fd4cb5fa36f7adf051fc | 150 | py | Python | overdub/threads.py | olemb/overdub | 04ff00cf71e041383c0b63d1b2024104f8364ab1 | [
"MIT"
] | 1 | 2021-03-23T00:16:06.000Z | 2021-03-23T00:16:06.000Z | overdub/threads.py | olemb/overdub | 04ff00cf71e041383c0b63d1b2024104f8364ab1 | [
"MIT"
] | null | null | null | overdub/threads.py | olemb/overdub | 04ff00cf71e041383c0b63d1b2024104f8364ab1 | [
"MIT"
] | 1 | 2022-03-10T20:33:04.000Z | 2022-03-10T20:33:04.000Z | import threading
def start_thread(func):
thread = threading.Thread(target=func)
thread.setDaemon(True)
thread.start()
return thread
| 16.666667 | 42 | 0.713333 |
796029fd5b596d12f0cf1737410976feac9883da | 2,103 | py | Python | src/card.py | Accelbread/Bolas | 33d6e250e41405eb0c6f2217d68f1fc082feacfe | [
"MIT"
] | null | null | null | src/card.py | Accelbread/Bolas | 33d6e250e41405eb0c6f2217d68f1fc082feacfe | [
"MIT"
] | null | null | null | src/card.py | Accelbread/Bolas | 33d6e250e41405eb0c6f2217d68f1fc082feacfe | [
"MIT"
] | null | null | null | class Card(dict):
"""
A wrapper around a Scryfall json card object.
It's just a dict with a custom __str__ method
"""
def __init__(self, *args, **kwargs):
# Superclass constructor
dict.__init__(self, *args, **kwargs)
# Setting up custom fields
if "image_uris" in sel... | 33.919355 | 76 | 0.470756 |
79602a567288ca67caa5462b43912f5c87ca93db | 25,769 | py | Python | experiments/audio_user_trials/ticker_user_trial.py | nbonaker/ticker | 4a9bab2916344914cbc96910c7eff4d9f0e10570 | [
"MIT"
] | null | null | null | experiments/audio_user_trials/ticker_user_trial.py | nbonaker/ticker | 4a9bab2916344914cbc96910c7eff4d9f0e10570 | [
"MIT"
] | 1 | 2018-11-06T09:30:23.000Z | 2018-11-06T09:30:23.000Z | experiments/audio_user_trials/ticker_user_trial.py | nbonaker/ticker | 4a9bab2916344914cbc96910c7eff4d9f0e10570 | [
"MIT"
] | 1 | 2019-01-23T14:46:11.000Z | 2019-01-23T14:46:11.000Z | #! /usr/bin/env python
from PyQt4 import QtCore, QtGui
import sys, os, copy
sys.path.append("../../")
from ticker import TickerGui
from utils import Utils
import numpy as np
import time, cPickle, shutil
from ticker_widgets import InstructionsDisplay
from synthetic_noise import SyntheticNoise
global user, session, su... | 46.767695 | 156 | 0.608289 |
79602a79a84bf4a92d46f2a363dfcb8a312cd496 | 539 | py | Python | webdev/produtos/migrations/0010_auto_20210527_1746.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | null | null | null | webdev/produtos/migrations/0010_auto_20210527_1746.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | 103 | 2021-04-25T21:28:11.000Z | 2022-03-15T01:36:31.000Z | webdev/produtos/migrations/0010_auto_20210527_1746.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-05-27 20:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('produtos', '0009_auto_20210524_1809'),
]
operations = [
migrations.AlterField(
model_name='materialdoproduto',
name=... | 28.368421 | 180 | 0.623377 |
79602a889963ccc508ba676cc10e94000b093a7d | 3,854 | py | Python | figures/admin.py | bvenkatr/figures | 8724cfac8d8bd3b60f1394eb5eda2fef282770c0 | [
"MIT"
] | null | null | null | figures/admin.py | bvenkatr/figures | 8724cfac8d8bd3b60f1394eb5eda2fef282770c0 | [
"MIT"
] | null | null | null | figures/admin.py | bvenkatr/figures | 8724cfac8d8bd3b60f1394eb5eda2fef282770c0 | [
"MIT"
] | null | null | null | """Provides access to Figures models in the admin dashboard
Filters are in this module because they are specific to the admin console
"""
from django.contrib import admin
from django.contrib.admin.filters import (
AllValuesFieldListFilter,
RelatedOnlyFieldListFilter)
from django.core.urlresolvers import rever... | 35.357798 | 81 | 0.677737 |
79602bb86bb9eb23a548fc11b47d1a12bac27612 | 8,837 | py | Python | moto/cloudtrail/models.py | akingscote/moto | 873375df16c71843ae74657db6a7bab8a4103eb0 | [
"Apache-2.0"
] | 12 | 2018-07-03T15:02:48.000Z | 2021-11-09T09:34:57.000Z | moto/cloudtrail/models.py | akingscote/moto | 873375df16c71843ae74657db6a7bab8a4103eb0 | [
"Apache-2.0"
] | 33 | 2019-08-30T14:36:03.000Z | 2022-02-04T10:23:49.000Z | moto/cloudtrail/models.py | akingscote/moto | 873375df16c71843ae74657db6a7bab8a4103eb0 | [
"Apache-2.0"
] | 26 | 2018-05-09T08:29:37.000Z | 2021-12-27T13:46:05.000Z | import re
import time
from boto3 import Session
from datetime import datetime
from moto.core import ACCOUNT_ID, BaseBackend, BaseModel
from moto.core.utils import iso_8601_datetime_without_milliseconds
from .exceptions import (
S3BucketDoesNotExistException,
InsufficientSnsTopicPolicyException,
TrailNameTo... | 32.134545 | 92 | 0.623967 |
79602bfd6d7ac44e3b8fd8c1cb2c83fe817d789f | 190 | py | Python | pysteel/scaffold/local.py | aTiKhan/Samples-1 | cbe2063ee0fa9e88bbb4ed7e83971a47e031b7cb | [
"Apache-2.0"
] | 643 | 2016-09-20T06:03:28.000Z | 2022-03-19T02:26:02.000Z | pysteel/scaffold/local.py | aTiKhan/Samples-1 | cbe2063ee0fa9e88bbb4ed7e83971a47e031b7cb | [
"Apache-2.0"
] | 195 | 2016-12-20T01:41:11.000Z | 2022-03-08T12:38:35.000Z | pysteel/scaffold/local.py | aTiKhan/Samples-1 | cbe2063ee0fa9e88bbb4ed7e83971a47e031b7cb | [
"Apache-2.0"
] | 269 | 2016-10-11T19:24:34.000Z | 2022-02-21T15:23:05.000Z |
def setup(context, scenario):
"""
set up scenario scaffolding for local samples
:type context: behave.runner.Context
:type scenario: behave.model.Scenario
"""
pass
| 19 | 49 | 0.668421 |
79602ecfb44ddec6ac348c37f05fddb7e238fe8e | 42 | py | Python | tests/components/huawei_lte/__init__.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/huawei_lte/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/huawei_lte/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Tests for the huawei_lte component."""
| 21 | 41 | 0.714286 |
796032763c247373149c04ed85afe8e1070246ad | 770 | py | Python | venv/bin/rst2html4.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/bin/rst2html4.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/bin/rst2html4.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/Home/ii/olafs/git/usegalaxy-no/infrastructure-playbook/venv/bin/python3
# $Id: rst2html4.py 7994 2016-12-10 17:41:45Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing (X)HTML.
The output... | 28.518519 | 78 | 0.749351 |
796032c2379436d985b455800bdb9eb5ee57b6d8 | 3,399 | py | Python | lib/client_index_test.py | ojengwa/grr | 4ce87003e0cd846cbd89627dd3c63b9f86027522 | [
"Apache-2.0"
] | 1 | 2016-02-13T15:40:20.000Z | 2016-02-13T15:40:20.000Z | lib/client_index_test.py | ojengwa/grr | 4ce87003e0cd846cbd89627dd3c63b9f86027522 | [
"Apache-2.0"
] | null | null | null | lib/client_index_test.py | ojengwa/grr | 4ce87003e0cd846cbd89627dd3c63b9f86027522 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Tests for grr.lib.client_index."""
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
from grr.lib import client_index
# pylint: enable=unused-import,g-bad-import-order
from grr.lib import aff4
from grr.lib import flags
from grr.lib import rdfvalue
from grr... | 33 | 72 | 0.593998 |
796032e798eae4fdd9a2719473b0438e2278ca94 | 5,565 | py | Python | tests/test_core.py | AIAScience/mflux-ai-python | 913ad04777e07c19cac447a9a96e11bc7288fafe | [
"Apache-2.0"
] | 2 | 2019-08-14T14:42:06.000Z | 2020-03-15T21:32:59.000Z | tests/test_core.py | AIAScience/mflux-ai-python | 913ad04777e07c19cac447a9a96e11bc7288fafe | [
"Apache-2.0"
] | 6 | 2019-08-14T11:37:53.000Z | 2020-01-13T11:36:20.000Z | tests/test_core.py | AIAScience/mflux-ai-python | 913ad04777e07c19cac447a9a96e11bc7288fafe | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the `mflux_ai` package."""
import os
import warnings
import responses
import mlflow
import mflux_ai
from mflux_ai.core import SERVER_HOST
@responses.activate
def test_mflux_ai_init():
"""Test the init function."""
content = {
"minio_secret... | 32.16763 | 92 | 0.557053 |
796033f565af2193e2bbc103baeb4f667f2aeda2 | 49,219 | py | Python | core/storage/base_model/gae_models.py | PLSV/oppia | 103a87975a5ce07ae92fdc75441c0b269f7e3dc0 | [
"Apache-2.0"
] | null | null | null | core/storage/base_model/gae_models.py | PLSV/oppia | 103a87975a5ce07ae92fdc75441c0b269f7e3dc0 | [
"Apache-2.0"
] | null | null | null | core/storage/base_model/gae_models.py | PLSV/oppia | 103a87975a5ce07ae92fdc75441c0b269f7e3dc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Oppia 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 applicable ... | 38.452344 | 94 | 0.638006 |
796034c53572e02db664470b81d3966cc0c43495 | 383 | py | Python | yatube/posts/migrations/0003_group_description.py | afivan20/yatube_project | f5683870edd9520d1608ae5e6b807cff6a7bf03f | [
"MIT"
] | null | null | null | yatube/posts/migrations/0003_group_description.py | afivan20/yatube_project | f5683870edd9520d1608ae5e6b807cff6a7bf03f | [
"MIT"
] | null | null | null | yatube/posts/migrations/0003_group_description.py | afivan20/yatube_project | f5683870edd9520d1608ae5e6b807cff6a7bf03f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.19 on 2021-08-14 01:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0002_auto_20210814_0053'),
]
operations = [
migrations.AddField(
model_name='group',
name='description',
... | 20.157895 | 48 | 0.5953 |
796034e39c644ee25f03f047fb15d191fa8dc6f0 | 4,078 | py | Python | Region.py | denoflionsx/OoT-Randomizer | 53e31ea89d7c9abc9ffc5e556e85b9960efec458 | [
"MIT"
] | 1 | 2022-02-07T15:07:10.000Z | 2022-02-07T15:07:10.000Z | Region.py | denoflionsx/OoT-Randomizer | 53e31ea89d7c9abc9ffc5e556e85b9960efec458 | [
"MIT"
] | 1 | 2022-02-14T14:32:53.000Z | 2022-02-14T14:37:03.000Z | Region.py | denoflionsx/OoT-Randomizer | 53e31ea89d7c9abc9ffc5e556e85b9960efec458 | [
"MIT"
] | null | null | null | from enum import Enum, unique
@unique
class RegionType(Enum):
Overworld = 1
Interior = 2
Dungeon = 3
Grotto = 4
@property
def is_indoors(self):
"""Shorthand for checking if Interior or Dungeon"""
return self in (RegionType.Interior, RegionType.Dungeon, RegionType.Grotto)
#... | 34.268908 | 108 | 0.654242 |
796034faf0a78e2b835926a712a4f0aa3cd85137 | 7,557 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20181101/get_azure_firewall.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20181101/get_azure_firewall.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20181101/get_azure_firewall.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.360406 | 237 | 0.672224 |
7960353efd0330de7de2ad15c5bb93d2d55d246a | 453 | py | Python | python/Fluoroseq/obsolete/common/channel_intensities.py | erisyon/whatprot | 176cd7e6ee99ea3f91794dcf1ec14f3578b7ee3c | [
"MIT"
] | null | null | null | python/Fluoroseq/obsolete/common/channel_intensities.py | erisyon/whatprot | 176cd7e6ee99ea3f91794dcf1ec14f3578b7ee3c | [
"MIT"
] | 1 | 2021-06-12T00:50:08.000Z | 2021-06-15T17:59:12.000Z | python/Fluoroseq/obsolete/common/channel_intensities.py | erisyon/whatprot | 176cd7e6ee99ea3f91794dcf1ec14f3578b7ee3c | [
"MIT"
] | 1 | 2021-06-11T19:34:43.000Z | 2021-06-11T19:34:43.000Z | # -*- coding: utf-8 -*-
"""
@author: Matthew B. Smith (UT Austin)
"""
class ChannelIntensities:
def __init__(self, intensities, src_dye_seq=None):
self.intensities = intensities
self.src_dye_seq = src_dye_seq
def class_index(self):
return self.src_dye_seq.dye_seq_id
d... | 23.842105 | 55 | 0.637969 |
7960358125ddaaa1ceb16b35f927bbb6d4b03154 | 1,561 | py | Python | fairing/architectures/kubeflow/distributed.py | wbuchwalter/fairing-1 | e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab | [
"Apache-2.0"
] | 21 | 2018-08-09T19:13:47.000Z | 2020-07-22T05:21:11.000Z | fairing/architectures/kubeflow/distributed.py | wbuchwalter/fairing-1 | e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab | [
"Apache-2.0"
] | 14 | 2018-08-02T18:44:09.000Z | 2018-11-08T15:32:55.000Z | fairing/architectures/kubeflow/distributed.py | wbuchwalter/fairing-1 | e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab | [
"Apache-2.0"
] | 4 | 2018-08-09T19:13:59.000Z | 2018-10-08T05:44:31.000Z | from fairing.architectures.kubeflow.basic import BasicArchitecture
from fairing.backend.kubeflow import KubeflowBackend
class DistributedTraining(BasicArchitecture):
def __init__(self, ps_count, worker_count):
self.ps_count = ps_count
self.worker_count = worker_count
def add_jobs(self, svc, c... | 31.22 | 70 | 0.391416 |
79603656522cde0a5468cc8389e6f034ed3af9a2 | 1,193 | py | Python | uniquify_fasta.py | alexherns/biotite-scripts | 22031b7a656b9d3893b7706d3d026ec0161c2b9d | [
"MIT"
] | 1 | 2015-08-13T22:15:55.000Z | 2015-08-13T22:15:55.000Z | uniquify_fasta.py | alexherns/biotite-scripts | 22031b7a656b9d3893b7706d3d026ec0161c2b9d | [
"MIT"
] | 1 | 2015-08-13T16:29:02.000Z | 2015-08-13T16:43:15.000Z | uniquify_fasta.py | alexherns/biotite-scripts | 22031b7a656b9d3893b7706d3d026ec0161c2b9d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import common_objects
import sys
def simplify_fasta(fhandle, fout = sys.stdout, save_pickle = False):
d = common_objects.uniquify_fasta_names(fhandle, output_handle = fout)
if save_pickle:
import cPickle
cPickle.dump(d, save_pickle)
if __name__ == '__main__':
import a... | 33.138889 | 84 | 0.592624 |
796037c5875444fe2ffcbb4751cfc65c80c926ad | 3,114 | py | Python | src/openscm_runner/settings.py | JGBroadbent/openscm-runner | 3fde3478f543a3a3263168988b12f0208d7181c1 | [
"BSD-3-Clause"
] | 4 | 2020-07-21T02:55:21.000Z | 2021-11-15T10:56:24.000Z | src/openscm_runner/settings.py | JGBroadbent/openscm-runner | 3fde3478f543a3a3263168988b12f0208d7181c1 | [
"BSD-3-Clause"
] | 42 | 2020-04-06T00:09:33.000Z | 2022-03-14T09:55:26.000Z | src/openscm_runner/settings.py | maritsandstad/openscm-runner | 03fe3977d85f840c2ca7990b84a0533c299a32d3 | [
"BSD-3-Clause"
] | 7 | 2020-04-06T00:03:50.000Z | 2021-03-31T10:12:21.000Z | """
Rather than hard-coding constants, configuration can be source from 2 different
sources:
* Environment variables
* dotenv files
Environment variables are always used in preference to the values in dotenv
files.
"""
import os
from dotenv import dotenv_values, find_dotenv
class ConfigLoader:
"""
Config... | 23.413534 | 82 | 0.578677 |
796037e43d5bbea6417ce5921b08b450ce2c66df | 33,573 | py | Python | hpomb_requirements/call.py | secanonm/HPomb | dc6e3eef3a3ac3f754279b5f93b8fb944b7eea28 | [
"MIT"
] | 96 | 2020-12-16T00:06:12.000Z | 2022-03-22T15:10:35.000Z | hpomb_requirements/call.py | secanonm/HPomb | dc6e3eef3a3ac3f754279b5f93b8fb944b7eea28 | [
"MIT"
] | 6 | 2020-12-25T03:48:47.000Z | 2021-02-27T07:52:27.000Z | hpomb_requirements/call.py | secanonm/HPomb | dc6e3eef3a3ac3f754279b5f93b8fb944b7eea28 | [
"MIT"
] | 44 | 2020-12-25T03:25:34.000Z | 2022-02-02T12:57:03.000Z | from pytransform import pyarmor_runtime
pyarmor_runtime()
__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\x03\x09\x00\x61\x0d\x0d\x0a\x06\x28\xa0\x01\x00\x00\x00\x00\x01\x00\x00\x00\x40\x00\x00\x00\x71\x20\x00\x00\x00\x00\x00\x18\x85\x68\xa8\xfa\x03\xb3\x95\xa6\xa0\x20\x8e\x8e\x98\xfc\x63\x8a\x00... | 11,191 | 33,515 | 0.750216 |
796038040398ff162ae05b5a2603706918da62b7 | 3,586 | py | Python | homework2/test_mic.py | quanganh1999/speech_processing_course | 26d7bf9adfa67c661256b73465e337ca9769b66b | [
"MIT"
] | 1 | 2020-04-03T10:01:41.000Z | 2020-04-03T10:01:41.000Z | homework2/test_mic.py | quanganh1999/speech_processing_course | 26d7bf9adfa67c661256b73465e337ca9769b66b | [
"MIT"
] | null | null | null | homework2/test_mic.py | quanganh1999/speech_processing_course | 26d7bf9adfa67c661256b73465e337ca9769b66b | [
"MIT"
] | null | null | null | import sounddevice as sd
import soundfile as sf
from pydub.playback import play
import os
from pydub import AudioSegment, silence
import keyboard # using module keyboard
import joblib
import hmmlearn.hmm as hmm
from sklearn.cluster import KMeans
import librosa
import math
import numpy as np
import time
#config
# Audi... | 38.55914 | 132 | 0.617959 |
7960383ee0b80e3784910b4ae55f06f94adeb3c1 | 1,091 | py | Python | src/rez/bind/arch.py | maxnbk/rez | 762c5cfce17eabde67eb5582498406eb3544daf0 | [
"Apache-2.0"
] | null | null | null | src/rez/bind/arch.py | maxnbk/rez | 762c5cfce17eabde67eb5582498406eb3544daf0 | [
"Apache-2.0"
] | null | null | null | src/rez/bind/arch.py | maxnbk/rez | 762c5cfce17eabde67eb5582498406eb3544daf0 | [
"Apache-2.0"
] | 1 | 2020-09-24T08:33:43.000Z | 2020-09-24T08:33:43.000Z | # Copyright Contributors to the Rez project
#
# 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 ... | 32.088235 | 74 | 0.767186 |
796038ddea612e41a909abd61ac586442e3f6ec3 | 123,003 | py | Python | kivy/uix/textinput.py | Gobbel2000/kivy | 422350301684cfc814fa8fb8c3637cefd825ec5f | [
"MIT"
] | null | null | null | kivy/uix/textinput.py | Gobbel2000/kivy | 422350301684cfc814fa8fb8c3637cefd825ec5f | [
"MIT"
] | null | null | null | kivy/uix/textinput.py | Gobbel2000/kivy | 422350301684cfc814fa8fb8c3637cefd825ec5f | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
Text Input
==========
.. versionadded:: 1.0.4
.. image:: images/textinput-mono.jpg
.. image:: images/textinput-multi.jpg
The :class:`TextInput` widget provides a box for editable plain text.
Unicode, multiline, cursor navigation, selection and clipboard features
are supported.
The :cl... | 35.850481 | 79 | 0.577246 |
79603a641e00363d22f41980425b028f6e99a7d0 | 1,950 | py | Python | graphgallery/functional/network/transform.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | 300 | 2020-08-09T04:27:41.000Z | 2022-03-30T07:43:41.000Z | graphgallery/functional/network/transform.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | 5 | 2020-11-05T06:16:50.000Z | 2021-12-11T05:05:22.000Z | graphgallery/functional/network/transform.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | 51 | 2020-09-23T15:37:12.000Z | 2022-03-05T01:28:56.000Z | import numpy as np
import networkx as nx
import scipy.sparse as sp
from .property import is_directed, is_weighted
from ..decorators import multiple
__all__ = ["from_networkx", "to_networkx", "to_directed",
"to_undirected", "to_unweighted"]
@multiple()
def from_networkx(G):
"""Convert a net... | 24.375 | 76 | 0.611795 |
79603a884f76d5d562fd64b5db6680f884dc72ca | 2,202 | py | Python | praticas-minicurso-ml-master/p3-avaliacao/metodo.py | GuiYago2015/curso-aprendizado-de-maquinas | ea787c3fbb27ebc1204caa9d2e20cdae6d46121c | [
"MIT"
] | null | null | null | praticas-minicurso-ml-master/p3-avaliacao/metodo.py | GuiYago2015/curso-aprendizado-de-maquinas | ea787c3fbb27ebc1204caa9d2e20cdae6d46121c | [
"MIT"
] | null | null | null | praticas-minicurso-ml-master/p3-avaliacao/metodo.py | GuiYago2015/curso-aprendizado-de-maquinas | ea787c3fbb27ebc1204caa9d2e20cdae6d46121c | [
"MIT"
] | null | null | null | from abc import abstractmethod
from resultado import Resultado
import pandas as pd
from sklearn.base import ClassifierMixin, RegressorMixin
from typing import List, Union
class MetodoAprendizadoDeMaquina:
@abstractmethod
def eval(
self,
df_treino: pd.DataFrame,
df_data_to_predict: pd.... | 32.382353 | 75 | 0.68347 |
79603ac29dbe265fa6ac591c36261c5a5e5720ba | 11,200 | py | Python | tests/schedules/test_schedules.py | concreted/prefect | dd732f5990ee2b0f3d816adb285168fd63b239e4 | [
"Apache-2.0"
] | 8,633 | 2019-03-23T17:51:03.000Z | 2022-03-31T22:17:42.000Z | tests/schedules/test_schedules.py | concreted/prefect | dd732f5990ee2b0f3d816adb285168fd63b239e4 | [
"Apache-2.0"
] | 3,903 | 2019-03-23T19:11:21.000Z | 2022-03-31T23:21:23.000Z | tests/schedules/test_schedules.py | ngriffiths13/prefect | 7f5613abcb182494b7dc12159277c3bc5f3c9898 | [
"Apache-2.0"
] | 937 | 2019-03-23T18:49:44.000Z | 2022-03-31T21:45:13.000Z | import itertools
from datetime import time, timedelta
import pendulum
import pytest
from prefect import __version__
from prefect.schedules import adjustments, clocks, filters, schedules
def test_create_schedule_requires_clock():
with pytest.raises(TypeError):
schedules.Schedule()
def test_create_sched... | 31.549296 | 92 | 0.614196 |
79603b3a86b4dc2c03fa428c6f750a2f67f60f02 | 3,798 | py | Python | etc/conda/python-scons/scons-3.0.0.alpha.20170821/engine/SCons/Scanner/Dir.py | MShaffar19/toolchain-tools | e4ab3c8d7b1b0633ab08d99b079d4fa678218f8a | [
"Apache-2.0"
] | null | null | null | etc/conda/python-scons/scons-3.0.0.alpha.20170821/engine/SCons/Scanner/Dir.py | MShaffar19/toolchain-tools | e4ab3c8d7b1b0633ab08d99b079d4fa678218f8a | [
"Apache-2.0"
] | 2 | 2018-12-18T16:18:31.000Z | 2019-02-20T10:29:21.000Z | etc/conda/python-scons/scons-3.0.0.alpha.20170821/engine/SCons/Scanner/Dir.py | StatisKit/toolchain-tools | e4ab3c8d7b1b0633ab08d99b079d4fa678218f8a | [
"Apache-2.0"
] | 3 | 2019-04-11T14:03:34.000Z | 2021-03-15T18:19:08.000Z | #
# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge... | 34.527273 | 103 | 0.694576 |
79603b776a3836b150a6de169a57d1dcdf62a2f4 | 2,527 | py | Python | student_code/main.py | alasin/vqa_pytorch | 8a311226d8eea56ef79f6be3c864ec05768e2895 | [
"MIT"
] | 1 | 2019-05-24T00:31:50.000Z | 2019-05-24T00:31:50.000Z | student_code/main.py | alasin/vqa_pytorch | 8a311226d8eea56ef79f6be3c864ec05768e2895 | [
"MIT"
] | null | null | null | student_code/main.py | alasin/vqa_pytorch | 8a311226d8eea56ef79f6be3c864ec05768e2895 | [
"MIT"
] | 1 | 2021-12-19T02:18:22.000Z | 2021-12-19T02:18:22.000Z | import argparse
from student_code.simple_baseline_experiment_runner import SimpleBaselineExperimentRunner
from student_code.coattention_experiment_runner import CoattentionNetExperimentRunner
if __name__ == "__main__":
# Feel free to add more args, or change/remove these.
parser = argparse.ArgumentParser(desc... | 57.431818 | 101 | 0.623269 |
79603b8a023907543b6311dde415ffa93c19aaee | 3,493 | py | Python | rest_example/people.py | ewae121/rest_example | e4462d2d1aea568dd049f22de742fdbc90d2059f | [
"MIT"
] | null | null | null | rest_example/people.py | ewae121/rest_example | e4462d2d1aea568dd049f22de742fdbc90d2059f | [
"MIT"
] | null | null | null | rest_example/people.py | ewae121/rest_example | e4462d2d1aea568dd049f22de742fdbc90d2059f | [
"MIT"
] | 1 | 2020-09-27T14:40:53.000Z | 2020-09-27T14:40:53.000Z | """
This is the people module and supports all the ReST actions for the
PEOPLE collection
"""
# System modules
from datetime import datetime
# 3rd party modules
from flask import make_response, abort
def get_timestamp():
return datetime.now().strftime(("%Y-%m-%d %H:%M:%S"))
# Data to serve with our API
PEOPLE... | 25.683824 | 79 | 0.59834 |
79603ba2936184189e67df4f853188242bdf8f80 | 32,676 | py | Python | scripts/Rotation/lambda_mp_GM.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | scripts/Rotation/lambda_mp_GM.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | scripts/Rotation/lambda_mp_GM.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | """
MODIFICATIONS
2015.12.03
final_gal is removed as non-main-progenitors are also analized,
there is no 1:1 correlation between final galaxies and earlier galaxies.
2015.12.21
Galaxies are saved in HDF format at selected nouts.
(for example,
nouts_d... | 37.174061 | 127 | 0.55325 |
79603bab5f446fa80b75986e26e031e5dc00c1e1 | 774 | py | Python | models.py | Apply4Techology/script-basher | 38613537c1fbf28abb929a2eabcd945f00883fbd | [
"MIT"
] | null | null | null | models.py | Apply4Techology/script-basher | 38613537c1fbf28abb929a2eabcd945f00883fbd | [
"MIT"
] | 1 | 2018-06-06T17:34:02.000Z | 2018-06-06T17:34:02.000Z | models.py | Apply4Techology/script-basher | 38613537c1fbf28abb929a2eabcd945f00883fbd | [
"MIT"
] | 1 | 2017-12-13T10:30:50.000Z | 2017-12-13T10:30:50.000Z | import textract
import re
class Scene:
characters = []
location = ""
number = 0
time = ""
length = 0
class Script:
def document_reader(self, file):
'''Uses textract to read and return the text of files, split them into different lines and return the whole thing\
as a list object'''
... | 20.918919 | 122 | 0.589147 |
79603c2c23e620ea8e96f9b19c22d38f506ca1dc | 851 | py | Python | sandbox/lib/jumpscale/Jumpscale/clients/gedis/GedisClientFactory.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | sandbox/lib/jumpscale/Jumpscale/clients/gedis/GedisClientFactory.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | sandbox/lib/jumpscale/Jumpscale/clients/gedis/GedisClientFactory.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | from Jumpscale import j
from .GedisClient import GedisClient
JSConfigBase = j.baseclasses.object_config_collection
class GedisClientCmds:
def __init__(self, client):
self._client = client
self.__dict__.update(client.cmds.__dict__)
def __str__(self):
output = "Gedis Client: (instance... | 28.366667 | 93 | 0.658049 |
79603c58ed241a55ab344608b6163954e21b085e | 893 | py | Python | tool/utils.py | cpbscholten/karonte | b989f7dfe9dbe002dd0dc4c4e5b0293dde61ae72 | [
"BSD-2-Clause"
] | 294 | 2019-11-14T13:14:55.000Z | 2022-03-22T08:28:56.000Z | tool/utils.py | cpbscholten/karonte | b989f7dfe9dbe002dd0dc4c4e5b0293dde61ae72 | [
"BSD-2-Clause"
] | 17 | 2019-12-23T09:32:00.000Z | 2022-03-17T20:00:13.000Z | tool/utils.py | cpbscholten/karonte | b989f7dfe9dbe002dd0dc4c4e5b0293dde61ae72 | [
"BSD-2-Clause"
] | 50 | 2019-11-25T02:27:04.000Z | 2021-12-10T04:46:26.000Z | import os
from random import randint
from libraries.extractor.extractor import Extractor
MAX_THREADS = 3
N_TYPE_DATA_KEYS = 4
DEFAULT_LOG_PATH = "/tmp/Karonte.txt_" + str(randint(1, 100))
DEFAULT_PICKLE_DIR = "/tmp/pickles"
FW_TMP_DIR = '/tmp/fw/'
def unpack_firmware(fw_path, out_dir):
"""
Unpacks the firm... | 25.514286 | 83 | 0.704367 |
79603d59699480530ac465a0f8c3d8dfc6285555 | 5,599 | py | Python | alphacsc/tests/test_update_z_multi.py | dinalzein/alphacsc | dab672c4da54ed1b89f2364f552cf9b0707fcaeb | [
"BSD-3-Clause"
] | null | null | null | alphacsc/tests/test_update_z_multi.py | dinalzein/alphacsc | dab672c4da54ed1b89f2364f552cf9b0707fcaeb | [
"BSD-3-Clause"
] | null | null | null | alphacsc/tests/test_update_z_multi.py | dinalzein/alphacsc | dab672c4da54ed1b89f2364f552cf9b0707fcaeb | [
"BSD-3-Clause"
] | null | null | null | import pytest
import numpy as np
from alphacsc.update_z_multi import update_z_multi
from alphacsc.update_z_multi import compute_DtD, _coordinate_descent_idx
from alphacsc.loss_and_gradient import compute_X_and_objective_multi
from alphacsc.utils import construct_X_multi
from alphacsc.utils.compute_constants import co... | 39.992857 | 79 | 0.595999 |
79603dbc50d948a00682483beca4b492664e0e06 | 776 | py | Python | app/users/form.py | woduq1414/school-meal-react | e4b4f39ddc41db63ec974ed75dd051b5805bc5bf | [
"MIT"
] | 1 | 2020-09-15T00:48:04.000Z | 2020-09-15T00:48:04.000Z | app/users/form.py | woduq1414/school-meal-react | e4b4f39ddc41db63ec974ed75dd051b5805bc5bf | [
"MIT"
] | 3 | 2021-05-11T06:53:07.000Z | 2022-02-27T01:18:12.000Z | app/users/form.py | woduq1414/school-meal-react | e4b4f39ddc41db63ec974ed75dd051b5805bc5bf | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import *
class RegisterForm(FlaskForm):
id = StringField('아이디',
[validators.InputRequired(), validators.Regexp(regex='^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,15}$')],
description="영문/숫자 섞어서 6~15자")
password = PasswordField('비밀번... | 43.111111 | 119 | 0.536082 |
79603e923549aa7bd97b4d1f65a71f4669263d15 | 854 | py | Python | tests/test_validate_logreg.py | TihonkovSergey/pd-model-logreg | baa6447198f5f89a43b1091413d3199192230ce1 | [
"Apache-2.0"
] | null | null | null | tests/test_validate_logreg.py | TihonkovSergey/pd-model-logreg | baa6447198f5f89a43b1091413d3199192230ce1 | [
"Apache-2.0"
] | null | null | null | tests/test_validate_logreg.py | TihonkovSergey/pd-model-logreg | baa6447198f5f89a43b1091413d3199192230ce1 | [
"Apache-2.0"
] | null | null | null | import pytest
import numpy as np
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from src.models.parameter_selection import validate_logreg
class TestThreshold:
@pytest.mark.parametrize("seed",
[np.random.randint(0, 100) for _ in rang... | 35.583333 | 99 | 0.660422 |
79603eb12e582f01a2b9cca1575f159170ce4212 | 4,468 | py | Python | app/models.py | KaranjaK/Pitch-Ideas | 6444f0e2eed835af05f4c314179b09c294513a66 | [
"MIT",
"Unlicense"
] | null | null | null | app/models.py | KaranjaK/Pitch-Ideas | 6444f0e2eed835af05f4c314179b09c294513a66 | [
"MIT",
"Unlicense"
] | null | null | null | app/models.py | KaranjaK/Pitch-Ideas | 6444f0e2eed835af05f4c314179b09c294513a66 | [
"MIT",
"Unlicense"
] | null | null | null | from . import db, login_manager
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import UserMixin, current_user
from datetime import datetime
@login_manager.user_loader
def load_user(user_id):
return Users.query.get(int(user_id))
class Users(UserMixin,db.Model):
__tabl... | 31.914286 | 81 | 0.671218 |
79603f9aec22e9ade550f5caa16b58d337389a58 | 2,355 | py | Python | python3/koans/about_asserts.py | Jgoodz/python_koans | 5669fb398f18a7e645938c51c03f03147695da83 | [
"MIT"
] | null | null | null | python3/koans/about_asserts.py | Jgoodz/python_koans | 5669fb398f18a7e645938c51c03f03147695da83 | [
"MIT"
] | null | null | null | python3/koans/about_asserts.py | Jgoodz/python_koans | 5669fb398f18a7e645938c51c03f03147695da83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutAsserts(Koan):
def test_assert_truth(self):
"""
We shall contemplate truth by testing reality, via asserts.
"""
# Confused? This video should help:
#
# http://bit.ly... | 29.810127 | 84 | 0.580892 |
79604113c55b0f275a261f113429bda44a03d096 | 27,359 | py | Python | deepclaw/modules/end2end/yolov5/train.py | 1079931505/ME336-Yellow-Team-SUSTech | f4e5391d7be3f7983692457d30c2bdc697dcb76d | [
"MIT"
] | 2 | 2021-12-01T15:32:33.000Z | 2021-12-28T05:44:45.000Z | deepclaw/modules/end2end/yolov5/train.py | silvery107/ME336-Yellow-Team-Project | f4e5391d7be3f7983692457d30c2bdc697dcb76d | [
"MIT"
] | null | null | null | deepclaw/modules/end2end/yolov5/train.py | silvery107/ME336-Yellow-Team-Project | f4e5391d7be3f7983692457d30c2bdc697dcb76d | [
"MIT"
] | 2 | 2021-03-26T01:57:21.000Z | 2021-03-27T07:18:47.000Z | import argparse
import math
import os
import random
import time
import logging
from pathlib import Path
import numpy as np
import torch.distributed as dist
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torch.utils.data
import yaml
from torch.cuda imp... | 51.138318 | 120 | 0.573413 |
79604166248469c00bb9c22e47cf0e2256abc6b5 | 1,917 | py | Python | Moving-to-Melbourne---Housing-Again!-/code.py | kadc87/ga-learner-dsmp-repo | d943fcca546a0463744fe8d076aec9c5e5d408c4 | [
"MIT"
] | null | null | null | Moving-to-Melbourne---Housing-Again!-/code.py | kadc87/ga-learner-dsmp-repo | d943fcca546a0463744fe8d076aec9c5e5d408c4 | [
"MIT"
] | null | null | null | Moving-to-Melbourne---Housing-Again!-/code.py | kadc87/ga-learner-dsmp-repo | d943fcca546a0463744fe8d076aec9c5e5d408c4 | [
"MIT"
] | null | null | null | # --------------
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
# path- variable storing file path
#Code starts here
df = pd.read_csv(path)
df.head(5)
X = df.loc[:, df.columns != 'Price']
y = df.loc[:, 'Price']
X_train, X_test, y_train, y_test = train_... | 18.432692 | 93 | 0.679186 |
7960416c8570e60c94b22155b7f395527d285bbd | 16,341 | py | Python | src/messenger.py | yhfmstr/hello01 | 107c2afd43de1ccfb2005c02d2b9b7aee2cdeb1e | [
"MIT"
] | null | null | null | src/messenger.py | yhfmstr/hello01 | 107c2afd43de1ccfb2005c02d2b9b7aee2cdeb1e | [
"MIT"
] | 4 | 2020-03-24T15:34:23.000Z | 2021-02-02T21:41:39.000Z | src/messenger.py | yhfmstr/hello01 | 107c2afd43de1ccfb2005c02d2b9b7aee2cdeb1e | [
"MIT"
] | null | null | null | import smtplib
import time
from slackclient import SlackClient
from termcolor import cprint
from math import floor, ceil
try:
import winsound
except ImportError:
winsound = None
class Messenger(object):
"""
Used for handling messaging functionality
"""
def __init__(self, secrets, settings):
... | 37.73903 | 116 | 0.590723 |
7960418642ed644bd7c56970ad59bd9ff8cce747 | 502 | py | Python | python/resistor-color/resistor_color.py | heymajor/exercism | 5cbe035abfdcd420e4b74ed24d7cb4d9fc38ddfd | [
"MIT"
] | null | null | null | python/resistor-color/resistor_color.py | heymajor/exercism | 5cbe035abfdcd420e4b74ed24d7cb4d9fc38ddfd | [
"MIT"
] | null | null | null | python/resistor-color/resistor_color.py | heymajor/exercism | 5cbe035abfdcd420e4b74ed24d7cb4d9fc38ddfd | [
"MIT"
] | null | null | null | def color_code(col):
colors = ["black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey", "white"]
for color in colors:
if col == color:
return colors.index(color)
def colors():
return ["black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey"... | 29.529412 | 103 | 0.549801 |
796041d5b467fc04b55cd7b29efbdc57ec224612 | 8,698 | py | Python | poethepoet/task/args.py | Parnassius/poethepoet | 997cbe7121b0f31756e0217ebfe1de7c5c60687f | [
"MIT"
] | 446 | 2020-06-06T09:04:42.000Z | 2022-03-30T18:31:42.000Z | poethepoet/task/args.py | Parnassius/poethepoet | 997cbe7121b0f31756e0217ebfe1de7c5c60687f | [
"MIT"
] | 52 | 2020-06-23T20:23:42.000Z | 2022-03-31T20:49:04.000Z | poethepoet/task/args.py | Parnassius/poethepoet | 997cbe7121b0f31756e0217ebfe1de7c5c60687f | [
"MIT"
] | 20 | 2020-06-23T22:04:42.000Z | 2022-02-17T16:41:59.000Z | import argparse
from typing import (
Any,
Dict,
List,
Optional,
Sequence,
Set,
Tuple,
Type,
Union,
TYPE_CHECKING,
)
if TYPE_CHECKING:
from ..config import PoeConfig
ArgParams = Dict[str, Any]
ArgsDef = Union[List[str], List[ArgParams], Dict[str, ArgParams]]
arg_param_schem... | 35.357724 | 91 | 0.521729 |
796041dca1b1129979443c3e066b40a81e9fc4ec | 1,790 | py | Python | digit_classification.py | jaysarva/Automatic-License-Plate-Search | ccf008a06a7c89e53017079e5f60bba2f336a004 | [
"MIT"
] | null | null | null | digit_classification.py | jaysarva/Automatic-License-Plate-Search | ccf008a06a7c89e53017079e5f60bba2f336a004 | [
"MIT"
] | 1 | 2021-11-27T23:30:14.000Z | 2021-11-27T23:30:14.000Z | digit_classification.py | jaysarva/Automatic-License-Plate-Search | ccf008a06a7c89e53017079e5f60bba2f336a004 | [
"MIT"
] | 1 | 2021-11-27T23:14:49.000Z | 2021-11-27T23:14:49.000Z | import numpy as np
import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Conv2DTranspose, Reshape, LeakyReLU, BatchNormalization
from tensorflow.math import log
## generator
class DigitClassifier(tf.keras.Model):
def __init__(self):
super(DigitCl... | 38.913043 | 106 | 0.632402 |
7960429df959af8b3c2b0eb02f9e0a51341045f5 | 48,627 | py | Python | io_scene_fbx/fbx_utils.py | deranjer/blender-fbx-export-materials | 42361b7f73ba561cb6adbe012aaed2b8814dbcc1 | [
"MIT"
] | 3 | 2018-03-23T06:51:42.000Z | 2019-06-03T17:27:20.000Z | io_scene_fbx/fbx_utils.py | deranjer/blender-fbx-export-materials | 42361b7f73ba561cb6adbe012aaed2b8814dbcc1 | [
"MIT"
] | null | null | null | io_scene_fbx/fbx_utils.py | deranjer/blender-fbx-export-materials | 42361b7f73ba561cb6adbe012aaed2b8814dbcc1 | [
"MIT"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 39.469968 | 119 | 0.63037 |
79604325700622cd23f375f5bd7ab8ca83645d4e | 810 | py | Python | code/Ex04.py | mariolpantunes/ml-deti | a47fdb5df70e3f6fda5768be14f97462dfe057fb | [
"MIT"
] | 8 | 2016-04-25T22:36:35.000Z | 2016-10-29T16:47:34.000Z | code/Ex04.py | mariolpantunes/ml-deti | a47fdb5df70e3f6fda5768be14f97462dfe057fb | [
"MIT"
] | null | null | null | code/Ex04.py | mariolpantunes/ml-deti | a47fdb5df70e3f6fda5768be14f97462dfe057fb | [
"MIT"
] | null | null | null | import numpy as np
import arff
import matplotlib.pyplot as plt
from sklearn import linear_model
dataset = arff.load(open('dataset/dataset02.arff', 'r'))
data = np.array(dataset['data'])
X = data[:, :2]
Y = data[:, 2]
h = .02
model = linear_model.LogisticRegression(C=1e5)
model.fit(X, Y)
x_min, x_max = X[:, 0].min(... | 23.823529 | 76 | 0.630864 |
79604331756b2f8e651ac5574623125533f7f48f | 770 | py | Python | conftest.py | ywb-python/pytest_project | 4becbc35f362b2a0b1e67b5e2530b7ea507f8e62 | [
"Unlicense"
] | null | null | null | conftest.py | ywb-python/pytest_project | 4becbc35f362b2a0b1e67b5e2530b7ea507f8e62 | [
"Unlicense"
] | null | null | null | conftest.py | ywb-python/pytest_project | 4becbc35f362b2a0b1e67b5e2530b7ea507f8e62 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/12/6 23:28
# @Author : ywb
# @Site :
# @File : conftest.py
# @Software: PyCharm
import pytest
def read_yaml():
# return ['林黛玉', '鲁智深', '诸葛亮']
return [{"红楼梦": '林黛玉'}, {"水浒传": '鲁智深'}, {"三国演义": '诸葛亮'}]
@pytest.fixture(scope='function', aut... | 22 | 103 | 0.609091 |
796046fa30a524fe8c7ce7bcbde12ac9e5e76ba0 | 4,366 | py | Python | im2txt/test_inference_in_graph_model.py | wangheda/ImageCaption-UnderFitting | ca98807d3a35a40a35446678d7e7b43242767a63 | [
"Apache-2.0"
] | 8 | 2018-05-08T12:29:56.000Z | 2021-04-07T03:11:32.000Z | im2txt/test_inference_in_graph_model.py | wangheda/ImageCaption-UnderFitting | ca98807d3a35a40a35446678d7e7b43242767a63 | [
"Apache-2.0"
] | null | null | null | im2txt/test_inference_in_graph_model.py | wangheda/ImageCaption-UnderFitting | ca98807d3a35a40a35446678d7e7b43242767a63 | [
"Apache-2.0"
] | 4 | 2017-12-22T02:10:38.000Z | 2021-04-07T03:12:24.000Z | # Copyright 2016 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... | 34.650794 | 94 | 0.680257 |
796049212fbdff87708d79cddb61350a0cd12d67 | 292 | py | Python | polling_stations/apps/pollingstations/filters.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 29 | 2015-03-10T08:41:34.000Z | 2022-01-12T08:51:38.000Z | polling_stations/apps/pollingstations/filters.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 4,112 | 2015-04-01T21:27:38.000Z | 2022-03-31T19:22:11.000Z | polling_stations/apps/pollingstations/filters.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 31 | 2015-03-18T14:52:50.000Z | 2022-02-24T10:31:07.000Z | import logging
class StatusCheckFilter(logging.Filter):
def filter(self, record):
if (
record.status_code == 503
and hasattr(record, "request")
and "status_check" in record.request.path
):
return False
return True
| 22.461538 | 53 | 0.571918 |
7960496f1aca3de6c4ee8e4c06e3671dcfbcf364 | 529 | py | Python | uplus/xpay/exception.py | MyMusicTaste/django-oscar-uplus | 4f77bc9f526a0bdd8507efb82a09448fd9d77a3f | [
"BSD-2-Clause"
] | null | null | null | uplus/xpay/exception.py | MyMusicTaste/django-oscar-uplus | 4f77bc9f526a0bdd8507efb82a09448fd9d77a3f | [
"BSD-2-Clause"
] | null | null | null | uplus/xpay/exception.py | MyMusicTaste/django-oscar-uplus | 4f77bc9f526a0bdd8507efb82a09448fd9d77a3f | [
"BSD-2-Clause"
] | 1 | 2019-09-02T04:20:45.000Z | 2019-09-02T04:20:45.000Z | __author__ = 'nujabes8'
LGD_ERR_NO_HOME_DIR = 10001
LGD_ERR_NO_MALL_CONFIG = 10002
LGD_ERR_NO_LGDACOM_CONFIG = 10003
LGD_ERR_NO_MID = 10004
LGD_ERR_OUT_OF_MEMORY = 10005
LGD_ERR_HTTP_URL = 20001
LGD_ERR_RESOLVE_HOST = 20002
LGD_ERR_RESOLVE_PROXY = 20003
LGD_ERR_CONNECT = 20004
LGD_ERR_WRITE = 20005
LGD... | 21.16 | 34 | 0.79206 |
7960497a5a3145419f20d03402839c63458ad2e6 | 20,029 | py | Python | src/airobot/arm/ur5e_real.py | weiqiao/airobot | 5f9c6f239a16f31f8923131e144b360f71a89a93 | [
"MIT"
] | null | null | null | src/airobot/arm/ur5e_real.py | weiqiao/airobot | 5f9c6f239a16f31f8923131e144b360f71a89a93 | [
"MIT"
] | null | null | null | src/airobot/arm/ur5e_real.py | weiqiao/airobot | 5f9c6f239a16f31f8923131e144b360f71a89a93 | [
"MIT"
] | null | null | null | """
A UR5e robot arm
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import numbers
import time
import airobot as ar
import airobot.utils.common as arutil
import numpy as np
import rospy
from airobot.arm.single_arm_ros import SingleArmROS
fr... | 39.195695 | 79 | 0.535673 |
79604a69643ed6f332ae73a7e3417088eeac286d | 3,676 | py | Python | python 2/koans/about_iteration.py | fifteen3/python_koans | 0042d792ebc691db3023c576f52efaa28bf4a3bb | [
"MIT"
] | 3 | 2015-03-17T17:26:58.000Z | 2016-11-27T05:08:41.000Z | python 2/koans/about_iteration.py | fifteen3/python_koans | 0042d792ebc691db3023c576f52efaa28bf4a3bb | [
"MIT"
] | null | null | null | python 2/koans/about_iteration.py | fifteen3/python_koans | 0042d792ebc691db3023c576f52efaa28bf4a3bb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutIteration(Koan):
def test_iterators_are_a_type(self):
it = iter(range(1, 6))
fib = 0
for num in it:
fib += num
self.assertEqual(__, fib)
def test_ite... | 29.408 | 79 | 0.504353 |
79604b2a7f8879798a165ddf5b6ee2da53c61777 | 1,796 | py | Python | tools/notebook_output_template.py | detrout/debian-statsmodels | 7fc33adbcbc440cc2f0cbfa621ee51a8553e7e86 | [
"BSD-3-Clause"
] | 1 | 2016-09-02T20:31:32.000Z | 2016-09-02T20:31:32.000Z | tools/notebook_output_template.py | kevindavenport/statsmodels | c8e980da57cb9d5be64872ad5e13893e6ae7cd0d | [
"BSD-3-Clause"
] | null | null | null | tools/notebook_output_template.py | kevindavenport/statsmodels | c8e980da57cb9d5be64872ad5e13893e6ae7cd0d | [
"BSD-3-Clause"
] | 1 | 2021-05-02T10:50:15.000Z | 2021-05-02T10:50:15.000Z | from string import Template
notebook_template = Template("""
.. _${name}_notebook:
`Link to Notebook GitHub <https://github.com/statsmodels/statsmodels/blob/master/examples/notebooks/$name.ipynb>`_
.. raw:: html
$body
<script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML... | 36.653061 | 130 | 0.568486 |
79604c055d67fc0e41ad88952e0de0d0cfbcfc84 | 61,652 | py | Python | modules/s3/s3navigation.py | vpccalderara/sahana | 6eb3f9798879dfa51bbe5d2b84829b1402671499 | [
"MIT"
] | 1 | 2021-06-14T22:26:41.000Z | 2021-06-14T22:26:41.000Z | modules/s3/s3navigation.py | vpccalderara/sahana | 6eb3f9798879dfa51bbe5d2b84829b1402671499 | [
"MIT"
] | null | null | null | modules/s3/s3navigation.py | vpccalderara/sahana | 6eb3f9798879dfa51bbe5d2b84829b1402671499 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" S3 Navigation Module
@copyright: 2011-2017 (c) Sahana Software Foundation
@license: MIT
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
... | 32.671966 | 79 | 0.468452 |
79604c7c2e7c81ae88b17351af08397d12aad59e | 5,287 | py | Python | tracker/covid_tracker/views/political_affiliation.py | mcdomx/marks-covid-tracker | df4cf1ba201e52d401f48c246f5f3a1b3de64752 | [
"MIT"
] | 1 | 2020-08-07T18:19:03.000Z | 2020-08-07T18:19:03.000Z | tracker/covid_tracker/views/political_affiliation.py | mcdomx/marks-covid-tracker | df4cf1ba201e52d401f48c246f5f3a1b3de64752 | [
"MIT"
] | 11 | 2021-06-09T17:46:15.000Z | 2022-03-12T00:58:34.000Z | tracker/covid_tracker/views/political_affiliation.py | mcdomx/marks-covid-tracker | df4cf1ba201e52d401f48c246f5f3a1b3de64752 | [
"MIT"
] | null | null | null |
from bokeh.embed import json_item
from bokeh.plotting import figure
from bokeh.models import FactorRange, ColumnDataSource, HoverTool, NumeralTickFormatter
from django.http import JsonResponse
from .helpers import *
def _get_plot_data(_data_type):
if _data_type == 'infections':
df_dict = get_dataframe... | 45.973913 | 218 | 0.662379 |
79604c7f14aa6b4c1bdc01aacd77b93dbd500a90 | 2,070 | py | Python | profiles_api/models.py | janak029/profiles-rest-api | 8250f766ae1676ab9b067b7016099ad0131d26ef | [
"MIT"
] | null | null | null | profiles_api/models.py | janak029/profiles-rest-api | 8250f766ae1676ab9b067b7016099ad0131d26ef | [
"MIT"
] | null | null | null | profiles_api/models.py | janak029/profiles-rest-api | 8250f766ae1676ab9b067b7016099ad0131d26ef | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def c... | 28.75 | 63 | 0.67971 |
79604df7039bfca7cbfd764feae9fae41c26a46c | 3,464 | py | Python | tf_euler/python/aggregators.py | chengenbao/euler | aeeb822ee78bfbade3f7c9351233bd280ee37995 | [
"Apache-2.0"
] | 1 | 2019-03-13T07:18:47.000Z | 2019-03-13T07:18:47.000Z | tf_euler/python/aggregators.py | DingXiye/euler | c45225119c5b991ca953174f06c2f223562f34c9 | [
"Apache-2.0"
] | null | null | null | tf_euler/python/aggregators.py | DingXiye/euler | c45225119c5b991ca953174f06c2f223562f34c9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Alibaba Group Holding Limited. 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 ... | 30.385965 | 80 | 0.714781 |
79604e8d460ae96032a87d31d494f2d74aa029da | 132 | py | Python | cbpapp/settings_staging.py | CrossBorderPatrol/cbpapp | 249b3adf5fc9670efc53080107835d5be7bb9c60 | [
"Unlicense"
] | 1 | 2018-06-07T05:36:15.000Z | 2018-06-07T05:36:15.000Z | cbpapp/settings_staging.py | CrossBorderPatrol/cbpapp | 249b3adf5fc9670efc53080107835d5be7bb9c60 | [
"Unlicense"
] | 8 | 2018-06-06T01:38:11.000Z | 2021-06-10T17:36:35.000Z | cbpapp/settings_staging.py | CrossBorderPatrol/cbpapp | 249b3adf5fc9670efc53080107835d5be7bb9c60 | [
"Unlicense"
] | null | null | null | import os
from cbpapp.settings_production import *
DEBUG = bool(int(os.getenv('DEBUG', '0')))
ALLOWED_HOSTS = ['.herokuapp.com']
| 16.5 | 42 | 0.712121 |
79604e993d77f631eeeb883ce09b4f924a7142dd | 260 | py | Python | btls_cookiecutter/users/apps.py | jrmcclure/btls-cc | bf8a2b3ad0adde31e33201bc8d2c7e6ecbcd3dee | [
"MIT"
] | null | null | null | btls_cookiecutter/users/apps.py | jrmcclure/btls-cc | bf8a2b3ad0adde31e33201bc8d2c7e6ecbcd3dee | [
"MIT"
] | null | null | null | btls_cookiecutter/users/apps.py | jrmcclure/btls-cc | bf8a2b3ad0adde31e33201bc8d2c7e6ecbcd3dee | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UsersAppConfig(AppConfig):
name = "btls_cookiecutter.users"
verbose_name = "Users"
def ready(self):
try:
import users.signals # noqa F401
except ImportError:
pass
| 18.571429 | 45 | 0.623077 |
79604f3fad9f0e7616829b8ab5a08f473c0e672a | 2,936 | py | Python | shell/ext-py/bitarray-2.3.0/bitarray/__init__.py | Keendata/impala | b25e250d321f329b98e017c648df75d052497963 | [
"Apache-2.0"
] | 746 | 2017-12-02T06:02:05.000Z | 2022-03-29T06:59:03.000Z | shell/ext-py/bitarray-2.3.0/bitarray/__init__.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 9 | 2018-01-30T16:16:22.000Z | 2021-08-31T00:13:28.000Z | shell/ext-py/bitarray-2.3.0/bitarray/__init__.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 363 | 2017-12-10T01:08:17.000Z | 2022-03-26T05:25:00.000Z | # Copyright (c) 2008 - 2021, Ilan Schnell; All Rights Reserved
"""
This package defines an object type which can efficiently represent
a bitarray. Bitarrays are sequence types and behave very much like lists.
Please find a description of this package at:
https://github.com/ilanschnell/bitarray
Author: Ilan Schn... | 34.952381 | 77 | 0.665872 |
79604fdda3f7c74c420296f6d75f5073a776fd83 | 67 | py | Python | 4-motokimura/spacenet6_model/utils/__init__.py | motokimura/SpaceNet_SAR_Buildings_Solutions | c208d0070124e087d4c2f8dfaade5a8c1a132498 | [
"Apache-2.0"
] | 60 | 2020-07-29T23:31:18.000Z | 2022-03-20T02:02:47.000Z | 4-motokimura/spacenet6_model/utils/__init__.py | Z-Zheng/SpaceNet_SAR_Buildings_Solutions | 6a9c3962d987d985384d0d41a187f5fbfadac82c | [
"Apache-2.0"
] | 9 | 2021-01-15T08:57:15.000Z | 2021-11-04T04:27:41.000Z | 4-motokimura/spacenet6_model/utils/__init__.py | Z-Zheng/SpaceNet_SAR_Buildings_Solutions | 6a9c3962d987d985384d0d41a187f5fbfadac82c | [
"Apache-2.0"
] | 16 | 2020-07-30T12:56:03.000Z | 2021-08-13T16:55:05.000Z | from .checkpoint import *
from .utils import *
from .lgbm import *
| 16.75 | 25 | 0.731343 |
796050e04e637961687cea5d5b6c36d7cd8503e9 | 3,856 | py | Python | lambda/requireMFA.py | ha-king/aws-account-automation | 192055b2b9f6708f4701d72faf09c85b6442bc74 | [
"Apache-2.0"
] | 73 | 2017-07-14T21:39:40.000Z | 2022-03-04T02:11:43.000Z | lambda/requireMFA.py | ha-king/aws-account-automation | 192055b2b9f6708f4701d72faf09c85b6442bc74 | [
"Apache-2.0"
] | 4 | 2018-06-27T20:16:35.000Z | 2021-09-29T19:50:19.000Z | lambda/requireMFA.py | ha-king/aws-account-automation | 192055b2b9f6708f4701d72faf09c85b6442bc74 | [
"Apache-2.0"
] | 45 | 2017-11-23T05:25:19.000Z | 2022-01-27T13:03:41.000Z | from __future__ import print_function
import json
import boto3
from botocore.exceptions import ClientError
import sys
import os
def lambda_handler(event, context):
print("Received event: " + json.dumps(event, sort_keys=True))
# Error Checking goes first
if event['source'] != "aws.iam" : sys.exit(0)
... | 35.703704 | 98 | 0.671421 |
7960523a55aac90964796d4a26ca219cb5dbe1f1 | 5,820 | py | Python | setup.py | aaronlelevier/tfx | 93aaeb7de023297817da3e1af524609e55e235d3 | [
"Apache-2.0"
] | null | null | null | setup.py | aaronlelevier/tfx | 93aaeb7de023297817da3e1af524609e55e235d3 | [
"Apache-2.0"
] | null | null | null | setup.py | aaronlelevier/tfx | 93aaeb7de023297817da3e1af524609e55e235d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.642857 | 130 | 0.669416 |
79605261f981c918773c1cf49be522333e6796eb | 961 | py | Python | dynamic_programming/climbing_stairs.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 21 | 2020-11-29T11:34:44.000Z | 2021-06-04T05:50:33.000Z | dynamic_programming/climbing_stairs.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | dynamic_programming/climbing_stairs.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 18 | 2020-02-09T13:00:11.000Z | 2021-03-11T08:47:36.000Z | #!/usr/bin/env python3
def climb_stairs(n: int) -> int:
"""
LeetCdoe No.70: Climbing Stairs
Distinct ways to climb a n step staircase where
each time you can either climb 1 or 2 steps.
Args:
n: number of steps of staircase
Returns:
Distinct ways to climb a n step staircase
... | 22.348837 | 65 | 0.575442 |
7960526bbec971f4c1824ff6a7d881e09ec08f66 | 8,440 | py | Python | autolamella/add_samples.py | Chlanda-Lab/autolamella | ab135eefd56770f326f90747ef4dafebff4e8f71 | [
"MIT"
] | 9 | 2019-10-11T06:22:34.000Z | 2020-10-30T06:47:34.000Z | autolamella/add_samples.py | Chlanda-Lab/autolamella | ab135eefd56770f326f90747ef4dafebff4e8f71 | [
"MIT"
] | 21 | 2019-10-15T04:44:42.000Z | 2022-03-21T15:52:43.000Z | autolamella/add_samples.py | GenevieveBuckley/autolamella | 932130999c0973db770bdf023db0d641218e50cd | [
"MIT"
] | 10 | 2019-10-18T16:33:45.000Z | 2022-03-21T08:42:22.000Z | import logging
from autolamella.acquire import grab_ion_image
import autolamella.autoscript
from autolamella.user_input import ask_user
from autolamella.sample import Lamella
def add_samples(microscope, settings):
"""Interactive function to add samples to list.
Parameters
----------
microscope : Aut... | 41.99005 | 92 | 0.652014 |
796052776bbbccea4e5bdfdd5810d2a438937008 | 4,381 | py | Python | aiociscospark/utils.py | razor-1/aiociscospark | 69cfe41a8f1fda788cbd5b3a77e84ce04e6d562d | [
"MIT"
] | 8 | 2017-12-29T19:03:27.000Z | 2020-08-17T06:53:58.000Z | aiociscospark/utils.py | razor-1/aiociscospark | 69cfe41a8f1fda788cbd5b3a77e84ce04e6d562d | [
"MIT"
] | 119 | 2017-10-28T10:27:38.000Z | 2020-03-16T05:19:45.000Z | aiociscospark/utils.py | razor-1/aiociscospark | 69cfe41a8f1fda788cbd5b3a77e84ce04e6d562d | [
"MIT"
] | 5 | 2018-05-08T17:49:32.000Z | 2019-06-05T17:34:29.000Z | import json
import os
import urllib.parse
from http.client import HTTPSConnection
from .constants import API_BASE_URL, API_V1
__all__ = (
'Credentials',
'get_access_token',
'refresh_access_token',
)
class Credentials(dict):
"""
This class partially implements python's dictionary api.
Delegat... | 28.448052 | 100 | 0.636613 |
7960530060dc734c845d6f819df983fad0f59251 | 5,506 | py | Python | q2_gcn_norm/tests/test_gcn_norm.py | Jiung-Wen/q2-gcn-norm | 90a756c98a0fb5defd06afb2d7bbbd95de9df5c4 | [
"BSD-3-Clause"
] | 1 | 2022-03-02T18:03:04.000Z | 2022-03-02T18:03:04.000Z | q2_gcn_norm/tests/test_gcn_norm.py | Jiung-Wen/q2-gcn-norm | 90a756c98a0fb5defd06afb2d7bbbd95de9df5c4 | [
"BSD-3-Clause"
] | 4 | 2019-12-07T08:27:51.000Z | 2021-11-29T19:43:29.000Z | q2_gcn_norm/tests/test_gcn_norm.py | Jiung-Wen/q2-gcn-norm | 90a756c98a0fb5defd06afb2d7bbbd95de9df5c4 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import pandas.util.testing as pdt
import pandas as pd
from qiime2 import Artifact
from qiime2.plugin.testing import TestPluginBase
from qiime2.plugins import gcn_norm
class GcnNormTests(TestPluginBase):
package = 'q2_gcn_norm.tests'
def test_gcn_norm_silva(self):
feature_id = ['taxon... | 43.698413 | 109 | 0.632583 |
796053497435725f2403cbb4e3182cbed575ceb2 | 3,058 | py | Python | get-waffles.py | cburmeister/get-waffles | 36bd0797cf84919ee151d45be2b6ef54787865de | [
"MIT"
] | 4 | 2016-04-01T15:48:18.000Z | 2018-10-27T20:47:32.000Z | get-waffles.py | cburmeister/get-waffles | 36bd0797cf84919ee151d45be2b6ef54787865de | [
"MIT"
] | null | null | null | get-waffles.py | cburmeister/get-waffles | 36bd0797cf84919ee151d45be2b6ef54787865de | [
"MIT"
] | 3 | 2017-02-18T19:27:14.000Z | 2019-11-06T06:10:32.000Z | """
Download all Freeleech torrents from waffles.fm with at least 1 leecher.
"""
from base64 import b64encode
from selenium import webdriver
import os
import time
import transmissionrpc
WAFFLES_USER = os.environ['WAFFLES_USER']
WAFFLES_PASS = os.environ['WAFFLES_PASS']
TRANSMISSION_HOST = os.environ['TRANSMISSION_HOS... | 32.189474 | 79 | 0.672335 |
7960543b0193d3c305c9c2eebaf869042e76d0ea | 26,738 | py | Python | kobo-install/tests/test_config.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | kobo-install/tests/test_config.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | kobo-install/tests/test_config.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import pytest
import random
import shutil
import tempfile
import time
from unittest.mock import patch, MagicMock
from helpers.cli import CLI
from helpers.config import Config
from .utils import (
read_config,
write_trigger_upsert_db_users,
MockAWSValidation
)
CHOICE_YES =... | 35.089239 | 81 | 0.632957 |
796055a2c9ae41afffbf120ebdf99bd06231ef4a | 6,475 | py | Python | brigitte/repositories/migrations/0010_auto__chg_field_repository_title__chg_field_repository_slug.py | stephrdev/brigitte | 473d3c30af728292693f4e94b3c9b34d2d784b41 | [
"BSD-3-Clause"
] | 3 | 2016-01-29T16:54:29.000Z | 2016-07-17T18:09:40.000Z | brigitte/repositories/migrations/0010_auto__chg_field_repository_title__chg_field_repository_slug.py | MasterofJOKers/brigitte | dc432960347546b51a8aaf4624673b20c19a6636 | [
"BSD-3-Clause"
] | 2 | 2020-02-11T21:49:28.000Z | 2020-06-05T16:50:40.000Z | brigitte/repositories/migrations/0010_auto__chg_field_repository_title__chg_field_repository_slug.py | MasterofJOKers/brigitte | dc432960347546b51a8aaf4624673b20c19a6636 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Repository.title'
db.alter_column('repositories_repository', 'title', self.gf('django.db... | 66.752577 | 182 | 0.576062 |
79605aa04c1a0fb10a7c4a02040059abe2c0a9cf | 21,982 | py | Python | src/emitters/gradient_improvement_emitter.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | 6 | 2022-02-09T05:35:37.000Z | 2022-03-12T11:54:59.000Z | src/emitters/gradient_improvement_emitter.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | null | null | null | src/emitters/gradient_improvement_emitter.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | null | null | null | """Provides the GradientImprovementEmitter used in CMA-MEGA and its variants."""
import itertools
import logging
import gin
import numpy as np
from ribs.archives import AddStatus
from ribs.emitters import EmitterBase
from src.emitters.opt.cma_es import CMAEvolutionStrategy
from src.emitters.opt.gradients import AdamO... | 42.683495 | 94 | 0.592348 |
79605acb334a03eabfa2d9c7ff10132d0f5ed3d0 | 1,261 | py | Python | telethon/tl/core/gzippacked.py | MxAboli/Telethon | 5d13626d7119eb23463495412e0e707d23723680 | [
"MIT"
] | 8 | 2021-06-09T17:26:18.000Z | 2022-02-15T06:13:15.000Z | telethon/tl/core/gzippacked.py | MxAboli/Telethon | 5d13626d7119eb23463495412e0e707d23723680 | [
"MIT"
] | 11 | 2021-06-09T17:19:38.000Z | 2021-12-30T07:22:16.000Z | telethon/tl/core/gzippacked.py | TAMILVIP007/Telethon | 15c0369b8fb90c991ff241bff34c9d80a171d972 | [
"MIT"
] | 19 | 2021-06-26T13:24:22.000Z | 2022-03-31T07:28:22.000Z | import gzip
import struct
from .. import TLObject
class GzipPacked(TLObject):
CONSTRUCTOR_ID = 0x3072CFA1
def __init__(self, data):
self.data = data
@staticmethod
def gzip_if_smaller(content_related, data):
"""Calls bytes(request), and based on a certain threshold,
optionall... | 28.659091 | 87 | 0.659794 |
79605b5b4e6041c863c4e1294d49bf0a37560903 | 11,175 | py | Python | test_ocr_general_text_det_1.py | HannaRiver/ocr-psenet | 1a862e4b3b1be51fb64f42719060e510ae6aaa3a | [
"Apache-2.0"
] | null | null | null | test_ocr_general_text_det_1.py | HannaRiver/ocr-psenet | 1a862e4b3b1be51fb64f42719060e510ae6aaa3a | [
"Apache-2.0"
] | null | null | null | test_ocr_general_text_det_1.py | HannaRiver/ocr-psenet | 1a862e4b3b1be51fb64f42719060e510ae6aaa3a | [
"Apache-2.0"
] | null | null | null |
#coding:utf-8
import os
import cv2
import sys
import time
import collections
import torch
import torchvision
import argparse
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils import data
from dataset import OCRTestGeneralTex... | 38.402062 | 121 | 0.557673 |
79605bad4f658cf13dbca2b85dd143568ea004f9 | 9,144 | py | Python | bricksrc/substances.py | shreyasnagare/Brick | f8d55d4529de2bc779e3c3eeeeeb8aefaf21e192 | [
"BSD-3-Clause"
] | null | null | null | bricksrc/substances.py | shreyasnagare/Brick | f8d55d4529de2bc779e3c3eeeeeb8aefaf21e192 | [
"BSD-3-Clause"
] | null | null | null | bricksrc/substances.py | shreyasnagare/Brick | f8d55d4529de2bc779e3c3eeeeeb8aefaf21e192 | [
"BSD-3-Clause"
] | null | null | null | from .namespaces import TAG, BRICK, OWL
# Defining substances
substances = {
"Fluid": {
"tags": [TAG.Fluid],
"subclasses": {
"Gas": {
"tags": [TAG.Fluid, TAG.Gas],
"subclasses": {
"Air": {
"tags": [TAG.Fluid, TA... | 46.653061 | 88 | 0.238298 |
79605c9e3e76657c55a3ca03f5e64cfabf0a310c | 993 | py | Python | main.py | richierh/androidpy | 8bffacc903458fe9327cf3cdb7b1d058067f3886 | [
"MIT"
] | null | null | null | main.py | richierh/androidpy | 8bffacc903458fe9327cf3cdb7b1d058067f3886 | [
"MIT"
] | null | null | null | main.py | richierh/androidpy | 8bffacc903458fe9327cf3cdb7b1d058067f3886 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
print ("hello world")
class Person():
def __init__(self,*args,**kwds):
# self.args=args
# self.kwds=kwds
self.mydatalist =["sdf","df"]
self.biodata = dict(nama = "None",ulangtahun="dd")
pass
class Personin(Person):
def __init__(self,*args,**kw... | 21.586957 | 59 | 0.555891 |
79605cc41ab6d62ead3f2dfe021dee57c60f493e | 4,668 | py | Python | whoville/cloudbreak/models/vm_type_meta_json.py | balazsgaspar/whoville | 0d26853bf5cfd3485067b0c23f886e2b4ab742f8 | [
"Apache-2.0"
] | 30 | 2017-06-12T13:05:24.000Z | 2021-08-03T09:00:48.000Z | whoville/cloudbreak/models/vm_type_meta_json.py | balazsgaspar/whoville | 0d26853bf5cfd3485067b0c23f886e2b4ab742f8 | [
"Apache-2.0"
] | 6 | 2017-12-27T23:12:45.000Z | 2019-03-07T22:14:24.000Z | whoville/cloudbreak/models/vm_type_meta_json.py | balazsgaspar/whoville | 0d26853bf5cfd3485067b0c23f886e2b4ab742f8 | [
"Apache-2.0"
] | 31 | 2017-06-12T13:05:28.000Z | 2019-09-20T01:50:29.000Z | # coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... | 31.12 | 984 | 0.605184 |
79605dc4c30ac4173d9681e3ce127b297321bb65 | 1,635 | py | Python | pyclesperanto_prototype/_tier1/_write_values_to_positions.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 64 | 2020-03-18T12:11:22.000Z | 2022-03-31T08:19:18.000Z | pyclesperanto_prototype/_tier1/_write_values_to_positions.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 148 | 2020-05-14T06:14:11.000Z | 2022-03-26T15:02:31.000Z | pyclesperanto_prototype/_tier1/_write_values_to_positions.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 16 | 2020-05-31T00:53:44.000Z | 2022-03-23T13:20:57.000Z | from .._tier0 import execute
from .._tier0 import plugin_function
from .._tier0 import Image
from .._tier0 import create
from .._tier0 import create_none
from .._tier1 import maximum_x_projection
from .._tier0 import pull
@plugin_function(output_creator=create_none)
def write_values_to_positions(positions_and_values :... | 34.0625 | 229 | 0.653211 |
79605e111a9cd0a61085ea04d68375633aa6d8de | 3,262 | py | Python | emanuel/models.py | Alexandre1313/Desafio | 03f6ba5228b0654be002cbf4ff22bbf8e2ea8fd1 | [
"MIT"
] | null | null | null | emanuel/models.py | Alexandre1313/Desafio | 03f6ba5228b0654be002cbf4ff22bbf8e2ea8fd1 | [
"MIT"
] | null | null | null | emanuel/models.py | Alexandre1313/Desafio | 03f6ba5228b0654be002cbf4ff22bbf8e2ea8fd1 | [
"MIT"
] | null | null | null | from django.db import models
class Base(models.Model):
criacao = models.DateTimeField(auto_now_add=True)
class Meta:
abstract = True
class Aluno(Base):
matricula_do_aluno = models.IntegerField(unique=True)
aluno = models.CharField(max_length=55)
class Meta:
verbose_name = 'alun... | 36.244444 | 103 | 0.709074 |
79605e2028e97b5a9949cfd3350c9a1ecbc19904 | 1,530 | py | Python | lib/galaxy/model/migrate/versions/0122_grow_mysql_blobs.py | Galaxyinternship/Galaxy | 204be086a8c16d6684584cefa9053ed7c86a1784 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/model/migrate/versions/0122_grow_mysql_blobs.py | Galaxyinternship/Galaxy | 204be086a8c16d6684584cefa9053ed7c86a1784 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/model/migrate/versions/0122_grow_mysql_blobs.py | Galaxyinternship/Galaxy | 204be086a8c16d6684584cefa9053ed7c86a1784 | [
"CC-BY-3.0"
] | null | null | null | """
Migration script to grow MySQL blobs.
"""
from __future__ import print_function
import logging
from sqlalchemy import MetaData
log = logging.getLogger( __name__ )
metadata = MetaData()
BLOB_COLUMNS = [
("deferred_job", "params"),
("extended_metadata", "data"),
("form_definition", "fields"),
("fo... | 27.321429 | 77 | 0.655556 |
79605e240e46e4523ab0cab67df007460e5a81a4 | 4,388 | py | Python | utils/mxnet_paser.py | ZHUXUHAN/mxnet_backbone | 1e4ccd9c14abf41202ec9fc646a96a02f58252bb | [
"MIT"
] | null | null | null | utils/mxnet_paser.py | ZHUXUHAN/mxnet_backbone | 1e4ccd9c14abf41202ec9fc646a96a02f58252bb | [
"MIT"
] | null | null | null | utils/mxnet_paser.py | ZHUXUHAN/mxnet_backbone | 1e4ccd9c14abf41202ec9fc646a96a02f58252bb | [
"MIT"
] | null | null | null | import mxnet as mx
def get_children(symbol):
symbollist = symbol.get_children()
if len(symbollist) > 1:
for sym in symbol:
return get_children(sym)
print(symbollist)
return symbollist
def get_outputs_shape():
pass
def False_True_2_bool(str):
if "False" == str:
r... | 35.387097 | 118 | 0.484959 |
79605e5a5b442e49fa9d8fbfa520022f446f415f | 1,179 | py | Python | solution2.py | Lossfull/2019_IT | 14c6129ba010aea5e6ab6c8057424e80e1fc4537 | [
"MIT"
] | null | null | null | solution2.py | Lossfull/2019_IT | 14c6129ba010aea5e6ab6c8057424e80e1fc4537 | [
"MIT"
] | null | null | null | solution2.py | Lossfull/2019_IT | 14c6129ba010aea5e6ab6c8057424e80e1fc4537 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import math
def add_noise(img, rate=5):
img[::rate, ::rate, :] = 1
return
def gauss(x,y,sigm):
return math.exp(-(x**2+y**2)/(2*sigm**2))/(2*math.pi*sigm**2)
def get_kernel(windos_size):
sigm=1
kernel = np.zeros((windos_size, windos... | 25.630435 | 71 | 0.568278 |
79605e6f799f1ba8f94b8eed0b7b98100c72230b | 12,880 | py | Python | sanic_ext/extensions/http/cors.py | ChihweiLHBird/sanic-ext | f0193a0cc89650a43c50fe543b43d1832307896f | [
"MIT"
] | 14 | 2021-06-18T12:16:02.000Z | 2022-02-10T09:36:50.000Z | sanic_ext/extensions/http/cors.py | ChihweiLHBird/sanic-ext | f0193a0cc89650a43c50fe543b43d1832307896f | [
"MIT"
] | 37 | 2021-10-03T10:47:12.000Z | 2022-03-24T10:08:20.000Z | sanic_ext/extensions/http/cors.py | ChihweiLHBird/sanic-ext | f0193a0cc89650a43c50fe543b43d1832307896f | [
"MIT"
] | 7 | 2021-10-03T09:43:36.000Z | 2022-03-27T14:29:49.000Z | import re
from dataclasses import dataclass
from datetime import timedelta
from types import SimpleNamespace
from typing import Any, FrozenSet, List, Optional, Tuple, Union
from sanic import HTTPResponse, Request, Sanic
from sanic.exceptions import SanicException
from sanic.helpers import Default, _default
from sanic.... | 33.281654 | 93 | 0.656056 |
79606011a13b524c806c0be927fda13d978e36b0 | 514 | py | Python | src/pages/views.py | Palpriyanka/priyankaaaa | 4cb4af6c785891d5a4a37a7c18cbe111914c472f | [
"MIT"
] | 41 | 2019-11-14T14:09:52.000Z | 2021-12-08T02:13:56.000Z | src/pages/views.py | Palpriyanka/priyankaaaa | 4cb4af6c785891d5a4a37a7c18cbe111914c472f | [
"MIT"
] | 9 | 2020-06-06T00:35:38.000Z | 2022-02-10T13:50:41.000Z | src/pages/views.py | Palpriyanka/priyankaaaa | 4cb4af6c785891d5a4a37a7c18cbe111914c472f | [
"MIT"
] | 24 | 2019-12-24T05:01:49.000Z | 2021-08-13T00:44:08.000Z | from django.shortcuts import render
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import View
class IndexView(View):
def get(self, request, *args, **kwargs):
return render(request, 'pages/home.html', {})
class DashboardView(LoginRequiredMixin, View):
def get(self, reques... | 30.235294 | 57 | 0.725681 |
7960602e1bbaf90c800596689d3f55ffb30a877b | 2,401 | py | Python | django/users/migrations/0001_initial.py | nilsgarland/facteur | 1a6b1921cfaf8a02edf0b59c8a00af1b59dd9c88 | [
"MIT"
] | null | null | null | django/users/migrations/0001_initial.py | nilsgarland/facteur | 1a6b1921cfaf8a02edf0b59c8a00af1b59dd9c88 | [
"MIT"
] | null | null | null | django/users/migrations/0001_initial.py | nilsgarland/facteur | 1a6b1921cfaf8a02edf0b59c8a00af1b59dd9c88 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-01 12:17
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
... | 61.564103 | 266 | 0.662224 |
7960605e437d880dbac332869c234023350ad1a9 | 6,464 | py | Python | pybind/nos/v7_2_0/interface/port_channel/protected_port/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_2_0/interface/port_channel/protected_port/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_2_0/interface/port_channel/protected_port/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 50.108527 | 513 | 0.726021 |
796061364255d2e8150a64a18c6776d99cbd4723 | 5,974 | py | Python | gym_pcgrl/envs/reps/turtle_rep.py | JiangZehua/control-pcgrl | e4fd1bf9670e5855f04941ebca34170517c451b4 | [
"MIT"
] | 15 | 2021-08-01T02:40:20.000Z | 2022-02-09T04:09:41.000Z | gym_pcgrl/envs/reps/turtle_rep.py | JiangZehua/control-pcgrl | e4fd1bf9670e5855f04941ebca34170517c451b4 | [
"MIT"
] | 2 | 2021-08-25T16:16:59.000Z | 2022-03-29T05:12:03.000Z | gym_pcgrl/envs/reps/turtle_rep.py | JiangZehua/control-pcgrl | e4fd1bf9670e5855f04941ebca34170517c451b4 | [
"MIT"
] | 6 | 2021-09-21T15:24:14.000Z | 2022-02-28T15:19:03.000Z | from gym_pcgrl.envs.reps.representation import Representation
from PIL import Image
from gym import spaces
import numpy as np
from collections import OrderedDict
"""
The turtle representation where the agent is trying to modify the position of the
turtle or the tile value of its current location similar to turtle grap... | 37.572327 | 127 | 0.60462 |
7960617369e3f24c7ba134dfb5a2de923afb538c | 2,057 | py | Python | python/paddle/fluid/dygraph/dygraph_to_static/print_transformer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 17,085 | 2016-11-18T06:40:52.000Z | 2022-03-31T22:52:32.000Z | python/paddle/fluid/dygraph/dygraph_to_static/print_transformer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 29,769 | 2016-11-18T06:35:22.000Z | 2022-03-31T16:46:15.000Z | python/paddle/fluid/dygraph/dygraph_to_static/print_transformer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 4,641 | 2016-11-18T07:43:33.000Z | 2022-03-31T15:15:02.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 36.732143 | 104 | 0.723384 |
796063f42a330655df76c90860041076b57e01bc | 23,186 | py | Python | localstack/utils/testutil.py | supaflysnooka/localstack | 078d477a42244d58bd0c8606a0fe80a048f06cb7 | [
"Apache-2.0"
] | 2 | 2021-11-19T00:06:54.000Z | 2021-12-26T02:03:47.000Z | localstack/utils/testutil.py | SNOmad1/localstack | bae78a0d44a60893d49b27b3fc6562098a78decf | [
"Apache-2.0"
] | null | null | null | localstack/utils/testutil.py | SNOmad1/localstack | bae78a0d44a60893d49b27b3fc6562098a78decf | [
"Apache-2.0"
] | null | null | null | import glob
import importlib
import io
import json
import os
import re
import shutil
import tempfile
import time
import zipfile
from contextlib import contextmanager
from typing import Any, Callable, Dict, List, Optional, Tuple
import requests
from six import iteritems
from localstack.constants import (
ENV_INTER... | 31.761644 | 113 | 0.638661 |
796064fd9585e1f97a2383f0e8b136499587e312 | 98,157 | py | Python | pyupgrade.py | angrycaptain19/pyupgrade | f665da00395db756f5fc47c16b92bdc90ea215d8 | [
"MIT"
] | null | null | null | pyupgrade.py | angrycaptain19/pyupgrade | f665da00395db756f5fc47c16b92bdc90ea215d8 | [
"MIT"
] | 1 | 2021-01-25T13:55:44.000Z | 2021-01-25T13:55:44.000Z | pyupgrade.py | angrycaptain19/pyupgrade | f665da00395db756f5fc47c16b92bdc90ea215d8 | [
"MIT"
] | null | null | null | import argparse
import ast
import codecs
import collections
import contextlib
import keyword
import re
import string
import sys
import tokenize
import warnings
from typing import Any
from typing import cast
from typing import Container
from typing import Dict
from typing import Generator
from typing import Iterable
fro... | 34.696713 | 79 | 0.545493 |
796065317a2058742a4d5fdece607b9d7631477c | 5,125 | py | Python | stonesoup/updater/tests/test_kalman.py | mgomesborges/Stone-Soup | 39c7f02ce11e10c9b3c612ad359f6d8bca495266 | [
"MIT"
] | 1 | 2019-12-26T14:55:03.000Z | 2019-12-26T14:55:03.000Z | stonesoup/updater/tests/test_kalman.py | mgomesborges/Stone-Soup | 39c7f02ce11e10c9b3c612ad359f6d8bca495266 | [
"MIT"
] | null | null | null | stonesoup/updater/tests/test_kalman.py | mgomesborges/Stone-Soup | 39c7f02ce11e10c9b3c612ad359f6d8bca495266 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test for updater.kalman module"""
import pytest
import numpy as np
from stonesoup.models.measurement.linear import LinearGaussian
from stonesoup.types.detection import Detection
from stonesoup.types.hypothesis import SingleHypothesis
from stonesoup.types.prediction import (
GaussianState... | 46.171171 | 80 | 0.644488 |
79606697b5662398e274ad484c26ea6cc2b81328 | 34,908 | py | Python | anzee_venv/lib/python3.5/site-packages/sympy/core/tests/test_function.py | PanthraxDigital/PD_Anzee_BE | 070998427db470044fdccb1cf75a5b0015677d73 | [
"BSD-3-Clause"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | anzee_venv/lib/python3.5/site-packages/sympy/core/tests/test_function.py | PanthraxDigital/PD_Anzee_BE | 070998427db470044fdccb1cf75a5b0015677d73 | [
"BSD-3-Clause"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | anzee_venv/lib/python3.5/site-packages/sympy/core/tests/test_function.py | PanthraxDigital/PD_Anzee_BE | 070998427db470044fdccb1cf75a5b0015677d73 | [
"BSD-3-Clause"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | from sympy import (Lambda, Symbol, Function, Derivative, Subs, sqrt,
log, exp, Rational, Float, sin, cos, acos, diff, I, re, im,
E, expand, pi, O, Sum, S, polygamma, loggamma, expint,
Tuple, Dummy, Eq, Expr, symbols, nfloat, Piecewise, Indexed)
from sympy.utilities.pytest import XFAIL, raises
fr... | 35.296259 | 168 | 0.54171 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.