hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | 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 4 247 | max_forks_repo_name stringlengths 4 125 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ef5dfd304623f9cd21c49fe10dad5b661348fb8e | 1,567 | py | Python | modeling/__init__.py | NewLuminous/Zalo-Vietnamese-Wiki-QA | 77ebee07d4555c9ee91a65921eec4adeb86a24c0 | [
"MIT"
] | null | null | null | modeling/__init__.py | NewLuminous/Zalo-Vietnamese-Wiki-QA | 77ebee07d4555c9ee91a65921eec4adeb86a24c0 | [
"MIT"
] | null | null | null | modeling/__init__.py | NewLuminous/Zalo-Vietnamese-Wiki-QA | 77ebee07d4555c9ee91a65921eec4adeb86a24c0 | [
"MIT"
] | null | null | null | from .logit import Logit
from .logit_embedding import LogitWithEmbedding
from .crnn import CRNN
from .crnn_attention import AttentionCRNN
from .naive_bayes import naiveBayes
from .rocchio import Rocchio
from .knn import KNN
from .svc import SVC_
from .linear_svc import LinearSVC_
from .random_forest import randomForest... | 27.982143 | 98 | 0.658583 | from .logit import Logit
from .logit_embedding import LogitWithEmbedding
from .crnn import CRNN
from .crnn_attention import AttentionCRNN
from .naive_bayes import naiveBayes
from .rocchio import Rocchio
from .knn import KNN
from .svc import SVC_
from .linear_svc import LinearSVC_
from .random_forest import randomForest... | 883 | 0 | 23 |
da31d5226f1019805ae1fc36a877d97bfa45cc3b | 5,467 | py | Python | decoder.py | bencarletonn/Compression- | 348695168a413a17aea5d0bda4bc8f91cb4f2b4e | [
"MIT"
] | null | null | null | decoder.py | bencarletonn/Compression- | 348695168a413a17aea5d0bda4bc8f91cb4f2b4e | [
"MIT"
] | null | null | null | decoder.py | bencarletonn/Compression- | 348695168a413a17aea5d0bda4bc8f91cb4f2b4e | [
"MIT"
] | null | null | null | import sys
inputFile = sys.argv[1]
# Read file and turn into string
with open(inputFile, 'rb') as file:
data = file.read()
# break bit stream down to consituent parts
encoded = (bin(int.from_bytes(data, byteorder="big")))[2:] # remove 0b
garbage = encoded[:8]
if garbage ==... | 26.410628 | 104 | 0.640937 | import sys
def bitsToBytes(bit_array): # Assume len(bit_array) % 8 == 0
byte_array = bytearray()
for i in range(0, len(bit_array), 8):
byte = bit_array[i:i+8]
byte_array.append(int(byte, 2))
return byte_array
class Node():
def __init__(self, left=None, right=None):
self.left = ... | 3,033 | 3 | 322 |
4495480541ea1c7274abf83dbd975ed852acb063 | 776 | py | Python | heritage/overlay-layers.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | heritage/overlay-layers.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | 11 | 2020-03-24T15:29:46.000Z | 2022-03-11T23:14:48.000Z | heritage/overlay-layers.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | from maps.plugins import OverlayLayer
from maps.utils.layers import register_overlay_layer
from rest_framework.reverse import reverse
register_overlay_layer('Species observations', SpeciesObservations)
register_overlay_layer('Species observations by interview', SpeciesObservationsFilteredByInterview)
| 36.952381 | 99 | 0.795103 | from maps.plugins import OverlayLayer
from maps.utils.layers import register_overlay_layer
from rest_framework.reverse import reverse
class SpeciesObservations(OverlayLayer):
name = 'All species observations.'
ajax_url = reverse('heritage:api:species-observation-list')
ajax_filters = None
register_overla... | 0 | 425 | 46 |
334e1b69a24fba5ce765ca949cbe946b4e65eafb | 92 | py | Python | 020_factorial_digit_sum/solve.py | kopwei/euler | 8b1bdc3f8162819d44f3f40121a5ad8e14a3f5ba | [
"Unlicense"
] | null | null | null | 020_factorial_digit_sum/solve.py | kopwei/euler | 8b1bdc3f8162819d44f3f40121a5ad8e14a3f5ba | [
"Unlicense"
] | null | null | null | 020_factorial_digit_sum/solve.py | kopwei/euler | 8b1bdc3f8162819d44f3f40121a5ad8e14a3f5ba | [
"Unlicense"
] | null | null | null | import math
res = str(math.factorial(100))
digits = [int(c) for c in res]
print(sum(digits)) | 23 | 30 | 0.706522 | import math
res = str(math.factorial(100))
digits = [int(c) for c in res]
print(sum(digits)) | 0 | 0 | 0 |
692ee74845159dd4e66a642119e01997949c3cf0 | 4,757 | py | Python | wagtail_resume/migrations/0008_auto_20220211_1557.py | danihodovic/wagtail-resume | a4283bd37f2ea8137f4d9ab84f066397112287de | [
"MIT"
] | null | null | null | wagtail_resume/migrations/0008_auto_20220211_1557.py | danihodovic/wagtail-resume | a4283bd37f2ea8137f4d9ab84f066397112287de | [
"MIT"
] | 1 | 2019-12-10T09:30:26.000Z | 2019-12-10T09:30:26.000Z | wagtail_resume/migrations/0008_auto_20220211_1557.py | danihodovic/wagtail-resume | a4283bd37f2ea8137f4d9ab84f066397112287de | [
"MIT"
] | null | null | null | # Generated by Django 3.2.12 on 2022-02-11 15:57
from django.db import migrations, models
import wagtail.core.blocks
import wagtail.core.fields
import wagtailmarkdown.blocks
| 176.185185 | 3,757 | 0.734707 | # Generated by Django 3.2.12 on 2022-02-11 15:57
from django.db import migrations, models
import wagtail.core.blocks
import wagtail.core.fields
import wagtailmarkdown.blocks
class Migration(migrations.Migration):
dependencies = [
('wagtail_resume', '0007_baseresumepage_pdf_generation_visibility'),
]... | 0 | 4,558 | 23 |
07af777b9f6f45964f599f6c051bc92bd8ac361c | 2,748 | py | Python | src/1-Phenotype-web/ext/wgetdl/backend/make_csv_reports.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 8 | 2019-09-17T10:22:40.000Z | 2022-03-30T22:22:19.000Z | src/1-Phenotype-web/ext/wgetdl/backend/make_csv_reports.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 4 | 2021-02-02T10:36:55.000Z | 2021-11-30T13:17:52.000Z | src/1-Phenotype-web/ext/wgetdl/backend/make_csv_reports.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 2 | 2019-09-11T00:10:26.000Z | 2021-01-21T22:38:01.000Z | from collections import OrderedDict
import csv
import json
import os
JSON_REPORTS_DIR = 'genomes_final'
CSV_REPORTS_DIR = 'csv_genome_reports'
# CSV_MAP: an OrderedDict defining CSV header and corresponding JSON data.
# The values in this OrderedDict are functions that generate the needed value,
# given a Variant dic... | 41.636364 | 78 | 0.626638 | from collections import OrderedDict
import csv
import json
import os
JSON_REPORTS_DIR = 'genomes_final'
CSV_REPORTS_DIR = 'csv_genome_reports'
# CSV_MAP: an OrderedDict defining CSV header and corresponding JSON data.
# The values in this OrderedDict are functions that generate the needed value,
# given a Variant dic... | 806 | 0 | 23 |
459f489516bb7118fe1f7af1a23c4fa4c32e22bb | 315 | py | Python | sorting_visualizer/variables.py | debdutgoswami/sorting-visualizer | e39e805acf22339b8ee06f8c8cd483e9c03ba3a4 | [
"MIT"
] | 3 | 2020-01-07T15:47:32.000Z | 2020-09-13T14:05:32.000Z | sorting_visualizer/variables.py | debdutgoswami/sorting-visualizer | e39e805acf22339b8ee06f8c8cd483e9c03ba3a4 | [
"MIT"
] | 3 | 2020-10-04T18:03:36.000Z | 2020-10-08T07:13:40.000Z | sorting_visualizer/variables.py | debdutgoswami/sorting-visualizer | e39e805acf22339b8ee06f8c8cd483e9c03ba3a4 | [
"MIT"
] | 3 | 2020-10-04T18:15:54.000Z | 2021-01-20T19:43:49.000Z | sortname = {
'bubblesort': f'Bubble Sort O(n\N{SUPERSCRIPT TWO})', 'insertionsort': f'Insertion Sort O(n\N{SUPERSCRIPT TWO})',
'selectionsort': f'Selection Sort O(n\N{SUPERSCRIPT TWO})', 'mergesort': 'Merge Sort O(n log n)',
'quicksort': 'Quick Sort O(n log n)', 'heapsort': 'Heap Sort O(n log n)'
} | 63 | 118 | 0.647619 | sortname = {
'bubblesort': f'Bubble Sort O(n\N{SUPERSCRIPT TWO})', 'insertionsort': f'Insertion Sort O(n\N{SUPERSCRIPT TWO})',
'selectionsort': f'Selection Sort O(n\N{SUPERSCRIPT TWO})', 'mergesort': 'Merge Sort O(n log n)',
'quicksort': 'Quick Sort O(n log n)', 'heapsort': 'Heap Sort O(n log n)'
} | 0 | 0 | 0 |
cc597a2a48b31e905ef81fd83370cf809a8085de | 224 | py | Python | dotted/__init__.py | freywaid/dotted | 7781eec26a0169dc8b3e098cc2c79fbd38eb5f97 | [
"MIT"
] | 2 | 2020-05-05T18:15:22.000Z | 2021-03-24T09:03:24.000Z | dotted/__init__.py | freywaid/dotted | 7781eec26a0169dc8b3e098cc2c79fbd38eb5f97 | [
"MIT"
] | null | null | null | dotted/__init__.py | freywaid/dotted | 7781eec26a0169dc8b3e098cc2c79fbd38eb5f97 | [
"MIT"
] | null | null | null | """
"""
from .api import \
parse, is_pattern, build, expand, match, get, has, update, remove, apply, \
register, transform, assemble, ANY, is_inverted, get_multi, update_multi, \
remove_multi, match_multi, quote
| 32 | 79 | 0.691964 | """
"""
from .api import \
parse, is_pattern, build, expand, match, get, has, update, remove, apply, \
register, transform, assemble, ANY, is_inverted, get_multi, update_multi, \
remove_multi, match_multi, quote
| 0 | 0 | 0 |
3cb80a0bb45882874312cd5c7933627afce35bfb | 470 | py | Python | dist_matrix.py | jnash10/Efficient-ration-delivery-in-post-disaster-scenario | acc828fbd47ac76e68ba126d8e768734794f4f64 | [
"MIT"
] | null | null | null | dist_matrix.py | jnash10/Efficient-ration-delivery-in-post-disaster-scenario | acc828fbd47ac76e68ba126d8e768734794f4f64 | [
"MIT"
] | null | null | null | dist_matrix.py | jnash10/Efficient-ration-delivery-in-post-disaster-scenario | acc828fbd47ac76e68ba126d8e768734794f4f64 | [
"MIT"
] | null | null | null | import numpy as np
| 21.363636 | 58 | 0.582979 | import numpy as np
def dist(a, b):
return int(((a[0]-b[0])**2+(a[1]-b[1])**2)**(1/2))
def matrix(cities):
dist_matrix = []
for city in cities:
city_dist = []
for i in range(0,len(cities)):
city_dist.append(dist(city,cities[i]))
#print(type(city_dist), city_dist)
... | 404 | 0 | 46 |
9fe751b1125f9336770bd58baf9e18d3c434dfd9 | 285 | py | Python | authors/apps/articles/migrations/0025_merge_20190130_0506.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | null | null | null | authors/apps/articles/migrations/0025_merge_20190130_0506.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | 32 | 2019-01-09T07:52:32.000Z | 2022-01-13T01:01:55.000Z | authors/apps/articles/migrations/0025_merge_20190130_0506.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | 3 | 2019-01-03T12:05:53.000Z | 2019-09-24T11:41:14.000Z | # Generated by Django 2.1.5 on 2019-01-30 05:06
from django.db import migrations
| 19 | 58 | 0.663158 | # Generated by Django 2.1.5 on 2019-01-30 05:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('articles', '0020_articledislikes_articlelikes'),
('articles', '0024_auto_20190130_0421'),
]
operations = [
]
| 0 | 179 | 23 |
84867b5607e5c4ff59b2fdf4653955465433cb0c | 1,279 | py | Python | geolocations_service/service/brumadinho/serializers.py | JBezerra/brumadinho_location | 360969bce9a153fbd1deeec55763bca65f37b6cc | [
"MIT"
] | 666 | 2019-01-28T00:32:43.000Z | 2019-01-30T22:16:41.000Z | geolocations_service/service/brumadinho/serializers.py | CoronaTrack/brumadinho_location | b9a94fd9295ba5759b93ba7def584c1f39b7dde0 | [
"MIT"
] | 68 | 2019-01-28T13:17:26.000Z | 2019-01-30T22:04:30.000Z | geolocations_service/service/brumadinho/serializers.py | sosbrumadinhodevs/brumadinho_location | b9a94fd9295ba5759b93ba7def584c1f39b7dde0 | [
"MIT"
] | 142 | 2019-01-27T21:19:45.000Z | 2019-01-30T22:09:58.000Z | # from django.contrib.auth.models import Group
from brumadinho.models import Geolocation, VisitedLocation, FoundPeople
from rest_framework import serializers
| 26.645833 | 71 | 0.680219 | # from django.contrib.auth.models import Group
from brumadinho.models import Geolocation, VisitedLocation, FoundPeople
from rest_framework import serializers
class GeolocationSerializer(serializers.ModelSerializer):
class Meta:
model = Geolocation
fields = "__all__"
class VisitedLocationSerializ... | 66 | 984 | 69 |
f4c99f62a8f4b876bf3899982fc90bc0e5b922f0 | 916 | py | Python | hackerrank-python/any-or-all.py | fmelihh/competitive-programming-solutions | c15c2f7d90153f35f9bd9ffcea20ac921564eacf | [
"MIT"
] | 2 | 2021-09-06T22:13:12.000Z | 2021-11-22T08:50:04.000Z | hackerrank-python/any-or-all.py | fmelihh/competitive-programming-solutions | c15c2f7d90153f35f9bd9ffcea20ac921564eacf | [
"MIT"
] | null | null | null | hackerrank-python/any-or-all.py | fmelihh/competitive-programming-solutions | c15c2f7d90153f35f9bd9ffcea20ac921564eacf | [
"MIT"
] | null | null | null |
# https://www.hackerrank.com/challenges/any-or-all/problem
if __name__ == '__main__':
N = int(input())
usr_list = input().split()
positive_condition = list(map(lambda x: x[0] != "-", usr_list))
palindromic_condition = list(map(lambda x: "".join(reversed(x)) == x, usr_list))
lenght = ... | 7.447154 | 84 | 0.433406 |
# https://www.hackerrank.com/challenges/any-or-all/problem
if __name__ == '__main__':
N = int(input())
usr_list = input().split()
positive_condition = list(map(lambda x: x[0] != "-", usr_list))
palindromic_condition = list(map(lambda x: "".join(reversed(x)) == x, usr_list))
lenght = ... | 0 | 0 | 0 |
cb79e580057d1143f2e0270be6e2e9fefd2f99a8 | 3,240 | py | Python | components/esp_eth/test_apps/pytest_esp_eth.py | HubertXie/esp-idf | a7032feeaa2f5a600b8e0b37f80fd52538d22145 | [
"Apache-2.0"
] | 1 | 2022-02-04T19:26:55.000Z | 2022-02-04T19:26:55.000Z | components/esp_eth/test_apps/pytest_esp_eth.py | HubertXie/esp-idf | a7032feeaa2f5a600b8e0b37f80fd52538d22145 | [
"Apache-2.0"
] | null | null | null | components/esp_eth/test_apps/pytest_esp_eth.py | HubertXie/esp-idf | a7032feeaa2f5a600b8e0b37f80fd52538d22145 | [
"Apache-2.0"
] | 1 | 2022-02-09T12:41:20.000Z | 2022-02-09T12:41:20.000Z | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import contextlib
import logging
import os
import socket
from typing import Iterator
import pytest
from pytest_embedded import Dut
@contextlib.contextmanager
@pytest.mark.esp32
@pytest.mark.ip101
@pytest.mark.p... | 30.566038 | 161 | 0.640123 | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import contextlib
import logging
import os
import socket
from typing import Iterator
import pytest
from pytest_embedded import Dut
@contextlib.contextmanager
def configure_eth_if() -> Iterator[socket.socket]:
#... | 2,552 | 0 | 112 |
808b74601a3834fa80016a6b2658146271635871 | 219 | py | Python | scenes/menu_main.py | EemeliSyynimaa/picross | 691d4a8a81656d48239d7fa1fa6b9566728a4a9f | [
"MIT"
] | null | null | null | scenes/menu_main.py | EemeliSyynimaa/picross | 691d4a8a81656d48239d7fa1fa6b9566728a4a9f | [
"MIT"
] | null | null | null | scenes/menu_main.py | EemeliSyynimaa/picross | 691d4a8a81656d48239d7fa1fa6b9566728a4a9f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from engine import scene
class MenuMain(scene.Scene):
""" The main menu scene. """
| 21.9 | 55 | 0.593607 | # -*- coding: utf-8 -*-
from engine import scene
class MenuMain(scene.Scene):
""" The main menu scene. """
def __init__(self, *args, **kwargs):
super(MenuMain, self).__init__(*args, **kwargs)
| 71 | 0 | 27 |
5145bdda96ac7d4bd1682309f0ee0a967bc378cb | 8,728 | py | Python | src/redrawing/ai_models/LightweightOpenPose.py | ReDrawing/redrawing | 20743f0c8d64d9d2e15cefa840423c9698c74653 | [
"MIT"
] | 1 | 2021-04-20T00:00:15.000Z | 2021-04-20T00:00:15.000Z | src/redrawing/ai_models/LightweightOpenPose.py | ReDrawing/redrawing | 20743f0c8d64d9d2e15cefa840423c9698c74653 | [
"MIT"
] | null | null | null | src/redrawing/ai_models/LightweightOpenPose.py | ReDrawing/redrawing | 20743f0c8d64d9d2e15cefa840423c9698c74653 | [
"MIT"
] | 1 | 2021-07-18T03:57:01.000Z | 2021-07-18T03:57:01.000Z | import inspect
import os
import numpy as np
import cv2 as cv
import torch
from redrawing.data_interfaces.bodypose import BodyPose
from redrawing.data_interfaces.image import Image
from redrawing.components.stage import Stage
import redrawing.third_models.lightweight_human_modules as lhm
from ..third_models.lightwei... | 35.917695 | 121 | 0.578025 | import inspect
import os
import numpy as np
import cv2 as cv
import torch
from redrawing.data_interfaces.bodypose import BodyPose
from redrawing.data_interfaces.image import Image
from redrawing.components.stage import Stage
import redrawing.third_models.lightweight_human_modules as lhm
from ..third_models.lightwei... | 1,873 | 6,101 | 23 |
88cb78cc36efd6e0ac79368f4de0301a371530e0 | 5,331 | py | Python | image-processing/obsolete/photo_analysis.py | twf2360/Industrial-Group-Project | a2a879d82a3ce7e714bbd30a34cd14e88cb22293 | [
"MIT"
] | 1 | 2020-12-17T22:50:49.000Z | 2020-12-17T22:50:49.000Z | image-processing/obsolete/photo_analysis.py | mjrevell/Industrial-Group-Project | 422367508093dfbb904c8a9aaa63a1ac12d1c82c | [
"MIT"
] | 5 | 2020-12-17T17:25:40.000Z | 2021-02-04T15:54:19.000Z | image-processing/obsolete/photo_analysis.py | twf2360/Industrial-Group-Project | a2a879d82a3ce7e714bbd30a34cd14e88cb22293 | [
"MIT"
] | 4 | 2020-11-19T09:28:33.000Z | 2021-02-04T16:15:33.000Z | import math
import skimage
from skimage import io, transform, viewer, color, data, filters, feature, morphology, exposure
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from scipy import fftpack
from matplotlib.colors import LogNorm
from scipy import ndimage
from scipy.signal impo... | 32.907407 | 124 | 0.681486 | import math
import skimage
from skimage import io, transform, viewer, color, data, filters, feature, morphology, exposure
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from scipy import fftpack
from matplotlib.colors import LogNorm
from scipy import ndimage
from scipy.signal impo... | 0 | 0 | 0 |
eaab12394212aecb195e1d8b0f4c982dad08d1de | 5,287 | py | Python | models/model_factory.py | haohlin/pointgmm-primitive-detection | 08ff42271a1d5b85d6b25de0f54be4e50fddff3e | [
"MIT"
] | 38 | 2020-04-13T13:11:14.000Z | 2022-03-24T17:28:21.000Z | models/model_factory.py | haohlin/pointgmm-primitive-detection | 08ff42271a1d5b85d6b25de0f54be4e50fddff3e | [
"MIT"
] | 1 | 2020-07-05T17:02:18.000Z | 2020-07-05T17:02:18.000Z | models/model_factory.py | haohlin/pointgmm-primitive-detection | 08ff42271a1d5b85d6b25de0f54be4e50fddff3e | [
"MIT"
] | 8 | 2020-07-14T15:08:34.000Z | 2022-01-04T05:29:43.000Z | import torch
from process_data.files_utils import init_folders
import shutil
from models.encoders.pointnet import PointNet, PointNetDual
from models.model_gm import PointGMM
from custom_types import *
from tqdm import tqdm
import os
import pickle
import options
DEBUG = False
| 34.331169 | 116 | 0.623605 | import torch
from process_data.files_utils import init_folders
import shutil
from models.encoders.pointnet import PointNet, PointNetDual
from models.model_gm import PointGMM
from custom_types import *
from tqdm import tqdm
import os
import pickle
import options
DEBUG = False
def is_model_clean(model) -> bool:
f... | 4,574 | 339 | 92 |
97999ee6c869dc6cc5dc9534fee69c349563bdc8 | 548 | py | Python | CNProtection/conanfile.py | memsharded/tools_build_requires | 99c9545a56092e4d44f58b34d06381bc75fdf61e | [
"MIT"
] | null | null | null | CNProtection/conanfile.py | memsharded/tools_build_requires | 99c9545a56092e4d44f58b34d06381bc75fdf61e | [
"MIT"
] | null | null | null | CNProtection/conanfile.py | memsharded/tools_build_requires | 99c9545a56092e4d44f58b34d06381bc75fdf61e | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake
| 26.095238 | 95 | 0.459854 | from conans import ConanFile, CMake
class AaaConan(ConanFile):
name = 'CNProtection'
version = '1.0.0'
requires = 'CNCoreUtils/1.0.0@user/testing'
options = {
'all_keys': [True, False]
}
default_options = {
'all_keys': False
}
def package_info(self):
self.outp... | 246 | 241 | 23 |
44615e3bceb8d0622803c2b933e8998224f94d76 | 513 | py | Python | rosys/communication/communication.py | zauberzeug/rosys | 10271c88ffd5dcc4fb8eec93d46fe4144a9e40d8 | [
"MIT"
] | 1 | 2022-02-20T08:21:07.000Z | 2022-02-20T08:21:07.000Z | rosys/communication/communication.py | zauberzeug/rosys | 10271c88ffd5dcc4fb8eec93d46fe4144a9e40d8 | [
"MIT"
] | 1 | 2022-03-08T12:46:09.000Z | 2022-03-08T12:46:09.000Z | rosys/communication/communication.py | zauberzeug/rosys | 10271c88ffd5dcc4fb8eec93d46fe4144a9e40d8 | [
"MIT"
] | null | null | null | from typing import Optional
import abc
import logging
| 20.52 | 60 | 0.641326 | from typing import Optional
import abc
import logging
class Communication(abc.ABC):
def __init__(self) -> None:
self.name = __name__[:-13] + self.__class__.__name__
self.log = logging.getLogger(self.name)
super().__init__()
@classmethod
@abc.abstractmethod
def is_possible(cls... | 230 | 205 | 23 |
e2875681b7503e5b2fe51a821d876693f5e58392 | 2,111 | py | Python | shedule_01iter.py | Gandifil/EvolutionTask | 28b6b45148ed8b820cbaa7a2cf1711f152edb97d | [
"Apache-2.0"
] | null | null | null | shedule_01iter.py | Gandifil/EvolutionTask | 28b6b45148ed8b820cbaa7a2cf1711f152edb97d | [
"Apache-2.0"
] | null | null | null | shedule_01iter.py | Gandifil/EvolutionTask | 28b6b45148ed8b820cbaa7a2cf1711f152edb97d | [
"Apache-2.0"
] | null | null | null | import signal
import sys
from math import factorial
import sheduling
from itertools import *
cellsCount = 6 * 2 * len(sheduling.times)
maxFitness = -1000000000
theBestShedule = None
i = 0
# оптимизация. Не используем утро, вечер( крайние отрезки времени) и субботу
cells = list(filter(isB... | 28.917808 | 94 | 0.629086 | import signal
import sys
from math import factorial
import sheduling
from itertools import *
cellsCount = 6 * 2 * len(sheduling.times)
def convert(lessonsPrint, indexes):
assert len(lessonsPrint) == len(indexes)
lessons = [None for _ in range(cellsCount)]
for i in range(len(lessonsPrint)):
... | 596 | 0 | 100 |
8be405719a8a9292f3a3d57b74c14e0205dc024e | 460 | py | Python | tests/test_core.py | pnowk/poket | b0927b73d7a65c771a2f5c49cb59a306c813de36 | [
"MIT"
] | null | null | null | tests/test_core.py | pnowk/poket | b0927b73d7a65c771a2f5c49cb59a306c813de36 | [
"MIT"
] | null | null | null | tests/test_core.py | pnowk/poket | b0927b73d7a65c771a2f5c49cb59a306c813de36 | [
"MIT"
] | null | null | null |
from os.path import join
from poket.core import create_profile, Configmap
from poket.conf import settings
from os.path import join
| 27.058824 | 68 | 0.726087 |
from os.path import join
from poket.core import create_profile, Configmap
from poket.conf import settings
from os.path import join
def test_profile_created(mocker):
profile = create_profile('test')
assert profile.name == 'test'
assert profile.path == join(settings.get_profiles_dir(), 'test')
def test_c... | 281 | 0 | 46 |
10f714b5fbe04253e969f75514440ed4e1505728 | 823 | py | Python | sipack/word_int.py | malhotravasu/sipack | 2207a39b750d9af5c5b09088ca3ca8f487602c85 | [
"MIT"
] | null | null | null | sipack/word_int.py | malhotravasu/sipack | 2207a39b750d9af5c5b09088ca3ca8f487602c85 | [
"MIT"
] | null | null | null | sipack/word_int.py | malhotravasu/sipack | 2207a39b750d9af5c5b09088ca3ca8f487602c85 | [
"MIT"
] | null | null | null | """Let's learn Python"""
import string
class StrManipulator(object):
"""First Class"""
def process_string(self, unsan_str):
"""Process string into useful list"""
table = str.maketrans({key: None for key in string.punctuation})
return unsan_str.translate(table).lower().split()
def ... | 29.392857 | 72 | 0.552855 | """Let's learn Python"""
import string
class StrManipulator(object):
"""First Class"""
def process_string(self, unsan_str):
"""Process string into useful list"""
table = str.maketrans({key: None for key in string.punctuation})
return unsan_str.translate(table).lower().split()
def ... | 0 | 0 | 0 |
cdc9b97235b50da549ea7490dc38d30cd1a652e5 | 539 | py | Python | LED.py | bor8/blinken-leds | 218aba28eb4a07f10b18b6f4a67225855646d2e6 | [
"MIT"
] | null | null | null | LED.py | bor8/blinken-leds | 218aba28eb4a07f10b18b6f4a67225855646d2e6 | [
"MIT"
] | null | null | null | LED.py | bor8/blinken-leds | 218aba28eb4a07f10b18b6f4a67225855646d2e6 | [
"MIT"
] | null | null | null | import argparse
import random
import RPi.GPIO as GPIO
import time
parser = argparse.ArgumentParser()
parser.add_argument('k', type=int, help='GPIO number')
args = parser.parse_args()
main(args.k)
| 23.434783 | 54 | 0.638219 | import argparse
import random
import RPi.GPIO as GPIO
import time
def main(k):
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(k, GPIO.OUT)
try:
while True:
GPIO.output(k, GPIO.HIGH)
time.sleep(random.random()*0.4)
GPIO.output(k, GPIO.LOW)
... | 319 | 0 | 23 |
860d5c8371b950b5169deef37bfff63eb23741ab | 5,096 | py | Python | Python/GameObjects/PipeSet.py | RaysOfTheSun/FlappyBird | 1af01144a67e65281293cb8a321124e22edf2825 | [
"Apache-2.0"
] | null | null | null | Python/GameObjects/PipeSet.py | RaysOfTheSun/FlappyBird | 1af01144a67e65281293cb8a321124e22edf2825 | [
"Apache-2.0"
] | null | null | null | Python/GameObjects/PipeSet.py | RaysOfTheSun/FlappyBird | 1af01144a67e65281293cb8a321124e22edf2825 | [
"Apache-2.0"
] | null | null | null | import pygame, random
from pathlib import PurePath
from GameModules.ColorPalette import ColorPalette
from GameObjects.Sprite import Sprite
class PipeSet:
"""
Represents an obstacle in the game
"""
def __init__(self):
"""
Initializes a new instance of the pipe class
"""
... | 40.444444 | 121 | 0.668956 | import pygame, random
from pathlib import PurePath
from GameModules.ColorPalette import ColorPalette
from GameObjects.Sprite import Sprite
class PipeSet:
"""
Represents an obstacle in the game
"""
def __init__(self):
"""
Initializes a new instance of the pipe class
"""
... | 144 | 0 | 79 |
af884e36b2dec88cd60b0d6f54da154fa61ccaeb | 319 | py | Python | src/countries_code.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2020-04-10T19:32:43.000Z | 2021-05-08T23:39:21.000Z | src/countries_code.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2016-09-01T04:38:53.000Z | 2019-01-31T15:51:39.000Z | src/countries_code.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 7 | 2016-08-10T10:30:59.000Z | 2020-02-21T14:12:35.000Z | import sys
import util
import countries_code_index
import countries_code_individual
if __name__ == "__main__":
run(sys.argv[1])
| 22.785714 | 42 | 0.705329 | import sys
import util
import countries_code_index
import countries_code_individual
def run(code):
print("Creating countries/" + code)
util.makedirs("../countries/" + code)
countries_code_index.run(code)
countries_code_individual.run(code)
if __name__ == "__main__":
run(sys.argv[1])
| 154 | 0 | 25 |
b9968b33347485b670a7572e853fabc762a7b0e5 | 1,833 | py | Python | disba/_base.py | th-reb/disba | b364a40ebe511f8b8d1db75557f9467fa6f12490 | [
"BSD-3-Clause"
] | null | null | null | disba/_base.py | th-reb/disba | b364a40ebe511f8b8d1db75557f9467fa6f12490 | [
"BSD-3-Clause"
] | null | null | null | disba/_base.py | th-reb/disba | b364a40ebe511f8b8d1db75557f9467fa6f12490 | [
"BSD-3-Clause"
] | null | null | null | from abc import ABC
import numpy
| 28.640625 | 86 | 0.641026 | from abc import ABC
import numpy
class Base(ABC):
def __init__(self, thickness, velocity_p, velocity_s, density, algorithm, dc):
"""Base class."""
self._thickness = numpy.asarray(thickness)
self._velocity_p = numpy.asarray(velocity_p)
self._velocity_s = numpy.asarray(velocity_s)
... | 0 | 1,727 | 69 |
1074b08bdc6a437a739be0f5e3f9fae3d408634b | 2,591 | py | Python | tests/test_refocus.py | RI-imaging/qpimage | e572f0ece5b0a33b031e44ce390c2d40a1975851 | [
"MIT"
] | 1 | 2022-02-13T15:14:21.000Z | 2022-02-13T15:14:21.000Z | tests/test_refocus.py | RI-imaging/qpimage | e572f0ece5b0a33b031e44ce390c2d40a1975851 | [
"MIT"
] | 13 | 2017-10-10T11:23:56.000Z | 2021-12-06T00:02:46.000Z | tests/test_refocus.py | RI-imaging/qpimage | e572f0ece5b0a33b031e44ce390c2d40a1975851 | [
"MIT"
] | 2 | 2018-04-05T04:21:34.000Z | 2020-07-21T11:57:04.000Z | import numpy as np
import nrefocus
from scipy.ndimage import gaussian_filter
import pytest
import qpimage
if __name__ == "__main__":
# Run all tests
_loc = locals()
for _key in list(_loc.keys()):
if _key.startswith("test_") and hasattr(_loc[_key], "__call__"):
_loc[_key]()
| 30.845238 | 72 | 0.551139 | import numpy as np
import nrefocus
from scipy.ndimage import gaussian_filter
import pytest
import qpimage
def test_refocus():
nrkw = {"res": 2,
"nm": 1,
"method": "helmholtz",
"padding": True,
"d": 5.5}
meta = {"wavelength": 1e-6,
"pixel size": 1e-... | 2,233 | 0 | 46 |
b61fdd250445e3eab4d4df963d8cfba91ce0bd48 | 6,220 | py | Python | model/utils/config_helper.py | aashiqmuhamed/transformer-gan | 1ccc9f251c1b1d054c1acc8be36c1da7bf8cf11c | [
"Apache-2.0"
] | 32 | 2021-06-11T02:03:03.000Z | 2022-03-23T16:12:49.000Z | model/utils/config_helper.py | aashiqmuhamed/transformer-gan | 1ccc9f251c1b1d054c1acc8be36c1da7bf8cf11c | [
"Apache-2.0"
] | 3 | 2021-11-11T06:08:37.000Z | 2022-02-20T14:09:30.000Z | model/utils/config_helper.py | aashiqmuhamed/transformer-gan | 1ccc9f251c1b1d054c1acc8be36c1da7bf8cf11c | [
"Apache-2.0"
] | 7 | 2021-06-11T01:19:56.000Z | 2022-02-17T03:52:15.000Z | from yacs.config import CfgNode as CN
| 37.926829 | 133 | 0.694855 | from yacs.config import CfgNode as CN
def model(cfg):
# For model
cfg.MODEL = CN()
cfg.MODEL.num_layers = 6
cfg.MODEL.num_heads = 10
cfg.MODEL.units = 500
cfg.MODEL.inner_size = 1000
cfg.MODEL.dropout = 0.1
cfg.MODEL.tie_embedding = True
cfg.MODEL.tie_proj = False
cfg.MODEL.atte... | 6,047 | 0 | 138 |
8caf0ebbcd5e1684dd13449e003b5532488ee2a3 | 1,374 | py | Python | edopt/main.py | maxschommer/edopt | 1fc4e6da8dca53565033d737484f6f609bd72bee | [
"MIT"
] | null | null | null | edopt/main.py | maxschommer/edopt | 1fc4e6da8dca53565033d737484f6f609bd72bee | [
"MIT"
] | null | null | null | edopt/main.py | maxschommer/edopt | 1fc4e6da8dca53565033d737484f6f609bd72bee | [
"MIT"
] | null | null | null | import networkx as nx
import matplotlib.pyplot as plt
class Node():
"""This is the base class for a nx node
It has basic electrical properties like
Voltage (All nodes have voltage)
Charge (Pins can collect charge, like capacitors)
Nodes compute functions as well, which based on the
e... | 19.083333 | 75 | 0.63246 | import networkx as nx
import matplotlib.pyplot as plt
class Node():
"""This is the base class for a nx node
It has basic electrical properties like
Voltage (All nodes have voltage)
Charge (Pins can collect charge, like capacitors)
Nodes compute functions as well, which based on the
e... | 0 | 0 | 0 |
df5b09d31ab3997244eb04d0dd3f98b98064b154 | 4,354 | py | Python | api.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | 1 | 2020-01-14T02:14:05.000Z | 2020-01-14T02:14:05.000Z | api.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | 2 | 2018-06-02T18:40:59.000Z | 2020-03-10T00:03:50.000Z | api.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | null | null | null | from flask_api import FlaskAPI
from flask import request
from functools import partial, reduce
from mapping import ResponseMapper
from constants import PROJECT_NAME, APIS
from constants import CACHE_NAME, CACHE_DB, SYNC_INTERVAL
import requests_cache as cache
import requests
import json
import pdb
import os
import re
... | 32.492537 | 102 | 0.655949 | from flask_api import FlaskAPI
from flask import request
from functools import partial, reduce
from mapping import ResponseMapper
from constants import PROJECT_NAME, APIS
from constants import CACHE_NAME, CACHE_DB, SYNC_INTERVAL
import requests_cache as cache
import requests
import json
import pdb
import os
import re
... | 1,086 | 0 | 209 |
fd24d904edcb763175640b8d015d59d7b39fe509 | 460 | py | Python | Sprint2/test_output_sprint2.py | Eziowrf/projectGedcom | c5f321723013d9bcc68c618ae54e03b5f0c9efe1 | [
"MIT"
] | null | null | null | Sprint2/test_output_sprint2.py | Eziowrf/projectGedcom | c5f321723013d9bcc68c618ae54e03b5f0c9efe1 | [
"MIT"
] | 7 | 2018-09-25T19:50:09.000Z | 2018-09-26T23:40:46.000Z | Sprint2/test_output_sprint2.py | Eziowrf/projectGedcom | c5f321723013d9bcc68c618ae54e03b5f0c9efe1 | [
"MIT"
] | null | null | null | import userStory03
import userStory04
(listOfPeople,listOfFamilies)= project3.gedComParse('error.ged')
project3.present(listOfPeople,listOfFamilies)
# (listOfPeople1,listOfFamilies1)= project3.gedComParse('correct.ged')
# project3.present(listOfPeople1,listOfFamilies1)
userStory03.userStory03(listOfPeople)
... | 32.857143 | 71 | 0.830435 | import userStory03
import userStory04
(listOfPeople,listOfFamilies)= project3.gedComParse('error.ged')
project3.present(listOfPeople,listOfFamilies)
# (listOfPeople1,listOfFamilies1)= project3.gedComParse('correct.ged')
# project3.present(listOfPeople1,listOfFamilies1)
userStory03.userStory03(listOfPeople)
... | 0 | 0 | 0 |
07e3ee28b7403a19b7ae926bbc045b8a2e7f37a0 | 4,238 | py | Python | AdityaGilraMOOSEnC/pythonScripts/RunTests.py | OpenSourceBrain/PyloricNetwork | 858bfcb2a030edbbf53fd4d1765cdee7454e2f3b | [
"MIT"
] | 1 | 2018-06-22T22:21:06.000Z | 2018-06-22T22:21:06.000Z | AdityaGilraMOOSEnC/pythonScripts/RunTests.py | OpenSourceBrain/PyloricNetwork | 858bfcb2a030edbbf53fd4d1765cdee7454e2f3b | [
"MIT"
] | 1 | 2018-12-05T14:54:41.000Z | 2018-12-06T16:50:00.000Z | AdityaGilraMOOSEnC/pythonScripts/RunTests.py | OpenSourceBrain/PyloricNetwork | 858bfcb2a030edbbf53fd4d1765cdee7454e2f3b | [
"MIT"
] | 1 | 2020-08-11T12:30:36.000Z | 2020-08-11T12:30:36.000Z | #
#
# File to test current configuration of Pyloric project.
#
# To execute this type of file, type 'nC.bat -python XXX.py' (Windows)
# or 'nC.sh -python XXX.py' (Linux/Mac). Note: you may have to update the
# NC_HOME and NC_MAX_MEMORY variables in nC.bat/nC.sh
#
# Author: Padraig Gleeson
#
# This... | 43.244898 | 714 | 0.586833 | #
#
# File to test current configuration of Pyloric project.
#
# To execute this type of file, type 'nC.bat -python XXX.py' (Windows)
# or 'nC.sh -python XXX.py' (Linux/Mac). Note: you may have to update the
# NC_HOME and NC_MAX_MEMORY variables in nC.bat/nC.sh
#
# Author: Padraig Gleeson
#
# This... | 2,804 | 0 | 25 |
60cec8b185ad7319db3515afd43cb50f5926a7ce | 8,302 | py | Python | bot/extensions/mod.py | cosmic-team/bellatrix | 59f2fce4f40bf953065fa357d18a9065d26653a3 | [
"MIT"
] | 3 | 2021-01-05T23:16:21.000Z | 2021-01-24T00:47:18.000Z | bot/extensions/mod.py | webkaiyo/sirius | 59f2fce4f40bf953065fa357d18a9065d26653a3 | [
"MIT"
] | 1 | 2021-01-06T22:59:29.000Z | 2021-01-06T22:59:29.000Z | bot/extensions/mod.py | webkaiyo/sirius | 59f2fce4f40bf953065fa357d18a9065d26653a3 | [
"MIT"
] | 1 | 2021-04-20T03:49:55.000Z | 2021-04-20T03:49:55.000Z | '''
MIT License
Copyright (c) 2021 Caio Alexandre
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, publish... | 35.32766 | 119 | 0.648037 | '''
MIT License
Copyright (c) 2021 Caio Alexandre
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, publish... | 5,075 | 82 | 338 |
2eb28186769049a7366b6c7f4cbe0bf29e3272b8 | 5,619 | py | Python | Browser/assertion_engine.py | Snooz82/robotframework-browser | 89488d4940df5288cf35a5bc9bceec9f34a49707 | [
"Apache-2.0"
] | null | null | null | Browser/assertion_engine.py | Snooz82/robotframework-browser | 89488d4940df5288cf35a5bc9bceec9f34a49707 | [
"Apache-2.0"
] | null | null | null | Browser/assertion_engine.py | Snooz82/robotframework-browser | 89488d4940df5288cf35a5bc9bceec9f34a49707 | [
"Apache-2.0"
] | null | null | null | import re
import time
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, cast
import wrapt # type: ignore
from robot.libraries.BuiltIn import BuiltIn # type: ignore
from robot.utils import timestr_to_secs # type: ignore
from .utils import AssertionOperator, is_truthy, logger
NumericalOperator... | 32.293103 | 88 | 0.639082 | import re
import time
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, cast
import wrapt # type: ignore
from robot.libraries.BuiltIn import BuiltIn # type: ignore
from robot.utils import timestr_to_secs # type: ignore
from .utils import AssertionOperator, is_truthy, logger
NumericalOperator... | 3,682 | 0 | 183 |
e49849bf9679c2ac4f01c6719c17106df42e032e | 7,468 | py | Python | mindmeld/models/model_factory.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | 1 | 2022-02-09T13:39:41.000Z | 2022-02-09T13:39:41.000Z | mindmeld/models/model_factory.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | mindmeld/models/model_factory.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE... | 38.694301 | 100 | 0.664971 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 362 | 0 | 53 |
f3dbecc57d01769492550dcff807da7ecbdf13f9 | 9,880 | py | Python | src/model/stylegan/executor.py | mgmk2/StyleGAN | a7ad9d1af7c0fbc43eefbde606653c4c24818103 | [
"Apache-2.0"
] | 9 | 2019-10-31T10:27:49.000Z | 2021-11-24T03:29:25.000Z | src/model/stylegan/executor.py | mgmk2/StyleGAN | a7ad9d1af7c0fbc43eefbde606653c4c24818103 | [
"Apache-2.0"
] | 1 | 2020-02-23T20:16:22.000Z | 2020-02-23T20:16:22.000Z | src/model/stylegan/executor.py | mgmk2/StyleGAN | a7ad9d1af7c0fbc43eefbde606653c4c24818103 | [
"Apache-2.0"
] | 5 | 2020-08-07T02:32:45.000Z | 2021-11-28T23:43:56.000Z | import os
import sys
import time
import numpy as np
from .network import res2num_blocks
from .model import StyleGANModel
from ..base_executor import ExecutorBase
from ...utils import image_utils, utils
from ...utils.decorator import tpu_decorator
| 41.338912 | 104 | 0.579352 | import os
import sys
import time
import numpy as np
from .network import res2num_blocks
from .model import StyleGANModel
from ..base_executor import ExecutorBase
from ...utils import image_utils, utils
from ...utils.decorator import tpu_decorator
class StyleGAN(ExecutorBase):
def __init__(self, params, use_tpu=Fal... | 9,267 | 343 | 23 |
fc8ac923e24c2887578743f8bf48d6672c29d320 | 12,809 | py | Python | python/2021/day17.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | python/2021/day17.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | python/2021/day17.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | # vi: set shiftwidth=4 tabstop=4 expandtab:
import datetime
import re
import math
target_area_re = r"^target area: x=([-0-9]+)..([-0-9]+), y=([-0-9]+)..([-0-9]+)$"
# Analysis of the x position
#############################
# step is [0, 1, 2, 3, ..., n
# x-velocity is [vx, vx-1, vx-2, ... | 25.824597 | 84 | 0.416504 | # vi: set shiftwidth=4 tabstop=4 expandtab:
import datetime
import re
import math
target_area_re = r"^target area: x=([-0-9]+)..([-0-9]+), y=([-0-9]+)..([-0-9]+)$"
def get_target_area_from_string(s):
m = re.match(target_area_re, s)
return [int(v) for v in m.group(1, 2, 3, 4)]
def get_target_area_from_file(... | 9,768 | 0 | 413 |
bdbe27eeece5a9c1fd8fc6c5813ff85ea6a011b4 | 5,657 | py | Python | pyame/config.py | toxinu/pyame | 7b9351bfddda790e321b55be9ef8df8c3dc1ede4 | [
"BSD-3-Clause"
] | 1 | 2018-03-02T17:50:40.000Z | 2018-03-02T17:50:40.000Z | pyame/config.py | toxinu/pyame | 7b9351bfddda790e321b55be9ef8df8c3dc1ede4 | [
"BSD-3-Clause"
] | null | null | null | pyame/config.py | toxinu/pyame | 7b9351bfddda790e321b55be9ef8df8c3dc1ede4 | [
"BSD-3-Clause"
] | null | null | null | import sys
import os
import configparser
from clint.textui import puts, indent, colored
class config(object):
""" This class represents the config file.
:param string path_file: Path to config file
"""
## Check the validity of the config file
def check(self):
""" Check every optio... | 48.350427 | 169 | 0.59148 | import sys
import os
import configparser
from clint.textui import puts, indent, colored
class config(object):
""" This class represents the config file.
:param string path_file: Path to config file
"""
def __init__(self, path_file):
config = configparser.RawConfigParser()
conf... | 2,033 | 0 | 26 |
60eedd43cfeb30178017ce5de73c721550bd0cf2 | 4,751 | py | Python | build_product_images.py | stackabletech/docker-images | acd69b7f634fcf05ee6580f8b1437cb4645982d9 | [
"Apache-2.0"
] | 1 | 2022-01-21T11:24:25.000Z | 2022-01-21T11:24:25.000Z | build_product_images.py | stackabletech/docker-images | acd69b7f634fcf05ee6580f8b1437cb4645982d9 | [
"Apache-2.0"
] | 34 | 2021-10-20T13:57:07.000Z | 2022-03-30T12:19:52.000Z | build_product_images.py | stackabletech/docker-images | acd69b7f634fcf05ee6580f8b1437cb4645982d9 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
"""
Build and possibly publish product images. It doesn't login to any registry when publishing
but it assumes a `docker login` has been performed before.
Usage: build_product_images.py --help
Example:
build_product_images.py --product zookeeper,kafka -image_version 0.1 --push
This whill build... | 34.427536 | 137 | 0.64176 | #!/bin/env python
"""
Build and possibly publish product images. It doesn't login to any registry when publishing
but it assumes a `docker login` has been performed before.
Usage: build_product_images.py --help
Example:
build_product_images.py --product zookeeper,kafka -image_version 0.1 --push
This whill build... | 1,111 | 0 | 69 |
d3d83974a27b8cdda759edb8312df23c202d8a4c | 830 | py | Python | tests/test_sample_dfs.py | rltvty/itables | f03c276e1b78209bb14f02a991a62bfc60a9c422 | [
"MIT"
] | null | null | null | tests/test_sample_dfs.py | rltvty/itables | f03c276e1b78209bb14f02a991a62bfc60a9c422 | [
"MIT"
] | null | null | null | tests/test_sample_dfs.py | rltvty/itables | f03c276e1b78209bb14f02a991a62bfc60a9c422 | [
"MIT"
] | null | null | null | import pytest
from itables import show
from itables.sample_dfs import (
get_countries,
get_dict_of_test_dfs,
get_dict_of_test_series,
get_indicators,
get_population,
)
@pytest.mark.parametrize("df_name,df", get_dict_of_test_dfs().items())
@pytest.mark.parametrize("series_name,series", get_di... | 19.761905 | 81 | 0.698795 | import pytest
from itables import show
from itables.sample_dfs import (
get_countries,
get_dict_of_test_dfs,
get_dict_of_test_series,
get_indicators,
get_population,
)
def test_get_countries():
df = get_countries()
assert len(df.columns) > 5
assert len(df.index) > 100
show(df)
d... | 368 | 0 | 113 |
b84129330a8b256214fa79062400b5804cf42137 | 2,499 | py | Python | Deep-Co-Training/data/data_ingestion.py | Deep-Co-Training/Deep-Co-Training | c14f440a4b51e12b7d3f35e8f88c9592d299486f | [
"MIT"
] | null | null | null | Deep-Co-Training/data/data_ingestion.py | Deep-Co-Training/Deep-Co-Training | c14f440a4b51e12b7d3f35e8f88c9592d299486f | [
"MIT"
] | null | null | null | Deep-Co-Training/data/data_ingestion.py | Deep-Co-Training/Deep-Co-Training | c14f440a4b51e12b7d3f35e8f88c9592d299486f | [
"MIT"
] | null | null | null | import json
import pandas as pd
import numpy as np
import os
import string
import tensorflow as tf
class DataIngestion:
"""Class for ingesting data from the dataset directory""" | 32.038462 | 81 | 0.745498 | import json
import pandas as pd
import numpy as np
import os
import string
import tensorflow as tf
class DataIngestion:
"""Class for ingesting data from the dataset directory"""
def __init__(self,dataset_path,batch_size,buffer_size):
self.dataset_path = dataset_path
self.batch_size = batch_size
self.buffer_s... | 2,174 | 0 | 145 |
6a037582fc8f8889431bc0e7b852993429b0b822 | 8,713 | py | Python | tests/test_utils.py | Jasha10/hydra-zen | c229ab37f9ab6be4d1c64cabb646df99d0308027 | [
"MIT"
] | null | null | null | tests/test_utils.py | Jasha10/hydra-zen | c229ab37f9ab6be4d1c64cabb646df99d0308027 | [
"MIT"
] | null | null | null | tests/test_utils.py | Jasha10/hydra-zen | c229ab37f9ab6be4d1c64cabb646df99d0308027 | [
"MIT"
] | null | null | null | # Copyright (c) 2022 Massachusetts Institute of Technology
# SPDX-License-Identifier: MIT
import collections.abc as abc
import enum
import random
import string
import sys
from dataclasses import dataclass, field as dataclass_field
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, TypeVar, Union
... | 28.106452 | 88 | 0.633192 | # Copyright (c) 2022 Massachusetts Institute of Technology
# SPDX-License-Identifier: MIT
import collections.abc as abc
import enum
import random
import string
import sys
from dataclasses import dataclass, field as dataclass_field
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, TypeVar, Union
... | 4,177 | -2 | 574 |
d1cdbc4a1fca884210a1fb02dffcc803c01019c6 | 334 | py | Python | pyautogui__keyboard__examples/hotkey.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | pyautogui__keyboard__examples/hotkey.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | pyautogui__keyboard__examples/hotkey.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install keyboard
import keyboard
keyboard.add_hotkey('shift', lambda: keyboard.write('on'))
keyboard.add_hotkey('shift', lambda: keyboard.write('off'), trigger_on_release=True)
# Block forever.
keyboard.wait()
# OR, wait Escape:
# keyboar... | 19.647059 | 84 | 0.712575 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install keyboard
import keyboard
keyboard.add_hotkey('shift', lambda: keyboard.write('on'))
keyboard.add_hotkey('shift', lambda: keyboard.write('off'), trigger_on_release=True)
# Block forever.
keyboard.wait()
# OR, wait Escape:
# keyboar... | 0 | 0 | 0 |
10d7d12b77403075618869cc35bda5a7d9d578b9 | 1,455 | py | Python | scitbx/math/tests/tst_clustering.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/math/tests/tst_clustering.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/math/tests/tst_clustering.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
from scitbx.math import clustering
from scitbx.array_family import flex
if __name__ == '__main__':
run()
| 28.529412 | 64 | 0.674914 | from __future__ import division
from scitbx.math import clustering
from scitbx.array_family import flex
def exercise_two_means_clustering():
data = flex.double((0.21947204867684716, 0.21947204867684716,
0.21947204867684716, 0.21947204867684714))
c = clustering.two_means(data)
assert c.cut =... | 1,246 | 0 | 69 |
95e053b693847088eeed92013a6b6f163fcdcf33 | 486 | py | Python | Python/swap_case.py | not4YU5H/hacktoberfest2021-2 | ae3d17f8bef81aa79231ee07db46a79841b4b06b | [
"CC0-1.0"
] | 81 | 2021-10-01T13:19:13.000Z | 2021-10-06T08:43:35.000Z | Python/swap_case.py | not4YU5H/hacktoberfest2021-2 | ae3d17f8bef81aa79231ee07db46a79841b4b06b | [
"CC0-1.0"
] | 67 | 2021-10-01T13:43:46.000Z | 2021-10-06T13:55:49.000Z | Python/swap_case.py | not4YU5H/hacktoberfest2021-2 | ae3d17f8bef81aa79231ee07db46a79841b4b06b | [
"CC0-1.0"
] | 394 | 2021-10-01T11:55:24.000Z | 2021-10-06T13:45:57.000Z | s=input("Enter a string:")
swap_case(s) #Calling the function
| 44.181818 | 96 | 0.666667 | def swap_case(s): #Defining a function called swap_case
res=''
for letter in s:
if(letter.islower()): #Returns true if the characters in the string are in lowercase
res=res+letter.upper() #Converting the lowercase characters to uppercase characters
else:
res... | 394 | 0 | 22 |
e78773d384028036541cb2d6b7311f197a6eebdf | 1,297 | py | Python | textblob/src/textblob_inference.py | arsalanc-v2/mailsense | 36e4c00c6fc26f0aa334a3f46b6d77f2306bf814 | [
"Unlicense"
] | 1 | 2019-08-13T06:40:18.000Z | 2019-08-13T06:40:18.000Z | textblob/src/textblob_inference.py | arsalanc-v2/mailsense | 36e4c00c6fc26f0aa334a3f46b6d77f2306bf814 | [
"Unlicense"
] | null | null | null | textblob/src/textblob_inference.py | arsalanc-v2/mailsense | 36e4c00c6fc26f0aa334a3f46b6d77f2306bf814 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import argparse
from textblob import TextBlob
from textblob.en.sentiments import NaiveBayesAnalyzer
import nltk
def initialize_model():
'''Initializes a textblob naive bayes sentiment analysis model.
'''
nltk.download('movie_reviews')
nltk.download('punkt')
# prevent exposing the learner... | 25.94 | 133 | 0.752506 | #!/usr/bin/env python3
import argparse
from textblob import TextBlob
from textblob.en.sentiments import NaiveBayesAnalyzer
import nltk
def initialize_model():
'''Initializes a textblob naive bayes sentiment analysis model.
'''
nltk.download('movie_reviews')
nltk.download('punkt')
# prevent exposing the learner... | 0 | 0 | 0 |
97539967a2d495df3d91856351876bf6945b8a5c | 1,434 | py | Python | hooks/post_gen_project.py | imankulov/cookiecutter-pypackage | 324df28244f0a5b72c6c6ff509030821dae643f1 | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | imankulov/cookiecutter-pypackage | 324df28244f0a5b72c6c6ff509030821dae643f1 | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | imankulov/cookiecutter-pypackage | 324df28244f0a5b72c6c6ff509030821dae643f1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import subprocess
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(filepath):
"""Remove a file if it exists."""
try:
os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
except FileNotFoundError:
pass
def execute(*args, suppress_except... | 24.724138 | 69 | 0.640865 | #!/usr/bin/env python
import os
import subprocess
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(filepath):
"""Remove a file if it exists."""
try:
os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
except FileNotFoundError:
pass
def execute(*args, suppress_except... | 0 | 0 | 0 |
2d7d3a10691e6366de51c95869974e931558d3a9 | 3,768 | py | Python | NeoML/Python/neoml/Dnn/Lrn.py | sergesk/neoml | cca05584ef3d892cb00d23a105bac6674b3d50ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | NeoML/Python/neoml/Dnn/Lrn.py | sergesk/neoml | cca05584ef3d892cb00d23a105bac6674b3d50ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | NeoML/Python/neoml/Dnn/Lrn.py | sergesk/neoml | cca05584ef3d892cb00d23a105bac6674b3d50ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """ Copyright (c) 2017-2021 ABBYY Production LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | 33.345133 | 163 | 0.617569 | """ Copyright (c) 2017-2021 ABBYY Production LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | 518 | 0 | 27 |
9870a55ca362a207d07de3d5671c002a7657fc1e | 23,726 | py | Python | order-1_voronoi/voronoi.py | bzliu94/algorithms | 43ccefd7ea1fd88339bf2afa0b35b0a3bdf6acff | [
"MIT"
] | null | null | null | order-1_voronoi/voronoi.py | bzliu94/algorithms | 43ccefd7ea1fd88339bf2afa0b35b0a3bdf6acff | [
"MIT"
] | null | null | null | order-1_voronoi/voronoi.py | bzliu94/algorithms | 43ccefd7ea1fd88339bf2afa0b35b0a3bdf6acff | [
"MIT"
] | null | null | null | # 2015-05-22
# rgba_value is a four-tuple
import time
time1 = time.clock()
# for event queue, we are using a priority queue
# we may have site events and circle events with same priority
from core.fortune.SweepLine import *
from core.fortune.arc_tree.ArcTree import *
# from core.priority_queue.P... | 32.412568 | 6,016 | 0.608784 | # 2015-05-22
def drawCircleEvent(draw, left_arc, arc, right_arc, l_y, color_triple):
location = CircleEvent.getIntersectionHelper(l_y, left_arc, arc, right_arc)
radius = CircleEvent.distanceFromBisectorIntersectionToContributingSite(l_y, left_arc, arc, right_arc)
# print "radius:", radius
(x, y) ... | 2,428 | -3 | 202 |
db1cf9381b20dc50f9497817357ba99f88e6c0ef | 365 | py | Python | Demo/branch/migrations/0003_auto_20181204_1533.py | 106626/Practical | b0a834a80558048defccf7a27da752b79c43d1fe | [
"Apache-2.0"
] | null | null | null | Demo/branch/migrations/0003_auto_20181204_1533.py | 106626/Practical | b0a834a80558048defccf7a27da752b79c43d1fe | [
"Apache-2.0"
] | null | null | null | Demo/branch/migrations/0003_auto_20181204_1533.py | 106626/Practical | b0a834a80558048defccf7a27da752b79c43d1fe | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.5 on 2018-12-04 07:33
from django.db import migrations, models
| 19.210526 | 49 | 0.575342 | # Generated by Django 2.0.5 on 2018-12-04 07:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('branch', '0002_shop_m'),
]
operations = [
migrations.AlterField(
model_name='shop',
name='m',
field=mode... | 0 | 251 | 23 |
0167343c21281a26ff48df3fdfeaed47c5892e24 | 6,366 | py | Python | FinalProject/EVS_GUI/resources/text/python_template.py | CAP1Sup/SieskoPythonLabs | 3a0525b4feb88ad865db3f0bc30ce4e3290358f7 | [
"MIT"
] | null | null | null | FinalProject/EVS_GUI/resources/text/python_template.py | CAP1Sup/SieskoPythonLabs | 3a0525b4feb88ad865db3f0bc30ce4e3290358f7 | [
"MIT"
] | null | null | null | FinalProject/EVS_GUI/resources/text/python_template.py | CAP1Sup/SieskoPythonLabs | 3a0525b4feb88ad865db3f0bc30ce4e3290358f7 | [
"MIT"
] | null | null | null | import time
import edgeiq
import pyfrc
from networktables import NetworkTables
import logging
import numpy as np
# Constant for the default confidence (0 being 0% sure and 1 being 100% sure)
default_conf_thres = .75
# TODO: Order the predictions in terms of priority (proximity?)
if __name__ == "__main__":
main(... | 36.586207 | 174 | 0.55011 | import time
import edgeiq
import pyfrc
from networktables import NetworkTables
import logging
import numpy as np
# Constant for the default confidence (0 being 0% sure and 1 being 100% sure)
default_conf_thres = .75
# TODO: Order the predictions in terms of priority (proximity?)
def main():
# Allow Rio to boot a... | 6,022 | 0 | 23 |
0e0d28b9238de2847acd048be139c0f913e7d6f9 | 1,044 | py | Python | ratings/tests/runtests.py | atheiste/django-generic-ratings | 2ea43877630bce56b9f0c7d20de1c7850dba8403 | [
"MIT"
] | null | null | null | ratings/tests/runtests.py | atheiste/django-generic-ratings | 2ea43877630bce56b9f0c7d20de1c7850dba8403 | [
"MIT"
] | null | null | null | ratings/tests/runtests.py | atheiste/django-generic-ratings | 2ea43877630bce56b9f0c7d20de1c7850dba8403 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This script is a trick to setup a fake Django environment, since this reusable
app will be developed and tested outside any specifiv Django project.
Via ``settings.configure`` you will be able to set all necessary settings
for your app and run the tests as if you were calling ``./manage.py te... | 23.2 | 78 | 0.719349 | #!/usr/bin/env python
"""
This script is a trick to setup a fake Django environment, since this reusable
app will be developed and tested outside any specifiv Django project.
Via ``settings.configure`` you will be able to set all necessary settings
for your app and run the tests as if you were calling ``./manage.py te... | 244 | 0 | 49 |
154ced56da08e4c21bb70b3e6ca95d5794d94f20 | 690 | py | Python | 8.py | eliascmaciiel/infosatc-lp-avaliativo-02 | 0d873907438b05b1eb7c28238cf287bad0de9f83 | [
"MIT"
] | null | null | null | 8.py | eliascmaciiel/infosatc-lp-avaliativo-02 | 0d873907438b05b1eb7c28238cf287bad0de9f83 | [
"MIT"
] | null | null | null | 8.py | eliascmaciiel/infosatc-lp-avaliativo-02 | 0d873907438b05b1eb7c28238cf287bad0de9f83 | [
"MIT"
] | null | null | null | lista_pc = []
lista_pc.append ("Processador Intel Core i9 11900K 11ª geração")
lista_pc.append ("Placa de vídeo NVIDIA GeForce RTX 2080TI 11 GB")
lista_pc.append ("Memória 2x 32GB DDR4 3000Mhz")
lista_pc.append ("HD 4TB Seagate 7200 RPM")
lista_pc.append ("SSD 2TB NVME SN850 Leitura 7000MB/s - Gravação 5300MB/s")
... | 20.294118 | 75 | 0.733333 | lista_pc = []
lista_pc.append ("Processador Intel Core i9 11900K 11ª geração")
lista_pc.append ("Placa de vídeo NVIDIA GeForce RTX 2080TI 11 GB")
lista_pc.append ("Memória 2x 32GB DDR4 3000Mhz")
lista_pc.append ("HD 4TB Seagate 7200 RPM")
lista_pc.append ("SSD 2TB NVME SN850 Leitura 7000MB/s - Gravação 5300MB/s")
... | 0 | 0 | 0 |
77e226c838e3ba2fbc0124b3cc743aa4f7dec4bd | 12,518 | py | Python | src/hooks/build-tag.py | jouvin/scdb | 2e367a79c2f0ece59d30fe46d0a586a6d69b72d5 | [
"Apache-2.0"
] | 1 | 2015-02-12T11:19:18.000Z | 2015-02-12T11:19:18.000Z | src/hooks/build-tag.py | jouvin/scdb | 2e367a79c2f0ece59d30fe46d0a586a6d69b72d5 | [
"Apache-2.0"
] | 12 | 2015-01-09T13:47:08.000Z | 2022-03-23T22:26:17.000Z | src/hooks/build-tag.py | jouvin/scdb | 2e367a79c2f0ece59d30fe46d0a586a6d69b72d5 | [
"Apache-2.0"
] | 4 | 2015-02-12T11:19:33.000Z | 2018-04-05T11:52:50.000Z | #!/usr/bin/python
"""
Script used to compile and deploy a tagged configuration on a deployment server.
This script is intended to be called by SVN post-commit hook script.
"""
__version__ = "1.0.3"
__author__ = "Michel Jouvin <jouvin@lal.in2p3.fr>"
import sys
import os
import re
import shutil
from subprocess impor... | 33.560322 | 151 | 0.718645 | #!/usr/bin/python
"""
Script used to compile and deploy a tagged configuration on a deployment server.
This script is intended to be called by SVN post-commit hook script.
"""
__version__ = "1.0.3"
__author__ = "Michel Jouvin <jouvin@lal.in2p3.fr>"
import sys
import os
import re
import shutil
from subprocess impor... | 390 | 0 | 69 |
22e3e2c5a8e0084d4bbf31891a9ec61c3b9572d0 | 9,623 | py | Python | nicos_mlz/toftof/gui/resolutionpanel.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/toftof/gui/resolutionpanel.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/toftof/gui/resolutionpanel.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 37.44358 | 79 | 0.59285 | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 6,285 | 1,093 | 323 |
0a34ceef7517c0930b6b2e79ec836a3e2e83ece6 | 123 | py | Python | random_password_generator/apps.py | BuilderTron/portfolio_v2 | d87823f4fbdd201a6b739aa197655602eb22e27f | [
"MIT"
] | null | null | null | random_password_generator/apps.py | BuilderTron/portfolio_v2 | d87823f4fbdd201a6b739aa197655602eb22e27f | [
"MIT"
] | 9 | 2021-03-19T01:46:10.000Z | 2022-03-12T00:23:17.000Z | random_password_generator/apps.py | BuilderTron/portfolio_v2 | d87823f4fbdd201a6b739aa197655602eb22e27f | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 20.5 | 47 | 0.821138 | from django.apps import AppConfig
class RandomPasswordGeneratorConfig(AppConfig):
name = 'random_password_generator'
| 0 | 65 | 23 |
b2b18deb75d1457551245ff02d950f3b4d3ae316 | 8,944 | py | Python | test/proxy/python/proxy.py | trjaeger/sauZTP | cfe88724ccd01b1db13d42f0c8c25c3b11c091de | [
"MIT"
] | 1 | 2019-04-01T18:19:09.000Z | 2019-04-01T18:19:09.000Z | test/proxy/python/proxy.py | trjaeger/sauZTP | cfe88724ccd01b1db13d42f0c8c25c3b11c091de | [
"MIT"
] | null | null | null | test/proxy/python/proxy.py | trjaeger/sauZTP | cfe88724ccd01b1db13d42f0c8c25c3b11c091de | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This is some demo code showing how a BRSKI proxy would
find a registrar in an ANIMA network using GRASP. This version
also shows how the proxy could advertise itself by flooding
to on-link nodes seeking a proxy. The actual BRSKI transactions
are not included.
"""
impo... | 34.007605 | 116 | 0.569208 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This is some demo code showing how a BRSKI proxy would
find a registrar in an ANIMA network using GRASP. This version
also shows how the proxy could advertise itself by flooding
to on-link nodes seeking a proxy. The actual BRSKI transactions
are not included.
"""
impo... | 1,494 | 0 | 46 |
5d7ab5ddd92bdd0269a70f7eac2809d02b683942 | 25,157 | py | Python | xdet_v2_resnet_eval.py | jacke121/X-Detector | a24e370a5acb6f5c29cd5db81fa4270f2697b8c1 | [
"Apache-2.0"
] | null | null | null | xdet_v2_resnet_eval.py | jacke121/X-Detector | a24e370a5acb6f5c29cd5db81fa4270f2697b8c1 | [
"Apache-2.0"
] | null | null | null | xdet_v2_resnet_eval.py | jacke121/X-Detector | a24e370a5acb6f5c29cd5db81fa4270f2697b8c1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Changan Wang
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 51.55123 | 242 | 0.655325 | # Copyright 2018 Changan Wang
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 10,990 | 0 | 136 |
7c14ceed74fda1a62c069fe757cd844c073d563d | 248 | py | Python | virtual_testing_machine/test_cases/scenarios/scenario_02_feature_door.py | TobKed/system_test_progress_tracking | 633792e7057289b6a23db30c6353241123eaa2e4 | [
"MIT"
] | null | null | null | virtual_testing_machine/test_cases/scenarios/scenario_02_feature_door.py | TobKed/system_test_progress_tracking | 633792e7057289b6a23db30c6353241123eaa2e4 | [
"MIT"
] | 3 | 2020-02-11T23:29:05.000Z | 2021-06-10T21:03:42.000Z | virtual_testing_machine/test_cases/scenarios/scenario_02_feature_door.py | TobKed/system_test_progress_tracking | 633792e7057289b6a23db30c6353241123eaa2e4 | [
"MIT"
] | 2 | 2019-01-24T20:39:31.000Z | 2019-01-29T07:42:27.000Z | import os
from run import TEST_CASES_DIR, run_test_case
FEATURE_DIR = os.path.join(TEST_CASES_DIR, "02_feature_door")
run_test_case(os.path.join(FEATURE_DIR, "01_01_test_door.py"))
run_test_case(os.path.join(FEATURE_DIR, "01_02_test_door.py"))
| 24.8 | 62 | 0.806452 | import os
from run import TEST_CASES_DIR, run_test_case
FEATURE_DIR = os.path.join(TEST_CASES_DIR, "02_feature_door")
run_test_case(os.path.join(FEATURE_DIR, "01_01_test_door.py"))
run_test_case(os.path.join(FEATURE_DIR, "01_02_test_door.py"))
| 0 | 0 | 0 |
898a47ba58e4d76c8114799cae5641740842da98 | 8,639 | py | Python | delight/utils.py | sylvielsstfr/Delight | 67202a27061dee33cb162ca382d11e4994189644 | [
"MIT"
] | 1 | 2021-12-01T10:30:08.000Z | 2021-12-01T10:30:08.000Z | delight/utils.py | sylvielsstfr/Delight | 67202a27061dee33cb162ca382d11e4994189644 | [
"MIT"
] | null | null | null | delight/utils.py | sylvielsstfr/Delight | 67202a27061dee33cb162ca382d11e4994189644 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from scipy.misc import derivative
import logging
import coloredlogs
logger = logging.getLogger(__name__)
coloredlogs.install(level='DEBUG', logger=logger,fmt='%(asctime)s,%(msecs)03d %(programname)s, %(name)s[%(process)d] %(levelname)s %(message)s')
class approx_DL():
... | 33.878431 | 144 | 0.588378 | # -*- coding: utf-8 -*-
import numpy as np
from scipy.misc import derivative
import logging
import coloredlogs
logger = logging.getLogger(__name__)
coloredlogs.install(level='DEBUG', logger=logger,fmt='%(asctime)s,%(msecs)03d %(programname)s, %(name)s[%(process)d] %(levelname)s %(message)s')
class approx_DL():
... | 2,627 | 0 | 172 |
b43b66969da9d5c75993dba739b75157d8fbb171 | 2,523 | py | Python | tests/functional/test_project.py | johnson2427/ape | e0dbce86d7ddb4574df109f443718f19dc183608 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_project.py | johnson2427/ape | e0dbce86d7ddb4574df109f443718f19dc183608 | [
"Apache-2.0"
] | 1 | 2022-02-12T01:31:16.000Z | 2022-02-22T00:26:49.000Z | tests/functional/test_project.py | johnson2427/ape | e0dbce86d7ddb4574df109f443718f19dc183608 | [
"Apache-2.0"
] | null | null | null | import shutil
from pathlib import Path
from typing import Dict
import pytest
from ethpm_types.manifest import PackageManifest
@pytest.fixture
@pytest.fixture
| 34.094595 | 93 | 0.69679 | import shutil
from pathlib import Path
from typing import Dict
import pytest
from ethpm_types.manifest import PackageManifest
@pytest.fixture
def oz_dependencies_config():
def _create_oz_dependency(version: str) -> Dict:
return {
"name": "OpenZeppelin",
"version": version,
... | 2,220 | 0 | 136 |
403cae85c33da984cd08376206f2ec096653241d | 10,339 | py | Python | nate/svonet/svo_degree_over_time.py | UWNETLAB/nelanna | 9029670d5804f478cac2e83d77ff86ff2a7266c2 | [
"MIT"
] | 8 | 2020-02-09T15:39:49.000Z | 2022-02-06T14:35:08.000Z | nate/svonet/svo_degree_over_time.py | UWNETLAB/nlpnet | 9029670d5804f478cac2e83d77ff86ff2a7266c2 | [
"MIT"
] | 11 | 2020-03-13T18:46:46.000Z | 2020-04-02T18:58:57.000Z | nate/svonet/svo_degree_over_time.py | UWNETLAB/nlpnet | 9029670d5804f478cac2e83d77ff86ff2a7266c2 | [
"MIT"
] | 1 | 2020-08-05T19:08:50.000Z | 2020-08-05T19:08:50.000Z | from nate.svonet.graph_svo import generate_ticks, find_max_burst
import networkx as nx
import stop_words as sw
import copy
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.ticker import MaxNLocator
import numpy as np
from multiprocessing impo... | 31.521341 | 101 | 0.531096 | from nate.svonet.graph_svo import generate_ticks, find_max_burst
import networkx as nx
import stop_words as sw
import copy
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.ticker import MaxNLocator
import numpy as np
from multiprocessing impo... | 3,800 | 6,129 | 46 |
754a6c1d143fcb676f1d4c3d66b7498268b5da30 | 1,929 | py | Python | opentargets_validator/cli.py | pcm32/validator | 711c098df9c82e66ff9b95412f4561c28a63b572 | [
"Apache-2.0"
] | null | null | null | opentargets_validator/cli.py | pcm32/validator | 711c098df9c82e66ff9b95412f4561c28a63b572 | [
"Apache-2.0"
] | null | null | null | opentargets_validator/cli.py | pcm32/validator | 711c098df9c82e66ff9b95412f4561c28a63b572 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, absolute_import
from __future__ import unicode_literals
import argparse
import logging
import logging.config
import sys
from opentargets_validator.helpers import file_or_resource, URLZSource
from opentargets_validator.validator import validate
if __name__ == '__main__':
sy... | 35.072727 | 77 | 0.635044 | from __future__ import print_function, absolute_import
from __future__ import unicode_literals
import argparse
import logging
import logging.config
import sys
from opentargets_validator.helpers import file_or_resource, URLZSource
from opentargets_validator.validator import validate
def main():
logging.config.fil... | 1,571 | 0 | 23 |
fa18577018997090e59693b955ae9745e82a58ed | 2,891 | py | Python | salt/pillar/sqlite3.py | bechtoldt/salt | 01dfa10dee93163b25400b4aac884aa9e35209b7 | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | salt/pillar/sqlite3.py | bechtoldt/salt | 01dfa10dee93163b25400b4aac884aa9e35209b7 | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/pillar/sqlite3.py | bechtoldt/salt | 01dfa10dee93163b25400b4aac884aa9e35209b7 | [
"Apache-2.0"
] | 1 | 2018-04-19T16:57:27.000Z | 2018-04-19T16:57:27.000Z | # -*- coding: utf-8 -*-
'''
Retrieve Pillar data by doing a SQLite3 query
sqlite3 is included in the stdlib since python2.5.
This module is a concrete implementation of the sql_base ext_pillar for SQLite3.
:maturity: new
:platform: all
Configuring the sqlite3 ext_pillar
=====================================
Use th... | 25.13913 | 80 | 0.593912 | # -*- coding: utf-8 -*-
'''
Retrieve Pillar data by doing a SQLite3 query
sqlite3 is included in the stdlib since python2.5.
This module is a concrete implementation of the sql_base ext_pillar for SQLite3.
:maturity: new
:platform: all
Configuring the sqlite3 ext_pillar
=====================================
Use th... | 35 | 0 | 49 |
2bbc149f725af8a385294ee1d15436db3b85e8a0 | 1,181 | py | Python | mlgo/datatraining/feature_selection.py | binary-warriors/ML-GO | f2572a4de5fd6361b26166cb022e6f60ba53f34b | [
"MIT"
] | 5 | 2019-01-27T11:56:46.000Z | 2019-12-30T04:18:38.000Z | mlgo/datatraining/feature_selection.py | binary-warriors/ML-GO | f2572a4de5fd6361b26166cb022e6f60ba53f34b | [
"MIT"
] | 2 | 2019-11-20T21:21:28.000Z | 2019-11-20T21:21:34.000Z | mlgo/datatraining/feature_selection.py | binary-warriors/ML-GO | f2572a4de5fd6361b26166cb022e6f60ba53f34b | [
"MIT"
] | 1 | 2019-02-15T07:19:58.000Z | 2019-02-15T07:19:58.000Z | from sklearn.feature_selection import chi2
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import VarianceThreshold
'''
For regression: f_regression, mutual_info_regression
For classification: chi2, f_classif, mutual_info_classif
'''
'''
threshold=0.0 means keeps only ... | 32.805556 | 108 | 0.7663 | from sklearn.feature_selection import chi2
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import VarianceThreshold
'''
For regression: f_regression, mutual_info_regression
For classification: chi2, f_classif, mutual_info_classif
'''
def select_k_best(train_features, train_... | 772 | 0 | 46 |
04c090bc596623aa03893dd697bfb5985cdcf597 | 3,679 | py | Python | cdk_bootstrap_multiple_accounts.py | raajheshkannaa/cdk-booty-strappin | b2351c0347325245dbbfaa1693842f7538a3ee32 | [
"MIT"
] | 2 | 2021-12-05T15:05:06.000Z | 2022-01-23T17:55:31.000Z | cdk_bootstrap_multiple_accounts.py | raajheshkannaa/cdk-booty-strappin | b2351c0347325245dbbfaa1693842f7538a3ee32 | [
"MIT"
] | null | null | null | cdk_bootstrap_multiple_accounts.py | raajheshkannaa/cdk-booty-strappin | b2351c0347325245dbbfaa1693842f7538a3ee32 | [
"MIT"
] | null | null | null | import boto3
import subprocess
# By default since code is run from the Organizations account, the account is trusted. Use this variable to add another account as trusted such as an Automation or Security account, from where CI/CD pipelines will be run. If you don't need or have a dedicated account, just use the Organi... | 40.428571 | 339 | 0.74966 | import boto3
import subprocess
# By default since code is run from the Organizations account, the account is trusted. Use this variable to add another account as trusted such as an Automation or Security account, from where CI/CD pipelines will be run. If you don't need or have a dedicated account, just use the Organi... | 865 | 0 | 46 |
853f4afc4fa2639432fa9b0f42ef8eb867e6190c | 803 | py | Python | Pythagorean-triplet.py | Shahibur50/ClassWork | 0fb8787668a55b7a722fa9a4920e2ab8fdad0f90 | [
"MIT"
] | 1 | 2021-01-02T17:51:18.000Z | 2021-01-02T17:51:18.000Z | Pythagorean-triplet.py | Shahibur50/ClassWork | 0fb8787668a55b7a722fa9a4920e2ab8fdad0f90 | [
"MIT"
] | null | null | null | Pythagorean-triplet.py | Shahibur50/ClassWork | 0fb8787668a55b7a722fa9a4920e2ab8fdad0f90 | [
"MIT"
] | null | null | null | """
Pythagorean triplet version 1.2.10.20
Copyright (c) 2020 Shahibur Rahaman
Licensed under MIT
"""
print("--------------------------------------------------------")
print("")
hypo = float(input("Enter the length of hypotenuse of triangle: "))
base = float(input("Enter the length of base of triangle: "))
height = fl... | 29.740741 | 84 | 0.594022 | """
Pythagorean triplet version 1.2.10.20
Copyright (c) 2020 Shahibur Rahaman
Licensed under MIT
"""
print("--------------------------------------------------------")
print("")
hypo = float(input("Enter the length of hypotenuse of triangle: "))
base = float(input("Enter the length of base of triangle: "))
height = fl... | 0 | 0 | 0 |
eb0678a6fd7cd4344e63da96a41c39051eae2505 | 354 | py | Python | scripts/export_query_registry.py | pydefi/pytelliot | 8dd761dfd11986aa818e7a9faf2560929113b104 | [
"MIT"
] | null | null | null | scripts/export_query_registry.py | pydefi/pytelliot | 8dd761dfd11986aa818e7a9faf2560929113b104 | [
"MIT"
] | null | null | null | scripts/export_query_registry.py | pydefi/pytelliot | 8dd761dfd11986aa818e7a9faf2560929113b104 | [
"MIT"
] | 1 | 2021-09-02T20:53:58.000Z | 2021-09-02T20:53:58.000Z | """ This script exports the tellor query registry to json
"""
from telliot.queries.query_registry import query_registry
from telliot.queries.query_registry import QueryRegistry
exported = query_registry.json(indent=2)
print(exported)
with open("query_registry_export.json", "w") as f:
f.write(exported)
imported = ... | 29.5 | 57 | 0.799435 | """ This script exports the tellor query registry to json
"""
from telliot.queries.query_registry import query_registry
from telliot.queries.query_registry import QueryRegistry
exported = query_registry.json(indent=2)
print(exported)
with open("query_registry_export.json", "w") as f:
f.write(exported)
imported = ... | 0 | 0 | 0 |
a1e3fad1e1a7bc46013cb4d166ba1d07fbd00d7d | 1,083 | py | Python | genomics_data_index/api/query/impl/cluster/ClusterScoreMRCAJaccard.py | apetkau/genomics-data-index | d0cc119fd57b8cbd701affb1c84450cf7832fa01 | [
"Apache-2.0"
] | 12 | 2021-05-03T20:56:05.000Z | 2022-01-04T14:52:19.000Z | genomics_data_index/api/query/impl/cluster/ClusterScoreMRCAJaccard.py | apetkau/thesis-index | 6c96e9ed75d8e661437effe62a939727a0b473fc | [
"Apache-2.0"
] | 30 | 2021-04-26T23:03:40.000Z | 2022-02-25T18:41:14.000Z | genomics_data_index/api/query/impl/cluster/ClusterScoreMRCAJaccard.py | apetkau/genomics-data-index | d0cc119fd57b8cbd701affb1c84450cf7832fa01 | [
"Apache-2.0"
] | null | null | null | from typing import Union
from genomics_data_index.api.query.SamplesQuery import SamplesQuery
from genomics_data_index.api.query.impl.cluster.ClusterScoreMethod import ClusterScoreMethod
from genomics_data_index.storage.SampleSet import SampleSet
class ClusterScoreMRCAJaccard(ClusterScoreMethod):
"""
A method... | 38.678571 | 118 | 0.707295 | from typing import Union
from genomics_data_index.api.query.SamplesQuery import SamplesQuery
from genomics_data_index.api.query.impl.cluster.ClusterScoreMethod import ClusterScoreMethod
from genomics_data_index.storage.SampleSet import SampleSet
class ClusterScoreMRCAJaccard(ClusterScoreMethod):
"""
A method... | 567 | 0 | 54 |
4c66b633ac0f09d8e046115d5ab4a772dd56c954 | 17,967 | py | Python | torchreid/data/datasets/dataset.py | dhenisdj/deep-object-reid | 9c6eed99b6d2f22fccac82ff4b3f8e3adc10fde7 | [
"MIT"
] | 1 | 2020-09-27T08:40:42.000Z | 2020-09-27T08:40:42.000Z | torchreid/data/datasets/dataset.py | dhenisdj/deep-object-reid | 9c6eed99b6d2f22fccac82ff4b3f8e3adc10fde7 | [
"MIT"
] | null | null | null | torchreid/data/datasets/dataset.py | dhenisdj/deep-object-reid | 9c6eed99b6d2f22fccac82ff4b3f8e3adc10fde7 | [
"MIT"
] | null | null | null | from __future__ import division, print_function, absolute_import
import copy
import os.path as osp
from collections import defaultdict
import numpy as np
import tarfile
import zipfile
import torch
import operator
from torchreid.utils import read_image, download_url, mkdir_if_missing
class Dataset:
"""An abstra... | 34.618497 | 99 | 0.559136 | from __future__ import division, print_function, absolute_import
import copy
import os.path as osp
from collections import defaultdict
import numpy as np
import tarfile
import zipfile
import torch
import operator
from torchreid.utils import read_image, download_url, mkdir_if_missing
class Dataset:
"""An abstra... | 9,985 | 0 | 401 |
9cd519fd3a4ef5beb68b9c3624d78ce13ce54dab | 1,421 | py | Python | No_0168_Excel Sheet Column Title/excel_shhet_column_title_by_recursive.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | 32 | 2020-01-05T13:37:16.000Z | 2022-03-26T07:27:09.000Z | No_0168_Excel Sheet Column Title/excel_shhet_column_title_by_recursive.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | null | null | null | No_0168_Excel Sheet Column Title/excel_shhet_column_title_by_recursive.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | 8 | 2020-06-18T16:17:27.000Z | 2022-03-15T23:58:18.000Z | '''
Description:
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
For example:
1 -> A
2 -> B
3 -> C
...
26 -> Z
27 -> AA
28 -> AB
...
Example 1:
Input: 1
Output: "A"
Example 2:
Input: 28
Output: "AB"
Example 3:
Input: 701
Output: "ZY"
... | 15.966292 | 98 | 0.539057 | '''
Description:
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
For example:
1 -> A
2 -> B
3 -> C
...
26 -> Z
27 -> AA
28 -> AB
...
Example 1:
Input: 1
Output: "A"
Example 2:
Input: 28
Output: "AB"
Example 3:
Input: 701
Output: "ZY"
... | 656 | -6 | 72 |
826f599c76249c92080a3a5fdfac7f4b1c7020f4 | 2,164 | py | Python | checkov/common/images/image_referencer.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | checkov/common/images/image_referencer.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | checkov/common/images/image_referencer.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import logging
from abc import abstractmethod
from typing import cast
import docker
| 33.292308 | 144 | 0.628928 | from __future__ import annotations
import logging
from abc import abstractmethod
from typing import cast
import docker
class Image:
def __init__(self, file_path: str, name: str, image_id: str, start_line: int, end_line: int) -> None:
"""
:param file_path: example: 'checkov/integration_tests/exa... | 0 | 1,995 | 46 |
2c5c8dd1e6c25291a9b6f7d2f216afabe215b161 | 3,527 | py | Python | swm-master/swm-master/calc/misc/diss_vis.py | m2lines/subgrid | 3de5d14c5525a62529d43cbafccda716c74e32df | [
"MIT"
] | 1 | 2021-11-03T01:27:16.000Z | 2021-11-03T01:27:16.000Z | swm-master/swm-master/calc/misc/diss_vis.py | m2lines/subgrid | 3de5d14c5525a62529d43cbafccda716c74e32df | [
"MIT"
] | null | null | null | swm-master/swm-master/calc/misc/diss_vis.py | m2lines/subgrid | 3de5d14c5525a62529d43cbafccda716c74e32df | [
"MIT"
] | 1 | 2021-06-24T15:58:32.000Z | 2021-06-24T15:58:32.000Z | ## UNDERSTANDING DISSIPATION
from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
from scipy.integrate import cumtrapz
import matplotlib.pyplot as plt
import time as tictoc
from netCDF4 import Dataset
i... | 24.493056 | 91 | 0.622625 | ## UNDERSTANDING DISSIPATION
from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
from scipy.integrate import cumtrapz
import matplotlib.pyplot as plt
import time as tictoc
from netCDF4 import Dataset
i... | 1,204 | 0 | 50 |
1f960740fdf359a3f5a455f685d9e6216838c47e | 1,877 | py | Python | ssl_image_classification/algorithms/ict.py | JanMarcelKezmann/Semi-Supervised-Learning-Image-Classification | b32599d1a5f28beefb4f9a744087e1dc47bd9906 | [
"MIT"
] | 4 | 2021-04-16T18:56:46.000Z | 2021-11-18T07:14:04.000Z | ssl_image_classification/algorithms/ict.py | JanMarcelKezmann/Semi-Supervised-Learning-Image-Classification | b32599d1a5f28beefb4f9a744087e1dc47bd9906 | [
"MIT"
] | 2 | 2022-02-05T16:55:14.000Z | 2022-03-06T11:04:23.000Z | ssl_image_classification/algorithms/ict.py | JanMarcelKezmann/Semi-Supervised-Learning-Image-Classification | b32599d1a5f28beefb4f9a744087e1dc47bd9906 | [
"MIT"
] | 2 | 2022-02-08T12:43:49.000Z | 2022-03-06T10:47:56.000Z | import tensorflow as tf
from ..libml.data_augmentations import weak_augment, medium_augment, strong_augment
def ict(x, u, height, width):
"""
Applies medium augmentations on inputs x and u returns augmented tensors.
Args:
x: tensor, labeled batch of images of shape [batch, height, width... | 39.104167 | 103 | 0.700053 | import tensorflow as tf
from ..libml.data_augmentations import weak_augment, medium_augment, strong_augment
def ict(x, u, height, width):
"""
Applies medium augmentations on inputs x and u returns augmented tensors.
Args:
x: tensor, labeled batch of images of shape [batch, height, width... | 0 | 0 | 0 |
e05ecb607217b90e55bf40931bf9023577bb0eeb | 517 | py | Python | tests/MenderAPI/__init__.py | bboozzoo/mender-integration | e9e5df47f09adf14ea18d5d7d536f1eb05af568e | [
"Apache-2.0"
] | null | null | null | tests/MenderAPI/__init__.py | bboozzoo/mender-integration | e9e5df47f09adf14ea18d5d7d536f1eb05af568e | [
"Apache-2.0"
] | null | null | null | tests/MenderAPI/__init__.py | bboozzoo/mender-integration | e9e5df47f09adf14ea18d5d7d536f1eb05af568e | [
"Apache-2.0"
] | null | null | null | import os
import logging
api_version = os.getenv("MENDER_API_VERSION", "v1")
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
#logging.getLogger("paramiko").setLevel(logging.DEBUG)
logging.info("Setting api_version as: " + api_version)
import authentication
import admission
import deployments
import art... | 21.541667 | 54 | 0.798839 | import os
import logging
api_version = os.getenv("MENDER_API_VERSION", "v1")
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
#logging.getLogger("paramiko").setLevel(logging.DEBUG)
logging.info("Setting api_version as: " + api_version)
import authentication
import admission
import deployments
import art... | 0 | 0 | 0 |
fc774541c6946966d63e7a063e2bc4711c1e05a0 | 3,228 | py | Python | ooobuild/lo/awt/x_text_component.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/awt/x_text_component.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/awt/x_text_component.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.339806 | 130 | 0.656753 | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 0 | 0 | 0 |
a5a2784e76badd805508193534eb920041b18a3b | 699 | py | Python | examples/parametric/hyperparameters.py | vishalbelsare/skpro | 05f0df076db777946f317117d6cc66f2dd54259b | [
"BSD-3-Clause"
] | 112 | 2018-01-03T18:37:30.000Z | 2021-11-03T13:47:22.000Z | examples/parametric/hyperparameters.py | vishalbelsare/skpro | 05f0df076db777946f317117d6cc66f2dd54259b | [
"BSD-3-Clause"
] | 6 | 2018-09-04T14:06:32.000Z | 2020-05-14T12:15:21.000Z | examples/parametric/hyperparameters.py | vishalbelsare/skpro | 05f0df076db777946f317117d6cc66f2dd54259b | [
"BSD-3-Clause"
] | 16 | 2018-01-05T04:01:42.000Z | 2021-03-12T20:28:43.000Z | from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets.base import load_boston
from sklearn.model_selection import GridSearchCV
from skpro.parametric import ParametricEstimator
from skpro.parametric.estimators import Constant
model = ParametricEstimator(
point=RandomForestRegressor(),
std=Co... | 31.772727 | 81 | 0.778255 | from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets.base import load_boston
from sklearn.model_selection import GridSearchCV
from skpro.parametric import ParametricEstimator
from skpro.parametric.estimators import Constant
model = ParametricEstimator(
point=RandomForestRegressor(),
std=Co... | 0 | 0 | 0 |
c37a9609915afb8e7ef58422b09882edd6503e3d | 211 | py | Python | zcls/config/key_word.py | ZJCV/ZCls | d67d2c69cc3607a3514c1daadabe51f50c820efa | [
"Apache-2.0"
] | 110 | 2021-02-04T14:32:57.000Z | 2022-03-30T01:51:56.000Z | zcls/config/key_word.py | ZJCV/ZCls | d67d2c69cc3607a3514c1daadabe51f50c820efa | [
"Apache-2.0"
] | 8 | 2021-04-11T02:46:57.000Z | 2021-12-14T19:30:58.000Z | zcls/config/key_word.py | ZJCV/ZCls | d67d2c69cc3607a3514c1daadabe51f50c820efa | [
"Apache-2.0"
] | 20 | 2021-02-07T14:17:07.000Z | 2022-03-22T05:20:40.000Z | # -*- coding: utf-8 -*-
"""
@date: 2020/12/28 上午10:35
@file: key_word.py
@author: zj
@description:
"""
KEY_OUTPUT = 'output'
KEY_LOSS = 'loss'
KEY_SEP = ',,'
KEY_DATASET = 'data.csv'
KEY_CLASSES = 'cls.csv'
| 13.1875 | 25 | 0.620853 | # -*- coding: utf-8 -*-
"""
@date: 2020/12/28 上午10:35
@file: key_word.py
@author: zj
@description:
"""
KEY_OUTPUT = 'output'
KEY_LOSS = 'loss'
KEY_SEP = ',,'
KEY_DATASET = 'data.csv'
KEY_CLASSES = 'cls.csv'
| 0 | 0 | 0 |
ed8efbdb00fb38ff596c2045914cfe1da2114b38 | 2,053 | py | Python | Desktop Application/Intermediate/Python/Space War/start.py | jyothi-k-g/Project-Guidance | a49c0576992739b8104694db5fdc1d5e50b96b8d | [
"MIT"
] | 1 | 2022-03-03T09:30:07.000Z | 2022-03-03T09:30:07.000Z | Desktop Application/Intermediate/Python/Space War/start.py | srinjoy-26/Project-Guidance | 504f37e8f7566db2d1bca873df7dd1fff5368497 | [
"MIT"
] | null | null | null | Desktop Application/Intermediate/Python/Space War/start.py | srinjoy-26/Project-Guidance | 504f37e8f7566db2d1bca873df7dd1fff5368497 | [
"MIT"
] | null | null | null | import pygame
import random
screen_size = [360, 600]
screen = pygame.display.set_mode(screen_size)
score = 0
green = (0, 255, 0)
pygame.font.init()
background = load('./img/space_open_space_planets_135213_360x640.jpg')
kill = load('./img/meteorBrown_med1.png')
user = load('./img/playerShip1_orange.png')
user_x =... | 25.036585 | 70 | 0.636142 | import pygame
import random
screen_size = [360, 600]
screen = pygame.display.set_mode(screen_size)
score = 0
green = (0, 255, 0)
pygame.font.init()
def load(name):
return pygame.image.load(name)
def display_score(score):
font = pygame.font.SysFont('Comic Sans MS', 30)
score_text = 'Score: ' + str(score... | 415 | 0 | 94 |
9852a9743ebe111d6a6600ed36b5f23c5f1b2da1 | 1,756 | py | Python | tests/functions/test_is_after.py | RDFLib/timefuncs | dd3bde87277327e14cf1cde34dc5b682679f9c51 | [
"BSD-3-Clause"
] | 3 | 2021-07-28T21:17:11.000Z | 2021-07-31T10:09:08.000Z | tests/functions/test_is_after.py | RDFLib/timefuncs | dd3bde87277327e14cf1cde34dc5b682679f9c51 | [
"BSD-3-Clause"
] | 1 | 2021-07-26T00:20:21.000Z | 2021-07-26T00:37:26.000Z | tests/functions/test_is_after.py | RDFLib/timefuncs | dd3bde87277327e14cf1cde34dc5b682679f9c51 | [
"BSD-3-Clause"
] | 1 | 2021-07-25T04:38:29.000Z | 2021-07-25T04:38:29.000Z | from pathlib import Path
from rdflib import Graph, Namespace
from rdflib.namespace import TIME
import sys
sys.path.append(str(Path(__file__).parent.parent))
from timefuncs import is_after
TFUN = Namespace("https://w3id.org/timefuncs/")
AFTER = Namespace("https://w3id.org/timefuncs/testdata/after/")
tests_dir = Path(... | 29.266667 | 63 | 0.545558 | from pathlib import Path
from rdflib import Graph, Namespace
from rdflib.namespace import TIME
import sys
sys.path.append(str(Path(__file__).parent.parent))
from timefuncs import is_after
TFUN = Namespace("https://w3id.org/timefuncs/")
AFTER = Namespace("https://w3id.org/timefuncs/testdata/after/")
tests_dir = Path(... | 1,395 | 0 | 23 |
3ebd3c71dfa1ea303fc134c90d4f8e5e2d5ca17a | 139 | py | Python | nipype/interfaces/slicer/quantification/__init__.py | nicholsn/nipype | 6601b00aac39d17bb9fb3a6801f5a740a6ebb1e3 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | nipype/interfaces/slicer/quantification/__init__.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/slicer/quantification/__init__.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:31:47.000Z | 2021-09-08T14:31:47.000Z | from changequantification import IntensityDifferenceMetric
from petstandarduptakevaluecomputation import PETStandardUptakeValueComputation
| 46.333333 | 79 | 0.942446 | from changequantification import IntensityDifferenceMetric
from petstandarduptakevaluecomputation import PETStandardUptakeValueComputation
| 0 | 0 | 0 |
36317a053a8be6fb26945b4292d2831da3f97d2f | 1,497 | py | Python | model/metric.py | jinchenglee/pytorch-visual-perception | b23484fd4f1bc9bb91297c256e3159d38a5fe2ea | [
"MIT"
] | null | null | null | model/metric.py | jinchenglee/pytorch-visual-perception | b23484fd4f1bc9bb91297c256e3159d38a5fe2ea | [
"MIT"
] | null | null | null | model/metric.py | jinchenglee/pytorch-visual-perception | b23484fd4f1bc9bb91297c256e3159d38a5fe2ea | [
"MIT"
] | null | null | null | import torch
| 35.642857 | 92 | 0.628591 | import torch
def precision(y_pred, y_true, threshold=0.5, eps=1e-9):
with torch.no_grad():
y_pred = torch.ge(y_pred.float(), threshold).float()
y_true = y_true.float()
# 'dim=0' reduce along class dimension
# 'dim=1' reduce along per-sample dimension
true_positive = (y_pre... | 1,414 | 0 | 69 |
8ec2f5f3410185cdaa7896f720b95d2072093970 | 81 | py | Python | django/CVE-2017-12794/xss/apps.py | nobgr/vulhub | b24a89459fbd98ba76881adb6d4e2fb376792863 | [
"MIT"
] | 9,681 | 2017-09-16T12:31:59.000Z | 2022-03-31T23:49:31.000Z | django/CVE-2017-12794/xss/apps.py | dingafter/vulhub | 67547c4ca153980004ccaeab94f77bcc9952d764 | [
"MIT"
] | 180 | 2017-11-01T08:05:07.000Z | 2022-03-31T05:26:33.000Z | django/CVE-2017-12794/xss/apps.py | dingafter/vulhub | 67547c4ca153980004ccaeab94f77bcc9952d764 | [
"MIT"
] | 3,399 | 2017-09-16T12:21:54.000Z | 2022-03-31T12:28:48.000Z | from django.apps import AppConfig
| 13.5 | 33 | 0.728395 | from django.apps import AppConfig
class XssConfig(AppConfig):
name = 'xss'
| 0 | 23 | 23 |
7c77ee13b9ff115b15cacbf33ff5d51bc57ca48d | 12,013 | py | Python | src/sentry/integrations/slack/utils.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/integrations/slack/utils.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/integrations/slack/utils.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import logging
from django.core.cache import cache
from django.core.urlresolvers import reverse
from sentry import http
from sentry import tagstore
from sentry.api.fields.actor import Actor
from sentry.incidents.logic import get_incident_aggregates
from sentry.incidents.models ... | 30.259446 | 98 | 0.621077 | from __future__ import absolute_import
import logging
from django.core.cache import cache
from django.core.urlresolvers import reverse
from sentry import http
from sentry import tagstore
from sentry.api.fields.actor import Actor
from sentry.incidents.logic import get_incident_aggregates
from sentry.incidents.models ... | 8,725 | 0 | 276 |
89ad0ad6e43eff28375eb4a00e494e71c34c168e | 4,472 | py | Python | scripts/driver_2dmast.py | vandalt/ImPlaneIA | 72b22e487ef45a8a665e4a6a88a91e99e382fdd0 | [
"BSD-3-Clause"
] | 6 | 2020-03-03T16:15:40.000Z | 2022-03-23T16:15:09.000Z | scripts/driver_2dmast.py | vandalt/ImPlaneIA | 72b22e487ef45a8a665e4a6a88a91e99e382fdd0 | [
"BSD-3-Clause"
] | 5 | 2020-02-03T17:46:59.000Z | 2022-03-07T20:00:59.000Z | scripts/driver_2dmast.py | vandalt/ImPlaneIA | 72b22e487ef45a8a665e4a6a88a91e99e382fdd0 | [
"BSD-3-Clause"
] | 1 | 2021-07-06T23:02:01.000Z | 2021-07-06T23:02:01.000Z | #! /usr/bin/env python
import os
import numpy as np
from astropy.io import fits
from astropy import units as u
import sys
import string
import matplotlib.pylab as plot
import nrm_analysis
from nrm_analysis.fringefitting.LG_Model import NRM_Model
from nrm_analysis.misctools import utils
from nrm_analysis import nrm_c... | 41.407407 | 107 | 0.591682 | #! /usr/bin/env python
import os
import numpy as np
from astropy.io import fits
from astropy import units as u
import sys
import string
import matplotlib.pylab as plot
import nrm_analysis
from nrm_analysis.fringefitting.LG_Model import NRM_Model
from nrm_analysis.misctools import utils
from nrm_analysis import nrm_c... | 0 | 0 | 0 |
6f9e31f93077a2ac8e6fd1a1ae12de1e4b7f82cc | 3,168 | py | Python | code/ReID_net/datasets/COCO/COCO_interactive.py | GeniusGaryant/PReMVOS | 53c5fac37fb57429d0046b77a491009d7b81607f | [
"MIT"
] | null | null | null | code/ReID_net/datasets/COCO/COCO_interactive.py | GeniusGaryant/PReMVOS | 53c5fac37fb57429d0046b77a491009d7b81607f | [
"MIT"
] | null | null | null | code/ReID_net/datasets/COCO/COCO_interactive.py | GeniusGaryant/PReMVOS | 53c5fac37fb57429d0046b77a491009d7b81607f | [
"MIT"
] | null | null | null | import random
import numpy as np
import tensorflow as tf
import Constants as Constants
from datasets.COCO.COCO_instance import COCOInstanceDataset
from datasets.Util import Reader
| 37.270588 | 106 | 0.648359 | import random
import numpy as np
import tensorflow as tf
import Constants as Constants
from datasets.COCO.COCO_instance import COCOInstanceDataset
from datasets.Util import Reader
class COCOInteractiveDataset(COCOInstanceDataset):
def __init__(self, config, subset, coord, fraction=1.0):
super(COCOInteractive... | 2,808 | 29 | 148 |
cb935a7319fb383e3ae5bc03e23311ed35d0a96d | 11,029 | py | Python | BatchLabelMap/automatic/pydicom/tests/test_data_manager.py | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | null | null | null | BatchLabelMap/automatic/pydicom/tests/test_data_manager.py | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | 1 | 2020-11-26T19:53:16.000Z | 2020-11-26T19:53:16.000Z | BatchLabelMap/automatic/pydicom/tests/test_data_manager.py | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | null | null | null | # Copyright 2008-2020 pydicom authors. See LICENSE file for details.
"""Unit tests for pydicom.data_manager"""
import json
import os
from os.path import basename
from pathlib import Path
import shutil
import pytest
from pydicom.data import (
get_charset_files, get_testdata_files, get_palette_files, fetch_data_fi... | 34.901899 | 78 | 0.641128 | # Copyright 2008-2020 pydicom authors. See LICENSE file for details.
"""Unit tests for pydicom.data_manager"""
import json
import os
from os.path import basename
from pathlib import Path
import shutil
import pytest
from pydicom.data import (
get_charset_files, get_testdata_files, get_palette_files, fetch_data_fi... | 472 | 2,540 | 76 |
ab0c317a25fe724c3540d5942e8e0369ebebbfa4 | 3,042 | py | Python | app/temperatures/migrations/0001_initial.py | swelanauguste/comptechs-1.1 | 5da6975a1eb93ed39fb2467e5c1cd702fe5917c5 | [
"MIT"
] | null | null | null | app/temperatures/migrations/0001_initial.py | swelanauguste/comptechs-1.1 | 5da6975a1eb93ed39fb2467e5c1cd702fe5917c5 | [
"MIT"
] | null | null | null | app/temperatures/migrations/0001_initial.py | swelanauguste/comptechs-1.1 | 5da6975a1eb93ed39fb2467e5c1cd702fe5917c5 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-12-04 01:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 55.309091 | 211 | 0.629191 | # Generated by Django 3.2.7 on 2021-12-04 01:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 2,862 | 23 |
589f83e2f1598859d74597f3d8dc8e2adced7600 | 2,079 | py | Python | epicteller/core/util/imghosting.py | KawashiroNitori/epicteller | 264b11e7e6eb58beb0f67ecbbb811d268a533f7a | [
"MIT"
] | null | null | null | epicteller/core/util/imghosting.py | KawashiroNitori/epicteller | 264b11e7e6eb58beb0f67ecbbb811d268a533f7a | [
"MIT"
] | null | null | null | epicteller/core/util/imghosting.py | KawashiroNitori/epicteller | 264b11e7e6eb58beb0f67ecbbb811d268a533f7a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import functools
import hashlib
import imghdr
import httpx
from qcloud_cos import CosConfig, CosS3Client
from epicteller.core.config import Config
config = CosConfig(
Region=Config.COS_REGION,
SecretId=Config.COS_SECRET_ID,
SecretKey=Config.COS_... | 27.355263 | 79 | 0.679173 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import functools
import hashlib
import imghdr
import httpx
from qcloud_cos import CosConfig, CosS3Client
from epicteller.core.config import Config
config = CosConfig(
Region=Config.COS_REGION,
SecretId=Config.COS_SECRET_ID,
SecretKey=Config.COS_... | 1,529 | 0 | 115 |
341ac263a9dd42368f40c67ea90e97b6357b0d72 | 2,426 | py | Python | sdk/identity/azure-identity/azure/identity/_internal/win_vscode_adapter.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/identity/azure-identity/azure/identity/_internal/win_vscode_adapter.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/identity/azure-identity/azure/identity/_internal/win_vscode_adapter.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import json
import logging
import ctypes as ct
from .._constants import VSCODE_CREDENTIALS_SECTION
try:
import ctypes.wintypes as wt
except (IOError, Valu... | 31.102564 | 120 | 0.647568 | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import json
import logging
import ctypes as ct
from .._constants import VSCODE_CREDENTIALS_SECTION
try:
import ctypes.wintypes as wt
except (IOError, Valu... | 1,101 | 461 | 92 |
e9339d70eb355b800703f5509494bc73b4cc3667 | 9,622 | py | Python | Backend/autonomus/utils/populareAutomata.py | IrinaMBejan/Autonom | 4a97da1b26ed22e3ec8bb939359148765392b692 | [
"MIT"
] | 2 | 2019-03-08T10:04:35.000Z | 2020-03-14T15:24:56.000Z | Backend/autonomus/utils/populareAutomata.py | IrinaMBejan/Autonom | 4a97da1b26ed22e3ec8bb939359148765392b692 | [
"MIT"
] | null | null | null | Backend/autonomus/utils/populareAutomata.py | IrinaMBejan/Autonom | 4a97da1b26ed22e3ec8bb939359148765392b692 | [
"MIT"
] | 2 | 2019-03-16T14:47:36.000Z | 2020-04-28T14:09:45.000Z | import datetime
import pytz
import json
import string
from urllib.request import Request, urlopen
from autonomus.models import Tag, Event, Link,User
from dateutil import parser
from autonomus.controllers import tags_controller, events_controller
import requests
import re
from autonomus.utils import sms
from concurrent... | 36.44697 | 148 | 0.536687 | import datetime
import pytz
import json
import string
from urllib.request import Request, urlopen
from autonomus.models import Tag, Event, Link,User
from dateutil import parser
from autonomus.controllers import tags_controller, events_controller
import requests
import re
from autonomus.utils import sms
from concurrent... | 8,713 | 4 | 256 |
b0b8590b9f8d8697f3895891763688345f7c5907 | 4,473 | py | Python | tvm/sandbox/testing/notepad.py | cmu-catalyst/collage | 663d6df941f559f372c87ff9207bf7905e3eaca0 | [
"Apache-2.0"
] | 32 | 2021-12-09T07:55:32.000Z | 2022-03-29T12:20:52.000Z | tvm/sandbox/testing/notepad.py | mikepapadim/collage-non-tvm-fork | fd2c7987359e2e4523d1de81bbb21f64bb3c8f75 | [
"Apache-2.0"
] | null | null | null | tvm/sandbox/testing/notepad.py | mikepapadim/collage-non-tvm-fork | fd2c7987359e2e4523d1de81bbb21f64bb3c8f75 | [
"Apache-2.0"
] | 1 | 2021-12-17T11:25:17.000Z | 2021-12-17T11:25:17.000Z |
# from e2e_perf_logger import *
#
# memo_dic = E2EPerfLogger().read_dict_from_csv()
# E2EPerfLogger().log_all_perf(memo_dic)
#
# def printa(text):
# print(text + "-a")
#
#
# class ABC():
# def __init__(self):
# self.func = printa
#
# def wow(self):
# self.func("WOW")
#
# a = ABC()
# a.wow... | 27.27439 | 163 | 0.642969 |
# from e2e_perf_logger import *
#
# memo_dic = E2EPerfLogger().read_dict_from_csv()
# E2EPerfLogger().log_all_perf(memo_dic)
#
# def printa(text):
# print(text + "-a")
#
#
# class ABC():
# def __init__(self):
# self.func = printa
#
# def wow(self):
# self.func("WOW")
#
# a = ABC()
# a.wow... | 0 | 0 | 0 |
8aab4fc4d565e4e3eb1761f5671bf846178bdab8 | 228 | py | Python | GUI/Shapes/Point.py | iagerogiannis/Image_to_plot | 15c01c50dcd23dfd187069145b3f2fdc06ed73a9 | [
"BSD-3-Clause"
] | null | null | null | GUI/Shapes/Point.py | iagerogiannis/Image_to_plot | 15c01c50dcd23dfd187069145b3f2fdc06ed73a9 | [
"BSD-3-Clause"
] | null | null | null | GUI/Shapes/Point.py | iagerogiannis/Image_to_plot | 15c01c50dcd23dfd187069145b3f2fdc06ed73a9 | [
"BSD-3-Clause"
] | null | null | null | from GUI.Shapes.Shape import Shape
| 22.8 | 63 | 0.609649 | from GUI.Shapes.Shape import Shape
class Point(Shape):
def __init__(self, parent, x0, y0, color, plot_style="o-"):
super().__init__(parent, [x0], [y0], color, plot_style)
self.x0 = x0
self.y0 = y0
| 144 | -2 | 50 |
6f1dfa2e61338451ee70d48ccd156b42cba5b7fa | 791 | py | Python | src/categories/admin.py | evis-market/web-interface-backend | f8930ff1c009ad18e522ab29680b4bcd50a6020e | [
"MIT"
] | 2 | 2021-08-30T22:58:32.000Z | 2021-12-12T10:47:52.000Z | src/categories/admin.py | evis-market/web-interface-backend | f8930ff1c009ad18e522ab29680b4bcd50a6020e | [
"MIT"
] | null | null | null | src/categories/admin.py | evis-market/web-interface-backend | f8930ff1c009ad18e522ab29680b4bcd50a6020e | [
"MIT"
] | 1 | 2021-08-22T19:12:44.000Z | 2021-08-22T19:12:44.000Z | from django.contrib import admin
from django_admin_listfilter_dropdown.filters import RelatedDropdownFilter
from mptt.admin import MPTTModelAdmin
from categories.models import Category, RecommendedFor
class CategoryAdmin(MPTTModelAdmin):
""" Class representing category admin
Attributes:
list_display... | 27.275862 | 74 | 0.735777 | from django.contrib import admin
from django_admin_listfilter_dropdown.filters import RelatedDropdownFilter
from mptt.admin import MPTTModelAdmin
from categories.models import Category, RecommendedFor
class CategoryAdmin(MPTTModelAdmin):
""" Class representing category admin
Attributes:
list_display... | 0 | 52 | 23 |
240ece79acba96e5cc0e30522568ac87cb476281 | 1,667 | py | Python | Laelia/pdf/functions.py | arantesdv/LaeliaAppProject | 93fca5393cb8406694903d9adde02067480c792e | [
"MIT"
] | null | null | null | Laelia/pdf/functions.py | arantesdv/LaeliaAppProject | 93fca5393cb8406694903d9adde02067480c792e | [
"MIT"
] | null | null | null | Laelia/pdf/functions.py | arantesdv/LaeliaAppProject | 93fca5393cb8406694903d9adde02067480c792e | [
"MIT"
] | null | null | null | from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle, TA_CENTER
| 66.68 | 123 | 0.754049 | from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle, TA_CENTER
class Styles:
@staticmethod
def compile():
styles = getSampleStyleSheet()
styles.add(ParagraphStyle('h1T', parent=styles['Heading1'], fontSize = 18, leading=10,))
styles.add(ParagraphStyle('h2T', parent=styles['Heading2'], font... | 1,531 | 32 | 23 |
844397e02efb87a5179ecba676d85fbc707a2592 | 1,503 | py | Python | tests/test_imei_support.py | JFF-Bohdan/pygsmmodule | 6744cee58ba480c69a53aa11dd49c3fb4dc82e1e | [
"MIT"
] | 7 | 2019-01-04T03:05:44.000Z | 2021-08-01T11:25:38.000Z | tests/test_imei_support.py | JFF-Bohdan/pygsmmodule | 6744cee58ba480c69a53aa11dd49c3fb4dc82e1e | [
"MIT"
] | 2 | 2017-11-07T23:09:09.000Z | 2019-01-26T22:21:35.000Z | tests/test_imei_support.py | JFF-Bohdan/pygsmmodule | 6744cee58ba480c69a53aa11dd49c3fb4dc82e1e | [
"MIT"
] | 2 | 2018-11-17T13:20:14.000Z | 2020-12-08T21:36:15.000Z | from pygsmmodule.imei.imei import ImeiSupport
| 24.639344 | 57 | 0.695276 | from pygsmmodule.imei.imei import ImeiSupport
def test_can_check_valid_imeis():
valid_imeis = [
356938035643809,
490154203237518,
"356938035643809",
358065019104265,
"357805023984942",
356938035643809
]
for imei in valid_imeis:
assert ImeiSupport.is... | 1,337 | 0 | 115 |
53ea60ae4820953621f064d7250baacb7429c36b | 2,506 | py | Python | src/fparser/two/tests/fortran2003/test_program_stmt_r1102.py | martin-schlipf/fparser | 95da2f617a4b448e11c1a001e3185faaf93f67ba | [
"BSD-3-Clause"
] | null | null | null | src/fparser/two/tests/fortran2003/test_program_stmt_r1102.py | martin-schlipf/fparser | 95da2f617a4b448e11c1a001e3185faaf93f67ba | [
"BSD-3-Clause"
] | null | null | null | src/fparser/two/tests/fortran2003/test_program_stmt_r1102.py | martin-schlipf/fparser | 95da2f617a4b448e11c1a001e3185faaf93f67ba | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018 Science and Technology Facilities Council
# All rights reserved.
# Modifications made as part of the fparser project are distributed
# under the following license:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | 40.419355 | 73 | 0.749002 | # Copyright (c) 2018 Science and Technology Facilities Council
# All rights reserved.
# Modifications made as part of the fparser project are distributed
# under the following license:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | 0 | 0 | 0 |
9399d6860eb65a749d984d6cbd5e7041d55a6f6c | 3,128 | py | Python | lib_utils/tests/test_file_funcs.py | jfuruness/lib_utils | 41e0a4f71044645f24ea6558bf92224f1173c79d | [
"BSD-3-Clause"
] | 1 | 2021-09-27T14:14:18.000Z | 2021-09-27T14:14:18.000Z | lib_utils/tests/test_file_funcs.py | jfuruness/lib_utils | 41e0a4f71044645f24ea6558bf92224f1173c79d | [
"BSD-3-Clause"
] | null | null | null | lib_utils/tests/test_file_funcs.py | jfuruness/lib_utils | 41e0a4f71044645f24ea6558bf92224f1173c79d | [
"BSD-3-Clause"
] | null | null | null | from pathlib import Path
import pytest
from .. import file_funcs
@pytest.mark.file_funcs
class TestFileFuncs:
"""Tests all funcs in file_funcs"""
@pytest.mark.skip(reason="New hire work")
def test_delete_files(self, tmp_path: Path):
"""Tests the delete files decorator
Files should be ... | 28.697248 | 70 | 0.555627 | from pathlib import Path
import pytest
from .. import file_funcs
@pytest.mark.file_funcs
class TestFileFuncs:
"""Tests all funcs in file_funcs"""
@pytest.mark.skip(reason="New hire work")
def test_temp_path(self):
pass
def test_delete_files(self, tmp_path: Path):
"""Tests the delet... | 156 | 0 | 82 |
1975e7ebc5d36658def7e702cc396501ea42f874 | 7,623 | py | Python | hummingbot/connector/exchange/binance/binance_api_user_stream_data_source.py | cclauss/hummingbot | 441041faac0d5e9f06fafef0f625ab1f19642371 | [
"Apache-2.0"
] | 11 | 2020-09-15T08:21:59.000Z | 2022-03-19T05:06:59.000Z | hummingbot/connector/exchange/binance/binance_api_user_stream_data_source.py | cclauss/hummingbot | 441041faac0d5e9f06fafef0f625ab1f19642371 | [
"Apache-2.0"
] | null | null | null | hummingbot/connector/exchange/binance/binance_api_user_stream_data_source.py | cclauss/hummingbot | 441041faac0d5e9f06fafef0f625ab1f19642371 | [
"Apache-2.0"
] | 5 | 2020-09-18T12:59:31.000Z | 2021-06-27T01:46:16.000Z | #!/usr/bin/env python
import asyncio
import aiohttp
import logging
import time
import ujson
import websockets
import hummingbot.connector.exchange.binance.binance_constants as CONSTANTS
from binance.client import Client as BinanceClient
from typing import (
AsyncIterable,
Dict,
Optional,
Tuple,
)
fr... | 45.106509 | 136 | 0.619835 | #!/usr/bin/env python
import asyncio
import aiohttp
import logging
import time
import ujson
import websockets
import hummingbot.connector.exchange.binance.binance_constants as CONSTANTS
from binance.client import Client as BinanceClient
from typing import (
AsyncIterable,
Dict,
Optional,
Tuple,
)
fr... | 6,356 | 578 | 23 |
900d6a2d0998da38a55cb405be354080354675b6 | 1,473 | py | Python | modules/pel/hexdump.py | zane131/openpower-pel-parsers | 0fcba2fc006edf385c83b961384f9153ea6a1015 | [
"Apache-2.0"
] | 1 | 2021-08-10T21:50:07.000Z | 2021-08-10T21:50:07.000Z | modules/pel/hexdump.py | zane131/openpower-pel-parsers | 0fcba2fc006edf385c83b961384f9153ea6a1015 | [
"Apache-2.0"
] | 1 | 2022-03-29T22:02:34.000Z | 2022-03-29T22:02:34.000Z | modules/pel/hexdump.py | zane131/openpower-pel-parsers | 0fcba2fc006edf385c83b961384f9153ea6a1015 | [
"Apache-2.0"
] | 2 | 2021-11-30T23:16:06.000Z | 2022-03-23T10:18:36.000Z | import math
def hexdump(data: memoryview,
bytes_per_line: int = 16,
bytes_per_chunk: int = 4) -> list:
"""
Returns a list of strings. Each entry will be one line of the hex dump from
the given data.
"""
# Allowing the flexibility for whatever size dump is needed, but still
... | 28.882353 | 79 | 0.580448 | import math
def hexdump(data: memoryview,
bytes_per_line: int = 16,
bytes_per_chunk: int = 4) -> list:
"""
Returns a list of strings. Each entry will be one line of the hex dump from
the given data.
"""
# Allowing the flexibility for whatever size dump is needed, but still
... | 0 | 0 | 0 |