hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3312488d9bc0545a909e84e0f784ee0afccb9768 | 1,542 | py | Python | lib/tests/streamlit/storage/S3Storage_test.py | deepchatterjeevns/streamlit | 631d42877bd16bdec14ee124c936917b430f6ce4 | [
"Apache-2.0"
] | 2 | 2020-03-21T15:27:33.000Z | 2020-06-28T02:37:25.000Z | lib/tests/streamlit/storage/S3Storage_test.py | IliaLarchenko/streamlit | 9cdf4851148a43e4e0431d7633c5a5d729e5b1e3 | [
"Apache-2.0"
] | 4 | 2021-05-09T11:42:18.000Z | 2022-02-27T10:59:36.000Z | lib/tests/streamlit/storage/S3Storage_test.py | IliaLarchenko/streamlit | 9cdf4851148a43e4e0431d7633c5a5d729e5b1e3 | [
"Apache-2.0"
] | 1 | 2019-11-26T09:37:57.000Z | 2019-11-26T09:37:57.000Z | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Streamlit 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 applicabl... | 34.266667 | 84 | 0.719196 |
33126d0e236e825f00a735cb42dc6b38420e96e5 | 2,712 | py | Python | main.py | wiio12/ADMN | 13654b19b2e3a7221f120537f8f388f88e2d704d | [
"MIT"
] | 4 | 2020-07-06T16:28:40.000Z | 2021-01-13T08:32:48.000Z | main.py | wiio12/ADMN | 13654b19b2e3a7221f120537f8f388f88e2d704d | [
"MIT"
] | null | null | null | main.py | wiio12/ADMN | 13654b19b2e3a7221f120537f8f388f88e2d704d | [
"MIT"
] | 1 | 2021-02-22T16:15:28.000Z | 2021-02-22T16:15:28.000Z | from conf import conf
from pro_data import dataloader
from Model import ADMN
import pickle
import time
import os
def save_data(data,parameter):
now = time.strftime('%Y%m%d_%H%M%S', time.localtime(time.time()))
save_path = os.path.join(os.getcwd(), "Result")
save_file = os.path.join(save_path, str(parameter... | 36.648649 | 93 | 0.639381 |
33128b62ec562283e5abcaaf8ad813eecebd4733 | 6,054 | py | Python | tests/test_name_generation.py | shaleh/tvnamer | 6fcde74bb66c0280ed376af84116be99176c1aaa | [
"Unlicense"
] | 1 | 2015-02-01T15:57:43.000Z | 2015-02-01T15:57:43.000Z | tests/test_name_generation.py | shaleh/tvnamer | 6fcde74bb66c0280ed376af84116be99176c1aaa | [
"Unlicense"
] | null | null | null | tests/test_name_generation.py | shaleh/tvnamer | 6fcde74bb66c0280ed376af84116be99176c1aaa | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""Test tvnamer's EpisodeInfo file name generation
"""
import datetime
from helpers import assertEquals
from tvnamer.utils import (EpisodeInfo, DatedEpisodeInfo, NoSeasonEpisodeInfo)
from test_files import files
from tvdb_api import Tvdb
def verify_name_gen(curtest, tvdb_instance):
if "... | 27.27027 | 86 | 0.612157 |
3312b59ab9d506a6ad775e67857f882741887804 | 25,026 | py | Python | python_modules/dagster/dagster_tests/core_tests/launcher_tests/test_default_run_launcher.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/launcher_tests/test_default_run_launcher.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/launcher_tests/test_default_run_launcher.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | import json
import os
import re
import sys
import tempfile
import time
from contextlib import contextmanager
import pytest
from dagster import (
DefaultRunLauncher,
ModeDefinition,
file_relative_path,
fs_io_manager,
pipeline,
repository,
seven,
solid,
)
from dagster.core.errors import ... | 33.591946 | 118 | 0.618916 |
33132790a5ce186489a5102b959e425987376e52 | 552 | py | Python | test/unittests/test_QrunP.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_QrunP.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_QrunP.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Runoff import QrunP
class TestQrunP(VariableUnitTest):
def test_QrunP(self):
z = self.z
np.testing.assert_array_almost_equal(
QrunP.QrunP_f(z.NYrs, z.DaysMonth, z.NRur, z.NUrb, z.Temp, z.InitSnow... | 36.8 | 115 | 0.639493 |
33133470800d096bbd1c1631027c3980ec259479 | 1,524 | py | Python | tests/testfilters.py | jgibson2/cutadapt-vbim | 5e1693e553d53c0aea0bfef33e53b90c44d7911b | [
"MIT"
] | 1 | 2018-12-12T10:31:11.000Z | 2018-12-12T10:31:11.000Z | tests/testfilters.py | jgibson2/cutadapt-vbim | 5e1693e553d53c0aea0bfef33e53b90c44d7911b | [
"MIT"
] | null | null | null | tests/testfilters.py | jgibson2/cutadapt-vbim | 5e1693e553d53c0aea0bfef33e53b90c44d7911b | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Tests write output (should it return True or False or write)
"""
from __future__ import print_function, division, absolute_import
from cutadapt.filters import NContentFilter, DISCARD, KEEP, LegacyPairedRedirector, PairedRedirector
from cutadapt.seqio import Sequence
def test_ncontentfilter():
... | 34.636364 | 100 | 0.618766 |
331348086b7bc9090f29532e2c55f5609c816072 | 515 | py | Python | backend/users/migrations/0009_votenotification_creation_data.py | Carbonara-Project/Carbonara-Web | be1fac46ed3e4f590f3d885e646970a29ec43cb5 | [
"MIT"
] | 2 | 2020-01-07T12:35:11.000Z | 2021-09-18T10:30:57.000Z | backend/users/migrations/0009_votenotification_creation_data.py | Carbonara-Project/Carbonara-Web | be1fac46ed3e4f590f3d885e646970a29ec43cb5 | [
"MIT"
] | null | null | null | backend/users/migrations/0009_votenotification_creation_data.py | Carbonara-Project/Carbonara-Web | be1fac46ed3e4f590f3d885e646970a29ec43cb5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-04-06 18:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('users', '0008_votenotification'),
]
operations = [
... | 23.409091 | 74 | 0.650485 |
3313989708ea58beb9fcbf65f9145af26a40d72c | 382 | py | Python | clrfterm/messages/message.py | SayHelloRoman/clrflterm | 0748cb936df4ea02cdf63c165eb2b20a968586d1 | [
"MIT"
] | 3 | 2021-08-18T20:58:03.000Z | 2022-02-07T15:59:24.000Z | clrfterm/messages/message.py | SayHelloRoman/clrflterm | 0748cb936df4ea02cdf63c165eb2b20a968586d1 | [
"MIT"
] | null | null | null | clrfterm/messages/message.py | SayHelloRoman/clrflterm | 0748cb936df4ea02cdf63c165eb2b20a968586d1 | [
"MIT"
] | 3 | 2021-08-17T11:15:12.000Z | 2021-08-19T00:55:04.000Z | from typing import Union
from clrfterm.messages.phrase import Phrase
class Message(str):
def __new__(cls, *phrases: Union[Phrase, str]) -> "Message":
obj = super(Message, cls).__new__(cls, ''.join(phrases))
obj.__phrases = phrases
return obj
def add(self, phrase: Union[Phrase, str]) ... | 27.285714 | 64 | 0.657068 |
3313b15070bc2c9e4a517e8108e874964a0a0d00 | 56 | py | Python | tests/fixtures/in/001_literals.py | lig/wrast | 7a4b140d79548e3eb48ba6d1e63b8765e2060981 | [
"MIT"
] | 2 | 2017-12-29T06:09:18.000Z | 2017-12-29T20:05:38.000Z | tests/fixtures/in/001_literals.py | lig/wrast | 7a4b140d79548e3eb48ba6d1e63b8765e2060981 | [
"MIT"
] | null | null | null | tests/fixtures/in/001_literals.py | lig/wrast | 7a4b140d79548e3eb48ba6d1e63b8765e2060981 | [
"MIT"
] | null | null | null | # Num
123
1.23
# Str
'foo'
'123'
'''bar'''
'''
ham
'''
| 4.666667 | 9 | 0.428571 |
3313cc9b0e739943f399b1ed6c9fe3dff5b526da | 1,253 | py | Python | src/mesh/proxy_group.py | hsoju/Cally | 0383a7d6a6df8f94314b9260f9905cf38f301e14 | [
"MIT"
] | null | null | null | src/mesh/proxy_group.py | hsoju/Cally | 0383a7d6a6df8f94314b9260f9905cf38f301e14 | [
"MIT"
] | null | null | null | src/mesh/proxy_group.py | hsoju/Cally | 0383a7d6a6df8f94314b9260f9905cf38f301e14 | [
"MIT"
] | null | null | null | from typing import Dict, Iterable, Tuple
import bpy
from bpy.types import Object
from .proxy import Proxy
class ProxyGroup:
"""Constructs multiple meshes under a single collection.
"""
def __init__(self, proxies: Iterable[Tuple[str, Iterable[str]]]):
self.proxies = []
for name, fpath in... | 35.8 | 105 | 0.64565 |
3313cec1a433f2626dba931818cc2c5fc3158f74 | 14,095 | py | Python | scripts/generate_field_test_vectors.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | scripts/generate_field_test_vectors.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | scripts/generate_field_test_vectors.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | """
Script to generate unit test vectors for the galois package using SageMath.
Install SageMath with:
```
sudo apt install sagemath
```
"""
import json
import os
import pickle
import random
import shutil
import sage
import numpy as np
from sage.all import GF, PolynomialRing, log
FIELD = None
SPARSE_SIZE = 20
def ... | 35.149626 | 160 | 0.569493 |
3313e72b31cee0d20b7558862d1edf2c96b9d7b9 | 2,126 | py | Python | testkit-data/custom-pipelines/custom_pipeline.py | PacificBiosciences/pbsmrtpipe | 4d532c823d3a46b82c2eb20b9d46e63544c8ba83 | [
"BSD-3-Clause"
] | 26 | 2015-08-06T02:09:51.000Z | 2021-02-26T02:25:01.000Z | testkit-data/custom-pipelines/custom_pipeline.py | mpkocher/pbsmrtpipe | 4d532c823d3a46b82c2eb20b9d46e63544c8ba83 | [
"BSD-3-Clause"
] | 181 | 2015-08-07T18:13:02.000Z | 2021-04-13T16:24:32.000Z | testkit-data/custom-pipelines/custom_pipeline.py | PacificBiosciences/pbsmrtpipe | 4d532c823d3a46b82c2eb20b9d46e63544c8ba83 | [
"BSD-3-Clause"
] | 29 | 2015-08-07T17:29:42.000Z | 2021-09-15T18:22:37.000Z | #!/usr/bin/env python
"""
Example for defining Custom Pipelines
using pipelines to emit a Pipeline XML or ResolvedPipeline Template JSON file
"""
import logging
import sys
from pbsmrtpipe.loader import load_all_installed_pipelines
from pbsmrtpipe.core import PipelineRegistry
from pbsmrtpipe.cli_custom_pipeline import ... | 35.433333 | 125 | 0.740357 |
3313efd947a53d942d92c2b31748182b74faf203 | 2,414 | py | Python | aim/cli/commit/commands.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | aim/cli/commit/commands.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | aim/cli/commit/commands.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | import click
import uuid
import time
@click.command()
@click.option('-m', '--message', default='', type=str)
@click.option('--code', is_flag=True)
@click.pass_obj
def commit(repo, message, code):
if repo is None:
click.echo('Repository does not exist')
return
commit_hash = str(uuid.uuid1())
... | 32.621622 | 76 | 0.584507 |
3314408f1205ab1dca4b6c48f3d004e6e7a6fa45 | 2,158 | py | Python | backend/core/mutations.py | ashutoshacharya24/Recipie-server | 75dcb9170eb65232ba7ef626155fc96f2094a03b | [
"MIT"
] | null | null | null | backend/core/mutations.py | ashutoshacharya24/Recipie-server | 75dcb9170eb65232ba7ef626155fc96f2094a03b | [
"MIT"
] | null | null | null | backend/core/mutations.py | ashutoshacharya24/Recipie-server | 75dcb9170eb65232ba7ef626155fc96f2094a03b | [
"MIT"
] | null | null | null | from celery import current_app
from graphene import Field
from graphene.relay import ClientIDMutation
from graphql_jwt.relay import ObtainJSONWebToken
from .choices import UploadStatus
from .decorators import login_required
from .inputs import CreateUploadInput, IDInput, RegisterInput, UpdateMeInput
from .models impor... | 29.561644 | 80 | 0.711307 |
3314781420c4140b8367ff17abf6090760da04c6 | 913 | py | Python | sdks/python/test/test_CrashAttachment.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_CrashAttachment.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_CrashAttachment.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 22.825 | 89 | 0.715225 |
33148969d809a3e05412b0e90f7db96dfc892d30 | 36,695 | py | Python | src/model/model.py | hrashkin/plotmachines | e7ede8c6f816acaec9676d9b81085851a3f53b2a | [
"MIT"
] | 47 | 2020-05-01T21:47:10.000Z | 2022-01-25T11:56:51.000Z | src/model/model.py | hrashkin/plotmachines | e7ede8c6f816acaec9676d9b81085851a3f53b2a | [
"MIT"
] | 4 | 2020-06-19T16:02:26.000Z | 2021-11-17T01:08:13.000Z | src/model/model.py | hrashkin/plotmachines | e7ede8c6f816acaec9676d9b81085851a3f53b2a | [
"MIT"
] | 5 | 2020-05-13T10:46:47.000Z | 2021-12-02T08:29:36.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import copy
from transformers.modeling_gpt2 import *
class GPT2NeighborModel(GPT2Model):
'''GPT2 model but with slightly altered foward function to include previous paragraph encoding as an additional input'''
def __init__(self, co... | 47.348387 | 299 | 0.602289 |
3314bd93bbaa9f5bce4a17bf181bf64ef366af18 | 1,701 | py | Python | configs/_base_/datasets/coco_instance.py | yishayahu/Swin-Transformer-Object-Detection | ebda3ed9a6ce147d66aa20e8a1d1ae3aac8272dc | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/coco_instance.py | yishayahu/Swin-Transformer-Object-Detection | ebda3ed9a6ce147d66aa20e8a1d1ae3aac8272dc | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/coco_instance.py | yishayahu/Swin-Transformer-Object-Detection | ebda3ed9a6ce147d66aa20e8a1d1ae3aac8272dc | [
"Apache-2.0"
] | null | null | null | dataset_type = 'PolypDataset'
data_root = '/media/data/Data/fdcccdbc7cffbd92b5d84cd5f3368f0e.dir/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_mask=False),
... | 34.714286 | 77 | 0.632569 |
3314bddcb9fdef07601cf0e9c4e8512f1fb9bc94 | 37,531 | py | Python | galpy/orbit/integratePlanarOrbit.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | galpy/orbit/integratePlanarOrbit.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | galpy/orbit/integratePlanarOrbit.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | import sys
import distutils.sysconfig as sysconfig
import warnings
import numpy as nu
from scipy import integrate
import ctypes
import ctypes.util
from numpy.ctypeslib import ndpointer
import os
from galpy import potential
from galpy.potential.planarPotential import planarPotentialFromFullPotential, \
planarPotenti... | 44.206125 | 138 | 0.560017 |
331510eda9f6c72735194df741e3012f6222b520 | 1,173 | py | Python | cc/test/test_2e.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | cc/test/test_2e.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | cc/test/test_2e.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import unittest
import numpy
from pyscf import gto
from pyscf import scf
from pyscf import cc
from pyscf import ao2mo
from pyscf import fci
mol = gto.Mole()
mol.verbose = 0
mol.atom = [
['H', ( 1.,-1. , 0. )],
['H', ( 0.,-1. ,-1. )],
['H', ( 1.,-0.5 , 0. )],
['H', (... | 26.066667 | 87 | 0.595908 |
331527705e3728bac478aa0548ef7c7090288321 | 12,718 | py | Python | pyglet/__init__.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | 2 | 2017-05-10T08:27:22.000Z | 2019-10-05T14:55:00.000Z | pyglet/__init__.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | null | null | null | pyglet/__init__.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | 33.824468 | 80 | 0.638308 |
331599a07c645cd3342ffb81f0b8f13177951e7d | 366 | py | Python | readthedocs/core/apps.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 2,092 | 2019-06-29T07:47:30.000Z | 2022-03-31T14:54:59.000Z | readthedocs/core/apps.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 2,389 | 2019-06-29T04:22:55.000Z | 2022-03-31T22:57:49.000Z | readthedocs/core/apps.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 1,185 | 2019-06-29T21:49:31.000Z | 2022-03-30T09:57:15.000Z | # -*- coding: utf-8 -*-
"""App configurations for core app."""
from django.apps import AppConfig
class CoreAppConfig(AppConfig):
name = 'readthedocs.core'
verbose_name = 'Core'
def ready(self):
import readthedocs.core.signals # noqa
# Import `readthedocs.core.logs` to set up structlog... | 21.529412 | 60 | 0.661202 |
33159e6015741ffda96fcaed5a4b3bc234a9eb19 | 567 | py | Python | feedler/migrations/0005_auto_20170920_1204.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 2 | 2020-10-29T16:27:21.000Z | 2021-06-07T12:47:46.000Z | feedler/migrations/0005_auto_20170920_1204.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 11 | 2017-05-09T10:50:28.000Z | 2021-12-15T17:01:23.000Z | feedler/migrations/0005_auto_20170920_1204.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 4 | 2017-04-24T13:06:55.000Z | 2021-06-04T02:18:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-20 10:04
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('feedler', '0004_auto_20170905_1502'),
]
operations... | 25.772727 | 134 | 0.657848 |
3315b0c3f5c9b9a55e2b3ae4e1ffb218d64b240c | 744 | py | Python | afmtopopt/tests/test_afmtopopt.py | simoore/afmtopopt | ef9d75557f617ee50f955c691e4c8c854378472b | [
"MIT"
] | null | null | null | afmtopopt/tests/test_afmtopopt.py | simoore/afmtopopt | ef9d75557f617ee50f955c691e4c8c854378472b | [
"MIT"
] | null | null | null | afmtopopt/tests/test_afmtopopt.py | simoore/afmtopopt | ef9d75557f617ee50f955c691e4c8c854378472b | [
"MIT"
] | null | null | null | #from math import pi
#import numpy as np
#import unittest
#import time
#from afmtopopt import DensityFilter
#from materials import IsotropicPlateMaterial, PiezoMumpsMaterial
#from mesh import UniformMesh
#from cantilevers import RectangularCantilever, BJNCantilever
#from finite_element import LaminateFEM, PlateFEM
#fro... | 33.818182 | 77 | 0.751344 |
3315b94bebf75c6d94d261559b30457f17fe278a | 2,550 | py | Python | src/test/py/ltprg/game/snli/data/featurize_sua.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | 11 | 2017-08-03T15:42:19.000Z | 2021-02-04T12:43:35.000Z | src/test/py/ltprg/game/snli/data/featurize_sua.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | null | null | null | src/test/py/ltprg/game/snli/data/featurize_sua.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | 1 | 2021-02-04T12:43:37.000Z | 2021-02-04T12:43:37.000Z | import unittest
import numpy as np
import sys
import mung.feature_helpers
import ltprg.data.feature_helpers
from os.path import join
input_data_dir = sys.argv[1]
output_feature_dir = sys.argv[2]
partition_file = sys.argv[3]
# Necessary to allow unittest.main() to work
del sys.argv[3]
del sys.argv[2]
del... | 40.47619 | 95 | 0.659216 |
3315d9329e87ab67c057b9c39dc12642afb01ce1 | 1,411 | py | Python | alipay/aop/api/domain/ZhimaCreditPeUserContractQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/ZhimaCreditPeUserContractQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/ZhimaCreditPeUserContractQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"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 ZhimaCreditPeUserContractQueryModel(object):
def __init__(self):
self._credit_scene = None
self._user_id = None
@property
def credit_scene(self):
return self._cre... | 25.196429 | 75 | 0.596031 |
3315ec7fad5548e4400d6c40e786eac91fefb82e | 1,921 | py | Python | tests/test_util.py | Matoking/siliqua | b943822631ab18dde85e95d1731ebd7ffd7ef14a | [
"CC0-1.0"
] | 8 | 2019-10-31T19:16:08.000Z | 2021-12-04T00:09:24.000Z | tests/test_util.py | Matoking/siliqua | b943822631ab18dde85e95d1731ebd7ffd7ef14a | [
"CC0-1.0"
] | null | null | null | tests/test_util.py | Matoking/siliqua | b943822631ab18dde85e95d1731ebd7ffd7ef14a | [
"CC0-1.0"
] | 1 | 2019-11-01T19:27:48.000Z | 2019-11-01T19:27:48.000Z | import pytest
from siliqua.util import AccountIDDict, account_ids_equal, normalize_account_id
ACCOUNT_NANO_A = \
"nano_3456cu49o6oco9uor9ytszhh9yozfbpbjffu94fpekmtet99pum8rmyr318x"
ACCOUNT_XRB_A = \
"xrb_3456cu49o6oco9uor9ytszhh9yozfbpbjffu94fpekmtet99pum8rmyr318x"
ACCOUNT_NANO_B = \
"nano_17mrjcdchuu3m5... | 31.491803 | 79 | 0.75898 |
3315f53f3d81e93feb709e4ed2dc5e385508a709 | 1,007 | py | Python | backend/calorie_find/calories/views.py | banjocat/calorie-find | 9b0314e3c3a5b4b4b4607ec61728e14988c8fd05 | [
"BSD-2-Clause"
] | 2 | 2016-08-10T19:54:02.000Z | 2016-10-20T00:22:19.000Z | backend/calorie_find/calories/views.py | banjocat/calorie-find | 9b0314e3c3a5b4b4b4607ec61728e14988c8fd05 | [
"BSD-2-Clause"
] | 9 | 2016-07-10T15:07:27.000Z | 2017-01-17T03:39:41.000Z | backend/calorie_find/calories/views.py | banjocat/calorie-find | 9b0314e3c3a5b4b4b4607ec61728e14988c8fd05 | [
"BSD-2-Clause"
] | null | null | null | from rest_framework import views
from rest_framework.response import Response
from rest_framework.renderers import JSONRenderer
from django.http import Http404
from django.db.models import Q
from calories.serializers import FoodListSerializer, FoodRequestSerializer
from calories.models import Food
class CalorieView(... | 32.483871 | 77 | 0.682224 |
331608bfaa1bbeecfc3dd18a2fde05596fb4e203 | 2,754 | py | Python | medios/diarios/diario.py | miglesias91/dicenlosmedios | 1f8867cd09689006f35447ad8540359d9429b518 | [
"MIT"
] | 1 | 2020-10-20T20:50:51.000Z | 2020-10-20T20:50:51.000Z | medios/diarios/diario.py | miglesias91/dicenlosmedios | 1f8867cd09689006f35447ad8540359d9429b518 | [
"MIT"
] | 8 | 2021-03-19T01:17:28.000Z | 2022-03-02T14:57:48.000Z | medios/diarios/diario.py | miglesias91/dicenlosmedios | 1f8867cd09689006f35447ad8540359d9429b518 | [
"MIT"
] | null | null | null | import dateutil
import yaml
import feedparser as fp
import newspaper as np
from medios.medio import Medio
from medios.diarios.noticia import Noticia
from bd.entidades import Kiosco
class Diario(Medio):
def __init__(self, etiqueta):
Medio.__init__(self, etiqueta)
self.noticias = []
self.f... | 34.860759 | 160 | 0.579521 |
3316185d50cbae3e04049541c1a7eb7f88053baa | 8,723 | py | Python | lib/streamlit/elements/write.py | jjdelvalle/streamlit | e4fcfcb951e4fdd8e0f34d355310e750b96aea09 | [
"Apache-2.0"
] | null | null | null | lib/streamlit/elements/write.py | jjdelvalle/streamlit | e4fcfcb951e4fdd8e0f34d355310e750b96aea09 | [
"Apache-2.0"
] | null | null | null | lib/streamlit/elements/write.py | jjdelvalle/streamlit | e4fcfcb951e4fdd8e0f34d355310e750b96aea09 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 38.091703 | 89 | 0.576178 |
33161c8e0fbae70ece02ff46c53f4f6d1cbc1358 | 2,430 | py | Python | ansiblemetrics/playbook/num_blocks_error_handling.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | 1 | 2020-04-24T16:09:14.000Z | 2020-04-24T16:09:14.000Z | ansiblemetrics/playbook/num_blocks_error_handling.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | ansiblemetrics/playbook/num_blocks_error_handling.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | from ansiblemetrics.ansible_metric import AnsibleMetric
class NumBlocksErrorHandling(AnsibleMetric):
""" This class measures the number of times errors are handled within the blocks tasks.
Blocks introduce the ability to handle errors in a way similar to exceptions in most programming languages.
The task... | 34.225352 | 115 | 0.539918 |
331640d2acf106454de27a539a48f12d3143e72f | 1,915 | py | Python | python/webapp-userreg-flask-mysql/app/models.py | parijatmishra/learn | e69e3e866d7a35940f405e94e00cb90059413dab | [
"Apache-2.0"
] | null | null | null | python/webapp-userreg-flask-mysql/app/models.py | parijatmishra/learn | e69e3e866d7a35940f405e94e00cb90059413dab | [
"Apache-2.0"
] | 8 | 2020-09-04T20:14:10.000Z | 2022-03-08T22:43:37.000Z | python/webapp-userreg-flask-mysql/app/models.py | parijatmishra/learn | e69e3e866d7a35940f405e94e00cb90059413dab | [
"Apache-2.0"
] | null | null | null | from . import db
from werkzeug.security import generate_password_hash, check_password_hash
from app import login_manager
from flask.ext.login import UserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
class Role(db.Model):
__tablename__ = "roles"
id =... | 30.887097 | 73 | 0.681462 |
3316413b647e3667c9e621c76e4278a1c9d32122 | 1,261 | py | Python | fastapi/config/conf.py | ilDug/docker-utils | 6580e916a8c2c0d91f2e3da52a9d839507569bb7 | [
"MIT"
] | null | null | null | fastapi/config/conf.py | ilDug/docker-utils | 6580e916a8c2c0d91f2e3da52a9d839507569bb7 | [
"MIT"
] | null | null | null | fastapi/config/conf.py | ilDug/docker-utils | 6580e916a8c2c0d91f2e3da52a9d839507569bb7 | [
"MIT"
] | null | null | null | from decouple import config
from pathlib import Path
# MONGO
###############################
MONGO_USER_PW = config("MONGO_USER_PW")
MONGO_USER_NAME = config("MONGO_USER_NAME")
MONGO_DB = config("MONGO_DB")
MONGO_HOST = config("MONGO_HOST")
MONGO_PORT = config("MONGO_PORT")
MONGO_CS = f"mongodb://{MONGO_USER_NAME}:{M... | 29.325581 | 111 | 0.655829 |
33166432bb858d56d96df862a041f90e575de36e | 6,231 | py | Python | license.py | TauferLab/llnl-hatchet | c7d12888d71d2b23058facd3025e7dcfa12cbb39 | [
"MIT"
] | null | null | null | license.py | TauferLab/llnl-hatchet | c7d12888d71d2b23058facd3025e7dcfa12cbb39 | [
"MIT"
] | null | null | null | license.py | TauferLab/llnl-hatchet | c7d12888d71d2b23058facd3025e7dcfa12cbb39 | [
"MIT"
] | null | null | null | # Copyright 2017-2022 Lawrence Livermore National Security, LLC and other
# Hatchet Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: MIT
from __future__ import print_function
import os
import re
from collections import defaultdict
import sys
#: SPDX license id must appea... | 30.694581 | 84 | 0.622051 |
33166aad33e98e0165bfffde4e73356a91ef5965 | 11,571 | py | Python | ABLIRC/bin/public/count_reads_in_bed.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:08:20.000Z | 2020-02-25T13:08:20.000Z | ABLIRC/bin/public/count_reads_in_bed.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:16:03.000Z | 2020-02-25T13:16:03.000Z | ABLIRC/bin/public/count_reads_in_bed.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
####################################################################################
### Copyright (C) 2015-2019 by ABLIFE
####################################################################################
#########################################################... | 31.442935 | 146 | 0.407571 |
33167caaf99d6b4ada20a8afac36991ba4e0d920 | 17,720 | py | Python | lamb/parsing.py | rawlins/lambda-notebook | 5da92a8625b9ad516d5084ca833d71eec14e0da3 | [
"BSD-3-Clause"
] | 13 | 2016-01-18T17:33:50.000Z | 2022-01-19T02:43:08.000Z | lamb/parsing.py | rawlins/lambda-notebook | 5da92a8625b9ad516d5084ca833d71eec14e0da3 | [
"BSD-3-Clause"
] | 11 | 2016-02-10T20:48:44.000Z | 2019-09-06T15:31:53.000Z | lamb/parsing.py | rawlins/lambda-notebook | 5da92a8625b9ad516d5084ca833d71eec14e0da3 | [
"BSD-3-Clause"
] | 4 | 2018-11-27T14:45:49.000Z | 2021-06-05T17:08:40.000Z | import sys, re, traceback, collections
from lamb import utils
from lamb.utils import *
Tree = utils.get_tree_class()
global eq_transforms
eq_transforms = dict()
class ParseError(Exception):
def __init__(self, msg, s=None, i=None, met_preconditions=True, e=None):
self.s = s
self.i = i
if e... | 34.341085 | 80 | 0.540801 |
331682e4373ccd2b2b4607d7fe9d1bc89a6549fd | 34 | py | Python | apps/PoolBasedTripletMDS/algs/ValidationSampling/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | apps/PoolBasedTripletMDS/algs/ValidationSampling/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | apps/PoolBasedTripletMDS/algs/ValidationSampling/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | from .ValidationSampling import *
| 17 | 33 | 0.823529 |
3316a2a6569edf1533a270fe10dae1046ef528f2 | 3,299 | py | Python | core/tests/programs.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | 1 | 2020-07-18T02:14:51.000Z | 2020-07-18T02:14:51.000Z | core/tests/programs.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | null | null | null | core/tests/programs.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | 1 | 2020-02-22T18:21:04.000Z | 2020-02-22T18:21:04.000Z | from core.tests.base import BaseTestCase
from django.core.management import call_command
from core.models import Service, Program
from rest_framework import status
import random
import json
class ProgramsTests(BaseTestCase):
fixtures = ['services.yaml', 'programs.yaml',]
def test_get_programs_list(self):
... | 34.726316 | 86 | 0.645044 |
3316e0dde83c7a010b212a311533075ad3bdedd2 | 560 | py | Python | ferrox/lib/mimetype.py | hsuaz/ferrox | ac89b698e6c12c57c7a3128b6a25a3dc100bfc15 | [
"MIT"
] | 3 | 2017-01-03T20:55:16.000Z | 2022-03-01T15:21:53.000Z | ferrox/lib/mimetype.py | hsuaz/ferrox | ac89b698e6c12c57c7a3128b6a25a3dc100bfc15 | [
"MIT"
] | null | null | null | ferrox/lib/mimetype.py | hsuaz/ferrox | ac89b698e6c12c57c7a3128b6a25a3dc100bfc15 | [
"MIT"
] | 4 | 2017-01-03T20:48:09.000Z | 2022-03-01T15:21:58.000Z | import os.path
import mimetypes
try:
import magic
def get_mime_type(fileobject):
ms = magic.open(magic.MAGIC_MIME)
ms.load()
type = ms.buffer(fileobject['content'])
ms.close()
if ';' in type:
return type.split(';')[0]
return type
except ImportError:
... | 26.666667 | 62 | 0.644643 |
3316ee5476bc49f9b5f520309b50780e05eba34c | 32,168 | py | Python | mzidGenerator/psims/xml.py | toppic-suite/topmsv | fef5d1f1f1c00ffdad2c258401d319f1e227c7cb | [
"Apache-2.0"
] | null | null | null | mzidGenerator/psims/xml.py | toppic-suite/topmsv | fef5d1f1f1c00ffdad2c258401d319f1e227c7cb | [
"Apache-2.0"
] | 8 | 2021-02-19T18:42:42.000Z | 2022-02-10T17:37:42.000Z | mzidGenerator/psims/xml.py | toppic-suite/topmsv | fef5d1f1f1c00ffdad2c258401d319f1e227c7cb | [
"Apache-2.0"
] | 1 | 2021-04-19T11:55:08.000Z | 2021-04-19T11:55:08.000Z | import re
import warnings
from contextlib import contextmanager
from collections import deque, OrderedDict
from lxml import etree
from six import string_types as basestring, add_metaclass, text_type, PY3
from . import controlled_vocabulary
from .controlled_vocabulary import obj_to_xsdtype
from .validation import va... | 29.457875 | 106 | 0.591955 |
3316f2915e2a18ce8d61fa6da500a1c1ba4e5bc1 | 5,028 | py | Python | ApiManager/managers.py | wishchen/HttpRunnerManager | 1e72baa8a84ca70124af908ac683bf88b869d48a | [
"MIT"
] | null | null | null | ApiManager/managers.py | wishchen/HttpRunnerManager | 1e72baa8a84ca70124af908ac683bf88b869d48a | [
"MIT"
] | null | null | null | ApiManager/managers.py | wishchen/HttpRunnerManager | 1e72baa8a84ca70124af908ac683bf88b869d48a | [
"MIT"
] | null | null | null | from django.db import models
'''用户类型表操作'''
class UserTypeManager(models.Manager):
def insert_user_type(self, user_type):
self.create(user_type=user_type)
def insert_type_name(self, type_name):
self.create(type_name=type_name)
def insert_type_desc(self, type_desc):
self.create(ty... | 32.230769 | 101 | 0.638027 |
3317308c88d9211e26e10ba3dac135112c85bb68 | 5,613 | py | Python | Tools/py_tools/fm_util.py | Se64s/MEGADRIVER | e80c0270142aeddf01735d478706b83d5ca2dc68 | [
"MIT"
] | 2 | 2020-05-13T11:30:47.000Z | 2022-01-20T21:39:17.000Z | Tools/py_tools/fm_util.py | Se64s/MEGADRIVER | e80c0270142aeddf01735d478706b83d5ca2dc68 | [
"MIT"
] | null | null | null | Tools/py_tools/fm_util.py | Se64s/MEGADRIVER | e80c0270142aeddf01735d478706b83d5ca2dc68 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""
Utility to extract YM2612 reg info from VGI files
"""
import argparse
import struct
import YM2612
import time
import sys
def read_byte(file_handler):
return struct.unpack('B', file_handler.read(1))[0]
def load_vgi_file(file_path, ym_handler):
retval = False
print ("VGI: LOAD FIL... | 41.272059 | 123 | 0.659184 |
331778577a946915ce509728999dd8392d30338d | 2,743 | py | Python | src/smepu/click.py | yapweiyih/amazon-sagemaker-entrypoint-utilities | 5c01bf0717cd6dbe9ba0114c21cffb84fbf9136b | [
"MIT-0"
] | 1 | 2021-07-10T21:52:20.000Z | 2021-07-10T21:52:20.000Z | src/smepu/click.py | yapweiyih/amazon-sagemaker-entrypoint-utilities | 5c01bf0717cd6dbe9ba0114c21cffb84fbf9136b | [
"MIT-0"
] | null | null | null | src/smepu/click.py | yapweiyih/amazon-sagemaker-entrypoint-utilities | 5c01bf0717cd6dbe9ba0114c21cffb84fbf9136b | [
"MIT-0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""Placeholder."""
import os
from pathlib import Path
from typing import Callable, List
import click
def sm_protocol(
model: str = "model",
output: str = "output",
channels: List[str] = ["train", "test"... | 33.864198 | 110 | 0.637258 |
33178961a99bb2d3db580f1596cae83eb2a5ade1 | 3,690 | py | Python | study/hfppnetwork/hfppnetwork/sms/externals.py | NASA-Tournament-Lab/CoECI-CMS-Healthcare-Fraud-Prevention | 4facd935920e77239c25323ca7e233cb899ba9f5 | [
"Apache-2.0"
] | 7 | 2015-07-15T06:47:16.000Z | 2020-10-17T20:51:09.000Z | study/hfppnetwork/hfppnetwork/sms/externals.py | NASA-Tournament-Lab/CoECI-CMS-Healthcare-Fraud-Prevention | 4facd935920e77239c25323ca7e233cb899ba9f5 | [
"Apache-2.0"
] | null | null | null | study/hfppnetwork/hfppnetwork/sms/externals.py | NASA-Tournament-Lab/CoECI-CMS-Healthcare-Fraud-Prevention | 4facd935920e77239c25323ca7e233cb899ba9f5 | [
"Apache-2.0"
] | 8 | 2017-01-30T02:27:01.000Z | 2021-04-21T04:15:48.000Z | # -*- coding: utf-8 -*-
"""
Copyright (C) 2013 TopCoder Inc., All Rights Reserved.
This is module that represents all the externals.
Currently it is mock implementation.
@author: TCSASSEMBLER
@version: 1.0
"""
from hfppnetwork.sms.models import BeneficiaryClaimData, CarrierClaimData,\
InpatientClaimData, Outpati... | 32.946429 | 109 | 0.677778 |
33178b22a93dd1872303f2d517468623f45e3438 | 4,999 | py | Python | ros_atlas/core/BaseInference.py | patrick-ubc/Huawei_HiFly_Drone | 5dae1b56f49c2b86c3b852bbc5e3a63e84ccd490 | [
"Apache-2.0"
] | 1 | 2021-09-21T23:23:59.000Z | 2021-09-21T23:23:59.000Z | ros_atlas/core/BaseInference.py | patrick-ubc/Huawei_HiFly_Drone | 5dae1b56f49c2b86c3b852bbc5e3a63e84ccd490 | [
"Apache-2.0"
] | 8 | 2021-07-05T21:41:53.000Z | 2022-02-15T19:46:13.000Z | ros_atlas/core/BaseInference.py | patrick-ubc/Huawei_HiFly_Drone | 5dae1b56f49c2b86c3b852bbc5e3a63e84ccd490 | [
"Apache-2.0"
] | 4 | 2021-06-11T22:47:04.000Z | 2021-07-29T19:57:13.000Z | """
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is... | 42.726496 | 164 | 0.669334 |
3317937b0f2cc1cd699a94798bb4cf9a4df01b00 | 1,422 | py | Python | tests/conftest.py | KonstantinTogoi/aiovkcom | db4a0789841496a5800bf86118f920eb4652b6ca | [
"BSD-2-Clause"
] | 1 | 2020-01-12T13:32:16.000Z | 2020-01-12T13:32:16.000Z | tests/conftest.py | KonstantinTogoi/aiovkcom | db4a0789841496a5800bf86118f920eb4652b6ca | [
"BSD-2-Clause"
] | null | null | null | tests/conftest.py | KonstantinTogoi/aiovkcom | db4a0789841496a5800bf86118f920eb4652b6ca | [
"BSD-2-Clause"
] | 1 | 2019-12-06T10:03:05.000Z | 2019-12-06T10:03:05.000Z | import json
from os.path import dirname, join
import pytest
from aiovkcom.sessions import TokenSession
data_path = join(dirname(__file__), 'data')
@pytest.fixture
def error():
return {'error': {
'error_code': -1, 'error_msg': 'test error msg', 'request_params': {}
}}
@pytest.fixture
def dummy():... | 20.608696 | 77 | 0.649789 |
3317b5bf8507a7937426c2acb20d8d91f49a632b | 7,234 | py | Python | graphony/graph.py | vishalbelsare/Graphony | d03c789ffa5b82017567f66e8547dd1b850dd63b | [
"Apache-2.0"
] | 3 | 2021-09-15T19:24:53.000Z | 2021-12-15T21:32:15.000Z | graphony/graph.py | vishalbelsare/Graphony | d03c789ffa5b82017567f66e8547dd1b850dd63b | [
"Apache-2.0"
] | null | null | null | graphony/graph.py | vishalbelsare/Graphony | d03c789ffa5b82017567f66e8547dd1b850dd63b | [
"Apache-2.0"
] | 1 | 2021-09-15T19:25:26.000Z | 2021-09-15T19:25:26.000Z | """
Graph objects
"""
import csv
from functools import lru_cache
from pickle import dumps, loads
import psycopg2 as pg
from .util import query
from .property import Property
from .node import Node
class Graph:
"""Graph objects"""
_LRU_MAXSIZE = None
def __init__(self, dsn, properties=None):
se... | 30.91453 | 96 | 0.526403 |
3318067fdf6aa4549f5a7773509554c759053be9 | 13,729 | py | Python | tradition/edge/contour_detect_3d_V2.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | 3 | 2018-10-16T09:36:12.000Z | 2019-04-15T03:12:49.000Z | tradition/edge/contour_detect_3d_V2.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | tradition/edge/contour_detect_3d_V2.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | import os
import cv2
import numpy as np
import os
import shutil
import time
import random
import math
import functools
class Point(object):
def __init__(self, x, y):
self.x = x
self.y = y
def __str__(self):
return '[{},{}]'.format(self.x,self.y)
def cmp(a, b, c):
if a.x-c.x >= ... | 41.477341 | 156 | 0.554301 |
331816ec23c974bd1653f8965d299ddd14a2b756 | 3,034 | py | Python | builder/mypy_boto3_builder/parsers/parse_resource.py | jbpratt78/mypy_boto3 | c1cfc39aa5643ca149dd6a4b16124826fcc28fa0 | [
"MIT"
] | null | null | null | builder/mypy_boto3_builder/parsers/parse_resource.py | jbpratt78/mypy_boto3 | c1cfc39aa5643ca149dd6a4b16124826fcc28fa0 | [
"MIT"
] | null | null | null | builder/mypy_boto3_builder/parsers/parse_resource.py | jbpratt78/mypy_boto3 | c1cfc39aa5643ca149dd6a4b16124826fcc28fa0 | [
"MIT"
] | null | null | null | """
Parser for Boto3 ServiceResource sub-resource, produces `structures.Resource`
"""
import inspect
from typing import Dict, Type
from types import FunctionType
from boto3.docs.utils import is_resource_action
from boto3.resources.base import ServiceResource as Boto3ServiceResource
from mypy_boto3_builder.service_na... | 30.646465 | 88 | 0.709624 |
3318192592f1ab484361f83feb37d9121d359d75 | 1,398 | py | Python | magnum/conductor/handlers/x509keypair_conductor.py | gyliu513/magnum | 943eba8a7b03b11878399198091327d2e1b90fcb | [
"Apache-2.0"
] | null | null | null | magnum/conductor/handlers/x509keypair_conductor.py | gyliu513/magnum | 943eba8a7b03b11878399198091327d2e1b90fcb | [
"Apache-2.0"
] | null | null | null | magnum/conductor/handlers/x509keypair_conductor.py | gyliu513/magnum | 943eba8a7b03b11878399198091327d2e1b90fcb | [
"Apache-2.0"
] | 1 | 2020-09-09T14:35:08.000Z | 2020-09-09T14:35:08.000Z | # Copyright 2015 NEC 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 License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 32.511628 | 79 | 0.715308 |
33185bd44b100287fa77bee6c3af036c2044ef8f | 1,226 | py | Python | common/common/sql/fixed_point.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | 2 | 2022-03-17T04:50:20.000Z | 2022-03-17T04:51:31.000Z | common/common/sql/fixed_point.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | common/common/sql/fixed_point.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | import decimal
from typing import TYPE_CHECKING, Optional
import sqlalchemy.types as types
from sqlalchemy.engine.interfaces import Dialect
if TYPE_CHECKING:
FixedPointEngine = types.TypeDecorator[decimal.Decimal] # pylint: disable=unsubscriptable-object
else:
FixedPointEngine = types.TypeDecorator
class F... | 34.055556 | 108 | 0.693312 |
331860fbbad5174dc2306202d1ba16a00a1c9232 | 4,556 | py | Python | test/connector/exchange/bitmax/test_bitmax_order_book_tracker.py | RBUB-Yatirim/hummingbot | 6b278932d423110b70d723c2b11c6ddf668cb367 | [
"Apache-2.0"
] | 37 | 2020-07-08T03:44:26.000Z | 2022-01-16T12:35:26.000Z | test/connector/exchange/bitmax/test_bitmax_order_book_tracker.py | RBUB-Yatirim/hummingbot | 6b278932d423110b70d723c2b11c6ddf668cb367 | [
"Apache-2.0"
] | 3 | 2021-04-13T10:40:05.000Z | 2021-05-09T16:15:42.000Z | test/connector/exchange/bitmax/test_bitmax_order_book_tracker.py | RBUB-Yatirim/hummingbot | 6b278932d423110b70d723c2b11c6ddf668cb367 | [
"Apache-2.0"
] | 7 | 2020-07-08T04:13:39.000Z | 2021-03-22T09:47:26.000Z | #!/usr/bin/env python
import sys
import math
import time
import asyncio
import logging
import unittest
from os.path import join, realpath
from typing import Dict, Optional, List
from hummingbot.core.event.event_logger import EventLogger
from hummingbot.core.event.events import OrderBookEvent, OrderBookTradeEvent, Trade... | 43.807692 | 118 | 0.692713 |
33187931ef09451c610a0b7615bef2727d5b9acc | 1,183 | py | Python | src/__version__.py | pBouillon/pynterpreter | 5501d1b59d08b80b3a8cd299cbd2e2e8d2817eae | [
"MIT"
] | 1 | 2018-05-26T00:53:17.000Z | 2018-05-26T00:53:17.000Z | src/__version__.py | pBouillon/pynterpreter | 5501d1b59d08b80b3a8cd299cbd2e2e8d2817eae | [
"MIT"
] | 11 | 2018-02-08T08:01:57.000Z | 2018-02-23T15:49:08.000Z | src/__version__.py | pBouillon/pynterpreter | 5501d1b59d08b80b3a8cd299cbd2e2e8d2817eae | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2018 Pierre Bouillon [https://pierrebouillon.tech/]
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 restrict... | 40.793103 | 78 | 0.783601 |
331892d685a6e5dc4e4263d3c3c8640c8c076c70 | 1,237 | py | Python | tron/Nubs/alerts.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | tron/Nubs/alerts.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | tron/Nubs/alerts.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | import os.path
from tron import g, hub
from tron.Hub.Command.Encoders.ASCIICmdEncoder import ASCIICmdEncoder
from tron.Hub.Nub.SocketActorNub import SocketActorNub
from tron.Hub.Reply.Decoders.ASCIIReplyDecoder import ASCIIReplyDecoder
from tron.Misc import cfg
name = 'alerts'
def start(poller):
my_cfg = cfg.... | 30.170732 | 94 | 0.611156 |
3318bade09028f52b73ad9282664dbcebeead81b | 475 | py | Python | services/swagger/views.py | Bellboy-Capstone/Services | 36888d90fe7ba4b2afc2ea8ad4839a8e13c7f98b | [
"MIT"
] | null | null | null | services/swagger/views.py | Bellboy-Capstone/Services | 36888d90fe7ba4b2afc2ea8ad4839a8e13c7f98b | [
"MIT"
] | 5 | 2020-10-07T16:31:54.000Z | 2022-03-01T22:16:54.000Z | services/swagger/views.py | Bellboy-Capstone/Services | 36888d90fe7ba4b2afc2ea8ad4839a8e13c7f98b | [
"MIT"
] | 2 | 2020-10-04T23:57:00.000Z | 2020-10-10T03:14:18.000Z | from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework.authentication import SessionAuthentication, TokenAuthentication
from rest_framework.permissions import IsAuthenticatedOrReadOnly
swagger_view = get_schema_view(
openapi.Info(title="Bellboy Services Autodocs", default_versi... | 39.583333 | 84 | 0.84 |
3318cd40b04ab3fa609e2050c3ba1d53388b10e4 | 91 | py | Python | feedstorage/tests/__init__.py | YAmikep/django-feedstorage | 69e6c2bb8ffa6dca357091ae2b97f50bf6234799 | [
"BSD-3-Clause"
] | 1 | 2016-10-12T12:30:17.000Z | 2016-10-12T12:30:17.000Z | feedstorage/tests/__init__.py | YAmikep/django-feedstorage | 69e6c2bb8ffa6dca357091ae2b97f50bf6234799 | [
"BSD-3-Clause"
] | null | null | null | feedstorage/tests/__init__.py | YAmikep/django-feedstorage | 69e6c2bb8ffa6dca357091ae2b97f50bf6234799 | [
"BSD-3-Clause"
] | null | null | null | from .utils.http import *
from .utils.loggers import *
from .utils.serializers import *
| 22.75 | 33 | 0.736264 |
3318eee5d5ba3ed47853d7899a98fbb2645f3ebe | 25,080 | py | Python | exp3/exp3g/exp3g.py | Haunter17/MIR_SU17 | 0eaefb8cab78ca896c1ed0074892c296110eb161 | [
"MIT"
] | null | null | null | exp3/exp3g/exp3g.py | Haunter17/MIR_SU17 | 0eaefb8cab78ca896c1ed0074892c296110eb161 | [
"MIT"
] | 5 | 2017-05-22T20:32:07.000Z | 2017-06-02T21:06:23.000Z | exp3/exp3g/exp3g.py | Haunter17/MIR_SU17 | 0eaefb8cab78ca896c1ed0074892c296110eb161 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
import h5py
import time
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import sys
# Functions for initializing neural nets parameters
def init_weight_variable(shape, nameIn):
initial = tf.truncated_normal(shape, stddev=0.1, dtype=tf.float32)
retu... | 41.25 | 218 | 0.734848 |
3318f29487f9c6177e3ead678abf7d0e15470126 | 17 | py | Python | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/Lobby/lobby.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/Lobby/lobby.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/Lobby/lobby.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Lobby: pass | 17 | 17 | 0.823529 |
33190129cb004d519e2b83ccaf307c2da090c73e | 3,657 | py | Python | src/robot/model/testcase.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/model/testcase.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/model/testcase.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... | 30.22314 | 78 | 0.645885 |
33191263be662af17feaf5b2ec0e5a0f0bc0f85e | 24,953 | py | Python | test/test_store.py | geoanalytics-ca/xcube-cds | 485928249896cf6e0d37e450be1038f79f79fe0b | [
"MIT"
] | null | null | null | test/test_store.py | geoanalytics-ca/xcube-cds | 485928249896cf6e0d37e450be1038f79f79fe0b | [
"MIT"
] | null | null | null | test/test_store.py | geoanalytics-ca/xcube-cds | 485928249896cf6e0d37e450be1038f79f79fe0b | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Brockmann Consult GmbH
#
# 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, modi... | 42.079258 | 80 | 0.61684 |
33192f351d413cf5d390ecf84014ca9f66aacfa3 | 10,748 | py | Python | apysc/_event/mouse_event.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | apysc/_event/mouse_event.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | apysc/_event/mouse_event.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | """Class implementation for the mouse event.
"""
from typing import Generic
from typing import TypeVar
from apysc._event.event import Event
from apysc._event.prevent_default_interface import PreventDefaultInterface
from apysc._event.stop_propagation_interface import StopPropagationInterface
from apysc._type.... | 34.448718 | 77 | 0.533588 |
33193c2a64207c1183330c27a42bd80b4a8def1f | 35,027 | py | Python | crosshair/condition_parser.py | Rik-de-Kort/CrossHair | e0a06969d571aebcc582359afdedf25f38630c0d | [
"MIT"
] | null | null | null | crosshair/condition_parser.py | Rik-de-Kort/CrossHair | e0a06969d571aebcc582359afdedf25f38630c0d | [
"MIT"
] | null | null | null | crosshair/condition_parser.py | Rik-de-Kort/CrossHair | e0a06969d571aebcc582359afdedf25f38630c0d | [
"MIT"
] | null | null | null | import ast
import collections
import contextlib
import enum
from functools import partial
from functools import wraps
import inspect
from inspect import BoundArguments
import re
import sys
import textwrap
import traceback
import types
from dataclasses import dataclass
from dataclasses import replace
from typing import ... | 34.006796 | 101 | 0.589374 |
33194983b71489d89faa84011f63f2162ccf6fe4 | 4,223 | py | Python | bigml/fusionhandler.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:38.000Z | 2021-08-30T20:18:38.000Z | bigml/fusionhandler.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | null | null | null | bigml/fusionhandler.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:40.000Z | 2021-08-30T20:18:40.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2018-2019 BigML
#
# 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 requi... | 34.333333 | 76 | 0.627516 |
33195aff08d5c7ff5911cb34f5814cb40ea5d8a8 | 4,366 | py | Python | input_dataset.py | greisane/transfer-learning-conv-ai | 8f15f7a3f573fc4109243f282c867e4408d4440b | [
"MIT"
] | null | null | null | input_dataset.py | greisane/transfer-learning-conv-ai | 8f15f7a3f573fc4109243f282c867e4408d4440b | [
"MIT"
] | null | null | null | input_dataset.py | greisane/transfer-learning-conv-ai | 8f15f7a3f573fc4109243f282c867e4408d4440b | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from utils import PERSONACHAT_URL, preprocess_utterance
import colorama as con
import json
import re
SEPARATOR = "=" * 40
def sanitize(text):
parts = re.split(r"([!?.,:;])", text.lower())
return ' '.join(s.strip() for s in parts if s)
def print_line(text, end='... | 36.082645 | 100 | 0.571232 |
33197ddd5c30d89fe2f3af31503e85443242a454 | 2,291 | py | Python | superset/models/annotations.py | visshaljagtap/incubator-superset | c9c18011f3cbee144ef8f76568449a4b83325773 | [
"Apache-2.0"
] | 11 | 2018-01-16T16:52:12.000Z | 2020-06-12T12:17:03.000Z | superset/models/annotations.py | visshaljagtap/incubator-superset | c9c18011f3cbee144ef8f76568449a4b83325773 | [
"Apache-2.0"
] | 108 | 2019-06-10T05:48:22.000Z | 2021-07-26T04:20:03.000Z | superset/models/annotations.py | visshaljagtap/incubator-superset | c9c18011f3cbee144ef8f76568449a4b83325773 | [
"Apache-2.0"
] | 4 | 2020-06-25T10:42:36.000Z | 2020-08-13T05:39:09.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.796875 | 81 | 0.718027 |
3319a26aaf21c440d2261f1ef09f9f3bffa1431f | 7,674 | py | Python | aws_xray_sdk/core/patcher.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 294 | 2017-10-10T19:01:04.000Z | 2022-03-18T15:52:19.000Z | aws_xray_sdk/core/patcher.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 285 | 2017-10-20T09:27:21.000Z | 2022-03-29T15:33:45.000Z | aws_xray_sdk/core/patcher.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 134 | 2017-10-11T13:55:17.000Z | 2022-03-23T07:21:17.000Z | import importlib
import inspect
import logging
import os
import pkgutil
import re
import sys
import wrapt
from aws_xray_sdk import global_sdk_config
from .utils.compat import PY2, is_classmethod, is_instance_method
log = logging.getLogger(__name__)
SUPPORTED_MODULES = (
'aiobotocore',
'botocore',
'pynamo... | 35.041096 | 117 | 0.666797 |
3319a30c2e9cdf001ee86786babf932f5a111444 | 388 | py | Python | sample/django_wiki/mysite/wiki/models.py | william-os4y/fapws2 | 5752af742b763517ce0a52d0f0c00b40b186edf8 | [
"MIT"
] | 2 | 2016-05-08T16:02:32.000Z | 2018-02-17T15:03:09.000Z | sample/django_wiki/mysite/wiki/models.py | william-os4y/fapws2 | 5752af742b763517ce0a52d0f0c00b40b186edf8 | [
"MIT"
] | null | null | null | sample/django_wiki/mysite/wiki/models.py | william-os4y/fapws2 | 5752af742b763517ce0a52d0f0c00b40b186edf8 | [
"MIT"
] | null | null | null | from django.db import models
from django.conf import settings
class Wikipage(models.Model):
"""Wiki page storage"""
title = models.CharField(maxlength=30)
content = models.TextField()
def editurl(self):
return settings.WIKI_SITEBASE + "edit/" + self.title + "/"
def __repr__(self):
... | 24.25 | 66 | 0.657216 |
3319c9741db8621e2edac707d42f4f1c2295b1a7 | 4,030 | py | Python | src/ipc_layer.py | unified-moderation-network/salamander | 98578aa1974a0d7778569ac9d822f13614d31269 | [
"Apache-2.0"
] | 10 | 2020-08-20T21:25:01.000Z | 2021-06-30T05:28:24.000Z | src/ipc_layer.py | mikeshardmind/salamander | f57ba6a8b2b2c9e2fb238df9595caf8ee51f18bf | [
"Apache-2.0"
] | 61 | 2020-09-28T14:56:23.000Z | 2022-02-19T20:04:59.000Z | src/ipc_layer.py | mikeshardmind/salamander | f57ba6a8b2b2c9e2fb238df9595caf8ee51f18bf | [
"Apache-2.0"
] | 2 | 2020-10-03T17:07:57.000Z | 2020-11-02T02:06:11.000Z | # Copyright 2020-present Michael Hall
#
# 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... | 38.75 | 114 | 0.673697 |
3319ca744c2e8afa88cd0af8fca4808e41bfc12c | 933 | py | Python | stats/src/update_errors.py | kbaseapps/refseq_importer | 33701fef231b7aa99cf32de420941e432eb753dd | [
"MIT"
] | null | null | null | stats/src/update_errors.py | kbaseapps/refseq_importer | 33701fef231b7aa99cf32de420941e432eb753dd | [
"MIT"
] | 2 | 2020-09-23T00:17:19.000Z | 2020-09-29T18:46:18.000Z | stats/src/update_errors.py | kbaseapps/refseq_importer | 33701fef231b7aa99cf32de420941e432eb753dd | [
"MIT"
] | null | null | null | """
Update error statuses to pending based on a pattern match for the error
message.
"""
import sys
import json
import os
import plyvel
dbdir = os.environ.get('WORKDIR', '/kb/module/work/import_state')
db = plyvel.DB(dbdir)
def main(pattern: str):
print(f"Loading database from {dbdir}")
total_count = 0
f... | 26.657143 | 71 | 0.623794 |
3319fca5a5c980c8b90b69788cdc064f48eba5d7 | 2,613 | py | Python | venv/lib/python3.8/site-packages/dateparser/data/date_translation_data/nd.py | yuta-komura/vishnu | 67173b674d5f4f3be189474103612447ef69ab44 | [
"MIT"
] | 1 | 2021-11-17T04:55:14.000Z | 2021-11-17T04:55:14.000Z | dateparser/data/date_translation_data/nd.py | cool-RR/dateparser | c38336df521cc57d947dc2c9111539a72f801652 | [
"BSD-3-Clause"
] | null | null | null | dateparser/data/date_translation_data/nd.py | cool-RR/dateparser | c38336df521cc57d947dc2c9111539a72f801652 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
info = {
"name": "nd",
"date_order": "DMY",
"january": [
"zibandlela",
"zib"
],
"february": [
"nhlolanja",
"nhlo"
],
"march": [
"mbimbitho",
"mbi"
],
"april": [
"mabasa",
"mab"
],
"may": [... | 15.280702 | 26 | 0.273632 |
331a00e55e01c164666fa7202719577913a67710 | 10,494 | py | Python | src/script/package_data_gen.py | bincrafters/conan-boost_base | 06b161a93da699d70d8fe7df162b30e7078a243c | [
"MIT"
] | 1 | 2020-01-30T21:33:28.000Z | 2020-01-30T21:33:28.000Z | src/script/package_data_gen.py | bincrafters/conan-boost_base | 06b161a93da699d70d8fe7df162b30e7078a243c | [
"MIT"
] | 1 | 2019-01-16T22:31:50.000Z | 2019-01-16T22:31:50.000Z | src/script/package_data_gen.py | bincrafters/conan-boost_base | 06b161a93da699d70d8fe7df162b30e7078a243c | [
"MIT"
] | 5 | 2019-04-24T05:49:13.000Z | 2020-01-30T21:36:55.000Z | #!/usr/bin/env python3
"""
Copyright (C) 2018-2019 Rene Rivera.
Use, modification and distribution are subject to the
Boost Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
import os.path
from bls.git_tool import Git
from bls.util... | 42.658537 | 78 | 0.534782 |
331a0bff7bca07e7a7704c46008669cbd379d149 | 3,000 | py | Python | yearn/treasury/buckets.py | 0xean/yearn-exporter | 4afe6cd8d2342bf63e0e9a6a45f6f4531b46903c | [
"MIT"
] | 64 | 2021-03-14T22:10:08.000Z | 2022-03-30T17:41:11.000Z | yearn/treasury/buckets.py | mariuspod/yearn-exporter | 9140038ef8c208f409ad83358e2e1ba395cc5094 | [
"MIT"
] | 130 | 2021-03-03T17:11:51.000Z | 2022-03-30T22:51:17.000Z | yearn/treasury/buckets.py | mariuspod/yearn-exporter | 9140038ef8c208f409ad83358e2e1ba395cc5094 | [
"MIT"
] | 74 | 2021-03-03T17:06:39.000Z | 2022-03-30T11:28:09.000Z | from brownie import Contract
from yearn.cache import memory
from yearn.constants import BTC_LIKE, ETH_LIKE as _ETH_LIKE
from yearn.prices.balancer import is_balancer_pool
from yearn.prices.compound import compound
from yearn.prices.constants import stablecoins, weth
from yearn.prices.fixed_forex import fixed_forex
from... | 30.927835 | 83 | 0.697 |
331a0e3d681be710ec03ea2bf5110272f2da7052 | 2,487 | py | Python | tolqc-api/app/test/base/tests/test_enum_link_relationship_by_name.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | tolqc-api/app/test/base/tests/test_enum_link_relationship_by_name.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | tolqc-api/app/test/base/tests/test_enum_link_relationship_by_name.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2022 Genome Research Ltd.
#
# SPDX-License-Identifier: MIT
from test.base import BaseTestCase
class TestEnumLinkRelationshipByName(BaseTestCase):
def test_post_J_specify_I_by_name(self):
self.add_I(id=4857, name='nicely')
response = self.client.open(
'/api/v1... | 30.329268 | 84 | 0.439083 |
331a11536231ae62cfd536db6208f6ecd4bb4fd6 | 1,125 | py | Python | tbonlineproject/relatedcontent/templatetags/relatedcontenttags.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | null | null | null | tbonlineproject/relatedcontent/templatetags/relatedcontenttags.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | 3 | 2021-06-08T23:57:13.000Z | 2022-01-13T03:42:01.000Z | tbonlineproject/relatedcontent/templatetags/relatedcontenttags.py | nathangeffen/tbonline-2 | 0d5869197e66a0057fa07cb99f21dde7f5b47c30 | [
"MIT"
] | null | null | null | import re
from django import template
from relatedcontent.models import RelatedContent
register = template.Library()
class RelatedContentRetriever(template.Node):
def __init__(self, model_instance, var_name):
self.model_instance = model_instance
self.var_name = var_name
def render(self... | 26.785714 | 101 | 0.681778 |
331a1eb2db85acc1e6d7e8dbb8f9480206c8d4c5 | 9,410 | py | Python | tests/test_pieces.py | pelletier2017/ChessGame | 1a88e919d446708ead2c1ee0dce37093f8a9212f | [
"MIT"
] | 1 | 2020-08-23T17:14:06.000Z | 2020-08-23T17:14:06.000Z | tests/test_pieces.py | pelletier2017/ChessGame | 1a88e919d446708ead2c1ee0dce37093f8a9212f | [
"MIT"
] | 4 | 2017-08-10T02:41:31.000Z | 2021-06-01T21:20:15.000Z | tests/test_pieces.py | pelletier2017/ChessGame | 1a88e919d446708ead2c1ee0dce37093f8a9212f | [
"MIT"
] | null | null | null | import unittest
# required to make imports work
import sys
sys.path.append("../")
from chess.board import ChessBoard
from chess.pieces import (Pawn, Knight, Bishop, Rook, Queen, King,
P1_CHAR, P2_CHAR)
class TestPawn(unittest.TestCase):
def test_movement(self):
inpt_str = "1 k.... | 40.560345 | 100 | 0.46238 |
331a7db027ede75fcf8f24ba2fd227c7a9b52055 | 6,952 | py | Python | plot_weather_data.py | AlSimons/graph_ambient_weather | 696d4dd226255139e9001480cab43bc19083408a | [
"MIT"
] | 3 | 2021-04-09T09:41:42.000Z | 2021-12-12T11:20:07.000Z | plot_weather_data.py | AlSimons/graph_ambient_weather | 696d4dd226255139e9001480cab43bc19083408a | [
"MIT"
] | 2 | 2021-03-13T16:51:01.000Z | 2022-01-18T19:05:08.000Z | plot_weather_data.py | AlSimons/graph_ambient_weather | 696d4dd226255139e9001480cab43bc19083408a | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
"""
Plot selected weather data from the WS2000 backup, as loaded into the database.
"""
import argparse
import datetime
import math
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import sqlite3
def parse_args(data_types):
parser = argparse.ArgumentParser()
parser.ad... | 35.835052 | 80 | 0.580984 |
331aa0063ff886ce9a44050bced3b40f1a008fc7 | 6,590 | py | Python | userbot/modules/filter.py | monubot/monman | 8bf9790f9eff01be183bd8371a74b123ca17f59f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-07-16T17:50:43.000Z | 2021-07-16T17:50:43.000Z | userbot/modules/filter.py | Ferdisaja/Man-Userbot | c319ff6e706e1e18269d0f31e6ce89763c222403 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-07-07T02:04:58.000Z | 2021-07-07T02:04:58.000Z | userbot/modules/filter.py | Ferdisaja/Man-Userbot | c319ff6e706e1e18269d0f31e6ce89763c222403 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for filter commands """
from asyncio import sleep
from re import IGNORECASE, escape, search
from u... | 41.1875 | 160 | 0.611077 |
331aba39d7c261b6b70a1aea524a54133f280078 | 1,915 | py | Python | config/halo_config_files/kcc_config.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 27 | 2019-10-31T15:16:13.000Z | 2022-03-29T03:56:57.000Z | config/halo_config_files/kcc_config.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 4 | 2020-03-25T14:18:04.000Z | 2022-02-10T00:34:58.000Z | config/halo_config_files/kcc_config.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 7 | 2020-02-23T22:12:37.000Z | 2021-12-08T20:14:41.000Z | """The Process Parameter/KCC configuration file consists of parameters of each KCC of the assembly system. This is required for sampling/active learning strategy. Each KCC is appended as a dictionary in a list of KCCs. Each KCC has the following parameters
:param kcc_struct[index]['kcc_id']: Un... | 38.3 | 256 | 0.573368 |
331ae966545ee70d004a634fb8d05ad9e569a7e0 | 2,646 | py | Python | storjkademlia/storage.py | Storj/storjkademlia | 4199e40e789a294e579395e27ff5f588c5fd8263 | [
"MIT"
] | null | null | null | storjkademlia/storage.py | Storj/storjkademlia | 4199e40e789a294e579395e27ff5f588c5fd8263 | [
"MIT"
] | null | null | null | storjkademlia/storage.py | Storj/storjkademlia | 4199e40e789a294e579395e27ff5f588c5fd8263 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import time
try:
import itertools.izip as zip # py2
except ImportError:
pass
try:
import itertools.imap as map # py2
except ImportError:
pass
from itertools import takewhile
import operator
from collections import OrderedDict
from zope.interface import impl... | 24.275229 | 98 | 0.602041 |
331af0344bea07eb29abce836b4714cfd299f04a | 1,004 | py | Python | Newtons-method/plots.py | Robertboy18/Numerical-Algorithms-Implementation | e1ea13137d42ccc2502c590559edba750db4592d | [
"Apache-2.0"
] | null | null | null | Newtons-method/plots.py | Robertboy18/Numerical-Algorithms-Implementation | e1ea13137d42ccc2502c590559edba750db4592d | [
"Apache-2.0"
] | null | null | null | Newtons-method/plots.py | Robertboy18/Numerical-Algorithms-Implementation | e1ea13137d42ccc2502c590559edba750db4592d | [
"Apache-2.0"
] | null | null | null | # Change for any of the other files according to the need
xplot = np.linspace(-1, 1, 100)
x = np.linspace(-1, 1, 100)
xhat = 2 # remember that f(xhat) = 0 implies we set xhat = some value
# example f(x) = x^2 - 3
# then xhat = 3^0.5
# standard figures
figure(1, [7, 4])
xplot = linspace(-1, 2, 200)
plot(xplot, 0*xplot... | 33.466667 | 69 | 0.655378 |
331b4f9fc5b03ef474712e38d8f770c46940722e | 1,639 | py | Python | app/auth/views.py | Monroe100/personalblog | d4fc0cee23adc8927814077f734413efb8dad21d | [
"MIT"
] | null | null | null | app/auth/views.py | Monroe100/personalblog | d4fc0cee23adc8927814077f734413efb8dad21d | [
"MIT"
] | null | null | null | app/auth/views.py | Monroe100/personalblog | d4fc0cee23adc8927814077f734413efb8dad21d | [
"MIT"
] | null | null | null |
from flask import render_template,redirect,url_for,request,flash
from . import auth
from ..models import User
from flask_login import login_user,logout_user,login_required
from .forms import RegistrationForm, LoginForm
from .. import db
# registration route
@auth.route('/reqister',methods=['GET','POST'])
def registe... | 31.519231 | 97 | 0.683954 |
331b8081a96a9f508934e3702f12e2de8f83b6e2 | 9,570 | py | Python | utils/optim.py | lim0606/pytorch-ardae-vae | 52f460a90fa5822692031ab7dcca39fa9168988e | [
"MIT"
] | 11 | 2020-06-11T03:01:46.000Z | 2021-06-17T02:59:39.000Z | utils/optim.py | lim0606/pytorch-ardae-vae | 52f460a90fa5822692031ab7dcca39fa9168988e | [
"MIT"
] | 1 | 2020-06-18T00:59:24.000Z | 2020-06-19T22:55:14.000Z | utils/optim.py | lim0606/pytorch-ardae-vae | 52f460a90fa5822692031ab7dcca39fa9168988e | [
"MIT"
] | null | null | null | '''
https://github.com/pytorch/pytorch/blob/master/torch/optim/adam.py
'''
import math
import torch
from torch.optim.optimizer import Optimizer
class Adam(Optimizer):
r"""Implements Adam algorithm.
It has been proposed in `Adam: A Method for Stochastic Optimization`_.
Arguments:
params (iterable):... | 44.305556 | 116 | 0.571055 |
331ba16ff4eadda7e284c16d294f60cbc997e827 | 10,724 | py | Python | utils/tracker_rich.py | mwesleyj/geo-deep-learning | 9bb8942156fc1a19f8f5ac911e237daa30740ca9 | [
"MIT"
] | null | null | null | utils/tracker_rich.py | mwesleyj/geo-deep-learning | 9bb8942156fc1a19f8f5ac911e237daa30740ca9 | [
"MIT"
] | null | null | null | utils/tracker_rich.py | mwesleyj/geo-deep-learning | 9bb8942156fc1a19f8f5ac911e237daa30740ca9 | [
"MIT"
] | null | null | null | try:
import ashjdfioastkjl
from rich.table import Table, Column
from rich.progress import Task, _TrackThread, Progress, BarColumn, TextColumn, TimeElapsedColumn, \
TimeRemainingColumn, SpinnerColumn
from rich.panel import Panel
from rich.style import StyleType
from rich.text import Text,... | 45.058824 | 224 | 0.526389 |
331bb2e8fd4999d811d3dbe3499605119c170fbd | 1,673 | py | Python | tryalgo/kuhn_munkres_n4.py | xcarcelle/tryalgo | c159fbffbea0a4e8b70e8898c31c62c7e08a3865 | [
"MIT"
] | null | null | null | tryalgo/kuhn_munkres_n4.py | xcarcelle/tryalgo | c159fbffbea0a4e8b70e8898c31c62c7e08a3865 | [
"MIT"
] | null | null | null | tryalgo/kuhn_munkres_n4.py | xcarcelle/tryalgo | c159fbffbea0a4e8b70e8898c31c62c7e08a3865 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# jill-jenn vie et christoph durr - 2014-2018
__all__ = ["kuhn_munkres"]
# snip{
def improve_matching(G, u, mu, mv, au, av, lu, lv):
assert not au[u]
au[u] = True
for v in range(len(G)):
if not av[v] and G[u][v] == lu[u] + lv[v]:
av[v] = ... | 28.355932 | 71 | 0.485953 |
331bb2eca97d8b16286844d1e3cdf19e015c69a9 | 6,983 | py | Python | putil/pcsv/merge.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | 6 | 2015-12-15T04:09:08.000Z | 2020-02-21T01:40:57.000Z | putil/pcsv/merge.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | null | null | null | putil/pcsv/merge.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | 2 | 2016-01-21T23:29:17.000Z | 2020-02-21T01:41:05.000Z | # merge.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,W0105,W0611
# Putil imports
import putil.exh
import putil.pcontracts
from putil.ptypes import (
csv_col_filter,
csv_row_filter,
file_name,
file_name_exists,
non_negative_integer
)
from .csv_... | 33.898058 | 79 | 0.632393 |
331bb897976a500d967c86b5fb1215bad682f556 | 2,336 | py | Python | torchblocks/models/nn/bert_for_attr.py | deepframwork/TorchBlocks | 35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | [
"MIT"
] | 1 | 2021-04-26T08:01:25.000Z | 2021-04-26T08:01:25.000Z | torchblocks/models/nn/bert_for_attr.py | deepframwork/TorchBlocks | 35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | [
"MIT"
] | null | null | null | torchblocks/models/nn/bert_for_attr.py | deepframwork/TorchBlocks | 35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn import LayerNorm
from ..layers.crf import CRF
from ..layers.attentions import CosAttention
from transformers.modeling_bert import BertPreTrainedModel, BertModel
class BertCRFForAttr(BertPreTrainedModel):
def __init__(self, config):
super(BertCRFForA... | 46.72 | 83 | 0.618151 |
331bc708dd50879251273ff9d1810d0626917183 | 33,301 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.63941 | 234 | 0.683463 |
331bcc97fb64db3b59541a2542c2ebf71507b4f7 | 37,529 | py | Python | tencentcloud/dnspod/v20210323/dnspod_client.py | lleiyyang/tencentcloud-sdk-python | e6e6a4ce89286673b2322ae92d3c2fbf8665aa0b | [
"Apache-2.0"
] | 465 | 2018-04-27T09:54:59.000Z | 2022-03-29T02:18:01.000Z | tencentcloud/dnspod/v20210323/dnspod_client.py | lleiyyang/tencentcloud-sdk-python | e6e6a4ce89286673b2322ae92d3c2fbf8665aa0b | [
"Apache-2.0"
] | 91 | 2018-04-27T09:48:11.000Z | 2022-03-12T08:04:04.000Z | tencentcloud/dnspod/v20210323/dnspod_client.py | lleiyyang/tencentcloud-sdk-python | e6e6a4ce89286673b2322ae92d3c2fbf8665aa0b | [
"Apache-2.0"
] | 232 | 2018-05-02T08:02:46.000Z | 2022-03-30T08:02:48.000Z | # -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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... | 40.703905 | 99 | 0.589784 |
331bedd69ec5625c4460f69bfd41cecbd9668097 | 2,210 | py | Python | lab/downscaling/worker/__init__.py | voschezang/distributed-systems | 6132dc33414d942378cd2b835408701c31075c91 | [
"MIT"
] | null | null | null | lab/downscaling/worker/__init__.py | voschezang/distributed-systems | 6132dc33414d942378cd2b835408701c31075c91 | [
"MIT"
] | null | null | null | lab/downscaling/worker/__init__.py | voschezang/distributed-systems | 6132dc33414d942378cd2b835408701c31075c91 | [
"MIT"
] | 1 | 2020-02-16T15:16:45.000Z | 2020-02-16T15:16:45.000Z | from lab.util.argument_parser import get_arg
from lab.util.output import print_error
from lab.util.validation import (
assert_nonnegative_int,
assert_positive_int,
assert_host,
assert_bool,
assert_pos_float,
assert_downscaling_method)
from lab.downscaling.worker.Worker import Worker
def main()... | 40.925926 | 135 | 0.658824 |
331bfe319985639de0a5fd51c0a77498a047d87f | 2,910 | py | Python | tests/col_generation/test_applytorows.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 438 | 2017-03-02T16:55:34.000Z | 2019-12-20T03:29:36.000Z | tests/col_generation/test_applytorows.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 68 | 2019-12-21T12:51:51.000Z | 2022-03-13T13:06:14.000Z | tests/col_generation/test_applytorows.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 30 | 2019-12-21T12:18:18.000Z | 2022-03-17T05:53:19.000Z | """Testing ApplyToRows pipeline stages."""
import pandas as pd
from pdpipe.col_generation import ApplyToRows
def _some_df():
return pd.DataFrame(
data=[[3, 2143], [10, 1321], [7, 1255]],
index=[1, 2, 3],
columns=["years", "avg_revenue"]
)
def _total_rev(row):
return row['years'... | 29.393939 | 79 | 0.63299 |
331c2f4e843b9b43cc458b759516db00990e9fed | 4,003 | py | Python | alipay/aop/api/request/AlipayCommerceYuntaskHunterReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayCommerceYuntaskHunterReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayCommerceYuntaskHunterReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceYuntaskHunterReceiveModel import AlipayCommerceYuntaskHunterReceiveModel
class AlipayCommerceYuntaskHunterReceiveReque... | 27.606897 | 148 | 0.647514 |
331c38b5c69fa942c1b69389f7b17184d9902258 | 1,894 | py | Python | test_napari.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | 3 | 2020-12-31T10:06:42.000Z | 2021-11-09T13:44:16.000Z | test_napari.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | null | null | null | test_napari.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | null | null | null |
from tools import imgfile_tools as imf
from tools import napari_tools as nap
from aicsimageio import AICSImage, imread, imread_dask
from apeer_ometiff_library import io, processing, omexmlClass
import napari
from magicgui import magicgui
from napari.types import ImageData
@magicgui(call_button='Save Image')
def save... | 26.676056 | 112 | 0.672122 |
331c4cf6d10b1bb88901a3bdc28f19373a1dd785 | 1,854 | py | Python | enhterm/provider/parser_provider.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | enhterm/provider/parser_provider.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | enhterm/provider/parser_provider.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Contains the definition of the ParserProvider class.
"""
import logging
from enhterm.command.noop import NoOpCommand
from enhterm.provider import Provider
logger = logging.getLogger('et.pp')
class ParserProvider(Provider):
"""
A provider that uses a parser to interpret textual in... | 26.112676 | 75 | 0.596548 |
331c626f53cb96615d3db3e45d9440ea917d0e6d | 1,853 | py | Python | 02/test_abstle.py | asmodehn/caerbannog | 47bb1138190748041a4c0d02e522c0924a9af962 | [
"MIT"
] | 1 | 2019-01-22T20:57:45.000Z | 2019-01-22T20:57:45.000Z | 02/test_abstle.py | asmodehn/functional-python | 47bb1138190748041a4c0d02e522c0924a9af962 | [
"MIT"
] | 3 | 2019-03-14T17:33:39.000Z | 2019-03-14T18:09:42.000Z | 02/test_abstle.py | asmodehn/caerbannog | 47bb1138190748041a4c0d02e522c0924a9af962 | [
"MIT"
] | null | null | null | import unittest
import unittest.mock as mock
import random
import abstle
class TestTootle(unittest.TestCase):
"""
With a functional interface, it is now much easier to inject our mock as a dependency.
However it is still tricky to know what should happen when the class hierarchy is involved during creati... | 30.883333 | 111 | 0.662169 |
331c6e52f47916ef26f6f905bb24868c33ddffbc | 1,727 | py | Python | py/208. Implement Trie (Prefix Tree).py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/208. Implement Trie (Prefix Tree).py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/208. Implement Trie (Prefix Tree).py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/implement-trie-prefix-tree/
# A trie (pronounced as "try") or prefix tree is a tree data structure used to
# efficiently store and retrieve keys in a dataset of strings. There are various
# applications of this data structure, such as autocomplete and spellchecker.
# Implement the Trie... | 27.412698 | 83 | 0.557614 |
331ccd790880624419dcbbb1957c574abe9cd290 | 64 | py | Python | gaphor/__main__.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/__main__.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/__main__.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | from gaphor import main
if __name__ == "__main__":
main()
| 10.666667 | 26 | 0.65625 |
331d08c18ba184be06ba7f8b88f9a5373004f1da | 1,583 | py | Python | server/danesfield_server/constants.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 25 | 2018-12-19T08:45:13.000Z | 2022-03-27T14:20:42.000Z | server/danesfield_server/constants.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 10 | 2018-11-30T22:21:45.000Z | 2022-01-21T19:43:47.000Z | server/danesfield_server/constants.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 7 | 2018-12-03T21:42:53.000Z | 2021-09-07T17:09:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc. and Contributors
# Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0)
# See accompanying Copyright.txt and LICENSE files for details
##########... | 29.867925 | 79 | 0.632975 |
331d1aaa370f83c770b5e9f95f0c879481c38418 | 701 | py | Python | setup.py | yourkin/fastapi_simple_security | 83014c88e4dcede33a4c2a32f678a69f5c672b1b | [
"MIT"
] | 103 | 2020-08-30T00:23:28.000Z | 2022-03-21T12:37:27.000Z | setup.py | yourkin/fastapi_simple_security | 83014c88e4dcede33a4c2a32f678a69f5c672b1b | [
"MIT"
] | 10 | 2021-01-01T16:36:44.000Z | 2022-02-16T04:20:59.000Z | setup.py | yourkin/fastapi_simple_security | 83014c88e4dcede33a4c2a32f678a69f5c672b1b | [
"MIT"
] | 26 | 2020-09-01T11:56:17.000Z | 2022-02-16T05:49:56.000Z | import setuptools
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
name="fastapi_simple_security",
version="0.1",
packages=["fastapi_simple_security"],
u... | 33.380952 | 91 | 0.737518 |
331d3f5b33845bc6b7692d6a2de62a1fbde996f4 | 695 | py | Python | main.py | AnglewoodJack/ScrapeJobs | f810e1a461c24bd10ad2376627d48f1b8a145966 | [
"MIT"
] | null | null | null | main.py | AnglewoodJack/ScrapeJobs | f810e1a461c24bd10ad2376627d48f1b8a145966 | [
"MIT"
] | null | null | null | main.py | AnglewoodJack/ScrapeJobs | f810e1a461c24bd10ad2376627d48f1b8a145966 | [
"MIT"
] | null | null | null | from db.clean_db import connect_pg, create_table_pg
from db.raw_db import connect_lite, create_table_lite
from core.update import update_db
def scrape():
# Connect to db.
conn = connect_lite('jobs.sqlite')
# Create table.
create_table_lite(conn)
# Update db.
update_db(conn)
# Close connect... | 21.060606 | 64 | 0.677698 |
331d8e61437ff1ed85b4b93d97e3621a30ad6473 | 4,328 | py | Python | apps/ingest/tests/test_services.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 18 | 2017-06-12T09:58:02.000Z | 2021-10-01T11:14:34.000Z | apps/ingest/tests/test_services.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 276 | 2019-04-26T20:13:01.000Z | 2022-03-31T10:26:28.000Z | apps/ingest/tests/test_services.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 7 | 2018-03-13T23:44:26.000Z | 2021-09-15T17:54:55.000Z | """ Tests for ingest.services """
import os
import json
import boto3
from moto import mock_s3
from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from django.conf import settings
from factory.django import FileField
from apps.iiif.canvases.tests.factories import CanvasFactory
... | 39.706422 | 119 | 0.637939 |
331d9b2cfa8b6ad16791359a0be3e57455e0ada9 | 1,249 | py | Python | user/collection/app.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 4 | 2018-04-23T00:04:01.000Z | 2018-10-28T22:56:51.000Z | user/collection/app.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 23 | 2017-12-22T08:27:35.000Z | 2021-12-13T19:57:35.000Z | user/collection/app.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 1 | 2020-06-03T02:07:26.000Z | 2020-06-03T02:07:26.000Z |
"""
Contains roap app and his db run class.
"""
import os
from setup import create_default_users
import falcon
from falcon_cors import CORS
from pymongo import MongoClient
from resources.user import User
from resources.user_collection import UserCollection
class Roap():
"""Main Roap class."""
def __ini... | 23.12963 | 80 | 0.604484 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.