hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a24a3239fb3a7b865abb2a6196355773dd66502 | 5,951 | py | Python | tools/InterfaceGenerator/MsgVersionGenerate.py | shoamano83/sdl_core | ea5960280585d11ee02542b0ab183d4400ed691d | [
"BSD-3-Clause"
] | null | null | null | tools/InterfaceGenerator/MsgVersionGenerate.py | shoamano83/sdl_core | ea5960280585d11ee02542b0ab183d4400ed691d | [
"BSD-3-Clause"
] | 2 | 2017-12-25T19:40:16.000Z | 2017-12-25T23:34:25.000Z | tools/InterfaceGenerator/MsgVersionGenerate.py | vkushnirenko-luxoft/sdl_core | 946e25fa31411a4a00b547cee2d0f1dd12b94a7d | [
"BSD-3-Clause"
] | 1 | 2020-04-22T07:17:49.000Z | 2020-04-22T07:17:49.000Z | """
Generate file with major and minor msg_version.
"""
import xml.etree.ElementTree
from string import Template
import re
from generator.parsers import RPCBase
def generate_msg_version(file_name, path_to_storage):
"""Parses MOBILE_API.xml in order to
receive major_version, minor_version, and patch_version
... | 53.133929 | 143 | 0.696858 |
4a24a3949e4c52171a24159a1dea6e427362a2ae | 8,380 | py | Python | celeriteflow/cpp_extension.py | mirca/celeriteflow | ed09a178df05856097552a9081b6eb6d537216ee | [
"MIT"
] | 38 | 2018-05-18T14:51:39.000Z | 2022-03-15T20:11:21.000Z | celeriteflow/cpp_extension.py | mirca/celeriteflow | ed09a178df05856097552a9081b6eb6d537216ee | [
"MIT"
] | 5 | 2019-02-23T13:40:00.000Z | 2022-02-02T06:20:40.000Z | celeriteflow/cpp_extension.py | mirca/celeriteflow | ed09a178df05856097552a9081b6eb6d537216ee | [
"MIT"
] | 9 | 2018-10-28T14:18:05.000Z | 2022-02-27T22:40:20.000Z | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["BuildExtension"]
import os
import re
import sys
import glob
import copy
import subprocess
import setuptools
from setuptools.command.build_ext import build_ext
import tensorflow as tf
def _find_cuda_home():
'''Finds the CUDA i... | 35.659574 | 79 | 0.540811 |
4a24a3e48375fa88148fa7fdf924e6f93b1a556f | 2,818 | py | Python | integrationtest/vm/monitor/alert_vm_cpu_util.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/monitor/alert_vm_cpu_util.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/monitor/alert_vm_cpu_util.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | '''
Test about monitor trigger on vm cpu free ratio in one minute
@author: Songtao,Haochen
'''
import os
import test_stub
import random
import zstacklib.utils.ssh as ssh
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpe... | 36.597403 | 143 | 0.724627 |
4a24a4205e0af3856bce704b1dda27d1e9aa90ad | 3,107 | py | Python | docker-jans-certmanager/scripts/oxshibboleth_handler.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | 18 | 2022-01-13T13:45:13.000Z | 2022-03-30T04:41:18.000Z | docker-jans-certmanager/scripts/oxshibboleth_handler.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | 604 | 2022-01-13T12:32:50.000Z | 2022-03-31T20:27:36.000Z | docker-jans-certmanager/scripts/oxshibboleth_handler.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | 8 | 2022-01-28T00:23:25.000Z | 2022-03-16T05:12:12.000Z | import logging.config
from jans.pycloudlib.utils import exec_cmd
from base_handler import BaseHandler
from settings import LOGGING_CONFIG
logging.config.dictConfig(LOGGING_CONFIG)
logger = logging.getLogger("certmanager")
class OxshibbolethHandler(BaseHandler):
@classmethod
def gen_idp3_key(cls, storepass)... | 33.771739 | 90 | 0.55906 |
4a24a5841fdd67233b8b6825023ceffdbe28dd63 | 6,324 | py | Python | paper/ProbCox/scripts/simulation/largescale_case.py | alexwjung/ProbCox | 6582ab30a4368283e779329d3df3fdeab1c48d32 | [
"MIT"
] | 3 | 2021-06-21T17:40:46.000Z | 2021-12-17T17:19:09.000Z | paper/ProbCox/scripts/simulation/largescale_case.py | alexwjung/ProbCox | 6582ab30a4368283e779329d3df3fdeab1c48d32 | [
"MIT"
] | null | null | null | paper/ProbCox/scripts/simulation/largescale_case.py | alexwjung/ProbCox | 6582ab30a4368283e779329d3df3fdeab1c48d32 | [
"MIT"
] | 1 | 2021-06-21T13:53:49.000Z | 2021-06-21T13:53:49.000Z | '''
Standard Case Simulation - Case 1:
Small size simulation with N >> I >> P
individuals: 1000
covaraites: 3 binary (0.2), 3 Normal(0, 1)
theta: -0.9, 0.2, 0, -0.4, 1.1, 0
censoring: ~ 0.74
runs: 200 - Seed = 1, 2, ..., 200
'''
# Modules
# =================================================... | 31.939394 | 236 | 0.573213 |
4a24a5ad382e5aa2dda445bb8f83e404746d750b | 3,768 | py | Python | sqlcollection/utils.py | knlambert/sqlcollection | bd5408c00e62c5284de8a70743a28032bbfaf9ba | [
"MIT"
] | null | null | null | sqlcollection/utils.py | knlambert/sqlcollection | bd5408c00e62c5284de8a70743a28032bbfaf9ba | [
"MIT"
] | null | null | null | sqlcollection/utils.py | knlambert/sqlcollection | bd5408c00e62c5284de8a70743a28032bbfaf9ba | [
"MIT"
] | null | null | null | # coding: utf-8
"""
This module contains various utils function at global usage.
"""
import sys
try:
import urlparse
from urllib import urlencode
except ImportError:
import urllib.parse as urlparse
from urllib.parse import urlencode
from .compatibility import UNICODE_TYPE
def json_set(item, path, va... | 28.984615 | 84 | 0.576699 |
4a24a5af0838567b5d3a74c1b11712074c7bcd02 | 4,646 | py | Python | regression/main_repulsive.py | maxwab/denn-ijcai | 6431f699b7d9b4e4fbb9ca71f41dbdecfd34378c | [
"MIT"
] | null | null | null | regression/main_repulsive.py | maxwab/denn-ijcai | 6431f699b7d9b4e4fbb9ca71f41dbdecfd34378c | [
"MIT"
] | 3 | 2021-09-08T02:07:17.000Z | 2022-03-12T00:33:04.000Z | regression/main_repulsive.py | maxwab/denn-ijcai | 6431f699b7d9b4e4fbb9ca71f41dbdecfd34378c | [
"MIT"
] | 2 | 2021-02-04T14:58:24.000Z | 2021-10-20T19:36:14.000Z | from comet_ml import Experiment
import argparse as ap
import torch
import numpy as np
import random
from tools import f, optimize
import model
from dataset import RegressionDataset
from model import MLP
from tqdm import tqdm
import os
import json
from pathlib import Path
from functools import partial
from sampler impor... | 34.414815 | 162 | 0.715239 |
4a24a872880dded888276612f0b1fb2abbca0c1e | 796 | py | Python | ptr/params.py | Wall-Facer-liuyu/slot_attention | a927960396011a108358f7b43c0f8e061e432564 | [
"Apache-2.0"
] | null | null | null | ptr/params.py | Wall-Facer-liuyu/slot_attention | a927960396011a108358f7b43c0f8e061e432564 | [
"Apache-2.0"
] | null | null | null | ptr/params.py | Wall-Facer-liuyu/slot_attention | a927960396011a108358f7b43c0f8e061e432564 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
from typing import Tuple
import attr
@attr.s(auto_attribs=True)
class SlotAttentionParams:
lr: float = 0.0004
batch_size: int = 32
val_batch_size: int = 64
resolution: Tuple[int, int] = (128, 128)
num_slots: int = 20
num_iterations: int = 3
data_root: str = "/h... | 25.677419 | 44 | 0.668342 |
4a24a877cea283a6072e8cd2293b7a56085eb3b2 | 1,553 | py | Python | setup.py | camerondurham/piazza-api | 095ad2fcac5aa90674faba09cbc72205337a536b | [
"MIT"
] | 171 | 2015-01-05T13:33:22.000Z | 2022-03-05T13:42:14.000Z | setup.py | camerondurham/piazza-api | 095ad2fcac5aa90674faba09cbc72205337a536b | [
"MIT"
] | 27 | 2015-01-11T08:30:52.000Z | 2021-09-15T03:36:28.000Z | setup.py | camerondurham/piazza-api | 095ad2fcac5aa90674faba09cbc72205337a536b | [
"MIT"
] | 52 | 2015-02-01T04:19:41.000Z | 2022-02-02T20:18:46.000Z | from __future__ import print_function
import codecs
import os
import re
from setuptools import setup
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()... | 32.354167 | 77 | 0.650998 |
4a24a8d17d57f99d6cdfa445d87ed290c0deb0a8 | 17,451 | py | Python | haystack/preprocessor/utils.py | peterdemin/haystack | 9ec2406a05aac3dc8afab68945a6afc2871bd2a3 | [
"Apache-2.0"
] | 1 | 2021-01-19T00:34:03.000Z | 2021-01-19T00:34:03.000Z | haystack/preprocessor/utils.py | peterdemin/haystack | 9ec2406a05aac3dc8afab68945a6afc2871bd2a3 | [
"Apache-2.0"
] | null | null | null | haystack/preprocessor/utils.py | peterdemin/haystack | 9ec2406a05aac3dc8afab68945a6afc2871bd2a3 | [
"Apache-2.0"
] | null | null | null | import re
import logging
import tarfile
import tempfile
import zipfile
import gzip
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple, Union, Generator
import json
from farm.data_handler.utils import http_get
from haystack.file_converter.base import BaseConverter
from haystack.file_conv... | 42.87715 | 156 | 0.571944 |
4a24a90b4cf0d180008feeaa35be1cd02b62f3b2 | 347 | py | Python | presqt/utilities/utils/list_intersection.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 3 | 2019-01-29T19:45:25.000Z | 2020-12-01T18:24:51.000Z | presqt/utilities/utils/list_intersection.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 419 | 2018-09-13T23:11:15.000Z | 2021-09-22T17:49:00.000Z | presqt/utilities/utils/list_intersection.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 2 | 2020-04-10T08:19:41.000Z | 2021-01-04T15:29:42.000Z | def list_intersection(list_one, list_two):
"""
Compares two lists and returns a list of shared values between them.
Parameters
----------
list_one: list
list_two: list
Returns
-------
A list of matching items between the two given lists.
"""
return [entry for entry in lis... | 21.6875 | 72 | 0.639769 |
4a24a984151c9e1682063447e1b0c07fe75d1054 | 21,832 | py | Python | detectron2/data/transforms/augmentation_impl.py | makman7/detectron2 | c8322e53fc61dacec7ce461886e66cf1a4545dae | [
"Apache-2.0"
] | null | null | null | detectron2/data/transforms/augmentation_impl.py | makman7/detectron2 | c8322e53fc61dacec7ce461886e66cf1a4545dae | [
"Apache-2.0"
] | null | null | null | detectron2/data/transforms/augmentation_impl.py | makman7/detectron2 | c8322e53fc61dacec7ce461886e66cf1a4545dae | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
"""
Implement many useful :class:`Augmentation`.
"""
import numpy as np
import sys
from typing import Tuple
from fvcore.transforms.transform import (
BlendTransform,
CropTransform,
HFlipTransform,
NoOpTransform,
PadTransform,... | 37.641379 | 101 | 0.609381 |
4a24a9f4ece6ba3267856a3860450b1a1cebe03a | 787 | py | Python | newsCrawl/fakeNews/actionfakeNews/migrations/0001_initial.py | ARIF-KHAN-420/Fake_News | acfbffcce454afc09c4a7b06205c1a632c11f822 | [
"MIT"
] | 1 | 2022-01-03T17:54:03.000Z | 2022-01-03T17:54:03.000Z | newsCrawl/fakeNews/actionfakeNews/migrations/0001_initial.py | arifkhan-silicornya/Fake_News | acfbffcce454afc09c4a7b06205c1a632c11f822 | [
"MIT"
] | null | null | null | newsCrawl/fakeNews/actionfakeNews/migrations/0001_initial.py | arifkhan-silicornya/Fake_News | acfbffcce454afc09c4a7b06205c1a632c11f822 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-11 20:44
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Authenticate_NEWS',
fields=[
('id', models.... | 27.137931 | 117 | 0.564168 |
4a24aa64073794a890b9caf311aa130ef19b30c8 | 1,509 | py | Python | backend/machinelearning/api.py | iloveyii/sdg-project | 02a53a0b10d36659410f045e700ad1931de2ffa9 | [
"MIT"
] | 1 | 2020-02-12T10:44:11.000Z | 2020-02-12T10:44:11.000Z | backend/machinelearning/api.py | iloveyii/sdg-project | 02a53a0b10d36659410f045e700ad1931de2ffa9 | [
"MIT"
] | 6 | 2021-03-10T07:33:51.000Z | 2022-02-27T10:28:13.000Z | backend/machinelearning/api.py | iloveyii/sdg-project | 02a53a0b10d36659410f045e700ad1931de2ffa9 | [
"MIT"
] | null | null | null | from flask import Flask
from flask import request
from flask_wtf.csrf import CSRFProtect
from flask_restful import Resource, Api
from ml import MachineLearning
from datetime import datetime
app = Flask(__name__)
csrf = CSRFProtect(app)
api = Api(app)
dt = datetime.now()
gl = {'server_start_ts': dt.microsecond}
clas... | 28.471698 | 89 | 0.611001 |
4a24aa6fa4acd2117f66b3096e2d24335e4c7abe | 414 | py | Python | data/external/repositories/241493/Kaggle-Whats-cooking-master/jsonToCsv.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/241493/Kaggle-Whats-cooking-master/jsonToCsv.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/241493/Kaggle-Whats-cooking-master/jsonToCsv.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | import json
from pprint import pprint
fw = open('traindata.csv','w')
with open('train.json') as data_file:
data = json.load(data_file)
for i in range(len(data)) :
s = str(data[i]['id']) + "\t" + str(data[i]['cuisine']) + "\t"
ingd = data[i]['ingredients']
for j in ingd :
j = str(filter(lambda x:ord(x)>31 an... | 24.352941 | 63 | 0.589372 |
4a24ab62c2b170753b6504b4d0ea460fec2f375c | 43,604 | py | Python | rmgpy/rmg/pdep.py | CanePan-cc/CanePanWorkshop | 349a4af759cf8877197772cd7eaca1e51d46eff5 | [
"MIT"
] | null | null | null | rmgpy/rmg/pdep.py | CanePan-cc/CanePanWorkshop | 349a4af759cf8877197772cd7eaca1e51d46eff5 | [
"MIT"
] | null | null | null | rmgpy/rmg/pdep.py | CanePan-cc/CanePanWorkshop | 349a4af759cf8877197772cd7eaca1e51d46eff5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 45.947313 | 146 | 0.54628 |
4a24ab82e1442fc1b3d89f5cbffa75419baf4ef9 | 2,187 | py | Python | ipfs_common/src/ipfs_common/ipfs_rosbag.py | Vourhey/robonomics_comm | 1b7c6dc85985909cb925d82b1081ec556423029e | [
"BSD-3-Clause"
] | 16 | 2017-11-15T15:20:34.000Z | 2021-08-05T03:08:13.000Z | ipfs_common/src/ipfs_common/ipfs_rosbag.py | aang1985/robonomics_comm | 4f7a339e01cbd00fc0f51405c77d89d6ae5e0d7d | [
"BSD-3-Clause"
] | 80 | 2018-02-08T22:44:41.000Z | 2021-07-15T10:12:09.000Z | ipfs_common/src/ipfs_common/ipfs_rosbag.py | aang1985/robonomics_comm | 4f7a339e01cbd00fc0f51405c77d89d6ae5e0d7d | [
"BSD-3-Clause"
] | 13 | 2018-02-08T14:22:26.000Z | 2021-11-20T00:29:14.000Z | # -*- coding: utf-8 -*-
from ipfs_common.srv import IpfsUploadFile, IpfsDownloadFile
from ipfs_common.msg import Multihash, Filepath
from tempfile import NamedTemporaryFile
from rosbag import Bag
import rospy
import os
def ipfs_download(multihash: Multihash) -> (dict, Bag):
rospy.wait_for_service('/ipfs/get_file... | 33.136364 | 89 | 0.638317 |
4a24ace33a24aea45567c6b2c70a41907fc4b425 | 22,787 | py | Python | tests/quart/test_graphqlview.py | colelin26/graphql-server | 1ccebee8c6102f2855bcf64024d84091d8547f08 | [
"MIT"
] | 60 | 2020-08-12T11:16:36.000Z | 2022-03-02T02:39:51.000Z | tests/quart/test_graphqlview.py | colelin26/graphql-server | 1ccebee8c6102f2855bcf64024d84091d8547f08 | [
"MIT"
] | 24 | 2017-03-23T04:19:29.000Z | 2022-02-25T09:32:34.000Z | tests/quart/test_graphqlview.py | colelin26/graphql-server | 1ccebee8c6102f2855bcf64024d84091d8547f08 | [
"MIT"
] | 25 | 2020-08-01T10:58:24.000Z | 2022-03-22T04:03:19.000Z | import json
import sys
# from io import StringIO
from urllib.parse import urlencode
import pytest
from quart import Quart, Response, url_for
from quart.testing import QuartClient
from werkzeug.datastructures import Headers
from .app import create_app
@pytest.fixture
def app() -> Quart:
# import app factory pat... | 31.087312 | 110 | 0.615877 |
4a24ace64d7788974b73d6362a1c8c287c02637a | 188 | py | Python | redirink/insights/tests/conftest.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | null | null | null | redirink/insights/tests/conftest.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | null | null | null | redirink/insights/tests/conftest.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | 1 | 2021-12-31T00:46:31.000Z | 2021-12-31T00:46:31.000Z | import factory
from .factories import InsightFactory
# def insight_data() -> dict:
# factory_dict = factory.build(dict, FACTORY_CLASS=InsightFactory)
# delete factory_dict["id"]
| 23.5 | 70 | 0.744681 |
4a24ae111c406b784d7cc2c2e0f28bf7d85058ba | 1,287 | py | Python | ucsrb/management/commands/set_baseline_flow.py | Ecotrust/ucsrb | 29d97cf1f21537aaf24f38e7dedc7c8cfccf1f12 | [
"MIT"
] | 1 | 2018-07-31T00:58:30.000Z | 2018-07-31T00:58:30.000Z | ucsrb/management/commands/set_baseline_flow.py | Ecotrust/ucsrb | 29d97cf1f21537aaf24f38e7dedc7c8cfccf1f12 | [
"MIT"
] | 264 | 2017-10-24T23:54:52.000Z | 2021-10-16T15:40:47.000Z | ucsrb/management/commands/set_baseline_flow.py | Ecotrust/ucsrb | 29d97cf1f21537aaf24f38e7dedc7c8cfccf1f12 | [
"MIT"
] | 1 | 2019-07-16T06:37:45.000Z | 2019-07-16T06:37:45.000Z | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.contrib.auth.models import User
from ucsrb.models import FocusArea, TreatmentScenario
from ucsrb.tasks import runBaseline
from time import sleep
class Command(BaseCommand):
help = 'Set Baseline Data. 1 ar... | 39 | 133 | 0.663559 |
4a24affac94dd960d0e1d37ec5ee6aa218262901 | 1,526 | py | Python | problems/knapsackProblemMaximizedSum.py | lnogueir/swe-interview-prep | 48ef00e94d4603b392db6ac272277f5f3d37d2f5 | [
"MIT"
] | null | null | null | problems/knapsackProblemMaximizedSum.py | lnogueir/swe-interview-prep | 48ef00e94d4603b392db6ac272277f5f3d37d2f5 | [
"MIT"
] | null | null | null | problems/knapsackProblemMaximizedSum.py | lnogueir/swe-interview-prep | 48ef00e94d4603b392db6ac272277f5f3d37d2f5 | [
"MIT"
] | null | null | null | '''
Prompt:
You're given an array of arrays where each subarray holds two integer values
and represents an item; the first integer is the item's value, and the second
integer is the item's weight. You're also given an integer representing the
maximum capacity of a knapsack that you have.
Your goal is to fit items in y... | 21.492958 | 83 | 0.625819 |
4a24b0e8d72529acba8583a75a0c177f70d1a6af | 2,005 | py | Python | ReadCategoriesFromExcel.py | mbuckaway/CrossMgr | 4c64e429eb3215fda1b685c5e684c56f5d0c02cf | [
"MIT"
] | 1 | 2020-02-05T11:22:03.000Z | 2020-02-05T11:22:03.000Z | ReadCategoriesFromExcel.py | mbuckaway/CrossMgr | 4c64e429eb3215fda1b685c5e684c56f5d0c02cf | [
"MIT"
] | null | null | null | ReadCategoriesFromExcel.py | mbuckaway/CrossMgr | 4c64e429eb3215fda1b685c5e684c56f5d0c02cf | [
"MIT"
] | null | null | null | import six
import Utils
import Model
sheetName = '--CrossMgr-Categories'
def ReadCategoriesFromExcel( reader ):
race = Model.race
if not race or sheetName not in reader.sheet_names():
return False
HeadersFields = (
('Category Type', 'catType'),
('Name', 'name'),
('Gender', 'gender'),
('Numbers', ... | 26.733333 | 102 | 0.673317 |
4a24b1265c6cd501daa6777d1dcde17510cbb3b4 | 638 | py | Python | test_apps/test.py | alexborsch/wms-assistant | 745593f55894466389e09d01e2a7aa140d4ce6c1 | [
"MIT"
] | null | null | null | test_apps/test.py | alexborsch/wms-assistant | 745593f55894466389e09d01e2a7aa140d4ce6c1 | [
"MIT"
] | null | null | null | test_apps/test.py | alexborsch/wms-assistant | 745593f55894466389e09d01e2a7aa140d4ce6c1 | [
"MIT"
] | null | null | null | import sys
import time
def updt(total, progress):
"""
Displays or updates a console progress bar.
Original source: /questions/27978/python-progress-bar/205178#205178
"""
barLength, status = 20, ""
progress = float(progress) / float(total)
if progress >= 1.:
progress, status = 1, "... | 24.538462 | 74 | 0.594044 |
4a24b140337b2e2f1ba9e2e28a5096fdc57168f0 | 2,757 | py | Python | exp/taskB/inference.py | temi92/epic-kitchens-55-action-models | 40e984bbdcf502539b3569774cb6b5526eb71c3c | [
"Apache-2.0"
] | null | null | null | exp/taskB/inference.py | temi92/epic-kitchens-55-action-models | 40e984bbdcf502539b3569774cb6b5526eb71c3c | [
"Apache-2.0"
] | null | null | null | exp/taskB/inference.py | temi92/epic-kitchens-55-action-models | 40e984bbdcf502539b3569774cb6b5526eb71c3c | [
"Apache-2.0"
] | null | null | null | import torch
from pathlib import Path
import sys
import cv2
sys.path.append("..")
from models.model import get_tsn_model
import numpy as np
import json
import argparse
parser = argparse.ArgumentParser(description='running inference on video')
parser.add_argument("weights", type=Path, help="weights file for model")
par... | 28.42268 | 119 | 0.686253 |
4a24b18b41e683a39094ec74d00965204db0a6d5 | 2,826 | py | Python | examples/benchmark_with_filtering.py | jina-ai/pqlite | 2ce1ec2283b381f5153ea60141a6bb474bbf0f0c | [
"Apache-2.0"
] | 45 | 2021-12-10T07:39:39.000Z | 2022-02-20T22:58:28.000Z | examples/benchmark_with_filtering.py | jina-ai/pqlite | 2ce1ec2283b381f5153ea60141a6bb474bbf0f0c | [
"Apache-2.0"
] | 30 | 2021-12-10T07:46:28.000Z | 2022-02-18T09:27:48.000Z | examples/benchmark_with_filtering.py | jina-ai/annlite | e4e706e313ba5cbfb7083a5dea9e75b8d2813394 | [
"Apache-2.0"
] | null | null | null | import os
import shutil
import numpy as np
from jina import Document, DocumentArray
from jina.logging.profile import TimeContext
from annlite import AnnLite
n_index = [10_000, 100_000, 500_000, 1_000_000]
n_query = [1, 8, 64]
D = 768
R = 5
B = 5000
n_cells = 1
probs = [[0.20, 0.30, 0.50], [0.05, 0.15, 0.80]]
catego... | 26.660377 | 101 | 0.536093 |
4a24b20775fa4f2a9e2ee1e4770cd32651978482 | 5,218 | py | Python | src/engine/main_engine.py | Sarajvega/kaggle-birdsong-recognition | cbe1c8b59d03a1ac210439fef6045ce4e57235dd | [
"MIT"
] | 137 | 2020-09-17T16:36:28.000Z | 2022-03-23T23:54:09.000Z | src/engine/main_engine.py | Sarajvega/kaggle-birdsong-recognition | cbe1c8b59d03a1ac210439fef6045ce4e57235dd | [
"MIT"
] | 3 | 2020-09-18T07:42:37.000Z | 2021-07-19T22:37:38.000Z | src/engine/main_engine.py | Sarajvega/kaggle-birdsong-recognition | cbe1c8b59d03a1ac210439fef6045ce4e57235dd | [
"MIT"
] | 38 | 2020-09-20T07:24:07.000Z | 2022-03-14T03:06:18.000Z | from torch.utils.data import DataLoader
import torch
from tqdm.auto import tqdm
import os
import cProfile
from ignite.engine import Events, Engine
from ignite.handlers import Checkpoint
from engine.base.base_engine import BaseEngine
from ignite.utils import convert_tensor
class MainEngine(BaseEngine):
def __init__... | 43.848739 | 144 | 0.645458 |
4a24b2488da72c5f6be45ec9a836b8e9c0f0a3d4 | 2,938 | py | Python | configs/eftnet/R2_ttf53_beta03_3lr_log_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | configs/eftnet/R2_ttf53_beta03_3lr_log_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | configs/eftnet/R2_ttf53_beta03_3lr_log_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='CenterNet',
pretrained='./pretrain/darknet53.pth',
backbone=dict(
type='DarknetV3',
layers=[1, 2, 8, 8, 4],
inplanes=[3, 32, 64, 128, 256, 512],
planes=[32, 64, 128, 256, 512, 1024],
norm_cfg=dict(type='BN'),
out_indices=(1... | 29.676768 | 86 | 0.640231 |
4a24b35fb5d7d03f8770e7abaf33216dbc8d6b45 | 13,218 | py | Python | musicbot/playlist.py | thisistoomuchwork/chris-music-bot-1.0 | e3364874fd4bca0d239c15422ed867ed9f45e229 | [
"MIT"
] | null | null | null | musicbot/playlist.py | thisistoomuchwork/chris-music-bot-1.0 | e3364874fd4bca0d239c15422ed867ed9f45e229 | [
"MIT"
] | null | null | null | musicbot/playlist.py | thisistoomuchwork/chris-music-bot-1.0 | e3364874fd4bca0d239c15422ed867ed9f45e229 | [
"MIT"
] | null | null | null | import os.path
import logging
import datetime
from random import shuffle
from itertools import islice
from collections import deque
from urllib.error import URLError
from youtube_dl.utils import ExtractorError, DownloadError, UnsupportedError
from .utils import get_header
from .constructs import Serializ... | 37.02521 | 131 | 0.564306 |
4a24b4d7e3ae3acd7d049c6e1303f4516cf8105a | 2,725 | py | Python | weld/pandas_weld/tests/io/test_parsers.py | radujica/data-analysis-pipelines | 64a6e5613cb1ab2ba2eb2f763c2aa1e3bc5e0d3b | [
"MIT"
] | 5 | 2018-03-05T13:19:35.000Z | 2020-11-17T15:59:41.000Z | weld/pandas_weld/tests/io/test_parsers.py | radujica/data-analysis-pipelines | 64a6e5613cb1ab2ba2eb2f763c2aa1e3bc5e0d3b | [
"MIT"
] | 1 | 2021-06-01T22:27:44.000Z | 2021-06-01T22:27:44.000Z | weld/pandas_weld/tests/io/test_parsers.py | radujica/data-analysis-pipelines | 64a6e5613cb1ab2ba2eb2f763c2aa1e3bc5e0d3b | [
"MIT"
] | null | null | null | import unittest
from datetime import date
import numpy as np
import os
import pandas_weld as pdw
from pandas_weld.tests import test_equal_multiindex
class ParserTests(unittest.TestCase):
PATH_EXT = (os.path.dirname(__file__)) + '/sample_ext.nc'
def test_read_netcdf4(self):
data = {'tg': np.array([-... | 45.416667 | 119 | 0.557064 |
4a24b4f390edc1470f26537cd35a232adccc5132 | 1,437 | py | Python | frappe/contacts/doctype/address_template/test_address_template.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | frappe/contacts/doctype/address_template/test_address_template.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | frappe/contacts/doctype/address_template/test_address_template.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
import frappe
class TestAddressTemplate(unittest.TestCase):
def setUp(self):
self.make_default_address_template()
def test_default_is_unset(self):
a = f... | 32.659091 | 360 | 0.654141 |
4a24b5928a682fe8424bd335832b341648aa97fe | 3,773 | py | Python | amath586/hw4/heat_CN_FWE.py | interesting-courses/UW_coursework | 987e336e70482622c5d03428b5532349483f87f4 | [
"MIT"
] | 2 | 2020-08-19T01:59:25.000Z | 2021-12-31T12:32:59.000Z | amath586/hw4/heat_CN_FWE.py | interesting-courses/UW_coursework | 987e336e70482622c5d03428b5532349483f87f4 | [
"MIT"
] | null | null | null | amath586/hw4/heat_CN_FWE.py | interesting-courses/UW_coursework | 987e336e70482622c5d03428b5532349483f87f4 | [
"MIT"
] | 3 | 2021-03-31T22:23:46.000Z | 2022-01-29T22:13:01.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 21:11:44 2018
@author: tyler
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import sparse
from scipy.sparse import linalg
#<start>
def heat_CN_FWE(m):
#
# heat_CN.py
#
# Solve u_t = kappa * u_{xx} on [ax,bx] with Dirichlet bo... | 31.441667 | 95 | 0.530612 |
4a24b69e45f2fea5c11ed05dc4271bc0a3c5e55e | 23,784 | py | Python | emat/database/sqlite/sql_queries.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | 13 | 2019-03-26T13:27:43.000Z | 2022-02-02T18:30:36.000Z | emat/database/sqlite/sql_queries.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | 19 | 2019-04-24T20:58:10.000Z | 2020-09-11T22:31:06.000Z | emat/database/sqlite/sql_queries.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | 17 | 2019-02-19T16:13:52.000Z | 2022-02-14T20:50:36.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 16 09:41:27 2018
@author: mmilkovits
"""
CONDITIONAL_INSERT_XL = (
'''INSERT OR IGNORE INTO ema_parameter( name, ptype )
VALUES(?1, CASE WHEN ?2 LIKE '%uncertainty%' THEN 1 WHEN ?2 LIKE '%constant%' THEN 2 ELSE 0 END)
'''
)
CONDITIONAL_INSERT_M = (
... | 26.574302 | 119 | 0.623949 |
4a24b70bd0e8e9961b5ea64afa2ef5157ac1b89e | 3,085 | py | Python | SimpleEnc/components/Decryptor.py | momoji123/Tools | 9b1a026e3346f4c26291018587409e86973925c6 | [
"MIT"
] | null | null | null | SimpleEnc/components/Decryptor.py | momoji123/Tools | 9b1a026e3346f4c26291018587409e86973925c6 | [
"MIT"
] | null | null | null | SimpleEnc/components/Decryptor.py | momoji123/Tools | 9b1a026e3346f4c26291018587409e86973925c6 | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import Frame, Button, Label, Entry, StringVar
from cryptography.fernet import Fernet
from components import KeyGenerator, ResultWindow
import traceback
class Decryptor:
root = None
master = None
mainContainer = None
console = None
fileManager = None
passInput ... | 35.872093 | 137 | 0.635981 |
4a24b806fa4ff97d94b7e6972f79d113901f10d4 | 133 | py | Python | web/zenmai.config.sample.py | mmktomato/zenmai-bts | e8915aed1174f9bc62f945d7be946d00fb43d4b8 | [
"MIT"
] | null | null | null | web/zenmai.config.sample.py | mmktomato/zenmai-bts | e8915aed1174f9bc62f945d7be946d00fb43d4b8 | [
"MIT"
] | null | null | null | web/zenmai.config.sample.py | mmktomato/zenmai-bts | e8915aed1174f9bc62f945d7be946d00fb43d4b8 | [
"MIT"
] | null | null | null | SQLALCHEMY_DATABASE_URI = 'sqlite:///../develop.db'
SECRET_KEY = 'your_own_secret_key'
MAX_CONTENT_LENGTH = 16 * 1024 * 1024 # 16MB
| 33.25 | 51 | 0.744361 |
4a24b912ca773c65fb3b57da0ad34a42f3fabf84 | 8,586 | py | Python | packages/python/plotly/plotly/graph_objs/layout/annotation/hoverlabel/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | 1 | 2020-04-06T20:57:36.000Z | 2020-04-06T20:57:36.000Z | packages/python/plotly/plotly/graph_objs/layout/annotation/hoverlabel/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/layout/annotation/hoverlabel/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Font(_BaseLayoutHierarchyType):
# color
# -----
@property
def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff00... | 37.168831 | 84 | 0.569648 |
4a24b94aca9432d37d8f15358acbaa71238d795c | 968 | py | Python | openverse_api/catalog/api/migrations/0013_contentprovider.py | ritesh-pandey/openverse-api | 7456e9ec4dd45800d5527039e466aa50991b3812 | [
"MIT"
] | 122 | 2018-09-12T13:49:37.000Z | 2021-12-05T07:04:59.000Z | cccatalog-api/cccatalog/api/migrations/0013_contentprovider.py | senyor/cccatalog-api | a18f75fccdd7345beff820dff4ee69604cd53748 | [
"MIT"
] | 500 | 2018-04-30T15:26:43.000Z | 2021-06-07T16:28:44.000Z | cccatalog-api/cccatalog/api/migrations/0013_contentprovider.py | senyor/cccatalog-api | a18f75fccdd7345beff820dff4ee69604cd53748 | [
"MIT"
] | 144 | 2018-08-11T17:11:50.000Z | 2022-01-12T20:39:09.000Z | # Generated by Django 2.0.8 on 2019-01-22 18:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0012_auto_20190102_2012'),
]
operations = [
migrations.CreateModel(
name='ContentProvider',
fields=[
... | 33.37931 | 114 | 0.576446 |
4a24b96692673c8720f4165b0bbcc0a08ad744c2 | 268 | py | Python | sdk/__init__.py | Elishanto/HarryBotter | e1977dbade44840288145f08aef60746ac66982b | [
"MIT"
] | 3 | 2016-06-12T19:37:05.000Z | 2016-06-12T20:23:33.000Z | sdk/__init__.py | Elishanto/HarryBotter | e1977dbade44840288145f08aef60746ac66982b | [
"MIT"
] | null | null | null | sdk/__init__.py | Elishanto/HarryBotter | e1977dbade44840288145f08aef60746ac66982b | [
"MIT"
] | null | null | null | from .button import ButtonPayload, ButtonElement
from .generic import GenericPayload, GenericElement
from .attachment import Attachment
from .message import Message
from .recipient import Recipient
from .image import ImagePayload
from .location import LocationPayload
| 33.5 | 51 | 0.854478 |
4a24b9da02165bb3efc3065d8ce46808f75867d0 | 1,517 | py | Python | scripts/helper/a7_parallel_evaluation.py | dslaborg/sumo | 1e9bfedaff201d4bd37b4889b6091cc4b9c8ad01 | [
"MIT"
] | 3 | 2022-02-03T22:54:14.000Z | 2022-03-31T09:59:02.000Z | scripts/helper/a7_parallel_evaluation.py | dslaborg/sumo | 1e9bfedaff201d4bd37b4889b6091cc4b9c8ad01 | [
"MIT"
] | null | null | null | scripts/helper/a7_parallel_evaluation.py | dslaborg/sumo | 1e9bfedaff201d4bd37b4889b6091cc4b9c8ad01 | [
"MIT"
] | null | null | null | """
As the parallel execution using the ProcessPoolExecutor only seems to work if the parallelized function is imported,
the split_evaluation function is extracted into this helper file.
"""
import pickle
import numpy as np
from scripts.a7.detect_spindles import detect_spindles
from sumo.data import spindle_vect_to_i... | 37 | 116 | 0.749506 |
4a24baf39bd618835c2985026e77d7575c1534cf | 4,673 | py | Python | verify/academic3d-done/superp_init.py | zhaohj2017/FAoC-tool | 9931a87a4831d45f4109af2cd1f990d4b30fc2dd | [
"BSD-3-Clause"
] | null | null | null | verify/academic3d-done/superp_init.py | zhaohj2017/FAoC-tool | 9931a87a4831d45f4109af2cd1f990d4b30fc2dd | [
"BSD-3-Clause"
] | null | null | null | verify/academic3d-done/superp_init.py | zhaohj2017/FAoC-tool | 9931a87a4831d45f4109af2cd1f990d4b30fc2dd | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
import acti
import numpy as np
############################################
# set default data type to double; for GPU
# training use float
############################################
torch.set_default_dtype(torch.float64)
torch.set_default_tensor_type(torch.DoubleTensor)
# torch.s... | 36.507813 | 129 | 0.607961 |
4a24bb89a57d1b0e126a3e9a23379314f28952c8 | 16,545 | py | Python | cogs/fun.py | hyarsan/mewtwo-bot | 26bd66d524c004e26e228e013e51092e1c0b10d3 | [
"MIT"
] | null | null | null | cogs/fun.py | hyarsan/mewtwo-bot | 26bd66d524c004e26e228e013e51092e1c0b10d3 | [
"MIT"
] | null | null | null | cogs/fun.py | hyarsan/mewtwo-bot | 26bd66d524c004e26e228e013e51092e1c0b10d3 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import asyncio
import random
import aiohttp
import dateutil.parser
import dataset
import json
from urllib.parse import quote_plus
botver = "Mewtwo v2.0" #--Bot's version, obviously--#
melo =[ #--List of images for meloetta command--#
'https://sks316.s-ul.eu/gKaVnpMW... | 51.542056 | 326 | 0.57806 |
4a24bc548153f77dfaa8e558053e8fb9a9fbf1cc | 1,186 | py | Python | yui/utils/__init__.py | item4/yui | 8628d0d54b94ada3cbe7d1b0f624063258bad10a | [
"MIT"
] | 36 | 2017-06-12T01:09:46.000Z | 2021-01-31T17:57:41.000Z | yui/utils/__init__.py | item4/yui | 8628d0d54b94ada3cbe7d1b0f624063258bad10a | [
"MIT"
] | 145 | 2017-06-21T13:31:29.000Z | 2021-06-20T01:01:30.000Z | yui/utils/__init__.py | item4/yui | 8628d0d54b94ada3cbe7d1b0f624063258bad10a | [
"MIT"
] | 21 | 2017-07-24T15:53:19.000Z | 2021-12-23T04:18:31.000Z | from .cast import AnyCaster
from .cast import BaseCaster
from .cast import BoolCaster
from .cast import CastError
from .cast import CasterBox
from .cast import DictCaster
from .cast import KNOWN_TYPES
from .cast import KnownTypesCaster
from .cast import ListCaster
from .cast import NewTypeCaster
from .cast import NoHan... | 29.65 | 45 | 0.835582 |
4a24bc7f9137a5247678617f2d58cdabe18309ea | 3,739 | py | Python | src/nodeconductor_gitlab/tests/test_resources.py | livenson/nodeconductor-gitlab | f668a1c1738c9ec23bbf8e6b6b27f7bdb491b873 | [
"MIT"
] | null | null | null | src/nodeconductor_gitlab/tests/test_resources.py | livenson/nodeconductor-gitlab | f668a1c1738c9ec23bbf8e6b6b27f7bdb491b873 | [
"MIT"
] | null | null | null | src/nodeconductor_gitlab/tests/test_resources.py | livenson/nodeconductor-gitlab | f668a1c1738c9ec23bbf8e6b6b27f7bdb491b873 | [
"MIT"
] | null | null | null | import mock
from rest_framework import status, test
from nodeconductor.structure.tests import factories as structure_factories
from . import factories
@mock.patch('nodeconductor.structure.models.ServiceProjectLink.get_backend')
class ProjectDeletionTest(test.APITransactionTestCase):
def setUp(self):
se... | 41.087912 | 97 | 0.754212 |
4a24bdbfb47559077775c123622e23b5a7838f5b | 6,274 | py | Python | BrainAnnex/pages/BA_pages_request_handler.py | BrainAnnex/brain-annex | 07701ba0309c448e9030a19a10dca4d73c155afe | [
"MIT"
] | null | null | null | BrainAnnex/pages/BA_pages_request_handler.py | BrainAnnex/brain-annex | 07701ba0309c448e9030a19a10dca4d73c155afe | [
"MIT"
] | 3 | 2021-12-19T03:58:42.000Z | 2022-02-11T07:40:46.000Z | BrainAnnex/pages/BA_pages_request_handler.py | BrainAnnex/brain-annex | 07701ba0309c448e9030a19a10dca4d73c155afe | [
"MIT"
] | null | null | null | from BrainAnnex.modules.neo_schema.neo_schema import NeoSchema
"""
MIT License. Copyright (c) 2021-2022 Julian A. West
"""
class PagesRequestHandler:
"""
Used by the UI for Page Generation.
This class does NOT get instantiated.
"""
db = None # "NeoAccess" object. MUST be set befor... | 35.050279 | 140 | 0.551323 |
4a24bfba346fd488a39ee091046075a7e8e343bc | 6,284 | py | Python | river/stats/quantile.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | 2 | 2021-04-13T09:19:42.000Z | 2021-12-22T13:43:15.000Z | river/stats/quantile.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | null | null | null | river/stats/quantile.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | null | null | null | import math
from river import utils
from . import base
class Quantile(base.Univariate):
"""Running quantile.
Uses the P² algorithm, which is also known as the "Piecewise-Parabolic quantile estimator".
The code is inspired by LiveStat's implementation [^2].
Parameters
----------
q
D... | 27.682819 | 192 | 0.527849 |
4a24c01bee8122cb9e7b9195080eef0936909581 | 1,318 | py | Python | CursoEmVideo/curso em video/ex95.py | elisio-ricardo/ExerciciosPythonCursoEmVideo | 47a10b2118a76f4f95a762876ef9ab90e92f4fd3 | [
"MIT"
] | null | null | null | CursoEmVideo/curso em video/ex95.py | elisio-ricardo/ExerciciosPythonCursoEmVideo | 47a10b2118a76f4f95a762876ef9ab90e92f4fd3 | [
"MIT"
] | null | null | null | CursoEmVideo/curso em video/ex95.py | elisio-ricardo/ExerciciosPythonCursoEmVideo | 47a10b2118a76f4f95a762876ef9ab90e92f4fd3 | [
"MIT"
] | null | null | null | time = list()
jogador = dict()
partidas = list()
while True:
jogador.clear()
jogador['nome'] = str(input('Nome do jogador: '))
tot = int(input(f'Quantas partidas {jogador["nome"]} jogou? '))
partidas.clear()
for c in range(0, tot):
partidas.append(int(input(f' Quantos gols na partida {c+1... | 30.651163 | 76 | 0.547041 |
4a24c126e7c4046280b77c5df9b05b481415ca98 | 1,133 | py | Python | python/src/nnabla/backward_function/patch_correlation.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 2,792 | 2017-06-26T13:05:44.000Z | 2022-03-28T07:55:26.000Z | python/src/nnabla/backward_function/patch_correlation.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 138 | 2017-06-27T07:04:44.000Z | 2022-02-28T01:37:15.000Z | python/src/nnabla/backward_function/patch_correlation.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 380 | 2017-06-26T13:23:52.000Z | 2022-03-25T16:51:30.000Z | # Copyright 2020,2021 Sony 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 40.464286 | 127 | 0.72639 |
4a24c1adceec55613f4620b0dba8fac9ddf47ff1 | 26,310 | py | Python | airflow/dag_processing/processor.py | rliuamzn/airflow | 177dfbd12a42a5c229640c6c830f43f280ea5caa | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-07-30T16:54:20.000Z | 2021-08-03T13:51:59.000Z | airflow/dag_processing/processor.py | rliuamzn/airflow | 177dfbd12a42a5c229640c6c830f43f280ea5caa | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 6 | 2020-12-22T17:43:49.000Z | 2021-04-27T13:41:10.000Z | airflow/dag_processing/processor.py | rliuamzn/airflow | 177dfbd12a42a5c229640c6c830f43f280ea5caa | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-11-01T16:22:58.000Z | 2020-11-01T16:22:58.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.476923 | 110 | 0.621475 |
4a24c2269b3c662ab174fda9c44b4df129da92f8 | 3,811 | py | Python | libraries/RealtimeUserSimulator.py | abhi-gm/Multi-Armed-Bandits-for-Recommendations-and-A-B-testing | 1626cc152e978a8cad223bce49b97fe5b5e1506b | [
"MIT"
] | null | null | null | libraries/RealtimeUserSimulator.py | abhi-gm/Multi-Armed-Bandits-for-Recommendations-and-A-B-testing | 1626cc152e978a8cad223bce49b97fe5b5e1506b | [
"MIT"
] | null | null | null | libraries/RealtimeUserSimulator.py | abhi-gm/Multi-Armed-Bandits-for-Recommendations-and-A-B-testing | 1626cc152e978a8cad223bce49b97fe5b5e1506b | [
"MIT"
] | 1 | 2021-10-20T22:27:58.000Z | 2021-10-20T22:27:58.000Z | '''
Author - Abhishek Maheshwarappa and Jiaxin Tong
'''
import numpy as np
from tqdm import tqdm
class ReplaySimulator(object):
'''
A class to provide base functionality for simulating the replayer method for online algorithms.
'''
def __init__(self, n_visits, reward_history, item_col... | 35.616822 | 136 | 0.544739 |
4a24c36ce57e948ae8f1054073a649fcb99c21fb | 1,006 | py | Python | watchman/integration/test_clock.py | istiak101/watchman | 8bede2333411b4cafc43c08ed21866dc100f3bd2 | [
"MIT"
] | 1 | 2022-03-04T14:09:05.000Z | 2022-03-04T14:09:05.000Z | watchman/integration/test_clock.py | Siyabonga-Gregory/watchman | 4c2a9ee8bc01f16be5be81c6734c0a00f8548770 | [
"MIT"
] | null | null | null | watchman/integration/test_clock.py | Siyabonga-Gregory/watchman | 4c2a9ee8bc01f16be5be81c6734c0a00f8548770 | [
"MIT"
] | null | null | null | # vim:ts=4:sw=4:et:
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from watchman.integration.lib import WatchmanTestCase
@WatchmanTestCase.expand_matrix
class TestClock(WatchmanTestCas... | 33.533333 | 76 | 0.646123 |
4a24c3f3c813bc28ed1b6d89317402a43da8f160 | 3,705 | py | Python | tests/integration/cli/conftest.py | unparalleled-js/ape | b5443197ebd73186bbf8e716fa7bba3260f3dc8a | [
"Apache-2.0"
] | 210 | 2021-04-29T05:42:42.000Z | 2022-03-31T15:50:17.000Z | tests/integration/cli/conftest.py | unparalleled-js/ape | b5443197ebd73186bbf8e716fa7bba3260f3dc8a | [
"Apache-2.0"
] | 370 | 2021-04-29T01:54:32.000Z | 2022-03-31T19:19:29.000Z | tests/integration/cli/conftest.py | unparalleled-js/ape | b5443197ebd73186bbf8e716fa7bba3260f3dc8a | [
"Apache-2.0"
] | 25 | 2021-04-29T05:08:50.000Z | 2022-03-11T20:43:56.000Z | import os
from distutils.dir_util import copy_tree
from importlib import import_module
from pathlib import Path
import pytest
from click.testing import CliRunner
import ape
from ape import Project
from .utils import NodeId, project_names, project_skipper, projects_directory
class IntegrationTestModule:
"""
... | 26.654676 | 89 | 0.68502 |
4a24c41493cd50e5ac11abe6524a00e5777b21a2 | 132 | py | Python | pyrhyme_demo.py | GSejas/pyrhyme | b9aab24b88130c9b1e48b5015098408bd21faa71 | [
"MIT"
] | 1 | 2020-05-05T11:54:10.000Z | 2020-05-05T11:54:10.000Z | pyrhyme_demo.py | GSejas/pyrhyme | b9aab24b88130c9b1e48b5015098408bd21faa71 | [
"MIT"
] | null | null | null | pyrhyme_demo.py | GSejas/pyrhyme | b9aab24b88130c9b1e48b5015098408bd21faa71 | [
"MIT"
] | null | null | null | import pyrhyme
rb = pyrhyme.RhymeBrain()
for obt in rb.rhyming_list(word="Dorf"):
print(obt["word"])
print(obt.freq)
| 18.857143 | 41 | 0.651515 |
4a24c4f25bd8f6bfda21592ff98ecc7aed866373 | 6,794 | py | Python | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslcertkey_service_binding.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslcertkey_service_binding.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslcertkey_service_binding.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2016 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 27.844262 | 253 | 0.719017 |
4a24c5f4720b7cefe9f68f42d7d1e269374df833 | 267 | py | Python | typeidea/typeidea/settings/develop.py | BaichengLu/MyBlog | ab55dd7c98468ba68f3074541163764748fc4972 | [
"MIT"
] | null | null | null | typeidea/typeidea/settings/develop.py | BaichengLu/MyBlog | ab55dd7c98468ba68f3074541163764748fc4972 | [
"MIT"
] | null | null | null | typeidea/typeidea/settings/develop.py | BaichengLu/MyBlog | ab55dd7c98468ba68f3074541163764748fc4972 | [
"MIT"
] | null | null | null | from .base import * # NOQA
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'blog_db',
'USER': 'blog',
'PASSWORD': 'blog123.',
'HOST': '192.168.174.130',
'PORT': 3306
}
}
| 17.8 | 45 | 0.479401 |
4a24c671d667ee4a5eabbc76c3a7b65424dc41ff | 4,928 | py | Python | pypureclient/flashblade/FB_2_3/models/hardware_connector.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flashblade/FB_2_3/models/hardware_connector.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flashblade/FB_2_3/models/hardware_connector.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashBlade REST API
A lightweight client for FlashBlade REST API 2.3, developed by Pure Storage, Inc. (http://www.purestorage.com/).
OpenAPI spec version: 2.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typ... | 34.704225 | 516 | 0.576907 |
4a24c70f4a64b73ceafd2936bb31c7b90442b9a2 | 398 | py | Python | dnfas/settings/development.py | altest-com/dnfas-api | 56b4dfbef33fd9ad6e6504d1cb88105069b57d70 | [
"MIT"
] | null | null | null | dnfas/settings/development.py | altest-com/dnfas-api | 56b4dfbef33fd9ad6e6504d1cb88105069b57d70 | [
"MIT"
] | 1 | 2020-03-31T17:20:57.000Z | 2020-04-01T17:40:31.000Z | dnfas/settings/development.py | altest-com/dnfas-api | 56b4dfbef33fd9ad6e6504d1cb88105069b57d70 | [
"MIT"
] | null | null | null | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# Django rest framework
REST_FRAMEWORK.update({
'DEFAULT_AUTHENTICATION_CLASSES': (
'users.backends.JWTAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthen... | 23.411765 | 65 | 0.721106 |
4a24c766acfe8638ef22e9b9436afb060ce1e6a2 | 514 | py | Python | feng-ml-python/src/GradienAlgorithm.py | JiangFeng07/feng-python-apply | 1dec2d518ea257467c9b253981cfc281d7ac108a | [
"MIT"
] | 12 | 2017-08-05T16:46:25.000Z | 2019-04-18T08:32:16.000Z | feng-ml-python/src/GradienAlgorithm.py | JiangFeng07/feng-python-apply | 1dec2d518ea257467c9b253981cfc281d7ac108a | [
"MIT"
] | null | null | null | feng-ml-python/src/GradienAlgorithm.py | JiangFeng07/feng-python-apply | 1dec2d518ea257467c9b253981cfc281d7ac108a | [
"MIT"
] | 18 | 2017-08-30T10:58:02.000Z | 2019-12-09T13:27:34.000Z | # encoding=utf-8
x_old = 0
x_new = 6
gamma = 0.01
precision = 0.00000001
# x = Symbol("x")
# f = (x ** 4) - (3 * (x ** 3)) + 2
# 梯度下降算法
def df(x):
y = 4 * x ** 3 - 9 * x ** 2
return y
while abs(x_new - x_old) > precision:
x_old = x_new
x_new += -gamma * df(x_old)
print("The local minimum occurs a... | 14.277778 | 43 | 0.558366 |
4a24c82bd2c6e9d5139a1f3f0a57e1f980f71428 | 2,731 | py | Python | mycli/key_bindings.py | lyrl/mycli | d62eefdc819a11ecdb97d93dd7ad1922d28a3795 | [
"BSD-3-Clause"
] | 10,997 | 2015-07-27T06:59:04.000Z | 2022-03-31T07:49:26.000Z | mycli/key_bindings.py | lyrl/mycli | d62eefdc819a11ecdb97d93dd7ad1922d28a3795 | [
"BSD-3-Clause"
] | 937 | 2015-07-29T09:25:30.000Z | 2022-03-30T23:54:03.000Z | mycli/key_bindings.py | lyrl/mycli | d62eefdc819a11ecdb97d93dd7ad1922d28a3795 | [
"BSD-3-Clause"
] | 799 | 2015-07-27T13:13:49.000Z | 2022-03-29T21:24:39.000Z | import logging
from prompt_toolkit.enums import EditingMode
from prompt_toolkit.filters import completion_is_selected
from prompt_toolkit.key_binding import KeyBindings
_logger = logging.getLogger(__name__)
def mycli_bindings(mycli):
"""Custom key bindings for mycli."""
kb = KeyBindings()
@kb.add('f2')
... | 30.344444 | 79 | 0.624313 |
4a24c82f43ddecd8279b927fc09b57c4b8d9a723 | 1,328 | py | Python | Python/maximum-distance-in-arrays.py | jolie1191/LeetCode | c081a67d3802b8ccf71b80cf0ec18346a46c1f82 | [
"MIT"
] | 5 | 2017-11-14T09:32:33.000Z | 2020-05-11T05:15:41.000Z | Python/maximum-distance-in-arrays.py | chairco/LeetCode | c35e1e04119de315560ec663fe5f56d918f0ed50 | [
"MIT"
] | null | null | null | Python/maximum-distance-in-arrays.py | chairco/LeetCode | c35e1e04119de315560ec663fe5f56d918f0ed50 | [
"MIT"
] | 3 | 2019-05-14T02:49:34.000Z | 2020-05-19T08:45:39.000Z | # Time: O(n)
# Space: O(1)
# Given m arrays, and each array is sorted in ascending order.
# Now you can pick up two integers from two different arrays (each array picks one)
# and calculate the distance.
# We define the distance between two integers a and b to be their absolute difference |a-b|.
# Your task is to fin... | 35.891892 | 92 | 0.612199 |
4a24c87178da1020bd24319df55db6af5c2b8855 | 396 | py | Python | befh/__init__.py | joshua-jd-lee/BitcoinExchangeFH | d8661daf6882db30e9ac720c20c20737af9b118b | [
"Apache-2.0"
] | 310 | 2018-10-13T13:52:33.000Z | 2022-03-20T17:54:36.000Z | befh/__init__.py | joshua-jd-lee/BitcoinExchangeFH | d8661daf6882db30e9ac720c20c20737af9b118b | [
"Apache-2.0"
] | 45 | 2018-11-09T11:11:01.000Z | 2021-11-10T00:39:17.000Z | befh/__init__.py | joshua-jd-lee/BitcoinExchangeFH | d8661daf6882db30e9ac720c20c20737af9b118b | [
"Apache-2.0"
] | 121 | 2018-10-24T20:37:46.000Z | 2022-03-28T04:38:55.000Z | # -*- coding: utf-8 -*-
"""Top-level package for Bitcoin exchange feedhandler."""
__author__ = """Gavin Chan"""
__email__ = 'gavincyi@gmail.com'
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not... | 23.294118 | 64 | 0.747475 |
4a24c95afba4f81a08cc61191fef1b99b9ee7b4c | 553 | py | Python | pypy/module/_collections/interp_defaultdict.py | microvm/pypy-mu | 6b03fbe93052d0eb3a4c67152c987c16837b3484 | [
"Apache-2.0",
"OpenSSL"
] | 34 | 2015-07-09T04:53:27.000Z | 2021-07-19T05:22:27.000Z | pypy/module/_collections/interp_defaultdict.py | microvm/pypy-mu | 6b03fbe93052d0eb3a4c67152c987c16837b3484 | [
"Apache-2.0",
"OpenSSL"
] | 6 | 2015-05-30T17:20:45.000Z | 2017-06-12T14:29:23.000Z | pypy/module/_collections/interp_defaultdict.py | microvm/pypy-mu | 6b03fbe93052d0eb3a4c67152c987c16837b3484 | [
"Apache-2.0",
"OpenSSL"
] | 11 | 2015-09-07T14:26:08.000Z | 2020-04-10T07:20:41.000Z | from pypy.interpreter.error import OperationError
def missing(space, w_self, w_key):
# An interp-level version of this method. This is mostly only
# useful because it can be executed atomically in the presence of
# threads.
w_default_factory = space.getattr(w_self, space.wrap('default_factory'))
i... | 42.538462 | 76 | 0.746835 |
4a24c9d7049a640434974c8d11fdb28b42742911 | 9,717 | py | Python | main.py | stridera/Rainbow | 69b1b30c3a8a5b13af88e87a9103d42cc70e505f | [
"MIT"
] | 1 | 2020-03-15T09:32:36.000Z | 2020-03-15T09:32:36.000Z | main.py | stridera/Rainbow | 69b1b30c3a8a5b13af88e87a9103d42cc70e505f | [
"MIT"
] | null | null | null | main.py | stridera/Rainbow | 69b1b30c3a8a5b13af88e87a9103d42cc70e505f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
import argparse
import bz2
from datetime import datetime
import os
import pickle
import numpy as np
import torch
from tqdm import trange
from agent import Agent
from robotronenv import Env
# from env import Env
from memory import ReplayMemory
from test import te... | 47.866995 | 120 | 0.672738 |
4a24ca10ebf588178aaa452577468c8da8bca9b9 | 301 | py | Python | api/__init__.py | Toskgreg/GoldenLions | 6616e7f531dc607cf7ddb75bfa341b5040c739a5 | [
"Apache-2.0"
] | 1 | 2019-01-30T17:41:53.000Z | 2019-01-30T17:41:53.000Z | api/__init__.py | bisonlou/challenge-III | 25b5fa7dcaf28606434175b240585a6e403ead09 | [
"Apache-2.0"
] | 3 | 2019-01-22T07:54:31.000Z | 2019-02-11T09:56:41.000Z | api/__init__.py | Toskgreg/GoldenLions | 6616e7f531dc607cf7ddb75bfa341b5040c739a5 | [
"Apache-2.0"
] | 1 | 2019-02-11T19:10:37.000Z | 2019-02-11T19:10:37.000Z | from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
test_client = app.test_client()
import api.database.engine
import api.views.user_view
import api.views.red_flag_view
import api.views.common_routes
import api.views.intervention_view
import api.models.user_model
| 17.705882 | 34 | 0.82392 |
4a24cbf89e5b2a354e1d762c7bbf095fda4407dd | 1,335 | py | Python | days/day_3/day_3_part_1.py | sharkbound/adventofcode2021 | b4f4721ffad91e4df73a831d5322d17ede06f9b3 | [
"MIT"
] | null | null | null | days/day_3/day_3_part_1.py | sharkbound/adventofcode2021 | b4f4721ffad91e4df73a831d5322d17ede06f9b3 | [
"MIT"
] | null | null | null | days/day_3/day_3_part_1.py | sharkbound/adventofcode2021 | b4f4721ffad91e4df73a831d5322d17ede06f9b3 | [
"MIT"
] | null | null | null | from collections import Counter
from icecream import ic
from day import Day
import re
import numpy as np
import utils
"""
You need to use the binary numbers in the
diagnostic report to generate two new binary numbers (called the gamma rate and the epsilon rate).
The power consumption can then be found by multipl... | 25.188679 | 99 | 0.580524 |
4a24cca4f04ca351eedbde310c6f2f356a6b3fd9 | 7,327 | py | Python | lib/surface/logging/sinks/update.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | null | null | null | lib/surface/logging/sinks/update.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | null | null | null | lib/surface/logging/sinks/update.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | 1 | 2020-07-25T12:23:41.000Z | 2020-07-25T12:23:41.000Z | # Copyright 2014 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 ag... | 38.973404 | 80 | 0.696056 |
4a24cca7dc3f7b5da5d1ab460e9dfd83ff805ad9 | 4,816 | py | Python | dashboard/dashboard/pinpoint/handlers/isolate.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 1 | 2021-07-04T03:26:43.000Z | 2021-07-04T03:26:43.000Z | dashboard/dashboard/pinpoint/handlers/isolate.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/pinpoint/handlers/isolate.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Service for tracking isolates and looking them up by builder and commit.
An isolate is a way to describe the dependencies of a specific build.
More about... | 32.540541 | 82 | 0.697051 |
4a24cd9b459a2d881b8e0c5cb7d026d49ff0f275 | 13,306 | py | Python | mydatamyconsent/model/error_type.py | My-Data-My-Consent/python-sdk | 414640bcda6350e6f5e74e42442737eb8d5b7447 | [
"Apache-2.0"
] | null | null | null | mydatamyconsent/model/error_type.py | My-Data-My-Consent/python-sdk | 414640bcda6350e6f5e74e42442737eb8d5b7447 | [
"Apache-2.0"
] | 5 | 2021-12-19T10:29:43.000Z | 2022-03-31T22:15:37.000Z | mydatamyconsent/model/error_type.py | mydatamyconsent/python-sdk | 414640bcda6350e6f5e74e42442737eb8d5b7447 | [
"Apache-2.0"
] | null | null | null | """
My Data My Consent - Developer API
Unleashing the power of data consent by establishing trust. The Platform Core Developer API defines a set of capabilities that can be used to request, issue, manage and update data, documents and credentials by organizations. The API can be used to request, manage and upd... | 44.651007 | 469 | 0.570119 |
4a24cde078bc8e66d4ed61b6c14ae1f36440ec0a | 734 | py | Python | tfx/version.py | Saiprasad16/tfx | c1e0704b2a83232469f55598efcdb7808b6c909f | [
"Apache-2.0"
] | 1 | 2021-05-10T10:41:06.000Z | 2021-05-10T10:41:06.000Z | tfx/version.py | Saiprasad16/tfx | c1e0704b2a83232469f55598efcdb7808b6c909f | [
"Apache-2.0"
] | null | null | null | tfx/version.py | Saiprasad16/tfx | c1e0704b2a83232469f55598efcdb7808b6c909f | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 38.631579 | 74 | 0.752044 |
4a24ce234ccc4632854811aed67b16a67fd93175 | 615 | py | Python | blender/arm/logicnode/array_remove.py | astronalta/armory-3d | 15fa9fe50587e9e054cc5176f9a7de334cce5113 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/array_remove.py | astronalta/armory-3d | 15fa9fe50587e9e054cc5176f9a7de334cce5113 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/array_remove.py | astronalta/armory-3d | 15fa9fe50587e9e054cc5176f9a7de334cce5113 | [
"Zlib"
] | null | null | null | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class ArrayRemoveNode(Node, ArmLogicTreeNode):
'''Array remove node'''
bl_idname = 'LNArrayRemoveNode'
bl_label = 'Array Remove'
bl_icon = 'GAME'
def init(self, context):
self.in... | 30.75 | 54 | 0.691057 |
4a24ce592bf9a1ad1bfa8597f12822f88adc0326 | 635 | py | Python | pyridge/preprocess/log.py | cperales/PyRidge | b0029fae9e24a4e5c364bbd8fc3791eab15baa75 | [
"MIT"
] | 8 | 2019-03-09T13:47:23.000Z | 2022-01-29T03:51:00.000Z | pyridge/preprocess/log.py | cperales/pyridge | 74a9aa83c1687e5362b0fd02f526281ad6837b75 | [
"MIT"
] | 1 | 2018-10-19T18:46:53.000Z | 2018-10-19T18:46:53.000Z | pyridge/preprocess/log.py | cperales/PyRidge | b0029fae9e24a4e5c364bbd8fc3791eab15baa75 | [
"MIT"
] | 3 | 2020-08-26T10:08:20.000Z | 2021-11-13T11:42:23.000Z | from pyridge.generic.scaler import Scaler
import numpy as np
class LogScaler(Scaler):
"""
Scaler for that transform the values in a logaritmic
scaler.
"""
def __init__(self):
self.min_: np.float
def get_params(self):
return {'min_': self.min_}
def fit(self, values):
... | 22.678571 | 56 | 0.623622 |
4a24ceb5e53ef73eeae8f50209b18d931e372b4f | 7,842 | py | Python | ceilometer/tests/unit/hardware/pollsters/test_generic.py | stackhpc/ceilometer | f19037c1b616f2ecb8fd4a1d446687538327e687 | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/unit/hardware/pollsters/test_generic.py | stackhpc/ceilometer | f19037c1b616f2ecb8fd4a1d446687538327e687 | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/unit/hardware/pollsters/test_generic.py | stackhpc/ceilometer | f19037c1b616f2ecb8fd4a1d446687538327e687 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 Intel Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 40.010204 | 78 | 0.554578 |
4a24d197dd2428eae1b7e3f94b91343bf5130617 | 9,366 | py | Python | photospline/resources/scripts/glam-photonics.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 1 | 2020-12-24T22:00:01.000Z | 2020-12-24T22:00:01.000Z | photospline/resources/scripts/glam-photonics.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | null | null | null | photospline/resources/scripts/glam-photonics.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 3 | 2020-07-17T09:20:29.000Z | 2021-03-30T16:44:18.000Z | from icecube.photospline import splinefitstable
from optparse import OptionParser
from icecube.photospline.photonics import *
try:
input = raw_input
except NameError:
pass
import sys
import os
import numpy
# Hard-coded params
#nknots =[17, 6, 12, 25] # [r, phi, z, t] For Nathan/Jakob's binning
# Parse argument... | 36.162162 | 87 | 0.690049 |
4a24d284d629284f315011b7f501fc41c9a4a9d9 | 3,268 | py | Python | applications/tensorflow/cnns/training/Models/model_base.py | xihuaiwen/chinese_bert | 631afbc76c40b0ac033be2186e717885246f446c | [
"MIT"
] | null | null | null | applications/tensorflow/cnns/training/Models/model_base.py | xihuaiwen/chinese_bert | 631afbc76c40b0ac033be2186e717885246f446c | [
"MIT"
] | null | null | null | applications/tensorflow/cnns/training/Models/model_base.py | xihuaiwen/chinese_bert | 631afbc76c40b0ac033be2186e717885246f446c | [
"MIT"
] | null | null | null | # Copyright 2020 Graphcore Ltd.
import tensorflow as tf
from functools import partial
def custom_dtype_getter(getter, name, dtype, trainable,
master_weight_filter_fn,
shape=None, *args, **kwargs):
master_dtype = master_weight_filter_fn(name)
if dtype != master_d... | 35.139785 | 97 | 0.584149 |
4a24d28808d585ebc2b370747222c2624a73176c | 3,621 | py | Python | numpyro/distributions/__init__.py | quattro/numpyro | b7b6e937297ea47c55760446134f84fc82936a9d | [
"Apache-2.0"
] | null | null | null | numpyro/distributions/__init__.py | quattro/numpyro | b7b6e937297ea47c55760446134f84fc82936a9d | [
"Apache-2.0"
] | null | null | null | numpyro/distributions/__init__.py | quattro/numpyro | b7b6e937297ea47c55760446134f84fc82936a9d | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from numpyro.distributions.conjugate import (
BetaBinomial,
DirichletMultinomial,
GammaPoisson,
NegativeBinomial2,
NegativeBinomialLogits,
NegativeBinomialProbs,
ZeroInflatedNegativeBinomial2,
)
from numpyro... | 21.175439 | 60 | 0.684894 |
4a24d29bbaf05e31a1e4ac4cc8eab395b67d68f3 | 3,113 | py | Python | Python/paste.py | Zarthus/Code-Snippets | ce2025cde910278e3cfdab4a84a2127910b7ca28 | [
"MIT"
] | null | null | null | Python/paste.py | Zarthus/Code-Snippets | ce2025cde910278e3cfdab4a84a2127910b7ca28 | [
"MIT"
] | 1 | 2015-02-01T09:35:23.000Z | 2015-02-01T10:20:22.000Z | Python/paste.py | Zarthus/Code-Snippets | ce2025cde910278e3cfdab4a84a2127910b7ca28 | [
"MIT"
] | 1 | 2019-11-26T11:54:02.000Z | 2019-11-26T11:54:02.000Z | """
paste.py by Zarthus,
Licensed under MIT
"""
import requests
import json
class Paste:
"""
paste.py: Serveral methods to store text online.
All methods in this class are 'static' and support the 'logger' parameter,
Whenever possible, passing this parameter ensures errors will be logged to console,... | 30.223301 | 116 | 0.569547 |
4a24d349776501706f895d41baadf1b5105ef618 | 723 | py | Python | 0x0F-python-object_relational_mapping/4-cities_by_state.py | oluwaseun-ebenezer/holbertonschool-higher_level_programming | e830f969d3ca71abf0a2f6d4f7c64a82337eccd7 | [
"MIT"
] | null | null | null | 0x0F-python-object_relational_mapping/4-cities_by_state.py | oluwaseun-ebenezer/holbertonschool-higher_level_programming | e830f969d3ca71abf0a2f6d4f7c64a82337eccd7 | [
"MIT"
] | null | null | null | 0x0F-python-object_relational_mapping/4-cities_by_state.py | oluwaseun-ebenezer/holbertonschool-higher_level_programming | e830f969d3ca71abf0a2f6d4f7c64a82337eccd7 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
'''Prints all cities and their state in a database.
'''
import sys
import MySQLdb
if __name__ == '__main__':
if len(sys.argv) >= 4:
db_connection = MySQLdb.connect(
host='localhost',
port=3306,
user=sys.argv[1],
passwd=sys.argv[2],
... | 26.777778 | 70 | 0.547718 |
4a24d434912e3b460808b2959981543b324bb75f | 596 | py | Python | software/server/V2.0/main.py | NKUSTMCU/MCU | 857135cd83fa55662ba06b44eafe6c7507e4eec5 | [
"MIT"
] | null | null | null | software/server/V2.0/main.py | NKUSTMCU/MCU | 857135cd83fa55662ba06b44eafe6c7507e4eec5 | [
"MIT"
] | null | null | null | software/server/V2.0/main.py | NKUSTMCU/MCU | 857135cd83fa55662ba06b44eafe6c7507e4eec5 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, Response
from camera import VideoCamera
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
def gen(camera):
while True:
frame = camera.get_frame()
yield (b'--frame\r\n'
b'Content-Type: i... | 27.090909 | 74 | 0.610738 |
4a24d456596cebde0564f30a8ecc01c62baf6dac | 1,639 | py | Python | src/predict_job_class.py | samshad/Predict_Job_Type | 0857dbeca5a029f751a0fe8860e4f983333cbcf0 | [
"MIT"
] | null | null | null | src/predict_job_class.py | samshad/Predict_Job_Type | 0857dbeca5a029f751a0fe8860e4f983333cbcf0 | [
"MIT"
] | null | null | null | src/predict_job_class.py | samshad/Predict_Job_Type | 0857dbeca5a029f751a0fe8860e4f983333cbcf0 | [
"MIT"
] | null | null | null | import PyPDF2
import text_cleaner as tc
import pickle
import pandas as pd
def extract_text_from_pdf(file):
f_reader = PyPDF2.PdfFileReader(open(file, 'rb'))
page_count = f_reader.getNumPages()
text = [f_reader.getPage(i).extractText() for i in range(page_count)]
return str(text).replace("\\n", "")
d... | 31.519231 | 87 | 0.707749 |
4a24d459c9127836324f0a9607061d94d5fd9e37 | 19,170 | py | Python | dvc/output/base.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | null | null | null | dvc/output/base.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 81 | 2021-04-13T08:02:09.000Z | 2022-03-30T16:10:17.000Z | dvc/output/base.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 2 | 2021-06-14T19:12:25.000Z | 2021-06-14T19:12:29.000Z | import logging
import os
from copy import copy
from typing import Type
from urllib.parse import urlparse
from voluptuous import Any
import dvc.objects as objects
import dvc.prompt as prompt
from dvc.checkout import checkout
from dvc.exceptions import (
CheckoutError,
CollectCacheError,
DvcException,
M... | 28.484398 | 79 | 0.57663 |
4a24d55254f47deb5cddb4570c50e2d744308e4f | 395 | py | Python | qctrl_api/qctrl_api/wsgi.py | bibek-Neupane/back-end-challenge | d5a7b33adaa59e5ad566ac7435132c990f80a740 | [
"Apache-2.0"
] | null | null | null | qctrl_api/qctrl_api/wsgi.py | bibek-Neupane/back-end-challenge | d5a7b33adaa59e5ad566ac7435132c990f80a740 | [
"Apache-2.0"
] | null | null | null | qctrl_api/qctrl_api/wsgi.py | bibek-Neupane/back-end-challenge | d5a7b33adaa59e5ad566ac7435132c990f80a740 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for qctrl_api project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
4a24d565d5685bb8cdf3477da4384c8d2c0ebaeb | 1,879 | py | Python | bintree.py | zhoujungis/Data-Structures-and-Algorithms | b96ff2eeca6dee8e6cfa6dd53f78fb84a2af7acf | [
"Apache-2.0"
] | null | null | null | bintree.py | zhoujungis/Data-Structures-and-Algorithms | b96ff2eeca6dee8e6cfa6dd53f78fb84a2af7acf | [
"Apache-2.0"
] | null | null | null | bintree.py | zhoujungis/Data-Structures-and-Algorithms | b96ff2eeca6dee8e6cfa6dd53f78fb84a2af7acf | [
"Apache-2.0"
] | null | null | null | from prioqueue import PrioQueue
class BinTNode:
def __init__(self, data, left=None, right=None):
self.data = data
self.left = left
self.right = right
class BinTree:
def __init__(self):
self._root = None
def is_empty(self):
return self._root is None
... | 24.723684 | 53 | 0.53273 |
4a24d58f7170b34c9d582f76324a87311cfb1b87 | 2,769 | py | Python | model.py | dsmoore96/wineorigin | 7c628a4811108fc651347ca04674f76345935884 | [
"Apache-2.0"
] | 1 | 2018-11-29T05:21:17.000Z | 2018-11-29T05:21:17.000Z | model.py | dsmoore96/wineorigin | 7c628a4811108fc651347ca04674f76345935884 | [
"Apache-2.0"
] | 1 | 2018-12-06T08:02:04.000Z | 2018-12-06T08:02:04.000Z | model.py | dsmoore96/wineorigin | 7c628a4811108fc651347ca04674f76345935884 | [
"Apache-2.0"
] | 1 | 2019-02-19T00:59:41.000Z | 2019-02-19T00:59:41.000Z | import gensim
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class CNN_Text(nn.Module):
def __init__(self, args):
super(CNN_Text, self).__init__()
self.args = args
V = args.embed_num
D = args.e... | 28.84375 | 93 | 0.530878 |
4a24d5e8e4864c0b5df5825fdf7dd75b9ea4e5d1 | 166 | py | Python | notebooks/funnel/config.py | matt-long/aerobic-safety-margins | 2f58775d8e67ea105a217ce89d09e239d208e001 | [
"MIT"
] | null | null | null | notebooks/funnel/config.py | matt-long/aerobic-safety-margins | 2f58775d8e67ea105a217ce89d09e239d208e001 | [
"MIT"
] | null | null | null | notebooks/funnel/config.py | matt-long/aerobic-safety-margins | 2f58775d8e67ea105a217ce89d09e239d208e001 | [
"MIT"
] | null | null | null | cache_catalog_dir = 'data/funnel-catalog'
cache_catalog_prefix = 'funnel-catalog-entry'
cache_format = 'zarr'
# TODO: provide some defaults and control over defaults
| 33.2 | 55 | 0.801205 |
4a24d5f6ffb0567fa893d2af018c946e695cbb7b | 5,395 | py | Python | src/datadog_api_client/v2/model/role_create_request.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 32 | 2021-01-07T15:09:56.000Z | 2022-01-30T05:49:23.000Z | src/datadog_api_client/v2/model/role_create_request.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 228 | 2020-09-03T14:03:54.000Z | 2022-03-31T20:16:12.000Z | src/datadog_api_client/v2/model/role_create_request.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 12 | 2020-09-15T21:36:03.000Z | 2022-03-31T17:13:17.000Z | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v2.model_utils import ( # noqa: F401
ApiTypeError,
Mo... | 38.535714 | 108 | 0.592586 |
4a24d80d1a515b764fcf4f14121e595d3d5924f7 | 33,117 | py | Python | reactive/etcd.py | exceptorr/layer-etcd | 53d38096a6de8d4bcc18a2cb64a94d904c496660 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | reactive/etcd.py | exceptorr/layer-etcd | 53d38096a6de8d4bcc18a2cb64a94d904c496660 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | reactive/etcd.py | exceptorr/layer-etcd | 53d38096a6de8d4bcc18a2cb64a94d904c496660 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
from charms import layer
from charms.layer import snap
from charms.reactive import endpoint_from_flag
from charms.reactive import when
from charms.reactive import when_any
from charms.reactive import when_not
from charms.reactive import is_state
from charms.reactive import set_state
from charms.re... | 35.156051 | 86 | 0.681372 |
4a24d820bda9a5ab1d6c6218445a812be86baff2 | 3,988 | py | Python | data/process_data.py | Duratorre/Disaster-Response-Pipeline | d68a51bd0d7d53a7a09259586011b76e8882ac08 | [
"zlib-acknowledgement"
] | null | null | null | data/process_data.py | Duratorre/Disaster-Response-Pipeline | d68a51bd0d7d53a7a09259586011b76e8882ac08 | [
"zlib-acknowledgement"
] | null | null | null | data/process_data.py | Duratorre/Disaster-Response-Pipeline | d68a51bd0d7d53a7a09259586011b76e8882ac08 | [
"zlib-acknowledgement"
] | null | null | null | # import libraries
import sys
import pandas as pd
from sqlalchemy import create_engine
# load messages and categories datasets
def load_data(messages_filepath, categories_filepath):
'''
The function takes as input the directories of the messages and categories
with respect to the working directory, loads t... | 34.08547 | 113 | 0.694835 |
4a24d8a0a0eddad330093fc7c06367f6d0148a22 | 172 | py | Python | sequenceapi/asgi.py | tiveritz/sequence-api | ba0fb432028eaf878122e4d96d8b1ce234602e47 | [
"MIT"
] | null | null | null | sequenceapi/asgi.py | tiveritz/sequence-api | ba0fb432028eaf878122e4d96d8b1ce234602e47 | [
"MIT"
] | null | null | null | sequenceapi/asgi.py | tiveritz/sequence-api | ba0fb432028eaf878122e4d96d8b1ce234602e47 | [
"MIT"
] | null | null | null | import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sequenceapi.settings')
application = get_asgi_application()
| 21.5 | 71 | 0.831395 |
4a24d8a811a8e09d385b9b0c634339a0ed43cc2d | 1,990 | py | Python | repos/system_upgrade/el7toel8/actors/checkcpu/libraries/cpu.py | fellipeh/leapp-repository | 874e480fa84476fee37da4f184b47f2472748929 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/checkcpu/libraries/cpu.py | fellipeh/leapp-repository | 874e480fa84476fee37da4f184b47f2472748929 | [
"Apache-2.0"
] | 1 | 2020-04-03T07:41:43.000Z | 2020-04-03T07:41:43.000Z | repos/system_upgrade/el7toel8/actors/checkcpu/libraries/cpu.py | pirat89/leapp-repository | aac51ab67ee22413a7ab1da6cec33e54b9357afd | [
"Apache-2.0"
] | null | null | null |
from leapp import reporting
from leapp.exceptions import StopActorExecutionError
from leapp.libraries.common.config import architecture
from leapp.libraries.stdlib import api
from leapp.models import CPUInfo
SUPPORTED_MACHINE_TYPES = [2964, 2965, 3906, 3907]
def process():
if not architecture.matches_architectu... | 47.380952 | 103 | 0.663317 |
4a24d8d0a34b10b02fa1fe2a018574d1fe473363 | 1,595 | py | Python | Test_Python_code/last/02_Indonesia_Com/total_death_indonesia.py | pdeesawat/PSIT58_test_01 | 631946eacd82503e0697680f06290a4fe10f17f2 | [
"Apache-2.0"
] | null | null | null | Test_Python_code/last/02_Indonesia_Com/total_death_indonesia.py | pdeesawat/PSIT58_test_01 | 631946eacd82503e0697680f06290a4fe10f17f2 | [
"Apache-2.0"
] | null | null | null | Test_Python_code/last/02_Indonesia_Com/total_death_indonesia.py | pdeesawat/PSIT58_test_01 | 631946eacd82503e0697680f06290a4fe10f17f2 | [
"Apache-2.0"
] | null | null | null | """Import Module Plotly To Ploting Graph"""
import plotly.plotly as py
import plotly.graph_objs as go
"""Open and Read CSV from database"""
data = open('Real_Final_database_02.csv')
alldata = data.readlines()
listdata = []
for i in alldata:
listdata.append(i.strip().split(','))
type_z = ['Flood', 'Epidemic', ... | 35.444444 | 102 | 0.578056 |
4a24dad199061ca157cbdeb2ce7ebd284534f666 | 549 | py | Python | database_demo.py | DMH2021/website_project | 8acffa0be705a4cd899f979b8b5af494f01a11ec | [
"Apache-2.0"
] | null | null | null | database_demo.py | DMH2021/website_project | 8acffa0be705a4cd899f979b8b5af494f01a11ec | [
"Apache-2.0"
] | null | null | null | database_demo.py | DMH2021/website_project | 8acffa0be705a4cd899f979b8b5af494f01a11ec | [
"Apache-2.0"
] | null | null | null | import sqlite3
def main():
conn = sqlite3.connect("site_data.db")
# Adding new data with the insert statement
cursor = conn.execute("INSERT INTO messages VALUES ('Sam', 'python is cool', 0)")
cursor.close()
conn.commit()
# Querying the database with SELECT statement
cursor = conn.execute("SE... | 32.294118 | 85 | 0.641166 |
4a24dd7093fb8f03663e3ad4826612cb51b67b7e | 5,312 | py | Python | python/qilinguist/test/test_gettext.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | python/qilinguist/test/test_gettext.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | python/qilinguist/test/test_gettext.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... | 36.136054 | 108 | 0.657003 |
4a24de0b33b27569c570076dbb3aa58427d1c5ed | 714 | py | Python | backend/env/lib/python3.8/site-packages/zmq/devices/__init__.py | lubitelpospat/CFM-source | 4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03 | [
"MIT"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | backend/env/lib/python3.8/site-packages/zmq/devices/__init__.py | lubitelpospat/CFM-source | 4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03 | [
"MIT"
] | 26 | 2020-03-24T18:07:06.000Z | 2022-03-12T00:12:27.000Z | backend/env/lib/python3.8/site-packages/zmq/devices/__init__.py | lubitelpospat/CFM-source | 4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03 | [
"MIT"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | """0MQ Device classes for running in background threads or processes."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq import device
from zmq.devices import (
basedevice,
monitoredqueue,
monitoredqueuedevice,
proxydevice,
proxysteerabledevice,... | 23.8 | 72 | 0.759104 |
4a24de877d28556a5136f1cf9259b141e0f2eddd | 993 | py | Python | test/tbaa.py | KennethNielsen/llvmpy | 70c5957cfd10f1e32a44f28dcb9a4dc72d499c2e | [
"BSD-3-Clause"
] | 140 | 2015-01-07T20:58:12.000Z | 2022-01-21T17:02:21.000Z | test/tbaa.py | KennethNielsen/llvmpy | 70c5957cfd10f1e32a44f28dcb9a4dc72d499c2e | [
"BSD-3-Clause"
] | 19 | 2015-01-15T14:45:49.000Z | 2020-09-04T14:58:23.000Z | test/tbaa.py | KennethNielsen/llvmpy | 70c5957cfd10f1e32a44f28dcb9a4dc72d499c2e | [
"BSD-3-Clause"
] | 12 | 2015-01-12T01:49:32.000Z | 2020-07-10T22:30:38.000Z | from llvm.core import *
from llvm.tbaa import *
from llvm.tests.support import TestCase
import unittest
class TestTBAABuilder(TestCase):
def test_tbaa_builder(self):
mod = Module.new('test_tbaa_builder')
fty = Type.function(Type.void(), [Type.pointer(Type.float())])
foo = mod.add_function(f... | 27.583333 | 70 | 0.64149 |
4a24debf930c7b00843f8f4976befa0e24ac9170 | 1,192 | py | Python | Mouse.py | VDHARV/hand-tracking | 03653f5b0a0a6f0f362047d86c94b0624e8e6a43 | [
"MIT"
] | null | null | null | Mouse.py | VDHARV/hand-tracking | 03653f5b0a0a6f0f362047d86c94b0624e8e6a43 | [
"MIT"
] | null | null | null | Mouse.py | VDHARV/hand-tracking | 03653f5b0a0a6f0f362047d86c94b0624e8e6a43 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from HandDetector import HandDetector
import autopy
vid = cv2.VideoCapture(0)
wScr, hScr = autopy.screen.size()
wCam, hCam = 640, 480
vid.set(3, wCam)
vid.set(4, hCam)
detector = HandDetector(detectionCon=0.75, trackCon=0.75)
while True:
success, img = vid.read()
img = detector... | 29.073171 | 99 | 0.600671 |
4a24def846cf1e0e9cae719122fcad6eccd44014 | 27,242 | py | Python | api/base/views.py | kounoAkihiro/SV-COS-osf.io | 0a9a68bbf9cf254d2e900d49b20d8a8e6e359c21 | [
"Apache-2.0"
] | null | null | null | api/base/views.py | kounoAkihiro/SV-COS-osf.io | 0a9a68bbf9cf254d2e900d49b20d8a8e6e359c21 | [
"Apache-2.0"
] | 16 | 2020-03-24T16:30:32.000Z | 2022-03-03T22:39:45.000Z | api/base/views.py | kounoAkihiro/SV-COS-osf.io | 0a9a68bbf9cf254d2e900d49b20d8a8e6e359c21 | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from distutils.version import StrictVersion
from django_bulk_update.helper import bulk_update
from django.conf import settings as django_settings
from django.db import transaction
from django.db.models import F
from django.http import JsonResponse
from django.contrib.contenttypes.mo... | 40.903904 | 158 | 0.640261 |
4a24df3ef2fd23b8c38ecd3babff675841817fe5 | 73 | py | Python | cfp/context_processors.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 11 | 2016-06-15T12:05:18.000Z | 2017-08-02T14:12:41.000Z | cfp/context_processors.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 110 | 2016-07-06T20:04:57.000Z | 2017-12-01T20:51:52.000Z | cfp/context_processors.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 10 | 2016-08-28T14:13:35.000Z | 2017-06-08T07:27:29.000Z |
def conference(request):
return {'conference': request.conference}
| 14.6 | 45 | 0.726027 |
4a24e040983c016ade11b4a8e3bf53a39de60d08 | 403 | py | Python | thefuck/rules/history.py | frankhli843/thedarn | 9e00f854c248156fba820f39b2834e8273583984 | [
"MIT"
] | null | null | null | thefuck/rules/history.py | frankhli843/thedarn | 9e00f854c248156fba820f39b2834e8273583984 | [
"MIT"
] | null | null | null | thefuck/rules/history.py | frankhli843/thedarn | 9e00f854c248156fba820f39b2834e8273583984 | [
"MIT"
] | null | null | null | from thedarn.utils import get_close_matches, get_closest, \
get_valid_history_without_current
def match(command):
return len(get_close_matches(command.script,
get_valid_history_without_current(command)))
def get_new_command(command):
return get_closest(command.script,
... | 25.1875 | 77 | 0.704715 |
4a24e16f24474e2c0f45f0333b645ab1772c6a17 | 8,261 | py | Python | egs/public_dataset/kiritan/local/prepare_data.py | bobwzy/SVS_system | 5fd711edd02d102bfebafe8a8863fba3321cdecc | [
"Apache-2.0"
] | null | null | null | egs/public_dataset/kiritan/local/prepare_data.py | bobwzy/SVS_system | 5fd711edd02d102bfebafe8a8863fba3321cdecc | [
"Apache-2.0"
] | null | null | null | egs/public_dataset/kiritan/local/prepare_data.py | bobwzy/SVS_system | 5fd711edd02d102bfebafe8a8863fba3321cdecc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020 The Johns Hopkins University (author: Jiatong Shi)
import argparse
import librosa
import numpy as np
import os
import pyworld as pw
import soundfile as sf
def pack_zero(number, length=4):
number = str(number)
return "0" * (length - len(number)) + number
def same_spli... | 32.912351 | 88 | 0.546544 |
4a24e24dafeb1c05c09171c774684841dfa7227f | 4,858 | py | Python | test/functional/p2p_node_network_limited.py | lihuanghai/bitcoin | 624da15f8c55219f4ca3e0877a17799990299504 | [
"MIT"
] | 20 | 2019-04-03T06:30:39.000Z | 2019-11-07T08:57:50.000Z | test/functional/p2p_node_network_limited.py | lihuanghai/bitcoin | 624da15f8c55219f4ca3e0877a17799990299504 | [
"MIT"
] | 1 | 2017-01-08T20:32:43.000Z | 2017-01-08T20:32:43.000Z | test/functional/p2p_node_network_limited.py | lihuanghai/bitcoin | 624da15f8c55219f4ca3e0877a17799990299504 | [
"MIT"
] | 1 | 2019-09-02T00:49:46.000Z | 2019-09-02T00:49:46.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests NODE_NETWORK_LIMITED.
Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED corre... | 41.521368 | 123 | 0.692466 |
4a24e361bbb2c0427e637a240b5a89a02711895c | 2,067 | py | Python | mindspore/ops/_op_impl/tbe/bias_add_grad.py | TommyLike/mindspore | 401dabb786a9097d6dd84f391657d266b04e9a37 | [
"Apache-2.0"
] | 1 | 2020-05-23T07:08:46.000Z | 2020-05-23T07:08:46.000Z | mindspore/ops/_op_impl/tbe/bias_add_grad.py | liyong126/mindspore | 930a1fb0a8fa9432025442c4f4732058bb7af592 | [
"Apache-2.0"
] | 7 | 2020-03-30T08:31:56.000Z | 2020-04-01T09:54:39.000Z | mindspore/ops/_op_impl/tbe/bias_add_grad.py | liyong126/mindspore | 930a1fb0a8fa9432025442c4f4732058bb7af592 | [
"Apache-2.0"
] | 1 | 2020-03-30T17:07:43.000Z | 2020-03-30T17:07:43.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 29.112676 | 79 | 0.524915 |
4a24e4c732fe1b524b09a8afd6d17bf495fb3543 | 4,326 | py | Python | BESI_LOGGING_R/pebble_connect.py | nh4ar/besi-relay-station | 71093a566aee6c0847f3b6c0f1c88cf3429f292a | [
"MIT"
] | null | null | null | BESI_LOGGING_R/pebble_connect.py | nh4ar/besi-relay-station | 71093a566aee6c0847f3b6c0f1c88cf3429f292a | [
"MIT"
] | null | null | null | BESI_LOGGING_R/pebble_connect.py | nh4ar/besi-relay-station | 71093a566aee6c0847f3b6c0f1c88cf3429f292a | [
"MIT"
] | null | null | null | from libpebble2.communication import PebbleConnection
import logging
from libpebble2.communication.transports.serial import SerialTransport as ST
import libpebble2.exceptions
from libpebble2.protocol import *
from libpebble2.services.appmessage import AppMessageService, CString, Uint8
from libpebble2.services.data_logg... | 27.909677 | 103 | 0.746879 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.