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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f718af4f6cc559aadfef9f792ebdb4072e29d55f | 299 | py | Python | SoccerDataCrawler/pipelines.py | saadchoukry/Ultimate-Manager-Assistant | 33584e83953dcf59970c9d7b5ec8e686e9aed89f | [
"MIT"
] | null | null | null | SoccerDataCrawler/pipelines.py | saadchoukry/Ultimate-Manager-Assistant | 33584e83953dcf59970c9d7b5ec8e686e9aed89f | [
"MIT"
] | null | null | null | SoccerDataCrawler/pipelines.py | saadchoukry/Ultimate-Manager-Assistant | 33584e83953dcf59970c9d7b5ec8e686e9aed89f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
class SoccerdatacrawlerPipeline(object):
def process_item(self, item, spider):
return item
| 24.916667 | 66 | 0.722408 |
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
class SoccerdatacrawlerPipeline(object):
def process_item(self, item, spider):
return item
| true | true |
f718b1b460678aee54372783e495ef607dfe5f64 | 1,587 | py | Python | evaluate/norvig_spell.py | aiainui/JamSpell | e6f2f28ab46049096bf8292f611d02f873f75d22 | [
"MIT"
] | null | null | null | evaluate/norvig_spell.py | aiainui/JamSpell | e6f2f28ab46049096bf8292f611d02f873f75d22 | [
"MIT"
] | null | null | null | evaluate/norvig_spell.py | aiainui/JamSpell | e6f2f28ab46049096bf8292f611d02f873f75d22 | [
"MIT"
] | null | null | null | import re
from collections import Counter
def words(text): return re.findall(r'\w+', text.lower())
WORDS = Counter()
TOTAL_WORDS = 0
def init(filename = 'big.txt'):
global WORDS
global TOTAL_WORDS
#统计词频,并存储为词典
WORDS = Counter(words(open(filename).read()))
#统计总词数
TOTAL_WORDS=sum(WORDS.values()... | 31.117647 | 83 | 0.617517 | import re
from collections import Counter
def words(text): return re.findall(r'\w+', text.lower())
WORDS = Counter()
TOTAL_WORDS = 0
def init(filename = 'big.txt'):
global WORDS
global TOTAL_WORDS
WORDS = Counter(words(open(filename).read()))
TOTAL_WORDS=sum(WORDS.values())
def P(word, N=Non... | true | true |
f718b204d55fcadab130f4070f6f7ffbad544568 | 4,581 | py | Python | docs/conf.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 24 | 2020-10-16T22:07:38.000Z | 2022-03-24T14:58:03.000Z | docs/conf.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 63 | 2020-10-26T18:26:15.000Z | 2022-03-31T17:31:02.000Z | docs/conf.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 10 | 2020-11-09T11:54:23.000Z | 2022-03-24T20:44:00.000Z | """Sphinx configuration file"""
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup ---------------------------------------... | 33.437956 | 103 | 0.679546 |
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
project = 'Carbon Black Cloud Python SDK'
copyright = '2020-2021, Developer Relations'
author = 'Developer Relations'
release = '1.3.4'
extensions = ['sphinx.ext.napoleon', 'sphinx.ext.autodoc', 'sphinx.ext.autosectionlabel']
templates_path = ['_te... | true | true |
f718b2d2011ebac2f31533e27863f7f07bb850cd | 5,032 | py | Python | perfkitbenchmarker/linux_packages/hbase.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 3 | 2018-04-28T13:06:14.000Z | 2020-06-09T02:39:44.000Z | perfkitbenchmarker/linux_packages/hbase.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 1 | 2021-09-09T07:43:25.000Z | 2021-09-09T10:47:56.000Z | perfkitbenchmarker/linux_packages/hbase.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 6 | 2019-06-11T18:59:57.000Z | 2021-03-02T19:14:42.000Z | # Copyright 2015 PerfKitBenchmarker 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 appli... | 31.254658 | 79 | 0.684221 |
import functools
import logging
import os
import posixpath
import re
from absl import flags
from perfkitbenchmarker import data
from perfkitbenchmarker import linux_packages
from perfkitbenchmarker import vm_util
from perfkitbenchmarker.linux_packages import hadoop
FLAGS = flags.FLAGS
flags.DEFINE_string('hbase_ver... | true | true |
f718b37e8693d0dc75af4742f9e4e99f3f98e05d | 15,690 | py | Python | src/tests/model_helper_test.py | fejesd/script-server | b46c0c25acea4fabe88d3206a404dc1c04e71e37 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/tests/model_helper_test.py | fejesd/script-server | b46c0c25acea4fabe88d3206a404dc1c04e71e37 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/tests/model_helper_test.py | fejesd/script-server | b46c0c25acea4fabe88d3206a404dc1c04e71e37 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | import os
import unittest
from config.constants import FILE_TYPE_FILE, FILE_TYPE_DIR
from model import model_helper
from model.model_helper import read_list, read_dict, fill_parameter_values, resolve_env_vars, \
InvalidFileException, read_bool_from_config, InvalidValueException, InvalidValueTypeException, read_str... | 38.933002 | 119 | 0.651052 | import os
import unittest
from config.constants import FILE_TYPE_FILE, FILE_TYPE_DIR
from model import model_helper
from model.model_helper import read_list, read_dict, fill_parameter_values, resolve_env_vars, \
InvalidFileException, read_bool_from_config, InvalidValueException, InvalidValueTypeException, read_str... | true | true |
f718b4588aba611670b18d91b9a922b3ee82b311 | 5,045 | py | Python | examples/shapefile1.py | yang69can/pyngl | 78a7040ce9de4b7a442b0c3b5faecccab2f01426 | [
"Apache-2.0"
] | 125 | 2016-11-24T09:04:28.000Z | 2022-01-22T14:06:56.000Z | examples/shapefile1.py | yang69can/pyngl | 78a7040ce9de4b7a442b0c3b5faecccab2f01426 | [
"Apache-2.0"
] | 52 | 2017-11-08T23:23:02.000Z | 2022-03-20T03:17:39.000Z | examples/shapefile1.py | yang69can/pyngl | 78a7040ce9de4b7a442b0c3b5faecccab2f01426 | [
"Apache-2.0"
] | 25 | 2017-08-27T10:50:43.000Z | 2022-01-29T14:56:05.000Z | #
# File:
# shapefile1.py
#
# Synopsis:
# Illustrates reading data from a shapefile and coloring U.S. states
# by "Percent unemployment".
#
# Categories:
# Maps only
# Polygons
#
# Author:
# Mary Haley (based on an NCL script of Rick Brownrigg, CISL/NCAR)
#
# Date of initial publication:
# A... | 29.852071 | 83 | 0.637066 |
from __future__ import print_function
import numpy,os
import Ngl, Nio
wks_type = "png"
wks = Ngl.open_wks (wks_type,"shapefile1")
Ngl.define_colormap(wks,"rainbow+gray")
res = Ngl.Resources()
res.mpProjection = "LambertConformal"
res.mpLambertParallel1F = 33 res.mpLambertParallel2F = 45
res.mpLambe... | true | true |
f718b4a0de04341fe33bcd7f98a98e05166f7286 | 631 | py | Python | mmdet/core/bbox/assigners/__init__.py | shouwangzhe134/Decoupled-R-CNN | 7fee5bef6c52a79636f61cfe48babfaf3e4fc088 | [
"Apache-2.0"
] | 1 | 2021-12-03T06:31:29.000Z | 2021-12-03T06:31:29.000Z | mmdet/core/bbox/assigners/__init__.py | shouwangzhe134/Decoupled-R-CNN | 7fee5bef6c52a79636f61cfe48babfaf3e4fc088 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/assigners/__init__.py | shouwangzhe134/Decoupled-R-CNN | 7fee5bef6c52a79636f61cfe48babfaf3e4fc088 | [
"Apache-2.0"
] | null | null | null | from .approx_max_iou_assigner import ApproxMaxIoUAssigner
from .assign_result import AssignResult
from .atss_assigner import ATSSAssigner
from .base_assigner import BaseAssigner
from .center_region_assigner import CenterRegionAssigner
from .grid_assigner import GridAssigner
from .max_iou_assigner import MaxIoUAssigner
... | 39.4375 | 77 | 0.836767 | from .approx_max_iou_assigner import ApproxMaxIoUAssigner
from .assign_result import AssignResult
from .atss_assigner import ATSSAssigner
from .base_assigner import BaseAssigner
from .center_region_assigner import CenterRegionAssigner
from .grid_assigner import GridAssigner
from .max_iou_assigner import MaxIoUAssigner
... | true | true |
f718b4fadc70811185014ceea7a2ac977f84aa08 | 1,472 | py | Python | src/server/core/tests/test_config.py | Freshia/masakhane-web | acf5eaef7ab8109d6f10f212765572a1dc893cd5 | [
"MIT"
] | 20 | 2021-04-09T09:08:53.000Z | 2022-03-16T09:45:36.000Z | src/server/core/tests/test_config.py | Freshia/masakhane-web | acf5eaef7ab8109d6f10f212765572a1dc893cd5 | [
"MIT"
] | 15 | 2021-04-19T07:04:56.000Z | 2022-03-12T00:57:44.000Z | src/server/core/tests/test_config.py | Freshia/masakhane-web | acf5eaef7ab8109d6f10f212765572a1dc893cd5 | [
"MIT"
] | 14 | 2021-04-19T04:39:04.000Z | 2021-10-08T22:19:58.000Z | import os
import unittest
from flask import current_app
from flask_testing import TestCase
from core import masakhane
class TestDevelopmentConfig(TestCase):
def create_app(self):
masakhane.config.from_object('core.config.DevelopmentConfig')
return masakhane
def test_app_is_development(self)... | 32 | 77 | 0.688179 | import os
import unittest
from flask import current_app
from flask_testing import TestCase
from core import masakhane
class TestDevelopmentConfig(TestCase):
def create_app(self):
masakhane.config.from_object('core.config.DevelopmentConfig')
return masakhane
def test_app_is_development(self)... | true | true |
f718b51aeb1c66972fd4cac0104213008e7d09c8 | 2,379 | py | Python | src/tests/unit/nlp/algorithms/test_unit_spacy_utils.py | AITestingOrg/aide--spacy-nlp-service | aa6573d6a7630c78e7729f52b5e7347b8e39ac6f | [
"MIT"
] | null | null | null | src/tests/unit/nlp/algorithms/test_unit_spacy_utils.py | AITestingOrg/aide--spacy-nlp-service | aa6573d6a7630c78e7729f52b5e7347b8e39ac6f | [
"MIT"
] | null | null | null | src/tests/unit/nlp/algorithms/test_unit_spacy_utils.py | AITestingOrg/aide--spacy-nlp-service | aa6573d6a7630c78e7729f52b5e7347b8e39ac6f | [
"MIT"
] | null | null | null | """Tests some of the helper methods in algorithms.spacy_utils"""
import pytest
import tests.unit.utils.spacy_utils as utils
from analysis.algorithms.spacy_utils import extract_compound_dependencies
from analysis.algorithms.spacy_utils import extract_dependencies
SHORT_SENTENCE = "Computer hardware is important"
SENTE... | 34.478261 | 98 | 0.752417 |
import pytest
import tests.unit.utils.spacy_utils as utils
from analysis.algorithms.spacy_utils import extract_compound_dependencies
from analysis.algorithms.spacy_utils import extract_dependencies
SHORT_SENTENCE = "Computer hardware is important"
SENTENCE_NO_COMPOUNDS = "there is a beautiful place somewhere that has... | true | true |
f718b75cfa0df5a38dc13850f1b1daf269e241b4 | 1,506 | py | Python | sdk/servicebus/azure-servicebus/azure/servicebus/__init__.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/servicebus/azure-servicebus/azure/servicebus/__init__.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/servicebus/azure-servicebus/azure/servicebus/__init__.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from uamqp i... | 28.961538 | 75 | 0.706507 | from uamqp import constants
from ._version import VERSION
__version__ = VERSION
from ._servicebus_client import ServiceBusClient
from ._servicebus_sender import ServiceBusSender
from ._servicebus_receiver import ServiceBusReceiver
from ._servicebus_session import ServiceBusSession
from ._common.message import (
... | true | true |
f718b7659cb335872792dd44aa202fbec8c95638 | 4,465 | py | Python | src/models/modules/rnn_decoder.py | jopetty/transd-dev | 0078dfd8a049f5b97a7b3be6e883821e4994d4c0 | [
"MIT"
] | null | null | null | src/models/modules/rnn_decoder.py | jopetty/transd-dev | 0078dfd8a049f5b97a7b3be6e883821e4994d4c0 | [
"MIT"
] | null | null | null | src/models/modules/rnn_decoder.py | jopetty/transd-dev | 0078dfd8a049f5b97a7b3be6e883821e4994d4c0 | [
"MIT"
] | null | null | null | import random
from typing import Dict
import torch
from torch import Tensor, nn
from torch.nn import functional as F
class RNNDecoder(nn.Module):
@property
def max_gen_length(self) -> int:
return self.hparams["dec_max_gen_length"]
@property
def EOS_idx(self) -> int:
return self.hpara... | 32.830882 | 88 | 0.57738 | import random
from typing import Dict
import torch
from torch import Tensor, nn
from torch.nn import functional as F
class RNNDecoder(nn.Module):
@property
def max_gen_length(self) -> int:
return self.hparams["dec_max_gen_length"]
@property
def EOS_idx(self) -> int:
return self.hpara... | true | true |
f718b7acac4aead0303354569b3ffa0a259d91e7 | 1,914 | py | Python | baselines/baseline2/summarize/sumy/summarizers/_summarizer.py | PKULiuHui/LiveBlogSum | b6a22521ee454e649981d70ddca6c89a1bac5a4c | [
"MIT"
] | 28 | 2017-06-02T08:39:49.000Z | 2022-03-04T09:48:16.000Z | ukpsummarizer-be/summarizer/baselines/sumy/sumy/summarizers/_summarizer.py | AIPHES/vldb2018-sherlock | 3746efa35c4c1769cc4aaeb15aeb9453564e1226 | [
"Apache-2.0"
] | null | null | null | ukpsummarizer-be/summarizer/baselines/sumy/sumy/summarizers/_summarizer.py | AIPHES/vldb2018-sherlock | 3746efa35c4c1769cc4aaeb15aeb9453564e1226 | [
"Apache-2.0"
] | 16 | 2017-06-22T07:48:27.000Z | 2019-12-23T17:44:52.000Z | # -*- coding: utf8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from collections import namedtuple
from operator import attrgetter
from ..utils import ItemsCount
from .._compat import to_unicode
from ..nlp.stemmers import null_stemmer
from nltk import w... | 33.578947 | 84 | 0.669801 |
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from collections import namedtuple
from operator import attrgetter
from ..utils import ItemsCount
from .._compat import to_unicode
from ..nlp.stemmers import null_stemmer
from nltk import word_tokenize
SentenceI... | true | true |
f718b877f9cbe06c7a235e035dbfefb4ed16beec | 394 | py | Python | parsers/defaults.py | ZenRows/scaling-to-distributed-crawling | 3da8d35327f888fcb047b588e7cb698494b4debe | [
"MIT"
] | 12 | 2021-08-25T10:13:44.000Z | 2022-03-24T06:48:54.000Z | parsers/defaults.py | ZenRows/scaling-to-distributed-crawling | 3da8d35327f888fcb047b588e7cb698494b4debe | [
"MIT"
] | null | null | null | parsers/defaults.py | ZenRows/scaling-to-distributed-crawling | 3da8d35327f888fcb047b588e7cb698494b4debe | [
"MIT"
] | 4 | 2021-08-28T22:50:16.000Z | 2022-03-23T02:02:00.000Z | import repo
from collectors import basic
def extract_content(url, soup):
return soup.title.string # extract page's title
def store_content(url, content):
# store in a hash with the URL as the key and the title as the content
repo.set_content(url, content)
def allow_url_filter(url):
return True #... | 19.7 | 74 | 0.728426 | import repo
from collectors import basic
def extract_content(url, soup):
return soup.title.string
def store_content(url, content):
# store in a hash with the URL as the key and the title as the content
repo.set_content(url, content)
def allow_url_filter(url):
return True # allow all by default
... | true | true |
f718ba3c617c375dee8540ada5548435f7892c63 | 16,710 | py | Python | test/functional/qtum_evm_create2.py | SeqSEE/Metrix | ea6ba7fcc3d775740d78a10e88ce4da5a84db6a3 | [
"MIT"
] | 26 | 2019-06-26T05:47:35.000Z | 2022-03-01T04:50:11.000Z | test/functional/qtum_evm_create2.py | SeqSEE/Metrix | ea6ba7fcc3d775740d78a10e88ce4da5a84db6a3 | [
"MIT"
] | 15 | 2018-08-29T21:58:38.000Z | 2019-05-17T10:31:22.000Z | test/functional/qtum_evm_create2.py | SeqSEE/Metrix | ea6ba7fcc3d775740d78a10e88ce4da5a84db6a3 | [
"MIT"
] | 24 | 2018-08-13T11:10:50.000Z | 2019-06-08T02:49:36.000Z | #!/usr/bin/env python3
# Copyright (c) 2016-2019 The Qtum Core developers
# Copyright (c) 2020 The Metrix Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramewo... | 74.598214 | 5,387 | 0.795212 |
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.metrix import *
from test_framework.qtumconfig import *
import sys
import io
import pprint
class QtumEVMCreate2Test(BitcoinTes... | true | true |
f718baf74518818d797d42c1119cb4a8e3f94fa1 | 6,048 | py | Python | capsule_em/norb/norb_record.py | continue-nature/google-research | 7011fe008efc4f11592ace842dbd4c9dffd46c29 | [
"Apache-2.0"
] | null | null | null | capsule_em/norb/norb_record.py | continue-nature/google-research | 7011fe008efc4f11592ace842dbd4c9dffd46c29 | [
"Apache-2.0"
] | null | null | null | capsule_em/norb/norb_record.py | continue-nature/google-research | 7011fe008efc4f11592ace842dbd4c9dffd46c29 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | 35.576471 | 77 | 0.645503 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import numpy as np
import tensorflow.compat.v1 as tf
def _read_and_decode(filename_queue, image_pixel=96, distort=0):
reader = tf.TFRecordReader()
_, serialized_example = reader.read(fil... | true | true |
f718bc829f48f8a6746cce096e97afd9ab044089 | 245 | py | Python | IOMC/EventVertexGenerators/python/VtxSmearedRun3RoundOptics25ns13TeVLowSigmaZ_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | IOMC/EventVertexGenerators/python/VtxSmearedRun3RoundOptics25ns13TeVLowSigmaZ_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | IOMC/EventVertexGenerators/python/VtxSmearedRun3RoundOptics25ns13TeVLowSigmaZ_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import *
VtxSmeared = cms.EDProducer("BetafuncEvtVtxGenerator",
Run3RoundOptics25ns13TeVLowSigmaZVtxSmearingParameters,
VtxSmearedCommon
) | 35 | 65 | 0.857143 | import FWCore.ParameterSet.Config as cms
from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import *
VtxSmeared = cms.EDProducer("BetafuncEvtVtxGenerator",
Run3RoundOptics25ns13TeVLowSigmaZVtxSmearingParameters,
VtxSmearedCommon
) | true | true |
f718bcfa66c3e9bd9ce5380c3709a1d89ddf5766 | 446 | py | Python | data.py | MarcyVampQueen/Alex-Agnes-Website | 54e973a798eed937e97c37367cfac4c3fbeebefd | [
"CC0-1.0"
] | null | null | null | data.py | MarcyVampQueen/Alex-Agnes-Website | 54e973a798eed937e97c37367cfac4c3fbeebefd | [
"CC0-1.0"
] | null | null | null | data.py | MarcyVampQueen/Alex-Agnes-Website | 54e973a798eed937e97c37367cfac4c3fbeebefd | [
"CC0-1.0"
] | null | null | null | ##
## For importing data from the database
##
# Python SQL toolkit and Object Relational Mapper
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, desc
######## Set up DB ########
engine = create_engine("sqlite:///static/ag... | 21.238095 | 60 | 0.744395 |
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, desc
engine = create_engine("sqlite:///static/agnesShows.sqlite")
Base = automap_base()
Base.prepare(engine, reflect=True)
def getData():
return 0
| true | true |
f718bcfd85e31d09972c8d4bec7f3557b99ee2d8 | 4,793 | py | Python | helm/kyverno-policies-dx/tests/ats/test_common_default.py | giantswarm/kyverno-policies-dx | 93eec2e3992edcb490dc2f6fd424df0917d8567b | [
"Apache-2.0"
] | null | null | null | helm/kyverno-policies-dx/tests/ats/test_common_default.py | giantswarm/kyverno-policies-dx | 93eec2e3992edcb490dc2f6fd424df0917d8567b | [
"Apache-2.0"
] | null | null | null | helm/kyverno-policies-dx/tests/ats/test_common_default.py | giantswarm/kyverno-policies-dx | 93eec2e3992edcb490dc2f6fd424df0917d8567b | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.append('../../../tests')
import yaml
from functools import partial
import time
import random
import string
import ensure
from textwrap import dedent
from ensure import release
from ensure import cluster
from ensure import machinedeployment
from ensure import kubeadmconfig
from ensure import kubead... | 38.653226 | 143 | 0.690799 | import sys
sys.path.append('../../../tests')
import yaml
from functools import partial
import time
import random
import string
import ensure
from textwrap import dedent
from ensure import release
from ensure import cluster
from ensure import machinedeployment
from ensure import kubeadmconfig
from ensure import kubead... | true | true |
f718bd140bb76d7697f696e4bb8ee88d4d8ace84 | 9,074 | py | Python | mltk/data/loaders.py | haowen-xu/ml-essentials | ca44186be37887461205227c32995f1485b4ff41 | [
"MIT"
] | 4 | 2019-08-06T03:23:14.000Z | 2019-11-08T10:58:54.000Z | mltk/data/loaders.py | haowen-xu/ml-essentials | ca44186be37887461205227c32995f1485b4ff41 | [
"MIT"
] | null | null | null | mltk/data/loaders.py | haowen-xu/ml-essentials | ca44186be37887461205227c32995f1485b4ff41 | [
"MIT"
] | 2 | 2019-12-03T08:09:05.000Z | 2020-10-15T06:50:20.000Z | """
Simple dataset loaders.
For more datasets and more comprehensive loaders, you may turn to dedicated
libraries like `fuel`.
"""
import gzip
import hashlib
import os
import pickle
from typing import *
import idx2numpy
import numpy as np
from ..typing_ import *
from ..utils import CacheDir, validate_enum_arg
__al... | 34.371212 | 87 | 0.638417 |
import gzip
import hashlib
import os
import pickle
from typing import *
import idx2numpy
import numpy as np
from ..typing_ import *
from ..utils import CacheDir, validate_enum_arg
__all__ = ['load_mnist', 'load_fashion_mnist', 'load_cifar10', 'load_cifar100']
_MNIST_LIKE_FILE_NAMES = {
'train_x': 'train-images... | true | true |
f718bd3022cc2f58c5419de421533f5813d0adac | 4,907 | py | Python | tb_rest_client/models/models_ce/shared_attributes_setting_snmp_communication_config.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 30 | 2020-06-19T06:42:50.000Z | 2021-08-23T21:16:36.000Z | tb_rest_client/models/models_ce/shared_attributes_setting_snmp_communication_config.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 25 | 2021-08-30T01:17:27.000Z | 2022-03-16T14:10:14.000Z | tb_rest_client/models/models_ce/shared_attributes_setting_snmp_communication_config.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 23 | 2020-07-06T13:41:54.000Z | 2021-08-23T21:04:50.000Z | # coding: utf-8
"""
ThingsBoard REST API
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.3.3-SNAPSHOT
Contact: info@thingsboard.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
impor... | 32.713333 | 112 | 0.611779 |
import pprint
import re
import six
from tb_rest_client.models.models_ce.snmp_communication_config import SnmpCommunicationConfig
class SharedAttributesSettingSnmpCommunicationConfig(SnmpCommunicationConfig):
swagger_types = {
'mappings': 'list[SnmpMapping]',
'spec': 'str'
}
if hasattr... | true | true |
f718be3ab1e8857e704777f735842ba57cdcf3f2 | 27,925 | py | Python | sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from azure.... | 37.134309 | 126 | 0.582775 | from azure.core.credentials import AccessToken
from datetime import datetime
from msrest.serialization import TZ_UTC
from azure.communication.chat.aio import ChatThreadClient
from azure.communication.chat import (
ChatParticipant,
ChatMessageType
)
from azure.communication.chat._shared.models import(
Commun... | true | true |
f718be894a4691236341bdac4c5579dd0d6a6f14 | 8,462 | py | Python | tests/callbacks/test_early_stopping.py | NunoEdgarGFlowHub/torchbearer | d2b21b8ffcabde5b505cb1c736e05af6ee4276ca | [
"MIT"
] | 358 | 2018-07-23T13:30:38.000Z | 2019-06-02T07:18:35.000Z | tests/callbacks/test_early_stopping.py | Jayaudaykmar26589/torchbearer | 940e75ec88acd59d5a97aa8c721f7cfa30a5c4d0 | [
"MIT"
] | 307 | 2018-07-18T12:07:23.000Z | 2019-06-03T18:00:27.000Z | tests/callbacks/test_early_stopping.py | Jayaudaykmar26589/torchbearer | 940e75ec88acd59d5a97aa8c721f7cfa30a5c4d0 | [
"MIT"
] | 42 | 2018-07-23T22:49:23.000Z | 2019-05-20T07:22:55.000Z | from unittest import TestCase
from mock import MagicMock
import torchbearer
from torchbearer.callbacks import EarlyStopping
class TestEarlyStopping(TestCase):
def test_step_on_batch(self):
stopper = EarlyStopping(monitor='test_metric', mode='min', step_on_batch=True)
stopper.step = MagicMock()
... | 29.381944 | 86 | 0.63732 | from unittest import TestCase
from mock import MagicMock
import torchbearer
from torchbearer.callbacks import EarlyStopping
class TestEarlyStopping(TestCase):
def test_step_on_batch(self):
stopper = EarlyStopping(monitor='test_metric', mode='min', step_on_batch=True)
stopper.step = MagicMock()
... | true | true |
f718bea2b4b0957c8f70bacbe0393777c4196839 | 27 | py | Python | pyaxe/axesim/__init__.py | sosey/pyaxe | f57de55daf77de21d5868ace08b69090778d5975 | [
"BSD-3-Clause"
] | null | null | null | pyaxe/axesim/__init__.py | sosey/pyaxe | f57de55daf77de21d5868ace08b69090778d5975 | [
"BSD-3-Clause"
] | null | null | null | pyaxe/axesim/__init__.py | sosey/pyaxe | f57de55daf77de21d5868ace08b69090778d5975 | [
"BSD-3-Clause"
] | null | null | null | from .axesimtasks import *
| 13.5 | 26 | 0.777778 | from .axesimtasks import *
| true | true |
f718bf45fe77b4e7d788d89bab1b100ccb4a2a7c | 2,737 | py | Python | python-build/python-libs/ase/android.py | visdom2000/python-for-android | 26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891 | [
"Apache-2.0"
] | 267 | 2015-03-22T15:23:48.000Z | 2022-03-05T21:57:34.000Z | python-build/python-libs/ase/android.py | visdom2000/python-for-android | 26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891 | [
"Apache-2.0"
] | 133 | 2015-03-21T15:13:43.000Z | 2021-12-11T23:37:58.000Z | python-build/python-libs/ase/android.py | visdom2000/python-for-android | 26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891 | [
"Apache-2.0"
] | 119 | 2015-04-28T16:07:10.000Z | 2022-03-18T03:49:48.000Z | # Copyright (C) 2017 shimoda kuri65536@hotmail.com
# Copyright (C) 2009 Google 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 r... | 30.076923 | 79 | 0.639021 | from __future__ import print_function
__author__ = 'Damon Kohler <damonkohler@gmail.com>'
import sys
import time
import collections
import json
import os
import socket
from logging import warning as warn
PORT = os.environ.get('AP_PORT')
HOST = os.environ.get('AP_HOST')
HANDSHAKE = os.environ.get('AP_HANDSHAKE')
Resu... | true | true |
f718c07db2037d9de5bc25abef5731563295c516 | 717 | py | Python | blog/models.py | piratos/ctfbulletin | 7c8766b89d4d726567d2690d761f6caa5db4d251 | [
"MIT"
] | 1 | 2015-10-17T17:19:52.000Z | 2015-10-17T17:19:52.000Z | blog/models.py | piratos/ctfbulletin | 7c8766b89d4d726567d2690d761f6caa5db4d251 | [
"MIT"
] | null | null | null | blog/models.py | piratos/ctfbulletin | 7c8766b89d4d726567d2690d761f6caa5db4d251 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from talk.models import Challenger
class Article(models.Model):
author = models.ForeignKey(User)
title = models.CharField(max_length=128)
content = models.TextField(blank=True)
date_post = models.DateTimeField(auto_now_add=True)
... | 31.173913 | 59 | 0.740586 | from django.db import models
from django.contrib.auth.models import User
from talk.models import Challenger
class Article(models.Model):
author = models.ForeignKey(User)
title = models.CharField(max_length=128)
content = models.TextField(blank=True)
date_post = models.DateTimeField(auto_now_add=True)
... | true | true |
f718c0c056dc10de1f4c8b09d04305451105ebae | 740 | py | Python | Algorithms/0021_Merge_Two_Sorted_Lists/Python/Merge_Two_Sorted_Lists_Solution_2.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null | Algorithms/0021_Merge_Two_Sorted_Lists/Python/Merge_Two_Sorted_Lists_Solution_2.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null | Algorithms/0021_Merge_Two_Sorted_Lists/Python/Merge_Two_Sorted_Lists_Solution_2.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null |
# Space: O(1)
# Time: O(n)
# Iterative approach
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def mergeTwoLists(self, l1, l2):
res = ListNode(0)
cur_res = res
cur1, cur2 = l1,l2
... | 17.619048 | 38 | 0.483784 |
class Solution:
def mergeTwoLists(self, l1, l2):
res = ListNode(0)
cur_res = res
cur1, cur2 = l1,l2
while cur1 and cur2:
if cur1.val<cur2.val:
cur_res.next = cur1
cur1 = cur1.next
cur_res = cur_res.next
e... | true | true |
f718c0ccbd1cbc0e5a1fcb274003f494640f1da2 | 4,247 | py | Python | test_files/use_cwl-utils_to_read_input_params.py | PMCC-BioinformaticsCore/CWLab | 6bea694c25364a5655d9e68fd29954b568ac9c4b | [
"Apache-2.0"
] | null | null | null | test_files/use_cwl-utils_to_read_input_params.py | PMCC-BioinformaticsCore/CWLab | 6bea694c25364a5655d9e68fd29954b568ac9c4b | [
"Apache-2.0"
] | null | null | null | test_files/use_cwl-utils_to_read_input_params.py | PMCC-BioinformaticsCore/CWLab | 6bea694c25364a5655d9e68fd29954b568ac9c4b | [
"Apache-2.0"
] | null | null | null | from cwl_utils import parser_v1_0
from re import sub
from cwlab.xls2cwl_job.read_xls import clean_string
configs = {}
cwl_document = parser_v1_0.load_document("test_files/workflows/wf_fastqc.cwl")
if isinstance(cwl_document, list):
cwl_documents = cwl_document
for cwl_document_ in cwl_documents:
if cl... | 41.637255 | 104 | 0.584177 | from cwl_utils import parser_v1_0
from re import sub
from cwlab.xls2cwl_job.read_xls import clean_string
configs = {}
cwl_document = parser_v1_0.load_document("test_files/workflows/wf_fastqc.cwl")
if isinstance(cwl_document, list):
cwl_documents = cwl_document
for cwl_document_ in cwl_documents:
if cl... | true | true |
f718c1ac19167819014f5c812c200a12969781c3 | 3,286 | py | Python | opencv/sources/samples/python/tutorial_code/imgProc/anisotropic_image_segmentation/anisotropic_image_segmentation.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null | opencv/sources/samples/python/tutorial_code/imgProc/anisotropic_image_segmentation/anisotropic_image_segmentation.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null | opencv/sources/samples/python/tutorial_code/imgProc/anisotropic_image_segmentation/anisotropic_image_segmentation.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null |
import cv2 as cv
import numpy as np
import argparse
W = 52 # window size is WxW
C_Thr = 0.43 # threshold for coherency
LowThr = 35 # threshold1 for orientation, it ranges from 0 to 180
HighThr = 57 # threshold2 for orientation, it ranges from 0 to 180
## [calcGST]
## [calcJ_header]
## ... | 35.333333 | 112 | 0.665855 |
import cv2 as cv
import numpy as np
import argparse
W = 52 C_Thr = 0.43 LowThr = 35 HighThr = 57
def calcGST(inputIMG, w):
img = inputIMG.astype(np.float32)
imgDiffX = cv.Sobel(img, cv.CV_32F, 1, 0, 3)
imgDiffY = cv.Sobel(img, cv.CV_32F, 0, 1, 3)
imgDiffXY = cv.... | true | true |
f718c3df162456688b5938954dae9350e0b38d1b | 902 | py | Python | skyfall.py | jopetty/skyfall | 0a048899c60de6666542a31abf3232cc95375998 | [
"MIT"
] | null | null | null | skyfall.py | jopetty/skyfall | 0a048899c60de6666542a31abf3232cc95375998 | [
"MIT"
] | null | null | null | skyfall.py | jopetty/skyfall | 0a048899c60de6666542a31abf3232cc95375998 | [
"MIT"
] | null | null | null | def get_sidereal_time(time: float, date: (int, int, int), longitude: float) -> float:
year, month, day = date
# Calculate the Julian Day
A = int(year/100)
B = 2 - A + int(A/4)
jd = int(365.25*(year + 4716)) + int(30.6001*(month + 1)) + day + B - 1524.5
# Calculate Greenwich Sidereal Time
T = (jd + time/... | 30.066667 | 92 | 0.665188 | def get_sidereal_time(time: float, date: (int, int, int), longitude: float) -> float:
year, month, day = date
A = int(year/100)
B = 2 - A + int(A/4)
jd = int(365.25*(year + 4716)) + int(30.6001*(month + 1)) + day + B - 1524.5
T = (jd + time/24.0 - 2451545.0)/36525.0
qo = 280.46061837 + 360.98564736629... | true | true |
f718c4016a855511a2343e1d1e93784a2accafd2 | 1,002 | py | Python | setup.py | boettiger-lab/rl-toolkit | cbf8060c79779f134101ef1c41b4b8ee44c61e4e | [
"BSD-3-Clause"
] | null | null | null | setup.py | boettiger-lab/rl-toolkit | cbf8060c79779f134101ef1c41b4b8ee44c61e4e | [
"BSD-3-Clause"
] | 1 | 2021-04-14T16:25:08.000Z | 2021-06-08T00:50:36.000Z | setup.py | boettiger-lab/rl-toolkit | cbf8060c79779f134101ef1c41b4b8ee44c61e4e | [
"BSD-3-Clause"
] | null | null | null | # setup.py
from setuptools import find_packages, setup
setup(
name="rl_toolkit",
version="0.0.0",
packages=find_packages(exclude=["docs", "scripts", "tests"]),
install_requires=[
"gym",
"gym_fishing",
"gym_conservation",
"numpy",
"pandas",
"matplotlib",
... | 22.772727 | 65 | 0.44511 | from setuptools import find_packages, setup
setup(
name="rl_toolkit",
version="0.0.0",
packages=find_packages(exclude=["docs", "scripts", "tests"]),
install_requires=[
"gym",
"gym_fishing",
"gym_conservation",
"numpy",
"pandas",
"matplotlib",
"sta... | true | true |
f718c4cdd12f00e7309d3ba6c81331d8862050b5 | 3,991 | py | Python | src/nodemgr/common/podman_containers.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | 37 | 2020-09-21T10:42:26.000Z | 2022-01-09T10:16:40.000Z | src/nodemgr/common/podman_containers.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | null | null | null | src/nodemgr/common/podman_containers.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | 21 | 2020-08-25T12:48:42.000Z | 2022-03-22T04:32:18.000Z | import json
import logging
import subprocess
from nodemgr.common import utils
from nodemgr.common.sandesh.nodeinfo.cpuinfo.ttypes import ProcessCpuInfo
class PodmanContainerMemoryCpuUsage:
def __init__(self, query_, pid_):
self._query = query_
self._cgroup = '/sys/fs/cgroup/memory{0}/memory.stat'.... | 27.524138 | 99 | 0.512152 | import json
import logging
import subprocess
from nodemgr.common import utils
from nodemgr.common.sandesh.nodeinfo.cpuinfo.ttypes import ProcessCpuInfo
class PodmanContainerMemoryCpuUsage:
def __init__(self, query_, pid_):
self._query = query_
self._cgroup = '/sys/fs/cgroup/memory{0}/memory.stat'.... | true | true |
f718c88b539b9df608482abd9c783e4ba2f18bbd | 1,390 | py | Python | client.py | melrick8196/string-matcher | 9854ec03b99fae89664184b1d8a3a81ae3e55001 | [
"MIT"
] | null | null | null | client.py | melrick8196/string-matcher | 9854ec03b99fae89664184b1d8a3a81ae3e55001 | [
"MIT"
] | null | null | null | client.py | melrick8196/string-matcher | 9854ec03b99fae89664184b1d8a3a81ae3e55001 | [
"MIT"
] | null | null | null |
from handler.handler import Handler
from handler.char_handler import CharHandler
from handler.dot_handler import DotHandler
from handler.star_handler import StarHandler
from handler.abstract_handler import AbstractHandler
from match import Match
def make_pattern():
head = CharHandler()
c = CharHandler()
d... | 30.217391 | 85 | 0.682014 |
from handler.handler import Handler
from handler.char_handler import CharHandler
from handler.dot_handler import DotHandler
from handler.star_handler import StarHandler
from handler.abstract_handler import AbstractHandler
from match import Match
def make_pattern():
head = CharHandler()
c = CharHandler()
d... | true | true |
f718c9dd0f055f503653caa02d3327cc81af693d | 534 | py | Python | odds_news/news/migrations/0001_initial.py | toyeiei/odds-news | 01aa0e89a90b033f1468663de760397753544e37 | [
"MIT"
] | 1 | 2021-02-11T03:36:48.000Z | 2021-02-11T03:36:48.000Z | odds_news/news/migrations/0001_initial.py | toyeiei/odds-news | 01aa0e89a90b033f1468663de760397753544e37 | [
"MIT"
] | null | null | null | odds_news/news/migrations/0001_initial.py | toyeiei/odds-news | 01aa0e89a90b033f1468663de760397753544e37 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-11 03:58
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='News',
fields=[
('id', models.AutoField(aut... | 23.217391 | 114 | 0.561798 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='News',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fals... | true | true |
f718ca8de83edf266222648897f5916fcb4f332f | 5,624 | py | Python | infra/base-sim/hwfutils/hwfutils/seed_composer.py | il-steffen/hw-fuzzing | 63c05761a524364e299206ee9376b8cf9f852930 | [
"Apache-2.0"
] | 31 | 2020-10-09T05:52:54.000Z | 2022-01-24T18:50:41.000Z | infra/base-sim/hwfutils/hwfutils/seed_composer.py | il-steffen/hw-fuzzing | 63c05761a524364e299206ee9376b8cf9f852930 | [
"Apache-2.0"
] | 2 | 2021-05-25T18:34:19.000Z | 2021-09-13T02:34:32.000Z | infra/base-sim/hwfutils/hwfutils/seed_composer.py | il-steffen/hw-fuzzing | 63c05761a524364e299206ee9376b8cf9f852930 | [
"Apache-2.0"
] | 5 | 2021-02-16T12:22:17.000Z | 2021-10-18T10:23:55.000Z | #!/usr/bin/python3
# Copyright 2020 Timothy Trippel
#
# 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 o... | 36.75817 | 76 | 0.63638 |
import argparse
import subprocess
import sys
import prettytable
import yaml
from hwfutils.string_color import color_str_green as green
from hwfutils.string_color import color_str_red as red
from hwfutils.string_color import color_str_yellow as yellow
from hwfutils.tlul_fuzz_instr import TLULFuzzInstr
def dump_seed... | true | true |
f718caa21924c30a5b8e61dde532d1a5687b439a | 1,670 | py | Python | igibson/test/test_motion_planning.py | fxia22/gibson_demos | 5f8d253694b23b41c53959774203ba5787578b74 | [
"MIT"
] | 1 | 2021-08-03T23:59:21.000Z | 2021-08-03T23:59:21.000Z | igibson/test/test_motion_planning.py | fxia22/gibson_demos | 5f8d253694b23b41c53959774203ba5787578b74 | [
"MIT"
] | null | null | null | igibson/test/test_motion_planning.py | fxia22/gibson_demos | 5f8d253694b23b41c53959774203ba5787578b74 | [
"MIT"
] | 1 | 2021-12-01T16:09:01.000Z | 2021-12-01T16:09:01.000Z | import igibson
from igibson.envs.igibson_env import iGibsonEnv
from time import time
import os
from igibson.utils.assets_utils import download_assets, download_demo_data
from igibson.utils.motion_planning_wrapper import MotionPlanningWrapper
import numpy as np
import matplotlib.pyplot as plt
def test_occupancy_grid():... | 31.509434 | 95 | 0.707784 | import igibson
from igibson.envs.igibson_env import iGibsonEnv
from time import time
import os
from igibson.utils.assets_utils import download_assets, download_demo_data
from igibson.utils.motion_planning_wrapper import MotionPlanningWrapper
import numpy as np
import matplotlib.pyplot as plt
def test_occupancy_grid():... | true | true |
f718caa3270dc05500c06ad33fedb631d114128e | 1,122 | py | Python | easy/27.removeElement.py | nanfeng-dada/leetcode- | 255c0e8ef2f19d7a384a28c1abb3bea085d597e8 | [
"MIT"
] | null | null | null | easy/27.removeElement.py | nanfeng-dada/leetcode- | 255c0e8ef2f19d7a384a28c1abb3bea085d597e8 | [
"MIT"
] | null | null | null | easy/27.removeElement.py | nanfeng-dada/leetcode- | 255c0e8ef2f19d7a384a28c1abb3bea085d597e8 | [
"MIT"
] | null | null | null | # 在python中复制操作重新赋一个标识符,所以可以直接赋值
class Solution():
def removeElement(self, nums: list, val: int) -> int:
lst=[]
for i in range(len(nums)):
if nums[i]!=val:
lst.append(nums[i])
nums[:]=lst
return len(lst)
#python计数与删除操作
class Solution2:
def removeE... | 26.093023 | 57 | 0.5 | class Solution():
def removeElement(self, nums: list, val: int) -> int:
lst=[]
for i in range(len(nums)):
if nums[i]!=val:
lst.append(nums[i])
nums[:]=lst
return len(lst)
class Solution2:
def removeElement(self, nums, val):
c = nums.count... | true | true |
f718cafcdc12bd1668b77de58ecb4b9f95b1567b | 999 | py | Python | tests/flows/test_fpgaflow.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | 1 | 2022-01-19T01:12:43.000Z | 2022-01-19T01:12:43.000Z | tests/flows/test_fpgaflow.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | null | null | null | tests/flows/test_fpgaflow.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
import pytest
##################################
@pytest.mark.eda
@pytest.mark.quick
def test_icebreaker(scroot):
'''Basic FPGA test: build the Blinky example by running `sc` as a command-line app.
'''
# Use subprocess to test running the `sc` scripts as a command-line program.... | 34.448276 | 93 | 0.628629 | import os
import subprocess
import pytest
@pytest.mark.eda
@pytest.mark.quick
def test_icebreaker(scroot):
blinky_ex_dir = os.path.join(scroot, 'examples', 'blinky')
subprocess.run(['sc',
os.path.join(blinky_ex_dir, 'blinky.v'),
'-read_pcf', f"import 0 {os.... | true | true |
f718cb4ed172fde3f674b4de0949910cbac3415f | 645 | py | Python | yandex_checkout/domain/models/payment_data/request/payment_data_applepay.py | tonchik-tm/yandex-checkout-sdk-python | 7680e85a3e3416a1b3d2a6dd6bd3de84ba646d1d | [
"MIT"
] | 1 | 2021-03-19T06:47:48.000Z | 2021-03-19T06:47:48.000Z | yandex_checkout/domain/models/payment_data/request/payment_data_applepay.py | tonchik-tm/yandex-checkout-sdk-python | 7680e85a3e3416a1b3d2a6dd6bd3de84ba646d1d | [
"MIT"
] | null | null | null | yandex_checkout/domain/models/payment_data/request/payment_data_applepay.py | tonchik-tm/yandex-checkout-sdk-python | 7680e85a3e3416a1b3d2a6dd6bd3de84ba646d1d | [
"MIT"
] | null | null | null | from yandex_checkout.domain.models.payment_data.payment_data import PaymentData
from yandex_checkout.domain.common.payment_method_type import PaymentMethodType
class PaymentDataApplepay(PaymentData):
__payment_data = None
def __init__(self, *args, **kwargs):
super(PaymentDataApplepay, self).__init__(... | 32.25 | 79 | 0.739535 | from yandex_checkout.domain.models.payment_data.payment_data import PaymentData
from yandex_checkout.domain.common.payment_method_type import PaymentMethodType
class PaymentDataApplepay(PaymentData):
__payment_data = None
def __init__(self, *args, **kwargs):
super(PaymentDataApplepay, self).__init__(... | true | true |
f718cc3919aa36f93ba35bd7f65b86bfe5177b51 | 45,740 | py | Python | Joint_Event_Extraction.py | adityabasu1/Event-Extraction-NLP | 98faa88d36f09330ebce6fc180ab2f087776f2e1 | [
"MIT"
] | null | null | null | Joint_Event_Extraction.py | adityabasu1/Event-Extraction-NLP | 98faa88d36f09330ebce6fc180ab2f087776f2e1 | [
"MIT"
] | null | null | null | Joint_Event_Extraction.py | adityabasu1/Event-Extraction-NLP | 98faa88d36f09330ebce6fc180ab2f087776f2e1 | [
"MIT"
] | 3 | 2021-11-25T08:21:13.000Z | 2021-11-26T14:12:03.000Z | import sys
import os
import numpy as np
import random
from collections import OrderedDict
import pickle
import datetime
from tqdm import tqdm
from recordclass import recordclass
import math
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
... | 36.101026 | 129 | 0.620638 | import sys
import os
import numpy as np
import random
from collections import OrderedDict
import pickle
import datetime
from tqdm import tqdm
from recordclass import recordclass
import math
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
... | true | true |
f718cce7e15087472b225e39690a19a8bdf903bc | 2,877 | py | Python | action-app_template.py | metal3d/snips-app-template-py | ba5f3f8d6e24b886e5177fb948deb9a87d4e354c | [
"MIT"
] | null | null | null | action-app_template.py | metal3d/snips-app-template-py | ba5f3f8d6e24b886e5177fb948deb9a87d4e354c | [
"MIT"
] | null | null | null | action-app_template.py | metal3d/snips-app-template-py | ba5f3f8d6e24b886e5177fb948deb9a87d4e354c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from snipsTools import SnipsConfigParser
from hermes_python.hermes import Hermes
# imported to get type check and IDE completion
from hermes_python.ontology.dialogue.intent import IntentMessage
CONFIG_INI = "config.ini"
# If this skill is supposed to run on the satellite,
# please get this mq... | 31.966667 | 79 | 0.638165 |
from snipsTools import SnipsConfigParser
from hermes_python.hermes import Hermes
from hermes_python.ontology.dialogue.intent import IntentMessage
CONFIG_INI = "config.ini"
MQTT_IP_ADDR: str = "localhost"
MQTT_PORT: int = 1883
MQTT_ADDR: str = "{}:{}".format(MQTT_IP_ADDR, str(MQTT_PORT))
class Template(object):
... | true | true |
f718cf53c5de4dffb4d199ec0f98de476584ce74 | 1,133 | py | Python | rubberband/utils/hasher.py | ambros-gleixner/rubberband | 72dd935dbc4bed93860fdcaa0cbe752bcbd6e395 | [
"MIT"
] | 4 | 2018-03-25T15:01:20.000Z | 2020-06-22T14:34:01.000Z | rubberband/utils/hasher.py | ambros-gleixner/rubberband | 72dd935dbc4bed93860fdcaa0cbe752bcbd6e395 | [
"MIT"
] | 41 | 2016-12-19T21:17:41.000Z | 2021-12-13T19:50:34.000Z | rubberband/utils/hasher.py | ambros-gleixner/rubberband | 72dd935dbc4bed93860fdcaa0cbe752bcbd6e395 | [
"MIT"
] | 1 | 2017-10-06T13:52:57.000Z | 2017-10-06T13:52:57.000Z | """Functions to deal with hases."""
import hashlib
def read_in_chunks(file_object, chunk_size=1024):
"""
Lazy function (generator) to read a file piece by piece.
Default chunk size: 1k.
borrowed from http://stackoverflow.com/a/519653
Parameters
----------
file_object : file object
... | 18.883333 | 60 | 0.596646 | import hashlib
def read_in_chunks(file_object, chunk_size=1024):
while True:
data = file_object.read(chunk_size)
if not data:
break
yield data
def generate_sha256_hash(filepath):
sha_result = hashlib.sha256()
try:
file_object = open(filepath, "rb")
except... | true | true |
f718d0527694a1af8cb31e96efd2f96edcedbbe0 | 1,309 | py | Python | test/unit_test_fdp_to_approxdp_conversion.py | samellem/autodp | fd14fed07e0bb67fca5f7e82bbdab6cf60b339d3 | [
"Apache-2.0"
] | 158 | 2019-04-16T15:13:27.000Z | 2022-03-29T17:41:20.000Z | test/unit_test_fdp_to_approxdp_conversion.py | samellem/autodp | fd14fed07e0bb67fca5f7e82bbdab6cf60b339d3 | [
"Apache-2.0"
] | 10 | 2019-09-17T19:42:29.000Z | 2021-09-23T16:54:20.000Z | test/unit_test_fdp_to_approxdp_conversion.py | samellem/autodp | fd14fed07e0bb67fca5f7e82bbdab6cf60b339d3 | [
"Apache-2.0"
] | 37 | 2019-04-17T18:26:03.000Z | 2022-03-29T14:31:06.000Z | from autodp.mechanism_zoo import GaussianMechanism
from autodp.dp_bank import get_eps_ana_gaussian
import numpy as np
from absl.testing import absltest
from absl.testing import parameterized
params = [0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0]
def _fdp_conversion(sigma):
delta_list = [0,1e-8, 1e-6, 1e-4, 1e-2,... | 27.270833 | 94 | 0.718869 | from autodp.mechanism_zoo import GaussianMechanism
from autodp.dp_bank import get_eps_ana_gaussian
import numpy as np
from absl.testing import absltest
from absl.testing import parameterized
params = [0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0]
def _fdp_conversion(sigma):
delta_list = [0,1e-8, 1e-6, 1e-4, 1e-2,... | true | true |
f718d07f43521deaf105e5ff03b5e17fd7bdf28f | 263 | py | Python | tests/urls.py | systemallica/django-websocket-notifications | eae304b021eb14d818d3a1fa5dd18bf791eb4197 | [
"MIT"
] | null | null | null | tests/urls.py | systemallica/django-websocket-notifications | eae304b021eb14d818d3a1fa5dd18bf791eb4197 | [
"MIT"
] | null | null | null | tests/urls.py | systemallica/django-websocket-notifications | eae304b021eb14d818d3a1fa5dd18bf791eb4197 | [
"MIT"
] | null | null | null | from django.urls import include, path
urlpatterns = [
path(
"websocket-notifications/",
include("websocket_notifications.urls", namespace="websocket_notifications"),
),
path("api/v1/", include("tests.router", namespace="api_v1")),
]
| 23.909091 | 85 | 0.669202 | from django.urls import include, path
urlpatterns = [
path(
"websocket-notifications/",
include("websocket_notifications.urls", namespace="websocket_notifications"),
),
path("api/v1/", include("tests.router", namespace="api_v1")),
]
| true | true |
f718d0a3f9b64d814641388c917ca2626dab7a70 | 263 | py | Python | tests/bugs/issue_34/test_artificial_1024_inv_constant_30__20.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/bugs/issue_34/test_artificial_1024_inv_constant_30__20.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/bugs/issue_34/test_artificial_1024_inv_constant_30__20.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "constant", cycle_length = 30, transform = "inv", sigma = 0.0, exog_count = 20, ar_order = 0);
| 43.833333 | 159 | 0.730038 | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "constant", cycle_length = 30, transform = "inv", sigma = 0.0, exog_count = 20, ar_order = 0);
| true | true |
f718d0afae215cd7135b82b727c09e9c0f4ed187 | 180 | py | Python | tdapp/forms.py | shagun-agrawal/ToDo-App | 7b9c60ca8cf2a431ac9b1b46d8a7dc1054489229 | [
"MIT"
] | 1 | 2021-05-05T12:42:58.000Z | 2021-05-05T12:42:58.000Z | tdapp/forms.py | shagun-agrawal/ToDo-App | 7b9c60ca8cf2a431ac9b1b46d8a7dc1054489229 | [
"MIT"
] | null | null | null | tdapp/forms.py | shagun-agrawal/ToDo-App | 7b9c60ca8cf2a431ac9b1b46d8a7dc1054489229 | [
"MIT"
] | null | null | null | from django import forms
from django.forms import ModelForm
from .models import *
class TodoForm(forms.ModelForm):
class Meta:
model=Todo
fields='__all__' | 25.714286 | 35 | 0.694444 | from django import forms
from django.forms import ModelForm
from .models import *
class TodoForm(forms.ModelForm):
class Meta:
model=Todo
fields='__all__' | true | true |
f718d0be8f645f8f092c72408323f1add9cb3ad9 | 1,127 | py | Python | tempest/tests/fake_tempest_plugin.py | KiranPawar72/tempest | 1fef3dd92b083055793065dd0693454735ec2c01 | [
"Apache-2.0"
] | 3 | 2016-07-15T12:27:23.000Z | 2021-04-23T04:41:10.000Z | tempest/tests/fake_tempest_plugin.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | null | null | null | tempest/tests/fake_tempest_plugin.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | 12 | 2016-07-14T18:13:05.000Z | 2017-07-08T18:45:42.000Z | # Copyright (c) 2015 Deutsche Telekom AG
# 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 r... | 27.487805 | 78 | 0.694765 |
from tempest.test_discover import plugins
class FakePlugin(plugins.TempestPlugin):
expected_load_test = ["my/test/path", "/home/dir"]
def load_tests(self):
return self.expected_load_test
def register_opts(self, conf):
return
def get_opt_lists(self):
return []
class FakeSt... | true | true |
f718d1040e1e703f3c3d716f7b5e0629af91e0bf | 421 | py | Python | project/utilities/context_processors.py | Aman2244-hub/ducss-site-old | 42bb7d4938f2500cc3e709c2f2e34cc11dacbe7c | [
"MIT"
] | 1 | 2020-10-19T17:25:33.000Z | 2020-10-19T17:25:33.000Z | project/utilities/context_processors.py | Aman2244-hub/ducss-site-old | 42bb7d4938f2500cc3e709c2f2e34cc11dacbe7c | [
"MIT"
] | 1 | 2020-10-24T16:28:57.000Z | 2020-10-24T16:28:57.000Z | project/utilities/context_processors.py | Aman2244-hub/ducss-site-old | 42bb7d4938f2500cc3e709c2f2e34cc11dacbe7c | [
"MIT"
] | 4 | 2020-09-30T16:48:40.000Z | 2020-10-19T03:53:12.000Z | import hmac, hashlib
from datetime import datetime
from django.conf import settings
def static(request):
''' Add static URL to the context, including the revision number (if known) when not in DEBUG mode. '''
if settings.DEBUG and settings.REVISION:
static_url = u'%sv%s/' % (settings.STATIC_URL, settin... | 38.272727 | 107 | 0.71734 | import hmac, hashlib
from datetime import datetime
from django.conf import settings
def static(request):
if settings.DEBUG and settings.REVISION:
static_url = u'%sv%s/' % (settings.STATIC_URL, settings.REVISION)
else:
static_url = settings.STATIC_URL
return {'STATIC_URL': static_url} | true | true |
f718d25705647be878e1d7696bde13ea0e8f11b5 | 138 | py | Python | testproj/testproj/testapp/admin.py | Polyconseil/django-select2-rocks | 0cc29af55cdd7bec7da773966bec0da84fa7aa6c | [
"BSD-2-Clause"
] | 6 | 2015-09-03T09:01:46.000Z | 2021-01-28T20:15:18.000Z | testproj/testproj/testapp/admin.py | Polyconseil/django-select2-rocks | 0cc29af55cdd7bec7da773966bec0da84fa7aa6c | [
"BSD-2-Clause"
] | 7 | 2015-06-04T14:48:20.000Z | 2018-02-28T09:53:03.000Z | testproj/testproj/testapp/admin.py | Polyconseil/django-select2-rocks | 0cc29af55cdd7bec7da773966bec0da84fa7aa6c | [
"BSD-2-Clause"
] | 3 | 2015-04-05T14:20:10.000Z | 2016-09-30T17:02:01.000Z | from django.contrib import admin
from .models import Beach, SelectedBeach
admin.site.register(Beach)
admin.site.register(SelectedBeach)
| 19.714286 | 40 | 0.826087 | from django.contrib import admin
from .models import Beach, SelectedBeach
admin.site.register(Beach)
admin.site.register(SelectedBeach)
| true | true |
f718d26ba94100e832b3e9147ab6faaa3966711c | 2,264 | py | Python | test/adjlist.py | roks/snap-python | e316dfae8f0b7707756e0a6bf4237d448259d2d2 | [
"BSD-3-Clause"
] | null | null | null | test/adjlist.py | roks/snap-python | e316dfae8f0b7707756e0a6bf4237d448259d2d2 | [
"BSD-3-Clause"
] | null | null | null | test/adjlist.py | roks/snap-python | e316dfae8f0b7707756e0a6bf4237d448259d2d2 | [
"BSD-3-Clause"
] | 1 | 2019-11-11T20:25:19.000Z | 2019-11-11T20:25:19.000Z | import random
import os
import sys
import time
sys.path.append("../swig")
import snap as Snap
numnodes = 100
valrange = numnodes / 10
Edges = Snap.TIntV()
for i in range(0,numnodes):
Edges.Add(int(random.random() * valrange))
d = {}
for i in range(0,numnodes,2):
print "Edges", i/2, Edges.GetVal(i).Val, Edg... | 21.561905 | 81 | 0.635159 | import random
import os
import sys
import time
sys.path.append("../swig")
import snap as Snap
numnodes = 100
valrange = numnodes / 10
Edges = Snap.TIntV()
for i in range(0,numnodes):
Edges.Add(int(random.random() * valrange))
d = {}
for i in range(0,numnodes,2):
print "Edges", i/2, Edges.GetVal(i).Val, Edg... | false | true |
f718d30770e5e2e065c0b1aec425ed1ab250e010 | 8,463 | py | Python | calico_cni/tests/unit/test_ipam.py | fasaxc/calico-cni | 671ab58b8a5705d0184d9353e060ca8475c0d5c8 | [
"Apache-2.0"
] | null | null | null | calico_cni/tests/unit/test_ipam.py | fasaxc/calico-cni | 671ab58b8a5705d0184d9353e060ca8475c0d5c8 | [
"Apache-2.0"
] | null | null | null | calico_cni/tests/unit/test_ipam.py | fasaxc/calico-cni | 671ab58b8a5705d0184d9353e060ca8475c0d5c8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Metaswitch 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 law or agreed to in w... | 34.263158 | 117 | 0.656268 |
import os
import sys
import json
import unittest
from mock import patch, MagicMock, Mock, call, ANY
from netaddr import IPAddress, IPNetwork
from subprocess32 import CalledProcessError, Popen, PIPE
from nose.tools import assert_equal, assert_true, assert_false, assert_raises
from StringIO import StringIO
import pycal... | true | true |
f718d35850eaef0795da6ed63a4cdb69e9bc3d94 | 5,413 | py | Python | venv/Lib/site-packages/scipy/sparse/linalg/isolve/tests/test_gcrotmk.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | venv/Lib/site-packages/scipy/sparse/linalg/isolve/tests/test_gcrotmk.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | venv/Lib/site-packages/scipy/sparse/linalg/isolve/tests/test_gcrotmk.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z | #!/usr/bin/env python
"""Tests for the linalg.isolve.gcrotmk module
"""
from numpy.testing import (assert_, assert_allclose, assert_equal,
suppress_warnings)
import numpy as np
from numpy import zeros, array, allclose
from scipy.linalg import norm
from scipy.sparse import csr_matrix, eye, r... | 32.608434 | 81 | 0.5448 |
from numpy.testing import (assert_, assert_allclose, assert_equal,
suppress_warnings)
import numpy as np
from numpy import zeros, array, allclose
from scipy.linalg import norm
from scipy.sparse import csr_matrix, eye, rand
from scipy.sparse.linalg.interface import LinearOperator
from scipy... | true | true |
f718d4231e5f1b451c3d615e57054feea91147f0 | 801 | py | Python | alembic/versions/1ef399cbd2b_add_downloads_and_followers_to_mod.py | toadicus/KerbalStuff | 91b3c0ee3c415a20292c9caa76022130bc5d5238 | [
"MIT"
] | 1 | 2019-04-15T10:30:17.000Z | 2019-04-15T10:30:17.000Z | alembic/versions/1ef399cbd2b_add_downloads_and_followers_to_mod.py | toadicus/KerbalStuff | 91b3c0ee3c415a20292c9caa76022130bc5d5238 | [
"MIT"
] | null | null | null | alembic/versions/1ef399cbd2b_add_downloads_and_followers_to_mod.py | toadicus/KerbalStuff | 91b3c0ee3c415a20292c9caa76022130bc5d5238 | [
"MIT"
] | null | null | null | """Add downloads and followers to Mod
Revision ID: 1ef399cbd2b
Revises: 29cdccab86f
Create Date: 2014-06-11 17:10:26.480478
"""
# revision identifiers, used by Alembic.
revision = '1ef399cbd2b'
down_revision = '29cdccab86f'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto genera... | 27.62069 | 103 | 0.701623 |
revision = '1ef399cbd2b'
down_revision = '29cdccab86f'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('mod', sa.Column('download_count', sa.Integer(), server_default='0', nullable=False))
op.add_column('mod', sa.Column('follower_count', sa.Integer(), server_default='0', null... | true | true |
f718d4a046685a88df8c7e67861745f498bb0714 | 96 | py | Python | venv/lib/python3.8/site-packages/pkginfo/tests/__init__.py | GiulianaPola/select_repeats | 17a0d053d4f874e42cf654dd142168c2ec8fbd11 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/pkginfo/tests/__init__.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/pkginfo/tests/__init__.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/2c/59/97/f8e5f25cbfc169c1e81504fc2144624a0b7d4d17526ee7745023ffd740 | 96 | 96 | 0.895833 | /home/runner/.cache/pip/pool/2c/59/97/f8e5f25cbfc169c1e81504fc2144624a0b7d4d17526ee7745023ffd740 | false | true |
f718d62abc1a0da728298427d458f2a847bb7f3c | 40 | py | Python | mydates/__init__.py | KirisakiMori/Test | 4d12d9588e3f64dcc9d044f2ba4abcaa07364e01 | [
"Apache-2.0"
] | null | null | null | mydates/__init__.py | KirisakiMori/Test | 4d12d9588e3f64dcc9d044f2ba4abcaa07364e01 | [
"Apache-2.0"
] | null | null | null | mydates/__init__.py | KirisakiMori/Test | 4d12d9588e3f64dcc9d044f2ba4abcaa07364e01 | [
"Apache-2.0"
] | null | null | null | from .core import *
from . import Dates | 20 | 20 | 0.725 | from .core import *
from . import Dates | true | true |
f718d7a372c2b5c43f47c1fac264c8f00320529c | 2,130 | py | Python | flask_client_side_session_test/__init__.py | WommyInStandingPosition/YtbDataApiRelated | 4856ad2ee5be49bb74c79c3d6649f9d1fdbdc85d | [
"MIT"
] | null | null | null | flask_client_side_session_test/__init__.py | WommyInStandingPosition/YtbDataApiRelated | 4856ad2ee5be49bb74c79c3d6649f9d1fdbdc85d | [
"MIT"
] | null | null | null | flask_client_side_session_test/__init__.py | WommyInStandingPosition/YtbDataApiRelated | 4856ad2ee5be49bb74c79c3d6649f9d1fdbdc85d | [
"MIT"
] | null | null | null | from flask import Flask, render_template_string, request, session, redirect, url_for
"""
The workflow os this client-side session server should be
1. When new user comes, assign it a random str as identifier. For any further request from the user, the identifier is needed
2. The user can queue either ytb items, or ytb... | 36.101695 | 145 | 0.666667 | from flask import Flask, render_template_string, request, session, redirect, url_for
app = Flask(__name__)
app.secret_key = 'BAD_SECRET_KEY'
@app.route('/set_email', methods=['GET', 'POST'])
def set_email():
if request.method == 'POST':
session['email'] = request.form['email_address']
re... | true | true |
f718d875583a4a0366807934bcf95cd9ab97d6a1 | 8,932 | py | Python | pyro/contrib/gp/models/gpr.py | GautamV234/pyro | d5474ebc6101b330bf9060a3731830d4b6a585d5 | [
"Apache-2.0"
] | 4,959 | 2017-11-03T14:39:17.000Z | 2019-02-04T16:14:30.000Z | pyro/contrib/gp/models/gpr.py | GautamV234/pyro | d5474ebc6101b330bf9060a3731830d4b6a585d5 | [
"Apache-2.0"
] | 985 | 2017-11-03T14:27:56.000Z | 2019-02-02T18:52:54.000Z | pyro/contrib/gp/models/gpr.py | GautamV234/pyro | d5474ebc6101b330bf9060a3731830d4b6a585d5 | [
"Apache-2.0"
] | 564 | 2017-11-03T15:05:55.000Z | 2019-01-31T14:02:29.000Z | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
import torch.distributions as torchdist
from torch.distributions import constraints
import pyro
import pyro.distributions as dist
from pyro.contrib.gp.models.model import GPModel
from pyro.contrib.gp.util import condi... | 38.17094 | 87 | 0.597627 |
import torch
import torch.distributions as torchdist
from torch.distributions import constraints
import pyro
import pyro.distributions as dist
from pyro.contrib.gp.models.model import GPModel
from pyro.contrib.gp.util import conditional
from pyro.nn.module import PyroParam, pyro_method
from pyro.util import warn_if_n... | true | true |
f718d8fd87c623aee43fc9e984ea46e92add8c51 | 11,213 | py | Python | source-code/PC/main.py | ZakkyMas/Audio_Mixer_Wireless | 7f7a002fdf8eebe6891c06b803f1a3bd0c2da7ca | [
"MIT"
] | 3 | 2020-12-30T18:37:13.000Z | 2021-10-02T07:43:10.000Z | source-code/PC/main.py | ZakkyMas/Audio_Mixer_Wireless | 7f7a002fdf8eebe6891c06b803f1a3bd0c2da7ca | [
"MIT"
] | null | null | null | source-code/PC/main.py | ZakkyMas/Audio_Mixer_Wireless | 7f7a002fdf8eebe6891c06b803f1a3bd0c2da7ca | [
"MIT"
] | 1 | 2021-10-02T07:47:53.000Z | 2021-10-02T07:47:53.000Z | import gc
#PC only
import json, socket, re, time
import random, os
os.system('start /wait cmd /c pip install psutil')
import psutil
gc.enable()
gc.collect()
class WebServer:
def __init__(self, system):
self._call = system
self.s = socket.socket(socket.AF_INET, socket.SOCK_STR... | 32.882698 | 113 | 0.483189 | import gc
import json, socket, re, time
import random, os
os.system('start /wait cmd /c pip install psutil')
import psutil
gc.enable()
gc.collect()
class WebServer:
def __init__(self, system):
self._call = system
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... | true | true |
f718d91c69a4489e6af5552967d46c000b7fdfe2 | 3,161 | py | Python | c3dev/galmocks/data_loaders/load_tng_data.py | aphearin/c3dev | d36d083c9eb688640670dbe066bf299777a78ba7 | [
"BSD-3-Clause"
] | 2 | 2020-09-23T00:47:06.000Z | 2022-02-08T18:41:00.000Z | c3dev/galmocks/data_loaders/load_tng_data.py | aphearin/c3dev | d36d083c9eb688640670dbe066bf299777a78ba7 | [
"BSD-3-Clause"
] | 2 | 2022-01-24T15:45:08.000Z | 2022-02-07T20:58:40.000Z | c3dev/galmocks/data_loaders/load_tng_data.py | aphearin/c3dev | d36d083c9eb688640670dbe066bf299777a78ba7 | [
"BSD-3-Clause"
] | 5 | 2018-03-27T17:21:06.000Z | 2022-03-11T19:45:30.000Z | """
"""
from collections import OrderedDict
import numpy as np
from halotools.utils import sliding_conditional_percentile
from astropy.table import Table
from ..utils.galprops import compute_lg_ssfr
SANDY_SCRATCH_PATH = "/global/cscratch1/sd/sihany/TNG300-1/output"
BEBOP = "/lcrc/project/halotools/C3EMC/TNG300-1"
NER... | 37.630952 | 87 | 0.702309 | from collections import OrderedDict
import numpy as np
from halotools.utils import sliding_conditional_percentile
from astropy.table import Table
from ..utils.galprops import compute_lg_ssfr
SANDY_SCRATCH_PATH = "/global/cscratch1/sd/sihany/TNG300-1/output"
BEBOP = "/lcrc/project/halotools/C3EMC/TNG300-1"
NERSC = "/g... | true | true |
f718d9523532a32523296a63dc44a0cb5a6195d4 | 2,166 | py | Python | rounded_rect.py | nik-panekin/pyramid_puzzle | ce5bfc9295e0c5b2b516cc3662440a86cb293943 | [
"MIT"
] | 5 | 2021-05-26T15:49:24.000Z | 2021-06-21T07:45:54.000Z | rounded_rect.py | xiaodaoapple/pyramid_puzzle | ce5bfc9295e0c5b2b516cc3662440a86cb293943 | [
"MIT"
] | null | null | null | rounded_rect.py | xiaodaoapple/pyramid_puzzle | ce5bfc9295e0c5b2b516cc3662440a86cb293943 | [
"MIT"
] | 1 | 2021-06-05T13:57:17.000Z | 2021-06-05T13:57:17.000Z | """Module for implementation the RoundedRect class.
"""
import pygame
# Brightness lowering for border color
# Must be in range (0..1) - not inclusively
BRIGHTNESS_LOW = 0.5
BORDER_WIDTH = 4 # Inner border width in pixels
class RoundedRect():
"""The RoundedRect class simplifies drawing filled rectangles with roun... | 36.711864 | 78 | 0.620037 | import pygame
BRIGHTNESS_LOW = 0.5
BORDER_WIDTH = 4
class RoundedRect():
def __init__(self, width: int, height: int, color: tuple):
self.color = color
self.border_color = [int(i * BRIGHTNESS_LOW) for i in self.color]
self.rect = pygame.Rect(0, 0, width, height)
def get_inner_rect(self... | true | true |
f718d9cbb0d92c6ed590234cfed98502650487da | 2,054 | py | Python | 4.30/code/three_nodes_bw.py | Therock90421/19-20-Computer_network_lab | 7b1295b68d4b874d71bba01255e27a5b92fdee56 | [
"MIT"
] | 3 | 2020-10-10T06:25:20.000Z | 2021-04-28T13:58:48.000Z | 4.30/code/three_nodes_bw.py | Therock90421/19-20-Computer_network_lab | 7b1295b68d4b874d71bba01255e27a5b92fdee56 | [
"MIT"
] | null | null | null | 4.30/code/three_nodes_bw.py | Therock90421/19-20-Computer_network_lab | 7b1295b68d4b874d71bba01255e27a5b92fdee56 | [
"MIT"
] | 3 | 2020-11-15T14:11:33.000Z | 2022-02-24T08:51:16.000Z | #!/usr/bin/python
import os
import sys
import glob
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.cli import CLI
script_deps = [ 'ethtool' ]
def check_scripts():
dir = os.path.abspath(os.path.dirname(sys.argv[0]))
for fname in glob.glob(dir + ... | 28.527778 | 110 | 0.587634 |
import os
import sys
import glob
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.cli import CLI
script_deps = [ 'ethtool' ]
def check_scripts():
dir = os.path.abspath(os.path.dirname(sys.argv[0]))
for fname in glob.glob(dir + '/' + 'scripts/*.s... | false | true |
f718da52417343bc9caaf1548feb02f4772b30d0 | 467 | bzl | Python | closure/deps.bzl | kalbasit/rules_proto_grpc | 7e0a97adc8801df1cd74ee435d74bbd857c98a36 | [
"Apache-2.0"
] | 1 | 2021-08-11T23:14:07.000Z | 2021-08-11T23:14:07.000Z | closure/deps.bzl | kalbasit/rules_proto_grpc | 7e0a97adc8801df1cd74ee435d74bbd857c98a36 | [
"Apache-2.0"
] | null | null | null | closure/deps.bzl | kalbasit/rules_proto_grpc | 7e0a97adc8801df1cd74ee435d74bbd857c98a36 | [
"Apache-2.0"
] | null | null | null | load(":repositories.bzl", "closure_repos")
# NOTE: THE RULES IN THIS FILE ARE KEPT FOR BACKWARDS COMPATIBILITY ONLY.
# Please use the rules in repositories.bzl
def closure_proto_compile(**kwargs):
print("Import of rules in deps.bzl is deprecated, please use repositories.bzl")
closure_repos(**kwargs)
de... | 35.923077 | 83 | 0.745182 | load(":repositories.bzl", "closure_repos")
def closure_proto_compile(**kwargs):
print("Import of rules in deps.bzl is deprecated, please use repositories.bzl")
closure_repos(**kwargs)
def closure_proto_library(**kwargs):
print("Import of rules in deps.bzl is deprecated, please use repositories.bzl")
... | true | true |
f718da9cba675296f3b6e8de45a3a71e366eb326 | 7,481 | py | Python | pypureclient/flasharray/FA_2_9/models/pod_array_status.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_9/models/pod_array_status.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_9/models/pod_array_status.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.9
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 50.547297 | 1,063 | 0.642561 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_9 import models
class PodArrayStatus(object):
swagger_types = {
'id': 'str',
'name': 'str',
'frozen_at': 'int',
'mediator_status':... | true | true |
f718db080a9c910e3b3827bd3a7417fe205bc663 | 43,146 | py | Python | python/mxnet/model.py | yurivict/incubator-mxnet | 3d38dbde744954854015919d4faf56ac1aea16de | [
"Apache-2.0"
] | 1 | 2019-12-13T02:05:16.000Z | 2019-12-13T02:05:16.000Z | python/mxnet/model.py | yurivict/incubator-mxnet | 3d38dbde744954854015919d4faf56ac1aea16de | [
"Apache-2.0"
] | 2 | 2021-12-10T01:39:06.000Z | 2021-12-14T21:41:10.000Z | python/mxnet/model.py | yurivict/incubator-mxnet | 3d38dbde744954854015919d4faf56ac1aea16de | [
"Apache-2.0"
] | 1 | 2019-12-02T04:16:13.000Z | 2019-12-02T04:16:13.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... | 41.566474 | 118 | 0.596463 |
from __future__ import absolute_import, print_function
import os
import time
import logging
import warnings
from collections import namedtuple
import numpy as np
from . import io
from . import ndarray as nd
from . import symbol as sym
from . import optimizer as opt
from . import metric
from . import kvstore as kvs
f... | true | true |
f718db406f28ba12957da6ad939fb6e3b4b39b16 | 17,400 | py | Python | markdown_to_confluence/confluence.py | vmware-tanzu-labs/markdown-to-confluence | 2a201f6721f819277fcbeda140b039a3c9cbf496 | [
"Apache-2.0"
] | null | null | null | markdown_to_confluence/confluence.py | vmware-tanzu-labs/markdown-to-confluence | 2a201f6721f819277fcbeda140b039a3c9cbf496 | [
"Apache-2.0"
] | null | null | null | markdown_to_confluence/confluence.py | vmware-tanzu-labs/markdown-to-confluence | 2a201f6721f819277fcbeda140b039a3c9cbf496 | [
"Apache-2.0"
] | 1 | 2022-02-18T14:26:36.000Z | 2022-02-18T14:26:36.000Z | import logging
import requests
import os
import pickle
import sys
from urllib.parse import urljoin
API_HEADERS = {
'User-Agent': 'markdown-to-confluence',
}
MULTIPART_HEADERS = {
'X-Atlassian-Token': 'nocheck' # Only need this for form uploads
}
DEFAULT_LABEL_PREFIX = 'global'
log = logging.getLogger(__na... | 37.339056 | 221 | 0.523218 | import logging
import requests
import os
import pickle
import sys
from urllib.parse import urljoin
API_HEADERS = {
'User-Agent': 'markdown-to-confluence',
}
MULTIPART_HEADERS = {
'X-Atlassian-Token': 'nocheck' }
DEFAULT_LABEL_PREFIX = 'global'
log = logging.getLogger(__name__)
class MissingArgumentExcep... | true | true |
f718dc4daf902e24ed5c590318820e31e58d8a29 | 2,594 | py | Python | srht/app.py | prplecake/legacy.sr.ht | 191ba17ab59ffc9a3818712ac976e37a734f7cdc | [
"MIT"
] | null | null | null | srht/app.py | prplecake/legacy.sr.ht | 191ba17ab59ffc9a3818712ac976e37a734f7cdc | [
"MIT"
] | 8 | 2021-05-15T20:33:08.000Z | 2021-06-02T04:39:23.000Z | srht/app.py | prplecake/legacy.sr.ht | 191ba17ab59ffc9a3818712ac976e37a734f7cdc | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, g, Response, redirect, url_for
from flask_login import LoginManager, current_user
from flask_wtf.csrf import CSRFProtect
from jinja2 import FileSystemLoader, ChoiceLoader
import random
import sys
import os
import locale
from srht.config import _cfg, _cfgi
from srht.d... | 26.20202 | 81 | 0.659214 | from flask import Flask, render_template, request, g, Response, redirect, url_for
from flask_login import LoginManager, current_user
from flask_wtf.csrf import CSRFProtect
from jinja2 import FileSystemLoader, ChoiceLoader
import random
import sys
import os
import locale
from srht.config import _cfg, _cfgi
from srht.d... | true | true |
f718dcaef716d7184b7c71448727c6c8b98ce48e | 6,970 | py | Python | eval_tiny_one_image.py | feiwu77777/Face-detection-and-tracking | 1135d2d93d5b667110551dc7e4b985b5861eb380 | [
"MIT"
] | 3 | 2019-02-05T13:35:43.000Z | 2019-02-05T13:40:45.000Z | eval_tiny_one_image.py | feiwu77777/Face-detection-and-tracking | 1135d2d93d5b667110551dc7e4b985b5861eb380 | [
"MIT"
] | 6 | 2019-12-16T22:21:15.000Z | 2022-02-10T00:30:41.000Z | eval_tiny_one_image.py | feiwu77777/Finding_unique_faces | 1135d2d93d5b667110551dc7e4b985b5861eb380 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 10 15:49:15 2018
@author: fei.wu
"""
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tiny_face_model
import util
import cv2
import numpy a... | 36.302083 | 110 | 0.58924 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tiny_face_model
import util
import cv2
import numpy as np
import matplotlib.pyplot as plt
import pickle
import pylab as pl
from scipy.special import expit
MAX_INP... | true | true |
f718dd4064635f2726a078e00dcce2703c4f553c | 399 | py | Python | src/synergyspace/wsgi.py | zavalnav/synergyspace | fa43ee64be2732c4813a8f0bb98cc96ede921289 | [
"MIT"
] | null | null | null | src/synergyspace/wsgi.py | zavalnav/synergyspace | fa43ee64be2732c4813a8f0bb98cc96ede921289 | [
"MIT"
] | null | null | null | src/synergyspace/wsgi.py | zavalnav/synergyspace | fa43ee64be2732c4813a8f0bb98cc96ede921289 | [
"MIT"
] | null | null | null | """
WSGI config for synergyspace project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "synergyspace.settings")
from dja... | 26.6 | 78 | 0.796992 |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "synergyspace.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| true | true |
f718df30f82beb6e6e21b89a28a1753ce7989932 | 614 | py | Python | data/test/python/f718df30f82beb6e6e21b89a28a1753ce7989932manage_cases_tool.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/test/python/f718df30f82beb6e6e21b89a28a1753ce7989932manage_cases_tool.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/test/python/f718df30f82beb6e6e21b89a28a1753ce7989932manage_cases_tool.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | from ert_gui.tools.manage_cases.case_init_configuration import CaseInitializationConfigurationPanel
from ert_gui.tools import Tool
from ert_gui.widgets import util
from ert_gui.widgets.closable_dialog import ClosableDialog
class ManageCasesTool(Tool):
def __init__(self):
super(ManageCasesTool, self).__ini... | 29.238095 | 123 | 0.776873 | from ert_gui.tools.manage_cases.case_init_configuration import CaseInitializationConfigurationPanel
from ert_gui.tools import Tool
from ert_gui.widgets import util
from ert_gui.widgets.closable_dialog import ClosableDialog
class ManageCasesTool(Tool):
def __init__(self):
super(ManageCasesTool, self).__ini... | true | true |
f718e070d70485ffb24d1e10801c888fc1b35282 | 66 | py | Python | main.py | ddkwing/har2case | 6d440651c8d79228b7bf034790334e7c9406f023 | [
"MIT"
] | null | null | null | main.py | ddkwing/har2case | 6d440651c8d79228b7bf034790334e7c9406f023 | [
"MIT"
] | null | null | null | main.py | ddkwing/har2case | 6d440651c8d79228b7bf034790334e7c9406f023 | [
"MIT"
] | null | null | null | """ used for debugging
"""
from har2case.cli import main
main()
| 9.428571 | 29 | 0.681818 |
from har2case.cli import main
main()
| true | true |
f718e09316029e900e756332a21f6047b48f65a5 | 6,818 | py | Python | collimator_geometry_DAC.py | Fahima-Islam/c3dp | f8eb9235dd4fba7edcc0642ed68e325346ff577e | [
"MIT"
] | null | null | null | collimator_geometry_DAC.py | Fahima-Islam/c3dp | f8eb9235dd4fba7edcc0642ed68e325346ff577e | [
"MIT"
] | 1 | 2019-05-03T20:16:49.000Z | 2019-05-03T20:16:49.000Z | collimator_geometry_DAC.py | Fahima-Islam/c3dp | f8eb9235dd4fba7edcc0642ed68e325346ff577e | [
"MIT"
] | null | null | null | from collimator_zigzagBlade_old import Collimator_geom, Parameter_error
import os, sys
from instrument.geometry.pml import weave
from instrument.geometry import operations,shapes
from instrument.geometry.pml.Renderer import Renderer as base
parent_dir = os.path.abspath(os.pardir)
libpath = os.path.join(parent_dir, 'c3... | 49.405797 | 137 | 0.663684 | from collimator_zigzagBlade_old import Collimator_geom, Parameter_error
import os, sys
from instrument.geometry.pml import weave
from instrument.geometry import operations,shapes
from instrument.geometry.pml.Renderer import Renderer as base
parent_dir = os.path.abspath(os.pardir)
libpath = os.path.join(parent_dir, 'c3... | true | true |
f718e0f64ee4309c479b119d007ee99dc6f7b42b | 120,802 | py | Python | pytorch_lightning/trainer/trainer.py | valanm22/pytorch-lightning | 5d190eabd28671a6222741f5dd9ee3f214e519b1 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/trainer.py | valanm22/pytorch-lightning | 5d190eabd28671a6222741f5dd9ee3f214e519b1 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/trainer.py | valanm22/pytorch-lightning | 5d190eabd28671a6222741f5dd9ee3f214e519b1 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning 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 law or agreed to i... | 42.776912 | 122 | 0.648367 | import inspect
import logging
import math
import os
import traceback
import warnings
from argparse import ArgumentParser, Namespace
from copy import deepcopy
from datetime import timedelta
from pathlib import Path
from typing import Any, Callable, cast, Dict, Iterable, List, Optional, Tuple, Type, Union
from weakref im... | true | true |
f718e1316edf5968cf316a2a3fea7d8e4a2d96be | 2,331 | py | Python | torch_glow/tests/nodes/add_test.py | saranyakrish14/glow | 3562fba6a77d2bb4aacf98a5bff5a737a93f6adc | [
"Apache-2.0"
] | null | null | null | torch_glow/tests/nodes/add_test.py | saranyakrish14/glow | 3562fba6a77d2bb4aacf98a5bff5a737a93f6adc | [
"Apache-2.0"
] | null | null | null | torch_glow/tests/nodes/add_test.py | saranyakrish14/glow | 3562fba6a77d2bb4aacf98a5bff5a737a93f6adc | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
from tests import utils
class SimpleAddModule(torch.nn.Module):
def __init__(self, inplace=False):
super(SimpleAddModule, self).__init__()
self.inplace = inplace
def forward(self, a, b):
i... | 31.5 | 87 | 0.464178 | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
from tests import utils
class SimpleAddModule(torch.nn.Module):
def __init__(self, inplace=False):
super(SimpleAddModule, self).__init__()
self.inplace = inplace
def forward(self, a, b):
i... | true | true |
f718e21d6e596548dd45b16aaf36234cd6ca2bb8 | 6,655 | py | Python | encoder.py | kuangliu/pytorch-ssd | 02ed1cbe6962e791895ab1c455dc5ddfb87291b9 | [
"MIT"
] | 124 | 2017-02-16T01:53:14.000Z | 2022-02-22T12:48:13.000Z | encoder.py | droogg/pytorch-ssd | 02ed1cbe6962e791895ab1c455dc5ddfb87291b9 | [
"MIT"
] | 10 | 2017-07-04T01:38:56.000Z | 2021-08-03T09:34:34.000Z | encoder.py | droogg/pytorch-ssd | 02ed1cbe6962e791895ab1c455dc5ddfb87291b9 | [
"MIT"
] | 43 | 2017-07-31T10:46:23.000Z | 2021-02-16T14:12:42.000Z | '''Encode target locations and labels.'''
import torch
import math
import itertools
class DataEncoder:
def __init__(self):
'''Compute default box sizes with scale and aspect transform.'''
scale = 300.
steps = [s / scale for s in (8, 16, 32, 64, 100, 300)]
sizes = [s / scale for s i... | 35.21164 | 98 | 0.494365 | import torch
import math
import itertools
class DataEncoder:
def __init__(self):
scale = 300.
steps = [s / scale for s in (8, 16, 32, 64, 100, 300)]
sizes = [s / scale for s in (30, 60, 111, 162, 213, 264, 315)]
aspect_ratios = ((2,), (2,3), (2,3), (2,3), (2,), (2,))
featur... | true | true |
f718e377e05cbba7bfafea8603bd1a95b92d24ae | 8,948 | py | Python | src/third_party/wiredtiger/test/suite/test_bulk01.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 72 | 2020-06-12T06:33:41.000Z | 2021-03-22T03:15:56.000Z | src/third_party/wiredtiger/test/suite/test_bulk01.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 9 | 2020-07-02T09:36:49.000Z | 2021-03-25T23:54:00.000Z | src/third_party/wiredtiger/test/suite/test_bulk01.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 14 | 2020-06-12T03:08:03.000Z | 2021-02-03T11:43:09.000Z | #!/usr/bin/env python
#
# Public Domain 2014-2018 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... | 40.858447 | 79 | 0.63679 |
import wiredtiger, wttest
from wtdataset import SimpleDataSet, simple_key, simple_value
from wtscenario import make_scenarios
class test_bulk_load(wttest.WiredTigerTestCase):
name = 'test_bulk'
types = [
('file', dict(type='file:')),
('table', dict(type='table:'))
]
keyfmt = [
... | true | true |
f718e400a830f367fac94079177fd69a5f120546 | 2,523 | py | Python | platemapgenerator_calccompsforsingleplate.py | johnmgregoire/JCAPGeneratePrintCode | afc1dbe6125d0024a46889011ab653ed24016fe4 | [
"BSD-3-Clause"
] | null | null | null | platemapgenerator_calccompsforsingleplate.py | johnmgregoire/JCAPGeneratePrintCode | afc1dbe6125d0024a46889011ab653ed24016fe4 | [
"BSD-3-Clause"
] | null | null | null | platemapgenerator_calccompsforsingleplate.py | johnmgregoire/JCAPGeneratePrintCode | afc1dbe6125d0024a46889011ab653ed24016fe4 | [
"BSD-3-Clause"
] | null | null | null | import time, copy, pickle
import os, os.path
import sys
import numpy, pylab
sys.path.append('C:/Users/Gregoire/Documents/PythonCode/JCAP')
from readplatemap import *
modelpath='C:/Users/Gregoire/Documents/CaltechWork/platemaps/Quaternarysingleplate/plate333_1map_full.txt'
newpath='C:/Users/Gregoire/Documents/CaltechW... | 27.725275 | 206 | 0.634958 | import time, copy, pickle
import os, os.path
import sys
import numpy, pylab
sys.path.append('C:/Users/Gregoire/Documents/PythonCode/JCAP')
from readplatemap import *
modelpath='C:/Users/Gregoire/Documents/CaltechWork/platemaps/Quaternarysingleplate/plate333_1map_full.txt'
newpath='C:/Users/Gregoire/Documents/CaltechW... | true | true |
f718e4068584530c0e91c11baa692efddfe5fe53 | 9,392 | py | Python | syne_tune/optimizer/schedulers/searchers/bayesopt/utils/test_objects.py | hfurkanbozkurt/syne-tune | 05ee2668f0155b40c3ee3b61e4b3d58f3f9f3c4f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | syne_tune/optimizer/schedulers/searchers/bayesopt/utils/test_objects.py | hfurkanbozkurt/syne-tune | 05ee2668f0155b40c3ee3b61e4b3d58f3f9f3c4f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | syne_tune/optimizer/schedulers/searchers/bayesopt/utils/test_objects.py | hfurkanbozkurt/syne-tune | 05ee2668f0155b40c3ee3b61e4b3d58f3f9f3c4f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2021 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 38.650206 | 87 | 0.693463 |
from typing import Iterator, Tuple, Dict, List, Optional, Union
import numpy as np
from syne_tune.optimizer.schedulers.searchers.bayesopt.datatypes.common \
import Hyperparameter, Configuration, dictionarize_objective
from syne_tune.config_space import Categorical, loguniform, randint, \
choice, uniform
from... | true | true |
f718e454d347591a4f961fd1e1312485c40195be | 631 | py | Python | setup.py | sagarkar10/pandarallel | 48e14a3c9011e8a19440abe0a49192982d485b8e | [
"BSD-3-Clause"
] | null | null | null | setup.py | sagarkar10/pandarallel | 48e14a3c9011e8a19440abe0a49192982d485b8e | [
"BSD-3-Clause"
] | null | null | null | setup.py | sagarkar10/pandarallel | 48e14a3c9011e8a19440abe0a49192982d485b8e | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
install_requires = [
'pandas',
'pyarrow >= 0.12.1',
'pathos >= 0.2.4'
]
setup(
name='pandarallel',
version='1.3.2',
python_requires='>=3.5',
packages=find_packages(),
author='Manu NALEPA',
author_email='nalepae@gmail.com',
description... | 28.681818 | 111 | 0.684628 | from setuptools import setup, find_packages
install_requires = [
'pandas',
'pyarrow >= 0.12.1',
'pathos >= 0.2.4'
]
setup(
name='pandarallel',
version='1.3.2',
python_requires='>=3.5',
packages=find_packages(),
author='Manu NALEPA',
author_email='nalepae@gmail.com',
description... | true | true |
f718e485c61a21c86f6b388bc00183ecb3b618e3 | 4,641 | py | Python | zerionAPI/api.py | jhsu98/zerion-py | 6c21fadc18e57814fd43a5b3fd187253f6f255e2 | [
"MIT"
] | 4 | 2022-01-03T00:25:45.000Z | 2022-02-04T21:51:25.000Z | zerionAPI/api.py | jhsu98/zerion-py | 6c21fadc18e57814fd43a5b3fd187253f6f255e2 | [
"MIT"
] | 1 | 2022-02-04T19:12:25.000Z | 2022-02-04T21:40:18.000Z | zerionAPI/api.py | jhsu98/zerion-py | 6c21fadc18e57814fd43a5b3fd187253f6f255e2 | [
"MIT"
] | null | null | null | import time
import re
import jwt
import requests
import json
from pprint import pprint
from abc import abstractmethod, ABC
import logging
logging.basicConfig(filename='app.log', level=logging.DEBUG,
format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')
class Response:
def __init__(s... | 33.630435 | 144 | 0.609782 | import time
import re
import jwt
import requests
import json
from pprint import pprint
from abc import abstractmethod, ABC
import logging
logging.basicConfig(filename='app.log', level=logging.DEBUG,
format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')
class Response:
def __init__(s... | true | true |
f718e494ba3808dafe39908eb2ec71cbde91f235 | 2,684 | py | Python | storm_analysis/sa_utilities/merge_hdf5.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | storm_analysis/sa_utilities/merge_hdf5.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | storm_analysis/sa_utilities/merge_hdf5.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | 1 | 2021-04-19T18:17:06.000Z | 2021-04-19T18:17:06.000Z | #!/usr/bin/env python
"""
Merge multiple HDF5 format localization files (tracks only). No
alignment is performed. Metadata is taken from the first file.
Hazen 01/18
"""
import sys
import storm_analysis.sa_library.sa_h5py as saH5Py
def mergeHDF5(hdf5_files, results_file):
"""
Note: This only merges the trac... | 36.767123 | 91 | 0.674739 | import sys
import storm_analysis.sa_library.sa_h5py as saH5Py
def mergeHDF5(hdf5_files, results_file):
with saH5Py.SAH5Py(results_file, is_existing = False) as h5_out:
for i, h5_name in enumerate(hdf5_files):
with saH5Py.SAH5Py(h5_name) as h5_in:
if (i == 0):
... | true | true |
f718e4b6fe5e6cbcd80d9790d53329bb92e5e0b4 | 532 | py | Python | app/core/models.py | DevelopwithTom/simple_inventory_api | 5ce67be1c6ddbe7f5283256d52cf38779cbfdd89 | [
"MIT"
] | null | null | null | app/core/models.py | DevelopwithTom/simple_inventory_api | 5ce67be1c6ddbe7f5283256d52cf38779cbfdd89 | [
"MIT"
] | null | null | null | app/core/models.py | DevelopwithTom/simple_inventory_api | 5ce67be1c6ddbe7f5283256d52cf38779cbfdd89 | [
"MIT"
] | null | null | null | from django.db import models
import uuid
class Product(models.Model):
""" Creates and saves a new product """
sku = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True)
name = models.CharField(max_length=255, blank=False, null=False)
quantity = models.IntegerField(blank=... | 38 | 104 | 0.710526 | from django.db import models
import uuid
class Product(models.Model):
sku = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True)
name = models.CharField(max_length=255, blank=False, null=False)
quantity = models.IntegerField(blank=False, null=False)
price = models.Decima... | true | true |
f718e4de43e06d53c6c3c35158f0b3ac68f8b713 | 4,230 | py | Python | util/utility.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | null | null | null | util/utility.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | 25 | 2020-03-26T11:16:58.000Z | 2020-09-10T18:31:52.000Z | util/utility.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | null | null | null | import numpy as np
class UtilInverse():
def __init__(self, verbose=True):
self.verbose = verbose
def find_nearest_ind(self, array, value):
index = []
for ind in range(len(array)-1):
if array[ind] < value and array[ind+1] > value:
index.append(ind)
... | 31.567164 | 86 | 0.529787 | import numpy as np
class UtilInverse():
def __init__(self, verbose=True):
self.verbose = verbose
def find_nearest_ind(self, array, value):
index = []
for ind in range(len(array)-1):
if array[ind] < value and array[ind+1] > value:
index.append(ind)
... | true | true |
f718e59a80e86c09e45c4dc013b7a554747f8a69 | 5,489 | py | Python | image-viewer.py | kuqihanyan/Arduboy-Python-Utilities | e4bd7ed0cebfca250b40873bdcc75a4eb70363ef | [
"CC0-1.0"
] | 37 | 2018-11-23T03:01:10.000Z | 2022-02-26T07:46:28.000Z | image-viewer.py | kuqihanyan/Arduboy-Python-Utilities | e4bd7ed0cebfca250b40873bdcc75a4eb70363ef | [
"CC0-1.0"
] | 3 | 2021-01-28T01:33:31.000Z | 2021-07-27T02:18:16.000Z | image-viewer.py | kuqihanyan/Arduboy-Python-Utilities | e4bd7ed0cebfca250b40873bdcc75a4eb70363ef | [
"CC0-1.0"
] | 24 | 2018-06-25T00:55:20.000Z | 2022-02-09T10:50:36.000Z | print("\nArduboy image viewer v1.0 by Mr.Blinky Jul.2019\n")
#requires pyserial and PILlow to be installed.
#Use "python -m pip install pyserial" and "python -m pip install pillow" on commandline
import sys
import time
import os
try:
from serial.tools.list_ports import comports
from serial import Seri... | 31.545977 | 121 | 0.596466 | print("\nArduboy image viewer v1.0 by Mr.Blinky Jul.2019\n")
import sys
import time
import os
try:
from serial.tools.list_ports import comports
from serial import Serial
except:
print("The pySerial module is required but not installed!")
print("Use 'python -m pip install pyserial' from the comman... | true | true |
f718e68c5abac3512deb144ea362e1ed01d290af | 251 | py | Python | linebot/models/line_types.py | tominaga443/globalbot | bbbb8f0e4c5164231656f515f4b889df8f28da86 | [
"MIT"
] | 2 | 2016-04-17T08:30:03.000Z | 2016-05-09T02:58:52.000Z | linebot/models/line_types.py | tominaga443/globalbot | bbbb8f0e4c5164231656f515f4b889df8f28da86 | [
"MIT"
] | null | null | null | linebot/models/line_types.py | tominaga443/globalbot | bbbb8f0e4c5164231656f515f4b889df8f28da86 | [
"MIT"
] | null | null | null | from enum import Enum
class EventType(Enum):
message = "138311609000106303"
operation = "138311609100106403"
class ContentType(Enum):
text = 1
image = 2
video = 3
audio = 4
location = 7
sticker = 8
contact = 10
| 14.764706 | 36 | 0.625498 | from enum import Enum
class EventType(Enum):
message = "138311609000106303"
operation = "138311609100106403"
class ContentType(Enum):
text = 1
image = 2
video = 3
audio = 4
location = 7
sticker = 8
contact = 10
| true | true |
f718e849c9b0d90bdc2380ce8a6c1c37b4447bdb | 59,962 | py | Python | python/dgl/distributed/dist_graph.py | blokhinnv/dgl | bcf92f6c21afd4ad48a86d2ee543386099190791 | [
"Apache-2.0"
] | null | null | null | python/dgl/distributed/dist_graph.py | blokhinnv/dgl | bcf92f6c21afd4ad48a86d2ee543386099190791 | [
"Apache-2.0"
] | null | null | null | python/dgl/distributed/dist_graph.py | blokhinnv/dgl | bcf92f6c21afd4ad48a86d2ee543386099190791 | [
"Apache-2.0"
] | null | null | null | """Define distributed graph."""
from collections.abc import MutableMapping
from collections import namedtuple
import os
import numpy as np
from ..heterograph import DGLHeteroGraph
from ..convert import heterograph as dgl_heterograph
from ..convert import graph as dgl_graph
from ..transform import compact_graphs
from... | 38.560772 | 100 | 0.622344 |
from collections.abc import MutableMapping
from collections import namedtuple
import os
import numpy as np
from ..heterograph import DGLHeteroGraph
from ..convert import heterograph as dgl_heterograph
from ..convert import graph as dgl_graph
from ..transform import compact_graphs
from .. import heterograph_index
fro... | true | true |
f718e88e36241f1a76f15b0b2e64f2b8c425d513 | 1,104 | py | Python | OpenPNM/Algorithms/__init__.py | khayratk/OpenPNM | 6c26d27dcc0152b5863e559085754a2183a483c2 | [
"MIT"
] | null | null | null | OpenPNM/Algorithms/__init__.py | khayratk/OpenPNM | 6c26d27dcc0152b5863e559085754a2183a483c2 | [
"MIT"
] | null | null | null | OpenPNM/Algorithms/__init__.py | khayratk/OpenPNM | 6c26d27dcc0152b5863e559085754a2183a483c2 | [
"MIT"
] | 1 | 2020-07-02T02:21:10.000Z | 2020-07-02T02:21:10.000Z | r"""
###############################################################################
:mod:`OpenPNM.Algorithms` -- Algorithms on Networks
###############################################################################
Contents
--------
This submodule contains algorithms for performing simulations on pore networks
Clas... | 24.533333 | 79 | 0.677536 |
from .__GenericAlgorithm__ import GenericAlgorithm
from .__GenericLinearTransport__ import GenericLinearTransport
from .__FickianDiffusion__ import FickianDiffusion
from .__FourierConduction__ import FourierConduction
from .__OhmicConduction__ import OhmicConduction
from .__StokesFlow__ import StokesFlow
from .__Ordin... | true | true |
f718ea048b0cff1469fdb160a4f667207eea726b | 8,324 | py | Python | tests/test_syllabics_conversion.py | eddieantonio/nehiyawewin | a161b6ec5441ff56395abc6cc0f548fb81b14562 | [
"MIT"
] | 6 | 2019-07-16T01:28:28.000Z | 2021-07-07T15:11:04.000Z | tests/test_syllabics_conversion.py | eddieantonio/nehiyawewin | a161b6ec5441ff56395abc6cc0f548fb81b14562 | [
"MIT"
] | 16 | 2018-07-16T00:48:17.000Z | 2018-11-08T18:41:04.000Z | tests/test_syllabics_conversion.py | eddieantonio/crk_orthography | a161b6ec5441ff56395abc6cc0f548fb81b14562 | [
"MIT"
] | null | null | null | import pytest # type: ignore
from cree_sro_syllabics import sro2syllabics, syllabics2sro
COMBINING_CIRCUMFLEX = "\u0302"
@pytest.mark.parametrize(
"sro,syllabics",
[
("acimosis", "ᐊᒋᒧᓯᐢ"),
("atahk", "ᐊᑕᕽ"),
("mêriy", "ᒣᕒᐃᐩ"),
("wîstihkêw", "ᐑᐢᑎᐦᑫᐤ"),
("nêhiyawêwin", "... | 30.602941 | 88 | 0.641398 | import pytest from cree_sro_syllabics import sro2syllabics, syllabics2sro
COMBINING_CIRCUMFLEX = "\u0302"
@pytest.mark.parametrize(
"sro,syllabics",
[
("acimosis", "ᐊᒋᒧᓯᐢ"),
("atahk", "ᐊᑕᕽ"),
("mêriy", "ᒣᕒᐃᐩ"),
("wîstihkêw", "ᐑᐢᑎᐦᑫᐤ"),
("nêhiyawêwin", "ᓀᐦᐃᔭᐍᐏᐣ"),
... | true | true |
f718ea668f086785a2ecdd071fd77637573089f4 | 53,142 | py | Python | discretisedfield/field.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | discretisedfield/field.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | discretisedfield/field.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | import pyvtk
import struct
import matplotlib
import numpy as np
import mpl_toolkits.axes_grid1
import discretisedfield as df
import ubermagutil.typesystem as ts
import discretisedfield.util as dfu
import matplotlib.pyplot as plt
@ts.typesystem(mesh=ts.Typed(expected_type=df.Mesh),
dim=ts.Scalar(expecte... | 35.333777 | 79 | 0.527003 | import pyvtk
import struct
import matplotlib
import numpy as np
import mpl_toolkits.axes_grid1
import discretisedfield as df
import ubermagutil.typesystem as ts
import discretisedfield.util as dfu
import matplotlib.pyplot as plt
@ts.typesystem(mesh=ts.Typed(expected_type=df.Mesh),
dim=ts.Scalar(expecte... | true | true |
f718eacfba0628440354e96dd089e07772ef3d94 | 11,677 | py | Python | docs/conf.py | yahgwai/raiden | a76809872468890d7f2a66b293876aff93b6ea97 | [
"MIT"
] | null | null | null | docs/conf.py | yahgwai/raiden | a76809872468890d7f2a66b293876aff93b6ea97 | [
"MIT"
] | null | null | null | docs/conf.py | yahgwai/raiden | a76809872468890d7f2a66b293876aff93b6ea97 | [
"MIT"
] | null | null | null | import os
import shlex
import subprocess
import sys
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
from sphinx.util import compat
compat.make_admonition = BaseAdmonition
#
# Raiden documentation build configuration file, created by
# sphinx-quickstart2 on Mon Oct 24 10:55:13 2016.
#
# This fil... | 28.761084 | 91 | 0.701208 | import os
import shlex
import subprocess
import sys
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
from sphinx.util import compat
compat.make_admonition = BaseAdmonition
sys.path.insert(0, os.path.dirname(os.path.abspath('../raiden/')))
def check_if_nightly(version):
try:
git_v... | true | true |
f718eb56dd751002a5d5f1dc575330589e32f944 | 1,486 | py | Python | agent/get_all_agents_info_for_customer.py | acronis/acronis-cyber-platform-python-examples | cb7837618e7e70bd4ca29c8128d99f597aba1289 | [
"MIT"
] | 3 | 2021-12-22T08:26:04.000Z | 2021-12-28T07:57:50.000Z | agent/get_all_agents_info_for_customer.py | stas-pavlov/acronis-cyber-platform-python-examples | c45ffd9fce517ffc65d573a6e332b8f95ae3c34b | [
"MIT"
] | null | null | null | agent/get_all_agents_info_for_customer.py | stas-pavlov/acronis-cyber-platform-python-examples | c45ffd9fce517ffc65d573a6e332b8f95ae3c34b | [
"MIT"
] | 2 | 2021-12-23T03:47:36.000Z | 2022-02-14T15:12:19.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ************************************************************
# Copyright © 2019-2021 Acronis International GmbH.
# This source code is distributed under MIT software license.
# ************************************************************
import json # used for manipulatin... | 30.326531 | 89 | 0.644011 |
import json import pprint import os
import sys
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, base_path)
from common.base_operations import Config, Tenant, Acronis
cfg = Config(full=True)
acronis = Acronis(cfg)
customer = Tenant(os.path.join(base_path, 'customer.j... | true | true |
f718ebcec01f5ba7dce969708019e02a04ab848a | 4,378 | py | Python | server/online/models.py | Jesterboxboy/mahjong-portal | c09362d69a81e81ed30c9159f3a35f9e9def4ac3 | [
"MIT"
] | 10 | 2018-02-12T10:30:22.000Z | 2020-06-29T21:06:15.000Z | server/online/models.py | Jesterboxboy/mahjong-portal | c09362d69a81e81ed30c9159f3a35f9e9def4ac3 | [
"MIT"
] | 62 | 2018-01-05T04:52:38.000Z | 2021-04-10T07:14:45.000Z | server/online/models.py | MahjongRepository/mahjong-leaderboard | 77dfd26cb812c12fa7c2b11e862bb80a9135ccb0 | [
"MIT"
] | 8 | 2018-05-11T11:05:41.000Z | 2021-03-10T08:10:50.000Z | from django.db import models
from mahjong_portal.models import BaseModel
from tournament.models import Tournament
class TournamentStatus(BaseModel):
tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE)
current_round = models.PositiveSmallIntegerField(null=True, blank=True)
end_break_time... | 37.101695 | 113 | 0.731156 | from django.db import models
from mahjong_portal.models import BaseModel
from tournament.models import Tournament
class TournamentStatus(BaseModel):
tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE)
current_round = models.PositiveSmallIntegerField(null=True, blank=True)
end_break_time... | true | true |
f718ebeaad41e74835f2322198fe180518fc5225 | 321 | py | Python | osf/migrations/0171_merge_20190827_1908.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 11 | 2018-12-11T16:39:40.000Z | 2022-02-26T09:51:32.000Z | osf/migrations/0171_merge_20190827_1908.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 52 | 2018-04-13T05:03:21.000Z | 2022-03-22T02:56:19.000Z | osf/migrations/0171_merge_20190827_1908.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 16 | 2018-07-09T01:44:51.000Z | 2021-06-30T01:57:16.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-08-27 19:08
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0141_mapsync'),
('osf', '0170_merge_20190807_0515'),
]
operations = [
]... | 18.882353 | 49 | 0.64486 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0141_mapsync'),
('osf', '0170_merge_20190807_0515'),
]
operations = [
]
| true | true |
f718ed1d545bbd1402bdebf7470241d3c6aa4d2f | 6,981 | py | Python | bs4/builder/_lxml.py | joepie91/beautifulsoup | f3675639173ebacf212a552362fbdcb1709c98c9 | [
"MIT"
] | 1 | 2020-01-21T13:08:01.000Z | 2020-01-21T13:08:01.000Z | bs4/builder/_lxml.py | joepie91/beautifulsoup | f3675639173ebacf212a552362fbdcb1709c98c9 | [
"MIT"
] | null | null | null | bs4/builder/_lxml.py | joepie91/beautifulsoup | f3675639173ebacf212a552362fbdcb1709c98c9 | [
"MIT"
] | null | null | null | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
TreeBuilder,
XML)
from b... | 35.436548 | 82 | 0.618966 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
TreeBuilder,
XML)
from b... | true | true |
f718ef5cb741f308a91aa8e5b6d292f61e222651 | 225 | py | Python | test/test_models/test_palm.py | Fei-Wang/dl-pytorch | a7672603e2de7824d0ff7e97b69dedad3fd9d476 | [
"MIT"
] | null | null | null | test/test_models/test_palm.py | Fei-Wang/dl-pytorch | a7672603e2de7824d0ff7e97b69dedad3fd9d476 | [
"MIT"
] | null | null | null | test/test_models/test_palm.py | Fei-Wang/dl-pytorch | a7672603e2de7824d0ff7e97b69dedad3fd9d476 | [
"MIT"
] | null | null | null | import torch
from luffy.models.palm import *
def test_palm_tony():
model = PaLMTony(num_tokens=20000)
tokens = torch.randint(0, 20000, (1, 2048))
feat = model(tokens)
assert feat.shape == (1, 2048, 20000)
| 18.75 | 47 | 0.666667 | import torch
from luffy.models.palm import *
def test_palm_tony():
model = PaLMTony(num_tokens=20000)
tokens = torch.randint(0, 20000, (1, 2048))
feat = model(tokens)
assert feat.shape == (1, 2048, 20000)
| true | true |
f718efd56f2b4db5ce4e2364a546b8f1827f61ad | 11,130 | py | Python | dask/diagnostics/profile.py | Jeremaiha-xmetix/dask | 361a2f5472932cb26667216f0200b565ac67487e | [
"BSD-3-Clause"
] | null | null | null | dask/diagnostics/profile.py | Jeremaiha-xmetix/dask | 361a2f5472932cb26667216f0200b565ac67487e | [
"BSD-3-Clause"
] | null | null | null | dask/diagnostics/profile.py | Jeremaiha-xmetix/dask | 361a2f5472932cb26667216f0200b565ac67487e | [
"BSD-3-Clause"
] | null | null | null | from collections import namedtuple
from itertools import starmap
from multiprocessing import Pipe, Process, current_process
from time import sleep
from timeit import default_timer
from ..callbacks import Callback
from ..utils import import_required
# Stores execution data for each task
TaskData = namedtuple(
"Tas... | 28.984375 | 89 | 0.579784 | from collections import namedtuple
from itertools import starmap
from multiprocessing import Pipe, Process, current_process
from time import sleep
from timeit import default_timer
from ..callbacks import Callback
from ..utils import import_required
TaskData = namedtuple(
"TaskData", ("key", "task", "start_time", ... | true | true |
f718f00471bdf766f909f135516dc1fb334ea3c9 | 61,188 | py | Python | nova/db/api.py | linets/nova | 936d0a49594e04e3ec08c7a2115784d072e61dee | [
"Apache-2.0"
] | null | null | null | nova/db/api.py | linets/nova | 936d0a49594e04e3ec08c7a2115784d072e61dee | [
"Apache-2.0"
] | null | null | null | nova/db/api.py | linets/nova | 936d0a49594e04e3ec08c7a2115784d072e61dee | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... | 32.119685 | 79 | 0.708064 |
from nova import exception
from nova import flags
from nova.openstack.common import cfg
from nova import utils
db_opts = [
cfg.StrOpt('db_backend',
default='sqlalchemy',
help='The backend to use for db'),
cfg.BoolOpt('enable_new_services',
default=True,
... | true | true |
f718f09f6947d861bde6f19e620f9dea6e20e15e | 1,128 | py | Python | codes/webdav/app.py | e7217/control-tv | 85533786528fe6379fd20700612d23de545111ab | [
"MIT"
] | null | null | null | codes/webdav/app.py | e7217/control-tv | 85533786528fe6379fd20700612d23de545111ab | [
"MIT"
] | null | null | null | codes/webdav/app.py | e7217/control-tv | 85533786528fe6379fd20700612d23de545111ab | [
"MIT"
] | null | null | null | import os
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class Target:
watchDir = os.getcwd()
#watchDir에 감시하려는 디렉토리를 명시한다.
def __init__(self):
self.observer = Observer() #observer객체를 만듦
def run(self):
event_handler = Handler()
... | 24.521739 | 60 | 0.606383 | import os
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class Target:
watchDir = os.getcwd()
def __init__(self):
self.observer = Observer()
def run(self):
event_handler = Handler()
self.observer.schedule(event_handler,... | false | true |
f718f27b7eda35619be65225a957b0ca51a830f4 | 122 | py | Python | dist/Basilisk/fswAlgorithms/sunSafeACS/__init__.py | ian-cooke/basilisk_mag | a8b1e37c31c1287549d6fd4d71fcaa35b6fc3f14 | [
"0BSD"
] | null | null | null | dist/Basilisk/fswAlgorithms/sunSafeACS/__init__.py | ian-cooke/basilisk_mag | a8b1e37c31c1287549d6fd4d71fcaa35b6fc3f14 | [
"0BSD"
] | 1 | 2019-03-13T20:52:22.000Z | 2019-03-13T20:52:22.000Z | dist/Basilisk/fswAlgorithms/sunSafeACS/__init__.py | ian-cooke/basilisk_mag | a8b1e37c31c1287549d6fd4d71fcaa35b6fc3f14 | [
"0BSD"
] | null | null | null | # This __init__.py file for the sunSafeACS package is automatically generated by the build system
from sunSafeACS import * | 61 | 97 | 0.827869 | from sunSafeACS import * | true | true |
f718f27c1be88d449be28eb8f385613384671af6 | 17,084 | py | Python | pysnmp-with-texts/CADANT-REMOTE-QUERY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/CADANT-REMOTE-QUERY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/CADANT-REMOTE-QUERY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CADANT-REMOTE-QUERY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CADANT-REMOTE-QUERY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:46:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... | 165.864078 | 1,652 | 0.808242 | ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuilder.impo... | true | true |
f718f34ad9ae971fc9eb04e25793ee4524e4cf8e | 9,062 | py | Python | src/generator.py | GovernorGecko/ObjFile | 1b7555447a25655a0436484d1f915f4fb759fb73 | [
"MIT"
] | null | null | null | src/generator.py | GovernorGecko/ObjFile | 1b7555447a25655a0436484d1f915f4fb759fb73 | [
"MIT"
] | null | null | null | src/generator.py | GovernorGecko/ObjFile | 1b7555447a25655a0436484d1f915f4fb759fb73 | [
"MIT"
] | null | null | null | """
obj generator
Order of faces position/texcoord/normal
https://www.loc.gov/preservation/digital/formats/fdd/fdd000508.shtml
Ka: specifies ambient color, to account for light that is scattered about
the entire scene.
Kd: specifies diffuse color, which typically contributes most of the color
... | 29.517915 | 78 | 0.543258 |
import os
from shutil import copyfile
from .MultiD.src.triangle import Triangle
from .MultiD.src.vector import Vector3
class Generator():
__slots__ = [
"__name", "__image_path", "__image_name",
"__ka", "__kd", "__ks", "__illum", "__ns", "__ni", "__d",
"__faces", "__v", "__vn", "__vt"
... | true | true |
f718f363b4dff8ac31c80d174fd8a06173a11675 | 10,934 | py | Python | frankly/websocket/http.py | franklyinc-public/frankly-python | 50a1d2dead3a55e63d105ddf9e5b0cdc233c4b4e | [
"MIT"
] | 1 | 2018-08-31T16:12:39.000Z | 2018-08-31T16:12:39.000Z | frankly/websocket/http.py | franklyinc-public/frankly-python | 50a1d2dead3a55e63d105ddf9e5b0cdc233c4b4e | [
"MIT"
] | null | null | null | frankly/websocket/http.py | franklyinc-public/frankly-python | 50a1d2dead3a55e63d105ddf9e5b0cdc233c4b4e | [
"MIT"
] | null | null | null | ##
# The MIT License (MIT)
#
# Copyright (c) 2015 Frankly Inc.
#
# 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, m... | 30.541899 | 107 | 0.605908 | from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from http_parser.http import HttpStream
from http_parser.http import NoMoreData
from http_parser.http import HTTP_REQUEST
from http_parser.http import HTTP_RESPONSE
from ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.