hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c332e26d923bffec6844f1832e10218c0d0b55e | 4,277 | py | Python | preprocessor/preprocessor.py | thepowerfuldeez/VAENAR-TTS | 7ee40a5511118491269102bc6874a51c1d9959ee | [
"MIT"
] | null | null | null | preprocessor/preprocessor.py | thepowerfuldeez/VAENAR-TTS | 7ee40a5511118491269102bc6874a51c1d9959ee | [
"MIT"
] | null | null | null | preprocessor/preprocessor.py | thepowerfuldeez/VAENAR-TTS | 7ee40a5511118491269102bc6874a51c1d9959ee | [
"MIT"
] | null | null | null | import os
import random
import json
import tgt
import librosa
import numpy as np
from tqdm import tqdm
import audio as Audio
from text import grapheme_to_phoneme
from utils.tools import read_lexicon
from g2p_en import G2p
random.seed(1234)
class Preprocessor:
def __init__(self, config):
self.config = c... | 33.677165 | 128 | 0.574468 | import os
import random
import json
import tgt
import librosa
import numpy as np
from tqdm import tqdm
import audio as Audio
from text import grapheme_to_phoneme
from utils.tools import read_lexicon
from g2p_en import G2p
random.seed(1234)
class Preprocessor:
def __init__(self, config):
self.config = c... | true | true |
1c332e30c32aa1ed1f57437c220782a600b636df | 3,771 | py | Python | tests/plugins/base_test.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | 1 | 2020-05-19T05:07:19.000Z | 2020-05-19T05:07:19.000Z | tests/plugins/base_test.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | 1 | 2020-08-12T21:57:16.000Z | 2020-08-12T21:57:16.000Z | tests/plugins/base_test.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | 1 | 2021-07-14T16:53:12.000Z | 2021-07-14T16:53:12.000Z | from contextlib import contextmanager
import mock
import pytest
from detect_secrets.core.constants import VerifiedResult
from detect_secrets.plugins.base import BasePlugin
from testing.factories import potential_secret_factory
from testing.mocks import mock_file_object
@pytest.mark.parametrize(
'name, expected'... | 31.425 | 78 | 0.619464 | from contextlib import contextmanager
import mock
import pytest
from detect_secrets.core.constants import VerifiedResult
from detect_secrets.plugins.base import BasePlugin
from testing.factories import potential_secret_factory
from testing.mocks import mock_file_object
@pytest.mark.parametrize(
'name, expected'... | true | true |
1c332eadaeec91974c0a1e42791d552c367427f6 | 1,259 | py | Python | profiles/migrations/0002_auto_20210313_1656.py | ezekieltech/eduTech-backend | 33b82f57add98285b73d89bc9d97f499cdb3f1e4 | [
"MIT"
] | null | null | null | profiles/migrations/0002_auto_20210313_1656.py | ezekieltech/eduTech-backend | 33b82f57add98285b73d89bc9d97f499cdb3f1e4 | [
"MIT"
] | 15 | 2021-01-02T17:43:37.000Z | 2021-02-13T12:02:11.000Z | profiles/migrations/0002_auto_20210313_1656.py | ezekieltech/eduTech-backend | 33b82f57add98285b73d89bc9d97f499cdb3f1e4 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-03-13 15:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('profiles', '0001_initial'),
migrations.swappable_dependency(set... | 37.029412 | 196 | 0.67355 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('profiles', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations =... | true | true |
1c332eba54cf48ce209e84efa7ccdceb379fb0bc | 492 | py | Python | tests/nn/mse_loss_test.py | kbrodt/tor4 | d09740b746c534e67a72f492c7c03654f5888a46 | [
"MIT"
] | null | null | null | tests/nn/mse_loss_test.py | kbrodt/tor4 | d09740b746c534e67a72f492c7c03654f5888a46 | [
"MIT"
] | null | null | null | tests/nn/mse_loss_test.py | kbrodt/tor4 | d09740b746c534e67a72f492c7c03654f5888a46 | [
"MIT"
] | null | null | null | import tor4
import tor4.nn as nn
def test_mse_backward():
inputs = tor4.tensor(data=[1.0, 2, 3], requires_grad=True)
targets = tor4.tensor(data=[2, 3, 2])
mse_nn = nn.functional.mse_loss(inputs, targets)
mse = ((inputs - targets) ** 2).mean()
mse2 = nn.functional.mse_loss_slow(inputs, targets)
... | 27.333333 | 62 | 0.634146 | import tor4
import tor4.nn as nn
def test_mse_backward():
inputs = tor4.tensor(data=[1.0, 2, 3], requires_grad=True)
targets = tor4.tensor(data=[2, 3, 2])
mse_nn = nn.functional.mse_loss(inputs, targets)
mse = ((inputs - targets) ** 2).mean()
mse2 = nn.functional.mse_loss_slow(inputs, targets)
... | true | true |
1c332f66e37a34e84130c88451c698f9e98f4daa | 1,640 | py | Python | textParser.py | guardian/google-ad-database-processing-scripts | e5e6becabb2f9696f2979936234cdb878626f557 | [
"MIT"
] | 1 | 2021-12-04T00:03:35.000Z | 2021-12-04T00:03:35.000Z | textParser.py | guardian/google-ad-database-processing-scripts | e5e6becabb2f9696f2979936234cdb878626f557 | [
"MIT"
] | null | null | null | textParser.py | guardian/google-ad-database-processing-scripts | e5e6becabb2f9696f2979936234cdb878626f557 | [
"MIT"
] | null | null | null | import requests
import simplejson as json
import scraperwiki
import time
# Text ad example https://transparencyreport.google.com/transparencyreport/api/v3/politicalads/creatives/details?entity_id=AR117485875444580352&creative_id=CR113556358325862400&hl=en
def getFullAdText(ad_text_json):
full_text = ""
for thing in... | 32.8 | 182 | 0.739634 | import requests
import simplejson as json
import scraperwiki
import time
def getFullAdText(ad_text_json):
full_text = ""
for thing in ad_text_json:
if type(thing) is str:
full_text = full_text + thing + "\n"
elif type(thing) is list:
for things in thing:
full_text = full_text + things + " "
full_... | true | true |
1c333086cd645f5e0478b97ef3ea91b87966bce8 | 12,641 | py | Python | vumi/transports/cellulant/tests/test_cellulant_sms.py | vishwaprakashmishra/xmatrix | aefdab7e2980748746c7fefcd75c965cea55466f | [
"BSD-3-Clause"
] | 1 | 2016-07-27T17:13:32.000Z | 2016-07-27T17:13:32.000Z | vumi/transports/cellulant/tests/test_cellulant_sms.py | TouK/vumi | 6d250c7039fa1d82b01c5b68722aa8a6a94580b2 | [
"BSD-3-Clause"
] | null | null | null | vumi/transports/cellulant/tests/test_cellulant_sms.py | TouK/vumi | 6d250c7039fa1d82b01c5b68722aa8a6a94580b2 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
import json
from urllib import urlencode
from twisted.internet.defer import inlineCallbacks, DeferredQueue, returnValue
from vumi.utils import http_request, http_request_full
from vumi.tests.utils import MockHttpServer
from vumi.tests.helpers import VumiTestCase
from vumi.transports.cellula... | 37.622024 | 78 | 0.592596 |
import json
from urllib import urlencode
from twisted.internet.defer import inlineCallbacks, DeferredQueue, returnValue
from vumi.utils import http_request, http_request_full
from vumi.tests.utils import MockHttpServer
from vumi.tests.helpers import VumiTestCase
from vumi.transports.cellulant import CellulantSmsTra... | true | true |
1c3330f58e7b519be076c0bf3286fea33c99ab94 | 2,907 | py | Python | scripts/helperSimulations.py | alok123t/HyINDEL | 39cb5a32f08c9c3054f9b7237cb39baab7172d82 | [
"MIT"
] | 4 | 2020-07-11T09:49:09.000Z | 2021-10-14T18:54:53.000Z | scripts/helperSimulations.py | alok123t/HyINDEL | 39cb5a32f08c9c3054f9b7237cb39baab7172d82 | [
"MIT"
] | 1 | 2021-10-10T14:21:06.000Z | 2021-11-06T13:01:18.000Z | scripts/helperSimulations.py | alok123t/HyINDEL | 39cb5a32f08c9c3054f9b7237cb39baab7172d82 | [
"MIT"
] | null | null | null | import random
import sys
# Small, large size ranges
DISTR = [[50, 500], [500, 10000]]
# Number of variants for each size range
N_DISTR = 375
def getRandomString(l):
return ''.join(random.choice('ATGC') for _ in range(l))
def genPositions():
# For each size range
for d in DISTR:
# Insertions
... | 28.782178 | 86 | 0.43894 | import random
import sys
DISTR = [[50, 500], [500, 10000]]
N_DISTR = 375
def getRandomString(l):
return ''.join(random.choice('ATGC') for _ in range(l))
def genPositions():
for d in DISTR:
rndVals = random.sample(range(d[0], d[1]), N_DISTR)
for val in rndVals:
ou... | true | true |
1c3331f13df114ad08467370a9d4d07f01f65559 | 7,816 | py | Python | examples/pwr_run/checkpointing/final/no_threshold/job53.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final/no_threshold/job53.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final/no_threshold/job53.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 32.978903 | 118 | 0.69153 |
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras.callbacks import ReduceLROn... | true | true |
1c33327019a9318a80800e8752a3c80c71bc8dcd | 7,953 | py | Python | configs/fusion_consis/xmuda/src_ctr_usa_v1_w2.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | 1 | 2020-11-05T19:51:23.000Z | 2020-11-05T19:51:23.000Z | configs/fusion_consis/xmuda/src_ctr_usa_v1_w2.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | null | null | null | configs/fusion_consis/xmuda/src_ctr_usa_v1_w2.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | null | null | null | # the same as src_ctr_usa_v1.py except for max_pts = 512
##############################################
# variants: Runner, model
# options: class_weights
##############################################
# runner
# runner = 'XmudaRunner' # for any customized runner, use general_train.py
only_contrast = False # default ... | 34.133047 | 120 | 0.655979 | true | true | |
1c33329b62c08f717b74feb9b3ec27e82debf45c | 2,876 | py | Python | Project/src/Modules/House/Family/Upb/upb_device.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | 3 | 2016-11-16T00:37:58.000Z | 2019-11-10T13:10:19.000Z | Project/src/Modules/House/Family/Upb/upb_device.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | null | null | null | Project/src/Modules/House/Family/Upb/upb_device.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | 1 | 2020-07-19T22:06:52.000Z | 2020-07-19T22:06:52.000Z | """
@name: Modules/families/UPB/UPB_device.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2011-2020 by D. Brian Kimmel
@license: MIT License
@note: Created on Mar 27, 2011
@summary: This module is for communicating with UPB controllers.
Load the database with UPB devic... | 35.506173 | 107 | 0.650556 |
__updated__ = '2020-02-19'
from Modules.Families.UPB.UPB_Pim import Api as upbPimApi
from Modules.Core import logging_pyh as Logger
LOG = Logger.getLogger('PyHouse.UPB_device ')
class lightingUtility(object):
@staticmethod
def _is_upb_active(p_controller_obj):
if p_controller_obj.Family.Nam... | true | true |
1c3332fce4b39830bc48b6785450db2bd6c00c52 | 11,547 | py | Python | lisa/tests/staging/sched_android.py | credp/lisa | c87a9a3463d55dd28ff7bb705551529a4ffd4456 | [
"Apache-2.0"
] | 1 | 2021-07-03T23:45:09.000Z | 2021-07-03T23:45:09.000Z | lisa/tests/staging/sched_android.py | QPC-database/lisa | 9cc520a11192dea02240ddcf0df53bf6d6763411 | [
"Apache-2.0"
] | null | null | null | lisa/tests/staging/sched_android.py | QPC-database/lisa | 9cc520a11192dea02240ddcf0df53bf6d6763411 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019, Arm Limited and contributors.
#
# 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
#
# ... | 35.097264 | 122 | 0.639993 |
import os
import os.path
import abc
from lisa.wlgen.rta import RTAPhase, PeriodicWload
from lisa.tests.base import TestBundleBase, TestBundle, ResultBundle, RTATestBundle, AggregatedResultBundle
from lisa.trace import requires_events
from lisa.target import Target
from lisa.utils import ArtifactPath, ... | true | true |
1c33333bbb025761b13dfdd9658ef772ab03d251 | 32,653 | py | Python | ckan/views/resource.py | end2end8x/ckan | 45ee306de2f667484b2d086519fb5335a73e36a5 | [
"Apache-2.0"
] | 58 | 2015-01-11T09:05:15.000Z | 2022-03-17T23:44:07.000Z | ckan/views/resource.py | end2end8x/ckan | 45ee306de2f667484b2d086519fb5335a73e36a5 | [
"Apache-2.0"
] | 1,467 | 2015-01-01T16:47:44.000Z | 2022-02-28T16:51:20.000Z | ckan/views/resource.py | end2end8x/ckan | 45ee306de2f667484b2d086519fb5335a73e36a5 | [
"Apache-2.0"
] | 17 | 2015-05-06T14:04:21.000Z | 2021-11-11T19:58:16.000Z | # encoding: utf-8
import cgi
import json
import logging
import flask
from flask.views import MethodView
import six
import ckan.lib.base as base
import ckan.lib.datapreview as lib_datapreview
import ckan.lib.helpers as h
import ckan.lib.navl.dictization_functions as dict_fns
import ckan.lib.uploader as uploader
import... | 33.490256 | 79 | 0.578017 |
import cgi
import json
import logging
import flask
from flask.views import MethodView
import six
import ckan.lib.base as base
import ckan.lib.datapreview as lib_datapreview
import ckan.lib.helpers as h
import ckan.lib.navl.dictization_functions as dict_fns
import ckan.lib.uploader as uploader
import ckan.logic as lo... | true | true |
1c3333803a99fbaa0e4a9b9243428d076cd7b431 | 5,362 | py | Python | discord/template.py | jonasbohmann/discord.py | a63ced9c6910b92acc06e6c0d9f50f1ce495b18b | [
"MIT"
] | 2 | 2020-11-19T09:41:26.000Z | 2021-12-07T12:08:55.000Z | discord/template.py | jonasbohmann/discord.py | a63ced9c6910b92acc06e6c0d9f50f1ce495b18b | [
"MIT"
] | null | null | null | discord/template.py | jonasbohmann/discord.py | a63ced9c6910b92acc06e6c0d9f50f1ce495b18b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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 t... | 31.356725 | 96 | 0.657404 |
from .utils import parse_time, _get_as_snowflake, _bytes_to_base64_data
from .enums import VoiceRegion
from .guild import Guild
__all__ = (
'Template',
)
class _FriendlyHttpAttributeErrorHelper:
__slots__ = ()
def __getattr__(self, attr):
raise AttributeError('PartialTemplateState does not sup... | true | true |
1c333452ebe6f0e0869a6644f68e01a17c05280f | 3,226 | py | Python | services/scheduling/tests/jrpc/test_compatibility.py | rtubio/server | 3bb15f4d4dcd543d6f95d1fda2cb737de0bb9a9b | [
"Apache-2.0"
] | 4 | 2015-03-23T16:34:53.000Z | 2017-12-12T11:41:54.000Z | services/scheduling/tests/jrpc/test_compatibility.py | rtubio/server | 3bb15f4d4dcd543d6f95d1fda2cb737de0bb9a9b | [
"Apache-2.0"
] | 42 | 2015-01-08T22:21:04.000Z | 2021-12-13T19:48:44.000Z | services/scheduling/tests/jrpc/test_compatibility.py | rtubio/server | 3bb15f4d4dcd543d6f95d1fda2cb737de0bb9a9b | [
"Apache-2.0"
] | 2 | 2015-04-04T15:23:35.000Z | 2017-07-23T23:14:06.000Z |
import logging
from django import test
from services.common import helpers as db_tools
from services.scheduling.jrpc.views import compatibility as compatibility_jrpc
"""
Copyright 2015 Ricardo Tubio-Pardavila
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except ... | 32.26 | 79 | 0.66491 |
import logging
from django import test
from services.common import helpers as db_tools
from services.scheduling.jrpc.views import compatibility as compatibility_jrpc
__author__ = 'rtubiopa@calpoly.edu'
class TestCompatibilityViews(test.TestCase):
def setUp(self):
self.__verbose_testing = False
... | true | true |
1c33358672906e92d07484e42457ecde63e16919 | 11,221 | py | Python | pypy/interpreter/pyparser/pytokenize.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | pypy/interpreter/pyparser/pytokenize.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | pypy/interpreter/pyparser/pytokenize.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 30 | 2018-08-20T03:16:34.000Z | 2022-01-12T17:39:22.000Z | # ______________________________________________________________________
"""Module pytokenize
THIS FILE WAS COPIED FROM pypy/module/parser/pytokenize.py AND ADAPTED
TO BE ANNOTABLE (Mainly made lists homogeneous)
This is a modified version of Ka-Ping Yee's tokenize module found in the
Python standard library.
The pr... | 29.843085 | 78 | 0.387131 |
from pypy.interpreter.pyparser import automata
__all__ = [ "tokenize" ]
accepts = [True, True, True, True, True, True, True, True,
True, True, False, True, True, True, True, False,
False, False, True, False, False, True, False,
False, True, False, True, False, True, False,
... | true | true |
1c3336890a8d0e233dbb651635e44b8a59ac72c8 | 7,181 | py | Python | src/rgt/THOR/binom_hmm.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | src/rgt/THOR/binom_hmm.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | src/rgt/THOR/binom_hmm.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
THOR detects differential peaks in multiple ChIP-seq profiles associated
with two distinct biological conditions.
Copyright (C) 2014-2016 Manuel Allhoff (allhoff@aices.rwth-aachen.de)
This program is free software: you can redistribute it and/or modify
it under the te... | 39.027174 | 156 | 0.58613 |
from __future__ import print_function
import sys
import string
import numpy as np
from scipy.stats import binom
from hmmlearn.hmm import _BaseHMM
from help_hmm import _valid_posteriors
def get_init_parameters(s1, s2, **info):
n_ = np.array([info['count'], info['count']])
m_ =[float(np.argmax(np.bincoun... | true | true |
1c3337b4228671c7b2f5d125c8ec33d2f9fa971e | 26,053 | py | Python | postprocessing_preBotBot/doPost.py | JoshMend/prebotc-graph-model | 4002e51ab965be366b30c2a6d900ac288fa41245 | [
"BSD-3-Clause"
] | null | null | null | postprocessing_preBotBot/doPost.py | JoshMend/prebotc-graph-model | 4002e51ab965be366b30c2a6d900ac288fa41245 | [
"BSD-3-Clause"
] | null | null | null | postprocessing_preBotBot/doPost.py | JoshMend/prebotc-graph-model | 4002e51ab965be366b30c2a6d900ac288fa41245 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
'''
This file does all the post processing for a given mat file at once. This includes:
1) Deleting Transient
2)Binning the spikes
3)Filter spikes using gaussian distribution
4)Using butterworth filter to remove high frequency signals to smooth
5)Finds Phase Lag and Population Correlation
'''... | 37.757971 | 188 | 0.630446 |
import sys
import numpy as np
import scipy.signal
import scipy.io
import argparse
import networkx as nx
import matplotlib.pyplot as plt
import cmath
import math
maxorder=20
eta_norm_pts = 10
def parse_args(argv):
transient = 10000
spike_thresh = -20
f_sigma = 20
butter_high = 4
butter_l... | true | true |
1c33382a90cfba888a05b51de0ec3f4456a3473f | 4,373 | py | Python | Code/fun3.py | HalforcNull/Research_PatternRecognition | e9cbe8df75ae775e0ed813ac4956973b4e857979 | [
"MIT"
] | null | null | null | Code/fun3.py | HalforcNull/Research_PatternRecognition | e9cbe8df75ae775e0ed813ac4956973b4e857979 | [
"MIT"
] | null | null | null | Code/fun3.py | HalforcNull/Research_PatternRecognition | e9cbe8df75ae775e0ed813ac4956973b4e857979 | [
"MIT"
] | null | null | null | """
Elevator Maintenance
====================
You've been assigned the onerous task of elevator maintenance - ugh! It wouldn't be so bad, except that all the elevator documentation has been lying in a disorganized pile at the bottom of a filing cabinet for years, and you don't even know what elevator version numbers y... | 40.490741 | 707 | 0.576263 |
class node:
left = None
right = None
father = None
value = ''
def __init__(self, v, father):
self.value = v
self.father = father
def isBefore(self, n):
lc = self.value.split('.')
ln = n.split('.')
for i in range(0, min(len(lc), len(ln))):
... | true | true |
1c333855ffae6255eb2af9e2088e8ddac49d027a | 8,938 | py | Python | analytics/common/runva.py | dhaval-zala/smart_city_ | c555253b57c442cb27e1e5a642cce25ae8bfa564 | [
"BSD-3-Clause"
] | null | null | null | analytics/common/runva.py | dhaval-zala/smart_city_ | c555253b57c442cb27e1e5a642cce25ae8bfa564 | [
"BSD-3-Clause"
] | null | null | null | analytics/common/runva.py | dhaval-zala/smart_city_ | c555253b57c442cb27e1e5a642cce25ae8bfa564 | [
"BSD-3-Clause"
] | 1 | 2022-03-23T12:07:41.000Z | 2022-03-23T12:07:41.000Z | #!/usr/bin/python3
from db_common import DBCommon
from db_query import DBQuery
from paho.mqtt.client import Client
from db_ingest import DBIngest
from threading import Event
from vaserving.vaserving import VAServing
from vaserving.pipeline import Pipeline
from configuration import env
import time
import traceback
impo... | 43.6 | 103 | 0.426046 |
from db_common import DBCommon
from db_query import DBQuery
from paho.mqtt.client import Client
from db_ingest import DBIngest
from threading import Event
from vaserving.vaserving import VAServing
from vaserving.pipeline import Pipeline
from configuration import env
import time
import traceback
import psutil
mqtthos... | true | true |
1c33391aac998ba80be1193d3b8412ce2e951685 | 8,400 | py | Python | src/vanguards/config.py | mikeperry-tor/vanguards | 10942de93f6578f8303f60014f34de2fca345545 | [
"MIT"
] | 132 | 2018-01-17T22:35:22.000Z | 2022-03-19T08:35:41.000Z | src/vanguards/config.py | mikeperry-tor/vanguards | 10942de93f6578f8303f60014f34de2fca345545 | [
"MIT"
] | 87 | 2018-05-25T23:20:24.000Z | 2022-02-02T08:41:08.000Z | src/vanguards/config.py | mikeperry-tor/vanguards | 10942de93f6578f8303f60014f34de2fca345545 | [
"MIT"
] | 22 | 2018-05-29T10:47:48.000Z | 2022-03-15T03:45:04.000Z | """ This file contains configuration defaults, options parsing, and config
file code.
"""
import argparse
import ipaddress
import os
import socket
import sys
from . import bandguards
from . import rendguard
from . import vanguards
from . import control
from . import logger
from .logger import plog
try:
from co... | 35.146444 | 115 | 0.686905 | import argparse
import ipaddress
import os
import socket
import sys
from . import bandguards
from . import rendguard
from . import vanguards
from . import control
from . import logger
from .logger import plog
try:
from configparser import SafeConfigParser, Error
except ImportError:
from ConfigParser import SafeC... | true | true |
1c333aa93800b8a44a18eb736edabe8885f9321e | 6,000 | py | Python | cidd/run-cidd-in-docker.py | NCAR/lrose-displays | c12e98c6890a5efdd4abe95a36b9004e0d83fe74 | [
"BSD-2-Clause"
] | null | null | null | cidd/run-cidd-in-docker.py | NCAR/lrose-displays | c12e98c6890a5efdd4abe95a36b9004e0d83fe74 | [
"BSD-2-Clause"
] | null | null | null | cidd/run-cidd-in-docker.py | NCAR/lrose-displays | c12e98c6890a5efdd4abe95a36b9004e0d83fe74 | [
"BSD-2-Clause"
] | 2 | 2021-07-02T06:20:59.000Z | 2022-01-28T06:23:58.000Z | #!/usr/bin/env python
#===========================================================================
#
# Run CIDD in docker. Wrapper script.
#
# This script performs the following steps:
#
# 1. clone lrose-core from git
# 2. clone lrose-netcdf from git
# 3. setup autoconf Makefile.am files
# 4. run configure to ... | 31.413613 | 294 | 0.543667 |
from __future__ import print_function
import os
import sys
from sys import platform
import shutil
import subprocess
from optparse import OptionParser
import time
from datetime import datetime
from datetime import date
from datetime import timedelta
def main():
global options
thisS... | true | true |
1c333b08d4042cb9cf835653ded7ce018942773f | 154 | py | Python | src/python-village/ini4-conditions-and-loops.py | spencerking/rosalind | 66c50378813abf7b9cc535a963aeb9249d8a3ed7 | [
"BSD-3-Clause"
] | null | null | null | src/python-village/ini4-conditions-and-loops.py | spencerking/rosalind | 66c50378813abf7b9cc535a963aeb9249d8a3ed7 | [
"BSD-3-Clause"
] | null | null | null | src/python-village/ini4-conditions-and-loops.py | spencerking/rosalind | 66c50378813abf7b9cc535a963aeb9249d8a3ed7 | [
"BSD-3-Clause"
] | null | null | null | def main(a, b):
result = 0
for i in range(a, b+1):
if i % 2 != 0:
result += i
return result
print(main(4862, 9002))
| 15.4 | 27 | 0.461039 | def main(a, b):
result = 0
for i in range(a, b+1):
if i % 2 != 0:
result += i
return result
print(main(4862, 9002))
| true | true |
1c333c5a0e8d89b3154871874c0ce9f7c532675b | 13,510 | py | Python | discordSuperUtils/base.py | StawaDev/discord-super-utils | 2734700c82dba1ed28131535d86b5a0b260ac824 | [
"MIT"
] | null | null | null | discordSuperUtils/base.py | StawaDev/discord-super-utils | 2734700c82dba1ed28131535d86b5a0b260ac824 | [
"MIT"
] | null | null | null | discordSuperUtils/base.py | StawaDev/discord-super-utils | 2734700c82dba1ed28131535d86b5a0b260ac824 | [
"MIT"
] | null | null | null | from __future__ import annotations
import asyncio
import dataclasses
import inspect
import logging
from dataclasses import dataclass
from typing import (
List,
Any,
Iterable,
Optional,
TYPE_CHECKING,
Union,
Tuple,
Callable,
Dict,
Coroutine,
)
import aiomysql
try:
import ai... | 27.237903 | 117 | 0.623316 | from __future__ import annotations
import asyncio
import dataclasses
import inspect
import logging
from dataclasses import dataclass
from typing import (
List,
Any,
Iterable,
Optional,
TYPE_CHECKING,
Union,
Tuple,
Callable,
Dict,
Coroutine,
)
import aiomysql
try:
import ai... | true | true |
1c333c80bcf6e629732d06ee24c7f63afee6c56e | 1,861 | py | Python | soundrts/res.py | Finnboy94/soundrts | 284ffe2c507f4c9e44b4e5fa8c4ef05b6614c6c6 | [
"BSD-3-Clause"
] | 23 | 2015-04-02T16:54:08.000Z | 2022-03-02T09:48:04.000Z | soundrts/res.py | Finnboy94/soundrts | 284ffe2c507f4c9e44b4e5fa8c4ef05b6614c6c6 | [
"BSD-3-Clause"
] | 94 | 2015-03-25T21:05:45.000Z | 2021-12-22T20:05:42.000Z | soundrts/res.py | TifloDev/soundrts | 209695ed80b8746facdcb35f446f0f855c48da84 | [
"BSD-3-Clause"
] | 33 | 2015-05-27T05:53:14.000Z | 2021-12-08T02:45:44.000Z | """SoundRTS resource manager"""
import os
from . import config, options
from .lib.resource import ResourceLoader
from .paths import MAPS_PATHS
def get_all_packages_paths():
"""return the default "maps and mods" paths followed by the paths of the active packages"""
return MAPS_PATHS # + package_manager.get_... | 23.556962 | 95 | 0.699624 |
import os
from . import config, options
from .lib.resource import ResourceLoader
from .paths import MAPS_PATHS
def get_all_packages_paths():
return MAPS_PATHS
if options.mods is not None:
mods = options.mods
else:
mods = config.mods
_r = ResourceLoader(mods, config.soundpacks, get_all_packages_paths... | true | true |
1c333d0051d4c4cf7ff7cd86bb2a6b0e789d47e6 | 3,434 | py | Python | DataModelling_PostgreSQL/etl.py | RammySekham/Data-Engineering | eec1020defe9c54403f6a80ba91fc071ed22b727 | [
"MIT"
] | 1 | 2021-06-08T15:49:50.000Z | 2021-06-08T15:49:50.000Z | DataModelling_PostgreSQL/etl.py | RammySekham/Data-Engineering | eec1020defe9c54403f6a80ba91fc071ed22b727 | [
"MIT"
] | null | null | null | DataModelling_PostgreSQL/etl.py | RammySekham/Data-Engineering | eec1020defe9c54403f6a80ba91fc071ed22b727 | [
"MIT"
] | null | null | null | import os
import glob
import psycopg2
import pandas as pd
import settings
from sql_queries import *
def process_song_file(cur, filepath):
"""
process the json song file to insert song record into SQL table
"""
# open song file
df = pd.read_json(filepath, lines=True)
# insert song record
... | 31.218182 | 151 | 0.647059 | import os
import glob
import psycopg2
import pandas as pd
import settings
from sql_queries import *
def process_song_file(cur, filepath):
df = pd.read_json(filepath, lines=True)
song_data = df[['song_id', 'title', 'artist_id', 'year', 'duration']].values[0]
cur.execute(song_table_insert, s... | true | true |
1c333e6fb73118b48b9d8dd4e0ef09d56c4dbb63 | 470 | py | Python | bin/rehex.py | HashRentalCoin/sentinel | f8ddd4682a485c10f151968e130123597994b2fb | [
"MIT"
] | null | null | null | bin/rehex.py | HashRentalCoin/sentinel | f8ddd4682a485c10f151968e130123597994b2fb | [
"MIT"
] | null | null | null | bin/rehex.py | HashRentalCoin/sentinel | f8ddd4682a485c10f151968e130123597994b2fb | [
"MIT"
] | null | null | null | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import hashrentalcoinlib
# ============================================================================
usage = "%s <hex>" % sys.arg... | 21.363636 | 84 | 0.6 | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import hashrentalcoinlib
usage = "%s <hex>" % sys.argv[0]
obj = None
if len(sys.argv) < 2:
print(usage)
sys.exit(1)
else:
... | true | true |
1c333f90187e1951964e824ce8ea4d592a06fada | 8,791 | py | Python | vim/autoload/conque_term/conque_sole_wrapper.py | adifinem/dotvim | 73d1acc3cfa457ad3790a5b4612dc7479d6a7019 | [
"0BSD"
] | 413 | 2015-01-27T04:34:18.000Z | 2019-05-15T07:37:18.000Z | home/.vim/autoload/conque_term/conque_sole_wrapper.py | khilnani/dot_files | 6f8d40e5137e9c207023aff5e540c1ff3c00cff3 | [
"MIT"
] | 11 | 2015-03-03T08:34:44.000Z | 2018-09-22T22:18:55.000Z | home/.vim/autoload/conque_term/conque_sole_wrapper.py | khilnani/dot_files | 6f8d40e5137e9c207023aff5e540c1ff3c00cff3 | [
"MIT"
] | 107 | 2015-05-29T02:27:34.000Z | 2019-05-03T22:58:47.000Z | # FILE: autoload/conque_term/conque_sole_wrapper.py
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
# WEBSITE: http://conque.googlecode.com
# MODIFIED: 2011-09-02
# VERSION: 2.3, for Vim 7.0
# LICENSE:
# Conque - Vim terminal/console emulator
# Copyright (C) 2009-2011 Nico Raffo
#
# MIT License
#
# Permission is he... | 31.508961 | 204 | 0.639859 |
import ctypes
import time
class ConqueSoleWrapper():
shm_key = ''
handle = None
pid = None
bucket = None
lines = 24
columns = 80
shm_input = None
shm_output = None
shm_attributes = None
shm_stats = None
shm_command... | true | true |
1c334168306f7a6a86168569011754df1514469c | 7,674 | py | Python | cloudcafe/auth/provider.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/auth/provider.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/auth/provider.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | """
Copyright 2013 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 40.603175 | 79 | 0.68061 | from cafe.drivers.unittest.decorators import memoized
from cloudcafe.auth.config import UserAuthConfig, UserConfig
from cloudcafe.extensions.rax_auth.v2_0.tokens_api.client import \
TokenAPI_Client as RaxTokenAPI_Client, \
MFA_TokenAPI_Client as RaxToken_MFA_API_Client
from cloudcafe.extensions.rax_auth.v2_0.t... | true | true |
1c3342a0fa5ffa4a0acc71147447042416e8f56a | 6,635 | py | Python | tests/integration/output/test_output.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | tests/integration/output/test_output.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/output/test_output.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: Nicole Thomas <nicole@saltstack.com>
'''
# Import Salt Libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import traceback
# Import Salt Testing Libs
from tests.support.case import ShellCase
from tests.support.mixins import RUNTIME_VARS... | 36.059783 | 92 | 0.592766 |
from __future__ import absolute_import, print_function, unicode_literals
import os
import traceback
from tests.support.case import ShellCase
from tests.support.mixins import RUNTIME_VARS
import salt.config
import salt.utils.yaml
from salt.output import display_output
from salt.ext import six
class OutputReturn... | true | true |
1c3344b206e7fa14a4a0cf6e031ac64c55973a92 | 1,753 | py | Python | electrum_mona/gui/qt/qrwindow.py | zcore-dev/electrum-mona | 2beb0c9c7794e8b03d1725bae41ee8b792c57275 | [
"MIT"
] | null | null | null | electrum_mona/gui/qt/qrwindow.py | zcore-dev/electrum-mona | 2beb0c9c7794e8b03d1725bae41ee8b792c57275 | [
"MIT"
] | null | null | null | electrum_mona/gui/qt/qrwindow.py | zcore-dev/electrum-mona | 2beb0c9c7794e8b03d1725bae41ee8b792c57275 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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... | 38.108696 | 71 | 0.725613 |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QHBoxLayout, QWidget
from .qrcodewidget import QRCodeWidget
from electrum_mona.i18n import _
class QR_Window(QWidget):
def __init__(self, win):
QWidget.__init__(self)
self.win = win
self.setWi... | true | true |
1c3344d6bd423d534da455d71038b44401ebed57 | 3,849 | py | Python | transfer_learn_model.py | MauriceKarrenbrock/reinvent-memory | 57860dabb6534daf14fe2ab81d57589a90760442 | [
"MIT"
] | null | null | null | transfer_learn_model.py | MauriceKarrenbrock/reinvent-memory | 57860dabb6534daf14fe2ab81d57589a90760442 | [
"MIT"
] | null | null | null | transfer_learn_model.py | MauriceKarrenbrock/reinvent-memory | 57860dabb6534daf14fe2ab81d57589a90760442 | [
"MIT"
] | null | null | null | # coding=utf-8
import argparse
import logging
from typing import List
import numpy as np
import torch
from rdkit import Chem
from rdkit import rdBase
from torch.utils.data import DataLoader
from tqdm import tqdm
import models.reinvent
from chem import smiles
from models.reinvent.dataset import Dataset
from utils imp... | 43.738636 | 116 | 0.637049 |
import argparse
import logging
from typing import List
import numpy as np
import torch
from rdkit import Chem
from rdkit import rdBase
from torch.utils.data import DataLoader
from tqdm import tqdm
import models.reinvent
from chem import smiles
from models.reinvent.dataset import Dataset
from utils import decrease_l... | true | true |
1c3346169c6bab4811d070c2ac8b31e6fa4fdb84 | 24,960 | py | Python | python/tvm/testing.py | dvhg/tvm | 288e9ef41d7884cea3d868d6d2bbb672c058757b | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 90 | 2019-01-26T00:38:49.000Z | 2022-03-11T23:12:34.000Z | python/tvm/testing.py | dvhg/tvm | 288e9ef41d7884cea3d868d6d2bbb672c058757b | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 91 | 2019-02-27T00:17:01.000Z | 2022-02-21T18:08:21.000Z | python/tvm/testing.py | dvhg/tvm | 288e9ef41d7884cea3d868d6d2bbb672c058757b | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 41 | 2019-01-28T14:37:03.000Z | 2022-03-31T03:58:57.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... | 32.206452 | 97 | 0.626282 |
import logging
import os
import sys
import time
import pytest
import numpy as np
import tvm
import tvm.arith
import tvm.tir
import tvm.te
import tvm._ffi
from tvm.contrib import nvcc
def assert_allclose(actual, desired, rtol=1e-7, atol=1e-7):
actual = np.asanyarray(actual)
desired = np.asany... | true | true |
1c3346bb5441b4ef67bd9069e53e3e12aee53d3a | 411 | py | Python | experiments/fdtd-2d/tmp_files/4665.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/4665.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/4665.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/4665.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
t... | 22.833333 | 116 | 0.720195 | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/4665.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
t... | true | true |
1c3347874c5ab5358cfcfa85a11e8a42aa32e186 | 1,991 | py | Python | src/robot/libdocpkg/model.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2016-01-13T13:48:28.000Z | 2021-09-05T07:14:07.000Z | src/robot/libdocpkg/model.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/libdocpkg/model.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2018-01-18T22:00:17.000Z | 2018-07-26T10:53:00.000Z | # Copyright 2008-2014 Nokia Solutions and Networks
#
# 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... | 28.855072 | 75 | 0.641888 |
from __future__ import with_statement
from robot.utils import setter
from .writer import LibdocWriter
from .output import LibdocOutput
class LibraryDoc(object):
def __init__(self, name='', doc='', version='', type='library',
scope='', named_args=True, doc_format=''):
self... | true | true |
1c3347b8d7b003cb8c724ccfeb706a04aa53091d | 728 | py | Python | bashfuscator/modules/compressors/gzip.py | 0xflotus/Bashfuscator | 0615a061336641165d5055b916e81e6db8e3a5a6 | [
"MIT"
] | 859 | 2018-08-07T02:06:01.000Z | 2022-03-24T10:00:13.000Z | bashfuscator/modules/compressors/gzip.py | 0xflotus/Bashfuscator | 0615a061336641165d5055b916e81e6db8e3a5a6 | [
"MIT"
] | 25 | 2018-09-13T19:30:17.000Z | 2022-01-05T17:53:35.000Z | bashfuscator/modules/compressors/gzip.py | 0xflotus/Bashfuscator | 0615a061336641165d5055b916e81e6db8e3a5a6 | [
"MIT"
] | 123 | 2018-08-11T02:48:36.000Z | 2022-03-30T13:46:57.000Z | import gzip
from base64 import b64encode
from bashfuscator.core.mutators.compressor import Compressor
class Gzip(Compressor):
def __init__(self):
super().__init__(
name="Gzip",
description="Compress command with gzip",
sizeRating=3,
timeRating=3,
... | 30.333333 | 118 | 0.605769 | import gzip
from base64 import b64encode
from bashfuscator.core.mutators.compressor import Compressor
class Gzip(Compressor):
def __init__(self):
super().__init__(
name="Gzip",
description="Compress command with gzip",
sizeRating=3,
timeRating=3,
... | true | true |
1c3347f5caa6ecc7a8129ca79f55c18637f4c7d9 | 1,055 | py | Python | scripts/AssetChecker/src/checker/main/main.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | 8 | 2018-07-18T17:49:41.000Z | 2022-03-17T01:30:44.000Z | scripts/AssetChecker/src/checker/main/main.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | null | null | null | scripts/AssetChecker/src/checker/main/main.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | 1 | 2018-09-05T07:11:25.000Z | 2018-09-05T07:11:25.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 8 15:20:09 2017
@author: hpy2
"""
import requests
import json
import hashlib
from pyfiglet import Figlet
def main(filepath, trialchainip):
url = "http://{0}:9000/trialchain/data_asset".format(trialchainip)
with open(filepath, 'rb') as f:
data = f.read()... | 28.513514 | 76 | 0.603791 |
import requests
import json
import hashlib
from pyfiglet import Figlet
def main(filepath, trialchainip):
url = "http://{0}:9000/trialchain/data_asset".format(trialchainip)
with open(filepath, 'rb') as f:
data = f.read()
hasher = hashlib.md5()
hasher.update(data)
md5 = hasher.h... | true | true |
1c334a270215b12a5f4c0f304d453d9b7a73eb97 | 4,204 | py | Python | PugHelpBot/cogs/channel_clean.py | ZusorCode/PugHelpBot | 162904676bd9e876b2f69b3d3a299e3267ab8828 | [
"MIT"
] | null | null | null | PugHelpBot/cogs/channel_clean.py | ZusorCode/PugHelpBot | 162904676bd9e876b2f69b3d3a299e3267ab8828 | [
"MIT"
] | 1 | 2019-06-26T23:07:09.000Z | 2019-06-26T23:07:09.000Z | PugHelpBot/cogs/channel_clean.py | ZusorCode/PugHelpBot | 162904676bd9e876b2f69b3d3a299e3267ab8828 | [
"MIT"
] | 1 | 2019-06-24T18:41:15.000Z | 2019-06-24T18:41:15.000Z | from ..helpers import Config, get_unique_message_react_users, PingStatus, send_ping
from datetime import datetime, timedelta
import logging
import discord
from discord.ext import commands, tasks
class ChannelClean(commands.Cog):
def __init__(self, bot: commands.Bot, log: logging.Logger, config: Config, ping_statu... | 50.650602 | 134 | 0.624167 | from ..helpers import Config, get_unique_message_react_users, PingStatus, send_ping
from datetime import datetime, timedelta
import logging
import discord
from discord.ext import commands, tasks
class ChannelClean(commands.Cog):
def __init__(self, bot: commands.Bot, log: logging.Logger, config: Config, ping_statu... | true | true |
1c334ab0b122af4b812c8f5d28e1a70012bb04b0 | 4,175 | py | Python | test/functional/onix_ignore_mpos_participant_reward.py | onixcoin-io/onix | 37c158a6229fa98c1a86f8b65e91226e36355fd6 | [
"MIT"
] | 6 | 2021-10-31T04:53:09.000Z | 2021-12-16T08:27:06.000Z | test/functional/onix_ignore_mpos_participant_reward.py | onixcoin-io/onix | 37c158a6229fa98c1a86f8b65e91226e36355fd6 | [
"MIT"
] | 1 | 2021-11-29T08:45:38.000Z | 2021-11-29T08:45:38.000Z | test/functional/onix_ignore_mpos_participant_reward.py | onixcoin-io/onix | 37c158a6229fa98c1a86f8b65e91226e36355fd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.onix import *
import sys
import random
import time
class OnixIgnore... | 42.602041 | 183 | 0.692216 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.onix import *
import sys
import random
import time
class OnixIgnoreMPOSParticipantRewardT... | true | true |
1c334b8aca67275b6a7e930a5e216179e7a52f1a | 11,187 | py | Python | fanficfare/adapters/adapter_wwwnovelallcom.py | trishume/FanFicFare | 2ddce1acd5258f8dae5b3860aec1c9643a7a0807 | [
"Apache-2.0"
] | 3 | 2020-11-10T16:43:43.000Z | 2021-04-09T07:12:31.000Z | fanficfare/adapters/adapter_wwwnovelallcom.py | trishume/FanFicFare | 2ddce1acd5258f8dae5b3860aec1c9643a7a0807 | [
"Apache-2.0"
] | null | null | null | fanficfare/adapters/adapter_wwwnovelallcom.py | trishume/FanFicFare | 2ddce1acd5258f8dae5b3860aec1c9643a7a0807 | [
"Apache-2.0"
] | 1 | 2021-04-08T12:25:09.000Z | 2021-04-08T12:25:09.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 FanFicFare team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 41.587361 | 173 | 0.567802 | true | true | |
1c334bdcd8d7ccf5ba0f8893842db5d53af4e545 | 1,996 | py | Python | LIEGE/database/table.py | seucs/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | 4 | 2018-03-07T07:59:58.000Z | 2019-10-19T09:31:44.000Z | TabEL/database/table.py | acmom/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | null | null | null | TabEL/database/table.py | acmom/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | 2 | 2018-11-05T16:09:07.000Z | 2019-11-07T00:22:37.000Z | #coding=utf8
import xlrd
import xlwt
import json
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class Table:
def __init__(self, table, row_num, col_num):
self.table = table
self.row_num = row_num
self.col_num = col_num
def __getitem__(self, i):
return self.table[i]
d... | 24.048193 | 62 | 0.43988 |
import xlrd
import xlwt
import json
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class Table:
def __init__(self, table, row_num, col_num):
self.table = table
self.row_num = row_num
self.col_num = col_num
def __getitem__(self, i):
return self.table[i]
def getMentio... | true | true |
1c334c43ec9647ed0e0ec846ea0ec8b0f1abcbfa | 1,332 | py | Python | movefiles.py | linhailan/JPG-PNG-to-MNIST-NN-Format | c2ff84cb8d2dc6cd49c4d462b4d8ea2ba4620719 | [
"Apache-2.0"
] | null | null | null | movefiles.py | linhailan/JPG-PNG-to-MNIST-NN-Format | c2ff84cb8d2dc6cd49c4d462b4d8ea2ba4620719 | [
"Apache-2.0"
] | null | null | null | movefiles.py | linhailan/JPG-PNG-to-MNIST-NN-Format | c2ff84cb8d2dc6cd49c4d462b4d8ea2ba4620719 | [
"Apache-2.0"
] | null | null | null | import os
from PIL import Image
from array import *
from random import shuffle
import shutil
def move_file(src_path, dst_path, file):
print("from : ",src_path)
print("to : ",dst_path)
try:
# cmd = 'chmod -R +x ' + src_path
# os.popen(cmd)
f_src = os.path.join(src_path, file)
... | 25.615385 | 65 | 0.553303 | import os
from PIL import Image
from array import *
from random import shuffle
import shutil
def move_file(src_path, dst_path, file):
print("from : ",src_path)
print("to : ",dst_path)
try:
f_src = os.path.join(src_path, file)
if not os.path.exists(dst_path):
... | true | true |
1c334c7a02aa7230afa09f3c7b5da4b74c2bc05b | 1,748 | py | Python | acunetix/v11/db/tables/vuln_types.py | BenDerPan/DScaner | 1552b1877185c08b0db3c48da4e5c3c601c49ce0 | [
"MIT"
] | 20 | 2017-11-09T01:47:56.000Z | 2021-03-08T07:08:10.000Z | acunetix/v11/db/tables/vuln_types.py | BenDerPan/DScaner | 1552b1877185c08b0db3c48da4e5c3c601c49ce0 | [
"MIT"
] | null | null | null | acunetix/v11/db/tables/vuln_types.py | BenDerPan/DScaner | 1552b1877185c08b0db3c48da4e5c3c601c49ce0 | [
"MIT"
] | 6 | 2017-11-09T01:48:01.000Z | 2020-04-06T11:57:05.000Z | # uncompyle6 version 2.13.2
# Python bytecode 3.5 (3351)
# Decompiled from: Python 3.5.3 (default, Jan 19 2017, 14:11:04)
# [GCC 6.3.0 20170118]
# Embedded file name: db\tables\vuln_types.py
__author__ = 'sanyi'
from sqlalchemy import *
from sqlalchemy.orm import mapper
from sqlalchemy.dialects.postgresql import UUID ... | 46 | 582 | 0.699657 |
__author__ = 'sanyi'
from sqlalchemy import *
from sqlalchemy.orm import mapper
from sqlalchemy.dialects.postgresql import UUID as C_UUID
from sqlalchemy.dialects.postgresql import ARRAY as C_ARRAY
from .tables import metadata
sensor_details_template = '{{#file}}<p>Source file: <strong class="bb-dark">{{file}}</st... | true | true |
1c334cd6809fae5b8cf2760630ff5474a4bc0f6b | 7,348 | py | Python | prepare.py | obitto/relation-network | 2cbea587c9d43d6e02dba8ddd79e9ae18eca5356 | [
"MIT"
] | null | null | null | prepare.py | obitto/relation-network | 2cbea587c9d43d6e02dba8ddd79e9ae18eca5356 | [
"MIT"
] | null | null | null | prepare.py | obitto/relation-network | 2cbea587c9d43d6e02dba8ddd79e9ae18eca5356 | [
"MIT"
] | null | null | null | import numpy as np
import json
from nltk.tokenize import word_tokenize
from PIL import Image
import os
import h5py
from random import shuffle
class ClevrDataset(object):
"""
This is the dataset for clevr task.
"""
def __init__(self, config, dataset_name = 'train' , shuffle = False, load_vocab = False):
if data... | 30.87395 | 174 | 0.664807 | import numpy as np
import json
from nltk.tokenize import word_tokenize
from PIL import Image
import os
import h5py
from random import shuffle
class ClevrDataset(object):
def __init__(self, config, dataset_name = 'train' , shuffle = False, load_vocab = False):
if dataset_name == 'train':
self.question_path = 'd... | true | true |
1c334ddc98738db0e05cabf20e610f1a0a62f889 | 21,417 | py | Python | train.py | kyuhyoung/yolact | 98fc78e963264d2ec18cf1b85de7a328abcd6e96 | [
"MIT"
] | 3 | 2020-09-29T00:04:00.000Z | 2021-06-23T07:54:57.000Z | train.py | kyuhyoung/yolact | 98fc78e963264d2ec18cf1b85de7a328abcd6e96 | [
"MIT"
] | 1 | 2020-08-19T16:35:26.000Z | 2020-08-19T17:22:07.000Z | train.py | kyuhyoung/yolact | 98fc78e963264d2ec18cf1b85de7a328abcd6e96 | [
"MIT"
] | 3 | 2020-03-11T17:03:03.000Z | 2021-07-11T02:56:19.000Z | from data import *
from utils.augmentations import SSDAugmentation, BaseTransform
from utils.functions import MovingAverage, SavePath
from utils.logger import Log
from utils import timer
from layers.modules import MultiBoxLoss
from yolact import Yolact
import os
import sys
import time
import math, random
from pathlib i... | 42.578529 | 196 | 0.608068 | from data import *
from utils.augmentations import SSDAugmentation, BaseTransform
from utils.functions import MovingAverage, SavePath
from utils.logger import Log
from utils import timer
from layers.modules import MultiBoxLoss
from yolact import Yolact
import os
import sys
import time
import math, random
from pathlib i... | true | true |
1c334e49a1724d0025acbd6ef5ed3baac910efb5 | 3,269 | py | Python | xfeltor/load.py | HenrikJantti/xFELTOR | 321fe73ce28fa590baedabc0aa13c5ba50a32dff | [
"MIT"
] | null | null | null | xfeltor/load.py | HenrikJantti/xFELTOR | 321fe73ce28fa590baedabc0aa13c5ba50a32dff | [
"MIT"
] | 1 | 2022-01-26T11:53:42.000Z | 2022-01-26T11:53:42.000Z | xfeltor/load.py | HenrikJantti/xFELTOR | 321fe73ce28fa590baedabc0aa13c5ba50a32dff | [
"MIT"
] | null | null | null | import xarray as xr
import numpy as np
from typing import Union
import json
def open_feltordataset(
datapath: str = "./*.nc",
chunks: Union[int, dict] = None,
restart_indices: bool = False,
probes: bool = False,
**kwargs: dict,
) -> xr.Dataset:
"""Loads FELTOR output into one xarray Dataset. C... | 33.701031 | 99 | 0.61762 | import xarray as xr
import numpy as np
from typing import Union
import json
def open_feltordataset(
datapath: str = "./*.nc",
chunks: Union[int, dict] = None,
restart_indices: bool = False,
probes: bool = False,
**kwargs: dict,
) -> xr.Dataset:
if chunks is None:
chunks = {}
combi... | true | true |
1c334fb05c5a8d5c3556b5f5c031aaf7ad9fdb70 | 14,472 | py | Python | flax/linen/normalization.py | AI-App/FLAX | 25dd368d9f35d276fe0999f9468c71a284eb3d96 | [
"Apache-2.0"
] | null | null | null | flax/linen/normalization.py | AI-App/FLAX | 25dd368d9f35d276fe0999f9468c71a284eb3d96 | [
"Apache-2.0"
] | 10 | 2022-01-19T11:32:54.000Z | 2022-02-09T23:47:20.000Z | flax/linen/normalization.py | slowy07/flax | fb4f2a455d4cae383f11d77707bf0d0f18a45e70 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 39.867769 | 100 | 0.6894 |
from typing import (Any, Callable, Optional, Tuple, Iterable, Union)
from jax import lax
from jax.nn import initializers
import jax.numpy as jnp
from flax.linen.module import Module, compact, merge_param
PRNGKey = Any
Array = Any
Shape = Tuple[int]
Dtype = Any
Axes = Union[int, Iterable[int]]
de... | true | true |
1c33502e4d76d3079ade89c8c30b3af81f805584 | 268 | py | Python | tests/artificial/transf_Difference/trend_ConstantTrend/cycle_5/ar_/test_artificial_32_Difference_ConstantTrend_5__20.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Difference/trend_ConstantTrend/cycle_5/ar_/test_artificial_32_Difference_ConstantTrend_5__20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Difference/trend_ConstantTrend/cycle_5/ar_/test_artificial_32_Difference_ConstantTrend_5__20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 5, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 0); | 38.285714 | 168 | 0.735075 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 5, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 0); | true | true |
1c3350aaa6a4bb05a67615451625477c84bb2507 | 3,667 | py | Python | repoman/depot_operations.py | jsoriano/python-repoman | 308c141ce7177238c70f78facf1fc2642cf485aa | [
"Apache-2.0"
] | 6 | 2015-08-10T09:42:55.000Z | 2021-11-08T10:26:02.000Z | repoman/depot_operations.py | jsoriano/python-repoman | 308c141ce7177238c70f78facf1fc2642cf485aa | [
"Apache-2.0"
] | 11 | 2017-08-28T17:38:24.000Z | 2019-05-31T12:49:31.000Z | repoman/depot_operations.py | jsoriano/python-repoman | 308c141ce7177238c70f78facf1fc2642cf485aa | [
"Apache-2.0"
] | 7 | 2015-02-14T16:15:41.000Z | 2021-09-29T09:53:26.000Z | #!/usr/bin/env python
#
# Copyright 2014 Tuenti Technologies S.L.
#
# 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... | 30.815126 | 77 | 0.641942 |
from repoman.depot import Depot
class DepotOperations(object):
KIND = None
@classmethod
def get_depot_operations(cls, repo_kind):
try:
mod = __import__("repoman.%s.depot_operations" % (repo_kind),
fromlist=['Depot... | true | true |
1c3350fd75ff2f1bea44df5b72d7e2556a0ee1e7 | 441 | py | Python | rest/recording/list-get-example-2/list-get-example-2.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2017-11-23T11:31:20.000Z | 2018-01-22T04:14:02.000Z | rest/recording/list-get-example-2/list-get-example-2.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/recording/list-get-example-2/list-get-example-2.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2020-05-22T23:31:21.000Z | 2021-06-10T18:33:45.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)
# A list... | 40.090909 | 72 | 0.823129 |
from twilio.rest import TwilioRestClient
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)
recordings = client.recordings.list(date_created="2016-10-18")
| true | true |
1c3351362491dc874ae6c3ccf9a6c1876506b1e8 | 4,730 | py | Python | docs/check_and_draw_box.py | alexchungio/under-water-detect | 312672ccbe5e31ca21dffab26e1438ea190f3e5a | [
"Apache-2.0"
] | 1 | 2022-02-17T12:14:59.000Z | 2022-02-17T12:14:59.000Z | docs/check_and_draw_box.py | alexchungio/under-water-object-detect-2020 | 312672ccbe5e31ca21dffab26e1438ea190f3e5a | [
"Apache-2.0"
] | null | null | null | docs/check_and_draw_box.py | alexchungio/under-water-object-detect-2020 | 312672ccbe5e31ca21dffab26e1438ea190f3e5a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------
# @ File : check_and_draw_box.py
# @ Description:
# @ Author : Alex Chung
# @ Contact : yonganzhong@outlook.com
# @ License : Copyright (c) 2017-2018
# @ Time : 2021/1/26 下午2:43
# @ Software :... | 35.56391 | 117 | 0.571247 |
import os
import json
import os.path as osp
import numpy as np
from PIL import Image, ImageFont, ImageDraw
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
from tqdm import tqdm
def draw_box_with_pil(image, bbox, label, color_dict):
img_w = image.size[0]
img_h = image.size[1]
... | true | true |
1c33516987ce24441f9b98964ec2c2675d908382 | 9,566 | py | Python | sunshine_conversations_client/model/message_webhook.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 4 | 2020-09-27T14:28:25.000Z | 2022-02-02T13:51:29.000Z | sunshine_conversations_client/model/message_webhook.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 3 | 2021-09-30T18:18:58.000Z | 2021-12-04T07:55:23.000Z | sunshine_conversations_client/model/message_webhook.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 5 | 2020-11-07T02:08:18.000Z | 2021-12-07T17:10:23.000Z | # coding: utf-8
"""
Sunshine Conversations API
The version of the OpenAPI document: 9.4.5
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefine... | 28.640719 | 203 | 0.589275 |
import pprint
import re
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefined import Undefined
class MessageWebhook(object):
openapi_types = {
'id': 'str',
'received': 'str',
'author': 'AuthorWebhook',
... | true | true |
1c33525922cd3446f90a3cac5e50b77916646871 | 497 | py | Python | app.py | KeisukeShima/streamlit-proj | a50c57a8f0effd484b4015fd1e027746c3b35647 | [
"MIT"
] | null | null | null | app.py | KeisukeShima/streamlit-proj | a50c57a8f0effd484b4015fd1e027746c3b35647 | [
"MIT"
] | null | null | null | app.py | KeisukeShima/streamlit-proj | a50c57a8f0effd484b4015fd1e027746c3b35647 | [
"MIT"
] | null | null | null | import streamlit as st
import plotly.graph_objs as go
animals = ['giraffes', 'orangutans', 'monkeys']
populations = [20, 14, 23]
fig = go.Figure(data=[go.Bar(x=animals, y=populations)])
fig.update_layout(
xaxis = dict(
tickangle = 0,
title_text = "Animal",
title_font = {"size": 20},
... | 23.666667 | 56 | 0.629779 | import streamlit as st
import plotly.graph_objs as go
animals = ['giraffes', 'orangutans', 'monkeys']
populations = [20, 14, 23]
fig = go.Figure(data=[go.Bar(x=animals, y=populations)])
fig.update_layout(
xaxis = dict(
tickangle = 0,
title_text = "Animal",
title_font = {"size": 20},
... | true | true |
1c33528d16e0c35d2c8c701db785ed705e8e572c | 26,364 | py | Python | src/sage/interfaces/lie.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 2 | 2021-08-20T00:30:35.000Z | 2021-11-17T10:54:00.000Z | src/sage/interfaces/lie.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/interfaces/lie.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | r"""
Interface to LiE
LiE is a software package under development at CWI since
January 1988. Its purpose is to enable mathematicians and
physicists to obtain on-line information as well as to
interactively perform computations of a Lie group theoretic
nature. It focuses on the representation theory of complex
semisi... | 29.196013 | 107 | 0.505765 | r"""
Interface to LiE
LiE is a software package under development at CWI since
January 1988. Its purpose is to enable mathematicians and
physicists to obtain on-line information as well as to
interactively perform computations of a Lie group theoretic
nature. It focuses on the representation theory of complex
semisi... | false | true |
1c3352f770946400356a22ead7df951cd76e504c | 7,267 | py | Python | stream_module.py | antofuller/configaformers | 293253cd35d96c8a24c4004ba3d24fc6dc85a260 | [
"Apache-2.0"
] | 51 | 2021-11-03T19:52:07.000Z | 2021-12-14T16:56:30.000Z | stream_module.py | muddyrains/muddy-nets | 293253cd35d96c8a24c4004ba3d24fc6dc85a260 | [
"Apache-2.0"
] | null | null | null | stream_module.py | muddyrains/muddy-nets | 293253cd35d96c8a24c4004ba3d24fc6dc85a260 | [
"Apache-2.0"
] | 2 | 2021-11-04T01:46:26.000Z | 2021-11-06T08:39:35.000Z | import torch
from torch import nn
from utils import set_default
class MakeStream(nn.Module):
def __init__(self,
config,
_streams,
):
super().__init__()
"""
Make data stream
"""
# Configure input(s) and output(s)
sel... | 36.70202 | 114 | 0.553874 | import torch
from torch import nn
from utils import set_default
class MakeStream(nn.Module):
def __init__(self,
config,
_streams,
):
super().__init__()
self.input_name = set_default(_look='input_name', _dict=config, _default='x')
... | true | true |
1c3353193d455c706d4e720bf2bc76ea6e47d636 | 10,765 | py | Python | 86833/tanks_test1.py | PlatovDmitriy/Tanks | 62e16e5da8325a1ca22f21a474f97afc682f546e | [
"CC0-1.0"
] | null | null | null | 86833/tanks_test1.py | PlatovDmitriy/Tanks | 62e16e5da8325a1ca22f21a474f97afc682f546e | [
"CC0-1.0"
] | null | null | null | 86833/tanks_test1.py | PlatovDmitriy/Tanks | 62e16e5da8325a1ca22f21a474f97afc682f546e | [
"CC0-1.0"
] | null | null | null | from pygame import *
from time import time as timer
x = 10
y = 10
x1 = 500
y1 = 500
font.init()
font1 = font.SysFont('Arial',36)
BLACK = (0,0,0)
class GameSprite(sprite.Sprite):
def __init__(self, player_image, player_x, player_y, x_speed, y_speed):
super().__init__()
self.image = transf... | 32.621212 | 76 | 0.51203 | from pygame import *
from time import time as timer
x = 10
y = 10
x1 = 500
y1 = 500
font.init()
font1 = font.SysFont('Arial',36)
BLACK = (0,0,0)
class GameSprite(sprite.Sprite):
def __init__(self, player_image, player_x, player_y, x_speed, y_speed):
super().__init__()
self.image = transf... | true | true |
1c33537ae776c160f9b195b1dab219707c8ed94d | 2,241 | py | Python | code/timeitme.py | mathemage/TheMulQuaBio | 63a0ad6803e2aa1b808bc4517009c18a8c190b4c | [
"MIT"
] | 1 | 2019-10-12T13:33:14.000Z | 2019-10-12T13:33:14.000Z | code/timeitme.py | OScott19/TheMulQuaBio | 197d710f76163469dfc7fa9d2d95ba3a739eccc7 | [
"MIT"
] | null | null | null | code/timeitme.py | OScott19/TheMulQuaBio | 197d710f76163469dfc7fa9d2d95ba3a739eccc7 | [
"MIT"
] | null | null | null | ##############################################################################
# range vs. xrange.
##############################################################################
import time
import timeit
def a_not_useful_function():
y = 0
for i in range(100000):
y = y + i
return 0
def a_less_usele... | 23.34375 | 79 | 0.464525 | false | true | |
1c33540ebf27a45236b9d7996d28384d42f3ce87 | 350 | py | Python | examples/cli_examples/set_sort_groups_by_shank.py | LorenFrankLab/SpyGlass | 5c2764b6ba5f7e9e47ddad5d2b9ce5039a0d3f41 | [
"MIT"
] | 1 | 2022-03-22T12:13:18.000Z | 2022-03-22T12:13:18.000Z | examples/cli_examples/set_sort_groups_by_shank.py | LorenFrankLab/SpyGlass | 5c2764b6ba5f7e9e47ddad5d2b9ce5039a0d3f41 | [
"MIT"
] | 17 | 2022-03-22T14:42:04.000Z | 2022-03-31T23:58:39.000Z | examples/cli_examples/set_sort_groups_by_shank.py | LorenFrankLab/SpyGlass | 5c2764b6ba5f7e9e47ddad5d2b9ce5039a0d3f41 | [
"MIT"
] | 1 | 2022-03-23T20:04:25.000Z | 2022-03-23T20:04:25.000Z | #!/usr/bin/env python3
import spyglass.common as sgc
nwb_file_name = 'RN2_20191110_.nwb'
sgc.SortGroup().set_group_by_shank(
nwb_file_name=nwb_file_name,
references=None,
omit_ref_electrode_group=False
)
print(sgc.SortGroup & {'nwb_file_name': nwb_file_name})
print(sgc.SortGroup.SortGroupElectrode & {'n... | 25 | 74 | 0.78 |
import spyglass.common as sgc
nwb_file_name = 'RN2_20191110_.nwb'
sgc.SortGroup().set_group_by_shank(
nwb_file_name=nwb_file_name,
references=None,
omit_ref_electrode_group=False
)
print(sgc.SortGroup & {'nwb_file_name': nwb_file_name})
print(sgc.SortGroup.SortGroupElectrode & {'nwb_file_name': nwb_fil... | true | true |
1c3354f45e59b7e88ce6f4d0e8f69626393a1065 | 1,888 | py | Python | mmdet/datasets/pipelines/__init__.py | HT-hlf/mmdetection_miner-2.22.0 | 76eb94d6547f9f95cd58f41bb5c91941e82322b9 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/pipelines/__init__.py | HT-hlf/mmdetection_miner-2.22.0 | 76eb94d6547f9f95cd58f41bb5c91941e82322b9 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/pipelines/__init__.py | HT-hlf/mmdetection_miner-2.22.0 | 76eb94d6547f9f95cd58f41bb5c91941e82322b9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .auto_augment import (AutoAugment, BrightnessTransform, ColorTransform,
ContrastTransform, EqualizeTransform, Rotate, Shear,
Translate)
from .compose import Compose
from .formatting import (Collect, DefaultFormatB... | 62.933333 | 130 | 0.711864 |
from .auto_augment import (AutoAugment, BrightnessTransform, ColorTransform,
ContrastTransform, EqualizeTransform, Rotate, Shear,
Translate)
from .compose import Compose
from .formatting import (Collect, DefaultFormatBundle, ImageToTensor,
... | true | true |
1c33550df5289d9baea0397f15634c63d4cc3235 | 22,474 | py | Python | sympy/functions/elementary/tests/test_complexes.py | pbrady/sympy | 7163137e22fbefbb645147a15147b26dad220d49 | [
"BSD-3-Clause"
] | 1 | 2019-06-27T13:40:28.000Z | 2019-06-27T13:40:28.000Z | sympy/functions/elementary/tests/test_complexes.py | amitsaha/sympy | 43ddfc644fd604a3dc0d4cac0aebfecd051917c1 | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/elementary/tests/test_complexes.py | amitsaha/sympy | 43ddfc644fd604a3dc0d4cac0aebfecd051917c1 | [
"BSD-3-Clause"
] | null | null | null | from sympy import (
Abs, adjoint, arg, atan2, conjugate, cos, DiracDelta, E, exp, expand,
Expr, Function, Heaviside, I, im, log, nan, oo, pi, Rational, re, S,
sign, sin, sqrt, Symbol, symbols, transpose, zoo, exp_polar, Piecewise,
Interval, comp
)
from sympy.utilities.pytest import XFAIL, raises
def N... | 31.300836 | 79 | 0.581249 | from sympy import (
Abs, adjoint, arg, atan2, conjugate, cos, DiracDelta, E, exp, expand,
Expr, Function, Heaviside, I, im, log, nan, oo, pi, Rational, re, S,
sign, sin, sqrt, Symbol, symbols, transpose, zoo, exp_polar, Piecewise,
Interval, comp
)
from sympy.utilities.pytest import XFAIL, raises
def N... | true | true |
1c33561b46f8ec90a73d5b7fa4f7967740fc7fcc | 1,509 | py | Python | autorest/python/emsapi/models/adi_ems_web_api_v2_dto_parameter_set_parameter_set_group.py | ge-flight-analytics/ems-api-wrappers | 5e787e0cbc72e7a3b06fa83ff6ba07968231f89c | [
"MIT"
] | 2 | 2017-02-20T18:32:02.000Z | 2018-08-01T11:45:29.000Z | autorest/python/emsapi/models/adi_ems_web_api_v2_dto_parameter_set_parameter_set_group.py | ge-flight-analytics/ems-api-wrappers | 5e787e0cbc72e7a3b06fa83ff6ba07968231f89c | [
"MIT"
] | 10 | 2017-02-20T16:17:04.000Z | 2019-04-02T16:52:49.000Z | autorest/python/emsapi/models/adi_ems_web_api_v2_dto_parameter_set_parameter_set_group.py | ge-flight-analytics/ems-api-wrappers | 5e787e0cbc72e7a3b06fa83ff6ba07968231f89c | [
"MIT"
] | 2 | 2017-02-18T23:22:20.000Z | 2017-02-20T19:35:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 39.710526 | 96 | 0.617628 |
from msrest.serialization import Model
class AdiEmsWebApiV2DtoParameterSetParameterSetGroup(Model):
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'group_id': {'key': 'groupId', 'type': 'str'},
'groups': {'key': 'groups', 'type': '[AdiEmsWebApiV2DtoParameterSetParameter... | true | true |
1c3356481cbd526a3b1e27b3157fe0a9488be0bf | 7,356 | py | Python | lib/streamlit/elements/multiselect.py | AnOctopus/streamlit | 6c5384f62c1415538347fa751185e5c487673f82 | [
"Apache-2.0"
] | 19,099 | 2019-08-25T14:00:15.000Z | 2022-03-31T21:00:28.000Z | lib/streamlit/elements/multiselect.py | AnOctopus/streamlit | 6c5384f62c1415538347fa751185e5c487673f82 | [
"Apache-2.0"
] | 3,078 | 2019-08-25T19:50:14.000Z | 2022-03-31T23:26:14.000Z | lib/streamlit/elements/multiselect.py | AnOctopus/streamlit | 6c5384f62c1415538347fa751185e5c487673f82 | [
"Apache-2.0"
] | 1,892 | 2019-08-26T04:44:24.000Z | 2022-03-30T16:11:51.000Z | # Copyright 2018-2021 Streamlit 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 law or agreed to in wr... | 40.640884 | 111 | 0.635943 |
from textwrap import dedent
from typing import Any, Callable, Optional, cast, List
import streamlit
from streamlit.errors import StreamlitAPIException
from streamlit.proto.MultiSelect_pb2 import MultiSelect as MultiSelectProto
from streamlit.state.widgets import register_widget
from streamlit.type_util i... | true | true |
1c33566bd3a34dff0c3f58954874dafac386d95b | 9,622 | py | Python | dask_ml/linear_model/glm.py | laprej/dask-ml | 78b1d942eae14db442a744f8812c3e94a8f31272 | [
"BSD-3-Clause"
] | 3 | 2017-06-13T22:36:45.000Z | 2017-09-20T16:08:47.000Z | dask_ml/linear_model/glm.py | laprej/dask-ml | 78b1d942eae14db442a744f8812c3e94a8f31272 | [
"BSD-3-Clause"
] | null | null | null | dask_ml/linear_model/glm.py | laprej/dask-ml | 78b1d942eae14db442a744f8812c3e94a8f31272 | [
"BSD-3-Clause"
] | 1 | 2019-12-03T13:23:52.000Z | 2019-12-03T13:23:52.000Z | # -*- coding: utf-8 -*-
"""Generalized Linear Models for large datasets."""
import textwrap
from dask_glm import algorithms, families
from dask_glm.utils import (accuracy_score, add_intercept, dot, exp,
mean_squared_error, poisson_deviance, sigmoid)
from sklearn.base import BaseEstimator
#... | 29.515337 | 79 | 0.568177 |
import textwrap
from dask_glm import algorithms, families
from dask_glm.utils import (accuracy_score, add_intercept, dot, exp,
mean_squared_error, poisson_deviance, sigmoid)
from sklearn.base import BaseEstimator
from . import utils
from ..utils import check_array
_base_doc = textwra... | true | true |
1c3357a25cce6c5948007ae0ef84e1c93beb4b30 | 697 | py | Python | fixture/application.py | VictorKazankov/Python_training_mantis | 02b85302079388e626a78e8289bfb979af3e7ed4 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | VictorKazankov/Python_training_mantis | 02b85302079388e626a78e8289bfb979af3e7ed4 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | VictorKazankov/Python_training_mantis | 02b85302079388e626a78e8289bfb979af3e7ed4 | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.firefox.webdriver import WebDriver
from fixture.session import SessionHelper
from fixture.project import ProjectHelper
from fixture.soap import SoapHelper
class Application:
def __init__(self):
self.wd = WebDriver()
self.wd.implicitly_wait(5)
self.session = SessionH... | 25.814815 | 58 | 0.642755 | from selenium.webdriver.firefox.webdriver import WebDriver
from fixture.session import SessionHelper
from fixture.project import ProjectHelper
from fixture.soap import SoapHelper
class Application:
def __init__(self):
self.wd = WebDriver()
self.wd.implicitly_wait(5)
self.session = SessionH... | true | true |
1c33584b6448febf032bed615847b0e83b564b17 | 6,610 | py | Python | mobula/build.py | mgno32/MobulaOP | a58c06216ee6768cf4c46610b802c8b96bf3240d | [
"MIT"
] | null | null | null | mobula/build.py | mgno32/MobulaOP | a58c06216ee6768cf4c46610b802c8b96bf3240d | [
"MIT"
] | null | null | null | mobula/build.py | mgno32/MobulaOP | a58c06216ee6768cf4c46610b802c8b96bf3240d | [
"MIT"
] | null | null | null | """Building Implementation"""
import sys
import multiprocessing
try:
from .build_utils import *
except Exception:
from build_utils import *
NUM_CPU_CORE = multiprocessing.cpu_count()
HOST_NUM_THREADS = config.HOST_NUM_THREADS if config.HOST_NUM_THREADS > 0 else NUM_CPU_CORE
COMMON_FLAGS = Flags().add_definitio... | 33.72449 | 117 | 0.663843 | import sys
import multiprocessing
try:
from .build_utils import *
except Exception:
from build_utils import *
NUM_CPU_CORE = multiprocessing.cpu_count()
HOST_NUM_THREADS = config.HOST_NUM_THREADS if config.HOST_NUM_THREADS > 0 else NUM_CPU_CORE
COMMON_FLAGS = Flags().add_definition('HOST_NUM_THREADS', HOST_NUM... | true | true |
1c33588cd2cfd239421257da498b156f986374d1 | 3,629 | py | Python | DeepLearningExamples/TensorFlow/Segmentation/UNet_Industrial/model/layers/array_ops.py | puririshi98/benchmark | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | [
"BSD-3-Clause"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | DeepLearningExamples/TensorFlow/Segmentation/UNet_Industrial/model/layers/array_ops.py | puririshi98/benchmark | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | [
"BSD-3-Clause"
] | 3 | 2021-03-31T20:15:40.000Z | 2022-02-09T23:50:46.000Z | built-in/TensorFlow/Official/cv/image_segmentation/UNet_Industrial_for_TensorFlow/model/layers/array_ops.py | Huawei-Ascend/modelzoo | df51ed9c1d6dbde1deef63f2a037a369f8554406 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
#
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 29.991736 | 120 | 0.618903 |
import tensorflow as tf
from model.layers.utils import _log_hparams
__all__ = ['concat', 'flatten', 'reshape', 'squeeze', 'upscale_2d']
def concat(values, axis, name='concat'):
net = tf.concat(values=values, axis=axis, name=name)
_log_hparams(classname='Concat', layername=net.name, ax... | true | true |
1c3359893ff7287a55b182731ef1b9f1b460a2db | 3,104 | py | Python | python/examples/scan_external_sources_custom_path_data_rules.py | fvaleye/metadata-guardian | ab5d6cada67785c3cfd98112f68e8fdb193d1617 | [
"Apache-2.0"
] | 9 | 2021-12-31T20:32:35.000Z | 2022-02-18T17:51:49.000Z | python/examples/scan_external_sources_custom_path_data_rules.py | fvaleye/metadata-guardian | ab5d6cada67785c3cfd98112f68e8fdb193d1617 | [
"Apache-2.0"
] | 1 | 2022-02-25T16:35:04.000Z | 2022-02-28T21:08:53.000Z | python/examples/scan_external_sources_custom_path_data_rules.py | fvaleye/metadata-guardian | ab5d6cada67785c3cfd98112f68e8fdb193d1617 | [
"Apache-2.0"
] | null | null | null | import argparse
import os
from metadata_guardian import (
AvailableCategory,
ColumnScanner,
DataRules,
ExternalMetadataSource,
)
from metadata_guardian.source import (
AthenaSource,
BigQuerySource,
DeltaTableSource,
GlueSource,
KafkaSchemaRegistrySource,
MySQLSource,
Snowfla... | 29.009346 | 94 | 0.664948 | import argparse
import os
from metadata_guardian import (
AvailableCategory,
ColumnScanner,
DataRules,
ExternalMetadataSource,
)
from metadata_guardian.source import (
AthenaSource,
BigQuerySource,
DeltaTableSource,
GlueSource,
KafkaSchemaRegistrySource,
MySQLSource,
Snowfla... | true | true |
1c335a4a3f949a93d650c47d0aff470cf8e0234b | 5,901 | py | Python | app/galleries.py | atm08e/amiller.im-py3 | ddbc80d233d9bd2c645eb7cb2af73e951515fca4 | [
"MIT"
] | null | null | null | app/galleries.py | atm08e/amiller.im-py3 | ddbc80d233d9bd2c645eb7cb2af73e951515fca4 | [
"MIT"
] | null | null | null | app/galleries.py | atm08e/amiller.im-py3 | ddbc80d233d9bd2c645eb7cb2af73e951515fca4 | [
"MIT"
] | null | null | null | import json
# TODO async json
import logging
import os
import sys
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging.getLogger(__name__)
def gallery_json_loader(path):
logger.debug('Trying to open file: {}'.format(path))
with open(path, 'r+', encoding='utf-8') as f:
# TODO a... | 50.435897 | 120 | 0.401457 | import json
import logging
import os
import sys
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging.getLogger(__name__)
def gallery_json_loader(path):
logger.debug('Trying to open file: {}'.format(path))
with open(path, 'r+', encoding='utf-8') as f:
loaded_json = js... | true | true |
1c335a5cb2b2657745ae992aecdd688526eb9297 | 2,611 | py | Python | planning/domains/hiking/Generatorhikingproblem.py | xlbandy/fape | 8a00f9d4c20f722930c11d88b60e0e82f523a439 | [
"BSD-2-Clause"
] | 14 | 2017-01-09T23:25:12.000Z | 2022-02-16T12:08:48.000Z | planning/domains/hiking/Generatorhikingproblem.py | xlbandy/fape | 8a00f9d4c20f722930c11d88b60e0e82f523a439 | [
"BSD-2-Clause"
] | 7 | 2018-05-18T08:27:03.000Z | 2022-03-23T06:39:42.000Z | planning/domains/hiking/Generatorhikingproblem.py | xlbandy/fape | 8a00f9d4c20f722930c11d88b60e0e82f523a439 | [
"BSD-2-Clause"
] | 8 | 2016-12-09T13:31:43.000Z | 2022-02-16T12:08:50.000Z | from __future__ import division
import itertools
import json
import math
import os
import random
import shutil
import subprocess
import sys
loc = 3
hiker =2
car = 2
def main():
global loc
global hiker
global car
if len(sys.argv) > 1:
loc = int(sys.argv[1])
if len(sys.argv) > 2:
hiker = int(sys.argv[2])
if ... | 25.105769 | 121 | 0.516277 | from __future__ import division
import itertools
import json
import math
import os
import random
import shutil
import subprocess
import sys
loc = 3
hiker =2
car = 2
def main():
global loc
global hiker
global car
if len(sys.argv) > 1:
loc = int(sys.argv[1])
if len(sys.argv) > 2:
hiker = int(sys.argv[2])
if ... | true | true |
1c335b506bbcd73c2a19432394cb2b936afb8669 | 17,202 | py | Python | python/analysis/habernal_comparison/analyse_features.py | UKPLab/tacl2018-preference-convincing | 65eb1cd3bf76f8068889880e0f80178e790350ce | [
"Apache-2.0"
] | 13 | 2019-03-01T19:40:23.000Z | 2022-01-10T05:53:47.000Z | python/analysis/habernal_comparison/analyse_features.py | UKPLab/tacl2018-preference-convincing | 65eb1cd3bf76f8068889880e0f80178e790350ce | [
"Apache-2.0"
] | 12 | 2020-11-13T17:54:01.000Z | 2022-02-09T23:39:11.000Z | python/analysis/habernal_comparison/analyse_features.py | UKPLab/tacl2018-preference-convincing | 65eb1cd3bf76f8068889880e0f80178e790350ce | [
"Apache-2.0"
] | 5 | 2019-02-06T12:08:20.000Z | 2022-01-10T20:40:22.000Z | '''
Created on 1 Jun 2017
Load a set of feature lengthscales from a good run with 'both' types of features.
Sort them by lengthscale.
Plot the distribution.
Identify which type of feature they are: add colours or markers to the plot.
Provide a zoomed-in variant for the best 25 features.
@author: simpson
'''
impor... | 41.651332 | 154 | 0.578421 |
import os, pickle
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from tests import load_embeddings, get_fold_data, TestRunner
from data_loader import load_train_test_data, load_ling_features
from matplotlib.ticker import MaxNLocator
if __name__ == '__main__':
expt_folder_name = 'crowds... | true | true |
1c335c7a96e78dad784537a49f59c108c83557f7 | 1,642 | py | Python | placethings/ilp/method.py | kumokay/placethings | c1fa9aace89be5766e7aa24e4df8bc5d5ca8fa66 | [
"Apache-2.0"
] | 2 | 2019-09-28T09:36:29.000Z | 2019-11-14T20:48:24.000Z | placethings/ilp/method.py | kumokay/placethings | c1fa9aace89be5766e7aa24e4df8bc5d5ca8fa66 | [
"Apache-2.0"
] | 1 | 2019-07-24T20:54:46.000Z | 2019-08-09T20:07:43.000Z | placethings/ilp/method.py | kumokay/placethings | c1fa9aace89be5766e7aa24e4df8bc5d5ca8fa66 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from copy import deepcopy
import logging
import pulp
# NOTE: to use glpk solver, sudo apt-get install glpk-utils
from placethings.graph_gen import task_graph
from place... | 34.93617 | 79 | 0.744823 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from copy import deepcopy
import logging
import pulp
from placethings.graph_gen import task_graph
from placethings.ilp import utils, solver
log = logging.getLogger()... | true | true |
1c335e4f3a102a7a5ae4cc8c6bb0efa75cb6e72d | 2,468 | py | Python | 5. Probability and Statistics/statistics-intermediate/The Mode-307.py | bibekuchiha/dataquest | c7d8a2966fe2eee864442a59d64309033ea9993e | [
"MIT"
] | null | null | null | 5. Probability and Statistics/statistics-intermediate/The Mode-307.py | bibekuchiha/dataquest | c7d8a2966fe2eee864442a59d64309033ea9993e | [
"MIT"
] | null | null | null | 5. Probability and Statistics/statistics-intermediate/The Mode-307.py | bibekuchiha/dataquest | c7d8a2966fe2eee864442a59d64309033ea9993e | [
"MIT"
] | null | null | null | ## 1. Introduction ##
import pandas as pd
houses = pd.read_table('AmesHousing_1.txt')
print(houses[['Land Slope','Roof Style','Kitchen AbvGr']])
scale_land = 'ordinal'
scale_roof = 'nominal'
kitchen_variable = 'discrete'
## 2. The Mode for Ordinal Variables ##
def mode(array):
counts = {}
for valu... | 23.961165 | 75 | 0.623987 | houses = pd.read_table('AmesHousing_1.txt')
print(houses[['Land Slope','Roof Style','Kitchen AbvGr']])
scale_land = 'ordinal'
scale_roof = 'nominal'
kitchen_variable = 'discrete'
for value in array:
if value in counts:
counts[value] += 1
else:
counts[value] = 1
... | true | true |
1c33613869982dc2d894924cc6286d86815c454a | 1,417 | py | Python | tests/lit/lit/formats/alivetest.py | rutgers-apl/alive-loops | 2ce0d2f02f4c1554451f9741520ffe7e92b4b50e | [
"Apache-2.0"
] | 4 | 2016-04-07T17:30:00.000Z | 2018-12-02T00:06:28.000Z | tests/lit/lit/formats/alivetest.py | rutgers-apl/alive-loops | 2ce0d2f02f4c1554451f9741520ffe7e92b4b50e | [
"Apache-2.0"
] | null | null | null | tests/lit/lit/formats/alivetest.py | rutgers-apl/alive-loops | 2ce0d2f02f4c1554451f9741520ffe7e92b4b50e | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import re, string, subprocess, signal
import lit.Test
from .base import FileBasedTest
def executeCommand(command, input):
p = subprocess.Popen(command,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=s... | 24.431034 | 78 | 0.625265 | from __future__ import absolute_import
import re, string, subprocess, signal
import lit.Test
from .base import FileBasedTest
def executeCommand(command, input):
p = subprocess.Popen(command,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=s... | true | true |
1c33622dace13df17153cec3a22ea9743fed0d6e | 1,447 | py | Python | tests/test_fast/test_deadlock.py | ponty/EasyProcess | 4b3f5ab487ec46133e361958d6061262bfad91c3 | [
"BSD-2-Clause"
] | 86 | 2015-02-17T11:41:18.000Z | 2022-03-05T08:05:29.000Z | tests/test_fast/test_deadlock.py | ponty/EasyProcess | 4b3f5ab487ec46133e361958d6061262bfad91c3 | [
"BSD-2-Clause"
] | 18 | 2015-02-11T21:03:13.000Z | 2022-03-20T14:32:51.000Z | tests/test_fast/test_deadlock.py | ponty/EasyProcess | 4b3f5ab487ec46133e361958d6061262bfad91c3 | [
"BSD-2-Clause"
] | 22 | 2015-02-11T20:47:00.000Z | 2021-11-01T15:26:23.000Z | import os
import sys
import threading
from time import sleep
import pytest
from pyvirtualdisplay.display import Display
from easyprocess import EasyProcess
python = sys.executable
# requirement: apt install imagemagick
# deadlock
# popen.communicate() hangs
# no deadlock with temp_files
PROG = """
from PIL import... | 22.609375 | 75 | 0.621977 | import os
import sys
import threading
from time import sleep
import pytest
from pyvirtualdisplay.display import Display
from easyprocess import EasyProcess
python = sys.executable
PROG = """
from PIL import Image
Image.new("RGB",(99, 99)).show()
"""
EASYPROCESS_USE_TEMP_FILES = os.environ.get("EASYPROCESS_USE... | true | true |
1c3363e3946059d0e9af3446782a8ac9ca9eb2ca | 1,105 | py | Python | Ar_Script/past/密码安全等级检查.py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | null | null | null | Ar_Script/past/密码安全等级检查.py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | 1 | 2020-01-19T01:19:57.000Z | 2020-01-19T01:19:57.000Z | Ar_Script/past/密码安全等级检查.py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | null | null | null |
psw=input('请输入需要检查的密码组合:')
zimu=('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','A','B','C'
, 'D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z')
shuzi='1234567890'
fuhao='~!@#$%^&*()_+[]{}:;"|\<,>.?//*-+.'
length=len(p... | 22.55102 | 117 | 0.506787 |
psw=input('请输入需要检查的密码组合:')
zimu=('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','A','B','C'
, 'D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z')
shuzi='1234567890'
fuhao='~!@#$%^&*()_+[]{}:;"|\<,>.?//*-+.'
length=len(p... | true | true |
1c3364a3c9abb5f56a012e9bb0585f043b4e08cc | 8,171 | py | Python | orc8r/gateway/python/magma/magmad/proxy_client.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | 3 | 2019-08-16T17:03:09.000Z | 2019-08-23T21:57:48.000Z | orc8r/gateway/python/magma/magmad/proxy_client.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | 14 | 2019-11-15T12:01:18.000Z | 2019-12-12T14:37:42.000Z | orc8r/gateway/python/magma/magmad/proxy_client.py | 119Vik/magma-1 | 107a7b374466a837fc0a49b283ba9d6ff1d702e3 | [
"BSD-3-Clause"
] | 3 | 2019-11-15T15:56:25.000Z | 2019-11-21T10:34:59.000Z | """
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import asyncio
import loggin... | 41.267677 | 79 | 0.582793 | import asyncio
import logging
import aioh2
import h2.events
from orc8r.protos.sync_rpc_service_pb2 import GatewayResponse, SyncRPCResponse
from magma.common.service_registry import ServiceRegistry
class ControlProxyHttpClient(object):
def __init__(self):
self._connection_table = {}
async def se... | true | true |
1c3365e3b522bc4f34c72ef66f784cc0cc49dbf1 | 10,574 | py | Python | tools/harness-automation/autothreadharness/open_thread_controller.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | 1 | 2020-08-12T06:15:53.000Z | 2020-08-12T06:15:53.000Z | tools/harness-automation/autothreadharness/open_thread_controller.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | null | null | null | tools/harness-automation/autothreadharness/open_thread_controller.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | 27.322997 | 92 | 0.56847 |
import logging
import re
import socket
import threading
import time
import serial
from . import settings
__all__ = ['OpenThreadController']
logger = logging.getLogger(__name__)
linesepx = re.compile(r'\r\n|\n')
class OpenThreadController(threading.Thread):
_lock = threading.Lock(... | true | true |
1c336671addc0cbf4baad8279578295bfaff1469 | 396 | py | Python | examples/16_helix_origami_rectangle_no_seq_no_twist.py | scadnano-test-user/scadnano-python-package-1 | 9becb5a076579f6cbac1ebfeda514540bb84ab87 | [
"MIT"
] | null | null | null | examples/16_helix_origami_rectangle_no_seq_no_twist.py | scadnano-test-user/scadnano-python-package-1 | 9becb5a076579f6cbac1ebfeda514540bb84ab87 | [
"MIT"
] | null | null | null | examples/16_helix_origami_rectangle_no_seq_no_twist.py | scadnano-test-user/scadnano-python-package-1 | 9becb5a076579f6cbac1ebfeda514540bb84ab87 | [
"MIT"
] | null | null | null | import origami_rectangle as rect
import scadnano as sc
def main():
design = rect.create(num_helices=16, num_cols=26, assign_seq=False, twist_correction_deletion_spacing=3,
twist_correction_start_col=2)
return design
if not sc.in_browser() and __name__ == '__main__':
d... | 28.285714 | 109 | 0.694444 | import origami_rectangle as rect
import scadnano as sc
def main():
design = rect.create(num_helices=16, num_cols=26, assign_seq=False, twist_correction_deletion_spacing=3,
twist_correction_start_col=2)
return design
if not sc.in_browser() and __name__ == '__main__':
d... | true | true |
1c33696bcd8ef856f152be64b1ac616cd4dc2881 | 8,724 | py | Python | uspto-txt-parser.py | hopped/uspto-patents-parsing-tools | c1804641d6fad690ddfd62039f4a367f625359b6 | [
"MIT"
] | 27 | 2015-03-08T09:38:03.000Z | 2022-01-21T09:46:22.000Z | uspto-txt-parser.py | hopped/uspto-patents-parsing-tools | c1804641d6fad690ddfd62039f4a367f625359b6 | [
"MIT"
] | null | null | null | uspto-txt-parser.py | hopped/uspto-patents-parsing-tools | c1804641d6fad690ddfd62039f4a367f625359b6 | [
"MIT"
] | 13 | 2015-08-17T20:28:38.000Z | 2020-05-21T11:37:39.000Z | #!/bin/bash/env python
"""
The MIT License
Copyright (c) 2014 Dennis Hoppe
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, cop... | 31.268817 | 103 | 0.599954 |
"""
The MIT License
Copyright (c) 2014 Dennis Hoppe
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, publ... | false | true |
1c33698445117e404bad1744f55343c669082b4b | 5,825 | py | Python | solid_i18n/middleware.py | affan2/django-solid-i18n-urls | 3b858a84499261a3f86253e472f83cd79e90bab6 | [
"BSD-3-Clause"
] | null | null | null | solid_i18n/middleware.py | affan2/django-solid-i18n-urls | 3b858a84499261a3f86253e472f83cd79e90bab6 | [
"BSD-3-Clause"
] | null | null | null | solid_i18n/middleware.py | affan2/django-solid-i18n-urls | 3b858a84499261a3f86253e472f83cd79e90bab6 | [
"BSD-3-Clause"
] | 1 | 2020-01-09T10:22:39.000Z | 2020-01-09T10:22:39.000Z | from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.core.urlresolvers import (is_valid_path, get_resolver,
get_script_prefix)
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
from django.utils.cache import patch_vary_headers
from django.utils import t... | 43.796992 | 135 | 0.664721 | from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.core.urlresolvers import (is_valid_path, get_resolver,
get_script_prefix)
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
from django.utils.cache import patch_vary_headers
from django.utils import t... | true | true |
1c3369cc581ad8d634b869346c35da6cd76f897b | 2,850 | py | Python | process.py | anirudhbelwadi/music-application-using-machine-learning | ef3514a59dd5d903bbd62ee0664d458098099d08 | [
"MIT"
] | 4 | 2021-07-01T12:38:53.000Z | 2021-11-13T09:21:14.000Z | process.py | anirudhbelwadi/music-application-using-machine-learning | ef3514a59dd5d903bbd62ee0664d458098099d08 | [
"MIT"
] | null | null | null | process.py | anirudhbelwadi/music-application-using-machine-learning | ef3514a59dd5d903bbd62ee0664d458098099d08 | [
"MIT"
] | null | null | null | import json
import os
import math
import librosa
DATASET_PATH = "./test"
JSON_PATH = "top.json"
SAMPLE_RATE = 22050
TRACK_DURATION = 30 # measured in seconds
SAMPLES_PER_TRACK = SAMPLE_RATE * TRACK_DURATION
def save_mfcc(dataset_path, json_path, num_mfcc=13, n_fft=2048, hop_length=512, num_segments=5):
"""Extra... | 38.513514 | 112 | 0.600702 | import json
import os
import math
import librosa
DATASET_PATH = "./test"
JSON_PATH = "top.json"
SAMPLE_RATE = 22050
TRACK_DURATION = 30
SAMPLES_PER_TRACK = SAMPLE_RATE * TRACK_DURATION
def save_mfcc(dataset_path, json_path, num_mfcc=13, n_fft=2048, hop_length=512, num_segments=5):
data = {
"mappi... | true | true |
1c336b9139628ad9f04b4d05454eb9f431d71374 | 2,735 | py | Python | mfdnres/descriptor_formats/mfdn_format_8.py | nd-nuclear-theory/slurp | 6b6c8faeda829b2e9b9751ae48ff7dbf69f2a7c6 | [
"MIT"
] | 1 | 2020-12-10T02:29:06.000Z | 2020-12-10T02:29:06.000Z | mfdnres/descriptor_formats/mfdn_format_8.py | nd-nuclear-theory/slurp | 6b6c8faeda829b2e9b9751ae48ff7dbf69f2a7c6 | [
"MIT"
] | null | null | null | mfdnres/descriptor_formats/mfdn_format_8.py | nd-nuclear-theory/slurp | 6b6c8faeda829b2e9b9751ae48ff7dbf69f2a7c6 | [
"MIT"
] | 1 | 2021-06-23T14:51:29.000Z | 2021-06-23T14:51:29.000Z | """ mfdn_format_8.py -- declares descriptor parser
Language: Python 3
Patrick J. Fasano
University of Notre Dame
03/18/18 (pjf): Initiated (based on mfdn_format_7_ho.py).
09/06/18 (pjf): Allow hyphens in interaction name.
"""
import re
# intra-package references
from .. import descriptor
_pari... | 27.35 | 144 | 0.558318 |
import re
from .. import descriptor
_parity_map = {"g0": +1, "g1": -1, "gx": 0}
def _truncation_parser(substr):
regex = re.compile(
r""
)
def parser(filename):
regex = re.compile(
r"run(?P<run>\w+)"
r"\-(?P<code_name>[^\-]+)"
r"\-(?P<descriptor>"
... | true | true |
1c336c1207f698399536830e67b1a84561fc0177 | 10,452 | py | Python | scripts/OQMD2PyChemia.py | petavazohi/PyChemia | e779389418771c25c830aed360773c63bb069372 | [
"MIT"
] | 67 | 2015-01-31T07:44:55.000Z | 2022-03-21T21:43:34.000Z | scripts/OQMD2PyChemia.py | petavazohi/PyChemia | e779389418771c25c830aed360773c63bb069372 | [
"MIT"
] | 13 | 2016-06-03T19:07:51.000Z | 2022-03-31T04:20:40.000Z | scripts/OQMD2PyChemia.py | petavazohi/PyChemia | e779389418771c25c830aed360773c63bb069372 | [
"MIT"
] | 37 | 2015-01-22T15:37:23.000Z | 2022-03-21T15:38:10.000Z | #!/usr/bin/env python
import os
import sys
import time
import logging
import itertools
import argparse
from multiprocessing import Pool, cpu_count, Process
import pychemia
from pychemia.utils.periodic import atomic_symbol
try:
from qmpy import Entry
except ImportError:
Entry = None
print("Could not import... | 35.55102 | 120 | 0.598833 |
import os
import sys
import time
import logging
import itertools
import argparse
from multiprocessing import Pool, cpu_count, Process
import pychemia
from pychemia.utils.periodic import atomic_symbol
try:
from qmpy import Entry
except ImportError:
Entry = None
print("Could not import 'qmpy' as needed to ... | true | true |
1c336c1dabe0cc6cdb07b243776fe77d86a4311f | 874 | py | Python | lib/cocoapi_windows/PythonAPI/setup.py | Shank2358/NPMMR-Det | 414d148ff2ba5edbe870a8dafb6336845fb9ffbb | [
"Apache-2.0"
] | 27 | 2021-01-09T07:35:45.000Z | 2022-02-06T03:18:54.000Z | lib/cocoapi_windows/PythonAPI/setup.py | Shank2358/NPMMR-Det | 414d148ff2ba5edbe870a8dafb6336845fb9ffbb | [
"Apache-2.0"
] | 4 | 2021-07-20T07:16:03.000Z | 2022-03-29T14:22:59.000Z | lib/cocoapi_windows/PythonAPI/setup.py | Shank2358/NPMMR-Det | 414d148ff2ba5edbe870a8dafb6336845fb9ffbb | [
"Apache-2.0"
] | 1 | 2021-12-26T09:12:08.000Z | 2021-12-26T09:12:08.000Z | from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy as np
# To install and compile to your anaconda/python site-packages, simply run:
# $ pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
# Note that the original co... | 32.37037 | 106 | 0.688787 | from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy as np
Extension(
'pycocotools._mask',
sources=['../common/maskApi.c', 'pycocotools/_mask.pyx'],
include_dirs = [np.get_include(), '../common'],
extra_compile_args... | true | true |
1c336dd763456ee791f4e197b59b28af345ec219 | 4,052 | py | Python | alipay/aop/api/request/AlipayMarketingCampaignDiscountBudgetQueryRequest.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/AlipayMarketingCampaignDiscountBudgetQueryRequest.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/AlipayMarketingCampaignDiscountBudgetQueryRequest.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.AlipayMarketingCampaignDiscountBudgetQueryModel import AlipayMarketingCampaignDiscountBudgetQueryModel
class AlipayMarketingCampaign... | 27.944828 | 148 | 0.65153 |
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayMarketingCampaignDiscountBudgetQueryModel import AlipayMarketingCampaignDiscountBudgetQueryModel
class AlipayMarketingCampaignDiscountBudgetQueryRequest(object):
def... | true | true |
1c336e553ba984f8fa1f69078ffb7e7486ff9172 | 9,600 | py | Python | python/codegen/generate_vhdl.py | MaartenBaert/xormix | 2b649bd9c2defd00dbffefb59db4de0b40785714 | [
"BSL-1.0",
"Apache-2.0",
"MIT"
] | 17 | 2022-02-21T02:23:30.000Z | 2022-03-03T03:38:54.000Z | python/codegen/generate_vhdl.py | MaartenBaert/xormix | 2b649bd9c2defd00dbffefb59db4de0b40785714 | [
"BSL-1.0",
"Apache-2.0",
"MIT"
] | null | null | null | python/codegen/generate_vhdl.py | MaartenBaert/xormix | 2b649bd9c2defd00dbffefb59db4de0b40785714 | [
"BSL-1.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright (c) 2020-2021 Maarten Baert <info@maartenbaert.be>
# Available under the MIT License - see LICENSE.txt for details.
import math
import random
import xormix16
import xormix24
import xormix32
import xormix48
import xormix64
import xormix96
import xormix128
random.seed(0x75cf32031077f039)
modules = {
16: ... | 41.921397 | 263 | 0.53125 |
import math
import random
import xormix16
import xormix24
import xormix32
import xormix48
import xormix64
import xormix96
import xormix128
random.seed(0x75cf32031077f039)
modules = {
16: xormix16,
24: xormix24,
32: xormix32,
48: xormix48,
64: xormix64,
96: xormix96,
128: xormix128,
}
def generate_rtl(n, f... | true | true |
1c337243f51bf5c05b4d429314fb8f3d6588f946 | 3,421 | py | Python | django/djangoproject/settings.py | RajapandiR/django-reactjs | 15371ee816ef4dfecd4cc0f4243fc358796c375b | [
"MIT"
] | null | null | null | django/djangoproject/settings.py | RajapandiR/django-reactjs | 15371ee816ef4dfecd4cc0f4243fc358796c375b | [
"MIT"
] | null | null | null | django/djangoproject/settings.py | RajapandiR/django-reactjs | 15371ee816ef4dfecd4cc0f4243fc358796c375b | [
"MIT"
] | null | null | null | """
Django settings for djangoproject project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from p... | 25.154412 | 91 | 0.688103 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'yjb#&^z%!1rvv57rgz!gmrrf!#vsc_9068t5k_*yosh^r!ij6^'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes'... | true | true |
1c3372470083842622d5ff11c75962a863ecf220 | 650 | py | Python | msgboard/migrations/0001_initial.py | Yoavsc129/beyond-tutorial | 733d2d26df980f2ccb3fa7d1595112bee089d8be | [
"MIT"
] | null | null | null | msgboard/migrations/0001_initial.py | Yoavsc129/beyond-tutorial | 733d2d26df980f2ccb3fa7d1595112bee089d8be | [
"MIT"
] | null | null | null | msgboard/migrations/0001_initial.py | Yoavsc129/beyond-tutorial | 733d2d26df980f2ccb3fa7d1595112bee089d8be | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-08 09:07
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
... | 26 | 117 | 0.586154 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
('id', models.BigAutoField(auto_created=Tr... | true | true |
1c33726a2db273b76310d3a6da8874396a32f59d | 4,270 | py | Python | alipay/aop/api/domain/DishonestyDetailInfo.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/domain/DishonestyDetailInfo.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/domain/DishonestyDetailInfo.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.constant.ParamConstants import *
class DishonestyDetailInfo(object):
def __init__(self):
self._behavior = None
self._case_code = None
self._enforce_court = None
self._id_number = None
self._name... | 29.246575 | 77 | 0.574239 |
import json
from alipay.aop.api.constant.ParamConstants import *
class DishonestyDetailInfo(object):
def __init__(self):
self._behavior = None
self._case_code = None
self._enforce_court = None
self._id_number = None
self._name = None
self._performance = None
... | true | true |
1c337336b004d37a33e535c259ebd287915bae27 | 4,939 | py | Python | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/trash/_402_cre_decimal.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | 1 | 2020-02-28T12:03:39.000Z | 2020-02-28T12:03:39.000Z | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/trash/_402_cre_decimal.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | null | null | null | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/trash/_402_cre_decimal.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 3 14:35:15 2018
@author: Kazuki
"""
import os
import pandas as pd
import gc
from multiprocessing import Pool
import multiprocessing
from glob import glob
import utils
utils.start(__file__)
#========================================================... | 36.858209 | 134 | 0.554161 |
import os
import pandas as pd
import gc
from multiprocessing import Pool
import multiprocessing
from glob import glob
import utils
utils.start(__file__)
KEY = 'SK_ID_CURR'
PREF = 'cre'
NTHREAD = multiprocessing.cpu_count()
cre = utils.read_pickles('../data/credit_card_balance')
cre.sort_values(['SK_ID_CURR',... | true | true |
1c3373c42e34c54544e374c1eb57af33cec00da7 | 2,569 | py | Python | python/word-count/word_count_test.py | stevenandrewcarter/exercism | db02c2f16d9cff878120208beccb3d09305a9df0 | [
"MIT"
] | 1 | 2021-02-12T18:54:17.000Z | 2021-02-12T18:54:17.000Z | python/word-count/word_count_test.py | stevenandrewcarter/exercism | db02c2f16d9cff878120208beccb3d09305a9df0 | [
"MIT"
] | null | null | null | python/word-count/word_count_test.py | stevenandrewcarter/exercism | db02c2f16d9cff878120208beccb3d09305a9df0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from wordcount import word_count
# to be backwards compatible with the old Python 2.X
def decode_if_needed(string):
try:
return string.decode('utf-8')
except AttributeError:
return string
class WordCountTests(unittest.TestCase):
def test_count_on... | 28.865169 | 78 | 0.513429 |
import unittest
from wordcount import word_count
def decode_if_needed(string):
try:
return string.decode('utf-8')
except AttributeError:
return string
class WordCountTests(unittest.TestCase):
def test_count_one_word(self):
self.assertEqual(
{'word': 1},
... | true | true |
1c3375a1a8258dedbd7bb99777fb79d19fde143e | 672 | py | Python | testing_individual_section.py | OpenHRS/openhrs-scraper-app | be8b2dcf6b4612642700314fd7259cd0f5613742 | [
"MIT"
] | 3 | 2017-11-13T10:35:12.000Z | 2017-11-19T09:29:02.000Z | testing_individual_section.py | OpenHRS/openhrs-scraper-app | be8b2dcf6b4612642700314fd7259cd0f5613742 | [
"MIT"
] | 12 | 2017-10-01T12:35:58.000Z | 2018-08-19T07:47:00.000Z | testing_individual_section.py | OpenHRS/openhrs-scraper-app | be8b2dcf6b4612642700314fd7259cd0f5613742 | [
"MIT"
] | 1 | 2020-01-09T04:27:46.000Z | 2020-01-09T04:27:46.000Z | import json
import requests
import re
from bs4 import BeautifulSoup as bs
from create_hrs_tree import get_section_text_data
def main():
Section = {"name": 'Risk of loss',
"number": '2A-219'}
baseURL = 'http://www.capitol.hawaii.gov/hrscurrent/Vol11_Ch0476-0490/HRS0490/HRS_0490-.htm'
sectio... | 26.88 | 96 | 0.686012 | import json
import requests
import re
from bs4 import BeautifulSoup as bs
from create_hrs_tree import get_section_text_data
def main():
Section = {"name": 'Risk of loss',
"number": '2A-219'}
baseURL = 'http://www.capitol.hawaii.gov/hrscurrent/Vol11_Ch0476-0490/HRS0490/HRS_0490-.htm'
sectio... | true | true |
1c3375b4eab451b16c40c709077979721739d1e9 | 2,994 | py | Python | experiments/murtaza/ros/sawyer_sim/sawyer_pos_sac.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/murtaza/ros/sawyer_sim/sawyer_pos_sac.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/murtaza/ros/sawyer_sim/sawyer_pos_sac.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.networks import ConcatMlp
import rlkit.torch.pytorch_util as ptu
from rlkit.torch.sac.policies import TanhGaussianPolicy
from rlkit.torch.sac.sac import SoftActorCritic
from sawyer_control.sawyer_reaching import SawyerXYZReachingEnv
import numpy ... | 26.732143 | 63 | 0.573146 | from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.networks import ConcatMlp
import rlkit.torch.pytorch_util as ptu
from rlkit.torch.sac.policies import TanhGaussianPolicy
from rlkit.torch.sac.sac import SoftActorCritic
from sawyer_control.sawyer_reaching import SawyerXYZReachingEnv
import numpy ... | true | true |
1c337605d45899ca95adf8c7fcedb4e9ce240822 | 4,528 | py | Python | api/src/opentrons/hardware_control/emulation/thermocycler.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/hardware_control/emulation/thermocycler.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/hardware_control/emulation/thermocycler.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | """An emulation of the opentrons thermocycler module.
The purpose is to provide a fake backend that responds to GCODE commands.
"""
import logging
from typing import Optional
from opentrons.drivers.thermocycler.driver import GCODE
from opentrons.drivers.types import ThermocyclerLidStatus
from opentrons.hardware_contr... | 39.373913 | 79 | 0.634496 |
import logging
from typing import Optional
from opentrons.drivers.thermocycler.driver import GCODE
from opentrons.drivers.types import ThermocyclerLidStatus
from opentrons.hardware_control.emulation.parser import Parser, Command
from .abstract_emulator import AbstractEmulator
from .simulations import Temperature, Tem... | true | true |
1c33763f08e3455be5c1b27f67dfa283532c92fc | 81 | py | Python | app-engine-by-example/local_constants.py | draescherl/griffith-cloud-plaforms-applications | 97f86f0a6cb40e3c66572023d7d7de7b49497b49 | [
"MIT"
] | null | null | null | app-engine-by-example/local_constants.py | draescherl/griffith-cloud-plaforms-applications | 97f86f0a6cb40e3c66572023d7d7de7b49497b49 | [
"MIT"
] | null | null | null | app-engine-by-example/local_constants.py | draescherl/griffith-cloud-plaforms-applications | 97f86f0a6cb40e3c66572023d7d7de7b49497b49 | [
"MIT"
] | null | null | null | PROJECT_NAME='gae-by-example'
PROJECT_STORAGE_BUCKET='gae-by-example.appspot.com' | 40.5 | 51 | 0.839506 | PROJECT_NAME='gae-by-example'
PROJECT_STORAGE_BUCKET='gae-by-example.appspot.com' | true | true |
1c33772aba5b57d2f7e626c7d7dec345fd5596bd | 156 | py | Python | configs/prod.py | Stupnitskiy/BinaryAPI | e448936ceed96da72e2aa65847030ea56edb224f | [
"MIT"
] | null | null | null | configs/prod.py | Stupnitskiy/BinaryAPI | e448936ceed96da72e2aa65847030ea56edb224f | [
"MIT"
] | null | null | null | configs/prod.py | Stupnitskiy/BinaryAPI | e448936ceed96da72e2aa65847030ea56edb224f | [
"MIT"
] | null | null | null | DEBUG = False
TESTING = False
DROPBOX_ACCESS_TOKEN = 'mTUuFHFyeNAAAAAAAAAAISJUHjSYan7RFlrRfJEdnzT1aUSKv59aLJFJMnzbS0uT'
DROPBO_PROJECT_PATH = '/binaryAPI'
| 26 | 89 | 0.858974 | DEBUG = False
TESTING = False
DROPBOX_ACCESS_TOKEN = 'mTUuFHFyeNAAAAAAAAAAISJUHjSYan7RFlrRfJEdnzT1aUSKv59aLJFJMnzbS0uT'
DROPBO_PROJECT_PATH = '/binaryAPI'
| true | true |
1c33775ff90dde5df7953bff084cd11b14119b45 | 8,034 | py | Python | python/kfserving/kfserving/models/v1alpha2_inference_service.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 6 | 2022-02-15T21:54:19.000Z | 2022-02-16T21:18:54.000Z | python/kfserving/kfserving/models/v1alpha2_inference_service.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 635 | 2021-01-29T07:06:06.000Z | 2022-03-31T09:09:20.000Z | python/kfserving/kfserving/models/v1alpha2_inference_service.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 4 | 2021-02-15T23:02:53.000Z | 2022-01-27T22:54:16.000Z | # Copyright 2020 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 33.061728 | 312 | 0.638163 |
import pprint
import re
import six
from kfserving.configuration import Configuration
class V1alpha2InferenceService(object):
openapi_types = {
'api_version': 'str',
'kind': 'str',
'metadata': 'V1ObjectMeta',
'spec': 'V1alpha2InferenceServiceSpec',
'st... | true | true |
1c337772a3c0152c7169b07e964047635ab78aae | 3,444 | py | Python | Intro_to_Recommendation_Systems/DeepRecommender/data_utils/movielens_data_convert.py | NunoEdgarGFlowHub/sciblog_support | 5ef38b935ad45edd1cf01b92b5184282b4ee25fa | [
"BSD-3-Clause"
] | 668 | 2016-11-27T13:12:40.000Z | 2022-02-18T09:12:19.000Z | Intro_to_Recommendation_Systems/DeepRecommender/data_utils/movielens_data_convert.py | mohamedndiaye/sciblog_support | 0d5b956bacbd40d1a1fc07582aba728abfb59f54 | [
"BSD-3-Clause"
] | 99 | 2016-11-01T08:18:44.000Z | 2021-02-25T06:16:39.000Z | Intro_to_Recommendation_Systems/DeepRecommender/data_utils/movielens_data_convert.py | mohamedndiaye/sciblog_support | 0d5b956bacbd40d1a1fc07582aba728abfb59f54 | [
"BSD-3-Clause"
] | 185 | 2016-11-29T11:11:33.000Z | 2022-03-31T09:14:41.000Z | # Copyright (c) 2017 NVIDIA Corporation
import sys
import datetime
import random
from math import floor
def print_stats(data):
total_ratings = 0
print("STATS")
for user in data:
total_ratings += len(data[user])
print("Total Ratings: {}".format(total_ratings))
print("Total User count: {}".format(len(data.... | 33.115385 | 115 | 0.671312 |
import sys
import datetime
import random
from math import floor
def print_stats(data):
total_ratings = 0
print("STATS")
for user in data:
total_ratings += len(data[user])
print("Total Ratings: {}".format(total_ratings))
print("Total User count: {}".format(len(data.keys())))
def save_data_to_file(data, ... | true | true |
1c33778216c6074870c586d573ca2ba9195b1476 | 1,047 | py | Python | editor/attributes/player/player_attribute_fk_style.py | PeterC10/COFPES-OF-Editor-6 | 0a9c9b75fada8264634bdc968c9da209c44b29e2 | [
"MIT"
] | 1 | 2022-03-11T12:25:57.000Z | 2022-03-11T12:25:57.000Z | editor/attributes/player/player_attribute_fk_style.py | PeterC10/COFPES-OF-Editor-6 | 0a9c9b75fada8264634bdc968c9da209c44b29e2 | [
"MIT"
] | null | null | null | editor/attributes/player/player_attribute_fk_style.py | PeterC10/COFPES-OF-Editor-6 | 0a9c9b75fada8264634bdc968c9da209c44b29e2 | [
"MIT"
] | null | null | null | from editor.attributes.player.player_attribute import (
PlayerAttribute,
PlayerAttributeTypes,
)
class PlayerAttributeFkStyle(PlayerAttribute):
@classmethod
def att_class_name(cls):
return "FK Style"
@classmethod
def att_class_type(cls):
return PlayerAttributeTypes.BasicSettin... | 26.846154 | 67 | 0.683859 | from editor.attributes.player.player_attribute import (
PlayerAttribute,
PlayerAttributeTypes,
)
class PlayerAttributeFkStyle(PlayerAttribute):
@classmethod
def att_class_name(cls):
return "FK Style"
@classmethod
def att_class_type(cls):
return PlayerAttributeTypes.BasicSettin... | true | true |
1c33781d337fcd41bdfddab8f6383b37366a2364 | 346 | py | Python | users/models.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | users/models.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | users/models.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(to=User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg', upload_to='profile')
def __str__(self):
return f"{self.... | 26.615385 | 73 | 0.734104 | from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(to=User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg', upload_to='profile')
def __str__(self):
return f"{self.user.username}'s Profile"
| true | true |
1c3378e86defbbc7f3668544036cb7b6f2d8b7c3 | 100 | py | Python | keras_textclassification/data/model/__init__.py | luoyudong593/Keras-TextClassification | b3e6966b5dbc7f425522074e2043fbff0614de84 | [
"MIT"
] | 1,339 | 2019-06-13T15:34:46.000Z | 2022-03-31T11:24:09.000Z | keras_textclassification/data/model/__init__.py | zhangshixing-chn/Keras-TextClassification | 640e3f44f90d9d8046546f7e1a93a29ebe5c8d30 | [
"MIT"
] | 75 | 2019-06-25T06:38:27.000Z | 2022-03-25T06:48:19.000Z | keras_textclassification/data/model/__init__.py | zhangshixing-chn/Keras-TextClassification | 640e3f44f90d9d8046546f7e1a93a29ebe5c8d30 | [
"MIT"
] | 400 | 2019-06-17T03:00:48.000Z | 2022-03-23T07:00:53.000Z | # -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/8/28 2:35
# @author :Mo
# @function : | 20 | 27 | 0.52 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.