hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3370f82953e071c5633e8bf63c7b1675f27de6b6 | 52,754 | py | Python | stage/test_field_processors.py | streamsets/datacollector-tests-external | 6f255b5e7496deeef333b57a5e9df4911ba3ef00 | [
"Apache-2.0"
] | 1 | 2020-04-14T03:01:51.000Z | 2020-04-14T03:01:51.000Z | stage/test_field_processors.py | streamsets/datacollector-tests-external | 6f255b5e7496deeef333b57a5e9df4911ba3ef00 | [
"Apache-2.0"
] | null | null | null | stage/test_field_processors.py | streamsets/datacollector-tests-external | 6f255b5e7496deeef333b57a5e9df4911ba3ef00 | [
"Apache-2.0"
] | 1 | 2019-09-14T08:30:23.000Z | 2019-09-14T08:30:23.000Z | # Copyright 2017 StreamSets 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 writi... | 42.715789 | 130 | 0.665106 |
33713889fbe153837e29c4b2ebd99c1d9199422b | 8,486 | py | Python | code/02_modeling/02_ModelCreation/03_D_ModelCreation_SSWE_GBM.py | maelcamerlynck/MachineLearningSamples-TwitterSentimentPrediction | a03f251953d6928117e292ff5929864643d92b31 | [
"MIT"
] | 12 | 2017-12-17T21:30:36.000Z | 2019-05-21T14:31:31.000Z | code/02_modeling/02_ModelCreation/03_D_ModelCreation_SSWE_GBM.py | maelcamerlynck/MachineLearningSamples-TwitterSentimentPrediction | a03f251953d6928117e292ff5929864643d92b31 | [
"MIT"
] | null | null | null | code/02_modeling/02_ModelCreation/03_D_ModelCreation_SSWE_GBM.py | maelcamerlynck/MachineLearningSamples-TwitterSentimentPrediction | a03f251953d6928117e292ff5929864643d92b31 | [
"MIT"
] | 6 | 2019-09-21T00:18:41.000Z | 2021-09-22T09:00:19.000Z | # The purpose of this notebook is to train a **Gradient Boosting** based model to classify the tweets' sentiment as positive or negative.
import numpy as np
import pandas as pd
random_seed=1
np.random.seed(random_seed)
import keras
from sklearn import metrics
from timeit import default_timer as timer
from keras.cal... | 41.194175 | 205 | 0.617723 |
33713d0d161324b36c68125756a4eeaa7c06638c | 15,982 | py | Python | blatann/gatt/service_discovery.py | dkkeller/blatann | 2b72df4812f68fb718ab96d16c82343ee35969a5 | [
"BSD-3-Clause"
] | null | null | null | blatann/gatt/service_discovery.py | dkkeller/blatann | 2b72df4812f68fb718ab96d16c82343ee35969a5 | [
"BSD-3-Clause"
] | null | null | null | blatann/gatt/service_discovery.py | dkkeller/blatann | 2b72df4812f68fb718ab96d16c82343ee35969a5 | [
"BSD-3-Clause"
] | null | null | null | import logging
from blatann.event_type import EventSource, Event
from blatann.gatt import gattc
from blatann.nrf import nrf_events
from blatann.waitables.event_waitable import EventWaitable
from blatann.event_args import EventArgs, DatabaseDiscoveryCompleteEventArgs
logger = logging.getLogger(__name__)
... | 39.756219 | 129 | 0.647729 |
337141a2b8c0e9962763386e5c20dc052bb61055 | 4,348 | py | Python | Assignment1/senreps.py | TimO96/NLP2 | 83f65a385457f68397c641f38b53df0110282578 | [
"MIT"
] | null | null | null | Assignment1/senreps.py | TimO96/NLP2 | 83f65a385457f68397c641f38b53df0110282578 | [
"MIT"
] | null | null | null | Assignment1/senreps.py | TimO96/NLP2 | 83f65a385457f68397c641f38b53df0110282578 | [
"MIT"
] | null | null | null | import torch
import random
from torch import Tensor
from tqdm import tqdm
from typing import List
from conllu import parse_incr, TokenList
from torch.nn.utils.rnn import pad_sequence
#
def fetch_sen_reps(ud_parses: List[TokenList], model, tokenizer, model_type, concat, device) -> Tensor:
'''
creates sentence ... | 34.784 | 107 | 0.553358 |
33716a89d0ebcbde7c61624f6f4740044c542df3 | 15,336 | py | Python | lib/adafruit_seesaw/seesaw.py | airportpeople/trellicopter | b75d0be8dcac8fe42d866f547b25382154ec298d | [
"MIT"
] | 1 | 2022-02-19T17:24:51.000Z | 2022-02-19T17:24:51.000Z | lib/adafruit_seesaw/seesaw.py | airportpeople/trellicopter | b75d0be8dcac8fe42d866f547b25382154ec298d | [
"MIT"
] | null | null | null | lib/adafruit_seesaw/seesaw.py | airportpeople/trellicopter | b75d0be8dcac8fe42d866f547b25382154ec298d | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2017 Dean Miller for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_seesaw.seesaw`
====================================================
An I2C to whatever helper chip.
* Author(s): Dean Miller
Implementation Notes
--------------------
**Hardware:**
* Adafruit `ATSAMD0... | 32.422833 | 93 | 0.627347 |
33717994ad9a825ebd1b64473f9fe0d93060e80f | 137 | py | Python | torchblocks/models/transformer/__init__.py | deepframwork/TorchBlocks | 35f6e1bb83d2b9b05ba914a21fd365cb26ac4a32 | [
"MIT"
] | 1 | 2021-04-26T08:01:25.000Z | 2021-04-26T08:01:25.000Z | torchblocks/models/transformer/__init__.py | Raiselimit/TorchBlocks | a5baecb9a2470ff175087475630f2b7db3f7ef51 | [
"MIT"
] | null | null | null | torchblocks/models/transformer/__init__.py | Raiselimit/TorchBlocks | a5baecb9a2470ff175087475630f2b7db3f7ef51 | [
"MIT"
] | null | null | null | from .modeling_nezha import *
from .modeling_albert import *
from .configuration_albert import *
from .modeling_bert_for_theseus import * | 34.25 | 40 | 0.832117 |
33718009dad6e1a1a4ba2127e171cf8a4c7fede3 | 5,588 | py | Python | jenkinsapi/view.py | ifwe/jenkinsapi | 31a7fbb07efcd48e226f7dcf643fd2a2625416c0 | [
"MIT"
] | 1 | 2015-01-12T14:15:59.000Z | 2015-01-12T14:15:59.000Z | jenkinsapi/view.py | moustuk/jenkinsapi-1 | d18c1e669965c209093763f3295f79c9d3ccdeea | [
"MIT"
] | null | null | null | jenkinsapi/view.py | moustuk/jenkinsapi-1 | d18c1e669965c209093763f3295f79c9d3ccdeea | [
"MIT"
] | null | null | null | """
Module for jenkinsapi views
"""
import urllib
import logging
from jenkinsapi.jenkinsbase import JenkinsBase
from jenkinsapi.job import Job
log = logging.getLogger(__name__)
class View(JenkinsBase):
"""
View class
"""
def __init__(self, url, name, jenkins_obj):
self.name = name
... | 34.282209 | 93 | 0.55995 |
33719c5ee567706f7d3d2fc58ae7678a0462b998 | 6,817 | py | Python | dposlib/ark/serde.py | Moustikitos/dpos | 3f53fb269c75a9b2dcc116590901131a38b2f5a3 | [
"MIT"
] | 5 | 2019-02-15T21:20:58.000Z | 2022-02-08T22:01:54.000Z | dposlib/ark/serde.py | Moustikitos/dpos | 3f53fb269c75a9b2dcc116590901131a38b2f5a3 | [
"MIT"
] | 1 | 2019-02-15T13:58:39.000Z | 2019-02-20T21:38:21.000Z | dposlib/ark/serde.py | Moustikitos/dpos | 3f53fb269c75a9b2dcc116590901131a38b2f5a3 | [
"MIT"
] | 5 | 2018-07-27T20:44:58.000Z | 2022-03-22T05:59:03.000Z | # -*- coding: utf-8 -*-
import sys
import base58
import hashlib
import json
from dposlib import BytesIO
from dposlib.util.bin import unhexlify, pack, pack_bytes
CACHE = {}
def serializePayload(tx):
asset = tx.get("asset", {})
md5_asset = hashlib.md5(
json.dumps(asset, sort_keys=True... | 28.523013 | 74 | 0.551562 |
3371a9cb3b56b9e1b0093e770678ce087cb65a73 | 4,596 | py | Python | defoe/papers/queries/target_concordance_collocation_by_date.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 2 | 2022-02-14T12:10:54.000Z | 2022-02-14T12:35:44.000Z | defoe/papers/queries/target_concordance_collocation_by_date.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 17 | 2022-02-09T21:46:14.000Z | 2022-02-25T14:55:09.000Z | defoe/papers/queries/target_concordance_collocation_by_date.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 1 | 2022-02-14T13:19:08.000Z | 2022-02-14T13:19:08.000Z | """
Gets concordance and collocation for keywords occurring in articles
which have a target word and groups the results by date.
Words in articles, target words and keywords can be normalized,
normalized and stemmed, or normalized and lemmatized (default).
"""
from defoe import query_utils
from defoe.papers.query_uti... | 32.828571 | 83 | 0.605091 |
3371ba3e924a8fa3f12b57ee0e24efad70c0e279 | 3,223 | py | Python | development/nautobot_config.py | jathanism/nautobot-plugin-device-onboarding | 39427f4c0fbdf46cfcbfc853590981287d550e66 | [
"Apache-2.0"
] | null | null | null | development/nautobot_config.py | jathanism/nautobot-plugin-device-onboarding | 39427f4c0fbdf46cfcbfc853590981287d550e66 | [
"Apache-2.0"
] | null | null | null | development/nautobot_config.py | jathanism/nautobot-plugin-device-onboarding | 39427f4c0fbdf46cfcbfc853590981287d550e66 | [
"Apache-2.0"
] | null | null | null | """Nautobot configuration file."""
from distutils.util import strtobool
import os
import sys
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "").split(" ")
DATABASES = {
"default": {
"NAME": os.environ.get("DB_NAME", "nautobot"),
"USER": os.environ.get("DB_USER", ""),
"PASSWORD": os.enviro... | 29.036036 | 126 | 0.558176 |
3371c48d5e6dd52de77d9a024d6a28aa22e61a5a | 20,689 | py | Python | stable_baselines/a2c/utils.py | jfsantos/stable-baselines | 5bd4ffa98e364b9e8e8b4e64bc2d1be9b6e4897a | [
"MIT"
] | null | null | null | stable_baselines/a2c/utils.py | jfsantos/stable-baselines | 5bd4ffa98e364b9e8e8b4e64bc2d1be9b6e4897a | [
"MIT"
] | null | null | null | stable_baselines/a2c/utils.py | jfsantos/stable-baselines | 5bd4ffa98e364b9e8e8b4e64bc2d1be9b6e4897a | [
"MIT"
] | 1 | 2019-12-25T16:45:54.000Z | 2019-12-25T16:45:54.000Z | import os
from collections import deque
import numpy as np
import tensorflow as tf
def sample(logits):
"""
Creates a sampling Tensor for non deterministic policies
:param logits: (TensorFlow Tensor) The input probability for each action
:return: (TensorFlow Tensor) The sampled action
"""
noi... | 36.944643 | 119 | 0.658949 |
33722dbd2927b586673d5f512013984b54a791dc | 6,670 | py | Python | src/legacy/derivation.py | hiteshpindikanti/OrthogonalTransformerProbing | a3f17126463825cd8fe3baa4bccfb64f972ce850 | [
"MIT"
] | null | null | null | src/legacy/derivation.py | hiteshpindikanti/OrthogonalTransformerProbing | a3f17126463825cd8fe3baa4bccfb64f972ce850 | [
"MIT"
] | 2 | 2021-03-26T19:30:55.000Z | 2021-11-10T19:57:45.000Z | src/legacy/derivation.py | tomlimi/OrthogonalTransformerProbing | 78461237cfce9f677bb3c7d3bbdf5af7b4f395cd | [
"MIT"
] | 1 | 2021-12-12T04:32:25.000Z | 2021-12-12T04:32:25.000Z | import csv
from collections import defaultdict
from itertools import chain
import tensorflow as tf
import numpy as np
from data_support.conll_wrapper import ConllWrapper
import constants
UDER = {'en': '../resources/UDer-1.0-en-CatVar.tsv'}
class Derivation(ConllWrapper):
def __init__(self, conll_file, bert_tokeni... | 33.686869 | 118 | 0.714993 |
33722ff74f954ca141575219ff79679beebc2bfb | 873 | py | Python | removeCSVHeaer.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | 1 | 2015-04-23T11:43:26.000Z | 2015-04-23T11:43:26.000Z | removeCSVHeaer.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | removeCSVHeaer.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | #! python3
# removeCSVHeader.py - Remove the header from all CSV files in the current working
# directory.
import csv, os
os.makedirs('headerRemoved', exist_ok=True)
# loop through every file in the current working directory.
for csvfile in os.listdir('.'):
if not csvfile.endswith('.csv'):
continue
p... | 25.676471 | 82 | 0.639175 |
33725feb4517934ccd68b5b18a558812e5dcafc1 | 7,949 | py | Python | run_sample.py | CVI-SZU/CLIMS | 9d3d0123b625b2c6941069e8fb359019a5cabd59 | [
"MIT"
] | 4 | 2022-03-19T06:50:32.000Z | 2022-03-26T03:25:51.000Z | run_sample.py | CVI-SZU/CLIMS | 9d3d0123b625b2c6941069e8fb359019a5cabd59 | [
"MIT"
] | 1 | 2022-03-26T03:27:57.000Z | 2022-03-30T07:00:43.000Z | run_sample.py | CVI-SZU/CLIMS | 9d3d0123b625b2c6941069e8fb359019a5cabd59 | [
"MIT"
] | null | null | null | import argparse
import os
import numpy as np
import os.path as osp
from misc import pyutils
import random
import torch
# def seed_torch(seed=1):
# random.seed(seed)
# os.environ['PYTHONHASHSEED'] = str(seed)
# np.random.seed(seed)
# torch.manual_seed(seed)
# torch.cuda.manual_seed(seed)
# torc... | 42.281915 | 108 | 0.691911 |
3372a3090197b27c3ebf3fa42056b657fa4b1078 | 3,956 | py | Python | rdchiral/clean.py | paulsmirnov/rdchiral | 9ebd0e42659fb8404ff37e8ab16e40800b7cec70 | [
"MIT"
] | 65 | 2020-06-27T04:28:21.000Z | 2022-03-30T11:18:22.000Z | rdchiral/clean.py | paulsmirnov/rdchiral | 9ebd0e42659fb8404ff37e8ab16e40800b7cec70 | [
"MIT"
] | 15 | 2020-07-07T13:17:05.000Z | 2022-03-22T12:52:29.000Z | rdchiral/clean.py | paulsmirnov/rdchiral | 9ebd0e42659fb8404ff37e8ab16e40800b7cec70 | [
"MIT"
] | 14 | 2020-06-30T09:22:13.000Z | 2022-03-30T11:18:28.000Z | from __future__ import print_function
import rdkit.Chem as Chem
import re
from itertools import chain
from rdchiral.utils import vprint, PLEVEL
def canonicalize_outcome_smiles(smiles, ensure=True):
# Uniquify via SMILES string - a little sloppy
# Need a full SMILES->MOL->SMILES cycle to get a true canonical... | 45.471264 | 87 | 0.578362 |
3372b73dbf1815291d9d38dbccdbaba4e331f751 | 204 | py | Python | 0x0A-python-inheritance/2-is_same_class.py | flourishcodes/holbertonschool-higher_level_programming | 6fda5cca4ed960d7f3d40c26292ad55e1e7d3065 | [
"MIT"
] | null | null | null | 0x0A-python-inheritance/2-is_same_class.py | flourishcodes/holbertonschool-higher_level_programming | 6fda5cca4ed960d7f3d40c26292ad55e1e7d3065 | [
"MIT"
] | null | null | null | 0x0A-python-inheritance/2-is_same_class.py | flourishcodes/holbertonschool-higher_level_programming | 6fda5cca4ed960d7f3d40c26292ad55e1e7d3065 | [
"MIT"
] | 4 | 2018-05-01T05:04:15.000Z | 2020-04-28T22:22:54.000Z | #!/usr/bin/python3
'''
Python function to check instance of specified object
'''
def is_same_class(obj, a_class):
'''
check if instance is same
'''
return issubclass(a_class, type(obj))
| 17 | 53 | 0.666667 |
3372cd87284191ced83fd187781d5e49232b531d | 4,800 | py | Python | ngsutils/bam/innerdist.py | bgruening/ngsutils | 417e90dc1918fb553dd84990f2c54bd8cea8f44d | [
"BSD-3-Clause"
] | 57 | 2015-03-09T01:26:45.000Z | 2022-02-22T07:26:01.000Z | ngsutils/bam/innerdist.py | bgruening/ngsutils | 417e90dc1918fb553dd84990f2c54bd8cea8f44d | [
"BSD-3-Clause"
] | 33 | 2015-02-03T23:24:46.000Z | 2022-03-16T20:08:10.000Z | ngsutils/bam/innerdist.py | bgruening/ngsutils | 417e90dc1918fb553dd84990f2c54bd8cea8f44d | [
"BSD-3-Clause"
] | 33 | 2015-01-18T16:47:47.000Z | 2022-02-22T07:28:09.000Z | #!/usr/bin/env python
## category General
## desc Calculate the inner mate-pair distance from two BAM files
'''
Calculate the inner mate-pair distance from two BAM files
With paired-end reads, knowing the inner mate-pair distance is key for some
downstream analyses or mapping. This value can be estimated using wet-lab... | 27.586207 | 112 | 0.519792 |
33732508f50d4e9a10c24232a8f0d3a9b5247e76 | 5,224 | py | Python | src/test/py/ltprg/meaning/test.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | 11 | 2017-08-03T15:42:19.000Z | 2021-02-04T12:43:35.000Z | src/test/py/ltprg/meaning/test.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | null | null | null | src/test/py/ltprg/meaning/test.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | 1 | 2021-02-04T12:43:37.000Z | 2021-02-04T12:43:37.000Z | import sys
import numpy as np
import json
import torch
from os.path import join
from torch.autograd import Variable
from mung.data import DataSet
from mung.feature import MultiviewDataSet
from ltprg.model.meaning import MeaningModel
from ltprg.model.seq import SequenceModel, strs_for_scored_samples
from ltprg... | 42.129032 | 132 | 0.713821 |
33732ff819f69f80896863c80dfd44a0e096a406 | 2,678 | py | Python | tests/server1_test.py | yeeon/sirepo | 081595df256d40fbc7959614689d64ad2bc745d4 | [
"Apache-2.0"
] | 1 | 2019-06-06T08:08:11.000Z | 2019-06-06T08:08:11.000Z | tests/server1_test.py | yeeon/sirepo | 081595df256d40fbc7959614689d64ad2bc745d4 | [
"Apache-2.0"
] | null | null | null | tests/server1_test.py | yeeon/sirepo | 081595df256d40fbc7959614689d64ad2bc745d4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
u"""Test simulationSerial
:copyright: Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
pytest.importorskip('srwl_bl')
#: Used for a sanity check o... | 32.26506 | 118 | 0.640403 |
337341c35273f79341762aee47fe96a97a4d1f45 | 4,497 | py | Python | pywick/models/localization/fpn.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | 2 | 2020-11-28T07:56:09.000Z | 2021-11-08T09:30:39.000Z | pywick/models/localization/fpn.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | null | null | null | pywick/models/localization/fpn.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | null | null | null | # Source: https://github.com/kuangliu/pytorch-fpn
'''FPN in PyTorch.
Implementation of `Feature Pyramid Networks for Object Detection <http://openaccess.thecvf.com/content_cvpr_2017/papers/Lin_Feature_Pyramid_Networks_CVPR_2017_paper.pdf>`_.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
cla... | 36.560976 | 172 | 0.618635 |
3373474b0609a5cae0e4794ab9aa1cddeb7231d7 | 5,246 | py | Python | src/forecastga/models/nbeats.py | richardfergie/ForecastGA | ce4ddc778d0be68f504e1bfc300be6b2fe870cb7 | [
"MIT"
] | 30 | 2021-01-02T16:14:55.000Z | 2022-02-11T23:17:18.000Z | src/forecastga/models/nbeats.py | richardfergie/ForecastGA | ce4ddc778d0be68f504e1bfc300be6b2fe870cb7 | [
"MIT"
] | 2 | 2021-01-11T16:56:23.000Z | 2021-02-04T00:37:56.000Z | src/forecastga/models/nbeats.py | richardfergie/ForecastGA | ce4ddc778d0be68f504e1bfc300be6b2fe870cb7 | [
"MIT"
] | 8 | 2021-01-10T19:04:22.000Z | 2021-11-14T18:47:22.000Z | #! /usr/bin/env python
# coding: utf-8
#
"""ForecastGA: NBEATS Model"""
import os
import numpy as np
import torch
from torch import optim
from torch.nn import functional as F
from tqdm.auto import tqdm
from nbeats_pytorch.model import (
NBeatsNet,
)
from forecastga.models.base import BaseModel
from forecastga... | 29.806818 | 90 | 0.586923 |
3373554ab57d11babb77f98d507860134a909e66 | 4,090 | py | Python | datasets/SOT/seed/Impl/TrackingNet.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 143 | 2021-12-03T02:33:36.000Z | 2022-03-29T00:01:48.000Z | datasets/SOT/seed/Impl/TrackingNet.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 33 | 2021-12-03T10:32:05.000Z | 2022-03-31T02:13:55.000Z | datasets/SOT/seed/Impl/TrackingNet.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 24 | 2021-12-04T06:46:42.000Z | 2022-03-30T07:57:47.000Z | import os
from datasets.types.data_split import DataSplit
from datasets.SOT.constructor.base_interface import SingleObjectTrackingDatasetConstructor
import numpy as np
def construct_TrackingNet(constructor: SingleObjectTrackingDatasetConstructor, seed):
root_path = seed.root_path
data_type = seed.data_split
... | 49.878049 | 137 | 0.697555 |
33736c2b9aac3279b35f38184c7106954a672519 | 1,435 | py | Python | alipay/aop/api/domain/AlipayFinancialnetAuthExpressSigncardQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayFinancialnetAuthExpressSigncardQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayFinancialnetAuthExpressSigncardQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"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 AlipayFinancialnetAuthExpressSigncardQueryModel(object):
def __init__(self):
self._biz_identity = None
self._user_id = None
@property
def biz_identity(self):
retu... | 25.625 | 75 | 0.602787 |
3373a983528170fbe52c4c7ecdfd3ea2a60ad960 | 94 | py | Python | src/__init__.py | ssichynskyi/web_metric_collection | 3ec4907fb21bcb04526b193989e6dd073d55294b | [
"MIT"
] | null | null | null | src/__init__.py | ssichynskyi/web_metric_collection | 3ec4907fb21bcb04526b193989e6dd073d55294b | [
"MIT"
] | null | null | null | src/__init__.py | ssichynskyi/web_metric_collection | 3ec4907fb21bcb04526b193989e6dd073d55294b | [
"MIT"
] | null | null | null | """Contains metrics_collector, Kafka producer and a service
to run them collaboratively.
"""
| 18.8 | 59 | 0.776596 |
3373b838d5b71ed2246bf355b39484e5e9ff8455 | 1,876 | py | Python | generate_view.py | jrhunter3/Basic_Dockerized_PoW | af0f80f7373ed0a3878aadcb79ff54c37dbf3fa6 | [
"MIT"
] | null | null | null | generate_view.py | jrhunter3/Basic_Dockerized_PoW | af0f80f7373ed0a3878aadcb79ff54c37dbf3fa6 | [
"MIT"
] | null | null | null | generate_view.py | jrhunter3/Basic_Dockerized_PoW | af0f80f7373ed0a3878aadcb79ff54c37dbf3fa6 | [
"MIT"
] | null | null | null | import click
import tornado.template as template
import os.path
#import timeit
import conf.config as cfg
import shutil
@click.command()
@click.option('--name', help='set the view name')
#@click.option('--base', default="base.bs4", help='set the base view ')
#@click.option('--type', default="simple", help='simple skel... | 32.344828 | 104 | 0.643923 |
3373bb5bfc446b3bc96755b9318914df55fd6794 | 3,263 | py | Python | ponghat.py | rememberYou/ponghat | 390cbc68e6646462256d0cf9c3fbf3924026be49 | [
"MIT"
] | null | null | null | ponghat.py | rememberYou/ponghat | 390cbc68e6646462256d0cf9c3fbf3924026be49 | [
"MIT"
] | null | null | null | ponghat.py | rememberYou/ponghat | 390cbc68e6646462256d0cf9c3fbf3924026be49 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0, '/usr/lib/python2.7/dist-packages/sense_hat')
from sense_hat import SenseHat
from src.ai import *
from src.ball import *
from src.ground import *
from src.paddle import *
import time
import os
YELLOW = "\033[1;33m"
sense = SenseHat()
sense... | 24.908397 | 69 | 0.54551 |
3373cb3b0a61936a9ba4e9fac830cbf97d310e55 | 10,164 | py | Python | hf_trainer.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 8 | 2022-03-01T09:02:44.000Z | 2022-03-18T14:41:56.000Z | hf_trainer.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 1 | 2022-03-09T12:12:22.000Z | 2022-03-10T09:08:42.000Z | hf_trainer.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 2 | 2022-03-02T01:46:52.000Z | 2022-03-02T13:51:53.000Z | #!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Team All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 38.5 | 122 | 0.696379 |
3373d7eedc0c37a1706987160d5a8adfb7009f98 | 1,331 | bzl | Python | internal/node/node_labels.bzl | uri-canva/rules_nodejs | 452ac46fa6e13342470517971628480a6bd4441f | [
"Apache-2.0"
] | null | null | null | internal/node/node_labels.bzl | uri-canva/rules_nodejs | 452ac46fa6e13342470517971628480a6bd4441f | [
"Apache-2.0"
] | null | null | null | internal/node/node_labels.bzl | uri-canva/rules_nodejs | 452ac46fa6e13342470517971628480a6bd4441f | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 33.275 | 74 | 0.715252 |
3373e58ecdb28f87be47e60be6fee3e0bb049fa0 | 1,764 | py | Python | src/dumpBuggyPatches/allRunn.py | dSar-UVA/repoMiner | 8f75074e388ff13419a0a37b4337c0cdcb459f74 | [
"BSD-3-Clause"
] | null | null | null | src/dumpBuggyPatches/allRunn.py | dSar-UVA/repoMiner | 8f75074e388ff13419a0a37b4337c0cdcb459f74 | [
"BSD-3-Clause"
] | null | null | null | src/dumpBuggyPatches/allRunn.py | dSar-UVA/repoMiner | 8f75074e388ff13419a0a37b4337c0cdcb459f74 | [
"BSD-3-Clause"
] | null | null | null |
#get the path of directory in which project directories are there. Assume dirsPath
#rootdir ='C:\Users\Yagnik\PycharmProjects\Top_Project'
import os
import sys
import ghProc
from logChunk import logChunk
#print os.listdir(rootdir)
# for subdir, dirs, files in os.walk(rootdir):
# print dirs
def main():
prin... | 30.413793 | 197 | 0.722789 |
3373f28ddfbcc0c19fc40598b0de4db9c507622c | 512 | py | Python | bricks/ev3dev/modules/core.py | ZPhilo/pybricks-micropython | bf3072b6f7dd87b60e50d7c2130ca3c393a5709f | [
"MIT"
] | 115 | 2020-06-15T16:43:14.000Z | 2022-03-21T21:11:57.000Z | bricks/ev3dev/modules/core.py | ZPhilo/pybricks-micropython | bf3072b6f7dd87b60e50d7c2130ca3c393a5709f | [
"MIT"
] | 83 | 2020-06-17T17:19:29.000Z | 2022-03-08T18:50:35.000Z | bricks/ev3dev/modules/core.py | BertLindeman/pybricks-micropython | 8f22a99551100e66ddf08d014d9f442f22b33b4d | [
"MIT"
] | 40 | 2020-06-15T18:36:39.000Z | 2022-03-28T13:22:43.000Z | """Conveniently import core functionality for use on the REPL."""
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (
Motor,
TouchSensor,
ColorSensor,
InfraredSensor,
UltrasonicSensor,
GyroSensor,
)
from pybricks.parameters import Port, Stop, Direction, Button, Color
from pybric... | 28.444444 | 68 | 0.773438 |
337419beb4858686d80231b3cdfc0d8c5e112be0 | 1,658 | py | Python | packages/service-library/src/servicelib/jsonschema_specs.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | packages/service-library/src/servicelib/jsonschema_specs.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | 2 | 2018-05-13T09:10:57.000Z | 2019-03-06T08:10:40.000Z | packages/service-library/src/servicelib/jsonschema_specs.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | import json
from pathlib import Path
from typing import Dict
from .jsonschema_validation import validate_instance
from aiohttp import ClientSession
from jsonschema import ValidationError
from yarl import URL
def _load_from_path(filepath: Path) -> Dict:
with filepath.open() as f:
spec_dict =... | 30.703704 | 69 | 0.675513 |
33743f1cb398b83cb8e76f06070d8c901bc058f5 | 1,452 | py | Python | tests/bins/TestTsMassFieldsPerTimeStep.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | tests/bins/TestTsMassFieldsPerTimeStep.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | tests/bins/TestTsMassFieldsPerTimeStep.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | # vim: set ff=unix expandtab ts=4 sw=4:
import unittest
import numpy as np
import matplotlib
matplotlib.use("Agg") # Must be before importing matplotlib.pyplot or pylab!
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from CompartmentalSystems.bins.TsMassField import TsMassField
from Compartme... | 27.396226 | 85 | 0.596419 |
3374503dc404cd2433427a6eb93b225020a04ba4 | 6,676 | py | Python | Examples/tensorflow/utils/image_net_evaluator.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | Examples/tensorflow/utils/image_net_evaluator.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | Examples/tensorflow/utils/image_net_evaluator.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | # !/usr/bin/env python3.6
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification... | 43.070968 | 106 | 0.662373 |
33745b0d0ac0efbcc183dc319d8271557c257878 | 513 | py | Python | vnc-eds-adapter/setup.py | nortismo/ADC | 48dfaaae71db174a48a0c308b77a3405d92cf729 | [
"Beerware"
] | 1 | 2018-11-26T10:59:51.000Z | 2018-11-26T10:59:51.000Z | vnc-eds-adapter/setup.py | nortismo/ADC | 48dfaaae71db174a48a0c308b77a3405d92cf729 | [
"Beerware"
] | null | null | null | vnc-eds-adapter/setup.py | nortismo/ADC | 48dfaaae71db174a48a0c308b77a3405d92cf729 | [
"Beerware"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='vnc-eds-adapter',
description='Displays the content of a vnc session on an e-paper display',
author='Carla Iten, Diego Bienz, Michael Blättler, Philipp Leu',
version='0.1.0-dev',
install_requires=['pillow', 'spidev', 'vncdotool'],
package... | 28.5 | 78 | 0.645224 |
3374662afa407a764a296e981b09a1c909c26e5a | 1,726 | py | Python | mmdet/models/backbones/noisy.py | ddayzzz/mmdetection | b9940c56cc19b3dda7468a5fd858b9683e93a486 | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/noisy.py | ddayzzz/mmdetection | b9940c56cc19b3dda7468a5fd858b9683e93a486 | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/noisy.py | ddayzzz/mmdetection | b9940c56cc19b3dda7468a5fd858b9683e93a486 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
import numpy as np
import torch.nn.functional as F
import torch
from ..utils.conv2d_same import Conv2d as SameConv2d
from ..builder import BACKBONES, build_backbone
# SRM 层
class SRMFilter(nn.Module):
def __init__(self):
super(SRMFilter, self).__init__()
q = [4.0, 12.0, 2.0]
... | 39.227273 | 125 | 0.504056 |
337486cebf309861337789cfb25f6fcc7aa5f206 | 115 | py | Python | lib/test/support/__init__.py | eonu/tempora | b857c72737532983ebe7403d627fc632cbc06dde | [
"MIT"
] | 32 | 2019-12-31T15:53:47.000Z | 2022-03-31T12:40:40.000Z | lib/test/support/__init__.py | eonu/tempora | b857c72737532983ebe7403d627fc632cbc06dde | [
"MIT"
] | 25 | 2020-06-01T18:32:47.000Z | 2022-01-22T13:15:36.000Z | lib/test/support/__init__.py | eonu/tempora | b857c72737532983ebe7403d627fc632cbc06dde | [
"MIT"
] | 6 | 2019-12-31T15:54:26.000Z | 2022-01-23T07:09:28.000Z | from .assertions import assert_equal, assert_not_equal, assert_all_equal, assert_all_not_equal, assert_distribution | 115 | 115 | 0.895652 |
3374b4f9e1c3f28735f1d725b9590ccb5b67689d | 1,781 | py | Python | tests/test_read_trial.py | pzarabadip/thermof | 44c33e37aeadce31241a878135b1531757a2b1c4 | [
"MIT"
] | null | null | null | tests/test_read_trial.py | pzarabadip/thermof | 44c33e37aeadce31241a878135b1531757a2b1c4 | [
"MIT"
] | 11 | 2017-08-15T22:11:32.000Z | 2017-08-22T23:32:17.000Z | tests/test_read_trial.py | pzarabadip/thermof | 44c33e37aeadce31241a878135b1531757a2b1c4 | [
"MIT"
] | 1 | 2017-01-31T19:44:02.000Z | 2017-01-31T19:44:02.000Z | """
Tests reading thermal flux and calculating thermal conductivity for trials with multiple runs
"""
import os
import yaml
import numpy as np
from thermof.read import read_trial
from thermof.parameters import k_parameters
k_ref_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'thermal-conductivity.yam... | 48.135135 | 116 | 0.694554 |
3374d62b752ec8dbc36d800eb96e92a51977f4bb | 114 | py | Python | pylint_django_translations/__init__.py | troyjfarrell/pylint_django_translations | b6c5349379024cdc5445499229bc31330591049a | [
"BSD-3-Clause"
] | null | null | null | pylint_django_translations/__init__.py | troyjfarrell/pylint_django_translations | b6c5349379024cdc5445499229bc31330591049a | [
"BSD-3-Clause"
] | null | null | null | pylint_django_translations/__init__.py | troyjfarrell/pylint_django_translations | b6c5349379024cdc5445499229bc31330591049a | [
"BSD-3-Clause"
] | null | null | null | "Pylint plugin for django-translations"
from pylint_django_translations import plugin
register = plugin.register
| 22.8 | 45 | 0.850877 |
3374d938e3bc52555ddb41faa42c8e3e7e4686e6 | 253 | py | Python | Python-code-snippets-001-100/026-User input dialog.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-001-100/026-User input dialog.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-001-100/026-User input dialog.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | ''' 26-User input dialog '''
import tkinter as tk
from tkinter import simpledialog
ROOT = tk.Tk()
ROOT.withdraw()
#the input dialog
USER_INP = simpledialog.askstring(title="Test", \
prompt="What's your Name?:")
#check it out
print("Hello", USER_INP)
| 18.071429 | 49 | 0.719368 |
3374dd02fbb8fb530ec497db22a9d6f391d4fe8d | 754 | py | Python | alipay/aop/api/response/AlipayCommerceEducateTrainCourseCreateResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayCommerceEducateTrainCourseCreateResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayCommerceEducateTrainCourseCreateResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"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.response.AlipayResponse import AlipayResponse
class AlipayCommerceEducateTrainCourseCreateResponse(AlipayResponse):
def __init__(self):
super(AlipayCommerceEducateTrainCourseCreateResponse, self).__init__()
self._cours... | 29 | 119 | 0.729443 |
3375428d101c507df995e30d53bf032421443408 | 3,821 | py | Python | Algorithms/Divide_Conquer_Strategy/Divide_and_Conquer_Problems.py | akhopkar01/Data-structures-and-Algorithms | bf8681179d3443d62f8a26332ce06106fb2dfdf6 | [
"MIT"
] | 1 | 2020-09-10T15:48:16.000Z | 2020-09-10T15:48:16.000Z | Algorithms/Divide_Conquer_Strategy/Divide_and_Conquer_Problems.py | akhopkar01/Data-structures-and-Algorithms | bf8681179d3443d62f8a26332ce06106fb2dfdf6 | [
"MIT"
] | null | null | null | Algorithms/Divide_Conquer_Strategy/Divide_and_Conquer_Problems.py | akhopkar01/Data-structures-and-Algorithms | bf8681179d3443d62f8a26332ce06106fb2dfdf6 | [
"MIT"
] | null | null | null | def fastSelect(Arr, k): # k is an index
n = len(Arr) # length of the original array
if (k > 0 and k <= n): # k should be a valid index
# Helper variables
setOfMedians = []
Arr_Less_P = []
Arr_Equal_P = []
Arr_More_P = []
i = 0
# Step 1 - Break Arr int... | 30.086614 | 96 | 0.571316 |
337567a9e3fd2e6d5a0a72a4a870fb02cee0ede1 | 12,068 | py | Python | lona/app.py | ukleinek/lona | b4b52dc1e76c1b28b5989b9a93ddc969e997a841 | [
"MIT"
] | 230 | 2021-08-15T20:46:24.000Z | 2022-03-30T10:17:43.000Z | lona/app.py | ukleinek/lona | b4b52dc1e76c1b28b5989b9a93ddc969e997a841 | [
"MIT"
] | 176 | 2021-08-18T08:19:37.000Z | 2022-03-29T16:45:06.000Z | lona/app.py | ukleinek/lona | b4b52dc1e76c1b28b5989b9a93ddc969e997a841 | [
"MIT"
] | 13 | 2021-08-20T10:35:04.000Z | 2022-01-17T15:49:40.000Z | from __future__ import annotations
from argparse import RawTextHelpFormatter, ArgumentParser, Namespace
from typing import overload, Callable, Any
from tempfile import TemporaryDirectory
from asyncio import AbstractEventLoop
from os import PathLike
import contextlib
import logging
import os
from typing_extensions imp... | 25.841542 | 79 | 0.527428 |
33756b5e79cfb676197d0d3fd0d7b50efba0e093 | 1,699 | py | Python | DNA Sequence translation/translation.py | ashish-khulbey/HarvardX-PH526x-Using-Python-for-Research | 44d46d612b16665fce0978df1e72cba0ea44ee62 | [
"MIT"
] | null | null | null | DNA Sequence translation/translation.py | ashish-khulbey/HarvardX-PH526x-Using-Python-for-Research | 44d46d612b16665fce0978df1e72cba0ea44ee62 | [
"MIT"
] | null | null | null | DNA Sequence translation/translation.py | ashish-khulbey/HarvardX-PH526x-Using-Python-for-Research | 44d46d612b16665fce0978df1e72cba0ea44ee62 | [
"MIT"
] | null | null | null | def read_seq(inputfile):
"""Read and return a input sequence"""
with open(inputfile, "r") as f:
seq = f.read()
seq = seq.replace("\n", "")
seq = seq.replace("\r", "")
return seq
inputfile = "dna.txt"
# f = open(inputfile, "r")
# seq = f.read()
def translate(seq):
"""Translate a string containing a... | 33.313725 | 86 | 0.52266 |
33757aa0ec0274cebe662ad4cb8b5ff7cb03db07 | 366 | py | Python | tests/test_version.py | lewoudar/scalpel | 455a3ff766c91d02f33957ea17f1cfbec141ab60 | [
"Apache-2.0"
] | 15 | 2020-11-02T21:11:03.000Z | 2022-03-10T14:17:46.000Z | tests/test_version.py | lewoudar/scalpel | 455a3ff766c91d02f33957ea17f1cfbec141ab60 | [
"Apache-2.0"
] | 4 | 2020-11-01T17:54:15.000Z | 2022-03-04T21:42:41.000Z | tests/test_version.py | lewoudar/scalpel | 455a3ff766c91d02f33957ea17f1cfbec141ab60 | [
"Apache-2.0"
] | 2 | 2021-05-01T06:59:12.000Z | 2021-11-25T07:01:02.000Z | import re
from scalpel.__version__ import __version__, version_info
def test_version_is_correctly_formatted():
assert re.match(r'(\d+\.){2}\d+', __version__)
def test_version_info_returns_correct_version():
value = version_info()
assert isinstance(value, tuple)
assert 3 == len(value)
for item i... | 22.875 | 57 | 0.721311 |
3375923acca1f6a047901ffdc7f6571d869f051a | 41 | py | Python | metadefender_menlo/api/adaptors/file_submit.py | OPSWAT/metadefender-menlo-integration | 2687d1b08e4cc2610dd4d871402a126d8e5fa59e | [
"MIT"
] | null | null | null | metadefender_menlo/api/adaptors/file_submit.py | OPSWAT/metadefender-menlo-integration | 2687d1b08e4cc2610dd4d871402a126d8e5fa59e | [
"MIT"
] | 1 | 2022-03-08T03:39:10.000Z | 2022-03-08T03:39:10.000Z | metadefender_menlo/api/adaptors/file_submit.py | OPSWAT/metadefender-menlo-integration | 2687d1b08e4cc2610dd4d871402a126d8e5fa59e | [
"MIT"
] | 5 | 2021-02-10T11:38:26.000Z | 2021-09-17T07:07:42.000Z |
class FileSubmit(BaseAdaptor):
pass | 10.25 | 30 | 0.731707 |
3375c875e391268315107a0d1cdbd3d296f3c93d | 18,502 | py | Python | deeplearning/pytorch/src/main/python/examples/Twister2MnistConnect.py | pulasthi/twister2 | 40b73bdf7dcb778d957c3f146baf825a97dceae5 | [
"Apache-2.0"
] | 63 | 2017-08-31T10:02:52.000Z | 2021-12-18T21:42:14.000Z | deeplearning/pytorch/src/main/python/examples/Twister2MnistConnect.py | pulasthi/twister2 | 40b73bdf7dcb778d957c3f146baf825a97dceae5 | [
"Apache-2.0"
] | 284 | 2017-10-20T15:35:26.000Z | 2020-09-11T15:25:40.000Z | deeplearning/pytorch/src/main/python/examples/Twister2MnistConnect.py | pulasthi/twister2 | 40b73bdf7dcb778d957c3f146baf825a97dceae5 | [
"Apache-2.0"
] | 44 | 2017-08-21T19:47:57.000Z | 2020-11-22T22:45:50.000Z | # // Licensed under the Apache License, Version 2.0 (the "License");
# // you may not use this file except in compliance with the License.
# // You may obtain a copy of the License at
# //
# // http://www.apache.org/licenses/LICENSE-2.0
# //
# // Unless required by applicable law or agreed to in writing, softwar... | 35.376673 | 120 | 0.672954 |
3375ced0f82023a4129ec57891569e4226e89a9b | 24,027 | py | Python | acid/structlib.py | dw/acid | 3aabb3940f23c052ed7a009cff5d84cc50b099fb | [
"Apache-2.0"
] | 15 | 2015-09-24T03:57:49.000Z | 2020-08-25T22:44:20.000Z | acid/structlib.py | dw/acid | 3aabb3940f23c052ed7a009cff5d84cc50b099fb | [
"Apache-2.0"
] | 2 | 2015-06-21T02:06:20.000Z | 2019-11-14T14:02:39.000Z | acid/structlib.py | dw/acid | 3aabb3940f23c052ed7a009cff5d84cc50b099fb | [
"Apache-2.0"
] | 1 | 2019-09-11T03:13:52.000Z | 2019-09-11T03:13:52.000Z | #
# Copyright 2013, David Wilson.
#
# 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 writi... | 28.233843 | 74 | 0.522246 |
3375e878744dd8bc6f9bf90694b7511b1287e99c | 14,599 | py | Python | matrix.py | tgillet1/PASTA | 454d7b4595d9ed28ae40c8629d33d7403c579020 | [
"MIT"
] | null | null | null | matrix.py | tgillet1/PASTA | 454d7b4595d9ed28ae40c8629d33d7403c579020 | [
"MIT"
] | null | null | null | matrix.py | tgillet1/PASTA | 454d7b4595d9ed28ae40c8629d33d7403c579020 | [
"MIT"
] | 1 | 2021-09-28T12:11:30.000Z | 2021-09-28T12:11:30.000Z | '''
A high-level class used for modeling various StateMatrix data-structures.
@author: Todd Gillette and Parsa Hosseini
'''
import math
import collections
import decimal
class AbstractMatrix():
"""
A high-level matrix with capability of setting row and column names and
dimensional information.
"""
... | 34.759524 | 99 | 0.571888 |
33761d394816e31d9b0293964ec99263676e5a96 | 12,315 | py | Python | Tests/test_Entrez_online.py | mikepm35/biopython | 9f2d4d8d70ec7223df35fdc3d9c4a3c018756327 | [
"BSD-3-Clause"
] | 1 | 2020-02-13T14:32:44.000Z | 2020-02-13T14:32:44.000Z | Tests/test_Entrez_online.py | EsamTolba/biopython | 120616cf0d28cb8e581898afd6604e5a2065a137 | [
"BSD-3-Clause"
] | null | null | null | Tests/test_Entrez_online.py | EsamTolba/biopython | 120616cf0d28cb8e581898afd6604e5a2065a137 | [
"BSD-3-Clause"
] | 1 | 2019-03-14T18:59:30.000Z | 2019-03-14T18:59:30.000Z | # -*- coding: utf-8 -*-
# Copyright 2012 by Wibowo Arindrarto. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for online Entrez access.
This file include tests for ac... | 42.612457 | 97 | 0.63581 |
3376256999ab6dfd22f1ca716a25bea206fea9d7 | 8,700 | py | Python | utils/terraform/new_python_tools/generate_parameter_doc.py | zengchen1024/developing_util | 071ab31b3946eea0e1c982dc5f8b9a3e5231a5f9 | [
"Apache-2.0"
] | null | null | null | utils/terraform/new_python_tools/generate_parameter_doc.py | zengchen1024/developing_util | 071ab31b3946eea0e1c982dc5f8b9a3e5231a5f9 | [
"Apache-2.0"
] | null | null | null | utils/terraform/new_python_tools/generate_parameter_doc.py | zengchen1024/developing_util | 071ab31b3946eea0e1c982dc5f8b9a3e5231a5f9 | [
"Apache-2.0"
] | 1 | 2018-09-28T01:52:15.000Z | 2018-09-28T01:52:15.000Z | import functools
import os
import re
import sys
import yaml
from convert_word_doc import word_to_params
import mm_param
def run(doc_dir, output):
def _generate_schema(params):
r = []
complex_obj = []
keys = sorted(params.keys())
for k in keys:
v = params[k]
... | 30.313589 | 79 | 0.538391 |
337642ee39caa341ee1056f32c963fd4ac0905de | 1,124 | bzl | Python | metropolis/node/build/kconfig-patcher/kconfig-patcher.bzl | monogon-dev/monogon | 950c26d52a08499ebf45ee2b4b0e46d3bea66dee | [
"Apache-2.0"
] | 31 | 2021-04-04T07:09:41.000Z | 2022-02-14T10:37:35.000Z | metropolis/node/build/kconfig-patcher/kconfig-patcher.bzl | monogon-dev/monogon | 950c26d52a08499ebf45ee2b4b0e46d3bea66dee | [
"Apache-2.0"
] | 116 | 2021-07-05T10:55:20.000Z | 2022-03-29T12:59:30.000Z | metropolis/node/build/kconfig-patcher/kconfig-patcher.bzl | monogon-dev/monogon | 950c26d52a08499ebf45ee2b4b0e46d3bea66dee | [
"Apache-2.0"
] | 2 | 2021-04-13T16:57:06.000Z | 2021-12-17T01:35:18.000Z | # Copyright 2020 The Monogon Project Authors.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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
... | 33.058824 | 75 | 0.652135 |
33764a53ac37ab267222dd0d3d02d8db391ec145 | 15,164 | py | Python | RELEASE_ScaleNet_minimal/models/model_part_GeneralizedRCNNRuiMod_cameraCalib_sep.py | Jerrypiglet/scalenet | 6a5db480e650d10d1e575e93b6cee366d1912c8a | [
"Adobe-2006",
"Adobe-Glyph"
] | 33 | 2020-08-27T09:06:19.000Z | 2022-03-10T02:27:31.000Z | RELEASE_ScaleNet_minimal/models/model_part_GeneralizedRCNNRuiMod_cameraCalib_sep.py | Jerrypiglet/scalenet | 6a5db480e650d10d1e575e93b6cee366d1912c8a | [
"Adobe-2006",
"Adobe-Glyph"
] | 2 | 2020-12-28T04:41:55.000Z | 2021-04-07T06:03:36.000Z | RELEASE_ScaleNet_minimal/models/model_part_GeneralizedRCNNRuiMod_cameraCalib_sep.py | Jerrypiglet/scalenet | 6a5db480e650d10d1e575e93b6cee366d1912c8a | [
"Adobe-2006",
"Adobe-Glyph"
] | 5 | 2020-12-22T03:02:35.000Z | 2021-12-08T09:46:01.000Z | import cv2
import logging
import torch
import torch.nn as nn
# from torchvision import models, transforms
from torchvision import transforms as T
from torchvision.transforms import functional as F
# from torchvision.models.densenet import model_urls
# model_urls['densenet161'] = model_urls['densenet161'].replace('htt... | 45.130952 | 221 | 0.663809 |
33766f9d09aab86df96314e2c7af50dfab1e3f2d | 1,023 | py | Python | example/resnet/convert_resnet_keras.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | example/resnet/convert_resnet_keras.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | example/resnet/convert_resnet_keras.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | """
Example of converting ResNet-50 Keras model
"""
import argparse
import sys
from keras.applications import resnet50
from webdnn.backend import generate_descriptor
from webdnn.frontend.keras import KerasConverter
from webdnn.util import console
def main():
parser = argparse.ArgumentParser()
parser.add_ar... | 29.228571 | 111 | 0.737048 |
33768487bb765bbb6b2fce78b183b89dcccf33a1 | 28,657 | py | Python | readthedocs/rtd_tests/tests/test_project_views.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 2,092 | 2019-06-29T07:47:30.000Z | 2022-03-31T14:54:59.000Z | readthedocs/rtd_tests/tests/test_project_views.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 2,389 | 2019-06-29T04:22:55.000Z | 2022-03-31T22:57:49.000Z | readthedocs/rtd_tests/tests/test_project_views.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 1,185 | 2019-06-29T21:49:31.000Z | 2022-03-30T09:57:15.000Z | from datetime import timedelta
from unittest import mock
from allauth.socialaccount.models import SocialAccount
from django.contrib.auth.models import User
from django.http.response import HttpResponseRedirect
from django.test import TestCase, override_settings
from django.urls import reverse
from django.utils import ... | 39.148907 | 114 | 0.639948 |
3376853a54d0f4676d8a09bcb678c34bdfbd60d8 | 1,622 | py | Python | setup.py | morepath/more.transaction | db8468c65db784c7de39193609c6e6161eaa54d1 | [
"BSD-3-Clause"
] | 3 | 2015-01-10T02:31:49.000Z | 2017-11-26T17:19:26.000Z | setup.py | morepath/more.transaction | db8468c65db784c7de39193609c6e6161eaa54d1 | [
"BSD-3-Clause"
] | 12 | 2015-08-17T09:28:25.000Z | 2021-04-18T14:34:36.000Z | setup.py | morepath/more.transaction | db8468c65db784c7de39193609c6e6161eaa54d1 | [
"BSD-3-Clause"
] | 3 | 2015-02-24T15:07:22.000Z | 2020-09-29T20:44:19.000Z | from setuptools import setup, find_packages
long_description = "\n".join(
(
open("README.rst", encoding="utf-8").read(),
open("CHANGES.txt", encoding="utf-8").read(),
)
)
setup(
name="more.transaction",
version="0.9.dev0",
description="transaction integration for Morepath",
lon... | 31.192308 | 79 | 0.590012 |
3376915ecc6dbb80d60420ddd4dbf247b09f53e4 | 411 | py | Python | venv/Scripts/pip3-script.py | AndreyEmelyanenko/Crawler | 6d12f7a4af98e8db0919b9b7f4fd470f7e073a99 | [
"MIT"
] | null | null | null | venv/Scripts/pip3-script.py | AndreyEmelyanenko/Crawler | 6d12f7a4af98e8db0919b9b7f4fd470f7e073a99 | [
"MIT"
] | null | null | null | venv/Scripts/pip3-script.py | AndreyEmelyanenko/Crawler | 6d12f7a4af98e8db0919b9b7f4fd470f7e073a99 | [
"MIT"
] | null | null | null | #!C:\Users\TOR\PycharmProjects\Crawler\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]... | 31.615385 | 69 | 0.6691 |
3376d01f3369625644a9d21b8294db036be4fa56 | 1,028 | py | Python | scripts/make_featureset.py | pettinato/kaggle_titanic | dd85b1aa0a1c4802294feb37b510878ee9b2ee43 | [
"MIT"
] | null | null | null | scripts/make_featureset.py | pettinato/kaggle_titanic | dd85b1aa0a1c4802294feb37b510878ee9b2ee43 | [
"MIT"
] | null | null | null | scripts/make_featureset.py | pettinato/kaggle_titanic | dd85b1aa0a1c4802294feb37b510878ee9b2ee43 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from src.features import build_features as bf
def main(input_filepath, output_filepath):
"""
Build features and store for further processing.
:param input_filepath: Raw input Titanic training set.
... | 35.448276 | 78 | 0.720817 |
3376de265046d8656eeb6b391be7e910451e4312 | 9,269 | py | Python | txdav/caldav/datastore/sql_external.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txdav/caldav/datastore/sql_external.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txdav/caldav/datastore/sql_external.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | # -*- test-case-name: txdav.caldav.datastore.test.test_sql -*-
##
# Copyright (c) 2013-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apac... | 31.314189 | 142 | 0.694142 |
3376ee8cb11a07b5e7201ac5857d774bbf766d46 | 6,041 | py | Python | NamedMatrix.py | xlu29466/PyGibbCAMP | 2ca7e9ecae69d8f8eb058204f99e322ae1b37670 | [
"Apache-2.0"
] | 10 | 2015-01-05T17:15:05.000Z | 2020-09-26T22:18:30.000Z | NamedMatrix.py | xlu29466/PyGibbCAMP | 2ca7e9ecae69d8f8eb058204f99e322ae1b37670 | [
"Apache-2.0"
] | null | null | null | NamedMatrix.py | xlu29466/PyGibbCAMP | 2ca7e9ecae69d8f8eb058204f99e322ae1b37670 | [
"Apache-2.0"
] | 8 | 2015-01-08T16:38:43.000Z | 2021-11-19T13:09:09.000Z | # -*- coding: utf-8 -*-
"""
A wrapper class enable access data matrix elements by col and row names
Created on Sun Aug 25 08:40:33 2013
@author: xinghualu
"""
import numpy as np
from StringIO import StringIO
class NamedMatrix:
## Constructor
# @param filename=None A string point to a text matrix file
... | 35.745562 | 118 | 0.525575 |
3376f21de2faa7dc2064f00ca41513a9bc86492a | 5,421 | py | Python | network_routing/gaps/cli.py | dvrpc/network-routing | a9ee8a5a3ab8ed7e7c24aefbaa3a03b8cf9416fb | [
"MIT"
] | 3 | 2020-11-04T18:21:30.000Z | 2021-08-24T19:50:04.000Z | network_routing/gaps/cli.py | dvrpc/network-routing | a9ee8a5a3ab8ed7e7c24aefbaa3a03b8cf9416fb | [
"MIT"
] | 1 | 2021-10-18T19:43:12.000Z | 2021-10-18T19:43:12.000Z | network_routing/gaps/cli.py | dvrpc/network-routing | a9ee8a5a3ab8ed7e7c24aefbaa3a03b8cf9416fb | [
"MIT"
] | 1 | 2020-10-14T17:14:43.000Z | 2020-10-14T17:14:43.000Z | """
`gaps`
------
`gaps` is the command-line-interface for the `network_routing.gaps` module.
Examples:
Classify the OSM centerlines by sidewalk coverage
```shell
> gaps classify-osm-sw-coverage
```
You can also see a list of all available configurations by running `gaps --help`
```shell
... | 23.467532 | 84 | 0.650065 |
3376fae161101f55a2471984017789efa6df6daa | 9,634 | py | Python | cupy/cuda/runtime.py | umitanuki/chainer | 225c56b233e684ff4855451d2af4c2fb66915f21 | [
"MIT"
] | null | null | null | cupy/cuda/runtime.py | umitanuki/chainer | 225c56b233e684ff4855451d2af4c2fb66915f21 | [
"MIT"
] | null | null | null | cupy/cuda/runtime.py | umitanuki/chainer | 225c56b233e684ff4855451d2af4c2fb66915f21 | [
"MIT"
] | 1 | 2018-11-18T00:36:51.000Z | 2018-11-18T00:36:51.000Z | """Thin wrapper of CUDA Runtime API.
There are four differences compared to the original C API.
1. Not all functions are ported.
2. Errors are translated into CUDARuntimeError exceptions.
3. The 'cuda' prefix of each API is omitted and the next character is set to
lower case.
4. The resulting values are returned d... | 26.250681 | 79 | 0.630994 |
33771a704c2e170832cc8a998a0538de56de1ae5 | 5,795 | py | Python | language-modeling/lmtool-fwms/src/utils/proj_adaptive_softmax.py | minhtannguyen/transformer-mgk | 304ebf3781b1eb4aeef93f2757319775d2fcdbc4 | [
"CC0-1.0"
] | 5 | 2021-11-06T16:10:31.000Z | 2021-12-25T19:47:42.000Z | language-modeling/lmtool-fwms/src/utils/proj_adaptive_softmax.py | minhtannguyen/transformer-mgk | 304ebf3781b1eb4aeef93f2757319775d2fcdbc4 | [
"CC0-1.0"
] | null | null | null | language-modeling/lmtool-fwms/src/utils/proj_adaptive_softmax.py | minhtannguyen/transformer-mgk | 304ebf3781b1eb4aeef93f2757319775d2fcdbc4 | [
"CC0-1.0"
] | 2 | 2021-11-30T03:36:54.000Z | 2021-12-25T19:49:58.000Z | from collections import defaultdict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
CUDA_MAJOR = int(torch.version.cuda.split('.')[0])
CUDA_MINOR = int(torch.version.cuda.split('.')[1])
class ProjectedAdaptiveLogSoftmax(nn.Module):
def __init__(self, n_token, d_embed, d_pr... | 37.147436 | 79 | 0.524418 |
33774b7eab522e0eb3307be63a6fa34195d8d4df | 1,700 | py | Python | models/utils.py | sorrowyn/C-Tran | 236d785952c59210e6812b4ad5ee12bab585ce4c | [
"MIT"
] | 104 | 2021-01-25T17:27:16.000Z | 2022-03-20T10:17:50.000Z | models/utils.py | mensudza/C-Tran | 4895ccb0e675ae2dcd2b619a9e47f30707062668 | [
"MIT"
] | 9 | 2021-02-26T08:11:46.000Z | 2021-11-17T16:24:52.000Z | models/utils.py | mensudza/C-Tran | 4895ccb0e675ae2dcd2b619a9e47f30707062668 | [
"MIT"
] | 18 | 2021-02-21T14:01:23.000Z | 2022-03-16T08:41:27.000Z |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from pdb import set_trace as stop
import copy
import math
from typing import Optional, List
from torch import nn, Tensor
def custom_replace(tensor,on_neg_1,on_zero,on_one):
res = tensor.clone()
res[tensor==-1] = on_neg_1
... | 30.909091 | 83 | 0.687059 |
33775a3dec90b13e6fef887e83418789839749fc | 11,708 | py | Python | bellman/agents/mepo/mepo_agent.py | RL-Gym/bellman | 210c9ff877b38705d1cf1b3ccd0f9f2644ad8d0d | [
"Apache-2.0"
] | 40 | 2021-03-24T10:41:56.000Z | 2022-03-15T09:50:47.000Z | bellman/agents/mepo/mepo_agent.py | RL-Gym/bellman | 210c9ff877b38705d1cf1b3ccd0f9f2644ad8d0d | [
"Apache-2.0"
] | 12 | 2021-03-25T18:36:27.000Z | 2021-07-27T11:09:34.000Z | bellman/agents/mepo/mepo_agent.py | RL-Gym/bellman | 210c9ff877b38705d1cf1b3ccd0f9f2644ad8d0d | [
"Apache-2.0"
] | 3 | 2021-04-25T03:18:44.000Z | 2021-11-14T15:54:34.000Z | # Copyright 2021 The Bellman 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
#
# Unless required by applicable law or agreed to... | 50.465517 | 100 | 0.721558 |
3377ccc89f22ea9906d12f35bb8cdcfd81ae2c7e | 11,608 | py | Python | ginga/examples/pg/example2_pg.py | Cadair/ginga | 5afdd8824f27c7ae7d8d82b5013b0ff0068bd8b8 | [
"BSD-3-Clause"
] | null | null | null | ginga/examples/pg/example2_pg.py | Cadair/ginga | 5afdd8824f27c7ae7d8d82b5013b0ff0068bd8b8 | [
"BSD-3-Clause"
] | null | null | null | ginga/examples/pg/example2_pg.py | Cadair/ginga | 5afdd8824f27c7ae7d8d82b5013b0ff0068bd8b8 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
#
# example2.py -- Simple, configurable FITS viewer.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
import sys, os
import logging
from ginga import AstroImage, colors
from ginga.canvas.CanvasOb... | 33.549133 | 84 | 0.593125 |
3377d011488fe38f4fd350813681e7c7b1c34ddd | 1,040 | py | Python | src/apps/aprobacion/migrations/0001_initial.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | null | null | null | src/apps/aprobacion/migrations/0001_initial.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | 48 | 2017-04-21T17:35:23.000Z | 2020-08-29T04:19:35.000Z | src/apps/aprobacion/migrations/0001_initial.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-06-10 20:56
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Aprobacion',
fields=[
('id', models.AutoFie... | 40 | 309 | 0.581731 |
3377fa9a41fb7bf1ee3be19ef865fcc5cac730e1 | 13,596 | py | Python | toontown/parties/PublicPartyGui.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/parties/PublicPartyGui.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/parties/PublicPartyGui.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from pandac.PandaModules import Vec3, Vec4, Point3, TextNode, VBase4
from direct.gui.DirectGui import DGG, DirectFrame, DirectButton, DirectLabel, DirectScrolledList, DirectCheckButton
from direct.gui import DirectGuiGlobals
from direct.showbase import DirectObject
from toontown.toonbase import ToonPythonUtil as Python... | 52.292308 | 281 | 0.647764 |
337828dbcdf7b31cd718df448155bb9061c13ef1 | 1,260 | py | Python | code/modelState.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | null | null | null | code/modelState.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | null | null | null | code/modelState.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | null | null | null | #Karan Vombatkere
#Settlers of Catan, 2020
# Modified by Alex Nazaruk, 2021
# #Imports
from AIGame import *
from board import *
from player import *
from heuristicAIPlayer import *
class modelState():
'''Define the variables needed by the RL model using a state and action object
STATE:
Vertices: Array of... | 32.307692 | 122 | 0.702381 |
3378376072049ecbfe5a18c75ad1ac376db4adcc | 4,389 | py | Python | datasets/base/storage_engine/memory_mapped.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 143 | 2021-12-03T02:33:36.000Z | 2022-03-29T00:01:48.000Z | datasets/base/storage_engine/memory_mapped.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 33 | 2021-12-03T10:32:05.000Z | 2022-03-31T02:13:55.000Z | datasets/base/storage_engine/memory_mapped.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 24 | 2021-12-04T06:46:42.000Z | 2022-03-30T07:57:47.000Z | import numpy as np
import pickle
import os
from typing import Union, Iterable
class ByteArrayMemoryMapped:
def __init__(self, path: str):
storage: np.ndarray = np.memmap(path, mode='r')
assert np.array_equal(np.array(memoryview(b"strg"), dtype=np.uint8), storage[0: 4]), 'not a storage file'
... | 36.272727 | 113 | 0.627706 |
337858def714996d308911c848f913ab7fa6994a | 830 | gyp | Python | ui/gfx/ipc/skia/gfx_ipc_skia.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | ui/gfx/ipc/skia/gfx_ipc_skia.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | ui/gfx/ipc/skia/gfx_ipc_skia.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
# GN version: //ui/gfx/ipc/skia
'target_name': 'gfx_ipc_skia',
'type':... | 23.714286 | 72 | 0.491566 |
33786eb16ebde29f9f82fca88c98490f8e31b19b | 1,552 | py | Python | {{cookiecutter.project_slug}}/app/core/settings.py | PiochU19/fastapi-cookiecutter | 05de23d1ca3121c317d4aeb78404fd3b25dcad99 | [
"MIT"
] | 1 | 2022-03-14T12:27:21.000Z | 2022-03-14T12:27:21.000Z | {{cookiecutter.project_slug}}/app/core/settings.py | PiochU19/fastapi-cookiecutter | 05de23d1ca3121c317d4aeb78404fd3b25dcad99 | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/app/core/settings.py | PiochU19/fastapi-cookiecutter | 05de23d1ca3121c317d4aeb78404fd3b25dcad99 | [
"MIT"
] | null | null | null | from enum import Enum
from typing import Any, Dict, List
from app.core.exceptions import AppConfigurationException
from pydantic import BaseSettings, Field, root_validator, validator
class Environments(str, Enum):
PRODUCTION: str = "PRODUCTION"
DEVELOPMENT: str = "DEVELOPMENT"
class Settings(BaseSettings):... | 30.431373 | 117 | 0.650773 |
3378855854d4bf199627140c800f0b314fc0d672 | 3,581 | py | Python | examples/example.py | mjavaid/BootIntegrityValidator | bc0735cc8f53393087dc1db0612796ad16b0367a | [
"MIT"
] | 4 | 2019-03-15T21:46:07.000Z | 2022-02-23T04:18:22.000Z | examples/example.py | mjavaid/BootIntegrityValidator | bc0735cc8f53393087dc1db0612796ad16b0367a | [
"MIT"
] | 4 | 2021-07-19T14:04:00.000Z | 2022-03-31T23:11:54.000Z | examples/example.py | mjavaid/BootIntegrityValidator | bc0735cc8f53393087dc1db0612796ad16b0367a | [
"MIT"
] | 1 | 2022-02-22T19:51:40.000Z | 2022-02-22T19:51:40.000Z | import logging
import BootIntegrityValidator
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
#####################################################################################
#
# Pass in the Known Good Values file to initialize the BootIntegrityValidator
# known_good_valu... | 36.917526 | 92 | 0.663502 |
3378a1567d98965ef7c1676f00c4d11eb5cf8589 | 130,002 | py | Python | SCRAPE/Lib/site-packages/twisted/test/test_ftp.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | SCRAPE/Lib/site-packages/twisted/test/test_ftp.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | SCRAPE/Lib/site-packages/twisted/test/test_ftp.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
FTP tests.
"""
import errno
import getpass
import os
import random
import string
from io import BytesIO
from zope.interface import implementer
from zope.interface.verify import verifyClass
from twisted.cred import checkers, credentials, por... | 33.943081 | 88 | 0.598714 |
3378d5e669be2b4a2920582b527497229ec18035 | 45,399 | py | Python | test-script.py | TemplarJQ/pycoindAnnotationVersion | d33b4c455c4654e0fde35500d230437210d5325e | [
"MIT"
] | null | null | null | test-script.py | TemplarJQ/pycoindAnnotationVersion | d33b4c455c4654e0fde35500d230437210d5325e | [
"MIT"
] | null | null | null | test-script.py | TemplarJQ/pycoindAnnotationVersion | d33b4c455c4654e0fde35500d230437210d5325e | [
"MIT"
] | null | null | null | import unittest
import pycoind
class TestScriptTransactions(unittest.TestCase):
class MockTransaction(pycoind.blockchain.transaction.Transaction):
"""Script only requires the wrapper to include the raw Txn. Many
operations will otherwise fail on this object, so do not try this
in your d... | 113.214464 | 17,496 | 0.851957 |
3378dd11552b21dc228b152e01ba9c9c6169eb2c | 6,204 | py | Python | examples/property_prediction/MTL/utils.py | siboehm/dgl-lifesci | f8a176414b21b72c5ca1f8c7eb8d64702432ae24 | [
"Apache-2.0"
] | 390 | 2020-06-05T13:16:18.000Z | 2022-03-31T07:36:34.000Z | examples/property_prediction/MTL/utils.py | siboehm/dgl-lifesci | f8a176414b21b72c5ca1f8c7eb8d64702432ae24 | [
"Apache-2.0"
] | 71 | 2020-06-12T05:26:56.000Z | 2022-03-29T06:26:39.000Z | examples/property_prediction/MTL/utils.py | siboehm/dgl-lifesci | f8a176414b21b72c5ca1f8c7eb8d64702432ae24 | [
"Apache-2.0"
] | 113 | 2020-06-08T18:48:18.000Z | 2022-03-22T01:16:26.000Z | import dgl
import errno
import numpy as np
import os
import random
import torch
from model import *
def mkdir_p(path):
"""Create a folder for the given path.
Parameters
----------
path: str
Folder to create
"""
try:
os.makedirs(path)
print('Created directory {}'.format(... | 36.928571 | 97 | 0.57334 |
3378dd88b6767ec58a3a9bdd4b7f25915c35e5fd | 2,491 | py | Python | docs/metrics/status.py | OrkoHunter/augur | 98be049680f5bdcea4bb3db6698a14f0d7e0bdfd | [
"MIT"
] | null | null | null | docs/metrics/status.py | OrkoHunter/augur | 98be049680f5bdcea4bb3db6698a14f0d7e0bdfd | [
"MIT"
] | null | null | null | docs/metrics/status.py | OrkoHunter/augur | 98be049680f5bdcea4bb3db6698a14f0d7e0bdfd | [
"MIT"
] | null | null | null | import os
import re
import json
import glob
import webbrowser
from flask import Flask, request, Response
metric_files = ['upstream/1_Diversity-Inclusion.md', 'upstream/2_Growth-Maturity-Decline.md', 'upstream/3_Risk.md', 'upstream/4_Value.md']
metric_type_by_file = {
'upstream/1_Diversity-Inclusion.md': 'Diversit... | 28.965116 | 172 | 0.652348 |
3378ee53bb7b51e1e904220cd72cf0afa70137f1 | 116 | py | Python | lighttpd/datadog_checks/lighttpd/__init__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 4 | 2021-06-21T19:21:49.000Z | 2021-06-23T21:21:55.000Z | lighttpd/datadog_checks/lighttpd/__init__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2018-08-15T05:50:17.000Z | 2018-08-15T05:50:17.000Z | lighttpd/datadog_checks/lighttpd/__init__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2021-06-21T19:21:51.000Z | 2021-06-21T19:21:51.000Z | from .lighttpd import Lighttpd
from .__about__ import __version__
__all__ = [
'Lighttpd',
'__version__',
]
| 14.5 | 34 | 0.706897 |
337903c438b96582e5c755d6d228b0c275876bae | 1,914 | py | Python | tests/test_database.py | miaoyinb/watts | 3f8b812d3bae9cff4fa87f7104f57a1d294a83ca | [
"MIT"
] | null | null | null | tests/test_database.py | miaoyinb/watts | 3f8b812d3bae9cff4fa87f7104f57a1d294a83ca | [
"MIT"
] | null | null | null | tests/test_database.py | miaoyinb/watts | 3f8b812d3bae9cff4fa87f7104f57a1d294a83ca | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2022 UChicago Argonne, LLC
# SPDX-License-Identifier: MIT
from datetime import datetime
from pathlib import Path
import pytest
import watts
@pytest.fixture(autouse=True, scope='module')
def restore_database_path():
db_path = watts.Database.get_default_path()
yield
watts.Databas... | 26.219178 | 76 | 0.687043 |
33790e477b8e9b78b3a9fc4abebb22dd72c076cc | 39,618 | py | Python | PBH-DM/Omega_h2_FI.py | earlyuniverse/ulysses | 9b8bade6d2d6badf2f17bac37306ea7ebceeeb4a | [
"MIT"
] | 9 | 2020-07-21T17:08:18.000Z | 2022-02-05T18:52:56.000Z | PBH-DM/Omega_h2_FI.py | earlyuniverse/ulysses | 9b8bade6d2d6badf2f17bac37306ea7ebceeeb4a | [
"MIT"
] | 2 | 2020-07-23T03:24:57.000Z | 2021-05-17T23:17:12.000Z | PBH-DM/Omega_h2_FI.py | earlyuniverse/ulysses | 9b8bade6d2d6badf2f17bac37306ea7ebceeeb4a | [
"MIT"
] | 1 | 2021-09-16T16:20:58.000Z | 2021-09-16T16:20:58.000Z | ###################################################################################################
# #
# Primordial Black Hole + Dark Matter Generation. #
# ... | 37.165103 | 201 | 0.427079 |
33792a244feb143fde550ab31fb98f962cb41cef | 2,392 | py | Python | sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/__init__.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 34.171429 | 76 | 0.715301 |
33795041170ddc6478cde3d97202b61b017481a4 | 2,083 | py | Python | doks/variables.py | rec/doks | 8fb1c2779bb40cbae9427c3be357231543e89d54 | [
"MIT"
] | 1 | 2020-10-31T03:25:23.000Z | 2020-10-31T03:25:23.000Z | doks/variables.py | rec/doks | 8fb1c2779bb40cbae9427c3be357231543e89d54 | [
"MIT"
] | 15 | 2020-05-29T11:50:13.000Z | 2020-12-08T11:07:45.000Z | doks/variables.py | rec/doks | 8fb1c2779bb40cbae9427c3be357231543e89d54 | [
"MIT"
] | null | null | null | import os
import re
import subprocess
import sys
ENV_PREFIX = 'DOKS_'
DEFAULTS = {'vcstype': 'github'}
FILL_INS = (('packagename', 'repo'),)
SUB = {'stderr': subprocess.DEVNULL, 'encoding': 'utf8'}
def remotes(path):
cmd = 'git', 'remote', '-v'
cwd = (path if os.path.isdir(path) else os.path.dirname(path)) o... | 25.402439 | 74 | 0.581373 |
337981614fbb092f8e0ac3bc4b915e8ba8f00531 | 11,510 | py | Python | test/kb_reaction_gene_finder_server_test.py | janakagithub/kb_rxn_gene_finder | 49e2cc6483849a83c311968693fda0012bda6484 | [
"MIT"
] | 1 | 2019-05-06T20:44:11.000Z | 2019-05-06T20:44:11.000Z | test/kb_reaction_gene_finder_server_test.py | janakagithub/kb_rxn_gene_finder | 49e2cc6483849a83c311968693fda0012bda6484 | [
"MIT"
] | null | null | null | test/kb_reaction_gene_finder_server_test.py | janakagithub/kb_rxn_gene_finder | 49e2cc6483849a83c311968693fda0012bda6484 | [
"MIT"
] | 2 | 2018-12-19T12:58:48.000Z | 2018-12-19T13:01:55.000Z | # -*- coding: utf-8 -*-
import re
import os
import time
import unittest
from configparser import ConfigParser
from collections import Counter
from pprint import pprint
from kb_reaction_gene_finder.kb_reaction_gene_finderImpl import kb_reaction_gene_finder
from kb_reaction_gene_finder.kb_reaction_gene_finderServer impo... | 45.856574 | 115 | 0.589227 |
337a3019e52e51b8c032074c6a100c91eb01e936 | 996 | py | Python | 2/led.py | ZYM-PKU/Raspberry-3B | bca939a71575d7298d09a8f56cd697ddf63f34d5 | [
"MIT"
] | null | null | null | 2/led.py | ZYM-PKU/Raspberry-3B | bca939a71575d7298d09a8f56cd697ddf63f34d5 | [
"MIT"
] | null | null | null | 2/led.py | ZYM-PKU/Raspberry-3B | bca939a71575d7298d09a8f56cd697ddf63f34d5 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
import time
LED = 26
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED,GPIO.OUT)
def display1():
'''利用原始方法控制led闪烁'''
state=0
try:
while True:
state=1 if state==0 else 0#变换状态
GPIO.output(LED,state)
time.sleep(0.2)
except KeyboardInterrupt:
... | 18.444444 | 43 | 0.5251 |
337a39d2c015aa2090d94e3ea6292b5e5f47a979 | 912 | py | Python | h/services/groupfinder.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | h/services/groupfinder.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | 4 | 2020-03-24T17:38:24.000Z | 2022-03-02T05:45:01.000Z | h/services/groupfinder.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from zope.interface import implementer
from h import models
from h.interfaces import IGroupService
from h.util.db import lru_cache_in_transaction
# Ideally this would be called the GroupService to match the nomenclature of
# the interface.
# FIXME: re... | 28.5 | 82 | 0.756579 |
337a457ac048219d88ffe02caf6bb7b918dba017 | 939 | py | Python | srfnef/io/auto_dump.py | twj2417/srf | 63365cfd75199d70eea2273214a4fa580a9fdf2a | [
"Apache-2.0"
] | null | null | null | srfnef/io/auto_dump.py | twj2417/srf | 63365cfd75199d70eea2273214a4fa580a9fdf2a | [
"Apache-2.0"
] | null | null | null | srfnef/io/auto_dump.py | twj2417/srf | 63365cfd75199d70eea2273214a4fa580a9fdf2a | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
'''
@author: Minghao Guo
@contact: mh.guo0111@gmail.com
@software: nef
@file: auto_dump.py
@date: 7/8/2019
@desc:
'''
import json
from srfnef import NefBaseClass
def auto_dump(obj: NefBaseClass, tags: dict) -> str:
dct = obj.asdict(recurse = True)
for key, val in dct.items():
if key... | 24.076923 | 59 | 0.631523 |
337a5cc5766fc7de48d56258e618674b32b82d15 | 4,755 | py | Python | tests/measure_tests/numerical_data_tests/euclidean_distance_test.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 23 | 2015-01-21T01:39:11.000Z | 2019-08-27T09:43:39.000Z | tests/measure_tests/numerical_data_tests/euclidean_distance_test.py | cenkbircanoglu/similarityPy | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 1 | 2021-07-24T19:55:47.000Z | 2021-07-24T19:55:47.000Z | tests/measure_tests/numerical_data_tests/euclidean_distance_test.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 6 | 2015-03-23T16:58:18.000Z | 2019-03-12T06:31:56.000Z | # coding=utf-8
from unittest import TestCase
from similarityPy.measure.numerical_data.euclidean_distance import EuclideanDistance
from tests import test_logger
__author__ = 'cenk'
class EuclideanDistanceTest(TestCase):
def test_algorithm(self):
test_logger.debug("EuclideanDistanceTest - test_algorithm ... | 36.576923 | 95 | 0.539432 |
337a63b204cff6856f85e56bd214a348a1ac60b7 | 1,743 | py | Python | data/transcoder_evaluation_gfg/python/MAXIMUM_SUBARRAY_SUM_ARRAY_CREATED_REPEATED_CONCATENATION.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/MAXIMUM_SUBARRAY_SUM_ARRAY_CREATED_REPEATED_CONCATENATION.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/MAXIMUM_SUBARRAY_SUM_ARRAY_CREATED_REPEATED_CONCATENATION.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( a , n , k ) :
max_so_far = - 2147483648
max_ending_here = 0
for i in range ( n * k ) :
max_endi... | 45.868421 | 168 | 0.496845 |
337a63c5d0d87ce4daaea4febda4aab46374ce51 | 44 | py | Python | RebeccaEncryption/RebeccaError.py | algalopez/MetaRepository | b8b0c94d459dd9f91b35f70a380d52f77ed60c77 | [
"BSD-3-Clause"
] | null | null | null | RebeccaEncryption/RebeccaError.py | algalopez/MetaRepository | b8b0c94d459dd9f91b35f70a380d52f77ed60c77 | [
"BSD-3-Clause"
] | 1 | 2020-01-30T19:49:09.000Z | 2020-02-08T13:56:53.000Z | RebeccaEncryption/RebeccaError.py | algalopez/aglPython | b8b0c94d459dd9f91b35f70a380d52f77ed60c77 | [
"BSD-3-Clause"
] | 2 | 2020-10-01T15:35:47.000Z | 2020-10-01T15:42:10.000Z |
class EncryptionError(Exception):
pass
| 11 | 33 | 0.75 |
337a8cf1a9f319cdb9c14ee4d2a61c27d7ac046e | 6,165 | py | Python | tests/test_proj_functor.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | null | null | null | tests/test_proj_functor.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | null | null | null | tests/test_proj_functor.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | null | null | null | from typing import cast, Callable
import subprocess
import petra as pt
import unittest
from ctypes import CFUNCTYPE, c_int32
program = pt.Program("module")
# Global variables
LEGION_MAX_DIM = 2
MAX_DOMAIN_DIM = 2 * LEGION_MAX_DIM
DIM = 1
# Define types:
legion_region_tree_id_t = pt.Int32_t # unsig... | 33.873626 | 108 | 0.630333 |
337a993faed238898fb927b271e458305047d30f | 42,970 | py | Python | mathics/builtin/arithmetic.py | rebcabin/mathics-core | 0cbf808fb9fb91e0a32d0aa9d1af1477d0258f41 | [
"Apache-2.0"
] | null | null | null | mathics/builtin/arithmetic.py | rebcabin/mathics-core | 0cbf808fb9fb91e0a32d0aa9d1af1477d0258f41 | [
"Apache-2.0"
] | null | null | null | mathics/builtin/arithmetic.py | rebcabin/mathics-core | 0cbf808fb9fb91e0a32d0aa9d1af1477d0258f41 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# cython: language_level=3
"""
Mathematical Functions
Basic arithmetic functions, including complex number arithmetic.
"""
import sympy
import sys
import mpmath
from functools import lru_cache
from mathics.builtin.base import (
Builtin,
PostfixOperator,
Predefined,
SympyFunc... | 27.848347 | 156 | 0.548685 |
337aa5b90a175caea4ae3cb170f1118d1e02aa2e | 7,999 | py | Python | google/cloud/compute_v1/services/snapshots/transports/base.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/snapshots/transports/base.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/snapshots/transports/base.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 35.551111 | 101 | 0.644456 |
337aaa7047344f0c45a51f7d8854694befc06e8c | 19,476 | py | Python | third_party/WebKit/Tools/Scripts/webkitpy/style/optparser.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-07-15T09:50:14.000Z | 2020-07-15T09:50:14.000Z | third_party/WebKit/Tools/Scripts/webkitpy/style/optparser.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/WebKit/Tools/Scripts/webkitpy/style/optparser.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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
# notice, this list of conditions and... | 42.617068 | 118 | 0.635089 |
337ad060390d813e7e010e09150ddf24bc2a9010 | 1,717 | py | Python | end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py | JamesHinshelwood/openapi-python-client | 08bc2acf91d50d4fcdd7f0e50a8b0d3f00a187d9 | [
"MIT"
] | 1 | 2022-02-17T11:45:13.000Z | 2022-02-17T11:45:13.000Z | end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py | guioliveirabh/openapi-python-client | d8d9cecffe41c5dc1c43bc667598b90f0d9253ca | [
"MIT"
] | null | null | null | end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py | guioliveirabh/openapi-python-client | d8d9cecffe41c5dc1c43bc667598b90f0d9253ca | [
"MIT"
] | null | null | null | from typing import Any, Dict
import httpx
from ...client import Client
from ...types import Response
def _get_kwargs(
*,
client: Client,
my_token: str,
) -> Dict[str, Any]:
url = "{}/auth/token_with_cookie".format(client.base_url)
headers: Dict[str, str] = client.get_headers()
cookies: Dict... | 18.462366 | 70 | 0.609202 |
337ad672ab3ffbc43371bc38466334b58a141df1 | 1,897 | py | Python | Data Structures/Graphs/maze.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | Data Structures/Graphs/maze.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | Data Structures/Graphs/maze.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | from collections import deque
class Node():
def __init__(self, val):
self.visited = False
self.val = val
self.prev = None
def setPrevious(self, node):
self.prev = node
def setVisited(self):
self.visited = True
def resetVisited(self):
self.visited = Fa... | 20.619565 | 48 | 0.503954 |
337ad7710e248bd6ef76c04a66fb6d5e0ba1fbdf | 30,960 | py | Python | satviz/scripts/visualize_path.py | patrickkon/hypatia | 3cbcaa9a5f377141628b4b3ef2808e1fe3e4b388 | [
"MIT"
] | null | null | null | satviz/scripts/visualize_path.py | patrickkon/hypatia | 3cbcaa9a5f377141628b4b3ef2808e1fe3e4b388 | [
"MIT"
] | null | null | null | satviz/scripts/visualize_path.py | patrickkon/hypatia | 3cbcaa9a5f377141628b4b3ef2808e1fe3e4b388 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Debopam Bhattacherjee
#
# 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, modif... | 48.074534 | 367 | 0.640698 |
337adffb59b61e5adb032bc3c376df42c0dbdacc | 55,734 | py | Python | lib/rucio/core/rse.py | jamesp-epcc/rucio | d36d346ea569e89ea413d4241bb69189dfeee7db | [
"Apache-2.0"
] | null | null | null | lib/rucio/core/rse.py | jamesp-epcc/rucio | d36d346ea569e89ea413d4241bb69189dfeee7db | [
"Apache-2.0"
] | null | null | null | lib/rucio/core/rse.py | jamesp-epcc/rucio | d36d346ea569e89ea413d4241bb69189dfeee7db | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2012-2021 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.724875 | 191 | 0.63995 |
337ae93da2423932de38cfb13b02a4e6391a4a68 | 10,046 | py | Python | smrf/utils/queue.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | smrf/utils/queue.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | smrf/utils/queue.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | """
Create classes for running on multiple threads
20160323 Scott Havens
"""
try:
from Queue import Queue, Empty, Full
except:
from queue import Queue, Empty, Full
import logging
import sys
import threading
from time import time as _time
import numpy as np
class DateQueue_Threading(Queue):
"""
Dat... | 33.264901 | 94 | 0.547382 |
337af19031c12c8068a4faf4c05c91da4b9c8b50 | 1,000 | py | Python | JDjango/api/djangotools/views/gets.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | 3 | 2020-12-28T05:09:02.000Z | 2021-06-23T10:02:03.000Z | JDjango/api/djangotools/views/gets.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | JDjango/api/djangotools/views/gets.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | from ..common import *
from .. import config as SCONFIGS
__all__ = [
'get_location_from_viewspy', # 定位视图在文件中的位置
]
def get_location_from_viewspy(app_name: str, def_class_name: str, dirname: str=None):
"""定位视图在文件中的位置
不提供 dirname 的路径,则默认是当前选中项目的根路径
"""
if "" == app_name or "" == def_class_na... | 34.482759 | 85 | 0.613 |
337b03b3ff711889dff35740df931b27064d8bce | 4,544 | py | Python | docs/source/conf.py | febuiles/two1-python | 88704487dba7715f97a0980781d4c0efb2ea7fc4 | [
"BSD-2-Clause-FreeBSD"
] | 415 | 2016-06-10T00:46:55.000Z | 2021-10-16T00:56:06.000Z | docs/source/conf.py | febuiles/two1-python | 88704487dba7715f97a0980781d4c0efb2ea7fc4 | [
"BSD-2-Clause-FreeBSD"
] | 25 | 2016-06-11T13:48:59.000Z | 2021-01-05T11:19:30.000Z | docs/source/conf.py | febuiles/two1-python | 88704487dba7715f97a0980781d4c0efb2ea7fc4 | [
"BSD-2-Clause-FreeBSD"
] | 109 | 2016-06-11T05:17:05.000Z | 2021-12-22T11:02:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# two1 documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 27 15:54:43 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 32 | 79 | 0.6875 |
337b0defe03a397208d2af37a1eefd257686dfe9 | 8,155 | py | Python | pcdsdevices/ccm.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pcdsdevices/ccm.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pcdsdevices/ccm.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | import logging
import time
import numpy as np
from ophyd.device import Component as Cpt
from ophyd.device import FormattedComponent as FCpt
from ophyd.pseudopos import PseudoPositioner
from ophyd.pv_positioner import PVPositionerPC
from ophyd.signal import AttributeSignal, EpicsSignal, EpicsSignalRO
from .epics_motor... | 33.698347 | 79 | 0.658737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.