hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
89a47c8f2c81a8efae575f3c791d4a82dc5e30e3 | 62,360 | py | Python | dlkit/authz_adapter/learning/managers.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 2 | 2018-02-23T12:16:11.000Z | 2020-10-08T17:54:24.000Z | dlkit/authz_adapter/learning/managers.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 87 | 2017-04-21T18:57:15.000Z | 2021-12-13T19:43:57.000Z | dlkit/authz_adapter/learning/managers.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 1 | 2018-03-01T16:44:25.000Z | 2018-03-01T16:44:25.000Z | """AuthZ Adapter implementations of learning managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . impor... | 52.535805 | 140 | 0.75085 |
bcdb28ac31bb1112c9527d11c61cb086c9c0d795 | 978 | py | Python | HTL.tab/Rebar.panel/SelectSameScheduleMarkRebars.pushbutton/script.py | htlcnn/pyrevitscripts | b898a3a5e8d212570254772ae314f343498b1398 | [
"MIT"
] | null | null | null | HTL.tab/Rebar.panel/SelectSameScheduleMarkRebars.pushbutton/script.py | htlcnn/pyrevitscripts | b898a3a5e8d212570254772ae314f343498b1398 | [
"MIT"
] | null | null | null | HTL.tab/Rebar.panel/SelectSameScheduleMarkRebars.pushbutton/script.py | htlcnn/pyrevitscripts | b898a3a5e8d212570254772ae314f343498b1398 | [
"MIT"
] | 2 | 2020-02-15T14:39:46.000Z | 2020-03-11T18:24:47.000Z | # -*- coding: utf-8 -*-
__title__ = 'Select Same\nSchedule Mark Rebar'
__author__ = 'htl'
import clr
clr.AddReference('RevitAPI')
import Autodesk
import rpw
from rpw import doc, uidoc
from System.Collections.Generic import List
class RebarFilter(Autodesk.Revit.UI.Selection.ISelectionFilter):
def AllowElement(sel... | 36.222222 | 89 | 0.662577 |
60f4cf950f40aaaa2c4c4d1225e07a50822dd05f | 1,400 | py | Python | contentcuration/contentcuration/migrations/0028_auto_20160926_1527.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 1 | 2019-03-30T18:14:25.000Z | 2019-03-30T18:14:25.000Z | contentcuration/contentcuration/migrations/0028_auto_20160926_1527.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 2 | 2019-04-06T07:06:08.000Z | 2019-04-08T23:33:53.000Z | contentcuration/contentcuration/migrations/0028_auto_20160926_1527.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 1 | 2020-10-20T05:21:56.000Z | 2020-10-20T05:21:56.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-26 22:27
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0027_auto_20160926_0945'),
]
operations = [
... | 48.275862 | 247 | 0.588571 |
82569570e094a77f1bb6ee940f3ae08d57c0055f | 38,896 | py | Python | base/services/schema_differ/mysql.py | joeportela/tinyAPI | f2469c38a605b00519acd0b79af17d0041f5ae7b | [
"MIT"
] | 6 | 2016-11-18T22:32:44.000Z | 2021-04-01T17:02:13.000Z | base/services/schema_differ/mysql.py | joeportela/tinyAPI | f2469c38a605b00519acd0b79af17d0041f5ae7b | [
"MIT"
] | 1 | 2018-12-20T23:07:52.000Z | 2018-12-20T23:07:52.000Z | base/services/schema_differ/mysql.py | joeportela/tinyAPI | f2469c38a605b00519acd0b79af17d0041f5ae7b | [
"MIT"
] | 10 | 2018-02-23T00:08:21.000Z | 2020-10-01T03:06:12.000Z | # ----- Info ------------------------------------------------------------------
__author__ = 'Michael Montero <mcmontero@gmail.com>'
# ----- Imports ---------------------------------------------------------------
from tinyAPI.base.config import ConfigManager
from tinyAPI.base.data_store.provider import DataStoreMySQ... | 32.630872 | 80 | 0.505553 |
48f0dcecf22eabdb6e8fe0fd118b76126165015a | 12,229 | py | Python | coremltools/converters/caffe/_caffe_converter.py | dlminvestments/coremltools | cf6db67bab18346e132124783d46a32b8a7f52c6 | [
"BSD-3-Clause"
] | null | null | null | coremltools/converters/caffe/_caffe_converter.py | dlminvestments/coremltools | cf6db67bab18346e132124783d46a32b8a7f52c6 | [
"BSD-3-Clause"
] | 75 | 2020-11-24T05:37:45.000Z | 2022-02-25T15:14:23.000Z | coremltools/converters/caffe/_caffe_converter.py | dlminvestments/coremltools | cf6db67bab18346e132124783d46a32b8a7f52c6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import os
import six as _six
from ...models import (
_MLMODEL_FULL_PRECISION,
_MLMODEL_HALF_PREC... | 39.704545 | 159 | 0.679859 |
ddf8776429ea9ba0bfac887c3d70d850f3fb1577 | 2,314 | py | Python | Vision/AutoMLVisionClassifier/app.py | iii-PaulCridland/azure-search-power-skills | bbc5848c32b3bd6f2c8942693d854563e0cee708 | [
"MIT"
] | 128 | 2019-06-12T19:24:34.000Z | 2022-03-08T18:39:40.000Z | Vision/AutoMLVisionClassifier/app.py | iii-PaulCridland/azure-search-power-skills | bbc5848c32b3bd6f2c8942693d854563e0cee708 | [
"MIT"
] | 47 | 2019-07-15T22:04:23.000Z | 2022-03-04T18:35:57.000Z | Vision/AutoMLVisionClassifier/app.py | iii-PaulCridland/azure-search-power-skills | bbc5848c32b3bd6f2c8942693d854563e0cee708 | [
"MIT"
] | 99 | 2019-06-28T20:56:21.000Z | 2022-03-30T17:17:24.000Z | import os
from typing import Dict, List
import uvicorn
from dotenv import load_dotenv
from fastapi import FastAPI, Security, Depends, HTTPException
from fastapi.security.api_key import APIKeyHeader, APIKey
from pydantic import BaseModel
from starlette.status import HTTP_403_FORBIDDEN
from powerskill import extractor,... | 29.291139 | 107 | 0.725151 |
7848c9e740fd7159043a18cf5f4e0e1388944743 | 1,811 | py | Python | setup.py | hammerlab/stanity | 6c36abc207c4ce94f78968501dab839a56f35a41 | [
"Apache-2.0"
] | 17 | 2016-07-15T15:59:29.000Z | 2020-07-30T18:42:04.000Z | setup.py | hammerlab/stanity | 6c36abc207c4ce94f78968501dab839a56f35a41 | [
"Apache-2.0"
] | 18 | 2016-06-03T18:09:00.000Z | 2019-01-14T20:04:01.000Z | setup.py | hammerlab/stanity | 6c36abc207c4ce94f78968501dab839a56f35a41 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016. Mount Sinai School of Medicine
#
# 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 o... | 32.927273 | 94 | 0.66317 |
8d1ab32590d0a5a24dcdf87712b21b812c0df9ac | 4,824 | py | Python | python/fastscore/v1/models/verify_info_slots.py | modelop/fastscore-sdk | 2206a4b9294cd83b6b8c2470193070bdc35a9061 | [
"Apache-2.0"
] | 2 | 2018-06-05T19:14:30.000Z | 2019-02-06T17:15:10.000Z | python/fastscore/v1/models/verify_info_slots.py | modelop/fastscore-sdk | 2206a4b9294cd83b6b8c2470193070bdc35a9061 | [
"Apache-2.0"
] | 2 | 2018-02-20T21:58:43.000Z | 2018-10-07T10:10:54.000Z | python/fastscore/v1/models/verify_info_slots.py | modelop/fastscore-sdk | 2206a4b9294cd83b6b8c2470193070bdc35a9061 | [
"Apache-2.0"
] | 1 | 2017-12-29T20:38:06.000Z | 2017-12-29T20:38:06.000Z | # coding: utf-8
"""
FastScore API (proxy)
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
im... | 23.881188 | 105 | 0.540008 |
ba6af36332b3cb5babafdfa2bdd507f83b931b3c | 7,574 | py | Python | addons/blender_mmd_tools-main/mmd_tools/properties/rigid_body.py | V-Sekai/V-Sekai-Blender-tools | 3473ad4abb737756290a9007273519460742960d | [
"MIT"
] | 2 | 2021-12-21T16:38:58.000Z | 2022-01-08T00:56:35.000Z | addons/blender_mmd_tools-main/mmd_tools/properties/rigid_body.py | V-Sekai/V-Sekai-Blender-game-tools | 3473ad4abb737756290a9007273519460742960d | [
"MIT"
] | 1 | 2022-01-29T05:46:50.000Z | 2022-01-29T05:46:50.000Z | addons/blender_mmd_tools-main/mmd_tools/properties/rigid_body.py | V-Sekai/V-Sekai-Blender-game-tools | 3473ad4abb737756290a9007273519460742960d | [
"MIT"
] | 1 | 2021-11-07T19:41:34.000Z | 2021-11-07T19:41:34.000Z | # -*- coding: utf-8 -*-
import bpy
from mmd_tools import bpyutils, register_wrap
from mmd_tools.core import rigid_body
from mmd_tools.core.model import FnModel, getRigidBodySize
def _updateCollisionGroup(prop, context):
obj = prop.id_data
materials = obj.data.materials
if len(materials) == 0:
mat... | 27.541818 | 110 | 0.570108 |
c7650dd0eda65713e250ffb9c61f58edd7ea3da8 | 26,549 | py | Python | dodo.py | deathbeds/jupyterlab-drawio | 6cd7d29adc53d73a7a27580b59483205747a400e | [
"Apache-2.0"
] | 1 | 2020-11-04T21:31:28.000Z | 2020-11-04T21:31:28.000Z | dodo.py | deathbeds/jupyterlab-drawio | 6cd7d29adc53d73a7a27580b59483205747a400e | [
"Apache-2.0"
] | 6 | 2020-08-06T12:10:58.000Z | 2020-12-27T15:32:58.000Z | dodo.py | deathbeds/jupyterlab-drawio | 6cd7d29adc53d73a7a27580b59483205747a400e | [
"Apache-2.0"
] | null | null | null | """automation for ipydrawio
> see https://pydoit.org/tutorial_1.html#incremental-computation
see what you can do
doit list --status --all | sort
do basically everything to get ready for a release
doit all
maybe before you push
doit -n8 lint
"""
# Copyright 2021 ipydrawio contributors
#
# Licensed un... | 27.341916 | 113 | 0.460206 |
d33c37a02c4881da198300ca4024f56fe7e52f16 | 1,344 | py | Python | app/core/tests/test_admin.py | MOFD308/recipe-app-api | efea5c28ae92a8c89b43921240855a0ca2b3f3a9 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | MOFD308/recipe-app-api | efea5c28ae92a8c89b43921240855a0ca2b3f3a9 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | MOFD308/recipe-app-api | efea5c28ae92a8c89b43921240855a0ca2b3f3a9 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email="admin@umich.edu",
... | 31.255814 | 68 | 0.634673 |
95625f7a2d89ef09b5713aa2010987c0aa83e54a | 2,735 | py | Python | tests/test_tokenization_phobert.py | WERimagin/transformers | cc7d14511c647f8147494df72f8b0575015e37ab | [
"Apache-2.0"
] | 47 | 2021-04-16T22:29:25.000Z | 2022-02-11T08:19:13.000Z | tests/test_tokenization_phobert.py | WERimagin/transformers | cc7d14511c647f8147494df72f8b0575015e37ab | [
"Apache-2.0"
] | 12 | 2021-04-28T19:45:02.000Z | 2021-08-31T13:56:02.000Z | tests/test_tokenization_phobert.py | WERimagin/transformers | cc7d14511c647f8147494df72f8b0575015e37ab | [
"Apache-2.0"
] | 5 | 2021-04-28T21:54:15.000Z | 2022-02-11T07:48:17.000Z | # coding=utf-8
# Copyright 2018 Salesforce and HuggingFace Inc. team.
# 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 a... | 40.820896 | 103 | 0.668739 |
b98822a332ba2001e90ea72ef66e6fcfbecd4400 | 11,250 | py | Python | test/functional/mining_prioritisetransaction.py | qogecoin/qogecoin | fce42076f1a2746525374f50f35939392f37ca84 | [
"MIT"
] | 9 | 2021-10-30T01:01:50.000Z | 2022-02-10T02:20:44.000Z | test/functional/mining_prioritisetransaction.py | qogecoin/qogecoin | fce42076f1a2746525374f50f35939392f37ca84 | [
"MIT"
] | 4 | 2021-10-17T19:59:16.000Z | 2021-11-04T19:11:25.000Z | test/functional/mining_prioritisetransaction.py | qogecoin/qogecoin | fce42076f1a2746525374f50f35939392f37ca84 | [
"MIT"
] | 7 | 2021-11-01T09:09:41.000Z | 2022-03-23T02:47:30.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2021 The Bitcoin and Qogecoin Core Authors
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the prioritisetransaction mining RPC."""
from decimal import Decimal
import time
from ... | 46.680498 | 266 | 0.664978 |
aa059eb24e49ae91af4ab81d438cf9f140032381 | 5,078 | py | Python | credmon/CredentialMonitors/LocalCredmon.py | matyasselmeci/scitokens-credmon | 70b943c7caf90657c78ac7c52723bfa11dd5e0fd | [
"Apache-2.0"
] | 1 | 2019-01-10T22:25:11.000Z | 2019-01-10T22:25:11.000Z | credmon/CredentialMonitors/LocalCredmon.py | matyasselmeci/scitokens-credmon | 70b943c7caf90657c78ac7c52723bfa11dd5e0fd | [
"Apache-2.0"
] | 36 | 2019-01-10T21:43:15.000Z | 2020-09-24T12:36:34.000Z | credmon/CredentialMonitors/LocalCredmon.py | matyasselmeci/scitokens-credmon | 70b943c7caf90657c78ac7c52723bfa11dd5e0fd | [
"Apache-2.0"
] | 6 | 2019-02-08T02:25:20.000Z | 2020-12-02T21:34:36.000Z |
import os
import shutil
import glob
import scitokens
import htcondor
from credmon.CredentialMonitors.OAuthCredmon import OAuthCredmon
from credmon.utils import atomic_output_json
class LocalCredmon(OAuthCredmon):
"""
This credential monitor class provides the ability to self-sign SciTokens
without needi... | 43.775862 | 143 | 0.651241 |
2eb38c0f77ecd778e48b7d12cc89aef7b309e424 | 20,578 | py | Python | python/cudf/cudf/utils/dtypes.py | etseidl/cudf | 84073e8c3c9477c8afa974f14058f1208f63aba2 | [
"Apache-2.0"
] | 1 | 2021-12-12T20:13:05.000Z | 2021-12-12T20:13:05.000Z | python/cudf/cudf/utils/dtypes.py | etseidl/cudf | 84073e8c3c9477c8afa974f14058f1208f63aba2 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/utils/dtypes.py | etseidl/cudf | 84073e8c3c9477c8afa974f14058f1208f63aba2 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020-2021, NVIDIA CORPORATION.
import datetime as dt
from collections import namedtuple
from decimal import Decimal
import cupy as cp
import numpy as np
import pandas as pd
import pyarrow as pa
from pandas.core.dtypes.common import infer_dtype_from_object
import cudf
from cudf.core._compat import PAN... | 28.266484 | 79 | 0.610701 |
cfa90ad0739d44ee6e49cd16650612b9b0211440 | 6,350 | py | Python | log_plotter.py | fartashf/nuqsgd | 848b84e28b8df32d52e1f0a865adb9cf768b3221 | [
"Apache-2.0"
] | 5 | 2019-12-19T22:49:34.000Z | 2021-06-09T21:40:56.000Z | log_plotter.py | fartashf/nuqsgd | 848b84e28b8df32d52e1f0a865adb9cf768b3221 | [
"Apache-2.0"
] | null | null | null | log_plotter.py | fartashf/nuqsgd | 848b84e28b8df32d52e1f0a865adb9cf768b3221 | [
"Apache-2.0"
] | 2 | 2020-01-10T15:27:33.000Z | 2020-04-08T10:16:42.000Z | from scipy.interpolate import spline
import numpy as np
import os
import re
import torch
import pylab as plt
import matplotlib.ticker as mtick
def get_run_names(logdir, patterns):
run_names = []
for pattern in patterns:
for root, subdirs, files in os.walk(logdir, followlinks=True):
if re.m... | 34.51087 | 78 | 0.546929 |
90b741b8a0a7a5afc73a8f866e8965cecc185288 | 387 | py | Python | vendor/cache/pygments.rb-2cada028da50/vendor/pygments-main/tests/examplefiles/linecontinuation.py | drnic/gitlabhq | 778083f71e94fbf1c98f2f890b43d9ccc8faee03 | [
"MIT"
] | 1 | 2019-06-27T12:45:36.000Z | 2019-06-27T12:45:36.000Z | vendor/cache/pygments.rb-2cada028da50/vendor/pygments-main/tests/examplefiles/linecontinuation.py | drnic/gitlabhq | 778083f71e94fbf1c98f2f890b43d9ccc8faee03 | [
"MIT"
] | null | null | null | vendor/cache/pygments.rb-2cada028da50/vendor/pygments-main/tests/examplefiles/linecontinuation.py | drnic/gitlabhq | 778083f71e94fbf1c98f2f890b43d9ccc8faee03 | [
"MIT"
] | null | null | null | apple.filter(x, y)
apple.\
filter(x, y)
1 \
. \
__str__
from os import path
from \
os \
import \
path
import os.path as something
import \
os.path \
as \
something
class \
Spam:
pass
class Spam: pass
class Spam(object):
pass
class \
Spam \
... | 8.413043 | 27 | 0.483204 |
83f30aed88e651b286d4c2d6666ce20863cbc3a5 | 4,023 | py | Python | pandas/tests/extension/test_period.py | Sanjay8874/pandas | 353a0f9ebfbd87642d1dd7154f25be0286cdaf93 | [
"BSD-3-Clause"
] | 4 | 2021-03-02T19:57:18.000Z | 2021-06-20T19:23:57.000Z | pandas/tests/extension/test_period.py | 16umm001/pandas | a2e599499667b256bc5b8b13a75f0601eccfd432 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/extension/test_period.py | 16umm001/pandas | a2e599499667b256bc5b8b13a75f0601eccfd432 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
from pandas._libs.tslib import iNaT
from pandas.core.dtypes.dtypes import PeriodDtype
import pandas as pd
from pandas.core.arrays import PeriodArray
from pandas.tests.extension import base
import pandas.util.testing as tm
@pytest.fixture
def dtype():
return PeriodDtype(freq='D'... | 25.462025 | 76 | 0.683072 |
1e81032c76e4feee1c6efac7e965387eaa9e5414 | 2,076 | py | Python | tests/pytests/functional/conftest.py | Bacon-Unlimited/salt | 9b1b791d212a6810c430dd15c63fbce3a4f7e1d6 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | tests/pytests/functional/conftest.py | Bacon-Unlimited/salt | 9b1b791d212a6810c430dd15c63fbce3a4f7e1d6 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | tests/pytests/functional/conftest.py | Bacon-Unlimited/salt | 9b1b791d212a6810c430dd15c63fbce3a4f7e1d6 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | import logging
import shutil
import pytest
from saltfactories.utils.functional import Loaders
log = logging.getLogger(__name__)
@pytest.fixture(scope="package")
def minion_id():
return "func-tests-minion"
@pytest.fixture(scope="module")
def state_tree(tmp_path_factory):
state_tree_path = tmp_path_factory.... | 23.590909 | 100 | 0.69316 |
0e5cf2c6e190000bb8ec500ad435b987c7899e72 | 423 | py | Python | Conditionals and Loops/Nth Fibbonacci Number.py | SaiPrasanth212/Coding-ninjas-Introduction-To-Python | f6aabc3b7b0f2ae82e2870c8f2bd1f37e3fe3005 | [
"MIT"
] | 2 | 2021-12-13T19:28:40.000Z | 2022-03-07T16:36:29.000Z | Conditionals and Loops/Nth Fibbonacci Number.py | SaiPrasanth212/Coding-ninjas-Introduction-To-Python | f6aabc3b7b0f2ae82e2870c8f2bd1f37e3fe3005 | [
"MIT"
] | null | null | null | Conditionals and Loops/Nth Fibbonacci Number.py | SaiPrasanth212/Coding-ninjas-Introduction-To-Python | f6aabc3b7b0f2ae82e2870c8f2bd1f37e3fe3005 | [
"MIT"
] | null | null | null | ## Read input as specified in the question.
## Print output as specified in the question.
''''def fibo(n):
if n == 1 or n == 2:
return 1
return fibo(n-1) + fibo(n-2)'''
def fibo(n):
if n == 1 or n == 2:
return 1
x = 1
y = 1
while n > 2:
z = x+y
x = y
... | 15.107143 | 45 | 0.432624 |
9df13205923bda5739bd76e4072919adaf1dc0f0 | 12,484 | py | Python | mne/io/utils.py | achilleas-k/mne-python | 0078e1af13a92ab47498dd167bc5ec73be864427 | [
"BSD-3-Clause"
] | 1 | 2020-07-28T16:09:54.000Z | 2020-07-28T16:09:54.000Z | mne/io/utils.py | achilleas-k/mne-python | 0078e1af13a92ab47498dd167bc5ec73be864427 | [
"BSD-3-Clause"
] | 4 | 2016-06-04T15:28:08.000Z | 2016-12-22T14:23:13.000Z | mne/io/utils.py | achilleas-k/mne-python | 0078e1af13a92ab47498dd167bc5ec73be864427 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Teon Brooks <teon.brooks@gmail.com>
# Mari... | 36.717647 | 104 | 0.590436 |
a1d3dd5c494a6016fae745b4d9f5cf26a5360384 | 3,123 | py | Python | reddit/settings.py | RaghuDalal/Django-Reddit-API | bdaba40f003da59be5ba4cf7ab6d83b6bae7b99b | [
"MIT"
] | null | null | null | reddit/settings.py | RaghuDalal/Django-Reddit-API | bdaba40f003da59be5ba4cf7ab6d83b6bae7b99b | [
"MIT"
] | null | null | null | reddit/settings.py | RaghuDalal/Django-Reddit-API | bdaba40f003da59be5ba4cf7ab6d83b6bae7b99b | [
"MIT"
] | null | null | null | """
Django settings for reddit project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# ... | 25.390244 | 91 | 0.692923 |
ad7f48b015718bb166c1e2248c1d3f81b466c6bf | 2,678 | py | Python | airflow/providers/google/cloud/example_dags/example_dataprep.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | 1 | 2020-12-23T05:03:17.000Z | 2020-12-23T05:03:17.000Z | airflow/providers/google/cloud/example_dags/example_dataprep.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | 20 | 2021-01-23T12:33:08.000Z | 2021-12-07T22:30:37.000Z | airflow/providers/google/cloud/example_dags/example_dataprep.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.684932 | 109 | 0.720687 |
1c4c705af7ccdb33a8700f125f9ffa320bb1deb0 | 24,136 | py | Python | include/TestController.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | null | null | null | include/TestController.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | null | null | null | include/TestController.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | null | null | null | import collections
import os
import random
import threading
import collections
import shutil
import sys
import tempfile
import time
import traceback
import unittest
import wx
from . import HydrusConstants as HC
from . import ClientConstants as CC
from . import HydrusGlobals as HG
from . import ClientAPI
from . import C... | 30.436318 | 164 | 0.568611 |
3eceb285cba16177f3c663eaa22775ccfc7ca53e | 14,707 | py | Python | pymessenger/bot.py | dranem03/messenger-chat-bot | 2f5aaa034337c4ec116e9d1627e7fcb7305d011a | [
"MIT"
] | null | null | null | pymessenger/bot.py | dranem03/messenger-chat-bot | 2f5aaa034337c4ec116e9d1627e7fcb7305d011a | [
"MIT"
] | null | null | null | pymessenger/bot.py | dranem03/messenger-chat-bot | 2f5aaa034337c4ec116e9d1627e7fcb7305d011a | [
"MIT"
] | null | null | null | import os
from enum import Enum
import requests
from requests_toolbelt import MultipartEncoder
from pymessenger import utils
DEFAULT_API_VERSION = 2.6
class NotificationType(Enum):
regular = "REGULAR"
silent_push = "SILENT_PUSH"
no_push = "NO_PUSH"
class Bot:
def __init__(self, access_token, **kw... | 39.323529 | 133 | 0.613653 |
bb841156ada6a3600fd8652aa2eb9ac69f91208d | 3,974 | py | Python | dev/Gems/CloudGemFramework/v1/AWS/lambda-code/PlayerAccessTokenExchange/lwa_auth.py | brianherrera/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | [
"AML"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | dev/Gems/CloudGemFramework/v1/AWS/lambda-code/PlayerAccessTokenExchange/lwa_auth.py | olivier-be/lumberyard | 3d688932f919dbf5821f0cb8a210ce24abe39e9e | [
"AML"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | dev/Gems/CloudGemFramework/v1/AWS/lambda-code/PlayerAccessTokenExchange/lwa_auth.py | olivier-be/lumberyard | 3d688932f919dbf5821f0cb8a210ce24abe39e9e | [
"AML"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | 46.209302 | 154 | 0.618017 |
fb0df07f722a340801c47117bccb41dbc6af10b3 | 52 | py | Python | pyteen/__init__.py | deeplook/tenliners | dc1b2e430d8ce0528544f1cf8dc8c6c1b1acc2ef | [
"MIT"
] | 1 | 2020-09-09T09:48:52.000Z | 2020-09-09T09:48:52.000Z | pyteen/__init__.py | deeplook/tenliners | dc1b2e430d8ce0528544f1cf8dc8c6c1b1acc2ef | [
"MIT"
] | 22 | 2020-07-27T21:46:28.000Z | 2020-08-09T21:18:36.000Z | pyteen/__init__.py | deeplook/tenliners | dc1b2e430d8ce0528544f1cf8dc8c6c1b1acc2ef | [
"MIT"
] | null | null | null | from . import snippets
from .core import Collection
| 17.333333 | 28 | 0.807692 |
59dbaf44ce16bac742a80d69196f10b6698364b7 | 8,680 | py | Python | melati/cmds/configure.py | Melati-Network/melati-blockchain | 6b96f6a84b9c9abf49c6acc239795d4650ddfab2 | [
"Apache-2.0"
] | 12 | 2021-07-13T15:39:57.000Z | 2022-02-09T04:32:12.000Z | melati/cmds/configure.py | Melati-Network/melati-blockchain | 6b96f6a84b9c9abf49c6acc239795d4650ddfab2 | [
"Apache-2.0"
] | 1 | 2021-07-16T12:41:41.000Z | 2021-07-16T12:42:48.000Z | melati/cmds/configure.py | Melati-Network/melati-blockchain | 6b96f6a84b9c9abf49c6acc239795d4650ddfab2 | [
"Apache-2.0"
] | 3 | 2021-07-13T05:35:30.000Z | 2021-08-06T13:11:14.000Z | from pathlib import Path
from typing import Dict
import click
from melati.util.config import load_config, save_config, str2bool
from melati.util.default_root import DEFAULT_ROOT_PATH
def configure(
root_path: Path,
set_farmer_peer: str,
set_node_introducer: str,
set_fullnode_port: str,
set_harve... | 40.560748 | 100 | 0.606452 |
d78ef4a6740a2914c6ae2da2189982d14eaa3adb | 2,642 | py | Python | isdbeads/inference.py | michaelhabeck/bayesian-random-tomography | 9429a3688df368f0fe8fd7beaa8202386951164a | [
"MIT"
] | 2 | 2021-04-17T14:05:05.000Z | 2022-02-24T16:03:29.000Z | isdbeads/inference.py | michaelhabeck/bayesian-random-tomography | 9429a3688df368f0fe8fd7beaa8202386951164a | [
"MIT"
] | null | null | null | isdbeads/inference.py | michaelhabeck/bayesian-random-tomography | 9429a3688df368f0fe8fd7beaa8202386951164a | [
"MIT"
] | null | null | null | import numpy as np
from scipy.special import logsumexp
from .mcmc import (
AdaptiveWalk as _AdaptiveWalk,
)
from .hmc import (
HamiltonianMonteCarlo as _HamiltonianMonteCarlo
)
class AdaptiveWalk(_AdaptiveWalk):
"""Adaptive Walk
keeping track of the stepsizes...
"""
stepsizes = []
@pr... | 27.520833 | 76 | 0.596518 |
17f37673a7a1aa6730fefb8ad411cb51a2cd2fd8 | 68 | py | Python | pycnv/__init__.py | martinhaagmans/pyCNV | af3ad803312aa8b2a7fe1547783f90e0d0d5ee83 | [
"MIT"
] | null | null | null | pycnv/__init__.py | martinhaagmans/pyCNV | af3ad803312aa8b2a7fe1547783f90e0d0d5ee83 | [
"MIT"
] | null | null | null | pycnv/__init__.py | martinhaagmans/pyCNV | af3ad803312aa8b2a7fe1547783f90e0d0d5ee83 | [
"MIT"
] | null | null | null | from .analysis import analyse
from .analysis import create_database
| 22.666667 | 37 | 0.852941 |
93ab9c25500ad7354aca27b8f04aa33dcc835a55 | 2,099 | py | Python | main.py | parizad1188/py-sr25519-bindings | 604f08ec15962c6695670df0647ac6818ffa356e | [
"Apache-2.0"
] | null | null | null | main.py | parizad1188/py-sr25519-bindings | 604f08ec15962c6695670df0647ac6818ffa356e | [
"Apache-2.0"
] | null | null | null | main.py | parizad1188/py-sr25519-bindings | 604f08ec15962c6695670df0647ac6818ffa356e | [
"Apache-2.0"
] | null | null | null | import os
import sr25519
from substrateinterface import Keypair
x1_mnemonic = 'stone cereal magnet search zoo split dish leisure crouch uniform elite panic'
x2_mnemonic = 'diagram truck orient actress resource attitude you initial during slight actress cluster'
x1_kp = Keypair.create_from_mnemonic(x1_mnemonic)
x2_kp... | 36.824561 | 115 | 0.676036 |
5fd83f39504913f477db7f00cf8176c102c27de1 | 1,334 | py | Python | BFS/69.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | BFS/69.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | BFS/69.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | """69. Binary Tree Level Order Traversal
"""
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@param root: A Tree
@return: Level order a list of lists of integer
"""
def levelOrder(self... | 23.403509 | 52 | 0.471514 |
711b9a24f0b193fe99b8eacd925158c8a35f72d7 | 1,162 | py | Python | Transformer.py | kyle-gao/TF_Transformer | 7029ccb88f6eb9a2ac2e10fbd820413b42f461a1 | [
"Apache-2.0"
] | 6 | 2020-09-11T16:48:51.000Z | 2021-09-30T19:23:16.000Z | Transformer.py | kyle-gao/TF_Transformer | 7029ccb88f6eb9a2ac2e10fbd820413b42f461a1 | [
"Apache-2.0"
] | 1 | 2021-08-30T08:58:54.000Z | 2021-08-30T08:58:54.000Z | Transformer.py | kyle-gao/TF_Transformer | 7029ccb88f6eb9a2ac2e10fbd820413b42f461a1 | [
"Apache-2.0"
] | 1 | 2022-03-23T23:30:20.000Z | 2022-03-23T23:30:20.000Z | import tensorflow as tf
from Encoder import *
from Decoder import *
class Transformer(tf.keras.Model):
def __init__(self, num_layers, num_heads, d_model, dense_dim, in_vocab_size, tar_vocab_size,
input_max_position, target_max_position, rate=0.1):
super().__init__()
s... | 40.068966 | 112 | 0.663511 |
d7eea412b9f9961bc640e93419a9d886280819ba | 1,396 | py | Python | jobsapp/documents.py | rishiparekh/Job-Portal | 0e9f8da132896fdba2f8c051cf79bb2ab5b63de8 | [
"MIT"
] | null | null | null | jobsapp/documents.py | rishiparekh/Job-Portal | 0e9f8da132896fdba2f8c051cf79bb2ab5b63de8 | [
"MIT"
] | null | null | null | jobsapp/documents.py | rishiparekh/Job-Portal | 0e9f8da132896fdba2f8c051cf79bb2ab5b63de8 | [
"MIT"
] | 5 | 2020-11-07T08:41:35.000Z | 2021-06-09T23:15:26.000Z | from django_elasticsearch_dsl import Document
from django_elasticsearch_dsl.registries import registry
from .models import Job
# TODO disabled for testing purpose
# @registry.register_document
class JobDocument(Document):
class Index:
# Name of the Elasticsearch index
name = 'jobs'
# See E... | 34.9 | 97 | 0.660458 |
4a903a273bfd11b47c25c41be746fb316dfc35af | 3,573 | py | Python | Figure_1_twoblock/figS1-simulations.py | MGarrod1/unobserved_spin_influence | 7bc3a304e1e09cf6cfaddb50ec3203ecc8808cbe | [
"MIT"
] | null | null | null | Figure_1_twoblock/figS1-simulations.py | MGarrod1/unobserved_spin_influence | 7bc3a304e1e09cf6cfaddb50ec3203ecc8808cbe | [
"MIT"
] | null | null | null | Figure_1_twoblock/figS1-simulations.py | MGarrod1/unobserved_spin_influence | 7bc3a304e1e09cf6cfaddb50ec3203ecc8808cbe | [
"MIT"
] | null | null | null | """
Code used for Figure S1 in the paper. Investigates the impact of changing
the coupling matrix on the magnetisation markup.
M Garrod, Jan 2021.
"""
import random
import numpy as np
from ising_block_level_influence import N_Block_sbm_class as NBlock
#Seed the random number generators:
seed = 1
random.seed(seed)... | 38.836957 | 113 | 0.68206 |
bb34e6aa8c55fe88d7a167d173a8ca05a5e0478e | 1,723 | py | Python | src/util/binary.py | zrthxn/CryptoGAN | e8dcdff0af4362d969874097516063f6bd39f5a1 | [
"MIT"
] | 4 | 2021-07-09T03:06:10.000Z | 2022-01-20T14:41:49.000Z | src/util/binary.py | meisme123/CryptoGAN | e8dcdff0af4362d969874097516063f6bd39f5a1 | [
"MIT"
] | 1 | 2021-05-13T08:29:38.000Z | 2021-05-13T08:29:38.000Z | src/util/binary.py | meisme123/CryptoGAN | e8dcdff0af4362d969874097516063f6bd39f5a1 | [
"MIT"
] | 1 | 2021-07-09T03:07:39.000Z | 2021-07-09T03:07:39.000Z | from torch.tensor import Tensor
from config import defaults
def str_to_binlist(text: str, values: tuple = (-1, 1), encoding: str = "utf-8"):
binlen = defaults[defaults["model"]]["blocksize"] // 8
byte = list()
if len(text) % binlen != 0:
text += "~"
if encoding == "utf-8":
byte = [ pad(bin(b).lstri... | 28.716667 | 82 | 0.587928 |
d5f5dc94d63275795be8faeeb4a752d45d885315 | 545 | py | Python | tests/doc/message_default_conf/conf.py | yosuke/sphinxcontrib-ros | 929f708f3c837b80e039d81a4be681e142a5784c | [
"BSD-2-Clause"
] | 9 | 2015-10-04T02:59:28.000Z | 2018-12-15T19:16:18.000Z | tests/doc/message_default_conf/conf.py | yosuke/sphinxcontrib-ros | 929f708f3c837b80e039d81a4be681e142a5784c | [
"BSD-2-Clause"
] | 4 | 2015-11-09T01:47:38.000Z | 2020-01-28T08:27:30.000Z | tests/doc/message_default_conf/conf.py | yosuke/sphinxcontrib-ros | 929f708f3c837b80e039d81a4be681e142a5784c | [
"BSD-2-Clause"
] | 2 | 2019-07-19T18:30:51.000Z | 2020-01-24T00:27:42.000Z | import os, sys
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/../../../src'))
from imp import reload; import sphinxcontrib; reload(sphinxcontrib)
master_doc = 'index'
extensions = ['sphinxcontrib.ros', 'sphinx.ext.intersphinx']
ros_base_path = ['/opt/ros/indigo/share']
#intersphinx_mapping = {'ros': (... | 45.416667 | 99 | 0.754128 |
b52eb00cc7ef26a93429f4034a375787070d8ca2 | 486 | py | Python | py/mount_passwords.py | christophfranke/continuous-integration-tools | eeb77a624303f5b5971ea7110a8352ff72feb312 | [
"MIT"
] | null | null | null | py/mount_passwords.py | christophfranke/continuous-integration-tools | eeb77a624303f5b5971ea7110a8352ff72feb312 | [
"MIT"
] | null | null | null | py/mount_passwords.py | christophfranke/continuous-integration-tools | eeb77a624303f5b5971ea7110a8352ff72feb312 | [
"MIT"
] | null | null | null | from modules import engine
from modules import out
from modules import run
@engine.prepare_and_clean
def execute():
out.log("Mounting passwords...")
run.local('mkdir -p ' + engine.PASSWORD_DIRECTORY)
run.local('chmod 700 ' + engine.PASSWORD_DIRECTORY)
run.local('sshfs macmini@Mac-minis-Mac-mini.local:Z... | 32.4 | 126 | 0.73251 |
2e4a520e7bbcc1bd3ff2d0a94e7a7adc62702653 | 9,248 | py | Python | Packs/FeedElasticsearch/Integrations/FeedElasticsearch/FeedElasticsearch_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 1 | 2020-04-19T11:05:42.000Z | 2020-04-19T11:05:42.000Z | Packs/FeedElasticsearch/Integrations/FeedElasticsearch/FeedElasticsearch_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | null | null | null | Packs/FeedElasticsearch/Integrations/FeedElasticsearch/FeedElasticsearch_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 1 | 2020-05-27T15:26:48.000Z | 2020-05-27T15:26:48.000Z | class MockHit:
def __init__(self, hit_val):
self._hit_val = hit_val
def to_dict(self):
return self._hit_val
"""MOCKED RESPONSES"""
CUSTOM_VAL_KEY = 'indicatorValue'
CUSTOM_TYPE_KEY = 'indicatorType'
CUSTOM_HIT = {
CUSTOM_VAL_KEY: '5.5.5.5',
CUSTOM_TYPE_KEY: 'IP'
}
PARSED_CUSTOM_HI... | 34.766917 | 104 | 0.648248 |
64ee1b69f879df17d80bc655ff5cff7faf8735c5 | 905 | py | Python | man/genlist-from-docbooks.py | charles-rose/nvme-stas | 7af1f489d98dad53d7bbb697eccc53e5c08dbfcc | [
"Apache-2.0"
] | null | null | null | man/genlist-from-docbooks.py | charles-rose/nvme-stas | 7af1f489d98dad53d7bbb697eccc53e5c08dbfcc | [
"Apache-2.0"
] | null | null | null | man/genlist-from-docbooks.py | charles-rose/nvme-stas | 7af1f489d98dad53d7bbb697eccc53e5c08dbfcc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import glob
from lxml import etree
exclude_list = list(glob.glob('standard-*.xml'))
PARSER = etree.XMLParser(remove_blank_text=True)
def extract_data(fname):
et = etree.parse(fname, PARSER)
manvolnum = et.find('./refmeta/manvolnum')
manvolnum = manvolnum.text if manvolnum is not No... | 26.617647 | 63 | 0.623204 |
3c4764ea302b24cfff8763bf4846bea8de10fcd0 | 4,941 | py | Python | src/dsfs/network.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | src/dsfs/network.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | src/dsfs/network.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | from collections import deque, Counter
import random
from typing import NamedTuple, Dict, List, Tuple
import tqdm
from dsfs.linalg.matrix import Matrix, make_matrix, shape
from dsfs.linalg.vector import Vector, dot, magnitude, distance
class User(NamedTuple):
id: int
name: str
users = [
User(0, "Hero"... | 25.209184 | 93 | 0.604938 |
f234e43e553b10b2559e610d6422d7847a4991f0 | 7,936 | py | Python | google/cloud/datacatalog_v1/types/policytagmanagerserialization.py | LaudateCorpus1/python-datacatalog | 7d8c3bc9bf540d3e5c0b0bd80a619792162c4fe2 | [
"Apache-2.0"
] | 41 | 2020-05-12T08:00:04.000Z | 2022-03-28T22:54:06.000Z | google/cloud/datacatalog_v1/types/policytagmanagerserialization.py | LaudateCorpus1/python-datacatalog | 7d8c3bc9bf540d3e5c0b0bd80a619792162c4fe2 | [
"Apache-2.0"
] | 114 | 2020-02-07T02:48:37.000Z | 2022-03-23T00:46:01.000Z | google/cloud/datacatalog_v1/types/policytagmanagerserialization.py | LaudateCorpus1/python-datacatalog | 7d8c3bc9bf540d3e5c0b0bd80a619792162c4fe2 | [
"Apache-2.0"
] | 21 | 2020-01-31T21:14:59.000Z | 2022-02-15T07:26:39.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 34.354978 | 110 | 0.686744 |
274bc3c9a286b1ede971d8084648e88a8f32d8e3 | 5,955 | py | Python | conformer/models/conformer/modules.py | phanxuanphucnd/conformer | a14562ef118c7539ebeade469d0e164ffb5f57a1 | [
"MIT"
] | 5 | 2021-11-05T17:15:42.000Z | 2022-01-11T04:38:05.000Z | conformer/models/conformer/modules.py | phanxuanphucnd/conformer | a14562ef118c7539ebeade469d0e164ffb5f57a1 | [
"MIT"
] | null | null | null | conformer/models/conformer/modules.py | phanxuanphucnd/conformer | a14562ef118c7539ebeade469d0e164ffb5f57a1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
from torch import Tensor
from typing import Optional
from arizona_asr.models.activation import Swish, GLU
from arizona_asr.models.modules import Transpose, Linear
from arizona_asr.models.attention import RelativeMultiHeadAttention
from arizona_asr.models.tr... | 42.535714 | 119 | 0.664652 |
3fa114358c99ff4f75ad6777b7e9291261cfa566 | 1,164 | py | Python | nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py | nicholsn/nipype | 6601b00aac39d17bb9fb3a6801f5a740a6ebb1e3 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:31:47.000Z | 2021-09-08T14:31:47.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.utils import ExtractMainComponent
def test_ExtractMainComponent_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
igno... | 27.714286 | 78 | 0.676976 |
a76963548702aa0e7c6efde23e38741f722969da | 1,181 | py | Python | dcrnn_train.py | ScanLab-ossi/SDN-DCRNN | ed74497717fc7d0a6bcadc1b3d48e2e848a60175 | [
"MIT"
] | null | null | null | dcrnn_train.py | ScanLab-ossi/SDN-DCRNN | ed74497717fc7d0a6bcadc1b3d48e2e848a60175 | [
"MIT"
] | null | null | null | dcrnn_train.py | ScanLab-ossi/SDN-DCRNN | ed74497717fc7d0a6bcadc1b3d48e2e848a60175 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import tensorflow as tf
import yaml
from lib.utils import load_pickle
from model.dcrnn_supervisor import DCRNNSupervisor
def main(args):
with open(args.config_filename) as f:
supe... | 31.918919 | 104 | 0.701948 |
f2679a50f274f52887565ed9aa0f47ebae43d55e | 10,063 | py | Python | pl_bolts/datamodules/experience_source.py | ahmedhshahin/pytorch-lightning-bolts | 9298367968955095db756a4864eee21e0f902ac3 | [
"Apache-2.0"
] | null | null | null | pl_bolts/datamodules/experience_source.py | ahmedhshahin/pytorch-lightning-bolts | 9298367968955095db756a4864eee21e0f902ac3 | [
"Apache-2.0"
] | null | null | null | pl_bolts/datamodules/experience_source.py | ahmedhshahin/pytorch-lightning-bolts | 9298367968955095db756a4864eee21e0f902ac3 | [
"Apache-2.0"
] | 1 | 2021-03-24T15:13:02.000Z | 2021-03-24T15:13:02.000Z | """
Datamodules for RL models that rely on experiences generated during training
Based on implementations found here: https://github.com/Shmuma/ptan/blob/master/ptan/experience.py
"""
from abc import ABC
from collections import deque, namedtuple
from typing import Callable, Iterable, List, Tuple
import torch
from gym ... | 34.111864 | 116 | 0.625062 |
912135c69210676089259583b0907ceb2abd5bff | 1,772 | py | Python | platform/core/polyaxon/options/registry/cleaning.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/options/registry/cleaning.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/options/registry/cleaning.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | from options import option_namespaces, option_subjects
from options.cache import LONG_CACHE_TTL
from options.option import NAMESPACE_DB_OPTION_MARKER, Option, OptionStores
from options.types import CONF_TYPES
CLEANING_INTERVALS_ACTIVITY_LOGS = '{}{}{}'.format(option_namespaces.CLEANING_INTERVALS,
... | 38.521739 | 88 | 0.6693 |
4ffbc659b6171acc21abbc96f91af0753ae7e47c | 15,193 | py | Python | recipe_modules/file/resources/fileutil.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | 1 | 2021-04-24T04:03:01.000Z | 2021-04-24T04:03:01.000Z | recipe_modules/file/resources/fileutil.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | null | null | null | recipe_modules/file/resources/fileutil.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Utility exporting basic filesystem operations.
This file was cut from "scripts/common/chromium_utils.py" at:
91310531c31... | 35.917258 | 86 | 0.679787 |
001a4551d9d979a77f27ee213af1616a5bdb3dc9 | 4,539 | py | Python | libs/groupdocs_conversion_cloud/models/webp_convert_options.py | rocketbot-cl/pdf2word | e46f6f574f69aa744e300baf4802e426b71bf9b2 | [
"MIT"
] | null | null | null | libs/groupdocs_conversion_cloud/models/webp_convert_options.py | rocketbot-cl/pdf2word | e46f6f574f69aa744e300baf4802e426b71bf9b2 | [
"MIT"
] | null | null | null | libs/groupdocs_conversion_cloud/models/webp_convert_options.py | rocketbot-cl/pdf2word | e46f6f574f69aa744e300baf4802e426b71bf9b2 | [
"MIT"
] | null | null | null | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd" file="WebpConvertOptions.py">
# Copyright (c) 2003-2019 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a cop... | 33.131387 | 94 | 0.593743 |
bc9f9176bc326a0e935338d4d11476312b79c433 | 21,608 | py | Python | src/test/tinc/tincrepo/mpp/models/test/sql_related/test_sql_test_case.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 9 | 2018-04-20T03:31:01.000Z | 2020-05-13T14:10:53.000Z | src/test/tinc/tincrepo/mpp/models/test/sql_related/test_sql_test_case.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 36 | 2017-09-21T09:12:27.000Z | 2020-06-17T16:40:48.000Z | src/test/tinc/tincrepo/mpp/models/test/sql_related/test_sql_test_case.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 32 | 2017-08-31T12:50:52.000Z | 2022-03-01T07:34:53.000Z | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | 45.586498 | 194 | 0.698954 |
54abb65abf4b369c3bf41ea983057c782fd3bce7 | 9,305 | py | Python | model.py | EricSchles/RNN-data-gen | 02cc59c8c44fffe375f7c51e1cf8f48811f6cc2f | [
"MIT"
] | 1 | 2019-04-22T16:47:05.000Z | 2019-04-22T16:47:05.000Z | model.py | afcarl/RNN-data-gen | 02cc59c8c44fffe375f7c51e1cf8f48811f6cc2f | [
"MIT"
] | null | null | null | model.py | afcarl/RNN-data-gen | 02cc59c8c44fffe375f7c51e1cf8f48811f6cc2f | [
"MIT"
] | 1 | 2018-08-12T15:16:11.000Z | 2018-08-12T15:16:11.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.206226 | 81 | 0.693498 |
6256362f43e9730a133bed84987e0a9b8695470f | 212 | gyp | Python | socket/rc522/binding.gyp | tryy3/skolschema | 50ff7db91f9a1f6d526341de920f595b7b6bf9d7 | [
"BSD-3-Clause"
] | null | null | null | socket/rc522/binding.gyp | tryy3/skolschema | 50ff7db91f9a1f6d526341de920f595b7b6bf9d7 | [
"BSD-3-Clause"
] | null | null | null | socket/rc522/binding.gyp | tryy3/skolschema | 50ff7db91f9a1f6d526341de920f595b7b6bf9d7 | [
"BSD-3-Clause"
] | null | null | null | {
"targets": [
{
"target_name": "rc522",
"sources": [
"src/rc522.c",
"src/rfid.c",
"src/accessor.cc"
],
"libraries": [
"-lbcm2835"
]
}
]
} | 14.133333 | 29 | 0.363208 |
3d428117d51286a63d94e35461d561297ff8d9a1 | 4,878 | py | Python | clients/python-flask/generated/openapi_server/models/computer_set.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 23 | 2017-08-01T12:25:26.000Z | 2022-01-25T03:44:11.000Z | clients/python-flask/generated/openapi_server/models/computer_set.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 35 | 2017-06-14T03:28:15.000Z | 2022-02-14T10:25:54.000Z | clients/python-flask/generated/openapi_server/models/computer_set.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 11 | 2017-08-31T19:00:20.000Z | 2021-12-19T12:04:12.000Z | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server.models.hudson_master_computer import HudsonMasterComputer # noqa: F401,E501
from openapi_server... | 28.694118 | 175 | 0.637351 |
c55db49df1433faa66e5ecfeb6e8adaad9fafed8 | 8,126 | py | Python | salt/states/saltmod.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/states/saltmod.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/states/saltmod.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Control the Salt command interface
==================================
The Salt state is used to control the salt command interface. This state is
intended for use primarily from the state runner from the master.
The salt.state declaration can call out a highstate or a list of sls:
web... | 27.924399 | 85 | 0.562023 |
5b050bb123e179303959b3e0c251104489653e1d | 5,519 | py | Python | Atrial_LDRBM/LDRBM/Fiber_RA/ra_main.py | KIT-IBT/AugmentA | b44ea02a4c6e33fd6c14ce3cf180d5603ff660b1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | Atrial_LDRBM/LDRBM/Fiber_RA/ra_main.py | KIT-IBT/AugmentA | b44ea02a4c6e33fd6c14ce3cf180d5603ff660b1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2022-02-25T13:58:03.000Z | 2022-03-01T14:53:42.000Z | Atrial_LDRBM/LDRBM/Fiber_RA/ra_main.py | KIT-IBT/AugmentA | b44ea02a4c6e33fd6c14ce3cf180d5603ff660b1 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 19 14:55:02 2021
@author: Luca Azzolin
Copyright 2021 Luca Azzolin
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
regard... | 37.544218 | 176 | 0.589237 |
dff3c720c16c4d01354dad494b2e9827e3857347 | 389 | py | Python | Lektion_5/gps_project/main.py | tvotan/dhbw_python_kivy | 41d363d41a79e1881128be54dc30b5d0c58afb70 | [
"MIT"
] | 1 | 2020-10-27T15:27:06.000Z | 2020-10-27T15:27:06.000Z | Lektion_5/gps_project/main.py | tvotan/dhbw_python_kivy | 41d363d41a79e1881128be54dc30b5d0c58afb70 | [
"MIT"
] | null | null | null | Lektion_5/gps_project/main.py | tvotan/dhbw_python_kivy | 41d363d41a79e1881128be54dc30b5d0c58afb70 | [
"MIT"
] | null | null | null | from kivymd.app import MDApp
from map_view import FarmersMapView
import sqlite3
class MainApp(MDApp):
connection = None
cursor = None
# Initialisiert die GPS-Funktion
def on_start(self):
# Database verbinden
self.connection = sqlite3.connect("markets.db")
self.cursor = self.c... | 18.52381 | 55 | 0.678663 |
9d8cf60b2bf8ee6c5b115f348a54eb9e242baedd | 3,147 | py | Python | tests/components/tradfri/test_init.py | FilHarr/core | c3a2eedf0beb0d1a66ff1a39705e715ded35e085 | [
"Apache-2.0"
] | 1 | 2022-03-20T05:31:13.000Z | 2022-03-20T05:31:13.000Z | tests/components/tradfri/test_init.py | FilHarr/core | c3a2eedf0beb0d1a66ff1a39705e715ded35e085 | [
"Apache-2.0"
] | null | null | null | tests/components/tradfri/test_init.py | FilHarr/core | c3a2eedf0beb0d1a66ff1a39705e715ded35e085 | [
"Apache-2.0"
] | null | null | null | """Tests for Tradfri setup."""
from unittest.mock import patch
from homeassistant.components import tradfri
from homeassistant.helpers import device_registry as dr
from . import GATEWAY_ID
from tests.common import MockConfigEntry
async def test_entry_setup_unload(hass, mock_api_factory):
"""Test config entry s... | 34.582418 | 76 | 0.708611 |
fa1e76baa3066c61b6d477217677ff0640a695da | 291 | py | Python | examples/advanced/multiple_tasks_single_process.py | thepycoder/clearml | 717edba8c2b39fb7486bd2aba9ca0294f309b4c3 | [
"Apache-2.0"
] | 2,097 | 2019-06-11T14:36:25.000Z | 2020-12-21T03:52:59.000Z | examples/advanced/multiple_tasks_single_process.py | thepycoder/clearml | 717edba8c2b39fb7486bd2aba9ca0294f309b4c3 | [
"Apache-2.0"
] | 247 | 2019-06-11T15:10:26.000Z | 2020-12-21T17:34:32.000Z | examples/advanced/multiple_tasks_single_process.py | thepycoder/clearml | 717edba8c2b39fb7486bd2aba9ca0294f309b4c3 | [
"Apache-2.0"
] | 256 | 2019-06-11T14:36:28.000Z | 2020-12-18T08:32:47.000Z | from clearml import Task
for i in range(3):
task = Task.init(project_name="examples", task_name="Same process, Multiple tasks, Task #{}".format(i))
# Doing Task processing here
print("Task #{} running".format(i))
#
print("Task #{} done :) ".format(i))
task.close()
| 26.454545 | 107 | 0.632302 |
3850cdc8424c8cb27ed59df67150eff2b0dcd2d6 | 5,693 | py | Python | ocs_ci/ocs/must_gather/must_gather.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | ocs_ci/ocs/must_gather/must_gather.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | ocs_ci/ocs/must_gather/must_gather.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | import os
import logging
import shutil
import tempfile
import re
from pathlib import Path
from ocs_ci.helpers.helpers import storagecluster_independent_check
from ocs_ci.ocs.resources.pod import get_all_pods
from ocs_ci.ocs.utils import collect_ocs_logs
from ocs_ci.ocs.must_gather.const_must_gather import GATHER_COMMA... | 32.718391 | 89 | 0.595468 |
d02fdfbff0cd41986ce36dd2bb29348f68cee7ba | 6,804 | py | Python | modules/tools/record_play/rtk_recorder.py | qwetqwe/simulation | 1d6a87b7595db1d32c656ae783aa365de551c5bc | [
"Apache-2.0"
] | 2 | 2020-06-04T01:11:43.000Z | 2020-06-04T05:32:15.000Z | modules/tools/record_play/rtk_recorder.py | LishaUnfoolish/simulation | 1d6a87b7595db1d32c656ae783aa365de551c5bc | [
"Apache-2.0"
] | 7 | 2021-03-10T18:14:25.000Z | 2022-02-27T04:46:46.000Z | modules/tools/record_play/rtk_recorder.py | LishaUnfoolish/simulation | 1d6a87b7595db1d32c656ae783aa365de551c5bc | [
"Apache-2.0"
] | 2 | 2020-08-05T12:52:42.000Z | 2021-10-19T13:07:49.000Z | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo 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 ... | 33.517241 | 87 | 0.604203 |
480aade4bc5d376e3ba7cd9df7d768f02bd4b3fe | 8,299 | py | Python | python/ray/tune/experiment.py | hhbyyh/ray | e4565c9cc6caa15e0d32694d974d8db28841630e | [
"Apache-2.0"
] | 1 | 2020-10-25T22:51:38.000Z | 2020-10-25T22:51:38.000Z | python/ray/tune/experiment.py | hhbyyh/ray | e4565c9cc6caa15e0d32694d974d8db28841630e | [
"Apache-2.0"
] | null | null | null | python/ray/tune/experiment.py | hhbyyh/ray | e4565c9cc6caa15e0d32694d974d8db28841630e | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import inspect
import logging
import os
import six
import types
from ray.tune.error import TuneError
from ray.tune.registry import register_trainable
from ray.tune.result import DEFAULT_RESULTS_DIR... | 33.59919 | 79 | 0.581998 |
9b9516f6d0bdedb30e9ddcb419639920fe6e000f | 10,340 | py | Python | tensorflow/lite/python/interpreter.py | Sonata-Wang/tensorflow | 8bbef0cd77879d05ed69bf30e76087847a8ca4a2 | [
"Apache-2.0"
] | 36 | 2016-12-17T15:25:25.000Z | 2022-01-29T21:50:53.000Z | tensorflow/lite/python/interpreter.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | 30 | 2016-10-04T15:38:08.000Z | 2020-07-16T12:09:33.000Z | tensorflow/lite/python/interpreter.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | 36 | 2017-07-27T21:12:40.000Z | 2022-02-03T16:45:56.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.050847 | 84 | 0.702708 |
c036218e7e416d328cbbce80d5e8e180fab5782d | 10,134 | py | Python | src/.history/Test/HiwinRT605_test_20190619124542.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | src/.history/Test/HiwinRT605_test_20190619124542.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | src/.history/Test/HiwinRT605_test_20190619124542.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# license removed for brevity
#策略 機械手臂 四點來回跑
import rospy
import os
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import math
import enum
import Hiwin_RT605_ROS as strategy
pos_feedback_times = 0
mode_feedback_times = 0
msg_feedback... | 30.616314 | 116 | 0.57687 |
6744366509a32f1853489155bb5d5acd13d44a4a | 227 | py | Python | sqlalchemy_utils/exceptions.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | 1 | 2015-07-06T11:19:11.000Z | 2015-07-06T11:19:11.000Z | sqlalchemy_utils/exceptions.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_utils/exceptions.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | null | null | null | """Global SQLAlchemy-Utils exception classes.
"""
class ImproperlyConfigured(Exception):
"""
SQLAlchemy-Utils is improperly configured; normally due to usage of
a utility that depends on a missing library.
"""
| 25.222222 | 71 | 0.722467 |
3df1044e69977585208295bb305ce79f3ee0b722 | 4,310 | py | Python | packages/tools/lektor_tools.py | Richienb/terminalguide | 5246927c4d1197909c0ae2c7440f9bbed45db3cd | [
"MIT"
] | null | null | null | packages/tools/lektor_tools.py | Richienb/terminalguide | 5246927c4d1197909c0ae2c7440f9bbed45db3cd | [
"MIT"
] | null | null | null | packages/tools/lektor_tools.py | Richienb/terminalguide | 5246927c4d1197909c0ae2c7440f9bbed45db3cd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
from lektor.pluginsystem import Plugin
from lektor.context import get_ctx
def snip_resolver(name):
ctx = get_ctx()
if not ctx:
return 'DEVMODE?'
val = 'SNIPPET ' + name
env = ctx.env
filename = os.path.join(env.root_path, 'snippets', name + '.txt')
... | 26.9375 | 85 | 0.494432 |
2a6da1c0108da50f479b2161b470ed87a09542c0 | 2,424 | py | Python | application/physical/GIS/qgis3-tests/test_qgisaddlayercsv.py | cprior/sunlightmap | 402809aaa48cd540d73b1954da353b6dfedb405d | [
"MIT"
] | 1 | 2018-01-05T11:18:57.000Z | 2018-01-05T11:18:57.000Z | application/physical/GIS/qgis3-tests/test_qgisaddlayercsv.py | cprior/sunlightmap_app | 402809aaa48cd540d73b1954da353b6dfedb405d | [
"MIT"
] | 8 | 2017-10-23T19:14:26.000Z | 2017-11-16T18:01:23.000Z | application/physical/GIS/qgis3-tests/test_qgisaddlayercsv.py | cprior/sunlightmap_app | 402809aaa48cd540d73b1954da353b6dfedb405d | [
"MIT"
] | null | null | null | """
This unittest for for QGIS 3 checks adding layers.
"""
import os
# import sys # @todo: setUp with an environment variable for PYTHONPATH
import unittest
#from qgis import *
from qgis.core import *
class TestQgisAddLayer(unittest.TestCase):
def setUp(self):
try:
self.qgis_version = QGis.... | 32.756757 | 79 | 0.640677 |
ebce82454a78d66791e52823f6e32759646fb597 | 1,252 | py | Python | python/opscore/RO/Comm/BrowseURL.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | null | null | null | python/opscore/RO/Comm/BrowseURL.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | 1 | 2021-08-17T21:08:14.000Z | 2021-08-17T21:08:14.000Z | python/opscore/RO/Comm/BrowseURL.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | null | null | null |
"""Open a URL in the user's default browser.
The URL is opened in a background thread.
History:
2004-10-05 ROwen
2011-06-16 ROwen Ditched obsolete "except (SystemExit, KeyboardInterrupt): raise" code
"""
__all__ = ["browseURL"]
import threading
import six.moves.urllib.parse as parse
import webbrowser
class _Bro... | 25.04 | 89 | 0.571885 |
e95fc9575a4fe693f4a307f8424c3edcbc9d196b | 1,810 | py | Python | test/parser/unit_operators/testcases/Log/Log_generator.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 223 | 2020-04-15T20:34:33.000Z | 2022-03-28T05:41:49.000Z | test/parser/unit_operators/testcases/Log/Log_generator.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 42 | 2019-07-29T15:57:12.000Z | 2020-04-08T15:12:48.000Z | test/parser/unit_operators/testcases/Log/Log_generator.py | AyishaR/deepC | 1dc9707ef5ca9000fc13c3da7f1129685a83b494 | [
"Apache-2.0"
] | 58 | 2019-07-22T11:46:19.000Z | 2020-04-09T22:56:41.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 ... | 38.510638 | 92 | 0.745304 |
c4cd6fc371b9b71426040dca2cec523e2480c979 | 16,525 | py | Python | ansys/mapdl/core/_commands/solution/solid_constraints.py | da1910/pymapdl | 305b70b30e61a78011e974ff4cb409ee21f89e13 | [
"MIT"
] | null | null | null | ansys/mapdl/core/_commands/solution/solid_constraints.py | da1910/pymapdl | 305b70b30e61a78011e974ff4cb409ee21f89e13 | [
"MIT"
] | null | null | null | ansys/mapdl/core/_commands/solution/solid_constraints.py | da1910/pymapdl | 305b70b30e61a78011e974ff4cb409ee21f89e13 | [
"MIT"
] | null | null | null | def da(self, area="", lab="", value1="", value2="", **kwargs):
"""Defines degree-of-freedom constraints on areas.
APDL Command: DA
Parameters
----------
area
Area on which constraints are to be specified. If ALL, apply to
all selected areas [ASEL]. A component name may also be su... | 32.593688 | 93 | 0.657368 |
f3b9678e04facb74be2995f5a4b6ca503802ef45 | 748 | py | Python | lakey_finicity/models/birth_date.py | jeremydeanlakey/lakey-finicity-python | f0b5ae6febb9337f0e28731f631b726fca940d2c | [
"MIT"
] | 1 | 2021-02-09T14:44:55.000Z | 2021-02-09T14:44:55.000Z | lakey_finicity/models/birth_date.py | jeremydeanlakey/lakey-finicity-python | f0b5ae6febb9337f0e28731f631b726fca940d2c | [
"MIT"
] | null | null | null | lakey_finicity/models/birth_date.py | jeremydeanlakey/lakey-finicity-python | f0b5ae6febb9337f0e28731f631b726fca940d2c | [
"MIT"
] | 1 | 2022-01-26T18:09:33.000Z | 2022-01-26T18:09:33.000Z | from dataclasses import dataclass
# https://community.finicity.com/s/article/Report-Consumers
@dataclass
class BirthDate(object):
year: int
month: int
day_of_month: int
def to_padded_string_dict(self) -> dict:
return {
'year': f'{self.year:04}', # The birthday's 4-digit year
... | 31.166667 | 91 | 0.628342 |
de614908b53369726bd04f554ef8a7ea7b791581 | 1,098 | py | Python | api/tests/batch_mode_split_10_requests/test_batch_mode_split_10_requests.py | zhampel/FakeFinder | 2891a8649acc1dabdef07554d6acb346dd23dbae | [
"Apache-2.0"
] | null | null | null | api/tests/batch_mode_split_10_requests/test_batch_mode_split_10_requests.py | zhampel/FakeFinder | 2891a8649acc1dabdef07554d6acb346dd23dbae | [
"Apache-2.0"
] | null | null | null | api/tests/batch_mode_split_10_requests/test_batch_mode_split_10_requests.py | zhampel/FakeFinder | 2891a8649acc1dabdef07554d6acb346dd23dbae | [
"Apache-2.0"
] | null | null | null | import requests
import json
def test_batch_mode_selimsef():
url = 'http://localhost:5000/fakefinder/'
# Additional headers.
headers = {'Content-Type': 'application/json' }
# Body
payload = {"batchMode": True,
"alwaysOn": False,
"s3Location": ["s3://ff-inbound-videos/... | 39.214286 | 380 | 0.627505 |
736638dd9e49ffff22868dd2c0e8ad8bdc8a08a6 | 381 | py | Python | tests/test_util.py | redsoxfantom-home-automation/python_lifx_sdk | 4a979036713c247de0603827e466fe746d16bc04 | [
"MIT"
] | 29 | 2015-07-07T00:22:39.000Z | 2021-01-30T21:41:21.000Z | tests/test_util.py | redsoxfantom-home-automation/python_lifx_sdk | 4a979036713c247de0603827e466fe746d16bc04 | [
"MIT"
] | 9 | 2015-07-11T23:06:50.000Z | 2016-12-08T22:11:49.000Z | tests/test_util.py | redsoxfantom-home-automation/python_lifx_sdk | 4a979036713c247de0603827e466fe746d16bc04 | [
"MIT"
] | 16 | 2015-09-03T13:38:00.000Z | 2020-11-23T20:27:52.000Z | import unittest
import time
from lifx.util import RepeatTimer
class UtilTests(unittest.TestCase):
def test_timer(self):
def trigger():
trigger.counter += 1
trigger.counter = 0
timer = RepeatTimer(0.005, trigger)
timer.start()
time.sleep(0.04)
timer.ca... | 18.142857 | 51 | 0.622047 |
91199d8b838586b2d4d89e8fdcc36eabdd908736 | 1,476 | py | Python | superjob.py | Rostwik/Future_salary | a42c95c3deaf6d63b81a300a001a45d0b44d5b05 | [
"MIT"
] | null | null | null | superjob.py | Rostwik/Future_salary | a42c95c3deaf6d63b81a300a001a45d0b44d5b05 | [
"MIT"
] | null | null | null | superjob.py | Rostwik/Future_salary | a42c95c3deaf6d63b81a300a001a45d0b44d5b05 | [
"MIT"
] | null | null | null | import itertools
import requests
from predict_salary import predict_rub_salary, get_analytics
def get_keyword_statistics(keyword, superjob_header, town_code, category_code):
url = 'https://api.superjob.ru/2.0/vacancies'
jobs = []
salaries = []
for page in itertools.count():
payloads = {
... | 25.894737 | 84 | 0.632114 |
f3b53aa80ddfb3ed4812472438551e7c1623afa1 | 1,454 | py | Python | prism/cmds/fun/eightball.py | ii-Python/Prism-v3 | 15a43161b41117529c915726e6270259f05d187d | [
"MIT"
] | 3 | 2021-11-26T22:08:11.000Z | 2021-12-23T21:42:22.000Z | prism/cmds/fun/eightball.py | wannurhadi/Prism-v3 | 514f8d17072bf208c42e68391bce471c7d608269 | [
"MIT"
] | 1 | 2021-07-07T22:37:10.000Z | 2021-07-07T22:40:11.000Z | prism/cmds/fun/eightball.py | wannurhadi/Prism-v3 | 514f8d17072bf208c42e68391bce471c7d608269 | [
"MIT"
] | 1 | 2021-12-23T21:42:24.000Z | 2021-12-23T21:42:24.000Z | # Copyright 2021-xx iiPython
# Modules
import random
from discord.ext import commands
from discord.commands import Option
# Command class
class Eightball(commands.Cog):
def __init__(self, bot) -> None:
self.bot = bot
self.core = bot.core
self._8ball_responses = [
"It is certai... | 36.35 | 106 | 0.608666 |
f5abf485762ec81cba3e638838afba8540ce5fcf | 4,147 | py | Python | qa/rpc-tests/p2p-feefilter.py | cenut/ilcoin-master | 8bfc6f7e5e23bcf35840e1988bf19ec6096be9c2 | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-feefilter.py | cenut/ilcoin-master | 8bfc6f7e5e23bcf35840e1988bf19ec6096be9c2 | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-feefilter.py | cenut/ilcoin-master | 8bfc6f7e5e23bcf35840e1988bf19ec6096be9c2 | [
"MIT"
] | 1 | 2020-04-10T07:57:53.000Z | 2020-04-10T07:57:53.000Z | #!/usr/bin/env python3
# Copyright (c) 2016 The Ilcoin Core developers
# All Rights Reserved. Ilgamos International 2017©
"""Test processing of feefilter messages."""
from test_framework.mininode import *
from test_framework.test_framework import IlcoinTestFramework
from test_framework.util import *
import time
def ... | 37.026786 | 91 | 0.657825 |
d1ca7633c451259985ebcbfa2c15d14d86c01a0d | 4,754 | py | Python | tests/unit/threaded_test_wrapper_test.py | DavidWittman/pika | 6d9896c89ee187ce1a1a5c6e55a1ee0adcc5b538 | [
"BSD-3-Clause"
] | 2,479 | 2015-01-01T20:06:23.000Z | 2022-03-31T13:29:19.000Z | tests/unit/threaded_test_wrapper_test.py | DavidWittman/pika | 6d9896c89ee187ce1a1a5c6e55a1ee0adcc5b538 | [
"BSD-3-Clause"
] | 813 | 2015-01-07T07:13:49.000Z | 2022-03-28T05:05:06.000Z | tests/unit/threaded_test_wrapper_test.py | DavidWittman/pika | 6d9896c89ee187ce1a1a5c6e55a1ee0adcc5b538 | [
"BSD-3-Clause"
] | 763 | 2015-01-10T04:38:33.000Z | 2022-03-31T07:24:57.000Z | """
Tests for threaded_test_wrapper.py
"""
from __future__ import print_function
import sys
import threading
import time
import unittest
try:
from unittest import mock
except ImportError:
import mock
import pika.compat
from tests.wrappers import threaded_test_wrapper
from tests.wrappers.threaded_test_wrapp... | 32.786207 | 99 | 0.628944 |
00135a8c3aa15221063162776956512989d51b7e | 320 | py | Python | lib.py | Shikiiii/shikiBot | 12540ca80d388951323ec121cb554bf603fc253f | [
"MIT"
] | null | null | null | lib.py | Shikiiii/shikiBot | 12540ca80d388951323ec121cb554bf603fc253f | [
"MIT"
] | null | null | null | lib.py | Shikiiii/shikiBot | 12540ca80d388951323ec121cb554bf603fc253f | [
"MIT"
] | null | null | null | import guilded
from guilded.ext import commands
class Cog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.owners = ["AnbjoWYA", "dxDY9JEd", "4WPbEZwd"]
if self.hidden:
for cmd in self.get_commands():
cmd.hidden = True
def __init_subclass__(cls, hidden: bool = False):
cls.hidden = hidden
| 21.333333 | 52 | 0.7 |
f13601a9451a26b2ff267829af339e98fac485f2 | 1,916 | py | Python | desktop/core/ext-py/amqp-2.4.1/extra/update_comments_from_spec.py | maulikjs/hue | 59ac879b55bb6fb26ecb4e85f4c70836fc21173f | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/amqp-2.4.1/extra/update_comments_from_spec.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/amqp-2.4.1/extra/update_comments_from_spec.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | from __future__ import absolute_import, unicode_literals
import os
import sys
import re
default_source_file = os.path.join(
os.path.dirname(__file__),
'../amqp/channel.py',
)
RE_COMMENTS = re.compile(
'(?P<methodsig>def\s+(?P<mname>[a-zA-Z0-9_]+)\(.*?\)'
':\n+\s+""")(?P<comment>.*?)(?=""")',
re.M... | 24.883117 | 72 | 0.60595 |
1963ceed30a44400f791762173131f732c2a5564 | 1,077 | py | Python | tests/test_lossy.py | finalfusion/finalfusion-python | f7ab0174a66731d0f71635c45d172f7711f6aec8 | [
"BlueOak-1.0.0"
] | 5 | 2019-06-13T12:06:59.000Z | 2020-09-11T11:56:16.000Z | tests/test_lossy.py | finalfusion/finalfusion-python | f7ab0174a66731d0f71635c45d172f7711f6aec8 | [
"BlueOak-1.0.0"
] | 77 | 2019-03-23T11:32:36.000Z | 2020-06-30T11:14:21.000Z | tests/test_lossy.py | danieldk/finalfrontier-python | f7ab0174a66731d0f71635c45d172f7711f6aec8 | [
"BlueOak-1.0.0"
] | 9 | 2019-06-24T10:11:50.000Z | 2019-12-12T10:02:00.000Z | import pytest
from finalfusion import load_text_dims, load_text, load_word2vec
def test_text_dims_broken_utf8(tests_root):
e = load_text_dims(tests_root / "data" / "utf8-incomplete.dims",
lossy=True)
assert e.vocab.words == ["meren", "zee�n", "rivieren"]
with pytest.raises(UnicodeD... | 38.464286 | 79 | 0.651811 |
1ecae9afd987ea18a3f4bdf63e2ff08d667cac09 | 254 | py | Python | tests/dB_scripts/removeOverlap.py | roberto-arista/TypedBot | a9af53d2d551ec761e81787e7e468d966e2bb37e | [
"BSD-3-Clause"
] | 2 | 2021-12-03T00:42:44.000Z | 2021-12-15T14:16:44.000Z | tests/dB_scripts/removeOverlap.py | roberto-arista/TypedBot | a9af53d2d551ec761e81787e7e468d966e2bb37e | [
"BSD-3-Clause"
] | null | null | null | tests/dB_scripts/removeOverlap.py | roberto-arista/TypedBot | a9af53d2d551ec761e81787e7e468d966e2bb37e | [
"BSD-3-Clause"
] | null | null | null | import drawBot
drawBot.newDrawing()
drawBot.newPage(200, 100)
p = drawBot.BezierPath()
p.oval(5, 5, 70, 70)
p.rect(25, 25, 70, 70)
drawBot.fill(0, 0.3)
drawBot.stroke(0)
drawBot.drawPath(p)
p.removeOverlap()
drawBot.translate(100, 0)
drawBot.drawPath(p)
| 19.538462 | 25 | 0.732283 |
0bd2f125d63bbcb69555c6dbe410955d23dbd53e | 8,734 | py | Python | tests/test_filtsmooth/test_gaussfiltsmooth/test_extendedkalman.py | admdev8/probnum | 792b6299bac247cf8b1b5056756f0f078855d83a | [
"MIT"
] | null | null | null | tests/test_filtsmooth/test_gaussfiltsmooth/test_extendedkalman.py | admdev8/probnum | 792b6299bac247cf8b1b5056756f0f078855d83a | [
"MIT"
] | 2 | 2020-12-28T19:37:16.000Z | 2020-12-28T19:37:31.000Z | tests/test_filtsmooth/test_gaussfiltsmooth/test_extendedkalman.py | admdev8/probnum | 792b6299bac247cf8b1b5056756f0f078855d83a | [
"MIT"
] | null | null | null | import numpy as np
import scipy.linalg
from probnum.filtsmooth.gaussfiltsmooth import ExtendedKalman
from .filtsmooth_testcases import (
CarTrackingDDTestCase,
OrnsteinUhlenbeckCDTestCase,
PendulumNonlinearDDTestCase,
)
np.random.seed(5472)
VISUALISE = False # show plots or not?
if VISUALISE is True:
... | 36.543933 | 88 | 0.583925 |
63912902c1a6da683bd77ca12fce5a30f70541eb | 1,406 | py | Python | server/app/users/repositories.py | aryaniyaps/todos | 06e18717dfc1139d5ab2fdd71f8baf0d08548c33 | [
"BSD-3-Clause"
] | 2 | 2021-11-05T05:19:55.000Z | 2021-11-05T07:07:50.000Z | server/app/users/repositories.py | aryaniyaps/todos | 06e18717dfc1139d5ab2fdd71f8baf0d08548c33 | [
"BSD-3-Clause"
] | 184 | 2021-11-11T04:34:30.000Z | 2022-03-28T08:25:51.000Z | server/app/users/repositories.py | aryaniyaps/todos | 06e18717dfc1139d5ab2fdd71f8baf0d08548c33 | [
"BSD-3-Clause"
] | null | null | null | from passlib.hash import bcrypt
from sqlalchemy import select
from app.database.core import db_session
from app.users.entities import User
class UserRepo:
@classmethod
def get_user(cls, user_id: int) -> User | None:
"""
Get an user with the given ID.
:param user_id: The user's ID.
... | 23.433333 | 60 | 0.586771 |
ce62ff348bde77fbc3b1c2ccb094ef74ab9fdeff | 2,853 | py | Python | src/log-analytics-solution/azext_log_analytics_solution/custom.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | null | null | null | src/log-analytics-solution/azext_log_analytics_solution/custom.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | null | null | null | src/log-analytics-solution/azext_log_analytics_solution/custom.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.347826 | 116 | 0.514546 |
99b98c85db6971f73c3d7f68fd6951c03998f24e | 3,102 | py | Python | course/migrations/0092_unicode_literals.py | 68ymtlab/relate | 0120ca0188a969b3251722241e8d97fda52226b4 | [
"Unlicense"
] | null | null | null | course/migrations/0092_unicode_literals.py | 68ymtlab/relate | 0120ca0188a969b3251722241e8d97fda52226b4 | [
"Unlicense"
] | 6 | 2015-08-18T00:13:40.000Z | 2018-01-31T05:55:13.000Z | course/migrations/0092_unicode_literals.py | davis68/relate | eb40c8c17d4a724a60de3caa3334521a833bad5c | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-08 22:07
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('course', '0091_changes_found... | 45.617647 | 195 | 0.661186 |
691d7d0c2859555ae2558d66a65ec7cca8b04eda | 387 | py | Python | thesis/nn/models/__init__.py | morris-frank/unnamed-source-separation | e23af1761e8fdd587a67b307eaee800b02f5bccf | [
"MIT"
] | 2 | 2021-01-05T11:34:09.000Z | 2021-01-05T16:06:36.000Z | thesis/nn/models/__init__.py | morris-frank/unsupervised-source-separation | e23af1761e8fdd587a67b307eaee800b02f5bccf | [
"MIT"
] | 1 | 2020-05-12T18:52:18.000Z | 2020-05-12T18:52:18.000Z | thesis/nn/models/__init__.py | morris-frank/unnamed-source-separation | e23af1761e8fdd587a67b307eaee800b02f5bccf | [
"MIT"
] | null | null | null | from abc import ABC
import torch
from torch import nn
from ...utils import _LossLogger
class BaseModel(ABC, nn.Module):
def __init__(self, name: str = ""):
super(BaseModel, self).__init__()
self.ℒ = _LossLogger()
self.name = name
def test(self, *args) -> torch.Tensor:
pass
... | 19.35 | 53 | 0.614987 |
1d35a0ec0c3e6f6cbc11bdbda03d1ad50bf98ed2 | 6,785 | py | Python | examples/agents/q_net.py | simasan1017/gymlissyusei | 7888e52785698a602687be2f70ad72c5bd4f20a6 | [
"MIT"
] | null | null | null | examples/agents/q_net.py | simasan1017/gymlissyusei | 7888e52785698a602687be2f70ad72c5bd4f20a6 | [
"MIT"
] | null | null | null | examples/agents/q_net.py | simasan1017/gymlissyusei | 7888e52785698a602687be2f70ad72c5bd4f20a6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import numpy as np
from chainer import cuda, FunctionSet, Variable, optimizers
import chainer.functions as F
class QNet:
# Hyper-Parameters
gamma = 0.99 # Discount factor
initial_exploration = 10**3 # Initial exploratoin. original: 5x10^4
replay_size = 32 # Repl... | 39.678363 | 108 | 0.585999 |
63c2f9b2906f6cad171ec7091cd2f800c4410e44 | 3,526 | py | Python | chb/mips/opcodes/MIPSBranch.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/mips/opcodes/MIPSBranch.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/mips/opcodes/MIPSBranch.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
# Copyright (c) 2020-2021 Henny Si... | 38.747253 | 80 | 0.646909 |
1ff14ebe8a6f41b14f4b103eec4f94eea2f583a3 | 275 | py | Python | apps/flasksample/flasksample/utils.py | Nebulaworks/orion | 7819e80b12b555322433373ddb5075173fa60f22 | [
"BSD-3-Clause"
] | 3 | 2021-07-27T20:07:55.000Z | 2021-12-03T18:24:15.000Z | apps/flasksample/flasksample/utils.py | Nebulaworks/orion | 7819e80b12b555322433373ddb5075173fa60f22 | [
"BSD-3-Clause"
] | 3 | 2021-06-25T16:54:20.000Z | 2021-12-07T19:20:43.000Z | apps/flasksample/flasksample/utils.py | Nebulaworks/orion | 7819e80b12b555322433373ddb5075173fa60f22 | [
"BSD-3-Clause"
] | null | null | null | import socket
def gethostname():
return socket.gethostname()
def getlocaladdress():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Doesnt matter what we try to connect to but just that we try
s.connect(("8.8.8.8", 80))
return s.getsockname()[0]
| 25 | 66 | 0.690909 |
b1d6436040038010ec3134a9bf458b7dad742030 | 1,530 | py | Python | test/tests/dunder_descriptors.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | 1 | 2020-02-06T14:28:45.000Z | 2020-02-06T14:28:45.000Z | test/tests/dunder_descriptors.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | null | null | null | test/tests/dunder_descriptors.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | 1 | 2020-02-06T14:29:00.000Z | 2020-02-06T14:29:00.000Z | # - descriptors
# Descriptors get processed when fetched as part of a dunder lookup
def f1():
class D(object):
def __init__(self, n):
self.n = n
def __get__(self, obj, cls):
print "__get__()", obj is None, self.n
def desc(*args):
print "desc()",... | 20.131579 | 68 | 0.498039 |
610af0a4a293668697bd0be32d1842c9de3abdd7 | 783 | py | Python | testing/python.readline/read.py | marshallmidden/m4 | 8ff1cb050efdefe6963c6d7f459fd6f3d25eea94 | [
"BSD-2-Clause"
] | null | null | null | testing/python.readline/read.py | marshallmidden/m4 | 8ff1cb050efdefe6963c6d7f459fd6f3d25eea94 | [
"BSD-2-Clause"
] | null | null | null | testing/python.readline/read.py | marshallmidden/m4 | 8ff1cb050efdefe6963c6d7f459fd6f3d25eea94 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
#-----------------------------------------------------------------------------
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
#-----------------------------------------------------------------------------
import sys
import readline
readline.parse_and_bind('tab: complete')
readline.parse_and_... | 24.46875 | 78 | 0.463602 |
c7453694c3c31955251d8dab9380722e2a7cd7e4 | 6,265 | py | Python | common/middleware/key_manager.py | escudocloud/encswift_server | 90a5a999c06b40da89d5f785795f80bd9d990640 | [
"Apache-2.0"
] | null | null | null | common/middleware/key_manager.py | escudocloud/encswift_server | 90a5a999c06b40da89d5f785795f80bd9d990640 | [
"Apache-2.0"
] | null | null | null | common/middleware/key_manager.py | escudocloud/encswift_server | 90a5a999c06b40da89d5f785795f80bd9d990640 | [
"Apache-2.0"
] | 1 | 2016-09-27T09:08:24.000Z | 2016-09-27T09:08:24.000Z | #!/usr/bin/env python
import os,json
import base64,time
from Crypto import Random
from Crypto.Cipher import AES,PKCS1_OAEP
from Crypto.Signature import PKCS1_PSS
from Crypto.Hash import SHA256
#from Crypto.PublicKey import RSA
from keystoneauth1.identity import v3
from keystoneauth1 import session
from ke... | 34.048913 | 160 | 0.600798 |
6ad7d0cf00cd62149b458ca82b3c20fee2812ac1 | 3,231 | py | Python | chapter12/09 TestFashionShopApp/Storage/FashionShop.py | munnep/begin_to_code_with_python | 3ef14d90785526b6b26d262a7627eee73791d7d0 | [
"MIT"
] | null | null | null | chapter12/09 TestFashionShopApp/Storage/FashionShop.py | munnep/begin_to_code_with_python | 3ef14d90785526b6b26d262a7627eee73791d7d0 | [
"MIT"
] | null | null | null | chapter12/09 TestFashionShopApp/Storage/FashionShop.py | munnep/begin_to_code_with_python | 3ef14d90785526b6b26d262a7627eee73791d7d0 | [
"MIT"
] | null | null | null |
import pickle
from Storage.StockItem import StockItem
class FashionShop:
show_instrumentation = False
min_price = 0.5
max_price = 500.0
max_stock_add = 50
def __init__(self):
if FashionShop.show_instrumentation:
print('** FashionShop __init__ called')
self.__stock... | 31.067308 | 100 | 0.629526 |
480ccb31d09fea68d99d374d3d56ced8de3e19e4 | 1,613 | py | Python | fibonacci_drop/__main__.py | myxie/fibonacci_drop | 19c673c615d4587e5d523f6811c7a005574f2437 | [
"Unlicense"
] | null | null | null | fibonacci_drop/__main__.py | myxie/fibonacci_drop | 19c673c615d4587e5d523f6811c7a005574f2437 | [
"Unlicense"
] | null | null | null | fibonacci_drop/__main__.py | myxie/fibonacci_drop | 19c673c615d4587e5d523f6811c7a005574f2437 | [
"Unlicense"
] | null | null | null | # __main__ is not required for DALiuGE components.
import argparse # pragma: no cover
from . import FibonacciAppDrop # pragma: no cover
def main() -> None: # pragma: no cover
"""
The main function executes on commands:
`python -m fibonacci_drop` and `$ fibonacci_drop `.
This is your program's ent... | 26.016129 | 65 | 0.599504 |
05939d5147db76601e28462bbe2955669f6e81be | 6,023 | py | Python | src/webcam_interface.py | DavidSpielman/Webcam-Midi-Controller | c97f39193b152aa2f5b3d9a1b0cd03d8d79bf2fc | [
"MIT"
] | null | null | null | src/webcam_interface.py | DavidSpielman/Webcam-Midi-Controller | c97f39193b152aa2f5b3d9a1b0cd03d8d79bf2fc | [
"MIT"
] | null | null | null | src/webcam_interface.py | DavidSpielman/Webcam-Midi-Controller | c97f39193b152aa2f5b3d9a1b0cd03d8d79bf2fc | [
"MIT"
] | null | null | null | import cv2 as cv
import rospy
from std_msgs.msg import Int16
global ret, frame, flip_frame, boundingBox, interval
# 0 for built in webcam, 2 for external webcam
cap = cv.VideoCapture(2, cv.CAP_V4L2) # This added VideoCapture API allows camera fps to be changed from initial 5fps
cap.set(cv.CAP_PROP_FRAME_WIDTH, 1280) ... | 45.285714 | 130 | 0.649676 |
3f5ec75b0d439b59b67f3c8dd3eb6f0d7e996e82 | 3,943 | py | Python | twitter_webapp/models.py | dsdoris/twitter_webapp | de43000b0755b49740ba516f8e74f93dfa9c4a50 | [
"MIT"
] | null | null | null | twitter_webapp/models.py | dsdoris/twitter_webapp | de43000b0755b49740ba516f8e74f93dfa9c4a50 | [
"MIT"
] | null | null | null | twitter_webapp/models.py | dsdoris/twitter_webapp | de43000b0755b49740ba516f8e74f93dfa9c4a50 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import pickle
from embedding_as_service_client import EmbeddingClient
from twitter_webapp.services import twitter_api
from sklearn.linear_model import LogisticRegression
db = SQLAlchemy()
migrate = Migrate()
en = EmbeddingClient(host='54.180.12... | 28.992647 | 142 | 0.695663 |
e90f9e96d23648c3e9d39e5b2426d929e0e30f43 | 618 | py | Python | dashboard/migrations/0020_auto_20170124_2107.py | jarifibrahim/ashoka-dashboard | da975b31ba1508ef8b8cf71cbfd2118b572a322d | [
"Apache-2.0"
] | 1 | 2021-11-26T03:41:22.000Z | 2021-11-26T03:41:22.000Z | dashboard/migrations/0020_auto_20170124_2107.py | jarifibrahim/ashoka-dashboard | da975b31ba1508ef8b8cf71cbfd2118b572a322d | [
"Apache-2.0"
] | 3 | 2017-02-04T05:12:47.000Z | 2017-02-21T14:33:06.000Z | dashboard/migrations/0020_auto_20170124_2107.py | jarifibrahim/ashoka-dashboard | da975b31ba1508ef8b8cf71cbfd2118b572a322d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-24 15:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0019_auto_20170124_2105'),
]
operations = [
migrations.RenameField(
... | 23.769231 | 49 | 0.608414 |
58a749b5db3bde6beca3038095412b900fed9bb7 | 1,345 | py | Python | WebHost/models.py | draguscloud/MultiWorld-Utilities | 0157f348cd46fce1bc6ff58a7eaec9f0a482f4be | [
"MIT"
] | null | null | null | WebHost/models.py | draguscloud/MultiWorld-Utilities | 0157f348cd46fce1bc6ff58a7eaec9f0a482f4be | [
"MIT"
] | null | null | null | WebHost/models.py | draguscloud/MultiWorld-Utilities | 0157f348cd46fce1bc6ff58a7eaec9f0a482f4be | [
"MIT"
] | null | null | null | from datetime import datetime
from uuid import UUID, uuid4
from pony.orm import *
db = Database()
class Patch(db.Entity):
id = PrimaryKey(int, auto=True)
player = Required(int)
data = Required(buffer, lazy=True)
seed = Optional('Seed')
class Room(db.Entity):
id = PrimaryKey(UUID, default=uuid4)... | 31.27907 | 99 | 0.685502 |
e098bd21dbd689a4d7b9fbcef62c41ccc4eb7efc | 1,278 | py | Python | app/core/migrations/0034_auto_20200912_1025.py | ig0r45ure/recipe-app-api | 0654102293d6e58c13c4b7520909eb6c0ddb45f2 | [
"MIT"
] | null | null | null | app/core/migrations/0034_auto_20200912_1025.py | ig0r45ure/recipe-app-api | 0654102293d6e58c13c4b7520909eb6c0ddb45f2 | [
"MIT"
] | null | null | null | app/core/migrations/0034_auto_20200912_1025.py | ig0r45ure/recipe-app-api | 0654102293d6e58c13c4b7520909eb6c0ddb45f2 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.10 on 2020-09-12 10:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0033_formgeneration'),
]
operations = [
migrations.RemoveField(
model_name='formgenera... | 34.540541 | 133 | 0.594679 |
3c54dd7e6cec5e04e42c7ba5c9204879e155d012 | 17,474 | py | Python | tensorflow_datasets/core/load.py | harsh020/datasets | b4ad3617b279ec65356e696c4c860458621976f6 | [
"Apache-2.0"
] | 1 | 2020-12-22T17:05:51.000Z | 2020-12-22T17:05:51.000Z | tensorflow_datasets/core/load.py | harsh020/datasets | b4ad3617b279ec65356e696c4c860458621976f6 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/load.py | harsh020/datasets | b4ad3617b279ec65356e696c4c860458621976f6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 36.787368 | 94 | 0.712487 |
13310f74067bdff30b67d3726eb6d8c5fc654414 | 3,284 | py | Python | xero/utils.py | bizgro/pyxero | 904275656959e385bd9fa43e9746ccdad9391aa1 | [
"BSD-3-Clause"
] | null | null | null | xero/utils.py | bizgro/pyxero | 904275656959e385bd9fa43e9746ccdad9391aa1 | [
"BSD-3-Clause"
] | null | null | null | xero/utils.py | bizgro/pyxero | 904275656959e385bd9fa43e9746ccdad9391aa1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import datetime
import re
import six
DATE = re.compile(
r'^(\/Date\((?P<timestamp>-?\d+)((?P<offset_h>[-+]\d\d)(?P<offset_m>\d\d))?\)\/)'
r'|'
r'((?P<year>\d{4})-(?P<month>[0-2]\d)-0?(?P<day>[0-3]\d)'
r'T'
r'(?P<hour>[0-5]\d):(?P<minute>[0-5]\d):(?P<second>... | 28.807018 | 85 | 0.607186 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.