hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
796876b0461a1cbc4b1dda031b083f9d07368d53 | 2,736 | bzl | Python | providers.bzl | jakebiesinger-storyhealth/rules_nodejs | 8df86ccb799e4f9f3c4b26174f09b58a89ef3639 | [
"Apache-2.0"
] | 1 | 2020-03-29T21:45:58.000Z | 2020-03-29T21:45:58.000Z | providers.bzl | jakebiesinger-storyhealth/rules_nodejs | 8df86ccb799e4f9f3c4b26174f09b58a89ef3639 | [
"Apache-2.0"
] | null | null | null | providers.bzl | jakebiesinger-storyhealth/rules_nodejs | 8df86ccb799e4f9f3c4b26174f09b58a89ef3639 | [
"Apache-2.0"
] | 1 | 2022-02-02T20:42:16.000Z | 2022-02-02T20:42:16.000Z | # Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 37.479452 | 107 | 0.792763 |
796876f9e5371f583b39c9604facc7cf498a6d3d | 37,990 | py | Python | scripts/overview-generate.py | deeg/libyal | 494a7b596c66da33f304118044a0fa5484a12718 | [
"Apache-2.0"
] | null | null | null | scripts/overview-generate.py | deeg/libyal | 494a7b596c66da33f304118044a0fa5484a12718 | [
"Apache-2.0"
] | null | null | null | scripts/overview-generate.py | deeg/libyal | 494a7b596c66da33f304118044a0fa5484a12718 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Script to automate generation of an overview of the libyal libraries."""
from __future__ import print_function
from __future__ import unicode_literals
import abc
import argparse
import glob
import json
import logging
import os
import string
import sys
try:
import Config... | 30.81103 | 81 | 0.654093 |
7968789657a76b7b6485d03c7c1c35ba234528a0 | 219 | py | Python | project/urls.py | kajala/django-jauth | 9a3681d4d0f030a167649ec6cb7ab5f79a71d00c | [
"MIT"
] | null | null | null | project/urls.py | kajala/django-jauth | 9a3681d4d0f030a167649ec6cb7ab5f79a71d00c | [
"MIT"
] | null | null | null | project/urls.py | kajala/django-jauth | 9a3681d4d0f030a167649ec6cb7ab5f79a71d00c | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from jauth_example.urls import urlpatterns as jauth_example_urlpatterns
urlpatterns = [
path('admin/', admin.site.urls),
] + jauth_example_urlpatterns
| 24.333333 | 71 | 0.799087 |
796878be784bf4a6a1958dc9bf31c9f1407cb700 | 2,688 | py | Python | edna2/tasks/test/ImageQualityIndicators/ImageQualityIndicators_exec_test.py | shibom/edna2 | 31e39b887be88a47bca775cd91310f5a17841bdd | [
"CC0-1.0",
"MIT"
] | null | null | null | edna2/tasks/test/ImageQualityIndicators/ImageQualityIndicators_exec_test.py | shibom/edna2 | 31e39b887be88a47bca775cd91310f5a17841bdd | [
"CC0-1.0",
"MIT"
] | 2 | 2020-04-06T10:39:50.000Z | 2021-04-14T19:24:37.000Z | edna2/tasks/test/ImageQualityIndicators/ImageQualityIndicators_exec_test.py | shibom/edna2 | 31e39b887be88a47bca775cd91310f5a17841bdd | [
"CC0-1.0",
"MIT"
] | 5 | 2019-06-14T07:28:38.000Z | 2021-04-28T13:10:39.000Z | #
# Copyright (c) European Synchrotron Radiation Facility (ESRF)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy,... | 40.119403 | 83 | 0.741443 |
79687933e314423ebc92b7170066f5efc576a17b | 7,312 | gyp | Python | gyp/ports.gyp | MinimalOS-AOSP/platform_external_skia | cf238b46ee368ed3d5b8a346316a431b7dcddbd9 | [
"BSD-3-Clause"
] | 10 | 2016-10-29T11:22:47.000Z | 2019-08-02T02:13:39.000Z | gyp/ports.gyp | MinimalOS-AOSP/platform_external_skia | cf238b46ee368ed3d5b8a346316a431b7dcddbd9 | [
"BSD-3-Clause"
] | null | null | null | gyp/ports.gyp | MinimalOS-AOSP/platform_external_skia | cf238b46ee368ed3d5b8a346316a431b7dcddbd9 | [
"BSD-3-Clause"
] | 11 | 2016-06-08T16:59:40.000Z | 2021-04-18T17:26:04.000Z | # Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Port-specific Skia library code.
{
'targets': [
{
'target_name': 'ports',
'product_name': 'skia_ports',
'type': 'static_library',
'standalone_static_librar... | 33.388128 | 91 | 0.448578 |
79687ca185981f6b2118311980ebfe1e74fa74fd | 4,742 | py | Python | piston/commands/from_shell.py | H4CKY54CK/piston-cli | 6d3a9973bcc4a72f3568d9d809e1c681171fdad4 | [
"MIT"
] | null | null | null | piston/commands/from_shell.py | H4CKY54CK/piston-cli | 6d3a9973bcc4a72f3568d9d809e1c681171fdad4 | [
"MIT"
] | null | null | null | piston/commands/from_shell.py | H4CKY54CK/piston-cli | 6d3a9973bcc4a72f3568d9d809e1c681171fdad4 | [
"MIT"
] | null | null | null | import json
import random
from dataclasses import dataclass
from typing import List
import requests
from piston.colorschemes import scheme_dict, schemes
from piston.utilities.compilers import languages_
from piston.utilities.constants import Shell, init_lexers, lexers_dict, spinners
from piston.utilities.prompt_contin... | 31.825503 | 88 | 0.588148 |
79687d1d6737c6f9e1d2eceeff4918aa1626589d | 2,004 | py | Python | tests/parser/syntax/test_send.py | onlymaresia/vyper | e46466aae2c8cc124fdb403a768551fe4a05bb4b | [
"Apache-2.0"
] | 1,471 | 2017-12-25T05:47:57.000Z | 2019-11-19T07:47:53.000Z | tests/parser/syntax/test_send.py | onlymaresia/vyper | e46466aae2c8cc124fdb403a768551fe4a05bb4b | [
"Apache-2.0"
] | 895 | 2017-12-25T08:18:23.000Z | 2019-11-20T06:29:03.000Z | tests/parser/syntax/test_send.py | onlymaresia/vyper | e46466aae2c8cc124fdb403a768551fe4a05bb4b | [
"Apache-2.0"
] | 321 | 2017-12-25T16:37:21.000Z | 2019-11-15T17:44:06.000Z | import pytest
from vyper import compiler
from vyper.exceptions import InvalidType, TypeMismatch
fail_list = [
(
"""
@external
def foo():
send(1, 2)
""",
InvalidType,
),
(
"""
@external
def foo():
send(0x1234567890123456789012345678901234567890, 2.5)
""",
Inv... | 16.983051 | 96 | 0.63024 |
79687d958ace59f0ed23e0cb451ed0feafe1f287 | 12,418 | py | Python | downstream/finetune/train.py | YihengZhang-CV/Sequence-Contrastive-Learning | f0b1b48731de808694e57da348e366df57dcd8c7 | [
"MIT"
] | 31 | 2020-12-14T13:58:34.000Z | 2022-03-24T02:43:32.000Z | downstream/finetune/train.py | YihengZhang-CV/Sequence-Contrastive-Learning | f0b1b48731de808694e57da348e366df57dcd8c7 | [
"MIT"
] | 4 | 2021-02-26T08:46:39.000Z | 2022-03-26T06:57:25.000Z | downstream/finetune/train.py | YihengZhang-CV/Sequence-Contrastive-Learning | f0b1b48731de808694e57da348e366df57dcd8c7 | [
"MIT"
] | 3 | 2021-02-02T12:54:54.000Z | 2022-01-17T06:48:31.000Z | import argparse
import os
import time
import json
import torch
import torch.backends.cudnn as cudnn
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel
from torchvision import transforms
from seco_util import clip_transforms
from seco_util.util import ClipGaussianBlur, AverageMeter
... | 42.527397 | 140 | 0.642052 |
79687e317717a2b1a7a9f1d320e186a12bc6bb68 | 3,775 | py | Python | util/loss.py | 9xEzreaL/WBC_AttGAN | 32c8f0bd38fb8cc6ebc4b3994031873ea6f47ed4 | [
"MIT"
] | null | null | null | util/loss.py | 9xEzreaL/WBC_AttGAN | 32c8f0bd38fb8cc6ebc4b3994031873ea6f47ed4 | [
"MIT"
] | null | null | null | util/loss.py | 9xEzreaL/WBC_AttGAN | 32c8f0bd38fb8cc6ebc4b3994031873ea6f47ed4 | [
"MIT"
] | null | null | null | from __future__ import print_function
import torch
import torch.nn as nn
class SupConLoss(nn.Module):
"""Supervised Contrastive Learning: https://arxiv.org/pdf/2004.11362.pdf.
It also supports the unsupervised contrastive loss in SimCLR"""
def __init__(self, temperature=0.07, contrast_mode='all',
... | 41.032609 | 80 | 0.60106 |
79687e31bd47d02eddd273344449e009cfea203f | 5,578 | py | Python | tensor2tensor/data_generators/all_problems.py | phamthuonghai/tensor2tensor | 8e5cb262b1f62a84eb948816ad43521c8975ecdb | [
"Apache-2.0"
] | 4 | 2018-11-18T10:07:13.000Z | 2019-12-10T11:18:24.000Z | tensor2tensor/data_generators/all_problems.py | phamthuonghai/tensor2tensor | 8e5cb262b1f62a84eb948816ad43521c8975ecdb | [
"Apache-2.0"
] | null | null | null | tensor2tensor/data_generators/all_problems.py | phamthuonghai/tensor2tensor | 8e5cb262b1f62a84eb948816ad43521c8975ecdb | [
"Apache-2.0"
] | 1 | 2018-11-18T10:09:50.000Z | 2018-11-18T10:09:50.000Z | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 40.42029 | 75 | 0.769093 |
79687e7f434b18e1d36ef9a7d3c9775daf52c9ec | 836 | py | Python | tests/utils_test.py | adrn/exoplanet | 24ee1fc4a7d984295740464888ca3ab9d20edb0a | [
"MIT"
] | null | null | null | tests/utils_test.py | adrn/exoplanet | 24ee1fc4a7d984295740464888ca3ab9d20edb0a | [
"MIT"
] | null | null | null | tests/utils_test.py | adrn/exoplanet | 24ee1fc4a7d984295740464888ca3ab9d20edb0a | [
"MIT"
] | 1 | 2021-12-04T22:27:14.000Z | 2021-12-04T22:27:14.000Z | # -*- coding: utf-8 -*-
import numpy as np
import pymc3 as pm
from exoplanet.utils import eval_in_model, optimize
def test_eval_in_model(seed=123409):
np.random.seed(seed)
x_val = np.random.randn(5, 3)
x_val2 = np.random.randn(5, 3)
with pm.Model():
x = pm.Normal("x", shape=x_val.shape, test... | 27.866667 | 70 | 0.651914 |
79687eab87cb198bf9f2e8ef2de5836ef33895da | 1,885 | py | Python | scvi/dataset/__init__.py | maichmueller/scVI | 95fe13a36f83e2b6390fc47e96a2d17ed1fa318d | [
"MIT"
] | null | null | null | scvi/dataset/__init__.py | maichmueller/scVI | 95fe13a36f83e2b6390fc47e96a2d17ed1fa318d | [
"MIT"
] | null | null | null | scvi/dataset/__init__.py | maichmueller/scVI | 95fe13a36f83e2b6390fc47e96a2d17ed1fa318d | [
"MIT"
] | null | null | null | from scvi.dataset.anndataset import AnnDatasetFromAnnData, DownloadableAnnDataset
from scvi.dataset.brain_large import BrainLargeDataset
from scvi.dataset.cite_seq import CiteSeqDataset, CbmcDataset
from scvi.dataset.cortex import CortexDataset
from scvi.dataset.csv import CsvDataset, BreastCancerDataset, MouseOBDatase... | 28.560606 | 81 | 0.775066 |
79687f3bd4c72113a36b99a404fa88959d71839d | 2,595 | py | Python | lib/surface/bms/volumes/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/bms/volumes/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/bms/volumes/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2021 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 requir... | 33.701299 | 80 | 0.717919 |
79687fb6fb10526acd265410a1145ee31aa05114 | 75 | py | Python | app/application.py | celinegilet/python-kata | bea1e56bf6cb4574200fd5c2688a78608e798975 | [
"MIT"
] | null | null | null | app/application.py | celinegilet/python-kata | bea1e56bf6cb4574200fd5c2688a78608e798975 | [
"MIT"
] | null | null | null | app/application.py | celinegilet/python-kata | bea1e56bf6cb4574200fd5c2688a78608e798975 | [
"MIT"
] | null | null | null | class Application(object):
def say_hello(self):
return "Hello"
| 18.75 | 26 | 0.653333 |
7968809a4aec408e4ee0a4da764466c50fb67fb8 | 13,392 | py | Python | tvsynth/find_adversarial.py | jmaces/robust-nets | 25d49302f9fa5fcc9ded2727de75e96e25243d09 | [
"MIT"
] | 14 | 2020-11-10T07:37:23.000Z | 2022-03-21T15:19:22.000Z | tvsynth/find_adversarial.py | jmaces/robust-nets | 25d49302f9fa5fcc9ded2727de75e96e25243d09 | [
"MIT"
] | null | null | null | tvsynth/find_adversarial.py | jmaces/robust-nets | 25d49302f9fa5fcc9ded2727de75e96e25243d09 | [
"MIT"
] | 2 | 2021-03-13T14:39:36.000Z | 2022-02-17T06:44:29.000Z | import torch
from tqdm import tqdm
from operators import l2_error
# ----- Variable Transforms -----
def identity(x):
return x
def normalized_tanh(x, eps=1e-6):
return (torch.tanh(x) + 1.0) / 2.0
def normalized_atanh(x, eps=1e-6):
x = x * (1 - eps) * 2 - 1
return 0.5 * torch.log((1.0 + x) / (1.... | 32.823529 | 79 | 0.618802 |
796880b78b301c80973b5cbd537ad0502fe6fe95 | 1,161 | py | Python | basic/test14.py | dxxzst/python-test | ab84b541a2374c55714b31d7d4445cda5c914a55 | [
"MIT"
] | null | null | null | basic/test14.py | dxxzst/python-test | ab84b541a2374c55714b31d7d4445cda5c914a55 | [
"MIT"
] | null | null | null | basic/test14.py | dxxzst/python-test | ab84b541a2374c55714b31d7d4445cda5c914a55 | [
"MIT"
] | 1 | 2021-06-01T05:46:51.000Z | 2021-06-01T05:46:51.000Z | import sys
print(sys.argv)
class Fib(object):
def __init__(self):
self.a, self.b = 0, 1
def __str__(self):
return "fib class"
__repr__ = __str__
def __iter__(self):
return self
def __next__(self):
self.a, self.b = self.b, self.a + self.b
if self.a > 100... | 19.677966 | 48 | 0.470284 |
7968811b65a479b2b6d7c69230111877d279a752 | 43 | py | Python | typereader/__init__.py | MickaelRigault/typereader | 84efeb3046a7881c5d8ff840094c9aadb7ede65a | [
"Apache-2.0"
] | null | null | null | typereader/__init__.py | MickaelRigault/typereader | 84efeb3046a7881c5d8ff840094c9aadb7ede65a | [
"Apache-2.0"
] | null | null | null | typereader/__init__.py | MickaelRigault/typereader | 84efeb3046a7881c5d8ff840094c9aadb7ede65a | [
"Apache-2.0"
] | null | null | null | __version__ = "0.1.1"
from .snid import *
| 10.75 | 21 | 0.651163 |
79688130a368187f88a740e4442271f79d3dbc49 | 3,381 | py | Python | homeassistant/components/media_player/reproduce_state.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/media_player/reproduce_state.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/media_player/reproduce_state.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Module that groups code required to handle state restore for component."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable
from typing import Any
from homeassistant.const import (
SERVICE_MEDIA_PAUSE,
SERVICE_MEDIA_PLAY,
SERVICE_MEDIA_STOP,
SERVICE_TURN_OFF,
... | 27.942149 | 81 | 0.680568 |
796881f0e188d37a1a93a5d488aee1600b34d32e | 1,120 | py | Python | String/leetCode_125.py | StitchIQ/leetCode_step | d22b1caf4937bc6b5c17249d18f8583e97bfca5d | [
"MIT"
] | null | null | null | String/leetCode_125.py | StitchIQ/leetCode_step | d22b1caf4937bc6b5c17249d18f8583e97bfca5d | [
"MIT"
] | null | null | null | String/leetCode_125.py | StitchIQ/leetCode_step | d22b1caf4937bc6b5c17249d18f8583e97bfca5d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/10/18 14:21
# @File : leetCode_125.py
class Solution(object):
def isPalindrome(self, s):
"""
:type s: str
:rtype: bool
"""
# s = s.lower()
# temp = s[::-1]
# print(s)
# print(temp)
... | 26.666667 | 61 | 0.35 |
7968826e4e1383a8ecf271f10e494319bda13a6c | 588 | py | Python | person/btyang/stock/TryWork/TestMain/Test.py | bluesheepcj/WorkWork | 598baf9c7ec8f17089954f18a4135f69b53af670 | [
"Apache-2.0"
] | null | null | null | person/btyang/stock/TryWork/TestMain/Test.py | bluesheepcj/WorkWork | 598baf9c7ec8f17089954f18a4135f69b53af670 | [
"Apache-2.0"
] | null | null | null | person/btyang/stock/TryWork/TestMain/Test.py | bluesheepcj/WorkWork | 598baf9c7ec8f17089954f18a4135f69b53af670 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import re
# 将正则表达式编译成Pattern对象
pattern = re.compile(r'(SH[\w\W]+)\.csv')
# pattern = re.compile(r'ˆSH')
# 使用Pattern匹配文本,获得匹配结果,无法匹配时将返回None
match = pattern.match('SHfjdfj984r3.csv')
if match:
# 使用Match获得分组信息
print(match.group(1));
### 输出 ###
# hello
mat = np.zeros((1,3));
mat=mat+1;
pri... | 19.6 | 47 | 0.687075 |
796882a1ff79039e9b84c40e277c74f8475373ba | 1,095 | py | Python | tests/structs/vector.py | dineshks1/dissononce | 154297aba0e9fdedad9279278f748bd8e4f790c6 | [
"MIT"
] | 34 | 2019-04-18T03:35:51.000Z | 2022-03-20T13:35:04.000Z | tests/structs/vector.py | mgp25/noise | 8560849fa4a1d6e938adde27d26572f4da16e422 | [
"MIT"
] | 2 | 2019-04-24T06:42:33.000Z | 2019-07-17T19:40:40.000Z | tests/structs/vector.py | mgp25/noise | 8560849fa4a1d6e938adde27d26572f4da16e422 | [
"MIT"
] | 16 | 2019-05-02T08:29:17.000Z | 2021-12-06T22:50:37.000Z | from tests.structs.vectorvars import VectorVars
from tests.structs.vectormessage import VectorMessage
class Vector(object):
def __init__(self, init_vectorvars, resp_vectorvars, handshake_hash, messages):
"""
:param init_vectorvars:
:type init_vectorvars: VectorVars
:param resp_vect... | 29.594595 | 83 | 0.679452 |
796882a8c4fe2b97c05761be9b686f60910959e6 | 391 | py | Python | domains/env_test.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 5 | 2020-10-15T14:40:03.000Z | 2021-08-20T17:45:41.000Z | domains/env_test.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | null | null | null | domains/env_test.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 2 | 2020-10-15T07:06:14.000Z | 2020-10-15T17:33:01.000Z | import numpy
from domain_constants import *
from domain_test import *
from state import state, rv
import random
commandProb = {
'c1': [0.8, 0.2],
'c2': [0.5, 0.5],
'c3': [0.9, 0.1],
}
def Sense(cmd, d=None):
p = commandProb[cmd]
outcome = numpy.random.choice(len(p), 50, p=p)
res = outcome[0]
... | 19.55 | 50 | 0.590793 |
796883037fda927af12a1ff88e0f9ecb60fb9602 | 10,204 | py | Python | chartesians/graphicsconstants.py | femtotrader/pythalesians | febdfbabc9f99b0ae3eb0b20ce4c5ed6a34c0bbb | [
"Apache-2.0"
] | 22 | 2017-06-04T21:05:18.000Z | 2022-01-22T19:01:43.000Z | chartesians/graphicsconstants.py | faruto/pythalesians | febdfbabc9f99b0ae3eb0b20ce4c5ed6a34c0bbb | [
"Apache-2.0"
] | null | null | null | chartesians/graphicsconstants.py | faruto/pythalesians | febdfbabc9f99b0ae3eb0b20ce4c5ed6a34c0bbb | [
"Apache-2.0"
] | 11 | 2016-10-06T21:25:20.000Z | 2020-07-08T19:13:35.000Z | __author__ = 'saeedamen' # Saeed Amen / saeed@thalesians.com
#
# Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians
#
# 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://... | 35.929577 | 154 | 0.50098 |
7968833a2d55bb16248f5bd5bc35df7e9906266c | 439 | py | Python | LearnPython/pythonFlow.py | ChallengerCY/Python-PythonBasic | 37f0b498b5df4cf9899023b8eec41d6e3297fe74 | [
"Apache-2.0"
] | 1 | 2021-05-06T03:36:10.000Z | 2021-05-06T03:36:10.000Z | LearnPython/pythonFlow.py | ChallengerCY/Python-PythonBasic | 37f0b498b5df4cf9899023b8eec41d6e3297fe74 | [
"Apache-2.0"
] | null | null | null | LearnPython/pythonFlow.py | ChallengerCY/Python-PythonBasic | 37f0b498b5df4cf9899023b8eec41d6e3297fe74 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# python 中的if elif else
score=-1
if score<=100:
if score>=0:
if score==100:
print ("满分")
elif score >= 90:
print ("很优秀")
elif score >= 80:
print ("优秀")
elif score>=70:
print ("良好")
elif score>=60:
pr... | 19.954545 | 25 | 0.430524 |
796883a6d386299a4b01fad32ad84b9caef9f4c5 | 604 | py | Python | tests/gsl/blas_dtrsv.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/gsl/blas_dtrsv.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/gsl/blas_dtrsv.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2018 all rights reserved
#
"""
Exercise {dtrsv}
"""
def test():
# get the package
import gsl
# the vector x
x = gsl.vector(shape=3)
x[0], x[1], x[2] = 1,2,3
# the matrix A
A = gsl.matrix(shap... | 14.380952 | 82 | 0.567881 |
796885708974626f10a131d2520d40b44ba461f1 | 1,292 | py | Python | jocasta/connectors/io_adafruit.py | chrishannam/zeep | c77de9dfeb093c53686d9aba7b072764f93921cb | [
"MIT"
] | null | null | null | jocasta/connectors/io_adafruit.py | chrishannam/zeep | c77de9dfeb093c53686d9aba7b072764f93921cb | [
"MIT"
] | 1 | 2020-09-13T23:24:41.000Z | 2020-09-13T23:24:41.000Z | jocasta/connectors/io_adafruit.py | chrishannam/zeep | c77de9dfeb093c53686d9aba7b072764f93921cb | [
"MIT"
] | 1 | 2020-11-11T06:03:32.000Z | 2020-11-11T06:03:32.000Z | """
Module for sending data to https://io.adafruit.com/, checkout
https://io.adafruit.com/api/docs/ for more information on the adafruit service.
Example ~/.config/jocasta_config.ini:
[io_adafruit]
username = username
key = api_key_from_adafruit_site
# names of the feeds configured on io.adafruit.com
feeds = office.... | 28.086957 | 87 | 0.702012 |
7968861fef2fe43da67861294bc994a306bc338f | 8,172 | py | Python | tests/core/report_test.py | thanhlelgg/golem | 5245c880d00d40c57581a7397a606359fb37cd59 | [
"MIT"
] | null | null | null | tests/core/report_test.py | thanhlelgg/golem | 5245c880d00d40c57581a7397a606359fb37cd59 | [
"MIT"
] | null | null | null | tests/core/report_test.py | thanhlelgg/golem | 5245c880d00d40c57581a7397a606359fb37cd59 | [
"MIT"
] | null | null | null | import os
import json
from golem.core import report, utils
from golem.test_runner import test_runner
class Test_create_execution_directory:
def test_create_execution_directory_test(self, project_session):
project = project_session['name']
testdir = project_session['testdir']
timestamp = ... | 39.669903 | 82 | 0.538669 |
7968862aa807e622f8807628ec0fc3d245b0138e | 165,310 | py | Python | pyfos/pyfos_rest_util.py | madhavinaiduprathap/pyfosbrocade | ec100e77c441761c3e688f1d8e5d18ad38cc83f4 | [
"Apache-2.0"
] | null | null | null | pyfos/pyfos_rest_util.py | madhavinaiduprathap/pyfosbrocade | ec100e77c441761c3e688f1d8e5d18ad38cc83f4 | [
"Apache-2.0"
] | null | null | null | pyfos/pyfos_rest_util.py | madhavinaiduprathap/pyfosbrocade | ec100e77c441761c3e688f1d8e5d18ad38cc83f4 | [
"Apache-2.0"
] | null | null | null | # Copyright © 2018 Broadcom. All rights reserved.
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may also obtain a copy of the License at
# http://www.apa... | 41.629313 | 390 | 0.55333 |
7968867df60efa172252474e03ef03643fc76ae6 | 986 | py | Python | scripts/train_resnet50.py | hungjinh/galaxyZooNet | b18a72ddaaf5ea24377d089d2288546e967dcf5f | [
"MIT"
] | 2 | 2021-09-01T17:22:16.000Z | 2021-09-05T09:06:56.000Z | scripts/train_resnet50.py | hungjinh/galaxyZooNet | b18a72ddaaf5ea24377d089d2288546e967dcf5f | [
"MIT"
] | null | null | null | scripts/train_resnet50.py | hungjinh/galaxyZooNet | b18a72ddaaf5ea24377d089d2288546e967dcf5f | [
"MIT"
] | null | null | null | import os
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(dir_path+'/..')
from galaxyZooNet.resnet50_classifier import ResNet50_Classifier
from galaxyZooNet.utils import get_config_from_yaml
def main(args=None):
'''
Usage:
run a test (on genie)
>> ... | 29.878788 | 95 | 0.687627 |
796886e7b1d9ce2361c5d3529ef257847e168f12 | 2,801 | py | Python | setup.py | cc-archive/deedscraper | 8c71ba8143a408d180a94f715cebb5363c9b6033 | [
"MIT"
] | 1 | 2017-12-25T14:43:21.000Z | 2017-12-25T14:43:21.000Z | setup.py | creativecommons/deedscraper | 8c71ba8143a408d180a94f715cebb5363c9b6033 | [
"MIT"
] | 1 | 2021-04-08T18:15:17.000Z | 2021-04-08T18:15:21.000Z | setup.py | cc-archive/deedscraper | 8c71ba8143a408d180a94f715cebb5363c9b6033 | [
"MIT"
] | 3 | 2015-04-28T10:21:07.000Z | 2019-02-08T15:52:30.000Z | ## Copyright (c) 2007-2008 Nathan R. Yergler, John E. Doig III Creative Commons
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the "Software"),
## to deal in the Software without restriction, including without limitation
## the ri... | 35.455696 | 79 | 0.605498 |
796888adbf11d053ca0a97fa4dfa76a16d101122 | 342 | py | Python | memoization_explicit_demo.py | zdenek-nemec/python-tutorial-socratica | d09deef45b7a7982814e5e564cf4265cdbe01aca | [
"MIT"
] | 1 | 2019-09-30T19:55:53.000Z | 2019-09-30T19:55:53.000Z | memoization_explicit_demo.py | zdenek-nemec/python-tutorial-socratica | d09deef45b7a7982814e5e564cf4265cdbe01aca | [
"MIT"
] | null | null | null | memoization_explicit_demo.py | zdenek-nemec/python-tutorial-socratica | d09deef45b7a7982814e5e564cf4265cdbe01aca | [
"MIT"
] | null | null | null | fibonacci_cache = {}
def fibonacci(n):
if n in fibonacci_cache:
return fibonacci_cache[n]
if n == 1:
value = 1
elif n == 2:
value = 1
elif n > 2:
value = fibonacci(n-1) + fibonacci(n-2)
fibonacci_cache[n] = value
return value
for n in range (1, 10):
print(... | 18 | 47 | 0.546784 |
796889da2ea77bc1fb3015e4d8c2efeebb007766 | 2,881 | py | Python | Bio/triefind.py | rht/biopython | 3a44496d7bd79446266a4951b7d1f64569e4a96d | [
"BSD-3-Clause"
] | 3 | 2021-08-17T15:28:41.000Z | 2022-02-12T06:43:22.000Z | Bio/triefind.py | rht/biopython | 3a44496d7bd79446266a4951b7d1f64569e4a96d | [
"BSD-3-Clause"
] | 32 | 2016-11-21T07:38:21.000Z | 2017-08-16T13:00:03.000Z | Bio/triefind.py | rht/biopython | 3a44496d7bd79446266a4951b7d1f64569e4a96d | [
"BSD-3-Clause"
] | 8 | 2016-11-24T18:57:35.000Z | 2022-01-16T08:15:25.000Z | # This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
"""Given a trie, find all occurrences of a word in the trie in a string.
Like searching a string for a substring, except that the substring is
any w... | 28.245098 | 78 | 0.620965 |
79688a13c171dad01a8acaa06f514f1f6d86f572 | 4,089 | py | Python | test/kernels/test_polynomial_kernel.py | techshot25/gpytorch | b4aee6f81a3428172d4914e7e0fef0e71cd1f519 | [
"MIT"
] | 1 | 2019-11-08T11:25:56.000Z | 2019-11-08T11:25:56.000Z | test/kernels/test_polynomial_kernel.py | VonRosenchild/gpytorch | 092d523027a844939ba85d7ea8c8c7b7511843d5 | [
"MIT"
] | null | null | null | test/kernels/test_polynomial_kernel.py | VonRosenchild/gpytorch | 092d523027a844939ba85d7ea8c8c7b7511843d5 | [
"MIT"
] | 1 | 2021-07-02T19:40:07.000Z | 2021-07-02T19:40:07.000Z | #!/usr/bin/env python3
import torch
import unittest
from gpytorch.kernels import PolynomialKernel
from gpytorch.test.base_kernel_test_case import BaseKernelTestCase
class TestPolynomialKernel(unittest.TestCase, BaseKernelTestCase):
def create_kernel_no_ard(self, **kwargs):
return PolynomialKernel(power=2... | 37.172727 | 107 | 0.565664 |
79688a543cfc3aa0656b4cbaec103b5ce20d3f35 | 2,076 | bzl | Python | version.bzl | johnedmonds/kythe | f775502ba34332cd0f17c343fd084b5ed6bde68e | [
"Apache-2.0"
] | 703 | 2018-11-05T22:51:58.000Z | 2022-03-31T21:54:22.000Z | version.bzl | johnedmonds/kythe | f775502ba34332cd0f17c343fd084b5ed6bde68e | [
"Apache-2.0"
] | 720 | 2018-11-05T21:29:49.000Z | 2022-03-29T19:43:50.000Z | version.bzl | johnedmonds/kythe | f775502ba34332cd0f17c343fd084b5ed6bde68e | [
"Apache-2.0"
] | 99 | 2018-11-06T22:20:08.000Z | 2022-03-16T12:50:35.000Z | # Minimum supported Bazel version. Should match .bazelminversion file.
MIN_VERSION = "4.0.0"
# Maximum supported Bazel version. Should match .bazelversion file.
MAX_VERSION = "4.2.0"
def _tuplicate(value, delim):
rv = ()
for field in value.split(delim):
if field.isdigit():
rv += (int(fie... | 34.032787 | 116 | 0.641137 |
79688b23538a17930671a0f58eefbcfbe1569e8a | 9,158 | py | Python | src/roslaunch2/__init__.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 10 | 2019-11-19T12:35:30.000Z | 2022-01-16T15:59:44.000Z | src/roslaunch2/__init__.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 1 | 2022-01-11T09:30:36.000Z | 2022-02-07T22:03:36.000Z | src/roslaunch2/__init__.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 3 | 2019-08-01T08:50:00.000Z | 2021-05-02T01:27:47.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Adrian Böckenkamp
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
# Date: 24/10/2021
# Import all submodules typically used in launch modules:
from .group import *
from .parameter import *
from .machine import *
from .package import *
from .lo... | 38.805085 | 120 | 0.666849 |
79688be9d0a674dc9bbc9e73611d3ce3d8acc983 | 108,340 | py | Python | src/sage/rings/padics/factory.py | robertwb/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | src/sage/rings/padics/factory.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | src/sage/rings/padics/factory.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | """
Factory
This file contains the constructor classes and functions for `p`-adic rings and fields.
AUTHORS:
- David Roe
"""
#*****************************************************************************
# Copyright (C) 2007-2013 David Roe <roed.math@gmail.com>
# William Stein <w... | 42.653543 | 328 | 0.56774 |
79688bfbbd3fa8ffc22fd5c37fb49163356c9313 | 723 | py | Python | Jumpscale/clients/kraken/karkenClient.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 2 | 2019-05-09T07:21:25.000Z | 2019-08-05T06:37:53.000Z | Jumpscale/clients/kraken/karkenClient.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 664 | 2018-12-19T12:43:44.000Z | 2019-08-23T04:24:42.000Z | Jumpscale/clients/kraken/karkenClient.py | threefoldtech/jumpscale10 | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 7 | 2019-05-03T07:14:37.000Z | 2019-08-05T12:36:52.000Z | from Jumpscale import j
import krakenex
from pykrakenapi import KrakenAPI
JSConfigClient = j.application.JSBaseConfigClass
class KrakenClient(JSConfigClient):
_SCHEMATEXT = """
@url = jumpscale.kraken.clients
name* = "" (S)
api_key_ = "" (S)
private_key_ = "" (S)
"""
... | 24.1 | 48 | 0.629322 |
79688d5964946874296ef09d272af632bc3569d7 | 809 | py | Python | 5_dictionary.py | onowdev/python-selflearning | 3d7245de0207a5bfcbce4f7adde60e7316b70a8e | [
"MIT"
] | null | null | null | 5_dictionary.py | onowdev/python-selflearning | 3d7245de0207a5bfcbce4f7adde60e7316b70a8e | [
"MIT"
] | null | null | null | 5_dictionary.py | onowdev/python-selflearning | 3d7245de0207a5bfcbce4f7adde60e7316b70a8e | [
"MIT"
] | null | null | null | """
Python Dictionary
Python's dictionaries are kind of hash-table type.
They work like associative arrays or hashes found in
Perl and consist of key-value pairs. A dictionary key
can be almost any Python type, but are usually numbers
or strings. Values, on the other hand, can be any arbitrary
Python object.
Dic... | 31.115385 | 60 | 0.721879 |
79688dcb2cdd24e800482d0b29cdf900f170f98f | 636 | py | Python | venv/Lib/site-packages/IPython/utils/zmqrelated.py | Kiiwi/Syssel | 83705e3fd0edf40f09df950d5ce91c95586573f5 | [
"BSD-3-Clause"
] | 1 | 2017-12-30T20:43:28.000Z | 2017-12-30T20:43:28.000Z | venv/Lib/site-packages/IPython/utils/zmqrelated.py | Kiiwi/Syssel | 83705e3fd0edf40f09df950d5ce91c95586573f5 | [
"BSD-3-Clause"
] | 7 | 2021-02-08T20:22:15.000Z | 2022-03-11T23:19:41.000Z | venv/Lib/site-packages/IPython/utils/zmqrelated.py | Kiiwi/Syssel | 83705e3fd0edf40f09df950d5ce91c95586573f5 | [
"BSD-3-Clause"
] | null | null | null | """Utilities for checking zmq versions."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from IPython.utils.version import check_version
def check_for_zmq(minimum_version, required_by='Someone'):
try:
import zmq
except ImportError:
raise ... | 31.8 | 83 | 0.693396 |
79688f8f2509f4bd271edea4a72b9c04684fa163 | 922 | py | Python | src/pathmanager/tool.py | duguhaotian/superscp | 2a2fe9737c7df41e787be72af6b55c156d93bc87 | [
"Apache-2.0"
] | null | null | null | src/pathmanager/tool.py | duguhaotian/superscp | 2a2fe9737c7df41e787be72af6b55c156d93bc87 | [
"Apache-2.0"
] | null | null | null | src/pathmanager/tool.py | duguhaotian/superscp | 2a2fe9737c7df41e787be72af6b55c156d93bc87 | [
"Apache-2.0"
] | null | null | null | import netifaces
def get_ips():
ips={}
for itf in netifaces.interfaces():
if itf == "lo" or itf == "docker0" or itf == "virbr0":
continue
ip = get_ip(itf)
if ip != None:
ips[itf] = ip
return ips
def get_ip(interface):
try:
addrs = netifaces.ifad... | 29.741935 | 62 | 0.60846 |
7968901af892eb2808a3c8de9cd020fba5cafb79 | 3,321 | py | Python | support_files/scraping/entries/proj_2011/proj_2011/settings.py | miccaldas/new_rss | 9580887ac44b5c3e4c4ed5045478f2c7fef36afe | [
"MIT"
] | null | null | null | support_files/scraping/entries/proj_2011/proj_2011/settings.py | miccaldas/new_rss | 9580887ac44b5c3e4c4ed5045478f2c7fef36afe | [
"MIT"
] | null | null | null | support_files/scraping/entries/proj_2011/proj_2011/settings.py | miccaldas/new_rss | 9580887ac44b5c3e4c4ed5045478f2c7fef36afe | [
"MIT"
] | null | null | null | # Scrapy settings for proj_2011 project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middlewa... | 35.329787 | 103 | 0.777176 |
79689027eb4bb65e3eaac03b6188a34366611e53 | 407 | py | Python | build/scripts/with_pathsep_resolve.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 33 | 2016-12-15T21:47:13.000Z | 2020-10-27T23:53:59.000Z | build/scripts/with_pathsep_resolve.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | null | null | null | build/scripts/with_pathsep_resolve.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 14 | 2016-12-28T17:00:33.000Z | 2022-01-16T20:15:27.000Z | import sys
import os
def fix_args(args):
just_replace_it = False
for arg in args:
if arg == '--fix-path-sep':
just_replace_it = True
continue
if just_replace_it:
arg = arg.replace('::', os.pathsep)
just_replace_it = False
yield arg
if __... | 21.421053 | 47 | 0.560197 |
79689037367c9be155211293284dc01979b03500 | 5,401 | py | Python | absl/copts/copts.py | wrightsg/abseil-cpp | f197d7c72a54064cfde5a2058f1513a4a0ee36fb | [
"Apache-2.0"
] | 1 | 2020-06-22T02:40:07.000Z | 2020-06-22T02:40:07.000Z | absl/copts/copts.py | wrightsg/abseil-cpp | f197d7c72a54064cfde5a2058f1513a4a0ee36fb | [
"Apache-2.0"
] | null | null | null | absl/copts/copts.py | wrightsg/abseil-cpp | f197d7c72a54064cfde5a2058f1513a4a0ee36fb | [
"Apache-2.0"
] | null | null | null | """Abseil compiler options.
This is the source of truth for Abseil compiler options. To modify Abseil
compilation options:
(1) Edit the appropriate list in this file.
(2) Run `<path_to_absl>/copts/generate_copts.py`.
The generated copts are consumed by configure_copts.bzl and
AbseilConfigureCopts.cmake.
"""
im... | 34.401274 | 80 | 0.586003 |
7968922019c1478e87cd53af26fd74884d97bc92 | 31,586 | py | Python | sktime/utils/tests/test_data_loading.py | brettkoonce/sktime | 6336247bad0dac8692aa4b911c267f401dea4163 | [
"BSD-3-Clause"
] | 2 | 2020-10-05T12:17:41.000Z | 2020-10-19T08:57:50.000Z | sktime/utils/tests/test_data_loading.py | brettkoonce/sktime | 6336247bad0dac8692aa4b911c267f401dea4163 | [
"BSD-3-Clause"
] | 2 | 2020-04-20T12:26:42.000Z | 2020-04-22T17:09:14.000Z | sktime/utils/tests/test_data_loading.py | brettkoonce/sktime | 6336247bad0dac8692aa4b911c267f401dea4163 | [
"BSD-3-Clause"
] | 1 | 2022-02-14T18:19:01.000Z | 2022-02-14T18:19:01.000Z | import os
import tempfile
import numpy as np
from sktime.utils.load_data import TsFileParseException
from sktime.utils.load_data import load_from_tsfile_to_dataframe
def test_load_from_tsfile_to_dataframe():
"""Test the load_from_tsfile_to_dataframe() function.
"""
# Test that an empty file is classed a... | 34.369967 | 79 | 0.529728 |
79689257fd4e0ec51095bba4fa3533cc3e310f6e | 1,452 | py | Python | python-sdk/tutorials/automl-with-azureml/continuous-retraining/check_data.py | 0mza987/azureml-examples | 2abb872f1278d4b4e65587e033f38a058512b2e3 | [
"MIT"
] | 331 | 2020-08-26T15:54:23.000Z | 2022-03-31T17:10:58.000Z | python-sdk/tutorials/automl-with-azureml/continuous-retraining/check_data.py | 0mza987/azureml-examples | 2abb872f1278d4b4e65587e033f38a058512b2e3 | [
"MIT"
] | 262 | 2020-08-25T23:17:17.000Z | 2022-03-31T00:25:32.000Z | python-sdk/tutorials/automl-with-azureml/continuous-retraining/check_data.py | 0mza987/azureml-examples | 2abb872f1278d4b4e65587e033f38a058512b2e3 | [
"MIT"
] | 307 | 2020-09-04T01:02:11.000Z | 2022-03-31T16:46:48.000Z | import argparse
import os
import azureml.core
from datetime import datetime
import pandas as pd
import pytz
from azureml.core import Dataset, Model
from azureml.core.run import Run, _OfflineRun
from azureml.core import Workspace
run = Run.get_context()
ws = None
if type(run) == _OfflineRun:
ws = Works... | 30.893617 | 89 | 0.726584 |
7968929e8e9eea94d09b7f465fa07a42a82d37c5 | 201 | py | Python | app/database/__init__.py | TartuNLP/speech-to-text-api | 7ec5222bea3710311ff91e81af374e985d39ab5d | [
"MIT"
] | null | null | null | app/database/__init__.py | TartuNLP/speech-to-text-api | 7ec5222bea3710311ff91e81af374e985d39ab5d | [
"MIT"
] | null | null | null | app/database/__init__.py | TartuNLP/speech-to-text-api | 7ec5222bea3710311ff91e81af374e985d39ab5d | [
"MIT"
] | null | null | null | from .session import get_session, db_engine, session_maker
from .base import Base
from .models import Job
from .crud import create_job, read_job, update_job, delete_job
from .cleanup import db_cleanup
| 33.5 | 62 | 0.825871 |
796893164f40075799f2973996f5617c90ea7957 | 166 | py | Python | src/prefect/tasks/jira/__init__.py | suryatmodulus/prefect | e4ac9f6aa831140c7fba0397f3e5e0884b1b9e42 | [
"Apache-2.0"
] | 3 | 2021-11-09T10:46:58.000Z | 2022-03-11T04:22:35.000Z | src/prefect/tasks/jira/__init__.py | suryatmodulus/prefect | e4ac9f6aa831140c7fba0397f3e5e0884b1b9e42 | [
"Apache-2.0"
] | 8 | 2021-10-11T16:42:59.000Z | 2022-03-31T08:42:24.000Z | src/prefect/tasks/jira/__init__.py | suryatmodulus/prefect | e4ac9f6aa831140c7fba0397f3e5e0884b1b9e42 | [
"Apache-2.0"
] | 1 | 2022-03-11T04:22:40.000Z | 2022-03-11T04:22:40.000Z | from prefect.tasks.jira.jira_task import JiraTask
from prefect.tasks.jira.jira_service_desk import JiraServiceDeskTask
__all__ = ["JiraServiceDeskTask", "JiraTask"]
| 33.2 | 68 | 0.837349 |
796893215d001e28cfaae91b0549cbe31ba82de9 | 3,413 | py | Python | main.py | ssd-ls-a/htwk_pdf_knowledge_base | 46a7fa42455f6ad6df074423d677bb13bffa0f94 | [
"MIT"
] | null | null | null | main.py | ssd-ls-a/htwk_pdf_knowledge_base | 46a7fa42455f6ad6df074423d677bb13bffa0f94 | [
"MIT"
] | 1 | 2022-01-19T10:34:53.000Z | 2022-01-19T10:34:53.000Z | main.py | ssd-ls-a/htwk_pdf_knowledge_base | 46a7fa42455f6ad6df074423d677bb13bffa0f94 | [
"MIT"
] | null | null | null | import argparse
import os
import re
from tqdm import tqdm
def make_md_file(file_name, target_dir, link_dict, tag_dict):
name = os.path.splitext(file_name)[0]
name_fragments = name.replace('_', '-').split('-')
with open(os.path.join(target_dir, name + '.md'), 'a') as f:
f.write(file_name)
... | 39.229885 | 84 | 0.552593 |
79689369dda0c1c5cd9986246bbec13446430597 | 404 | py | Python | py_privatekonomi/core/factories/account_parser_factory.py | nilsFK/py-privatekonomi | 9172dfa85e439e18558a60fdb3b69e956e70e783 | [
"MIT"
] | 2 | 2015-01-04T21:27:45.000Z | 2015-01-05T13:31:52.000Z | py_privatekonomi/core/factories/account_parser_factory.py | nilsFK/py-privatekonomi | 9172dfa85e439e18558a60fdb3b69e956e70e783 | [
"MIT"
] | 28 | 2015-01-04T22:13:24.000Z | 2019-11-29T13:41:01.000Z | py_privatekonomi/core/factories/account_parser_factory.py | nilsFK/py-privatekonomi | 9172dfa85e439e18558a60fdb3b69e956e70e783 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from py_privatekonomi.core.factory import Factory
class AccountParserFactory(Factory):
def __init__(self):
super(AccountParserFactory, self).__init__()
def create(self, acc_type):
parser = self.get(acc_type)
... | 25.25 | 52 | 0.653465 |
7968945d1bfcee97647c2ed58df1510ac7273472 | 6,281 | py | Python | hivemind/utils/mpfuture.py | Rapixar/hivemind | bb759e23eec9c3d63b2763428bcdb8687ee055d3 | [
"MIT"
] | 1 | 2020-09-21T01:54:00.000Z | 2020-09-21T01:54:00.000Z | hivemind/utils/mpfuture.py | Rapixar/hivemind | bb759e23eec9c3d63b2763428bcdb8687ee055d3 | [
"MIT"
] | null | null | null | hivemind/utils/mpfuture.py | Rapixar/hivemind | bb759e23eec9c3d63b2763428bcdb8687ee055d3 | [
"MIT"
] | null | null | null | from __future__ import annotations
import time
import multiprocessing as mp
import multiprocessing.connection
import concurrent.futures._base as base
import asyncio
from functools import lru_cache
from typing import Optional
from hivemind.utils.threading import run_in_background
class MPFuture(base.Future):
"""... | 38.066667 | 113 | 0.650533 |
7968947d2f9795e1309abf08cfd260dc8a49b802 | 951 | py | Python | ads/adsutils.py | rako233/TC2ADSProtocol | 53c1f3d700a6bb1c7dc585caaac6756e657ef230 | [
"MIT"
] | null | null | null | ads/adsutils.py | rako233/TC2ADSProtocol | 53c1f3d700a6bb1c7dc585caaac6756e657ef230 | [
"MIT"
] | null | null | null | ads/adsutils.py | rako233/TC2ADSProtocol | 53c1f3d700a6bb1c7dc585caaac6756e657ef230 | [
"MIT"
] | null | null | null |
def HexBlock(data, width=8):
i = 0
count = 0
result = ''
currentHexLine = ''
currentChrLine = ''
for byte in data:
# next line, if required
if (i == width):
result += f'{currentHexLine} {currentChrLine}\n'
currentHexLine = ''
currentChrLine =... | 27.970588 | 88 | 0.498423 |
796895021296647137db3cf753386d79ba144fba | 2,049 | py | Python | benchexec/test_cgroups.py | MartinSpiessl/benchexec | 7bd6c62b0fdc6eac0b6eedbe0315d0de3992c410 | [
"Apache-2.0"
] | null | null | null | benchexec/test_cgroups.py | MartinSpiessl/benchexec | 7bd6c62b0fdc6eac0b6eedbe0315d0de3992c410 | [
"Apache-2.0"
] | 1 | 2020-10-16T21:22:46.000Z | 2020-10-16T21:22:46.000Z | benchexec/test_cgroups.py | MartinSpiessl/benchexec | 7bd6c62b0fdc6eac0b6eedbe0315d0de3992c410 | [
"Apache-2.0"
] | null | null | null | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import logging
import subprocess
import sys
import unittest
from benchexec import check_c... | 30.132353 | 79 | 0.630551 |
796896540919cfc5f4d56c42f81f3b88b7c0a107 | 250 | py | Python | views/__init__.py | jindada1/Relaxion | 3c1de540c0ef7b5eb99a7386b9a6893b80dfb5bb | [
"MIT"
] | 5 | 2021-12-07T13:24:31.000Z | 2021-12-23T06:47:53.000Z | views/__init__.py | jindada1/Relaxion | 3c1de540c0ef7b5eb99a7386b9a6893b80dfb5bb | [
"MIT"
] | 1 | 2021-12-07T13:25:15.000Z | 2021-12-07T13:25:15.000Z | views/__init__.py | jindada1/Relaxion | 3c1de540c0ef7b5eb99a7386b9a6893b80dfb5bb | [
"MIT"
] | null | null | null | '''
on : 2019-10-03
by : Kris Huang
for : all views of this application
'''
__all__ = ['Cores', 'Users', 'Platforms']
__version__ = '0.1'
__author__ = 'Kris Huang'
from .cores import Cores
from .users import Users
from .musics import Platforms | 17.857143 | 41 | 0.688 |
79689872fbb5d35fdec0a24168779d5ce80f4454 | 390 | py | Python | data_structures/array/number_of_1_in_sorted_array.py | Inquis1t0r/python-ds | d7395e6e25a2085bb8d201b77153e4af6720291e | [
"MIT"
] | 2 | 2021-05-19T02:11:35.000Z | 2021-07-01T03:33:31.000Z | data_structures/array/number_of_1_in_sorted_array.py | Inquis1t0r/python-ds | d7395e6e25a2085bb8d201b77153e4af6720291e | [
"MIT"
] | null | null | null | data_structures/array/number_of_1_in_sorted_array.py | Inquis1t0r/python-ds | d7395e6e25a2085bb8d201b77153e4af6720291e | [
"MIT"
] | 4 | 2019-10-21T23:35:59.000Z | 2021-12-08T04:43:31.000Z | # The array is sorted in decreasing order
def count(arr):
start = 0
end = len(arr) - 1
while start <= end:
mid = (start + end) // 2
if arr[mid] == 1 and (arr[mid + 1] == 0 or mid == high):
return mid + 1
if arr[mid] == 1:
start = mid + 1
else:
... | 18.571429 | 64 | 0.461538 |
796898c0d92e352b6b9376e6c6a59c7788f406a3 | 1,863 | py | Python | tricircle-6.0.0/tricircle/network/drivers/type_flat.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | tricircle-6.0.0/tricircle/network/drivers/type_flat.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | tricircle-6.0.0/tricircle/network/drivers/type_flat.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2017 Huawei Technologies Co., Ltd.
# 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
#
# Unl... | 34.5 | 78 | 0.70424 |
796898e037fa8319b62a52fb8d6a93b166f5c588 | 160 | py | Python | Python 3 - Fundamentos/Desafio 27.py | Paimonz/Python-Estudos | bbc4d7abb2eebff7f160eac54a290fd9ea7a1cff | [
"MIT"
] | null | null | null | Python 3 - Fundamentos/Desafio 27.py | Paimonz/Python-Estudos | bbc4d7abb2eebff7f160eac54a290fd9ea7a1cff | [
"MIT"
] | null | null | null | Python 3 - Fundamentos/Desafio 27.py | Paimonz/Python-Estudos | bbc4d7abb2eebff7f160eac54a290fd9ea7a1cff | [
"MIT"
] | null | null | null | nome = input ('\nDigite o seu nome completo: ')
nome = nome.split()
n = len(nome) - 1
print (f'Seu primeiro nome é: {nome[0]}, e seu último nome é: {nome[n]}')
| 32 | 73 | 0.63125 |
796899c41950074a4627573e8d991191b167b2ba | 4,155 | py | Python | gaphor/ui/actiongroup.py | milotype/gaphor | 58370f5f8a2460863265044eaafd9624622fcdff | [
"Apache-2.0"
] | null | null | null | gaphor/ui/actiongroup.py | milotype/gaphor | 58370f5f8a2460863265044eaafd9624622fcdff | [
"Apache-2.0"
] | 1 | 2017-04-18T01:51:12.000Z | 2017-04-18T01:51:12.000Z | gaphor/ui/actiongroup.py | milotype/gaphor | 58370f5f8a2460863265044eaafd9624622fcdff | [
"Apache-2.0"
] | null | null | null | from typing import NamedTuple
from gi.repository import Gio, GLib, Gtk
from gaphor.abc import ActionProvider
class ActionGroup(NamedTuple):
actions: Gio.SimpleActionGroup
shortcuts: Gtk.AccelGroup
def apply_application_actions(component_registry, gtk_app):
scope = "app"
for _name, provider in comp... | 30.108696 | 82 | 0.668111 |
79689b0b877d4e1f4e1c47bcd42aba2dc57948fc | 1,957 | py | Python | tests/st/ops/cpu/test_softmax_cross_entropy_with_logits_op.py | GuoSuiming/mindspore | 48afc4cfa53d970c0b20eedfb46e039db2a133d5 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/ops/cpu/test_softmax_cross_entropy_with_logits_op.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/ops/cpu/test_softmax_cross_entropy_with_logits_op.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020 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 a... | 36.924528 | 79 | 0.649463 |
79689d2bf7050ba7fdc601e7c09d88b519ba4860 | 4,793 | py | Python | hackerrank_plugin.py | rishiloyola/hackerrank | dbec6be4806b5133258f3831ad439ca1b9c3c6d8 | [
"MIT"
] | null | null | null | hackerrank_plugin.py | rishiloyola/hackerrank | dbec6be4806b5133258f3831ad439ca1b9c3c6d8 | [
"MIT"
] | null | null | null | hackerrank_plugin.py | rishiloyola/hackerrank | dbec6be4806b5133258f3831ad439ca1b9c3c6d8 | [
"MIT"
] | null | null | null | import sublime, sublime_plugin
import urllib2, httplib, urllib
import json as JSON
import time
import Cookie
import base64
basicUrl = 'https://www.hackerrank.com/rest/contests/'
lang = {'py':'python', 'java':'java', 'c':'c', 'cpp':'cpp'}
class CustomBasicAuthHandler(urllib2.HTTPBasicAuthHandler):
def http_request(s... | 32.385135 | 351 | 0.678907 |
79689ecf8ff34851ae0e6b4a2319da09ffb3289d | 267 | py | Python | ovhcli/formater/json.py | simon/ovh-cli | fb746511b855a4f9c41c28e8a11932ecb82c3b4e | [
"BSD-3-Clause"
] | 1 | 2020-05-14T01:14:46.000Z | 2020-05-14T01:14:46.000Z | ovhcli/formater/json.py | simon/ovh-cli | fb746511b855a4f9c41c28e8a11932ecb82c3b4e | [
"BSD-3-Clause"
] | null | null | null | ovhcli/formater/json.py | simon/ovh-cli | fb746511b855a4f9c41c28e8a11932ecb82c3b4e | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
import json
def do_format(client, verb, method, arguments):
data = getattr(client, verb.lower())(method, **arguments)
print json.dumps(
data,
sort_keys=True,
indent=4,
separators=(',', ': ')
)
| 17.8 | 61 | 0.554307 |
7968a036b1831a85abe88b1dffabec131b08e852 | 6,683 | py | Python | nova/tests/functional/regressions/test_bug_1679750.py | confi-surya/nova | adda77352cbe037f47c86bbd809c94fee269eaae | [
"Apache-2.0"
] | 2 | 2021-10-11T04:56:25.000Z | 2022-02-16T08:49:29.000Z | nova/tests/functional/regressions/test_bug_1679750.py | ljzjohnson/nova | 87e1951a1b8c03b9ecdf8f75610d14690b61f272 | [
"Apache-2.0"
] | 132 | 2017-03-27T11:31:52.000Z | 2022-03-30T08:45:02.000Z | nova/tests/functional/regressions/test_bug_1679750.py | ljzjohnson/nova | 87e1951a1b8c03b9ecdf8f75610d14690b61f272 | [
"Apache-2.0"
] | 8 | 2017-03-27T07:50:38.000Z | 2020-02-14T16:55:56.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 44.852349 | 78 | 0.668861 |
7968a0a5ca10f676dd9444c7ba8112a79eccba98 | 3,629 | py | Python | tests/test_billing_requests.py | ireneperezddc/connect-reports | 9a7d56255f3ea4989d28e45a759e04315eef5504 | [
"Apache-2.0"
] | 7 | 2021-03-31T13:45:10.000Z | 2022-02-08T05:48:21.000Z | tests/test_billing_requests.py | ireneperezddc/connect-reports | 9a7d56255f3ea4989d28e45a759e04315eef5504 | [
"Apache-2.0"
] | null | null | null | tests/test_billing_requests.py | ireneperezddc/connect-reports | 9a7d56255f3ea4989d28e45a759e04315eef5504 | [
"Apache-2.0"
] | 8 | 2021-01-14T13:57:52.000Z | 2022-02-18T09:12:52.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2021, CloudBlue
# All rights reserved.
#
from reports.billing_requests.entrypoint import (
generate,
HEADERS,
)
PARAMETERS = {
'date': {
'after': '2020-12-01T00:00:00',
'before': '2021-01-01T00:00:00',
},
'product': {
'all': True,
... | 24.52027 | 93 | 0.544503 |
7968a1c93657d56bb1ed97c772fa3aa4dde2fa10 | 10,372 | py | Python | service.py | cg-saarland/GloBiE | 23cb52e8c06716667eca2c174f3f732b20315098 | [
"MIT"
] | null | null | null | service.py | cg-saarland/GloBiE | 23cb52e8c06716667eca2c174f3f732b20315098 | [
"MIT"
] | null | null | null | service.py | cg-saarland/GloBiE | 23cb52e8c06716667eca2c174f3f732b20315098 | [
"MIT"
] | null | null | null | import json
import numpy
import math
import os
import argparse
import sys
import random
# add dependencies for auto-py-to-exe
# https://github.com/pyinstaller/pyinstaller/issues/4363#issuecomment-522350024
# import numpy.random.common
# import numpy.random.bounded_integers
# import numpy.random.entropy
from PIL impor... | 34.688963 | 79 | 0.596317 |
7968a21d752be4299d2330044ccdcb0bdb5bda99 | 4,407 | py | Python | Cassandra.py | Sparab16/Advance-Image-Downloader | 26e2423049018d1099053b90c22aabd781d7e106 | [
"MIT"
] | 16 | 2021-09-05T14:13:17.000Z | 2022-01-09T05:55:30.000Z | Cassandra.py | Sparab16/Advance-Image-Downloader | 26e2423049018d1099053b90c22aabd781d7e106 | [
"MIT"
] | null | null | null | Cassandra.py | Sparab16/Advance-Image-Downloader | 26e2423049018d1099053b90c22aabd781d7e106 | [
"MIT"
] | 4 | 2021-09-05T15:36:57.000Z | 2021-09-10T15:24:47.000Z | from cassandra.auth import PlainTextAuthProvider
from cassandra.cluster import Cluster
from config import database_config
from Logger import Logging
logger_obj = Logging('Advance Image Downloader') # Creating a custom based logger
logger_obj.initialize_logger() # Instantiating the logger object
class Cassandra:
... | 40.063636 | 118 | 0.593147 |
7968a23558d7573cb5efc6d7184dc18c9aedf916 | 280 | py | Python | exercises/es/exc_01_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/exc_01_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/exc_01_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Carga el modelo "es_core_news_sm"
nlp = ____
text = (
"De acuerdo con la revista Fortune, Apple fue la empresa "
"más admirada en el mundo entre 2008 y 2012."
)
# Procesa el texto
doc = ____
# Imprime en pantalla el texto del documento
print(____.____)
| 17.5 | 62 | 0.710714 |
7968a2e6e5688115c80bcbf8335938abe62728b1 | 14,832 | py | Python | Wrappers/Python/cil/processors/Resizer.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/cil/processors/Resizer.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/cil/processors/Resizer.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# CCP in Tomographic Imaging (CCPi) Core Imaging Library (CIL).
# Copyright 2017 UKRI-STFC
# Copyright 2017 University of Manchester
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | 55.969811 | 149 | 0.483347 |
7968a30e37d9fb468423f6e1f380f6239a02c979 | 7,954 | py | Python | docs/conf.py | sternoru/goscalecms | 7eee50357c47ebdfe3e573a8b4be3b67892d229e | [
"BSD-3-Clause"
] | 2 | 2015-09-28T10:07:38.000Z | 2016-05-31T00:17:16.000Z | docs/conf.py | sternoru/goscalecms | 7eee50357c47ebdfe3e573a8b4be3b67892d229e | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | sternoru/goscalecms | 7eee50357c47ebdfe3e573a8b4be3b67892d229e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# goscalecms documentation build configuration file, created by
# sphinx-quickstart on Tue May 8 12:39:57 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | 31.816 | 80 | 0.715238 |
7968a31c95321e476ccb272671d7c3b0c3e33a15 | 265 | py | Python | tests/fixtures/config1.py | bpmbank/mrq | 12b0be3795164732da94d12240d9ed74f8b33601 | [
"MIT"
] | null | null | null | tests/fixtures/config1.py | bpmbank/mrq | 12b0be3795164732da94d12240d9ed74f8b33601 | [
"MIT"
] | null | null | null | tests/fixtures/config1.py | bpmbank/mrq | 12b0be3795164732da94d12240d9ed74f8b33601 | [
"MIT"
] | null | null | null | NAME = "testworker"
TASKS = {
"tests.tasks.general.TimeoutFromConfig": {
"timeout": 2,
"queue": "tests"
},
"tests.tasks.general.TimeoutFromConfigAndCancel": {
"timeout": 2,
"queue": "tests"
}
}
QUEUES = ["high", "default", "low", "tests"]
| 17.666667 | 53 | 0.592453 |
7968a3838e60e8443c07a6f605dc4a8f89e8789e | 18,676 | py | Python | dataprep/clean/clean_currency.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 1,229 | 2019-12-21T02:58:59.000Z | 2022-03-30T08:12:33.000Z | dataprep/clean/clean_currency.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 680 | 2019-12-19T06:09:23.000Z | 2022-03-31T04:15:25.000Z | dataprep/clean/clean_currency.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 170 | 2020-01-08T03:27:26.000Z | 2022-03-20T20:42:55.000Z | """
Clean and validate a DataFrame column containing currencies
"""
# pylint: disable=too-many-arguments, line-too-long, too-many-locals, too-many-branches, too-many-statements, too-many-return-statements,
import json
from os import path
from operator import itemgetter
from typing import Any, List, Union, Optional
... | 33.772152 | 137 | 0.640662 |
7968a3b095cfbb0b1698eaf03cb2dbd63c78d956 | 6,958 | py | Python | mmdet/models/necks/fpn.py | nithinksath96/MMdetection_TensorRT_FP16 | c8379b209d4deeff9350baf5bbedfc95fb8941f4 | [
"Apache-2.0"
] | null | null | null | mmdet/models/necks/fpn.py | nithinksath96/MMdetection_TensorRT_FP16 | c8379b209d4deeff9350baf5bbedfc95fb8941f4 | [
"Apache-2.0"
] | null | null | null | mmdet/models/necks/fpn.py | nithinksath96/MMdetection_TensorRT_FP16 | c8379b209d4deeff9350baf5bbedfc95fb8941f4 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from mmdet.core import auto_fp16
from ..registry import NECKS
from ..utils import ConvModule
@NECKS.register_module
class FPN(nn.Module):
"""
Feature Pyramid Network.
This is an implementation of - Feature Pyramid Net... | 37.010638 | 90 | 0.557057 |
7968a3f4625f25ae5be74ac4d9cb505115cbcf47 | 4,979 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 29.636905 | 94 | 0.748142 |
7968a3f5e8fbb2c4bed8bfe9fb3d5c9754a65382 | 2,402 | py | Python | data/cirq_new/cirq_program/startCirq_Class729.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_Class729.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_Class729.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=21
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
def make_circuit(n: int, input_qubit):
c = cirq.Ci... | 33.361111 | 80 | 0.676936 |
7968a62304c35e85994264cd72a04f7572a67f83 | 559 | py | Python | client/skyhookdmclient/examples/example4.py | uccross/skyhookdm-pythonclient | b9afda683329a7ac984ab09de24cdbfe11e2618c | [
"MIT"
] | null | null | null | client/skyhookdmclient/examples/example4.py | uccross/skyhookdm-pythonclient | b9afda683329a7ac984ab09de24cdbfe11e2618c | [
"MIT"
] | 14 | 2019-12-06T09:29:09.000Z | 2020-06-23T06:04:06.000Z | client/skyhookdmclient/examples/example4.py | uccross/skyhookdm-pythonclient | b9afda683329a7ac984ab09de24cdbfe11e2618c | [
"MIT"
] | null | null | null | from skyhookdmclient import SkyhookDM
sk = SkyhookDM()
sk.connect('localhost', 'hepdatapool')
urls = ['http://opendata.cern.ch/record/12352/files/VBF_HToTauTau.root']
sk.writeDataset(urls,'nanodst')
dst = sk.getDataset('nanodst')
files = dst.getFiles()
file = files[0]
rootnode = file.getRoot()
trees = rootnode.getChild... | 34.9375 | 139 | 0.754919 |
7968a66546f7c94e279f128ba9c984af335ae07f | 31,599 | py | Python | forged_packet.py | ZXing9/WireWhale | 291ea9aebfaa27fbf22eb9b3a135c2050ca5166c | [
"MIT"
] | 1 | 2021-08-30T14:34:59.000Z | 2021-08-30T14:34:59.000Z | forged_packet.py | ZXing9/WireWhale | 291ea9aebfaa27fbf22eb9b3a135c2050ca5166c | [
"MIT"
] | null | null | null | forged_packet.py | ZXing9/WireWhale | 291ea9aebfaa27fbf22eb9b3a135c2050ca5166c | [
"MIT"
] | 2 | 2021-08-30T14:35:02.000Z | 2021-11-22T09:38:35.000Z | # -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
from scapy.sendrecv import sr, sr1, srloop
import scapy
from scapy.layers.inet import *
import sys
import threading
"""获取控制台内容"""
class EmittingStream(QtCore.QObject):
textWritten = QtCore.pyqtSignal(str) # 定义一个发送str的信号
def write(self, text... | 40.772903 | 77 | 0.648755 |
7968a6fc7863fa71ab2dc00fab45513f4a9b9bde | 8,933 | py | Python | tutorials/source-modeling/plot_compute_covariance.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 2 | 2020-06-15T12:25:12.000Z | 2020-09-13T11:49:51.000Z | tutorials/source-modeling/plot_compute_covariance.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 23 | 2017-09-12T11:08:26.000Z | 2019-10-04T11:11:29.000Z | tutorials/source-modeling/plot_compute_covariance.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 3 | 2019-01-28T13:48:00.000Z | 2019-07-10T16:02:11.000Z | """
.. _tut_compute_covariance:
Computing a covariance matrix
=============================
Many methods in MNE, including source estimation and some classification
algorithms, require covariance estimations from the recordings.
In this tutorial we cover the basics of sensor covariance computations and
construct a no... | 47.515957 | 79 | 0.66842 |
7968a73e8db21881ac2a9fd3cbe735e9f72135a4 | 1,238 | py | Python | stonks/conf/cfg.py | tjduigna/stonks | bc8fdca24931d2b9167c7107744a8ffb63eb9937 | [
"Apache-2.0"
] | null | null | null | stonks/conf/cfg.py | tjduigna/stonks | bc8fdca24931d2b9167c7107744a8ffb63eb9937 | [
"Apache-2.0"
] | null | null | null | stonks/conf/cfg.py | tjduigna/stonks | bc8fdca24931d2b9167c7107744a8ffb63eb9937 | [
"Apache-2.0"
] | null | null | null | c = get_config()
c.App.mode = 'email'
c.Mailbox.user = ''
c.Mailbox.pwd = ''
c.Mailbox.hostname = 'imap.gmail.com'
c.Mailbox.folder = 'inbox'
c.Mailbox.broker = 'robinhood.com'
# key words to filter by in email subject
c.Mailbox.filters = ['Executed',] # 'Placed', 'Canceled']
c.EmailParser.debug = 1
# delete these s... | 20.983051 | 57 | 0.638934 |
7968a7918ad744563cd44d16206a59cbcbb43393 | 1,216 | py | Python | push/urls.py | nnsnodnb/djabaas | 788cea2c26e7e2afc9b7ceb6ddc4934560201c7a | [
"Apache-2.0"
] | 3 | 2017-12-27T09:04:33.000Z | 2019-08-29T13:44:53.000Z | push/urls.py | nnsnodnb/djabaas | 788cea2c26e7e2afc9b7ceb6ddc4934560201c7a | [
"Apache-2.0"
] | 1 | 2018-07-30T04:42:24.000Z | 2018-07-30T04:42:24.000Z | push/urls.py | nnsnodnb/djabaas | 788cea2c26e7e2afc9b7ceb6ddc4934560201c7a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from django.conf.urls import url
from push import views
urlpatterns = [
url(r'^$', views.index, name = 'index'),
url(r'^download_device_token$', views.download_device_token, name = 'download_device_token'),
url(r'^sender', views.sender, name = 'sender'),
url(r'^notification_list', view... | 57.904762 | 116 | 0.721217 |
7968a8357e3a565ac3a8c98ddf5caa07c30fe7ed | 1,525 | py | Python | services/app.py | OpenKnowledgeMaps/headstart-ifs | 95c3e7f7384d66c5b13d02ac26a00b30fbed3cb1 | [
"MIT"
] | 4 | 2019-06-26T16:23:06.000Z | 2021-09-19T01:03:47.000Z | services/app.py | OpenKnowledgeMaps/headstart-ifs | 95c3e7f7384d66c5b13d02ac26a00b30fbed3cb1 | [
"MIT"
] | null | null | null | services/app.py | OpenKnowledgeMaps/headstart-ifs | 95c3e7f7384d66c5b13d02ac26a00b30fbed3cb1 | [
"MIT"
] | 2 | 2018-12-04T13:55:51.000Z | 2019-06-26T16:23:09.000Z | from flask import Flask
# from app.models import Documents
from databases import db
def new_ifs_app(settings_override=None):
from blueprints.ifs.views import app as ifs
app = Flask('ifs', instance_relative_config=True)
app.config.from_object('config.settings')
app.config.from_pyfile('settings.py', s... | 26.293103 | 73 | 0.72 |
7968aa0888644ef1f57ae318f619081caee3c5ae | 7,527 | py | Python | sympy/physics/units/unitsystem.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | sympy/physics/units/unitsystem.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | sympy/physics/units/unitsystem.py | SirAbhi13/sympy | 5868aa1cc649f048cdbddd0082be67f2b65f0d95 | [
"BSD-3-Clause"
] | null | null | null | """
Unit system for physical quantities; include definition of constants.
"""
from typing import Dict
from sympy.core.add import Add
from sympy.core.function import (Derivative, Function)
from sympy.core.mul import Mul
from sympy.core.power import Pow
from sympy.core.singleton import S
from sympy.physics.units.dimens... | 34.847222 | 87 | 0.611266 |
7968aa400fac6b3ae40b98a6fe94398d50b84f18 | 792 | py | Python | ponyconf/management/commands/suffixdomains.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 11 | 2016-06-15T12:05:18.000Z | 2017-08-02T14:12:41.000Z | ponyconf/management/commands/suffixdomains.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 110 | 2016-07-06T20:04:57.000Z | 2017-12-01T20:51:52.000Z | ponyconf/management/commands/suffixdomains.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 10 | 2016-08-28T14:13:35.000Z | 2017-06-08T07:27:29.000Z | from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
class Command(BaseCommand):
help = 'Add a suffix to all site domains.'
def add_arguments(self, parser):
parser.add_argument('suffix')
def handle(self, *args, **options):
answer = input("""You... | 28.285714 | 70 | 0.630051 |
7968aa88be7f9182085e75de14ff1f0ee93d4501 | 5,370 | py | Python | test/functional/feature_versionbits_warning.py | ultraEX/uex | a37bffc5c3fbc4d044a06ea6b33e7712cb73dbd5 | [
"MIT"
] | 2 | 2018-04-13T13:37:00.000Z | 2018-07-26T06:39:38.000Z | test/functional/feature_versionbits_warning.py | ultraEX/uex | a37bffc5c3fbc4d044a06ea6b33e7712cb73dbd5 | [
"MIT"
] | null | null | null | test/functional/feature_versionbits_warning.py | ultraEX/uex | a37bffc5c3fbc4d044a06ea6b33e7712cb73dbd5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test version bits warning system.
Generate chains with block versions that appear to be signalling unk... | 47.522124 | 137 | 0.710056 |
7968ac5c3d9c8fd0e28f436a48fc8c225d82a92e | 3,343 | py | Python | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/utils.py | Anillab/One-Minute-Pitch | 123f7b2010d3ae0f031066db1bcfe6eda7a41e84 | [
"MIT"
] | 4 | 2019-10-03T21:58:22.000Z | 2021-02-12T13:33:32.000Z | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/utils.py | Anillab/One-Minute-Pitch | 123f7b2010d3ae0f031066db1bcfe6eda7a41e84 | [
"MIT"
] | 4 | 2020-01-22T13:45:12.000Z | 2022-02-10T20:58:09.000Z | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/utils.py | Anillab/One-Minute-Pitch | 123f7b2010d3ae0f031066db1bcfe6eda7a41e84 | [
"MIT"
] | 1 | 2021-01-13T09:30:29.000Z | 2021-01-13T09:30:29.000Z | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from __future__ i... | 36.736264 | 79 | 0.553694 |
7968ad794530b7da5992e17d3c96e0fe63e1ae99 | 1,511 | py | Python | calculator.py | rgsthethird/DraftKings-Soccer | 05b6847335034406045aec23d413cbfa4e14b76c | [
"MIT"
] | 2 | 2021-05-05T05:24:12.000Z | 2021-12-20T05:09:16.000Z | calculator.py | rgsthethird/DraftKings-Soccer | 05b6847335034406045aec23d413cbfa4e14b76c | [
"MIT"
] | null | null | null | calculator.py | rgsthethird/DraftKings-Soccer | 05b6847335034406045aec23d413cbfa4e14b76c | [
"MIT"
] | null | null | null | class Calculator:
def __init__(self, match):
self.match = match
self.averages = match
# Appends match data
def add_data(self, data, index):
data_array = data[index]
for datum in data_array:
try:
self.match.append(float(datum))
except:
... | 28.509434 | 67 | 0.509596 |
7968ae8469fcc360d711b6899015047c4fcbf4d3 | 15,353 | py | Python | lithops/serverless/backends/azure_functions/azure_functions.py | pywren/pywren-ibm-cloud | 34ede62e3cc62f4626f9be89db4993bc6a8455a7 | [
"Apache-2.0"
] | 55 | 2018-04-23T09:58:56.000Z | 2020-09-09T11:47:16.000Z | lithops/serverless/backends/azure_functions/azure_functions.py | pywren/pywren-ibm-cloud | 34ede62e3cc62f4626f9be89db4993bc6a8455a7 | [
"Apache-2.0"
] | 256 | 2018-05-20T13:01:51.000Z | 2020-09-16T09:09:54.000Z | lithops/serverless/backends/azure_functions/azure_functions.py | pywren/pywren-ibm-cloud | 34ede62e3cc62f4626f9be89db4993bc6a8455a7 | [
"Apache-2.0"
] | 35 | 2018-04-23T09:07:57.000Z | 2020-08-12T13:43:06.000Z | #
# Copyright Cloudlab URV 2021
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 39.671835 | 104 | 0.624829 |
7968aecdd05274f09c29699c995cee497f201324 | 1,220 | py | Python | setup.py | tikitu/jsmin | 0c8281681d53d5adc827de06ccae763975a9ee49 | [
"MIT"
] | 81 | 2015-07-19T14:17:00.000Z | 2022-03-27T19:45:10.000Z | setup.py | tikitu/jsmin | 0c8281681d53d5adc827de06ccae763975a9ee49 | [
"MIT"
] | 28 | 2015-08-04T19:23:40.000Z | 2022-01-16T20:39:57.000Z | setup.py | tikitu/jsmin | 0c8281681d53d5adc827de06ccae763975a9ee49 | [
"MIT"
] | 23 | 2015-08-04T19:41:27.000Z | 2022-01-03T08:08:09.000Z | from setuptools import setup
import os, sys, re
os.environ['COPYFILE_DISABLE'] = 'true' # this disables including resource forks in tar files on os x
def long_description():
return open('README.rst').read() + '\n' + open('CHANGELOG.txt').read()
setup(
name="jsmin",
version=re.search(r'__version__ = [... | 32.972973 | 102 | 0.632787 |
7968aee14b8043490205d6374b9a89b5f57d7beb | 995 | py | Python | resources/split_dataset.py | simenvg/cloud_detection_framework | 97db2eb2cf3da91aa64ae90bf404adbd4744578b | [
"MIT"
] | 4 | 2020-06-26T06:47:26.000Z | 2022-01-10T07:46:54.000Z | resources/split_dataset.py | simenvg/cloud-detection-framework | 97db2eb2cf3da91aa64ae90bf404adbd4744578b | [
"MIT"
] | null | null | null | resources/split_dataset.py | simenvg/cloud-detection-framework | 97db2eb2cf3da91aa64ae90bf404adbd4744578b | [
"MIT"
] | 4 | 2020-05-13T08:23:48.000Z | 2021-04-19T07:58:47.000Z | import os
import sys
import random
def change_folder(current_path, new_path, filename):
if not os.path.exists(new_path):
os.makedirs(new_path)
os.rename(os.path.join(current_path, filename),
os.path.join(new_path, filename))
def split_to_train_and_test_folders(path):
for filename i... | 31.09375 | 88 | 0.60603 |
7968af5fceeb1fcad31cba1fccbcb6b134ab2577 | 451 | py | Python | pytube/monostate.py | JarbasAl/pytube | 10d0bdb6761682c2a48e4c816aec4bb9b801f7aa | [
"Unlicense"
] | 4,079 | 2015-01-08T13:09:24.000Z | 2020-12-31T08:59:22.000Z | pytube/monostate.py | JarbasAl/pytube | 10d0bdb6761682c2a48e4c816aec4bb9b801f7aa | [
"Unlicense"
] | 807 | 2015-02-23T12:49:43.000Z | 2020-12-31T16:09:01.000Z | pytube/monostate.py | JarbasAl/pytube | 10d0bdb6761682c2a48e4c816aec4bb9b801f7aa | [
"Unlicense"
] | 1,079 | 2015-01-08T10:16:47.000Z | 2020-12-30T15:26:13.000Z | from typing import Any, Callable, Optional
class Monostate:
def __init__(
self,
on_progress: Optional[Callable[[Any, bytes, int], None]],
on_complete: Optional[Callable[[Any, Optional[str]], None]],
title: Optional[str] = None,
duration: Optional[int] = None,
):
... | 28.1875 | 68 | 0.620843 |
7968b052b983aabe33ab4474bb25e6c9646d0eef | 8,414 | py | Python | python3/sudoku.py | toroidal-code/sudoku | f553738af85fd10f9f8fb781ff3619f089ca9c80 | [
"MIT"
] | 2 | 2017-03-07T21:23:15.000Z | 2020-12-15T12:57:16.000Z | python3/sudoku.py | toroidal-code/sudoku | f553738af85fd10f9f8fb781ff3619f089ca9c80 | [
"MIT"
] | null | null | null | python3/sudoku.py | toroidal-code/sudoku | f553738af85fd10f9f8fb781ff3619f089ca9c80 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
from copy import deepcopy
from sys import argv
import collections
import time
import os
class SudokuConfig:
"""
A class that represents a sudoku configuration.
board - square grid of values
(list of list of int's, size DIM*DIM)
"""
__slots__ = ('DIM', 'board')
... | 31.162963 | 160 | 0.463632 |
7968b05d16be7582e8905bb05b61b00a911364f8 | 2,489 | py | Python | src/sentiment_analysis_twitter/pipeline_registry.py | FelixBehne/sentiment_analysis_twitter | f811a9dc270a759305de593edef2de81918aee4d | [
"MIT"
] | null | null | null | src/sentiment_analysis_twitter/pipeline_registry.py | FelixBehne/sentiment_analysis_twitter | f811a9dc270a759305de593edef2de81918aee4d | [
"MIT"
] | null | null | null | src/sentiment_analysis_twitter/pipeline_registry.py | FelixBehne/sentiment_analysis_twitter | f811a9dc270a759305de593edef2de81918aee4d | [
"MIT"
] | null | null | null | # Copyright 2021 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 40.145161 | 77 | 0.748092 |
7968b0ddd636722f26351affd082af5eb70b2a1d | 1,141 | py | Python | register/tasks.py | alok102singh/courtside | 6d427391c543cc602ae2d92e1aa61ea15721645b | [
"MIT"
] | 49 | 2015-02-07T02:36:42.000Z | 2021-03-26T10:22:06.000Z | courtside/register/tasks.py | besartaliju/courtside | 6d427391c543cc602ae2d92e1aa61ea15721645b | [
"MIT"
] | 3 | 2015-02-07T02:37:41.000Z | 2016-12-09T19:53:13.000Z | courtside/register/tasks.py | besartaliju/courtside | 6d427391c543cc602ae2d92e1aa61ea15721645b | [
"MIT"
] | 24 | 2015-01-23T12:47:16.000Z | 2021-01-27T00:18:22.000Z | from time import sleep
from delorean import Delorean
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from django.core.mail import EmailMultiAlternatives
from game.models import Game
class SignUpTask(object):
def run(self, user):
subject, from_email, to = 'W... | 26.534884 | 87 | 0.62752 |
7968b1622d43e5a494880878fcd544df257faaba | 365 | py | Python | cohort/week2/cs3.py | jamestiotio/DW2020 | a8c575f1afd34d66dce2798a11b2fa15d1214a43 | [
"MIT"
] | null | null | null | cohort/week2/cs3.py | jamestiotio/DW2020 | a8c575f1afd34d66dce2798a11b2fa15d1214a43 | [
"MIT"
] | 1 | 2021-11-04T16:30:26.000Z | 2021-11-04T16:30:26.000Z | cohort/week2/cs3.py | jamestiotio/DW2020 | a8c575f1afd34d66dce2798a11b2fa15d1214a43 | [
"MIT"
] | null | null | null | from math import sqrt
class Coordinate:
x = 0.0
y = 0.0
def area_of_triangle(p1,p2,p3):
side1 = sqrt((p2.x-p1.x)**2 + (p2.y-p1.y)**2)
side2 = sqrt((p3.x-p2.x)**2 + (p3.y-p2.y)**2)
side3 = sqrt((p3.x-p1.x)**2 + (p3.y-p1.y)**2)
s = (side1 + side2 + side3) / 2
area = sqrt(s * (s-side1) * (s-... | 26.071429 | 54 | 0.528767 |
7968b20f8d1bb889b9c1c8a24dcb2ad79771ec33 | 1,840 | py | Python | pratical_quizs/pratical_quiz1.py | varunscyther/DataStructureUsingPython | ee29e37172f224621d8ad2a36dc5de9bce3c886f | [
"MIT"
] | null | null | null | pratical_quizs/pratical_quiz1.py | varunscyther/DataStructureUsingPython | ee29e37172f224621d8ad2a36dc5de9bce3c886f | [
"MIT"
] | null | null | null | pratical_quizs/pratical_quiz1.py | varunscyther/DataStructureUsingPython | ee29e37172f224621d8ad2a36dc5de9bce3c886f | [
"MIT"
] | 1 | 2022-03-02T19:34:06.000Z | 2022-03-02T19:34:06.000Z | """
Every day, Petr Tort either catches his bus or misses it. In the former case, he comes to the office on time,
in the latter case he is late. Petr knows that his boss gets angry if Petr is late two days in a row.
For a given number n of days, Petr wants to compute the number of possible combinations of catching and
... | 40 | 112 | 0.6375 |
7968b2eca44aa9069de57c7da39ec6b9422acc72 | 4,455 | py | Python | station/receiver.py | gut-space/svarog | ef5dda811315c183bdc2e996b015d4d1fbe57f19 | [
"MIT"
] | 7 | 2021-09-12T17:23:35.000Z | 2022-01-26T18:14:45.000Z | station/receiver.py | gut-space/svarog | ef5dda811315c183bdc2e996b015d4d1fbe57f19 | [
"MIT"
] | 45 | 2021-05-09T11:46:34.000Z | 2022-02-20T20:47:09.000Z | station/receiver.py | gut-space/svarog | d68020a8f104da3b30a29ad24cc0ac64cf12ef5c | [
"MIT"
] | null | null | null | import datetime
import logging
import os
import shutil
import sys
import typing
from matplotlib.pyplot import imread
from utils.functional import first
from utils.models import get_satellite
from utils.dates import from_iso_format
from utils.configuration import open_config
from submitobs import submit_observation, S... | 35.927419 | 153 | 0.656341 |
7968b2fc568c1ecc84e7635a14f9db0334b34f8c | 11,918 | py | Python | maddpg/common/distributions.py | rallen10/maddpg | 7e68d12474fae83777ba85694277ac2c3abff2a2 | [
"MIT"
] | null | null | null | maddpg/common/distributions.py | rallen10/maddpg | 7e68d12474fae83777ba85694277ac2c3abff2a2 | [
"MIT"
] | null | null | null | maddpg/common/distributions.py | rallen10/maddpg | 7e68d12474fae83777ba85694277ac2c3abff2a2 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import maddpg.common.tf_util as U
from tensorflow.python.ops import math_ops
from multiagent.multi_discrete import MultiDiscreteLegacy
from tensorflow.python.ops import nn
class Pd(object):
"""
A particular probability distribution
"""
def flatparam(self):
... | 35.682635 | 199 | 0.626867 |
7968b3018c5d5e3a1addf188c2a25491ceebae89 | 534 | py | Python | data/samplers.py | developer0hye/AS-MLP | a18569e61e1a0ffe4635ba149d5f3d19bbe74831 | [
"MIT"
] | 66 | 2021-07-20T03:10:26.000Z | 2022-03-31T08:15:36.000Z | data/samplers.py | developer0hye/AS-MLP | a18569e61e1a0ffe4635ba149d5f3d19bbe74831 | [
"MIT"
] | 11 | 2021-07-21T09:00:51.000Z | 2022-03-29T10:24:44.000Z | data/samplers.py | developer0hye/AS-MLP | a18569e61e1a0ffe4635ba149d5f3d19bbe74831 | [
"MIT"
] | 4 | 2021-07-22T03:09:11.000Z | 2022-03-31T14:54:31.000Z |
import torch
class SubsetRandomSampler(torch.utils.data.Sampler):
r"""Samples elements randomly from a given list of indices, without replacement.
Arguments:
indices (sequence): a sequence of indices
"""
def __init__(self, indices):
self.epoch = 0
self.indices = indices
... | 22.25 | 84 | 0.651685 |
7968b3b3eef1fc96032d547a1800a1882ab6ba87 | 7,477 | py | Python | pyphabricatordb/project.py | veblush/PyPhabricatorDb | 154efbe225d593e9f073d73fd428171f1dd0536b | [
"MIT"
] | null | null | null | pyphabricatordb/project.py | veblush/PyPhabricatorDb | 154efbe225d593e9f073d73fd428171f1dd0536b | [
"MIT"
] | null | null | null | pyphabricatordb/project.py | veblush/PyPhabricatorDb | 154efbe225d593e9f073d73fd428171f1dd0536b | [
"MIT"
] | null | null | null | # coding: utf-8
from sqlalchemy import BINARY, BigInteger, Column, Index, Integer, String, VARBINARY, text
from sqlalchemy import String, Unicode, ForeignKey
from sqlalchemy.orm import relationship, backref
from dbdatetime import dbdatetime
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_ba... | 37.199005 | 90 | 0.713789 |
7968b4302273e1fa9c574a721c7aa8f60a214ea8 | 561 | py | Python | bayescache/metrics/accuracy.py | jacobhinkle/bayescache | 1728aaaec112a375a7341776ccb5c2d4b67242d6 | [
"MIT"
] | null | null | null | bayescache/metrics/accuracy.py | jacobhinkle/bayescache | 1728aaaec112a375a7341776ccb5c2d4b67242d6 | [
"MIT"
] | null | null | null | bayescache/metrics/accuracy.py | jacobhinkle/bayescache | 1728aaaec112a375a7341776ccb5c2d4b67242d6 | [
"MIT"
] | null | null | null | from bayescache.api.metrics.averaging_metric import AveragingSupervisedMetric
class Accuracy(AveragingSupervisedMetric):
""" Classification accuracy """
def __init__(self):
super().__init__("accuracy")
def _value_function(self, x_input, y_true, y_pred):
""" Return classification accuracy ... | 28.05 | 77 | 0.659537 |
7968b53afb91d26142c28af6e9667f6d6be424c8 | 1,489 | py | Python | setup.py | amirzed/provisionpad | 51d2a886f46b5090b6fb8b91c18c3043ec36ae42 | [
"Apache-2.0"
] | 69 | 2019-08-08T03:14:06.000Z | 2021-10-09T07:44:45.000Z | setup.py | provisionpad/provisionpad | 51d2a886f46b5090b6fb8b91c18c3043ec36ae42 | [
"Apache-2.0"
] | 5 | 2019-08-20T06:17:22.000Z | 2019-08-20T18:06:33.000Z | setup.py | amirzed/provisionpad | 51d2a886f46b5090b6fb8b91c18c3043ec36ae42 | [
"Apache-2.0"
] | 4 | 2019-08-11T00:57:13.000Z | 2019-08-12T20:00:51.000Z |
import sys
import os
from os.path import expanduser
home = expanduser("~")
try:
from setuptools import setup, find_packages
except ImportError:
print("Please install setup tools.")
sys.exit(1)
def read_file(file_name):
'''
Read a file and return stringls
'''
with open(file_name, 'r') as ... | 25.672414 | 82 | 0.558093 |
7968b561ad39038195519c90718fc4100fe5b091 | 1,360 | py | Python | codigo/10 - Model Selection & Boosting/1 - Model Selection/k_fold_validation.py | MartinSantaGitHub/machinelearning-az | d672073e63eb09e5f3ba7cc8bdc6980d7e21c291 | [
"MIT"
] | null | null | null | codigo/10 - Model Selection & Boosting/1 - Model Selection/k_fold_validation.py | MartinSantaGitHub/machinelearning-az | d672073e63eb09e5f3ba7cc8bdc6980d7e21c291 | [
"MIT"
] | null | null | null | codigo/10 - Model Selection & Boosting/1 - Model Selection/k_fold_validation.py | MartinSantaGitHub/machinelearning-az | d672073e63eb09e5f3ba7cc8bdc6980d7e21c291 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 24 17:34:40 2020
@author: msantamaria
"""
# k - Fold Cross Validation
# Importar las librerías
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importar el data set
dataset = pd.read_csv("Social_Network_Ads.csv")
X = dataset.iloc[:,[2,3]].value... | 28.93617 | 88 | 0.775 |
7968b5f6814bbfd619f0e548961e410ad467dd2f | 1,511 | py | Python | __init__.py | ClaudiuIoanMaftei/Emarkovescu | c251ddcc3ca032c76808576ca7423aa20f412ee1 | [
"MIT"
] | null | null | null | __init__.py | ClaudiuIoanMaftei/Emarkovescu | c251ddcc3ca032c76808576ca7423aa20f412ee1 | [
"MIT"
] | null | null | null | __init__.py | ClaudiuIoanMaftei/Emarkovescu | c251ddcc3ca032c76808576ca7423aa20f412ee1 | [
"MIT"
] | null | null | null | import Markov, Corpus
import re
def versify(line):
new_line = ""
first=True
for token in line.split(" "):
if token[0].isalpha() and token[0].isupper():
if not first:
new_line += "\n"
else:
first=False
new_line += token + " ... | 24.770492 | 107 | 0.489742 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.