hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b3fd22ec5fd7e94081cc05195e7ac610490bdc1b | 771 | py | Python | verysimplestats/__init__.py | PierreSelim/verysimplestats | dd42b9068ab36ba881ae2f28a19bde7cb904482d | [
"MIT"
] | 1 | 2016-08-19T15:32:16.000Z | 2016-08-19T15:32:16.000Z | verysimplestats/__init__.py | PierreSelim/verysimplestats | dd42b9068ab36ba881ae2f28a19bde7cb904482d | [
"MIT"
] | null | null | null | verysimplestats/__init__.py | PierreSelim/verysimplestats | dd42b9068ab36ba881ae2f28a19bde7cb904482d | [
"MIT"
] | null | null | null | """Statistics for humans"""
__version__ = "1.1"
from verysimplestats.statistics import correlation # NOQA
from verysimplestats.statistics import covariance # NOQA
from verysimplestats.statistics import linear_forecast # NOQA
from verysimplestats.statistics import linear_regression # NOQA
from verysimplestats.st... | 40.578947 | 68 | 0.833982 |
4b6b576e07a98e8234a043ef4dd233208522c81d | 2,193 | py | Python | trade_client.py | emrecavdar94/ds | 94fdeb93915ccc1ae389596bb10c13f65ae30dc8 | [
"MIT"
] | null | null | null | trade_client.py | emrecavdar94/ds | 94fdeb93915ccc1ae389596bb10c13f65ae30dc8 | [
"MIT"
] | null | null | null | trade_client.py | emrecavdar94/ds | 94fdeb93915ccc1ae389596bb10c13f65ae30dc8 | [
"MIT"
] | null | null | null | from datetime import datetime
from logger import logger
from gateio_auth import *
from gate_api import ApiClient, Order, SpotApi
client = load_gateio_creds('auth.yml')
spot_api = SpotApi(ApiClient(client))
last_trade = None
def get_last_price(base, quote, return_price_only):
"""
Args:
'DOT', 'USDT'
... | 30.041096 | 111 | 0.632011 |
9295ab51450eab2897a61eb14edefbab21c30c53 | 5,796 | py | Python | src/gui/porteditorwidget.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | 2 | 2020-09-17T20:51:18.000Z | 2020-11-03T15:58:10.000Z | src/gui/porteditorwidget.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | 97 | 2020-08-26T05:07:08.000Z | 2022-03-28T16:01:49.000Z | src/gui/porteditorwidget.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | null | null | null | """
..
/------------------------------------------------------------------------------\
| -- FACADE TECHNOLOGIES INC. CONFIDENTIAL -- |
|------------------------------------------------------------------------------|
| ... | 31.672131 | 106 | 0.60766 |
856cadb47c14173e405d73adfeabc96061198533 | 13,645 | py | Python | src/prefect/agent/fargate/agent.py | elenapalesis/prefect | 424be6b5ed8d3be85064de4b95b5c3d7cb665510 | [
"Apache-2.0"
] | null | null | null | src/prefect/agent/fargate/agent.py | elenapalesis/prefect | 424be6b5ed8d3be85064de4b95b5c3d7cb665510 | [
"Apache-2.0"
] | null | null | null | src/prefect/agent/fargate/agent.py | elenapalesis/prefect | 424be6b5ed8d3be85064de4b95b5c3d7cb665510 | [
"Apache-2.0"
] | null | null | null | import os
from prefect import config
from prefect.agent import Agent
from prefect.environments.storage import Docker
from prefect.serialization.storage import StorageSchema
from prefect.utilities.graphql import GraphQLResult
class FargateAgent(Agent):
"""
Agent which deploys flow runs as tasks using Fargate.... | 40.975976 | 92 | 0.590399 |
94e4986c68d0de7fce980f7826614dbcb7062330 | 3,468 | bzl | Python | apple/bundling/product_actions.bzl | kastiglione/rules_apple | 3745c3f03b9d29a04671fd4fac96468ca7031fd6 | [
"Apache-2.0"
] | 1 | 2021-06-06T11:34:58.000Z | 2021-06-06T11:34:58.000Z | apple/bundling/product_actions.bzl | c-parsons/rules_apple | f75c4b1be219cb32704d900bd1a42ab200eab445 | [
"Apache-2.0"
] | null | null | null | apple/bundling/product_actions.bzl | c-parsons/rules_apple | f75c4b1be219cb32704d900bd1a42ab200eab445 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 38.533333 | 84 | 0.649654 |
0b8d6b5564e2c25d497fc8ca0c62ef448c5289dc | 10,864 | py | Python | models.py | playgrdstar/hamp | a7fe6ac1a5f0f5df811625c1ca378ca7ae1ba798 | [
"MIT"
] | null | null | null | models.py | playgrdstar/hamp | a7fe6ac1a5f0f5df811625c1ca378ca7ae1ba798 | [
"MIT"
] | null | null | null | models.py | playgrdstar/hamp | a7fe6ac1a5f0f5df811625c1ca378ca7ae1ba798 | [
"MIT"
] | null | null | null | import os
import math
import numpy as np
import pandas as pd
import json
import scipy.sparse as sp
from pathlib import Path
import networkx as nx
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import dgl
import dgl.function as fn
import dgl.nn.pytorch as dglnn
fro... | 44.707819 | 199 | 0.622791 |
7328970d6f71595a11399cc618be5c5b1aa46d3c | 1,638 | py | Python | python/hetu/gpu_ops/MultiplyConst.py | initzhang/Hetu | 447111a358e4dc6df5db9c216bdb3590fff05f84 | [
"Apache-2.0"
] | 82 | 2021-07-20T02:45:54.000Z | 2022-03-14T07:08:45.000Z | python/hetu/gpu_ops/MultiplyConst.py | initzhang/Hetu | 447111a358e4dc6df5db9c216bdb3590fff05f84 | [
"Apache-2.0"
] | 4 | 2021-11-25T13:39:21.000Z | 2022-03-13T04:14:14.000Z | python/hetu/gpu_ops/MultiplyConst.py | initzhang/Hetu | 447111a358e4dc6df5db9c216bdb3590fff05f84 | [
"Apache-2.0"
] | 13 | 2021-07-18T14:40:56.000Z | 2022-03-09T06:37:42.000Z | from __future__ import absolute_import
from .Node import Op
from .._base import DNNL_LIB
from ..cpu_links import matrix_elementwise_multiply_by_const as cpu_matrix_elementwise_multiply_by_const
from ..gpu_links import matrix_elementwise_multiply_by_const
class MulByConstOp(Op):
def __init__(self, node_A, const_va... | 32.76 | 104 | 0.672772 |
9fa6bd2eaf5000bfe83bd9c88c5eb1d6cc744db6 | 778 | py | Python | idunn/blocks/information.py | amatissart/idunn | cae32024165a85ad99881c373a88ea5702631d71 | [
"Apache-2.0"
] | null | null | null | idunn/blocks/information.py | amatissart/idunn | cae32024165a85ad99881c373a88ea5702631d71 | [
"Apache-2.0"
] | null | null | null | idunn/blocks/information.py | amatissart/idunn | cae32024165a85ad99881c373a88ea5702631d71 | [
"Apache-2.0"
] | null | null | null | from .base import BaseBlock, BlocksValidator
from idunn.blocks.services_and_information import ServicesAndInformationBlock
from idunn.blocks.wikipedia import WikipediaBlock
class InformationBlock(BaseBlock):
BLOCK_TYPE = "information"
blocks = BlocksValidator(allowed_blocks=[WikipediaBlock, ServicesAndInform... | 31.12 | 90 | 0.722365 |
a3fd9b46379c9e964de40e0ef1e4f2441a39fb5d | 14,021 | py | Python | scipy/_lib/_pep440.py | ikamensh/scipy | d645404be21b7c0b1e7ba24bf8d525b624aeb848 | [
"BSD-3-Clause"
] | null | null | null | scipy/_lib/_pep440.py | ikamensh/scipy | d645404be21b7c0b1e7ba24bf8d525b624aeb848 | [
"BSD-3-Clause"
] | null | null | null | scipy/_lib/_pep440.py | ikamensh/scipy | d645404be21b7c0b1e7ba24bf8d525b624aeb848 | [
"BSD-3-Clause"
] | null | null | null | """Utility to compare pep440 compatible version strings.
The LooseVersion and StrictVersion classes that distutils provides don't
work; they don't recognize anything like alpha/beta/rc/dev versions.
"""
# Copyright (c) Donald Stufft and individual contributors.
# All rights reserved.
# Redistribution and use in sour... | 28.731557 | 79 | 0.594751 |
43118c9f97d3d9f5899330823de099f075b6f55e | 2,030 | py | Python | python_intermediate/dungeon_game.py | aksampath123/Python_Development_Projects | 8946d468ffe87d407ff7c86d3b1c83d8c742cdb4 | [
"Unlicense"
] | null | null | null | python_intermediate/dungeon_game.py | aksampath123/Python_Development_Projects | 8946d468ffe87d407ff7c86d3b1c83d8c742cdb4 | [
"Unlicense"
] | null | null | null | python_intermediate/dungeon_game.py | aksampath123/Python_Development_Projects | 8946d468ffe87d407ff7c86d3b1c83d8c742cdb4 | [
"Unlicense"
] | null | null | null | import random
MAP = [(0,0), (0,1), (0,2),
(1,0), (1,1), (1,2),
(2,0), (2,1), (2,2),]
def get_locations():
monster = random.choice(MAP)
door = random.choice(MAP)
player = random.choice(MAP)
if monster == door or player == door or player == monster:
return get_locations()
return mon... | 21.827957 | 91 | 0.573399 |
18b3d75f7d9d6dffb698d83d8292b852dc4c86b0 | 700 | py | Python | 08/08_P3.py | monikuri/2110101_Com_Prog | bed16297685571edd7101b3e911d74ae3c62310c | [
"MIT"
] | null | null | null | 08/08_P3.py | monikuri/2110101_Com_Prog | bed16297685571edd7101b3e911d74ae3c62310c | [
"MIT"
] | null | null | null | 08/08_P3.py | monikuri/2110101_Com_Prog | bed16297685571edd7101b3e911d74ae3c62310c | [
"MIT"
] | null | null | null | addr = {}
with open('address.txt') as f:
for line in f:
args = line.strip().split()
name = args[0] + ' ' + args[1]
phone = args[2]
addr[name] = phone
while True:
args = input().strip().split()
if len(args) == 0:
break
# Phone no.
if args[0].isdigit():
... | 25 | 38 | 0.44 |
c8056335b32f8ba80caefe9c0e827d2e1ed61cfa | 3,570 | py | Python | contingent/code/example/blog_project.py | choosewhatulike/500lines | fba689d101eb5600f5c8f4d7fd79912498e950e2 | [
"CC-BY-3.0"
] | 26,185 | 2015-01-01T04:59:51.000Z | 2022-03-31T10:20:14.000Z | contingent/code/example/blog_project.py | fsxchen/500lines | 3f2cd407ebedaf0a3cfa6858c4cf94543067433d | [
"CC-BY-3.0"
] | 160 | 2015-01-05T12:20:21.000Z | 2021-10-03T07:25:43.000Z | contingent/code/example/blog_project.py | fsxchen/500lines | 3f2cd407ebedaf0a3cfa6858c4cf94543067433d | [
"CC-BY-3.0"
] | 6,572 | 2015-01-01T01:31:00.000Z | 2022-03-31T07:31:22.000Z | """Render a directory of cross-referenced blog posts as HTML."""
import os
import re
from IPython.nbconvert import HTMLExporter
from IPython.nbformat import current as nbformat
from docutils.core import publish_doctree, publish_parts
from docutils import nodes
from glob import glob
from jinja2 import DictLoader
from ... | 29.02439 | 79 | 0.626611 |
4451ad5eb26bd01db24d5ce75d7cb3509e1d8797 | 2,387 | py | Python | youtube0/main.py | pralaymandal/UDOWN | 3c023dec26b79ea397f245baa47c30bcf39384ff | [
"MIT"
] | null | null | null | youtube0/main.py | pralaymandal/UDOWN | 3c023dec26b79ea397f245baa47c30bcf39384ff | [
"MIT"
] | null | null | null | youtube0/main.py | pralaymandal/UDOWN | 3c023dec26b79ea397f245baa47c30bcf39384ff | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import pytube
class Youtube(pytube):
def __init__(self, link):
self.static().yt = pytube.YouTube(link)
self.streams = self.yt.stream.all() # Here is a Runtime Error ^ or v
def get_instance(self):
return self.streams
def to_list(self, data):
... | 26.820225 | 88 | 0.462086 |
397d672e60ee917e7cd8a7d111cb168f6d9d5576 | 858 | py | Python | addons/digest/models/res_users.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/digest/models/res_users.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/digest/models/res_users.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class ResUsers(models.Model):
_inherit = "res.users"
@api.model_create_multi
def create(self, vals_list):
""" Automatically subscribe employee users to default digest if... | 45.157895 | 112 | 0.694639 |
c9faea8883f9fd0994166e197ad2afe6c8e70ca5 | 2,205 | py | Python | openprocurement/tender/competitivedialogue/views/stage2/lot.py | raccoongang/openprocurement.tender.competitivedialogue | 0cc7fdf8aff1ecd82ba404318d6d88efc9a97d78 | [
"Apache-2.0"
] | null | null | null | openprocurement/tender/competitivedialogue/views/stage2/lot.py | raccoongang/openprocurement.tender.competitivedialogue | 0cc7fdf8aff1ecd82ba404318d6d88efc9a97d78 | [
"Apache-2.0"
] | 150 | 2016-06-07T15:09:50.000Z | 2018-03-19T16:17:53.000Z | openprocurement/tender/competitivedialogue/views/stage2/lot.py | raccoongang/openprocurement.tender.competitivedialogue | 0cc7fdf8aff1ecd82ba404318d6d88efc9a97d78 | [
"Apache-2.0"
] | 17 | 2016-05-27T13:17:52.000Z | 2018-06-15T14:39:03.000Z | # -*- coding: utf-8 -*-
from openprocurement.api.utils import json_view
from openprocurement.tender.core.utils import (
optendersresource
)
from openprocurement.tender.openua.views.lot import TenderUaLotResource
from openprocurement.tender.openeu.views.lot import TenderEULotResource
from openprocurement.tender.com... | 40.833333 | 122 | 0.713379 |
3aa63cd1ec8a5a7386b0dd4874639f3999af065e | 8,585 | py | Python | app/src/rds_cleanup.py | troydieter/aws-auto-cleanup | 523bae5cc57b81d3a2f0d43c87b9f1ef5390e3a4 | [
"MIT"
] | 322 | 2019-04-15T01:59:57.000Z | 2022-03-09T00:06:55.000Z | app/src/rds_cleanup.py | troydieter/aws-auto-cleanup | 523bae5cc57b81d3a2f0d43c87b9f1ef5390e3a4 | [
"MIT"
] | 70 | 2019-04-15T01:27:21.000Z | 2022-03-02T00:39:29.000Z | app/src/rds_cleanup.py | troydieter/aws-auto-cleanup | 523bae5cc57b81d3a2f0d43c87b9f1ef5390e3a4 | [
"MIT"
] | 49 | 2019-04-15T06:36:42.000Z | 2022-01-17T11:37:32.000Z | import sys
import boto3
from src.helper import Helper
class RDSCleanup:
def __init__(self, logging, whitelist, settings, execution_log, region):
self.logging = logging
self.whitelist = whitelist
self.settings = settings
self.execution_log = execution_log
self.region = reg... | 41.47343 | 113 | 0.466861 |
feca6755c3b23b3444fc61e76a8d7bcadb281bac | 21,482 | py | Python | sscanss/ui/window/model.py | StephenNneji/SScanSS-2 | b0a3697d803439840a8f29c4486428f1b7a010f3 | [
"BSD-3-Clause"
] | null | null | null | sscanss/ui/window/model.py | StephenNneji/SScanSS-2 | b0a3697d803439840a8f29c4486428f1b7a010f3 | [
"BSD-3-Clause"
] | null | null | null | sscanss/ui/window/model.py | StephenNneji/SScanSS-2 | b0a3697d803439840a8f29c4486428f1b7a010f3 | [
"BSD-3-Clause"
] | null | null | null | from contextlib import suppress
from collections import OrderedDict, namedtuple
import json
import os
import numpy as np
from PyQt5 .QtCore import pyqtSignal, QObject
from sscanss.config import settings, INSTRUMENTS_PATH
from sscanss.core.instrument import read_instrument_description_file, Sequence, Simulation
from ssc... | 37.687719 | 114 | 0.631412 |
4437019cd09143ac16589e062b1f840b3acb25a5 | 2,108 | py | Python | src/enamlnative/android/android_frame_layout.py | codelv/enaml-native | 04c3a015bcd649f374c5ecd98fcddba5e4fbdbdc | [
"MIT"
] | 237 | 2017-09-15T19:31:45.000Z | 2022-03-17T04:22:20.000Z | src/enamlnative/android/android_frame_layout.py | codelv/enaml-native | 04c3a015bcd649f374c5ecd98fcddba5e4fbdbdc | [
"MIT"
] | 74 | 2017-09-06T20:16:41.000Z | 2022-03-05T13:34:35.000Z | src/enamlnative/android/android_frame_layout.py | codelv/enaml-native | 04c3a015bcd649f374c5ecd98fcddba5e4fbdbdc | [
"MIT"
] | 22 | 2017-09-15T19:32:11.000Z | 2022-03-17T18:33:39.000Z | """
Copyright (c) 2017, Jairus Martin.
Distributed under the terms of the MIT License.
The full license is in the file LICENSE, distributed with this software.
Created on May 20, 2017
@author: jrm
"""
from atom.api import Typed, set_default
from enamlnative.widgets.frame_layout import ProxyFrameLayout
from .andro... | 31.939394 | 79 | 0.590607 |
11e856209b737af268a7644ca22e23e2848b5b61 | 7,725 | py | Python | tests/system/test_marathon_fault_inject.py | Mwea/marathon | f6331abf6141951976de944800500a40d168e3b8 | [
"Apache-2.0"
] | null | null | null | tests/system/test_marathon_fault_inject.py | Mwea/marathon | f6331abf6141951976de944800500a40d168e3b8 | [
"Apache-2.0"
] | null | null | null | tests/system/test_marathon_fault_inject.py | Mwea/marathon | f6331abf6141951976de944800500a40d168e3b8 | [
"Apache-2.0"
] | null | null | null | """Marathon acceptance tests for DC/OS regarding network partitioning"""
import os
import pytest
import requests
from common import *
from shakedown import *
from utils import *
PACKAGE_NAME = 'marathon'
PACKAGE_APP_ID = 'marathon-user'
DCOS_SERVICE_URL = dcos_service_url(PACKAGE_APP_ID)
TOKEN = dcos_acs_token()
... | 28.932584 | 86 | 0.667443 |
6fd29f7950c3345020bdb5d7996aaed852926e16 | 20,460 | py | Python | sympy/simplify/tests/test_cse.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/simplify/tests/test_cse.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/simplify/tests/test_cse.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | from functools import reduce
import itertools
from operator import add
from sympy.core.add import Add
from sympy.core.containers import Tuple
from sympy.core.function import Function
from sympy.core.mul import Mul
from sympy.core.power import Pow
from sympy.core.relational import Eq
from sympy.core.singleton... | 33.762376 | 116 | 0.515738 |
a9847a85f8b34592379afe3418e7e2b5af9ec623 | 2,336 | py | Python | followthemoney/compare.py | achievement008/followthemoney | bda06d62c81c82e62cd0c53117d8804939b40f62 | [
"MIT"
] | null | null | null | followthemoney/compare.py | achievement008/followthemoney | bda06d62c81c82e62cd0c53117d8804939b40f62 | [
"MIT"
] | null | null | null | followthemoney/compare.py | achievement008/followthemoney | bda06d62c81c82e62cd0c53117d8804939b40f62 | [
"MIT"
] | null | null | null | import itertools
from Levenshtein import jaro # type: ignore
from normality import normalize
from followthemoney.types import registry
from followthemoney.util import dampen, shortest
from followthemoney.exc import InvalidData
# OK, Here's the plan: we have to find a way to get user judgements
# on as many of these m... | 32.901408 | 70 | 0.681507 |
fa2e59a3c6a079776176216f91564f629982b286 | 9,496 | py | Python | src/stripes/qrcode/reedsolomon.py | pmachek/barcode | 2be24c34992fb3d7ae853d286eef19bc64b7fc80 | [
"MIT"
] | 1 | 2020-02-23T15:16:08.000Z | 2020-02-23T15:16:08.000Z | src/stripes/qrcode/reedsolomon.py | pmachek/barcode | 2be24c34992fb3d7ae853d286eef19bc64b7fc80 | [
"MIT"
] | null | null | null | src/stripes/qrcode/reedsolomon.py | pmachek/barcode | 2be24c34992fb3d7ae853d286eef19bc64b7fc80 | [
"MIT"
] | null | null | null | # TODO: Cleanup: Remove encode/decode methods
from .galoisfield import GaloisField
primitive_polynomials = [0, 0, 0, 11, 19, 37, 67, 131, 285, 1033]
class ReedSolomonEncoder:
def __init__(self, k, n=None, primitive_poly=None):
if n is None and primitive_poly is None:
primitive_poly = 285
... | 36.106464 | 78 | 0.568766 |
928f3fbb514ec8b63cf0a990380902116dffd950 | 483 | py | Python | implementations/utils.py | DavidNKraemer/rl-study-projects | e55f60b2efa6ff4669248e63012a94ab235d9d08 | [
"MIT"
] | null | null | null | implementations/utils.py | DavidNKraemer/rl-study-projects | e55f60b2efa6ff4669248e63012a94ab235d9d08 | [
"MIT"
] | null | null | null | implementations/utils.py | DavidNKraemer/rl-study-projects | e55f60b2efa6ff4669248e63012a94ab235d9d08 | [
"MIT"
] | null | null | null | import pydash
import torch
import numpy as np
def to_torch_batch(batch, device, is_episodic):
'''Mutate a batch (dict) to make its values from numpy into PyTorch tensor'''
for key in batch:
if is_episodic: # for episodic format
batch[key] = np.concatenate(batch[key])
elif pydash.i... | 32.2 | 81 | 0.660455 |
69e8862808394ae412d3ac3c6f0e992de6eaec11 | 13,370 | py | Python | lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py | Machiry/checkedc-clang | ab9360d8be0a737cb5e09051f3a0051adc4b3e47 | [
"BSD-Source-Code"
] | 250 | 2019-05-07T12:56:44.000Z | 2022-03-10T15:52:06.000Z | lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py | procedural/checkedc_binaries_ubuntu_16_04_from_12_Oct_2021 | ad4e8b01121fbfb40d81ee798480add7dc93f0bf | [
"BSD-Source-Code"
] | 410 | 2019-06-06T20:52:32.000Z | 2022-01-18T14:21:48.000Z | lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py | procedural/checkedc_binaries_ubuntu_16_04_from_12_Oct_2021 | ad4e8b01121fbfb40d81ee798480add7dc93f0bf | [
"BSD-Source-Code"
] | 50 | 2019-05-10T21:12:24.000Z | 2022-01-21T06:39:47.000Z | """
Test lldb breakpoint command add/list/delete.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import side_effect
class BreakpointCommandTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
mydir = TestBase.compute_mydir(__f... | 41.78125 | 147 | 0.620344 |
3dd408390e15d3e7996492aadd27a981e0f3c82a | 4,541 | py | Python | annogesiclib/format_fixer.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 26 | 2016-02-25T19:27:55.000Z | 2022-01-22T09:54:59.000Z | annogesiclib/format_fixer.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 28 | 2018-11-22T19:51:06.000Z | 2022-03-20T23:02:13.000Z | annogesiclib/format_fixer.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 18 | 2016-06-01T11:53:45.000Z | 2021-12-27T03:41:03.000Z | from annogesiclib.gff3 import Gff3Parser
class FormatFixer(object):
'''Fix the format which is not fit with ANNOgesic'''
def _read_gff(self, gff_file, genes, datas, strain):
gene_num = 0
fh = open(gff_file, "r")
for entry in Gff3Parser().entries(fh):
entry.seq_id = strain
... | 42.439252 | 79 | 0.440872 |
f075acabc06ab7a64db17aa42734e19d70ea7e4e | 577 | py | Python | Course I/Алгоритмы Python/Part1/лекции/examples/customtuple.py | GeorgiyDemo/FA | 641a29d088904302f5f2164c9b3e1f1c813849ec | [
"WTFPL"
] | 27 | 2019-08-18T20:54:27.000Z | 2022-02-22T02:39:45.000Z | Course I/Алгоритмы Python/Part1/лекции/examples/customtuple.py | GeorgiyDemo/FA | 641a29d088904302f5f2164c9b3e1f1c813849ec | [
"WTFPL"
] | 217 | 2019-09-22T14:43:25.000Z | 2022-03-30T13:49:18.000Z | Course I/Алгоритмы Python/Part1/лекции/examples/customtuple.py | GeorgiyDemo/FA | 641a29d088904302f5f2164c9b3e1f1c813849ec | [
"WTFPL"
] | 42 | 2019-09-18T11:36:28.000Z | 2022-03-19T18:43:00.000Z | import collections
class CheckClass(object):
def __init__(self):
self.custom_tuple()
self.standart_dictionary()
def custom_tuple(self):
ctuple = collections.namedtuple("Koshkas", "name value")
custom = []
custom.append(ctuple("Kot", 1))
print(ctuple)
pr... | 20.607143 | 64 | 0.542461 |
5a0cc705c0ed216a0c8587ed2b00b0432af91c10 | 379 | py | Python | experiments/wang_height_map_11,7,5,3/k=2/run.py | laitoch/tree-bark-synthesis | 0bd43d6699d2e05f62d144f310874f986bbd91d2 | [
"MIT"
] | null | null | null | experiments/wang_height_map_11,7,5,3/k=2/run.py | laitoch/tree-bark-synthesis | 0bd43d6699d2e05f62d144f310874f986bbd91d2 | [
"MIT"
] | null | null | null | experiments/wang_height_map_11,7,5,3/k=2/run.py | laitoch/tree-bark-synthesis | 0bd43d6699d2e05f62d144f310874f986bbd91d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import sys
sys.path.append('../../..')
from tree_bark_synthesis import generate_tree_bark
generate_tree_bark(
ai_filename=sys.argv[1],
height_map=True,
k=2,
pyramid_size=3,
width_ratio=2,
height_ratio=8,
init = 'smart',
init_size = 64,
coefs = [1,4,1,1],
... | 17.227273 | 50 | 0.62533 |
6f71d089d1318d8cb657490aab4d13521ff5ac8b | 3,879 | py | Python | rma/cli/rma_cli.py | geraldcheng/eleme-redis-cluster-key-analyze | 1ec54a23a0a0fd11ff0531711587ee875d69702b | [
"MIT"
] | 2 | 2017-01-09T03:16:54.000Z | 2020-04-02T07:12:49.000Z | rma/cli/rma_cli.py | geraldcheng/eleme-redis-cluster-key-analyze | 1ec54a23a0a0fd11ff0531711587ee875d69702b | [
"MIT"
] | null | null | null | rma/cli/rma_cli.py | geraldcheng/eleme-redis-cluster-key-analyze | 1ec54a23a0a0fd11ff0531711587ee875d69702b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import time
import logging
from argparse import ArgumentParser, HelpFormatter
from rma.application import RmaApplication
logging.basicConfig(level=logging.INFO)
VALID_TYPES = ("string", "hash", "list", "set", "zset")
VALID_MODES = ('all', 'scanner', 'ram', 'global')
class CustomHelpFormatter(H... | 39.581633 | 116 | 0.547048 |
cd609da1133c0b2290a7354db592d674f3baa661 | 7,213 | py | Python | CPAG.py | parsashahzeidi/CPAG | 456a70d886b405c24e2ae68bbe41508fc65b2849 | [
"Unlicense"
] | 3 | 2019-05-24T16:14:56.000Z | 2019-07-18T02:42:06.000Z | CPAG.py | parsashahzeidi/CPAG | 456a70d886b405c24e2ae68bbe41508fc65b2849 | [
"Unlicense"
] | null | null | null | CPAG.py | parsashahzeidi/CPAG | 456a70d886b405c24e2ae68bbe41508fc65b2849 | [
"Unlicense"
] | null | null | null | '''
Bash interface for palette.py and posterizer.py
'''
import time
import os
import sys
bench = time.time()
cd = os.getcwd()
params = sys.argv[1:]
capitalized_params = params
params = [str.lower(p) for p in params]
# Usage:
cmd = 0
path = 0
cmd_param = 0
def illegalin(msg: str = None):
# illegalin is activat... | 32.200893 | 117 | 0.545265 |
b00c20c2de23a6e938f79f98b3c1dbd2397560ac | 3,364 | py | Python | cogs/lockdown.py | roblabla/robocop-ng | c86edbfe48d9f6f7d6df3e7d9889b890564d4a46 | [
"MIT"
] | null | null | null | cogs/lockdown.py | roblabla/robocop-ng | c86edbfe48d9f6f7d6df3e7d9889b890564d4a46 | [
"MIT"
] | null | null | null | cogs/lockdown.py | roblabla/robocop-ng | c86edbfe48d9f6f7d6df3e7d9889b890564d4a46 | [
"MIT"
] | null | null | null | from discord.ext import commands
from discord.ext.commands import Cog
import config
import discord
from helpers.checks import check_if_staff
class Lockdown(Cog):
def __init__(self, bot):
self.bot = bot
async def set_sendmessage(self, channel: discord.TextChannel,
role, al... | 36.172043 | 80 | 0.608799 |
a51ccfd276e838c39b0b4339656cdcc966182cfc | 1,633 | py | Python | leetcode/easy/move_zeroes/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | leetcode/easy/move_zeroes/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | leetcode/easy/move_zeroes/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | #
# We use a slow/fast pointer technique. The fast pointer (index) is running ahead,
# reporting whether the value it is pointing to is a zero value or not.
#
# If nums[fast] is not a zero value, we copy the value to nums[slow] and increment
# the slow pointer. This way, by the time the fast pointer reaches the end of... | 37.976744 | 85 | 0.616656 |
51ef0375952f48c5a2f18de5583a73bc8da90ba1 | 3,852 | py | Python | resolwe_bio/processes/slamdunk/alleyoop_collapse.py | romunov/resolwe-bio | 66eca196b5458123743814d54c4e1d8d89e8d517 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/processes/slamdunk/alleyoop_collapse.py | romunov/resolwe-bio | 66eca196b5458123743814d54c4e1d8d89e8d517 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/processes/slamdunk/alleyoop_collapse.py | romunov/resolwe-bio | 66eca196b5458123743814d54c4e1d8d89e8d517 | [
"Apache-2.0"
] | null | null | null | """Run Alleyoop collapse tool on Slamdunk results."""
import os
import pandas as pd
import resdk
from plumbum import TEE
from resolwe.process import Cmd, DataField, FileField, Process, StringField
def compute_tpm(tcount):
"""Normalize readCount column to TPM values."""
exp = pd.read_csv(
tcount,
... | 29.40458 | 85 | 0.563084 |
441e428f59c14b206380df21980d2b9550b33f94 | 5,035 | py | Python | pyglet/canvas/win32.py | AnantTiwari-Naman/pyglet | 4774f2889057da95a78785a69372112931e6a620 | [
"BSD-3-Clause"
] | null | null | null | pyglet/canvas/win32.py | AnantTiwari-Naman/pyglet | 4774f2889057da95a78785a69372112931e6a620 | [
"BSD-3-Clause"
] | null | null | null | pyglet/canvas/win32.py | AnantTiwari-Naman/pyglet | 4774f2889057da95a78785a69372112931e6a620 | [
"BSD-3-Clause"
] | 1 | 2021-09-16T20:47:07.000Z | 2021-09-16T20:47:07.000Z | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | 36.223022 | 78 | 0.623635 |
794273ed9dcb4fbaa257e3b10cd126bda79258d9 | 935 | py | Python | datastructure/practice/c7/c_7_37.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | datastructure/practice/c7/c_7_37.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | datastructure/practice/c7/c_7_37.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | import unittest
from datastructure.links.PositionList import PositionList
def has_sum_equals(position_list, V):
if position_list.is_empty():
return None
sum_dict = {}
current = position_list.first()
while current is not None:
if current.element() in sum_dict:
return sum_d... | 26.714286 | 67 | 0.673797 |
f6cd55c513e0bf5b7f6edf2f7e9dc8a5634c2bef | 6,728 | py | Python | mini-project-3/model/AbstractMLP.py | ding-ma/applied-ml | 91f5ade1984e84fd252fbc76d72f0ee8bd5c96d0 | [
"MIT"
] | null | null | null | mini-project-3/model/AbstractMLP.py | ding-ma/applied-ml | 91f5ade1984e84fd252fbc76d72f0ee8bd5c96d0 | [
"MIT"
] | null | null | null | mini-project-3/model/AbstractMLP.py | ding-ma/applied-ml | 91f5ade1984e84fd252fbc76d72f0ee8bd5c96d0 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from utils.activation import ActivationFunction
import joblib
from pathlib import Path
import logging
import numpy as np
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
from sklearn.metrics import confusion_matrix
class ... | 33.64 | 115 | 0.578627 |
80928737889b5bcf523ca741a30a6a46965addf1 | 1,789 | py | Python | netmiko/keymile/keymile_ssh.py | Richard-Su/netmiko | 2dc032b64c3049d3048966441ee30a0139bebc81 | [
"MIT"
] | null | null | null | netmiko/keymile/keymile_ssh.py | Richard-Su/netmiko | 2dc032b64c3049d3048966441ee30a0139bebc81 | [
"MIT"
] | null | null | null | netmiko/keymile/keymile_ssh.py | Richard-Su/netmiko | 2dc032b64c3049d3048966441ee30a0139bebc81 | [
"MIT"
] | null | null | null | import time
from netmiko.cisco.cisco_ios import CiscoIosBase
class KeymileSSH(CiscoIosBase):
def __init__(self, **kwargs):
kwargs.setdefault("default_enter", "\r\n")
return super().__init__(**kwargs)
def session_preparation(self):
"""Prepare the session after the connection has been ... | 31.385965 | 83 | 0.623253 |
6ea5071df452bf0363b2631a3e87591f5a1af47a | 21,708 | py | Python | src/custom_qt_widgets.py | aeroaks/custom_qt_classes | eeb23d9716b9f2976c3830a34408f97d5b01ceef | [
"MIT"
] | null | null | null | src/custom_qt_widgets.py | aeroaks/custom_qt_classes | eeb23d9716b9f2976c3830a34408f97d5b01ceef | [
"MIT"
] | null | null | null | src/custom_qt_widgets.py | aeroaks/custom_qt_classes | eeb23d9716b9f2976c3830a34408f97d5b01ceef | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
custom_qt_widgets
used as base class for configurable basic GUIs that interact with the Database.
Author: Akshay Verma
Date: 02-2017
""""
import os
import sys
import json
import logging
from time import gmtime
from time import strftime
from time import monotonic
... | 34.677316 | 110 | 0.648747 |
767deb90f60d22504fc89b06dd4dd15d06b71506 | 1,129 | py | Python | bumblebee_status/modules/contrib/layout-xkbswitch.py | rosalogia/bumblebee-status | 19c3975301d8700743df745ecd5ca2c05ecf5cf0 | [
"MIT"
] | null | null | null | bumblebee_status/modules/contrib/layout-xkbswitch.py | rosalogia/bumblebee-status | 19c3975301d8700743df745ecd5ca2c05ecf5cf0 | [
"MIT"
] | null | null | null | bumblebee_status/modules/contrib/layout-xkbswitch.py | rosalogia/bumblebee-status | 19c3975301d8700743df745ecd5ca2c05ecf5cf0 | [
"MIT"
] | null | null | null | """Displays and changes the current keyboard layout
Requires the following executable:
* xkb-switch
contributed by `somospocos <https://github.com/somospocos>`_ - many thanks!
"""
import core.module
import core.widget
import core.decorators
import core.input
import util.cli
class Module(core.module.Module):
... | 26.255814 | 87 | 0.690877 |
47bc0b1baf8279684374a9cbcc828dfd25aa1968 | 2,796 | py | Python | plugins/wikipedia.py | daviddever/skybot | 1dfcd5889f1711b24098c2d6640ec47a2dbd047c | [
"Unlicense"
] | 114 | 2015-01-04T07:44:12.000Z | 2021-09-12T16:06:40.000Z | plugins/wikipedia.py | daviddever/skybot | 1dfcd5889f1711b24098c2d6640ec47a2dbd047c | [
"Unlicense"
] | 54 | 2015-01-11T21:55:59.000Z | 2021-04-24T22:19:53.000Z | plugins/wikipedia.py | daviddever/skybot | 1dfcd5889f1711b24098c2d6640ec47a2dbd047c | [
"Unlicense"
] | 84 | 2015-01-05T23:10:38.000Z | 2021-12-24T06:08:09.000Z | """Searches wikipedia and returns first sentence of article
Scaevolus 2009"""
from __future__ import unicode_literals
import re
from util import hook, http
OUTPUT_LIMIT = 240 # character limit
INSTANCES = {
"encyclopediadramatica": {
"name": "Encyclopedia Dramatica",
"search": "https://encyclo... | 23.3 | 76 | 0.602647 |
974a9de8f9b8cf5e0eabee52ebbaffa10e4fb6bf | 5,080 | py | Python | Data_Iterator.py | annadymanus/IR-project | 37facbbab2c8d215c8be2415838d46445e116a8b | [
"MIT"
] | null | null | null | Data_Iterator.py | annadymanus/IR-project | 37facbbab2c8d215c8be2415838d46445e116a8b | [
"MIT"
] | null | null | null | Data_Iterator.py | annadymanus/IR-project | 37facbbab2c8d215c8be2415838d46445e116a8b | [
"MIT"
] | null | null | null | import csv
from collections import defaultdict
import random
from typing import Tuple, List
import time
import pickle
from tqdm import tqdm
import os.path
def write_dataset(data, filename: str):
"""Saves processed_samples to .pickle file"""
with open(filename, 'wb') as handle:
pickle.dump(data, handl... | 37.080292 | 180 | 0.611417 |
cb3683c4e69fc246c70335d69424d9b945859d90 | 1,091 | py | Python | src/adafruit_blinka/microcontroller/generic_micropython/__init__.py | tekktrik/Adafruit_Blinka | d094997a471301a2147d58f1693aa1d3a49df6cd | [
"MIT"
] | null | null | null | src/adafruit_blinka/microcontroller/generic_micropython/__init__.py | tekktrik/Adafruit_Blinka | d094997a471301a2147d58f1693aa1d3a49df6cd | [
"MIT"
] | null | null | null | src/adafruit_blinka/microcontroller/generic_micropython/__init__.py | tekktrik/Adafruit_Blinka | d094997a471301a2147d58f1693aa1d3a49df6cd | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""Genereic Pin class for use with MicroPython boards"""
from adafruit_blinka import Enum
class Pin(Enum):
"""
Identifies an IO pin on the microcontroller.
They are fixed by the hardware so th... | 32.088235 | 97 | 0.662695 |
37acfef3b46ca3712a1ace8fc8f8ec8d0ba84326 | 805 | py | Python | btcwallet/urls.py | cpanda11/btcwallet | 0aab11ac8946252f0487729dd81c6fca8038285e | [
"MIT"
] | null | null | null | btcwallet/urls.py | cpanda11/btcwallet | 0aab11ac8946252f0487729dd81c6fca8038285e | [
"MIT"
] | null | null | null | btcwallet/urls.py | cpanda11/btcwallet | 0aab11ac8946252f0487729dd81c6fca8038285e | [
"MIT"
] | null | null | null | """btcwallet URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 33.541667 | 77 | 0.704348 |
042eea88cd77ddf2b4d1780b5ff1d2b52c7ba736 | 1,434 | py | Python | csv_to_json.py | Aiky30/csv_to_json | 2cff427da9ce3c696f9735a6df563fb4f7451c3d | [
"MIT"
] | null | null | null | csv_to_json.py | Aiky30/csv_to_json | 2cff427da9ce3c696f9735a6df563fb4f7451c3d | [
"MIT"
] | null | null | null | csv_to_json.py | Aiky30/csv_to_json | 2cff427da9ce3c696f9735a6df563fb4f7451c3d | [
"MIT"
] | null | null | null | import os
import csv
import json
class JSWriter:
def __init__(self, filename):
self.file_path = filename
def write_file(self, master_contents):
try:
# Open the file with option 'rU' Enable Universal newline support
with open(self.file_path, 'w') as file_instance:
... | 20.485714 | 77 | 0.579498 |
b2309c6b4db538c9b48aa7f3f6cc7257d40f6a54 | 10,843 | py | Python | htrc/tools/htrc/htrc/volumes/__init__.py | lapps-htrc/lapps-htrc-deploy | e6f86ef1bb36682173d5a74a65cfa1a279571ccf | [
"Apache-2.0"
] | null | null | null | htrc/tools/htrc/htrc/volumes/__init__.py | lapps-htrc/lapps-htrc-deploy | e6f86ef1bb36682173d5a74a65cfa1a279571ccf | [
"Apache-2.0"
] | null | null | null | htrc/tools/htrc/htrc/volumes/__init__.py | lapps-htrc/lapps-htrc-deploy | e6f86ef1bb36682173d5a74a65cfa1a279571ccf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
`htrc.volumes`
Contains functions to retrieve volumes from the HTRC Data API.
The functions in this package will not operate unless they are
executed from an HTRC Data Capsule in Secure Mode. The module
`htrc.mock.volumes` contains Patch objects for testing workflows.
"""
from __future__ ... | 32.079882 | 96 | 0.648529 |
5d5ff198206dca9fb9581133eb646b060b2b80c0 | 34,373 | py | Python | venv/lib/python2.7/site-packages/astropy/nddata/utils.py | EnSlavingBlair/Coincidences | bba3435d9f0530822ddd2ab48a6a0bb84aa95f15 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/astropy/nddata/utils.py | EnSlavingBlair/Coincidences | bba3435d9f0530822ddd2ab48a6a0bb84aa95f15 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/astropy/nddata/utils.py | EnSlavingBlair/Coincidences | bba3435d9f0530822ddd2ab48a6a0bb84aa95f15 | [
"MIT"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module includes helper functions for array operations.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from copy import deepcopy
import numpy as np
from .decorators import support_... | 37.443355 | 80 | 0.607221 |
f3c41573e7deaf714cd846a828c26ee4cacc4869 | 2,747 | py | Python | src/main.py | jf20541/XGBoostClfCatBoostClf | 5d834fb5725f8536f93411dfe306979cb2f5e91e | [
"MIT"
] | null | null | null | src/main.py | jf20541/XGBoostClfCatBoostClf | 5d834fb5725f8536f93411dfe306979cb2f5e91e | [
"MIT"
] | null | null | null | src/main.py | jf20541/XGBoostClfCatBoostClf | 5d834fb5725f8536f93411dfe306979cb2f5e91e | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from functools import partial
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score, roc_auc_score
from skopt import gp_minimize, space
from xgboost import XGBClassifier
import config
def optimize(params, param_names, x, y):
"""Takes ... | 31.215909 | 92 | 0.690207 |
45c8d67fd80f0eb5fe3c697a6a027efdc3530bbf | 1,960 | py | Python | sweetpea/tests/test_design_graph.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | 10 | 2019-03-15T01:30:14.000Z | 2022-03-21T03:41:57.000Z | sweetpea/tests/test_design_graph.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | 33 | 2019-03-25T16:30:22.000Z | 2021-07-14T22:31:10.000Z | sweetpea/tests/test_design_graph.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | 5 | 2020-09-07T10:20:12.000Z | 2022-01-18T03:11:29.000Z | import networkx as nx
import operator as op
from sweetpea.primitives import Factor, DerivedLevel, WithinTrial, Transition
from sweetpea.design_graph import DesignGraph
# Setup
color_list = ["red", "blue"]
color = Factor("color", color_list)
text = Factor("text", color_list)
# Congruent factor
congruent = Factor("... | 32.666667 | 91 | 0.687245 |
bf7bb09eb8a836f4fb6cc27ae0fb3129dcafaebb | 1,957 | py | Python | examples/network/Member.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/network/Member.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/network/Member.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
import sys
from openstack import connection
from openstack import utils
# utils.enable_logging(debug=True, stream=sys.stdout)
username = "xxxxxxxxxxx"
password = "xxxxxxxxxxx"
projectId = "xxxxxxxxxxx"
userDomainId = "xxxxxxxxxx"
auth_url = "xxxxxxxxxx"
conn = conne... | 28.362319 | 73 | 0.613694 |
d7bd545e36e8a189b0ff811670ecd9fea5d55633 | 711 | py | Python | stubs/micropython-esp32-1_11/umqtt/robust.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 38 | 2020-10-18T21:59:44.000Z | 2022-03-17T03:03:28.000Z | stubs/micropython-esp32-1_11/umqtt/robust.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 176 | 2020-10-18T14:31:03.000Z | 2022-03-30T23:22:39.000Z | stubs/micropython-esp32-1_11/umqtt/robust.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 6 | 2020-12-28T21:11:12.000Z | 2022-02-06T04:07:50.000Z | """
Module: 'umqtt.robust' on esp32 1.11.0
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11 on 2019-05-29', machine='ESP32 module with ESP32')
# Stubber: 1.3.2
class MQTTClient:
''
DEBUG = None
DELAY = 2
def _recv_len():
pass
def _send_str():
pass
... | 14.510204 | 126 | 0.530239 |
198b8991332d6a342808311fc81f23f0b9e191cb | 14,572 | py | Python | MECboard/views.py | mec-by-shp-wbl-hjk/MEC | da722701ee1673bf3477219f81208c28fa0a3d18 | [
"MIT"
] | 1 | 2019-07-18T15:43:12.000Z | 2019-07-18T15:43:12.000Z | MECboard/views.py | mec-by-shp-wbl-hjk/MEC | da722701ee1673bf3477219f81208c28fa0a3d18 | [
"MIT"
] | null | null | null | MECboard/views.py | mec-by-shp-wbl-hjk/MEC | da722701ee1673bf3477219f81208c28fa0a3d18 | [
"MIT"
] | 6 | 2019-07-17T07:59:14.000Z | 2019-09-12T04:08:37.000Z | from django.shortcuts import render, redirect, render_to_response, get_object_or_404
from MECboard.models import Board, Comment, Profile
import os
import math
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.utils.http import urlquote
from django... | 36.339152 | 178 | 0.63924 |
b3098ec3787eae7bacbb3c88e24cb4c9234d35d4 | 3,973 | py | Python | alipay/aop/api/request/AlipayDataDataserviceCodeRecoRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayDataDataserviceCodeRecoRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayDataDataserviceCodeRecoRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayDataDataserviceCodeRecoModel import AlipayDataDataserviceCodeRecoModel
class AlipayDataDataserviceCodeRecoRequest(object):
... | 27.4 | 148 | 0.644853 |
a52352c067301c2bba3752759fa73f4d943eafd3 | 18,713 | py | Python | plaso/parsers/firefox_cache.py | jonathan-greig/plaso | b88a6e54c06a162295d09b016bddbfbfe7ca9070 | [
"Apache-2.0"
] | 1,253 | 2015-01-02T13:58:02.000Z | 2022-03-31T08:43:39.000Z | plaso/parsers/firefox_cache.py | jonathan-greig/plaso | b88a6e54c06a162295d09b016bddbfbfe7ca9070 | [
"Apache-2.0"
] | 3,388 | 2015-01-02T11:17:58.000Z | 2022-03-30T10:21:45.000Z | plaso/parsers/firefox_cache.py | jonathan-greig/plaso | b88a6e54c06a162295d09b016bddbfbfe7ca9070 | [
"Apache-2.0"
] | 376 | 2015-01-20T07:04:54.000Z | 2022-03-04T23:53:00.000Z | # -*- coding: utf-8 -*-
"""Implements a parser for Firefox cache 1 and 2 files."""
import collections
import re
import os
from dfdatetime import posix_time as dfdatetime_posix_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.lib import dtf... | 35.986538 | 80 | 0.715225 |
d44489e1691c5cc098fab84ba37459988df52641 | 10,172 | py | Python | ptree/ptree/gittree.py | lsst-dm/DMTN-104 | 02f074beb4cb9eb1e08dc5e5f8446f7df2e33a4d | [
"CC-BY-4.0"
] | null | null | null | ptree/ptree/gittree.py | lsst-dm/DMTN-104 | 02f074beb4cb9eb1e08dc5e5f8446f7df2e33a4d | [
"CC-BY-4.0"
] | null | null | null | ptree/ptree/gittree.py | lsst-dm/DMTN-104 | 02f074beb4cb9eb1e08dc5e5f8446f7df2e33a4d | [
"CC-BY-4.0"
] | null | null | null | # LSST Data Management System
# Copyright 2018 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program 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 Foundat... | 34.134228 | 121 | 0.582973 |
cd697a23a6a8a07f404ef423444ff6b5742dd61b | 527 | py | Python | Bloomberg/CodeCon/cake.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | 1 | 2017-10-01T00:51:39.000Z | 2017-10-01T00:51:39.000Z | Bloomberg/CodeCon/cake.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | null | null | null | Bloomberg/CodeCon/cake.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | null | null | null | #Problem : Birthday Cake
#Language : Python 3
#Compiled Using : py_compile
#Version : Python 3.4.3
#Input for your program will be provided from STDIN
#Print out all output from your program to STDOUT
import sys
data = sys.stdin.read().splitlines()
n = int(data[0])
a = list(map(int, data[1:]))
... | 18.172414 | 51 | 0.588235 |
1063194153c4346ded3f0143f8a08ad8a763c148 | 1,132 | py | Python | Part_3_advanced/m03_date_and_time/date_construct/homework_1_start/new_movies/actions.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m03_date_and_time/date_construct/homework_1_start/new_movies/actions.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m03_date_and_time/date_construct/homework_1_start/new_movies/actions.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | from new_movies import permissions
from new_movies.exceptions import (
NoCreditsForMovieRent,
ActionNotAllowed,
MovieNotFound,
ViewsLimitReached,
)
from new_movies.rented_movie import RentedMovie
def rent_movie(user, movie):
if user.credits_left < 1:
raise NoCreditsForMovieRent()
user.... | 25.155556 | 82 | 0.726148 |
cfc559d5437f812c40467b39bd90b46b282435c9 | 2,603 | py | Python | model/data_loader.py | nrichards17/diabetes-pytorch | 80ba7e366e5850657cdd29dd8f81adf81408c56f | [
"MIT"
] | null | null | null | model/data_loader.py | nrichards17/diabetes-pytorch | 80ba7e366e5850657cdd29dd8f81adf81408c56f | [
"MIT"
] | null | null | null | model/data_loader.py | nrichards17/diabetes-pytorch | 80ba7e366e5850657cdd29dd8f81adf81408c56f | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
from torch.utils.data import Dataset, DataLoader
class DiabetesDataset(Dataset):
"""
docstring - todo
"""
def __init__(self, df, continuous_features=None,
categorical_features=None, output_features=None):
"""
docstring ... | 30.267442 | 104 | 0.61237 |
e4d9706c4d64e5dd80eea666e10b605f0d3b33a8 | 4,343 | py | Python | controlm_py/models/body3.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | 2 | 2020-03-20T18:24:23.000Z | 2021-03-05T22:05:04.000Z | controlm_py/models/body3.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | null | null | null | controlm_py/models/body3.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | 1 | 2021-05-27T15:54:37.000Z | 2021-05-27T15:54:37.000Z | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.220
Contact: customer_support@bmc.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Body3(obje... | 30.584507 | 102 | 0.589454 |
791b7b09b9334a001b35d6cc83d6b26958b72ef5 | 6,090 | py | Python | kiwi-content/kiwi/app.py | bubblegumsoldier/kiwi | 91701c1806dcfbc1b038fecf7c2cab8bb07a01d4 | [
"MIT"
] | null | null | null | kiwi-content/kiwi/app.py | bubblegumsoldier/kiwi | 91701c1806dcfbc1b038fecf7c2cab8bb07a01d4 | [
"MIT"
] | null | null | null | kiwi-content/kiwi/app.py | bubblegumsoldier/kiwi | 91701c1806dcfbc1b038fecf7c2cab8bb07a01d4 | [
"MIT"
] | null | null | null | from concurrent.futures import ThreadPoolExecutor, CancelledError
from aiomysql import create_pool
from asyncio import ensure_future, gather, sleep
from pymysql.err import OperationalError
from logging import getLogger
from sanic import Sanic
from sanic.request import Request
from sanic.response import json
from sanic.... | 33.461538 | 126 | 0.669294 |
b67187bedf6db83703e488b2db19f40230898ac7 | 10,479 | py | Python | tests/api_coverage_tests_regressors.py | dhdsjy/Feature_auto_ml | d30aa3f884c51cc060e26d38a8c648f9744f43c1 | [
"MIT"
] | null | null | null | tests/api_coverage_tests_regressors.py | dhdsjy/Feature_auto_ml | d30aa3f884c51cc060e26d38a8c648f9744f43c1 | [
"MIT"
] | null | null | null | tests/api_coverage_tests_regressors.py | dhdsjy/Feature_auto_ml | d30aa3f884c51cc060e26d38a8c648f9744f43c1 | [
"MIT"
] | null | null | null | # This file is just to test passing a bunch of different parameters into train to make sure that things work
# At first, it is not necessarily testing whether those things have the intended effect or not
import os
import sys
sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
from auto_ml import Predic... | 33.266667 | 400 | 0.743678 |
ea1367edb68bb37d33fef6787b3863f11c65d0e6 | 1,407 | py | Python | src/sima/doc/blueprints/workflowtest.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/doc/blueprints/workflowtest.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/doc/blueprints/workflowtest.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | #
# Generated with WorkflowTestBlueprint
from dmt.blueprint import Blueprint
from dmt.dimension import Dimension
from dmt.attribute import Attribute
from dmt.enum_attribute import EnumAttribute
from dmt.blueprint_attribute import BlueprintAttribute
from .test import TestBlueprint
class WorkflowTestBlueprint(TestBluep... | 61.173913 | 157 | 0.742715 |
968c0dceb2d5e30de8941a3fa0e2e7385efd408f | 70,844 | py | Python | Lib/typing.py | zhongxinshuju/labelme | 73a70f35160b5d691b1c532f7cda682427f00485 | [
"bzip2-1.0.6"
] | null | null | null | Lib/typing.py | zhongxinshuju/labelme | 73a70f35160b5d691b1c532f7cda682427f00485 | [
"bzip2-1.0.6"
] | null | null | null | Lib/typing.py | zhongxinshuju/labelme | 73a70f35160b5d691b1c532f7cda682427f00485 | [
"bzip2-1.0.6"
] | null | null | null | """
The typing module: Support for gradual typing as defined by PEP 484.
At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and... | 35.280876 | 97 | 0.60557 |
5274b82ef88ab30a1d5b29293c138c784b25f5fd | 22,351 | py | Python | pb/risk_atc_pb2.py | zheng-zy/LearnPyqt | 9e8c107102d00a7bfe810e514326631e7f457447 | [
"Apache-2.0"
] | 1 | 2016-03-23T07:54:55.000Z | 2016-03-23T07:54:55.000Z | pb/risk_atc_pb2.py | zheng-zy/LearnPyqt | 9e8c107102d00a7bfe810e514326631e7f457447 | [
"Apache-2.0"
] | null | null | null | pb/risk_atc_pb2.py | zheng-zy/LearnPyqt | 9e8c107102d00a7bfe810e514326631e7f457447 | [
"Apache-2.0"
] | 1 | 2020-07-23T18:27:53.000Z | 2020-07-23T18:27:53.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: risk_atc.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refl... | 41.855805 | 2,168 | 0.754194 |
4aae94a86e58da8b127d3e475629fea49a3c2f2f | 325 | py | Python | src/logproducer.py | cloudhubs/logscraper | 7e26e3e1c7f10cc9c551345349eeb4f75d8674cd | [
"MIT"
] | 3 | 2020-05-25T17:15:04.000Z | 2020-06-03T16:04:12.000Z | src/logproducer.py | cloudhubs/logscraper | 7e26e3e1c7f10cc9c551345349eeb4f75d8674cd | [
"MIT"
] | 93 | 2020-05-25T17:12:12.000Z | 2020-07-02T16:24:35.000Z | src/logproducer.py | cloudhubs/logscraper | 7e26e3e1c7f10cc9c551345349eeb4f75d8674cd | [
"MIT"
] | null | null | null | from kafka import KafkaProducer
from json import dumps
from time import sleep
producer = KafkaProducer(value_serializer=lambda m: dumps(m).encode('utf-8'),
bootstrap_servers='localhost:9092')
for i in range(4):
print('Sending')
sleep(1)
producer.send('test', value={"offset": i + 1... | 27.083333 | 77 | 0.667692 |
be89096ca271051a48c6312c790a90483b32a5c0 | 6,817 | py | Python | files/catkin_ws/devel/lib/python2.7/dist-packages/gazebo_ros/cfg/PhysicsConfig.py | Filipe-Douglas-Slam/slam_lidar_kinect | 4ac2c9555f939ba3bc3e97314eb611bdd9df5f27 | [
"MIT"
] | null | null | null | files/catkin_ws/devel/lib/python2.7/dist-packages/gazebo_ros/cfg/PhysicsConfig.py | Filipe-Douglas-Slam/slam_lidar_kinect | 4ac2c9555f939ba3bc3e97314eb611bdd9df5f27 | [
"MIT"
] | null | null | null | files/catkin_ws/devel/lib/python2.7/dist-packages/gazebo_ros/cfg/PhysicsConfig.py | Filipe-Douglas-Slam/slam_lidar_kinect | 4ac2c9555f939ba3bc3e97314eb611bdd9df5f27 | [
"MIT"
] | null | null | null | ## *********************************************************
##
## File autogenerated for the gazebo_ros package
## by the dynamic_reconfigure package.
## Please do not edit.
##
## ********************************************************/
from dynamic_reconfigure.encoding import extract_params
inf = float('inf')
con... | 184.243243 | 5,943 | 0.676104 |
497d825dcca07c4391965071cb49fefba8872754 | 2,133 | py | Python | tests/quickumls/test_quickumls.py | tnguyen-cohere/medspacy | 5d820a492d02440e4e902398397052daadb0e4ce | [
"MIT"
] | null | null | null | tests/quickumls/test_quickumls.py | tnguyen-cohere/medspacy | 5d820a492d02440e4e902398397052daadb0e4ce | [
"MIT"
] | null | null | null | tests/quickumls/test_quickumls.py | tnguyen-cohere/medspacy | 5d820a492d02440e4e902398397052daadb0e4ce | [
"MIT"
] | null | null | null | import spacy
import warnings
from sys import platform
import medspacy
class TestQuickUMLS:
@staticmethod
def can_test_quickumls():
if platform.startswith("win"):
# we're done here for now...
return False
return True
def test_initialize_pipeline(self):
"""... | 34.403226 | 104 | 0.66151 |
0c641125a598ebb1a1b2a1ccdcd0e78f374defe8 | 1,203 | py | Python | system_monitor/tests/test_exception_handling.py | weijia/system-monitor | 1f7f7275905d32e0d76e446609a681a728042fbd | [
"MIT"
] | null | null | null | system_monitor/tests/test_exception_handling.py | weijia/system-monitor | 1f7f7275905d32e0d76e446609a681a728042fbd | [
"MIT"
] | null | null | null | system_monitor/tests/test_exception_handling.py | weijia/system-monitor | 1f7f7275905d32e0d76e446609a681a728042fbd | [
"MIT"
] | null | null | null | from django.test import TestCase
from system_monitor.cmd_handler_with_alarm_report import CmdHandlerWithAlarmReport
# noinspection PyMethodMayBeStatic
class HandlerClassBaseStub(object):
def get_task_object_ufs_url(self):
return "ufs://handler_class_stub"
def get_subject_for_error(self):
ret... | 25.0625 | 82 | 0.768911 |
aea03c6c43598a1c2cbc08793f5b705130d57d1a | 6,041 | py | Python | tensorflow/python/compat/compat.py | raikonenfnu/tensorflow | aae314cf1c0bbe4b311cb6cddb8ff7b2a9fabd6b | [
"Apache-2.0"
] | 1 | 2022-01-14T16:26:48.000Z | 2022-01-14T16:26:48.000Z | tensorflow/python/compat/compat.py | raikonenfnu/tensorflow | aae314cf1c0bbe4b311cb6cddb8ff7b2a9fabd6b | [
"Apache-2.0"
] | null | null | null | tensorflow/python/compat/compat.py | raikonenfnu/tensorflow | aae314cf1c0bbe4b311cb6cddb8ff7b2a9fabd6b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.745562 | 82 | 0.74342 |
561d07c0cc880d23447645bb9e751d8ee69597a9 | 17,417 | py | Python | stfsclient/tensorflow/attr_value_pb2.py | jagans94/stfsclient | e24f109a4256c05ecca9331c21bf8f76e172ad45 | [
"MIT"
] | null | null | null | stfsclient/tensorflow/attr_value_pb2.py | jagans94/stfsclient | e24f109a4256c05ecca9331c21bf8f76e172ad45 | [
"MIT"
] | 2 | 2019-09-15T19:11:05.000Z | 2019-09-21T13:05:11.000Z | stfsclient/tensorflow/attr_value_pb2.py | jagans94/stfsclient | e24f109a4256c05ecca9331c21bf8f76e172ad45 | [
"MIT"
] | 1 | 2020-01-19T03:46:32.000Z | 2020-01-19T03:46:32.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: stfsclient/tensorflow/attr_value.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message... | 47.328804 | 1,706 | 0.760292 |
e298233a99aeda70420528ae211d0a0634300094 | 2,960 | py | Python | animation/kinematics.py | codyly/locomotion-by-mann | 89139466829ef7802bf645f865e335d4cda444e4 | [
"MIT"
] | null | null | null | animation/kinematics.py | codyly/locomotion-by-mann | 89139466829ef7802bf645f865e335d4cda444e4 | [
"MIT"
] | null | null | null | animation/kinematics.py | codyly/locomotion-by-mann | 89139466829ef7802bf645f865e335d4cda444e4 | [
"MIT"
] | null | null | null | from typing import List
import numpy as np
from scipy.spatial.transform import Rotation as R
from animation import common as C
from animation import utils as U
class Trajectory:
def __init__(self) -> None:
self.points: List[Point] = []
class Point:
def __init__(self, traj_vec=None, ... | 28.737864 | 107 | 0.596959 |
90159f2e8af49d0d5ef52dfb256604b6be89abb7 | 34,097 | py | Python | test/functional/rpc_fundrawtransaction.py | bitcoin-rush/bitcoinrush | 4329a6a7b9ce7a2188225f4abfc307e68de7dae0 | [
"MIT"
] | null | null | null | test/functional/rpc_fundrawtransaction.py | bitcoin-rush/bitcoinrush | 4329a6a7b9ce7a2188225f4abfc307e68de7dae0 | [
"MIT"
] | null | null | null | test/functional/rpc_fundrawtransaction.py | bitcoin-rush/bitcoinrush | 4329a6a7b9ce7a2188225f4abfc307e68de7dae0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the fundrawtransaction RPC."""
from decimal import Decimal
from test_framework.test_framework imp... | 45.161589 | 223 | 0.574713 |
b5102c9e611706ca54c6f8f07b13c6c8a4abd51e | 511 | py | Python | linear_regression_readline/code/code_length_1/lr_ds16.py | rodonguyen/vres_code_2021 | cb49d941db4dfc5137e887b195f403fb4262cfd8 | [
"MIT"
] | null | null | null | linear_regression_readline/code/code_length_1/lr_ds16.py | rodonguyen/vres_code_2021 | cb49d941db4dfc5137e887b195f403fb4262cfd8 | [
"MIT"
] | null | null | null | linear_regression_readline/code/code_length_1/lr_ds16.py | rodonguyen/vres_code_2021 | cb49d941db4dfc5137e887b195f403fb4262cfd8 | [
"MIT"
] | null | null | null | from sklearn import linear_model
x_values = []
y_values = []
n = 1
with open('./dataset/dataset_16.csv') as f:
for i in range(0, n):
x,y = f.readline().replace('\n','').split(',')
x, y = float(x), float(y)
x_values.append([x,y])
y_values.append(y)
# Create linear re... | 23.227273 | 55 | 0.62818 |
6d68e857e5188ad85dc626f25b90cf9fec4c297a | 689 | py | Python | babel/data/wlo_generator.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | babel/data/wlo_generator.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | 125 | 2017-10-12T12:14:23.000Z | 2022-03-11T23:50:19.000Z | babel/data/wlo_generator.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | # unique Babel wlo number generator
def wlo_pool(last_wlo_number, quantity):
"""
unique Babel wlo id generator
args:
last_wlo_number: str, format 'wlo0000001'
yields:
next_wlo: str, follwoing wlo number in sequence
"""
if last_wlo_number is None:
digits = 0
else:
... | 25.518519 | 62 | 0.618287 |
b71785cb0ad7a0c715358f10c913955c1a035a47 | 2,375 | py | Python | ui/pavetab.py | felixmariotto/rhino_awesome_pave | 7b5125f1466e5320f0c39088484aceee876ad284 | [
"CC0-1.0"
] | null | null | null | ui/pavetab.py | felixmariotto/rhino_awesome_pave | 7b5125f1466e5320f0c39088484aceee876ad284 | [
"CC0-1.0"
] | null | null | null | ui/pavetab.py | felixmariotto/rhino_awesome_pave | 7b5125f1466e5320f0c39088484aceee876ad284 | [
"CC0-1.0"
] | null | null | null |
"""
UI panel that's responsible for interaction with one pave setting.
This panel is duplicated for each new pave setting.
When instanced with Form(), it get passed an instance of Handler,
which is the functional module for handling the pave in the scene.
"""
import Eto.Forms as forms
import Eto.Drawing as drawing
#... | 30.448718 | 85 | 0.654316 |
2e5b253946ffd1eb0830823820b897380db7a0fd | 5,153 | py | Python | tests/test_cpu.py | hspaans/cs-6502-emulator-python | 9057a22c92e5d9de568758e109a4cff70d1d5b74 | [
"MIT"
] | null | null | null | tests/test_cpu.py | hspaans/cs-6502-emulator-python | 9057a22c92e5d9de568758e109a4cff70d1d5b74 | [
"MIT"
] | null | null | null | tests/test_cpu.py | hspaans/cs-6502-emulator-python | 9057a22c92e5d9de568758e109a4cff70d1d5b74 | [
"MIT"
] | null | null | null | """Verifies that the processor class works as expected."""
import m6502
def test_cpu_reset() -> None:
"""
Verify CPU state after CPU Reset.
:return: None
"""
memory = m6502.Memory()
cpu = m6502.Processor(memory)
cpu.reset()
assert (
cpu.program_counter,
cpu.stack_point... | 23.107623 | 75 | 0.589948 |
0a01669e3e0130739a4fdf924aa5eab24001d98d | 1,401 | py | Python | arjuna/core/reader/ini.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna/core/reader/ini.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna/core/reader/ini.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | # This file is a part of Arjuna
# Copyright 2015-2020 Rahul Verma
# Website: www.RahulVerma.net
# 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... | 28.591837 | 74 | 0.680942 |
e132cfaea7fe30c7806ea9db19c919a4c4758bce | 462 | py | Python | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/commoncrypto/secpolicy.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 10 | 2018-12-18T18:04:28.000Z | 2021-04-23T07:31:13.000Z | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/commoncrypto/secpolicy.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | null | null | null | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/commoncrypto/secpolicy.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 3 | 2019-06-22T14:16:57.000Z | 2021-12-29T22:04:42.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <Security/SecPolicy.h>
"""
TYPES = """
typedef .... | 19.25 | 79 | 0.712121 |
66cd9728a1a6287d5944282ece1f104751bf49e6 | 273 | py | Python | stacks/XIAOMATECH/1.0/services/CLICKHOUSE/package/scripts/service_check.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | 3 | 2019-08-13T01:44:16.000Z | 2019-12-10T04:05:56.000Z | stacks/XIAOMATECH/1.0/services/CLICKHOUSE/package/scripts/service_check.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | null | null | null | stacks/XIAOMATECH/1.0/services/CLICKHOUSE/package/scripts/service_check.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | 7 | 2019-05-29T17:35:25.000Z | 2021-12-04T07:55:10.000Z | #!/usr/bin/env python
from resource_management.libraries.script.script import Script
class ServiceCheck(Script):
def service_check(self, env):
import params
env.set_params(params)
pass
if __name__ == "__main__":
ServiceCheck().execute()
| 19.5 | 62 | 0.692308 |
305966df1057660f820e9f4c1081f30b44f205ef | 909 | py | Python | vis3d.py | dmrd/dnn | ed13beeccf92eccfd7ac8fe2eee63ab3a677a245 | [
"MIT"
] | 3 | 2015-05-01T15:10:45.000Z | 2019-09-29T13:53:11.000Z | vis3d.py | dmrd/dnn | ed13beeccf92eccfd7ac8fe2eee63ab3a677a245 | [
"MIT"
] | null | null | null | vis3d.py | dmrd/dnn | ed13beeccf92eccfd7ac8fe2eee63ab3a677a245 | [
"MIT"
] | null | null | null | import mayavi.mlab as ml
def plot_points(points):
""" Plots points as cubes in space """
if len(points):
x, y, z, s = zip(*points)
ml.points3d(x, y, z, s, mode='cube', scale_factor=0.2, colormap="binary", transparent=True)
def visualize3d(vis, size):
""" Size is (x, y, z) tuple """
p... | 30.3 | 99 | 0.515952 |
3215c4ae54ed626236b177566e3bdaeb90740be5 | 136 | py | Python | colcon_bundle/__init__.py | rotu/colcon-bundle | b57dd328dca2750b31c6303e587d70913a9dfe9d | [
"Apache-2.0"
] | null | null | null | colcon_bundle/__init__.py | rotu/colcon-bundle | b57dd328dca2750b31c6303e587d70913a9dfe9d | [
"Apache-2.0"
] | null | null | null | colcon_bundle/__init__.py | rotu/colcon-bundle | b57dd328dca2750b31c6303e587d70913a9dfe9d | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
__version__ = '0.0.20'
| 27.2 | 73 | 0.742647 |
9585d924618b903060079507744d1d49e0552c6b | 1,251 | py | Python | pointer/transformer/mask.py | RacleRay/TextSummerize | fe2572d26d65bdf849ce89fbb0c5adf5607f06b1 | [
"MIT"
] | 1 | 2020-08-25T03:13:57.000Z | 2020-08-25T03:13:57.000Z | pointer/transformer/mask.py | RacleRay/TextSummerize | fe2572d26d65bdf849ce89fbb0c5adf5607f06b1 | [
"MIT"
] | null | null | null | pointer/transformer/mask.py | RacleRay/TextSummerize | fe2572d26d65bdf849ce89fbb0c5adf5607f06b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : mask.py
@Author : Racle
@Version : 1.0
@Desc : None
'''
import torch
import torch.nn as nn
def create_padding_mask(seq, pad_id):
"注意,此处的mask为0表示有效内容,为1表示pad"
mask = seq.eq(pad_id).byte() # (batch, seq_len)
if torch.cuda.is_availa... | 29.093023 | 88 | 0.689049 |
6d9e444674960551b91b0b63375374bc129c5908 | 2,891 | py | Python | unit-tests/test-get-last-acquisition-timestamp.py | usnistgov/SpectrumBrowser | de398cb1e4ad4669e81a9504bbd32b1fd167841e | [
"BSD-Source-Code"
] | 10 | 2016-12-12T11:40:49.000Z | 2021-11-30T01:28:26.000Z | unit-tests/test-get-last-acquisition-timestamp.py | usnistgov/SpectrumBrowser | de398cb1e4ad4669e81a9504bbd32b1fd167841e | [
"BSD-Source-Code"
] | null | null | null | unit-tests/test-get-last-acquisition-timestamp.py | usnistgov/SpectrumBrowser | de398cb1e4ad4669e81a9504bbd32b1fd167841e | [
"BSD-Source-Code"
] | 4 | 2016-10-21T19:16:32.000Z | 2021-08-25T14:41:10.000Z | #! /usr/local/bin/python2.7
# -*- coding: utf-8 -*-
#
# This software was developed by employees of the National Institute of
# Standards and Technology (NIST), and others.
# This software has been contributed to the public domain.
# Pursuant to title 15 Untied States Code Section 105, works of NIST
# employees are not... | 34.831325 | 115 | 0.682809 |
0ce05289d539cb18e020192a4954351e4daf8f47 | 5,394 | py | Python | optimus/engines/base/io/load.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | optimus/engines/base/io/load.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | optimus/engines/base/io/load.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | import csv
import os
from abc import abstractmethod
import boto3
import joblib
import magic
from optimus.engines.base.basedataframe import BaseDataFrame
from optimus.helpers.functions import prepare_path
from optimus.helpers.raiseit import RaiseIt
XML_THRESHOLD = 10
JSON_THRESHOLD = 20
BYTES_SIZE = 327680
class Ba... | 31.91716 | 124 | 0.538747 |
efd384df4e7c0b3c08224c60a81b5db16f40b6d4 | 27,598 | py | Python | python/paddle/tensor/manipulation.py | randytli/Paddle | 75dadd586996c71cf5b088b6141b94705561773f | [
"Apache-2.0"
] | 1 | 2020-05-27T05:21:42.000Z | 2020-05-27T05:21:42.000Z | python/paddle/tensor/manipulation.py | randytli/Paddle | 75dadd586996c71cf5b088b6141b94705561773f | [
"Apache-2.0"
] | null | null | null | python/paddle/tensor/manipulation.py | randytli/Paddle | 75dadd586996c71cf5b088b6141b94705561773f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 34.934177 | 145 | 0.559823 |
9840981af5d9490495eb30d784a1733ac2663f43 | 3,534 | bzl | Python | private/rules/jvm_import.bzl | ljessendk/rules_jvm_external | 9b7e4c0af92144e637ca2e81492c267cc68605c2 | [
"Apache-2.0"
] | null | null | null | private/rules/jvm_import.bzl | ljessendk/rules_jvm_external | 9b7e4c0af92144e637ca2e81492c267cc68605c2 | [
"Apache-2.0"
] | null | null | null | private/rules/jvm_import.bzl | ljessendk/rules_jvm_external | 9b7e4c0af92144e637ca2e81492c267cc68605c2 | [
"Apache-2.0"
] | null | null | null | # Stripped down version of a java_import Starlark rule, without invoking ijar
# to create interface jars.
# Inspired by Square's implementation of `raw_jvm_import` [0] and discussions
# on the GitHub thread [1] about ijar's interaction with Kotlin JARs.
#
# [0]: https://github.com/square/bazel_maven_repository/pull/48... | 35.34 | 102 | 0.602716 |
d698ef222b908569282777676bf55e8768de68c1 | 8,738 | py | Python | demos/GCAMatting/utils/logger.py | briana-jin-zhang/spatial-segmentation | 1e9716d71692eebd5794f9129b833315625661fc | [
"Apache-2.0"
] | 733 | 2020-04-05T20:59:38.000Z | 2022-03-27T05:01:29.000Z | demos/GCAMatting/utils/logger.py | PooyaAlamirpour/deocclusion | 17e4a93dad1369ceb4d91c4564a93c99af398c77 | [
"Apache-2.0"
] | 44 | 2020-04-26T10:53:25.000Z | 2022-01-13T02:29:29.000Z | demos/GCAMatting/utils/logger.py | PooyaAlamirpour/deocclusion | 17e4a93dad1369ceb4d91c4564a93c99af398c77 | [
"Apache-2.0"
] | 98 | 2020-04-07T10:43:37.000Z | 2022-03-27T05:01:32.000Z | import os
import cv2
import torch
import logging
import datetime
import numpy as np
from pprint import pprint
from . import util
from .config import CONFIG
from tensorboardX import SummaryWriter
LEVELS = {
"DEBUG": logging.DEBUG,
"INFO": logging.INFO,
"WARNING": logging.WARNING,
... | 35.376518 | 130 | 0.584688 |
69c3f5d19831ca59217410e4ca75b0bf35b61ab0 | 2,014 | py | Python | Automated_ML/02_AutoML_Training_Pipeline/scripts/helper.py | nickwiecien/solution-accelerator-many-models | ff286029b474ebff09ff010418be56e2eb55de57 | [
"MIT"
] | null | null | null | Automated_ML/02_AutoML_Training_Pipeline/scripts/helper.py | nickwiecien/solution-accelerator-many-models | ff286029b474ebff09ff010418be56e2eb55de57 | [
"MIT"
] | null | null | null | Automated_ML/02_AutoML_Training_Pipeline/scripts/helper.py | nickwiecien/solution-accelerator-many-models | ff286029b474ebff09ff010418be56e2eb55de57 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
import sys
from azureml.core import Experiment
from azureml.core.run import Run
from azureml.core import Workspace
sys.path.append("..")
def write_automl_settings_to_file(automl_settings):
with open('scrip... | 34.724138 | 83 | 0.728898 |
a1939d3d274b6162a2837381474293b74dd4aa69 | 1,152 | py | Python | tests/test_services/test_auto_behavior/actions.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 4 | 2017-06-07T08:10:06.000Z | 2017-11-10T02:20:38.000Z | tests/test_services/test_auto_behavior/actions.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 242 | 2017-05-18T10:51:48.000Z | 2019-09-18T15:09:47.000Z | tests/test_services/test_auto_behavior/actions.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 5 | 2017-06-16T15:43:25.000Z | 2017-09-29T12:48:06.000Z | def init_actions_(service, args):
"""
this needs to returns an array of actions representing the depencies between actions.
Looks at ACTION_DEPS in this module for an example of what is expected
"""
# some default logic for simple actions
return {
'test': ['install']
}
def te... | 29.538462 | 100 | 0.619792 |
8289d7a399b2787aec9707be25cc530fc86b480c | 194 | py | Python | gnosis/eth/clients/contract_metadata.py | gosuto-ai/gnosis-py | 637ce5c92f208f0e1d4f5e0687c10f378cfdff56 | [
"MIT"
] | 64 | 2018-09-26T19:56:50.000Z | 2022-03-18T21:45:59.000Z | gnosis/eth/clients/contract_metadata.py | zhanghao-ic/gnosis-py | d2a5912547b7d1b576c826909f4c1d0155db536f | [
"MIT"
] | 151 | 2018-09-10T21:42:05.000Z | 2022-03-31T12:33:31.000Z | gnosis/eth/clients/contract_metadata.py | zhanghao-ic/gnosis-py | d2a5912547b7d1b576c826909f4c1d0155db536f | [
"MIT"
] | 50 | 2018-12-13T20:43:46.000Z | 2022-03-30T09:32:32.000Z | from dataclasses import dataclass
from typing import Any, Dict, List, Optional
@dataclass
class ContractMetadata:
name: Optional[str]
abi: List[Dict[str, Any]]
partial_match: bool
| 19.4 | 44 | 0.742268 |
6ae443820efd17b145f31ddc303055a3c5a0f8be | 5,610 | py | Python | laonlp/transliterate/__init__.py | wannaphong/LaoNLP | b147762089e1c92c60665fabfcfad1b7807e5a66 | [
"Apache-2.0"
] | 13 | 2020-04-01T02:19:35.000Z | 2022-02-09T12:06:17.000Z | laonlp/transliterate/__init__.py | wannaphong/LaoNLP | b147762089e1c92c60665fabfcfad1b7807e5a66 | [
"Apache-2.0"
] | 2 | 2021-09-23T10:35:53.000Z | 2022-02-04T14:33:51.000Z | laonlp/transliterate/__init__.py | wannaphong/LaoNLP | b147762089e1c92c60665fabfcfad1b7807e5a66 | [
"Apache-2.0"
] | 3 | 2020-08-19T14:56:41.000Z | 2021-11-06T16:47:38.000Z | # -*- coding: utf-8 -*-
__all__ = [
"lao2thai_script",
"thai2lao_script",
"lao2thai_transliteration",
"thai2lao_transliteration"
]
# Naive Lao script to Thai script transliteration.
# Data from https://github.com/google/language-resources/blob/master/lo/Laoo-Thai.txt
lao2thai_transliteration = {
"\u0e... | 48.782609 | 85 | 0.62549 |
657e8482373af55a9877db587deb8303a3ccf94f | 2,568 | py | Python | proconfig/utils/google_sheet.py | gfw-api/gs-pro-config | cf43fb977189a025a0b5b6e1fe38616845021b03 | [
"MIT"
] | null | null | null | proconfig/utils/google_sheet.py | gfw-api/gs-pro-config | cf43fb977189a025a0b5b6e1fe38616845021b03 | [
"MIT"
] | 4 | 2020-03-03T17:26:19.000Z | 2020-03-04T09:58:05.000Z | proconfig/utils/google_sheet.py | gfw-api/gs-pro-config | cf43fb977189a025a0b5b6e1fe38616845021b03 | [
"MIT"
] | null | null | null | import gspread
from oauth2client.service_account import ServiceAccountCredentials
from proconfig.errors import Error
class GoogleSheet(object):
def open_spreadsheet(sheet_name, custom_key=False):
"""
Open the spreadsheet for read/update
:param sheet_name: name of the google sheet
... | 36.169014 | 113 | 0.628894 |
ad82aaf682fd12babab7e2683c144918b8c49ff1 | 1,374 | py | Python | checkov/terraform/checks/resource/yandexcloud/VPCSecurityGroupRuleAllowAll.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | checkov/terraform/checks/resource/yandexcloud/VPCSecurityGroupRuleAllowAll.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | checkov/terraform/checks/resource/yandexcloud/VPCSecurityGroupRuleAllowAll.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
from checkov.common.models.enums import CheckResult, CheckCategories
class VPCSecurityGroupRuleAllowAll(BaseResourceCheck):
def __init__(self) -> None:
name = "Ensure security group rule is not allow-all."
id = "CKV... | 42.9375 | 87 | 0.583697 |
629151f1928f9f2ad71705b9c8e423e31fdaff17 | 585 | py | Python | data/run_data_prep.py | vsoch/theMAC | 2450e532e64c97ebabc029bbf4e1165e0b6078b4 | [
"MIT"
] | null | null | null | data/run_data_prep.py | vsoch/theMAC | 2450e532e64c97ebabc029bbf4e1165e0b6078b4 | [
"MIT"
] | null | null | null | data/run_data_prep.py | vsoch/theMAC | 2450e532e64c97ebabc029bbf4e1165e0b6078b4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from glob import glob
from mac_functions import remove_zeros, rename_nodes_sequential, make_color_string
input_files = glob("/home/vanessa/Documents/Dropbox/Code/Javascript/mac/data/*.csv")
# First remove rows of empty zeros at the end of the files
for ii in input_files:
remove_zeros(ii)
# Now r... | 30.789474 | 84 | 0.8 |
7aee9d99208d11706afdc089ac0785ffb03834ef | 2,173 | py | Python | homeassistant/components/otp/sensor.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/otp/sensor.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | homeassistant/components/otp/sensor.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 6 | 2018-02-04T03:48:55.000Z | 2022-01-24T20:37:04.000Z | """Support for One-Time Password (OTP)."""
import time
import pyotp
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_NAME, CONF_TOKEN
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
DEF... | 27.506329 | 86 | 0.669581 |
9eebdb82361cdd81004e3286316af23a4e2e551a | 3,282 | py | Python | events/ksoft_ban.py | botatooo/fire | 674de0f89d46d83a2c86a5eaae546befea05fd0b | [
"MIT"
] | null | null | null | events/ksoft_ban.py | botatooo/fire | 674de0f89d46d83a2c86a5eaae546befea05fd0b | [
"MIT"
] | null | null | null | events/ksoft_ban.py | botatooo/fire | 674de0f89d46d83a2c86a5eaae546befea05fd0b | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 GamingGeek
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, dis... | 48.985075 | 169 | 0.615478 |
aa19d39d8816c21dea8f2051f86f4287ab53bed7 | 4,999 | py | Python | src/pretrain/qa_answer_table.py | muziyongshixin/pytorch_SSRP | e54b3098927ba2ff16bdc8f64f3a2bf46d1f72c5 | [
"MIT"
] | 1 | 2022-01-11T06:29:01.000Z | 2022-01-11T06:29:01.000Z | src/pretrain/qa_answer_table.py | muziyongshixin/pytorch_SSRP | e54b3098927ba2ff16bdc8f64f3a2bf46d1f72c5 | [
"MIT"
] | null | null | null | src/pretrain/qa_answer_table.py | muziyongshixin/pytorch_SSRP | e54b3098927ba2ff16bdc8f64f3a2bf46d1f72c5 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyleft 2019 project LXRT.
import json
import torch
class AnswerTable:
ANS_CONVERT = {
"a man": "man",
"the man": "man",
"a woman": "woman",
"the woman": "woman",
'one': '1',
'two': '2',
'three': '3',
'four': '4',
'five': '... | 31.440252 | 85 | 0.604921 |
a4713b2bfcb38d65442bde989003fce4f9a23e00 | 2,849 | py | Python | code/Experiments/Lasagne_examples/modelzoo/vgg19.py | matthijsvk/convNets | 7e65db7857a4e6abfbcab264953eb7741319de6c | [
"Apache-2.0"
] | 1,034 | 2015-05-21T12:47:50.000Z | 2022-03-17T19:27:29.000Z | modelzoo/vgg19.py | nestyme/Recipes | 553f5cf671f164da71152e33253cd7ed737dd2ac | [
"MIT"
] | 111 | 2015-07-04T11:38:59.000Z | 2022-03-04T01:12:11.000Z | modelzoo/vgg19.py | nestyme/Recipes | 553f5cf671f164da71152e33253cd7ed737dd2ac | [
"MIT"
] | 528 | 2015-07-03T22:15:02.000Z | 2022-03-27T10:01:21.000Z | # VGG-19, 19-layer model from the paper:
# "Very Deep Convolutional Networks for Large-Scale Image Recognition"
# Original source: https://gist.github.com/ksimonyan/3785162f95cd2d5fee77
# License: see http://www.robots.ox.ac.uk/~vgg/research/very_deep/
# Download pretrained weights from:
# https://s3.amazonaws.com/las... | 42.522388 | 73 | 0.650404 |
e5246ff42e0c23313050f34fe67dfa2c5778463e | 4,774 | py | Python | imageio/plugins/fits.py | gerlero/imageio | 4b3550ddedf99ecdfa71768d20a4a6251adcbabf | [
"BSD-2-Clause"
] | null | null | null | imageio/plugins/fits.py | gerlero/imageio | 4b3550ddedf99ecdfa71768d20a4a6251adcbabf | [
"BSD-2-Clause"
] | null | null | null | imageio/plugins/fits.py | gerlero/imageio | 4b3550ddedf99ecdfa71768d20a4a6251adcbabf | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# imageio is distributed under the terms of the (new) BSD License.
""" Plugin for reading FITS files.
"""
from .. import formats
from ..core import Format
_fits = None # lazily loaded
def load_lib():
global _fits
try:
from astropy.io import fits as _fits
except ImportEr... | 37.296875 | 86 | 0.628823 |
6e9fce364c08c00836171d669aab167fe00e65b6 | 1,537 | py | Python | code/Add_intended_for_fixed.py | DVS-Lab/rutgers-r21 | 2303b2c62c41946872de8afb9796c5dffa8eee65 | [
"MIT"
] | null | null | null | code/Add_intended_for_fixed.py | DVS-Lab/rutgers-r21 | 2303b2c62c41946872de8afb9796c5dffa8eee65 | [
"MIT"
] | null | null | null | code/Add_intended_for_fixed.py | DVS-Lab/rutgers-r21 | 2303b2c62c41946872de8afb9796c5dffa8eee65 | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[1]:
# In[12]:
#imports libraries
import json
import os
import subprocess
# sets subject number we can later set this to all in the bids folder
#gets current working directory If your bids is in the same folder as this file this should work for everyone
cwd = os.getcwd()
bidsdir="/data/proje... | 26.5 | 151 | 0.657124 |
4a0e47af2b0afd3e04a62df700cf850c3576a93e | 419 | py | Python | models/model_configs.py | AkibMashrur/AI-Finbot | ba2a6f876d5a8dcbc19b713219ddc5574e4032de | [
"Apache-2.0"
] | null | null | null | models/model_configs.py | AkibMashrur/AI-Finbot | ba2a6f876d5a8dcbc19b713219ddc5574e4032de | [
"Apache-2.0"
] | null | null | null | models/model_configs.py | AkibMashrur/AI-Finbot | ba2a6f876d5a8dcbc19b713219ddc5574e4032de | [
"Apache-2.0"
] | 1 | 2021-11-09T13:01:51.000Z | 2021-11-09T13:01:51.000Z | class SDEnet_configs():
# structure configs
drift_depth = 8
diffusion_depth = 8
in_nodes = 20
latent_nodes = 64
diffusion_nodes = 128
# compilation configs
lr_1 = 1e-6
momentum_1 = 0.9
lr_2 = 0.01
momentum_2 = 0.9
weight_decay = 5e-4
# train configs
noise_scale ... | 17.458333 | 25 | 0.622912 |
2c7e894d1823a3a86f6dc48ab5ae456c4ece38a8 | 3,622 | py | Python | spec/reporter_spec.py | kfischer-okarin/mamba | 0a2c83e2e9b1fc06aa6165519bc2c8de418e906b | [
"MIT"
] | 462 | 2015-01-02T19:59:33.000Z | 2022-03-12T09:47:17.000Z | spec/reporter_spec.py | kfischer-okarin/mamba | 0a2c83e2e9b1fc06aa6165519bc2c8de418e906b | [
"MIT"
] | 93 | 2015-01-31T13:18:47.000Z | 2021-05-06T18:32:42.000Z | spec/reporter_spec.py | kfischer-okarin/mamba | 0a2c83e2e9b1fc06aa6165519bc2c8de418e906b | [
"MIT"
] | 66 | 2015-04-24T14:12:13.000Z | 2022-03-01T16:52:51.000Z | from mamba import description, context, before, it
from expects import expect, equal, contain
from doublex_expects import have_been_called_with
from doublex import Spy
from spec.object_mother import *
from mamba import reporter, formatters, example_group
with description(reporter.Reporter) as self:
with before... | 37.729167 | 103 | 0.689674 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.