hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f9a3a81ecc1f916f1da23203f267f583b3c374 | 887 | py | Python | obsolete/tests/test_init.py | telegrambotdev/telegram.email.notify | d16880819b2f1887b0e0f0b9841de2a122d81dd6 | [
"MIT"
] | null | null | null | obsolete/tests/test_init.py | telegrambotdev/telegram.email.notify | d16880819b2f1887b0e0f0b9841de2a122d81dd6 | [
"MIT"
] | null | null | null | obsolete/tests/test_init.py | telegrambotdev/telegram.email.notify | d16880819b2f1887b0e0f0b9841de2a122d81dd6 | [
"MIT"
] | null | null | null | # python tests.py ../source test.test_modules.test_init
from modules import remove_line_with, remove_new_lines
from . import TestCaseModule
class TestCaseInit(TestCaseModule):
def test_remove_line_with(self):
source = "Test text\nLine one\nLine two"
result = "Test text\nLine two"
self.ass... | 36.958333 | 67 | 0.70124 |
from modules import remove_line_with, remove_new_lines
from . import TestCaseModule
class TestCaseInit(TestCaseModule):
def test_remove_line_with(self):
source = "Test text\nLine one\nLine two"
result = "Test text\nLine two"
self.assertEqual(remove_line_with(source, " one"), result)
... | true | true |
f7f9a3f1b6cd85d0b636ba241e8d6f1cbca779e6 | 10,772 | py | Python | tests/neurst/layers/decoders/transformer_decoder_test.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 208 | 2020-11-12T03:56:41.000Z | 2022-03-27T07:01:27.000Z | tests/neurst/layers/decoders/transformer_decoder_test.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 16 | 2021-02-20T07:57:03.000Z | 2022-01-27T07:36:31.000Z | tests/neurst/layers/decoders/transformer_decoder_test.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 33 | 2020-11-12T04:44:50.000Z | 2022-03-23T09:22:29.000Z | # Copyright 2020 ByteDance Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 57.913978 | 107 | 0.583457 |
import numpy
import tensorflow as tf
from neurst.layers.decoders.transformer_decoder import TransformerDecoder
def test_transformer_decoder():
dmodel = 4
batch_size = 2
num_layers = 1
num_self_attention_heads = 2
hidden_size = dmodel
filter_size = 16
self_attention_dropout_ra... | true | true |
f7f9a62a9d60761d21925599218368c0cfde97af | 3,225 | py | Python | python/excel_writer_xlwt.py | extrabacon/pyspreadsheet | e8f83eaff1e5cb7dfbd774fa1764dd28326a6a5f | [
"MIT",
"Unlicense"
] | 24 | 2015-01-06T01:49:50.000Z | 2021-05-17T13:47:59.000Z | python/excel_writer_xlwt.py | extrabacon/pyspreadsheet | e8f83eaff1e5cb7dfbd774fa1764dd28326a6a5f | [
"MIT",
"Unlicense"
] | 17 | 2015-01-14T17:57:34.000Z | 2019-11-17T23:17:48.000Z | python/excel_writer_xlwt.py | extrabacon/pyspreadsheet | e8f83eaff1e5cb7dfbd774fa1764dd28326a6a5f | [
"MIT",
"Unlicense"
] | 10 | 2015-04-03T19:46:54.000Z | 2017-09-04T03:20:33.000Z | import sys, json, datetime, xlwt
from xlwt import *
def create_workbook(self, options = None):
self.workbook = Workbook()
self.sheet_count = 0
self.dump_record("open", self.filename)
if options and "properties" in options:
# TODO: add support for more properties, xlwt has a ton of them
prop = options[... | 28.289474 | 68 | 0.656434 | import sys, json, datetime, xlwt
from xlwt import *
def create_workbook(self, options = None):
self.workbook = Workbook()
self.sheet_count = 0
self.dump_record("open", self.filename)
if options and "properties" in options:
prop = options["properties"]
if "owner" in prop:
self.workbook.owner... | true | true |
f7f9a63350d1c14b46a67404c9a69e03c1e36d10 | 13,202 | py | Python | django/utils/html.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/utils/html.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/utils/html.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-02-06T10:31:51.000Z | 2020-02-06T10:31:51.000Z | """HTML utilities suitable for global use."""
import re
from urllib.parse import (
parse_qsl, quote, unquote, urlencode, urlsplit, urlunsplit,
)
from django.utils.encoding import force_text
from django.utils.functional import keep_lazy, keep_lazy_text
from django.utils.http import RFC3986_GENDELIMS, RFC3986_SUBDE... | 35.489247 | 110 | 0.601348 |
import re
from urllib.parse import (
parse_qsl, quote, unquote, urlencode, urlsplit, urlunsplit,
)
from django.utils.encoding import force_text
from django.utils.functional import keep_lazy, keep_lazy_text
from django.utils.http import RFC3986_GENDELIMS, RFC3986_SUBDELIMS
from django.utils.safestring import SafeD... | true | true |
f7f9a682d5806e5a26e6939c37218f09f20fe12e | 1,873 | py | Python | src/anime_search.py | SparXFusion/Anime-DL-Bot | 94fb942168c31df8bc548f48c6ea3e2b6306c242 | [
"MIT"
] | null | null | null | src/anime_search.py | SparXFusion/Anime-DL-Bot | 94fb942168c31df8bc548f48c6ea3e2b6306c242 | [
"MIT"
] | null | null | null | src/anime_search.py | SparXFusion/Anime-DL-Bot | 94fb942168c31df8bc548f48c6ea3e2b6306c242 | [
"MIT"
] | null | null | null | # Copyright © 2021 BaraniARR
# Encoding = 'utf-8'
# Licensed under MIT License
# Special Thanks for gogoanime
from pyrogram import *
from pyrogram.types import *
from requests_html import HTMLSession
from bs4 import BeautifulSoup
# Searching anime by regex pattern "/search <space> Anime Name"
def anime_search(client... | 39.851064 | 123 | 0.61559 |
from pyrogram import *
from pyrogram.types import *
from requests_html import HTMLSession
from bs4 import BeautifulSoup
def anime_search(client, message):
q = message.text
q1 = q.split()
q1.remove(q1[0])
str = " "
query = str.join(q1)
if query == "":
message.reply_animat... | true | true |
f7f9a704da9eb36e8a4c4758cd9c7d4a60880097 | 569 | py | Python | charts/random_coord.py | taimur1871/plotly_examples | 04cccbc1c60963c4a6b5405614d9136de93846f6 | [
"MIT"
] | null | null | null | charts/random_coord.py | taimur1871/plotly_examples | 04cccbc1c60963c4a6b5405614d9136de93846f6 | [
"MIT"
] | null | null | null | charts/random_coord.py | taimur1871/plotly_examples | 04cccbc1c60963c4a6b5405614d9136de93846f6 | [
"MIT"
] | 1 | 2022-01-19T03:15:52.000Z | 2022-01-19T03:15:52.000Z | import numpy as np
import pandas as pd
# set coordinate range
max_lat = 41.986046
min_lat = 41.056583
max_long = -89.766294
min_long = -92.238217
# random data
fake_data = []
for i in range(10):
rand_lat = np.random.uniform(min_lat, max_lat)
rand_long = np.random.uniform(min_long, max_long)
rand_dist = n... | 27.095238 | 86 | 0.706503 | import numpy as np
import pandas as pd
max_lat = 41.986046
min_lat = 41.056583
max_long = -89.766294
min_long = -92.238217
fake_data = []
for i in range(10):
rand_lat = np.random.uniform(min_lat, max_lat)
rand_long = np.random.uniform(min_long, max_long)
rand_dist = np.random.uniform(2500.00, 5500.00)
... | true | true |
f7f9a7572e4eb73ebe22a3e5d8af7b4ddccfcf01 | 24,385 | py | Python | relate/checks.py | romer8/relate | d25e3479f7746cf77d45fe0d34aff495dea9bd84 | [
"Unlicense"
] | null | null | null | relate/checks.py | romer8/relate | d25e3479f7746cf77d45fe0d34aff495dea9bd84 | [
"Unlicense"
] | 6 | 2015-08-18T00:13:40.000Z | 2018-01-31T05:55:13.000Z | relate/checks.py | davis68/relate | eb40c8c17d4a724a60de3caa3334521a833bad5c | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
__copyright__ = "Copyright (C) 2017 Dong Zhuang"
__license__ = """
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, in... | 43.779174 | 83 | 0.536518 |
from __future__ import division
__copyright__ = "Copyright (C) 2017 Dong Zhuang"
__license__ = """
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 limitat... | true | true |
f7f9a8288fcf6d5609e2107fcf8ce75c377db132 | 1,000 | py | Python | src/split_train_test.py | ibraheem-moosa/protein-asa-prediction | d9e49ec70008a41387739651a1e66798c0c2d5a6 | [
"MIT"
] | null | null | null | src/split_train_test.py | ibraheem-moosa/protein-asa-prediction | d9e49ec70008a41387739651a1e66798c0c2d5a6 | [
"MIT"
] | null | null | null | src/split_train_test.py | ibraheem-moosa/protein-asa-prediction | d9e49ec70008a41387739651a1e66798c0c2d5a6 | [
"MIT"
] | null | null | null | import random
from itertools import chain
def split_train_test_without_chaining(proteins, asas, train_ratio):
indices = list(range(len(proteins)))
random.shuffle(indices)
train_indices = indices[:int(train_ratio * len(indices))]
test_indices = indices[int(train_ratio * len(indices)):]
train_protei... | 41.666667 | 121 | 0.753 | import random
from itertools import chain
def split_train_test_without_chaining(proteins, asas, train_ratio):
indices = list(range(len(proteins)))
random.shuffle(indices)
train_indices = indices[:int(train_ratio * len(indices))]
test_indices = indices[int(train_ratio * len(indices)):]
train_protei... | true | true |
f7f9a88d99d63b1b98b730f1b0d9d97ffdb62133 | 3,207 | py | Python | whiskyton/models.py | gabrielusvicente/whiskyton | 2c3781120c44aced68ef0770f44c880491ff8cf0 | [
"MIT"
] | null | null | null | whiskyton/models.py | gabrielusvicente/whiskyton | 2c3781120c44aced68ef0770f44c880491ff8cf0 | [
"MIT"
] | 1 | 2021-03-26T00:32:58.000Z | 2021-03-26T00:32:58.000Z | whiskyton/models.py | gabrielusvicente/whiskyton | 2c3781120c44aced68ef0770f44c880491ff8cf0 | [
"MIT"
] | null | null | null | # coding: utf-8
from re import compile
from whiskyton import app, db
class Whisky(db.Model):
id = db.Column(db.Integer, primary_key=True)
distillery = db.Column(db.String(64), index=True, unique=True)
slug = db.Column(db.String(64), index=True, unique=True)
body = db.Column(db.Integer)
sweetness... | 33.40625 | 78 | 0.598067 |
from re import compile
from whiskyton import app, db
class Whisky(db.Model):
id = db.Column(db.Integer, primary_key=True)
distillery = db.Column(db.String(64), index=True, unique=True)
slug = db.Column(db.String(64), index=True, unique=True)
body = db.Column(db.Integer)
sweetness = db.Column(db... | true | true |
f7f9a9e1f30286d4b9732e44006a015568c7fa31 | 640 | py | Python | tests/utils/test_utils_udf.py | annelhote/fonduer | bd5b1feebfb2860286ae8b5a520b24baa023b445 | [
"MIT"
] | 379 | 2018-03-29T10:06:02.000Z | 2022-03-30T22:51:43.000Z | tests/utils/test_utils_udf.py | annelhote/fonduer | bd5b1feebfb2860286ae8b5a520b24baa023b445 | [
"MIT"
] | 328 | 2018-03-29T03:34:46.000Z | 2021-09-02T21:24:41.000Z | tests/utils/test_utils_udf.py | annelhote/fonduer | bd5b1feebfb2860286ae8b5a520b24baa023b445 | [
"MIT"
] | 86 | 2018-03-30T12:56:33.000Z | 2022-01-12T09:10:48.000Z | """Fonduer UDF utils' unit tests."""
import logging
import numpy as np
from fonduer.utils.utils_udf import shift_label_matrix, unshift_label_matrix
def test_shift_label_matrix(caplog):
"""Test the label matrix shifter and unshifter."""
caplog.set_level(logging.INFO)
"""
L is a dense label matrix (A... | 23.703704 | 76 | 0.651563 | import logging
import numpy as np
from fonduer.utils.utils_udf import shift_label_matrix, unshift_label_matrix
def test_shift_label_matrix(caplog):
caplog.set_level(logging.INFO)
L = np.array([[-1, 0], [1, -1]])
L_sparse = shift_label_matrix(L)
assert np.array_equal(L, unshift_label_matrix(L_sparse... | true | true |
f7f9a9e58ded44b7fc6c7e8ce65bb85b7f475e31 | 1,455 | py | Python | src/transformers/models/__init__.py | ArneBinder/transformers | ddaafd78fb9c98d4f7b5009fb1998deff4c3d6f1 | [
"Apache-2.0"
] | 309 | 2020-02-07T23:09:27.000Z | 2022-03-31T08:01:53.000Z | src/transformers/models/__init__.py | ArneBinder/transformers | ddaafd78fb9c98d4f7b5009fb1998deff4c3d6f1 | [
"Apache-2.0"
] | 93 | 2020-02-22T05:56:28.000Z | 2022-03-27T08:43:38.000Z | src/transformers/models/__init__.py | ArneBinder/transformers | ddaafd78fb9c98d4f7b5009fb1998deff4c3d6f1 | [
"Apache-2.0"
] | 148 | 2020-02-14T22:16:11.000Z | 2022-03-22T17:08:04.000Z | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 20.492958 | 77 | 0.656357 |
# module, but to preserve other warnings. So, don't check this module at all.
from . import (
albert,
auto,
bart,
barthez,
bert,
bert_generation,
bert_japanese,
bertweet,
blenderbot,
blenderbot_small,
camembert,
convbert,
ctrl,
deberta,
dialog... | true | true |
f7f9aa1264295e425b199cd156872887672fee2f | 1,126 | py | Python | lib/coginvasion/dna/DNALoader.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | 1 | 2020-03-12T16:44:10.000Z | 2020-03-12T16:44:10.000Z | lib/coginvasion/dna/DNALoader.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | null | null | null | lib/coginvasion/dna/DNALoader.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: lib.coginvasion.dna.DNALoader
from direct.stdpy import threading
from libpandadna import *
class DNABulkLoader:
def __init__(self,... | 27.463415 | 104 | 0.674067 |
from direct.stdpy import threading
from libpandadna import *
class DNABulkLoader:
def __init__(self, storage, files):
self.dnaStorage = storage
self.dnaFiles = files
def loadDNAFiles(self):
for file in self.dnaFiles:
print 'Reading DNA file...', file
loadDN... | false | true |
f7f9ab3b2346c9ea8b3904cf6065a172b03d0ea9 | 2,794 | py | Python | api/tests/test_repo_data.py | elisabettai/osparc-simcore | ad7b6e05111b50fe95e49306a992170490a7247f | [
"MIT"
] | null | null | null | api/tests/test_repo_data.py | elisabettai/osparc-simcore | ad7b6e05111b50fe95e49306a992170490a7247f | [
"MIT"
] | 1 | 2021-11-29T13:38:09.000Z | 2021-11-29T13:38:09.000Z | api/tests/test_repo_data.py | mrnicegyu11/osparc-simcore | b6fa6c245dbfbc18cc74a387111a52de9b05d1f4 | [
"MIT"
] | null | null | null | """ Keeps up-to-date all mock data in repo with schemas
"""
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import json
from pathlib import Path
import jsonschema
import pytest
import yaml
from utils import current_repo_dir
SYNCED_VERSIONS_SUFFIX = [
".jso... | 29.723404 | 99 | 0.641374 |
import json
from pathlib import Path
import jsonschema
import pytest
import yaml
from utils import current_repo_dir
SYNCED_VERSIONS_SUFFIX = [
".json",
"-converted.yaml",
]
PROJECTS_NAMES = [
"fake-project.json",
"fake-template-projects.hack08.notebooks.json",
"fake-template-projects.isa... | true | true |
f7f9abd526cb81b8ef6749da0f96f8ad4f10b3cc | 24,783 | py | Python | chia/farmer/farmer_api.py | nim-lang-cn/chia-blockchain | 02eb24b8d3ebfc65dfa602d88a72a946e97edb70 | [
"Apache-2.0"
] | null | null | null | chia/farmer/farmer_api.py | nim-lang-cn/chia-blockchain | 02eb24b8d3ebfc65dfa602d88a72a946e97edb70 | [
"Apache-2.0"
] | null | null | null | chia/farmer/farmer_api.py | nim-lang-cn/chia-blockchain | 02eb24b8d3ebfc65dfa602d88a72a946e97edb70 | [
"Apache-2.0"
] | null | null | null | import json
import time
from typing import Callable, Optional, List, Any, Dict
import aiohttp
from blspy import AugSchemeMPL, G2Element, PrivateKey
import chia.server.ws_connection as ws
from chia.consensus.network_type import NetworkType
from chia.consensus.pot_iterations import calculate_iterations_quality, calcula... | 50.269777 | 120 | 0.589315 | import json
import time
from typing import Callable, Optional, List, Any, Dict
import aiohttp
from blspy import AugSchemeMPL, G2Element, PrivateKey
import chia.server.ws_connection as ws
from chia.consensus.network_type import NetworkType
from chia.consensus.pot_iterations import calculate_iterations_quality, calcula... | true | true |
f7f9ac9e1e3038e4b1b2b7b257d085f0922391fb | 269 | py | Python | anki_helpers/models/AddNoteRequest.py | AndrewDang-Tran/AnkiConnectClient | f3c1cbbcd45b7e3391d9fe5b77dccbaa5c70ad69 | [
"MIT"
] | null | null | null | anki_helpers/models/AddNoteRequest.py | AndrewDang-Tran/AnkiConnectClient | f3c1cbbcd45b7e3391d9fe5b77dccbaa5c70ad69 | [
"MIT"
] | null | null | null | anki_helpers/models/AddNoteRequest.py | AndrewDang-Tran/AnkiConnectClient | f3c1cbbcd45b7e3391d9fe5b77dccbaa5c70ad69 | [
"MIT"
] | null | null | null | from typing import Dict, List
from dataclasses import dataclass
from .AddNoteOptions import AddNoteOptions
@dataclass(frozen = True)
class AddNoteRequest:
deckName: str
modelName: str
fields: Dict[str, str]
tags: List[str]
options: AddNoteOptions
| 20.692308 | 42 | 0.747212 | from typing import Dict, List
from dataclasses import dataclass
from .AddNoteOptions import AddNoteOptions
@dataclass(frozen = True)
class AddNoteRequest:
deckName: str
modelName: str
fields: Dict[str, str]
tags: List[str]
options: AddNoteOptions
| true | true |
f7f9ad62c91089b5561b759d0e7310ef4bc56565 | 46 | py | Python | hatspil/reports/__init__.py | dodomorandi/hatspil | 99c4d255b3f9836b32506636c84b16b3456bd74c | [
"MIT"
] | 2 | 2018-12-20T08:54:17.000Z | 2019-10-19T18:35:33.000Z | hatspil/reports/__init__.py | dodomorandi/hatspil | 99c4d255b3f9836b32506636c84b16b3456bd74c | [
"MIT"
] | null | null | null | hatspil/reports/__init__.py | dodomorandi/hatspil | 99c4d255b3f9836b32506636c84b16b3456bd74c | [
"MIT"
] | null | null | null | """A package to handle reports generation."""
| 23 | 45 | 0.717391 | true | true | |
f7f9ad8bf6c5f7536d6708d7d63bcf239c8c2b15 | 11,362 | py | Python | tests/util.py | themanifold/pyinfra | 5b2eef0b22fa6b1750d595d7eb3e258ce350a693 | [
"MIT"
] | 1 | 2021-09-25T09:21:37.000Z | 2021-09-25T09:21:37.000Z | tests/util.py | themanifold/pyinfra | 5b2eef0b22fa6b1750d595d7eb3e258ce350a693 | [
"MIT"
] | null | null | null | tests/util.py | themanifold/pyinfra | 5b2eef0b22fa6b1750d595d7eb3e258ce350a693 | [
"MIT"
] | null | null | null | import json
import os
from datetime import datetime
from io import open
from os import listdir, path
import six
from mock import patch
from pyinfra.api import Config, Inventory
from pyinfra.api.util import get_kwargs_str
from . import logger
def get_command_string(command):
value = command.get_raw_value()
... | 27.985222 | 99 | 0.594878 | import json
import os
from datetime import datetime
from io import open
from os import listdir, path
import six
from mock import patch
from pyinfra.api import Config, Inventory
from pyinfra.api.util import get_kwargs_str
from . import logger
def get_command_string(command):
value = command.get_raw_value()
... | true | true |
f7f9ae1d606adaf47619f3f0c44e0a87b8b3ca94 | 783 | py | Python | tests/_01_docs/_overview_routes_3.py | qedalab/spira | 32e4d2096e298b9fcc5952abd654312dc232a259 | [
"MIT"
] | 10 | 2018-07-13T09:46:21.000Z | 2021-06-22T13:34:50.000Z | tests/_01_docs/_overview_routes_3.py | qedalab/spira | 32e4d2096e298b9fcc5952abd654312dc232a259 | [
"MIT"
] | 8 | 2018-09-09T11:32:40.000Z | 2019-10-08T07:47:31.000Z | tests/_01_docs/_overview_routes_3.py | qedalab/spira | 32e4d2096e298b9fcc5952abd654312dc232a259 | [
"MIT"
] | 7 | 2019-01-17T18:50:17.000Z | 2022-01-13T20:27:52.000Z | import spira.all as spira
class RouteExample(spira.Cell):
layer = spira.LayerParameter(default=spira.RDD.PLAYER.M1.METAL, doc='Layer to be used when creating the route object.')
@spira.cache()
def get_io_ports(self):
p1 = spira.Port(name='P1', midpoint=(0,0), orientation=180, process=self.la... | 27.964286 | 123 | 0.666667 | import spira.all as spira
class RouteExample(spira.Cell):
layer = spira.LayerParameter(default=spira.RDD.PLAYER.M1.METAL, doc='Layer to be used when creating the route object.')
@spira.cache()
def get_io_ports(self):
p1 = spira.Port(name='P1', midpoint=(0,0), orientation=180, process=self.la... | true | true |
f7f9ae409701d86181a410df9b2590811761cf91 | 5,773 | py | Python | tests/test_pdfpapersaver.py | beyond-content/python-pdf-paper-saver | 48f9e65ab809288cfa63b7c37a090d60b21f7777 | [
"BSD-2-Clause"
] | null | null | null | tests/test_pdfpapersaver.py | beyond-content/python-pdf-paper-saver | 48f9e65ab809288cfa63b7c37a090d60b21f7777 | [
"BSD-2-Clause"
] | null | null | null | tests/test_pdfpapersaver.py | beyond-content/python-pdf-paper-saver | 48f9e65ab809288cfa63b7c37a090d60b21f7777 | [
"BSD-2-Clause"
] | null | null | null | from itertools import chain
from random import randint
from unittest import TestCase
from cStringIO import StringIO
from hamcrest import *
from rect import Rect
from reportlab.lib import pagesizes
from reportlab.lib.colors import black, getAllNamedColors
from reportlab.lib.units import mm
from reportlab.pdfgen.canvas... | 37.980263 | 110 | 0.642127 | from itertools import chain
from random import randint
from unittest import TestCase
from cStringIO import StringIO
from hamcrest import *
from rect import Rect
from reportlab.lib import pagesizes
from reportlab.lib.colors import black, getAllNamedColors
from reportlab.lib.units import mm
from reportlab.pdfgen.canvas... | true | true |
f7f9af65dfa00d71a2d381178aa540a3b00ffc98 | 4,109 | py | Python | src/flask_easy/repository/mongo_repository.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | 1 | 2021-12-30T12:25:05.000Z | 2021-12-30T12:25:05.000Z | src/flask_easy/repository/mongo_repository.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | null | null | null | src/flask_easy/repository/mongo_repository.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | null | null | null | """
mongo_repository.py
Author: Joseph Maclean Arhin
"""
import typing as t
import mongoengine as me
from ..exc import OperationError, NotFoundException
from .repository_interface import RepositoryInterface
class MongoRepository(RepositoryInterface):
"""
MongoRepository to be inherited
"""
model:... | 31.366412 | 88 | 0.595765 |
import typing as t
import mongoengine as me
from ..exc import OperationError, NotFoundException
from .repository_interface import RepositoryInterface
class MongoRepository(RepositoryInterface):
model: t.Type[me.Document]
@classmethod
def index(cls) -> t.List[me.Document]:
try:
ret... | true | true |
f7f9afbf6ffa62516cd10da080e06b707285fb60 | 6,659 | py | Python | simulated_annealing.py | Epsilon-Infinity/Self-driving-rides | 1ecbc05b6a51509d3f193260a131deca3383957f | [
"MIT"
] | null | null | null | simulated_annealing.py | Epsilon-Infinity/Self-driving-rides | 1ecbc05b6a51509d3f193260a131deca3383957f | [
"MIT"
] | null | null | null | simulated_annealing.py | Epsilon-Infinity/Self-driving-rides | 1ecbc05b6a51509d3f193260a131deca3383957f | [
"MIT"
] | null | null | null | from random import randint
import random
import math
from copy import deepcopy
from ride import Ride
from simulator import Simulator
# from main import solver
from collections import defaultdict
from vehicle import Vehicle
from timer import Timer
def solver(inputs):
rides_list = inputs['rides_list']
rides_lis... | 41.880503 | 113 | 0.54768 | from random import randint
import random
import math
from copy import deepcopy
from ride import Ride
from simulator import Simulator
from collections import defaultdict
from vehicle import Vehicle
from timer import Timer
def solver(inputs):
rides_list = inputs['rides_list']
rides_list = sorted([Ride(ride_inf... | true | true |
f7f9b06a44dc85ff43bc120d85ebe44a12eb08f2 | 12,953 | py | Python | var/spack/repos/builtin/packages/dray/package.py | HigherOrderMethods/spack | 87ed3fcc59fc25ce250042338d082925e3a3610b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-11-26T12:31:07.000Z | 2020-11-26T12:31:07.000Z | var/spack/repos/builtin/packages/dray/package.py | HigherOrderMethods/spack | 87ed3fcc59fc25ce250042338d082925e3a3610b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 15 | 2021-04-14T12:34:46.000Z | 2022-03-02T19:08:00.000Z | var/spack/repos/builtin/packages/dray/package.py | mahermanns/spack | 849943c63d1948c65f75cb8164e96ed361ca7a7f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
import socket
import llnl.util.tty as tty
def cmake_cache_entry(name, value, vtype=None)... | 41.383387 | 96 | 0.560179 |
from spack import *
import os
import socket
import llnl.util.tty as tty
def cmake_cache_entry(name, value, vtype=None):
if vtype is None:
if value == "ON" or value == "OFF":
vtype = "BOOL"
else:
vtype = "PATH"
return 'set({0} "{1}" CACHE {2} "")\n\n'.format(name,... | true | true |
f7f9b0bca3dbbd24fdc40a133125f52a8fa74272 | 7,441 | py | Python | nfv/nfv-common/nfv_common/thread/_thread.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | null | null | null | nfv/nfv-common/nfv_common/thread/_thread.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | null | null | null | nfv/nfv-common/nfv_common/thread/_thread.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2015-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import ctypes
from multiprocessing import Process
import signal
import sys
from nfv_common import debug
from nfv_common import selectable
from nfv_common import selobj
from nfv_common import timers
from nfv_common.helpers i... | 31.264706 | 82 | 0.605833 |
import ctypes
from multiprocessing import Process
import signal
import sys
from nfv_common import debug
from nfv_common import selectable
from nfv_common import selobj
from nfv_common import timers
from nfv_common.helpers import coroutine
from nfv_common.thread._thread_progress_marker import ThreadProgressMarke... | true | true |
f7f9b220725c89f0afb7ef7cd28df2b538a9eb11 | 1,629 | py | Python | resources/AccountResource.py | kckotcherlakota/workindia_passwordkeeper | 4168dc8310073588029359d2ede380d435e592ba | [
"Apache-2.0"
] | null | null | null | resources/AccountResource.py | kckotcherlakota/workindia_passwordkeeper | 4168dc8310073588029359d2ede380d435e592ba | [
"Apache-2.0"
] | null | null | null | resources/AccountResource.py | kckotcherlakota/workindia_passwordkeeper | 4168dc8310073588029359d2ede380d435e592ba | [
"Apache-2.0"
] | null | null | null | from flask_restful import Resource,reqparse
import pymysql
from models.Account import Account
from storage_security import StorageSecurity
class AccountListResource(Resource):
def get(self):
try:
SS = StorageSecurity()
parser = reqparse.RequestParser()
parser.add_ar... | 29.089286 | 70 | 0.54205 | from flask_restful import Resource,reqparse
import pymysql
from models.Account import Account
from storage_security import StorageSecurity
class AccountListResource(Resource):
def get(self):
try:
SS = StorageSecurity()
parser = reqparse.RequestParser()
parser.add_ar... | true | true |
f7f9b242e63a1464608be1618e12f03ed606d82f | 1,560 | py | Python | Assignment2_spark_ML/CC_A2_code/cc_a2/matrix.py | franciszhangkk/Cloud_computing | e53e91199119ea72a434d7b7b424f9029a11451c | [
"MIT"
] | null | null | null | Assignment2_spark_ML/CC_A2_code/cc_a2/matrix.py | franciszhangkk/Cloud_computing | e53e91199119ea72a434d7b7b424f9029a11451c | [
"MIT"
] | null | null | null | Assignment2_spark_ML/CC_A2_code/cc_a2/matrix.py | franciszhangkk/Cloud_computing | e53e91199119ea72a434d7b7b424f9029a11451c | [
"MIT"
] | null | null | null | import seaborn as sn
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import csv
import math
# def show_confusion_matrix(confusion, xlabels, ylabels):
# plt.figure(figsize=(14, 11))
# df_cm = pd.DataFrame(confusion, range(10), range(10))
# df_cm.astype(int)
#
# sn.heatmap(df_cm, ... | 30.588235 | 117 | 0.619872 | import seaborn as sn
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import csv
import math
matrix = []
with open('/Users/zekunzhang/Desktop/ML_A2/matrix/Confusion_MLP.csv') as training_label0:
spamreader_label = csv.reader(training_label0, quotechar=',')
for row in spamreade... | true | true |
f7f9b3ad8099082d90427adab7943f28d601265d | 2,370 | py | Python | trading_bot/pull_data.py | PabloJabat/trading-bot-python | f97930a34b614ae3538a27398ee82d9fde72cf9a | [
"MIT"
] | 4 | 2020-08-11T16:16:47.000Z | 2021-03-13T14:44:43.000Z | trading_bot/pull_data.py | fcarazo/trading-bot-python | db1144f18cd12814fa4806cffa1020c6bfcad2a4 | [
"MIT"
] | 6 | 2021-03-13T16:06:21.000Z | 2022-03-29T22:28:48.000Z | trading_bot/pull_data.py | fcarazo/trading-bot-python | db1144f18cd12814fa4806cffa1020c6bfcad2a4 | [
"MIT"
] | 2 | 2021-03-13T15:45:23.000Z | 2021-10-16T11:10:00.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pull data"""
import time
import concurrent.futures
from .config import *
from typing import List
import alpaca_trade_api
BASE_URL = "https://paper-api.alpaca.markets"
BARS_URL = f"https://data.alpaca.markets/v1/bars"
HEADERS = {
"APCA-API-KEY-ID": API_KEY,
"APC... | 30.779221 | 80 | 0.685654 |
import time
import concurrent.futures
from .config import *
from typing import List
import alpaca_trade_api
BASE_URL = "https://paper-api.alpaca.markets"
BARS_URL = f"https://data.alpaca.markets/v1/bars"
HEADERS = {
"APCA-API-KEY-ID": API_KEY,
"APCA-API-SECRET-KEY": SECRET_KEY
}
market_api = alpaca_trade_a... | true | true |
f7f9b5ad2ceee052e0ba12955d679dab4e84e53e | 702 | py | Python | ex19.py | nopythoner/python | 7d39eb361f3d3dd78d61c92740897ab04c80b195 | [
"MIT"
] | null | null | null | ex19.py | nopythoner/python | 7d39eb361f3d3dd78d61c92740897ab04c80b195 | [
"MIT"
] | null | null | null | ex19.py | nopythoner/python | 7d39eb361f3d3dd78d61c92740897ab04c80b195 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# coding:utf-8
def cheese_and_crackers(cheese_count,boxes_of_crackers):
print "You have %d cheeses!" %cheese_count
print "You have %d boxes of rackers!" %boxes_of_crackers
print "Man that's enough for a party!"
print "Get a blanket.\n"
print "We can just give the function numbers directly:... | 26 | 67 | 0.780627 |
def cheese_and_crackers(cheese_count,boxes_of_crackers):
print "You have %d cheeses!" %cheese_count
print "You have %d boxes of rackers!" %boxes_of_crackers
print "Man that's enough for a party!"
print "Get a blanket.\n"
print "We can just give the function numbers directly:"
cheese_and_crackers(20,30)
print... | false | true |
f7f9b6ab91d1c90241ce69b3942c4f394a37f0a9 | 1,775 | py | Python | src/daily-coding-problem/easy/word-board/word_board.py | nwthomas/code-challenges | 49c2532ff597495474e67b13f2ed9b9ad93d40b5 | [
"MIT"
] | 1 | 2020-12-11T05:54:59.000Z | 2020-12-11T05:54:59.000Z | src/daily-coding-problem/easy/word-board/word_board.py | nwthomas/code-challenges | 49c2532ff597495474e67b13f2ed9b9ad93d40b5 | [
"MIT"
] | 1 | 2021-04-10T06:53:30.000Z | 2021-04-10T06:53:30.000Z | src/daily-coding-problem/easy/word-board/word_board.py | nwthomas/code-challenges | 49c2532ff597495474e67b13f2ed9b9ad93d40b5 | [
"MIT"
] | 7 | 2019-11-24T12:10:35.000Z | 2020-12-14T22:36:31.000Z | """
Good morning! Here's your coding interview problem for today.
This problem was asked by Coursera.
Given a 2D board of characters and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically nei... | 30.603448 | 197 | 0.544789 |
def is_word_present(board, word):
if type(board) != list or type(board[0]) != list or type(word) != str:
return None
isFound = False
root_x = 0
root_y = 0
def find_word(x, y, current_word=""):
nonlocal isFound
new_current_word = current_word + board[x][y]
if new_cu... | true | true |
f7f9b776c46f0dde37bc1e6abdf12c6f13e16868 | 4,260 | py | Python | salt/modules/aix_group.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | 5 | 2018-05-01T20:51:14.000Z | 2021-11-09T05:43:00.000Z | salt/modules/aix_group.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | 4 | 2019-02-08T17:53:38.000Z | 2019-06-06T16:17:27.000Z | salt/modules/aix_group.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | 7 | 2017-09-29T18:49:53.000Z | 2021-11-09T05:42:49.000Z | # -*- coding: utf-8 -*-
'''
Manage groups on AIX
.. important::
If you feel that Salt should be using this module to manage groups on a
minion, and it is using a different module (or gives an error similar to
*'group.info' is not available*), see :ref:`here
<module-provider-override>`.
'''
from __futur... | 21.19403 | 81 | 0.598592 |
from __future__ import absolute_import, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
try:
import grp
except ImportError:
pass
__virtualname__ = 'group'
def __virtual__():
if __grains__['kernel'] == 'AIX':
return __virtualname__
return (False, 'The ... | true | true |
f7f9b8613102fb6706f8828e2bfabe654e588fa7 | 6,207 | py | Python | bin/augustus_parallel.py | gamcil/funannotate | e37418b754d018fcd18dc87d3931ab8bac892538 | [
"BSD-2-Clause"
] | null | null | null | bin/augustus_parallel.py | gamcil/funannotate | e37418b754d018fcd18dc87d3931ab8bac892538 | [
"BSD-2-Clause"
] | null | null | null | bin/augustus_parallel.py | gamcil/funannotate | e37418b754d018fcd18dc87d3931ab8bac892538 | [
"BSD-2-Clause"
] | 1 | 2021-01-19T02:11:17.000Z | 2021-01-19T02:11:17.000Z | #!/usr/bin/env python
import sys, multiprocessing, subprocess, os, shutil, argparse, time, inspect
from Bio import SeqIO
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import lib.library as lib
#setup menu wit... | 40.305195 | 136 | 0.641695 |
import sys, multiprocessing, subprocess, os, shutil, argparse, time, inspect
from Bio import SeqIO
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import lib.library as lib
class MyFormatter(argparse.Argument... | true | true |
f7f9b87c455908d11aaf14d364cbc3e51a3159bf | 215 | py | Python | bigcommerce/resources/v3/redirects.py | aglensmith/bigcommerce-api-python | 2f83ae30dbaa3cd9b7d465e40df2862a7f13795c | [
"MIT"
] | null | null | null | bigcommerce/resources/v3/redirects.py | aglensmith/bigcommerce-api-python | 2f83ae30dbaa3cd9b7d465e40df2862a7f13795c | [
"MIT"
] | null | null | null | bigcommerce/resources/v3/redirects.py | aglensmith/bigcommerce-api-python | 2f83ae30dbaa3cd9b7d465e40df2862a7f13795c | [
"MIT"
] | null | null | null | from ..base import *
class Redirects(ListableApiResource, CreateableApiResource,
UpdateableApiResource, DeleteableApiResource):
resource_version = 'v3'
resource_name = 'storefront/redirects' | 30.714286 | 61 | 0.744186 | from ..base import *
class Redirects(ListableApiResource, CreateableApiResource,
UpdateableApiResource, DeleteableApiResource):
resource_version = 'v3'
resource_name = 'storefront/redirects' | true | true |
f7f9b940106e34f91dc65350ce17d8d76ecf78f5 | 48,550 | py | Python | sympy/utilities/lambdify.py | synthetic-tensors/sympy | d7da4f357f6a556f4d4933502335d49642927640 | [
"BSD-3-Clause"
] | null | null | null | sympy/utilities/lambdify.py | synthetic-tensors/sympy | d7da4f357f6a556f4d4933502335d49642927640 | [
"BSD-3-Clause"
] | null | null | null | sympy/utilities/lambdify.py | synthetic-tensors/sympy | d7da4f357f6a556f4d4933502335d49642927640 | [
"BSD-3-Clause"
] | null | null | null | """
This module provides convenient functions to transform sympy expressions to
lambda functions which can be used to calculate numerical values very fast.
"""
from typing import Any, Dict, Iterable
import builtins
import inspect
import keyword
import textwrap
import linecache
from sympy.utilities.exceptions import ... | 36.367041 | 139 | 0.618393 |
from typing import Any, Dict, Iterable
import builtins
import inspect
import keyword
import textwrap
import linecache
from sympy.utilities.exceptions import SymPyDeprecationWarning
from sympy.core.compatibility import (is_sequence, iterable,
NotIterable)
from sympy.utilities.misc import filldedent
from sympy.uti... | true | true |
f7f9b949e5f6e382015eabefcef7631166191ea0 | 1,952 | py | Python | snoop/urls.py | liquidinvestigations/hoover-snoop2 | 28e328401609f53fb56abaa4817619085aa3fbee | [
"MIT"
] | null | null | null | snoop/urls.py | liquidinvestigations/hoover-snoop2 | 28e328401609f53fb56abaa4817619085aa3fbee | [
"MIT"
] | 168 | 2019-11-07T12:38:07.000Z | 2021-04-19T09:53:51.000Z | snoop/urls.py | liquidinvestigations/hoover-snoop2 | 28e328401609f53fb56abaa4817619085aa3fbee | [
"MIT"
] | null | null | null | """Root URL routes file.
Points to global health check, admin sites, API documentation generators and the [snoop.data.urls][] URLs.
Also sets global URL prefixes.
"""
from django.urls import path, include, re_path
from django.http import HttpResponseRedirect
from django.conf import settings
from rest_framework import... | 32.533333 | 106 | 0.688525 |
from django.urls import path, include, re_path
from django.http import HttpResponseRedirect
from django.conf import settings
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from snoop import views
from snoop.data import admin
def redirect_to_admin(reque... | true | true |
f7f9b9e95f206c9a16415c219040fa1e279fd4ea | 2,148 | py | Python | src/django_dart_reverse/management/commands/collectstatic_dart_reverse.py | marekprochazka/django-dart-reverse | b1bf6f076cf96782437dcba0a2f264d6e179e9c0 | [
"MIT"
] | null | null | null | src/django_dart_reverse/management/commands/collectstatic_dart_reverse.py | marekprochazka/django-dart-reverse | b1bf6f076cf96782437dcba0a2f264d6e179e9c0 | [
"MIT"
] | null | null | null | src/django_dart_reverse/management/commands/collectstatic_dart_reverse.py | marekprochazka/django-dart-reverse | b1bf6f076cf96782437dcba0a2f264d6e179e9c0 | [
"MIT"
] | null | null | null | import os
import sys
from django.core.exceptions import ImproperlyConfigured
from django.core.files.base import ContentFile
from django.core.files.storage import FileSystemStorage
from django.core.management.base import BaseCommand
from django_dart_reverse.utils.collect_urls import collect_urls
from django.urls import... | 37.034483 | 125 | 0.708101 | import os
import sys
from django.core.exceptions import ImproperlyConfigured
from django.core.files.base import ContentFile
from django.core.files.storage import FileSystemStorage
from django.core.management.base import BaseCommand
from django_dart_reverse.utils.collect_urls import collect_urls
from django.urls import... | true | true |
f7f9b9ffaa84be12beaa72e62b7c1b1d877cca69 | 1,962 | py | Python | tests/test_classification_pipeline.py | giorgiosavastano/casa | 8ecfdb121ec5b6814a5c15bc75d6879848c99ec9 | [
"MIT"
] | 1 | 2022-03-22T11:35:06.000Z | 2022-03-22T11:35:06.000Z | tests/test_classification_pipeline.py | giorgiosavastano/CASA | 8ecfdb121ec5b6814a5c15bc75d6879848c99ec9 | [
"MIT"
] | 1 | 2022-03-27T16:08:56.000Z | 2022-03-27T16:08:56.000Z | tests/test_classification_pipeline.py | giorgiosavastano/CASA | 8ecfdb121ec5b6814a5c15bc75d6879848c99ec9 | [
"MIT"
] | null | null | null | from pathlib import Path
from unittest import TestCase
import numpy as np
import pytest
from cassa.classification_pipeline import (
eigen_decomposition,
get_affinity_matrix,
get_clusters_spectral,
)
from cassa.distance_matrix import DistanceMatrix
path = Path(__file__)
class TestDistMatrix(TestCase):
... | 30.65625 | 77 | 0.699286 | from pathlib import Path
from unittest import TestCase
import numpy as np
import pytest
from cassa.classification_pipeline import (
eigen_decomposition,
get_affinity_matrix,
get_clusters_spectral,
)
from cassa.distance_matrix import DistanceMatrix
path = Path(__file__)
class TestDistMatrix(TestCase):
... | true | true |
f7f9ba475ec001028cdc14895a97b63e91f5b204 | 5,507 | py | Python | results/aggregate_results.py | mostafamahdieh/ClusteringFaultPronenessTCP | 567184740d24f464cde7d623f84ec3a6d989d401 | [
"MIT"
] | null | null | null | results/aggregate_results.py | mostafamahdieh/ClusteringFaultPronenessTCP | 567184740d24f464cde7d623f84ec3a6d989d401 | [
"MIT"
] | null | null | null | results/aggregate_results.py | mostafamahdieh/ClusteringFaultPronenessTCP | 567184740d24f464cde7d623f84ec3a6d989d401 | [
"MIT"
] | 1 | 2021-09-21T13:29:01.000Z | 2021-09-21T13:29:01.000Z | import pandas as pd
from pandas import Categorical
import numpy as np
from numpy import std, mean, sqrt
import os
import matplotlib
import matplotlib.pyplot as plt
import scipy.stats as stats
import itertools as it
def effect_size(lst1, lst2):
return improvement(lst1, lst2)
def improvement(x, y):... | 40.19708 | 132 | 0.610677 | import pandas as pd
from pandas import Categorical
import numpy as np
from numpy import std, mean, sqrt
import os
import matplotlib
import matplotlib.pyplot as plt
import scipy.stats as stats
import itertools as it
def effect_size(lst1, lst2):
return improvement(lst1, lst2)
def improvement(x, y):... | true | true |
f7f9bb06540b930a8b6704051424343cb499ec30 | 803 | py | Python | python/program.py | dejanfajfar/enigma | 51d737a843571d173c93d0abba7017518e1b217b | [
"MIT"
] | null | null | null | python/program.py | dejanfajfar/enigma | 51d737a843571d173c93d0abba7017518e1b217b | [
"MIT"
] | null | null | null | python/program.py | dejanfajfar/enigma | 51d737a843571d173c93d0abba7017518e1b217b | [
"MIT"
] | null | null | null | import Rotor
import Reflector
from Enigma import Enigma
rotor1 = Rotor.Rotor("C", Rotor.Type1, 'r1')
rotor2 = Rotor.Rotor("A", Rotor.Type1, 'r2')
rotor3 = Rotor.Rotor("D", Rotor.Type1, 'r3')
rotor12 = Rotor.Rotor("C", Rotor.Type1, 'r1')
rotor22 = Rotor.Rotor("A", Rotor.Type1, 'r2')
rotor32 = Rotor.Rotor("D", Rotor.Ty... | 28.678571 | 64 | 0.739726 | import Rotor
import Reflector
from Enigma import Enigma
rotor1 = Rotor.Rotor("C", Rotor.Type1, 'r1')
rotor2 = Rotor.Rotor("A", Rotor.Type1, 'r2')
rotor3 = Rotor.Rotor("D", Rotor.Type1, 'r3')
rotor12 = Rotor.Rotor("C", Rotor.Type1, 'r1')
rotor22 = Rotor.Rotor("A", Rotor.Type1, 'r2')
rotor32 = Rotor.Rotor("D", Rotor.Ty... | true | true |
f7f9bb2ba1a602a40bcb09a7b2118dd904b7e424 | 2,381 | py | Python | rlpyt/utils/tensor.py | cambel/rlpyt | 96e231d6c77ba5ff06dd09f6e9c8837f0abb1a89 | [
"MIT"
] | 17 | 2020-12-07T11:10:03.000Z | 2022-03-21T04:18:13.000Z | rlpyt/utils/tensor.py | cambel/rlpyt | 96e231d6c77ba5ff06dd09f6e9c8837f0abb1a89 | [
"MIT"
] | 3 | 2021-02-20T01:59:20.000Z | 2021-12-08T09:19:43.000Z | rlpyt/utils/tensor.py | cambel/rlpyt | 96e231d6c77ba5ff06dd09f6e9c8837f0abb1a89 | [
"MIT"
] | 3 | 2021-04-19T14:40:32.000Z | 2022-03-29T15:56:38.000Z |
import torch
def select_at_indexes(indexes, tensor):
"""Leading dimensions of tensor must match dimensions of indexes."""
dim = len(indexes.shape)
assert indexes.shape == tensor.shape[:dim]
num = indexes.numel()
t_flat = tensor.view((num,) + tensor.shape[dim:])
s_flat = t_flat[torch.arange(nu... | 34.014286 | 80 | 0.642587 |
import torch
def select_at_indexes(indexes, tensor):
dim = len(indexes.shape)
assert indexes.shape == tensor.shape[:dim]
num = indexes.numel()
t_flat = tensor.view((num,) + tensor.shape[dim:])
s_flat = t_flat[torch.arange(num), indexes.view(-1)]
return s_flat.view(tensor.shape[:dim] + tensor.... | true | true |
f7f9bbb2632c6f35444faaf33af8f70a8b3075fb | 1,876 | py | Python | pygments_base16/base16-mellow-purple.py | philj56/base16-pygments | 04cf1b28ad4a5603cd3336a3c4dba976cf5f1e5b | [
"MIT"
] | null | null | null | pygments_base16/base16-mellow-purple.py | philj56/base16-pygments | 04cf1b28ad4a5603cd3336a3c4dba976cf5f1e5b | [
"MIT"
] | null | null | null | pygments_base16/base16-mellow-purple.py | philj56/base16-pygments | 04cf1b28ad4a5603cd3336a3c4dba976cf5f1e5b | [
"MIT"
] | null | null | null | from pygments.style import Style
from pygments.token import (
Comment, Error, Keyword, Literal, Name, Number, Operator, String, Text
)
class BaseSixteenStyle(Style):
base00 = '#1e0528'
base01 = '#1A092D'
base02 = '#331354'
base03 = '#320f55'
base04 = '#873582'
base05 = '#ffeeff'
base06... | 25.351351 | 74 | 0.570896 | from pygments.style import Style
from pygments.token import (
Comment, Error, Keyword, Literal, Name, Number, Operator, String, Text
)
class BaseSixteenStyle(Style):
base00 = '#1e0528'
base01 = '#1A092D'
base02 = '#331354'
base03 = '#320f55'
base04 = '#873582'
base05 = '#ffeeff'
base06... | true | true |
f7f9bcabdc23c3b530e5db4bbcb30206e5e9becd | 595 | py | Python | accounts/admin.py | mcastellin/anem-per-feina | 5c7072c560e8e34355f7bbf7db12e36403766e68 | [
"MIT"
] | null | null | null | accounts/admin.py | mcastellin/anem-per-feina | 5c7072c560e8e34355f7bbf7db12e36403766e68 | [
"MIT"
] | null | null | null | accounts/admin.py | mcastellin/anem-per-feina | 5c7072c560e8e34355f7bbf7db12e36403766e68 | [
"MIT"
] | null | null | null | from django.contrib import admin # type: ignore
# Register your models here.
from accounts.models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
list_display = [
"email",
"first_name",
"last_name",
"is_active",
"date_joined",
]
list_filter = ... | 20.517241 | 67 | 0.544538 | from django.contrib import admin
from accounts.models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
list_display = [
"email",
"first_name",
"last_name",
"is_active",
"date_joined",
]
list_filter = ["role", "is_active", "is_staff", "is_supe... | true | true |
f7f9bd42690d032cbf16620fa48e6d3d3afc9813 | 30,393 | py | Python | azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | null | null | null | azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 45.362687 | 176 | 0.667884 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class DomainsOperations(object):
models = models
def __init__... | true | true |
f7f9bd4802acfc26e5fcfcf2ce4b87743031bf20 | 115 | py | Python | Examples/execute_command.py | GrayHatsUWB/Slacked | 46819015c449ac5c0527e6d5fd8ed7c30ed53e02 | [
"BSD-3-Clause"
] | 3 | 2019-11-01T07:19:44.000Z | 2021-07-05T06:45:54.000Z | Examples/execute_command.py | GrayHatsUWB/Slacked | 46819015c449ac5c0527e6d5fd8ed7c30ed53e02 | [
"BSD-3-Clause"
] | null | null | null | Examples/execute_command.py | GrayHatsUWB/Slacked | 46819015c449ac5c0527e6d5fd8ed7c30ed53e02 | [
"BSD-3-Clause"
] | 2 | 2018-05-26T01:51:44.000Z | 2020-04-11T18:46:52.000Z | import subprocess
output = subprocess.run(['echo', 'You got hacked'], stdout=subprocess.PIPE)
print(output.stdout)
| 28.75 | 75 | 0.765217 | import subprocess
output = subprocess.run(['echo', 'You got hacked'], stdout=subprocess.PIPE)
print(output.stdout)
| true | true |
f7f9bda241d84da72808b519280b2468239d4042 | 6,099 | py | Python | scapy/lib/python2.7/site-packages/setuptools/build_meta.py | akellermann97/college-dump | 5c82d93767038709ad71b8f212fdb6243eeb0aec | [
"MIT"
] | 1 | 2018-10-22T10:42:08.000Z | 2018-10-22T10:42:08.000Z | scapy/lib/python2.7/site-packages/setuptools/build_meta.py | akellermann97/college-dump | 5c82d93767038709ad71b8f212fdb6243eeb0aec | [
"MIT"
] | 6 | 2018-09-20T15:27:32.000Z | 2022-03-11T23:29:42.000Z | virtual/lib/python3.6/site-packages/setuptools/build_meta.py | kd-kinuthiadavid/TWMRS | 4a5b8240226a0063bfc9e7651013947c36a7be39 | [
"MIT"
] | 3 | 2018-09-17T12:46:34.000Z | 2018-09-18T06:03:51.000Z | """A PEP 517 interface to setuptools
Previously, when a user or a command line tool (let's call it a "frontend")
needed to make a request of setuptools to take a certain action, for
example, generating a list of installation requirements, the frontend would
would call "setup.py egg_info" or "setup.py bdist_wheel" on t... | 32.967568 | 86 | 0.696836 |
import os
import sys
import tokenize
import shutil
import contextlib
import setuptools
import distutils
class SetupRequirementsError(BaseException):
def __init__(self, specifiers):
self.specifiers = specifiers
class Distribution(setuptools.dist.Distribution):
def fetch_build_eggs(self, specifiers)... | true | true |
f7f9be8cd1fdd85121a701f48f4f2fe02cc3ffda | 3,758 | py | Python | Bilibili/Article/article_img.py | THFX/python-webspider | 18feaff330f069a90cc43ee5768a504f8d90e476 | [
"MIT"
] | 7 | 2019-09-02T05:33:36.000Z | 2020-08-17T07:24:51.000Z | Bilibili/Article/article_img.py | THFX/python-webspider | 18feaff330f069a90cc43ee5768a504f8d90e476 | [
"MIT"
] | null | null | null | Bilibili/Article/article_img.py | THFX/python-webspider | 18feaff330f069a90cc43ee5768a504f8d90e476 | [
"MIT"
] | 7 | 2020-04-08T07:19:17.000Z | 2021-11-01T10:42:26.000Z | import requests
import re
import os
import time
def Download():
print("开始下载......")
i = 1
# 建立以时间命名的目录
#
# ----获取系统时间 年 月 日
ymd = time.strftime("%Y%m%d", time.localtime(time.time()))
# ---- 获取系统时间 小时 分钟 秒。 输出:120043
hms = time.strftime("%H%M%S", time.localtime(time.time()))
#
p... | 24.887417 | 135 | 0.509313 | import requests
import re
import os
import time
def Download():
print("开始下载......")
i = 1
ymd = time.strftime("%Y%m%d", time.localtime(time.time()))
hms = time.strftime("%H%M%S", time.localtime(time.time()))
path = str(ymd)+"_"+str(hms)
os.mkdir("./"+path)
print("目... | true | true |
f7f9c07d2aeab74ea3d23de97a392c72a05b315f | 11,074 | py | Python | cogs/moderation.py | xxopcode90xx/DiscordChatBotProject | d9577fabe9d5b57ad31c36a6abcc8c907a15c69d | [
"Apache-2.0"
] | null | null | null | cogs/moderation.py | xxopcode90xx/DiscordChatBotProject | d9577fabe9d5b57ad31c36a6abcc8c907a15c69d | [
"Apache-2.0"
] | null | null | null | cogs/moderation.py | xxopcode90xx/DiscordChatBotProject | d9577fabe9d5b57ad31c36a6abcc8c907a15c69d | [
"Apache-2.0"
] | null | null | null | """"
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Description:
This is a template to create your own discord bot in python.
Version: 3.1.1
"""
import json
import os
import sys
import discord
from discord.ext import commands
from discord_slash import cog_ext, SlashContext
from discord_slash.utils.manage_co... | 36.071661 | 178 | 0.530793 |
import json
import os
import sys
import discord
from discord.ext import commands
from discord_slash import cog_ext, SlashContext
from discord_slash.utils.manage_commands import create_option
from helpers import checks
if not os.path.isfile("config.json"):
sys.exit("'config.json' not found! Please add it and try... | true | true |
f7f9c0cb72bce30399792056fa4ca80a491e9fca | 2,618 | py | Python | census/migrations/0001_initial.py | escobar022/cens_django | 984fb224d2cb7f16e1d54564a1f1fc5e8ff76e3b | [
"MIT"
] | null | null | null | census/migrations/0001_initial.py | escobar022/cens_django | 984fb224d2cb7f16e1d54564a1f1fc5e8ff76e3b | [
"MIT"
] | null | null | null | census/migrations/0001_initial.py | escobar022/cens_django | 984fb224d2cb7f16e1d54564a1f1fc5e8ff76e3b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='APISetting',
fields=[
('id', models.AutoField(v... | 65.45 | 1,229 | 0.559969 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='APISetting',
fields=[
('id', models.AutoField(verbose_name='ID', seria... | true | true |
f7f9c11e3b690ded7d61e1f4f5a7684443accee3 | 4,367 | py | Python | schedule/urls.py | drodger/django-scheduler | 564b47da32d909188e2563a0b4312fbaebe3f309 | [
"BSD-3-Clause"
] | null | null | null | schedule/urls.py | drodger/django-scheduler | 564b47da32d909188e2563a0b4312fbaebe3f309 | [
"BSD-3-Clause"
] | null | null | null | schedule/urls.py | drodger/django-scheduler | 564b47da32d909188e2563a0b4312fbaebe3f309 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from django.views.generic.list import ListView
from schedule.feeds import CalendarICalendar, UpcomingEventsFeed
from schedule.models import Calendar
from schedule.periods import Day, Month, Week, Year
from schedule.views import (
CalendarByPeriodsView, CalendarView, CancelOccurrenc... | 41.590476 | 138 | 0.641401 | from django.conf.urls import url
from django.views.generic.list import ListView
from schedule.feeds import CalendarICalendar, UpcomingEventsFeed
from schedule.models import Calendar
from schedule.periods import Day, Month, Week, Year
from schedule.views import (
CalendarByPeriodsView, CalendarView, CancelOccurrenc... | true | true |
f7f9c16fda69f33e7ba7f55acdf3328788822fde | 641 | py | Python | setup.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | 16 | 2015-02-06T14:35:57.000Z | 2021-07-10T11:14:00.000Z | setup.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | 310 | 2015-01-07T14:39:35.000Z | 2016-05-02T17:41:30.000Z | setup.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | 22 | 2015-01-15T13:46:03.000Z | 2020-07-24T10:08:51.000Z | import os
from setuptools import setup, find_packages
setup(
name='fjord',
version='1.0',
description='Django application.',
long_description='',
author='Mozilla Foundation',
author_email='',
license='BSD',
url='https://github.com/mozilla/fjord',
include_package_data=True,
cla... | 24.653846 | 49 | 0.613105 | import os
from setuptools import setup, find_packages
setup(
name='fjord',
version='1.0',
description='Django application.',
long_description='',
author='Mozilla Foundation',
author_email='',
license='BSD',
url='https://github.com/mozilla/fjord',
include_package_data=True,
cla... | true | true |
f7f9c3220e75629f8f0dcc88021598b779e44f1c | 9,132 | py | Python | deep-learning/GANs and Variational Autoencoders/BigGAN-PyTorch/train.py | DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials | 7adab3877fc1d3f1d5f57e6c1743dae8f76f72c5 | [
"Apache-2.0"
] | 3,266 | 2017-08-06T16:51:46.000Z | 2022-03-30T07:34:24.000Z | train.py | darthsuogles/BigGAN-PyTorch | 6988f1f3ccfa4f6794ce269f056422da4ce9baf6 | [
"MIT"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | train.py | darthsuogles/BigGAN-PyTorch | 6988f1f3ccfa4f6794ce269f056422da4ce9baf6 | [
"MIT"
] | 1,449 | 2017-08-06T17:40:59.000Z | 2022-03-31T12:03:24.000Z | """ BigGAN: The Authorized Unofficial PyTorch release
Code by A. Brock and A. Andonian
This code is an unofficial reimplementation of
"Large-Scale GAN Training for High Fidelity Natural Image Synthesis,"
by A. Brock, J. Donahue, and K. Simonyan (arXiv 1809.11096).
Let's go.
"""
import os
import fu... | 40.229075 | 124 | 0.635896 |
import os
import functools
import math
import numpy as np
from tqdm import tqdm, trange
import torch
import torch.nn as nn
from torch.nn import init
import torch.optim as optim
import torch.nn.functional as F
from torch.nn import Parameter as P
import torchvision
import inception_utils
import utils
import losses
i... | true | true |
f7f9c54b17dacd252e701e8adb842c091f9e4901 | 681 | py | Python | accounts/migrations/0002_auto_20200908_1336.py | SarangWadode/medstore | 07cb70661a8cba6f8dd090dfbd589bfacb7bf12a | [
"MIT"
] | 2 | 2021-03-24T13:36:39.000Z | 2022-02-10T13:51:59.000Z | accounts/migrations/0002_auto_20200908_1336.py | SarangWadode/medstore | 07cb70661a8cba6f8dd090dfbd589bfacb7bf12a | [
"MIT"
] | 44 | 2021-01-05T01:51:38.000Z | 2022-02-10T13:44:26.000Z | accounts/migrations/0002_auto_20200908_1336.py | mukeshgurpude/medstore | 498b76acbeb9727e7a61560e4016b3577c2706d2 | [
"MIT"
] | 1 | 2020-10-28T09:26:01.000Z | 2020-10-28T09:26:01.000Z | # Generated by Django 3.1 on 2020-09-08 08:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='gender',
... | 28.375 | 155 | 0.593245 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='gender',
field=models.CharField(choices=[('Male', '... | true | true |
f7f9c57d95687981d735c5b9f71b31788ac82444 | 767 | py | Python | desktop/core/ext-py/xlwt-1.3.0/examples/merged.py | zhoudahong/hue | 9ec1b48e6abf08e81b74fa5fc4a03770e37aff92 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/xlwt-1.3.0/examples/merged.py | zhoudahong/hue | 9ec1b48e6abf08e81b74fa5fc4a03770e37aff92 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/xlwt-1.3.0/examples/merged.py | zhoudahong/hue | 9ec1b48e6abf08e81b74fa5fc4a03770e37aff92 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | #!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman
from xlwt import *
fnt = Font()
fnt.name = 'Arial'
fnt.colour_index = 4
fnt.bold = True
borders = Borders()
borders.left = 6
borders.right = 6
borders.top = 6
borders.bottom = 6
al = Alignment()
al.horz = Alignment.HORZ_CENTER
... | 19.175 | 64 | 0.65189 |
from xlwt import *
fnt = Font()
fnt.name = 'Arial'
fnt.colour_index = 4
fnt.bold = True
borders = Borders()
borders.left = 6
borders.right = 6
borders.top = 6
borders.bottom = 6
al = Alignment()
al.horz = Alignment.HORZ_CENTER
al.vert = Alignment.VERT_CENTER
style = XFStyle()
style.font = fnt
style.borders = bo... | true | true |
f7f9c631dd0b2e9aa7271690abee3aed5371fe4f | 2,380 | py | Python | apps/students/models.py | 96RadhikaJadhav/JagratiWebApp | f516c1a683dc0b550f8e0815a012342d316c3de1 | [
"MIT"
] | 1 | 2020-12-31T13:56:55.000Z | 2020-12-31T13:56:55.000Z | apps/students/models.py | 96RadhikaJadhav/JagratiWebApp | f516c1a683dc0b550f8e0815a012342d316c3de1 | [
"MIT"
] | null | null | null | apps/students/models.py | 96RadhikaJadhav/JagratiWebApp | f516c1a683dc0b550f8e0815a012342d316c3de1 | [
"MIT"
] | null | null | null | from django.db import models
from home.models import Calendar, Schedule
# Create your models here.
class Student(models.Model):
VILLAGE = (
('G', 'Gadheri'),
('M', 'Mehgawan'),
('C', 'Chanditola'),
('A', 'Amanala'),
('S', 'Suarkol'),
)
first_name = models.CharField... | 35 | 103 | 0.677731 | from django.db import models
from home.models import Calendar, Schedule
class Student(models.Model):
VILLAGE = (
('G', 'Gadheri'),
('M', 'Mehgawan'),
('C', 'Chanditola'),
('A', 'Amanala'),
('S', 'Suarkol'),
)
first_name = models.CharField(max_length=50)
last_n... | true | true |
f7f9c7099985c76c55e77a21d827117a20fecab1 | 2,348 | py | Python | tests/conftest.py | TinLe/elastalert | fc648c37eaed7617196a1ca020ebd99beb0fade8 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | TinLe/elastalert | fc648c37eaed7617196a1ca020ebd99beb0fade8 | [
"Apache-2.0"
] | 1 | 2021-06-02T04:32:03.000Z | 2021-06-02T04:32:03.000Z | tests/conftest.py | talyian/elastalert | 8ff39d485c0babd098ad659b53ce0f8ad456c6c3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import elasticsearch
import mock
import pytest
from elastalert.elastalert import ElastAlerter
class mock_es_client(object):
def __init__(self, host='es', port=14900):
self.host = host
self.port = port
self.return_hits = []
self.search = moc... | 31.306667 | 73 | 0.58092 |
import datetime
import elasticsearch
import mock
import pytest
from elastalert.elastalert import ElastAlerter
class mock_es_client(object):
def __init__(self, host='es', port=14900):
self.host = host
self.port = port
self.return_hits = []
self.search = mock.Mock()
self.c... | true | true |
f7f9c7a8e30f567acb44dc065de504016bedccd2 | 663 | py | Python | app/user/views.py | EmersonsfDev/Flask_login | d50e62b0352fa6d2b69e21e14f6d4bf8e9cbc92f | [
"Apache-2.0"
] | null | null | null | app/user/views.py | EmersonsfDev/Flask_login | d50e62b0352fa6d2b69e21e14f6d4bf8e9cbc92f | [
"Apache-2.0"
] | null | null | null | app/user/views.py | EmersonsfDev/Flask_login | d50e62b0352fa6d2b69e21e14f6d4bf8e9cbc92f | [
"Apache-2.0"
] | null | null | null | from flask import redirect, render_template, url_for
from flask_login import login_required
from app import db
from app.models import User
from . import user
@user.route("/")
def index():
users = User.query.all() # Select * from users;
return render_template("users.html", users=users)
@user.... | 23.678571 | 54 | 0.671192 | from flask import redirect, render_template, url_for
from flask_login import login_required
from app import db
from app.models import User
from . import user
@user.route("/")
def index():
users = User.query.all()
return render_template("users.html", users=users)
@user.route("/user/<int:id>")
... | true | true |
f7f9c8525c8765435d123e12348f5dbca6ca3c15 | 3,732 | py | Python | sdk/python/pulumi_azure/authorization/get_user_assigned_identity.py | AdminTurnedDevOps/pulumi-azure | affd9eaaee3016f350f0d0469694dbd52850300b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/authorization/get_user_assigned_identity.py | AdminTurnedDevOps/pulumi-azure | affd9eaaee3016f350f0d0469694dbd52850300b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/authorization/get_user_assigned_identity.py | AdminTurnedDevOps/pulumi-azure | affd9eaaee3016f350f0d0469694dbd52850300b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class GetUse... | 39.702128 | 134 | 0.667203 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class GetUserAssignedIdentityResult:
def __init__(__self__, client_id=None, id=None, location=None, name=None, principal_id=None, resource_group_name=None, tags=None):
if client_id ... | true | true |
f7f9c927990c92870b237492b72e754c44b514cc | 91 | py | Python | saltshaker/version.py | diegotoral/SaltShaker | 86c7619f3347c1b56ed3e680b8bb558d93b0e385 | [
"MIT"
] | 2 | 2017-07-02T20:29:26.000Z | 2017-07-02T21:18:51.000Z | saltshaker/version.py | diegotoral/SaltShaker | 86c7619f3347c1b56ed3e680b8bb558d93b0e385 | [
"MIT"
] | null | null | null | saltshaker/version.py | diegotoral/SaltShaker | 86c7619f3347c1b56ed3e680b8bb558d93b0e385 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__version__ = '0.0.1'
def get_version():
return __version__
| 11.375 | 23 | 0.604396 |
__version__ = '0.0.1'
def get_version():
return __version__
| true | true |
f7f9c96dca50dc206ff3e874c0800267a552dca3 | 497 | py | Python | week10/CinemaReservation/hack_cinema/users/users_gateway.py | HackBulgaria/Programming-101-Python-2020-Spring | 443446028df7fe78fcdd6c37dada0b5cd8ed3c93 | [
"MIT"
] | 30 | 2020-01-22T17:22:43.000Z | 2022-01-26T08:28:57.000Z | week10/CinemaReservation/hack_cinema/users/users_gateway.py | HackBulgaria/Programming-101-Python-2020-Spring | 443446028df7fe78fcdd6c37dada0b5cd8ed3c93 | [
"MIT"
] | 1 | 2020-01-21T19:50:47.000Z | 2020-03-18T16:18:31.000Z | week10/CinemaReservation/hack_cinema/users/users_gateway.py | HackBulgaria/Programming-101-Python-2020-Spring | 443446028df7fe78fcdd6c37dada0b5cd8ed3c93 | [
"MIT"
] | 7 | 2019-11-28T15:59:16.000Z | 2020-12-05T08:39:02.000Z | from ..db import Database
from .models import UserModel
class UserGateway:
def __init__(self):
self.model = UserModel
self.db = Database()
def create(self, *, email, password):
self.model.validate(email, password)
self.db.cursor.execute() # TODO: create user query
#... | 23.666667 | 70 | 0.631791 | from ..db import Database
from .models import UserModel
class UserGateway:
def __init__(self):
self.model = UserModel
self.db = Database()
def create(self, *, email, password):
self.model.validate(email, password)
self.db.cursor.execute()
def all(self):
... | true | true |
f7f9c975e23e44ade6351567ee3a56fd11afc6be | 3,466 | py | Python | lib_search.py | ayoubBouziane/model_server | 03d6d325304e01fc197e6e033c84eb9af150301d | [
"Apache-2.0"
] | null | null | null | lib_search.py | ayoubBouziane/model_server | 03d6d325304e01fc197e6e033c84eb9af150301d | [
"Apache-2.0"
] | null | null | null | lib_search.py | ayoubBouziane/model_server | 03d6d325304e01fc197e6e033c84eb9af150301d | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.980392 | 129 | 0.548471 |
import os
import sys
import re
COPYRIGHT = re.compile(r'Copyright')
INTEL_COPYRIGHT = re.compile(r'Copyright (\(c\) )?(201(8|9)-)?20(20|19|18) Intel Corporation')
def check_header(fd):
result = False
detected = False
try:
for line in fd:
if COPYRIGHT.findall(line):
... | true | true |
f7f9c9edab3b2b66e59f0f2d6e520e55c558c159 | 193 | py | Python | exercises/concept/pretty-leaflet/string_formatting.py | highb/python | 5cf63f0a070e0efef4d2334582d331296100fbb0 | [
"MIT"
] | 1,177 | 2017-06-21T20:24:06.000Z | 2022-03-29T02:30:55.000Z | exercises/concept/pretty-leaflet/string_formatting.py | highb/python | 5cf63f0a070e0efef4d2334582d331296100fbb0 | [
"MIT"
] | 1,890 | 2017-06-18T20:06:10.000Z | 2022-03-31T18:35:51.000Z | exercises/concept/pretty-leaflet/string_formatting.py | highb/python | 5cf63f0a070e0efef4d2334582d331296100fbb0 | [
"MIT"
] | 1,095 | 2017-06-26T23:06:19.000Z | 2022-03-29T03:25:38.000Z | def capitalize_header(event_name):
pass
def format_date(event_date):
pass
def display_icons(icons):
pass
def print_leaflet(event_name, icons, authors, event_date=None):
pass
| 16.083333 | 63 | 0.740933 | def capitalize_header(event_name):
pass
def format_date(event_date):
pass
def display_icons(icons):
pass
def print_leaflet(event_name, icons, authors, event_date=None):
pass
| true | true |
f7f9cb6cae0403510c98c6943007fd306aac6a84 | 515 | py | Python | helpdesk/migrations/0010_remove_queuemembership.py | altimore/django-helpdesk | e710cb028be6725350b05a802d14508a96375d14 | [
"BSD-3-Clause",
"CC-BY-4.0",
"MIT"
] | null | null | null | helpdesk/migrations/0010_remove_queuemembership.py | altimore/django-helpdesk | e710cb028be6725350b05a802d14508a96375d14 | [
"BSD-3-Clause",
"CC-BY-4.0",
"MIT"
] | null | null | null | helpdesk/migrations/0010_remove_queuemembership.py | altimore/django-helpdesk | e710cb028be6725350b05a802d14508a96375d14 | [
"BSD-3-Clause",
"CC-BY-4.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
("helpdesk", "0009_migrate_queuemembership"),
]
operations = [
migrations.RemoveField(
model_name="queuemembership",
name="queues",
),
... | 21.458333 | 53 | 0.553398 |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
("helpdesk", "0009_migrate_queuemembership"),
]
operations = [
migrations.RemoveField(
model_name="queuemembership",
name="queues",
),
migrations.Remo... | true | true |
f7f9ccff2f79aa03b7ad28757bcdd31989c41f47 | 1,300 | py | Python | WildlifeObservations/observations/management/commands/import_id_guides.py | jen-thomas/wildlife-observations | 594f141822c75f3d8fdbc8dcba3d09bbf5bc42ca | [
"MIT"
] | null | null | null | WildlifeObservations/observations/management/commands/import_id_guides.py | jen-thomas/wildlife-observations | 594f141822c75f3d8fdbc8dcba3d09bbf5bc42ca | [
"MIT"
] | 24 | 2022-01-21T16:37:55.000Z | 2022-03-10T15:34:34.000Z | WildlifeObservations/observations/management/commands/import_id_guides.py | jen-thomas/wildlife-observations | 594f141822c75f3d8fdbc8dcba3d09bbf5bc42ca | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from django.db import transaction
from ...models import IdentificationGuide
class Command(BaseCommand):
help = 'Adds ID guides'
@transaction.atomic
def handle(self, *args, **options):
self.import_id_guides()
def import_id_guides(self):
... | 54.166667 | 132 | 0.618462 | from django.core.management.base import BaseCommand
from django.db import transaction
from ...models import IdentificationGuide
class Command(BaseCommand):
help = 'Adds ID guides'
@transaction.atomic
def handle(self, *args, **options):
self.import_id_guides()
def import_id_guides(self):
... | true | true |
f7f9cd6b8dab8a678606d68bee0e5a4b21885af1 | 75 | py | Python | index.py | netvork109/soapie-client | 87ee215be565101bf79583a75ca2ce08d627186c | [
"MIT"
] | null | null | null | index.py | netvork109/soapie-client | 87ee215be565101bf79583a75ca2ce08d627186c | [
"MIT"
] | null | null | null | index.py | netvork109/soapie-client | 87ee215be565101bf79583a75ca2ce08d627186c | [
"MIT"
] | null | null | null | # local modules
from data import *
from editor import *
from api import API | 18.75 | 20 | 0.773333 |
from data import *
from editor import *
from api import API | true | true |
f7f9cd9dcd11a0d0ae3196de0e978244a8ba850e | 2,526 | py | Python | presets/Modes/Python/S - A Zach Reactive/main.py | jqrsound/EYESY_OS_for_RasPiSound | ac117b91cd84ad4c0566bd1a7d4c7b1ccc01cf62 | [
"BSD-3-Clause"
] | 4 | 2021-07-04T16:49:34.000Z | 2022-02-08T13:38:34.000Z | presets/Modes/Python/S - A Zach Reactive/main.py | jqrsound/EYESY_OS_for_RasPiSound | ac117b91cd84ad4c0566bd1a7d4c7b1ccc01cf62 | [
"BSD-3-Clause"
] | null | null | null | presets/Modes/Python/S - A Zach Reactive/main.py | jqrsound/EYESY_OS_for_RasPiSound | ac117b91cd84ad4c0566bd1a7d4c7b1ccc01cf62 | [
"BSD-3-Clause"
] | null | null | null | import pygame
import pygame.gfxdraw
import random
import time
import math
from pygame.locals import *
# original code adapted from zach lieberman's talk
# https://www.youtube.com/watch?v=bmztlO9_Wvo
white=(255,255,255)
w1 = 0
h1 = 0
def setup(screen, etc) :
global w1,h1
w1 = screen.get_width()
h1 = s... | 47.660377 | 223 | 0.578385 | import pygame
import pygame.gfxdraw
import random
import time
import math
from pygame.locals import *
# https://www.youtube.com/watch?v=bmztlO9_Wvo
white=(255,255,255)
w1 = 0
h1 = 0
def setup(screen, etc) :
global w1,h1
w1 = screen.get_width()
h1 = screen.get_height()
pass
def draw(screen, etc)... | true | true |
f7f9ce88964d1bfaab8aa22f167b9de31a05863e | 7,399 | py | Python | tf_agents/bandits/environments/random_bandit_environment_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 3,175 | 2017-09-08T18:28:32.000Z | 2022-03-31T01:32:22.000Z | tf_agents/bandits/environments/random_bandit_environment_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 703 | 2017-09-18T05:51:57.000Z | 2022-03-31T17:37:50.000Z | tf_agents/bandits/environments/random_bandit_environment_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 844 | 2017-09-08T23:28:57.000Z | 2022-03-30T09:29:32.000Z | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 39.148148 | 79 | 0.711177 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tf_agents.bandits.environments import random_bandit_environment
fro... | true | true |
f7f9cf42a7755e62180d3792cd9799d2205644b7 | 1,188 | py | Python | tests/test_base_manager.py | kibernick/pycontacts | 9ec7653cdea582b242a6d5f314b4d0c4bb92dd39 | [
"MIT"
] | null | null | null | tests/test_base_manager.py | kibernick/pycontacts | 9ec7653cdea582b242a6d5f314b4d0c4bb92dd39 | [
"MIT"
] | null | null | null | tests/test_base_manager.py | kibernick/pycontacts | 9ec7653cdea582b242a6d5f314b4d0c4bb92dd39 | [
"MIT"
] | null | null | null | from pycontacts.managers import BaseManager
from conftest import ExtenedBaseModel
class ExampleManager(BaseManager):
cls = ExtenedBaseModel
def test_new_manager(address_book):
examples = ExampleManager(address_book)
assert examples.book == address_book
def test_manager_create(address_book):
examp... | 27.627907 | 56 | 0.750842 | from pycontacts.managers import BaseManager
from conftest import ExtenedBaseModel
class ExampleManager(BaseManager):
cls = ExtenedBaseModel
def test_new_manager(address_book):
examples = ExampleManager(address_book)
assert examples.book == address_book
def test_manager_create(address_book):
examp... | true | true |
f7f9cfc9da0438adb7aab54ef70197fd1fc1f1c8 | 911 | py | Python | Python/Basics-Sentdex/1. Basics with Sentdex/Tutorial 13 - Bringing things together_Iterator_Iterable/Iteratable/iterator_iterable.py | yorks-dev/Learning-Software-Developement | 4733f782705dda04cc790b0e16297241c23b2504 | [
"MIT"
] | null | null | null | Python/Basics-Sentdex/1. Basics with Sentdex/Tutorial 13 - Bringing things together_Iterator_Iterable/Iteratable/iterator_iterable.py | yorks-dev/Learning-Software-Developement | 4733f782705dda04cc790b0e16297241c23b2504 | [
"MIT"
] | null | null | null | Python/Basics-Sentdex/1. Basics with Sentdex/Tutorial 13 - Bringing things together_Iterator_Iterable/Iteratable/iterator_iterable.py | yorks-dev/Learning-Software-Developement | 4733f782705dda04cc790b0e16297241c23b2504 | [
"MIT"
] | null | null | null | # iterable : Something that we can iterate over.
# iterator : a special object with a next() method
import itertools
x = [1, 2, 3, 4] # ... Iterable not an iterator. So we cant use the next()
# for i in x:
# print(i)
n = itertools.cycle(x) # ... Iterator .. also an iterable ..
# basic... | 20.704545 | 80 | 0.608123 |
import itertools
x = [1, 2, 3, 4]
n = itertools.cycle(x)
for i in y:
print(i)
for i in y:
print(i)
for i in y:
print(i)
player_num = itertools.cycle([[1,'X'], [2,'O']])
print(next(player_num)[0])
| true | true |
f7f9cfd718181ae979f7da1ff0932b5301163d3d | 1,800 | py | Python | mla/base/base.py | Sanyambansal76/MLAlgorithms | c8d0083cde15b56d171d273c7870b87b0392f6c3 | [
"MIT"
] | 4 | 2019-03-07T22:19:57.000Z | 2021-05-12T22:09:18.000Z | mla/base/base.py | zhenghuangcheng/ML_Algorithms | 829c74cf7d79307fc6ca1d849e65b959fb10e5de | [
"MIT"
] | null | null | null | mla/base/base.py | zhenghuangcheng/ML_Algorithms | 829c74cf7d79307fc6ca1d849e65b959fb10e5de | [
"MIT"
] | 3 | 2018-03-22T15:53:21.000Z | 2020-09-22T11:24:59.000Z | import numpy as np
class BaseEstimator(object):
X = None
y = None
y_required = True
def _setup_input(self, X, y=None):
"""Ensure inputs to an estimator are in the expected format.
Ensures X and y are stored as numpy ndarrays by converting from an
array-like object if necessar... | 28.125 | 78 | 0.558889 | import numpy as np
class BaseEstimator(object):
X = None
y = None
y_required = True
def _setup_input(self, X, y=None):
if not isinstance(X, np.ndarray):
X = np.array(X)
if X.size == 0:
raise ValueError('Number of features must be > 0')
if X.ndim == 1:... | true | true |
f7f9d0416e0fd9cfb6b30b27275071d81ff69cf4 | 262 | py | Python | cpdb/search_mobile/serializers/trr_serializer.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 25 | 2018-07-20T22:31:40.000Z | 2021-07-15T16:58:41.000Z | cpdb/search_mobile/serializers/trr_serializer.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 13 | 2018-06-18T23:08:47.000Z | 2022-02-10T07:38:25.000Z | cpdb/search_mobile/serializers/trr_serializer.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 6 | 2018-05-17T21:59:43.000Z | 2020-11-17T00:30:26.000Z | from rest_framework import serializers
from shared.serializer import NoNullSerializer
class TRRSerializer(NoNullSerializer):
id = serializers.IntegerField()
type = serializers.SerializerMethodField()
def get_type(self, obj):
return 'TRR'
| 21.833333 | 46 | 0.759542 | from rest_framework import serializers
from shared.serializer import NoNullSerializer
class TRRSerializer(NoNullSerializer):
id = serializers.IntegerField()
type = serializers.SerializerMethodField()
def get_type(self, obj):
return 'TRR'
| true | true |
f7f9d0cf5780e1bbe437f2475539d7875a6c09b9 | 2,768 | py | Python | var/spack/repos/builtin/packages/ninja/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/ninja/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/ninja/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack.package import *
class Ninja(Package):
"""Ninja is a small build system with a focus on speed.... | 38.985915 | 97 | 0.689306 |
import sys
from spack.package import *
class Ninja(Package):
homepage = "https://ninja-build.org/"
url = "https://github.com/ninja-build/ninja/archive/v1.7.2.tar.gz"
git = "https://github.com/ninja-build/ninja.git"
tags = ['build-tools', 'e4s']
executables = ['^ninja$']
vers... | true | true |
f7f9d122199ead50578defaedb9ee52f4cbd91fd | 419 | py | Python | example/env.example.py | andrzejressel/tuya-iot-python-sdk | cbe628695b8adb966a333ff28f6f41653baa1e5f | [
"MIT"
] | null | null | null | example/env.example.py | andrzejressel/tuya-iot-python-sdk | cbe628695b8adb966a333ff28f6f41653baa1e5f | [
"MIT"
] | null | null | null | example/env.example.py | andrzejressel/tuya-iot-python-sdk | cbe628695b8adb966a333ff28f6f41653baa1e5f | [
"MIT"
] | null | null | null | # from tuya_iot.tuya_enums import *
# online
# ACCESS_ID = # your_access_id
# ACCESS_KEY = # your_access_key
# USERNAME = # your_username
# PASSWORD = # your_password
# ASSET_ID = # your_asset_id
# DEVICE_ID = # your_device_id
# COUNTRY_CODE = # your_country_code
# SCHEMA = "tuyaSmart"
# ENDPOINT = TuyaCloudOpenAPIEnd... | 27.933333 | 48 | 0.768496 | true | true | |
f7f9d157d6be28ec0a55bec3f9919e77734d4177 | 1,382 | py | Python | py_everything/search.py | Morgan-Phoenix/py_everything | a7bbaf19ee6007fcfbcfe9d03944ef621b9f9ac9 | [
"MIT"
] | null | null | null | py_everything/search.py | Morgan-Phoenix/py_everything | a7bbaf19ee6007fcfbcfe9d03944ef621b9f9ac9 | [
"MIT"
] | null | null | null | py_everything/search.py | Morgan-Phoenix/py_everything | a7bbaf19ee6007fcfbcfe9d03944ef621b9f9ac9 | [
"MIT"
] | null | null | null | from typing import List, Any
import os
def searchFiles(keyword: str , path: str):
"""Search for files"""
files: List[Any] = []
for root, dirs, files in os.walk(path):
for file in files:
if keyword in file:
files.append(root + '\\' + str(file))
return files
... | 30.711111 | 59 | 0.547033 | from typing import List, Any
import os
def searchFiles(keyword: str , path: str):
files: List[Any] = []
for root, dirs, files in os.walk(path):
for file in files:
if keyword in file:
files.append(root + '\\' + str(file))
return files
def searchDirs(keyword: s... | true | true |
f7f9d249528f221b9eef7b917caa3cd915feb5ff | 5,589 | py | Python | wxBot-v4.py | weenjoylife/wxbot_jyb | b445f319d924aac93836b648a1855acc432e80b5 | [
"Apache-2.0"
] | null | null | null | wxBot-v4.py | weenjoylife/wxbot_jyb | b445f319d924aac93836b648a1855acc432e80b5 | [
"Apache-2.0"
] | null | null | null | wxBot-v4.py | weenjoylife/wxbot_jyb | b445f319d924aac93836b648a1855acc432e80b5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
from wxbot import *
import ConfigParser
import json
from collections import Counter
import time
import re
"""
20180720编写
版本说明:
1.该版本为第一个生产环境版本
2.优化了微信端的回复显示格式:只显示月-日,不再显示年份
以下无内容
"""
# 报单微信Bot
class BDWXBot(WXBot):
def __init__(self):
WXBot.__init__(self)
se... | 28.227273 | 90 | 0.528538 |
from wxbot import *
import ConfigParser
import json
from collections import Counter
import time
import re
"""
20180720编写
版本说明:
1.该版本为第一个生产环境版本
2.优化了微信端的回复显示格式:只显示月-日,不再显示年份
以下无内容
"""
class BDWXBot(WXBot):
def __init__(self):
WXBot.__init__(self)
self.tuling_key = ""
self.robot_switch ... | false | true |
f7f9d2e5bccf9baf5c353c527b321faebbe25bd2 | 14,152 | py | Python | src/garage/experiment/local_tf_runner.py | lywong92/garage | 96cb8887fcae90531a645d540653010e7fe10fcc | [
"MIT"
] | 1 | 2020-01-05T14:57:43.000Z | 2020-01-05T14:57:43.000Z | src/garage/experiment/local_tf_runner.py | lywong92/garage | 96cb8887fcae90531a645d540653010e7fe10fcc | [
"MIT"
] | null | null | null | src/garage/experiment/local_tf_runner.py | lywong92/garage | 96cb8887fcae90531a645d540653010e7fe10fcc | [
"MIT"
] | null | null | null | """
The local runner for tensorflow algorithms.
A runner setup context for algorithms during initialization and
pipelines data between sampler and algorithm during training.
"""
import copy
import time
from types import SimpleNamespace
from dowel import logger, tabular
import tensorflow as tf
from garage.experiment ... | 34.771499 | 79 | 0.59617 | import copy
import time
from types import SimpleNamespace
from dowel import logger, tabular
import tensorflow as tf
from garage.experiment import snapshotter
class LocalRunner:
def __init__(self, sess=None, max_cpus=1):
if max_cpus > 1:
from garage.sampler import singleton_pool
... | true | true |
f7f9d3a8135700a216c8335586b8e05519c876c5 | 5,756 | py | Python | py_aoc_2018_tests/test_days.py | davidlukac/advent-of-code | ed330b3005af248a5812906de97bd108485e624c | [
"MIT"
] | null | null | null | py_aoc_2018_tests/test_days.py | davidlukac/advent-of-code | ed330b3005af248a5812906de97bd108485e624c | [
"MIT"
] | null | null | null | py_aoc_2018_tests/test_days.py | davidlukac/advent-of-code | ed330b3005af248a5812906de97bd108485e624c | [
"MIT"
] | null | null | null | import io
import unittest
from collections import OrderedDict
import pytest
from py_aoc_2018.day_1 import day_1
from py_aoc_2018.day_2 import day_2, find_matching
from py_aoc_2018.day_3 import Claim, load_claims, optimize_claims, SquareBySquareOverclaimedCounter
from py_aoc_2018.day_3 import IterateClaimsOverclaimedC... | 27.806763 | 113 | 0.525191 | import io
import unittest
from collections import OrderedDict
import pytest
from py_aoc_2018.day_1 import day_1
from py_aoc_2018.day_2 import day_2, find_matching
from py_aoc_2018.day_3 import Claim, load_claims, optimize_claims, SquareBySquareOverclaimedCounter
from py_aoc_2018.day_3 import IterateClaimsOverclaimedC... | true | true |
f7f9d3cd3ab6517110579eb5b363906479418ee4 | 1,344 | py | Python | Section 3/balancer.py | PacktPublishing/Artificial-Intelligence-with-Python-Deep-Neural-Networks | 0f729bea5a8ab6f932ce3b01f80b4dbd3b8d62a2 | [
"MIT"
] | 3 | 2019-06-03T12:47:43.000Z | 2021-10-24T02:55:03.000Z | Section 3/balancer.py | PacktPublishing/Artificial-Intelligence-with-Python-Deep-Neural-Networks | 0f729bea5a8ab6f932ce3b01f80b4dbd3b8d62a2 | [
"MIT"
] | null | null | null | Section 3/balancer.py | PacktPublishing/Artificial-Intelligence-with-Python-Deep-Neural-Networks | 0f729bea5a8ab6f932ce3b01f80b4dbd3b8d62a2 | [
"MIT"
] | 2 | 2020-06-08T23:01:47.000Z | 2021-08-10T17:42:06.000Z | import argparse
import gym
def build_arg_parser():
parser = argparse.ArgumentParser(description='Run an environment')
parser.add_argument('--input-env', dest='input_env', required=True,
choices=['cartpole', 'mountaincar', 'pendulum'],
help='Specify the name of the environment')
re... | 28 | 72 | 0.584821 | import argparse
import gym
def build_arg_parser():
parser = argparse.ArgumentParser(description='Run an environment')
parser.add_argument('--input-env', dest='input_env', required=True,
choices=['cartpole', 'mountaincar', 'pendulum'],
help='Specify the name of the environment')
re... | true | true |
f7f9d607814c4ab71dab6e9df44d8f3ec518ac9f | 1,052 | py | Python | tests/terraform/checks/resource/gcp/test_GoogleCloudSqlDatabasePublicallyAccessible.py | mgmt1pyro/Test-Theme | d3e20b62111636ecbe4267c5fff7c2820a9a892d | [
"Apache-2.0"
] | null | null | null | tests/terraform/checks/resource/gcp/test_GoogleCloudSqlDatabasePublicallyAccessible.py | mgmt1pyro/Test-Theme | d3e20b62111636ecbe4267c5fff7c2820a9a892d | [
"Apache-2.0"
] | null | null | null | tests/terraform/checks/resource/gcp/test_GoogleCloudSqlDatabasePublicallyAccessible.py | mgmt1pyro/Test-Theme | d3e20b62111636ecbe4267c5fff7c2820a9a892d | [
"Apache-2.0"
] | null | null | null | import unittest
from checkov.terraform.checks.resource.gcp.GoogleCloudSqlDatabasePublicallyAccessible import check
from checkov.terraform.models.enums import CheckResult
class GoogleCloudSqlDatabasePublicallyAccessible(unittest.TestCase):
def test_failure(self):
resource_conf = {'settings': [{'tier': ['... | 47.818182 | 227 | 0.684411 | import unittest
from checkov.terraform.checks.resource.gcp.GoogleCloudSqlDatabasePublicallyAccessible import check
from checkov.terraform.models.enums import CheckResult
class GoogleCloudSqlDatabasePublicallyAccessible(unittest.TestCase):
def test_failure(self):
resource_conf = {'settings': [{'tier': ['... | true | true |
f7f9d667528222b2a8ef392ab2a9d527423b3b73 | 8,371 | py | Python | backbone/hyrnn_nets.py | jacv050/hyperfuture | 1c328c18773bf6c0bb0d1573ef34431c59a054d2 | [
"MIT"
] | 130 | 2021-01-05T17:56:14.000Z | 2022-03-30T03:51:17.000Z | backbone/hyrnn_nets.py | shravankumar147/hyperfuture | 54288230656c7a8cc0b825f9e397d690408d9e42 | [
"MIT"
] | null | null | null | backbone/hyrnn_nets.py | shravankumar147/hyperfuture | 54288230656c7a8cc0b825f9e397d690408d9e42 | [
"MIT"
] | 24 | 2021-01-06T07:21:55.000Z | 2021-10-29T19:27:06.000Z | """
Network definitions from https://github.com/ferrine/hyrnn
"""
import geoopt
import geoopt.manifolds.stereographic.math as gmath
import numpy as np
import torch.nn
import torch.nn.functional
from torch.cuda.amp import autocast
def mobius_linear(
input,
weight,
bias=None,
hyperbolic... | 34.028455 | 100 | 0.571736 |
import geoopt
import geoopt.manifolds.stereographic.math as gmath
import numpy as np
import torch.nn
import torch.nn.functional
from torch.cuda.amp import autocast
def mobius_linear(
input,
weight,
bias=None,
hyperbolic_input=True,
hyperbolic_bias=True,
nonlin=None,
... | true | true |
f7f9d6af25d1ecfefe19469b4269c1c2f995d79f | 8,266 | py | Python | gensrc/gensrc/addins/valueobjects.py | txu2014/quantlib | 95c7d94906c30d0c3c4e0758a2ebfe2a62b075ec | [
"BSD-3-Clause"
] | null | null | null | gensrc/gensrc/addins/valueobjects.py | txu2014/quantlib | 95c7d94906c30d0c3c4e0758a2ebfe2a62b075ec | [
"BSD-3-Clause"
] | null | null | null | gensrc/gensrc/addins/valueobjects.py | txu2014/quantlib | 95c7d94906c30d0c3c4e0758a2ebfe2a62b075ec | [
"BSD-3-Clause"
] | 1 | 2022-02-24T04:54:18.000Z | 2022-02-24T04:54:18.000Z |
"""
Copyright (C) 2005, 2006 Plamen Neykov
Copyright (C) 2007, 2008 Eric Ehlers
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the... | 45.169399 | 99 | 0.638156 |
from gensrc.addins import addin
from gensrc.functions import function
from gensrc.utilities import outputfile
from gensrc.utilities import common
from gensrc.utilities import log
from gensrc.categories import category
from gensrc.configuration import environment
class ValueObjects(addin.Addin):
VO_INCLUDE = ''... | true | true |
f7f9d6c3d3dec5a14d7740b96e3ef44d190b7fac | 3,427 | py | Python | blog/models.py | NieShengyuan/blog | 24e64b8daa50b77a48a91ed23399ea3ca85cb02a | [
"MIT"
] | null | null | null | blog/models.py | NieShengyuan/blog | 24e64b8daa50b77a48a91ed23399ea3ca85cb02a | [
"MIT"
] | null | null | null | blog/models.py | NieShengyuan/blog | 24e64b8daa50b77a48a91ed23399ea3ca85cb02a | [
"MIT"
] | null | null | null | import markdown
from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
import django.utils.six
from django.utils.html import strip_tags
class Category(models.Model):
"""
Django 要求模型必须继承 models.Model 类。
Category 只需要一个简单的分类名 name 就可以了。
CharField 指定了分类名 n... | 31.731481 | 88 | 0.686606 | import markdown
from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
import django.utils.six
from django.utils.html import strip_tags
class Category(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class T... | true | true |
f7f9d6ce5d08e6e9691522a79bdd359f09bb7203 | 7,257 | py | Python | push_notifications/models.py | DataGreed/django-push-notifications | dc241fbe0346719eac8b823a5707fd05f9b23800 | [
"MIT"
] | 1 | 2019-05-07T10:48:26.000Z | 2019-05-07T10:48:26.000Z | push_notifications/models.py | ubergrape/django-push-notifications | c610dd9c7871f4e81bdffce783df8b040ca22878 | [
"MIT"
] | null | null | null | push_notifications/models.py | ubergrape/django-push-notifications | c610dd9c7871f4e81bdffce783df8b040ca22878 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.translation import ugettext_lazy as _
from .fields import HexIntegerField
from .settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
CLOUD_MESSAGE_TYPES = (
("FCM", "Firebase Cloud Message"),
("GCM", "Google Cloud Message"),
)
BROWSER_TYPES = (
("CHROME", "Chrome... | 27.911538 | 105 | 0.729503 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from .fields import HexIntegerField
from .settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
CLOUD_MESSAGE_TYPES = (
("FCM", "Firebase Cloud Message"),
("GCM", "Google Cloud Message"),
)
BROWSER_TYPES = (
("CHROME", "Chrome... | true | true |
f7f9d7911fe578e951a9ca8ec9f03a27b1b6ea67 | 5,447 | py | Python | tests/api/v2/test_max_project_volume.py | CiscoSystems/ceilometer | a9267fd94e7854afa0720d761fbe75d946e7167d | [
"Apache-2.0"
] | 1 | 2021-11-22T11:00:53.000Z | 2021-11-22T11:00:53.000Z | tests/api/v2/test_max_project_volume.py | CiscoSystems/ceilometer | a9267fd94e7854afa0720d761fbe75d946e7167d | [
"Apache-2.0"
] | null | null | null | tests/api/v2/test_max_project_volume.py | CiscoSystems/ceilometer | a9267fd94e7854afa0720d761fbe75d946e7167d | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Steven Berler <steven.berler@dreamhost.com>
#
# 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
#
# ... | 41.580153 | 76 | 0.38792 |
import datetime
from oslo.config import cfg
from ceilometer.collector import meter
from ceilometer import counter
from ceilometer.storage.impl_mongodb import require_map_reduce
from .base import FunctionalTest
class TestMaxProjectVolume(FunctionalTest):
PATH = '/meters/volume.size/statistic... | true | true |
f7f9d815fd74248ee87d991bd107aab15b47f8cc | 618 | py | Python | easy/867-transpose-matrix.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 2 | 2021-03-14T11:38:26.000Z | 2021-03-14T11:38:30.000Z | easy/867-transpose-matrix.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | null | null | null | easy/867-transpose-matrix.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 1 | 2022-01-17T19:33:23.000Z | 2022-01-17T19:33:23.000Z | '''
转置矩阵
给你一个二维整数数组 matrix, 返回 matrix 的 转置矩阵 。
矩阵的 转置 是指将矩阵的主对角线翻转,交换矩阵的行索引与列索引。
'''
from typing import List
'''
思路:简单问题,原矩阵大小为m*n,创建一个n*m大小的新矩阵,按照行列转化的方式将旧矩阵数据复制过去
'''
class Solution:
def transpose(self, matrix: List[List[int]]) -> List[List[int]]:
m = len(matrix)
n = len(matrix[0])
ne... | 20.6 | 68 | 0.548544 |
from typing import List
class Solution:
def transpose(self, matrix: List[List[int]]) -> List[List[int]]:
m = len(matrix)
n = len(matrix[0])
newMatrix = [[]] * n
for i in range(n):
newMatrix[i] = [0] * m
for j in range(m):
newMatrix[i][j] = m... | true | true |
f7f9dae3e42da4080067f70c12a852c4112f050d | 1,019 | py | Python | opencv/tutorials/imageProcessing/hough_line/probabilistic.py | SSG-DRD-IOT/commercial-iot-security-system | 0c3d89b35d0468d4d3cc5ce2653b3f0ac82652a9 | [
"MIT"
] | null | null | null | opencv/tutorials/imageProcessing/hough_line/probabilistic.py | SSG-DRD-IOT/commercial-iot-security-system | 0c3d89b35d0468d4d3cc5ce2653b3f0ac82652a9 | [
"MIT"
] | null | null | null | opencv/tutorials/imageProcessing/hough_line/probabilistic.py | SSG-DRD-IOT/commercial-iot-security-system | 0c3d89b35d0468d4d3cc5ce2653b3f0ac82652a9 | [
"MIT"
] | 3 | 2022-01-22T05:02:41.000Z | 2022-03-31T08:13:06.000Z | """
Probabilistic Hough Transform
# this is Hough you do it.
in HT, even for line w/ 2 arguments, lots of computation
Probabilistic Hough Transform is optimization of HT we saw
only considers random subset of points
sufficient for line detection
have to decrease threshold
function: cv2.HoughLi... | 32.870968 | 83 | 0.718351 |
import cv2
import numpy as np
img = cv2.imread('dave.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(gray, 50, 150, apertureSize = 3)
lines = cv2.HoughLinesP(edges, 1, np.pi/180,100,minLineLength=100,maxLineGap=10)
for line in lines:
x1, y1, x2, y2 = line[0]
cv2.line(img, (x1, y1), (x2, y2... | true | true |
f7f9db121dcf5ff2c64326f029b1adcc1fbd467d | 2,758 | py | Python | source/tests/test.py | xu4wang/todo | 5e53e162233b8a7da32f6c93a02849134a1d67b5 | [
"MIT"
] | 419 | 2016-02-13T19:26:13.000Z | 2022-03-22T23:41:43.000Z | source/tests/test.py | xu4wang/todo | 5e53e162233b8a7da32f6c93a02849134a1d67b5 | [
"MIT"
] | 19 | 2016-02-15T05:22:54.000Z | 2022-03-27T20:43:14.000Z | source/tests/test.py | xu4wang/todo | 5e53e162233b8a7da32f6c93a02849134a1d67b5 | [
"MIT"
] | 58 | 2016-02-14T02:24:18.000Z | 2022-03-26T19:23:23.000Z | #! /usr/bin/env python3
import unittest, sys, os, functools, argparse
import os.path as op
from . import utils
from . import test_todo, test_utils, test_rainbow, test_text_wrap # pylint: disable=W0611
sys.path.insert(0, op.abspath('.'))
import todo.todo as todo
import todo.utils as tutils
from todo.data_access impo... | 26.266667 | 89 | 0.719362 |
import unittest, sys, os, functools, argparse
import os.path as op
from . import utils
from . import test_todo, test_utils, test_rainbow, test_text_wrap
sys.path.insert(0, op.abspath('.'))
import todo.todo as todo
import todo.utils as tutils
from todo.data_access import DB_PATH as DATA_LOCATION
from todo.todo imp... | true | true |
f7f9db6f26a5d9f211f23e307181a8967645b204 | 885 | py | Python | setup.py | sfroth/python-ontrac | f593a80a226a4f3d1191e09e1141e6bbe7370148 | [
"BSD-3-Clause"
] | null | null | null | setup.py | sfroth/python-ontrac | f593a80a226a4f3d1191e09e1141e6bbe7370148 | [
"BSD-3-Clause"
] | null | null | null | setup.py | sfroth/python-ontrac | f593a80a226a4f3d1191e09e1141e6bbe7370148 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
import ontrac
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Progra... | 29.5 | 67 | 0.632768 |
from distutils.core import setup
import ontrac
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Pyth... | true | true |
f7f9dc303e099414ffbbcd093f3e36fdd4a3c761 | 985 | py | Python | day2/day2.py | BLannoo/Advent-of-Code-2020 | a4efa637e5885a3f849b8bad13c7115c82bdec97 | [
"MIT"
] | null | null | null | day2/day2.py | BLannoo/Advent-of-Code-2020 | a4efa637e5885a3f849b8bad13c7115c82bdec97 | [
"MIT"
] | null | null | null | day2/day2.py | BLannoo/Advent-of-Code-2020 | a4efa637e5885a3f849b8bad13c7115c82bdec97 | [
"MIT"
] | null | null | null | import re
def test_silver():
assert 660 == valid_count(read_input(), silver)
def test_gold():
assert 530 == valid_count(read_input(), gold)
def silver(line: str) -> bool:
match = re.match(
r"(?P<min>\d+)-(?P<max>\d+) (?P<char>\w): (?P<password>\w+)",
line
)
return int(match.gro... | 24.02439 | 115 | 0.550254 | import re
def test_silver():
assert 660 == valid_count(read_input(), silver)
def test_gold():
assert 530 == valid_count(read_input(), gold)
def silver(line: str) -> bool:
match = re.match(
r"(?P<min>\d+)-(?P<max>\d+) (?P<char>\w): (?P<password>\w+)",
line
)
return int(match.gro... | true | true |
f7f9dc538099b1ac2c1efc11043efddc264d346b | 10,517 | py | Python | venv/Lib/site-packages/alpacalib/syntax.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | null | null | null | venv/Lib/site-packages/alpacalib/syntax.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | null | null | null | venv/Lib/site-packages/alpacalib/syntax.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | 1 | 2020-06-28T11:47:47.000Z | 2020-06-28T11:47:47.000Z | """
syntax.py
Syntax Pasrse for Regex
"""
from alpacalib.rast import RAST
from alpacalib.lex import LexParser
from alpacalib.charset import CharacterSet
class SyntaxParserError(Exception):
pass
class SyntaxParser:
def __init__(self, regex):
self.lex = LexParser(regex)
def build(self):
s... | 39.389513 | 107 | 0.501474 |
from alpacalib.rast import RAST
from alpacalib.lex import LexParser
from alpacalib.charset import CharacterSet
class SyntaxParserError(Exception):
pass
class SyntaxParser:
def __init__(self, regex):
self.lex = LexParser(regex)
def build(self):
self.root = self.__parse_regex()
... | true | true |
f7f9ddd7b08717338bd32f4ce298dd6f6fd20a68 | 3,118 | py | Python | tensorflow/contrib/eager/python/datasets.py | tianhm/tensorflow | e55574f28257bdacd744dcdba86c839e661b1b2a | [
"Apache-2.0"
] | 47 | 2017-03-08T20:58:54.000Z | 2021-06-24T07:07:49.000Z | tensorflow/contrib/eager/python/datasets.py | genSud/tensorflow | ec8216568d8cd9810004067558041c11a8356685 | [
"Apache-2.0"
] | 1 | 2019-07-11T16:29:54.000Z | 2019-07-11T16:29:54.000Z | tensorflow/contrib/eager/python/datasets.py | genSud/tensorflow | ec8216568d8cd9810004067558041c11a8356685 | [
"Apache-2.0"
] | 19 | 2017-04-17T01:28:40.000Z | 2020-08-15T13:01:33.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.14433 | 80 | 0.71424 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
from tensorflow.contrib.data.python.util import nest
from tensorflow.python.eager import context
from tensorflow.python.framework import errors
from tensorflow.python.ops import... | true | true |
f7f9de82300605b4cafcc1c246400ab08f4a30c5 | 1,318 | py | Python | Code_10_2_Data_pipeline_nosql.py | bpbpublications/Data-Science-for-Business-Professionals | e0795321f4f393b4ae2c5959046e5508a510f2a6 | [
"MIT"
] | null | null | null | Code_10_2_Data_pipeline_nosql.py | bpbpublications/Data-Science-for-Business-Professionals | e0795321f4f393b4ae2c5959046e5508a510f2a6 | [
"MIT"
] | null | null | null | Code_10_2_Data_pipeline_nosql.py | bpbpublications/Data-Science-for-Business-Professionals | e0795321f4f393b4ae2c5959046e5508a510f2a6 | [
"MIT"
] | null | null | null | ##Python Script to Implement the Pipeline
#Define the API KEY ( this can be found in the data.gov.in account section for registered users)
API_KEY = <YOUR API KEY>
#Import the requests library
import requests
#Construct the GET REQUEST
response = requests.get(
'https://api.data.gov.in/reso... | 28.652174 | 97 | 0.674507 | requests
response = requests.get(
'https://api.data.gov.in/resource/9ef84268-d588-465a-a308-a864a43d0070',
params=[('api-key',API_KEY ),
('format','json'),
('offset',0),
('limit',20)],
)
if response.sta... | false | true |
f7f9deb4b6b436f25447bc1ffe5c6369d88eedce | 32 | py | Python | shadowrun_prototype/defs/obje.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | shadowrun_prototype/defs/obje.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | shadowrun_prototype/defs/obje.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | from ...hek.defs.obje import *
| 16 | 31 | 0.65625 | from ...hek.defs.obje import *
| true | true |
f7f9df744a7c40740fac49d87ac5a7b56073d214 | 312 | py | Python | pacote-download/pythonProject/exercicios_python_guanabara/ex53_professor.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | pacote-download/pythonProject/exercicios_python_guanabara/ex53_professor.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | pacote-download/pythonProject/exercicios_python_guanabara/ex53_professor.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | frase = str(input('Digite uma frase: ')).strip().upper()
palavras = frase.split()
junto = ''.join(palavras)
inverso = ''
for letra in range(len(junto)-1, -1, -1):
inverso = inverso + junto[letra]
if junto == inverso:
print('Temos um palíndromo!')
else:
print('A frase digitada não é um palíndromo')
| 26 | 56 | 0.653846 | frase = str(input('Digite uma frase: ')).strip().upper()
palavras = frase.split()
junto = ''.join(palavras)
inverso = ''
for letra in range(len(junto)-1, -1, -1):
inverso = inverso + junto[letra]
if junto == inverso:
print('Temos um palíndromo!')
else:
print('A frase digitada não é um palíndromo')
| true | true |
f7f9dfc5a177c79d2b80ef9e34a715e0f0ec5468 | 3,408 | py | Python | pymimir/ARC.py | trauzti/mimir | 76362f82a06230606fc994cc7ea73f6ca036255b | [
"ISC"
] | 4 | 2016-09-07T00:16:47.000Z | 2018-05-29T12:27:47.000Z | pymimir/ARC.py | trauzti/mimir | 76362f82a06230606fc994cc7ea73f6ca036255b | [
"ISC"
] | null | null | null | pymimir/ARC.py | trauzti/mimir | 76362f82a06230606fc994cc7ea73f6ca036255b | [
"ISC"
] | 2 | 2015-02-04T09:38:26.000Z | 2020-06-23T18:22:22.000Z | # Modified from http://code.activestate.com/recipes/576532/
from collections import OrderedDict
from common import Entry, statbase
class Deque:
'Fast searchable queue'
def __init__(self):
self.od = OrderedDict()
def appendleft(self, k):
od = self.od
if k in od:
del od[k... | 28.4 | 97 | 0.48973 |
from collections import OrderedDict
from common import Entry, statbase
class Deque:
def __init__(self):
self.od = OrderedDict()
def appendleft(self, k):
od = self.od
if k in od:
del od[k]
od[k] = None
def pop(self):
return self.od.popitem(0)[0]
def ... | true | true |
f7f9e066f00f2469e952b600f16817805a10de19 | 2,341 | py | Python | thglibs/auxiliares/hash_encode/hash_encode.py | darkcode357/thg_lib | c1052bcd85f705ff8be404b7a28964eabef2ed45 | [
"MIT"
] | null | null | null | thglibs/auxiliares/hash_encode/hash_encode.py | darkcode357/thg_lib | c1052bcd85f705ff8be404b7a28964eabef2ed45 | [
"MIT"
] | 52 | 2018-10-25T20:29:17.000Z | 2018-10-25T20:45:02.000Z | thglibs/auxiliares/hash_encode/hash_encode.py | darkcode357/thg_lib | c1052bcd85f705ff8be404b7a28964eabef2ed45 | [
"MIT"
] | null | null | null | import hashlib
class Hash_encode:
"""
suport para hash_encode
=>sha3_256
=>ha256
=>blake2b
=>sha384
=>md5
=>sha3_512
=>sha512
=>sha512
=>sha1
=>sha3_224
=>blake2s
=>sha3_384
=>sha224
"""
def __init__(self, sha3_256, sha256, blake2b, sha384, md5, sha... | 24.134021 | 115 | 0.562153 | import hashlib
class Hash_encode:
def __init__(self, sha3_256, sha256, blake2b, sha384, md5, sha3_512, sha512, sha1, sha3_224, blake2s, sha3_384,
sha224):
self.sha3_256 = sha3_256
self.sha256 = sha256
self.blake2b = blake2b
self.sha384 = sha384
self.md5 = ... | true | true |
f7f9e088c3967cca2dcace2828f5a0a009034dcd | 591 | py | Python | src/objects/hospital.py | jp172/covid19-hospital-scheduler | 0931ac7b91f3e7fdbad741c5fc92577278dfc823 | [
"MIT"
] | 5 | 2020-03-22T22:46:15.000Z | 2020-03-25T14:16:49.000Z | src/objects/hospital.py | jp172/covid19-hospital-scheduler | 0931ac7b91f3e7fdbad741c5fc92577278dfc823 | [
"MIT"
] | null | null | null | src/objects/hospital.py | jp172/covid19-hospital-scheduler | 0931ac7b91f3e7fdbad741c5fc92577278dfc823 | [
"MIT"
] | 1 | 2020-03-22T20:44:01.000Z | 2020-03-22T20:44:01.000Z | from dataclasses import dataclass
from dataclasses_json import dataclass_json
from ..globals import CAPACITY_SCALAR
from .position import Position
@dataclass_json
@dataclass
class Hospital:
ident: str
position: Position
nbr_free_beds: int
nbr_free_corona_beds: int
nbr_corona_beds: int
nbr_co... | 24.625 | 69 | 0.746193 | from dataclasses import dataclass
from dataclasses_json import dataclass_json
from ..globals import CAPACITY_SCALAR
from .position import Position
@dataclass_json
@dataclass
class Hospital:
ident: str
position: Position
nbr_free_beds: int
nbr_free_corona_beds: int
nbr_corona_beds: int
nbr_co... | true | true |
f7f9e1913bfc9725ab0fcf5277e5457cc7a0cf2f | 4,249 | py | Python | tests/test_pacmon.py | fhightower/pacmon | ad9f9869f61cbd43ffe97fd7f10a3522161f74b8 | [
"MIT"
] | null | null | null | tests/test_pacmon.py | fhightower/pacmon | ad9f9869f61cbd43ffe97fd7f10a3522161f74b8 | [
"MIT"
] | null | null | null | tests/test_pacmon.py | fhightower/pacmon | ad9f9869f61cbd43ffe97fd7f10a3522161f74b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `pacmon` module."""
import json
import os
from pacmon import pacmon
import pytest
def test_initialization():
p = pacmon.Pacmon(os.path.abspath(os.path.join(os.path.dirname(__file__), "./test_output.json")))
def test_pypi_monitoring_1():
p = pacmon... | 35.115702 | 105 | 0.633796 |
import json
import os
from pacmon import pacmon
import pytest
def test_initialization():
p = pacmon.Pacmon(os.path.abspath(os.path.join(os.path.dirname(__file__), "./test_output.json")))
def test_pypi_monitoring_1():
p = pacmon.Pacmon(os.path.abspath(os.path.join(os.path.dirname(__file__), "./test_outpu... | true | true |
f7f9e24332c8bdf2631924c3f1b6673eb2080dfb | 44,358 | py | Python | fixture/Python3/expected_xml/Block1.py | exKAZUu/ParserTests | 609cfc62b70c8d04d5a2ced25a213a8d601e7011 | [
"Apache-2.0"
] | null | null | null | fixture/Python3/expected_xml/Block1.py | exKAZUu/ParserTests | 609cfc62b70c8d04d5a2ced25a213a8d601e7011 | [
"Apache-2.0"
] | null | null | null | fixture/Python3/expected_xml/Block1.py | exKAZUu/ParserTests | 609cfc62b70c8d04d5a2ced25a213a8d601e7011 | [
"Apache-2.0"
] | null | null | null | <file_input>
<stmt>
<simple_stmt>
<small_stmt>
<expr_stmt>
<testlist_star_expr>
<test>
<or_test>
<and_test>
<not_test>
<comparison>
<expr>
<xor_expr>
... | 45.495385 | 118 | 0.185265 | <file_input>
<stmt>
<simple_stmt>
<small_stmt>
<expr_stmt>
<testlist_star_expr>
<test>
<or_test>
<and_test>
<not_test>
<comparison>
<expr>
<xor_expr>
... | false | true |
f7f9e252060aa604e95ba76f501f5ed1f1b78487 | 8,362 | py | Python | cirq/contrib/paulistring/clifford_optimize.py | rickyHong/Cirq-repl | 5b31440d5b5bf5a66ee85ef5e44373ac89aa0eaf | [
"Apache-2.0"
] | 2 | 2019-04-02T09:16:28.000Z | 2019-05-25T18:35:19.000Z | cirq/contrib/paulistring/clifford_optimize.py | babbush/Cirq | 447b2c762cc2820dd28abb3bd2bc785d36bae39a | [
"Apache-2.0"
] | 36 | 2019-04-03T23:03:51.000Z | 2019-05-15T23:49:01.000Z | cirq/contrib/paulistring/clifford_optimize.py | babbush/Cirq | 447b2c762cc2820dd28abb3bd2bc785d36bae39a | [
"Apache-2.0"
] | 2 | 2019-04-03T22:55:05.000Z | 2019-04-24T23:24:53.000Z | # Copyright 2018 The ops Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 43.552083 | 80 | 0.559196 |
from typing import Tuple, cast
from cirq import ops, circuits
from cirq.contrib.paulistring.convert_gate_set import (
converted_gate_set)
def clifford_optimized_circuit(circuit: circuits.Circuit,
atol: float = 1e-8
) -> circuits.Circuit:... | true | true |
f7f9e3108829f88a5ca916aeef820a02b3bb4922 | 2,794 | py | Python | LAB03/01-DDB/backend/cloudalbum/__init__.py | liks79/moving-to-serverless-renew | 2f173071ab387654d4cc851a0b39130613906378 | [
"MIT"
] | 6 | 2019-08-21T04:13:34.000Z | 2019-10-29T07:15:39.000Z | LAB03/01-DDB/backend/cloudalbum/__init__.py | liks79/moving-to-serverless-renew | 2f173071ab387654d4cc851a0b39130613906378 | [
"MIT"
] | 89 | 2019-07-31T02:29:54.000Z | 2022-03-12T01:03:22.000Z | LAB03/01-DDB/backend/cloudalbum/__init__.py | michaelrishiforrester/moving-to-serverless-renew | 27cbcbde9db3d2bc66212fe4f768563d25f64c19 | [
"MIT"
] | 4 | 2019-08-02T03:00:35.000Z | 2020-02-26T18:44:03.000Z | """
cloudalbum/__init__.py
~~~~~~~~~~~~~~~~~~~~~~~
Environment configuration how to run application.
:description: CloudAlbum is a fully featured sample application for 'Moving to AWS serverless' training course
:copyright: © 2019 written by Dayoungle Jun, Sungshik Jou.
:license: MIT, see LICEN... | 30.043011 | 114 | 0.704366 |
import os
import logging
import sys
import json
import datetime
from bson.objectid import ObjectId
from flask import Flask
from flask_cors import CORS
from flask_jwt_extended import JWTManager
from flask_bcrypt import Bcrypt
from werkzeug.exceptions import Conflict
from cloudalbum.database import create_table
class ... | true | true |
f7f9e35397087f18ceebaed258481b681536e538 | 2,567 | py | Python | src/ner_func.py | Danboruya/ner-practice | a23d103a9997d70b83425a899893848f52b9a4dc | [
"Apache-2.0"
] | null | null | null | src/ner_func.py | Danboruya/ner-practice | a23d103a9997d70b83425a899893848f52b9a4dc | [
"Apache-2.0"
] | null | null | null | src/ner_func.py | Danboruya/ner-practice | a23d103a9997d70b83425a899893848f52b9a4dc | [
"Apache-2.0"
] | null | null | null | import re
import pyknp
def extract_ne(src_str, knp, fstring_flag=False, detail_flag=False):
_knp = knp
tagged_str = src_str
result = _knp.parse(src_str)
ne_phrase_list = []
ne_dict = {}
if fstring_flag:
for t in result.tag_list():
print(t.fstring)
if detail_flag:
... | 36.15493 | 105 | 0.62836 | import re
import pyknp
def extract_ne(src_str, knp, fstring_flag=False, detail_flag=False):
_knp = knp
tagged_str = src_str
result = _knp.parse(src_str)
ne_phrase_list = []
ne_dict = {}
if fstring_flag:
for t in result.tag_list():
print(t.fstring)
if detail_flag:
... | true | true |
f7f9e4154d6f8e32a33526e6381306274a9a2ac7 | 178 | py | Python | heksher/exceptions.py | biocatchltd/heksher-py | bdee59eabd13ce4b32b8100e33675859bdc0cfb7 | [
"MIT"
] | 2 | 2021-01-21T11:41:16.000Z | 2021-02-10T07:27:48.000Z | heksher/exceptions.py | biocatchltd/heksher-py | bdee59eabd13ce4b32b8100e33675859bdc0cfb7 | [
"MIT"
] | 20 | 2021-02-04T11:51:28.000Z | 2022-01-09T14:39:54.000Z | heksher/exceptions.py | biocatchltd/heksher-py | bdee59eabd13ce4b32b8100e33675859bdc0cfb7 | [
"MIT"
] | null | null | null | class NoMatchError(Exception):
"""
Raised either internally when resolving a ruleset fails, or externally when a setting has no default and no
matching rules
"""
| 29.666667 | 111 | 0.719101 | class NoMatchError(Exception):
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.