hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f712c86400d482f402d2dea0381b0ef298481b24 | 80 | py | Python | tadpole/template/app/lib/__init__.py | echoyuanliang/pine | 22175e6aea0ca9b02d6542677b27a690c1501c9c | [
"MIT"
] | 2 | 2017-12-02T07:02:31.000Z | 2020-10-13T02:20:18.000Z | tadpole/template/app/lib/__init__.py | echoyuanliang/pine | 22175e6aea0ca9b02d6542677b27a690c1501c9c | [
"MIT"
] | null | null | null | tadpole/template/app/lib/__init__.py | echoyuanliang/pine | 22175e6aea0ca9b02d6542677b27a690c1501c9c | [
"MIT"
] | 1 | 2018-04-23T04:59:38.000Z | 2018-04-23T04:59:38.000Z | #!/usr/bin/env python
# coding: utf-8
"""
create at 2017/11/5 by allen
"""
| 11.428571 | 32 | 0.5875 | true | true | |
f712c86751b2c032848e2d896cff8be52f3866a2 | 1,979 | py | Python | computorv2/types/function.py | ayoubyt/ComputorV2 | d3aef2802b795327b8b3b190e0744d39508638b3 | [
"MIT"
] | null | null | null | computorv2/types/function.py | ayoubyt/ComputorV2 | d3aef2802b795327b8b3b190e0744d39508638b3 | [
"MIT"
] | null | null | null | computorv2/types/function.py | ayoubyt/ComputorV2 | d3aef2802b795327b8b3b190e0744d39508638b3 | [
"MIT"
] | null | null | null | from inspect import signature
from typing import Callable, Any, List
import re
import copy
from .type import Type
class Function(Type):
def __init__(self, fn: Callable[..., Any], name: str = "anonymouse") -> None:
self.name = name
self.vars = list(signature(fn).parameters)
self.expr = "[bu... | 32.983333 | 86 | 0.573017 | from inspect import signature
from typing import Callable, Any, List
import re
import copy
from .type import Type
class Function(Type):
def __init__(self, fn: Callable[..., Any], name: str = "anonymouse") -> None:
self.name = name
self.vars = list(signature(fn).parameters)
self.expr = "[bu... | true | true |
f712c8a3fe4a7f1fe2a76a5437c55a3f6b98cd80 | 12,509 | py | Python | gracebot/gracebot.py | Roald87/GraceDB | 5c7e6cc93a33b00c1c30ce040ef26326c003630d | [
"Apache-2.0"
] | 7 | 2019-05-16T20:08:11.000Z | 2021-10-07T03:15:00.000Z | gracebot/gracebot.py | Roald87/GraceDB | 5c7e6cc93a33b00c1c30ce040ef26326c003630d | [
"Apache-2.0"
] | 24 | 2019-07-07T06:14:12.000Z | 2021-09-21T18:50:50.000Z | gracebot/gracebot.py | Roald87/GraceDB | 5c7e6cc93a33b00c1c30ce040ef26326c003630d | [
"Apache-2.0"
] | null | null | null | import logging
from collections import Counter, defaultdict
import aiogram
from aiogram import Bot, types
from aiogram.utils.emoji import emojize
from detector import Detector
from gwevents import Events, time_ago
from keyboard import InlineKeyboard
from permanentset import PermanentSet
class GraceBot(Bot):
def ... | 33.268617 | 96 | 0.587257 | import logging
from collections import Counter, defaultdict
import aiogram
from aiogram import Bot, types
from aiogram.utils.emoji import emojize
from detector import Detector
from gwevents import Events, time_ago
from keyboard import InlineKeyboard
from permanentset import PermanentSet
class GraceBot(Bot):
def ... | true | true |
f712c8de43a8c629aa786fd8a8da9cc2f3bc7f9a | 1,788 | py | Python | optmlstat/test/test_basic_functions.py | sungheeyun/optmlstat | 11d529c915bf27976da9157471a6dbf7df34d205 | [
"MIT"
] | 4 | 2020-04-08T03:48:59.000Z | 2020-12-30T01:39:52.000Z | optmlstat/test/test_basic_functions.py | sungheeyun/optmlstat | 11d529c915bf27976da9157471a6dbf7df34d205 | [
"MIT"
] | null | null | null | optmlstat/test/test_basic_functions.py | sungheeyun/optmlstat | 11d529c915bf27976da9157471a6dbf7df34d205 | [
"MIT"
] | 1 | 2020-04-08T04:04:00.000Z | 2020-04-08T04:04:00.000Z | import unittest
from logging import Logger, getLogger
from numpy import ndarray, power, allclose
from numpy.random import randn
from freq_used.logging_utils import set_logging_basic_config
from optmlstat.functions.function_base import FunctionBase
from optmlstat.functions.example_functions import get_sum_of_square_fu... | 33.111111 | 113 | 0.75 | import unittest
from logging import Logger, getLogger
from numpy import ndarray, power, allclose
from numpy.random import randn
from freq_used.logging_utils import set_logging_basic_config
from optmlstat.functions.function_base import FunctionBase
from optmlstat.functions.example_functions import get_sum_of_square_fu... | true | true |
f712c989452d45e22101d40c8a7502a2c3174e77 | 9,381 | py | Python | client-py/src/utils/IoTDBRpcDataSet.py | SilverNarcissus/incubator-iotdb | ea5529280a57125f4aa48a026a2b24d394e15ee5 | [
"Apache-2.0"
] | 1 | 2020-12-26T11:28:50.000Z | 2020-12-26T11:28:50.000Z | client-py/src/utils/IoTDBRpcDataSet.py | SilverNarcissus/incubator-iotdb | ea5529280a57125f4aa48a026a2b24d394e15ee5 | [
"Apache-2.0"
] | null | null | null | client-py/src/utils/IoTDBRpcDataSet.py | SilverNarcissus/incubator-iotdb | ea5529280a57125f4aa48a026a2b24d394e15ee5 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 42.640909 | 118 | 0.644601 |
from IoTDBConstants import *
from thrift.transport import TTransport
from iotdb.rpc.TSIService import TSFetchResultsReq, TSCloseOperationReq
class IoTDBRpcDataSet(object):
TIMESTAMP_STR = "Time"
START_INDEX = 2
FLAG = 0x80
def __init__(self, sql, column_name_list, column_type_list, column_name_... | true | true |
f712c99545e91e441d992d541c1ccf79df97e92d | 5,158 | py | Python | mlfromscratch/unsupervised_learning/gaussian_mixture_model.py | mmderakhshani/ML-From-Scratch | 4593ffbb64399ed9eaf4921d6c0d5430d81ec1cb | [
"MIT"
] | 6 | 2017-09-14T08:36:04.000Z | 2021-11-06T12:23:30.000Z | mlfromscratch/unsupervised_learning/gaussian_mixture_model.py | ZexinYan/ML-From-Scratch | 86ccc5273e0182b66c5d93c428f75dad61d8ced3 | [
"MIT"
] | null | null | null | mlfromscratch/unsupervised_learning/gaussian_mixture_model.py | ZexinYan/ML-From-Scratch | 86ccc5273e0182b66c5d93c428f75dad61d8ced3 | [
"MIT"
] | 1 | 2018-01-02T22:45:05.000Z | 2018-01-02T22:45:05.000Z | from __future__ import division, print_function
import sys
import os
import math
import random
from sklearn import datasets
import numpy as np
# Import helper functions
from mlfromscratch.utils.data_manipulation import normalize
from mlfromscratch.utils.data_operation import euclidean_distance, calculate_covariance_ma... | 35.819444 | 105 | 0.630865 | from __future__ import division, print_function
import sys
import os
import math
import random
from sklearn import datasets
import numpy as np
from mlfromscratch.utils.data_manipulation import normalize
from mlfromscratch.utils.data_operation import euclidean_distance, calculate_covariance_matrix
from mlfromscratch.un... | true | true |
f712cb48c2676caa70abd3795aeccf02d5574156 | 3,509 | py | Python | lnbits/core/views/generic.py | frankhinek/lnbits | 30f5eef3b547ba0626ee91bcf4bfc0dcdf8265a1 | [
"MIT"
] | null | null | null | lnbits/core/views/generic.py | frankhinek/lnbits | 30f5eef3b547ba0626ee91bcf4bfc0dcdf8265a1 | [
"MIT"
] | 1 | 2020-08-08T13:11:34.000Z | 2020-08-08T16:38:09.000Z | lnbits/core/views/generic.py | dennisreimann/lnbits | 8ea72c9934feff6307c116a91d28236f2d9f6e2a | [
"MIT"
] | null | null | null | from flask import g, abort, redirect, request, render_template, send_from_directory, url_for
from http import HTTPStatus
from os import getenv, path
from lnbits.core import core_app
from lnbits.decorators import check_user_exists, validate_uuids
from lnbits.settings import SERVICE_FEE
from ..crud import (
create_... | 35.09 | 117 | 0.717013 | from flask import g, abort, redirect, request, render_template, send_from_directory, url_for
from http import HTTPStatus
from os import getenv, path
from lnbits.core import core_app
from lnbits.decorators import check_user_exists, validate_uuids
from lnbits.settings import SERVICE_FEE
from ..crud import (
create_... | true | true |
f712ccf8aad1c576c4bb7d20447015501ae5c134 | 961 | py | Python | src/quo/layout/dummy.py | chouette254/quo | 8979afd118e77d3d0f93f9fbe8711efada7158c5 | [
"MIT"
] | 1 | 2021-02-15T03:56:00.000Z | 2021-02-15T03:56:00.000Z | src/quo/layout/dummy.py | chouette254/quo | 8979afd118e77d3d0f93f9fbe8711efada7158c5 | [
"MIT"
] | 3 | 2021-02-22T11:49:23.000Z | 2021-02-28T06:47:41.000Z | src/quo/layout/dummy.py | secretuminc/quo | c4f77d52f015c612d32ed0fc2fc79545af598f10 | [
"MIT"
] | null | null | null | """
Dummy layout. Used when somebody creates an `Application` without specifying a
`Layout`.
"""
from quo.text import HTML
from quo.keys import KeyBinder
from quo.keys.key_binding.key_processor import KeyPressEvent
from .containers import Window
from .controls import FormattedTextControl
from .dimension import D
from ... | 25.289474 | 78 | 0.707596 | from quo.text import HTML
from quo.keys import KeyBinder
from quo.keys.key_binding.key_processor import KeyPressEvent
from .containers import Window
from .controls import FormattedTextControl
from .dimension import D
from .layout import Layout
__all__ = [
"create_dummy_layout",
]
E = KeyPressEvent
def create_d... | true | true |
f712cd35d53a7f9e2846be7bc0df488a47a60401 | 581 | py | Python | koco/patch.py | inmoonlight/koco | 1ad92c91ffe47f2455190970024c948554923770 | [
"MIT"
] | 24 | 2020-05-20T14:51:59.000Z | 2021-12-12T13:08:57.000Z | koco/patch.py | alisonykim/koco | 1ad92c91ffe47f2455190970024c948554923770 | [
"MIT"
] | null | null | null | koco/patch.py | alisonykim/koco | 1ad92c91ffe47f2455190970024c948554923770 | [
"MIT"
] | 2 | 2021-01-24T20:55:05.000Z | 2022-03-17T09:36:18.000Z | import logging
import zipfile
import wget
from .utils import DOWNLOAD_DIR, make_dirs
baseurl = 'https://codeload.github.com/kocohub/{}/zip/master'
logger = logging.getLogger(__name__)
def download_dataset(dataset, verbose=True):
make_dirs(DOWNLOAD_DIR)
url = baseurl.format(dataset)
wget.download(url, ... | 23.24 | 71 | 0.719449 | import logging
import zipfile
import wget
from .utils import DOWNLOAD_DIR, make_dirs
baseurl = 'https://codeload.github.com/kocohub/{}/zip/master'
logger = logging.getLogger(__name__)
def download_dataset(dataset, verbose=True):
make_dirs(DOWNLOAD_DIR)
url = baseurl.format(dataset)
wget.download(url, ... | true | true |
f712cd5980cb2bd7a24133bce003672fd878a49a | 5,271 | py | Python | ptsemseg/loader/mapillary_vistas_loader.py | EEEGUI/Mapillary-vistas-semseg | d07a107fd08a7536f09f25e426a6f15033cbb609 | [
"MIT"
] | 14 | 2019-07-17T06:04:15.000Z | 2021-09-24T08:00:52.000Z | ptsemseg/loader/mapillary_vistas_loader.py | EEEGUI/Mapillary-vistas-semseg | d07a107fd08a7536f09f25e426a6f15033cbb609 | [
"MIT"
] | null | null | null | ptsemseg/loader/mapillary_vistas_loader.py | EEEGUI/Mapillary-vistas-semseg | d07a107fd08a7536f09f25e426a6f15033cbb609 | [
"MIT"
] | 5 | 2019-07-17T06:03:58.000Z | 2022-01-26T08:57:33.000Z | import os
import json
import torch
import numpy as np
from torch.utils import data
from PIL import Image
from ptsemseg.utils import recursive_glob
from ptsemseg.augmentations import Compose, RandomHorizontallyFlip, RandomRotate
class mapillaryVistasLoader(data.Dataset):
def __init__(
self,
root,
... | 33.788462 | 103 | 0.554544 | import os
import json
import torch
import numpy as np
from torch.utils import data
from PIL import Image
from ptsemseg.utils import recursive_glob
from ptsemseg.augmentations import Compose, RandomHorizontallyFlip, RandomRotate
class mapillaryVistasLoader(data.Dataset):
def __init__(
self,
root,
... | true | true |
f712cde8cb3f42ff94400d66337b26560b041a31 | 1,728 | py | Python | 02_Arrays/max_non_negative_subArray.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 61 | 2018-02-18T08:16:31.000Z | 2022-02-17T17:18:57.000Z | 02_Arrays/max_non_negative_subArray.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 1 | 2018-02-23T20:06:18.000Z | 2019-12-29T18:52:20.000Z | 02_Arrays/max_non_negative_subArray.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 30 | 2018-03-28T19:02:23.000Z | 2021-07-06T20:00:14.000Z | # Max Non Negative SubArray
# https://www.interviewbit.com/problems/max-non-negative-subarray/
#
# Find out the maximum sub-array of non negative numbers from an array.
# The sub-array should be continuous. That is, a sub-array created by choosing
# the second and fourth element and skipping the third element is invali... | 36.765957 | 105 | 0.538194 | # NOTE 2: If there is still a tie, then return the segment with minimum starting index
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
class Solution:
# @param A : list of integers
# @return a list of integers
def maxset(self, A):
max_sum = max_... | true | true |
f712ce0b1470383ff19a2fba7bee20d030c85cf0 | 454 | py | Python | models/dist_phold/experiment.py | MISTCARRYYOU/PythonPDEVS | 53cad29832b3c489ab037bdc487affcbf1e3f408 | [
"Apache-2.0"
] | 1 | 2018-09-19T14:42:28.000Z | 2018-09-19T14:42:28.000Z | models/dist_phold/experiment.py | MISTCARRYYOU/PythonPDEVS | 53cad29832b3c489ab037bdc487affcbf1e3f408 | [
"Apache-2.0"
] | null | null | null | models/dist_phold/experiment.py | MISTCARRYYOU/PythonPDEVS | 53cad29832b3c489ab037bdc487affcbf1e3f408 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:21:35.000Z | 2021-01-14T12:21:35.000Z | import model
import logging
import sys
sys.path.append('../../src/')
from simulator import Simulator
sys.setrecursionlimit(50000)
model = model.AutoDistPHOLD(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3]))
sim = Simulator(model)
#sim.setVerbose(None)
sim.setTerminationTime(200)
sim.setMessageCopy('custom')
sim.... | 22.7 | 81 | 0.768722 | import model
import logging
import sys
sys.path.append('../../src/')
from simulator import Simulator
sys.setrecursionlimit(50000)
model = model.AutoDistPHOLD(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3]))
sim = Simulator(model)
sim.setTerminationTime(200)
sim.setMessageCopy('custom')
sim.setStateSaving("custom... | true | true |
f712ce2546498b7793961eedc7b6a1340fa62324 | 340 | py | Python | persons/api_urls.py | mbaragiola/heimdallerp | 8d32131a20bd0f3609d772ac437f4f24622abfc7 | [
"0BSD"
] | 8 | 2016-04-07T11:58:42.000Z | 2019-06-24T01:38:12.000Z | persons/api_urls.py | mbaragiola/heimdallerp | 8d32131a20bd0f3609d772ac437f4f24622abfc7 | [
"0BSD"
] | null | null | null | persons/api_urls.py | mbaragiola/heimdallerp | 8d32131a20bd0f3609d772ac437f4f24622abfc7 | [
"0BSD"
] | null | null | null | from django.conf.urls import include, url
from persons import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'physicaladdresses', views.PhysicalAddressViewSet)
router.register(r'companies', views.CompanyViewSet)
app_name = 'persons'
urlpatterns = [
url(r'^', inclu... | 26.153846 | 67 | 0.788235 | from django.conf.urls import include, url
from persons import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'physicaladdresses', views.PhysicalAddressViewSet)
router.register(r'companies', views.CompanyViewSet)
app_name = 'persons'
urlpatterns = [
url(r'^', inclu... | true | true |
f712ce60e828ba1f2912f4462a14e369e218292b | 1,692 | py | Python | tests/jenkins/python/install_conda.py | E3SM-Project/acme_processflow | 84110cab08f7897d1489a6dc925258580a5d2bff | [
"MIT"
] | 3 | 2019-02-06T23:46:36.000Z | 2022-02-28T01:39:26.000Z | tests/jenkins/python/install_conda.py | E3SM-Project/acme_processflow | 84110cab08f7897d1489a6dc925258580a5d2bff | [
"MIT"
] | 62 | 2017-09-15T00:14:53.000Z | 2018-03-23T22:07:12.000Z | tests/jenkins/python/install_conda.py | E3SM-Project/acme_processflow | 84110cab08f7897d1489a6dc925258580a5d2bff | [
"MIT"
] | 4 | 2018-07-26T16:07:07.000Z | 2021-06-02T12:01:48.000Z | import argparse
import os
import sys
from Util import SUCCESS, FAILURE
from Util import run_cmd
parser = argparse.ArgumentParser(description="install conda",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("-w", "--workdir",
help="worki... | 29.172414 | 115 | 0.706856 | import argparse
import os
import sys
from Util import SUCCESS, FAILURE
from Util import run_cmd
parser = argparse.ArgumentParser(description="install conda",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("-w", "--workdir",
help="worki... | true | true |
f712cf680f5b3fed52d193239019e11f40f5a36d | 854 | py | Python | threads/simple_threads.py | bchekuri/python101 | b025bb52c56ee69647310a6f883c88f80697a2d0 | [
"MIT"
] | null | null | null | threads/simple_threads.py | bchekuri/python101 | b025bb52c56ee69647310a6f883c88f80697a2d0 | [
"MIT"
] | null | null | null | threads/simple_threads.py | bchekuri/python101 | b025bb52c56ee69647310a6f883c88f80697a2d0 | [
"MIT"
] | null | null | null | # Simple Threads Pool
from multiprocessing.dummy import Pool as ThreadPool
from datetime import date
from datetime import datetime
import time
multiply_results = []
def squareNumber(n):
multiply_results.append(n ** 2)
dt_string = datetime.now().strftime("%H:%M:%S")
millis = int(round(time.time() * 1000))
... | 28.466667 | 65 | 0.669789 |
from multiprocessing.dummy import Pool as ThreadPool
from datetime import date
from datetime import datetime
import time
multiply_results = []
def squareNumber(n):
multiply_results.append(n ** 2)
dt_string = datetime.now().strftime("%H:%M:%S")
millis = int(round(time.time() * 1000))
print("Each Thread... | true | true |
f712d08b33b9d9be7a030ff73142cdebe8d78a2d | 176 | py | Python | Code Bundle/Chapter03/tests/test_slow.py | ghanigreen/pytest_code | dbdcc322b3469c62ad328043060518edf2b2d83f | [
"MIT"
] | 46 | 2018-06-28T04:40:08.000Z | 2022-02-14T05:36:48.000Z | Code Bundle/Chapter03/tests/test_slow.py | ghanigreen/pytest_code | dbdcc322b3469c62ad328043060518edf2b2d83f | [
"MIT"
] | null | null | null | Code Bundle/Chapter03/tests/test_slow.py | ghanigreen/pytest_code | dbdcc322b3469c62ad328043060518edf2b2d83f | [
"MIT"
] | 22 | 2018-06-10T23:20:29.000Z | 2022-02-24T06:47:18.000Z | import pytest
@pytest.mark.slow
def test_long_computation():
...
@pytest.mark.timeout(10, method="thread")
def test_topology_sort():
...
def test_foo():
pass
| 11 | 41 | 0.664773 | import pytest
@pytest.mark.slow
def test_long_computation():
...
@pytest.mark.timeout(10, method="thread")
def test_topology_sort():
...
def test_foo():
pass
| true | true |
f712d258066fe75e06fb27363746e555f80b0561 | 13,566 | py | Python | trainer/trainer.py | vinay-swamy/gMVP | 62202baa0769dfe0e47c230e78dffa42fb1280f1 | [
"MIT"
] | 2 | 2021-04-24T03:23:40.000Z | 2021-06-28T11:51:10.000Z | trainer/trainer.py | vinay-swamy/gMVP | 62202baa0769dfe0e47c230e78dffa42fb1280f1 | [
"MIT"
] | null | null | null | trainer/trainer.py | vinay-swamy/gMVP | 62202baa0769dfe0e47c230e78dffa42fb1280f1 | [
"MIT"
] | 2 | 2021-09-14T13:03:38.000Z | 2022-03-23T02:49:19.000Z | import time
import json
import argparse
import os
import sys
import logging
import shutil
from datetime import datetime
import glob
import random
from scipy.stats import mannwhitneyu
from scipy.stats import spearmanr
import numpy as np
from sklearn.metrics import roc_auc_score, precision_recall_curve, auc
import te... | 33.830424 | 231 | 0.597523 | import time
import json
import argparse
import os
import sys
import logging
import shutil
from datetime import datetime
import glob
import random
from scipy.stats import mannwhitneyu
from scipy.stats import spearmanr
import numpy as np
from sklearn.metrics import roc_auc_score, precision_recall_curve, auc
import te... | true | true |
f712d3de3c53306b7e8cbd2a8d7569448d1f0fa1 | 150 | py | Python | mne/io/edf/__init__.py | dgwakeman/mne-python | 3cc7a3f8456d78c828355f1860dd7e0297e59c73 | [
"BSD-3-Clause"
] | 4 | 2017-10-25T18:42:30.000Z | 2019-06-15T06:48:10.000Z | mne/io/edf/__init__.py | alexandrebarachant/mne-python | b54e38c9bbac38c6f53747075b5bad2936fbc5b9 | [
"BSD-3-Clause"
] | 4 | 2015-04-20T16:10:47.000Z | 2016-11-01T13:32:48.000Z | mne/io/edf/__init__.py | alexandrebarachant/mne-python | b54e38c9bbac38c6f53747075b5bad2936fbc5b9 | [
"BSD-3-Clause"
] | 2 | 2018-04-02T06:45:11.000Z | 2018-07-16T23:39:02.000Z | """EDF+,BDF module for conversion to FIF"""
# Author: Teon Brooks <teon.brooks@gmail.com>
#
# License: BSD (3-clause)
from .edf import read_raw_edf
| 18.75 | 45 | 0.706667 |
from .edf import read_raw_edf
| true | true |
f712d4a70a34e71d9b6b998c3bb2d73d7e9cf24b | 2,349 | py | Python | minimax/algorithm.py | ARBII-xD/Checkers-Using-Minimax-Algorithm | f687757dca7689b4838a0d210abf6b255b1ab15a | [
"MIT"
] | null | null | null | minimax/algorithm.py | ARBII-xD/Checkers-Using-Minimax-Algorithm | f687757dca7689b4838a0d210abf6b255b1ab15a | [
"MIT"
] | null | null | null | minimax/algorithm.py | ARBII-xD/Checkers-Using-Minimax-Algorithm | f687757dca7689b4838a0d210abf6b255b1ab15a | [
"MIT"
] | null | null | null | from copy import deepcopy
import pygame
RED = (0,100,100)
WHITE = (255, 255, 255)
def minimax(position, depth, max_player, game):
if depth == 0 or position.winner() != None: #maximum depth reach or someone has won, returning position along with evaluating the position
return position.evaluate(), pos... | 34.544118 | 146 | 0.616007 | from copy import deepcopy
import pygame
RED = (0,100,100)
WHITE = (255, 255, 255)
def minimax(position, depth, max_player, game):
if depth == 0 or position.winner() != None: return position.evaluate(), position
if max_player: maxEval = float('-inf')
... | true | true |
f712d5b23f3d353d51169075f17ae12ccbceea2b | 785 | py | Python | python/qidoc/test/test_qidoc_clean.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | python/qidoc/test/test_qidoc_clean.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | python/qidoc/test/test_qidoc_clean.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print... | 32.708333 | 84 | 0.719745 | from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import os
def test_simple(qidoc_action):
world_proj = qidoc_action.add_test_project("world")
build_dir = os.path.join(world_proj.path, "build-doc")
assert not os.path.exists(build_dir)
... | true | true |
f712d63ef56485edfd05b220d59ea32a53d6543b | 11,764 | py | Python | src/oci/signer.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/signer.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/signer.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 43.091575 | 245 | 0.670095 |
from __future__ import absolute_import
import base64
import email.utils
import hashlib
import io
import functools
import os
from oci._vendor import six
from oci.util import record_body_position_for_rewind, rewind_body, back_up_body_calculate_stream_content_length, read_stream_for_signing
from ._vendor import httpsi... | true | true |
f712d66ca7e4d5f30fd049146ccec02a60361ca6 | 5,779 | py | Python | gnuradio-3.7.13.4/gr-analog/python/analog/qa_fastnoise.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | 1 | 2021-03-09T07:32:37.000Z | 2021-03-09T07:32:37.000Z | gnuradio-3.7.13.4/gr-analog/python/analog/qa_fastnoise.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | gnuradio-3.7.13.4/gr-analog/python/analog/qa_fastnoise.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007,2010,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | 41.278571 | 99 | 0.693719 |
from gnuradio import gr, gr_unittest, analog, blocks
import numpy
class test_fastnoise_source(gr_unittest.TestCase):
def setUp (self):
self.num = 2**22
self.num_items = 10**6
self.default_args = {"samples": self.num, "seed": 43, "ampl": 1}
def tearDown (self):
pass
def... | true | true |
f712d6e22f52ae42d8161b676b62d682117d0c50 | 4,316 | py | Python | openfoodfact/utils.py | pythonmentor/teiva-p11 | 4be26edbad6e490c3991ca1ce5680e889b2ab75a | [
"MIT",
"Unlicense"
] | null | null | null | openfoodfact/utils.py | pythonmentor/teiva-p11 | 4be26edbad6e490c3991ca1ce5680e889b2ab75a | [
"MIT",
"Unlicense"
] | 4 | 2021-03-30T14:25:16.000Z | 2021-06-17T06:53:27.000Z | openfoodfact/utils.py | pythonmentor/teiva-p11 | 4be26edbad6e490c3991ca1ce5680e889b2ab75a | [
"MIT",
"Unlicense"
] | 2 | 2020-08-15T17:23:42.000Z | 2020-08-15T17:23:55.000Z | """Useful command to download and clean data from OpenFoodfact."""
import requests
keys = [
"id",
"product_name_fr",
"nutrition_grade_fr",
"url",
"image_front_url",
"image_ingredients_url",
]
class RequestData:
"""The class fetch the data and save it in to a json file."""
def __init_... | 31.50365 | 78 | 0.568119 | import requests
keys = [
"id",
"product_name_fr",
"nutrition_grade_fr",
"url",
"image_front_url",
"image_ingredients_url",
]
class RequestData:
def __init__(self):
self.cat_url = "https://fr.openfoodfacts.org/categories.json"
self.search_url = "https://fr.openfoodfacts.or... | true | true |
f712d787e5627871c91f146aa80f27825ee8dab9 | 1,046 | py | Python | alipay/aop/api/response/AlipayDataDataexchangeDtmorseSyncResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayDataDataexchangeDtmorseSyncResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayDataDataexchangeDtmorseSyncResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayDataDataexchangeDtmorseSyncResponse(AlipayResponse):
def __init__(self):
super(AlipayDataDataexchangeDtmorseSyncResponse, self).__init__()
self._r... | 29.055556 | 114 | 0.700765 | import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayDataDataexchangeDtmorseSyncResponse(AlipayResponse):
def __init__(self):
super(AlipayDataDataexchangeDtmorseSyncResponse, self).__init__()
self._result_extent = None
self._success = No... | true | true |
f712d827a636f2d74376374332f5d9a6bde70b89 | 530 | py | Python | CarHome/CarHome/items.py | monkey-hjy/SpiderCarHome | 302e470a653f680c2b1aa72649848d61c9626ddd | [
"MIT"
] | 3 | 2020-03-23T09:57:10.000Z | 2022-02-23T08:20:23.000Z | CarHome/CarHome/items.py | monkey-hjy/SpiderCarHome | 302e470a653f680c2b1aa72649848d61c9626ddd | [
"MIT"
] | null | null | null | CarHome/CarHome/items.py | monkey-hjy/SpiderCarHome | 302e470a653f680c2b1aa72649848d61c9626ddd | [
"MIT"
] | 1 | 2021-03-29T02:41:37.000Z | 2021-03-29T02:41:37.000Z | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class CarhomeItem(scrapy.Item):
# define the fields for your item here like:
car_name = scrapy.Field()
car_url = scrapy.Field()
# 车辆评分... | 21.2 | 53 | 0.656604 |
import scrapy
class CarhomeItem(scrapy.Item):
car_name = scrapy.Field()
car_url = scrapy.Field()
car_score = scrapy.Field()
car_gray = scrapy.Field()
car_structure = scrapy.Field()
car_engine = scrapy.Field()
car_price = scrapy.Field()
pass
| true | true |
f712d8a32d790551e15d9bc33d66e68b3e000da2 | 125 | py | Python | test/run/t315.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 2,671 | 2015-01-03T08:23:25.000Z | 2022-03-31T06:15:48.000Z | test/run/t315.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 972 | 2015-01-05T08:11:00.000Z | 2022-03-29T13:47:15.000Z | test/run/t315.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 845 | 2015-01-03T19:53:36.000Z | 2022-03-29T18:34:22.000Z | def default_outside(x=[]):
return x
a = default_outside()
a.append(1)
print a
b = default_outside()
b.append(2)
print b
| 12.5 | 26 | 0.688 | def default_outside(x=[]):
return x
a = default_outside()
a.append(1)
print a
b = default_outside()
b.append(2)
print b
| false | true |
f712d8aae613059300d69cf1c8864f9738f9af0e | 32,052 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/connection_monitors_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/connection_monitors_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/connection_monitors_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | # 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 ... | 50.00312 | 217 | 0.689442 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class ConnectionMonitorsOperations(object):
models = models
def __init_... | true | true |
f712d92458ee75bbf3600c3bc00250da44027dad | 5,258 | py | Python | languages/python/docs/conf.py | hobofan/oso | 2656313dc46581a588fcf0c57dee7bf91afbb3d0 | [
"Apache-2.0"
] | null | null | null | languages/python/docs/conf.py | hobofan/oso | 2656313dc46581a588fcf0c57dee7bf91afbb3d0 | [
"Apache-2.0"
] | null | null | null | languages/python/docs/conf.py | hobofan/oso | 2656313dc46581a588fcf0c57dee7bf91afbb3d0 | [
"Apache-2.0"
] | 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:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 29.875 | 82 | 0.68391 |
import os
import sys
from sphinx.highlighting import lexers
from sphinxcontrib.spelling.filters import ContractionFilter
from enchant.tokenize import Filter
sys.path.insert(0, os.path.abspath("../django-oso"))
sys.path.insert(0, os.path.abspath("../flask-oso"))
sys.path.insert(0, os.path.abspath("../sqlalchemy-oso... | true | true |
f712d9f94983a2b03e5360c5cb331880264eac96 | 2,183 | py | Python | profil3r/app/_menu.py | fxcebx/Profil3r | 9b51f17f44e7b5cb9247bb5ed86aaf27685cb83e | [
"MIT"
] | 1 | 2021-11-17T09:47:18.000Z | 2021-11-17T09:47:18.000Z | profil3r/app/_menu.py | fxcebx/Profil3r | 9b51f17f44e7b5cb9247bb5ed86aaf27685cb83e | [
"MIT"
] | null | null | null | profil3r/app/_menu.py | fxcebx/Profil3r | 9b51f17f44e7b5cb9247bb5ed86aaf27685cb83e | [
"MIT"
] | null | null | null | from PyInquirer import prompt, Separator
# The menus displays a list of checkboxes, which allows the user to select the separators and modules he wants to use
def separators_menu(self):
# Get a list of all existing separators
separators = self.config["separators"]
separators_menu = [
{
... | 35.786885 | 139 | 0.561612 | from PyInquirer import prompt, Separator
def separators_menu(self):
separators = self.config["separators"]
separators_menu = [
{
'type': 'checkbox',
'qmark': '⚙️ ',
'message': 'Select separators',
'name': 'separators',
'choices': []
... | true | true |
f712da4b952c50969a2013d5aeb86c1c59be1dc0 | 3,466 | py | Python | watero_go/services/base_service.py | Qinnnnnn/Watero_Go | 4e277f197971ba190591a0e83b00424b075dce3d | [
"MIT"
] | null | null | null | watero_go/services/base_service.py | Qinnnnnn/Watero_Go | 4e277f197971ba190591a0e83b00424b075dce3d | [
"MIT"
] | null | null | null | watero_go/services/base_service.py | Qinnnnnn/Watero_Go | 4e277f197971ba190591a0e83b00424b075dce3d | [
"MIT"
] | null | null | null | #!/usr/bin/pythonr
# -*- coding: utf-8 -*-
"""
File : base_service.py
Author : Zerui Qin
CreateDate : 2018-12-20 10:00:00
LastModifiedDate : 2018-12-20 10:00:00
Note : Agent基础服务类, 获取Agent数据服务相关方法
"""
import datetime
import psutil
import pytz
import requests
from watero_go.utils import hardware
from watero_go.utils.l... | 33.980392 | 99 | 0.615695 |
import datetime
import psutil
import pytz
import requests
from watero_go.utils import hardware
from watero_go.utils.log import log_debug
from watero_go.utils.mapping import Route
class BaseService:
def __init__(self, p_url_prefix):
self.url_prefix = p_url_prefix
self.mac_addr = hardware.get_ma... | true | true |
f712dc5199108dec890f7de5823fae6ab14f629e | 28,210 | py | Python | tensorflow_transform/schema_inference.py | Saiprasad16/transform | 774458bf0c296f8275fedf3ace303427654dace7 | [
"Apache-2.0"
] | 1 | 2021-05-10T10:52:06.000Z | 2021-05-10T10:52:06.000Z | tensorflow_transform/schema_inference.py | Saiprasad16/transform | 774458bf0c296f8275fedf3ace303427654dace7 | [
"Apache-2.0"
] | null | null | null | tensorflow_transform/schema_inference.py | Saiprasad16/transform | 774458bf0c296f8275fedf3ace303427654dace7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. 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... | 43.668731 | 99 | 0.731301 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from typing import Callable, Dict, Mapping, Optional, Tuple
import tensorflow as tf
from tensorflow_transform import common
from tensorflow_transform import common_types
from tensorflow_tr... | true | true |
f712dc6eb272c7e1cfc8af53279c9be612493ee3 | 132 | py | Python | chia/util/default_root.py | wei-zero/shell-blockchain | f792a54b39d491efbac8e165228268716e07409e | [
"Apache-2.0"
] | 1 | 2021-09-19T18:58:32.000Z | 2021-09-19T18:58:32.000Z | chia/util/default_root.py | wei-zero/shell-blockchain | f792a54b39d491efbac8e165228268716e07409e | [
"Apache-2.0"
] | null | null | null | chia/util/default_root.py | wei-zero/shell-blockchain | f792a54b39d491efbac8e165228268716e07409e | [
"Apache-2.0"
] | null | null | null | import os
from pathlib import Path
DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("SHL_ROOT", "~/.shl/mainnet"))).resolve()
| 26.4 | 95 | 0.75 | import os
from pathlib import Path
DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("SHL_ROOT", "~/.shl/mainnet"))).resolve()
| true | true |
f712dd6bed08e1c48b8aaf9f59279ca864fa33d6 | 16,424 | py | Python | yatube/posts/tests/test_views.py | Dimanitto/yatube | 1d93d5b90c2a9f7c888ce83eac5acdc4d9ed40e2 | [
"MIT"
] | null | null | null | yatube/posts/tests/test_views.py | Dimanitto/yatube | 1d93d5b90c2a9f7c888ce83eac5acdc4d9ed40e2 | [
"MIT"
] | null | null | null | yatube/posts/tests/test_views.py | Dimanitto/yatube | 1d93d5b90c2a9f7c888ce83eac5acdc4d9ed40e2 | [
"MIT"
] | null | null | null | import shutil
import tempfile
from django.core.cache import cache
from http import HTTPStatus
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.contrib.auth import get_user_model
from django.test import Client, TestCase, override_settings
from django.urls import ... | 42.439276 | 79 | 0.631089 | import shutil
import tempfile
from django.core.cache import cache
from http import HTTPStatus
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.contrib.auth import get_user_model
from django.test import Client, TestCase, override_settings
from django.urls import ... | true | true |
f712dd6d2f6273bf1a9e18367b21be5b5e836958 | 331 | py | Python | wiske/util/logger.py | jthistle/wiskesynth | b2132c7edf79c9f52b0a67779ae77a8d427ae712 | [
"MIT"
] | null | null | null | wiske/util/logger.py | jthistle/wiskesynth | b2132c7edf79c9f52b0a67779ae77a8d427ae712 | [
"MIT"
] | null | null | null | wiske/util/logger.py | jthistle/wiskesynth | b2132c7edf79c9f52b0a67779ae77a8d427ae712 | [
"MIT"
] | null | null | null | import logging
def get_logger():
logger = logging.getLogger("debug")
hdlr = logging.FileHandler("debug.log")
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
return logger
logger = ge... | 23.642857 | 74 | 0.703927 | import logging
def get_logger():
logger = logging.getLogger("debug")
hdlr = logging.FileHandler("debug.log")
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
return logger
logger = ge... | true | true |
f712dd782c3efe97099c83a527417452c37a4862 | 3,562 | py | Python | docs/source/conf.py | jbueltemeier/pystiche_papers | d162c2db87251f9e3280fea35cf149d030dc335b | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | jbueltemeier/pystiche_papers | d162c2db87251f9e3280fea35cf149d030dc335b | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | jbueltemeier/pystiche_papers | d162c2db87251f9e3280fea35cf149d030dc335b | [
"BSD-3-Clause"
] | 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:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Imports --------------------------------------------------------------------------... | 32.981481 | 88 | 0.613419 |
import os
from datetime import datetime
from distutils.util import strtobool
from importlib_metadata import metadata
from os import path
def get_bool_env_var(name, default=False):
try:
return bool(strtobool(os.environ[name]))
except KeyError:
return default
run_by_github_actions = get_boo... | true | true |
f712ddaddf5fa16ffdec898ed9bf189ea59a2c2f | 30,939 | py | Python | kaku_events.py | bear/kaku | a86ad97eac2a9069d3b8b2897567595894f0beee | [
"MIT"
] | 26 | 2015-10-09T14:46:35.000Z | 2022-01-11T21:28:50.000Z | kaku_events.py | bear/kaku | a86ad97eac2a9069d3b8b2897567595894f0beee | [
"MIT"
] | 4 | 2016-05-10T09:28:50.000Z | 2019-12-03T02:17:18.000Z | kaku_events.py | bear/kaku | a86ad97eac2a9069d3b8b2897567595894f0beee | [
"MIT"
] | 5 | 2016-06-21T05:43:36.000Z | 2019-11-18T23:25:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright: (c) 2013-2016 by Mike Taylor
:license: CC0 1.0 Universal, see LICENSE for more details.
"""
import os
import json
import uuid
import types
import errno
import shutil
import logging
import datetime
import argparse
import pytz
import redis
import jinja2
impo... | 39.015132 | 115 | 0.531013 |
import os
import json
import uuid
import types
import errno
import shutil
import logging
import datetime
import argparse
import pytz
import redis
import jinja2
import ronkyuu
import requests
import markdown2
from bs4 import BeautifulSoup
from logging.handlers import RotatingFileHandler
from dateutil.parser import pa... | true | true |
f712de466750aaf771cb56bf97edbee3086e0194 | 2,719 | py | Python | playbooks/files/rax-maas/plugins/bonding_iface_check.py | odyssey4me/rpc-maas | 6ba26ee4e793de740124d0e22d2cee6a943440f9 | [
"Apache-2.0"
] | null | null | null | playbooks/files/rax-maas/plugins/bonding_iface_check.py | odyssey4me/rpc-maas | 6ba26ee4e793de740124d0e22d2cee6a943440f9 | [
"Apache-2.0"
] | 2 | 2020-08-13T19:29:13.000Z | 2020-08-13T21:45:39.000Z | playbooks/files/rax-maas/plugins/bonding_iface_check.py | odyssey4me/rpc-maas | 6ba26ee4e793de740124d0e22d2cee6a943440f9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 34.858974 | 74 | 0.630379 |
import argparse
import os
import subprocess
from maas_common import metric_bool
from maas_common import print_output
def bonding_ifaces_check(_):
bonding_ifaces = os.listdir("/proc/net/bonding")
for bonding_iface in bonding_ifaces:
bonding_iface_check_cmd = ['cat', '/proc/net/bonding/%s'
... | true | true |
f712df66591fc0d8b0718cae5fe6211b949499cd | 556 | py | Python | tablarray/kwtools/__init__.py | chriscannon9001/tablarray | f07530f84a8c86abe996cdb999233ed9bb8edf7e | [
"BSD-3-Clause"
] | null | null | null | tablarray/kwtools/__init__.py | chriscannon9001/tablarray | f07530f84a8c86abe996cdb999233ed9bb8edf7e | [
"BSD-3-Clause"
] | null | null | null | tablarray/kwtools/__init__.py | chriscannon9001/tablarray | f07530f84a8c86abe996cdb999233ed9bb8edf7e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
kwargs_tools
by Chris Cannon
====
Provides
1. kwargs_scan - convert header and values from csv into a dictionary
2. kwargs_db - instance = myclass(search='name')
is converted to
instance = myclass(param1, param2, ...)
... | 21.384615 | 73 | 0.625899 |
__author__ = "Chris Cannon"
__version__ = "0.0.0"
__license__ = "GPLv3"
__status__ = "Prototype"
from .kwargs_scan import *
from .kwargs_db import * | true | true |
f712e0700d6b0fc427bb1da21e1c1cd0184c3f10 | 1,715 | py | Python | ee/tasks/send_license_usage.py | asherf/posthog | 1e50704d76cba484e80b83f1e1f658bd6e98743a | [
"MIT"
] | null | null | null | ee/tasks/send_license_usage.py | asherf/posthog | 1e50704d76cba484e80b83f1e1f658bd6e98743a | [
"MIT"
] | null | null | null | ee/tasks/send_license_usage.py | asherf/posthog | 1e50704d76cba484e80b83f1e1f658bd6e98743a | [
"MIT"
] | null | null | null | import posthoganalytics
import requests
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from ee.clickhouse.client import sync_execute
from ee.models.license import License
from posthog.models import User
def send_license_usage():
license = License.objects.first_valid()
if n... | 38.111111 | 111 | 0.594752 | import posthoganalytics
import requests
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from ee.clickhouse.client import sync_execute
from ee.models.license import License
from posthog.models import User
def send_license_usage():
license = License.objects.first_valid()
if n... | true | true |
f712e0eb5555667a488c2bf52ce2443674b5782c | 1,719 | py | Python | Sec24_Design/q0284.py | OctoberChang/LeetCode-Solutions | bb7958194e7b196729611cbad19ee792ba41c429 | [
"MIT"
] | 2 | 2021-01-26T00:59:47.000Z | 2021-11-20T02:55:13.000Z | Sec24_Design/q0284.py | OctoberChang/LeetCode-Solutions | bb7958194e7b196729611cbad19ee792ba41c429 | [
"MIT"
] | null | null | null | Sec24_Design/q0284.py | OctoberChang/LeetCode-Solutions | bb7958194e7b196729611cbad19ee792ba41c429 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# Below is the interface for Iterator, which is already defined for you.
#
# class Iterator:
# def __init__(self, nums):
# """
# Initializes an iterator object to the beginning of a list.
# :type nums: List[int]
# """
#
# def hasNext(self)... | 25.656716 | 81 | 0.556719 |
# Initializes an iterator object to the beginning of a list.
# :type nums: List[int]
# """
# Returns true if the iteration has more elements.
# :rtype: bool
# """
# Returns the next element in the iteration.
# :rtype: int
# """
class PeekingItera... | true | true |
f712e225df2cc8743f4e2cf410c78b74be4c512a | 523 | py | Python | index.py | kavehkm/MiddleWareSystem | de5484d7fab6582904506dcf7db19ecfffcc8df7 | [
"Apache-2.0"
] | null | null | null | index.py | kavehkm/MiddleWareSystem | de5484d7fab6582904506dcf7db19ecfffcc8df7 | [
"Apache-2.0"
] | null | null | null | index.py | kavehkm/MiddleWareSystem | de5484d7fab6582904506dcf7db19ecfffcc8df7 | [
"Apache-2.0"
] | null | null | null | # standard
from importlib import import_module
# internal
import settings
def core_func(*args, **kwargs):
print('core_func executed with args={} + kwargs={}'.format(args, kwargs))
def set_middlewares(func):
for middleware in reversed(settings.MIDDLEWARES):
p, m = middleware.rsplit('.', 1)
mod = import_modul... | 17.433333 | 74 | 0.65392 | from importlib import import_module
import settings
def core_func(*args, **kwargs):
print('core_func executed with args={} + kwargs={}'.format(args, kwargs))
def set_middlewares(func):
for middleware in reversed(settings.MIDDLEWARES):
p, m = middleware.rsplit('.', 1)
mod = import_module(p)
met = getattr(m... | true | true |
f712e2465ddae95ed0184616de702dadd275e6fe | 3,225 | py | Python | Algorithm.Python/FinancialAdvisorDemoAlgorithm.py | theGOTOguy/Lean-1 | 99327d106cf7f6b40a5cb43d7cf40350bd6eb02a | [
"Apache-2.0"
] | null | null | null | Algorithm.Python/FinancialAdvisorDemoAlgorithm.py | theGOTOguy/Lean-1 | 99327d106cf7f6b40a5cb43d7cf40350bd6eb02a | [
"Apache-2.0"
] | null | null | null | Algorithm.Python/FinancialAdvisorDemoAlgorithm.py | theGOTOguy/Lean-1 | 99327d106cf7f6b40a5cb43d7cf40350bd6eb02a | [
"Apache-2.0"
] | null | null | null | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Lice... | 47.426471 | 150 | 0.728992 |
from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Algorithm")
AddReference("QuantConnect.Common")
from System import *
from QuantConnect import *
from QuantConnect.Algorithm import *
class FinancialAdvisorDemoAlgorithm(QCAlgorithm):
def Initialize(self):
self.SetSt... | false | true |
f712e29e44bdca122469aef17d117cb64090f78d | 1,306 | py | Python | Data_Processing/BoxPlot_error.py | ZzhKlaus/2018-SURF-Trajectory-Estimation | 71c62c816d1531f6806bfa9455fec9affe36496c | [
"MIT"
] | 14 | 2018-09-03T03:01:00.000Z | 2021-07-13T13:22:08.000Z | Data_Processing/BoxPlot_error.py | ZzhKlaus/2018-SURF-Trajectory-Estimation | 71c62c816d1531f6806bfa9455fec9affe36496c | [
"MIT"
] | null | null | null | Data_Processing/BoxPlot_error.py | ZzhKlaus/2018-SURF-Trajectory-Estimation | 71c62c816d1531f6806bfa9455fec9affe36496c | [
"MIT"
] | 13 | 2018-09-08T08:49:31.000Z | 2021-04-23T12:27:58.000Z | #By Zhenghang(Klaus) Zhong
#Box Plot of error distribution
from pandas import DataFrame
from pandas import read_csv
import pandas as pd
import numpy as np
from matplotlib import pyplot
# load results into a dataframe
filenames_128 = ['dis_diff_128.csv']
filenames_256 = ['dis_diff_256.csv']
filenames_512 = ['dis_diff_... | 29.681818 | 97 | 0.748086 |
from pandas import DataFrame
from pandas import read_csv
import pandas as pd
import numpy as np
from matplotlib import pyplot
filenames_128 = ['dis_diff_128.csv']
filenames_256 = ['dis_diff_256.csv']
filenames_512 = ['dis_diff_512.csv']
results = DataFrame()
for name in filenames_128:
results_128 = read_csv(name, h... | true | true |
f712e366441a3726dfdd8750a0e6012404d00359 | 383 | py | Python | main.py | afrigon/sharify-api | 383baa5ae089d996c2d68da8b55e566dd0cfbbf9 | [
"MIT"
] | 1 | 2020-01-06T17:29:39.000Z | 2020-01-06T17:29:39.000Z | main.py | afrigon/sharify-api | 383baa5ae089d996c2d68da8b55e566dd0cfbbf9 | [
"MIT"
] | null | null | null | main.py | afrigon/sharify-api | 383baa5ae089d996c2d68da8b55e566dd0cfbbf9 | [
"MIT"
] | 2 | 2020-01-07T14:25:38.000Z | 2021-06-23T16:10:57.000Z | import os
from dotenv import load_dotenv
from app.utils.cache import Cache
from app import ApplicationFactory
load_dotenv()
with open('./AppleMusicAuthKey.p8', 'r') as f:
os.environ['APPLE_KEY'] = f.read()
TITLE = 'Sharify'
DESCRIPTION = ''
DEBUG = os.environ.get('APP_DEBUG') or False
Cache.instance().init()
ap... | 22.529412 | 64 | 0.744125 | import os
from dotenv import load_dotenv
from app.utils.cache import Cache
from app import ApplicationFactory
load_dotenv()
with open('./AppleMusicAuthKey.p8', 'r') as f:
os.environ['APPLE_KEY'] = f.read()
TITLE = 'Sharify'
DESCRIPTION = ''
DEBUG = os.environ.get('APP_DEBUG') or False
Cache.instance().init()
ap... | true | true |
f712e38bdcebebf07f396d967e3bb465facc3362 | 648 | py | Python | src/popoto/utils/list_search.py | yudame/portfolio | 936b92e39e764e0e511c4203a978e240a0a90714 | [
"MIT"
] | 5 | 2021-11-21T01:36:02.000Z | 2022-01-28T23:16:51.000Z | src/popoto/utils/list_search.py | yudame/portfolio | 936b92e39e764e0e511c4203a978e240a0a90714 | [
"MIT"
] | 1 | 2021-12-29T13:20:17.000Z | 2021-12-29T13:20:17.000Z | src/popoto/utils/list_search.py | yudame/portfolio | 936b92e39e764e0e511c4203a978e240a0a90714 | [
"MIT"
] | null | null | null | # https://stackoverflow.com/questions/16974047/efficient-way-to-find-missing-elements-in-an-integer-sequence/16974075#16974075
from itertools import islice, chain
def window(seq, n=2):
"Returns a sliding window (of width n) over data from the iterable"
" s -> (s0,s1,...s[n-1]), (s1,s2,...,sn), ... ... | 34.105263 | 126 | 0.611111 | from itertools import islice, chain
def window(seq, n=2):
it = iter(seq)
result = tuple(islice(it, n))
if len(result) == n:
yield result
for elem in it:
result = result[1:] + (elem,)
yield result
def missing_elements(L):
missing = chain.from_iterable(range(x + 1, y) for x,... | true | true |
f712e48a3d3608959b97bc229c46bebab602676f | 10,349 | py | Python | tests/krs/test_groups.py | WIPACrepo/keycloak-rest-services | 2661b0db2dd320bdb8eefc62c805188bec52ecc7 | [
"MIT"
] | 1 | 2021-09-23T14:39:36.000Z | 2021-09-23T14:39:36.000Z | tests/krs/test_groups.py | WIPACrepo/keycloak-rest-services | 2661b0db2dd320bdb8eefc62c805188bec52ecc7 | [
"MIT"
] | 38 | 2020-08-31T22:53:09.000Z | 2022-03-28T20:55:39.000Z | tests/krs/test_groups.py | WIPACrepo/keycloak-rest-services | 2661b0db2dd320bdb8eefc62c805188bec52ecc7 | [
"MIT"
] | null | null | null | import pytest
from krs.token import get_token
from krs import groups, users
from ..util import keycloak_bootstrap
@pytest.mark.asyncio
async def test_list_groups_empty(keycloak_bootstrap):
ret = await groups.list_groups(rest_client=keycloak_bootstrap)
assert ret == {}
@pytest.mark.asyncio
async def test_lis... | 48.359813 | 104 | 0.757948 | import pytest
from krs.token import get_token
from krs import groups, users
from ..util import keycloak_bootstrap
@pytest.mark.asyncio
async def test_list_groups_empty(keycloak_bootstrap):
ret = await groups.list_groups(rest_client=keycloak_bootstrap)
assert ret == {}
@pytest.mark.asyncio
async def test_lis... | true | true |
f712e55f8833113841675aec904201ea6fc6f2de | 1,487 | py | Python | setup.py | jbn/idgraph | f610e72bed77de011f2a6610daa3fb45ea4caa8c | [
"MIT"
] | 2 | 2019-10-21T15:07:06.000Z | 2019-10-21T15:21:02.000Z | setup.py | jbn/idgraph | f610e72bed77de011f2a6610daa3fb45ea4caa8c | [
"MIT"
] | 1 | 2019-10-20T21:07:11.000Z | 2019-10-20T21:07:11.000Z | setup.py | jbn/idgraph | f610e72bed77de011f2a6610daa3fb45ea4caa8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [ ]
setup_requirements = ['pytest-run... | 30.346939 | 111 | 0.639543 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [ ]
setup_requirements = ['pytest-runner', 'requests', 'IPython', 'jmespath']
test_requirements = ['pytest... | true | true |
f712e80bcddd2868db294705cd39a8d69135bad5 | 3,615 | py | Python | xlab/local_settings.py | topd333/Xlab | 28d89b3b18717957229ca52cb2cbbbc20bd31eae | [
"Unlicense"
] | null | null | null | xlab/local_settings.py | topd333/Xlab | 28d89b3b18717957229ca52cb2cbbbc20bd31eae | [
"Unlicense"
] | null | null | null | xlab/local_settings.py | topd333/Xlab | 28d89b3b18717957229ca52cb2cbbbc20bd31eae | [
"Unlicense"
] | null | null | null | #import django.conf.global_settings as DEFAULT_SETTINGS
from .settings import *
import os
from django.utils.translation import ugettext as _
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
ADMINS = (
('Admin User', 'jamesh@linkinulife.com'),
)
... | 26.195652 | 136 | 0.6213 | from .settings import *
import os
from django.utils.translation import ugettext as _
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
ADMINS = (
('Admin User', 'jamesh@linkinulife.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
... | false | true |
f712e81c27b57e8b397111576bc790c2e0fc749e | 1,567 | py | Python | algorithms_and_data_structures/binary-search.py | amgad01/algorithms | 53eecf06e907cde806d4b78dc78fcd70d0271e3e | [
"MIT"
] | 1 | 2021-03-05T18:13:02.000Z | 2021-03-05T18:13:02.000Z | algorithms_and_data_structures/binary-search.py | amgad01/algorithms | 53eecf06e907cde806d4b78dc78fcd70d0271e3e | [
"MIT"
] | null | null | null | algorithms_and_data_structures/binary-search.py | amgad01/algorithms | 53eecf06e907cde806d4b78dc78fcd70d0271e3e | [
"MIT"
] | 1 | 2021-07-25T01:55:12.000Z | 2021-07-25T01:55:12.000Z | from util import time_it
# Time complexity: O(N)
@time_it
def linear_search(list1: [], element) -> int:
"""Returns the index of a given element in a given sorted list, otherwise returns -1"""
for index, item in enumerate(list1):
if item == element:
return index
return -1
@time_it
de... | 27.017241 | 92 | 0.611997 | from util import time_it
@time_it
def linear_search(list1: [], element) -> int:
"""Returns the index of a given element in a given sorted list, otherwise returns -1"""
for index, item in enumerate(list1):
if item == element:
return index
return -1
@time_it
def binary_search(list1: [... | false | true |
f712e8c8aad123e2fecb19d1455f5c0d1ee29767 | 1,768 | py | Python | color_format.py | among-us-bot/aque-worker | 662ac8b762af753f1d184b6e8532ef794b6a7a0a | [
"MIT"
] | 1 | 2020-11-10T18:21:59.000Z | 2020-11-10T18:21:59.000Z | color_format.py | among-us-bot/aque-worker | 662ac8b762af753f1d184b6e8532ef794b6a7a0a | [
"MIT"
] | null | null | null | color_format.py | among-us-bot/aque-worker | 662ac8b762af753f1d184b6e8532ef794b6a7a0a | [
"MIT"
] | null | null | null | """
Created by Epic at 10/13/20
Original script by FireDiscordBot on GitHub
"""
import logging
from copy import copy
from logging import Logger, DEBUG
import sys
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
def getcolor(color=N... | 24.219178 | 102 | 0.636312 |
import logging
from copy import copy
from logging import Logger, DEBUG
import sys
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
def getcolor(color=None):
return COLOR_SEQ % (30 + (color or WHITE))
def formatter_message(mes... | true | true |
f712e8db6a738c49cf8e7633062bc54f0157a74a | 713 | py | Python | main.py | python3f/spectral_clustering | bd5900dfa7ada69bd77080b905ef08ea62b420e9 | [
"MIT"
] | null | null | null | main.py | python3f/spectral_clustering | bd5900dfa7ada69bd77080b905ef08ea62b420e9 | [
"MIT"
] | null | null | null | main.py | python3f/spectral_clustering | bd5900dfa7ada69bd77080b905ef08ea62b420e9 | [
"MIT"
] | null | null | null | from sklearn.cluster import KMeans
from sklearn.neighbors import kneighbors_graph
from scipy.spatial.distance import pdist, squareform
from scipy.sparse.csgraph import laplacian
import numpy as np
"""Args:
X: input samples, array (num, dim)
n_clusters: no. of clusters
n_neighbours: neighborhood size
... | 27.423077 | 71 | 0.683029 | from sklearn.cluster import KMeans
from sklearn.neighbors import kneighbors_graph
from scipy.spatial.distance import pdist, squareform
from scipy.sparse.csgraph import laplacian
import numpy as np
def spectral_clustering(X, n_clusters=2, n_neighbors=10):
n, d = X.shape
A = kneighbors_graph(X, n_... | true | true |
f712e989579dcf78423172da1b70edb9359eb352 | 1,688 | py | Python | set_matrix_zeroes.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | 6 | 2021-05-21T01:10:42.000Z | 2021-12-16T16:12:30.000Z | set_matrix_zeroes.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | null | null | null | set_matrix_zeroes.py | tusharsadhwani/leetcode | a17a8a7587c5654f05fcd13ae7cdf47263ab2ea8 | [
"MIT"
] | null | null | null | from typing import Callable
class Solution:
def setZeroes(self, matrix: list[list[int]]) -> None:
"""Do not return anything, modify matrix in-place instead."""
first_column_zero = False
for row in matrix:
for j, cell in enumerate(row):
if cell != 0:
... | 26.375 | 74 | 0.414692 | from typing import Callable
class Solution:
def setZeroes(self, matrix: list[list[int]]) -> None:
first_column_zero = False
for row in matrix:
for j, cell in enumerate(row):
if cell != 0:
continue
row[0] = 0
if j == 0... | true | true |
f712e99b409c6e441711b6025c241579d0555fa2 | 1,611 | py | Python | froide_campaign/migrations/0002_auto_20160123_1454.py | okfde/froide-campaign | 2757888c59dcf89b2b33fba5a4fd517d046aa6cd | [
"MIT"
] | 5 | 2016-01-27T19:00:50.000Z | 2021-11-15T12:23:24.000Z | froide_campaign/migrations/0002_auto_20160123_1454.py | okfde/froide-campaign | 2757888c59dcf89b2b33fba5a4fd517d046aa6cd | [
"MIT"
] | 2 | 2020-11-02T11:48:44.000Z | 2020-11-03T15:39:46.000Z | froide_campaign/migrations/0002_auto_20160123_1454.py | okfde/froide-campaign | 2757888c59dcf89b2b33fba5a4fd517d046aa6cd | [
"MIT"
] | 1 | 2020-10-30T09:20:53.000Z | 2020-10-30T09:20:53.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('froide_campaign', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... | 32.22 | 133 | 0.599628 | from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('froide_campaign', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='informationobje... | true | true |
f712ea1efe173795afb893bc3ccf4c0139b4b0b3 | 3,709 | py | Python | orbit_transfer/models/__init__.py | sinzlab/orbit_transfer | 812d89af5c7ab26d9ea26766a4250ae023bb20b8 | [
"MIT"
] | null | null | null | orbit_transfer/models/__init__.py | sinzlab/orbit_transfer | 812d89af5c7ab26d9ea26766a4250ae023bb20b8 | [
"MIT"
] | null | null | null | orbit_transfer/models/__init__.py | sinzlab/orbit_transfer | 812d89af5c7ab26d9ea26766a4250ae023bb20b8 | [
"MIT"
] | null | null | null | import torch
import numpy as np
from torch.hub import load_state_dict_from_url
from nnfabrik.utility.nn_helpers import load_state_dict
from nntransfer.models.resnet import resnet_builder
from nntransfer.models.utils import get_model_parameters
from nntransfer.models.vgg import vgg_builder
from nntransfer.models.lene... | 35.663462 | 82 | 0.619035 | import torch
import numpy as np
from torch.hub import load_state_dict_from_url
from nnfabrik.utility.nn_helpers import load_state_dict
from nntransfer.models.resnet import resnet_builder
from nntransfer.models.utils import get_model_parameters
from nntransfer.models.vgg import vgg_builder
from nntransfer.models.lene... | true | true |
f712ea94c86b298e1e59b372d543565e614ba7a8 | 18,505 | py | Python | letsencrypt/tests/client_test.py | Alearranat/letsencrypt | e09398c9a8d11d4449ad8639472f6e212291412a | [
"Apache-2.0"
] | null | null | null | letsencrypt/tests/client_test.py | Alearranat/letsencrypt | e09398c9a8d11d4449ad8639472f6e212291412a | [
"Apache-2.0"
] | null | null | null | letsencrypt/tests/client_test.py | Alearranat/letsencrypt | e09398c9a8d11d4449ad8639472f6e212291412a | [
"Apache-2.0"
] | null | null | null | """Tests for letsencrypt.client."""
import os
import shutil
import tempfile
import unittest
import OpenSSL
import mock
from acme import jose
from letsencrypt import account
from letsencrypt import errors
from letsencrypt import le_util
from letsencrypt.tests import test_util
KEY = test_util.load_vector("rsa512_ke... | 43.954869 | 94 | 0.675277 | import os
import shutil
import tempfile
import unittest
import OpenSSL
import mock
from acme import jose
from letsencrypt import account
from letsencrypt import errors
from letsencrypt import le_util
from letsencrypt.tests import test_util
KEY = test_util.load_vector("rsa512_key.pem")
CSR_SAN = test_util.load_vec... | true | true |
f712ec4ae2274d14604fa9d454afd175219c4e6f | 2,981 | py | Python | test/language/array_types/python/SubtypedBuiltinAutoArrayTest.py | Klebert-Engineering/zserio-1 | fbb4fc42d9ab6f3afa6c040a36267357399180f4 | [
"BSD-3-Clause"
] | 2 | 2019-02-06T17:50:24.000Z | 2019-11-20T16:51:34.000Z | test/language/array_types/python/SubtypedBuiltinAutoArrayTest.py | Klebert-Engineering/zserio-1 | fbb4fc42d9ab6f3afa6c040a36267357399180f4 | [
"BSD-3-Clause"
] | 1 | 2019-11-25T16:25:51.000Z | 2019-11-25T18:09:39.000Z | test/language/array_types/python/SubtypedBuiltinAutoArrayTest.py | Klebert-Engineering/zserio-1 | fbb4fc42d9ab6f3afa6c040a36267357399180f4 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import zserio
from testutils import getZserioApi
class AutoArrayTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "array_types.zs").subtyped_builtin_auto_array
def testBitSizeOfLength1(self):
self._checkBitSizeOf(self.AUTO_ARRAY_LE... | 36.802469 | 105 | 0.724925 | import unittest
import zserio
from testutils import getZserioApi
class AutoArrayTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "array_types.zs").subtyped_builtin_auto_array
def testBitSizeOfLength1(self):
self._checkBitSizeOf(self.AUTO_ARRAY_LE... | true | true |
f712edc8a873297e7c4aff9875cda2f07f1f055b | 1,399 | py | Python | Configs/dm.py | KoshikKumar17/ilovepdf | c0a05787aa9573e3ead2e791b17bd3af4a386d6b | [
"Apache-2.0"
] | null | null | null | Configs/dm.py | KoshikKumar17/ilovepdf | c0a05787aa9573e3ead2e791b17bd3af4a386d6b | [
"Apache-2.0"
] | null | null | null | Configs/dm.py | KoshikKumar17/ilovepdf | c0a05787aa9573e3ead2e791b17bd3af4a386d6b | [
"Apache-2.0"
] | null | null | null | # fileName: Configs/dm.py
# copyright ©️ 2021 nabilanavab
import os
#--------------->
#--------> CONFIG VAR.
#------------------->
class Config(object):
# get API_ID, API_HASH values from my.telegram.org (Mandatory)
API_ID = os.environ.get("API_ID")
API_HASH = os.environ.get("API_HASH")
... | 26.903846 | 100 | 0.580415 |
import os
class Config(object):
API_ID = os.environ.get("API_ID")
API_HASH = os.environ.get("API_HASH")
API_TOKEN = os.environ.get("API_TOKEN")
UPDATE_CHANNEL = os.environ.get("UPDATE_CHANNEL")
CONVERT_API = os.environ.get("CONVERT_API")
... | true | true |
f712ee136bc001e5c792d4c74aba2a21258e8d8c | 788 | py | Python | python/quadrotorModel/rb_dynamics.py | smallpondtom/quadCaptureSim | b0433e353da9bd1f9a6a04a7cf3eeda73bd52019 | [
"MIT"
] | null | null | null | python/quadrotorModel/rb_dynamics.py | smallpondtom/quadCaptureSim | b0433e353da9bd1f9a6a04a7cf3eeda73bd52019 | [
"MIT"
] | null | null | null | python/quadrotorModel/rb_dynamics.py | smallpondtom/quadCaptureSim | b0433e353da9bd1f9a6a04a7cf3eeda73bd52019 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
#
# Copyright (c) 2021
# Georgia Institute of Technology
# Tomoki Koike
# <tkoike3@gatech.edu>
#
# *****************************************************************************
#
# DESCRIPTION:
# Rigid body dynamics ... | 22.514286 | 79 | 0.427665 |
from dataclasses import dataclass
import constants
import numpy as np
import utils
@dataclass(order=False, frozen=False)
class RBDYNAMICS:
m: float I: np.ndarray
small: int
| true | true |
f712ee5300d01cf580380c25fb563ff27ed947d0 | 227 | py | Python | pandoc/filter/python/FirstFilter/myfilter.py | mikoto2000/MiscellaneousStudy | 3717edf599fea2cf3a63bd9599ca4e1ddfdd10a6 | [
"MIT"
] | 3 | 2015-06-23T03:09:54.000Z | 2019-03-27T09:10:13.000Z | pandoc/filter/python/FirstFilter/myfilter.py | mikoto2000/MiscellaneousStudy | 3717edf599fea2cf3a63bd9599ca4e1ddfdd10a6 | [
"MIT"
] | 10 | 2017-05-18T16:19:45.000Z | 2022-02-26T06:16:43.000Z | pandoc/filter/python/FirstFilter/myfilter.py | mikoto2000/MiscellaneousStudy | 3717edf599fea2cf3a63bd9599ca4e1ddfdd10a6 | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
from pandocfilters import toJSONFilter, Link, Str
def myfilter(key, value, form, meta):
if key == 'Link':
return Str("replaced_text")
if __name__ == "__main__":
toJSONFilter(myfilter)
| 18.916667 | 49 | 0.651982 |
from pandocfilters import toJSONFilter, Link, Str
def myfilter(key, value, form, meta):
if key == 'Link':
return Str("replaced_text")
if __name__ == "__main__":
toJSONFilter(myfilter)
| true | true |
f712ee6bfe30e8b52429864f41f6b4669282abe5 | 1,352 | wsgi | Python | trac/web/templates/deploy_trac.wsgi | rwbaumg/trac | a3b8eb6db4f4999fab421e31615bb8eb8da6fdba | [
"BSD-3-Clause"
] | null | null | null | trac/web/templates/deploy_trac.wsgi | rwbaumg/trac | a3b8eb6db4f4999fab421e31615bb8eb8da6fdba | [
"BSD-3-Clause"
] | null | null | null | trac/web/templates/deploy_trac.wsgi | rwbaumg/trac | a3b8eb6db4f4999fab421e31615bb8eb8da6fdba | [
"BSD-3-Clause"
] | null | null | null | {##}#!${executable}
{##}# -*- coding: utf-8 -*-
{##}#
{##}# Copyright (C)2008-2009 Edgewall Software
{##}# Copyright (C) 2008 Noah Kantrowitz <noah@coderanger.net>
{##}# All rights reserved.
{##}#
{##}# This software is licensed as described in the file COPYING, which
{##}# you should have received as part of this dist... | 42.25 | 71 | 0.681953 | {{{{{{{{{{{{{{{{import os
def application(environ, start_request):
if not 'trac.env_parent_dir' in environ:
environ.setdefault('trac.env_path', ${repr(env.path)})
if 'PYTHON_EGG_CACHE' in environ:
os.environ['PYTHON_EGG_CACHE'] = environ['PYTHON_EGG_CACHE']
elif 'trac.env_path' in environ:
... | false | true |
f712eebd0eb39e575762499a0ae3dc87e97345a0 | 20,474 | py | Python | lib/parser.py | Harshalszz/Pansy | 07b7072994374fb0c220230fa5e37ba359e7f4b8 | [
"MIT"
] | null | null | null | lib/parser.py | Harshalszz/Pansy | 07b7072994374fb0c220230fa5e37ba359e7f4b8 | [
"MIT"
] | null | null | null | lib/parser.py | Harshalszz/Pansy | 07b7072994374fb0c220230fa5e37ba359e7f4b8 | [
"MIT"
] | null | null | null | from lib.utils import token, nodes
from lib import errors
#######################################
# PARSE RESULT
#######################################
class ParseResult:
def __init__(self):
self.error = None
self.node = None
self.last_registered_advance_count = 0
self.advanced_count = 0
self.to_reverse_c... | 26.452196 | 138 | 0.69283 | from lib.utils import token, nodes
from lib import errors
class ParseResult:
def __init__(self):
self.error = None
self.node = None
self.last_registered_advance_count = 0
self.advanced_count = 0
self.to_reverse_count = 0
def register_advancement(self):
self.advanced_count += 1
self.last_registered_ad... | true | true |
f712efa6c8e65b144dbf8de914a5873c5e8bb92d | 6,135 | py | Python | sanic_wtf/__init__.py | omarryhan/sanic-wtf | 41c24f061fa16652a82d83753c3bee56f746e23a | [
"BSD-3-Clause"
] | 3 | 2019-04-11T11:01:54.000Z | 2020-03-09T12:19:26.000Z | sanic_wtf/__init__.py | omarryhan/sanic-wtf | 41c24f061fa16652a82d83753c3bee56f746e23a | [
"BSD-3-Clause"
] | null | null | null | sanic_wtf/__init__.py | omarryhan/sanic-wtf | 41c24f061fa16652a82d83753c3bee56f746e23a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import ChainMap
from datetime import timedelta
from itertools import chain
from wtforms import Form
from wtforms.csrf.session import SessionCSRF
from wtforms.meta import DefaultMeta
from wtforms.validators import DataRequired, StopValidation
from wtforms.fields.core import Fiel... | 33.342391 | 98 | 0.631622 | from collections import ChainMap
from datetime import timedelta
from itertools import chain
from wtforms import Form
from wtforms.csrf.session import SessionCSRF
from wtforms.meta import DefaultMeta
from wtforms.validators import DataRequired, StopValidation
from wtforms.fields.core import Field
from ._patch import p... | true | true |
f712efe144ad625bebe21fb5d3a4946f8efaa3af | 2,203 | py | Python | GAN_tf/src/model/flags.py | inamori/DeepLearningImplementations | 8bbd3c5a4a7d24b2c098ba47cfd45fe2c152771d | [
"MIT"
] | 2,010 | 2016-09-22T22:22:05.000Z | 2022-03-21T02:43:21.000Z | GAN_tf/src/model/flags.py | inamori/DeepLearningImplementations | 8bbd3c5a4a7d24b2c098ba47cfd45fe2c152771d | [
"MIT"
] | 81 | 2016-09-13T01:00:06.000Z | 2021-08-17T15:10:28.000Z | GAN_tf/src/model/flags.py | inamori/DeepLearningImplementations | 8bbd3c5a4a7d24b2c098ba47cfd45fe2c152771d | [
"MIT"
] | 777 | 2016-09-10T12:44:23.000Z | 2022-01-16T04:19:55.000Z |
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
def define_flags():
############
# Run mode
############
tf.app.flags.DEFINE_string('run', None, "Which operation to run. [train|inference]")
##########################
# Training parameters
###########################
tf.app.flags... | 45.895833 | 106 | 0.622333 |
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
def define_flags():
tf.app.flags.DEFINE_string('run', None, "Which operation to run. [train|inference]")
tf.app.flags.DEFINE_integer('nb_epoch', 400, "Number of epochs")
tf.app.flags.DEFINE_integer('batch_size', 64, "Number of ... | true | true |
f712f03d95082cb78501e5b7a4c3b0f6128a8166 | 266 | py | Python | accounting/accounting/doctype/account/account.py | athul/accounting-app | cde48fde0ee96be212281b3a6a28c82e90d39d8a | [
"MIT"
] | 1 | 2021-05-17T09:48:38.000Z | 2021-05-17T09:48:38.000Z | accounting/accounting/doctype/account/account.py | athul/accounting-app | cde48fde0ee96be212281b3a6a28c82e90d39d8a | [
"MIT"
] | null | null | null | accounting/accounting/doctype/account/account.py | athul/accounting-app | cde48fde0ee96be212281b3a6a28c82e90d39d8a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Athul Cyriac Ajay and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.utils.nestedset import NestedSet
class Account(NestedSet):
pass
| 24.181818 | 56 | 0.774436 |
from __future__ import unicode_literals
from frappe.utils.nestedset import NestedSet
class Account(NestedSet):
pass
| true | true |
f712f0e14d8999105f1c03a1a69665fda1b7c3be | 2,465 | py | Python | matrixrecovery/matrixrecovery.py | kwangsungjun/lrbandit | 2f1f7ca4bbefe2bfd3e0bc50c4423a9791bfcde8 | [
"Apache-2.0"
] | 2 | 2019-08-11T22:50:49.000Z | 2021-04-21T17:48:20.000Z | matrixrecovery/matrixrecovery.py | kwangsungjun/lrbandit | 2f1f7ca4bbefe2bfd3e0bc50c4423a9791bfcde8 | [
"Apache-2.0"
] | null | null | null | matrixrecovery/matrixrecovery.py | kwangsungjun/lrbandit | 2f1f7ca4bbefe2bfd3e0bc50c4423a9791bfcde8 | [
"Apache-2.0"
] | 2 | 2019-08-11T22:52:57.000Z | 2021-09-18T05:31:32.000Z | import myutils_cython
import numpy as np, numpy.random as ra, scipy.linalg as sla
from tqdm import tqdm
def rankone(X,Z,y,r,R=.1, C=.1, tolPred=0.01, tolTh=0.01, maxIter=400, verbose=False):
"""
matrix recovery with rank-one measurements using Burer-Monteiro approach
measurement model: (X[i,:] @ Theta) @ ... | 34.71831 | 103 | 0.571197 | import myutils_cython
import numpy as np, numpy.random as ra, scipy.linalg as sla
from tqdm import tqdm
def rankone(X,Z,y,r,R=.1, C=.1, tolPred=0.01, tolTh=0.01, maxIter=400, verbose=False):
N,d = X.shape
initU = ra.randn(d,r)
U = initU
V = initU M = np.zeros( (d*r,d*r) )
hatTh = initU @ initU.... | true | true |
f712f1594cbc629a2413df1610f21e67bb57e812 | 20,937 | py | Python | tests/tests_complexity.py | kassyray/NeuroKit | b84d110a71d5d17c0d1efde0d60d00446fda16cb | [
"MIT"
] | null | null | null | tests/tests_complexity.py | kassyray/NeuroKit | b84d110a71d5d17c0d1efde0d60d00446fda16cb | [
"MIT"
] | null | null | null | tests/tests_complexity.py | kassyray/NeuroKit | b84d110a71d5d17c0d1efde0d60d00446fda16cb | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import neurokit2 as nk
import nolds
from pyentrp import entropy as pyentrp
"""
For the testing of complexity, we test our implementations against existing and established ones.
However, some of these other implementations are not really packaged in a way
SO THAT we can easily im... | 34.77907 | 188 | 0.561542 | import numpy as np
import pandas as pd
import neurokit2 as nk
import nolds
from pyentrp import entropy as pyentrp
def test_complexity_sanity():
signal = np.cos(np.linspace(start=0, stop=30, num=1000))
assert np.allclose(nk.entropy_fuzzy(signal), nk.entropy_sample(signal, fuzzy=True), atol=0.000001)
... | true | true |
f712f324f95489601d591ac5a91a4fc13b4cd06d | 63,499 | py | Python | tests/models/tapas/test_tokenization_tapas.py | shangz-ai/transformers | 75259b44bf2e2b98b5a4d431fb400b7190342a01 | [
"Apache-2.0"
] | 5 | 2020-09-01T09:15:48.000Z | 2020-09-15T03:25:05.000Z | tests/models/tapas/test_tokenization_tapas.py | shangz-ai/transformers | 75259b44bf2e2b98b5a4d431fb400b7190342a01 | [
"Apache-2.0"
] | null | null | null | tests/models/tapas/test_tokenization_tapas.py | shangz-ai/transformers | 75259b44bf2e2b98b5a4d431fb400b7190342a01 | [
"Apache-2.0"
] | 3 | 2020-08-20T04:46:25.000Z | 2020-10-14T08:39:13.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 51.044212 | 5,363 | 0.605632 | import inspect
import os
import shutil
import tempfile
import unittest
from typing import List
import numpy as np
import pandas as pd
from transformers import AddedToken
from transformers.models.tapas.tokenization_tapas import (
VOCAB_FILES_NAMES,
BasicTokenizer,
TapasTokenizer,
WordpieceTokenizer,
... | true | true |
f712f35d11e9baf743377f65259f9f175c99f59d | 9,052 | py | Python | challenges/multiview_matting/worker.py | Haiper-ai/kubric | d096ba178b8a78ea2c840ae121646d36281d31d9 | [
"Apache-2.0"
] | null | null | null | challenges/multiview_matting/worker.py | Haiper-ai/kubric | d096ba178b8a78ea2c840ae121646d36281d31d9 | [
"Apache-2.0"
] | null | null | null | challenges/multiview_matting/worker.py | Haiper-ai/kubric | d096ba178b8a78ea2c840ae121646d36281d31d9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Kubric 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 35.085271 | 91 | 0.715091 |
import logging
import numpy as np
import kubric as kb
from kubric.renderer import Blender as KubricRenderer
source_path = (
"gs://tensorflow-graphics/public/60c9de9c410be30098c297ac/ShapeNetCore.v2")
parser = kb.ArgumentParser()
parser.set_defaults(
seed=1,
frame_start=1,
frame_end=10,
width=128,
heig... | true | true |
f712f558e36700c9a2b16f8b5e67cffbd02340f7 | 558 | py | Python | booking/migrations/0012_auto_20210920_0214.py | starsouf/Python-Django-web-app | 0af1a4f97a7b7583858bd3e487d8a1b502b4daa7 | [
"Unlicense"
] | null | null | null | booking/migrations/0012_auto_20210920_0214.py | starsouf/Python-Django-web-app | 0af1a4f97a7b7583858bd3e487d8a1b502b4daa7 | [
"Unlicense"
] | null | null | null | booking/migrations/0012_auto_20210920_0214.py | starsouf/Python-Django-web-app | 0af1a4f97a7b7583858bd3e487d8a1b502b4daa7 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.2 on 2021-09-20 06:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('booking', '0011_auto_20210920_0204'),
]
operations = [
migrations.AlterField(
model_name='appointment',
name='appoin... | 29.368421 | 205 | 0.611111 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('booking', '0011_auto_20210920_0204'),
]
operations = [
migrations.AlterField(
model_name='appointment',
name='appointment_statue',
field=models.CharFiel... | true | true |
f712f6558ed50db7fff7120d2677a6ee59fe1aa4 | 15,039 | py | Python | defoe/fmp/document.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 2 | 2022-02-14T12:10:54.000Z | 2022-02-14T12:35:44.000Z | defoe/fmp/document.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 17 | 2022-02-09T21:46:14.000Z | 2022-02-25T14:55:09.000Z | defoe/fmp/document.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 1 | 2022-02-14T13:19:08.000Z | 2022-02-14T13:19:08.000Z | """
Object model representation of a document represented as a collection
of XML files in METS/MODS format.
"""
from defoe.fmp.page import Page
from lxml import etree
import re
class Document(object):
"""
Object model representation of a document represented as a
collection of XML files in METS/MODS for... | 33.948081 | 191 | 0.554558 |
from defoe.fmp.page import Page
from lxml import etree
import re
class Document(object):
def __init__(self, code, archive):
self.namespaces = {
"mods": "http://www.loc.gov/mods/v3",
"mets": "http://www.loc.gov/METS/",
"xsi": "http://www.w3.org/2001/XMLSchema-instance... | true | true |
f712f6eace062c31fb8cd15f637e74b23214b100 | 4,302 | py | Python | tfnn_mlp.py | KiLJ4EdeN/tf2_nn | 0ccec7692f061e7e066a4a2439683e3b09faa7bc | [
"MIT"
] | 1 | 2021-11-19T16:04:39.000Z | 2021-11-19T16:04:39.000Z | tfnn_mlp.py | KiLJ4EdeN/tf2_nn | 0ccec7692f061e7e066a4a2439683e3b09faa7bc | [
"MIT"
] | null | null | null | tfnn_mlp.py | KiLJ4EdeN/tf2_nn | 0ccec7692f061e7e066a4a2439683e3b09faa7bc | [
"MIT"
] | null | null | null | import tensorflow as tf
import matplotlib.pyplot as plt
# MNIST dataset parameters.
num_classes = 10 # 0 to 9 digits
num_features = 784 # 28*28
# Training parameters.
learning_rate = 0.001
training_steps = 1000
batch_size = 256
display_step = 100
# Network parameters.
n_hidden_1 = 128 # 1st layer number of neurons.
... | 37.736842 | 91 | 0.718968 | import tensorflow as tf
import matplotlib.pyplot as plt
num_classes = 10 num_features = 784
learning_rate = 0.001
training_steps = 1000
batch_size = 256
display_step = 100
n_hidden_1 = 128 n_hidden_2 = 256
from tensorflow.keras.datasets import mnist
(X_train, Y_train), (X_test, Y_test) = mnist.load_data()
X_train =... | true | true |
f712f7710849a450ed29af68d0147dcb2e216c9f | 665 | py | Python | tests/conftest.py | sebastien-prudhomme/docker-pytest | fc1b4ed3af860a40f95bff04b7f8e434fe16432e | [
"MIT"
] | null | null | null | tests/conftest.py | sebastien-prudhomme/docker-pytest | fc1b4ed3af860a40f95bff04b7f8e434fe16432e | [
"MIT"
] | 85 | 2021-11-23T22:30:20.000Z | 2022-02-21T03:14:01.000Z | tests/conftest.py | sebastien-prudhomme/docker-pytest | fc1b4ed3af860a40f95bff04b7f8e434fe16432e | [
"MIT"
] | 1 | 2021-12-06T17:33:06.000Z | 2021-12-06T17:33:06.000Z | import subprocess
import pytest
import testinfra
def pytest_addoption(parser):
parser.addoption("--image")
@pytest.fixture(scope="session")
def image(request):
return request.config.getoption("--image")
@pytest.fixture(scope="session")
def host(image):
run_command = ["docker", "run", "-d", image, "sl... | 20.78125 | 69 | 0.697744 | import subprocess
import pytest
import testinfra
def pytest_addoption(parser):
parser.addoption("--image")
@pytest.fixture(scope="session")
def image(request):
return request.config.getoption("--image")
@pytest.fixture(scope="session")
def host(image):
run_command = ["docker", "run", "-d", image, "sl... | true | true |
f712f7cf75786e46db7389f593830972a3844b31 | 2,501 | py | Python | cirq-core/cirq/contrib/routing/device_test.py | stubbi/Cirq | 6d2cd16991bd7fde352010d31010f85d7eafc0ba | [
"Apache-2.0"
] | 2 | 2019-01-12T07:10:32.000Z | 2020-09-08T03:47:22.000Z | cirq-core/cirq/contrib/routing/device_test.py | resduo/Cirq | 680f897345eb1c71c9242515edda8f04b8594319 | [
"Apache-2.0"
] | 5 | 2020-08-20T01:03:57.000Z | 2021-04-13T00:26:48.000Z | cirq-core/cirq/contrib/routing/device_test.py | resduo/Cirq | 680f897345eb1c71c9242515edda8f04b8594319 | [
"Apache-2.0"
] | 1 | 2019-06-17T11:21:53.000Z | 2019-06-17T11:21:53.000Z | # Copyright 2019 The Cirq Developers
#
# 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 ... | 30.5 | 88 | 0.656937 |
import pytest
import networkx as nx
import cirq
import cirq.contrib.routing as ccr
def test_xmon_device_to_graph():
with cirq.testing.assert_deprecated("gridqubits_to_graph_device", deadline="v0.12"):
class TestDevice:
qubits = cirq.GridQubit.rect(2, 11)
foxtail_graph = ccr.xmon_d... | true | true |
f712f7f0a4f7bb5575b634061313c5538d1a265f | 10,549 | py | Python | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/auto_rest_bool_test_service/operations/bool_model_operations.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | 3 | 2018-03-20T22:36:32.000Z | 2021-07-15T02:36:51.000Z | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/auto_rest_bool_test_service/operations/bool_model_operations.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/auto_rest_bool_test_service/operations/bool_model_operations.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | 1 | 2019-07-20T12:20:03.000Z | 2019-07-20T12:20:03.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 ... | 35.046512 | 91 | 0.645274 |
from msrest.pipeline import ClientRawResponse
from .. import models
class BoolModelOperations(object):
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.config = config
de... | true | true |
f712f93fa50415847d9a2a993a502e1fbea5717c | 761 | py | Python | ConfirmVersionAndTag.py | matthewfcarlson/edk2-pytool-extensions | 60a6b32a8a9e8deaed7fd197779a27a8bbf44c84 | [
"BSD-2-Clause-Patent"
] | null | null | null | ConfirmVersionAndTag.py | matthewfcarlson/edk2-pytool-extensions | 60a6b32a8a9e8deaed7fd197779a27a8bbf44c84 | [
"BSD-2-Clause-Patent"
] | null | null | null | ConfirmVersionAndTag.py | matthewfcarlson/edk2-pytool-extensions | 60a6b32a8a9e8deaed7fd197779a27a8bbf44c84 | [
"BSD-2-Clause-Patent"
] | null | null | null | ## @file
# Quick script to check that the wheel/package created is aligned on a git tag.
# Official releases should not be made from non-tagged code.
#
# Copyright (c) Microsoft Corporation
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import glob
import os
import sys
p = os.path.join(os.getcwd(), "dist")
whlfi... | 27.178571 | 79 | 0.678055 |
import glob
import os
import sys
p = os.path.join(os.getcwd(), "dist")
whlfile = glob.glob(os.path.join(p, "*.whl"))
if(len(whlfile) != 1):
for filename in whlfile:
print(filename)
raise Exception("Too many wheel files")
rfn = os.path.relpath(whlfile[0], os.getcwd())
v = rfn.split("-")[1]
if v.count("... | true | true |
f712f954c7bbf6e7b96547d67794e6b38cba128d | 278 | py | Python | ex096.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | ex096.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | ex096.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | def area(c, la):
print(f'A area de um terreno {c :.2f}m x {la :.2f}m é de {c * la :.2f}m².')
# Programa principal
print(f'{"Controle de Terrenos" :^30}\n'
f'{"-" * 30}')
comp = float(input('Comprimento (m)): '))
larg = float(input('Largura (m): '))
area(comp, larg)
| 25.272727 | 79 | 0.571942 | def area(c, la):
print(f'A area de um terreno {c :.2f}m x {la :.2f}m é de {c * la :.2f}m².')
print(f'{"Controle de Terrenos" :^30}\n'
f'{"-" * 30}')
comp = float(input('Comprimento (m)): '))
larg = float(input('Largura (m): '))
area(comp, larg)
| true | true |
f712f97584455965df05168aab1f03822ef439d1 | 977 | py | Python | igibson/utils/data_utils/ext_object/scripts/step_2_merge.py | mamadbiabon/iGibson | d416a470240eb7ad86e04fee475ae4bd67263a7c | [
"MIT"
] | 360 | 2020-04-02T11:12:09.000Z | 2022-03-24T21:46:58.000Z | igibson/utils/data_utils/ext_object/scripts/step_2_merge.py | mamadbiabon/iGibson | d416a470240eb7ad86e04fee475ae4bd67263a7c | [
"MIT"
] | 169 | 2020-04-07T21:01:05.000Z | 2022-03-31T10:07:39.000Z | igibson/utils/data_utils/ext_object/scripts/step_2_merge.py | mamadbiabon/iGibson | d416a470240eb7ad86e04fee475ae4bd67263a7c | [
"MIT"
] | 94 | 2020-04-09T23:22:17.000Z | 2022-03-17T21:49:03.000Z | import os
import sys
import bpy
script_dir = os.path.dirname(os.path.abspath(__file__))
utils_dir = os.path.join(script_dir, "../../blender_utils")
sys.path.append(utils_dir)
from utils import clean_unused, import_obj_folder
model_id = sys.argv[-3]
obj_dir = sys.argv[-2]
save_dir = sys.argv[-1]
os.makedirs(save_dir,... | 26.405405 | 64 | 0.733879 | import os
import sys
import bpy
script_dir = os.path.dirname(os.path.abspath(__file__))
utils_dir = os.path.join(script_dir, "../../blender_utils")
sys.path.append(utils_dir)
from utils import clean_unused, import_obj_folder
model_id = sys.argv[-3]
obj_dir = sys.argv[-2]
save_dir = sys.argv[-1]
os.makedirs(save_dir,... | true | true |
f712f9a4f811eb447ce4ca49292f63080e7cea3d | 9,291 | py | Python | app/fsr_cfg.py | tappi287/openvr_fsr_app | a41feca64b53a42dc4808ea5f16ad1d3a851eaf9 | [
"MIT"
] | 146 | 2021-07-21T23:03:53.000Z | 2022-03-30T15:03:01.000Z | app/fsr_cfg.py | tappi287/openvr_fsr_app | a41feca64b53a42dc4808ea5f16ad1d3a851eaf9 | [
"MIT"
] | 45 | 2021-08-09T12:19:44.000Z | 2022-03-31T14:22:08.000Z | app/fsr_cfg.py | tappi287/openvr_fsr_app | a41feca64b53a42dc4808ea5f16ad1d3a851eaf9 | [
"MIT"
] | 5 | 2021-09-03T16:12:15.000Z | 2022-01-22T07:45:35.000Z | from .openvr_mod_cfg import OpenVRModCfgSetting, OpenVRModSettings
class FsrSettings(OpenVRModSettings):
cfg_key = 'fsr'
format = 'cfg'
def __init__(self):
self.enabled = OpenVRModCfgSetting(
key='enabled',
name='Enabled',
category='FSR Settings',
d... | 45.321951 | 113 | 0.551394 | from .openvr_mod_cfg import OpenVRModCfgSetting, OpenVRModSettings
class FsrSettings(OpenVRModSettings):
cfg_key = 'fsr'
format = 'cfg'
def __init__(self):
self.enabled = OpenVRModCfgSetting(
key='enabled',
name='Enabled',
category='FSR Settings',
d... | true | true |
f712f9debe1711e0dceba667d636b17c24e7f00f | 19,164 | py | Python | projectRoot/env/Lib/site-packages/django/contrib/staticfiles/storage.py | russellgoldman/Beer-Finder | 89b8493f72cb77cc79896b4221d5d8b7953bb5f6 | [
"MIT"
] | 3 | 2018-05-12T18:13:19.000Z | 2018-05-27T00:06:31.000Z | projectRoot/env/Lib/site-packages/django/contrib/staticfiles/storage.py | russellgoldman/Beer-Finder | 89b8493f72cb77cc79896b4221d5d8b7953bb5f6 | [
"MIT"
] | 1 | 2020-06-05T18:32:05.000Z | 2020-06-05T18:32:05.000Z | projectRoot/env/Lib/site-packages/django/contrib/staticfiles/storage.py | russellgoldman/Beer-Finder | 89b8493f72cb77cc79896b4221d5d8b7953bb5f6 | [
"MIT"
] | 5 | 2018-05-17T18:08:26.000Z | 2018-12-10T17:37:11.000Z | import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from urllib.parse import unquote, urldefrag, urlsplit, urlunsplit
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
Invali... | 38.481928 | 113 | 0.593143 | import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from urllib.parse import unquote, urldefrag, urlsplit, urlunsplit
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
Invali... | true | true |
f712fa692140b87d42856b40c9e6ecd289c79a5a | 408 | py | Python | frontends/pytorch/test/extension_coexistence.py | cathyzhyi/mlir-npcomp | 79a3f639bfb449ba1409ff6dff161badf5a11b44 | [
"Apache-2.0"
] | null | null | null | frontends/pytorch/test/extension_coexistence.py | cathyzhyi/mlir-npcomp | 79a3f639bfb449ba1409ff6dff161badf5a11b44 | [
"Apache-2.0"
] | 6 | 2020-10-21T18:18:10.000Z | 2021-04-02T20:38:28.000Z | frontends/pytorch/test/extension_coexistence.py | cathyzhyi/mlir-npcomp | 79a3f639bfb449ba1409ff6dff161badf5a11b44 | [
"Apache-2.0"
] | null | null | null | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See frontends/pytorch/LICENSE for license information.
# Some checks that we can import the various extensions and libraries and
# not have symbol collisions or other goings on.
# RUN: %PYTHON %s
import sys
print(f"PYTHONPATH={sys.path}")
impo... | 21.473684 | 73 | 0.764706 |
import sys
print(f"PYTHONPATH={sys.path}")
import mlir
import npcomp
import _npcomp
import _torch_mlir
print("Extensions all loaded")
| true | true |
f712fa9c033a17ba9d2b04ae09b2bba1b4db81c7 | 10,862 | py | Python | libcloud/loadbalancer/drivers/alb.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | null | null | null | libcloud/loadbalancer/drivers/alb.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | null | null | null | libcloud/loadbalancer/drivers/alb.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 1 | 2021-11-04T21:48:14.000Z | 2021-11-04T21:48:14.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 33.732919 | 78 | 0.614712 |
__all__ = [
'ApplicationLBDriver'
]
from libcloud.utils.xml import findtext, findall
from libcloud.loadbalancer.types import State
from libcloud.loadbalancer.base import Driver, LoadBalancer, Member
from libcloud.common.aws import AWSGenericResponse, SignedAWSConnection
VERSION = '2015-12-01'
HOST = 'elasticloa... | true | true |
f712fac6bd1822c194117ca4f70daa44951941ca | 23,640 | py | Python | ummeli/base/migrations/0025_auto__add_field_userban_is_unbanned.py | praekelt/ummeli | c09731ed9a3a40359e81dcf6ed365797606ae9e2 | [
"BSD-3-Clause"
] | null | null | null | ummeli/base/migrations/0025_auto__add_field_userban_is_unbanned.py | praekelt/ummeli | c09731ed9a3a40359e81dcf6ed365797606ae9e2 | [
"BSD-3-Clause"
] | null | null | null | ummeli/base/migrations/0025_auto__add_field_userban_is_unbanned.py | praekelt/ummeli | c09731ed9a3a40359e81dcf6ed365797606ae9e2 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserBan.is_unbanned'
db.add_column('base_userban', 'is_unbanned', self.gf('django.db.model... | 84.731183 | 201 | 0.554103 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column('base_userban', 'is_unbanned', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=Fa... | true | true |
f712fac84d590819f808ab2c2adec2ef2541b025 | 2,277 | py | Python | test/test_profile_audiences_changes.py | talon-one/talon_one.py | f863bb3c2cc5ddc94d9227adcf14947b2ea7db41 | [
"MIT"
] | 1 | 2021-03-05T06:41:26.000Z | 2021-03-05T06:41:26.000Z | test/test_profile_audiences_changes.py | talon-one/talon_one.py | f863bb3c2cc5ddc94d9227adcf14947b2ea7db41 | [
"MIT"
] | 1 | 2021-09-07T08:56:58.000Z | 2021-09-07T08:56:58.000Z | test/test_profile_audiences_changes.py | talon-one/talon_one.py | f863bb3c2cc5ddc94d9227adcf14947b2ea7db41 | [
"MIT"
] | 1 | 2019-05-21T10:27:54.000Z | 2019-05-21T10:27:54.000Z | # coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | 35.578125 | 647 | 0.645586 |
from __future__ import absolute_import
import unittest
import datetime
import talon_one
from talon_one.models.profile_audiences_changes import ProfileAudiencesChanges from talon_one.rest import ApiException
class TestProfileAudiencesChanges(unittest.TestCase):
def setUp(self):
pass
def tearDown... | true | true |
f712fc10c849490c50a12ea4f35d86af02b77820 | 1,407 | py | Python | src/subcommands/listers/list_users.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 8 | 2021-12-08T05:33:58.000Z | 2022-03-07T00:40:48.000Z | src/subcommands/listers/list_users.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 34 | 2021-08-11T03:59:33.000Z | 2022-03-10T05:39:26.000Z | src/subcommands/listers/list_users.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 1 | 2022-01-08T07:34:55.000Z | 2022-01-08T07:34:55.000Z | #!/usr/bin/env python3
"""
List all users registered in <CWL_ICA_REPO_PATH>/config/user.yaml
"""
from classes.command import Command
from utils.logging import get_logger
import pandas as pd
from utils.repo import read_yaml, get_user_yaml_path
import sys
logger = get_logger()
class ListUsers(Command):
"""Usage:... | 21.984375 | 78 | 0.636105 |
from classes.command import Command
from utils.logging import get_logger
import pandas as pd
from utils.repo import read_yaml, get_user_yaml_path
import sys
logger = get_logger()
class ListUsers(Command):
def __init__(self, command_argv):
super().__init__(command_argv)
self.ch... | true | true |
f712fc37bbc5834d89b087770d9385645d23ac35 | 287 | py | Python | delphi/distributions/__init__.py | pstefanou12/icml-submission | 341cc13cbd0a7a3a38c94b1adab80dbe0a98718c | [
"MIT"
] | null | null | null | delphi/distributions/__init__.py | pstefanou12/icml-submission | 341cc13cbd0a7a3a38c94b1adab80dbe0a98718c | [
"MIT"
] | null | null | null | delphi/distributions/__init__.py | pstefanou12/icml-submission | 341cc13cbd0a7a3a38c94b1adab80dbe0a98718c | [
"MIT"
] | null | null | null | from .censored_normal import CensoredNormal
from .censored_multivariate_normal import CensoredMultivariateNormal
from .truncated_normal import TruncatedNormal
from .truncated_multivariate_normal import TruncatedMultivariateNormal
from .truncated_boolean_product import TruncatedBernoulli | 57.4 | 70 | 0.916376 | from .censored_normal import CensoredNormal
from .censored_multivariate_normal import CensoredMultivariateNormal
from .truncated_normal import TruncatedNormal
from .truncated_multivariate_normal import TruncatedMultivariateNormal
from .truncated_boolean_product import TruncatedBernoulli | true | true |
f712fcb88b0b58b27af1bae0b47800d64b53266b | 3,419 | py | Python | testing/test_dynamic_function_error_suppression.py | python-discord/flake8-annotations | f96dd508d5b2c0bcaf3019d6dcfe65612e6cef78 | [
"MIT"
] | 49 | 2019-08-06T20:54:38.000Z | 2020-09-02T10:59:24.000Z | testing/test_dynamic_function_error_suppression.py | python-discord/flake8-annotations | f96dd508d5b2c0bcaf3019d6dcfe65612e6cef78 | [
"MIT"
] | 73 | 2019-08-06T18:02:54.000Z | 2020-08-31T12:21:39.000Z | testing/test_dynamic_function_error_suppression.py | python-discord/flake8-annotations | f96dd508d5b2c0bcaf3019d6dcfe65612e6cef78 | [
"MIT"
] | 12 | 2019-08-08T20:25:59.000Z | 2020-09-02T18:17:48.000Z | from typing import Tuple
import pytest
from flake8_annotations.error_codes import Error
from testing.helpers import check_is_empty, check_is_not_empty, check_source
from testing.test_cases.dynamic_function_test_cases import (
DynamicallyTypedFunctionTestCase,
DynamicallyTypedNestedFunctionTestCase,
dynami... | 38.852273 | 99 | 0.705762 | from typing import Tuple
import pytest
from flake8_annotations.error_codes import Error
from testing.helpers import check_is_empty, check_is_not_empty, check_source
from testing.test_cases.dynamic_function_test_cases import (
DynamicallyTypedFunctionTestCase,
DynamicallyTypedNestedFunctionTestCase,
dynami... | true | true |
f712fcca54f7c24c8947bd7ce93370ffecca026f | 408 | py | Python | tests.py | justin4480/spelling | b209a95aa7d95ec7febd576db03377ee3368e05d | [
"MIT"
] | null | null | null | tests.py | justin4480/spelling | b209a95aa7d95ec7febd576db03377ee3368e05d | [
"MIT"
] | null | null | null | tests.py | justin4480/spelling | b209a95aa7d95ec7febd576db03377ee3368e05d | [
"MIT"
] | null | null | null | from main import Word, Wordgroup
print('start')
i = 22
wg = Wordgroup()
wg.create_wordgroup(f'wordgroup_test{i}')
wa = Word()
wa.create_word(f'word_test{i}a', wg)
wb = Word()
wb.create_word(f'word_test{i}b', wg)
wg = Wordgroup()
wg.load_wordgroup(f'wordgroup_test{i}')
wa = Word()
wa.load_word(f'word_test{i}a')
wb... | 15.111111 | 41 | 0.696078 | from main import Word, Wordgroup
print('start')
i = 22
wg = Wordgroup()
wg.create_wordgroup(f'wordgroup_test{i}')
wa = Word()
wa.create_word(f'word_test{i}a', wg)
wb = Word()
wb.create_word(f'word_test{i}b', wg)
wg = Wordgroup()
wg.load_wordgroup(f'wordgroup_test{i}')
wa = Word()
wa.load_word(f'word_test{i}a')
wb... | true | true |
f712fdb394a818d1ca7adba3026bbe8e490a5839 | 2,122 | py | Python | src/app/test/api/http/unit/handlers/v1/admin_test.py | ExpressHermes/beer-garden | 2ea0944d7528a8127bc1b79d16d8fdc668f1c8e4 | [
"MIT"
] | 230 | 2018-02-03T01:33:45.000Z | 2022-02-20T22:07:25.000Z | src/app/test/api/http/unit/handlers/v1/admin_test.py | ExpressHermes/beer-garden | 2ea0944d7528a8127bc1b79d16d8fdc668f1c8e4 | [
"MIT"
] | 961 | 2018-02-06T11:22:40.000Z | 2022-03-24T15:22:33.000Z | src/app/test/api/http/unit/handlers/v1/admin_test.py | ExpressHermes/beer-garden | 2ea0944d7528a8127bc1b79d16d8fdc668f1c8e4 | [
"MIT"
] | 33 | 2018-02-04T18:00:07.000Z | 2021-12-15T13:07:22.000Z | # -*- coding: utf-8 -*-
import unittest
from mock import MagicMock, Mock, patch
from tornado.gen import Future
from .. import TestHandlerBase
@unittest.skip("TODO")
class AdminAPITest(TestHandlerBase):
def setUp(self):
self.client_mock = MagicMock(name="client_mock")
self.fake_context = MagicMoc... | 34.786885 | 78 | 0.638077 | import unittest
from mock import MagicMock, Mock, patch
from tornado.gen import Future
from .. import TestHandlerBase
@unittest.skip("TODO")
class AdminAPITest(TestHandlerBase):
def setUp(self):
self.client_mock = MagicMock(name="client_mock")
self.fake_context = MagicMock(
__enter__... | true | true |
f712ff3202a32d3e17ff93147d1fcf3e2d1d5750 | 1,244 | py | Python | examples/plotting_utils.py | Broly498/sentinel2-cloud-detector | 912880fcd6fed482475b4cd8da07bda17993ebe8 | [
"CC0-1.0"
] | null | null | null | examples/plotting_utils.py | Broly498/sentinel2-cloud-detector | 912880fcd6fed482475b4cd8da07bda17993ebe8 | [
"CC0-1.0"
] | null | null | null | examples/plotting_utils.py | Broly498/sentinel2-cloud-detector | 912880fcd6fed482475b4cd8da07bda17993ebe8 | [
"CC0-1.0"
] | null | null | null | """
Plotting utilities for example notebooks
"""
import matplotlib.pyplot as plt
import numpy as np
def plot_image(image=None, mask=None, ax=None, factor=3.5/255, clip_range=(0, 1), **kwargs):
""" Utility function for plotting RGB images and masks.
"""
if ax is None:
_, ax = plt.subplots(nrows=1, ... | 29.619048 | 99 | 0.635048 | import matplotlib.pyplot as plt
import numpy as np
def plot_image(image=None, mask=None, ax=None, factor=3.5/255, clip_range=(0, 1), **kwargs):
if ax is None:
_, ax = plt.subplots(nrows=1, ncols=1, figsize=(15, 15))
mask_color = [255, 255, 255, 255] if image is None else [255, 255, 0, 100]
if im... | true | true |
f712ff51027a96befc2a75d344cf5da30ad5c687 | 112 | py | Python | hello/urls.py | mk-knight23/django-project | ce03d27c0b95eb09d4aa35b298d23409540894ff | [
"MIT"
] | 1 | 2020-12-24T12:36:46.000Z | 2020-12-24T12:36:46.000Z | hello/urls.py | mk-knight23/django-project | ce03d27c0b95eb09d4aa35b298d23409540894ff | [
"MIT"
] | null | null | null | hello/urls.py | mk-knight23/django-project | ce03d27c0b95eb09d4aa35b298d23409540894ff | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.home , name="homepage"),
]
| 16 | 43 | 0.669643 | from django.urls import path
from . import views
urlpatterns = [
path('', views.home , name="homepage"),
]
| true | true |
f712ffe3f187336770e99740630606a865844c02 | 560 | py | Python | team_builder/accounts/urls.py | squadran2003/Social-Team-Builder | 08fdab7cf176de0daf38078cd9fcd5f17501cef8 | [
"MIT"
] | null | null | null | team_builder/accounts/urls.py | squadran2003/Social-Team-Builder | 08fdab7cf176de0daf38078cd9fcd5f17501cef8 | [
"MIT"
] | null | null | null | team_builder/accounts/urls.py | squadran2003/Social-Team-Builder | 08fdab7cf176de0daf38078cd9fcd5f17501cef8 | [
"MIT"
] | null | null | null | from django.urls import path, include
from .views import (ProfileView, ApplicantView,
loginView, sign_out, SignupView)
app_name = 'accounts'
urlpatterns = [
path('profile/edit/', ProfileView.as_view(), name='edit_profile'),
path('profile/<option>/', ProfileView.as_view(), name='profile'),
... | 31.111111 | 75 | 0.658929 | from django.urls import path, include
from .views import (ProfileView, ApplicantView,
loginView, sign_out, SignupView)
app_name = 'accounts'
urlpatterns = [
path('profile/edit/', ProfileView.as_view(), name='edit_profile'),
path('profile/<option>/', ProfileView.as_view(), name='profile'),
... | true | true |
f712ffe6fe5c0a6c8759123f756a187d71de3fdd | 8,081 | py | Python | homeassistant/components/miflora/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 2 | 2021-01-29T02:52:01.000Z | 2021-05-15T04:23:18.000Z | homeassistant/components/miflora/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 68 | 2020-07-23T07:13:53.000Z | 2022-03-31T06:01:48.000Z | homeassistant/components/miflora/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 7 | 2021-03-20T12:34:01.000Z | 2021-12-02T10:13:52.000Z | """Support for Xiaomi Mi Flora BLE plant sensor."""
from datetime import timedelta
import logging
import btlewrap
from btlewrap import BluetoothBackendException
from miflora import miflora_poller
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
... | 30.379699 | 87 | 0.643361 |
from datetime import timedelta
import logging
import btlewrap
from btlewrap import BluetoothBackendException
from miflora import miflora_poller
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassistant.const import ... | true | true |
f712ffebf55ea52b9d968763e92a05b11a563ee3 | 12,387 | py | Python | qa/rpc-tests/util.py | VZUH-dev/VZUH | 5c3fcdb7cd439b2537217d5bc797b459a1518270 | [
"MIT"
] | null | null | null | qa/rpc-tests/util.py | VZUH-dev/VZUH | 5c3fcdb7cd439b2537217d5bc797b459a1518270 | [
"MIT"
] | null | null | null | qa/rpc-tests/util.py | VZUH-dev/VZUH | 5c3fcdb7cd439b2537217d5bc797b459a1518270 | [
"MIT"
] | null | null | null | # Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2014-2015 The Dash developers
# Copyright (c) 2019 The Vzuh developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing... | 35.800578 | 104 | 0.647049 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc"))
from decimal import Decimal, ROUND_DOWN
import json
import random
import shutil
import subprocess
import time
import re
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util imp... | true | true |
f7130035aa9cbd6d6b04ef2f46267242342d95e7 | 1,619 | py | Python | examples/adspygoogle/dfp/v201306/get_all_orders.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | null | null | null | examples/adspygoogle/dfp/v201306/get_all_orders.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | null | null | null | examples/adspygoogle/dfp/v201306/get_all_orders.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | 2 | 2020-04-02T19:00:31.000Z | 2020-08-06T03:28:38.000Z | #!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 33.729167 | 80 | 0.723286 |
"""This code example gets all orders. To create orders, run create_orders.py."""
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)'
import os
import sys
sys.path.insert(0, os.path.join('..', '..', '..', '..'))
from adspygoogle import DfpClient
from adspygoogle.dfp import DfpUtils
client = DfpClient(path=os.path.jo... | false | true |
f713009dc6d46b1dfeef756a592f007aa58af451 | 514 | py | Python | astroML/utils/exceptions.py | arjunsavel/astroML | 361cadc56360ca35c760405a341e35ecab6dd585 | [
"BSD-2-Clause"
] | 735 | 2015-01-07T23:55:25.000Z | 2022-03-31T15:20:25.000Z | astroML/utils/exceptions.py | awesomemachinelearning/astroML | d378ca41565d1aa39997191d13d46d09d104ff1d | [
"BSD-2-Clause"
] | 168 | 2015-01-06T21:02:41.000Z | 2022-03-29T03:15:29.000Z | astroML/utils/exceptions.py | DinoBektesevic/astroML | b4e699bf45a65e233b40d60323c05eafa1d4955e | [
"BSD-2-Clause"
] | 278 | 2015-01-26T00:29:38.000Z | 2022-02-25T21:17:50.000Z | """
This module contains errors/exceptions and warnings for astroML.
"""
from astropy.utils.exceptions import AstropyWarning
class AstroMLWarning(AstropyWarning):
"""
A base warning class from which all AstroML warnings should inherit.
This class is subclassed from AstropyWarnings, so warnings inherited ... | 23.363636 | 75 | 0.743191 | from astropy.utils.exceptions import AstropyWarning
class AstroMLWarning(AstropyWarning):
class AstroMLDeprecationWarning(AstroMLWarning):
| true | true |
f71300d3ab93cd67015041b58c76c4dce981df47 | 912 | py | Python | mysql/tests/common.py | Nevon/integrations-core | 8b8284e8ca6c7188eea8548a6c3b809831c885cb | [
"BSD-3-Clause"
] | null | null | null | mysql/tests/common.py | Nevon/integrations-core | 8b8284e8ca6c7188eea8548a6c3b809831c885cb | [
"BSD-3-Clause"
] | null | null | null | mysql/tests/common.py | Nevon/integrations-core | 8b8284e8ca6c7188eea8548a6c3b809831c885cb | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from sys import maxsize
import pytest
from pkg_resources import parse_version
from datadog_checks.dev import get_docker_hostname
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.pat... | 26.823529 | 81 | 0.774123 | import os
from sys import maxsize
import pytest
from pkg_resources import parse_version
from datadog_checks.dev import get_docker_hostname
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.dirname(os.path.dirname(HERE))
TESTS_HELPER_DIR = os.path.join(ROOT, 'datadog_checks_tests_helper')
MYSQL_VERSIO... | true | true |
f71301a2158041bdeea3e6ee12a28171ccdfbfe0 | 10,841 | py | Python | deepforest/preprocess.py | henrykironde/DeepForest | 9df98ea30debc8a1dc98edfa45dada063b109e6e | [
"MIT"
] | 249 | 2018-04-03T18:44:51.000Z | 2022-03-31T18:01:52.000Z | deepforest/preprocess.py | henrykironde/DeepForest | 9df98ea30debc8a1dc98edfa45dada063b109e6e | [
"MIT"
] | 280 | 2018-05-23T14:33:39.000Z | 2022-03-31T21:29:38.000Z | deepforest/preprocess.py | henrykironde/DeepForest | 9df98ea30debc8a1dc98edfa45dada063b109e6e | [
"MIT"
] | 112 | 2018-05-30T14:52:56.000Z | 2022-03-25T10:10:58.000Z | # Deepforest Preprocessing model
"""The preprocessing module is used to reshape data into format suitable for
training or prediction.
For example cutting large tiles into smaller images.
"""
import os
import numpy as np
import pandas as pd
import slidingwindow
from PIL import Image
import torch
import warnings
import... | 40.301115 | 140 | 0.628079 | import os
import numpy as np
import pandas as pd
import slidingwindow
from PIL import Image
import torch
import warnings
import rasterio
def preprocess_image(image, device):
image = torch.tensor(image, device=device).permute(2, 0, 1).unsqueeze(0)
image = image / 255
return image
def image_name_from_pat... | true | true |
f71301afd0525fb53613e57af433339ec0256bce | 250 | py | Python | 05_debugging/bug_06.py | ASU-CompMethodsPhysics-PHY494/PHY494-resources-2020 | 20e08c20995eab567063b1845487e84c0e690e96 | [
"CC-BY-4.0"
] | null | null | null | 05_debugging/bug_06.py | ASU-CompMethodsPhysics-PHY494/PHY494-resources-2020 | 20e08c20995eab567063b1845487e84c0e690e96 | [
"CC-BY-4.0"
] | null | null | null | 05_debugging/bug_06.py | ASU-CompMethodsPhysics-PHY494/PHY494-resources-2020 | 20e08c20995eab567063b1845487e84c0e690e96 | [
"CC-BY-4.0"
] | null | null | null | # bug 5
# https://asu-compmethodsphysics-phy494.github.io/ASU-PHY494/2019/02/05/05_Debugging/#activity-fix-as-many-bugs-as-possible
# Create a list of values -10, -9.8, -9.6, ..., -0.2, 0, 0.2, ..., 10.
h = 0.2
x = [-10 + i*h for i in range(100)]
| 27.777778 | 123 | 0.632 |
h = 0.2
x = [-10 + i*h for i in range(100)]
| true | true |
f713033e7c9b0eb233e59f1ec4f01deff530cf46 | 9,351 | py | Python | csgo/client.py | ValvePython/csgo | ed81efa8c36122e882ffa5247be1b327dbd20850 | [
"MIT"
] | 108 | 2016-05-16T20:05:45.000Z | 2022-03-31T13:33:52.000Z | csgo/client.py | ValvePython/csgo | ed81efa8c36122e882ffa5247be1b327dbd20850 | [
"MIT"
] | 50 | 2016-10-19T20:55:09.000Z | 2022-02-22T18:14:21.000Z | csgo/client.py | ValvePython/csgo | ed81efa8c36122e882ffa5247be1b327dbd20850 | [
"MIT"
] | 21 | 2017-04-18T20:38:27.000Z | 2022-03-11T16:34:59.000Z | """
Only the most essential features to :class:`csgo.client.CSGOClient` are found here. Every other feature is inherited from
the :mod:`csgo.features` package and it's submodules.
"""
import logging
import gevent
import google.protobuf
from steam.core.msg import GCMsgHdrProto
from steam.client.gc import GameCoordinato... | 35.555133 | 121 | 0.61202 |
import logging
import gevent
import google.protobuf
from steam.core.msg import GCMsgHdrProto
from steam.client.gc import GameCoordinator
from steam.enums.emsg import EMsg
from steam.utils.proto import proto_fill_from_dict
from csgo.features import FeatureBase
from csgo.enums import EGCBaseClientMsg, GCConnectionStatus... | true | true |
f7130439941982fc40699d5ed9af64d9a4f823e1 | 7,358 | py | Python | assignment2/cs231n/optim.py | furkannturkmen/CS231n-2021 | 2c6618d16bfd4e02e0493e8b8a411a6509206bb4 | [
"MIT"
] | null | null | null | assignment2/cs231n/optim.py | furkannturkmen/CS231n-2021 | 2c6618d16bfd4e02e0493e8b8a411a6509206bb4 | [
"MIT"
] | null | null | null | assignment2/cs231n/optim.py | furkannturkmen/CS231n-2021 | 2c6618d16bfd4e02e0493e8b8a411a6509206bb4 | [
"MIT"
] | null | null | null | import numpy as np
"""
This file implements various first-order update rules that are commonly used
for training neural networks. Each update rule accepts current weights and the
gradient of the loss with respect to those weights and produces the next set of
weights. Each update rule has the same interface:
def updat... | 39.98913 | 102 | 0.534792 | import numpy as np
def sgd(w, dw, config=None):
if config is None:
config = {}
config.setdefault("learning_rate", 1e-2)
w -= config["learning_rate"] * dw
return w, config
def sgd_momentum(w, dw, config=None):
if config is None:
config = {}
config.setdefault("learning_rate",... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.