hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7036aa4f3fc1fce05496b25d2d43eb341c65925 | 9,659 | py | Python | imageops/imageops/server.py | EdgeGallery/toolchain | c7b6e99a754e45372155f54ead8a3860f72f78a4 | [
"Apache-2.0"
] | 18 | 2021-03-12T09:18:41.000Z | 2021-03-12T10:15:34.000Z | imageops/imageops/server.py | EdgeGallery/toolchain | c7b6e99a754e45372155f54ead8a3860f72f78a4 | [
"Apache-2.0"
] | null | null | null | imageops/imageops/server.py | EdgeGallery/toolchain | c7b6e99a754e45372155f54ead8a3860f72f78a4 | [
"Apache-2.0"
] | null | null | null | """
# Copyright 2021 Huawei Technologies Co., Ltd.
#
# 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 ... | 41.813853 | 99 | 0.575422 |
import os
from pathlib import Path
from imageops.utils import Utils
from imageops.logger import Logger
class Server(object):
logger = Logger(__name__).get_logger()
def __init__(self, request_id=None):
if not request_id:
msg = 'Lacking request_id.'
self.logger.error(msg)
... | true | true |
f7036ad171f84f32479e698abddcec505adae5dc | 2,307 | py | Python | examples/modal_beamforming_open_circular_array.py | trojanjay/sfa-numpy | bff5737ef429f31228d20a9e1d0ce7d46d3080d3 | [
"MIT"
] | 39 | 2017-09-22T10:30:22.000Z | 2022-03-29T15:56:22.000Z | examples/modal_beamforming_open_circular_array.py | trojanjay/sfa-numpy | bff5737ef429f31228d20a9e1d0ce7d46d3080d3 | [
"MIT"
] | 16 | 2017-11-14T13:02:44.000Z | 2021-04-01T09:53:47.000Z | examples/modal_beamforming_open_circular_array.py | trojanjay/sfa-numpy | bff5737ef429f31228d20a9e1d0ce7d46d3080d3 | [
"MIT"
] | 11 | 2017-12-08T23:54:45.000Z | 2021-01-06T21:06:47.000Z | """
Compute the plane wave decomposition for an incident broadband plane wave
on an open circular array using a modal beamformer of finite order.
"""
import numpy as np
import matplotlib.pyplot as plt
import micarray
from micarray.util import db
Nsf = 50 # order of the incident sound field
N = 30 # order of... | 40.473684 | 93 | 0.748591 |
import numpy as np
import matplotlib.pyplot as plt
import micarray
from micarray.util import db
Nsf = 50
N = 30
pw_angle = 1.23 * np.pi
pol_pwd = np.linspace(0, 2*np.pi, 180, endpoint=False)
k = np.linspace(0, 20, 100)
r = 1
pol, weights = micarray.modal.angular.grid_equal_polar_angle(N)
Bn = micarray... | true | true |
f7036b111cbc0c4e8d9ebaa6a764738d5e9e5c12 | 3,864 | py | Python | eulexistdb/manager.py | emory-libraries/eulexistdb | 7b74f4ec9e7486e493060d4012098613c2b9c85e | [
"Apache-2.0"
] | 9 | 2015-05-09T07:18:21.000Z | 2021-02-26T16:27:08.000Z | eulexistdb/manager.py | emory-libraries/eulexistdb | 7b74f4ec9e7486e493060d4012098613c2b9c85e | [
"Apache-2.0"
] | 14 | 2016-05-20T12:19:09.000Z | 2019-09-05T20:59:36.000Z | eulexistdb/manager.py | emory-libraries/eulexistdb | 7b74f4ec9e7486e493060d4012098613c2b9c85e | [
"Apache-2.0"
] | 3 | 2016-05-23T17:20:08.000Z | 2017-12-20T13:23:06.000Z | # file eulexistdb/manager.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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
#
... | 36.8 | 122 | 0.667443 |
from django.conf import settings
from eulexistdb.db import ExistDB
from eulexistdb.query import QuerySet
class Manager(object):
def __init__(self, xpath):
self.xpath = xpath
self.model = None
def get_query_set(self):
if hasattr(settings, '... | true | true |
f7036c5fbe4bafb0e1af4388a84aaf25e75f6c0c | 623 | py | Python | 14-flashcardsContador/1-versaoTerminal/0-versoesAntigas/flashcardsContador2/Soma.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | 14-flashcardsContador/1-versaoTerminal/0-versoesAntigas/flashcardsContador2/Soma.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | 14-flashcardsContador/1-versaoTerminal/0-versoesAntigas/flashcardsContador2/Soma.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | class Soma:
def __init__(self):
self.numeroDeCartas = list()
def set_numeroDeCartas(self, numero):
if numero == '':
numero = '1'
numero = numero[:]
self.numeroDeCartas.extend(numero)
def get_numeroDeCartas(self):
... | 23.074074 | 65 | 0.539326 | class Soma:
def __init__(self):
self.numeroDeCartas = list()
def set_numeroDeCartas(self, numero):
if numero == '':
numero = '1'
numero = numero[:]
self.numeroDeCartas.extend(numero)
def get_numeroDeCartas(self):
... | true | true |
f7036c87ca207cfcc12ce67719024edf8b098396 | 4,026 | py | Python | ralamb.py | uclyyu/over9000 | 42db9fa6ac5a9a2e177f1f9a9a660bee9cd5d587 | [
"Apache-2.0"
] | 411 | 2019-08-25T12:24:34.000Z | 2022-03-25T03:31:38.000Z | optimizers/ralamb.py | AryanRaj315/EAD2020 | 9e2e0aa4be9da941372a21ea627c38a3eb7be617 | [
"MIT"
] | 23 | 2019-08-26T13:14:45.000Z | 2021-07-04T19:00:15.000Z | optimizers/ralamb.py | AryanRaj315/EAD2020 | 9e2e0aa4be9da941372a21ea627c38a3eb7be617 | [
"MIT"
] | 60 | 2019-08-25T12:31:46.000Z | 2022-02-10T09:39:20.000Z | import torch, math
from torch.optim.optimizer import Optimizer
# RAdam + LARS
class Ralamb(Optimizer):
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0):
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay)
self.buffer = [[None, None, None] for in... | 40.26 | 181 | 0.504223 | import torch, math
from torch.optim.optimizer import Optimizer
class Ralamb(Optimizer):
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0):
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay)
self.buffer = [[None, None, None] for ind in range(10)... | true | true |
f7036cde771e158378a1bdef64092434538782a5 | 18,321 | py | Python | mlir/test/Bindings/Python/ir_operation.py | MochalovaAn/llvm | 528aa5ca4aa9df447dc3497ef19da3b124e88d7d | [
"Apache-2.0"
] | null | null | null | mlir/test/Bindings/Python/ir_operation.py | MochalovaAn/llvm | 528aa5ca4aa9df447dc3497ef19da3b124e88d7d | [
"Apache-2.0"
] | null | null | null | mlir/test/Bindings/Python/ir_operation.py | MochalovaAn/llvm | 528aa5ca4aa9df447dc3497ef19da3b124e88d7d | [
"Apache-2.0"
] | null | null | null | # RUN: %PYTHON %s | FileCheck %s
import gc
import io
import itertools
from mlir.ir import *
def run(f):
print("\nTEST:", f.__name__)
f()
gc.collect()
assert Context._get_live_count() == 0
# Verify iterator based traversal of the op/region/block hierarchy.
# CHECK-LABEL: TEST: testTraverseOpRegionBlockIterat... | 29.693679 | 129 | 0.645871 |
import gc
import io
import itertools
from mlir.ir import *
def run(f):
print("\nTEST:", f.__name__)
f()
gc.collect()
assert Context._get_live_count() == 0
def testTraverseOpRegionBlockIterators():
ctx = Context()
ctx.allow_unregistered_dialects = True
module = Module.parse(r"""
func @f1(%arg0: ... | true | true |
f7036da9f3477fb29d1f73794bda2fccb598b879 | 8,016 | py | Python | docs/conf.py | tdi/pyPEPA | db15073487331b66e8ab60a1d05cb158070e0d54 | [
"Apache-2.0"
] | 4 | 2015-05-12T09:30:45.000Z | 2021-11-30T23:09:51.000Z | docs/conf.py | tdi/pyPEPA | db15073487331b66e8ab60a1d05cb158070e0d54 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | tdi/pyPEPA | db15073487331b66e8ab60a1d05cb158070e0d54 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pypepa documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 18 15:33:13 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 32.064 | 80 | 0.715694 |
import sys, os
extensions = ['sphinx.ext.mathjax', 'sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'pypepa'
copyright = '2013, Dariusz Dwornikowski'
# |version| and |release|, also used in various other places throughout... | true | true |
f7036df95921f8dea17f6d6274c42b3d1551879a | 153 | py | Python | StatsClass/urls.py | nelliesnoodles/my-first-blog | e552ea38891ebe005316487ae32a324659ad6367 | [
"MIT"
] | null | null | null | StatsClass/urls.py | nelliesnoodles/my-first-blog | e552ea38891ebe005316487ae32a324659ad6367 | [
"MIT"
] | 5 | 2019-12-13T17:37:55.000Z | 2021-06-10T20:59:32.000Z | StatsClass/urls.py | nelliesnoodles/My-Website | e552ea38891ebe005316487ae32a324659ad6367 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('StatsClass', views.index),
path('BasicProbability', views.basic_prob),
]
| 19.125 | 47 | 0.712418 | from django.urls import path
from . import views
urlpatterns = [
path('StatsClass', views.index),
path('BasicProbability', views.basic_prob),
]
| true | true |
f7036e9ffbe44cdcb5926a139df525aedf532378 | 262 | py | Python | common/signature/__init__.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | 2 | 2015-04-04T01:44:11.000Z | 2017-11-04T11:59:27.000Z | common/signature/__init__.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | null | null | null | common/signature/__init__.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | null | null | null | class DigitalSignatureScheme(object):
def get_public_key(self):
return self.public_key
def sign(self, messsage):
raise NotImplementedError
def verify(self, message, signature):
raise NotImplementedError
| 23.818182 | 41 | 0.648855 | class DigitalSignatureScheme(object):
def get_public_key(self):
return self.public_key
def sign(self, messsage):
raise NotImplementedError
def verify(self, message, signature):
raise NotImplementedError
| true | true |
f7036eb900de1e0cf354ec91df0aa273644cb847 | 10,409 | py | Python | t2c/segmentation.py | micbia/tools21cm | 72081e94e4d83511380baacce427d79d13da2fa5 | [
"MIT"
] | 1 | 2020-10-08T12:34:05.000Z | 2020-10-08T12:34:05.000Z | t2c/segmentation.py | micbia/tools21cm | 72081e94e4d83511380baacce427d79d13da2fa5 | [
"MIT"
] | null | null | null | t2c/segmentation.py | micbia/tools21cm | 72081e94e4d83511380baacce427d79d13da2fa5 | [
"MIT"
] | null | null | null | """
Created by Michele Bianco, 9 July 2021
"""
import numpy as np, pkg_resources
from tqdm import tqdm
import tensorflow as tf
from tensorflow.keras.models import load_model
from tensorflow.keras import backend as K
from tensorflow.python.ops import nn_ops
from tensorflow.python.framework import ops
from tensorflow.... | 40.819608 | 159 | 0.58142 |
import numpy as np, pkg_resources
from tqdm import tqdm
import tensorflow as tf
from tensorflow.keras.models import load_model
from tensorflow.keras import backend as K
from tensorflow.python.ops import nn_ops
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.py... | true | true |
f7036f30e8f6a74391031fa260de951dacb90cb4 | 4,427 | py | Python | sunshine_conversations_client/model/user_truncated.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 4 | 2020-09-27T14:28:25.000Z | 2022-02-02T13:51:29.000Z | sunshine_conversations_client/model/user_truncated.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 3 | 2021-09-30T18:18:58.000Z | 2021-12-04T07:55:23.000Z | sunshine_conversations_client/model/user_truncated.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 5 | 2020-11-07T02:08:18.000Z | 2021-12-07T17:10:23.000Z | # coding: utf-8
"""
Sunshine Conversations API
The version of the OpenAPI document: 9.4.5
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefine... | 27.66875 | 102 | 0.574656 |
import pprint
import re
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefined import Undefined
class UserTruncated(object):
openapi_types = {
'id': 'str',
'external_id': 'str'
}
attribute_map = {
'id... | true | true |
f7036f5c4bd73b8f7b2a333ac6993a89266119a0 | 1,581 | py | Python | preprocessing/main.py | jrobertojunior/face-parsing.PyTorch | d34f39c9ae9726ac8eaf39ecff824a14ec4e15b9 | [
"MIT"
] | null | null | null | preprocessing/main.py | jrobertojunior/face-parsing.PyTorch | d34f39c9ae9726ac8eaf39ecff824a14ec4e15b9 | [
"MIT"
] | null | null | null | preprocessing/main.py | jrobertojunior/face-parsing.PyTorch | d34f39c9ae9726ac8eaf39ecff824a14ec4e15b9 | [
"MIT"
] | null | null | null | import cv2 as cv
import numpy as np
import os
def preprocess(labels_path, sep_labels_path):
# list all files on labels_path
labels_filenames = os.listdir(labels_path)
count = 0
for label_filename in labels_filenames:
label_path = os.path.join(labels_path, label_filename)
print(f'segme... | 25.918033 | 80 | 0.563567 | import cv2 as cv
import numpy as np
import os
def preprocess(labels_path, sep_labels_path):
labels_filenames = os.listdir(labels_path)
count = 0
for label_filename in labels_filenames:
label_path = os.path.join(labels_path, label_filename)
print(f'segmenting {label_filename}')
... | true | true |
f7036f7636cc20ea4dc6d9b8460cfa888a315805 | 39,822 | py | Python | netqasm/sdk/epr_socket.py | QuTech-Delft/netqasm | 954162542c441d5663ecb9a8801eab94efd4ef2e | [
"MIT"
] | 6 | 2021-11-10T15:03:59.000Z | 2022-02-16T19:35:01.000Z | netqasm/sdk/epr_socket.py | QuTech-Delft/netqasm | 954162542c441d5663ecb9a8801eab94efd4ef2e | [
"MIT"
] | 13 | 2021-11-26T09:19:46.000Z | 2022-03-29T09:21:42.000Z | netqasm/sdk/epr_socket.py | QuTech-Delft/netqasm | 954162542c441d5663ecb9a8801eab94efd4ef2e | [
"MIT"
] | 4 | 2021-11-19T15:46:17.000Z | 2022-01-23T18:59:15.000Z | """EPR Socket interface."""
from __future__ import annotations
import abc
import logging
from contextlib import contextmanager
from typing import TYPE_CHECKING, Callable, ContextManager, List, Optional, Tuple, Union
from netqasm.logging.glob import get_netqasm_logger
from netqasm.qlink_compat import (
EPRRole,
... | 43.856828 | 92 | 0.641454 |
from __future__ import annotations
import abc
import logging
from contextlib import contextmanager
from typing import TYPE_CHECKING, Callable, ContextManager, List, Optional, Tuple, Union
from netqasm.logging.glob import get_netqasm_logger
from netqasm.qlink_compat import (
EPRRole,
EPRType,
LinkLayerOKT... | true | true |
f7036fe313c66a97f4197a25427a74fb4d122a60 | 14,595 | py | Python | google_cal_app/views.py | google-business-communications/bm-gCal-bot | fe67391f956ccfcfe80ad786c40847a154ca6a6e | [
"Apache-2.0"
] | 2 | 2021-02-26T16:32:53.000Z | 2021-03-04T16:12:10.000Z | google_cal_app/views.py | google-business-communications/bm-gCal-bot | fe67391f956ccfcfe80ad786c40847a154ca6a6e | [
"Apache-2.0"
] | null | null | null | google_cal_app/views.py | google-business-communications/bm-gCal-bot | fe67391f956ccfcfe80ad786c40847a154ca6a6e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.578125 | 138 | 0.722576 |
import base64
import datetime
import hashlib
import json
import os
import uuid
from businessmessages import businessmessages_v1_client as bm_client
from businessmessages.businessmessages_v1_messages import (
BusinessmessagesConversationsMessagesCreateRequest,
BusinessMessagesMessage, BusinessMes... | true | true |
f70370a8e859605dfe04aa5778ef4129010bb78a | 7,577 | py | Python | distrax/_src/bijectors/tfp_compatible_bijector.py | kuperov/distrax | dd3363a64017c5eafb3241bb2a3884de50f21427 | [
"Apache-2.0"
] | 278 | 2021-04-13T09:06:23.000Z | 2022-03-29T11:01:20.000Z | distrax/_src/bijectors/tfp_compatible_bijector.py | kuperov/distrax | dd3363a64017c5eafb3241bb2a3884de50f21427 | [
"Apache-2.0"
] | 26 | 2021-04-13T18:19:37.000Z | 2022-03-25T15:00:15.000Z | distrax/_src/bijectors/tfp_compatible_bijector.py | kuperov/distrax | dd3363a64017c5eafb3241bb2a3884de50f21427 | [
"Apache-2.0"
] | 14 | 2021-04-13T17:05:33.000Z | 2022-03-13T13:01:04.000Z | # Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 42.329609 | 80 | 0.707668 |
from typing import Any, Optional
import chex
from distrax._src.bijectors import bijector
from distrax._src.utils import math
import jax
import jax.numpy as jnp
from tensorflow_probability.substrates import jax as tfp
tfb = tfp.bijectors
tfd = tfp.distributions
Array = chex.Array
Bijector = bijector.Bi... | true | true |
f70370b31a5fa70191a3015de5da4b12b92ec6dd | 3,338 | py | Python | example/loc3/rewards.py | Principe92/contextualbandits | 43cf5be10b3d39d74f9da5c5fe1cfae5bc2dd6f5 | [
"BSD-2-Clause"
] | null | null | null | example/loc3/rewards.py | Principe92/contextualbandits | 43cf5be10b3d39d74f9da5c5fe1cfae5bc2dd6f5 | [
"BSD-2-Clause"
] | null | null | null | example/loc3/rewards.py | Principe92/contextualbandits | 43cf5be10b3d39d74f9da5c5fe1cfae5bc2dd6f5 | [
"BSD-2-Clause"
] | null | null | null | import pandas
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
from pylab import rcParams
df = pandas.read_csv('rewards_loc3.csv')
ucb,ts,ovr,egr,egr2,agr,agr2,efr,ac,aac,sft = df['ucb'],df['ts'],df['ovr'],\
df['egr'],df['egr2'],df['agr'],df['agr2'],df['efr'],df['ac'],df['aac'],df['sft']
... | 46.361111 | 122 | 0.687837 | import pandas
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
from pylab import rcParams
df = pandas.read_csv('rewards_loc3.csv')
ucb,ts,ovr,egr,egr2,agr,agr2,efr,ac,aac,sft = df['ucb'],df['ts'],df['ovr'],\
df['egr'],df['egr2'],df['agr'],df['agr2'],df['efr'],df['ac'],df['aac'],df['sft']
... | true | true |
f7037101f3dd9b27d3e290a174bc7d2a9542b452 | 27 | py | Python | venv/lib/python3.8/site-packages/crispy_forms/templates/bootstrap/layout/button.html.py | Solurix/Flashcards-Django | 03c863f6722936093927785a2b20b6b668bb743d | [
"MIT"
] | 1 | 2021-05-16T03:20:23.000Z | 2021-05-16T03:20:23.000Z | venv/lib/python3.8/site-packages/crispy_forms/templates/bootstrap4/layout/button.html.py | Solurix/Flashcards-Django | 03c863f6722936093927785a2b20b6b668bb743d | [
"MIT"
] | 4 | 2021-03-30T14:06:09.000Z | 2021-09-22T19:26:31.000Z | venv/lib/python3.8/site-packages/crispy_forms/templates/bootstrap4/layout/button.html.py | Solurix/Flashcards-Django | 03c863f6722936093927785a2b20b6b668bb743d | [
"MIT"
] | null | null | null | XXXXXXX FFFFXFFFFXXXXXXXXX
| 13.5 | 26 | 0.925926 | XXXXXXX FFFFXFFFFXXXXXXXXX
| false | true |
f70371f921691212a121904c194ef6c94e3d6329 | 21,898 | py | Python | test/db/test_db_sqlite.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 150 | 2016-10-05T11:09:36.000Z | 2022-03-06T16:24:41.000Z | test/db/test_db_sqlite.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 27 | 2017-03-02T03:37:02.000Z | 2022-02-10T04:59:54.000Z | test/db/test_db_sqlite.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 21 | 2016-11-11T07:51:48.000Z | 2020-04-26T21:38:33.000Z | from datetime import datetime
from dino.config import UserKeys, RedisKeys, SessionKeys
from dino.db.rdbms.models import Channels
from dino.db.rdbms.models import Rooms
from test.base import BaseTest
from test.db import BaseDatabaseTest
class DatabaseSqliteTest(BaseDatabaseTest):
def setUp(self):
self.set... | 34.269171 | 119 | 0.776692 | from datetime import datetime
from dino.config import UserKeys, RedisKeys, SessionKeys
from dino.db.rdbms.models import Channels
from dino.db.rdbms.models import Rooms
from test.base import BaseTest
from test.db import BaseDatabaseTest
class DatabaseSqliteTest(BaseDatabaseTest):
def setUp(self):
self.set... | true | true |
f7037282b9d4bec22d75254382e9b4bf3d7a655e | 5,332 | py | Python | Add/add_heuristic_engine.py | Jesmine0902/TSP_CPLEX_2 | 8853d6837bd5408b8925eb5f45e21c79945a5904 | [
"MIT"
] | 1 | 2020-08-14T03:25:09.000Z | 2020-08-14T03:25:09.000Z | Add/add_heuristic_engine.py | Jesmine0902/TSP_CPLEX_2 | 8853d6837bd5408b8925eb5f45e21c79945a5904 | [
"MIT"
] | null | null | null | Add/add_heuristic_engine.py | Jesmine0902/TSP_CPLEX_2 | 8853d6837bd5408b8925eb5f45e21c79945a5904 | [
"MIT"
] | 1 | 2020-08-14T03:24:29.000Z | 2020-08-14T03:24:29.000Z | import pandas as pd
__author__ = 'slei'
class AddHeuristicTSP:
""" Finds the shortest path using a heuristic method """
def __init__(self, cities_df):
self.df = cities_df
self.edges = list((t.origin, t.destination) for t in df.itertuples())
self.distance = dict([((t.origin, t.destina... | 37.027778 | 117 | 0.589835 | import pandas as pd
__author__ = 'slei'
class AddHeuristicTSP:
def __init__(self, cities_df):
self.df = cities_df
self.edges = list((t.origin, t.destination) for t in df.itertuples())
self.distance = dict([((t.origin, t.destination), t.distance) for t in df.itertuples()])
self.ci... | true | true |
f70372ff51a0c2ba1144263ef3314dfe0f59ebb1 | 28,309 | py | Python | ots_eval/stability_evaluation/close.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | 3 | 2021-03-28T14:46:57.000Z | 2022-01-03T17:25:19.000Z | ots_eval/stability_evaluation/close.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | null | null | null | ots_eval/stability_evaluation/close.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T10:56:14.000Z | 2022-01-11T10:56:14.000Z | import numpy as np
from scipy.spatial.distance import euclidean
from typing import Union
import pandas
class CLOSE(object):
def __init__(self, data: pandas.DataFrame, measure: Union[str, callable] = 'mse', minPts: int = None, output: bool = False,
jaccard: bool = False, weighting: bool = False, ... | 44.511006 | 145 | 0.575753 | import numpy as np
from scipy.spatial.distance import euclidean
from typing import Union
import pandas
class CLOSE(object):
def __init__(self, data: pandas.DataFrame, measure: Union[str, callable] = 'mse', minPts: int = None, output: bool = False,
jaccard: bool = False, weighting: bool = False, ... | true | true |
f70373e85dd7d594ac8c8db40a01f648beb6171b | 7,943 | py | Python | Modules/Roles.py | Skk-nsmt/reina | 1b658bfcf4ff35a641c7fe9398652aa36b254d3a | [
"WTFPL"
] | null | null | null | Modules/Roles.py | Skk-nsmt/reina | 1b658bfcf4ff35a641c7fe9398652aa36b254d3a | [
"WTFPL"
] | 13 | 2020-12-22T04:35:03.000Z | 2021-07-07T07:05:53.000Z | Modules/Roles.py | Skk-nsmt/reina | 1b658bfcf4ff35a641c7fe9398652aa36b254d3a | [
"WTFPL"
] | 1 | 2022-02-28T21:40:51.000Z | 2022-02-28T21:40:51.000Z | import discord
from discord.ext import commands
from Modules import CONSTANT
from Modules.Checks import check_if_role_or_bot_spam
class Roles(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command()
@check_if_role_or_bot_spam()
async def role(self, ctx: comman... | 43.883978 | 117 | 0.545134 | import discord
from discord.ext import commands
from Modules import CONSTANT
from Modules.Checks import check_if_role_or_bot_spam
class Roles(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command()
@check_if_role_or_bot_spam()
async def role(self, ctx: comman... | true | true |
f7037425cd747334c2b88b75c4d4315203805b2e | 1,119 | py | Python | ptk_gestaorecurso_teste/recursos/forms.py | rodrigombsantana/ptk-gestaorecursos-teste | 4f6f1fbac8b5501cf54520bf7434e92e19d6dfc6 | [
"MIT"
] | null | null | null | ptk_gestaorecurso_teste/recursos/forms.py | rodrigombsantana/ptk-gestaorecursos-teste | 4f6f1fbac8b5501cf54520bf7434e92e19d6dfc6 | [
"MIT"
] | null | null | null | ptk_gestaorecurso_teste/recursos/forms.py | rodrigombsantana/ptk-gestaorecursos-teste | 4f6f1fbac8b5501cf54520bf7434e92e19d6dfc6 | [
"MIT"
] | null | null | null | from django.db import models
from django.forms import ModelForm
from django.forms import TextInput
from .models import agendamento
#import datetime
#class frm_agendamento(forms.ModelForm):
#
# data_agendamento = forms.DateField(label="Data",initial=datetime.date.today)
# horario_inicio = forms.TimeField(label="In... | 43.038462 | 119 | 0.679178 | from django.db import models
from django.forms import ModelForm
from django.forms import TextInput
from .models import agendamento
class frm_agendamento(ModelForm):
class Meta:
model = agendamento
exclude = ('criado_em','google_link')
widgets = {
'data_agendamento':... | true | true |
f703746e0316f7cff40f0b2d9a7c219de426744e | 26,744 | py | Python | tools/validators/ontology_validator/yamlformat/validator/entity_type_lib.py | a-o-u/digitalbuildings | 407075cbfbd3d81e6c2ce0c25cc160e3238d9225 | [
"Apache-2.0"
] | null | null | null | tools/validators/ontology_validator/yamlformat/validator/entity_type_lib.py | a-o-u/digitalbuildings | 407075cbfbd3d81e6c2ce0c25cc160e3238d9225 | [
"Apache-2.0"
] | null | null | null | tools/validators/ontology_validator/yamlformat/validator/entity_type_lib.py | a-o-u/digitalbuildings | 407075cbfbd3d81e6c2ce0c25cc160e3238d9225 | [
"Apache-2.0"
] | null | null | null | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 36.091768 | 80 | 0.695408 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import typing
from typing import Optional, Tuple
from yamlformat.validator import base_lib
from yamlformat.validator import config_folder_lib
from yamlformat.validator import field_lib
... | true | true |
f70374938ed4795d168e995524aeabe6d04b8859 | 33 | py | Python | cfail/check.py | Seanny123/coala-fail | c45e9986e2a46de93f73ad7d1edbc86a609bbe28 | [
"MIT"
] | null | null | null | cfail/check.py | Seanny123/coala-fail | c45e9986e2a46de93f73ad7d1edbc86a609bbe28 | [
"MIT"
] | null | null | null | cfail/check.py | Seanny123/coala-fail | c45e9986e2a46de93f73ad7d1edbc86a609bbe28 | [
"MIT"
] | null | null | null | # a = 2
print("check this file")
| 11 | 24 | 0.606061 |
print("check this file")
| true | true |
f70375438cbfcec1b0797a36cf6bd37f200b244f | 540 | py | Python | realtimeplt/outputs/__init__.py | Aryan05/realtimeplt | e04c09550fece33df03aaf6f340d0405d77d6443 | [
"MIT"
] | 3 | 2020-09-28T10:08:56.000Z | 2020-10-10T00:30:05.000Z | realtimeplt/outputs/__init__.py | Aryan05/realtimeplt | e04c09550fece33df03aaf6f340d0405d77d6443 | [
"MIT"
] | 1 | 2020-09-30T16:15:31.000Z | 2020-09-30T16:15:42.000Z | realtimeplt/outputs/__init__.py | Aryan05/realtimeplt | e04c09550fece33df03aaf6f340d0405d77d6443 | [
"MIT"
] | 1 | 2020-10-10T00:36:19.000Z | 2020-10-10T00:36:19.000Z | # technical
from .base_output import BaseOutput
# default
from .matplotlib_plot import MatplotlibPlot
from .extrema_printer import ExtremaPrinter
# with external dependencies
# import are respective __init__ methods
# hack-ish, but works (and I am not aware of a more proper way to do so)
from .bokeh_plot import Bo... | 24.545455 | 72 | 0.82963 |
from .base_output import BaseOutput
from .matplotlib_plot import MatplotlibPlot
from .extrema_printer import ExtremaPrinter
from .bokeh_plot import BokehPlot
from .neptune_logger import NeptuneLogger
from .tensorboard_logger import TensorboardLogger
from .tensorboard_tf_logger import TensorboardTFLogger
fr... | true | true |
f7037640bf3a851ac42c1c322ba7e2f5f9dc9b00 | 4,367 | py | Python | test/functional/wallet-hd.py | danigarcia3k/Sikacoin | 82ef600cfeed1d8f163df6071d8d080fb9dac6b0 | [
"MIT"
] | null | null | null | test/functional/wallet-hd.py | danigarcia3k/Sikacoin | 82ef600cfeed1d8f163df6071d8d080fb9dac6b0 | [
"MIT"
] | null | null | null | test/functional/wallet-hd.py | danigarcia3k/Sikacoin | 82ef600cfeed1d8f163df6071d8d080fb9dac6b0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Sikacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Hierarchical Deterministic wallet function."""
from test_framework.test_framework import SikacoinTest... | 41.198113 | 105 | 0.642317 |
from test_framework.test_framework import SikacoinTestFramework
from test_framework.util import (
assert_equal,
connect_nodes_bi,
)
import shutil
class WalletHDTest(SikacoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_ar... | true | true |
f70377c8ead6d814b75810083ddb336ecbc41f22 | 8,307 | py | Python | commons/siam_mask/experiments/siammask_sharp/resnet.py | dajes/labelfficient | 5dd0566224fb04285e690bf8576eacc04a7c87cd | [
"MIT"
] | 4 | 2021-02-09T08:18:18.000Z | 2022-02-26T03:18:26.000Z | commons/siam_mask/experiments/siammask_sharp/resnet.py | dajes/labelfficient | 5dd0566224fb04285e690bf8576eacc04a7c87cd | [
"MIT"
] | 1 | 2022-02-26T03:15:34.000Z | 2022-02-26T03:20:27.000Z | commons/siam_mask/experiments/siammask_sharp/resnet.py | dajes/labelfficient | 5dd0566224fb04285e690bf8576eacc04a7c87cd | [
"MIT"
] | 2 | 2021-06-06T16:39:57.000Z | 2021-06-06T16:48:32.000Z | import torch.nn as nn
import torch
from torch.autograd import Variable
import math
import torch.utils.model_zoo as model_zoo
from commons.siam_mask.models.features import Features
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://dow... | 31.706107 | 100 | 0.589142 | import torch.nn as nn
import torch
from torch.autograd import Variable
import math
import torch.utils.model_zoo as model_zoo
from commons.siam_mask.models.features import Features
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://dow... | true | true |
f70378b1e6899af4a8706e20c4f8edf6329a186a | 2,796 | py | Python | tflib/distribute/distribute.py | AlexBlack2202/EigenGAN-Tensorflow | 9668738852abdcd7161b64b7e6a074c7ebfea055 | [
"MIT"
] | 302 | 2021-04-27T02:15:47.000Z | 2022-03-13T07:51:07.000Z | tflib/distribute/distribute.py | gokulsg/EigenGAN-Tensorflow | 86b21a47a824a2bb04a088c3e78b03d03a53735c | [
"MIT"
] | 7 | 2021-05-26T05:44:46.000Z | 2021-12-28T02:38:47.000Z | tflib/distribute/distribute.py | gokulsg/EigenGAN-Tensorflow | 86b21a47a824a2bb04a088c3e78b03d03a53735c | [
"MIT"
] | 34 | 2021-04-27T02:16:04.000Z | 2022-01-28T12:18:17.000Z | import tensorflow as tf
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
gpus = get_available_gpus
def split_nest(nest, num_or_size_splits, axis=0):
"""... | 33.285714 | 88 | 0.655222 | import tensorflow as tf
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
gpus = get_available_gpus
def split_nest(nest, num_or_size_splits, axis=0):
fla... | true | true |
f7037a2ff7ed82e1cd626b834ee5784390b3252e | 4,466 | py | Python | test.py | pyEtherCAT/Test-Source | 32e7f36873cf311580acc25ab76db589e209e479 | [
"MIT"
] | 9 | 2018-09-16T01:00:08.000Z | 2021-04-21T03:08:38.000Z | test.py | pyEtherCAT/Test-Source | 32e7f36873cf311580acc25ab76db589e209e479 | [
"MIT"
] | null | null | null | test.py | pyEtherCAT/Test-Source | 32e7f36873cf311580acc25ab76db589e209e479 | [
"MIT"
] | 5 | 2018-05-24T08:41:45.000Z | 2020-09-26T12:04:16.000Z | # import gevent.monkey
# gevent.monkey.patch_socket()
from pyEtherCAT import MasterEtherCAT
import time
import os
#============================================================================#
# C95用の簡易EtherCATパッケージです。
# 本来は細かいパケットに付いて理解を深めた上で仕組みを構築していきますが、
# 説明も実験も追いつかず、ひとまずGPIOで高速にON/OFF出来る部分だけを纏めました。
# 動作は Linux(R... | 34.620155 | 85 | 0.537841 |
from pyEtherCAT import MasterEtherCAT
import time
import os
def EtherCAT_Init(nic):
cat = MasterEtherCAT.MasterEtherCAT(nic)
return cat
def EtherCAT_SetUp(cat):
cat.EEPROM_SetUp(cat.ADP)
cat.EEPROM_Stasus(enable=0x00, command=0x04)
ADDR = 0x0120
data = 0x0002
cat.APWR(ID... | true | true |
f7037afae16524014eb92d458ac6b7aedaa8b9b9 | 1,107 | py | Python | porcupine/__init__.py | Akuli/editor | cf98c538e75a07d825f9066e25a3752fdf7c3c29 | [
"MIT"
] | 1 | 2021-07-28T10:09:26.000Z | 2021-07-28T10:09:26.000Z | porcupine/__init__.py | Akuli/editor | cf98c538e75a07d825f9066e25a3752fdf7c3c29 | [
"MIT"
] | null | null | null | porcupine/__init__.py | Akuli/editor | cf98c538e75a07d825f9066e25a3752fdf7c3c29 | [
"MIT"
] | null | null | null | """Porcupine is a simple editor.
You are probably reading this because you want to learn how Porcupine
works or write fun plugins for it. I recommend getting started with the
plugin API documentation:
https://akuli.github.io/porcupine/
"""
import sys
import appdirs
version_info = (0, 99, 2) # this is updated ... | 29.918919 | 83 | 0.775068 |
import sys
import appdirs
version_info = (0, 99, 2)
__version__ = "%d.%d.%d" % version_info
__author__ = "Akuli"
__copyright__ = "Copyright (c) 2017-2022 Akuli"
__license__ = "MIT"
if sys.platform in {"win32", "darwin"}:
dirs = appdirs.AppDirs("Porcupine", "Akuli")
else:
dirs = appdirs.AppDirs("porcu... | true | true |
f7037b3a3daadb1935f85a9a60ff3076e2dc7967 | 446 | py | Python | loglizer/models/__init__.py | paulinko/loglizer | d3910370fa6752ef77232bef79ddb504ef245a9d | [
"MIT"
] | null | null | null | loglizer/models/__init__.py | paulinko/loglizer | d3910370fa6752ef77232bef79ddb504ef245a9d | [
"MIT"
] | null | null | null | loglizer/models/__init__.py | paulinko/loglizer | d3910370fa6752ef77232bef79ddb504ef245a9d | [
"MIT"
] | null | null | null | from .PCA import PCA
from .InvariantsMiner import InvariantsMiner
from .LogClustering import LogClustering
from .LR import LR
from .SVM import SVM
from .DecisionTree import DecisionTree
from .IsolationForest import IsolationForest
from .DeepLog import DeepLog
from .Autoencoder import Autoencoder
from .AutoencoderLSTM i... | 37.166667 | 53 | 0.867713 | from .PCA import PCA
from .InvariantsMiner import InvariantsMiner
from .LogClustering import LogClustering
from .LR import LR
from .SVM import SVM
from .DecisionTree import DecisionTree
from .IsolationForest import IsolationForest
from .DeepLog import DeepLog
from .Autoencoder import Autoencoder
from .AutoencoderLSTM i... | true | true |
f7037c6d6ec327ebf3ef4a26aa0079107e008b3c | 1,165 | py | Python | semantic_aware_models/models/classification/abstract_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | null | null | null | semantic_aware_models/models/classification/abstract_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | null | null | null | semantic_aware_models/models/classification/abstract_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | 1 | 2020-03-19T12:41:54.000Z | 2020-03-19T12:41:54.000Z | import abc
class AbstractClassifier:
""" Abstract class with specific methods for classifier models (training, validation and test) """
def __init__(self):
pass
@abc.abstractmethod
def train(self, config, train_data):
"""
Classifier training.
:param config: Model con... | 27.738095 | 102 | 0.64206 | import abc
class AbstractClassifier:
def __init__(self):
pass
@abc.abstractmethod
def train(self, config, train_data):
pass
@abc.abstractmethod
def validation(self, config, val_data):
pass
@abc.abstractmethod
def test(self, config, test_data):
pass
| true | true |
f7037dd7dfb7d354c6a820cd68cc1823c6415a56 | 268 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_7/fix_purchase_receipt_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_7/fix_purchase_receipt_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_7/fix_purchase_receipt_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
def execute():
# there is no more status called "Submitted", there was an old issue that used
# to set it as Submitted, fixed in this commit
frappe.db.sql("""
update
`tabPurchase Receipt`
set
status = 'To Bill'
where
status = 'Submitted'""") | 22.333333 | 79 | 0.697761 | import frappe
def execute():
frappe.db.sql("""
update
`tabPurchase Receipt`
set
status = 'To Bill'
where
status = 'Submitted'""") | true | true |
f7037e109c2718e9c405382ccb501215255265e8 | 142 | py | Python | python/testData/inspections/PyCompatibilityInspection/reprExpression.py | teddywest32/intellij-community | e0268d7a1da1d318b441001448cdd3e8929b2f29 | [
"Apache-2.0"
] | null | null | null | python/testData/inspections/PyCompatibilityInspection/reprExpression.py | teddywest32/intellij-community | e0268d7a1da1d318b441001448cdd3e8929b2f29 | [
"Apache-2.0"
] | null | null | null | python/testData/inspections/PyCompatibilityInspection/reprExpression.py | teddywest32/intellij-community | e0268d7a1da1d318b441001448cdd3e8929b2f29 | [
"Apache-2.0"
] | 1 | 2020-11-27T10:36:50.000Z | 2020-11-27T10:36:50.000Z | a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support backquotes, use repr() instead">`imp.acquire_lock()`</warning>
| 71 | 141 | 0.676056 | a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support backquotes, use repr() instead">`imp.acquire_lock()`</warning>
| false | true |
f7037e199865a1b95556700d0a7781ddb980ced3 | 67,271 | py | Python | tests/store/model_registry/test_sqlalchemy_store.py | abhiramr/mlflow | 2bbdc20f2d90d551fb7d40f982f2f799da9feca8 | [
"Apache-2.0"
] | null | null | null | tests/store/model_registry/test_sqlalchemy_store.py | abhiramr/mlflow | 2bbdc20f2d90d551fb7d40f982f2f799da9feca8 | [
"Apache-2.0"
] | null | null | null | tests/store/model_registry/test_sqlalchemy_store.py | abhiramr/mlflow | 2bbdc20f2d90d551fb7d40f982f2f799da9feca8 | [
"Apache-2.0"
] | null | null | null | import os
import unittest
import tempfile
from unittest import mock
import uuid
import mlflow
import mlflow.db
import mlflow.store.db.base_sql_model
from mlflow.entities.model_registry import (
RegisteredModel,
ModelVersion,
RegisteredModelTag,
ModelVersionTag,
)
from mlflow.exceptions import MlflowEx... | 46.944173 | 100 | 0.663154 | import os
import unittest
import tempfile
from unittest import mock
import uuid
import mlflow
import mlflow.db
import mlflow.store.db.base_sql_model
from mlflow.entities.model_registry import (
RegisteredModel,
ModelVersion,
RegisteredModelTag,
ModelVersionTag,
)
from mlflow.exceptions import MlflowEx... | true | true |
f7037f546b10ab4102b4b86bf61a04e560b49f85 | 13,327 | py | Python | digits/tools/test_parse_s3.py | Benedict93/DIGITS | 4be733f02ae79a2e75f5d07af396f38d356e1ff4 | [
"BSD-3-Clause"
] | 4,552 | 2015-03-17T17:24:11.000Z | 2022-03-27T04:07:58.000Z | digits/tools/test_parse_s3.py | Benedict93/DIGITS | 4be733f02ae79a2e75f5d07af396f38d356e1ff4 | [
"BSD-3-Clause"
] | 1,994 | 2015-03-17T21:46:44.000Z | 2022-03-19T18:20:29.000Z | digits/tools/test_parse_s3.py | Benedict93/DIGITS | 4be733f02ae79a2e75f5d07af396f38d356e1ff4 | [
"BSD-3-Clause"
] | 1,791 | 2015-03-17T17:51:05.000Z | 2022-03-08T13:44:40.000Z | # Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
import itertools
import os
import shutil
import tempfile
import mock
from nose.tools import raises, assert_raises
try:
from . import parse_s3
from digits.tools.mock_s3_walker import MockS3Walker
import_failed = False
except ImportError:... | 36.214674 | 115 | 0.619869 |
import itertools
import os
import shutil
import tempfile
import mock
from nose.tools import raises, assert_raises
try:
from . import parse_s3
from digits.tools.mock_s3_walker import MockS3Walker
import_failed = False
except ImportError:
import_failed = True
from digits import test_utils
test_util... | true | true |
f70380311cfd080c813d27a91a6974abd86c2888 | 12,424 | py | Python | broccoli/plugins.py | vulnersCom/broccoli | 273c9f60c72ca0de2fb1588f88b6da255f3e0322 | [
"MIT"
] | 3 | 2018-04-24T09:33:03.000Z | 2021-02-16T02:14:58.000Z | broccoli/plugins.py | vulnersCom/broccoli | 273c9f60c72ca0de2fb1588f88b6da255f3e0322 | [
"MIT"
] | null | null | null | broccoli/plugins.py | vulnersCom/broccoli | 273c9f60c72ca0de2fb1588f88b6da255f3e0322 | [
"MIT"
] | 1 | 2019-11-08T15:14:09.000Z | 2019-11-08T15:14:09.000Z | import re
import time
import typing
import logging
from calendar import monthrange
from datetime import datetime
from collections import Iterable
from heapq import heappush, heappop
from . import types # noqa
from . exceptions import BrokerError
from . interfaces import App, Plugin, Logger
from . utils import cached_p... | 34.898876 | 79 | 0.525998 | import re
import time
import typing
import logging
from calendar import monthrange
from datetime import datetime
from collections import Iterable
from heapq import heappush, heappop
from . import types
from . exceptions import BrokerError
from . interfaces import App, Plugin, Logger
from . utils import cached_propert... | true | true |
f703808ba89e85e0b17a1b390f31606eb6d19386 | 2,313 | py | Python | torch/distributed/elastic/rendezvous/registry.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | 1 | 2021-05-11T11:53:47.000Z | 2021-05-11T11:53:47.000Z | torch/distributed/elastic/rendezvous/registry.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | null | null | null | torch/distributed/elastic/rendezvous/registry.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from .api import RendezvousHandler, RendezvousParameters
from .api import rendezvous_handler_registry as handler_... | 34.014706 | 92 | 0.793342 |
from .api import RendezvousHandler, RendezvousParameters
from .api import rendezvous_handler_registry as handler_registry
from .dynamic_rendezvous import create_handler
def _create_static_handler(params: RendezvousParameters) -> RendezvousHandler:
from . import static_tcp_rendezvous
return static_tcp_r... | true | true |
f70380c5f6f598fd66459071a4078c0cc10c2a22 | 6,058 | py | Python | redlure-console.py | redlure/redlure-console | e59dabaea240976bffe645148a0eb95d1075143d | [
"BSD-3-Clause"
] | 21 | 2020-08-09T04:28:46.000Z | 2022-02-23T10:29:50.000Z | redlure-console.py | redlure/redlure-console | e59dabaea240976bffe645148a0eb95d1075143d | [
"BSD-3-Clause"
] | 9 | 2021-03-31T15:43:17.000Z | 2022-03-26T16:40:18.000Z | redlure-console.py | redlure/redlure-console | e59dabaea240976bffe645148a0eb95d1075143d | [
"BSD-3-Clause"
] | 7 | 2020-08-14T20:48:42.000Z | 2022-03-16T22:02:36.000Z | #!/usr/bin/env python3
from app import app, db, functions
from app.functions import Color
import subprocess
import os
import shlex
import shutil
from config import Config
from datetime import datetime
from cryptography.fernet import InvalidToken
from app.cipher import CipherTest, Cipher, new_cipher_key, encrypt, decryp... | 35.017341 | 151 | 0.651535 |
from app import app, db, functions
from app.functions import Color
import subprocess
import os
import shlex
import shutil
from config import Config
from datetime import datetime
from cryptography.fernet import InvalidToken
from app.cipher import CipherTest, Cipher, new_cipher_key, encrypt, decrypt
from app.workspace i... | true | true |
f70380d80d551bbc351d9ece8199eacdade9c151 | 6,731 | py | Python | rwt_robot_monitor/test/test_rwt_robot_monitor_plotter.py | Affonso-Gui/visualization_rwt | 9c015164e95ec13492dac9bf433c082355168ce4 | [
"BSD-3-Clause"
] | 33 | 2015-05-27T00:07:15.000Z | 2022-02-05T21:55:14.000Z | rwt_robot_monitor/test/test_rwt_robot_monitor_plotter.py | Affonso-Gui/visualization_rwt | 9c015164e95ec13492dac9bf433c082355168ce4 | [
"BSD-3-Clause"
] | 41 | 2015-02-06T09:33:24.000Z | 2022-03-21T05:06:29.000Z | rwt_robot_monitor/test/test_rwt_robot_monitor_plotter.py | Affonso-Gui/visualization_rwt | 9c015164e95ec13492dac9bf433c082355168ce4 | [
"BSD-3-Clause"
] | 38 | 2016-01-27T05:34:34.000Z | 2022-03-21T05:03:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2021, Kei Okada
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions... | 39.133721 | 119 | 0.679988 |
import argparse
import sys
import time
import rospy
import rostest
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from seleniu... | true | true |
f70380dd5f4275cd1df2a70863a2cb9bd97885b2 | 2,135 | py | Python | tests/test_config.py | pete-twibill/alertlogic-sdk-python | 5449dc3db312ba42de43cd8c9d86a68732c4c319 | [
"MIT"
] | 4 | 2020-05-14T11:18:07.000Z | 2021-09-30T13:20:34.000Z | tests/test_config.py | pete-twibill/alertlogic-sdk-python | 5449dc3db312ba42de43cd8c9d86a68732c4c319 | [
"MIT"
] | 26 | 2020-05-18T14:58:12.000Z | 2021-11-29T16:57:04.000Z | tests/test_config.py | pete-twibill/alertlogic-sdk-python | 5449dc3db312ba42de43cd8c9d86a68732c4c319 | [
"MIT"
] | 23 | 2020-02-10T09:14:05.000Z | 2022-01-27T23:44:54.000Z | import unittest
from almdrlib.session import Session
import re
MOCK_AUTH = {
"authentication": {
"user": {
"id": "589B64BB-AE91-4FA9-A6D8-37AC6759BB5D",
"account_id": "2",
"created": {
"at": 1443713420,
"by": "693BA145-78C0-4C77-AC1A-53854... | 26.358025 | 89 | 0.533489 | import unittest
from almdrlib.session import Session
import re
MOCK_AUTH = {
"authentication": {
"user": {
"id": "589B64BB-AE91-4FA9-A6D8-37AC6759BB5D",
"account_id": "2",
"created": {
"at": 1443713420,
"by": "693BA145-78C0-4C77-AC1A-53854... | true | true |
f70381bc71cd4b54071ed982ffd4ba5b95af32fa | 1,866 | py | Python | synapse/__init__.py | schildbach/synapse | 3aa36b782c715a2d3c965d5d9b37f7a49a5f17e1 | [
"Apache-2.0"
] | 1 | 2020-10-10T13:23:05.000Z | 2020-10-10T13:23:05.000Z | synapse/__init__.py | schildbach/synapse | 3aa36b782c715a2d3c965d5d9b37f7a49a5f17e1 | [
"Apache-2.0"
] | null | null | null | synapse/__init__.py | schildbach/synapse | 3aa36b782c715a2d3c965d5d9b37f7a49a5f17e1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018-9 New Vector Ltd
#
# 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... | 31.627119 | 79 | 0.752947 |
import json
import os
import sys
if sys.version_info < (3, 5):
print("Synapse requires Python 3.5 or above.")
sys.exit(1)
# Twisted and canonicaljson will fail to import when this file is executed to
# get the __version__ during a fresh install. That's OK and subsequent calls to
try:
fr... | true | true |
f7038372acea8564b8305e0beb5f6d7f87ed3aa9 | 6,454 | py | Python | experiments/increasing_dim/Exp_1/kron.py | vdutor/VFF | 459be5b480bba49e8c15dc7daeca5fd1ddd762df | [
"Apache-2.0"
] | 75 | 2016-11-21T21:50:12.000Z | 2022-03-22T17:56:36.000Z | experiments/increasing_dim/Exp_1/kron.py | vdutor/VFF | 459be5b480bba49e8c15dc7daeca5fd1ddd762df | [
"Apache-2.0"
] | 4 | 2018-03-22T19:47:08.000Z | 2021-10-06T14:49:54.000Z | experiments/increasing_dim/Exp_1/kron.py | vdutor/VFF | 459be5b480bba49e8c15dc7daeca5fd1ddd762df | [
"Apache-2.0"
] | 26 | 2016-11-22T14:14:58.000Z | 2022-02-03T18:29:20.000Z | import numpy as np
import sys
import gpflow
import VFF
from time import time
from config import *
dim = sys.argv[1]
rep = sys.argv[2]
print('vff: dimension {}, replicate {}'.format(dim, r))
# data
data = np.load('data/data_dim{}_rep{}.npz'.format(dim, 0))
# full_gp
def prodkern(dim):
return gpflow.kernels.Pro... | 37.523256 | 101 | 0.503719 | import numpy as np
import sys
import gpflow
import VFF
from time import time
from config import *
dim = sys.argv[1]
rep = sys.argv[2]
print('vff: dimension {}, replicate {}'.format(dim, r))
data = np.load('data/data_dim{}_rep{}.npz'.format(dim, 0))
def prodkern(dim):
return gpflow.kernels.Prod([gpflow.kerne... | true | true |
f70383c83f8ac45d0ac95cb44577dc706c18ae28 | 8,317 | py | Python | datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py | KarrLab/Kinetic-Datanator | 8aff047fd117033b98eca8ee3b21a8f07c430dec | [
"CC-BY-3.0",
"CC0-1.0",
"CC-BY-4.0",
"MIT"
] | 10 | 2018-11-20T17:04:09.000Z | 2021-08-24T18:29:06.000Z | datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py | KarrLab/Kinetic-Datanator | 8aff047fd117033b98eca8ee3b21a8f07c430dec | [
"CC-BY-3.0",
"CC0-1.0",
"CC-BY-4.0",
"MIT"
] | 59 | 2018-11-23T20:42:11.000Z | 2020-11-08T19:51:36.000Z | datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py | KarrLab/Kinetic-Datanator | 8aff047fd117033b98eca8ee3b21a8f07c430dec | [
"CC-BY-3.0",
"CC0-1.0",
"CC-BY-4.0",
"MIT"
] | 3 | 2018-12-15T00:53:54.000Z | 2021-08-24T18:29:08.000Z | import pandas as pd
from datanator.util import rna_halflife_util
import datetime
import datanator.config.core
import datetime
from pymongo.collation import Collation, CollationStrength
class Halflife(rna_halflife_util.RnaHLUtil):
def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
... | 59.407143 | 555 | 0.593123 | import pandas as pd
from datanator.util import rna_halflife_util
import datetime
import datanator.config.core
import datetime
from pymongo.collation import Collation, CollationStrength
class Halflife(rna_halflife_util.RnaHLUtil):
def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
... | true | true |
f703863d27b157411139d10736ab6cddb11462a0 | 4,522 | py | Python | tests/integration/issues/hanging_termination/test_hanging_termination.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | 1 | 2021-12-18T06:54:49.000Z | 2021-12-18T06:54:49.000Z | tests/integration/issues/hanging_termination/test_hanging_termination.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | 2 | 2021-12-17T15:22:12.000Z | 2021-12-18T07:19:06.000Z | tests/integration/issues/hanging_termination/test_hanging_termination.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | null | null | null | import os
from pathlib import Path
import numpy as np
import pytest
from jina import Flow, Document
from jina.clients import Client
from jina.logging.profile import TimeContext
from jina.parsers import set_client_cli_parser
from typing import Dict
from jina import DocumentArray, Executor, requests
class DumpExecuto... | 32.3 | 85 | 0.568996 | import os
from pathlib import Path
import numpy as np
import pytest
from jina import Flow, Document
from jina.clients import Client
from jina.logging.profile import TimeContext
from jina.parsers import set_client_cli_parser
from typing import Dict
from jina import DocumentArray, Executor, requests
class DumpExecuto... | true | true |
f70386457425b8a79d1bf8bba8f25e6afd14e258 | 2,013 | py | Python | utils/timeout.py | trilogy-group/kayako-dd-agent | 4a4cce9a367a6a522f3f4290819cbcd3ef637832 | [
"BSD-3-Clause"
] | 76 | 2015-02-09T12:20:12.000Z | 2022-03-31T04:29:35.000Z | utils/timeout.py | fotinakis/dd-agent | b8642a36f26190b7bed3208e145bd3ac4cc4f59b | [
"BSD-3-Clause"
] | 58 | 2015-01-12T08:57:23.000Z | 2021-09-24T23:06:23.000Z | utils/timeout.py | fotinakis/dd-agent | b8642a36f26190b7bed3208e145bd3ac4cc4f59b | [
"BSD-3-Clause"
] | 31 | 2015-03-30T15:30:19.000Z | 2021-01-12T07:37:22.000Z | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from threading import Thread
import functools
_thread_by_func = {}
class TimeoutException(Exception):
"""
Raised when a function runtime exceeds the limit set.
"""
pass
class ThreadMethod(Thre... | 26.84 | 99 | 0.606557 |
from threading import Thread
import functools
_thread_by_func = {}
class TimeoutException(Exception):
pass
class ThreadMethod(Thread):
def __init__(self, target, args, kwargs):
Thread.__init__(self)
self.setDaemon(True)
self.target, self.args, self.kwargs = target, args, kwargs
... | true | true |
f703876b792a5aa0ae1f2b68123b4b424e567173 | 2,939 | py | Python | designate/scheduler/filters/pool_id_attribute_filter.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 145 | 2015-01-02T09:35:53.000Z | 2021-12-14T17:03:53.000Z | designate/scheduler/filters/pool_id_attribute_filter.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 6 | 2015-03-15T00:22:27.000Z | 2019-12-16T09:37:38.000Z | designate/scheduler/filters/pool_id_attribute_filter.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 109 | 2015-01-13T16:47:34.000Z | 2021-03-15T13:18:48.000Z | # Copyright 2016 Hewlett Packard Enterprise Development Company, L.P.
#
# 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... | 34.576471 | 78 | 0.636611 |
from oslo_log import log as logging
from designate import exceptions
from designate import objects
from designate import policy
from designate.scheduler.filters import base
LOG = logging.getLogger(__name__)
class PoolIDAttributeFilter(base.Filter):
name = 'pool_id_attribute'
def filter(self, ... | true | true |
f703884b878ba570bfebe96909363b76a6c9c45f | 34 | py | Python | operation/__init__.py | gretchi/twim | 20a4bf459182a01d535cfb948d8b30de087585f1 | [
"MIT"
] | null | null | null | operation/__init__.py | gretchi/twim | 20a4bf459182a01d535cfb948d8b30de087585f1 | [
"MIT"
] | null | null | null | operation/__init__.py | gretchi/twim | 20a4bf459182a01d535cfb948d8b30de087585f1 | [
"MIT"
] | null | null | null |
from .operation import Operation
| 11.333333 | 32 | 0.823529 |
from .operation import Operation
| true | true |
f703884d0e67a0ffdabbd1f89173bd1ecbd974bb | 8,899 | py | Python | aiida/orm/utils/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 1 | 2016-09-12T10:51:00.000Z | 2016-09-12T10:51:00.000Z | aiida/orm/utils/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 17 | 2020-03-11T17:04:05.000Z | 2020-05-01T09:34:45.000Z | aiida/orm/utils/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 43.199029 | 120 | 0.684234 | true | true | |
f703888ac8620fcfd52e21ef458eecb61c9abac7 | 4,366 | py | Python | pynet/cam.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | null | null | null | pynet/cam.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | null | null | null | pynet/cam.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | null | null | null | # -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2019
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... | 34.109375 | 77 | 0.598717 | true | true | |
f7038a4e3cc3a6dbe03fde86c4a7001c8c8b8b51 | 9,495 | py | Python | src/UI_assign_group_window.py | GatherLab/OLED-evaluation | 419dfd5d2c3773f5f90d76aef634f8b1cc0b6378 | [
"MIT"
] | null | null | null | src/UI_assign_group_window.py | GatherLab/OLED-evaluation | 419dfd5d2c3773f5f90d76aef634f8b1cc0b6378 | [
"MIT"
] | null | null | null | src/UI_assign_group_window.py | GatherLab/OLED-evaluation | 419dfd5d2c3773f5f90d76aef634f8b1cc0b6378 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from PySide2 import QtCore, QtGui, QtWidgets
import json
import core_functions as cf
import numpy as np
from UI_labeled_slider import LabeledSlider
class Ui_AssignGroup(object):
def setupUi(self, AssignGroups):
# Note: this is not how it should be done but currently I don't know
... | 42.013274 | 89 | 0.618325 |
from PySide2 import QtCore, QtGui, QtWidgets
import json
import core_functions as cf
import numpy as np
from UI_labeled_slider import LabeledSlider
class Ui_AssignGroup(object):
def setupUi(self, AssignGroups):
# how to do it differently. This is only needed to be able to emit
# signal... | true | true |
f7038a82901c73f8b97543c9ba73f6bc069364fd | 1,496 | py | Python | Code/word_jumbler.py | squeaky1273/CS-1.3-Core-Data-Structures | e4aeabebc757b65dae89b82b2c341b90cf9880b6 | [
"MIT"
] | null | null | null | Code/word_jumbler.py | squeaky1273/CS-1.3-Core-Data-Structures | e4aeabebc757b65dae89b82b2c341b90cf9880b6 | [
"MIT"
] | 4 | 2020-02-18T00:17:01.000Z | 2020-03-10T21:17:33.000Z | Code/word_jumbler.py | squeaky1273/CS-1.3-Core-Data-Structures | e4aeabebc757b65dae89b82b2c341b90cf9880b6 | [
"MIT"
] | null | null | null | # Dictionary
class Dict_word_jumbler(object):
def __init__(self):
self.dict = self.build_dict()
def build_dict(self):
""""Build a dictionary to hold all of the words/letters"""
dic = {}
f = open("/usr/share/dict/words", "r")
word_list = f.readlines()
for word in ... | 34.790698 | 87 | 0.580214 |
class Dict_word_jumbler(object):
def __init__(self):
self.dict = self.build_dict()
def build_dict(self):
dic = {}
f = open("/usr/share/dict/words", "r")
word_list = f.readlines()
for word in word_list:
word = word.strip().lower()
words = ''.join(... | true | true |
f7038b41b4f2b57e449c6284c229a0c467b90e25 | 119 | py | Python | pickle2.py | himanshuhat21/mcd | 2603f7eb0926e2b47464e6913ea665d5dca6b767 | [
"MIT"
] | null | null | null | pickle2.py | himanshuhat21/mcd | 2603f7eb0926e2b47464e6913ea665d5dca6b767 | [
"MIT"
] | null | null | null | pickle2.py | himanshuhat21/mcd | 2603f7eb0926e2b47464e6913ea665d5dca6b767 | [
"MIT"
] | null | null | null | import pickle
dict1 = {'Python ':90,'Java ':95,'C++ ':85}
f = open('bin)file.dat','wb')
pickle.dump(dict1,f)
f.close() | 23.8 | 43 | 0.613445 | import pickle
dict1 = {'Python ':90,'Java ':95,'C++ ':85}
f = open('bin)file.dat','wb')
pickle.dump(dict1,f)
f.close() | true | true |
f7038c9082852a874f45dece3844cb48296d142a | 7,393 | py | Python | run/run_ResGraphNet.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | run/run_ResGraphNet.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | run/run_ResGraphNet.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | """
Testing ResGraphNet
"""
import datetime
import numpy as np
import pandas as pd
import torch
import os
import os.path as osp
import matplotlib.pyplot as plt
import sys
sys.path.append("..")
import func.cal as cal
device = "cuda:0" if torch.cuda.is_available() else "cpu"
# device = "cpu"
l_x = 60 ... | 40.179348 | 126 | 0.685108 | import datetime
import numpy as np
import pandas as pd
import torch
import os
import os.path as osp
import matplotlib.pyplot as plt
import sys
sys.path.append("..")
import func.cal as cal
device = "cuda:0" if torch.cuda.is_available() else "cpu"
l_x = 60
l_y = 1
lr = 0.0001 ... | true | true |
f7038d3cbafdba54d89cec202b769b1daff110b0 | 2,214 | py | Python | FreeCAD/OpenStereotaxy.py | VisionandCognition/OpenStereotaxy | b6894f37d4d94ae773734612ecb1604951158a27 | [
"MIT"
] | null | null | null | FreeCAD/OpenStereotaxy.py | VisionandCognition/OpenStereotaxy | b6894f37d4d94ae773734612ecb1604951158a27 | [
"MIT"
] | null | null | null | FreeCAD/OpenStereotaxy.py | VisionandCognition/OpenStereotaxy | b6894f37d4d94ae773734612ecb1604951158a27 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
===================== OpenStereotaxy module for FreeCAD =======================
This Python module for FreeCAD allows the user to calculate the chamber-centered
coordinates of the target structure(s). Based on this data, the module will
generate surface meshes (exported in .stl format ready ... | 42.576923 | 110 | 0.604788 |
"""
===================== OpenStereotaxy module for FreeCAD =======================
This Python module for FreeCAD allows the user to calculate the chamber-centered
coordinates of the target structure(s). Based on this data, the module will
generate surface meshes (exported in .stl format ready for 3D-printing) of the... | false | true |
f7038e23fe0fcedf0278b48b1b3477e90f408cec | 8,573 | py | Python | idea.py | JaworWr/Dynamic-inverse-kinematics | b9da50b88152682060075a44da940e6f98690a9a | [
"MIT"
] | null | null | null | idea.py | JaworWr/Dynamic-inverse-kinematics | b9da50b88152682060075a44da940e6f98690a9a | [
"MIT"
] | null | null | null | idea.py | JaworWr/Dynamic-inverse-kinematics | b9da50b88152682060075a44da940e6f98690a9a | [
"MIT"
] | null | null | null | import numpy as np
def FNS(scores):
domination = np.all(scores[:, None, :] <= scores[None, :, :], axis=2) # domination[i, j] = "i dominuje j"
domination &= np.any(scores[:, None, :] < scores[None, :, :], axis=2)
Nx = domination.sum(0)
Pf = []
ranks = np.zeros(scores.shape[0])
r = 0
Q = n... | 32.973077 | 118 | 0.591508 | import numpy as np
def FNS(scores):
domination = np.all(scores[:, None, :] <= scores[None, :, :], axis=2)
domination &= np.any(scores[:, None, :] < scores[None, :, :], axis=2)
Nx = domination.sum(0)
Pf = []
ranks = np.zeros(scores.shape[0])
r = 0
Q = np.nonzero(Nx == 0)[0]
while Q.s... | true | true |
f7038fc0bc5d2f6096f6475db9c9bcecc2181c6d | 8,118 | py | Python | proxy/utils.py | rmarx/quic_iot | 56e3c184bdaa20c065150c33851a5b6608987b8b | [
"MIT"
] | 1 | 2020-09-28T11:34:28.000Z | 2020-09-28T11:34:28.000Z | proxy/utils.py | rmarx/quic_iot | 56e3c184bdaa20c065150c33851a5b6608987b8b | [
"MIT"
] | null | null | null | proxy/utils.py | rmarx/quic_iot | 56e3c184bdaa20c065150c33851a5b6608987b8b | [
"MIT"
] | 1 | 2021-04-05T16:19:51.000Z | 2021-04-05T16:19:51.000Z | """
Misc functions.
"""
import ipaddress
import datetime
import hashlib
import json
import netaddr
import netifaces
import os
import re
import requests
import scapy.all as sc
import subprocess
import sys
import threading
import time
import traceback
import uuid
import server_config
IPv4_REGEX = re.compile(r'[0-9]{... | 22.363636 | 91 | 0.615176 | import ipaddress
import datetime
import hashlib
import json
import netaddr
import netifaces
import os
import re
import requests
import scapy.all as sc
import subprocess
import sys
import threading
import time
import traceback
import uuid
import server_config
IPv4_REGEX = re.compile(r'[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0... | true | true |
f703901192427f703569a7943582237c9e551aeb | 8,622 | py | Python | py_trans/async_translator.py | Itz-fork/py-trans | 2c35eb987ad990850dab55f00ec0f1c489b2589e | [
"MIT"
] | 12 | 2021-09-11T16:27:24.000Z | 2021-11-07T12:48:13.000Z | py_trans/async_translator.py | Itz-fork/py-trans | 2c35eb987ad990850dab55f00ec0f1c489b2589e | [
"MIT"
] | 1 | 2021-09-11T16:42:02.000Z | 2021-09-12T04:14:04.000Z | py_trans/async_translator.py | Itz-fork/py-trans | 2c35eb987ad990850dab55f00ec0f1c489b2589e | [
"MIT"
] | 2 | 2021-10-03T10:17:31.000Z | 2022-01-25T12:33:45.000Z | # Project: py-trans
# Author: Itz-fork
import aiohttp
from .language_codes import _get_full_lang_name, _get_lang_code
from .errors import check_internet_connection, UnknownErrorOccurred
class Async_PyTranslator:
"""
Async PyTranslator Class
Note:
Before Trying to Translate Create an instance of ... | 47.373626 | 190 | 0.593714 |
import aiohttp
from .language_codes import _get_full_lang_name, _get_lang_code
from .errors import check_internet_connection, UnknownErrorOccurred
class Async_PyTranslator:
def __init__(self, provider="google"):
check_internet_connection()
self.providers = ["google", "libre", "translat... | true | true |
f703904473e73730adab7124ddff717c8c6d6c0d | 14,395 | py | Python | axonius_api_client/api/assets/saved_query.py | Axonius/axonius_api_client | 751fd6346ee9f361a73cd1399704b6d928f130ae | [
"MIT"
] | 11 | 2020-01-31T00:28:26.000Z | 2022-03-25T20:27:08.000Z | axonius_api_client/api/assets/saved_query.py | Axonius/axonius_api_client | 751fd6346ee9f361a73cd1399704b6d928f130ae | [
"MIT"
] | 83 | 2020-01-22T12:52:38.000Z | 2022-02-07T16:20:18.000Z | axonius_api_client/api/assets/saved_query.py | Axonius/axonius_api_client | 751fd6346ee9f361a73cd1399704b6d928f130ae | [
"MIT"
] | 16 | 2019-08-23T17:44:31.000Z | 2022-01-06T00:57:34.000Z | # -*- coding: utf-8 -*-
"""API for working with saved queries for assets."""
import warnings
from typing import Generator, List, Optional, Union
from ...constants.api import MAX_PAGE_SIZE
from ...exceptions import NotFoundError, ResponseError, ApiWarning
# from ...features import Features
from ...parsers.tables impor... | 34.93932 | 107 | 0.570823 |
import warnings
from typing import Generator, List, Optional, Union
from ...constants.api import MAX_PAGE_SIZE
from ...exceptions import NotFoundError, ResponseError, ApiWarning
from ...parsers.tables import tablize_sqs
from ...tools import check_gui_page_size, listify
from .. import json_api
from ..api_endpoints i... | true | true |
f703904bca3f1b62c246cc7e14f00f30d95c4d00 | 6,564 | py | Python | producer/util.py | Keck-FOBOS/producer | 6f2b0d3f29f62187bf593567081061e53ddb5a4e | [
"BSD-3-Clause"
] | null | null | null | producer/util.py | Keck-FOBOS/producer | 6f2b0d3f29f62187bf593567081061e53ddb5a4e | [
"BSD-3-Clause"
] | null | null | null | producer/util.py | Keck-FOBOS/producer | 6f2b0d3f29f62187bf593567081061e53ddb5a4e | [
"BSD-3-Clause"
] | null | null | null | """
Miscellaneous package utilities.
.. include:: ../include/links.rst
"""
from itertools import chain, combinations
from IPython import embed
import numpy
def all_subclasses(cls):
"""
Collect all the subclasses of the provided class.
The search follows the inheritance to the highest-level class. I... | 33.319797 | 104 | 0.61883 |
from itertools import chain, combinations
from IPython import embed
import numpy
def all_subclasses(cls):
return set(cls.__subclasses__()).union(
[s for c in cls.__subclasses__() for s in all_subclasses(c)])
def string_table(tbl, delimeter='print', has_header=True):
nrows, ncols = tbl.shape
... | true | true |
f70390583a82b46fca6f1d21db1f09463d4fd79d | 3,979 | py | Python | generate_cdiscount_predictions.py | chundiliu/slim_for_Cdiscount | ea7f9d56072072c031094c12c803c63591066c6c | [
"Apache-2.0"
] | null | null | null | generate_cdiscount_predictions.py | chundiliu/slim_for_Cdiscount | ea7f9d56072072c031094c12c803c63591066c6c | [
"Apache-2.0"
] | null | null | null | generate_cdiscount_predictions.py | chundiliu/slim_for_Cdiscount | ea7f9d56072072c031094c12c803c63591066c6c | [
"Apache-2.0"
] | null | null | null | import math
import tensorflow as tf
import os
import struct
import pdb
import numpy as np
from datasets import dataset_factory
from nets import nets_factory
import nets.resnet_v2 as resnet_v2
from preprocessing import preprocessing_factory
slim = tf.contrib.slim
def merge_predictions(predictions_fn):
'''
Merge... | 35.526786 | 121 | 0.654938 | import math
import tensorflow as tf
import os
import struct
import pdb
import numpy as np
from datasets import dataset_factory
from nets import nets_factory
import nets.resnet_v2 as resnet_v2
from preprocessing import preprocessing_factory
slim = tf.contrib.slim
def merge_predictions(predictions_fn):
out_f = open... | true | true |
f703910d9e118fa5006358175ab5d250b7cb827a | 15,716 | py | Python | src/collective/solr/browser/maintenance.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | src/collective/solr/browser/maintenance.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | src/collective/solr/browser/maintenance.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | # -*- coding: utf-8 -*-
from logging import getLogger
from time import time, strftime
from BTrees.IIBTree import IITreeSet
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from plone.uuid.interfaces import IUUID, IUUIDAware
from zope.interface import implementer
from zope.... | 35.718182 | 88 | 0.53646 |
from logging import getLogger
from time import time, strftime
from BTrees.IIBTree import IITreeSet
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from plone.uuid.interfaces import IUUID, IUUIDAware
from zope.interface import implementer
from zope.component import queryU... | true | true |
f7039164567fe3e1f10bbf5d027112ab3c1c5b73 | 1,649 | py | Python | fable/fable_sources/libtbx/command_line/any2unix.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 4 | 2016-09-30T15:03:39.000Z | 2021-03-25T13:27:08.000Z | fable/fable_sources/libtbx/command_line/any2unix.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 1 | 2018-04-18T14:41:18.000Z | 2018-04-20T19:33:52.000Z | fable/fable_sources/libtbx/command_line/any2unix.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 3 | 2016-04-19T18:20:30.000Z | 2019-04-03T14:54:29.000Z | from __future__ import division
import sys, os
def run(args):
for path in args:
problem = None
if (not os.path.isfile(path) or os.path.islink(path)):
problem = "not a regular file"
else:
try:
file_content = open(path, "rb").read()
except Exception:
problem = "no read acc... | 32.98 | 79 | 0.551243 | from __future__ import division
import sys, os
def run(args):
for path in args:
problem = None
if (not os.path.isfile(path) or os.path.islink(path)):
problem = "not a regular file"
else:
try:
file_content = open(path, "rb").read()
except Exception:
problem = "no read acc... | false | true |
f70391cad5dd31becb556ae04a51819ce17fe64b | 1,881 | py | Python | data-and-statistics/understanding-a-population-using-sampling.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | 1 | 2021-01-16T21:42:42.000Z | 2021-01-16T21:42:42.000Z | data-and-statistics/understanding-a-population-using-sampling.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | null | null | null | data-and-statistics/understanding-a-population-using-sampling.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | null | null | null | """
One of the central problems in statistics is to make estimations — and quantify
how good these estimations are — of the distribution of an entire population
given only a small (random) sample. A classic example is to estimate the average
height of all the people in a country when measuring the height of a randomly
... | 40.021277 | 80 | 0.758107 | import math
import pandas as pd
from scipy import stats
sample_data = pd.Series([
172.3, 171.3, 164.7, 162.9, 172.5, 176.3, 174.8, 171.9,
176.8, 167.8, 164.5, 179.7, 157.8, 170.6, 189.9, 185. ,
172.7, 165.5, 174.5, 171.5])
sample_mean = sample_data.mean()
sample_std = sample_data.std()
print(f"Mean: {sa... | true | true |
f703920ef91c9979de1ce19afa587a2ed363587a | 500 | py | Python | algorithm/github_al/flatten.py | freedomDR/coding | 310a68077de93ef445ccd2929e90ba9c22a9b8eb | [
"MIT"
] | null | null | null | algorithm/github_al/flatten.py | freedomDR/coding | 310a68077de93ef445ccd2929e90ba9c22a9b8eb | [
"MIT"
] | null | null | null | algorithm/github_al/flatten.py | freedomDR/coding | 310a68077de93ef445ccd2929e90ba9c22a9b8eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import Iterable
def flatten(input_arr, output_arr = None):
if output_arr is None:
output_arr = []
for t in input_arr:
if isinstance(t, Iterable):
flatten(t, output_arr)
else:
output_arr.append(t)
... | 22.727273 | 42 | 0.592 |
from collections import Iterable
def flatten(input_arr, output_arr = None):
if output_arr is None:
output_arr = []
for t in input_arr:
if isinstance(t, Iterable):
flatten(t, output_arr)
else:
output_arr.append(t)
return output_arr
def flatten_iter(iterabl... | true | true |
f703926c80160625841d05702077db2125d9440e | 23,974 | py | Python | keras/optimizer_v2/rmsprop_test.py | Bhavay192/keras | ed6ca50cceb2a071f86e5e9af5076b1d62fd2531 | [
"Apache-2.0"
] | 37,222 | 2017-12-13T00:52:55.000Z | 2022-03-31T22:34:35.000Z | keras/optimizer_v2/rmsprop_test.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 7,624 | 2017-12-13T01:03:40.000Z | 2022-03-31T23:57:24.000Z | keras/optimizer_v2/rmsprop_test.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 14,914 | 2017-12-13T02:30:46.000Z | 2022-03-30T14:49:16.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... | 40.633898 | 114 | 0.616042 |
import tensorflow.compat.v2 as tf
import copy
import itertools
import math
from absl.testing import parameterized
import numpy as np
from tensorflow.python.framework import test_util
from keras import combinations
from keras import testing_utils
from keras.optimizer_v2 import learning_rate_schedule
fro... | true | true |
f703935a81099d2c4a2a54350f54542dcb59b99b | 9,815 | py | Python | visualization/visualizer/ArcBall.py | zhigangjiang/LGT-Net | d9a619158b2dc66a50c100e7fa7e491f1df16fd7 | [
"MIT"
] | 11 | 2022-03-03T17:49:33.000Z | 2022-03-25T11:23:11.000Z | visualization/visualizer/ArcBall.py | zhigangjiang/LGT-Net | d9a619158b2dc66a50c100e7fa7e491f1df16fd7 | [
"MIT"
] | 3 | 2021-05-03T08:06:13.000Z | 2022-01-13T15:21:28.000Z | ArcBall.py | fuenwang/360LayoutVisualizer | 36a7b0e17be6491800c6904d0a9ec0ffcd1b5249 | [
"MIT"
] | 1 | 2022-03-04T06:39:50.000Z | 2022-03-04T06:39:50.000Z | """
ArcBall.py -- Math utilities, vector, matrix types and ArcBall quaternion rotation class
>>> unit_test_ArcBall_module ()
unit testing ArcBall
Quat for first drag
[ 0.08438914 -0.08534209 -0.06240178 0.99080837]
First transform
[[ 0.97764552 -0.1380603 0.15858325 0. ]
[ 0.10925253 0.97796899 0.1778779... | 30.29321 | 111 | 0.652573 |
try:
import numpy as Numeric
def sumDot( a,b ):
return Numeric.dot (a, b)
except ImportError:
try:
import Numeric
def sumDot( a,b ):
return sum (Numeric.dot (a, b) )
except ImportError:
print ("This demo requires the numpy or Numeric extension, sorry")
import sys
sys.exit()
import copy
from math im... | true | true |
f70393d6c78a695c7990d9fcc63b60178e2de3e0 | 2,786 | py | Python | tests/test_filesystem.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 8 | 2020-12-06T13:04:57.000Z | 2021-12-14T23:00:56.000Z | tests/test_filesystem.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | null | null | null | tests/test_filesystem.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 1 | 2022-01-25T21:15:46.000Z | 2022-01-25T21:15:46.000Z | import os
import boto3
import fsspec
import pytest
from moto import mock_s3
from datasets.filesystems import (
COMPRESSION_FILESYSTEMS,
HfFileSystem,
S3FileSystem,
extract_path_from_uri,
is_remote_filesystem,
)
from .utils import require_lz4, require_zstandard
@pytest.fixture(scope="function")
... | 33.166667 | 116 | 0.739052 | import os
import boto3
import fsspec
import pytest
from moto import mock_s3
from datasets.filesystems import (
COMPRESSION_FILESYSTEMS,
HfFileSystem,
S3FileSystem,
extract_path_from_uri,
is_remote_filesystem,
)
from .utils import require_lz4, require_zstandard
@pytest.fixture(scope="function")
... | true | true |
f703943fbc79d0f254b8d08ea640cf0e5c86ba5f | 3,639 | py | Python | facebook_business/adobjects/messengerdestinationpagewelcomemessage.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 3 | 2021-08-06T05:01:39.000Z | 2021-08-11T03:31:44.000Z | facebook_business/adobjects/messengerdestinationpagewelcomemessage.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 5 | 2016-09-22T20:18:11.000Z | 2018-10-19T00:00:24.000Z | facebook_business/adobjects/messengerdestinationpagewelcomemessage.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 1 | 2021-02-25T16:20:58.000Z | 2021-02-25T16:20:58.000Z | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 38.305263 | 103 | 0.706238 |
from facebook_business.adobjects.abstractobject import AbstractObject
from facebook_business.adobjects.abstractcrudobject import AbstractCrudObject
from facebook_business.adobjects.objectparser import ObjectParser
from facebook_business.api import FacebookRequest
from facebook_business.typechecker i... | true | true |
f70394ae6aab6d7f593c2084d4429207c49d3d56 | 1,245 | py | Python | courses/src/task_app/serializers/task_file.py | yuramorozov01/courses_system | 582532b2a2753d89642e1e8dbee0f369774638b1 | [
"Apache-2.0"
] | null | null | null | courses/src/task_app/serializers/task_file.py | yuramorozov01/courses_system | 582532b2a2753d89642e1e8dbee0f369774638b1 | [
"Apache-2.0"
] | null | null | null | courses/src/task_app/serializers/task_file.py | yuramorozov01/courses_system | 582532b2a2753d89642e1e8dbee0f369774638b1 | [
"Apache-2.0"
] | null | null | null | from base_app.serializers import CustomUserSerializer
from rest_framework import serializers
from task_app.models import TaskFile
class TaskFileCreateSerializer(serializers.ModelSerializer):
'''Serializer for creating task files'''
author = CustomUserSerializer(read_only=True)
class Meta:
model ... | 29.642857 | 77 | 0.718072 | from base_app.serializers import CustomUserSerializer
from rest_framework import serializers
from task_app.models import TaskFile
class TaskFileCreateSerializer(serializers.ModelSerializer):
author = CustomUserSerializer(read_only=True)
class Meta:
model = TaskFile
fields = '__all__'
... | true | true |
f70394c0c84001797c89a541d9f24d7cf0bd3eb7 | 11,469 | py | Python | ckan/model/license.py | sabinem/ckan | dfad5d98a644a76939a57872073ef27dc7c68d86 | [
"Apache-2.0"
] | 1 | 2020-07-09T02:10:18.000Z | 2020-07-09T02:10:18.000Z | ckan/model/license.py | sabinem/ckan | dfad5d98a644a76939a57872073ef27dc7c68d86 | [
"Apache-2.0"
] | 3 | 2020-03-24T17:56:04.000Z | 2021-02-02T22:16:31.000Z | ckan/model/license.py | sabinem/ckan | dfad5d98a644a76939a57872073ef27dc7c68d86 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import datetime
import re
import requests
from ckan.common import config
from ckan.common import asbool
from six import text_type, string_types
from ckan.common import _, json
import ckan.lib.maintain as maintain
log = __import__('logging').getLogger(__name__)
class License(object):
"""Doma... | 31.250681 | 82 | 0.608684 |
import datetime
import re
import requests
from ckan.common import config
from ckan.common import asbool
from six import text_type, string_types
from ckan.common import _, json
import ckan.lib.maintain as maintain
log = __import__('logging').getLogger(__name__)
class License(object):
def __init__(self, data... | true | true |
f70394c4b4c5b9d7822853ff5865b2756c9dd6bc | 1,768 | py | Python | Chapter 10/code/category_predictor.py | shivampotdar/Artificial-Intelligence-with-Python | 00221c3b1a6d8003765d1ca48b5c95f86da375d9 | [
"MIT"
] | 387 | 2017-02-11T18:28:50.000Z | 2022-03-27T01:16:05.000Z | Chapter 10/code/category_predictor.py | shivampotdar/Artificial-Intelligence-with-Python | 00221c3b1a6d8003765d1ca48b5c95f86da375d9 | [
"MIT"
] | 18 | 2017-12-15T03:10:25.000Z | 2021-04-20T14:32:43.000Z | Chapter 10/code/category_predictor.py | shivampotdar/Artificial-Intelligence-with-Python | 00221c3b1a6d8003765d1ca48b5c95f86da375d9 | [
"MIT"
] | 407 | 2017-01-23T15:18:33.000Z | 2022-03-16T05:39:02.000Z | from sklearn.datasets import fetch_20newsgroups
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
# Define the category map
category_map = {'talk.politics.misc': 'Politics', 'rec.autos': 'Autos',
... | 36.081633 | 79 | 0.769796 | from sklearn.datasets import fetch_20newsgroups
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
category_map = {'talk.politics.misc': 'Politics', 'rec.autos': 'Autos',
'rec.sport.hockey': 'H... | true | true |
f7039603998c5edc3cabdaf934821dfecab387fe | 1,434 | py | Python | ada_friend_app/api/login.py | ratopythonista/ada-friend | 0b40afb3b7b4b60980663e962ccd455d6436345d | [
"MIT"
] | null | null | null | ada_friend_app/api/login.py | ratopythonista/ada-friend | 0b40afb3b7b4b60980663e962ccd455d6436345d | [
"MIT"
] | null | null | null | ada_friend_app/api/login.py | ratopythonista/ada-friend | 0b40afb3b7b4b60980663e962ccd455d6436345d | [
"MIT"
] | null | null | null | from loguru import logger
from flask import request
from flasgger import swag_from
from flask_restful import Resource
from jwt.exceptions import ExpiredSignatureError
from ada_friend_app.modulo.cripto import Sha256
from ada_friend_app.modulo.jwt_auth import Token
from ada_friend_app.api.resposta_api import Resposta
fr... | 37.736842 | 97 | 0.608089 | from loguru import logger
from flask import request
from flasgger import swag_from
from flask_restful import Resource
from jwt.exceptions import ExpiredSignatureError
from ada_friend_app.modulo.cripto import Sha256
from ada_friend_app.modulo.jwt_auth import Token
from ada_friend_app.api.resposta_api import Resposta
fr... | true | true |
f70396193135830ef2d1de8e357842ea1ef0eea2 | 747 | py | Python | PaddleCV/PaddleDetection/ppdet/experimental/__init__.py | XiaoguangHu01/models | a95d49323ed504e5a9164586f171f408954fd43a | [
"Apache-2.0"
] | 7,782 | 2019-10-25T09:39:37.000Z | 2022-03-31T13:44:14.000Z | static/ppdet/experimental/__init__.py | siqi-yang/PaddleDetection | d7383ad99c69e03f984ead52cc645d17f4729837 | [
"Apache-2.0"
] | 3,499 | 2019-10-29T12:37:40.000Z | 2022-03-31T14:51:56.000Z | static/ppdet/experimental/__init__.py | siqi-yang/PaddleDetection | d7383ad99c69e03f984ead52cc645d17f4729837 | [
"Apache-2.0"
] | 1,874 | 2019-10-28T04:21:58.000Z | 2022-03-31T05:41:21.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.571429 | 74 | 0.776439 |
from __future__ import absolute_import
from .mixed_precision import *
from . import mixed_precision
__all__ = mixed_precision.__all__
| true | true |
f70396c8be176b604dce67ff49b19ec44c86cdc8 | 1,328 | py | Python | rasa/cli/arguments/data.py | deepmipt/rasa | f0cc0ff6e515df2249998ff4e788009cccaecc02 | [
"Apache-2.0"
] | 2 | 2021-02-19T07:19:27.000Z | 2022-01-19T09:00:43.000Z | rasa/cli/arguments/data.py | RakibulAsheeque/rasa | 7d3804cd081c73d78ab5e973f95a55845eed1e89 | [
"Apache-2.0"
] | 6 | 2020-01-28T22:55:28.000Z | 2022-02-10T00:20:45.000Z | rasa/cli/arguments/data.py | RakibulAsheeque/rasa | 7d3804cd081c73d78ab5e973f95a55845eed1e89 | [
"Apache-2.0"
] | 1 | 2022-01-19T09:00:45.000Z | 2022-01-19T09:00:45.000Z | import argparse
from rasa.cli.arguments.default_arguments import (
add_nlu_data_param,
add_out_param,
add_data_param,
add_domain_param,
)
def set_convert_arguments(parser: argparse.ArgumentParser):
add_data_param(parser, required=True, default=None, data_type="Rasa NLU ")
add_out_param(
... | 25.538462 | 84 | 0.665663 | import argparse
from rasa.cli.arguments.default_arguments import (
add_nlu_data_param,
add_out_param,
add_data_param,
add_domain_param,
)
def set_convert_arguments(parser: argparse.ArgumentParser):
add_data_param(parser, required=True, default=None, data_type="Rasa NLU ")
add_out_param(
... | true | true |
f703974e9d75f9f9f38c70017d90be9c33941f4b | 3,275 | py | Python | src/trading_simulation/simulation.py | andrzejmalota/StockPricePrediction | a6d7da353b706fb2d970f2883841db14d896268f | [
"MIT"
] | 1 | 2020-02-28T15:37:35.000Z | 2020-02-28T15:37:35.000Z | src/trading_simulation/simulation.py | andrzejmalota/StockPricePrediction | a6d7da353b706fb2d970f2883841db14d896268f | [
"MIT"
] | null | null | null | src/trading_simulation/simulation.py | andrzejmalota/StockPricePrediction | a6d7da353b706fb2d970f2883841db14d896268f | [
"MIT"
] | 1 | 2020-07-09T02:41:15.000Z | 2020-07-09T02:41:15.000Z | import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class Simulation:
def __init__(self, init_investment, stock_returns, strategy, predicted_movements=None):
self.init_investment = init_investment
self.predicted_movements = predicted_movements
self.stock_retur... | 38.988095 | 108 | 0.654656 | import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class Simulation:
def __init__(self, init_investment, stock_returns, strategy, predicted_movements=None):
self.init_investment = init_investment
self.predicted_movements = predicted_movements
self.stock_retur... | true | true |
f70398596acf9ff285114deab4a95eb353a9e137 | 5,676 | py | Python | src/interactive/azext_interactive/azclishell/configuration.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2019-05-10T19:58:09.000Z | 2019-05-10T19:58:09.000Z | src/interactive/azext_interactive/azclishell/configuration.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | src/interactive/azext_interactive/azclishell/configuration.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2021-07-28T14:50:54.000Z | 2021-07-28T14:50:54.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 37.84 | 122 | 0.592319 |
from __future__ import print_function
import os
from six.moves import configparser
from prompt_toolkit import prompt
from azure.cli.core._help import PRIVACY_STATEMENT
SELECT_SYMBOL = {
'outside': '#',
'query': '??',
'example': '::',
'exit_code': '$',
'scope': '%%',
'unscope': '..'
}
... | true | true |
f70398e1f175d5b25119973036ab52f724bcd197 | 1,279 | py | Python | setup.py | cunningr/yanccm | 2d8f891d704672f4d3a15472c7a13edf7832d53d | [
"MIT"
] | null | null | null | setup.py | cunningr/yanccm | 2d8f891d704672f4d3a15472c7a13edf7832d53d | [
"MIT"
] | null | null | null | setup.py | cunningr/yanccm | 2d8f891d704672f4d3a15472c7a13edf7832d53d | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='yanccm',
packages=[
'controller',
'sot',
'ncservice',
'ncservice.configDb',
'ncservice.ncDeviceOps',
'ncservice.ncDeviceOps.threaded',
'view'],
version='0.0.2',
license='MIT',
description='''YANCCM... | 29.068182 | 113 | 0.591087 | from distutils.core import setup
setup(
name='yanccm',
packages=[
'controller',
'sot',
'ncservice',
'ncservice.configDb',
'ncservice.ncDeviceOps',
'ncservice.ncDeviceOps.threaded',
'view'],
version='0.0.2',
license='MIT',
description='''YANCCM... | true | true |
f7039945cbf7c33f6d0a0a69ac4129d20b76d598 | 194 | py | Python | src/terregex/__init__.py | m1kit/terregex | b8a809b2db664f26f90f7da29481be97cf6959f7 | [
"Apache-2.0"
] | null | null | null | src/terregex/__init__.py | m1kit/terregex | b8a809b2db664f26f90f7da29481be97cf6959f7 | [
"Apache-2.0"
] | null | null | null | src/terregex/__init__.py | m1kit/terregex | b8a809b2db664f26f90f7da29481be97cf6959f7 | [
"Apache-2.0"
] | null | null | null | from terregex.mlr import Node, NodeList, Literal, NotLiteral, \
In, Negate, Range, Category, MinRepeat, MaxRepeat, \
SubPattern, Branch, Any, parse
from terregex.transform import Transformer | 48.5 | 63 | 0.778351 | from terregex.mlr import Node, NodeList, Literal, NotLiteral, \
In, Negate, Range, Category, MinRepeat, MaxRepeat, \
SubPattern, Branch, Any, parse
from terregex.transform import Transformer | true | true |
f70399bc2b81b97e423fbbbaf3c843a17a7dcaf9 | 1,452 | py | Python | var/spack/repos/builtin/packages/prinseq-lite/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/prinseq-lite/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/prinseq-lite/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PrinseqLite(Package):
"""PRINSEQ will help you to preprocess your genomic or metagenomic
... | 34.571429 | 101 | 0.643251 |
from spack import *
class PrinseqLite(Package):
homepage = "http://prinseq.sourceforge.net"
url = "https://sourceforge.net/projects/prinseq/files/standalone/prinseq-lite-0.20.4.tar.gz"
version('0.20.4', sha256='9b5e0dce3b7f02f09e1cc7e8a2dd77c0b133e5e35529d570ee901f53ebfeb56f')
variant('no... | true | true |
f7039abe17a41985ac2cb62489cf2a254e3f0f3f | 1,874 | py | Python | rcp/rcp_listCNVDetails.py | dhanaprakashj/cnv_wgs | 453d6f87ca7377e338f4606194af24d97f4d6381 | [
"MIT"
] | null | null | null | rcp/rcp_listCNVDetails.py | dhanaprakashj/cnv_wgs | 453d6f87ca7377e338f4606194af24d97f4d6381 | [
"MIT"
] | null | null | null | rcp/rcp_listCNVDetails.py | dhanaprakashj/cnv_wgs | 453d6f87ca7377e338f4606194af24d97f4d6381 | [
"MIT"
] | null | null | null | import gzip
import sys
def ParseFields(line):
fields = {}
var = line.rstrip("\n").lstrip("#").lstrip(">").split("\t")
for x in range(0, len(var)):
fields[var[x]] = x
return fields
def StripLeadLag(line):
var = line.rstrip("\n").lstrip("#").lstrip(">").split("\t")
return var
#Checks if... | 31.233333 | 84 | 0.61953 | import gzip
import sys
def ParseFields(line):
fields = {}
var = line.rstrip("\n").lstrip("#").lstrip(">").split("\t")
for x in range(0, len(var)):
fields[var[x]] = x
return fields
def StripLeadLag(line):
var = line.rstrip("\n").lstrip("#").lstrip(">").split("\t")
return var
def Caref... | false | true |
f7039b4c486e283b178471dcf9b70206d4183022 | 81,410 | py | Python | scipy/optimize/tests/test_linprog.py | pranavrajpal/scipy | 7dcdeffed53483a60b3e054618520e0f28adeba4 | [
"BSD-3-Clause"
] | 1 | 2021-06-11T22:09:38.000Z | 2021-06-11T22:09:38.000Z | scipy/optimize/tests/test_linprog.py | pranavrajpal/scipy | 7dcdeffed53483a60b3e054618520e0f28adeba4 | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_linprog.py | pranavrajpal/scipy | 7dcdeffed53483a60b3e054618520e0f28adeba4 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:44:38.000Z | 2021-09-13T20:44:38.000Z | """
Unit test for Linear Programming
"""
import sys
import numpy as np
from numpy.testing import (assert_, assert_allclose, assert_equal,
assert_array_less, assert_warns, suppress_warnings)
from pytest import raises as assert_raises
from scipy.optimize import linprog, OptimizeWarning
from sc... | 39.008146 | 107 | 0.542132 | import sys
import numpy as np
from numpy.testing import (assert_, assert_allclose, assert_equal,
assert_array_less, assert_warns, suppress_warnings)
from pytest import raises as assert_raises
from scipy.optimize import linprog, OptimizeWarning
from scipy.sparse.linalg import MatrixRankWarnin... | true | true |
f7039b99de5e7aefe25f080a32f03253b9c3ea2f | 3,573 | py | Python | tests/unit/agroapi10/test_polygon.py | ChuckVanHoff/pyowm | 86735d8629ead2cfa0232b0f8ec0b88ab16eff11 | [
"MIT"
] | 1 | 2019-06-01T07:47:12.000Z | 2019-06-01T07:47:12.000Z | tests/unit/agroapi10/test_polygon.py | cjsgh901/pyowm | cdd59eb72f32f7238624ceef9b2e2329a5ebd472 | [
"MIT"
] | null | null | null | tests/unit/agroapi10/test_polygon.py | cjsgh901/pyowm | cdd59eb72f32f7238624ceef9b2e2329a5ebd472 | [
"MIT"
] | 1 | 2020-01-20T22:54:02.000Z | 2020-01-20T22:54:02.000Z | import unittest
from pyowm.agroapi10.polygon import Polygon, GeoPoint, GeoPolygon
class TestPolygon(unittest.TestCase):
geopoint= GeoPoint(34, -56.3)
geopolygon = GeoPolygon([
[[2.3, 57.32], [23.19, -20.2], [-120.4, 19.15], [2.3, 57.32]]
])
def test_polygon_fails_with_wrong_parameters(self):... | 38.836957 | 114 | 0.563672 | import unittest
from pyowm.agroapi10.polygon import Polygon, GeoPoint, GeoPolygon
class TestPolygon(unittest.TestCase):
geopoint= GeoPoint(34, -56.3)
geopolygon = GeoPolygon([
[[2.3, 57.32], [23.19, -20.2], [-120.4, 19.15], [2.3, 57.32]]
])
def test_polygon_fails_with_wrong_parameters(self):... | true | true |
f7039c4f0f970d872e14754af77e13a6dcf2b429 | 207 | py | Python | module10-writing.api.with.flask/utility/rest.py | deepcloudlabs/dcl162-2020-sep-02 | abd21c59d89985e9f5922df65fd1a5ccab019de4 | [
"MIT"
] | null | null | null | module10-writing.api.with.flask/utility/rest.py | deepcloudlabs/dcl162-2020-sep-02 | abd21c59d89985e9f5922df65fd1a5ccab019de4 | [
"MIT"
] | null | null | null | module10-writing.api.with.flask/utility/rest.py | deepcloudlabs/dcl162-2020-sep-02 | abd21c59d89985e9f5922df65fd1a5ccab019de4 | [
"MIT"
] | null | null | null | def convert_request_to_dictionary(request, fields):
emp = {}
for field in fields:
if field in request.json:
emp[field] = request.json[field]
del emp["identity"]
return emp | 29.571429 | 51 | 0.63285 | def convert_request_to_dictionary(request, fields):
emp = {}
for field in fields:
if field in request.json:
emp[field] = request.json[field]
del emp["identity"]
return emp | true | true |
f7039caff8ee44c13e6b74d8f1920cff661c5ead | 481 | py | Python | manuscript/tools/play.py | anterokangas/ManuscriptManagerOld | 194bc6c7b899bb4ab61966af3ba1e619fc74c20c | [
"MIT"
] | null | null | null | manuscript/tools/play.py | anterokangas/ManuscriptManagerOld | 194bc6c7b899bb4ab61966af3ba1e619fc74c20c | [
"MIT"
] | null | null | null | manuscript/tools/play.py | anterokangas/ManuscriptManagerOld | 194bc6c7b899bb4ab61966af3ba1e619fc74c20c | [
"MIT"
] | null | null | null | import os
from pydub import playback
from playsound import playsound
from simpleaudio import play_buffer
import winsound
from manuscript.tools.counter import Counter
def play_sound(sound, block=True):
if sound is not None:
prefix = "tmp"
with Counter(prefix) as counter:
tmp_file = os.... | 26.722222 | 73 | 0.673597 | import os
from pydub import playback
from playsound import playsound
from simpleaudio import play_buffer
import winsound
from manuscript.tools.counter import Counter
def play_sound(sound, block=True):
if sound is not None:
prefix = "tmp"
with Counter(prefix) as counter:
tmp_file = os.... | true | true |
f7039ccc97e8de2fedf8a71747166960ca9d7503 | 429 | py | Python | TelegramBot/utility.py | Otkuda/telebot | 5bbd901c74340922e349f5ac372ce238eb682877 | [
"CC0-1.0"
] | null | null | null | TelegramBot/utility.py | Otkuda/telebot | 5bbd901c74340922e349f5ac372ce238eb682877 | [
"CC0-1.0"
] | null | null | null | TelegramBot/utility.py | Otkuda/telebot | 5bbd901c74340922e349f5ac372ce238eb682877 | [
"CC0-1.0"
] | null | null | null | from telegram import ReplyKeyboardMarkup, KeyboardButton
def get_keyboard():
contact_button = KeyboardButton('Отправить контакты', request_contact=True)
location_button = KeyboardButton('Отправить локацию', request_location=True)
my_keyboard = ReplyKeyboardMarkup([['Анекдот', 'Начать'],
... | 47.666667 | 97 | 0.706294 | from telegram import ReplyKeyboardMarkup, KeyboardButton
def get_keyboard():
contact_button = KeyboardButton('Отправить контакты', request_contact=True)
location_button = KeyboardButton('Отправить локацию', request_location=True)
my_keyboard = ReplyKeyboardMarkup([['Анекдот', 'Начать'],
... | true | true |
f7039eb952f4df789dbf533948f40ffcbf2abfb4 | 28,246 | py | Python | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | llvm/torch-mlir | 2b1b0f6e1970c9db13caea2515070c61d4dee167 | [
"Apache-2.0"
] | 213 | 2021-09-24T03:26:53.000Z | 2022-03-30T07:11:48.000Z | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | llvm/torch-mlir | 2b1b0f6e1970c9db13caea2515070c61d4dee167 | [
"Apache-2.0"
] | 247 | 2021-09-23T18:49:45.000Z | 2022-03-31T17:19:02.000Z | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | llvm/torch-mlir | 2b1b0f6e1970c9db13caea2515070c61d4dee167 | [
"Apache-2.0"
] | 68 | 2021-09-23T18:23:20.000Z | 2022-03-29T11:18:58.000Z | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
"""Queries the pytorch op registry and generates ODS and CC sourc... | 47.234114 | 128 | 0.568434 |
from typing import List, Optional, TextIO
import argparse
import logging
import os
import sys
from .utils import TextEmitter
from .registry import Registry, JitOperator
TORCH_TYPE_TO_ODS_TYPE = {
"Tensor": "AnyTorchTensorType",
"Tensor?": "AnyTorchOptionalTensorType",
"Tensor?[]": "AnyTorchListOfO... | true | true |
f7039ed8f3ea00ea4a9006ac8bbcd14458307bde | 2,085 | py | Python | MaixPy/components/micropython/port/src/ulab/micropython-ulab/docs/manual/source/conf.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | 1 | 2020-08-28T20:38:54.000Z | 2020-08-28T20:38:54.000Z | MaixPy/components/micropython/port/src/ulab/micropython-ulab/docs/manual/source/conf.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | null | null | null | MaixPy/components/micropython/port/src/ulab/micropython-ulab/docs/manual/source/conf.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 30.661765 | 79 | 0.667626 |
project = 'micropython-ulab'
copyright = '2019, Zoltán Vörös'
author = 'Zoltán Vörös'
release = '0.26'
extensions = [
]
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
master_doc = 'index'
author=u'Zoltán... | true | true |
f7039f924072b7979a9db1aca50b6ea7282999b5 | 1,613 | py | Python | src/textlabelling/experimentparam.py | aakinlalu/textlabelling | e2c8fe5f68e92d70249d37cd6eb13a3ab046a891 | [
"MIT"
] | 1 | 2021-01-12T01:04:00.000Z | 2021-01-12T01:04:00.000Z | src/textlabelling/experimentparam.py | aakinlalu/textlabelling | e2c8fe5f68e92d70249d37cd6eb13a3ab046a891 | [
"MIT"
] | null | null | null | src/textlabelling/experimentparam.py | aakinlalu/textlabelling | e2c8fe5f68e92d70249d37cd6eb13a3ab046a891 | [
"MIT"
] | null | null | null | import spacy
from spacy.lang.en import English
from spacy.util import minibatch, compounding
from spacy.util import decaying
class ExperimentParam:
def __init__(self, TRAIN_DATA: list, max_batch_sizes: dict, model_type='ner',
dropout_start: float = 0.6, dropout_end: float = 0.2, interval: float =... | 40.325 | 269 | 0.6677 | import spacy
from spacy.lang.en import English
from spacy.util import minibatch, compounding
from spacy.util import decaying
class ExperimentParam:
def __init__(self, TRAIN_DATA: list, max_batch_sizes: dict, model_type='ner',
dropout_start: float = 0.6, dropout_end: float = 0.2, interval: float =... | true | true |
f7039fc4a1a734c44cfbc0383120c8162bc3c829 | 678 | py | Python | Part_3_advanced/m14_metaclass/register_cls/example_2/main.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m14_metaclass/register_cls/example_2/main.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m14_metaclass/register_cls/example_2/main.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | from example_system import serializer
from example_system.bike import Bike
from example_system.human import Human
def run_example() -> None:
krzysztof = Human(name="Krzysztof", age=37)
giant_bike = Bike(brand="Giant", model="Contend AR")
krzysztof_json = serializer.serialize(krzysztof)
print(krzyszto... | 27.12 | 67 | 0.755162 | from example_system import serializer
from example_system.bike import Bike
from example_system.human import Human
def run_example() -> None:
krzysztof = Human(name="Krzysztof", age=37)
giant_bike = Bike(brand="Giant", model="Contend AR")
krzysztof_json = serializer.serialize(krzysztof)
print(krzyszto... | true | true |
f703a0383ac9c6b9d0f7e37d998648f8cfbc1ec4 | 343 | py | Python | other/dingding/dingtalk/api/rest/OapiSmartdeviceBatcheventPostRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiSmartdeviceBatcheventPostRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiSmartdeviceBatcheventPostRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2020.11.25
'''
from dingtalk.api.base import RestApi
class OapiSmartdeviceBatcheventPostRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.device_event_vos = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.smartd... | 22.866667 | 52 | 0.772595 | from dingtalk.api.base import RestApi
class OapiSmartdeviceBatcheventPostRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.device_event_vos = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.smartdevice.batchevent.post'
| true | true |
f703a1141807b8881b25f73ca2ae811357879d80 | 1,032 | py | Python | hermione/module_templates/__IMPLEMENTED_BASE__/src/predict.py | RodrigoATorres/hermione | 6cbed73e309f8025a48f33165d8f29561c6a3cc7 | [
"Apache-2.0"
] | 183 | 2020-06-03T22:43:14.000Z | 2022-03-17T22:39:07.000Z | hermione/file_text/predict.txt | gquaresma89/hermione | c51f5e54a41609099eef48990c7ad7018dcdf41a | [
"Apache-2.0"
] | 31 | 2020-06-03T22:55:18.000Z | 2022-03-27T20:06:17.000Z | hermione/file_text/predict.txt | gquaresma89/hermione | c51f5e54a41609099eef48990c7ad7018dcdf41a | [
"Apache-2.0"
] | 43 | 2020-06-03T22:45:03.000Z | 2021-12-29T19:43:54.000Z | import pandas as pd
import io
from joblib import load
import logging
logging.getLogger().setLevel(logging.INFO)
def generate_data():
new_data = pd.DataFrame({
'Pclass':[3,2,1],
'Sex': ['male', 'female', 'male'],
'Age':[4, 22, 28]
})
return new_data
def load_model():
try:
... | 20.64 | 60 | 0.584302 | import pandas as pd
import io
from joblib import load
import logging
logging.getLogger().setLevel(logging.INFO)
def generate_data():
new_data = pd.DataFrame({
'Pclass':[3,2,1],
'Sex': ['male', 'female', 'male'],
'Age':[4, 22, 28]
})
return new_data
def load_model():
try:
... | true | true |
f703a230af22a6d9ac2792f00e4cc97acc420aa4 | 8,919 | py | Python | src/frico/blocks.py | mmangus/frico | 0d95340a53a7f6da3792fdd241eb3ed986fe894b | [
"MIT"
] | null | null | null | src/frico/blocks.py | mmangus/frico | 0d95340a53a7f6da3792fdd241eb3ed986fe894b | [
"MIT"
] | null | null | null | src/frico/blocks.py | mmangus/frico | 0d95340a53a7f6da3792fdd241eb3ed986fe894b | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from datetime import datetime
from typing import Generic, Type, TypeVar, Union
from .devices import I2CDevice
from .parsers import RegisterParser
from .typing import RegisterState
BlockType = TypeVar("BlockType")
class RegisterBlock(Generic[BlockType], ABC):
"""
Abstract ... | 38.947598 | 79 | 0.659603 | from abc import ABC, abstractmethod
from datetime import datetime
from typing import Generic, Type, TypeVar, Union
from .devices import I2CDevice
from .parsers import RegisterParser
from .typing import RegisterState
BlockType = TypeVar("BlockType")
class RegisterBlock(Generic[BlockType], ABC):
@property
de... | true | true |
f703a27ca290c7545f1f668cdb2157b3fb23e494 | 65 | py | Python | atompack/__init__.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | atompack/__init__.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | atompack/__init__.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | """A flexible Python library for atomic structure generation."""
| 32.5 | 64 | 0.769231 | true | true | |
f703a2b25d1cfdb54a7f8078c6a59380c9101dae | 759 | py | Python | csau/ub/apps/UnifiedBroadcastTest/sim.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | 1 | 2020-02-28T20:35:09.000Z | 2020-02-28T20:35:09.000Z | csau/ub/apps/UnifiedBroadcastTest/sim.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | csau/ub/apps/UnifiedBroadcastTest/sim.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | import sys
import time
from TOSSIM import *
from TossimHelp import *
t = Tossim([])
sf = SerialForwarder(9002)
throttle = Throttle(t, 10)
nodecount = loadLinkModel(t, "linkgain.out")
loadNoiseModel(t, "meyer.txt", nodecount)
# Set debug channels
print "Setting debug channels..."
t.addChannel("printf", sys.stdout);
t... | 22.323529 | 52 | 0.714097 | import sys
import time
from TOSSIM import *
from TossimHelp import *
t = Tossim([])
sf = SerialForwarder(9002)
throttle = Throttle(t, 10)
nodecount = loadLinkModel(t, "linkgain.out")
loadNoiseModel(t, "meyer.txt", nodecount)
print "Setting debug channels..."
t.addChannel("printf", sys.stdout);
t.addChannel("UB.debu... | false | true |
f703a2fda15b537ff3df48a0cd9175e8f5d2f38c | 43,765 | py | Python | seno/rpc/wallet_rpc_api.py | emilson0407/seno-blockchain | fa73fc06639faaacbb82504a6c8698c3bcab57c0 | [
"Apache-2.0"
] | 33 | 2021-06-26T22:50:48.000Z | 2022-02-09T04:31:40.000Z | seno/rpc/wallet_rpc_api.py | emilson0407/seno-blockchain | fa73fc06639faaacbb82504a6c8698c3bcab57c0 | [
"Apache-2.0"
] | 18 | 2021-06-27T17:13:13.000Z | 2022-01-04T11:45:56.000Z | seno/rpc/wallet_rpc_api.py | emilson0407/seno-blockchain | fa73fc06639faaacbb82504a6c8698c3bcab57c0 | [
"Apache-2.0"
] | 19 | 2021-06-26T00:17:08.000Z | 2022-03-15T06:58:21.000Z | import asyncio
import logging
import time
from datetime import datetime
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
from blspy import PrivateKey, G1Element
from seno.cmds.init_funcs import check_keys
from seno.consensus.block_rewards import calculate_base_farmer_reward
from seno.... | 44.476626 | 120 | 0.60882 | import asyncio
import logging
import time
from datetime import datetime
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
from blspy import PrivateKey, G1Element
from seno.cmds.init_funcs import check_keys
from seno.consensus.block_rewards import calculate_base_farmer_reward
from seno.... | true | true |
f703a3ab24005dbecdddfd6bf01d5f0da3cef21d | 1,702 | py | Python | tests/test_networks.py | bee-hive/nested-policy-rl | 56b0be37ed814265cb3ef26ea0a1a62b5cd7f05c | [
"MIT"
] | 1 | 2022-01-28T16:52:40.000Z | 2022-01-28T16:52:40.000Z | tests/test_networks.py | bee-hive/nested-policy-rl | 56b0be37ed814265cb3ef26ea0a1a62b5cd7f05c | [
"MIT"
] | null | null | null | tests/test_networks.py | bee-hive/nested-policy-rl | 56b0be37ed814265cb3ef26ea0a1a62b5cd7f05c | [
"MIT"
] | null | null | null | import torch
import torch.optim as optim
import torch.nn.functional as F
import torch.nn as nn
# import sys
# sys.path.append("../simulated_fqi/")
from simulated_fqi import NFQNetwork, ContrastiveNFQNetwork
import matplotlib.pyplot as plt
import numpy as np
def train(x, y, groups, network, optimizer):
predicted... | 27.901639 | 97 | 0.632197 | import torch
import torch.optim as optim
import torch.nn.functional as F
import torch.nn as nn
from simulated_fqi import NFQNetwork, ContrastiveNFQNetwork
import matplotlib.pyplot as plt
import numpy as np
def train(x, y, groups, network, optimizer):
predicted_q_values = network(x, groups).squeeze()
loss ... | true | true |
f703a3ad013a7914e2e45a7ac2c29a6df6b1ce61 | 381 | py | Python | backend/tw/wsgi.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | backend/tw/wsgi.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | backend/tw/wsgi.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for tw project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_M... | 22.411765 | 78 | 0.779528 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tw.settings")
application = get_wsgi_application()
| true | true |
f703a3c46f875bef0458a54b32b51c5f0011535b | 1,315 | py | Python | libs/utils_torch.py | SixHeo/IVOS-ATNet | 1cf574953a96bd680c518c6362b510fd103ff271 | [
"MIT"
] | 31 | 2020-07-17T09:10:14.000Z | 2022-03-19T06:32:09.000Z | libs/utils_torch.py | SixHeo/IVOS-ATNet | 1cf574953a96bd680c518c6362b510fd103ff271 | [
"MIT"
] | 4 | 2020-09-16T09:50:30.000Z | 2021-11-23T06:34:33.000Z | libs/utils_torch.py | SixHeo/IVOS-ATNet | 1cf574953a96bd680c518c6362b510fd103ff271 | [
"MIT"
] | 3 | 2020-07-17T09:09:38.000Z | 2020-08-08T12:43:43.000Z | import torch
def combine_masks_with_batch(masks, n_obj, th=0.5, return_as_onehot = False):
""" Combine mask for different objects.
Different methods are the following:
* `max_per_pixel`: Computes the final mask taking the pixel with the highest
probability for every object.
# ... | 35.540541 | 84 | 0.607605 | import torch
def combine_masks_with_batch(masks, n_obj, th=0.5, return_as_onehot = False):
marker = torch.argmax(masks, dim=1, keepdim=True)
if not return_as_onehot:
out_mask = torch.unsqueeze(torch.zeros_like(masks)[:,0],1)
for obj_id in range(n_obj):
try :tmp_mask = (... | true | true |
f703a42c92053186384ad6eaafe8ad76c4d7b51e | 120 | py | Python | python/GtBurst/Task.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | 2 | 2019-03-06T15:48:20.000Z | 2020-05-02T15:02:57.000Z | python/GtBurst/Task.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | 5 | 2019-01-23T11:35:41.000Z | 2019-03-29T17:36:19.000Z | python/GtBurst/Task.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | null | null | null | class Task(object):
def __init__(self,name):
self.name = name
pass
def run(self):
pass
| 15 | 36 | 0.533333 | class Task(object):
def __init__(self,name):
self.name = name
pass
def run(self):
pass
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.