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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19209b415b12634958f1efb8484a45b0d4088f88 | 10 | py | Python | dataset/imageGenerateDataset.py | RickyDoge/WFGN | 88c70ad623f370fa76eb0b75a452c8f2c527ca6e | [
"MIT"
] | null | null | null | dataset/imageGenerateDataset.py | RickyDoge/WFGN | 88c70ad623f370fa76eb0b75a452c8f2c527ca6e | [
"MIT"
] | null | null | null | dataset/imageGenerateDataset.py | RickyDoge/WFGN | 88c70ad623f370fa76eb0b75a452c8f2c527ca6e | [
"MIT"
] | null | null | null | # For GAN
| 5 | 9 | 0.6 | # For GAN
| 0 | 0 | 0 |
414515dcdbf131e12ab0825125c8f7e1da0e8704 | 1,688 | py | Python | thelper/routes.py | jpsolanet/thelper | 38ee164748ef36eb300afa7960f8f8c38150a20b | [
"MIT"
] | null | null | null | thelper/routes.py | jpsolanet/thelper | 38ee164748ef36eb300afa7960f8f8c38150a20b | [
"MIT"
] | null | null | null | thelper/routes.py | jpsolanet/thelper | 38ee164748ef36eb300afa7960f8f8c38150a20b | [
"MIT"
] | null | null | null | """sqlaclhemy models for tracker and class"""
import random
import pandas as pd
import numpy as np
import pdfkit
from flask import url_for, make_response, render_template, request
from thelper import APP, DB, admin_views
from thelper import models
@APP.route("/")
@APP.route("/bingo")
def get_bingo_card():
"""ge... | 28.610169 | 87 | 0.668246 | """sqlaclhemy models for tracker and class"""
import random
import pandas as pd
import numpy as np
import pdfkit
from flask import url_for, make_response, render_template, request
from thelper import APP, DB, admin_views
from thelper import models
@APP.route("/")
def hello():
periods = DB.session.query(models.Per... | 483 | 0 | 44 |
2ac62715c1cf6ce9866d22cf897644d3db36a361 | 762 | py | Python | ircawp-learn.py | Fortyseven/ircawp2020-markov | 4ba1f84ff6813a36fade009c5152a81b4e220243 | [
"CC0-1.0"
] | null | null | null | ircawp-learn.py | Fortyseven/ircawp2020-markov | 4ba1f84ff6813a36fade009c5152a81b4e220243 | [
"CC0-1.0"
] | null | null | null | ircawp-learn.py | Fortyseven/ircawp2020-markov | 4ba1f84ff6813a36fade009c5152a81b4e220243 | [
"CC0-1.0"
] | null | null | null | #!/bin/python3
import sys
import os
import Markov
if __name__ == "__main__":
if (len(sys.argv) < 2 or len(sys.argv) > 3):
print("usage: {} sourcefile.txt [existingbrain.json]".format(
sys.argv[0]))
sys.exit(-1)
if (not os.path.exists(sys.argv[1])):
print("Can't find sourc... | 25.4 | 76 | 0.585302 | #!/bin/python3
import sys
import os
import Markov
if __name__ == "__main__":
if (len(sys.argv) < 2 or len(sys.argv) > 3):
print("usage: {} sourcefile.txt [existingbrain.json]".format(
sys.argv[0]))
sys.exit(-1)
if (not os.path.exists(sys.argv[1])):
print("Can't find sourc... | 0 | 0 | 0 |
b21add2cc00bf7eaa4b66be407e328dc7e9387af | 668 | py | Python | backend/users/api/serializers/user.py | fthurtado/entrega-0-backend | 6f9cf01efbeb6736b73d316ff617d0e9aaea5a5a | [
"MIT"
] | null | null | null | backend/users/api/serializers/user.py | fthurtado/entrega-0-backend | 6f9cf01efbeb6736b73d316ff617d0e9aaea5a5a | [
"MIT"
] | null | null | null | backend/users/api/serializers/user.py | fthurtado/entrega-0-backend | 6f9cf01efbeb6736b73d316ff617d0e9aaea5a5a | [
"MIT"
] | null | null | null | import jwt
from django.conf import settings
from rest_framework import serializers
from backend.users.models import ClientUser
| 27.833333 | 85 | 0.699102 | import jwt
from django.conf import settings
from rest_framework import serializers
from backend.users.models import ClientUser
class ClientUserSerializer(serializers.ModelSerializer):
token = serializers.SerializerMethodField("get_token")
class Meta:
model = ClientUser
fields = ["token", "id"... | 144 | 350 | 46 |
e5f104aef22df762ef1a4cce4e0ce10773df3a89 | 1,066 | py | Python | test/test_verify_model.py | Loniks/RoundRobinDNSAtackDetector | d8c9c9e953f360ff67ffe05af67943329760e20c | [
"MIT"
] | null | null | null | test/test_verify_model.py | Loniks/RoundRobinDNSAtackDetector | d8c9c9e953f360ff67ffe05af67943329760e20c | [
"MIT"
] | null | null | null | test/test_verify_model.py | Loniks/RoundRobinDNSAtackDetector | d8c9c9e953f360ff67ffe05af67943329760e20c | [
"MIT"
] | 1 | 2017-11-28T08:24:56.000Z | 2017-11-28T08:24:56.000Z | import os
import csv
import joblib
protocol_names = [
'QUIC', 'DNS', 'ARP', 'TCP', 'UDP', 'SSDP', 'IGMPv2', 'SSL',
'TLSv1.2', 'DB-LSP-DISC', 'MDNS', 'TLSv1', 'BROWSER', 'ICMP',
'HTTP', 'HTTP/XML'
]
| 33.3125 | 79 | 0.556285 | import os
import csv
import joblib
protocol_names = [
'QUIC', 'DNS', 'ARP', 'TCP', 'UDP', 'SSDP', 'IGMPv2', 'SSL',
'TLSv1.2', 'DB-LSP-DISC', 'MDNS', 'TLSv1', 'BROWSER', 'ICMP',
'HTTP', 'HTTP/XML'
]
def test_verify_model():
# arrange test by loading model
current_path = os.path.abspath(os.path... | 827 | 0 | 23 |
a213a5d00d9d3a04c6bee6c48f3bebf7a5dbb766 | 1,028 | py | Python | {{cookiecutter.project_folder}}/code/add_this_dir_to_site-packages.py | gaulinmp/cookiecutter-research-project-template | 7d5feff90d2303d8bfd8a2916c8dac9fa1ba185c | [
"MIT"
] | null | null | null | {{cookiecutter.project_folder}}/code/add_this_dir_to_site-packages.py | gaulinmp/cookiecutter-research-project-template | 7d5feff90d2303d8bfd8a2916c8dac9fa1ba185c | [
"MIT"
] | null | null | null | {{cookiecutter.project_folder}}/code/add_this_dir_to_site-packages.py | gaulinmp/cookiecutter-research-project-template | 7d5feff90d2303d8bfd8a2916c8dac9fa1ba185c | [
"MIT"
] | 2 | 2021-07-01T14:44:06.000Z | 2022-02-05T22:57:39.000Z | #!python
import os
import sys
site_packages_folder_name = 'site-packages'
site_package_dir = [c for c in sys.path if site_packages_folder_name in c[-len(site_packages_folder_name):]]
if site_package_dir:
site_package_dir = site_package_dir[0]
{{ cookiecutter.python_libname }}_pth_file = os.path.join(si... | 42.833333 | 130 | 0.705253 | #!python
import os
import sys
site_packages_folder_name = 'site-packages'
site_package_dir = [c for c in sys.path if site_packages_folder_name in c[-len(site_packages_folder_name):]]
if site_package_dir:
site_package_dir = site_package_dir[0]
{{ cookiecutter.python_libname }}_pth_file = os.path.join(si... | 0 | 0 | 0 |
e2eb51a68fe7c9191778502631813fa1533dae09 | 1,369 | py | Python | rsockets2/connection/resume_strategy.py | freelancer1845/rsockets2-try | 25b8b38e00925c3feb6c6e790624a35bc8689619 | [
"Apache-2.0"
] | 3 | 2020-05-08T09:45:44.000Z | 2020-11-13T11:39:06.000Z | rsockets2/connection/resume_strategy.py | freelancer1845/rsockets2-try | 25b8b38e00925c3feb6c6e790624a35bc8689619 | [
"Apache-2.0"
] | 1 | 2022-01-27T08:07:22.000Z | 2022-01-27T08:07:22.000Z | rsockets2/connection/resume_strategy.py | freelancer1845/rsockets2-try | 25b8b38e00925c3feb6c6e790624a35bc8689619 | [
"Apache-2.0"
] | 1 | 2020-05-08T09:47:14.000Z | 2020-05-08T09:47:14.000Z | from abc import ABC, abstractmethod
from ..frames import Frame_ABC, KeepAliveFrame
from .abstract_connection import AbstractConnection
import rx.operators as op
import threading
| 26.326923 | 60 | 0.655223 | from abc import ABC, abstractmethod
from ..frames import Frame_ABC, KeepAliveFrame
from .abstract_connection import AbstractConnection
import rx.operators as op
import threading
class ResumeStrategy(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def create_resume_frame(self):
... | 827 | 316 | 46 |
8f9a2c2701c01e458cb636d205efbc6987b320ae | 11,623 | py | Python | data_processing/tournament_txt_to_csv.py | Andrew-Talley/seven-oh-two | 73a78e0f6d82bba6f80f7655afb6ed3a2c783486 | [
"MIT"
] | null | null | null | data_processing/tournament_txt_to_csv.py | Andrew-Talley/seven-oh-two | 73a78e0f6d82bba6f80f7655afb6ed3a2c783486 | [
"MIT"
] | null | null | null | data_processing/tournament_txt_to_csv.py | Andrew-Talley/seven-oh-two | 73a78e0f6d82bba6f80f7655afb6ed3a2c783486 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
import re
import functools
import itertools
import json
import traceback
from collections import deque, defaultdict
from Tournament_Iterator import Tournament_Iterator
from parse_results_rows import parse_results_rows
from get_outstanding_students import get_outstanding... | 36.665615 | 143 | 0.709197 | import numpy as np
import pandas as pd
import os
import re
import functools
import itertools
import json
import traceback
from collections import deque, defaultdict
from Tournament_Iterator import Tournament_Iterator
from parse_results_rows import parse_results_rows
from get_outstanding_students import get_outstanding... | 9,993 | 0 | 253 |
766d36bc9b401dcaa299cd9f9b1e2101f6b371a5 | 1,327 | py | Python | nvflare/private/fed/server/server_cmd_modules.py | drbeh/NVFlare | efea2c04e641051537604a4de2f85e570fb4f3a7 | [
"Apache-2.0"
] | null | null | null | nvflare/private/fed/server/server_cmd_modules.py | drbeh/NVFlare | efea2c04e641051537604a4de2f85e570fb4f3a7 | [
"Apache-2.0"
] | null | null | null | nvflare/private/fed/server/server_cmd_modules.py | drbeh/NVFlare | efea2c04e641051537604a4de2f85e570fb4f3a7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.029412 | 79 | 0.754333 | # Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 123 | 254 | 23 |
db145964edc404f9728296e74053393638f1cd91 | 8,122 | py | Python | DGSQP/solvers/PID.py | zhu-edward/DGSQP | b907d961f292695e4cddbc1266313e0e1030c4f0 | [
"MIT"
] | null | null | null | DGSQP/solvers/PID.py | zhu-edward/DGSQP | b907d961f292695e4cddbc1266313e0e1030c4f0 | [
"MIT"
] | null | null | null | DGSQP/solvers/PID.py | zhu-edward/DGSQP | b907d961f292695e4cddbc1266313e0e1030c4f0 | [
"MIT"
] | null | null | null | #!/usr/bin python3
import numpy as np
import time
from typing import Tuple
from DGSQP.types import VehicleState
from DGSQP.solvers.abstract_solver import AbstractSolver
from DGSQP.solvers.solver_types import PIDParams
class PID():
'''
Base class for PID controller
Meant to be packaged for use in actual... | 32.230159 | 174 | 0.582615 | #!/usr/bin python3
import numpy as np
import time
from typing import Tuple
from DGSQP.types import VehicleState
from DGSQP.solvers.abstract_solver import AbstractSolver
from DGSQP.solvers.solver_types import PIDParams
class PID():
'''
Base class for PID controller
Meant to be packaged for use in actual... | 6,528 | 0 | 457 |
84a707b07afe3b537b10fca5f8c71aed1cce1db3 | 9,420 | py | Python | tests/geneartpingertest.py | Global-Biofoundries-Alliance/DNA-scanner | 8001fcf486de415ac469170fe459f8df29e86685 | [
"MIT"
] | 12 | 2019-11-08T17:23:24.000Z | 2021-12-18T02:28:31.000Z | tests/geneartpingertest.py | Zulko/DNA-scanner | 65907a0d8eaa162ca8d4fa85b3330e3fd454047d | [
"MIT"
] | 41 | 2019-10-30T08:33:05.000Z | 2022-02-26T21:01:55.000Z | tests/geneartpingertest.py | Global-Biofoundries-Alliance/DNA-scanner | 8001fcf486de415ac469170fe459f8df29e86685 | [
"MIT"
] | 5 | 2019-11-05T11:35:12.000Z | 2020-11-11T16:19:40.000Z | import unittest
import json
import yaml
from Pinger import Pinger, Entities, GeneArt, Validator
# Test file which can be successfully valideted by the API.
with open('./examples/seqinf_geneart.json') as json_file:
data = json.load(json_file)
example_list = []
# Create a list of 'SequenceInformation' objects where... | 46.176471 | 118 | 0.666242 | import unittest
import json
import yaml
from Pinger import Pinger, Entities, GeneArt, Validator
# Test file which can be successfully valideted by the API.
with open('./examples/seqinf_geneart.json') as json_file:
data = json.load(json_file)
example_list = []
# Create a list of 'SequenceInformation' objects where... | 7,674 | 959 | 27 |
e4ddbdebb6ad60bd0ac6d32b26c0e0b8c43fedc9 | 1,036 | py | Python | actualite/models.py | Kgermando/ev-ccnsc | ad8710014ab11aec18d72cbb97462efbba28dc85 | [
"Apache-2.0"
] | null | null | null | actualite/models.py | Kgermando/ev-ccnsc | ad8710014ab11aec18d72cbb97462efbba28dc85 | [
"Apache-2.0"
] | null | null | null | actualite/models.py | Kgermando/ev-ccnsc | ad8710014ab11aec18d72cbb97462efbba28dc85 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from ccnsc.constant import CATEGORIES, PROVINCES
# Create your models here.
| 41.44 | 98 | 0.750965 | from django.db import models
from ccnsc.constant import CATEGORIES, PROVINCES
# Create your models here.
class Actualite(models.Model):
actu_titre = models.CharField(max_length=300)
auteur = models.CharField(max_length=300)
actu_content = models.TextField()
actu_province = models.CharField(max_length=... | 153 | 753 | 23 |
1304534d80b2dff7e32c9acf5d7838faeb29410b | 3,700 | py | Python | voa_and_megadata.py | cdoolin/labtools | 867a2726f5a707a8f5e698bf4a6bb4de40cfbe27 | [
"MIT"
] | 1 | 2021-06-07T16:51:09.000Z | 2021-06-07T16:51:09.000Z | voa_and_megadata.py | cdoolin/labtools | 867a2726f5a707a8f5e698bf4a6bb4de40cfbe27 | [
"MIT"
] | null | null | null | voa_and_megadata.py | cdoolin/labtools | 867a2726f5a707a8f5e698bf4a6bb4de40cfbe27 | [
"MIT"
] | null | null | null |
import argparse
parser = argparse.ArgumentParser(description="control voa and take megadata")
parser.add_argument("--power", default=5, type=float, help="On voltage of VOA")
parser.add_argument("--delay", default=10, type=float, help="Delay between starting megadaq and turning on voa (in ms)")
parser.add_argument(... | 26.428571 | 170 | 0.657838 |
import argparse
parser = argparse.ArgumentParser(description="control voa and take megadata")
parser.add_argument("--power", default=5, type=float, help="On voltage of VOA")
parser.add_argument("--delay", default=10, type=float, help="Delay between starting megadaq and turning on voa (in ms)")
parser.add_argument(... | 48 | 0 | 23 |
736bfde148e48f0e5e3ee39dde77d4591eca9d9f | 4,606 | py | Python | utils.py | garvm7/TransUNet | f330ff264680f035e84e4b3142f9188304d06c48 | [
"Apache-2.0"
] | null | null | null | utils.py | garvm7/TransUNet | f330ff264680f035e84e4b3142f9188304d06c48 | [
"Apache-2.0"
] | null | null | null | utils.py | garvm7/TransUNet | f330ff264680f035e84e4b3142f9188304d06c48 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
from medpy import metric
from scipy.ndimage import zoom
import torch.nn as nn
import SimpleITK as sitk
| 38.705882 | 127 | 0.547112 | import numpy as np
import torch
from medpy import metric
from scipy.ndimage import zoom
import torch.nn as nn
import SimpleITK as sitk
class DiceLoss(nn.Module):
def __init__(self, n_classes):
super(DiceLoss, self).__init__()
self.n_classes = n_classes
def _one_hot_encoder(self, input_tensor)... | 4,287 | 5 | 176 |
ca01e2d44643a8dff671f968cb9acbc1adf392b1 | 12,700 | py | Python | examples/gb1/vae.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | null | null | null | examples/gb1/vae.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | 1 | 2021-09-15T13:13:12.000Z | 2021-09-15T13:13:12.000Z | examples/gb1/vae.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | null | null | null | r"""Train GB1 variational autoencoder (VAE) model.
The model encodes information about the input `x` into a latent variable
`z` (through `mu` and `logvar`) so that the decoder network can generate
the reconstructed output `x'` (such that `x \approx x'`) [1].
The latent variable `z` allows us to generate samples from ... | 46.691176 | 86 | 0.606693 | r"""Train GB1 variational autoencoder (VAE) model.
The model encodes information about the input `x` into a latent variable
`z` (through `mu` and `logvar`) so that the decoder network can generate
the reconstructed output `x'` (such that `x \approx x'`) [1].
The latent variable `z` allows us to generate samples from ... | 7,634 | 0 | 23 |
24979e4e53de2b2ce07c5e10f742ff0fa787a88c | 7,081 | py | Python | introduction/matlab_plot/python/11.grid.py | LeandroTk/intro-data-science | 36a8bf2c080a94526c2f71e5773dd451ca371d38 | [
"MIT"
] | 9 | 2019-01-01T17:44:18.000Z | 2021-02-08T06:30:03.000Z | introduction/matlab_plot/python/11.grid.py | kemojal/machine-learning-degree | b27f21854b7df9fbac3a801087c0f2c3ff0a6b63 | [
"MIT"
] | null | null | null | introduction/matlab_plot/python/11.grid.py | kemojal/machine-learning-degree | b27f21854b7df9fbac3a801087c0f2c3ff0a6b63 | [
"MIT"
] | 3 | 2019-02-23T04:22:23.000Z | 2021-02-08T06:30:04.000Z | # defining "gross_domestic_product_per_capita" and "life_expectancy" lists
gross_domestic_product_per_capita = [
974.5803384, 5937.029525999998, 6223.367465, 4797.231267, 12779.37964, 34435.367439999995, 36126.4927, 29796.04834, 1391.253792, 33692.60508, 1441.284873, 3822.137084, 7446.298803, 12569.85177, 9065.8008... | 114.209677 | 1,952 | 0.696794 | # defining "gross_domestic_product_per_capita" and "life_expectancy" lists
gross_domestic_product_per_capita = [
974.5803384, 5937.029525999998, 6223.367465, 4797.231267, 12779.37964, 34435.367439999995, 36126.4927, 29796.04834, 1391.253792, 33692.60508, 1441.284873, 3822.137084, 7446.298803, 12569.85177, 9065.8008... | 0 | 0 | 0 |
76b0b7caf13e99d3aaa206eefe95f234032dd2fc | 1,560 | py | Python | profiles_api/models.py | Aashutosh3804/profile_rest_apis | 0b54cddf996bb61acb5930b6ff4631801ce5547d | [
"MIT"
] | null | null | null | profiles_api/models.py | Aashutosh3804/profile_rest_apis | 0b54cddf996bb61acb5930b6ff4631801ce5547d | [
"MIT"
] | 3 | 2020-06-06T01:35:22.000Z | 2021-04-08T21:30:49.000Z | profiles_api/models.py | Aashutosh3804/profile_rest_apis | 0b54cddf996bb61acb5930b6ff4631801ce5547d | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin,BaseUserManager
# Create your models here.
class UserProfileManager(BaseUserManager):
"""Manager For user Profiles"""
def create_user(self,email,name,password=None):
"""Create a NEw SUer Profile"""
... | 31.836735 | 89 | 0.680128 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin,BaseUserManager
# Create your models here.
class UserProfileManager(BaseUserManager):
"""Manager For user Profiles"""
def create_user(self,email,name,password=None):
"""Create a NEw SUer Profile"""
... | 0 | 0 | 0 |
dce94a6ace55ef22c6e6e2de483e66b2f9f04f7f | 8,512 | py | Python | spambayes/Outlook2000/export.py | alexeip0/spambayes | 0c7d12cf4702ef82974ab16d2a36fa9ccedf185a | [
"PSF-2.0"
] | 13 | 2015-07-03T06:53:47.000Z | 2021-02-19T13:21:56.000Z | spambayes/Outlook2000/export.py | alexeip0/spambayes | 0c7d12cf4702ef82974ab16d2a36fa9ccedf185a | [
"PSF-2.0"
] | 5 | 2015-07-16T07:33:46.000Z | 2021-04-05T20:27:52.000Z | spambayes/Outlook2000/export.py | alexeip0/spambayes | 0c7d12cf4702ef82974ab16d2a36fa9ccedf185a | [
"PSF-2.0"
] | 20 | 2015-05-16T22:42:14.000Z | 2021-09-18T17:46:40.000Z | # Exports your ham and spam folders to a standard SpamBayes test directory.
import sys, os, shutil
from manager import GetManager
NUM_BUCKETS = 10
DEFAULT_DIRECTORY = "..\\testtools\\Data"
import re
mime_header_re = re.compile(r"""
^ content- (type | transfer-encoding) : [^\n]* \n
([ \t] [^\n]* \n)* # suck ... | 36.376068 | 80 | 0.617011 | # Exports your ham and spam folders to a standard SpamBayes test directory.
import sys, os, shutil
from manager import GetManager
NUM_BUCKETS = 10
DEFAULT_DIRECTORY = "..\\testtools\\Data"
import re
mime_header_re = re.compile(r"""
^ content- (type | transfer-encoding) : [^\n]* \n
([ \t] [^\n]* \n)* # suck ... | 6,981 | 0 | 155 |
56eed8550ea27f693fcab9cfb8ecd4aceda49e2f | 2,392 | py | Python | Data fetching script.py | mohamedsaadmoustafa/Arabic_Dialect_Classification | a13e92ddaa8fda5afcc40d1ce97946174f9a4674 | [
"BSD-3-Clause"
] | null | null | null | Data fetching script.py | mohamedsaadmoustafa/Arabic_Dialect_Classification | a13e92ddaa8fda5afcc40d1ce97946174f9a4674 | [
"BSD-3-Clause"
] | null | null | null | Data fetching script.py | mohamedsaadmoustafa/Arabic_Dialect_Classification | a13e92ddaa8fda5afcc40d1ce97946174f9a4674 | [
"BSD-3-Clause"
] | 1 | 2022-03-14T19:41:57.000Z | 2022-03-14T19:41:57.000Z | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import requests
import json
import os
# Import dataset with text ids.
df = pd.read_csv("../input/dialect-datasetcsv/dialect_dataset.csv")
# create a new column to store feched text in
df['tweets'] = np.nan
# chan... | 34.171429 | 85 | 0.700669 | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import requests
import json
import os
# Import dataset with text ids.
df = pd.read_csv("../input/dialect-datasetcsv/dialect_dataset.csv")
# create a new column to store feched text in
df['tweets'] = np.nan
# chan... | 861 | 0 | 44 |
fd952ee9d4b5eb67bb14f64b38abf73e85b2e79a | 18,232 | py | Python | nlp_label_quality/nlp_label_quality/analysis/analysis_utils.py | jwiltfang/bachelor-thesis | a15bdd1a6dec527624085640436748a545cee370 | [
"MIT"
] | null | null | null | nlp_label_quality/nlp_label_quality/analysis/analysis_utils.py | jwiltfang/bachelor-thesis | a15bdd1a6dec527624085640436748a545cee370 | [
"MIT"
] | null | null | null | nlp_label_quality/nlp_label_quality/analysis/analysis_utils.py | jwiltfang/bachelor-thesis | a15bdd1a6dec527624085640436748a545cee370 | [
"MIT"
] | null | null | null | from nltk.corpus import wordnet as wn
import nltk
import numpy as np
import pm4py
from pm4py.objects.log.log import EventLog
from nlp_label_quality.analysis import matrix_eval
from typing import Dict, List, Tuple, Union, Any
from nlp_label_quality.analysis.attribute_value import Attribute, AttributeValue
import tim... | 42.301624 | 172 | 0.599331 | from nltk.corpus import wordnet as wn
import nltk
import numpy as np
import pm4py
from pm4py.objects.log.log import EventLog
from nlp_label_quality.analysis import matrix_eval
from typing import Dict, List, Tuple, Union, Any
from nlp_label_quality.analysis.attribute_value import Attribute, AttributeValue
import tim... | 4,307 | 0 | 69 |
5b3a3b5d61e677e816fc3f066fa360eebf0bc8b9 | 3,206 | py | Python | atis_simulator.py | ashishrao7/Neuromorphic-Sampling | ab921456ebcada361c64f24cd0fd727771d1acd8 | [
"MIT"
] | null | null | null | atis_simulator.py | ashishrao7/Neuromorphic-Sampling | ab921456ebcada361c64f24cd0fd727771d1acd8 | [
"MIT"
] | null | null | null | atis_simulator.py | ashishrao7/Neuromorphic-Sampling | ab921456ebcada361c64f24cd0fd727771d1acd8 | [
"MIT"
] | null | null | null | ##############################################################################################################################
# This program simulates a DVS sensor. The input images are specified as a directory in the program
# Author: Ashish Rao M
# email: ashish.rao.m@gmail.com
######################################... | 30.826923 | 126 | 0.52932 | ##############################################################################################################################
# This program simulates a DVS sensor. The input images are specified as a directory in the program
# Author: Ashish Rao M
# email: ashish.rao.m@gmail.com
######################################... | 0 | 0 | 0 |
4dd35800a4721581c35c28114dd5078a23c3de08 | 182 | py | Python | django_minifier/filesystem.py | realnoobs/django_minifier | 4750ddacd8ab2efd66680abfa3e267d0363e1a8d | [
"MIT"
] | null | null | null | django_minifier/filesystem.py | realnoobs/django_minifier | 4750ddacd8ab2efd66680abfa3e267d0363e1a8d | [
"MIT"
] | null | null | null | django_minifier/filesystem.py | realnoobs/django_minifier | 4750ddacd8ab2efd66680abfa3e267d0363e1a8d | [
"MIT"
] | null | null | null | from django.template.loaders.filesystem import Loader as FilesystemLoader
from .mixins import TemplateMinifierMixin
| 26 | 73 | 0.846154 | from django.template.loaders.filesystem import Loader as FilesystemLoader
from .mixins import TemplateMinifierMixin
class Loader(TemplateMinifierMixin, FilesystemLoader):
pass
| 0 | 42 | 23 |
e3e6312937486725b68bad4e6f68a31a4c015bb9 | 850 | py | Python | app/lib/overrides/common/raw_cluster_role_bindings.py | cisco-sso/mh2-poc | a476c9e119e2e15834dc04242504049b9fc7e8e5 | [
"Apache-2.0"
] | null | null | null | app/lib/overrides/common/raw_cluster_role_bindings.py | cisco-sso/mh2-poc | a476c9e119e2e15834dc04242504049b9fc7e8e5 | [
"Apache-2.0"
] | null | null | null | app/lib/overrides/common/raw_cluster_role_bindings.py | cisco-sso/mh2-poc | a476c9e119e2e15834dc04242504049b9fc7e8e5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
| 25.757576 | 56 | 0.434118 | #!/usr/bin/env python3
def raw_cluster_role_bindings(callback_values):
data = {
'__meta': {
'chart': 'cisco-sso/raw',
'version': '0.1.0'
},
'resources': [{
'apiVersion':
'rbac.authorization.k8s.io/v1',
'kind':
'Cluster... | 803 | 0 | 23 |
8d359700d0dad3653a8d21dbc6fa360fe4e807d2 | 1,034 | py | Python | cutter/files/views.py | pikulak/cutter | 881ad0a76bb880c7a2fb1bf7a32881d6830bbcaf | [
"Apache-2.0"
] | null | null | null | cutter/files/views.py | pikulak/cutter | 881ad0a76bb880c7a2fb1bf7a32881d6830bbcaf | [
"Apache-2.0"
] | 2 | 2018-04-25T00:07:11.000Z | 2018-04-25T00:42:38.000Z | cutter/files/views.py | pikulak/cutter | 881ad0a76bb880c7a2fb1bf7a32881d6830bbcaf | [
"Apache-2.0"
] | null | null | null | from rest_framework import status
from rest_framework.response import Response
from rest_framework.viewsets import (
GenericViewSet,
mixins
)
from .models import FileAudio
from .serializers import FileAudioSerializer
from .tasks import async_cut_file
class FileViewSet(mixins.CreateModelMixin,
... | 32.3125 | 89 | 0.709865 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.viewsets import (
GenericViewSet,
mixins
)
from .models import FileAudio
from .serializers import FileAudioSerializer
from .tasks import async_cut_file
class FileViewSet(mixins.CreateModelMixin,
... | 381 | 0 | 27 |
114812efcc3174485ae2199f16a9e47803cc121f | 916 | py | Python | livestyled/schemas/tests/test_ticket_integration.py | andrelopez/python-sdk | 3c83d4698ecf6b5b59003d20cb26644e0dd77f61 | [
"MIT"
] | null | null | null | livestyled/schemas/tests/test_ticket_integration.py | andrelopez/python-sdk | 3c83d4698ecf6b5b59003d20cb26644e0dd77f61 | [
"MIT"
] | 1 | 2021-07-09T10:59:21.000Z | 2021-07-09T10:59:21.000Z | livestyled/schemas/tests/test_ticket_integration.py | andrelopez/python-sdk | 3c83d4698ecf6b5b59003d20cb26644e0dd77f61 | [
"MIT"
] | 3 | 2021-02-01T10:13:36.000Z | 2022-02-11T17:47:30.000Z | import os
from livestyled.schemas.ticket_integration import TicketIntegrationSchema
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixtures')
TEST_API_DOMAIN = 'test.livestyled.com'
| 33.925926 | 98 | 0.636463 | import os
from livestyled.schemas.ticket_integration import TicketIntegrationSchema
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixtures')
TEST_API_DOMAIN = 'test.livestyled.com'
def test_deserialize_ticket_integration():
with open(os.path.join(FIXTURES_DIR, 'example_ticket_integration.json'), 'r')... | 698 | 0 | 23 |
290ea24da1d1eae66b04c26acdf95a3b6d5bbf1e | 1,865 | py | Python | tutorial/part2/ch9_files/final_app.py | open-resources/dash_curriculum | cd9b7db3f357edeed2d027a23fceb85eabbffb7e | [
"MIT"
] | 3 | 2022-02-23T22:16:25.000Z | 2022-02-25T01:23:40.000Z | tutorial/part2/ch9_files/final_app.py | open-resources/dash_curriculum | cd9b7db3f357edeed2d027a23fceb85eabbffb7e | [
"MIT"
] | 15 | 2022-02-23T22:12:51.000Z | 2022-03-23T21:51:49.000Z | tutorial/part2/ch9_files/final_app.py | open-resources/dash_curriculum | cd9b7db3f357edeed2d027a23fceb85eabbffb7e | [
"MIT"
] | 2 | 2022-02-25T20:57:59.000Z | 2022-03-26T15:29:01.000Z | # Import libraries
from dash import Dash, dash_table, dcc, Input, Output, State
import dash_bootstrap_components as dbc
import pandas as pd
import plotly.express as px
# Import data into Pandas dataframe
df = px.data.gapminder()
# Filter data with a list of countries we're interested in exploring
country_list = ['Ca... | 28.692308 | 77 | 0.674531 | # Import libraries
from dash import Dash, dash_table, dcc, Input, Output, State
import dash_bootstrap_components as dbc
import pandas as pd
import plotly.express as px
# Import data into Pandas dataframe
df = px.data.gapminder()
# Filter data with a list of countries we're interested in exploring
country_list = ['Ca... | 275 | 0 | 22 |
b56b656c50472636928bf236304449bc7270a77a | 1,217 | py | Python | ynlu/sdk/test/test_client.py | hsiaoyi0504/yoctol-nlu-py | 4cec8d52ba3dd7827bddde152c95e814e533c0f2 | [
"MIT"
] | null | null | null | ynlu/sdk/test/test_client.py | hsiaoyi0504/yoctol-nlu-py | 4cec8d52ba3dd7827bddde152c95e814e533c0f2 | [
"MIT"
] | null | null | null | ynlu/sdk/test/test_client.py | hsiaoyi0504/yoctol-nlu-py | 4cec8d52ba3dd7827bddde152c95e814e533c0f2 | [
"MIT"
] | null | null | null | from unittest import TestCase
from ..client import NLUClient
TEST_MODEL_ID = ['5566', '7788', '1024']
TEST_MODEL_NAME = ['random', 'name', 'here']
| 27.659091 | 100 | 0.683648 | from unittest import TestCase
from ..client import NLUClient
TEST_MODEL_ID = ['5566', '7788', '1024']
TEST_MODEL_NAME = ['random', 'name', 'here']
def mock_client(_, retries):
return 'Some random client'
def mock_fetch_all_available_clf_ids_and_names(_):
return TEST_MODEL_ID, TEST_MODEL_NAME
class NLUC... | 901 | 13 | 150 |
0cea6ee79a99de1a790f701a85ae58a4c6b59c7d | 6,506 | py | Python | mesh.py | zjucxh/mesh-meanshift | d21e5f49b1085f1013258a925e6245b5c68661fe | [
"MIT"
] | null | null | null | mesh.py | zjucxh/mesh-meanshift | d21e5f49b1085f1013258a925e6245b5c68661fe | [
"MIT"
] | null | null | null | mesh.py | zjucxh/mesh-meanshift | d21e5f49b1085f1013258a925e6245b5c68661fe | [
"MIT"
] | null | null | null | import numpy as np
import meshio
from gdist import compute_gdist as geo_dist
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import open3d as o3d
from scipy import sparse
from scipy.stats import uniform
#o3d.geometry.TriangleMesh.compute_vertex_normals
# write mesh to obj
# normalize mes... | 35.358696 | 110 | 0.637873 | import numpy as np
import meshio
from gdist import compute_gdist as geo_dist
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import open3d as o3d
from scipy import sparse
from scipy.stats import uniform
#o3d.geometry.TriangleMesh.compute_vertex_normals
# write mesh to obj
def write_mesh(f... | 4,882 | 0 | 156 |
563fb5ca9b675c935bfc915e5745df0f3ea2e074 | 274 | py | Python | tests/test_graph_iterator.py | Jarino/pycgp | c3281c0deff3388cb7cfd79339b84391f6499ae1 | [
"MIT"
] | 4 | 2018-02-08T17:34:58.000Z | 2021-09-20T01:37:32.000Z | tests/test_graph_iterator.py | Jarino/pycgp | c3281c0deff3388cb7cfd79339b84391f6499ae1 | [
"MIT"
] | 1 | 2018-02-09T09:59:09.000Z | 2018-02-09T10:52:26.000Z | tests/test_graph_iterator.py | Jarino/pycgp | c3281c0deff3388cb7cfd79339b84391f6499ae1 | [
"MIT"
] | 1 | 2018-12-12T03:51:33.000Z | 2018-12-12T03:51:33.000Z | """ test for individual iterators """
from pycgp.graph_iterator import iterate_active_nodes
| 22.833333 | 54 | 0.733577 | """ test for individual iterators """
from pycgp.graph_iterator import iterate_active_nodes
def test_iterate_active_nodes(individual):
iterator = iterate_active_nodes(individual)
visited_ids = [x.id for x in iterator]
assert visited_ids == [7, 6, 3, 0, 0]
| 156 | 0 | 23 |
8b1f968c73d4acd737b1e800258da82d5bf3c50f | 271 | py | Python | trainer/metrics.py | xinranhe/mahjong | 8cfc6234f9c80fd11267adf06b420b63f4c8d87d | [
"MIT"
] | null | null | null | trainer/metrics.py | xinranhe/mahjong | 8cfc6234f9c80fd11267adf06b420b63f4c8d87d | [
"MIT"
] | null | null | null | trainer/metrics.py | xinranhe/mahjong | 8cfc6234f9c80fd11267adf06b420b63f4c8d87d | [
"MIT"
] | null | null | null | import tensorflow as tf
| 30.111111 | 61 | 0.704797 | import tensorflow as tf
def compute_accuracy(labels, logits):
prediction = tf.argmax(logits, axis=1)
max_mask = tf.one_hot(prediction, 14)
is_acc = tf.cast(max_mask * labels > 0, dtype=tf.float32)
is_acc = tf.reduce_sum(is_acc, axis=1)
return is_acc
| 224 | 0 | 23 |
4069be0bb36a8f8fc11cbd2cb9b0d77f32b887bc | 1,430 | py | Python | aiopening/client/client.py | ducandu/aiopening | 214d8d6dfc928ab4f8db634018092dc43eaf0e3c | [
"MIT"
] | null | null | null | aiopening/client/client.py | ducandu/aiopening | 214d8d6dfc928ab4f8db634018092dc43eaf0e3c | [
"MIT"
] | null | null | null | aiopening/client/client.py | ducandu/aiopening | 214d8d6dfc928ab4f8db634018092dc43eaf0e3c | [
"MIT"
] | null | null | null | """
-------------------------------------------------------------------------
AIOpener -
client
command line client for aiopener-server operations
- allows login, start/list projects
- submission of games for solving
- check job status
created: 2017/06/05 in PyCharm
(c) 2017 Sven - ducandu GmbH
--------... | 30.425532 | 134 | 0.644755 | """
-------------------------------------------------------------------------
AIOpener -
client
command line client for aiopener-server operations
- allows login, start/list projects
- submission of games for solving
- check job status
created: 2017/06/05 in PyCharm
(c) 2017 Sven - ducandu GmbH
--------... | 0 | 0 | 0 |
821610d176c232df04f951041810e8721219f6a5 | 54,329 | py | Python | examples/speech_recognition/infer.py | SeunghyunSEO/seosh_fairseq | 443b2a8effb6b8fba5758989076cf992470ccb62 | [
"MIT"
] | null | null | null | examples/speech_recognition/infer.py | SeunghyunSEO/seosh_fairseq | 443b2a8effb6b8fba5758989076cf992470ccb62 | [
"MIT"
] | 2 | 2022-02-22T08:28:06.000Z | 2022-02-22T09:26:26.000Z | examples/speech_recognition/infer.py | SeunghyunSEO/seosh_fairseq | 443b2a8effb6b8fba5758989076cf992470ccb62 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Run inference for pre-processed data with a trained model.
"""
import ast
import logging
import math
import os
... | 45.539816 | 272 | 0.532588 | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Run inference for pre-processed data with a trained model.
"""
import ast
import logging
import math
import os
... | 52,321 | 18 | 352 |
0bd93f88d9451f2a7f0864e82e017e730575b137 | 1,491 | py | Python | antiword_test.py | AmanBudhraja/Multi-Format-Text-Extraction-and-Text-to-Speech-Synthesis | c49eafaaf0be62b2183e27f499aa8cb4d4856447 | [
"MIT"
] | 1 | 2020-03-23T07:22:30.000Z | 2020-03-23T07:22:30.000Z | antiword_test.py | AmanBudhraja/M.engProject | c49eafaaf0be62b2183e27f499aa8cb4d4856447 | [
"MIT"
] | null | null | null | antiword_test.py | AmanBudhraja/M.engProject | c49eafaaf0be62b2183e27f499aa8cb4d4856447 | [
"MIT"
] | null | null | null | import os, docx2txt, PyPDF2
filepath = "A:/ECE9013A_Fall2019.pdf"
text = get_doc_text(filepath)
print(text)
| 33.886364 | 102 | 0.565392 | import os, docx2txt, PyPDF2
def get_doc_text(filepath):
if filepath.endswith('.docx'):
text = docx2txt.process(filepath)
return text
elif filepath.endswith('.doc'):
# converting .doc to .docx
doc_file = filepath
docx_file = filepath + 'x'
if not os.path.exists(... | 1,350 | 0 | 23 |
9a10b93b1e8fde26008b598c2634361fc129b639 | 828 | py | Python | problems/test_0075_countingsort.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0075_countingsort.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0075_countingsort.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 23 | 74 | 0.497585 | import unittest
class Solution:
def sortColors(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
counts = [0] * 3
for num in nums:
counts[num] += 1
sum_ = 0
for i in range(3):
... | 267 | 395 | 99 |
9a0a2a0ac163d946d7fabbd3be202d2575f75952 | 5,148 | py | Python | RegressionModels/LinearRegression/HousePriceEstimation.py | mohansaimandalapu/MachineLearningProjects | 6d5e325a0b6edafd0e41e07c977090f68850f491 | [
"MIT"
] | null | null | null | RegressionModels/LinearRegression/HousePriceEstimation.py | mohansaimandalapu/MachineLearningProjects | 6d5e325a0b6edafd0e41e07c977090f68850f491 | [
"MIT"
] | 1 | 2021-05-18T06:26:33.000Z | 2021-05-18T11:02:14.000Z | RegressionModels/LinearRegression/HousePriceEstimation.py | mohansaimandalapu/MachineLearningProjects | 6d5e325a0b6edafd0e41e07c977090f68850f491 | [
"MIT"
] | 1 | 2020-10-26T13:34:01.000Z | 2020-10-26T13:34:01.000Z | import pandas as pd
from sklearn.linear_model import LinearRegression
import numpy as np
from sklearn.metrics import mean_squared_error
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
import sklearn
from pathlib import Path
import matplotlib.pyplot as plt
from sklearn.preprocessin... | 34.092715 | 234 | 0.736208 | import pandas as pd
from sklearn.linear_model import LinearRegression
import numpy as np
from sklearn.metrics import mean_squared_error
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
import sklearn
from pathlib import Path
import matplotlib.pyplot as plt
from sklearn.preprocessin... | 0 | 0 | 0 |
8533e395982bc717c66dbd4cbb9efa3d688eedc5 | 675 | py | Python | tests/factories.py | DevOpsWishlist/wishlists | 5275003e9278a012c2e2d2a8d75db41971c58220 | [
"Apache-2.0"
] | null | null | null | tests/factories.py | DevOpsWishlist/wishlists | 5275003e9278a012c2e2d2a8d75db41971c58220 | [
"Apache-2.0"
] | 57 | 2021-02-22T21:52:52.000Z | 2021-05-24T10:17:02.000Z | tests/factories.py | DevOpsWishlist/wishlists | 5275003e9278a012c2e2d2a8d75db41971c58220 | [
"Apache-2.0"
] | null | null | null | """
Test Factory to make fake objects for testing
"""
import factory
from datetime import datetime
from factory.fuzzy import FuzzyChoice
from service.models import WishList, Item
class ItemFactory(factory.Factory):
""" Creates fake Addresses """
id = factory.Sequence(lambda n: n)
# account_id = ???
nam... | 21.774194 | 59 | 0.671111 | """
Test Factory to make fake objects for testing
"""
import factory
from datetime import datetime
from factory.fuzzy import FuzzyChoice
from service.models import WishList, Item
class ItemFactory(factory.Factory):
""" Creates fake Addresses """
class Meta:
model = Item
id = factory.Sequence(lamb... | 0 | 26 | 54 |
bd4f73859f255272632f914e37b56bda35c7a0fb | 1,005 | py | Python | daemon/start_daemon.py | Robert-Kolmos/GitUp1 | 5a4bbbbd6f4ad82dfea7a78fb988eba25b574ee9 | [
"MIT"
] | null | null | null | daemon/start_daemon.py | Robert-Kolmos/GitUp1 | 5a4bbbbd6f4ad82dfea7a78fb988eba25b574ee9 | [
"MIT"
] | null | null | null | daemon/start_daemon.py | Robert-Kolmos/GitUp1 | 5a4bbbbd6f4ad82dfea7a78fb988eba25b574ee9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.7
from daemon import GitUpDaemon
import os
# The repository information is stored in this file.
if __name__ == "__main__":
start_daemon()
| 29.558824 | 66 | 0.595025 | #!/usr/bin/env python3.7
from daemon import GitUpDaemon
import os
# The repository information is stored in this file.
def start_daemon():
repofile = "/tmp/gitup/repositories.csv"
logs_dir = '/tmp/gitup/'
out = '/tmp/gitup/daemon.out'
err = '/tmp/gitup/daemon.err'
# make sure the directory to write... | 812 | 0 | 22 |
fc1ee74f746bc8e00e83204ee018fcd480e507fa | 1,020 | py | Python | projects/OpenNeuroSample/example.py | cocozhao321/rt-cloud | 4293f65f86730eb97c13aafdca02b710d3fe1173 | [
"Apache-2.0"
] | null | null | null | projects/OpenNeuroSample/example.py | cocozhao321/rt-cloud | 4293f65f86730eb97c13aafdca02b710d3fe1173 | [
"Apache-2.0"
] | null | null | null | projects/OpenNeuroSample/example.py | cocozhao321/rt-cloud | 4293f65f86730eb97c13aafdca02b710d3fe1173 | [
"Apache-2.0"
] | null | null | null | """
An example to download OpenNeuro dataset and stream it as BIDS-I.
This example uses OpenNeuro Dataset ds003030_sub01
"""
from projects.OpenNeuroSample.OpenNeuroProto import OpenNeuroOverview
from projects.OpenNeuroSample.openNeuroUpdate import OutputUpdate
if __name__ == "__main__":
main() | 37.777778 | 121 | 0.762745 | """
An example to download OpenNeuro dataset and stream it as BIDS-I.
This example uses OpenNeuro Dataset ds003030_sub01
"""
from projects.OpenNeuroSample.OpenNeuroProto import OpenNeuroOverview
from projects.OpenNeuroSample.openNeuroUpdate import OutputUpdate
def main():
# checkout the dataset
overview = Op... | 697 | 0 | 23 |
b9a08f27f60b92a9f66adfdddbe2110ddc0b80da | 2,871 | py | Python | math/0x03-probability/binomial.py | sebaslherrera/holbertonschool-machine_learning | a4c09230688700aee199f4099de32261104918be | [
"MIT"
] | null | null | null | math/0x03-probability/binomial.py | sebaslherrera/holbertonschool-machine_learning | a4c09230688700aee199f4099de32261104918be | [
"MIT"
] | null | null | null | math/0x03-probability/binomial.py | sebaslherrera/holbertonschool-machine_learning | a4c09230688700aee199f4099de32261104918be | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Project 0x03. Probability"""
class Binomial:
"""Class that represents an Binomial distribution"""
e = 2.7182818285
pi = 3.1415926536
def __init__(self, data=None, n=1, p=0.5):
"""Constructor of Binomial
Parameters:
data (list): list of the data to ... | 25.184211 | 78 | 0.516545 | #!/usr/bin/env python3
"""Project 0x03. Probability"""
class Binomial:
"""Class that represents an Binomial distribution"""
e = 2.7182818285
pi = 3.1415926536
def __init__(self, data=None, n=1, p=0.5):
"""Constructor of Binomial
Parameters:
data (list): list of the data to ... | 0 | 0 | 0 |
2d2e2e14a7265b0780d811febdb96a16b1f5c7af | 674 | py | Python | test/basic.py | hugoprudente/pycritic | 201d9fa01ebf6a103b70738d2bd92d556d519073 | [
"MIT"
] | 9 | 2015-07-14T16:07:33.000Z | 2021-03-31T18:41:16.000Z | test/basic.py | hugoprudente/pycritic | 201d9fa01ebf6a103b70738d2bd92d556d519073 | [
"MIT"
] | null | null | null | test/basic.py | hugoprudente/pycritic | 201d9fa01ebf6a103b70738d2bd92d556d519073 | [
"MIT"
] | 5 | 2016-05-04T17:53:44.000Z | 2022-01-08T08:31:42.000Z | import pycritic
if __name__ == "__main__":
main()
| 30.636364 | 80 | 0.700297 | import pycritic
def print_resource_data(resource):
print "Name: " + resource.name
print "Release date: " + resource.date
print "Metascore: " + str(resource.metascore)
print "Userscore: " + str(resource.userscore)
print "Description: " + resource.description
def main():
scraper = pycritic.Scra... | 572 | 0 | 46 |
0849699776956afc0dc990e8d7267f47912de6ac | 3,182 | py | Python | yozuch/config.py | akrylysov/yozuch | 0eb6206c8c2fff806a8901456cfc4cc338052a95 | [
"BSD-3-Clause"
] | 32 | 2015-02-01T16:35:21.000Z | 2022-03-14T00:50:32.000Z | yozuch/config.py | akrylysov/yozuch | 0eb6206c8c2fff806a8901456cfc4cc338052a95 | [
"BSD-3-Clause"
] | 6 | 2015-06-19T10:58:35.000Z | 2019-04-07T16:38:01.000Z | yozuch/config.py | akrylysov/yozuch | 0eb6206c8c2fff806a8901456cfc4cc338052a95 | [
"BSD-3-Clause"
] | 1 | 2017-01-21T18:51:11.000Z | 2017-01-21T18:51:11.000Z | """
Default configuration and configuration related helpers.
"""
import copy
import os
import importlib.util
from yozuch.view import view
PACKAGE_DIR = os.path.dirname(__file__)
| 29.192661 | 107 | 0.576681 | """
Default configuration and configuration related helpers.
"""
import copy
import os
import importlib.util
from yozuch.view import view
PACKAGE_DIR = os.path.dirname(__file__)
class DefaultConfig(object):
DEBUG = False
TITLE = 'Site title'
URL = 'http://localhost:8000'
DESCRIPTION = 'Site descr... | 1,116 | 1,837 | 46 |
6f6ffe2cc228494bc9c5ea6d4e92b29788e1fe6d | 1,328 | py | Python | src/ci_workflow/ci_input_manifest.py | boktorbb-amzn/opensearch-build | ea5a964b2a570ac518b380ef6efd42c38ae9f911 | [
"Apache-2.0"
] | 62 | 2021-05-14T04:06:09.000Z | 2022-03-23T03:30:13.000Z | src/ci_workflow/ci_input_manifest.py | boktorbb-amzn/opensearch-build | ea5a964b2a570ac518b380ef6efd42c38ae9f911 | [
"Apache-2.0"
] | 1,590 | 2021-05-07T20:21:19.000Z | 2022-03-31T23:57:53.000Z | src/ci_workflow/ci_input_manifest.py | mch2/opensearch-build | 39464ae1ded2b628d5b6cacb22064b715906520d | [
"Apache-2.0"
] | 134 | 2021-05-07T19:27:56.000Z | 2022-03-24T23:06:17.000Z | # SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import logging
from ci_workflow.ci_check_lists import CiCheckLists
from ci_workflow.ci_manifest import CiManifest
from ci_work... | 36.888889 | 126 | 0.725904 | # SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import logging
from ci_workflow.ci_check_lists import CiCheckLists
from ci_workflow.ci_manifest import CiManifest
from ci_work... | 778 | 13 | 76 |
f0fb6a2538f33841224a7ecc9b974600b1e5efc6 | 443 | py | Python | src/GUI/compile_space/line.py | gitter-badger/GeoMetrics | 8f33a7da1db88ea49f10772c4bf63b357e9f066c | [
"MIT"
] | 1 | 2018-10-19T12:35:27.000Z | 2018-10-19T12:35:27.000Z | src/GUI/compile_space/line.py | gitter-badger/GeoMetrics | 8f33a7da1db88ea49f10772c4bf63b357e9f066c | [
"MIT"
] | null | null | null | src/GUI/compile_space/line.py | gitter-badger/GeoMetrics | 8f33a7da1db88ea49f10772c4bf63b357e9f066c | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from matplotlib import *
from numpy import *
from matplotlib.animation import *
name = "Line"
| 17.038462 | 69 | 0.659142 | import matplotlib.pyplot as plt
from matplotlib import *
from numpy import *
from matplotlib.animation import *
name = "Line"
def shape(fig, slope, a, b):
def x_(y):
x = 2*y
return x
y = linspace(a, b, 100)
#y = meshgrid(y)
x = x_(y)
plt.axis(grid)
plt.axis('equal')
line = plt.plot(x,y)
#... | 292 | 0 | 23 |
073be6d009b44ee5ab834a0e374db634c56b9903 | 36,392 | py | Python | odoo/base-addons/survey/models/survey_survey.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | odoo/base-addons/survey/models/survey_survey.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | odoo/base-addons/survey/models/survey_survey.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import uuid
from collections import Counter, OrderedDict
from itertools import product
from werkzeug import urls
import random
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.osv... | 49.178378 | 196 | 0.619724 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import uuid
from collections import Counter, OrderedDict
from itertools import product
from werkzeug import urls
import random
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.osv... | 9,256 | 0 | 639 |
5c6f0052b67e99312353d8f258a9203e7198bf74 | 3,539 | py | Python | camping_server2/database/review_table.py | solyourock/crawling_project | 068525f299eb180d46f1537ee2a02648bbec61ec | [
"MIT"
] | null | null | null | camping_server2/database/review_table.py | solyourock/crawling_project | 068525f299eb180d46f1537ee2a02648bbec61ec | [
"MIT"
] | null | null | null | camping_server2/database/review_table.py | solyourock/crawling_project | 068525f299eb180d46f1537ee2a02648bbec61ec | [
"MIT"
] | null | null | null | import pandas as pd
import re
import config as config
# 네이버 리뷰 전처리
# 카카오 리뷰 전처리
# 네이버와 카카오 리뷰 concat
# review table
# reviewer table
| 46.565789 | 144 | 0.556937 | import pandas as pd
import re
import config as config
class ReviewInsert:
def __init__(self):
self.naver = config.Config.NAVER
self.kakao = config.Config.KAKAO
self.camp=config.Config.CAMP
# 네이버 리뷰 전처리
def naver_review(self):
naver = self.naver
naver['user_info'] =... | 3,220 | -2 | 179 |
c5ecbb8f4093c9d1b57a4f9aefd519132d4e198c | 505 | py | Python | gitconfig_parser/metadata.py | seanfisk/gitconfig-parser | f747a4263bdd7fc4ffd6b6a0fe34ef7cf7e935a8 | [
"MIT"
] | null | null | null | gitconfig_parser/metadata.py | seanfisk/gitconfig-parser | f747a4263bdd7fc4ffd6b6a0fe34ef7cf7e935a8 | [
"MIT"
] | null | null | null | gitconfig_parser/metadata.py | seanfisk/gitconfig-parser | f747a4263bdd7fc4ffd6b6a0fe34ef7cf7e935a8 | [
"MIT"
] | 2 | 2019-03-07T04:55:29.000Z | 2019-03-28T00:59:55.000Z | """:mod:`gitconfig_parser.metadata` --- Project metadata
Information describing the project.
"""
# The package name, which is also the "UNIX name" for the project.
package = 'gitconfig_parser'
project = "gitconfig parser"
project_no_spaces = project.replace(' ', '')
version = '0.1'
description = 'Parse a .gitconfig f... | 28.055556 | 66 | 0.710891 | """:mod:`gitconfig_parser.metadata` --- Project metadata
Information describing the project.
"""
# The package name, which is also the "UNIX name" for the project.
package = 'gitconfig_parser'
project = "gitconfig parser"
project_no_spaces = project.replace(' ', '')
version = '0.1'
description = 'Parse a .gitconfig f... | 0 | 0 | 0 |
7f811144d31029ae77dbeca057082d4bb9bfc049 | 5,819 | py | Python | bilana/files/pofn.py | azadeha83/BilayAna | 1150a148da2864b88eff2bfb8204a5f51ace0b9a | [
"MIT"
] | null | null | null | bilana/files/pofn.py | azadeha83/BilayAna | 1150a148da2864b88eff2bfb8204a5f51ace0b9a | [
"MIT"
] | null | null | null | bilana/files/pofn.py | azadeha83/BilayAna | 1150a148da2864b88eff2bfb8204a5f51ace0b9a | [
"MIT"
] | null | null | null | import numpy as np
import bisect
from ..common import exec_gromacs
def pofn(systeminfo, neiblist, fname="neighbortype_distribution.dat"):
'''
Creates datafile < fname > with columns:
< time > < residue > < resname > < N comp 1 > < N comp 2 > ... < N comp i >
'''
components = systeminfo.mo... | 44.761538 | 115 | 0.488744 | import numpy as np
import bisect
from ..common import exec_gromacs
def write_pofn_file(outfilename, pofn, typeset, averageing='off', count_type='Ntot'):
with open(outfilename, "w") as outf:
print("{: <10}{: <5}{: <20}".format('Scd', count_type, ' '.join(sorted(typeset))), file=outf)
for scdval in s... | 1,064 | 0 | 23 |
dcd4cad40b670e6ad008de32199693584c038c27 | 16,037 | py | Python | src/triage/cli.py | DataFactorTOP/triage | f8d16c745fcb81740cb402671117d647e497c5a7 | [
"MIT"
] | null | null | null | src/triage/cli.py | DataFactorTOP/triage | f8d16c745fcb81740cb402671117d647e497c5a7 | [
"MIT"
] | null | null | null | src/triage/cli.py | DataFactorTOP/triage | f8d16c745fcb81740cb402671117d647e497c5a7 | [
"MIT"
] | null | null | null | import argparse
import importlib.util
import os
import yaml
from datetime import datetime
from descriptors import cachedproperty
from argcmdr import RootCommand, Command, main, cmdmethod
from sqlalchemy.engine.url import URL
from triage.component.architect.feature_generators import FeatureGenerator
from triage.compo... | 36.365079 | 218 | 0.616761 | import argparse
import importlib.util
import os
import yaml
from datetime import datetime
from descriptors import cachedproperty
from argcmdr import RootCommand, Command, main, cmdmethod
from sqlalchemy.engine.url import URL
from triage.component.architect.feature_generators import FeatureGenerator
from triage.compo... | 11,893 | 0 | 444 |
aab24a27b3201d7176b6d735e9eeae34b34971d2 | 15,903 | py | Python | gpt/gpt_util.py | etherlabsio/hinton | eedd99f6a5fbbc38283bbf945dff4f4006a3d1f5 | [
"MIT"
] | null | null | null | gpt/gpt_util.py | etherlabsio/hinton | eedd99f6a5fbbc38283bbf945dff4f4006a3d1f5 | [
"MIT"
] | null | null | null | gpt/gpt_util.py | etherlabsio/hinton | eedd99f6a5fbbc38283bbf945dff4f4006a3d1f5 | [
"MIT"
] | 1 | 2020-04-19T11:08:02.000Z | 2020-04-19T11:08:02.000Z | import argparse
import os
import csv
import random
import logging
from tqdm import tqdm, trange
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,
TensorDataset)
from pytorch_pretrained_bert import (OpenAIGPTDoubleHeadsModel, OpenA... | 50.485714 | 239 | 0.749481 | import argparse
import os
import csv
import random
import logging
from tqdm import tqdm, trange
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,
TensorDataset)
from pytorch_pretrained_bert import (OpenAIGPTDoubleHeadsModel, OpenA... | 5,306 | 0 | 214 |
5b21054650292a232b0a2123e23f4300d1188808 | 11,421 | py | Python | data_processing/filter_aichallenge2018_only_single_person.py | tucan9389/mobile-pose-estimation-for-TF2 | 82a01359820c1797505a13bc663df49b717cc696 | [
"Apache-2.0"
] | 122 | 2019-04-08T04:20:26.000Z | 2021-03-22T05:32:29.000Z | data_processing/filter_aichallenge2018_only_single_person.py | tucan9389/mobile-pose-estimation-for-TF2 | 82a01359820c1797505a13bc663df49b717cc696 | [
"Apache-2.0"
] | 45 | 2019-03-31T22:29:31.000Z | 2021-03-21T07:00:08.000Z | data_processing/filter_aichallenge2018_only_single_person.py | tucan9389/mobile-pose-estimation-for-TF2 | 82a01359820c1797505a13bc663df49b717cc696 | [
"Apache-2.0"
] | 35 | 2019-05-24T03:43:11.000Z | 2021-03-09T08:22:22.000Z | import os, json, shutil
# coco_annotation_json_path = "/home/centos/datasets/ai_challenger_2018/ai_challenger_keypoint_train_20170909/keypoint_train_annotations_20170909.json"
# image_source_dir_path = "/home/centos/datasets/ai_challenger_2018/ai_challenger_keypoint_train_20170909/keypoint_train_images_201... | 47.987395 | 875 | 0.687068 | import os, json, shutil
# coco_annotation_json_path = "/home/centos/datasets/ai_challenger_2018/ai_challenger_keypoint_train_20170909/keypoint_train_annotations_20170909.json"
# image_source_dir_path = "/home/centos/datasets/ai_challenger_2018/ai_challenger_keypoint_train_20170909/keypoint_train_images_201... | 0 | 0 | 0 |
ad6fccd97c42913f9a12c342b71ce5c7c1616c3d | 8,231 | py | Python | mGui/events.py | theodox/mGui | d2cd8c48ae1d51c9587b0aaab5b1d296a0561625 | [
"MIT"
] | 105 | 2015-01-13T10:52:55.000Z | 2022-03-23T12:49:01.000Z | mGui/events.py | techartorg/mGui | d2cd8c48ae1d51c9587b0aaab5b1d296a0561625 | [
"MIT"
] | 84 | 2015-01-15T14:56:08.000Z | 2019-04-15T17:03:51.000Z | mGui/events.py | techartorg/mGui | d2cd8c48ae1d51c9587b0aaab5b1d296a0561625 | [
"MIT"
] | 22 | 2015-01-11T11:25:37.000Z | 2021-12-24T06:34:46.000Z | """
events.py
Defines a simple event handler system similar to that used in C#. Events allow
multicast delegates and arbitrary message passing. They use weak references so
they don't keep their handlers alive if they are otherwise out of scope.
"""
import weakref
import maya.utils
from functools import partial, wrap... | 28.679443 | 113 | 0.604422 | """
events.py
Defines a simple event handler system similar to that used in C#. Events allow
multicast delegates and arbitrary message passing. They use weak references so
they don't keep their handlers alive if they are otherwise out of scope.
"""
import weakref
import maya.utils
from functools import partial, wrap... | 1,312 | 0 | 296 |
a5f8f84904a521d378c6142ffd089939a1e26fa7 | 3,254 | py | Python | test/unit/extractor/test_non_primary_key_tables.py | willangenent/abridger | 6daa80f7360339376b38544ce60694c5addaa30f | [
"MIT"
] | 8 | 2016-10-19T14:15:34.000Z | 2020-06-23T09:37:02.000Z | test/unit/extractor/test_non_primary_key_tables.py | freewilll/abridger | 6daa80f7360339376b38544ce60694c5addaa30f | [
"MIT"
] | null | null | null | test/unit/extractor/test_non_primary_key_tables.py | freewilll/abridger | 6daa80f7360339376b38544ce60694c5addaa30f | [
"MIT"
] | null | null | null | import pytest
from abridger.extraction_model import Relation
from abridger.schema import SqliteSchema
from test.unit.extractor.base import TestExtractorBase
| 26.032 | 72 | 0.461893 | import pytest
from abridger.extraction_model import Relation
from abridger.schema import SqliteSchema
from test.unit.extractor.base import TestExtractorBase
class TestExtractorNonPrimaryKeyTables(TestExtractorBase):
REL_EVERYTHING = [{'defaults': Relation.DEFAULT_EVERYTHING}]
schema1 = [
'''CREATE T... | 529 | 2,543 | 23 |
a058ad0d4a712b1de02aa04af18c78ce90cac74b | 259 | py | Python | transbank/error/transaction_create_error.py | atpollmann/transbank-sdk-python | 84adba01bc81110431ae49da95c9f7b823790f23 | [
"BSD-3-Clause"
] | 22 | 2018-10-11T17:37:35.000Z | 2022-03-20T23:53:32.000Z | transbank/error/transaction_create_error.py | atpollmann/transbank-sdk-python | 84adba01bc81110431ae49da95c9f7b823790f23 | [
"BSD-3-Clause"
] | 25 | 2018-10-10T12:10:13.000Z | 2022-01-27T19:04:22.000Z | transbank/error/transaction_create_error.py | atpollmann/transbank-sdk-python | 84adba01bc81110431ae49da95c9f7b823790f23 | [
"BSD-3-Clause"
] | 10 | 2018-12-04T16:41:17.000Z | 2021-05-31T16:02:43.000Z | from transbank.error.transbank_error import TransbankError
| 37 | 111 | 0.772201 | from transbank.error.transbank_error import TransbankError
class TransactionCreateError(TransbankError):
def __init__(self, message = "Transaction could not be created. Please verify given parameters", code = 0):
super().__init__(message, code)
| 126 | 24 | 49 |
db3ea965c5c068c95deadd65f2f299b1fb2aad20 | 3,478 | py | Python | app/views.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 29 | 2016-12-18T08:44:26.000Z | 2022-03-20T09:39:22.000Z | app/views.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 11 | 2016-11-22T01:13:11.000Z | 2022-03-04T21:21:15.000Z | app/views.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 5 | 2017-02-07T08:54:49.000Z | 2022-01-13T15:23:45.000Z | import json
import sys
import os.path as path
from flask import render_template, jsonify, request
from app import app
base_directory = path.dirname(path.dirname(path.abspath(__file__)))
sys.path.append(path.join(base_directory, 'engine'))
import engine
import metrics
optimisation_functions = {'Maximise': max, 'Minim... | 32.203704 | 89 | 0.642611 | import json
import sys
import os.path as path
from flask import render_template, jsonify, request
from app import app
base_directory = path.dirname(path.dirname(path.abspath(__file__)))
sys.path.append(path.join(base_directory, 'engine'))
import engine
import metrics
optimisation_functions = {'Maximise': max, 'Minim... | 992 | 0 | 44 |
708de96b5e867459e01ef603bcccd38b98f7676d | 2,532 | py | Python | NotIncluded/Draw_NetworkX_Graph.py | DaluS/GEMMES | 10d4a062004ce5b7fd26eb8c4937d940b7d097d5 | [
"MIT"
] | 4 | 2021-06-28T07:11:34.000Z | 2022-01-11T13:43:17.000Z | NotIncluded/Draw_NetworkX_Graph.py | DaluS/GEMMES | 10d4a062004ce5b7fd26eb8c4937d940b7d097d5 | [
"MIT"
] | 167 | 2021-06-28T07:10:21.000Z | 2022-03-18T17:30:40.000Z | NotIncluded/Draw_NetworkX_Graph.py | DaluS/GEMMES | 10d4a062004ce5b7fd26eb8c4937d940b7d097d5 | [
"MIT"
] | 3 | 2021-06-28T07:19:12.000Z | 2022-03-03T02:44:15.000Z | # -*- coding: utf-8 -*
import pandas as pd
import pygraphviz
import numpy as np
import pygemmes as pgm
import networkx as nx
import matplotlib.pyplot as plt
from graph_tools import Graph
import graph_tools as gt
import pygraphviz as pgv
A = pgv.AGraph(directed=True,)
model = 'GK'
hub = pgm.Hub(model, verb=False)
R = ... | 26.652632 | 77 | 0.631122 | # -*- coding: utf-8 -*
import pandas as pd
import pygraphviz
import numpy as np
import pygemmes as pgm
import networkx as nx
import matplotlib.pyplot as plt
from graph_tools import Graph
import graph_tools as gt
import pygraphviz as pgv
A = pgv.AGraph(directed=True,)
model = 'GK'
hub = pgm.Hub(model, verb=False)
R = ... | 0 | 0 | 0 |
94e2f679c8e9b5dd0244c89c55f353b897eaaca9 | 481 | py | Python | hot/software-config/elements/heat-config-cfn-init/install.d/hook-cfn-init.py | ader1990/heat-templates | 47d4b403af5b557b3885556b75c903d504f9354d | [
"Apache-2.0"
] | 1 | 2017-09-27T18:19:21.000Z | 2017-09-27T18:19:21.000Z | hot/software-config/elements/heat-config-cfn-init/install.d/hook-cfn-init.py | abettadapur/heat-templates | c9b682f1eff9b1ecf8de08af7760e5ed7c070adb | [
"Apache-2.0"
] | null | null | null | hot/software-config/elements/heat-config-cfn-init/install.d/hook-cfn-init.py | abettadapur/heat-templates | c9b682f1eff9b1ecf8de08af7760e5ed7c070adb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from heat_cfntools.cfntools import cfn_helper
import json
import sys
if __name__ == '__main__':
sys.exit(main(sys.argv))
| 22.904762 | 48 | 0.677755 | #!/usr/bin/env python
from heat_cfntools.cfntools import cfn_helper
import json
import sys
def main(argv=sys.argv):
c = json.load(sys.stdin)
config = c.get('config', {})
if not isinstance(config, dict):
config = json.loads(config)
meta = {'AWS::CloudFormation::Init': config}
metadata = c... | 309 | 0 | 23 |
7666fb4eaae5093557e63fd6895154c351f16afa | 2,334 | py | Python | flask_request_logger/request_logger.py | passiomatic/flask-request-logger | bbace0a0c3ba80b87bd03f53fcec290ba7ded9aa | [
"MIT"
] | 5 | 2018-10-26T09:49:40.000Z | 2022-01-13T06:40:06.000Z | flask_request_logger/request_logger.py | passiomatic/flask-request-logger | bbace0a0c3ba80b87bd03f53fcec290ba7ded9aa | [
"MIT"
] | 1 | 2019-08-20T02:40:02.000Z | 2019-08-20T02:40:02.000Z | flask_request_logger/request_logger.py | passiomatic/flask-request-logger | bbace0a0c3ba80b87bd03f53fcec290ba7ded9aa | [
"MIT"
] | 4 | 2019-08-17T16:48:26.000Z | 2021-05-25T12:02:17.000Z | from flask import request
from sqlalchemy.engine.url import make_url
from .cli import logger_cli
from .models import RequestLog, ResponseLog
from .api import RequestLogAPI, ResponseLogAPI, LogAPI
| 34.835821 | 122 | 0.691088 | from flask import request
from sqlalchemy.engine.url import make_url
from .cli import logger_cli
from .models import RequestLog, ResponseLog
from .api import RequestLogAPI, ResponseLogAPI, LogAPI
class RequestLogger(object):
def __init__(self, app=None):
if app is not None:
self.init_app(app... | 1,917 | 7 | 212 |
6f31fe2d4e259ee5e5ee9297370fbb182351a229 | 17,536 | py | Python | tests/integration_tests/performance/test_network_tcp_throughput.py | Tobbeman/firecracker | b4376a9e5ab03d3754b6d3001972968251df4d8b | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/performance/test_network_tcp_throughput.py | Tobbeman/firecracker | b4376a9e5ab03d3754b6d3001972968251df4d8b | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/performance/test_network_tcp_throughput.py | Tobbeman/firecracker | b4376a9e5ab03d3754b6d3001972968251df4d8b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests the network throughput of Firecracker uVMs."""
import json
import logging
import time
import concurrent.futures
import pytest
from conftest import _test_images_s3_bucket
from framework.artifacts im... | 41.752381 | 79 | 0.602304 | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests the network throughput of Firecracker uVMs."""
import json
import logging
import time
import concurrent.futures
import pytest
from conftest import _test_images_s3_bucket
from framework.artifacts im... | 521 | 0 | 26 |
b3715c510b71bd30b076561c32affaf68f804c42 | 5,039 | py | Python | mfsetup/ic.py | aleaf/MFsetup | 85cc44eb767c595b19006e43587699be4771f818 | [
"CC0-1.0"
] | 21 | 2020-05-06T16:40:06.000Z | 2022-02-13T03:57:19.000Z | mfsetup/ic.py | aleaf/MFsetup | 85cc44eb767c595b19006e43587699be4771f818 | [
"CC0-1.0"
] | 39 | 2020-05-13T12:35:48.000Z | 2022-01-26T18:03:42.000Z | mfsetup/ic.py | aleaf/MFsetup | 85cc44eb767c595b19006e43587699be4771f818 | [
"CC0-1.0"
] | 12 | 2020-04-06T15:06:47.000Z | 2022-01-24T14:14:12.000Z | """
Functions for setting up starting heads
"""
import shutil
from mfsetup.fileio import save_array, setup_external_filepaths
from mfsetup.mf5to6 import get_variable_name, get_variable_package_name
from mfsetup.sourcedata import (
ArraySourceData,
MFArrayData,
MFBinaryArraySourceData,
get_source_data_f... | 43.817391 | 92 | 0.576305 | """
Functions for setting up starting heads
"""
import shutil
from mfsetup.fileio import save_array, setup_external_filepaths
from mfsetup.mf5to6 import get_variable_name, get_variable_package_name
from mfsetup.sourcedata import (
ArraySourceData,
MFArrayData,
MFBinaryArraySourceData,
get_source_data_f... | 4,638 | 0 | 23 |
03374072ec19f619188be3e572e09621f87343e2 | 5,303 | py | Python | python/tests/src/v3/test_async_report.py | patricker/api-quickstart | 39da07ae436292957fca2cab36ecffc4d1be7733 | [
"Apache-2.0"
] | 39 | 2021-07-14T21:48:21.000Z | 2022-03-20T15:05:11.000Z | python/tests/src/v3/test_async_report.py | patricker/api-quickstart | 39da07ae436292957fca2cab36ecffc4d1be7733 | [
"Apache-2.0"
] | 12 | 2021-07-13T18:43:53.000Z | 2022-03-31T23:11:39.000Z | python/tests/src/v3/test_async_report.py | patricker/api-quickstart | 39da07ae436292957fca2cab36ecffc4d1be7733 | [
"Apache-2.0"
] | 12 | 2021-09-25T01:19:07.000Z | 2022-03-23T12:03:34.000Z | import unittest
import mock
from mock import call
from src.v3.async_report import AsyncReport
| 38.151079 | 88 | 0.624364 | import unittest
import mock
from mock import call
from src.v3.async_report import AsyncReport
class AsyncReportTest(unittest.TestCase):
@mock.patch("src.v3.async_report.ApiObject.request_data")
@mock.patch("src.v3.async_report.ApiObject.post_data")
@mock.patch("src.v3.async_report.ApiObject.__init__")
... | 4,688 | 495 | 23 |
d6903670e3f8f3b0f64ccf1783a4a2c22d736b41 | 67 | py | Python | Inheritance/Exercises/02. zoo/project/lizard.py | geodimitrov/PythonOOP_SoftUni | f1c6718c878b618b3ab3f174cd4d187bd178940b | [
"MIT"
] | 1 | 2021-06-30T11:53:44.000Z | 2021-06-30T11:53:44.000Z | Inheritance/Exercises/02. zoo/project/lizard.py | geodimitrov/PythonOOP_SoftUni | f1c6718c878b618b3ab3f174cd4d187bd178940b | [
"MIT"
] | null | null | null | Inheritance/Exercises/02. zoo/project/lizard.py | geodimitrov/PythonOOP_SoftUni | f1c6718c878b618b3ab3f174cd4d187bd178940b | [
"MIT"
] | null | null | null | from project.reptile import Reptile | 22.333333 | 35 | 0.791045 | from project.reptile import Reptile
class Lizard(Reptile):
pass | 0 | 10 | 22 |
0dbac0c2d70a9f50a7701c7330f2e30799e45748 | 1,259 | py | Python | blog.py | rserling/blogapi | ff26ff9503c78b1778ae65d8b30438d900bb205d | [
"Apache-2.0"
] | null | null | null | blog.py | rserling/blogapi | ff26ff9503c78b1778ae65d8b30438d900bb205d | [
"Apache-2.0"
] | null | null | null | blog.py | rserling/blogapi | ff26ff9503c78b1778ae65d8b30438d900bb205d | [
"Apache-2.0"
] | null | null | null | ####
## see EOF where you have to set the listening IP, that's the only edit
from flask import Flask, request, make_response
from flask_restful import Resource, Api
from flask_jsonpify import jsonify
from json import dumps
from sqlalchemy import create_engine
# post_id
# title
# body
db_connect = create_engine('sqli... | 26.787234 | 86 | 0.69579 | ####
## see EOF where you have to set the listening IP, that's the only edit
from flask import Flask, request, make_response
from flask_restful import Resource, Api
from flask_jsonpify import jsonify
from json import dumps
from sqlalchemy import create_engine
# post_id
# title
# body
db_connect = create_engine('sqli... | 458 | 1 | 114 |
40a7ede8a018d55657337243bc47b0c601e47bff | 2,703 | py | Python | 2.show_conv1bn_pic.py | Tcloser/resnet_conv_show | b4d0e67a41888cb8fe513087d968f99cdecf1a64 | [
"MIT"
] | 1 | 2019-07-30T05:27:57.000Z | 2019-07-30T05:27:57.000Z | 2.show_conv1bn_pic.py | Tcloser/resnet_conv_show | b4d0e67a41888cb8fe513087d968f99cdecf1a64 | [
"MIT"
] | null | null | null | 2.show_conv1bn_pic.py | Tcloser/resnet_conv_show | b4d0e67a41888cb8fe513087d968f99cdecf1a64 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
import cv2
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
if __name__ == '__main__':
unloader = transforms.ToPILImage()
device = torch.device('cuda:0... | 35.565789 | 120 | 0.572697 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
import cv2
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
class resnet():
def __init__(self, inplanes, planes, kernel_size,stride=1,padding=1):
sel... | 2,338 | -6 | 122 |
b5164d931aebc0c2c26ea7e2fb6a9aeb49f33b51 | 1,877 | py | Python | cnn.py | loop333/ha_web_server_example | 4327f356e9c3477f10c311a29ffa368d69241c47 | [
"MIT"
] | 1 | 2020-11-24T06:26:33.000Z | 2020-11-24T06:26:33.000Z | cnn.py | loop333/ha_web_server_example | 4327f356e9c3477f10c311a29ffa368d69241c47 | [
"MIT"
] | null | null | null | cnn.py | loop333/ha_web_server_example | 4327f356e9c3477f10c311a29ffa368d69241c47 | [
"MIT"
] | null | null | null | import logging
import urllib.request
import xml.etree.ElementTree as ET
import re
from . import HTMLView
import homeassistant.core as ha
_LOGGER = logging.getLogger(__name__)
| 34.127273 | 79 | 0.478956 | import logging
import urllib.request
import xml.etree.ElementTree as ET
import re
from . import HTMLView
import homeassistant.core as ha
_LOGGER = logging.getLogger(__name__)
class cnn(HTMLView):
url = '/my_api/news/cnn/{path:.*}'
name = 'my_api:news_cnn'
requires_auth = False
@ha.callback
def ... | 1,539 | 137 | 23 |
8d0ea1fc6385f18441014c4f433e3f19413d5ef7 | 63 | py | Python | datahub/omis/payment/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 6 | 2019-12-02T16:11:24.000Z | 2022-03-18T10:02:02.000Z | datahub/omis/payment/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 1,696 | 2019-10-31T14:08:37.000Z | 2022-03-29T12:35:57.000Z | datahub/omis/payment/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 9 | 2019-11-22T12:42:03.000Z | 2021-09-03T14:25:05.000Z | default_app_config = 'datahub.omis.payment.apps.PaymentConfig'
| 31.5 | 62 | 0.84127 | default_app_config = 'datahub.omis.payment.apps.PaymentConfig'
| 0 | 0 | 0 |
4d5f9943269cd8039084ce660955ac1c487d0dc9 | 326 | py | Python | Utuputki/manager/urls.py | katajakasa/utuputki | e20cc950b59c66a0279a05fd6362c2985af4a022 | [
"MIT"
] | 2 | 2015-04-28T08:04:28.000Z | 2016-04-16T22:34:36.000Z | Utuputki/manager/urls.py | katajakasa/utuputki | e20cc950b59c66a0279a05fd6362c2985af4a022 | [
"MIT"
] | 12 | 2015-02-11T17:08:13.000Z | 2015-02-20T22:39:20.000Z | Utuputki/manager/urls.py | katajakasa/utuputki | e20cc950b59c66a0279a05fd6362c2985af4a022 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns(
'Utuputki.manager.views',
url(r'^$', 'index', name="index"),
url(r'^linklist/$', 'linklist', name="linklist"),
url(r'^reqskip/$', 'request_skip', name="reqskip"),
url(r'^getdata/$', 'get_data', name="getdata... | 27.166667 | 55 | 0.607362 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns(
'Utuputki.manager.views',
url(r'^$', 'index', name="index"),
url(r'^linklist/$', 'linklist', name="linklist"),
url(r'^reqskip/$', 'request_skip', name="reqskip"),
url(r'^getdata/$', 'get_data', name="getdata... | 0 | 0 | 0 |
6b76a40f910ad81a0d43315e4b598b00dfe30784 | 1,972 | py | Python | videoLooper.py | barrulik/video-looper | e9b3d2ae38d639b9b08891fdadf7687cb5b6db68 | [
"Apache-2.0"
] | null | null | null | videoLooper.py | barrulik/video-looper | e9b3d2ae38d639b9b08891fdadf7687cb5b6db68 | [
"Apache-2.0"
] | null | null | null | videoLooper.py | barrulik/video-looper | e9b3d2ae38d639b9b08891fdadf7687cb5b6db68 | [
"Apache-2.0"
] | null | null | null | # Python program to play a video
# in reverse mode using opencv
# import cv2 library
import cv2
import os
import shutil
if os.path.isdir("images"):
shutil.rmtree("images")
os.mkdir("images")
fileName = input("type the file path: ")
# videoCapture method of cv2 return video object
# Pass absolute address of video fil... | 22.930233 | 112 | 0.727688 | # Python program to play a video
# in reverse mode using opencv
# import cv2 library
import cv2
import os
import shutil
if os.path.isdir("images"):
shutil.rmtree("images")
os.mkdir("images")
fileName = input("type the file path: ")
# videoCapture method of cv2 return video object
# Pass absolute address of video fil... | 0 | 0 | 0 |
5f013d7157104d5ee7d0a4a18aa044f7d675251a | 275 | py | Python | testes e exercícios/URI/URI_PositivosMedia.py | LightSnow17/exercicios-Python | 3ac016ce284860f45d71cfb396d33a73ec06c25d | [
"MIT"
] | null | null | null | testes e exercícios/URI/URI_PositivosMedia.py | LightSnow17/exercicios-Python | 3ac016ce284860f45d71cfb396d33a73ec06c25d | [
"MIT"
] | null | null | null | testes e exercícios/URI/URI_PositivosMedia.py | LightSnow17/exercicios-Python | 3ac016ce284860f45d71cfb396d33a73ec06c25d | [
"MIT"
] | null | null | null | # Variaveis
i = 1
# Definir o vetor no escopo
lista = []
a = 0
while i <= 6:
lista.append(float(input()))
if(lista[i] > 0):
a += 1
i += 1
pass
print ('Os valores foram: ')
j = 0
num_Cont = len(a)
while j < num_Cont:
print(a)
j += 1
pass | 13.095238 | 32 | 0.52 | # Variaveis
i = 1
# Definir o vetor no escopo
lista = []
a = 0
while i <= 6:
lista.append(float(input()))
if(lista[i] > 0):
a += 1
i += 1
pass
print ('Os valores foram: ')
j = 0
num_Cont = len(a)
while j < num_Cont:
print(a)
j += 1
pass | 0 | 0 | 0 |
8f0041ba26b0117c46db52a8bb46cde380392ac6 | 6,218 | py | Python | integration_tests/test_deed.py | LandRegistry/gatekeeper | e809ee4d5fe6737b2be456174a09ad6878391eca | [
"MIT"
] | null | null | null | integration_tests/test_deed.py | LandRegistry/gatekeeper | e809ee4d5fe6737b2be456174a09ad6878391eca | [
"MIT"
] | null | null | null | integration_tests/test_deed.py | LandRegistry/gatekeeper | e809ee4d5fe6737b2be456174a09ad6878391eca | [
"MIT"
] | null | null | null | import json
import unittest
import PyPDF2
import io
import os
import time
import requests
from integration_tests.deed_data import valid_deed
from gatekeeper.main import app
| 41.178808 | 144 | 0.608717 | import json
import unittest
import PyPDF2
import io
import os
import time
import requests
from integration_tests.deed_data import valid_deed
from gatekeeper.main import app
class TestDeedRoutes(unittest.TestCase):
webseal_headers = {
"Content-Type": "application/json",
os.getenv("WEBSEAL_HEADER_K... | 5,495 | 525 | 23 |
80cf66be167904a4b8f24d650b2ddbed60d794d5 | 1,754 | py | Python | tests/integration/test_client.py | Global19-atlassian-net/python2 | 35e998bdf4a2a9f9852d5fcc841ff29218aea3cf | [
"MIT"
] | 1 | 2017-02-13T18:26:24.000Z | 2017-02-13T18:26:24.000Z | tests/integration/test_client.py | Global19-atlassian-net/python2 | 35e998bdf4a2a9f9852d5fcc841ff29218aea3cf | [
"MIT"
] | null | null | null | tests/integration/test_client.py | Global19-atlassian-net/python2 | 35e998bdf4a2a9f9852d5fcc841ff29218aea3cf | [
"MIT"
] | 2 | 2020-07-31T16:36:25.000Z | 2020-07-31T16:36:32.000Z | import weakref
import pytest
from python2.client import Py2Error, Py2Object
def test_unique_proxy_objects(py2):
"""
Test that identical Python 2 objects are represented by the same
`Py2Object` object.
"""
f = py2.eval("lambda x: (x, x)")
o1, o2 = f(py2.object())._
assert o1 is o2
p... | 23.702703 | 78 | 0.647092 | import weakref
import pytest
from python2.client import Py2Error, Py2Object
def test_exception(py2, helpers):
with pytest.raises(Py2Error) as einfo:
py2.int("asdf")
py2.ping() # Make sure session is still working
assert hasattr(einfo.value, 'exception')
py2_exc = einfo.value.exception
... | 805 | 0 | 46 |
e16b5890dbc0181867767f69960414802a67ef00 | 1,521 | py | Python | src/scene.py | FabiaHC/Breakout | 07b4b91f2acf9e07a3224ba99f9fa9918a0f5d10 | [
"MIT"
] | null | null | null | src/scene.py | FabiaHC/Breakout | 07b4b91f2acf9e07a3224ba99f9fa9918a0f5d10 | [
"MIT"
] | null | null | null | src/scene.py | FabiaHC/Breakout | 07b4b91f2acf9e07a3224ba99f9fa9918a0f5d10 | [
"MIT"
] | null | null | null | import pygame
| 32.361702 | 84 | 0.644313 | import pygame
class SceneManager():
def __init__(self, initialSceneName, initialScene):
self.__currentScene = initialSceneName
initialScene.setScene = self.setScene
self.__scene = {initialSceneName : initialScene}
self.__scene[self.__currentScene]
def loop(self, events):
... | 1,210 | -12 | 309 |
f63d3fe6919698461a5f479584bbbe27ae3ad064 | 1,413 | py | Python | apps/view.py | kevin-meng/2022shanghai-covid | 5335f2283fd2739e4abcfaf09a2cdf2b8a223978 | [
"MIT"
] | null | null | null | apps/view.py | kevin-meng/2022shanghai-covid | 5335f2283fd2739e4abcfaf09a2cdf2b8a223978 | [
"MIT"
] | null | null | null | apps/view.py | kevin-meng/2022shanghai-covid | 5335f2283fd2739e4abcfaf09a2cdf2b8a223978 | [
"MIT"
] | null | null | null | import streamlit as st
import json
from PIL import Image
import pandas as pd
import streamlit.components.v1 as components
import plotly.graph_objects as go
from streamlit_folium import folium_static
from visual import plot_summary,load_point2layer,plot_map
from utils import load_pickle
from config import MODE, mobile_p... | 23.55 | 71 | 0.674452 | import streamlit as st
import json
from PIL import Image
import pandas as pd
import streamlit.components.v1 as components
import plotly.graph_objects as go
from streamlit_folium import folium_static
from visual import plot_summary,load_point2layer,plot_map
from utils import load_pickle
from config import MODE, mobile_p... | 1,040 | 0 | 45 |
4ec1eeb21a3fa678f8fa38d7586c01a00f767477 | 1,030 | py | Python | read_name.py | wangyuechina/LFNet-light-field-saliency-net | 59e4f52ac03f049a56009785a4afe2980cf7dd79 | [
"MIT"
] | 11 | 2019-11-03T10:35:59.000Z | 2022-03-23T07:55:02.000Z | read_name.py | wangyuechina/LFNet-light-field-saliency-net | 59e4f52ac03f049a56009785a4afe2980cf7dd79 | [
"MIT"
] | 2 | 2020-10-07T19:54:35.000Z | 2021-06-04T19:52:57.000Z | read_name.py | wangyuechina/LFNet-light-field-saliency-net | 59e4f52ac03f049a56009785a4afe2980cf7dd79 | [
"MIT"
] | 7 | 2019-10-08T04:45:35.000Z | 2021-08-23T17:00:24.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 20:57:14 2018
@author: dhubel
"""
import os
Test()
| 29.428571 | 91 | 0.592233 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 20:57:14 2018
@author: dhubel
"""
import os
def ListFilesToTxt(dir,file,wildcard,recursion):
exts = wildcard.split(" ")
files = os.listdir(dir)
files.sort()
for name in files:
fullname=os.path.join(dir,name)
if(... | 856 | 0 | 46 |
d07e141d373f71599755cdfc495f50452ed0963c | 3,197 | py | Python | stackcoin/__init__.py | jackharrhy/stackcoin-python | 7045d3277e2e967f6e7dd5a5d379857ed2b5d44d | [
"MIT"
] | null | null | null | stackcoin/__init__.py | jackharrhy/stackcoin-python | 7045d3277e2e967f6e7dd5a5d379857ed2b5d44d | [
"MIT"
] | null | null | null | stackcoin/__init__.py | jackharrhy/stackcoin-python | 7045d3277e2e967f6e7dd5a5d379857ed2b5d44d | [
"MIT"
] | null | null | null | from typing import Dict, Optional
from pydantic import BaseModel
import requests
from requests.exceptions import RequestException
from .exceptions import *
| 27.8 | 88 | 0.561464 | from typing import Dict, Optional
from pydantic import BaseModel
import requests
from requests.exceptions import RequestException
from .exceptions import *
class TransferSuccess(BaseModel):
message: str
from_bal: int
to_bal: int
class User(BaseModel):
id: str
bal: int
class Users(BaseModel):... | 2,666 | 116 | 253 |
d4004f4ab02da4df3d9c2e344fda6c76224a36a4 | 323 | py | Python | easy_workflow_manager/scripts/tag_release.py | kenjyco/easy-workflow-manager | 7c4a193feea007e1638a98ca6466361232774fa5 | [
"MIT"
] | null | null | null | easy_workflow_manager/scripts/tag_release.py | kenjyco/easy-workflow-manager | 7c4a193feea007e1638a98ca6466361232774fa5 | [
"MIT"
] | null | null | null | easy_workflow_manager/scripts/tag_release.py | kenjyco/easy-workflow-manager | 7c4a193feea007e1638a98ca6466361232774fa5 | [
"MIT"
] | null | null | null | import click
import input_helper as ih
import easy_workflow_manager as ewm
from pprint import pprint
@click.command()
def main():
"""Select a recent remote commit on SOURCE_BRANCH to tag"""
success = ewm.tag_release()
if success:
print('\nSuccessfully tagged')
if __name__ == '__main__':
main... | 19 | 63 | 0.702786 | import click
import input_helper as ih
import easy_workflow_manager as ewm
from pprint import pprint
@click.command()
def main():
"""Select a recent remote commit on SOURCE_BRANCH to tag"""
success = ewm.tag_release()
if success:
print('\nSuccessfully tagged')
if __name__ == '__main__':
main... | 0 | 0 | 0 |
701aa172ab14b97d87125d1f5d3e2c1ee2afb364 | 351 | py | Python | importance_sampling/layers/__init__.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 289 | 2017-08-03T17:30:12.000Z | 2022-03-30T12:04:21.000Z | importance_sampling/layers/__init__.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 34 | 2017-08-03T21:47:49.000Z | 2021-06-16T17:59:45.000Z | importance_sampling/layers/__init__.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 58 | 2017-08-06T01:10:24.000Z | 2022-03-07T00:30:24.000Z | #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>
#
from .metrics import MetricLayer, TripletLossLayer
from .normalization import BatchRenormalization, LayerNormalization, \
StatsBatchNorm, GroupNormalization
from .scores impor... | 35.1 | 70 | 0.811966 | #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>
#
from .metrics import MetricLayer, TripletLossLayer
from .normalization import BatchRenormalization, LayerNormalization, \
StatsBatchNorm, GroupNormalization
from .scores impor... | 0 | 0 | 0 |
e93c527510ecc850db72f0beb3b35957e8d41695 | 2,899 | py | Python | figshare/oauth_dance.py | rmcgibbo/figshare | 6c61bb0cd59b9a3c79722bfe2ef21edcf8ff1ed1 | [
"MIT"
] | 10 | 2016-07-06T10:45:09.000Z | 2020-06-23T15:47:24.000Z | figshare/oauth_dance.py | rmcgibbo/figshare | 6c61bb0cd59b9a3c79722bfe2ef21edcf8ff1ed1 | [
"MIT"
] | null | null | null | figshare/oauth_dance.py | rmcgibbo/figshare | 6c61bb0cd59b9a3c79722bfe2ef21edcf8ff1ed1 | [
"MIT"
] | 4 | 2017-07-02T14:56:54.000Z | 2022-02-03T13:56:29.000Z | # This code was adapted from Python Twitter Tools (MIT license)
# https://github.com/sixohsix/twitter/blob/master/twitter/oauth_dance.py
# Authors: Mike Verdone, Robert T. McGibbon
from __future__ import print_function
import os
import time
import webbrowser
from requests_oauthlib import OAuth1Session
try:
_input... | 34.511905 | 130 | 0.699207 | # This code was adapted from Python Twitter Tools (MIT license)
# https://github.com/sixohsix/twitter/blob/master/twitter/oauth_dance.py
# Authors: Mike Verdone, Robert T. McGibbon
from __future__ import print_function
import os
import time
import webbrowser
from requests_oauthlib import OAuth1Session
try:
_input... | 0 | 0 | 0 |
b887eacfdd6f00b42a3648077ad6adc8c3d65cef | 9,760 | py | Python | web/run.py | alvinwan/motiosecure | bc71c36e7aa6f35eb57a34e54093f056f150726d | [
"Apache-2.0"
] | 4 | 2019-05-05T08:13:02.000Z | 2020-07-22T13:10:57.000Z | web/run.py | alvinwan/motiosecure | bc71c36e7aa6f35eb57a34e54093f056f150726d | [
"Apache-2.0"
] | null | null | null | web/run.py | alvinwan/motiosecure | bc71c36e7aa6f35eb57a34e54093f056f150726d | [
"Apache-2.0"
] | null | null | null | from apns import APNs
from apns import Frame
from apns import Payload
from flask import request
from flask import abort
from flask import render_template as flask_render_template
from subprocess import call
from flask import Flask
from flask import url_for
from flask import redirect
from sklearn.decomposition import Tr... | 31.082803 | 117 | 0.647234 | from apns import APNs
from apns import Frame
from apns import Payload
from flask import request
from flask import abort
from flask import render_template as flask_render_template
from subprocess import call
from flask import Flask
from flask import url_for
from flask import redirect
from sklearn.decomposition import Tr... | 1,266 | 0 | 125 |
90165396bba02525383f22461df552f7e9cdc127 | 8,901 | py | Python | cinder/tests/unit/policies/test_volume_access.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 571 | 2015-01-01T17:47:26.000Z | 2022-03-23T07:46:36.000Z | cinder/tests/unit/policies/test_volume_access.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 37 | 2015-01-22T23:27:04.000Z | 2021-02-05T16:38:48.000Z | cinder/tests/unit/policies/test_volume_access.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 841 | 2015-01-04T17:17:11.000Z | 2022-03-31T12:06:51.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 36.036437 | 78 | 0.604314 | #
# 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, software
# ... | 4,108 | 3,202 | 213 |
3b534bcfcb377052d7eebaee3e2b5d3c189b784e | 982 | py | Python | setup.py | edflow/hiker | e04b9ca27e7ce466b28dff7b1e8cc6713ff9dde6 | [
"MIT"
] | null | null | null | setup.py | edflow/hiker | e04b9ca27e7ce466b28dff7b1e8cc6713ff9dde6 | [
"MIT"
] | null | null | null | setup.py | edflow/hiker | e04b9ca27e7ce466b28dff7b1e8cc6713ff9dde6 | [
"MIT"
] | null | null | null | import os
from setuptools import setup, find_packages
def clean():
"""Custom clean command to tidy up the project root."""
if "posix" in os.name:
os.system("rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info ./*__pycache__/")
elif "nt" == os.name:
# possible to-do: also remove directories... | 27.277778 | 88 | 0.598778 | import os
from setuptools import setup, find_packages
def clean():
"""Custom clean command to tidy up the project root."""
if "posix" in os.name:
os.system("rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info ./*__pycache__/")
elif "nt" == os.name:
# possible to-do: also remove directories... | 0 | 0 | 0 |
adf5c0eefe13ae9e98fea1fe85be4e83cf7960a8 | 1,444 | py | Python | CBIR/searcher.py | chi0321/image_retrieval | ac5fa3b8871f9dc94464581fcd930e67f76eff2a | [
"MIT"
] | null | null | null | CBIR/searcher.py | chi0321/image_retrieval | ac5fa3b8871f9dc94464581fcd930e67f76eff2a | [
"MIT"
] | null | null | null | CBIR/searcher.py | chi0321/image_retrieval | ac5fa3b8871f9dc94464581fcd930e67f76eff2a | [
"MIT"
] | null | null | null | import numpy as np
import csv | 28.88 | 68 | 0.637812 | import numpy as np
import csv
class Searcher:
def __init__(self, indexPath1, indexPath2):
self.indexPath1 = indexPath1
self.indexPath2 = indexPath2
def search(self, queryFeatures1, queryFeatures2, limit=10):
results1 = {}
results2 = {}
results = {}
with open(self.indexPath1) as f:
reader = csv.read... | 1,322 | -6 | 99 |
79594d01fd1e15203d722f03169d7ffc40654904 | 24,469 | py | Python | workitem.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | null | null | null | workitem.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | null | null | null | workitem.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | 1 | 2021-11-01T07:58:18.000Z | 2021-11-01T07:58:18.000Z | # Copyright (c) 2004-2006 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Work item base classes"""
import DateTime
import persistent.list
import zope.interface
import zope.component
from AccessControl import ClassSecurityInfo, getSecurityManager
from Globals import InitializeClass
import zope.app.annotation.int... | 34.270308 | 83 | 0.643958 | # Copyright (c) 2004-2006 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Work item base classes"""
import DateTime
import persistent.list
import zope.interface
import zope.component
from AccessControl import ClassSecurityInfo, getSecurityManager
from Globals import InitializeClass
import zope.app.annotation.int... | 7,984 | 10,267 | 456 |
92be9fce8e2d3402ce08cfc8b8841dab0e8456e7 | 248 | py | Python | catalog/bindings/wfs/property.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/wfs/property.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/wfs/property.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from bindings.wfs.property_type import PropertyType
__NAMESPACE__ = "http://www.opengis.net/wfs/2.0"
@dataclass
| 22.545455 | 52 | 0.745968 | from dataclasses import dataclass
from bindings.wfs.property_type import PropertyType
__NAMESPACE__ = "http://www.opengis.net/wfs/2.0"
@dataclass
class Property(PropertyType):
class Meta:
namespace = "http://www.opengis.net/wfs/2.0"
| 0 | 77 | 22 |
923be82983df685c80b4399d2cd561be53787c21 | 1,027 | py | Python | sim/vec.py | oak-bay/sim | 8969e85bcbf81ba7410ce1af7b328965534ca672 | [
"MIT"
] | null | null | null | sim/vec.py | oak-bay/sim | 8969e85bcbf81ba7410ce1af7b328965534ca672 | [
"MIT"
] | null | null | null | sim/vec.py | oak-bay/sim | 8969e85bcbf81ba7410ce1af7b328965534ca672 | [
"MIT"
] | null | null | null | import numpy as np
import math
def dim(v) -> int:
""" 获取向量维度. """
return len(v)
def vec(val):
""" 数值向量化. """
return np.array(val, dtype=np.float)
def dist(pos0, pos1=None) -> float:
""" 计算向量距离(模). """
pos = (vec(pos0) - vec(pos1)) if pos1 is not None else vec(pos0)
return np.linalg.nor... | 18.339286 | 68 | 0.519961 | import numpy as np
import math
def dim(v) -> int:
""" 获取向量维度. """
return len(v)
def vec(val):
""" 数值向量化. """
return np.array(val, dtype=np.float)
def dist(pos0, pos1=None) -> float:
""" 计算向量距离(模). """
pos = (vec(pos0) - vec(pos1)) if pos1 is not None else vec(pos0)
return np.linalg.nor... | 0 | 0 | 0 |
b9a8af06ece5a1d9feb8c7f08ec3f8104e40d580 | 3,985 | py | Python | lino_book/projects/noi1e/tests/test_workflow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 3 | 2016-08-25T05:58:09.000Z | 2019-12-05T11:13:45.000Z | lino_book/projects/noi1e/tests/test_workflow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 18 | 2016-11-12T21:38:58.000Z | 2019-12-03T17:54:38.000Z | lino_book/projects/noi1e/tests/test_workflow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 9 | 2016-10-15T11:12:33.000Z | 2021-09-22T04:37:37.000Z | # -*- coding: utf-8 -*-
# Copyright 2016-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Runs some tests about ticket and vote workflow.
You can run only these tests by issuing::
$ go team
$ python manage.py test tests.test_workflow
"""
from __future__ import unicode_literals
from __future... | 34.059829 | 68 | 0.598745 | # -*- coding: utf-8 -*-
# Copyright 2016-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Runs some tests about ticket and vote workflow.
You can run only these tests by issuing::
$ go team
$ python manage.py test tests.test_workflow
"""
from __future__ import unicode_literals
from __future... | 3,313 | 65 | 23 |
ac2ee55a7e1d816960f338ac54158f5dbd56f811 | 3,743 | py | Python | my_memory_card.py | tima13343/algorit | 8bcb67d7d4356038945e0b2c2d39372ece0f0ac1 | [
"CC0-1.0"
] | null | null | null | my_memory_card.py | tima13343/algorit | 8bcb67d7d4356038945e0b2c2d39372ece0f0ac1 | [
"CC0-1.0"
] | null | null | null | my_memory_card.py | tima13343/algorit | 8bcb67d7d4356038945e0b2c2d39372ece0f0ac1 | [
"CC0-1.0"
] | null | null | null | #создай приложение для запоминания информации
#подключение библиотек
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication,QWidget,QPushButton,QLabel,QVBoxLayout,QRadioButton,QMessageBox,QHBoxLayout, QGroupBox, QPushButton, QButtonGroup
from random import shuffle, randint
question_list = []
question_li... | 25.290541 | 154 | 0.738712 | #создай приложение для запоминания информации
#подключение библиотек
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication,QWidget,QPushButton,QLabel,QVBoxLayout,QRadioButton,QMessageBox,QHBoxLayout, QGroupBox, QPushButton, QButtonGroup
from random import shuffle, randint
class Question():
def __ini... | 1,103 | -4 | 187 |
d961d77141fbfd7d44ff4afe4cd1d7d15f2648ed | 2,107 | py | Python | test/e2e/policies.test-suite/podpools/n4c16/py_consts.var.py | huangrui666/cri-resource-manager | f17bfb48449da0ac5c1211dd2d076b1a43d687d0 | [
"Apache-2.0"
] | 84 | 2019-08-09T08:08:36.000Z | 2022-03-19T05:20:38.000Z | test/e2e/policies.test-suite/podpools/n4c16/py_consts.var.py | huangrui666/cri-resource-manager | f17bfb48449da0ac5c1211dd2d076b1a43d687d0 | [
"Apache-2.0"
] | 647 | 2019-08-30T18:37:55.000Z | 2022-03-30T13:42:40.000Z | test/e2e/policies.test-suite/podpools/n4c16/py_consts.var.py | huangrui666/cri-resource-manager | f17bfb48449da0ac5c1211dd2d076b1a43d687d0 | [
"Apache-2.0"
] | 35 | 2019-08-26T18:30:33.000Z | 2022-03-22T02:16:04.000Z | # This file captures expected CPU allocator behavior when the podpools
# policy is started with the test default cri-resmgr configuration on
# n4c16 topology.
# cri-resmgr output on constructed pools.
expected_podpools_output = """
podpools policy pools:
- pool 0: reserved[0]{cpus:15, mems:3, pods:0/0, containers:0}
-... | 40.519231 | 118 | 0.657807 | # This file captures expected CPU allocator behavior when the podpools
# policy is started with the test default cri-resmgr configuration on
# n4c16 topology.
# cri-resmgr output on constructed pools.
expected_podpools_output = """
podpools policy pools:
- pool 0: reserved[0]{cpus:15, mems:3, pods:0/0, containers:0}
-... | 629 | 52 | 46 |
8f95ef05b253e5a40aa9fd3025a844632c83e192 | 280 | py | Python | bhr_client/run.py | solidgoldbomb/bhr-client | ee608fa195def3600ec334517db21696b920c603 | [
"NCSA"
] | null | null | null | bhr_client/run.py | solidgoldbomb/bhr-client | ee608fa195def3600ec334517db21696b920c603 | [
"NCSA"
] | null | null | null | bhr_client/run.py | solidgoldbomb/bhr-client | ee608fa195def3600ec334517db21696b920c603 | [
"NCSA"
] | null | null | null | from bhr_client.rest import login_from_env
from bhr_client.block_manager import BlockManager, DummyStdoutBlocker
if __name__ == "__main__":
main()
| 23.333333 | 69 | 0.732143 | from bhr_client.rest import login_from_env
from bhr_client.block_manager import BlockManager, DummyStdoutBlocker
def main():
client = login_from_env()
blocker = DummyStdoutBlocker()
m = BlockManager(client, blocker)
m.run()
if __name__ == "__main__":
main()
| 105 | 0 | 23 |
ddfecdaa668bbe7c0a07f3bc0f22caa7891cc3d7 | 85 | wsgi | Python | radar.wsgi | karthikv792/PlanningAssistance | 5693c844e9067591ea1414ee9586bcd2dfff6f51 | [
"MIT"
] | 4 | 2019-04-23T10:41:35.000Z | 2019-10-27T05:14:42.000Z | radar.wsgi | karthikv792/PlanningAssistance | 5693c844e9067591ea1414ee9586bcd2dfff6f51 | [
"MIT"
] | null | null | null | radar.wsgi | karthikv792/PlanningAssistance | 5693c844e9067591ea1414ee9586bcd2dfff6f51 | [
"MIT"
] | 4 | 2018-01-16T00:00:22.000Z | 2019-11-01T23:35:01.000Z | import sys
sys.path.insert(0, '/var/www/radar')
from radar import app as application
| 21.25 | 36 | 0.764706 | import sys
sys.path.insert(0, '/var/www/radar')
from radar import app as application
| 0 | 0 | 0 |
7ffda4b2b8c4b10ea06b90e7dc37d5025f2463d1 | 1,460 | py | Python | asciify/img_to_char.py | Pomb/asciify | 747f2c9a763d294bbbb4cdea2bc109c1d1397bcc | [
"MIT"
] | 2 | 2019-11-26T11:10:41.000Z | 2020-12-05T11:55:04.000Z | asciify/img_to_char.py | Pomb/asciify | 747f2c9a763d294bbbb4cdea2bc109c1d1397bcc | [
"MIT"
] | 8 | 2019-11-24T13:05:30.000Z | 2019-11-24T22:44:08.000Z | asciify/img_to_char.py | Pomb/asciify | 747f2c9a763d294bbbb4cdea2bc109c1d1397bcc | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
import math
from sizing import getWidth, getHeight
| 27.037037 | 76 | 0.613699 | import os
import cv2
import numpy as np
import math
from sizing import getWidth, getHeight
def rgb_to_character(value, gradient):
return gradient[int((value / 255) * (len(gradient) - 1))]
def grey(path, settings):
if not os.path.isfile:
print("provided path isn't an image")
return None
r... | 1,273 | 0 | 92 |
a6f38c05272f5bee4378551cdf5b7843490b457c | 2,246 | py | Python | app/django/apps/print3d/views.py | aoirint/Mnemosyne | 1b08aa827e4b74c24ec24887bce4bd0b50ce7b64 | [
"MIT"
] | null | null | null | app/django/apps/print3d/views.py | aoirint/Mnemosyne | 1b08aa827e4b74c24ec24887bce4bd0b50ce7b64 | [
"MIT"
] | 2 | 2020-11-12T17:12:18.000Z | 2020-11-12T17:12:18.000Z | app/django/apps/print3d/views.py | aoirint/Mnemosyne | 1b08aa827e4b74c24ec24887bce4bd0b50ce7b64 | [
"MIT"
] | null | null | null | import json
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.db import transaction
from print3d.forms import *
from filament.models import *
from print3d.models import *
# Create your views here.
| 29.168831 | 61 | 0.622885 | import json
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.db import transaction
from print3d.forms import *
from filament.models import *
from print3d.models import *
# Create your views here.
def index(request):
if request.method == 'POST':
p... | 1,942 | 0 | 98 |
6b829e6551c63b3e12900a0ed8bddb8e494a2592 | 9,211 | py | Python | back_end/tests/get_routes/test_api_get_embedding_interva_data_features.py | gerlichlab/HiCognition | dff022025b7c83732b9510ff5ca8232d30aa5304 | [
"MIT"
] | null | null | null | back_end/tests/get_routes/test_api_get_embedding_interva_data_features.py | gerlichlab/HiCognition | dff022025b7c83732b9510ff5ca8232d30aa5304 | [
"MIT"
] | 5 | 2022-03-31T11:54:12.000Z | 2022-03-31T12:04:29.000Z | back_end/tests/get_routes/test_api_get_embedding_interva_data_features.py | gerlichlab/HiCognition | dff022025b7c83732b9510ff5ca8232d30aa5304 | [
"MIT"
] | null | null | null | """Tests for get route of features associated with embedding interval data."""
import os
import gzip
import json
import unittest
from unittest.mock import patch
import numpy as np
from hicognition.test_helpers import LoginTestCase, TempDirTestCase
# add path to import app
# import sys
# sys.path.append("./")
from app ... | 38.061983 | 91 | 0.605906 | """Tests for get route of features associated with embedding interval data."""
import os
import gzip
import json
import unittest
from unittest.mock import patch
import numpy as np
from hicognition.test_helpers import LoginTestCase, TempDirTestCase
# add path to import app
# import sys
# sys.path.append("./")
from app ... | 2,050 | 0 | 27 |
9d75f6db294d268b5cb7a9ad1dcb8ca7f7f24895 | 457 | py | Python | setup.py | ReneTC/sgraphics | 32ef7b257576843043f39e1e438e98a108a631f4 | [
"MIT"
] | null | null | null | setup.py | ReneTC/sgraphics | 32ef7b257576843043f39e1e438e98a108a631f4 | [
"MIT"
] | 1 | 2021-09-04T09:00:15.000Z | 2021-09-04T17:01:35.000Z | setup.py | ReneTC/sgraphics | 32ef7b257576843043f39e1e438e98a108a631f4 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name = "sgraphic",
version = "0.1.2",
author = "Rene Czepluch Thomsen",
author_email = "sepluk1@gmail.com",
description = ("Fast and simple graphics. "),
url="https://github.com/ReneTC/Simple-graphics",
license = "BSD",
keywords = "graphics package 2d... | 20.772727 | 52 | 0.619256 | from setuptools import setup
setup(
name = "sgraphic",
version = "0.1.2",
author = "Rene Czepluch Thomsen",
author_email = "sepluk1@gmail.com",
description = ("Fast and simple graphics. "),
url="https://github.com/ReneTC/Simple-graphics",
license = "BSD",
keywords = "graphics package 2d... | 0 | 0 | 0 |
9173c6d51ecab7648ce105021df857f01f31df81 | 59,817 | py | Python | modules/AIController/backend/middleware.py | junxnone/aerial_wildlife_detection | 0eebed2aaf926ceb212b6a2b7a75bb0a82b28a88 | [
"MIT"
] | null | null | null | modules/AIController/backend/middleware.py | junxnone/aerial_wildlife_detection | 0eebed2aaf926ceb212b6a2b7a75bb0a82b28a88 | [
"MIT"
] | null | null | null | modules/AIController/backend/middleware.py | junxnone/aerial_wildlife_detection | 0eebed2aaf926ceb212b6a2b7a75bb0a82b28a88 | [
"MIT"
] | null | null | null | '''
Middleware for AIController: handles requests and updates to and from the database.
2019-20 Benjamin Kellenberger
'''
from datetime import datetime
import uuid
import re
import json
from constants.annotationTypes import ANNOTATION_TYPES
from ai import PREDICTION_MODELS, ALCRITERION_MODELS
from modules.AIC... | 46.048499 | 186 | 0.557467 | '''
Middleware for AIController: handles requests and updates to and from the database.
2019-20 Benjamin Kellenberger
'''
from datetime import datetime
import uuid
import re
import json
from constants.annotationTypes import ANNOTATION_TYPES
from ai import PREDICTION_MODELS, ALCRITERION_MODELS
from modules.AIC... | 14,443 | 44,300 | 23 |
d18e6a78eb355c7e09f2598bd265f8c301656f48 | 2,333 | py | Python | src/chord/helpers.py | melzareix/chord-dht | e7956e41f1200cb2ddc183d186eb16da3f106b68 | [
"MIT"
] | null | null | null | src/chord/helpers.py | melzareix/chord-dht | e7956e41f1200cb2ddc183d186eb16da3f106b68 | [
"MIT"
] | null | null | null | src/chord/helpers.py | melzareix/chord-dht | e7956e41f1200cb2ddc183d186eb16da3f106b68 | [
"MIT"
] | null | null | null | import hashlib
from typing import Union
from config.config import dht_config
def generate_id(key: Union[bytes, str]) -> str:
"""Generate id for key or node on the ring.
Args:
key (string): Key or node-ip to hash
Returns:
string: the first m bits from the key hash.
"""
_ke... | 31.527027 | 97 | 0.595371 | import hashlib
from typing import Union
from config.config import dht_config
def generate_id(key: Union[bytes, str]) -> str:
"""Generate id for key or node on the ring.
Args:
key (string): Key or node-ip to hash
Returns:
string: the first m bits from the key hash.
"""
_ke... | 0 | 0 | 0 |
3714ef5513929a78e914bc57bf0495fda60499e0 | 360 | py | Python | iceworm/engine/plans/__init__.py | wrmsr0/iceworm | 09431bb3cdc4f6796aafca41e37d42ebe0ddfeef | [
"BSD-3-Clause"
] | null | null | null | iceworm/engine/plans/__init__.py | wrmsr0/iceworm | 09431bb3cdc4f6796aafca41e37d42ebe0ddfeef | [
"BSD-3-Clause"
] | 1 | 2021-01-19T14:29:19.000Z | 2021-01-19T14:34:27.000Z | iceworm/engine/plans/__init__.py | wrmsr0/iceworm | 09431bb3cdc4f6796aafca41e37d42ebe0ddfeef | [
"BSD-3-Clause"
] | 1 | 2020-12-31T22:29:52.000Z | 2020-12-31T22:29:52.000Z | from . import inject # noqa
from .elements import DomainInvalidation # noqa
from .elements import Invalidation # noqa
from .elements import Invalidator # noqa
from .elements import InvalidatorTrigger # noqa
from .elements import InvalidatorTriggers # noqa
from .elements import Materializer # noqa
from .planning ... | 40 | 54 | 0.8 | from . import inject # noqa
from .elements import DomainInvalidation # noqa
from .elements import Invalidation # noqa
from .elements import Invalidator # noqa
from .elements import InvalidatorTrigger # noqa
from .elements import InvalidatorTriggers # noqa
from .elements import Materializer # noqa
from .planning ... | 0 | 0 | 0 |
3b1ce493fa6b2c943fa8c59c41e6cb2d1811a2ee | 4,787 | py | Python | src/datruf/find_units.py | yoshihikosuzuki/RepeatAssembly | a5629affd669c9c029058f6f1519205ea592d1f1 | [
"MIT"
] | 1 | 2020-01-30T13:50:05.000Z | 2020-01-30T13:50:05.000Z | src/datruf/find_units.py | yoshihikosuzuki/RepeatAssembly | a5629affd669c9c029058f6f1519205ea592d1f1 | [
"MIT"
] | null | null | null | src/datruf/find_units.py | yoshihikosuzuki/RepeatAssembly | a5629affd669c9c029058f6f1519205ea592d1f1 | [
"MIT"
] | null | null | null | from multiprocessing import Pool
import numpy as np
from interval import interval
from logzero import logger
from BITS.util.io import save_pickle
from BITS.util.interval import intvl_len, subtract_intvl
from .io import load_tr_reads, load_paths
from ..types import TRUnit
def find_units(start_dbid, end_dbid, n_core, d... | 43.126126 | 110 | 0.665553 | from multiprocessing import Pool
import numpy as np
from interval import interval
from logzero import logger
from BITS.util.io import save_pickle
from BITS.util.interval import intvl_len, subtract_intvl
from .io import load_tr_reads, load_paths
from ..types import TRUnit
def find_units(start_dbid, end_dbid, n_core, d... | 0 | 0 | 0 |
2fb41badb7a51137dd06115d9c314aaf2e792b99 | 3,682 | py | Python | src/project/settings/default.py | jmaslanka/movie-db | fcee4b0a1fa6f4c7d4bdc02972dae473b916127e | [
"MIT"
] | null | null | null | src/project/settings/default.py | jmaslanka/movie-db | fcee4b0a1fa6f4c7d4bdc02972dae473b916127e | [
"MIT"
] | null | null | null | src/project/settings/default.py | jmaslanka/movie-db | fcee4b0a1fa6f4c7d4bdc02972dae473b916127e | [
"MIT"
] | null | null | null | import environ
from django.urls import reverse_lazy
# ---------- Basic settings ----------
env = environ.Env()
root = environ.Path(__file__) - 3
BASE_DIR = root()
SECRET_KEY = env('SECRET_KEY')
DEBUG = env.bool('DEBUG', default=False)
SITE_ID = env.int('SITE_ID', default=1)
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS'... | 25.748252 | 99 | 0.654264 | import environ
from django.urls import reverse_lazy
# ---------- Basic settings ----------
env = environ.Env()
root = environ.Path(__file__) - 3
BASE_DIR = root()
SECRET_KEY = env('SECRET_KEY')
DEBUG = env.bool('DEBUG', default=False)
SITE_ID = env.int('SITE_ID', default=1)
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS'... | 0 | 0 | 0 |
63daaa3046a1ccd62471aaedd1015aa26b81d76f | 529 | py | Python | src/SqlAnalyzer/Metrics.py | Prygan/OpenstackSQLAnalyzer | 89977a064019dab6c0f898f045c2818faa81a1e4 | [
"MIT"
] | null | null | null | src/SqlAnalyzer/Metrics.py | Prygan/OpenstackSQLAnalyzer | 89977a064019dab6c0f898f045c2818faa81a1e4 | [
"MIT"
] | null | null | null | src/SqlAnalyzer/Metrics.py | Prygan/OpenstackSQLAnalyzer | 89977a064019dab6c0f898f045c2818faa81a1e4 | [
"MIT"
] | null | null | null | from SqlAnalyzer.parser.SqlListener import SqlListener | 22.041667 | 54 | 0.654064 | from SqlAnalyzer.parser.SqlListener import SqlListener
class Metrics(SqlListener):
nb_join = 0
nb_transac = 0
nb_select = 0
def enterJoin_operator(self, ctx):
self.nb_join += 1
def enterBegin_stmt(self, ctx):
self.nb_transac += 1
def enterSelect_stmt(self, ctx):
s... | 227 | 225 | 23 |
440194087440116498a8c088b1f6b7c33e2d2d53 | 12,135 | py | Python | tiktok_file_operations.py | ItsABlackScreen/ErrorChecking-tiktok-scraper | d7c17c9cdd731d32e6ffecdd261e039c99c5d381 | [
"MIT"
] | 4 | 2020-08-07T18:30:06.000Z | 2021-02-22T06:12:42.000Z | tiktok_file_operations.py | ItsABlackScreen/ErrorChecking-tiktok-scraper | d7c17c9cdd731d32e6ffecdd261e039c99c5d381 | [
"MIT"
] | null | null | null | tiktok_file_operations.py | ItsABlackScreen/ErrorChecking-tiktok-scraper | d7c17c9cdd731d32e6ffecdd261e039c99c5d381 | [
"MIT"
] | null | null | null | import os
import shutil
import json
import argparse
from pathlib import Path
class TikTokFiles:
"""A simple class to model various file operations on tiktok files."""
def __init__(self, args):
"""Initializing various attributes."""
self.start_folder = Path(args.filepath)
... | 38.52381 | 114 | 0.572971 | import os
import shutil
import json
import argparse
from pathlib import Path
class TikTokFiles:
"""A simple class to model various file operations on tiktok files."""
def __init__(self, args):
"""Initializing various attributes."""
self.start_folder = Path(args.filepath)
... | 170 | 0 | 29 |