hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14edad87d7176020cffbc7f590643fcd9fe9c088 | 6,160 | py | Python | python/pyarrow/tests/test_orc.py | Spirarel/arrow | 2746266addddf71d20a4fe49381497b894c4d15c | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 1 | 2021-05-22T00:24:09.000Z | 2021-05-22T00:24:09.000Z | python/pyarrow/tests/test_orc.py | Spirarel/arrow | 2746266addddf71d20a4fe49381497b894c4d15c | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 7 | 2021-04-20T23:30:51.000Z | 2021-08-31T22:59:52.000Z | python/pyarrow/tests/test_orc.py | pixie-labs/arrow | e53ce15d379514bc7de0a25855d9bd3b9e2a714e | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0"
] | 1 | 2018-10-15T02:49:29.000Z | 2018-10-15T02:49:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.661202 | 77 | 0.621429 |
701196407b9f4f5d0c907c0311b45c1fde80f0da | 31 | py | Python | __backup__/py_cf/__init__.py | bopopescu/local_controller_3 | e5d98ab60e1ccac7e0310abc55e83b671d4a643c | [
"MIT"
] | null | null | null | __backup__/py_cf/__init__.py | bopopescu/local_controller_3 | e5d98ab60e1ccac7e0310abc55e83b671d4a643c | [
"MIT"
] | null | null | null | __backup__/py_cf/__init__.py | bopopescu/local_controller_3 | e5d98ab60e1ccac7e0310abc55e83b671d4a643c | [
"MIT"
] | null | null | null | from cf_interpreter import *
| 7.75 | 28 | 0.774194 |
42a62af023e785fbb51999eecb0d59ec93b198d4 | 9,769 | py | Python | nnvm/tests/python/frontend/mxnet/model_zoo/resnet.py | titikid/tvm | 0cf3765b28d457d2503ec20b551e9a8eadb1491d | [
"Apache-2.0"
] | 1,872 | 2016-09-01T03:31:45.000Z | 2022-02-23T08:56:53.000Z | nnvm/tests/python/frontend/mxnet/model_zoo/resnet.py | titikid/tvm | 0cf3765b28d457d2503ec20b551e9a8eadb1491d | [
"Apache-2.0"
] | 313 | 2016-09-08T16:18:18.000Z | 2018-09-11T09:34:52.000Z | nnvm/tests/python/frontend/mxnet/model_zoo/resnet.py | titikid/tvm | 0cf3765b28d457d2503ec20b551e9a8eadb1491d | [
"Apache-2.0"
] | 375 | 2016-09-01T03:50:05.000Z | 2022-03-18T16:00:53.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 48.60199 | 147 | 0.609479 |
b058b575466473208dd90aafc36c6e95c8663344 | 1,003 | py | Python | pypeit/scripts/lowrdx_skyspec.py | joshwalawender/PypeIt | f952cbb2aaee640b5c585be823884a237b441e8e | [
"BSD-3-Clause"
] | 1 | 2018-12-18T21:56:23.000Z | 2018-12-18T21:56:23.000Z | pypeit/scripts/lowrdx_skyspec.py | joshwalawender/PypeIt | f952cbb2aaee640b5c585be823884a237b441e8e | [
"BSD-3-Clause"
] | null | null | null | pypeit/scripts/lowrdx_skyspec.py | joshwalawender/PypeIt | f952cbb2aaee640b5c585be823884a237b441e8e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# See top-level LICENSE file for Copyright information
#
# -*- coding: utf-8 -*-
"""
This script generates a sky spectrum from a LowRedux IDL save file
"""
def parser(options=None):
import argparse
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter... | 26.394737 | 97 | 0.683948 |
f035c96714372ea68b9f8179ae0d8875edb0a310 | 5,352 | py | Python | sunpy/map/sources/tests/test_mdi_source.py | RhnSharma/sunpy | 03700193d287156ca1922eb27c4c2ad50040e53f | [
"BSD-2-Clause"
] | 1 | 2020-05-01T07:38:28.000Z | 2020-05-01T07:38:28.000Z | sunpy/map/sources/tests/test_mdi_source.py | RhnSharma/sunpy | 03700193d287156ca1922eb27c4c2ad50040e53f | [
"BSD-2-Clause"
] | null | null | null | sunpy/map/sources/tests/test_mdi_source.py | RhnSharma/sunpy | 03700193d287156ca1922eb27c4c2ad50040e53f | [
"BSD-2-Clause"
] | 1 | 2020-11-14T19:12:03.000Z | 2020-11-14T19:12:03.000Z | """Test cases for SOHO Map subclasses.
This particular test file pertains to MDIMap.
@Author: Pritish C. (VaticanCameos)
"""
import os
import glob
from textwrap import dedent
import numpy as np
import pytest
import astropy.units as u
from astropy.coordinates import Angle
from astropy.io import fits
import sunpy.data... | 33.45 | 91 | 0.608184 |
f874eb9ac8b2f94b5e9144d0638c07160e517755 | 3,135 | py | Python | SemanticsApp/app.py | abpwrs/thee-flying-chicken | 6e2863af9dd92b01c6bb4fa3598c7c2b5f898c54 | [
"MIT"
] | 2 | 2018-11-29T04:00:03.000Z | 2018-12-22T18:02:05.000Z | SemanticsApp/app.py | abpwrs/thee-flying-chicken | 6e2863af9dd92b01c6bb4fa3598c7c2b5f898c54 | [
"MIT"
] | 12 | 2018-12-02T19:14:36.000Z | 2019-03-05T01:51:46.000Z | SemanticsApp/app.py | abpwrs/thee-flying-chicken | 6e2863af9dd92b01c6bb4fa3598c7c2b5f898c54 | [
"MIT"
] | 1 | 2019-02-07T13:37:55.000Z | 2019-02-07T13:37:55.000Z | from flask import Flask, redirect, render_template, url_for, request
from database import db_session, init_db
from models.User import User
from internal_api import *
app = Flask(__name__)
init_db()
@app.errorhandler(404)
def page_not_found():
# note that we set the 404 status explicitly
return render_templa... | 24.880952 | 68 | 0.631579 |
d511ce65d4f3489bc7914da376b5bb3748bb04e0 | 1,194 | py | Python | sort-colors/sort-colors.py | kayanmorshed/Leetcode | 233e50a069a69fbe126dc86d293d4024eb070b8a | [
"MIT"
] | null | null | null | sort-colors/sort-colors.py | kayanmorshed/Leetcode | 233e50a069a69fbe126dc86d293d4024eb070b8a | [
"MIT"
] | null | null | null | sort-colors/sort-colors.py | kayanmorshed/Leetcode | 233e50a069a69fbe126dc86d293d4024eb070b8a | [
"MIT"
] | null | null | null | class Solution:
def sortColors(self, nums: List[int]) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
# method to partition a given array using two pointer
def partition(nums, start, end):
pivot = nums[end]
i = start-1
... | 34.114286 | 61 | 0.454774 |
8adbbbd0b591308bcd93feff75d4c30a670f5503 | 403 | py | Python | AdventOfCode2016/day15math.py | Matematik411/Advent-of-Code-Practice | f556ae8b84526368184f72a811949ec1fd4b686e | [
"MIT"
] | null | null | null | AdventOfCode2016/day15math.py | Matematik411/Advent-of-Code-Practice | f556ae8b84526368184f72a811949ec1fd4b686e | [
"MIT"
] | null | null | null | AdventOfCode2016/day15math.py | Matematik411/Advent-of-Code-Practice | f556ae8b84526368184f72a811949ec1fd4b686e | [
"MIT"
] | null | null | null | m = [17, 3, 19, 13, 7, 5, 11]
M = 17*3*19*13*7*5*11
z = [M//17, M//3, M//19, M//13, M//7, M//5, M//11]
a = [1, 2, 12, 7, 0, 4, 4]
def inv_mod(x, mod):
x %= mod
o = x
k = 1
while x != 1:
x = (x + o) % mod
k += 1
return k
y = [inv_mod(z[i], m[i]) for i in range(7)]
w = [y[i] *... | 18.318182 | 50 | 0.409429 |
7fbf0d5f37098f91fef44c87df8c2e7bb00672b6 | 3,477 | py | Python | md/annotate/util.py | thisismedium/md | fc31614e2b85b9dc405a1d1e12f1e21c26782db8 | [
"BSD-2-Clause"
] | 1 | 2016-05-09T09:48:40.000Z | 2016-05-09T09:48:40.000Z | md/annotate/util.py | thisismedium/md | fc31614e2b85b9dc405a1d1e12f1e21c26782db8 | [
"BSD-2-Clause"
] | null | null | null | md/annotate/util.py | thisismedium/md | fc31614e2b85b9dc405a1d1e12f1e21c26782db8 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
from collections import Mapping
from itertools import chain, ifilter, izip, izip_longest
from inspect import getargspec
from md.expect import expect
__all__ = (
'mapping', 'name', 'flatten', 'is_nested',
'annotatable_names', 'annotatable_spec',
'zip_annotatable', 'zip... | 30.234783 | 80 | 0.612597 |
d704e2f820ad44ff3c524a958604fec8883299e3 | 7,981 | py | Python | reproduction/matching/model/esim.py | brxx122/fastNLP | 8affc4a3ff75061ccbdecca6247493f346634155 | [
"Apache-2.0"
] | null | null | null | reproduction/matching/model/esim.py | brxx122/fastNLP | 8affc4a3ff75061ccbdecca6247493f346634155 | [
"Apache-2.0"
] | null | null | null | reproduction/matching/model/esim.py | brxx122/fastNLP | 8affc4a3ff75061ccbdecca6247493f346634155 | [
"Apache-2.0"
] | 2 | 2020-04-21T06:17:59.000Z | 2020-05-05T11:22:11.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from fastNLP.models.base_model import BaseModel
from fastNLP.embeddings import TokenEmbedding
from fastNLP.core.const import Const
from fastNLP.core.utils import seq_len_to_mask
class ESIMModel(BaseModel):
def __init__(self, init_embedding: Token... | 42.227513 | 107 | 0.600927 |
28c4382c41e258fc01a24f69c083ac88f0eb699d | 636 | py | Python | pytest_data_extractor/data_containers.py | adam-is-here/pytest-data-extractor | 9eb986e39bf0bfb8a6c9646876a0c7f4223e916e | [
"MIT"
] | null | null | null | pytest_data_extractor/data_containers.py | adam-is-here/pytest-data-extractor | 9eb986e39bf0bfb8a6c9646876a0c7f4223e916e | [
"MIT"
] | null | null | null | pytest_data_extractor/data_containers.py | adam-is-here/pytest-data-extractor | 9eb986e39bf0bfb8a6c9646876a0c7f4223e916e | [
"MIT"
] | null | null | null | from dataclasses import dataclass,field
from typing import (
Optional,
Any,
Dict
)
@dataclass
class TestData:
test_input: Optional[Any] = field(default=None)
func_args: Optional[Dict] = field(default_factory=dict)
expected_result: Optional[Any] = field(default=None)
actual_result: Optional[... | 33.473684 | 69 | 0.718553 |
f79ea9de028d644d5d236d4334b2e86497c6ebe4 | 298 | py | Python | src/estrutura_se.py | EstudoAAS/treinaweb-python-basico | 6b85c0e95aa741cc35810a12659bcb346d9060af | [
"Apache-2.0"
] | null | null | null | src/estrutura_se.py | EstudoAAS/treinaweb-python-basico | 6b85c0e95aa741cc35810a12659bcb346d9060af | [
"Apache-2.0"
] | null | null | null | src/estrutura_se.py | EstudoAAS/treinaweb-python-basico | 6b85c0e95aa741cc35810a12659bcb346d9060af | [
"Apache-2.0"
] | null | null | null | idade = int(input("Qual a sua idade? "))
if idade >= 18:
print("Você é maior de idade.")
print("outra coisa")
else:
print("Você é menor de idade.")
if idade < 18:
print("Você é criança.")
elif idade >=18 and idade <= 65:
print("Você é adulto.")
else:
print("Você é idoso.") | 22.923077 | 40 | 0.604027 |
ffebb205188e5533c41d2d3b5eb7ce63c31a7e47 | 730 | py | Python | cn/pyQt/lesson/capter5/IconForm.py | Jasonandy/Python-X | 2f02b9a17bd5495dd1f8746b191f11ec2d7bccbe | [
"Apache-2.0"
] | null | null | null | cn/pyQt/lesson/capter5/IconForm.py | Jasonandy/Python-X | 2f02b9a17bd5495dd1f8746b191f11ec2d7bccbe | [
"Apache-2.0"
] | null | null | null | cn/pyQt/lesson/capter5/IconForm.py | Jasonandy/Python-X | 2f02b9a17bd5495dd1f8746b191f11ec2d7bccbe | [
"Apache-2.0"
] | 2 | 2019-06-18T05:53:26.000Z | 2019-06-19T03:26:02.000Z | import sys
from PyQt5.QtWidgets import QMainWindow,QApplication
from PyQt5.QtGui import QIcon
'''
窗口的setWindowIcon方法用于设置窗口的图标,只在Windows中可用
QAplication中的setWindowIcon方法用于设置主窗口的图标和应用程序图标,但调用了窗口的setWindowIcon方法
QAplication中的setWindowIcon方法就只能用于设置应用程序图标了
'''
class IconForm(QMainWindow):
def __init__(self):
sup... | 25.172414 | 68 | 0.70137 |
9f1aed7bdb31a55efac7460c35f26221cc1a9a58 | 8,933 | py | Python | google/cloud/forseti/scanner/audit/lien_rules_engine.py | BrunoReboul/forseti-security | 9d4a61b3e5a5d22a4330d15ddf61063fc9079071 | [
"Apache-2.0"
] | 1 | 2018-10-06T23:16:59.000Z | 2018-10-06T23:16:59.000Z | google/cloud/forseti/scanner/audit/lien_rules_engine.py | BrunoReboul/forseti-security | 9d4a61b3e5a5d22a4330d15ddf61063fc9079071 | [
"Apache-2.0"
] | null | null | null | google/cloud/forseti/scanner/audit/lien_rules_engine.py | BrunoReboul/forseti-security | 9d4a61b3e5a5d22a4330d15ddf61063fc9079071 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security 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 ap... | 35.875502 | 80 | 0.612896 |
75835f8a1a60f5831fbbd78b95c21248358ce3b7 | 1,347 | py | Python | setup.py | ionata/django-minimal-user | 5d7c187151c4586c85c67de16b6635f864202b5d | [
"BSD-3-Clause"
] | null | null | null | setup.py | ionata/django-minimal-user | 5d7c187151c4586c85c67de16b6635f864202b5d | [
"BSD-3-Clause"
] | 1 | 2017-11-21T22:11:15.000Z | 2017-11-22T00:37:55.000Z | setup.py | ionata/django-minimal-user | 5d7c187151c4586c85c67de16b6635f864202b5d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import, print_function
import io
from setuptools import setup, find_packages
def _read(filename, as_lines=True):
with io.open(filename, encoding='utf-8') as handle:
if as_lines:
return [line.strip('\n').strip() for line in handle.readline... | 32.071429 | 76 | 0.649592 |
715f42ceab7d6abeb407f306bb4bf95bbe0a0a01 | 5,487 | py | Python | lib/galaxy/structured_app.py | lldelisle/galaxy | 69069ea5280b283ecf5f522a1ec74305089e5f85 | [
"CC-BY-3.0"
] | 47 | 2015-10-21T23:30:30.000Z | 2022-03-09T06:51:32.000Z | lib/galaxy/structured_app.py | lldelisle/galaxy | 69069ea5280b283ecf5f522a1ec74305089e5f85 | [
"CC-BY-3.0"
] | 78 | 2019-01-18T08:12:49.000Z | 2022-03-13T08:56:41.000Z | lib/galaxy/structured_app.py | lldelisle/galaxy | 69069ea5280b283ecf5f522a1ec74305089e5f85 | [
"CC-BY-3.0"
] | 35 | 2015-10-30T13:09:40.000Z | 2021-05-03T23:17:46.000Z | """Typed description of Galaxy's app object."""
from typing import Any, Optional
from kombu import Connection
from galaxy.auth import AuthManager
from galaxy.datatypes.registry import Registry
from galaxy.di import Container
from galaxy.files import ConfiguredFileSources
from galaxy.job_metrics import JobMetrics
from... | 44.609756 | 130 | 0.790778 |
936e8788636780124f4205afb8f87b213a5f2529 | 10,586 | py | Python | venv/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/endpoints/metadata.py | nicholasadamou/StockBird | 257396479667863d4ee122ea46adb86087c9aa78 | [
"Apache-2.0"
] | 32 | 2019-11-14T07:49:33.000Z | 2022-02-16T00:49:22.000Z | venv/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/endpoints/metadata.py | nicholasadamou/StockBird | 257396479667863d4ee122ea46adb86087c9aa78 | [
"Apache-2.0"
] | 48 | 2020-10-15T09:53:36.000Z | 2021-07-05T15:33:24.000Z | venv/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/endpoints/metadata.py | nicholasadamou/StockBird | 257396479667863d4ee122ea46adb86087c9aa78 | [
"Apache-2.0"
] | 18 | 2019-08-19T12:11:00.000Z | 2021-10-12T09:36:27.000Z | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.endpoint.metadata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the `OAuth 2.0 Authorization Server Metadata`.
.. _`OAuth 2.0 Authorization Server Metadata`: https://tools.ietf.org/html/rfc8414
"""
from __future__ import absolute_import, unicode_l... | 43.563786 | 119 | 0.691385 |
c3e96ef008ab998874422f027c3f7de17379d2b4 | 11,651 | py | Python | experiments/002_cnn_processes_single_sat_image_then_rnn.py | openclimatefix/predict_pv_yield | 83f27bd392190f1771221e92bfebb879bf562f5d | [
"MIT"
] | 47 | 2019-10-21T17:08:00.000Z | 2022-02-17T16:24:03.000Z | experiments/002_cnn_processes_single_sat_image_then_rnn.py | openclimatefix/predict_pv_yield | 83f27bd392190f1771221e92bfebb879bf562f5d | [
"MIT"
] | 75 | 2019-10-29T09:54:03.000Z | 2022-03-02T16:00:46.000Z | experiments/002_cnn_processes_single_sat_image_then_rnn.py | openclimatefix/predict_pv_yield | 83f27bd392190f1771221e92bfebb879bf562f5d | [
"MIT"
] | 11 | 2019-11-06T04:35:43.000Z | 2022-03-12T16:25:49.000Z | #!/usr/bin/env python3
import numpy as np
import os
import torch
from torch import nn
import torch.nn.functional as F
import pytorch_lightning as pl
from predict_pv_yield.netcdf_dataset import NetCDFDataset, worker_init_fn
from predict_pv_yield.visualisation import plot_example
from neptune.new.integrations.pytorch... | 35.199396 | 150 | 0.608102 |
49ffdd5ebb0b110412d5a59929eaeb173c75f2c9 | 3,133 | py | Python | tests/test_forms.py | Khan/agar | 77ff2ccd79001630f74f04ce252faa408e7686a6 | [
"MIT"
] | null | null | null | tests/test_forms.py | Khan/agar | 77ff2ccd79001630f74f04ce252faa408e7686a6 | [
"MIT"
] | null | null | null | tests/test_forms.py | Khan/agar | 77ff2ccd79001630f74f04ce252faa408e7686a6 | [
"MIT"
] | null | null | null | import urllib
from webapp2 import WSGIApplication
from webtest import Request
from agar.url import uri_for
from agar.test import BaseTest, WebTest
from api import application
class JsonWebTestCase(BaseTest):
def assertOK(self, response):
self.assertValidResponse(response)
super(JsonWebTestCase,... | 35.602273 | 111 | 0.63294 |
75606bea25e929b3f818211e89dab8ed3f641a93 | 17,505 | py | Python | Tools/freeze/freeze.py | ajdiaz/python-static | ed4c3b45027de7ff8cc9a7bf84f27468f7f07179 | [
"PSF-2.0"
] | null | null | null | Tools/freeze/freeze.py | ajdiaz/python-static | ed4c3b45027de7ff8cc9a7bf84f27468f7f07179 | [
"PSF-2.0"
] | null | null | null | Tools/freeze/freeze.py | ajdiaz/python-static | ed4c3b45027de7ff8cc9a7bf84f27468f7f07179 | [
"PSF-2.0"
] | null | null | null | #! /usr/bin/env python3
"""Freeze a Python script into a binary.
usage: freeze [options...] script [module]...
Options:
-p prefix: This is the prefix used when you ran ``make install''
in the Python build directory.
(If you never ran this, freeze won't work.)
The default ... | 34.323529 | 90 | 0.579263 |
121fe587ec69245f6ba1d260385f87c4b51980d3 | 9,770 | py | Python | tests/test_resource/test_jdbc/test_mysql.py | MarkHerhold/local-data-api | 3ac3040b63fd90673c4a888eeb762a6a513f9c9c | [
"MIT"
] | null | null | null | tests/test_resource/test_jdbc/test_mysql.py | MarkHerhold/local-data-api | 3ac3040b63fd90673c4a888eeb762a6a513f9c9c | [
"MIT"
] | null | null | null | tests/test_resource/test_jdbc/test_mysql.py | MarkHerhold/local-data-api | 3ac3040b63fd90673c4a888eeb762a6a513f9c9c | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Union
import jaydebeapi
import pytest
from local_data_api.exceptions import BadRequestException
from local_data_api.models import ColumnMetadata, ExecuteStatementResponse, Field
from local_data_api.resources.jdbc.mysql import MySQLJDBC
from t... | 35.787546 | 88 | 0.656602 |
525b1f97a9556c1391046a7d6185a908cbef4684 | 173 | py | Python | training_data/reports/pdftotext.py | rbenic-fer/security-report-generation | d06d71abbf8e60be9bf4001657d9ee44affa0d59 | [
"MIT"
] | null | null | null | training_data/reports/pdftotext.py | rbenic-fer/security-report-generation | d06d71abbf8e60be9bf4001657d9ee44affa0d59 | [
"MIT"
] | null | null | null | training_data/reports/pdftotext.py | rbenic-fer/security-report-generation | d06d71abbf8e60be9bf4001657d9ee44affa0d59 | [
"MIT"
] | null | null | null | import chardet
import sys
import textract
filename = sys.argv[1]
text = textract.process(filename)
encoding = chardet.detect(text)['encoding']
print(text.decode(encoding))
| 19.222222 | 43 | 0.780347 |
d7896e81780d368f64fe0158a7aa026a68901dab | 1,761 | py | Python | python/train.py | whoanuragverma/rock-paper-scissor | a4dc543e53588a1625227ff8632171e8898ce4fc | [
"MIT"
] | null | null | null | python/train.py | whoanuragverma/rock-paper-scissor | a4dc543e53588a1625227ff8632171e8898ce4fc | [
"MIT"
] | null | null | null | python/train.py | whoanuragverma/rock-paper-scissor | a4dc543e53588a1625227ff8632171e8898ce4fc | [
"MIT"
] | null | null | null | """
author: Anurag Verma
license: MIT
This file trains the model on processed Dataset and exports a tensorflow-js model to model/
"""
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow import keras
import tensorflowjs as tfjs
df = pd.read_csv('python/processedDS.csv', sep='|')
#... | 38.282609 | 101 | 0.57297 |
cefc9edb484bc087abd1b52c92021993df8ec41d | 908 | py | Python | fermipy/jobs/app_link.py | damgreen/fermipy | 92b693a9272453bc6eb5c21e9bbac912408122fb | [
"BSD-3-Clause"
] | 42 | 2015-05-08T14:47:07.000Z | 2022-03-14T03:28:54.000Z | fermipy/jobs/app_link.py | damgreen/fermipy | 92b693a9272453bc6eb5c21e9bbac912408122fb | [
"BSD-3-Clause"
] | 321 | 2015-10-01T18:57:54.000Z | 2022-03-24T13:02:05.000Z | fermipy/jobs/app_link.py | damgreen/fermipy | 92b693a9272453bc6eb5c21e9bbac912408122fb | [
"BSD-3-Clause"
] | 44 | 2015-11-23T08:54:54.000Z | 2022-01-10T17:50:51.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities to chain together a series of ScienceTools apps
"""
from __future__ import absolute_import, division, print_function
from fermipy.jobs.link import Link
class AppLink(Link):
"""A wrapper for a single fermipy application
This class... | 29.290323 | 71 | 0.700441 |
911551ddf36c8551c6a9e6c17fe0b75fa47e913d | 2,158 | py | Python | purescript_show_python/Data/Field/pure.src.py | thautwarm/purescript-show-python | e40134362653baa2f5feffced579504d7fe7f7ba | [
"MIT"
] | null | null | null | purescript_show_python/Data/Field/pure.src.py | thautwarm/purescript-show-python | e40134362653baa2f5feffced579504d7fe7f7ba | [
"MIT"
] | 1 | 2020-02-24T16:38:30.000Z | 2020-02-24T16:38:30.000Z | purescript_show_python/Data/Field/pure.src.py | purescript-python/purescript-show-python | e40134362653baa2f5feffced579504d7fe7f7ba | [
"MIT"
] | null | null | null | from py_sexpr.terms import *
from py_sexpr.stack_vm.emit import module_code
res = block( "No document"
, assign_star( "ps_Field"
, define( None
, [ "ps_DivisionRing1"
, "ps_EuclideanRing0"
... | 67.4375 | 204 | 0.310009 |
002a8038cd837be469b65bf2e221f23f60c13e02 | 3,710 | py | Python | Example_C2_Profile/mythic/MythicCallbackRPC.py | xorrior/Mythic | ea348b66e1d96e88e0e7fbabff182945cbdf12b6 | [
"BSD-3-Clause"
] | 2 | 2021-01-28T19:35:46.000Z | 2021-04-08T12:01:48.000Z | Example_C2_Profile/mythic/MythicCallbackRPC.py | xorrior/Mythic | ea348b66e1d96e88e0e7fbabff182945cbdf12b6 | [
"BSD-3-Clause"
] | null | null | null | Example_C2_Profile/mythic/MythicCallbackRPC.py | xorrior/Mythic | ea348b66e1d96e88e0e7fbabff182945cbdf12b6 | [
"BSD-3-Clause"
] | 2 | 2020-12-29T02:34:13.000Z | 2021-06-24T04:07:38.000Z | from MythicBaseRPC import *
import base64
class MythicRPCResponse(RPCResponse):
def __init__(self, resp: RPCResponse):
super().__init__(resp._raw_resp)
if resp.status == MythicStatus.Success:
self.data = resp.response
else:
self.data = None
@property
def da... | 29.68 | 95 | 0.53504 |
7ac1ea0625d4d80718e10b3a2f88ffdbf66c685b | 553 | py | Python | sd_maskrcnn/utils.py | woshisj/sd-maskrcnn | 132dcede064db0dd0b25ccd770eb55c57fdbd18d | [
"MIT"
] | null | null | null | sd_maskrcnn/utils.py | woshisj/sd-maskrcnn | 132dcede064db0dd0b25ccd770eb55c57fdbd18d | [
"MIT"
] | null | null | null | sd_maskrcnn/utils.py | woshisj/sd-maskrcnn | 132dcede064db0dd0b25ccd770eb55c57fdbd18d | [
"MIT"
] | null | null | null | import os
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
def set_tf_config():
tf_config = tf.ConfigProto()
tf_config.gpu_options.allow_growth = True
with tf.Session(config=tf_config) as sess:
set_session(sess)
def mkdir_if_missing(output_dir):
if not os.... | 29.105263 | 79 | 0.683544 |
bc2e20565d39d23f0af97068fd8f74303a0b4be4 | 2,443 | py | Python | python/ray/tests/test_garbage_collection.py | timgates42/ray | 032e8553c78d9f72db99be6f95621887a4d24d7f | [
"Apache-2.0"
] | 1 | 2020-01-09T09:15:52.000Z | 2020-01-09T09:15:52.000Z | python/ray/tests/test_garbage_collection.py | timgates42/ray | 032e8553c78d9f72db99be6f95621887a4d24d7f | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_garbage_collection.py | timgates42/ray | 032e8553c78d9f72db99be6f95621887a4d24d7f | [
"Apache-2.0"
] | 1 | 2020-04-03T14:53:36.000Z | 2020-04-03T14:53:36.000Z | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import numpy as np
import time
import logging
import pytest
import ray
import ray.cluster_utils
import ray.test_utils
logger = logging.getLogger(__name__)
def test_basic_gc(shutd... | 28.08046 | 78 | 0.672124 |
063eefcb64ecd39d6c04104481e639768714e5a5 | 219 | py | Python | charitysite/aboutapp/views.py | Fazer56/Assignment3 | fef159143b9b05a9e288fd104e375aa500ff2666 | [
"MIT"
] | null | null | null | charitysite/aboutapp/views.py | Fazer56/Assignment3 | fef159143b9b05a9e288fd104e375aa500ff2666 | [
"MIT"
] | null | null | null | charitysite/aboutapp/views.py | Fazer56/Assignment3 | fef159143b9b05a9e288fd104e375aa500ff2666 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
class appView:
def about(request):
return render(request, 'aboutapp/basic.html') #return render looks in a templates directory
| 21.9 | 101 | 0.689498 |
7972885747189a1878baa57c9ec0a796e26366a5 | 8,184 | py | Python | venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2_snapshot_facts.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2_snapshot_facts.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2_snapshot_facts.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 32.86747 | 156 | 0.693671 |
63e37b17798b64894df624b0c1fe68e6f420e1e1 | 3,520 | py | Python | PyMesh/third_party/pybind11/tests/test_operator_overloading.py | VincentLefevre/3D-parallax | 8eab905fcc591e1bd7ddbbb01ad21427286c02e3 | [
"MIT"
] | 73 | 2021-01-05T07:25:51.000Z | 2022-03-17T20:46:01.000Z | pybind11/tests/test_operator_overloading.py | alherit/kd-switch-cpp | 7b99e9e20eeb06fbd93b149c0bd5c5de47965f6e | [
"MIT"
] | 1 | 2021-01-05T11:45:36.000Z | 2021-01-05T20:55:28.000Z | pybind11/tests/test_operator_overloading.py | alherit/kd-switch-cpp | 7b99e9e20eeb06fbd93b149c0bd5c5de47965f6e | [
"MIT"
] | 4 | 2021-01-05T10:27:50.000Z | 2021-01-06T12:02:57.000Z | import pytest
from pybind11_tests import operators as m
from pybind11_tests import ConstructorStats
def test_operator_overloading():
v1 = m.Vector2(1, 2)
v2 = m.Vector(3, -1)
assert str(v1) == "[1.000000, 2.000000]"
assert str(v2) == "[3.000000, -1.000000]"
assert str(-v2) == "[-3.0000... | 32.293578 | 91 | 0.522727 |
ca22dcb6e7e1b65ea42bb462afff033bf74a9e42 | 2,410 | py | Python | venv/lib/python3.9/site-packages/django_postgres_extensions/models/fields/reverse_related.py | boshanxiang/bernoulli_backend | d446a33014d7bd9b5232a921edfd377d05fe0121 | [
"MIT"
] | null | null | null | venv/lib/python3.9/site-packages/django_postgres_extensions/models/fields/reverse_related.py | boshanxiang/bernoulli_backend | d446a33014d7bd9b5232a921edfd377d05fe0121 | [
"MIT"
] | null | null | null | venv/lib/python3.9/site-packages/django_postgres_extensions/models/fields/reverse_related.py | boshanxiang/bernoulli_backend | d446a33014d7bd9b5232a921edfd377d05fe0121 | [
"MIT"
] | null | null | null | from django.db.models.fields.reverse_related import ForeignObjectRel
from django.db.models.fields.related_lookups import RelatedExact, RelatedIn, RelatedGreaterThan, RelatedIsNull, \
RelatedLessThan, RelatedGreaterThanOrEqual, RelatedLessThanOrEqual
from django.core import exceptions
class ArrayManyToManyRel(... | 37.65625 | 114 | 0.619502 |
03a5fc6058c038a478759041f4d4114ff97a73b7 | 218 | py | Python | Important/repr_method.py | jason71319jason/Interview-solved | 42ca93a68475952753d185c325cb55c79e2e55e1 | [
"MIT"
] | 46 | 2019-10-14T01:21:35.000Z | 2022-01-08T23:55:15.000Z | Important/repr_method.py | jason71319jason/Interview-solved | 42ca93a68475952753d185c325cb55c79e2e55e1 | [
"MIT"
] | 53 | 2019-10-03T17:16:43.000Z | 2020-12-08T12:48:19.000Z | Important/repr_method.py | jason71319jason/Interview-solved | 42ca93a68475952753d185c325cb55c79e2e55e1 | [
"MIT"
] | 96 | 2019-10-03T18:12:10.000Z | 2021-03-14T19:41:06.000Z | # printing objects/class
class MyClass:
def __init__(self, a, b):
self.a = a
self.b = b
def __repr__(self):
return "a: " + self.a + "b: " + self.b
m = MyClass("hi", "there")
print(m) | 16.769231 | 46 | 0.527523 |
7f633dab64b377c8abeea60e3a19e7d7934d0d8c | 3,499 | py | Python | display.py | Nguyendat-bit/U-net | 0ee5f0beb2513fa6031947e42a7ad398ad3c8a28 | [
"MIT"
] | 2 | 2021-12-24T12:06:39.000Z | 2022-01-25T17:49:25.000Z | display.py | Nguyendat-bit/U-net | 0ee5f0beb2513fa6031947e42a7ad398ad3c8a28 | [
"MIT"
] | null | null | null | display.py | Nguyendat-bit/U-net | 0ee5f0beb2513fa6031947e42a7ad398ad3c8a28 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import cv2
import predict_func
import tensorflow as tf
from data import *
import numpy as np
def show_history(history, validation : bool = False):
if validation:
# Loss
fig, axes = plt.subplots(figsize= (20,5))
# Train
axes.plot(history.epoch, history... | 38.877778 | 118 | 0.589025 |
883b6311557b3371bef8e15c62f91397a97d134a | 145 | py | Python | Day3/secondquestion.py | Amitadk22/Letsupgradepython7 | 49951f0412fc14a53c58f21bb63013084dafe249 | [
"Apache-2.0"
] | null | null | null | Day3/secondquestion.py | Amitadk22/Letsupgradepython7 | 49951f0412fc14a53c58f21bb63013084dafe249 | [
"Apache-2.0"
] | null | null | null | Day3/secondquestion.py | Amitadk22/Letsupgradepython7 | 49951f0412fc14a53c58f21bb63013084dafe249 | [
"Apache-2.0"
] | null | null | null | for n in range(1,201):
if n>1:
for i in range(2,n):
if(n%i==0):
break
else:
print(n)
| 18.125 | 28 | 0.358621 |
9d93ece14fd633045bbafe867c164ea350b48bd6 | 2,116 | py | Python | src/cryptography/x509/name.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | 674 | 2015-11-06T04:22:47.000Z | 2022-02-26T17:31:43.000Z | src/cryptography/x509/name.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | 713 | 2015-11-06T10:48:58.000Z | 2018-11-27T16:32:18.000Z | src/cryptography/x509/name.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | 106 | 2015-12-07T11:21:06.000Z | 2022-03-11T10:58:41.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import six
from cryptography import utils
from cryptography.x509.oid imp... | 26.78481 | 79 | 0.63327 |
02a00004464852366e8eb41cc8e5c2730d15229e | 3,886 | py | Python | u1_2d/s_nthmc_l76_fixBV_l64_b6.py | nftqcd/nthmc | 010c70e297c904219e9d8a04cc20b9c75a4b61e5 | [
"MIT"
] | 2 | 2021-07-29T19:09:30.000Z | 2022-01-17T21:13:40.000Z | u1_2d/s_nthmc_l76_fixBV_l64_b6.py | nftqcd/nthmc | 010c70e297c904219e9d8a04cc20b9c75a4b61e5 | [
"MIT"
] | null | null | null | u1_2d/s_nthmc_l76_fixBV_l64_b6.py | nftqcd/nthmc | 010c70e297c904219e9d8a04cc20b9c75a4b61e5 | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorflow.keras as tk
import numpy
import nthmc, ftr, evolve, forcetrain
trajLength = 4.0
nstep = 20
fac = (76./64.)**2
conf = nthmc.Conf(nbatch=32, nepoch=1, nstepEpoch=1024, nstepMixing=0, initDt=trajLength/nstep, stepPerTraj=nstep, trainDt=False, nthr=10, nthrIop=1, seed=7*11*13*7*1... | 64.766667 | 172 | 0.636902 |
26ab8a95ff553c235120492c82dd0f67e3cc5613 | 1,796 | py | Python | re-sub.py | Borodin-Atamanov/pytest | 0ffb22613bdcaee278abf7a4b0b3720020c50151 | [
"Apache-2.0"
] | null | null | null | re-sub.py | Borodin-Atamanov/pytest | 0ffb22613bdcaee278abf7a4b0b3720020c50151 | [
"Apache-2.0"
] | null | null | null | re-sub.py | Borodin-Atamanov/pytest | 0ffb22613bdcaee278abf7a4b0b3720020c50151 | [
"Apache-2.0"
] | null | null | null | import re
import re
inp = 'Привет\n\rКак дела?'
filter = "\n\r\t "
#w = w.maketrans(' ', ' ', "\n\r\t")
#w = w.translate(None, ",!.;\n")
#print (w)
s = "asjo,fdjk;djaso,oio!kod.kjods;dkps"
#s = s.translate(None, ",!.;")
#s = s.translate(dict.fromkeys(map(ord, u"\n,!.;")))
#w = w.translate(dict.fromkeys(map(ord, u"\n... | 22.17284 | 86 | 0.527283 |
da381c10d25f7552f967e7a86274a4659c2b1885 | 5,411 | py | Python | algol60/Lexer.py | nukata/ply-algol60 | 8bf5818b38862fd7ca4f697ebd7ba72f0dd10cb4 | [
"MIT"
] | null | null | null | algol60/Lexer.py | nukata/ply-algol60 | 8bf5818b38862fd7ca4f697ebd7ba72f0dd10cb4 | [
"MIT"
] | null | null | null | algol60/Lexer.py | nukata/ply-algol60 | 8bf5818b38862fd7ca4f697ebd7ba72f0dd10cb4 | [
"MIT"
] | null | null | null | # H20.10.06/R02.02.11 by SUZUKI Hisao
from .ply import lex
class SyntaxError (Exception):
def __init__(self, msg, LEXER, src, lineno=None, lexpos=None):
if lineno is None:
lineno = LEXER.lex.lineno
if lexpos is None:
lexpos = LEXER.lex.lexpos
msg += " at %d column %... | 25.167442 | 77 | 0.48346 |
5c159ad86726b0843bd3a67ceb6e8890eece5a26 | 10,912 | py | Python | src/oscar/apps/dashboard/views.py | iicc/django-oscar | 67ebe6bc21c242e9b0750b9f306b2f46a2758199 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/dashboard/views.py | iicc/django-oscar | 67ebe6bc21c242e9b0750b9f306b2f46a2758199 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/dashboard/views.py | iicc/django-oscar | 67ebe6bc21c242e9b0750b9f306b2f46a2758199 | [
"BSD-3-Clause"
] | null | null | null | import json
from datetime import timedelta
from decimal import Decimal as D
from decimal import ROUND_UP
from django.contrib import messages
from django.db.models import Avg, Count, Sum
from django.template.response import TemplateResponse
from django.utils.timezone import now
from django.views.generic import Template... | 35.086817 | 87 | 0.617027 |
9fb43de0edf9ac09eecc1f3d11071f71d18c50e5 | 1,579 | py | Python | src/ikea_api/endpoints/cart/mutations.py | sqr/ikea-api-client | 687cbb532b3e59001437373b9c44af504c8c4baf | [
"MIT"
] | null | null | null | src/ikea_api/endpoints/cart/mutations.py | sqr/ikea-api-client | 687cbb532b3e59001437373b9c44af504c8c4baf | [
"MIT"
] | null | null | null | src/ikea_api/endpoints/cart/mutations.py | sqr/ikea-api-client | 687cbb532b3e59001437373b9c44af504c8c4baf | [
"MIT"
] | null | null | null | from ikea_api.endpoints.cart.fragments import cart_props
add_items = """
mutation AddItems(
$items: [AddItemInput!]!
$languageCode: String
) {
addItems(items: $items, languageCode: $languageCode) {
quantity
context {
userId
isAnonymous
retailId
}
}
}
"""
... | 14.225225 | 73 | 0.576314 |
96b2ab71311de6ab12369369cfd4ee2b70b4266d | 410 | py | Python | plugins/redis/komand_redis/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/redis/komand_redis/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/redis/komand_redis/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .delete.action import Delete
from .get.action import Get
from .hash_get.action import HashGet
from .hash_set.action import HashSet
from .hincrby.action import Hincrby
from .hmget.action import Hmget
from .hmset.action import Hmset
from .keys.action import Keys
from .list_get... | 31.538462 | 39 | 0.812195 |
585bef2e384501589f157c1b83b10216c2f3a932 | 1,027 | py | Python | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/express_route_cross_connection_paged.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/express_route_cross_connection_paged.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/express_route_cross_connection_paged.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # 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 ... | 36.678571 | 163 | 0.61149 |
3a39995d5312e86826dac2dcef47ad2fbb243a70 | 725 | py | Python | test/test_huffman.py | hlibbabii/uni-dca | 51ce4144314ca28b38f2c925aa73dde5ab3f829e | [
"MIT"
] | null | null | null | test/test_huffman.py | hlibbabii/uni-dca | 51ce4144314ca28b38f2c925aa73dde5ab3f829e | [
"MIT"
] | null | null | null | test/test_huffman.py | hlibbabii/uni-dca | 51ce4144314ca28b38f2c925aa73dde5ab3f829e | [
"MIT"
] | null | null | null | from unittest import TestCase
from huffman import huffman
from huffman_compression import get_n_bits_to_encode
class TestHuffman(TestCase):
def test_huffman1(self):
result = huffman([('A', 6), ('B', 7), ('C', 6), ('D', 7), ('E', 1000), ])
self.assertItemsEqual(result, [('A', '111'), ('C', '110'),... | 36.25 | 107 | 0.597241 |
656977bf7e27becb3dd7271d27eb54c4669e6e4f | 1,949 | py | Python | python/game/chapter_8/maze.py | daite/funfun | 4fc04431852b10a5abd6f411c5f627b468e70833 | [
"MIT"
] | null | null | null | python/game/chapter_8/maze.py | daite/funfun | 4fc04431852b10a5abd6f411c5f627b468e70833 | [
"MIT"
] | null | null | null | python/game/chapter_8/maze.py | daite/funfun | 4fc04431852b10a5abd6f411c5f627b468e70833 | [
"MIT"
] | null | null | null | import tkinter
import tkinter.messagebox
key = ""
def key_press(e):
global key
key = e.keysym
def key_release(e):
global key
key = ""
mx = 1
my = 1
yuka = 0
def main_proc():
global mx, my, yuka
if key == "Shift_L" and yuka > 1:
canvas.delete("PAINT")
mx = 1
my = 1
... | 24.987179 | 79 | 0.490508 |
23ac86274a06d3d51094f851f3449a7e7b9e0146 | 3,229 | py | Python | gym_envs/srl_env.py | PierreExeter/custom_gym_envs | 2b6a1c16a4198c8d9fa64f10fe09a041826ac81a | [
"MIT"
] | 1 | 2020-09-25T01:51:58.000Z | 2020-09-25T01:51:58.000Z | gym_envs/srl_env.py | PierreExeter/custom_gym_envs | 2b6a1c16a4198c8d9fa64f10fe09a041826ac81a | [
"MIT"
] | null | null | null | gym_envs/srl_env.py | PierreExeter/custom_gym_envs | 2b6a1c16a4198c8d9fa64f10fe09a041826ac81a | [
"MIT"
] | 1 | 2021-07-16T02:55:59.000Z | 2021-07-16T02:55:59.000Z | import gym
from gym.utils import seeding
class SRLGymEnv(gym.Env):
metadata = {
'render.modes': ['human', 'rgb_array'],
'video.frames_per_second': 50
}
def __init__(self, *, srl_model, relative_pos, env_rank, srl_pipe):
"""
Gym wrapper for SRL environments
:param ... | 31.048077 | 89 | 0.587179 |
f1a75e2e7992bab2c46c24636ff4a89fe93d79f8 | 15,701 | py | Python | indra/sources/tees/processor.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 136 | 2016-02-11T22:06:37.000Z | 2022-03-31T17:26:20.000Z | indra/sources/tees/processor.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 748 | 2016-02-03T16:27:56.000Z | 2022-03-09T14:27:54.000Z | indra/sources/tees/processor.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 56 | 2015-08-28T14:03:44.000Z | 2022-02-04T06:15:55.000Z | # -*- coding: utf-8 -*-
"""
This module takes the TEES parse graph generated by parse_tees and converts it
into INDRA statements.
See publication:
Jari Björne, Sofie Van Landeghem, Sampo Pyysalo, Tomoko Ohta, Filip Ginter,
Yves Van de Peer, Sofia Ananiadou and Tapio Salakoski, PubMed-Scale Event
Extraction for Post-Tr... | 38.577396 | 81 | 0.605312 |
6251b124f31954c00f00ce13dd262a3749fd9f55 | 3,074 | py | Python | pyuhooair/objects.py | mcclown/pyuhooair | 4e054a179f6895a9a73d6fb729fa6858aaccd139 | [
"Apache-2.0"
] | null | null | null | pyuhooair/objects.py | mcclown/pyuhooair | 4e054a179f6895a9a73d6fb729fa6858aaccd139 | [
"Apache-2.0"
] | null | null | null | pyuhooair/objects.py | mcclown/pyuhooair | 4e054a179f6895a9a73d6fb729fa6858aaccd139 | [
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python3
# coding=utf-8
# author: @netmanchris
# -*- coding: utf-8 -*-
from pyuhooair.auth import *
from pyuhooair.data import get_current_data, get_all_devices
import datetime
class UhooDev:
def __init__(self, device_name: str, auth: UhooAuth, cache_time: float = 15):
"""
Initiali... | 40.447368 | 125 | 0.638256 |
6db54c70f63731bc2a45c340fc68638334231543 | 12,318 | py | Python | src/analyses/reconstruction/decoder.py | kevinbdsouza/Hi-C-LSTM | c8e5d23b7e69878b8b5d7c537a3f33b3cdf9907d | [
"MIT"
] | null | null | null | src/analyses/reconstruction/decoder.py | kevinbdsouza/Hi-C-LSTM | c8e5d23b7e69878b8b5d7c537a3f33b3cdf9907d | [
"MIT"
] | null | null | null | src/analyses/reconstruction/decoder.py | kevinbdsouza/Hi-C-LSTM | c8e5d23b7e69878b8b5d7c537a3f33b3cdf9907d | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch.autograd import Variable
import training.ln_lstm as lstm
import numpy as np
from tqdm import tqdm
import pandas as pd
from torch.nn.utils.clip_grad import clip_grad_norm_
class Decoder(nn.Module):
"""
Class includes Decoders to be used with representations.
Inc... | 45.286765 | 122 | 0.569898 |
dfe1820edb3777595a261e002f48e5eb60a0d25a | 8,269 | py | Python | python/dazl/damlast/types.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/damlast/types.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/damlast/types.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from typing import TYPE_CHECKING, Callable, Optional, no_type_check
import warnings
from ..util.typing import safe_cast
from ._base import T
from .daml_lf_1 import PrimType, Typ... | 29.014035 | 102 | 0.68388 |
ba8aadb27bd65f4f7fa3d627b22fb4ce9d89ca48 | 1,368 | py | Python | python/pgq/ticker.py | askotm/skytools-dev | ae76eabcf9dfafa534575c8f0551a0dca81388bd | [
"0BSD"
] | 1 | 2016-05-09T13:35:53.000Z | 2016-05-09T13:35:53.000Z | python/pgq/ticker.py | askoja/skytools-dev | 3268ee069e8230d299488feec774ad619fe8610d | [
"0BSD"
] | null | null | null | python/pgq/ticker.py | askoja/skytools-dev | 3268ee069e8230d299488feec774ad619fe8610d | [
"0BSD"
] | null | null | null | """PgQ ticker.
It will also launch maintenance job.
"""
import sys, os, time, threading
import skytools
from maint import MaintenanceJob
__all__ = ['SmallTicker']
class SmallTicker(skytools.DBScript):
"""Ticker that periodically calls pgq.ticker()."""
tick_count = 0
maint_thread = None
def __init_... | 25.811321 | 74 | 0.614766 |
9880e474914789ee9b8b0e71975ee4cf80ba6ad0 | 700 | py | Python | ivy/functional/backends/mxnet/array_api/elementwise_functions.py | alierenak/ivy | 6e91bae159101abbac904a0dd37d0f59daaa75e3 | [
"Apache-2.0"
] | null | null | null | ivy/functional/backends/mxnet/array_api/elementwise_functions.py | alierenak/ivy | 6e91bae159101abbac904a0dd37d0f59daaa75e3 | [
"Apache-2.0"
] | null | null | null | ivy/functional/backends/mxnet/array_api/elementwise_functions.py | alierenak/ivy | 6e91bae159101abbac904a0dd37d0f59daaa75e3 | [
"Apache-2.0"
] | null | null | null | # global
import mxnet as mx
# local
from ivy.functional.backends.mxnet import _handle_flat_arrays_in_out
def bitwise_and(x1: mx.ndarray.ndarray.NDArray, x2: mx.ndarray.ndarray.NDArray) -> mx.nd.ndarray.NDArray:
return mx.numpy.bitwise_and(x1, x2)
@_handle_flat_arrays_in_out
def isfinite(x: mx.ndarray.ndarray.N... | 30.434783 | 112 | 0.752857 |
4e6018f8eb2c2d225fb264439a79e8c255e8209e | 982 | py | Python | server/controller/routes.py | zenyui/celery-flask-factory | 4462e9fd5ee82aa8908a6cb4ada66dfbf39c9c1f | [
"MIT"
] | 37 | 2018-02-17T23:10:05.000Z | 2022-02-25T06:39:00.000Z | server/controller/routes.py | zenyui/celery-flask-factory | 4462e9fd5ee82aa8908a6cb4ada66dfbf39c9c1f | [
"MIT"
] | 2 | 2019-01-24T20:21:15.000Z | 2020-08-18T10:37:27.000Z | server/controller/routes.py | zenyui/celery-flask-factory | 4462e9fd5ee82aa8908a6cb4ada66dfbf39c9c1f | [
"MIT"
] | 8 | 2019-02-23T20:48:38.000Z | 2021-11-30T16:29:51.000Z | import logging
from flask import Flask, jsonify, Blueprint
from server.controller import tasks
bp = Blueprint('tasks', __name__)
logger = logging.getLogger()
@bp.route('/')
def view_base():
return jsonify({'status': 'success'})
@bp.route('/sleep/', methods=['POST'])
@bp.route('/sleep/<int:sleep_time>', methods=[... | 27.277778 | 72 | 0.652749 |
4411799bf12dde1887715cf8f1f1a11ad488707f | 1,101 | py | Python | embarkTools/utils.py | embarkchina/embarkTools | 6d02ac51ccacde6bbad2f2b36af3a4d78f1be734 | [
"BSD-2-Clause"
] | 3 | 2019-04-09T02:37:18.000Z | 2021-11-17T10:28:09.000Z | embarkTools/utils.py | embarkchina/embarkTools | 6d02ac51ccacde6bbad2f2b36af3a4d78f1be734 | [
"BSD-2-Clause"
] | 2 | 2019-04-09T02:41:11.000Z | 2019-05-09T09:12:39.000Z | embarkTools/utils.py | embarkchina/embarkTools | 6d02ac51ccacde6bbad2f2b36af3a4d78f1be734 | [
"BSD-2-Clause"
] | 2 | 2019-04-08T09:30:22.000Z | 2020-08-24T07:56:42.000Z | import os
from jupyter_core.paths import (
jupyter_config_dir,
jupyter_config_path
)
from ipython_genutils import py3compat
from traitlets.config.application import Application
from traitlets.config.loader import Config
from sqlalchemy import create_engine
__all__ = [
'rela2abs',
'get_engine',
'c... | 23.934783 | 85 | 0.73297 |
191024458c4bfd14d84ace90c28810f813ad62af | 1,791 | py | Python | skp_edu_docker/code/api/views/workflow_netconf_predefined.py | TensorMSA/hoyai_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 8 | 2017-06-16T00:19:12.000Z | 2020-08-13T03:15:57.000Z | skp_edu_docker/code/api/views/workflow_netconf_predefined.py | TensorMSA/tensormsa_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 21 | 2017-06-09T10:15:14.000Z | 2018-03-29T07:51:02.000Z | skp_edu_docker/code/api/views/workflow_netconf_predefined.py | TensorMSA/hoyai_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 4 | 2017-10-25T09:59:53.000Z | 2020-05-07T09:51:11.000Z | import json
from rest_framework.response import Response
from rest_framework.views import APIView
import coreapi
class WorkFlowNetConfPredefined(APIView) :
# TODO:add document sample for swagger (need to update)
coreapi_fields = (
coreapi.Field(
name='parm1',
required=True,
... | 28.428571 | 61 | 0.524846 |
173fbb57e7b4bdcfdb8419b912e92250b3687461 | 431 | py | Python | mysite/myapp/migrations/0005_user_name.py | MirjahonMirsaidov/habit-tracker | 8bb60bceac9c6405b5f75db461668d8ca9e2beb7 | [
"MIT"
] | 1 | 2021-05-03T12:44:19.000Z | 2021-05-03T12:44:19.000Z | mysite/myapp/migrations/0005_user_name.py | MirjahonMirsaidov/recipe-app | 8bb60bceac9c6405b5f75db461668d8ca9e2beb7 | [
"MIT"
] | null | null | null | mysite/myapp/migrations/0005_user_name.py | MirjahonMirsaidov/recipe-app | 8bb60bceac9c6405b5f75db461668d8ca9e2beb7 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-01-26 16:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myapp', '0004_auto_20210126_2051'),
]
operations = [
migrations.AddField(
model_name='user',
name='name',
... | 21.55 | 67 | 0.593968 |
20a791feba0c6df4216bf33600b9f66dcfd20b42 | 2,998 | py | Python | run.py | tigju/Amazon-Deforestation-Prediction-App | c219e169d42de2d599cff7dff012332d6bb4407d | [
"MIT"
] | 1 | 2021-12-09T19:39:13.000Z | 2021-12-09T19:39:13.000Z | run.py | tigju/Amazon-Deforestation-Prediction-App | c219e169d42de2d599cff7dff012332d6bb4407d | [
"MIT"
] | null | null | null | run.py | tigju/Amazon-Deforestation-Prediction-App | c219e169d42de2d599cff7dff012332d6bb4407d | [
"MIT"
] | 1 | 2020-08-17T14:36:57.000Z | 2020-08-17T14:36:57.000Z | # Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Imports from this application
from app import app, server
from pages import index, predictions, insights, process
... | 37.475 | 144 | 0.650767 |
971e6c19c3361aeed4c69dea077183e474560d1b | 4,421 | py | Python | cscs-checks/prgenv/mpi.py | CLIP-HPC/reframe | eddf0b2508c2ba644e4c3aba5652e57fddfde106 | [
"BSD-3-Clause"
] | 167 | 2017-11-14T20:37:28.000Z | 2022-03-31T11:19:18.000Z | cscs-checks/prgenv/mpi.py | CLIP-HPC/reframe | eddf0b2508c2ba644e4c3aba5652e57fddfde106 | [
"BSD-3-Clause"
] | 2,190 | 2017-06-14T12:48:13.000Z | 2022-03-31T16:09:51.000Z | cscs-checks/prgenv/mpi.py | victorusu/reframe | e98078a990e31a47604b06d674e4ee730c22cd44 | [
"BSD-3-Clause"
] | 83 | 2017-05-29T19:12:16.000Z | 2022-03-18T09:49:21.000Z | # Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import os
import reframe as rfm
import reframe.utility.sanity as sn
@rfm.simple_test
class MpiInitTest(rfm.RegressionTest):... | 38.112069 | 78 | 0.584936 |
156d69587d5a4b8ee3a28c37b3951bfbe9d23e4d | 1,650 | py | Python | tycho/__init__.py | SamHDev/tycho-py | cd6f8082c2d261bac96d1b5d4ff5b5ed251658b2 | [
"MIT"
] | 2 | 2021-02-07T19:46:08.000Z | 2021-05-14T14:54:45.000Z | tycho/__init__.py | SamHDev/tycho-py | cd6f8082c2d261bac96d1b5d4ff5b5ed251658b2 | [
"MIT"
] | null | null | null | tycho/__init__.py | SamHDev/tycho-py | cd6f8082c2d261bac96d1b5d4ff5b5ed251658b2 | [
"MIT"
] | null | null | null | from .elements import Unit, Option, Array, Structure, Variant, Map, List, Element
from .values import Boolean, Unsigned8, Unsigned16, Unsigned32, Unsigned64, Unsigned128, Signed8, Signed16, Signed32, \
Signed64, Signed128, Char, String, Bytes, Value
from . import length
from . import ser as __ser__
from . import d... | 23.571429 | 119 | 0.651515 |
46c3315a812d0a55749798ca541027e6b9716a03 | 9,674 | py | Python | fastai2/text/learner.py | ducha-aiki/fastai2 | 744981faa4340af7a9476f6cff70b6e9caaab23a | [
"Apache-2.0"
] | null | null | null | fastai2/text/learner.py | ducha-aiki/fastai2 | 744981faa4340af7a9476f6cff70b6e9caaab23a | [
"Apache-2.0"
] | null | null | null | fastai2/text/learner.py | ducha-aiki/fastai2 | 744981faa4340af7a9476f6cff70b6e9caaab23a | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/37_text.learner.ipynb (unless otherwise specified).
__all__ = ['match_embeds', 'load_ignore_keys', 'TextLearner', 'decode_spec_tokens', 'LMLearner',
'language_model_learner', 'text_classifier_learner']
# Cell
from ..basics import *
from .core import *
from .d... | 44.995349 | 123 | 0.643167 |
28fcb675b68db74cd2a36719ba5b7a4af3738eb3 | 3,383 | py | Python | lib/fbuild/inspect.py | felix-lang/fbuild | 9595fbfd6d3ceece31fda2f96c35d4a241f0129b | [
"PSF-2.0",
"BSD-2-Clause"
] | 40 | 2015-02-07T00:44:12.000Z | 2021-04-02T13:41:08.000Z | lib/fbuild/inspect.py | dmerejkowsky/fbuild | be0bf901eed1f66c33897fbd4b147e0433e8cc72 | [
"BSD-2-Clause"
] | 30 | 2015-02-06T17:45:15.000Z | 2019-01-10T16:34:29.000Z | lib/fbuild/inspect.py | dmerejkowsky/fbuild | be0bf901eed1f66c33897fbd4b147e0433e8cc72 | [
"BSD-2-Clause"
] | 3 | 2015-09-03T06:38:02.000Z | 2019-10-24T14:26:57.000Z | from inspect import *
import linecache
def findsource(object):
"""Return the entire source file and starting line number for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a list of all the lines
in the file and the l... | 38.885057 | 76 | 0.633166 |
13f81000e240d37120ba53ee6d0c2b410307837c | 1,422 | py | Python | tests/test_enjoy.py | alessandropadrinofficial/rl-baseline-zoo | 1e13a57379dbfeee606a3974988fde691676c032 | [
"MIT"
] | 1 | 2020-02-18T00:49:41.000Z | 2020-02-18T00:49:41.000Z | tests/test_enjoy.py | alessandropadrinofficial/rl-baseline-zoo | 1e13a57379dbfeee606a3974988fde691676c032 | [
"MIT"
] | null | null | null | tests/test_enjoy.py | alessandropadrinofficial/rl-baseline-zoo | 1e13a57379dbfeee606a3974988fde691676c032 | [
"MIT"
] | null | null | null | import os
import subprocess
import pytest
from utils import get_trained_models
def _assert_eq(left, right):
assert left == right, '{} != {}'.format(left, right)
FOLDER = 'trained_agents/'
N_STEPS = 100
trained_models = get_trained_models(FOLDER)
@pytest.mark.parametrize("trained_model", tra... | 24.947368 | 90 | 0.592827 |
55ebc464493cfdbac6dd2c4ec6504b55e5cf24a5 | 382 | py | Python | lino_book/projects/roger/settings/demo.py | khchine5/book | b6272d33d49d12335d25cf0a2660f7996680b1d1 | [
"BSD-2-Clause"
] | 1 | 2018-01-12T14:09:58.000Z | 2018-01-12T14:09:58.000Z | lino_book/projects/roger/settings/demo.py | khchine5/book | b6272d33d49d12335d25cf0a2660f7996680b1d1 | [
"BSD-2-Clause"
] | 4 | 2018-02-06T19:53:10.000Z | 2019-08-01T21:47:44.000Z | lino_book/projects/roger/settings/demo.py | khchine5/book | b6272d33d49d12335d25cf0a2660f7996680b1d1 | [
"BSD-2-Clause"
] | null | null | null | import datetime
from ..settings import *
class Site(Site):
is_demo_site = True
the_demo_date = datetime.date(2015, 5, 22)
# ignore_dates_after = datetime.date(2019, 05, 22)
use_java = False
# use_ipdict = True
SITE = Site(globals())
DEBUG = True
# the following line should not be active in a c... | 20.105263 | 65 | 0.680628 |
65d51aeb940523d538a2f9434a7b82b4e208a364 | 88,966 | py | Python | src/ditagen/pdf_generator.py | jelovirt/dita-generator | 9687f4438c7df5f1765a568c67275df870d2c979 | [
"Apache-2.0"
] | 8 | 2015-03-12T13:49:12.000Z | 2021-12-22T01:39:22.000Z | src/ditagen/pdf_generator.py | jelovirt/dita-generator | 9687f4438c7df5f1765a568c67275df870d2c979 | [
"Apache-2.0"
] | 17 | 2015-01-16T12:27:44.000Z | 2021-09-15T08:32:17.000Z | src/ditagen/pdf_generator.py | jelovirt/dita-generator | 9687f4438c7df5f1765a568c67275df870d2c979 | [
"Apache-2.0"
] | 1 | 2021-12-22T01:39:25.000Z | 2021-12-22T01:39:25.000Z | # -*- coding: UTF-8; indent-tabs-mode:nil; tab-width:4 -*-
# This file is part of DITA DTD Generator.
#
# Copyright 2009 Jarno Elovirta <http://www.elovirta.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 co... | 53.20933 | 4,738 | 0.572758 |
3940abb33b039e415b27bb60ed06f29337d862fc | 3,564 | py | Python | pyScripts/doSpeedupGraph.py | Sly93/MCMC_Colorer | 78051330cb0c6b926eb858a18469174217ed4bf9 | [
"Apache-2.0"
] | null | null | null | pyScripts/doSpeedupGraph.py | Sly93/MCMC_Colorer | 78051330cb0c6b926eb858a18469174217ed4bf9 | [
"Apache-2.0"
] | null | null | null | pyScripts/doSpeedupGraph.py | Sly93/MCMC_Colorer | 78051330cb0c6b926eb858a18469174217ed4bf9 | [
"Apache-2.0"
] | 2 | 2020-03-17T06:40:16.000Z | 2020-05-28T17:07:08.000Z | import json
import sys
from math import ceil
import matplotlib.pyplot as plt
import numpy as np
# Draws execution time and speed-up index graphs
# Feed me a json file in the 'Old' format (fixed density)
def drawTime( avgTime, prob ):
x = []
yLuby = []
yMCPU = []
yMGPU = []
yMCPUiter = []
yMGPUiter = []
yLubyit... | 29.213115 | 92 | 0.651796 |
56aa9c036064c83f5518431f0a3da29f68f4a9ec | 3,624 | py | Python | net/attentions.py | MoritzSchueler96/TUM_ADLCV_Deep_Metric_Learning | 365d1609de044ba8498d3add808274f6f2d02d2b | [
"MIT"
] | null | null | null | net/attentions.py | MoritzSchueler96/TUM_ADLCV_Deep_Metric_Learning | 365d1609de044ba8498d3add808274f6f2d02d2b | [
"MIT"
] | null | null | null | net/attentions.py | MoritzSchueler96/TUM_ADLCV_Deep_Metric_Learning | 365d1609de044ba8498d3add808274f6f2d02d2b | [
"MIT"
] | null | null | null | from logging import raiseExceptions
from os import defpath
from torch.cuda.memory import caching_allocator_alloc
from torch_scatter.scatter import scatter_mean
from .utils import *
from torch import nn
import torch
import math
from einops import rearrange, reduce
class MultiHeadDotProduct(nn.Module):
"""
Mu... | 31.789474 | 117 | 0.593819 |
b320f24f49b2c20738ec2b3b9250697d4da80179 | 752 | py | Python | API/GCP_api/image/test_use.py | JimouChen/python-application | b7b16506a17e2c304d1c5fabd6385e96be211c56 | [
"Apache-2.0"
] | 1 | 2020-08-09T12:47:27.000Z | 2020-08-09T12:47:27.000Z | API/GCP_api/image/test_use.py | JimouChen/Python_Application | b7b16506a17e2c304d1c5fabd6385e96be211c56 | [
"Apache-2.0"
] | null | null | null | API/GCP_api/image/test_use.py | JimouChen/Python_Application | b7b16506a17e2c304d1c5fabd6385e96be211c56 | [
"Apache-2.0"
] | null | null | null | """
# @Time : 2020/8/11
# @Author : Jimou Chen
"""
import io
import os
# Imports the Google Cloud client library
from google.cloud import vision
from google.cloud.vision import types
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "D:/App/API/wellnet.json"
# Instantiates a client
client = vision.ImageAnnotatorCl... | 24.258065 | 72 | 0.75 |
92d11f255c1effd4b21e00929352545aa1f26499 | 1,243 | py | Python | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/patterns/behavioral/strategy.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/patterns/behavioral/strategy.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/patterns/behavioral/strategy.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | """
*What is this pattern about?
Define a family of algorithms, encapsulate each one, and make them interchangeable.
Strategy lets the algorithm vary independently from clients that use it.
*TL;DR
Enables selecting an algorithm at runtime.
"""
class Order:
def __init__(self, price, discount_strategy=None):
... | 23.45283 | 83 | 0.668544 |
c7b3cdd1f1cb28b7fcb72f8f84da91a70ef97b8c | 2,995 | py | Python | lldb/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py | dan-zheng/llvm-project | 6b792850da0345274758c9260fda5df5e57ab486 | [
"Apache-2.0"
] | 765 | 2015-12-03T16:44:59.000Z | 2022-03-07T12:41:10.000Z | lldb/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py | dan-zheng/llvm-project | 6b792850da0345274758c9260fda5df5e57ab486 | [
"Apache-2.0"
] | 1,815 | 2015-12-11T23:56:05.000Z | 2020-01-10T19:28:43.000Z | lldb/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py | dan-zheng/llvm-project | 6b792850da0345274758c9260fda5df5e57ab486 | [
"Apache-2.0"
] | 284 | 2015-12-03T16:47:25.000Z | 2022-03-12T05:39:48.000Z | """Test SBValue::Persist"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class SBValuePersistTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(['pyapi'])
... | 36.084337 | 85 | 0.625042 |
df779c4395262e26741c9671def40e2751ef714d | 6,709 | py | Python | logger/visualization.py | shengliu66/SOP | 6e25e3c9a0363813d6f5384b2b9db1358bc10ef2 | [
"MIT"
] | 5 | 2022-03-03T11:59:36.000Z | 2022-03-23T07:48:14.000Z | logger/visualization.py | shengliu66/SOP | 6e25e3c9a0363813d6f5384b2b9db1358bc10ef2 | [
"MIT"
] | 1 | 2022-03-03T12:39:31.000Z | 2022-03-03T12:39:31.000Z | logger/visualization.py | shengliu66/SOP | 6e25e3c9a0363813d6f5384b2b9db1358bc10ef2 | [
"MIT"
] | null | null | null | import importlib
try:
from comet_ml import Experiment as CometExperiment
from comet_ml import OfflineExperiment as CometOfflineExperiment
except ImportError: # pragma: no-cover
_COMET_AVAILABLE = False
else:
_COMET_AVAILABLE = True
from utils import Timer
import torch
from torch import is_tensor
from ... | 35.310526 | 138 | 0.57013 |
d3bc10602364ceac9e509f3355ff4e3c5b7d6e6d | 3,569 | py | Python | bindings/python/ensmallen/datasets/string/desulfurisporathermophila.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/desulfurisporathermophila.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/desulfurisporathermophila.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Desulfurispora thermophila.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--pro... | 33.046296 | 223 | 0.679462 |
1ed0af51b656495eaf8eff24a0a540c6855bd6c5 | 3,706 | py | Python | services/core-api/app/api/mines/tailings/resources/tailings.py | bcgov/mds | 6c427a66a5edb4196222607291adef8fd6677038 | [
"Apache-2.0"
] | 25 | 2018-07-09T19:04:37.000Z | 2022-03-15T17:27:10.000Z | services/core-api/app/api/mines/tailings/resources/tailings.py | bcgov/mds | 6c427a66a5edb4196222607291adef8fd6677038 | [
"Apache-2.0"
] | 983 | 2018-04-25T20:08:07.000Z | 2022-03-31T21:45:20.000Z | services/core-api/app/api/mines/tailings/resources/tailings.py | bcgov/mds | 6c427a66a5edb4196222607291adef8fd6677038 | [
"Apache-2.0"
] | 58 | 2018-05-15T22:35:50.000Z | 2021-11-29T19:40:52.000Z | from decimal import Decimal
from datetime import datetime, timezone
from flask_restplus import Resource, reqparse
from werkzeug.exceptions import NotFound
from app.extensions import api, db
from app.api.utils.access_decorators import requires_role_mine_edit
from app.api.utils.resources_mixins import UserMixin
from ap... | 37.816327 | 110 | 0.672693 |
fdebac4f3f1777eac39bdeffbdb02497fea048e7 | 1,740 | py | Python | code/run_rb.py | glederrey/ratebeer_crawler | 7f46616e8314204b190021eb4f15b6a97cba3fd5 | [
"MIT"
] | 1 | 2020-10-11T11:10:18.000Z | 2020-10-11T11:10:18.000Z | code/run_rb.py | glederrey/ratebeer_crawler | 7f46616e8314204b190021eb4f15b6a97cba3fd5 | [
"MIT"
] | null | null | null | code/run_rb.py | glederrey/ratebeer_crawler | 7f46616e8314204b190021eb4f15b6a97cba3fd5 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
#
# Copyright © 2017 Gael Lederrey <gael.lederrey@epfl.ch>
#
# Distributed under terms of the MIT license.
from classes.crawler import *
from classes.parser import *
import time
import datetime
import os
def run():
# Create directory for the data
data_folder = '../data/... | 24.857143 | 74 | 0.682184 |
7b2b858942f01fc0784d30a24c4d9dd69810f6b0 | 528 | py | Python | fast-rcnn/experiments/scripts/parseTime.py | litingfeng/FasterSubCNN | 29b1c441e71867caf18e1c075c488bbb86d66e2f | [
"MIT"
] | null | null | null | fast-rcnn/experiments/scripts/parseTime.py | litingfeng/FasterSubCNN | 29b1c441e71867caf18e1c075c488bbb86d66e2f | [
"MIT"
] | null | null | null | fast-rcnn/experiments/scripts/parseTime.py | litingfeng/FasterSubCNN | 29b1c441e71867caf18e1c075c488bbb86d66e2f | [
"MIT"
] | null | null | null | import numpy as np
filename = "/home/amax/DeepLearning/SubCNN1/fast-rcnn/experiments/logs/kitti_val_caffenet_rpn_num20000.txt.2016-11-20_13-52-50"
totaltime = 0.0
num = 0.0
with open(filename) as f:
for line in f.readlines()[799:(799+3799*2):2]:
words = line.split()
totaltime = totaltime+float(wo... | 26.4 | 127 | 0.653409 |
5c715c9e39d613bb74e186e3b85cd883f5c81457 | 4,612 | py | Python | backend/glamourhaven/migrations/0004_c2bpayment_lnmonline_client_profile_picture_and_more.py | njeveh/GlamourHaven | 5cc72f4ad430df96667f1ca7141b1e2481ad3c97 | [
"MIT"
] | 3 | 2022-02-05T22:52:02.000Z | 2022-02-08T08:40:12.000Z | backend/glamourhaven/migrations/0004_c2bpayment_lnmonline_client_profile_picture_and_more.py | njeveh/GlamourHaven | 5cc72f4ad430df96667f1ca7141b1e2481ad3c97 | [
"MIT"
] | 23 | 2022-02-19T00:03:45.000Z | 2022-03-04T10:11:32.000Z | backend/glamourhaven/migrations/0004_c2bpayment_lnmonline_client_profile_picture_and_more.py | njeveh/GlamourHaven | 5cc72f4ad430df96667f1ca7141b1e2481ad3c97 | [
"MIT"
] | 6 | 2022-01-27T10:08:46.000Z | 2022-03-02T17:52:08.000Z | # Generated by Django 4.0.2 on 2022-02-24 10:34
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('glamourhaven', '0003_employee_profile_picture'),
]
operations = [
migrations.CreateModel(
... | 51.820225 | 133 | 0.607112 |
fa965bd08220a5eebb1adc940e157a6b292b0f87 | 3,212 | py | Python | web-api/src/permission/model.py | Dambola/LeWi | 5c31219b3c146fe4bd57675bb53ed7eb8220be74 | [
"MIT"
] | null | null | null | web-api/src/permission/model.py | Dambola/LeWi | 5c31219b3c146fe4bd57675bb53ed7eb8220be74 | [
"MIT"
] | null | null | null | web-api/src/permission/model.py | Dambola/LeWi | 5c31219b3c146fe4bd57675bb53ed7eb8220be74 | [
"MIT"
] | null | null | null | from src.db import database
from src.permission.api import PERMISSIONS
from src.utils.api import SingletonMeta
from sqlalchemy.exc import IntegrityError
class PermissionManager(metaclass=SingletonMeta):
"""This class is a Singleton that manager the permissions.
"""
class __Permission(database.Model):... | 30.590476 | 77 | 0.590909 |
704e8f27d3a303a6f28d36488af7befb6ec20cdf | 9,617 | py | Python | aacharts/aaoptionsmodel/AAPlotOptions.py | AAChartModel/AACharts-PyQt | 7c1e4aea4a37c77f82d30507c320a38a76d8dbce | [
"MIT"
] | null | null | null | aacharts/aaoptionsmodel/AAPlotOptions.py | AAChartModel/AACharts-PyQt | 7c1e4aea4a37c77f82d30507c320a38a76d8dbce | [
"MIT"
] | null | null | null | aacharts/aaoptionsmodel/AAPlotOptions.py | AAChartModel/AACharts-PyQt | 7c1e4aea4a37c77f82d30507c320a38a76d8dbce | [
"MIT"
] | null | null | null |
from typing import List
from aacharts.aaenum.AAEnum import AAChartType, AAChartStackingType
from aacharts.aaoptionsmodel.AADataLabels import AADataLabels
from aacharts.aaoptionsmodel.AASeries import AASeries
class AAColumn:
name: str
data: List
color: str
grouping: bool#Whether to group non-stac... | 25.24147 | 189 | 0.609338 |
561f5f7a50e0207ab64fd06211e94e406208e894 | 5,756 | py | Python | tensorflow/lite/experimental/microfrontend/python/kernel_tests/audio_microfrontend_op_test.py | aeverall/tensorflow | 7992bf97711919f56f80bff9e5510cead4ab2095 | [
"Apache-2.0"
] | 5 | 2018-07-04T22:14:02.000Z | 2018-07-04T22:21:43.000Z | tensorflow/lite/experimental/microfrontend/python/kernel_tests/audio_microfrontend_op_test.py | aeverall/tensorflow | 7992bf97711919f56f80bff9e5510cead4ab2095 | [
"Apache-2.0"
] | null | null | null | tensorflow/lite/experimental/microfrontend/python/kernel_tests/audio_microfrontend_op_test.py | aeverall/tensorflow | 7992bf97711919f56f80bff9e5510cead4ab2095 | [
"Apache-2.0"
] | 2 | 2019-02-26T16:21:15.000Z | 2020-12-04T17:48:17.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.312883 | 103 | 0.618138 |
8052651efa7b36abe92797036ff498d5a2bc17f8 | 22,899 | py | Python | tensorflow/python/keras/legacy_tf_layers/base.py | nicolas-harraudeau-sonarsource/tensorflow | f42f57b814b82a217943f621967036a08bb95e88 | [
"Apache-2.0"
] | 27 | 2019-01-02T09:36:57.000Z | 2022-02-21T06:41:51.000Z | tensorflow/python/keras/legacy_tf_layers/base.py | whoozle/tensorflow | a2725aa0153d52260f602c6604756840629d1569 | [
"Apache-2.0"
] | 3 | 2019-01-23T11:01:22.000Z | 2022-02-24T02:53:31.000Z | tensorflow/python/keras/legacy_tf_layers/base.py | whoozle/tensorflow | a2725aa0153d52260f602c6604756840629d1569 | [
"Apache-2.0"
] | 11 | 2019-03-02T12:42:23.000Z | 2021-02-04T12:20:10.000Z | # Copyright 2015 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... | 38.485714 | 80 | 0.685401 |
d51d4d0cf6be65865f43fa99ad1819873b0da7ab | 12,599 | py | Python | vcf/__init__.py | phenopolis/phenopolis | 4750858f68b99dc1d60f24cd7f1c27a1b6aa12ca | [
"MIT"
] | 24 | 2017-03-22T12:05:39.000Z | 2021-01-02T19:27:36.000Z | vcf/__init__.py | phenopolis/phenopolis | 4750858f68b99dc1d60f24cd7f1c27a1b6aa12ca | [
"MIT"
] | 89 | 2017-02-19T17:54:48.000Z | 2022-01-24T11:14:55.000Z | vcf/__init__.py | phenopolis/phenopolis | 4750858f68b99dc1d60f24cd7f1c27a1b6aa12ca | [
"MIT"
] | 3 | 2017-03-13T13:23:12.000Z | 2019-12-13T21:44:09.000Z |
from config import config
if config.IMPORT_PYSAM_PRIMER3:
import pysam
# VCF query
def vcf_query(chrom=None, pos=None, ref=None, alt=None, variant_str=None, individual=None, verbose=False, limit=100, release='mainset_July2016'):
if variant_str:
variant_str=str(variant_str).strip().replace('_','-')
... | 58.059908 | 169 | 0.593539 |
2a42e5543239b5331fa12d732f50c192dcbe1470 | 8,758 | py | Python | tensorflow/contrib/distributions/python/ops/inverse_gamma.py | topsun888/tensorflow | bad7c50b9dc9789ad7dd0a62daca40b7269841ed | [
"Apache-2.0"
] | 2 | 2019-07-05T15:17:01.000Z | 2020-04-16T07:25:56.000Z | tensorflow/contrib/distributions/python/ops/inverse_gamma.py | topsun888/tensorflow | bad7c50b9dc9789ad7dd0a62daca40b7269841ed | [
"Apache-2.0"
] | 1 | 2021-04-12T03:51:59.000Z | 2021-04-12T03:51:59.000Z | tensorflow/contrib/distributions/python/ops/inverse_gamma.py | topsun888/tensorflow | bad7c50b9dc9789ad7dd0a62daca40b7269841ed | [
"Apache-2.0"
] | 5 | 2018-02-27T00:34:23.000Z | 2022-02-28T16:38:08.000Z | # Copyright 2016 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... | 37.268085 | 80 | 0.651747 |
2f8a6718df3fcbd8f24a08442096c37521493133 | 2,953 | py | Python | Examples/ImageRegistrationMethod3/ImageRegistrationMethod3.py | nathantspencer/SimpleElastix | a9641c1197e58a4ff614145e9ba5ca43c2833ebf | [
"Apache-2.0"
] | 350 | 2017-05-22T14:23:55.000Z | 2022-03-26T07:11:28.000Z | Examples/ImageRegistrationMethod3/ImageRegistrationMethod3.py | nathantspencer/SimpleElastix | a9641c1197e58a4ff614145e9ba5ca43c2833ebf | [
"Apache-2.0"
] | 382 | 2017-05-19T06:43:28.000Z | 2022-03-30T16:16:59.000Z | Examples/ImageRegistrationMethod3/ImageRegistrationMethod3.py | nathantspencer/SimpleElastix | a9641c1197e58a4ff614145e9ba5ca43c2833ebf | [
"Apache-2.0"
] | 121 | 2017-05-24T07:26:13.000Z | 2022-03-24T07:20:09.000Z | #!/usr/bin/env python
#=========================================================================
#
# Copyright NumFOCUS
#
# 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://... | 32.450549 | 104 | 0.653234 |
e01dafe6155fe8ecfdb70fb2028f0cbd40d47177 | 261 | py | Python | main.py | Maxime26s/6GEI311-Lab4 | 4d670df124108d0da30a5bc445c33f54c7074394 | [
"MIT"
] | null | null | null | main.py | Maxime26s/6GEI311-Lab4 | 4d670df124108d0da30a5bc445c33f54c7074394 | [
"MIT"
] | null | null | null | main.py | Maxime26s/6GEI311-Lab4 | 4d670df124108d0da30a5bc445c33f54c7074394 | [
"MIT"
] | null | null | null | from Server import Lab4HTTPRequestHandler
from socketserver import TCPServer
if __name__ == '__main__':
with TCPServer(('', 8081), Lab4HTTPRequestHandler) as tcp_server:
print('Serving on http://localhost:8081')
tcp_server.serve_forever()
| 29 | 69 | 0.735632 |
99b9c085d470ca29cdb3f1947d86a7b2ef104811 | 28,279 | py | Python | overload/connectors/goo_settings/sheet_templates.py | Mfgloger/overload | b34f88750d9272db268324807f7e8ba308940d1e | [
"MIT"
] | null | null | null | overload/connectors/goo_settings/sheet_templates.py | Mfgloger/overload | b34f88750d9272db268324807f7e8ba308940d1e | [
"MIT"
] | 58 | 2017-10-16T13:09:33.000Z | 2022-01-10T15:35:58.000Z | overload/connectors/goo_settings/sheet_templates.py | Mfgloger/overload | b34f88750d9272db268324807f7e8ba308940d1e | [
"MIT"
] | 2 | 2019-04-15T16:04:38.000Z | 2020-11-03T17:58:33.000Z | # Google Sheets templates encoded in request body
def nypl_pvf_dup_report_template(tab_id):
"""
args:
tab_id: string, id of Google Sheet tab
returns:
body: dictionary, encodes in requests body properties of the tab
"""
return {
"requests": [
{
"... | 34.912346 | 97 | 0.23742 |
cb2ae33ee4baf6d4f79bac07597b30eda85867e2 | 708 | py | Python | contrib/seeds/makeseeds.py | desicoin/desicoin | 7ccb95bb09407cfd298c74f79398705dcb0f1334 | [
"MIT"
] | 1 | 2021-12-03T05:34:37.000Z | 2021-12-03T05:34:37.000Z | contrib/seeds/makeseeds.py | resslerruntime/desicoin | 7ccb95bb09407cfd298c74f79398705dcb0f1334 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | resslerruntime/desicoin | 7ccb95bb09407cfd298c74f79398705dcb0f1334 | [
"MIT"
] | 1 | 2021-12-03T05:34:38.000Z | 2021-12-03T05:34:38.000Z | #!/usr/bin/env python
#
# Generate pnSeed[] from Pieter's DNS seeder
#
NSEEDS=600
import re
import sys
from subprocess import check_output
def main():
lines = sys.stdin.readlines()
ips = []
pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):5711")
for line in lines:
m = patte... | 21.454545 | 78 | 0.508475 |
eb0f8f3da0ddcc042ede52151cee6e40be29d0ce | 9,325 | py | Python | keras_cv_attention_models/visualizing.py | awsaf49/keras_cv_attention_models | 242aaf02fd46f68d57f710b9e805afe96e3067e5 | [
"MIT"
] | null | null | null | keras_cv_attention_models/visualizing.py | awsaf49/keras_cv_attention_models | 242aaf02fd46f68d57f710b9e805afe96e3067e5 | [
"MIT"
] | null | null | null | keras_cv_attention_models/visualizing.py | awsaf49/keras_cv_attention_models | 242aaf02fd46f68d57f710b9e805afe96e3067e5 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
def __compute_loss__(feature_extractor, input_image, filter_index):
activation = feature_extractor(input_image)
# We avoid border artifacts by only involving non-border pixels in the loss.
filter_activation = activation[:, 2:-2, 2:-2, filter_index]
return tf.r... | 45.048309 | 131 | 0.686971 |
1e5fd3a815a473c8db57a35cb059e3928a334fc2 | 1,768 | py | Python | tests/unit/gae/test_factory.py | MAhsanAkhtar/BDA_TERM_PROJECT | 68b0deb2b126f81924997b7d9f8c6c1ad53bbac0 | [
"MIT"
] | 29 | 2018-01-08T21:31:12.000Z | 2022-02-14T01:11:01.000Z | tests/unit/gae/test_factory.py | MAhsanAkhtar/BDA_TERM_PROJECT | 68b0deb2b126f81924997b7d9f8c6c1ad53bbac0 | [
"MIT"
] | null | null | null | tests/unit/gae/test_factory.py | MAhsanAkhtar/BDA_TERM_PROJECT | 68b0deb2b126f81924997b7d9f8c6c1ad53bbac0 | [
"MIT"
] | 9 | 2018-01-09T21:04:16.000Z | 2021-10-18T15:50:35.000Z | #MIT License
#
#Copyright (c) 2017 Willian Fuks
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publi... | 35.36 | 79 | 0.749434 |
076baac5d619ea992d5d05b363277dc61236566d | 1,166 | py | Python | tests/clustering_system/corpus/test_BowNewsCorpus.py | vanam/clustering | 6e3d3ce7e60e31519b81547bc4afdf6ef3b0079f | [
"MIT"
] | 5 | 2019-05-28T15:45:46.000Z | 2020-10-05T17:48:27.000Z | tests/clustering_system/corpus/test_BowNewsCorpus.py | vanam/clustering | 6e3d3ce7e60e31519b81547bc4afdf6ef3b0079f | [
"MIT"
] | null | null | null | tests/clustering_system/corpus/test_BowNewsCorpus.py | vanam/clustering | 6e3d3ce7e60e31519b81547bc4afdf6ef3b0079f | [
"MIT"
] | 2 | 2019-07-16T14:13:19.000Z | 2020-11-23T01:53:44.000Z | import os
from typing import List
import numpy as np
from gensim.corpora import Dictionary
from clustering_system.corpus.BowNewsCorpus import BowNewsCorpus
def bow2text(dictionary: Dictionary, bow: List):
return [dictionary[i] for i, _ in bow]
class TestBowNewsCorpus:
def test_create(self):
# Cur... | 27.761905 | 107 | 0.636364 |
d64c540d9d0f911066623c1b9d151244262d0f7c | 1,579 | py | Python | src/sha1.py | Krzem5/Python-Sha1 | daf7faef8f200f6b5626bd6b70a46bf36d07a67f | [
"BSD-3-Clause"
] | null | null | null | src/sha1.py | Krzem5/Python-Sha1 | daf7faef8f200f6b5626bd6b70a46bf36d07a67f | [
"BSD-3-Clause"
] | null | null | null | src/sha1.py | Krzem5/Python-Sha1 | daf7faef8f200f6b5626bd6b70a46bf36d07a67f | [
"BSD-3-Clause"
] | null | null | null | def _sha1_chunk(h,dt):
w=[]
for i in range(0,64,4):
w.append((dt[i]<<24)|(dt[i+1]<<16)|(dt[i+2]<<8)|dt[i+3])
for i in range(16,80):
v=w[i-3]^w[i-8]^w[i-14]^w[i-16]
w.append(((v<<1)|(v>>31))&0xffffffff)
a,b,c,d,e=h
for i in range(80):
if (i<20):
f=d^(b&c)^(b&d)
k=0x5a827999
elif (i<40):
f=b^c^d
... | 25.063492 | 184 | 0.562381 |
7ed469f8aafbe203d4f10d7347b0c4de7f02af2a | 4,120 | py | Python | huaweicloud-sdk-ims/huaweicloudsdkims/v2/model/add_or_update_tags_request_body.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-ims/huaweicloudsdkims/v2/model/add_or_update_tags_request_body.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-ims/huaweicloudsdkims/v2/model/add_or_update_tags_request_body.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class AddOrUpdateTagsRequestBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and t... | 25.432099 | 77 | 0.559223 |
a9ea63e38af248f5597dd917d9b9d6237a8826ac | 126 | py | Python | project/apps/core/views.py | iguanaus/FPG_Website_Backtest | d597dcd291344d7edf97c2db6fdc535d623d47fc | [
"Apache-2.0"
] | null | null | null | project/apps/core/views.py | iguanaus/FPG_Website_Backtest | d597dcd291344d7edf97c2db6fdc535d623d47fc | [
"Apache-2.0"
] | 1 | 2019-01-05T14:32:40.000Z | 2019-01-05T14:32:40.000Z | project/apps/core/views.py | iguanaus/FPG_Website_Backtest | d597dcd291344d7edf97c2db6fdc535d623d47fc | [
"Apache-2.0"
] | null | null | null | from django.http import JsonResponse
def api_404(request):
return JsonResponse({'detail': 'url not found'}, status=404)
| 21 | 64 | 0.738095 |
ee6bfb6669c0d9d570457b865ec713bb802afc13 | 5,686 | py | Python | data/base_dataset.py | roopeshmangeshkar/Revamp3 | 28392f0da3aa5eb9ae64db73d04b31be10ce6350 | [
"MIT"
] | 78 | 2021-06-18T19:22:37.000Z | 2022-03-29T10:33:53.000Z | data/base_dataset.py | roopeshmangeshkar/Revamp3 | 28392f0da3aa5eb9ae64db73d04b31be10ce6350 | [
"MIT"
] | 4 | 2021-09-28T11:11:30.000Z | 2022-03-16T08:41:14.000Z | data/base_dataset.py | roopeshmangeshkar/Revamp3 | 28392f0da3aa5eb9ae64db73d04b31be10ce6350 | [
"MIT"
] | 18 | 2021-06-22T12:21:02.000Z | 2022-03-28T03:18:43.000Z | import os
from PIL import Image
import cv2
import numpy as np
import random
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
class BaseDataset(data.Dataset):
def __init__(self):
super(BaseDataset, self).__init__()
def name(self):
return... | 29.926316 | 110 | 0.591804 |
84fa9adf475db8e2e6fdf1186a4f25e587766977 | 4,444 | py | Python | tests/cases/userChangePassword.py | ktphipps/Capstone-ARK | 335234f874eaab3f3f53ca6d3f122c2826a24e2e | [
"MIT"
] | null | null | null | tests/cases/userChangePassword.py | ktphipps/Capstone-ARK | 335234f874eaab3f3f53ca6d3f122c2826a24e2e | [
"MIT"
] | null | null | null | tests/cases/userChangePassword.py | ktphipps/Capstone-ARK | 335234f874eaab3f3f53ca6d3f122c2826a24e2e | [
"MIT"
] | null | null | null | import pyautogui;
import time;
import unittest
from selenium import webdriver
from selenium.common.exceptions import NoAlertPresentException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.support import expected_conditions as EC
# inherit Te... | 26.295858 | 84 | 0.694869 |
f61709e66cd15af8c1ff000a671aa04447233e15 | 5,095 | py | Python | st2reactor/tests/integration/test_rules_engine.py | meghasfdc/st2 | 7079635e94942e7b44ae74daa6a7378a00e518d9 | [
"Apache-2.0"
] | 1 | 2020-10-26T03:26:17.000Z | 2020-10-26T03:26:17.000Z | st2reactor/tests/integration/test_rules_engine.py | meghasfdc/st2 | 7079635e94942e7b44ae74daa6a7378a00e518d9 | [
"Apache-2.0"
] | null | null | null | st2reactor/tests/integration/test_rules_engine.py | meghasfdc/st2 | 7079635e94942e7b44ae74daa6a7378a00e518d9 | [
"Apache-2.0"
] | 1 | 2019-10-11T14:42:28.000Z | 2019-10-11T14:42:28.000Z | # Copyright 2019 Extreme Networks, 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 i... | 34.194631 | 99 | 0.615898 |
5526a14f530f0dda40441f96a05544ed8d94dd8a | 12,874 | py | Python | lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 34 | 2020-01-31T17:50:00.000Z | 2022-02-16T20:19:29.000Z | lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 14 | 2020-02-03T23:39:51.000Z | 2021-07-20T16:24:25.000Z | lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 7 | 2020-04-14T09:12:18.000Z | 2021-09-20T10:31:12.000Z | """
Test the printing of anonymous and named namespace variables.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class NamespaceLookupTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# ... | 40.869841 | 85 | 0.612863 |
95c545d768a5b57d24f07fa5b82eb2f5d1a535e8 | 434 | py | Python | houseowner/admin.py | agiledesign2/base-rent | 071c2122cea0501c75f4afd17ea1bbd944694f85 | [
"MIT"
] | null | null | null | houseowner/admin.py | agiledesign2/base-rent | 071c2122cea0501c75f4afd17ea1bbd944694f85 | [
"MIT"
] | null | null | null | houseowner/admin.py | agiledesign2/base-rent | 071c2122cea0501c75f4afd17ea1bbd944694f85 | [
"MIT"
] | null | null | null | from django.contrib import admin
from houseowner.models import HouseOwner
from Renter.models import RenterInfo
# Register your models here.
class RenterInline(admin.TabularInline):
model = RenterInfo
class HouseOwnerAdmin(admin.ModelAdmin):
fields = ['UID','Full_Name', 'No_of_renters', 'Address_of_houseow... | 33.384615 | 100 | 0.781106 |
8a016a46490b509f886dbf120684af905f8ddb43 | 1,552 | py | Python | src/py/flwr_tool/init_py_check.py | KooperAI/flower | 289090d2e2c4f76ec4976e7b14b7d047363b4f77 | [
"Apache-2.0"
] | 2 | 2022-03-11T16:53:29.000Z | 2022-03-12T06:00:41.000Z | src/py/flwr_tool/init_py_check.py | KooperAI/flower | 289090d2e2c4f76ec4976e7b14b7d047363b4f77 | [
"Apache-2.0"
] | null | null | null | src/py/flwr_tool/init_py_check.py | KooperAI/flower | 289090d2e2c4f76ec4976e7b14b7d047363b4f77 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Adap GmbH. All Rights Reserved.
"""Check provided directory and sub-directories for missing __init__.py files.
Example:
python -m flwr_tool.init_py_check src/py/flwr
"""
import os
import re
import sys
def check_missing_init_files(absolute_path: str) -> None:
"""Searches through the specifi... | 33.73913 | 100 | 0.667526 |
9f724051238142c9b6670dda8c8eea2b21694a6a | 308 | py | Python | src/xlprotocol/__init__.py | jddixon/xlprotocol_py | c07c8c12e9f1e714da831ee28ad1f0e21f69580a | [
"MIT"
] | null | null | null | src/xlprotocol/__init__.py | jddixon/xlprotocol_py | c07c8c12e9f1e714da831ee28ad1f0e21f69580a | [
"MIT"
] | null | null | null | src/xlprotocol/__init__.py | jddixon/xlprotocol_py | c07c8c12e9f1e714da831ee28ad1f0e21f69580a | [
"MIT"
] | null | null | null | # xlprotocol/__init__.py
""" Protocol library for python XLattice packages. """
__version__ = '0.0.10'
__version_date__ = '2018-03-06'
__all__ = ['__version__', '__version_date__', 'XLProtocolError', ]
class XLProtocolError(RuntimeError):
""" General purpose exception for the package. """
pass
| 22 | 66 | 0.714286 |
e90602b7c6425409439334c15bddd4113be46d2a | 1,270 | py | Python | src/util/airports.py | arkits/udaan | 6c732915692bdc29f61ccb63192b567c381b2b96 | [
"MIT"
] | null | null | null | src/util/airports.py | arkits/udaan | 6c732915692bdc29f61ccb63192b567c381b2b96 | [
"MIT"
] | null | null | null | src/util/airports.py | arkits/udaan | 6c732915692bdc29f61ccb63192b567c381b2b96 | [
"MIT"
] | null | null | null | import json
from loguru import logger
import random
airportsFile = None
def readAirportsFile():
with open('resources/airport-codes_json.json') as f:
logger.debug("Reading aiports file...")
global airportsFile
airportsFile = json.load(f)
logger.debug("We Got - {} airports!", l... | 17.638889 | 64 | 0.654331 |
1d39b124b995019c3666ae0c7c8c3277179a0620 | 890 | py | Python | leetcode/21.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | null | null | null | leetcode/21.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | null | null | null | leetcode/21.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | 1 | 2018-11-21T05:14:07.000Z | 2018-11-21T05:14:07.000Z | zpython'''
Author: ZHAO Zinan
Created: 26. April 2019
21. Merge Two Sorted Lists
'''
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode:
... | 22.25 | 69 | 0.423596 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.