hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f59e767ecc296ece5f2f229615f34bfb6522912e | 44,883 | py | Python | neural_style_pattern_transfer (1).py | Solidity-Coder/Paperspace | 65f128f85dea1d0f9efb8ab7ee8352f43e933ddc | [
"BSD-Source-Code"
] | null | null | null | neural_style_pattern_transfer (1).py | Solidity-Coder/Paperspace | 65f128f85dea1d0f9efb8ab7ee8352f43e933ddc | [
"BSD-Source-Code"
] | null | null | null | neural_style_pattern_transfer (1).py | Solidity-Coder/Paperspace | 65f128f85dea1d0f9efb8ab7ee8352f43e933ddc | [
"BSD-Source-Code"
] | null | null | null | # -*- coding: utf-8 -*-
"""Neural Style Pattern Transfer.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ijYjSvGfWm1aUkw0stn6P7U8pYwhsbU0
"""
#!nvcc --version
print("Your GPU is a ")
!nvidia-smi -L
print("GPU Logs")
print("Nvidia K80 is not enou... | 318.319149 | 850 | 0.812646 | # -*- coding: utf-8 -*-
"""Neural Style Pattern Transfer.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ijYjSvGfWm1aUkw0stn6P7U8pYwhsbU0
"""
#!nvcc --version
print("Your GPU is a ")
!nvidia-smi -L
print("GPU Logs")
print("Nvidia K80 is not enou... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4638f5ba6e3f686cec58d6f8ca423b3545ee3d5f | 3,856 | py | Python | io_utils.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | null | null | null | io_utils.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2020-12-16T18:21:11.000Z | 2020-12-30T10:08:27.000Z | io_utils.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2021-03-29T20:58:26.000Z | 2021-03-29T20:58:26.000Z | import logging
logger = logging.getLogger(__name__)
| 37.436893 | 110 | 0.747666 | import logging
from os import path
from os.path import dirname, join
from arekit.common.utils import create_dir_if_not_exists
from arekit.contrib.experiments.cv.default import SimpleCVFolding
from arekit.contrib.experiments.cv.doc_stat.rusentrel import RuSentRelDocStatGenerator
from arekit.contrib.experiments.cv.senten... | 0 | 344 | 0 | 2,520 | 0 | 0 | 0 | 629 | 309 |
75cfe90c3d565a83d48164ad50bd25b3298e863e | 1,038 | py | Python | image_utils.py | Raiszo/facenet-testing | 563ff85a2aec50f86a49e1b1054651584872cb02 | [
"MIT"
] | null | null | null | image_utils.py | Raiszo/facenet-testing | 563ff85a2aec50f86a49e1b1054651584872cb02 | [
"MIT"
] | null | null | null | image_utils.py | Raiszo/facenet-testing | 563ff85a2aec50f86a49e1b1054651584872cb02 | [
"MIT"
] | null | null | null | import numpy as np
FACENET_MEAN = np.array([ 0.52591038, 0.40204082, 0.34178183], dtype=np.float32)
FACENET_STD = np.sqrt(np.array([3941.30175781, 2856.94287109, 2519.35791016], dtype=np.float32) / 255.**2)
def preprocess_image(img):
"""Preprocess an image for squeezenet.
Subtracts the pixel mean and d... | 34.6 | 106 | 0.685934 | import numpy as np
from scipy.misc import imread, imresize
def load_image(filename, size=None):
img = imread(filename)
if size is not None:
orig_shape = np.array(img.shape[:2])
min_idx = np.argmin(orig_shape)
scale_factor = float(size) / orig_shape[min_idx]
new_shape = (orig_sha... | 0 | 0 | 0 | 0 | 0 | 519 | 0 | 18 | 68 |
ab65c055bcd0082903a22b251f7cfa1e0ddbad07 | 3,466 | py | Python | pizza_cell.py | hex7c0/google-hashcode | a0aecc6a08fe3ffcdd362c2c4abccd58d9b73937 | [
"MIT"
] | null | null | null | pizza_cell.py | hex7c0/google-hashcode | a0aecc6a08fe3ffcdd362c2c4abccd58d9b73937 | [
"MIT"
] | null | null | null | pizza_cell.py | hex7c0/google-hashcode | a0aecc6a08fe3ffcdd362c2c4abccd58d9b73937 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""PizzaCell class."""
| 19.255556 | 69 | 0.540681 | # -*- coding: utf-8 -*-
"""PizzaCell class."""
from enum import Enum, unique
from cell import Cell
from slice import Slice
@unique
class Ingredient(Enum):
"""Ingredient enum."""
MUSHROOM = 'M'
TOMATO = 'T'
class PizzaCell(object):
"""Cell of Pizza.
:type ingredient: Ingredient or None
... | 0 | 1,400 | 0 | 1,893 | 0 | 0 | 0 | 10 | 114 |
beca77095f01db98212b8a9f91256b225a689bb8 | 1,945 | py | Python | moses/junction_tree/trainer.py | GT4SD/moses | 2fb13dc757f82484beaae19140be335affb60c4b | [
"MIT"
] | null | null | null | moses/junction_tree/trainer.py | GT4SD/moses | 2fb13dc757f82484beaae19140be335affb60c4b | [
"MIT"
] | null | null | null | moses/junction_tree/trainer.py | GT4SD/moses | 2fb13dc757f82484beaae19140be335affb60c4b | [
"MIT"
] | null | null | null | import torch.optim as optim
| 35.363636 | 103 | 0.488432 | import torch.optim as optim
import tqdm
from moses.utils import Logger
import torch
class JTreeTrainer:
def __init__(self, config):
self.config = config
def fit(self, model, data):
def get_params():
return (p for p in model.parameters() if p.requires_grad)
model.train()
... | 0 | 0 | 0 | 1,837 | 0 | 0 | 0 | -10 | 89 |
ef259f88b97a2ce21f13a711e7f4694b88d463ec | 4,136 | py | Python | src/deploy/builder/stacks/stack_processor.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null | src/deploy/builder/stacks/stack_processor.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null | src/deploy/builder/stacks/stack_processor.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null |
from django.conf import settings
from docker.client import DockerClient
from docker.models.images import ImageCollection
from docker_registry_client import DockerRegistryClient
from .registry_checker import check_registry
DOCKER_COMPOSE_FILE_DEFAULT_NAME = settings.DOCKER_COMPOSE_FILE_DEFAULT_NAME
DOCKER_REGISTRY_U... | 33.088 | 112 | 0.735493 | import requests
from django.core.files import File
from tempfile import mkdtemp
from shutil import copy, rmtree
import os
import yaml
import zipfile
from django.conf import settings
from docker.client import DockerClient
from docker.models.images import ImageCollection
from docker_registry_client import DockerRegistry... | 0 | 0 | 0 | 56 | 0 | 3,064 | 0 | -1 | 429 |
17670b80b678e8575dd39c563e1e3a2f22fe7ac1 | 45,313 | py | Python | Software/Network plotters/elec_only_OMEGA_plot.py | JonasVind/Master_Project_Code-Plots | f3efea1a30738b119bf6958cc490b940c90e2909 | [
"CC-BY-4.0"
] | null | null | null | Software/Network plotters/elec_only_OMEGA_plot.py | JonasVind/Master_Project_Code-Plots | f3efea1a30738b119bf6958cc490b940c90e2909 | [
"CC-BY-4.0"
] | null | null | null | Software/Network plotters/elec_only_OMEGA_plot.py | JonasVind/Master_Project_Code-Plots | f3efea1a30738b119bf6958cc490b940c90e2909 | [
"CC-BY-4.0"
] | null | null | null | # Import libraries
import os
import sys
import pypsa
import numpy as np
import pandas as pd
#from sympy import latex
import time
import math
# Timer
t0 = time.time() # Start a timer
# Import functions file
sys.path.append(os.path.split(os.getcwd())[0])
# Directory of file
#directory = os.path.split(os.path.split(o... | 42.828922 | 213 | 0.664489 | # Import libraries
import os
import sys
import pypsa
import numpy as np
import pandas as pd
#from sympy import latex
import time
import math
# Timer
t0 = time.time() # Start a timer
# Import functions file
sys.path.append(os.path.split(os.getcwd())[0])
from functions_file import *
# Directory of file
#dir... | 19 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 55 |
ba87651683190064a49de123288bc017d6c365cd | 4,017 | py | Python | scratch/scratch5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | 1 | 2020-06-14T13:50:28.000Z | 2020-06-14T13:50:28.000Z | scratch/scratch5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | scratch/scratch5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | # Similar to scratch3, but with the BAN channel
from sys_simulator.channels import BANChannel
from sys_simulator import general as gen
from sys_simulator.q_learning.environments.completeEnvironment5 import CompleteEnvironment5
from sys_simulator.q_learning.rewards import dis_reward_tensor2
from sys_simulator.parameters... | 34.930435 | 73 | 0.731641 | # Similar to scratch3, but with the BAN channel
from sys_simulator.channels import BANChannel
from sys_simulator import general as gen
from sys_simulator.pathloss import pathloss_bs_users
from sys_simulator.plots import plot_positions_actions_pie
from sys_simulator.q_learning.environments.completeEnvironment5 \
imp... | 0 | 0 | 0 | 0 | 0 | 1,238 | 0 | 126 | 133 |
2e15e14410009c204ee1fd1d8c430864f2e208fa | 681 | py | Python | tests/test_losses.py | feng-y16/Hamiltonian-Generative-Networks | 702d3ff3aec40eba20e17c5a1612b5b0b1e2f831 | [
"MIT"
] | 29 | 2020-09-14T11:59:03.000Z | 2022-03-10T16:31:19.000Z | tests/test_losses.py | feng-y16/Hamiltonian-Generative-Networks | 702d3ff3aec40eba20e17c5a1612b5b0b1e2f831 | [
"MIT"
] | 49 | 2020-09-14T12:33:51.000Z | 2021-01-21T22:52:17.000Z | tests/test_losses.py | feng-y16/Hamiltonian-Generative-Networks | 702d3ff3aec40eba20e17c5a1612b5b0b1e2f831 | [
"MIT"
] | 7 | 2020-11-10T16:20:31.000Z | 2022-01-09T10:49:59.000Z | import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
test_kld_loss() | 29.608696 | 81 | 0.668135 | import torch
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from utilities.losses import kld_loss
def test_kld_loss():
batch_sizes = [1, 10, 100]
latent_size = 8
for batch_size in [10]: #batch_sizes:
mu = torch.randn((batch_size, latent_size))
... | 0 | 0 | 0 | 0 | 0 | 493 | 0 | 7 | 67 |
4c9f191f559541a62f958864ace3c9c32de00e4d | 257 | py | Python | python-mundo1/ex023.py | abm-astro/estudos-python | c0dcd71489e528d445efa25d4986bf2fd08f8fe6 | [
"MIT"
] | 1 | 2021-08-15T18:18:43.000Z | 2021-08-15T18:18:43.000Z | python-mundo1/ex023.py | abm-astro/estudos-python | c0dcd71489e528d445efa25d4986bf2fd08f8fe6 | [
"MIT"
] | null | null | null | python-mundo1/ex023.py | abm-astro/estudos-python | c0dcd71489e528d445efa25d4986bf2fd08f8fe6 | [
"MIT"
] | null | null | null | number = int(input('Digite um nmero de at 4 algarismos: '))
print(f'Analisando o nmero {number} ...')
u = number // 1 % 10
d = number // 10 % 10
c = number // 100 % 10
m = number // 1000 % 10
print(f'Unidade: {u}\nDezena: {d}\nCentena: {c}\nMilhar: {m}') | 36.714286 | 62 | 0.614786 | number = int(input('Digite um número de até 4 algarismos: '))
print(f'Analisando o número {number} ...')
u = number // 1 % 10
d = number // 10 % 10
c = number // 100 % 10
m = number // 1000 % 10
print(f'Unidade: {u}\nDezena: {d}\nCentena: {c}\nMilhar: {m}') | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0445556ee9637cca8a8f03fdbe424f60d870d8ec | 1,351 | py | Python | python/lockfile/Lockfile.py | devastating/misc | f9922e14a9305808e668d8412b7a2443a7f45a0d | [
"MIT"
] | null | null | null | python/lockfile/Lockfile.py | devastating/misc | f9922e14a9305808e668d8412b7a2443a7f45a0d | [
"MIT"
] | null | null | null | python/lockfile/Lockfile.py | devastating/misc | f9922e14a9305808e668d8412b7a2443a7f45a0d | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
Simple implementation for Linux lockfile
'''
import os
import time
def LockFile(target, retry=30, timeout=1):
'''
Use this method if you want to make sure only one process opens
the "target" file. The "target" path should be a path to a file
in an existing folder.
Create a ... | 27.02 | 77 | 0.646188 | #!/usr/bin/python
'''
Simple implementation for Linux lockfile
'''
import os
import time
def LockFile(target, retry=30, timeout=1):
'''
Use this method if you want to make sure only one process opens
the "target" file. The "target" path should be a path to a file
in an existing folder.
Create a ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8a4eee6bbaa12039e95643fb0658e9efe65e588b | 18,494 | py | Python | oidc_example/op3/server.py | kschu91/pyoidc | ae5702a8b2f13d5e7af173a58355cd738ec79a31 | [
"Apache-2.0"
] | 373 | 2017-03-08T21:37:03.000Z | 2022-03-24T13:37:23.000Z | oidc_example/op3/server.py | kschu91/pyoidc | ae5702a8b2f13d5e7af173a58355cd738ec79a31 | [
"Apache-2.0"
] | 523 | 2017-03-02T17:03:12.000Z | 2022-03-24T18:34:51.000Z | oidc_example/op3/server.py | kschu91/pyoidc | ae5702a8b2f13d5e7af173a58355cd738ec79a31 | [
"Apache-2.0"
] | 165 | 2017-03-02T16:54:42.000Z | 2022-02-26T18:34:00.000Z | #!/usr/bin/env python
__author__ = 'Vahid Jalili'
import json
import argparse
import importlib
import logging
from mako.lookup import TemplateLookup
from oic import rndstr
from oic.oic.provider import Provider
from oic.utils import shelve_wrapper
from oic.utils.authn.authn_context import AuthnBroker
from oic.utils.a... | 37.975359 | 119 | 0.610414 | #!/usr/bin/env python
__author__ = 'Vahid Jalili'
from urllib.parse import parse_qs
import json
import os
import re
import sys
import traceback
import argparse
import importlib
import logging
from mako.lookup import TemplateLookup
from oic import rndstr
from oic.oic.provider import AuthorizationEndpoint
from oic.o... | 0 | 0 | 0 | 7,457 | 0 | 1,756 | 0 | 153 | 452 |
7eae67215162eb3733569a02295ab225f4a06ab6 | 8,636 | py | Python | tools/phenomics/gol_blood/gol_blood.py | skitchen19/galaxy_tools | b935f36cfe430263564503ebb71f78dc79315acb | [
"MIT"
] | 3 | 2017-04-05T18:01:59.000Z | 2019-05-03T14:15:31.000Z | tools/phenomics/gol_blood/gol_blood.py | skitchen19/galaxy_tools | b935f36cfe430263564503ebb71f78dc79315acb | [
"MIT"
] | 6 | 2019-02-27T15:45:58.000Z | 2021-01-12T15:18:50.000Z | tools/phenomics/gol_blood/gol_blood.py | skitchen19/galaxy_tools | b935f36cfe430263564503ebb71f78dc79315acb | [
"MIT"
] | 2 | 2018-10-26T18:36:39.000Z | 2019-01-28T15:12:39.000Z | #!/usr/bin/env python
import argparse
import numpy as np
import os
import data_utils
import mle_sphere
import gen_sphere
import gen_sphere_grid
import gen_r_sig_3d
import gen_selection_in_g_3d
import metrics
import param_ss
import mle_priors_3d
DEFAULT_MLE_SPHERE_PARAM_DICT = dict(xc=0, yc=0, zc=0, r=1, rSig=0.3, xE... | 49.919075 | 172 | 0.596225 | #!/usr/bin/env python
import argparse
import numpy as np
import os
import data_utils
import mle_sphere
import gen_sphere
import gen_sphere_grid
import gen_r_sig_3d
import gen_selection_in_g_3d
import metrics
import param_ss
import mle_priors_3d
DEFAULT_MLE_SPHERE_PARAM_DICT = dict(xc=0, yc=0, zc=0, r=1, rSig=0.3, xE... | 0 | 0 | 0 | 0 | 0 | 1,085 | 0 | 0 | 69 |
e8550a5932930f1b2d7a5aff94124ea076b04b7a | 2,208 | py | Python | gnuradio-3.7.13.4/gr-filter/python/filter/qa_hilbert.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | 1 | 2021-03-09T07:32:37.000Z | 2021-03-09T07:32:37.000Z | gnuradio-3.7.13.4/gr-filter/python/filter/qa_hilbert.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | gnuradio-3.7.13.4/gr-filter/python/filter/qa_hilbert.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or... | 30.246575 | 73 | 0.658967 | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or... | 0 | 0 | 0 | 770 | 0 | 397 | 0 | 10 | 91 |
a195a12bcbb2de73d5ba7db88a8a27392864dc58 | 1,539 | py | Python | reagent/net_builder/discrete_actor_net_builder.py | wall-ed-coder/ReAgent | 14d9906d74f943e74c6a6f95d129e18741168f9c | [
"BSD-3-Clause"
] | null | null | null | reagent/net_builder/discrete_actor_net_builder.py | wall-ed-coder/ReAgent | 14d9906d74f943e74c6a6f95d129e18741168f9c | [
"BSD-3-Clause"
] | null | null | null | reagent/net_builder/discrete_actor_net_builder.py | wall-ed-coder/ReAgent | 14d9906d74f943e74c6a6f95d129e18741168f9c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from reagent.core.fb_checker import IS_FB_ENVIRONMENT
if IS_FB_ENVIRONMENT:
from reagent.fb.prediction.fb_predictor_wrapper import (FbActorPredictorWrapper as ActorPredictorWrapper)
else:
| 28.5 | 82 | 0.725796 | #!/usr/bin/env python3
import abc
from typing import List
import torch
from reagent.core.fb_checker import IS_FB_ENVIRONMENT
from reagent.core.registry_meta import RegistryMeta
from reagent.models.base import ModelBase
from reagent.parameters import NormalizationData
from reagent.prediction.predictor_wrapper import A... | 0 | 145 | 0 | 739 | 0 | 0 | 0 | 210 | 227 |
5af783943b8c376293c1b3b150c9dca00877a8eb | 668 | py | Python | 6 semester/Computer graphics/lab7.2.py | vladtsap/study | 87bc1aae4db67fdc18d5203f4e2af1dee1220ec5 | [
"MIT"
] | 1 | 2021-07-13T14:35:21.000Z | 2021-07-13T14:35:21.000Z | 6 semester/Computer graphics/lab7.2.py | vladtsap/study | 87bc1aae4db67fdc18d5203f4e2af1dee1220ec5 | [
"MIT"
] | null | null | null | 6 semester/Computer graphics/lab7.2.py | vladtsap/study | 87bc1aae4db67fdc18d5203f4e2af1dee1220ec5 | [
"MIT"
] | null | null | null | show_process = False
iterations = 50
import turtle
if not show_process:
turtle.tracer(0)
turtle.colormode(255)
turtle.color((0, 150, 0))
turtle.penup()
turtle.goto(-330, 0)
turtle.pendown()
fern(iterations)
turtle.update()
turtle.exitonclick()
| 17.128205 | 36 | 0.535928 | show_process = False
iterations = 50
import turtle
if not show_process:
turtle.tracer(0)
def fern(length):
if length <= 0.50:
turtle.fd(length)
turtle.bk(length)
else:
turtle.fd(length)
turtle.lt(90)
fern(length * 0.35)
turtle.... | 0 | 0 | 0 | 0 | 0 | 370 | 0 | 0 | 25 |
ba33f9c40a30d9716e2192d6b3a8e6d34446b9b5 | 282 | py | Python | crowdgezwitscher/crowdgezwitscher/auth.py | Strassengezwitscher/Crowdgezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 4 | 2016-07-22T07:20:31.000Z | 2016-11-13T18:13:34.000Z | crowdgezwitscher/crowdgezwitscher/auth.py | Strassengezwitscher/Strassengezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 402 | 2016-04-26T08:38:17.000Z | 2022-03-11T23:26:49.000Z | crowdgezwitscher/crowdgezwitscher/auth.py | Strassengezwitscher/Crowdgezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 1 | 2018-01-14T16:58:57.000Z | 2018-01-14T16:58:57.000Z | # source: https://stackoverflow.com/a/30875830
| 31.333333 | 68 | 0.804965 | # source: https://stackoverflow.com/a/30875830
from rest_framework.authentication import SessionAuthentication
class CsrfExemptSessionAuthentication(SessionAuthentication):
def enforce_csrf(self, request):
return # To not perform the csrf check previously happening
| 0 | 0 | 0 | 147 | 0 | 0 | 0 | 42 | 45 |
88ad5ef34c4f5e74c468301747172d1d70c18248 | 1,765 | py | Python | library/explorerhat/ads1015.py | DT-was-an-ET/explorer-hat | 9dd8624a094b9a7663fbcbb95be72fdb946eecc7 | [
"MIT"
] | null | null | null | library/explorerhat/ads1015.py | DT-was-an-ET/explorer-hat | 9dd8624a094b9a7663fbcbb95be72fdb946eecc7 | [
"MIT"
] | null | null | null | library/explorerhat/ads1015.py | DT-was-an-ET/explorer-hat | 9dd8624a094b9a7663fbcbb95be72fdb946eecc7 | [
"MIT"
] | null | null | null | from sys import exit, version_info
try:
from smbus import SMBus
except ImportError:
if version_info[0] < 3:
exit("This library requires python-smbus\nInstall with: sudo apt-get install python-smbus")
elif version_info[0] == 3:
exit("This library requires python3-smbus\nInstall with: sudo ap... | 27.153846 | 119 | 0.692918 | import time
from sys import exit, version_info
try:
from smbus import SMBus
except ImportError:
if version_info[0] < 3:
exit("This library requires python-smbus\nInstall with: sudo apt-get install python-smbus")
elif version_info[0] == 3:
exit("This library requires python3-smbus\nInstall w... | 0 | 0 | 0 | 0 | 0 | 796 | 0 | -10 | 68 |
7c12abd47a52ad7e02410a984ccfe624d0b9deeb | 230 | py | Python | pyvolt/types/category.py | Gael-devv/Pyvolt | 1d84ba95f1fd3f959a933051c25f8a3e60500c5d | [
"MIT"
] | null | null | null | pyvolt/types/category.py | Gael-devv/Pyvolt | 1d84ba95f1fd3f959a933051c25f8a3e60500c5d | [
"MIT"
] | null | null | null | pyvolt/types/category.py | Gael-devv/Pyvolt | 1d84ba95f1fd3f959a933051c25f8a3e60500c5d | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
__all__ = ("Category",)
| 17.692308 | 51 | 0.743478 | from typing import TYPE_CHECKING, TypedDict
if TYPE_CHECKING:
from .snowflake import Snowflake, SnowflakeList
__all__ = ("Category",)
class Category(TypedDict):
id: Snowflake
title: str
channels: SnowflakeList
| 0 | 0 | 0 | 66 | 0 | 0 | 0 | 37 | 49 |
7076ef271d06a797450c907543f266df5539f478 | 841 | py | Python | test/digits_1112.py | Radenz/my-convex-hull | e887d84dd646ae046b10633218d0bf9b266fb8f6 | [
"MIT"
] | null | null | null | test/digits_1112.py | Radenz/my-convex-hull | e887d84dd646ae046b10633218d0bf9b266fb8f6 | [
"MIT"
] | null | null | null | test/digits_1112.py | Radenz/my-convex-hull | e887d84dd646ae046b10633218d0bf9b266fb8f6 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import datasets
from myConvexHull import convex_hull, random_color
from myConvexHull.point_utils import X, Y
data = datasets.load_digits()
df = pd.DataFrame(data.data, columns=data.feature_names)
df['Target'] = pd.DataFrame(data.target... | 30.035714 | 56 | 0.699168 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import datasets
from myConvexHull import convex_hull, random_color
from myConvexHull.point_utils import X, Y
data = datasets.load_digits()
df = pd.DataFrame(data.data, columns=data.feature_names)
df['Target'] = pd.DataFrame(data.target... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
89a1617fe951435594bb047f64e8489024798ba7 | 497 | py | Python | World 1/Modules/ex020 - Choosing a Order.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 2 | 2021-04-23T19:18:06.000Z | 2021-05-15T17:45:21.000Z | World 1/Modules/ex020 - Choosing a Order.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 1 | 2021-05-14T00:29:23.000Z | 2021-05-14T00:29:23.000Z | World 1/Modules/ex020 - Choosing a Order.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 1 | 2021-05-14T00:19:33.000Z | 2021-05-14T00:19:33.000Z | from random import sample
from time import sleep
colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
order = ["Breno", "Edu", "Miguel", "Lucas"]
print("{}Hmm..... | 33.133333 | 69 | 0.527163 | from random import sample
from time import sleep
colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
order = ["Breno", "Edu", "Miguel", "Lucas"]
print("{}Hmm..... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d96784146bd766dcccea9ce0e829666670d8dddd | 2,689 | py | Python | video_background_dynamic_mode_decomposition_582HW5/subtractLRvideo.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | video_background_dynamic_mode_decomposition_582HW5/subtractLRvideo.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | video_background_dynamic_mode_decomposition_582HW5/subtractLRvideo.py | aruymgaart/AMATH | 87579a076ec74094d0420c2a1f477022aaefb6bc | [
"MIT"
] | null | null | null | # AP Ruymgaart DMD, main script
import numpy as np, sys, copy
#==== input (command line, from run.sh) ====
print('===================================== start DMD =================================\nInput:')
cmds = processCmdArgs(sys.argv)
for c in cmds: print('\t', c, cmds[c])
dt,nv,fname,ftype,images,f0,f1,outname,frP... | 36.337838 | 106 | 0.641502 | # AP Ruymgaart DMD, main script
import numpy as np, time, sys, copy, matplotlib.pyplot as plt
from videoFunctions import *
from tensorFiles import *
from plottingFunctions import *
from dmd import *
#==== input (command line, from run.sh) ====
print('===================================== start DMD ====================... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 88 |
483599ed8536eddf29b6ea87ea65105e1967fb97 | 2,479 | py | Python | payment_rounding/settings.py | adrian-kalinin/payment-rounding-api | d4639a2e7e733a40dccc3fe98605352c594b4332 | [
"MIT"
] | null | null | null | payment_rounding/settings.py | adrian-kalinin/payment-rounding-api | d4639a2e7e733a40dccc3fe98605352c594b4332 | [
"MIT"
] | null | null | null | payment_rounding/settings.py | adrian-kalinin/payment-rounding-api | d4639a2e7e733a40dccc3fe98605352c594b4332 | [
"MIT"
] | null | null | null | from pathlib import Path
import environ
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=True)
if READ_DOT_ENV_FILE:
env.read_env()
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = env('SECRET_KEY')
DEBUG = env.bool('DEBUG')
ALLOWED_HOSTS = ['127.0.0.1', 'payment-... | 22.536364 | 117 | 0.673255 | from pathlib import Path
import environ
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=True)
if READ_DOT_ENV_FILE:
env.read_env()
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = env('SECRET_KEY')
DEBUG = env.bool('DEBUG')
ALLOWED_HOSTS = ['127.0.0.1', 'payment-... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e90ce6e277dc1dee758c86d3003b819de9af1d2f | 12,772 | py | Python | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages/picamera/display.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | 1 | 2021-05-30T08:20:37.000Z | 2021-05-30T08:20:37.000Z | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages/picamera/display.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages/picamera/display.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | null | null | null | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 39.788162 | 104 | 0.633104 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 0 | 222 | 0 | 10,424 | 0 | 0 | 0 | 107 | 179 |
016bbec27abd5c066c9c544b6cd0e4027d21bf59 | 6,680 | py | Python | data_loaders/citation_networks.py | hcnoh/gcn-pytorch | 2ef4ada8ae60ff4402ee5430def49e441f650e8c | [
"MIT"
] | null | null | null | data_loaders/citation_networks.py | hcnoh/gcn-pytorch | 2ef4ada8ae60ff4402ee5430def49e441f650e8c | [
"MIT"
] | null | null | null | data_loaders/citation_networks.py | hcnoh/gcn-pytorch | 2ef4ada8ae60ff4402ee5430def49e441f650e8c | [
"MIT"
] | null | null | null |
DATASET_DIR = "datasets"
| 31.809524 | 79 | 0.570359 | import os
import pickle
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
DATASET_DIR = "datasets"
class CitationNetworks(Dataset):
def __init__(self, dataset_dir=DATASET_DIR) -> None:
super().__init__()
# will be defined in child classes
self.dataset_name = ... | 0 | 0 | 0 | 6,479 | 0 | 0 | 0 | -10 | 181 |
4763556f9202f9225d54195f6543fae5e3581e1f | 573 | py | Python | Course 01 - Getting Started with Python/Extra Studies/Conditionals/ex013.py | marcoshsq/python_practical_exercises | 77136cd4bc0f34acde3380ffdc5af74f7a960670 | [
"MIT"
] | 9 | 2022-03-22T16:45:17.000Z | 2022-03-25T20:22:35.000Z | Course 01 - Getting Started with Python/Extra Studies/Conditionals/ex013.py | marcoshsq/python_practical_exercises | 77136cd4bc0f34acde3380ffdc5af74f7a960670 | [
"MIT"
] | null | null | null | Course 01 - Getting Started with Python/Extra Studies/Conditionals/ex013.py | marcoshsq/python_practical_exercises | 77136cd4bc0f34acde3380ffdc5af74f7a960670 | [
"MIT"
] | 3 | 2022-03-22T17:03:38.000Z | 2022-03-29T17:20:55.000Z | # Exercise 013 - That Classic Average
"""Create a program that reads two grades from a student and calculates their average, showing a message at the end, according to the average achieved:
- Average below 5.0: FAIL"""
grade_01 = float(input("Enter the first grade: "))
grade_02 = float(input("Enter the second grade: ... | 31.833333 | 151 | 0.69808 | # Exercise 013 - That Classic Average
"""Create a program that reads two grades from a student and calculates their average, showing a message at the end, according to the average achieved:
- Average below 5.0: FAIL"""
grade_01 = float(input("Enter the first grade: "))
grade_02 = float(input("Enter the second grade: ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
18bb3bc7809f2da3e09891859e20660934914e96 | 1,788 | py | Python | ebp/config.py | ttimasdf/ebp | 994e3f5d40446098b02491f6b6449cb705397d95 | [
"Apache-2.0"
] | 4 | 2018-01-29T09:13:19.000Z | 2021-08-10T06:58:08.000Z | ebp/config.py | ttimasdf/uni-patcher | 994e3f5d40446098b02491f6b6449cb705397d95 | [
"Apache-2.0"
] | 2 | 2017-07-11T13:30:48.000Z | 2020-06-01T07:15:22.000Z | ebp/config.py | ttimasdf/uni-patcher | 994e3f5d40446098b02491f6b6449cb705397d95 | [
"Apache-2.0"
] | 1 | 2020-06-01T07:01:17.000Z | 2020-06-01T07:01:17.000Z | import configparser
BACKUP_SUFFIX = ".bak"
_parser = configparser.ConfigParser()
def parse_file(filename):
"""Return all infomation you needed to patch files"""
_parser.read(filename)
result = {'files': {}}
result['metadata'] = {
"name": _parser['metadata']['name'],
"description": _p... | 30.305085 | 65 | 0.480984 | import configparser
BACKUP_SUFFIX = ".bak"
_parser = configparser.ConfigParser()
def parse_file(filename):
"""Return all infomation you needed to patch files"""
_parser.read(filename)
result = {'files': {}}
result['metadata'] = {
"name": _parser['metadata']['name'],
"description": _p... | 0 | 0 | 0 | 0 | 0 | 132 | 0 | 0 | 23 |
5859c97e18fc8e9f8c17c8655f9db9df190cf387 | 467 | py | Python | python/5.py | kylekanos/project-euler-1 | af7089356a4cea90f8ef331cfdc65e696def6140 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | python/5.py | kylekanos/project-euler-1 | af7089356a4cea90f8ef331cfdc65e696def6140 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | python/5.py | kylekanos/project-euler-1 | af7089356a4cea90f8ef331cfdc65e696def6140 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-09-17T00:55:58.000Z | 2019-09-17T00:55:58.000Z | #!/usr/bin/env python
# for i from 2 to 20
# compute prime factorization of i.
# use largest multiplicity in any
# prime factor seen thus far
facs = {}
for i in xrange(2,21):
f = factorize(i)
for j in f:
facs[j] = max(facs.get(j,0),f[j])
print reduce(lambda x,y: x*y, (i**facs[i] for i in facs))
| 19.458333 | 57 | 0.537473 | #!/usr/bin/env python
# for i from 2 to 20
# compute prime factorization of i.
# use largest multiplicity in any
# prime factor seen thus far
def factorize(n):
d = {}
p=2
while n>=p:
while not n%p:
n//=p
d[p] = d.get(p,0)+1
p+=1
return d
facs = {}
for i in xran... | 0 | 0 | 0 | 0 | 0 | 130 | 0 | 0 | 23 |
a88f21775f07697d182770e156e849a1936e4122 | 9,973 | py | Python | python/onos/config/diags/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 9 | 2021-03-24T10:40:05.000Z | 2022-01-22T08:55:25.000Z | python/onos/config/diags/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 23 | 2020-11-26T01:29:48.000Z | 2022-03-01T00:33:34.000Z | python/onos/config/diags/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 29 | 2020-11-25T17:25:45.000Z | 2022-03-30T05:54:15.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: onos/config/diags/diags.proto
# plugin: python-betterproto
from .. import admin as _admin__
| 36.937037 | 89 | 0.682242 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: onos/config/diags/diags.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncIterator, Dict
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
import grpclib
class Type(betterproto.En... | 0 | 3,990 | 3,504 | 1,710 | 0 | 0 | 0 | 107 | 487 |
6258be964f0d0f522fe9c811d890fe76ef476459 | 1,551 | py | Python | setup.py | fusionbox/django-reversion | a7899ead7348dcd45eb34aa3f0bbfbc9a3c5596b | [
"BSD-3-Clause"
] | null | null | null | setup.py | fusionbox/django-reversion | a7899ead7348dcd45eb34aa3f0bbfbc9a3c5596b | [
"BSD-3-Clause"
] | null | null | null | setup.py | fusionbox/django-reversion | a7899ead7348dcd45eb34aa3f0bbfbc9a3c5596b | [
"BSD-3-Clause"
] | null | null | null | import sys
sys.path.insert(0, 'src/reversion')
from distutils.core import setup
from version import __version__
# Load in babel support, if available.
try:
from babel.messages import frontend as babel
cmdclass = {"compile_catalog": babel.compile_catalog,
"extract_messages": babel.extract_messa... | 41.918919 | 116 | 0.636364 | import sys
sys.path.insert(0, 'src/reversion')
from distutils.core import setup
from version import __version__
# Load in babel support, if available.
try:
from babel.messages import frontend as babel
cmdclass = {"compile_catalog": babel.compile_catalog,
"extract_messages": babel.extract_messa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac8bbc8720f9c64445fe9a7d755e4c38fead6d25 | 14,429 | py | Python | plot.py | nsg-ethz/SDNRacer | 33353177998947580e879941f05862f0173a0c48 | [
"Apache-2.0"
] | 5 | 2016-03-18T15:12:04.000Z | 2019-01-28T20:18:24.000Z | plot.py | nsg-ethz/SDNRacer | 33353177998947580e879941f05862f0173a0c48 | [
"Apache-2.0"
] | null | null | null | plot.py | nsg-ethz/SDNRacer | 33353177998947580e879941f05862f0173a0c48 | [
"Apache-2.0"
] | 1 | 2019-11-02T22:04:48.000Z | 2019-11-02T22:04:48.000Z | #!/usr/bin/env python
import argparse
import csv
import glob
import os
import itertools
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from asyncore import loop
# Values we care about
keys = []
keys.append('num_read')
keys.append('num_writes')
keys.append('num_ops')
keys.appen... | 37.871391 | 168 | 0.662069 | #!/usr/bin/env python
import argparse
import csv
import glob
import os
import itertools
from pylab import *
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from asyncore import loop
# Values we care about
keys = []
keys.append('num_read')
keys.append('num_writes')
keys.append('n... | 0 | 0 | 0 | 0 | 0 | 8,783 | 0 | -2 | 114 |
1c59c47850aa708f1f8006c09f199f92f56b6546 | 6,881 | py | Python | src/pack/bin/simple_setup.py | mbari-media-management/vampire-squid | 4e9c380daf47fbdb4215e614e65eb504bb63cda1 | [
"Apache-2.0"
] | 5 | 2019-06-26T18:18:53.000Z | 2021-12-04T18:12:43.000Z | src/pack/bin/simple_setup.py | mbari-media-management/vampire-squid | 4e9c380daf47fbdb4215e614e65eb504bb63cda1 | [
"Apache-2.0"
] | 1 | 2019-02-28T18:06:56.000Z | 2019-03-01T00:50:06.000Z | src/pack/bin/simple_setup.py | mbari-media-management/vampire-squid | 4e9c380daf47fbdb4215e614e65eb504bb63cda1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# This is a script for loading some test data into the video-asset-manager using
# REST calls. Each insert is being done as a separate call, which is the only type of
# insert that the API supports at this point.
#
# Note that for production loads, we would not do this in this manner. Instead, we... | 43.828025 | 99 | 0.46098 | #!/usr/bin/env python
# This is a script for loading some test data into the video-asset-manager using
# REST calls. Each insert is being done as a separate call, which is the only type of
# insert that the API supports at this point.
#
# Note that for production loads, we would not do this in this manner. Instead, we... | 0 | 0 | 0 | 0 | 0 | 75 | 0 | 0 | 23 |
4c405f7cef7119b297f3b6a357e3b86b8b9f4ec5 | 28,254 | py | Python | wolfism8/ism8.py | nanosonde/python-wolfism8 | 20f4ac2e40a2f711f00a833107e286f802a21364 | [
"MIT"
] | null | null | null | wolfism8/ism8.py | nanosonde/python-wolfism8 | 20f4ac2e40a2f711f00a833107e286f802a21364 | [
"MIT"
] | null | null | null | wolfism8/ism8.py | nanosonde/python-wolfism8 | 20f4ac2e40a2f711f00a833107e286f802a21364 | [
"MIT"
] | null | null | null | """
Module for gathering info from Wolf Heating System via ISM8 adapter
"""
import logging
import asyncio
if __name__ == "__main__":
_LOGGER = logging.getLogger(__name__)
logging.basicConfig()
_LOGGER.setLevel(logging.DEBUG)
# for testing purposes only, relies on debug output
myP... | 51.9375 | 80 | 0.537552 | """
Module for gathering info from Wolf Heating System via ISM8 adapter
"""
import logging
import asyncio
class Ism8(asyncio.Protocol):
"""
This protocol class is invoked to listen to message from ISM8 module and
feed data into internal data array
"""
ISM_HEADER = b'\x06\x20\xf0\x80'... | 0 | 1,072 | 0 | 26,362 | 0 | 0 | 0 | 0 | 25 |
7c11d04529484bac5ffcaf0ec1b0a0573a4a23f4 | 18,027 | py | Python | tests/deserialize_test.py | linhuiwzqu/clxcommunications | 5f5fe593402fdb014c17fa5ef200ee9b39d42caf | [
"Apache-2.0"
] | 3 | 2018-01-23T14:18:25.000Z | 2019-02-12T07:35:37.000Z | tests/deserialize_test.py | linhuiwzqu/clxcommunications | 5f5fe593402fdb014c17fa5ef200ee9b39d42caf | [
"Apache-2.0"
] | 3 | 2017-01-20T08:23:05.000Z | 2017-01-20T10:38:10.000Z | tests/deserialize_test.py | linhuiwzqu/clxcommunications | 5f5fe593402fdb014c17fa5ef200ee9b39d42caf | [
"Apache-2.0"
] | 2 | 2019-03-07T18:33:52.000Z | 2021-06-24T01:23:03.000Z | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
# pylint: disable=invalid-name
| 31.626316 | 287 | 0.552283 | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
# pylint: disable=invalid-name
from datetime import datetime
import json
from clx.xms import api, exceptions, deserialize
from nose.tools import *
from iso8601 import UTC
class MockRe... | 12 | 1,445 | 0 | 119 | 0 | 15,621 | 0 | 30 | 640 |
8a2c28fd9c3b626ba88c7c0aa37a2c2f9aae24a5 | 3,390 | py | Python | tensorflow_similarity/retrieval_metrics/recall_at_k.py | phillips96/similarity | 3794f288f17f47f1f90b5368e5c0eeac1e81e10d | [
"Apache-2.0"
] | 706 | 2021-09-04T02:11:05.000Z | 2022-03-31T13:29:14.000Z | tensorflow_similarity/retrieval_metrics/recall_at_k.py | phillips96/similarity | 3794f288f17f47f1f90b5368e5c0eeac1e81e10d | [
"Apache-2.0"
] | 119 | 2021-09-01T22:32:40.000Z | 2022-03-30T22:39:27.000Z | tensorflow_similarity/retrieval_metrics/recall_at_k.py | phillips96/similarity | 3794f288f17f47f1f90b5368e5c0eeac1e81e10d | [
"Apache-2.0"
] | 57 | 2021-09-04T02:11:14.000Z | 2022-03-31T13:29:15.000Z | # Copyright 2021 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 34.948454 | 78 | 0.646608 | # Copyright 2021 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 0 | 0 | 0 | 2,632 | 0 | 0 | 0 | 79 | 91 |
846536ef805d07aa120fe6037fec9a5a37e67b93 | 493 | py | Python | app/blueprints.py | excalibur1987/team-management | ed6dfaf83280dad947edb31b404680d6083d7e62 | [
"MIT"
] | 1 | 2021-06-05T16:18:10.000Z | 2021-06-05T16:18:10.000Z | app/blueprints.py | excalibur1987/flask-api-backend-boilerplate | 3f0933599f12b9632a3fc697eb3dde534ec93ce1 | [
"MIT"
] | null | null | null | app/blueprints.py | excalibur1987/flask-api-backend-boilerplate | 3f0933599f12b9632a3fc697eb3dde534ec93ce1 | [
"MIT"
] | null | null | null | from flask import Flask
from app.apis.v1 import api_v1_bp
def register_blueprints(app: "Flask") -> "Flask":
"""A function to register flask blueprint.
To register blueprints add them like the example
Example usage:
from app.blueprints import blueprint
app.register_blueprint(blueprint)
... | 23.47619 | 52 | 0.693712 | from flask import Flask
from app.apis.v1 import api_v1_bp
def register_blueprints(app: "Flask") -> "Flask":
"""A function to register flask blueprint.
To register blueprints add them like the example
Example usage:
from app.blueprints import blueprint
app.register_blueprint(blueprint)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
09cc33ccba4b0ca212dc86714544f05c4ce8cead | 2,007 | py | Python | experiments/benchmark/run_sampler.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | 3 | 2017-01-18T21:20:26.000Z | 2019-01-22T19:11:58.000Z | experiments/benchmark/run_sampler.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | null | null | null | experiments/benchmark/run_sampler.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | 3 | 2016-10-13T06:31:25.000Z | 2021-11-08T19:09:03.000Z | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
import numpy as np
import trees
from trees.ddt import DirichletDiffusionTree, Inverse, GaussianLikelihoodModel
from trees.mcmc import MetropolisHastingsSampler
from sklearn.decomposition import PCA
import seaborn as sns
sns.set_style('white')
... | 26.064935 | 105 | 0.715994 | import networkx as nx
from cStringIO import StringIO
from Bio import Phylo
import matplotlib.pyplot as plt
import random
import logging
from tqdm import tqdm
logger = logging.getLogger()
logger.setLevel(logging.INFO)
import numpy as np
import trees
from trees.ddt import DirichletDiffusionTree, Inverse, GaussianLikeliho... | 0 | 0 | 0 | 0 | 0 | 972 | 0 | 28 | 199 |
37dd96679211af25ef8e409406d45a4f07bce62d | 8,666 | py | Python | scripts/qos-exp/nn2-sweep.py | ixent/qosa-snee | cc103a2f50262cad1927976a0b7f99554362581d | [
"BSD-3-Clause"
] | 1 | 2019-01-19T06:45:42.000Z | 2019-01-19T06:45:42.000Z | scripts/qos-exp/nn2-sweep.py | ixent/qosa-snee | cc103a2f50262cad1927976a0b7f99554362581d | [
"BSD-3-Clause"
] | null | null | null | scripts/qos-exp/nn2-sweep.py | ixent/qosa-snee | cc103a2f50262cad1927976a0b7f99554362581d | [
"BSD-3-Clause"
] | 3 | 2017-03-08T17:42:16.000Z | 2021-05-28T16:01:30.000Z | #!/usr/bin/python
queryMap = {'Q2' : 'input/pipes/Q2.txt', 'Q4' : 'input/pipes/QNest4.txt', 'Q5' : 'input/pipes/QNest5.txt'}
networkMap = {'10' : 'input/networks/10-node-topology.xml', '30' : 'scripts/qos-exp/scenarios/30-dense-net.xml', '100' : 'scripts/qos-exp/scenarios/ix-100-dense-net.xml'}
numSourcesMap = {'1... | 35.371429 | 381 | 0.681168 | #!/usr/bin/python
import getopt, logging, sys, SneeqlLib, UtilLib, AvroraLib, os, checkTupleCount
def usage():
print '''Usage: nn-sweep.py <parameters>
--query=[Q2|Q4|Q5]
--network_size=[n]
--network_type=[A|B]
--num_sources=[3|10|min|maj]
--optimization-goal=[min_delivery,min_energy,max_lifetime]
-... | 0 | 0 | 0 | 0 | 0 | 7,161 | 0 | 58 | 292 |
54fa8cb4636d823aa634912d24017e8db3798df3 | 704 | py | Python | UsePhoneticName.py | fishy/scripts | 91abd0451cae916d885f4ff0fd2f69d335d37cf3 | [
"BSD-3-Clause"
] | 4 | 2016-05-09T13:42:23.000Z | 2021-11-29T15:16:11.000Z | UsePhoneticName.py | fishy/scripts | 91abd0451cae916d885f4ff0fd2f69d335d37cf3 | [
"BSD-3-Clause"
] | null | null | null | UsePhoneticName.py | fishy/scripts | 91abd0451cae916d885f4ff0fd2f69d335d37cf3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import sys
ab = SBApplication.applicationWithBundleIdentifier_("com.apple.AddressBook")
for person in ab.people():
fname = person.firstName()
pfname = person.phoneticFirstName()
lname = person.lastName()
plname = person.phoneticLastName()
note = person.note()
print "%s %s %s... | 22.709677 | 76 | 0.697443 | #!/usr/bin/python
import sys
from Foundation import *
from ScriptingBridge import *
ab = SBApplication.applicationWithBundleIdentifier_("com.apple.AddressBook")
for person in ab.people():
fname = person.firstName()
pfname = person.phoneticFirstName()
lname = person.lastName()
plname = person.phonetic... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 44 |
3d49ec04019e9889366c1843e35834272201e46f | 9,163 | py | Python | src/probnum/quad/_integration_measures.py | christopheroates/probnum | 4ae63da307bd7279c3ce477ef68cbd0b8e30c73a | [
"MIT"
] | 226 | 2019-11-01T09:44:09.000Z | 2022-03-30T23:17:17.000Z | src/probnum/quad/_integration_measures.py | christopheroates/probnum | 4ae63da307bd7279c3ce477ef68cbd0b8e30c73a | [
"MIT"
] | 590 | 2019-11-21T08:32:30.000Z | 2022-03-31T12:37:37.000Z | src/probnum/quad/_integration_measures.py | christopheroates/probnum | 4ae63da307bd7279c3ce477ef68cbd0b8e30c73a | [
"MIT"
] | 39 | 2020-01-13T16:29:45.000Z | 2022-03-28T16:16:54.000Z | """Contains integration measures."""
# pylint: disable=too-few-public-methods
| 34.708333 | 88 | 0.582451 | """Contains integration measures."""
import abc
from typing import Optional, Tuple, Union
import numpy as np
import scipy.stats
from probnum.randvars import Normal
from probnum.typing import FloatArgType, IntArgType
class IntegrationMeasure(abc.ABC):
"""An abstract class for a measure against which a target fu... | 0 | 0 | 0 | 8,831 | 0 | 0 | 0 | 47 | 203 |
a41dca34310966caf3e8427d639781fcb0598d18 | 761 | py | Python | resources/lib/helpers/exceptions.py | CastagnaIT/script.appcast | a9c0d6c30316599d6892f944ac185a9331af4ec1 | [
"BSD-2-Clause",
"MIT"
] | 2 | 2021-01-16T21:45:57.000Z | 2021-01-24T06:31:16.000Z | resources/lib/helpers/exceptions.py | CastagnaIT/script.appcast | a9c0d6c30316599d6892f944ac185a9331af4ec1 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | resources/lib/helpers/exceptions.py | CastagnaIT/script.appcast | a9c0d6c30316599d6892f944ac185a9331af4ec1 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (C) 2021 Stefano Gottardo (script.appcast)
Exceptions
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
# Exceptions for DATABASE
| 22.382353 | 56 | 0.720105 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2021 Stefano Gottardo (script.appcast)
Exceptions
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
# Exceptions for DATABASE
class DBSQLiteConnectionError(Exception):
"""An error occurred in the database connection"""
class DBS... | 0 | 0 | 0 | 407 | 0 | 0 | 0 | 0 | 138 |
b8830ac7964ef91a4f94e8863c8ef461e382bb37 | 18,342 | py | Python | tripleo_common/actions/derive_params.py | AllenJSebastian/tripleo-common | d510a30266e002e90c358e69cb720bfdfa736134 | [
"Apache-2.0"
] | null | null | null | tripleo_common/actions/derive_params.py | AllenJSebastian/tripleo-common | d510a30266e002e90c358e69cb720bfdfa736134 | [
"Apache-2.0"
] | null | null | null | tripleo_common/actions/derive_params.py | AllenJSebastian/tripleo-common | d510a30266e002e90c358e69cb720bfdfa736134 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 39.360515 | 79 | 0.602061 | # Copyright 2017 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 0 | 0 | 0 | 17,414 | 0 | 0 | 0 | 21 | 250 |
a1a1aa9f7cbbc6265cfe3b922867e0bc944af177 | 12,974 | py | Python | appion/build/scripts-2.7/tiltStackSync.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | appion/build/scripts-2.7/tiltStackSync.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | appion/build/scripts-2.7/tiltStackSync.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | #!/bin/python
#python
#appion
#=====================
if __name__ == "__main__":
tiltstacks = tiltStackSync()
tiltstacks.start()
tiltstacks.close()
| 35.545205 | 108 | 0.697934 | #!/bin/python
#python
import sys
import os
import time
import re
import shutil
import MySQLdb
#appion
from appionlib import appionScript
from appionlib import apStack
from appionlib import apDisplay
from appionlib import apEMAN
from appionlib import apFile
from appionlib.apSpider import operations
from appionlib.apTil... | 0 | 0 | 0 | 12,438 | 0 | 0 | 0 | 29 | 353 |
7c5fb9f45657ecafdf1c38f92248649f38bb6604 | 260 | py | Python | 05_debugging/solutions/bug_03.py | nachrisman/PHY494 | bac0dd5a7fe6f59f9e2ccaee56ebafcb7d97e2e7 | [
"CC-BY-4.0"
] | null | null | null | 05_debugging/solutions/bug_03.py | nachrisman/PHY494 | bac0dd5a7fe6f59f9e2ccaee56ebafcb7d97e2e7 | [
"CC-BY-4.0"
] | null | null | null | 05_debugging/solutions/bug_03.py | nachrisman/PHY494 | bac0dd5a7fe6f59f9e2ccaee56ebafcb7d97e2e7 | [
"CC-BY-4.0"
] | null | null | null | # bug 3
# http://asu-compmethodsphysics-phy494.github.io/ASU-PHY494/2017/01/24/04_Debugging_1/#activity-fix-as-many-bugs-as-possible
# Print "error" for input 0:
x = float(input("Enter non-zero number --> "))
if x == 0:
print("ERROR: number cannot be 0")
| 28.888889 | 124 | 0.7 | # bug 3
# http://asu-compmethodsphysics-phy494.github.io/ASU-PHY494/2017/01/24/04_Debugging_1/#activity-fix-as-many-bugs-as-possible
# Print "error" for input 0:
x = float(input("Enter non-zero number --> "))
if x == 0:
print("ERROR: number cannot be 0")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e009120c4e68c7222536c86157b18d6d0fc86315 | 5,348 | py | Python | test/automl/test_notebook_example.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null | test/automl/test_notebook_example.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null | test/automl/test_notebook_example.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
test_automl(600)
| 36.882759 | 152 | 0.663426 | import sys
from openml.exceptions import OpenMLServerException
from requests.exceptions import ChunkedEncodingError
def test_automl(budget=5, dataset_format="dataframe", hpo_method=None):
from flaml.data import load_openml_dataset
import urllib3
performance_check_budget = 600
if (
sys.platfor... | 0 | 0 | 0 | 0 | 0 | 5,110 | 0 | 50 | 135 |
c1e967e0502cb36c1b0d66fa783de85952b4bbed | 241 | py | Python | neighbor_app/admin.py | FloiceNyota98/Neighborhood | ef60aa45e50ec093fcccad583ccb914114d7d71f | [
"MIT"
] | 1 | 2021-07-31T07:59:56.000Z | 2021-07-31T07:59:56.000Z | neighbor_app/admin.py | FloiceNyota98/Neighborhood | ef60aa45e50ec093fcccad583ccb914114d7d71f | [
"MIT"
] | null | null | null | neighbor_app/admin.py | FloiceNyota98/Neighborhood | ef60aa45e50ec093fcccad583ccb914114d7d71f | [
"MIT"
] | 1 | 2021-08-31T09:36:53.000Z | 2021-08-31T09:36:53.000Z | from django.contrib import admin
from .models import Business, NeighborHood, Post, Profile
# Register your models here.
admin.site.register(Profile)
admin.site.register(Business)
admin.site.register(Post)
admin.site.register(NeighborHood)
| 24.1 | 57 | 0.813278 | from django.contrib import admin
from .models import Business, NeighborHood, Post, Profile
# Register your models here.
admin.site.register(Profile)
admin.site.register(Business)
admin.site.register(Post)
admin.site.register(NeighborHood)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d296585d1c8d998824941555345adc6ce57ce849 | 1,142 | py | Python | divico_ctrl/translation.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | 2 | 2019-12-12T20:57:37.000Z | 2021-09-29T02:59:19.000Z | divico_ctrl/translation.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | null | null | null | divico_ctrl/translation.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | null | null | null |
T = Translation()
| 30.864865 | 95 | 0.585814 | import json
import os
class Translation(object):
def __init__(self, default_lang='de'):
self.__langs = {}
self.__default_lang = default_lang
# loading translations
path = os.path.dirname(os.path.abspath(__file__))
lang_files = {
'de': path + '/../assets/transla... | 0 | 0 | 0 | 1,076 | 0 | 0 | 0 | -22 | 67 |
cbec29e23f3954ee6849cec0a554ca2c1e06eec3 | 439 | py | Python | rudra/rudra/urls.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | rudra/rudra/urls.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | rudra/rudra/urls.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from inventory import views as inventory_index
urlpatterns = [
# Examples:
# url(r'^$', 'rudra.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', inventory_index.index, name='index'),
url(r'^... | 29.266667 | 80 | 0.651481 | from django.conf.urls import include, url
from django.contrib import admin
from inventory import views as inventory_index
urlpatterns = [
# Examples:
# url(r'^$', 'rudra.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', inventory_index.index, name='index'),
url(r'^... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1314845f31133e2f039af920f60d0139625cdac7 | 51,179 | py | Python | twords/twords.py | ddandur/Twords | 63675d89af8d8c7fda939a3e3911ccc4417644a9 | [
"MIT"
] | 17 | 2017-08-16T12:27:16.000Z | 2021-05-23T12:41:56.000Z | twords/twords.py | ddandur/Twords | 63675d89af8d8c7fda939a3e3911ccc4417644a9 | [
"MIT"
] | null | null | null | twords/twords.py | ddandur/Twords | 63675d89af8d8c7fda939a3e3911ccc4417644a9 | [
"MIT"
] | 7 | 2017-08-15T13:20:42.000Z | 2020-03-01T16:59:50.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
# use this if you want to include modules from a subfolder
#cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"GetOldTweets-python")))
#if cmd_subfolder not in sys.path:
# sys.path.... | 46.611111 | 147 | 0.605502 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import datetime
import string
from os import listdir
from os.path import join as pathjoin
from math import log, ceil
import subprocess
import pandas as pd
import nltk
from nltk.corpus import stopwords
import matplotlib.pyplot as plt
import tailer
from ttp import t... | 0 | 0 | 0 | 50,508 | 0 | 0 | 0 | -5 | 288 |
35399c5f7200466f779bc16de6978d488fb725b7 | 399 | py | Python | parameter/__init__.py | coldnight/parameter | 70a9f5e21ebb78d526d074eea64a16242b129848 | [
"Apache-2.0"
] | 2 | 2017-08-08T03:30:25.000Z | 2017-12-02T19:10:38.000Z | parameter/__init__.py | coldnight/parameter | 70a9f5e21ebb78d526d074eea64a16242b129848 | [
"Apache-2.0"
] | null | null | null | parameter/__init__.py | coldnight/parameter | 70a9f5e21ebb78d526d074eea64a16242b129848 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Reexport"""
from __future__ import print_function, division, unicode_literals
from .model import Model, Argument, BaseAdapter
from .exception import ArgumentError, ArgumentMissError, ArgumentInvalidError
__version__ = "0.0.2"
__all__ = ["ArgumentError", "ArgumentMiss... | 26.6 | 77 | 0.736842 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Reexport"""
from __future__ import print_function, division, unicode_literals
from .model import Model, Argument, BaseAdapter
from .exception import ArgumentError, ArgumentMissError, ArgumentInvalidError
__version__ = "0.0.2"
__all__ = ["ArgumentError", "ArgumentMiss... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eea6820d66c1cc7a727aa191616c827de43dab06 | 433 | py | Python | kattis/missingnumbers.py | btjanaka/competitive-programming-solutions | e3df47c18451802b8521ebe61ca71ee348e5ced7 | [
"MIT"
] | 3 | 2020-06-25T21:04:02.000Z | 2021-05-12T03:33:19.000Z | kattis/missingnumbers.py | btjanaka/competitive-programming-solutions | e3df47c18451802b8521ebe61ca71ee348e5ced7 | [
"MIT"
] | null | null | null | kattis/missingnumbers.py | btjanaka/competitive-programming-solutions | e3df47c18451802b8521ebe61ca71ee348e5ced7 | [
"MIT"
] | 1 | 2020-06-25T21:04:06.000Z | 2020-06-25T21:04:06.000Z | # Author: btjanaka (Bryon Tjanaka)
# Problem: (Kattis) missingnumbers
# Title: Missing Numbers
# Link: https://open.kattis.com/problems/missingnumbers
# Idea: Keep counting.
# Difficulty: easy
# Tags: implementation
n = int(input())
cur = 1
num_printed = 0
for _ in range(n):
k = int(input())
while cur < k:
... | 21.65 | 55 | 0.632794 | # Author: btjanaka (Bryon Tjanaka)
# Problem: (Kattis) missingnumbers
# Title: Missing Numbers
# Link: https://open.kattis.com/problems/missingnumbers
# Idea: Keep counting.
# Difficulty: easy
# Tags: implementation
n = int(input())
cur = 1
num_printed = 0
for _ in range(n):
k = int(input())
while cur < k:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f490e6a25b99549407a4432f866c4c80cbdaff53 | 339 | py | Python | dag_03.py | harkabeeparolus/kodkalender-2020 | ad6ca9c6e067ad206c54854771c8c6bb1bf27cfa | [
"MIT"
] | null | null | null | dag_03.py | harkabeeparolus/kodkalender-2020 | ad6ca9c6e067ad206c54854771c8c6bb1bf27cfa | [
"MIT"
] | null | null | null | dag_03.py | harkabeeparolus/kodkalender-2020 | ad6ca9c6e067ad206c54854771c8c6bb1bf27cfa | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
"""Unga programmerare kodkalender 2020, lucka 3."""
# https://ungaprogrammerare.se/kodkalender/lucka-3/
import functools
import math
import operator
a = math.factorial(100)
b = functools.reduce(operator.mul, range(2, 165, 2))
how_many = round(a / b)
print(f"Antal delar: {how_many}")
# Antal ... | 21.1875 | 52 | 0.731563 | #! /usr/bin/env python3
"""Unga programmerare kodkalender 2020, lucka 3."""
# https://ungaprogrammerare.se/kodkalender/lucka-3/
import functools
import math
import operator
a = math.factorial(100)
b = functools.reduce(operator.mul, range(2, 165, 2))
how_many = round(a / b)
print(f"Antal delar: {how_many}")
# Antal ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d25e0e3402b84408e43fdbf5a922a14a3ddebf16 | 13,327 | py | Python | utils/face.py | foamliu/i-Cloud | c5eb0a22c1c0c78d5195d4f62237fd6c2b5e6a32 | [
"MIT"
] | 1 | 2020-02-27T07:46:24.000Z | 2020-02-27T07:46:24.000Z | utils/face.py | foamliu/i-Cloud | c5eb0a22c1c0c78d5195d4f62237fd6c2b5e6a32 | [
"MIT"
] | null | null | null | utils/face.py | foamliu/i-Cloud | c5eb0a22c1c0c78d5195d4f62237fd6c2b5e6a32 | [
"MIT"
] | 2 | 2019-04-25T22:56:41.000Z | 2019-07-01T21:12:21.000Z | import torch
from torch import nn
from torchvision import transforms
from config import device, logger
from models import resnet101
from utils.common import AverageMeter
data_transforms = {
'train': transforms.Compose([
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.No... | 29.161926 | 109 | 0.648758 | import datetime
import math
import os
import pickle
import random
import shutil
import time
import zipfile
import cv2 as cv
import numpy as np
import torch
from PIL import Image
from flask import request
from scipy.stats import norm
from torch import nn
from torch.utils.data import Dataset
from torchvision import tran... | 0 | 0 | 0 | 528 | 0 | 10,599 | 0 | 99 | 880 |
7ae8c7f7b52099998030d4155daa298e682c086a | 630 | py | Python | Assignment Solution/Module5-master/Module5_CaseStudy1_Q2_Ans.py | krdhakal/Edureka-HW-Solutions-of-Data-Science-for-Python-Certification | 2332839d25cca3ee8036d6dda7360a3b31824d6b | [
"MIT"
] | null | null | null | Assignment Solution/Module5-master/Module5_CaseStudy1_Q2_Ans.py | krdhakal/Edureka-HW-Solutions-of-Data-Science-for-Python-Certification | 2332839d25cca3ee8036d6dda7360a3b31824d6b | [
"MIT"
] | null | null | null | Assignment Solution/Module5-master/Module5_CaseStudy1_Q2_Ans.py | krdhakal/Edureka-HW-Solutions-of-Data-Science-for-Python-Certification | 2332839d25cca3ee8036d6dda7360a3b31824d6b | [
"MIT"
] | null | null | null | # Find the genre in which there has been the greatest number of movie releases
import pandas as pd
import numpy as np
dataset=pd.read_csv('c:\\temp\\HollywoodMovies.csv')
selected_data=dataset.loc[:,['WorldGross','Genre']]
df=pd.DataFrame(selected_data)
df_notnull_genre=df[df.Genre.notnull()]
df_notnull_worldgross=df... | 39.375 | 106 | 0.803175 | # Find the genre in which there has been the greatest number of movie releases
import pandas as pd
import numpy as np
dataset=pd.read_csv('c:\\temp\\HollywoodMovies.csv')
selected_data=dataset.loc[:,['WorldGross','Genre']]
df=pd.DataFrame(selected_data)
df_notnull_genre=df[df.Genre.notnull()]
df_notnull_worldgross=df... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a943368dd77b94ada6edbbab0c76bd8593bd383e | 634 | py | Python | esphome/components/homeassistant/binary_sensor/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 249 | 2018-04-07T12:04:11.000Z | 2019-01-25T01:11:34.000Z | esphome/components/homeassistant/binary_sensor/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 243 | 2018-04-11T16:37:11.000Z | 2019-01-25T16:50:37.000Z | esphome/components/homeassistant/binary_sensor/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 40 | 2018-04-10T05:50:14.000Z | 2019-01-25T15:20:36.000Z | import esphome.codegen as cg
from esphome.components import binary_sensor
from .. import (HOME_ASSISTANT_IMPORT_SCHEMA, homeassistant_ns, setup_home_assistant_entity)
DEPENDENCIES = ["api"]
HomeassistantBinarySensor = homeassistant_ns.class_(
"HomeassistantBinarySensor", binary_sensor.BinarySensor, cg.Component
... | 25.36 | 85 | 0.801262 | import esphome.codegen as cg
from esphome.components import binary_sensor
from .. import (
HOME_ASSISTANT_IMPORT_SCHEMA,
homeassistant_ns,
setup_home_assistant_entity,
)
DEPENDENCIES = ["api"]
HomeassistantBinarySensor = homeassistant_ns.class_(
"HomeassistantBinarySensor", binary_sensor.BinarySensor... | 0 | 0 | 151 | 0 | 0 | 0 | 0 | 15 | 23 |
89089996ae8b20945ecd282a5d4e36d1c88f9623 | 658 | py | Python | Programming/python/cookbook/n_base_conversion.py | kwangjunechoi7/TIL | 99403791eb77fd9190d7d6f60ade67bb48122b33 | [
"MIT"
] | null | null | null | Programming/python/cookbook/n_base_conversion.py | kwangjunechoi7/TIL | 99403791eb77fd9190d7d6f60ade67bb48122b33 | [
"MIT"
] | null | null | null | Programming/python/cookbook/n_base_conversion.py | kwangjunechoi7/TIL | 99403791eb77fd9190d7d6f60ade67bb48122b33 | [
"MIT"
] | null | null | null | # -*-coding:utf-8-*-
"""
recursive
2 <= n <= 16
"""
"""
def test(n,t):
answer = ''
while t//n >= 1:
re = t%n
t = t//n
answer = str(re) + answer
print(answer)
if t < n:
answer = str(t) + answer
return int(answer)
"""
"""
#
def convert_2(t, n):
... | 16.04878 | 36 | 0.410334 | # -*-coding:utf-8-*-
"""
진법 변환 recursive 알고리즘
2 <= n <= 16까지 가능
"""
def convert(n,t):
T = "0123456789ABCDEF"
q,r = divmod(n, t)
if q ==0:
return T[r]
else:
return convert(q, t) + T[r]
"""
def test(n,t):
answer = ''
while t//n >= 1:
re = t%n
t = t//n
an... | 63 | 0 | 0 | 0 | 0 | 126 | 0 | 0 | 23 |
c33f07b92a9ea6c9b5d80e72c591cec5aeaf2a35 | 2,591 | py | Python | setup.py | Robert-96/websocket-client | fd56fd35d2a933745814afd23253a33d71306bb9 | [
"Apache-2.0"
] | 1 | 2022-03-25T09:03:23.000Z | 2022-03-25T09:03:23.000Z | setup.py | Robert-96/websocket-client | fd56fd35d2a933745814afd23253a33d71306bb9 | [
"Apache-2.0"
] | null | null | null | setup.py | Robert-96/websocket-client | fd56fd35d2a933745814afd23253a33d71306bb9 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
"""
setup.py
websocket - WebSocket client library for Python
Copyright 2022 engn33r
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.apac... | 32.797468 | 81 | 0.661521 | import sys
import pkg_resources
from setuptools import setup, find_packages
"""
setup.py
websocket - WebSocket client library for Python
Copyright 2022 engn33r
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... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 44 |
c656d81b7ac6d0b7d7e2fea232113d472dda5096 | 10,112 | py | Python | on_policy/algorithms/ppo.py | marsXyr/RL_Pytorch | cc80bfb442c45c8e87849a7d0a1fb8bc837448a5 | [
"MIT"
] | null | null | null | on_policy/algorithms/ppo.py | marsXyr/RL_Pytorch | cc80bfb442c45c8e87849a7d0a1fb8bc837448a5 | [
"MIT"
] | null | null | null | on_policy/algorithms/ppo.py | marsXyr/RL_Pytorch | cc80bfb442c45c8e87849a7d0a1fb8bc837448a5 | [
"MIT"
] | null | null | null | import argparse
import os.path as osp
import torch.nn as nn
import torch.optim as optim
from utils.run_utils import setup_logger_kwargs
from utils.mpi_tools import mpi_fork
if __name__ == '__main__':
parser = argparse.ArgumentParser()
""" env """
parser.add_argument('--env', type=str, def... | 42.666667 | 122 | 0.601563 | import numpy as np
import argparse, gym, time, os
import os.path as osp
import torch
import torch.nn as nn
import torch.optim as optim
from on_policy.utils import core
from on_policy.utils.model import ActorCritic
from on_policy.utils.replay_buffer import ReplayBuffer
from utils.logx import EpochLogger
from u... | 0 | 0 | 0 | 8,209 | 0 | 0 | 0 | 113 | 163 |
51d108784cff76de7b29f2597632b0919f2ce39a | 4,072 | py | Python | insert.py | DigiLog-N/Cassandra_Loaders | ad97e8b5ee4b9dfd4887476f1818fa101075aa8d | [
"Apache-2.0"
] | null | null | null | insert.py | DigiLog-N/Cassandra_Loaders | ad97e8b5ee4b9dfd4887476f1818fa101075aa8d | [
"Apache-2.0"
] | null | null | null | insert.py | DigiLog-N/Cassandra_Loaders | ad97e8b5ee4b9dfd4887476f1818fa101075aa8d | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# insert.py
# https://github.com/DigiLog-N/SynopticDataClient
# Copyright 2020 Canvass Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | 32.83871 | 79 | 0.561886 | ##############################################################################
# insert.py
# https://github.com/DigiLog-N/SynopticDataClient
# Copyright 2020 Canvass Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | 0 | 0 | 0 | 2,691 | 0 | 0 | 0 | 0 | 23 |
f208f86a147806a8b0c97fa5e9dd1609d1f04c1e | 3,092 | py | Python | gapid_tests/resource_creation_tests/vkCreateFramebuffer_test/vkCreateFramebuffer_test.py | RenfengLiu/vulkan_test_applications | 04359b7184ad94659810213ff63ae71296426182 | [
"Apache-2.0"
] | 55 | 2017-06-20T13:54:31.000Z | 2022-02-08T23:58:11.000Z | gapid_tests/resource_creation_tests/vkCreateFramebuffer_test/vkCreateFramebuffer_test.py | RenfengLiu/vulkan_test_applications | 04359b7184ad94659810213ff63ae71296426182 | [
"Apache-2.0"
] | 53 | 2017-06-15T19:23:07.000Z | 2022-03-30T19:56:30.000Z | gapid_tests/resource_creation_tests/vkCreateFramebuffer_test/vkCreateFramebuffer_test.py | RenfengLiu/vulkan_test_applications | 04359b7184ad94659810213ff63ae71296426182 | [
"Apache-2.0"
] | 42 | 2017-06-15T19:05:40.000Z | 2022-03-30T14:15:25.000Z | # Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softwa... | 45.470588 | 78 | 0.731565 | # Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softwa... | 0 | 1,875 | 0 | 0 | 0 | 0 | 0 | 201 | 112 |
2af14be3d99155fb27452df82a3ee04acbf74715 | 16,524 | py | Python | benchmarks/scripts/benchmarks.py | riddopic/delta | 532da849290f9fa63ccacfc176f39f6d4775035d | [
"Apache-2.0"
] | null | null | null | benchmarks/scripts/benchmarks.py | riddopic/delta | 532da849290f9fa63ccacfc176f39f6d4775035d | [
"Apache-2.0"
] | null | null | null | benchmarks/scripts/benchmarks.py | riddopic/delta | 532da849290f9fa63ccacfc176f39f6d4775035d | [
"Apache-2.0"
] | null | null | null | #
# Copyright (2021) The Delta Lake Project Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 44.659459 | 131 | 0.653292 | #
# Copyright (2021) The Delta Lake Project Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 2,646 | 0 | 12,915 | 0 | 0 | 0 | 4 | 228 |
7fd483db80d173ed61885938f51715a5a658b565 | 3,003 | py | Python | sewing/display.py | except-pass/sewing | d6b1098b1d7826da3b2cfb4fe3f591ac5dea5529 | [
"Apache-2.0"
] | 1 | 2021-08-16T23:57:35.000Z | 2021-08-16T23:57:35.000Z | sewing/display.py | except-pass/sewing | d6b1098b1d7826da3b2cfb4fe3f591ac5dea5529 | [
"Apache-2.0"
] | null | null | null | sewing/display.py | except-pass/sewing | d6b1098b1d7826da3b2cfb4fe3f591ac5dea5529 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/display.ipynb (unless otherwise specified).
__all__ = ['encode', 'DiscordEncoder', 'Formatter', 'serialize_content', 'html_content']
# Cell
# Cell
# Cell
#TODO change the data model for this to something more standard.
# use only strings for the keywords rather t... | 33.741573 | 92 | 0.55045 | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/display.ipynb (unless otherwise specified).
__all__ = ['encode', 'DiscordEncoder', 'Formatter', 'serialize_content', 'html_content']
# Cell
import discord
# Cell
import json
def encode(u):
if isinstance(u, discord.Message):
ts = u.created_at
ser... | 0 | 0 | 0 | 1,252 | 0 | 1,270 | 0 | -17 | 159 |
4fc50fa8fdc22ae0a42408d29bb1eaa2f4f6629f | 255 | py | Python | producer.py | Fran006/tarea_kafka | 4956c1469ee28a22cfde3dd0c6de8b5b4ae57062 | [
"Apache-2.0"
] | null | null | null | producer.py | Fran006/tarea_kafka | 4956c1469ee28a22cfde3dd0c6de8b5b4ae57062 | [
"Apache-2.0"
] | null | null | null | producer.py | Fran006/tarea_kafka | 4956c1469ee28a22cfde3dd0c6de8b5b4ae57062 | [
"Apache-2.0"
] | 1 | 2021-11-10T22:42:25.000Z | 2021-11-10T22:42:25.000Z | from kafka import KafkaProducer
import json
producer = KafkaProducer(value_serializer=lambda m: json.dumps(m).encode('ascii'), bootstrap_servers=['localhost:9092'])
producer.send('event', {'id': 123, 'email_vendedor': 'asdas@mail.com'})
producer.flush() | 42.5 | 120 | 0.760784 | from kafka import KafkaProducer
import json
producer = KafkaProducer(value_serializer=lambda m: json.dumps(m).encode('ascii'), bootstrap_servers=['localhost:9092'])
producer.send('event', {'id': 123, 'email_vendedor': 'asdas@mail.com'})
producer.flush() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c1b599e6e1ca1877962e355a6ed461f34dc75d4a | 153 | py | Python | app/__init__.py | themagpimag/magpi-api | f99b9bc534dc7f44fc7d84d7f266370e5794b467 | [
"MIT"
] | 1 | 2015-08-11T11:44:45.000Z | 2015-08-11T11:44:45.000Z | app/__init__.py | themagpimag/magpi-api | f99b9bc534dc7f44fc7d84d7f266370e5794b467 | [
"MIT"
] | null | null | null | app/__init__.py | themagpimag/magpi-api | f99b9bc534dc7f44fc7d84d7f266370e5794b467 | [
"MIT"
] | null | null | null | import os, sys
sys.path.insert(1, os.path.join(os.path.abspath('.'), 'flaskstuff'))
from flask import Flask
app = Flask(__name__)
| 21.857143 | 68 | 0.732026 | import os, sys
sys.path.insert(1, os.path.join(os.path.abspath('.'), 'flaskstuff'))
from flask import Flask
app = Flask(__name__)
from app import views
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
1d16e66cae87b4d4e0d7cb5177e60619c21733ff | 1,471 | py | Python | ssh_telnet/pexpect/ex11_ssh_pexpect_threads.py | levs72/pyneng-examples | d6288292dcf9d1ebc5a9db4a0d620bd11b4a2df9 | [
"MIT"
] | 11 | 2021-04-05T09:30:23.000Z | 2022-03-09T13:27:56.000Z | ssh_telnet/pexpect/ex11_ssh_pexpect_threads.py | levs72/pyneng-examples | d6288292dcf9d1ebc5a9db4a0d620bd11b4a2df9 | [
"MIT"
] | null | null | null | ssh_telnet/pexpect/ex11_ssh_pexpect_threads.py | levs72/pyneng-examples | d6288292dcf9d1ebc5a9db4a0d620bd11b4a2df9 | [
"MIT"
] | 11 | 2021-04-06T03:44:35.000Z | 2022-03-04T21:20:40.000Z | from pprint import pprint
import yaml
import logging
logging.basicConfig(
format="%(threadName)s %(name)s %(levelname)s: %(message)s", level=logging.INFO
)
if __name__ == "__main__":
with open("devices.yaml") as f:
devices = yaml.safe_load(f)
r = send_show_to_devices(devices, "sh int desc")
... | 28.288462 | 86 | 0.645139 | from concurrent.futures import ThreadPoolExecutor
from itertools import repeat
from pprint import pprint
import pexpect
import yaml
import logging
logging.basicConfig(
format="%(threadName)s %(name)s %(levelname)s: %(message)s", level=logging.INFO
)
def send_show_command(host, username, password, enable_pass, ... | 0 | 0 | 0 | 0 | 0 | 987 | 0 | 28 | 113 |
26834ebb2aeaa8b8b055be1d5f31f9e4d6541584 | 127 | py | Python | qbatch/__init__.py | Gab-D-G/qbatch | 3ecff388d7d4d19468403f9b5595e7f8a865ff73 | [
"Unlicense"
] | 29 | 2015-12-11T19:30:41.000Z | 2021-08-30T12:39:48.000Z | qbatch/__init__.py | Gab-D-G/qbatch | 3ecff388d7d4d19468403f9b5595e7f8a865ff73 | [
"Unlicense"
] | 157 | 2015-12-15T20:42:14.000Z | 2021-08-19T16:26:15.000Z | qbatch/__init__.py | gdevenyi/qbatch | 40e62a8232f199c26de2bbe4a619ae474d8398d6 | [
"Unlicense"
] | 15 | 2015-12-15T19:48:38.000Z | 2021-07-09T14:47:09.000Z | from __future__ import absolute_import
| 21.166667 | 38 | 0.84252 | from __future__ import absolute_import
from . import qbatch
from .qbatch import qbatchParser
from .qbatch import qbatchDriver
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 67 |
ef3f4491efa17c348ebc2c021ea1f9365a52f5f0 | 1,950 | py | Python | 6.00.1x/PS7/AdoptionCenter.py | batnam/MITx6.00.1x | f2c342c8b69ecf22b2e40f3ce554255efdc6f7c0 | [
"MIT"
] | null | null | null | 6.00.1x/PS7/AdoptionCenter.py | batnam/MITx6.00.1x | f2c342c8b69ecf22b2e40f3ce554255efdc6f7c0 | [
"MIT"
] | null | null | null | 6.00.1x/PS7/AdoptionCenter.py | batnam/MITx6.00.1x | f2c342c8b69ecf22b2e40f3ce554255efdc6f7c0 | [
"MIT"
] | null | null | null | __author__ = 'ThanhNam'
# Enter your code for the AdoptionCenter class here
# Be sure to include the __init__, get_name, get_species_count, get_number_of_species, and adopt_pet methods. | 45.348837 | 109 | 0.657949 | __author__ = 'ThanhNam'
# Enter your code for the AdoptionCenter class here
# Be sure to include the __init__, get_name, get_species_count, get_number_of_species, and adopt_pet methods.
class AdoptionCenter:
"""
The AdoptionCenter class stores the important information that a
client would need to know about... | 0 | 0 | 0 | 1,743 | 0 | 0 | 0 | 0 | 22 |
07ccf046f59337ff05c6654450113b1bb0cbf3bc | 830 | py | Python | gammapy/datasets/tests/test_load.py | contrera/gammapy | aa0a74baa977ee2477b5c63e036075f4219792a3 | [
"BSD-3-Clause"
] | null | null | null | gammapy/datasets/tests/test_load.py | contrera/gammapy | aa0a74baa977ee2477b5c63e036075f4219792a3 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T19:55:46.000Z | 2020-10-29T19:55:46.000Z | gammapy/datasets/tests/test_load.py | qpiel/gammapy | cfb976909e63f4d5d578e1495245c0baad69482b | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
| 33.2 | 82 | 0.760241 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from numpy.testing import assert_allclose
from ...utils.testing import requires_data
from ..core import gammapy_extra
from ...datasets import load_poisson_stats_image
@req... | 0 | 468 | 0 | 0 | 0 | 0 | 0 | 79 | 134 |
f7f700d638e18614ca377341088ad873b1037c34 | 2,301 | py | Python | GPflow/testing/test_triang.py | mlilab/Mixed-Effect-Composite-RNN-Gaussian-Process | dd7da89ce3c41d459a26ad1ce5ed2f40ab4ca85d | [
"Apache-2.0"
] | 24 | 2018-11-29T07:00:59.000Z | 2021-04-22T19:12:31.000Z | GPflow/testing/test_triang.py | mlilab/Mixed-Effect-Composite-RNN-Gaussian-Process | dd7da89ce3c41d459a26ad1ce5ed2f40ab4ca85d | [
"Apache-2.0"
] | 1 | 2018-12-04T11:51:21.000Z | 2018-12-04T11:51:21.000Z | GPflow/testing/test_triang.py | OpenXAIProject/Mixed-Effect-Composite-RNN-Gaussian-Process | dd7da89ce3c41d459a26ad1ce5ed2f40ab4ca85d | [
"Apache-2.0"
] | 12 | 2018-11-30T00:40:13.000Z | 2019-10-30T16:09:52.000Z | import unittest
from gpflow.tf_wraps import vec_to_tri
if __name__ == "__main__":
unittest.main()
| 37.721311 | 88 | 0.65189 | import unittest
from gpflow.tf_wraps import vec_to_tri
import tensorflow as tf
import numpy as np
from testing.gpflow_testcase import GPflowTestCase
from gpflow.tf_wraps import vec_to_tri
class TestVecToTri(GPflowTestCase):
def referenceInverse(self, matrices):
#this is the inverse operation of the vec_to_tri
... | 0 | 0 | 0 | 2,040 | 0 | 0 | 0 | 45 | 112 |
38026a46d227486abffd913d93d9c5a5bf30660e | 1,607 | py | Python | GUTG_Vote/views.py | KnightHawk3/GUTG-Vote | 73187427ecf4848f5942b627ccb01a6bb46e20c7 | [
"MIT"
] | null | null | null | GUTG_Vote/views.py | KnightHawk3/GUTG-Vote | 73187427ecf4848f5942b627ccb01a6bb46e20c7 | [
"MIT"
] | null | null | null | GUTG_Vote/views.py | KnightHawk3/GUTG-Vote | 73187427ecf4848f5942b627ccb01a6bb46e20c7 | [
"MIT"
] | null | null | null | from flask import Blueprint
main = Blueprint('main', __name__)
| 31.509804 | 82 | 0.698818 | from flask import Blueprint, redirect, url_for, request, render_template, flash, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from GUTG_Vote import utilities
from GUTG_Vote.models import User, Game
from GUTG_Vote.forms import LoginForm
from GUTG_Vote.extensions import db
main = ... | 0 | 1,143 | 0 | 0 | 0 | 0 | 0 | 173 | 227 |
5ba26c08e92e3d324c6c278311b3671c8361e603 | 3,460 | py | Python | scripts/getannotations.py | spyysalo/consensus-pipeline | 2301fcd6fa5bacc7daa18abcc93e5abf28a9a8c1 | [
"MIT"
] | null | null | null | scripts/getannotations.py | spyysalo/consensus-pipeline | 2301fcd6fa5bacc7daa18abcc93e5abf28a9a8c1 | [
"MIT"
] | null | null | null | scripts/getannotations.py | spyysalo/consensus-pipeline | 2301fcd6fa5bacc7daa18abcc93e5abf28a9a8c1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Get annotations with context from database.
import sys
from logging import error
from standoff import Textbound
try:
except ImportError:
error('failed to import sqlitedict, try `pip3 install sqlitedict`')
raise
def get_annotation(standoff, id_):
"""Get annotation with given ... | 28.833333 | 76 | 0.591329 | #!/usr/bin/env python3
# Get annotations with context from database.
import sys
import os
import re
from logging import warning, error
from standoff import Textbound
try:
from sqlitedict import SqliteDict
except ImportError:
error('failed to import sqlitedict, try `pip3 install sqlitedict`')
raise
de... | 0 | 0 | 0 | 0 | 0 | 2,557 | 0 | -3 | 231 |
63cf91e19f748137ebd544fda7899261450dbabc | 605 | py | Python | botforms/urls.py | johan--/botforms | d10731b658459b1cf15b05820f227c3ac7bf9aa3 | [
"MIT"
] | null | null | null | botforms/urls.py | johan--/botforms | d10731b658459b1cf15b05820f227c3ac7bf9aa3 | [
"MIT"
] | null | null | null | botforms/urls.py | johan--/botforms | d10731b658459b1cf15b05820f227c3ac7bf9aa3 | [
"MIT"
] | null | null | null | """botform URL Configuration
"""
from django.conf.urls import url, include
from rest_framework import routers
from botform import api as form_api
router = routers.DefaultRouter()
router.register(r'forms', form_api.FormsViewSet)
router.register(r'submissions', form_api.SubmissionsViewSet)
urlpatterns = [
url(r'^... | 30.25 | 87 | 0.709091 | """botform URL Configuration
"""
from django.conf.urls import url, include
from rest_framework import routers
from botform import api as form_api
router = routers.DefaultRouter()
router.register(r'forms', form_api.FormsViewSet)
router.register(r'submissions', form_api.SubmissionsViewSet)
urlpatterns = [
url(r'^... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
09d397d02fc2b73e519ee160bc9f72a5d0483391 | 351 | py | Python | Aula_3/aaa.py | Mateus-Silva11/AulasPython | d34dc4f62ade438e68b0a80e0baac4d6ec0d378e | [
"MIT"
] | null | null | null | Aula_3/aaa.py | Mateus-Silva11/AulasPython | d34dc4f62ade438e68b0a80e0baac4d6ec0d378e | [
"MIT"
] | null | null | null | Aula_3/aaa.py | Mateus-Silva11/AulasPython | d34dc4f62ade438e68b0a80e0baac4d6ec0d378e | [
"MIT"
] | null | null | null | from operacaoes3 import mais, menos, vezes, divicao, resto, raiz, divicao_f
n1 = int(input('a'))
n2 = int(input('b'))
a = mais(n1,n2)
b = menos(n1,n2)
c = vezes(n1,n2)
d = divicao(n1,n2)
e = resto(n1,n2)
f = raiz(n1,n2)
g = divicao_f(n1,n2)
print(f'{a}')
print(f'{b}')
print(f'{c}')
print(f'{d}')
print(f'{e}')
pri... | 15.26087 | 81 | 0.584046 | from operacaoes3 import mais , menos , vezes , divicao , resto , raiz , divicao_f
n1 = int(input('a'))
n2 = int(input('b'))
a = mais(n1,n2)
b = menos(n1,n2)
c = vezes(n1,n2)
d = divicao(n1,n2)
e = resto(n1,n2)
f = raiz(n1,n2)
g = divicao_f(n1,n2)
print(f'{a}')
print(f'{b}')
print(f'{c}')
print(f'{d}')
print(f'{e}... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
218ffd003ad6258797c16b4042895fa4389c24c3 | 5,088 | py | Python | test/update-tests.py | edanaher/scry | 6958acea46ae6d43540092bb7397ebb4fcc97463 | [
"MIT"
] | 1 | 2020-06-09T20:46:39.000Z | 2020-06-09T20:46:39.000Z | test/update-tests.py | edanaher/scry | 6958acea46ae6d43540092bb7397ebb4fcc97463 | [
"MIT"
] | null | null | null | test/update-tests.py | edanaher/scry | 6958acea46ae6d43540092bb7397ebb4fcc97463 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
# Why is it so hard to get python imports working?
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
if __name__ == "__main__":
main()
| 31.602484 | 149 | 0.64033 | #!/usr/bin/env python
import argparse
import os
import psycopg2
import sys
# Why is it so hard to get python imports working?
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from scry import scry
def parseadd(args):
db = psycopg2.connect("")
cur = db.cursor()
table_inf... | 0 | 0 | 0 | 0 | 0 | 4,721 | 0 | -12 | 159 |
ab148763a282ac4ed2f0fd91c8a2b01c2150e582 | 305 | py | Python | pyrolysis/common/__init__.py | fmerlin/pyrolysis | 2edf1094466b09b4c5d1ab93f5cbc2bb01cc73c3 | [
"MIT"
] | 1 | 2020-05-01T14:14:23.000Z | 2020-05-01T14:14:23.000Z | pyrolysis/common/__init__.py | fmerlin/pyrolysis | 2edf1094466b09b4c5d1ab93f5cbc2bb01cc73c3 | [
"MIT"
] | null | null | null | pyrolysis/common/__init__.py | fmerlin/pyrolysis | 2edf1094466b09b4c5d1ab93f5cbc2bb01cc73c3 | [
"MIT"
] | null | null | null | __version__ = '0.1.5'
try:
import pandas
pandas_df_type = pandas.DataFrame
except ImportError:
pandas_df_type = type(None)
try:
has_msgpack = True
except ImportError:
has_msgpack = False
try:
import os
login = os.getlogin()
except OSError:
login = ''
| 15.25 | 37 | 0.672131 | __version__ = '0.1.5'
try:
import pandas
pandas_df_type = pandas.DataFrame
except ImportError:
pandas_df_type = type(None)
try:
import msgpack
has_msgpack = True
except ImportError:
has_msgpack = False
try:
import os
login = os.getlogin()
except OSError:
login = ''
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -7 | 26 |
e08c7b206b10f6e7ff785d1da11f76d04ad807cf | 1,555 | py | Python | metax/db/extract_gbff_rrna.py | yesimon/metax_bakeoff_2019 | e90da33a9d9407c6a804fee8d58333212148806c | [
"MIT"
] | 16 | 2019-08-08T16:00:15.000Z | 2021-01-22T00:13:05.000Z | metax/db/extract_gbff_rrna.py | yesimon/metax_bakeoff_2019 | e90da33a9d9407c6a804fee8d58333212148806c | [
"MIT"
] | 4 | 2019-09-23T11:23:01.000Z | 2021-01-20T23:20:50.000Z | metax/db/extract_gbff_rrna.py | yesimon/metax_bakeoff_2019 | e90da33a9d9407c6a804fee8d58333212148806c | [
"MIT"
] | 2 | 2019-10-24T14:50:59.000Z | 2019-12-31T02:57:56.000Z | #!/usr/bin/env python3
| 37.02381 | 118 | 0.550482 | #!/usr/bin/env python3
import argparse
import sys
import os
from pathlib import Path
from Bio import SeqIO
import gzip
def add_command(subparsers):
parser = subparsers.add_parser('extract-gbff-rrna', description='Extract rRNA entries from GBFF files.')
parser.add_argument('-i', '--input-dir', help='Output dir... | 0 | 0 | 0 | 0 | 0 | 1,388 | 0 | -36 | 178 |
961e5203d3d494ae7891731578eafae7a39ef2dc | 1,818 | py | Python | tools/online_assembler.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | 161 | 2020-05-31T03:29:42.000Z | 2022-03-07T08:36:19.000Z | tools/online_assembler.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | 74 | 2020-05-26T18:05:48.000Z | 2021-02-13T21:55:39.000Z | tools/online_assembler.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | 19 | 2020-05-27T19:22:11.000Z | 2022-02-17T18:53:52.000Z | """ Helper to assemble code from a web page. """
import flask
main_html = r"""
<!DOCTYPE html>
<html><head>
<title>Online compiler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<script src="https://ajax.googleapis.com/aj... | 25.25 | 88 | 0.640264 | """ Helper to assemble code from a web page. """
import flask
import subprocess
import tempfile
main_html = r"""
<!DOCTYPE html>
<html><head>
<title>Online compiler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<script s... | 0 | 296 | 0 | 0 | 0 | 357 | 0 | -10 | 136 |
7cc91d079a51e8d8c6dac891686716599ed68ead | 188 | py | Python | week0/swapy.py | peacekeeper6/Python-Project | d27101dda4b977fcd1143c02670fd1b78759543f | [
"MIT"
] | null | null | null | week0/swapy.py | peacekeeper6/Python-Project | d27101dda4b977fcd1143c02670fd1b78759543f | [
"MIT"
] | 4 | 2022-03-14T21:40:34.000Z | 2022-03-28T21:46:17.000Z | week0/swapy.py | peacekeeper6/Python-Project | d27101dda4b977fcd1143c02670fd1b78759543f | [
"MIT"
] | 1 | 2022-03-14T21:31:59.000Z | 2022-03-14T21:31:59.000Z |
if __name__ == "__main__":
a = input("first number:")
b = input("second number:")
print(', '.join(swap(a, b)))
| 15.666667 | 30 | 0.494681 | def swap(a, b):
if b < a:
a, b = b, a
return a, b
if __name__ == "__main__":
a = input("first number:")
b = input("second number:")
print(', '.join(swap(a, b)))
| 0 | 0 | 0 | 0 | 0 | 46 | 0 | 0 | 22 |
dd7a28c483c819da0124ed863aebb47475aa02bc | 3,776 | py | Python | devel/forms.py | VanirLab/VOS | e6cb3e4e391e583e98d548292b5f272320d38cc4 | [
"MIT"
] | null | null | null | devel/forms.py | VanirLab/VOS | e6cb3e4e391e583e98d548292b5f272320d38cc4 | [
"MIT"
] | null | null | null | devel/forms.py | VanirLab/VOS | e6cb3e4e391e583e98d548292b5f272320d38cc4 | [
"MIT"
] | null | null | null |
# vim: set ts=4 sw=4 et:
| 36.307692 | 80 | 0.613083 | import random
from collections import OrderedDict
from string import ascii_letters, digits
from django import forms
from django.contrib.auth.models import User, Group
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.template import loader
from .models import Us... | 0 | 0 | 0 | 3,336 | 0 | 0 | 0 | 120 | 286 |
8b16473ee83dc682af821beb59c1c5dc297a5544 | 3,006 | py | Python | numpy_ann.py | anushaa51/YTrendNet | 3c5179d493aea6c45ca4258e1f41857947ec953e | [
"Apache-2.0"
] | 1 | 2019-07-08T15:57:36.000Z | 2019-07-08T15:57:36.000Z | numpy_ann.py | anushab05/YTrendNet | 3c5179d493aea6c45ca4258e1f41857947ec953e | [
"Apache-2.0"
] | null | null | null | numpy_ann.py | anushab05/YTrendNet | 3c5179d493aea6c45ca4258e1f41857947ec953e | [
"Apache-2.0"
] | null | null | null |
# hidden layer activation function
# derivate of hidden layer activation function for gradient descent
# output layer activation function
# cost function
# derivative of cost function for gradient descent
| 34.551724 | 80 | 0.619428 | import numpy as np
# hidden layer activation function
def sigmoid(s):
return 1/(1 + np.exp(-s))
# derivate of hidden layer activation function for gradient descent
def delta_sigmoid(s):
return s * (1 - s)
# output layer activation function
def softmax(s):
exps = np.exp(s - np.max(s, axis=1, k... | 0 | 0 | 0 | 2,066 | 0 | 562 | 0 | -3 | 162 |
5a2cb2c9491ab33ef0c17574907ea19101bad7c3 | 1,797 | py | Python | notebooks/models/spoilers/optimizer.py | AnveshAeturi/deep-learning-workshop | 20be7d92f310ca27a176e96e3a0b557f3fee2ec2 | [
"MIT"
] | 486 | 2016-06-23T09:12:57.000Z | 2022-03-03T11:23:38.000Z | notebooks/models/spoilers/optimizer.py | AnveshAeturi/deep-learning-workshop | 20be7d92f310ca27a176e96e3a0b557f3fee2ec2 | [
"MIT"
] | 4 | 2016-06-24T03:36:02.000Z | 2020-05-15T06:59:54.000Z | notebooks/models/spoilers/optimizer.py | AnveshAeturi/deep-learning-workshop | 20be7d92f310ca27a176e96e3a0b557f3fee2ec2 | [
"MIT"
] | 133 | 2016-07-23T02:50:53.000Z | 2022-03-19T03:41:46.000Z | l_in = lasagne.layers.InputLayer((None, 784))
l_out = lasagne.layers.DenseLayer(l_in,
num_units=10,
nonlinearity=lasagne.nonlinearities.softmax)
X_sym = T.matrix()
y_sym = T.ivector()
output = lasagne.layers.get_output(l_out, X_sym)
pred = output.arg... | 30.457627 | 84 | 0.633278 | l_in = lasagne.layers.InputLayer((None, 784))
l_out = lasagne.layers.DenseLayer(l_in,
num_units=10,
nonlinearity=lasagne.nonlinearities.softmax)
X_sym = T.matrix()
y_sym = T.ivector()
output = lasagne.layers.get_output(l_out, X_sym)
pred = output.arg... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4f3678ead1dd3f3d96e7f7ed489968e2d3d73686 | 14,367 | py | Python | .venv/Lib/site-packages/lemoncheesecake/filter.py | yadavdeepa365/HUDL_PYTHON | e1d5d264e3748f0add18258496f5a850e16b7ee6 | [
"MIT"
] | 34 | 2017-06-12T18:50:36.000Z | 2021-11-29T01:59:07.000Z | .venv/Lib/site-packages/lemoncheesecake/filter.py | yadavdeepa365/HUDL_PYTHON | e1d5d264e3748f0add18258496f5a850e16b7ee6 | [
"MIT"
] | 25 | 2017-12-07T13:35:29.000Z | 2022-03-10T01:27:58.000Z | .venv/Lib/site-packages/lemoncheesecake/filter.py | yadavdeepa365/HUDL_PYTHON | e1d5d264e3748f0add18258496f5a850e16b7ee6 | [
"MIT"
] | 4 | 2019-05-05T03:19:00.000Z | 2021-10-06T13:12:05.000Z | '''
Created on Sep 8, 2016
@author: nicolas
'''
_NEGATION_FLAGS = "-^~"
| 34.536058 | 123 | 0.661934 | '''
Created on Sep 8, 2016
@author: nicolas
'''
import re
import fnmatch
from functools import reduce
from lemoncheesecake.reporting import load_report
from lemoncheesecake.reporting.reportdir import DEFAULT_REPORT_DIR_NAME
from lemoncheesecake.reporting.report import Result, TestResult, Step, Log, Check, Attachment... | 0 | 1,204 | 0 | 6,266 | 541 | 5,404 | 0 | 222 | 637 |
06a50c62e1fde1ccf15cad6a38ed701acf4dc5f3 | 20,995 | py | Python | scenegraph/exp-official/taskographyv2medium10_FF/taskographyv2medium10_FF_test.py | taskography/3dscenegraph-dev | 2c261241230fbea1f1c687ff793478248f25c02c | [
"MIT"
] | 1 | 2022-01-30T22:06:57.000Z | 2022-01-30T22:06:57.000Z | scenegraph/exp-official/taskographyv2medium10_FF/taskographyv2medium10_FF_test.py | taskography/3dscenegraph-dev | 2c261241230fbea1f1c687ff793478248f25c02c | [
"MIT"
] | null | null | null | scenegraph/exp-official/taskographyv2medium10_FF/taskographyv2medium10_FF_test.py | taskography/3dscenegraph-dev | 2c261241230fbea1f1c687ff793478248f25c02c | [
"MIT"
] | null | null | null | STATS = [
{
"num_node_expansions": 653,
"plan_length": 167,
"search_time": 0.52,
"total_time": 0.52
},
{
"num_node_expansions": 978,
"plan_length": 167,
"search_time": 0.86,
"total_time": 0.86
},
{
"num_node_expansions": 1087,
... | 22.146624 | 36 | 0.475685 | STATS = [
{
"num_node_expansions": 653,
"plan_length": 167,
"search_time": 0.52,
"total_time": 0.52
},
{
"num_node_expansions": 978,
"plan_length": 167,
"search_time": 0.86,
"total_time": 0.86
},
{
"num_node_expansions": 1087,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9ae1fd07ba143f523cf6ec0b09ff7db797b76542 | 4,448 | py | Python | scratch/parse_flexible_args.py | strukovsv/PyHAML | 75d7774f30809f755dad2867e9ab55cea3019046 | [
"BSD-3-Clause"
] | 21 | 2015-01-27T13:32:46.000Z | 2022-03-12T21:45:12.000Z | scratch/parse_flexible_args.py | strukovsv/PyHAML | 75d7774f30809f755dad2867e9ab55cea3019046 | [
"BSD-3-Clause"
] | 2 | 2017-05-23T11:30:01.000Z | 2019-07-29T01:21:27.000Z | scratch/parse_flexible_args.py | strukovsv/PyHAML | 75d7774f30809f755dad2867e9ab55cea3019046 | [
"BSD-3-Clause"
] | 8 | 2015-07-13T17:46:24.000Z | 2021-12-08T18:13:22.000Z | import re
import ast
import operator
def literal_eval(node_or_string):
"""
Safely evaluate an expression node or a string containing a Python
expression. The string or node provided may only consist of the following
Python literal structures: strings, numbers, tuples, lists, dicts, booleans,
an... | 29.263158 | 80 | 0.510342 | import re
import ast
import operator
def parse_args(input, end=')'):
chunks = re.split(r'(,|%s)' % re.escape(end), input)
output = []
# Continue processing chunks as long as we keep getting something.
last_output = -1
while len(output) != last_output:
last_output = len(output)
... | 0 | 0 | 0 | 0 | 0 | 2,830 | 0 | 0 | 58 |
5e6887bbdad82231a81256d4d50e3159e34d107f | 8,506 | py | Python | old/dig1/sageutil.py | letonchanh/dig-m3 | 98b6f2bd6efeddbd8c047e77f4d3b506abf022b9 | [
"MIT"
] | null | null | null | old/dig1/sageutil.py | letonchanh/dig-m3 | 98b6f2bd6efeddbd8c047e77f4d3b506abf022b9 | [
"MIT"
] | null | null | null | old/dig1/sageutil.py | letonchanh/dig-m3 | 98b6f2bd6efeddbd8c047e77f4d3b506abf022b9 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from sage.all import (operator, flatten, PolynomialRing, SR, QQ, ZZ, RR, sage, oo)
from vu_common import (is_iterable, is_empty)
is_sage_expr = lambda x: isinstance(x, sage.symbolic.expression.Expression)
is_sage_real = lambda x: isinstance(x, sage.rings.real... | 27.175719 | 229 | 0.53715 | from collections import OrderedDict
from sage.all import (operator, flatten, PolynomialRing, SR, QQ, ZZ, RR, sage, oo)
from vu_common import (pause, get_logger,is_iterable, is_str, is_empty)
is_sage_expr = lambda x: isinstance(x, sage.symbolic.expression.Expression)
is_sage_real = lambda x: isi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 0 |
2d9d4e84698d3d2c0c263817fbcf9fb9d2d85765 | 142 | py | Python | src/skdh/io/_extensions/__init__.py | PfizerRD/scikit-digital-health | f834a82d750d9e3cdd35f4f5692a0a388210b821 | [
"MIT"
] | 1 | 2022-03-31T20:56:49.000Z | 2022-03-31T20:56:49.000Z | src/skdh/io/_extensions/__init__.py | PfizerRD/scikit-digital-health | f834a82d750d9e3cdd35f4f5692a0a388210b821 | [
"MIT"
] | null | null | null | src/skdh/io/_extensions/__init__.py | PfizerRD/scikit-digital-health | f834a82d750d9e3cdd35f4f5692a0a388210b821 | [
"MIT"
] | null | null | null | from .read import read_axivity, read_geneactiv
from .gt3x_convert import read_gt3x
__all__ = ("read_axivity", "read_geneactiv", "read_gt3x")
| 28.4 | 57 | 0.795775 | from .read import read_axivity, read_geneactiv
from .gt3x_convert import read_gt3x
__all__ = ("read_axivity", "read_geneactiv", "read_gt3x")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
52f5eda8651e076c601fe495f7f73ef9cf7c5ced | 3,552 | py | Python | reports/migrations/0001_initial.py | CMU-TRP/podd-api | 6eb5c4598f848f75d131287163cd9babf2a0a0fc | [
"MIT"
] | 3 | 2020-04-26T06:28:50.000Z | 2021-04-05T08:02:26.000Z | reports/migrations/0001_initial.py | CMU-TRP/podd-api | 6eb5c4598f848f75d131287163cd9babf2a0a0fc | [
"MIT"
] | 10 | 2020-06-05T17:36:10.000Z | 2022-03-11T23:16:42.000Z | reports/migrations/0001_initial.py | CMU-TRP/podd-api | 6eb5c4598f848f75d131287163cd9babf2a0a0fc | [
"MIT"
] | 5 | 2021-04-08T08:43:49.000Z | 2021-11-27T06:36:46.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 39.466667 | 114 | 0.546734 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... | 0 | 0 | 0 | 3,346 | 0 | 0 | 0 | 51 | 90 |
e1dfe9ea6751bada26fc5b052be6b8b9471c1399 | 1,203 | py | Python | project_template/{{cookiecutter.app_name}}/setup.py | pvandyken/snakebids | 10186d116dc016769e6b43c67f10e0d50264d053 | [
"MIT"
] | null | null | null | project_template/{{cookiecutter.app_name}}/setup.py | pvandyken/snakebids | 10186d116dc016769e6b43c67f10e0d50264d053 | [
"MIT"
] | null | null | null | project_template/{{cookiecutter.app_name}}/setup.py | pvandyken/snakebids | 10186d116dc016769e6b43c67f10e0d50264d053 | [
"MIT"
] | null | null | null | import setuptools
import json
with open("README.rst", "r") as fh:
long_description = fh.read()
with open('pipeline_description.json', 'r') as fh:
pipeline = json.load(fh)
name = pipeline['GeneratedBy'][0]['Name']
description = pipeline['Name']
version = pipeline['GeneratedBy'][0]['Version']
ur... | 29.341463 | 70 | 0.654198 | import setuptools
import json
with open("README.rst", "r") as fh:
long_description = fh.read()
with open('pipeline_description.json', 'r') as fh:
pipeline = json.load(fh)
name = pipeline['GeneratedBy'][0]['Name']
description = pipeline['Name']
version = pipeline['GeneratedBy'][0]['Version']
ur... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8e6325079667283a268285f4f7694919da11f536 | 7,332 | py | Python | yales2/droplet-AMR-opt/pymooCFD/util/handleData.py | gmclove/pymoo-CFD | fd4a7b1335db33b467fe975ec804f4b055de407c | [
"Apache-2.0"
] | null | null | null | yales2/droplet-AMR-opt/pymooCFD/util/handleData.py | gmclove/pymoo-CFD | fd4a7b1335db33b467fe975ec804f4b055de407c | [
"Apache-2.0"
] | null | null | null | yales2/droplet-AMR-opt/pymooCFD/util/handleData.py | gmclove/pymoo-CFD | fd4a7b1335db33b467fe975ec804f4b055de407c | [
"Apache-2.0"
] | null | null | null |
# def getGen(checkpointFile=checkpointFile):
# try:
# loadCP(checkpointFile=checkpointFile)
# except FileNotFoundError as err:
# print(err)
# return 0
# def popGen(gen, checkpointFile=checkpointFile):
# '''
# Parameters
# ----------
# gen : int
# gen... | 30.677824 | 88 | 0.635161 | from pymooCFD.setupOpt import checkpointFile, dataDir, nCP, archDir, \
preProcDir, cluster
from pymooCFD.util.sysTools import removeDir #, makeDir, emptyDir
from pymooCFD.setupCFD import runCase
import numpy as np
import time
import os
import tarfile
from dask.distributed import Client
from sys import exit
# d... | 0 | 0 | 0 | 0 | 0 | 3,029 | 0 | 93 | 405 |
86b03430e41a966ea5e3eaf883b62becfb48eb41 | 409 | py | Python | _bak/more/test1.py | hello-sea/DeepLearning_Wavelet-LSTM | 1606c16005a5338333b4943f782f57311c6b5e49 | [
"MIT"
] | 95 | 2018-04-13T03:34:51.000Z | 2022-03-30T10:10:28.000Z | _bak/more/test1.py | Dlaiven/DeepLearning_Wavelet-LSTM | 1606c16005a5338333b4943f782f57311c6b5e49 | [
"MIT"
] | 3 | 2019-07-18T11:19:53.000Z | 2020-12-28T05:45:19.000Z | _bak/more/test1.py | Dlaiven/DeepLearning_Wavelet-LSTM | 1606c16005a5338333b4943f782f57311c6b5e49 | [
"MIT"
] | 35 | 2018-07-27T09:21:18.000Z | 2021-11-30T02:13:01.000Z | from scipy import signal
import matplotlib.pyplot as plt
import numpy as np
t = np.linspace(1, 201, 200, endpoint=False)
sig = np.cos(2 * np.pi * 7 * t) + signal.gausspulse(t - 0.4, fc=2)
widths = np.arange(1, 31)
cwtmatr = signal.cwt(sig, signal.ricker, widths)
plt.imshow(cwtmatr, extent=[1, 201, 31, 1], cmap='PRGn'... | 34.083333 | 71 | 0.667482 | from scipy import signal
import matplotlib.pyplot as plt
import numpy as np
t = np.linspace(1, 201, 200, endpoint=False)
sig = np.cos(2 * np.pi * 7 * t) + signal.gausspulse(t - 0.4, fc=2)
widths = np.arange(1, 31)
cwtmatr = signal.cwt(sig, signal.ricker, widths)
plt.imshow(cwtmatr, extent=[1, 201, 31, 1], cmap='PRGn'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
46a9510d72ae38ad38081220dacac06a010d2c9c | 124 | py | Python | nicos_mlz/toftof/setups/startup.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/toftof/setups/startup.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/toftof/setups/startup.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'minimal NICOS startup setup'
group = 'lowlevel'
sysconfig = dict(
cache = 'tofhw.toftof.frm2:14869',
)
| 15.5 | 43 | 0.693548 | description = 'minimal NICOS startup setup'
group = 'lowlevel'
sysconfig = dict(
cache = 'tofhw.toftof.frm2:14869',
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86f60d4ac6c228fc43e7b01916beec33a223dbf4 | 2,449 | py | Python | lab01/guessing_game_graph.py | ryandroll/CS61A_Practice | 01c955e670929be21fa0a085b935d1a43451f083 | [
"Apache-2.0"
] | null | null | null | lab01/guessing_game_graph.py | ryandroll/CS61A_Practice | 01c955e670929be21fa0a085b935d1a43451f083 | [
"Apache-2.0"
] | null | null | null | lab01/guessing_game_graph.py | ryandroll/CS61A_Practice | 01c955e670929be21fa0a085b935d1a43451f083 | [
"Apache-2.0"
] | null | null | null | """Guessing Game Visualization
You do not need to understand any of the code in this file.
"""
# This section avoids asking for user input.
import lab01
lab01.LOWER = 1
lab01.UPPER = 100
lab01.prompt_for_number = prompt_for_number
lab01.is_correct = is_correct
lab01.is_too_high = is_too_high
# This section runs an ... | 37.106061 | 197 | 0.683953 | """Guessing Game Visualization
You do not need to understand any of the code in this file.
"""
# This section avoids asking for user input.
def prompt_for_number(lower, upper):
from random import randint
prompt_for_number.number = randint(lower, upper)
return prompt_for_number.number
def is_correct(gues... | 0 | 0 | 0 | 0 | 0 | 227 | 0 | 0 | 69 |
2df6888285e22ed0f6b1ee4a5e5e52074a12b373 | 680 | py | Python | src/digolds/manipulate/drop_column.py | digolds/dp | 305089cbd2e933a0fff4d044485d591b6a2f3349 | [
"MIT"
] | null | null | null | src/digolds/manipulate/drop_column.py | digolds/dp | 305089cbd2e933a0fff4d044485d591b6a2f3349 | [
"MIT"
] | null | null | null | src/digolds/manipulate/drop_column.py | digolds/dp | 305089cbd2e933a0fff4d044485d591b6a2f3349 | [
"MIT"
] | null | null | null | import pandas as pd
name = 'drop-column'
if __name__ == "__main__":
data = [['tom', 10], ['nick', 15], ['juli', 15]]
df = pd.DataFrame(data, columns = ['Name', 'Age'])
args = {
'--columns':[
'Age',
'Name'
]
}
operator(df, args) | 22.666667 | 64 | 0.567647 | import pandas as pd
def _parse(args):
columns = args.get('--columns')
remain = args.get('--remain', False)
return [columns, remain]
def _drop_column(df, columns, remain):
if remain:
return df.filter(columns, axis=1).reset_index(drop=True)
else:
return df.drop(columns, axis=1).reset... | 0 | 0 | 0 | 0 | 0 | 317 | 0 | 0 | 69 |
14d91785c4e47c8abaef5e5e52cdeb6c231349a9 | 422 | py | Python | sample_webapp/migrations/0003_foo_geojson.py | calocan/rescape_graphene | 20b35e7f7020470da7958e9beb1d10b82e1e20cd | [
"MIT"
] | 1 | 2021-05-08T12:04:54.000Z | 2021-05-08T12:04:54.000Z | sample_webapp/migrations/0003_foo_geojson.py | calocan/rescape_graphene | 20b35e7f7020470da7958e9beb1d10b82e1e20cd | [
"MIT"
] | 6 | 2021-04-08T18:27:30.000Z | 2022-02-10T10:30:50.000Z | sample_webapp/migrations/0003_foo_geojson.py | rescapes/rescape-graphene | 90ac2002636aa9700d5ea459d6aa0699487379f7 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-11-02 22:15
| 22.210526 | 53 | 0.599526 | # Generated by Django 2.0.7 on 2018-11-02 22:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sample_webapp', '0002_foo_geo_collection'),
]
operations = [
migrations.AddField(
model_name='foo',
name='geojson',
... | 0 | 0 | 0 | 309 | 0 | 0 | 0 | 19 | 46 |
cc976d628e959da54d922c002f02bd4799ee0d6e | 6,751 | py | Python | model/resnet.py | collector-m/UniTrack | e8e56e164f2dd40ba590a19ed7a4a75d8da7e2eb | [
"MIT"
] | 240 | 2021-06-20T13:50:42.000Z | 2022-03-31T05:08:29.000Z | model/resnet.py | collector-m/UniTrack | e8e56e164f2dd40ba590a19ed7a4a75d8da7e2eb | [
"MIT"
] | 27 | 2021-07-12T01:19:39.000Z | 2021-12-27T08:05:08.000Z | model/resnet.py | collector-m/UniTrack | e8e56e164f2dd40ba590a19ed7a4a75d8da7e2eb | [
"MIT"
] | 24 | 2021-07-01T09:48:24.000Z | 2022-03-14T06:39:46.000Z | import torch.nn as nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torchvision.models.resnet import Bottleneck
model_urls = {'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',
'res... | 42.727848 | 107 | 0.654273 | import torch
import torch.nn as nn
import torch.nn.functional as F
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
import torchvision.models.resnet as torch_resnet
from torchvision.models.resnet import BasicBlock, Bo... | 0 | 0 | 0 | 1,581 | 0 | 738 | 0 | 89 | 216 |
f71fb300004e91ff987107bb558165bb8d7b340e | 14,538 | py | Python | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | from sqlalchemy import sql
metadatas = {}
########################################################################
for col_type in [dt, delta, num, bool_]:
col_type._storage_target_registry['sqlalchemy'] = col_type._storage_target_registry['pandas'].copy()
#######################################################... | 35.896296 | 155 | 0.623882 | import pandas
from ..schema.schema_base import *
from .datastore_base import DataStore
from .odo_datastore import OdoDataStore
from ..config import config
from functools import lru_cache, partial
from sqlalchemy import Table, MetaData, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.automap import ... | 0 | 1,373 | 0 | 7,132 | 0 | 4,215 | 0 | 137 | 952 |
f772e5b4a86ee9267ab9234ff8197c72c91ef62a | 16,056 | py | Python | models/RelationNetworks/relation_rcnn/core/rcnn.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | models/RelationNetworks/relation_rcnn/core/rcnn.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | models/RelationNetworks/relation_rcnn/core/rcnn.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | """
Fast R-CNN:
data =
{'data': [num_images, c, h, w],
'rois': [num_rois, 5]}
label =
{'label': [num_rois],
'bbox_target': [num_rois, 4 * num_classes],
'bbox_weight': [num_rois, 4 * num_classes]}
roidb extended format [image_index]
['image', 'height', 'width', 'flipped',
'boxes', 'gt_classe... | 41.921671 | 115 | 0.607686 | """
Fast R-CNN:
data =
{'data': [num_images, c, h, w],
'rois': [num_rois, 5]}
label =
{'label': [num_rois],
'bbox_target': [num_rois, 4 * num_classes],
'bbox_weight': [num_rois, 4 * num_classes]}
roidb extended format [image_index]
['image', 'height', 'width', 'flipped',
'boxes', 'gt_classe... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7cbfc364b8c5913e09428b8051b575c6d9ddf730 | 1,177 | py | Python | tests/medium/plugins/test_file_output.py | hyacker/eventgen | 2d33536e5b830b4bccb620b5239f25609c647c1a | [
"Apache-2.0"
] | null | null | null | tests/medium/plugins/test_file_output.py | hyacker/eventgen | 2d33536e5b830b4bccb620b5239f25609c647c1a | [
"Apache-2.0"
] | null | null | null | tests/medium/plugins/test_file_output.py | hyacker/eventgen | 2d33536e5b830b4bccb620b5239f25609c647c1a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
import os
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
| 30.179487 | 111 | 0.654206 | #!/usr/bin/env python
# encoding: utf-8
import os
import sys
from mock import MagicMock, patch
from splunk_eventgen.__main__ import parse_args
from splunk_eventgen.eventgen_core import EventGenerator
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
class TestFileOutputPlugin(object):
def test_output_data_... | 0 | 0 | 0 | 893 | 0 | 0 | 0 | 62 | 112 |
e8caf316aff1c240c2bd8b5750f5fa64ff151a5c | 994 | py | Python | documentstore_migracao/utils/files.py | robertatakenaka/document-store-migracao | 54e8dc279b336f40a772e204de3142a7bb715382 | [
"BSD-2-Clause"
] | null | null | null | documentstore_migracao/utils/files.py | robertatakenaka/document-store-migracao | 54e8dc279b336f40a772e204de3142a7bb715382 | [
"BSD-2-Clause"
] | null | null | null | documentstore_migracao/utils/files.py | robertatakenaka/document-store-migracao | 54e8dc279b336f40a772e204de3142a7bb715382 | [
"BSD-2-Clause"
] | null | null | null | """ module to utils methods to file """
import logging
logger = logging.getLogger(__name__)
| 19.88 | 70 | 0.65493 | """ module to utils methods to file """
import os
import shutil
import logging
from documentstore_migracao import config
logger = logging.getLogger(__name__)
def setup_processing_folder():
paths = config.INITIAL_PATH
for path in paths:
if not os.path.exists(path):
logger.debug("Criando... | 0 | 0 | 0 | 0 | 0 | 713 | 0 | 0 | 183 |
340dfb07bbad6b3d413744279dd2ff9f7f8e7bd0 | 1,059 | py | Python | docs/reST/ext/customversion.py | czogran/pygame1 | 1591a3295402f914950ae15039b91136d8bf8f79 | [
"Python-2.0",
"OLDAP-2.3"
] | 2 | 2021-04-03T20:01:35.000Z | 2021-09-09T23:42:21.000Z | docs/reST/ext/customversion.py | czogran/pygame1 | 1591a3295402f914950ae15039b91136d8bf8f79 | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | docs/reST/ext/customversion.py | czogran/pygame1 | 1591a3295402f914950ae15039b91136d8bf8f79 | [
"Python-2.0",
"OLDAP-2.3"
] | 1 | 2021-06-06T17:52:54.000Z | 2021-06-06T17:52:54.000Z |
try:
except ImportError:
# versionlabel_classes doesn't exist in old Sphinx versions.
UPDATE_VERIONLABEL_CLASSES = False
else:
UPDATE_VERIONLABEL_CLASSES = True
labels = ('versionadded', 'versionchanged', 'deprecated', 'versionextended')
| 32.090909 | 89 | 0.734655 | from sphinx.domains.changeset import versionlabels, VersionChange
from sphinx.locale import _ # just to suppress warnings
try:
from sphinx.domains.changeset import versionlabel_classes
except ImportError:
# versionlabel_classes doesn't exist in old Sphinx versions.
UPDATE_VERIONLABEL_CLASSES = False
else:
... | 0 | 0 | 0 | 0 | 0 | 574 | 0 | 86 | 144 |