hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7488f48db402ab8dbabded977cf5159c7604250 | 14,044 | py | Python | stravaio.py | tylerdave/stravaio | a2de2ef68ef59b906d53e6f3086ff10ffba4f507 | [
"MIT"
] | null | null | null | stravaio.py | tylerdave/stravaio | a2de2ef68ef59b906d53e6f3086ff10ffba4f507 | [
"MIT"
] | null | null | null | stravaio.py | tylerdave/stravaio | a2de2ef68ef59b906d53e6f3086ff10ffba4f507 | [
"MIT"
] | null | null | null | import swagger_client
from swagger_client.rest import ApiException
import maya
import os
import json
import datetime
import pandas as pd
import glob
import datetime
from loguru import logger
import requests
import socket
import urllib
import webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
class ... | 31.278396 | 153 | 0.606665 | import swagger_client
from swagger_client.rest import ApiException
import maya
import os
import json
import datetime
import pandas as pd
import glob
import datetime
from loguru import logger
import requests
import socket
import urllib
import webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
class ... | true | true |
f7489053b0573720ad934703fc10aeac9eabce70 | 2,760 | py | Python | cibyl/outputs/cli/ci/env/impl/colored.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 3 | 2022-02-17T18:07:07.000Z | 2022-03-19T10:22:38.000Z | cibyl/outputs/cli/ci/env/impl/colored.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 58 | 2022-02-14T14:41:22.000Z | 2022-03-31T10:54:28.000Z | cibyl/outputs/cli/ci/env/impl/colored.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 6 | 2022-02-14T19:21:26.000Z | 2022-03-29T09:31:31.000Z | """
# Copyright 2022 Red Hat
#
# 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 agr... | 32.857143 | 78 | 0.659058 | import logging
from overrides import overrides
from cibyl.models.ci.base.system import JobsSystem
from cibyl.models.ci.zuul.system import ZuulSystem
from cibyl.outputs.cli.ci.env.printer import CIPrinter
from cibyl.outputs.cli.ci.system.impls.base.colored import \
ColoredBaseSystemPrinter
from cibyl.outputs.cli.c... | true | true |
f74890ad858ef6e45b6830eb12c77c43cc9801c6 | 1,725 | py | Python | dev/gaussian_beam.py | JoshKarpel/simulacra | e5770ced1bef860caec25ce8c77a61ff0bb78907 | [
"MIT"
] | 1 | 2018-05-24T08:01:26.000Z | 2018-05-24T08:01:26.000Z | dev/gaussian_beam.py | JoshKarpel/simulacra | e5770ced1bef860caec25ce8c77a61ff0bb78907 | [
"MIT"
] | 1 | 2019-10-08T21:03:46.000Z | 2019-10-08T21:03:46.000Z | dev/gaussian_beam.py | JoshKarpel/simulacra | e5770ced1bef860caec25ce8c77a61ff0bb78907 | [
"MIT"
] | 2 | 2017-07-03T18:33:16.000Z | 2018-10-16T01:52:57.000Z | import logging
from pathlib import Path
import numpy as np
import simulacra as si
import simulacra.units as u
import matplotlib.pyplot as plt
FILE_NAME = Path(__file__).stem
OUT_DIR = Path(__file__).parent / "out" / FILE_NAME
def w(z, w_0, z_0):
return w_0 * np.sqrt(1 + ((z / z_0) ** 2))
def R(z, z_0):
... | 23.958333 | 139 | 0.541449 | import logging
from pathlib import Path
import numpy as np
import simulacra as si
import simulacra.units as u
import matplotlib.pyplot as plt
FILE_NAME = Path(__file__).stem
OUT_DIR = Path(__file__).parent / "out" / FILE_NAME
def w(z, w_0, z_0):
return w_0 * np.sqrt(1 + ((z / z_0) ** 2))
def R(z, z_0):
... | true | true |
f748914f195acab8ecdb143911025bd5b4fdb4cc | 5,171 | py | Python | app.py | obfrap/sqlalchemy-challenge | 54dd0a62c7bf05012e48307fc2799abcc2dde30a | [
"Apache-2.0"
] | null | null | null | app.py | obfrap/sqlalchemy-challenge | 54dd0a62c7bf05012e48307fc2799abcc2dde30a | [
"Apache-2.0"
] | null | null | null | app.py | obfrap/sqlalchemy-challenge | 54dd0a62c7bf05012e48307fc2799abcc2dde30a | [
"Apache-2.0"
] | null | null | null | #matplotlib inline
from matplotlib import style
style.use('fivethirtyeight')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from ... | 30.964072 | 236 | 0.652678 |
from matplotlib import style
style.use('fivethirtyeight')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from sqlalchemy import ... | true | true |
f748924b3f9e688752476f1123cd6605b4994b08 | 32,926 | py | Python | env/channel_pruning_env.py | lightconeWJA/amc_with_annotation | 3fadc69944e7e6692c37949309ab03e37d2e30a2 | [
"MIT"
] | null | null | null | env/channel_pruning_env.py | lightconeWJA/amc_with_annotation | 3fadc69944e7e6692c37949309ab03e37d2e30a2 | [
"MIT"
] | null | null | null | env/channel_pruning_env.py | lightconeWJA/amc_with_annotation | 3fadc69944e7e6692c37949309ab03e37d2e30a2 | [
"MIT"
] | null | null | null | # Code for "AMC: AutoML for Model Compression and Acceleration on Mobile Devices"
# Yihui He*, Ji Lin*, Zhijian Liu, Hanrui Wang, Li-Jia Li, Song Han
# {jilin, songhan}@mit.edu
import time
import torch
import torch.nn as nn
from lib.utils import AverageMeter, accuracy, prGreen
from lib.data import get_split_dataset
fr... | 43.437995 | 127 | 0.571646 |
import time
import torch
import torch.nn as nn
from lib.utils import AverageMeter, accuracy, prGreen
from lib.data import get_split_dataset
from env.rewards import *
import math
import numpy as np
import copy
class ChannelPruningEnv:
def __init__(self, model, checkpoint, data, preserve_ratio, args, n_data_wo... | true | true |
f7489431896dabb7f30995c58d9ddf04aee363c1 | 770 | py | Python | py2/config/config.py | ti-ginkgo/Severstal | 57f37dc61cfd910b575afa7dc51094c94e3511c0 | [
"MIT"
] | 2 | 2020-01-08T02:58:18.000Z | 2020-01-28T16:42:00.000Z | py2/config/config.py | ti-ginkgo/Severstal | 57f37dc61cfd910b575afa7dc51094c94e3511c0 | [
"MIT"
] | null | null | null | py2/config/config.py | ti-ginkgo/Severstal | 57f37dc61cfd910b575afa7dc51094c94e3511c0 | [
"MIT"
] | null | null | null | # TODO: change
import os
ope = os.path.exists
import numpy as np
import socket
import warnings
warnings.filterwarnings('ignore')
sk = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
hostname = socket.gethostname()
print('run on %s' % hostname)
RESULT_DIR = '../output/result'
DATA_DIR = '../input'
PRETRAINED_DIR = '... | 22.647059 | 72 | 0.697403 |
import os
ope = os.path.exists
import numpy as np
import socket
import warnings
warnings.filterwarnings('ignore')
sk = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
hostname = socket.gethostname()
print('run on %s' % hostname)
RESULT_DIR = '../output/result'
DATA_DIR = '../input'
PRETRAINED_DIR = '../input/pretr... | true | true |
f7489625a9a8851fc70211fc9d772bb642396c22 | 2,774 | py | Python | source/conf.py | luhuadong/rtt-ptqs100x | ea68566ad8044cc753cfe1de81de4cae1ac15006 | [
"Apache-2.0"
] | 2 | 2020-12-05T10:24:37.000Z | 2021-03-16T13:27:24.000Z | source/conf.py | luhuadong/rtt-ptqs100x | ea68566ad8044cc753cfe1de81de4cae1ac15006 | [
"Apache-2.0"
] | null | null | null | source/conf.py | luhuadong/rtt-ptqs100x | ea68566ad8044cc753cfe1de81de4cae1ac15006 | [
"Apache-2.0"
] | 1 | 2020-12-05T10:24:50.000Z | 2020-12-05T10:24:50.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 31.168539 | 79 | 0.678443 |
project = '《未来城入住指南》'
copyright = '2020, luhuadong'
author = 'luhuadong'
release = 'v1.0'
master_doc = 'index'
extensions = [
'recommonmark',
'sphinx_markdown_tables',
'sphinxemoji.sphinxemoji'
]
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
templ... | true | true |
f748969a3893b8d1317621ccb2f48bf92fc504d0 | 1,941 | py | Python | utils/emailConfig/email_config.py | wdangelo/file-collector-afd | 068078c5dc224f86035da0fefb75e09745255023 | [
"MIT"
] | 1 | 2021-12-08T13:58:55.000Z | 2021-12-08T13:58:55.000Z | utils/emailConfig/email_config.py | wdangelo/file-collector-afd | 068078c5dc224f86035da0fefb75e09745255023 | [
"MIT"
] | null | null | null | utils/emailConfig/email_config.py | wdangelo/file-collector-afd | 068078c5dc224f86035da0fefb75e09745255023 | [
"MIT"
] | null | null | null | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
from datetime import datetime
def sending(message):
date_hour_now = datetime.now()
date_hour_now_format = date_hour_now.strftime(f" data: %d/%m... | 34.052632 | 94 | 0.652241 | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
from datetime import datetime
def sending(message):
date_hour_now = datetime.now()
date_hour_now_format = date_hour_now.strftime(f" data: %d/%m... | true | true |
f74896cfd588770981204c8862a8490847ba00b9 | 7,835 | py | Python | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/process_dialogs.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | 1 | 2021-01-17T06:21:36.000Z | 2021-01-17T06:21:36.000Z | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/process_dialogs.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | 2 | 2021-01-17T12:57:37.000Z | 2021-02-08T02:16:45.000Z | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/process_dialogs.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | null | null | null | import string
import types
from module_info import *
from module_triggers import *
from module_dialogs import *
from process_common import *
from process_operations import *
speaker_pos = 0
ipt_token_pos = 1
sentence_conditions_pos = 2
text_pos = 3
opt_token_pos = 4
sentence_consequences_pos = 5
se... | 37.850242 | 251 | 0.655648 | import string
import types
from module_info import *
from module_triggers import *
from module_dialogs import *
from process_common import *
from process_operations import *
speaker_pos = 0
ipt_token_pos = 1
sentence_conditions_pos = 2
text_pos = 3
opt_token_pos = 4
sentence_consequences_pos = 5
se... | false | true |
f74897b63e73b411a9dd6129ab9cd03095e5be20 | 8,734 | py | Python | tardis/adapters/batchsystems/htcondor.py | wiene/tardis | 60d00ae8a6adc720903632ef823941418210ccd7 | [
"MIT"
] | null | null | null | tardis/adapters/batchsystems/htcondor.py | wiene/tardis | 60d00ae8a6adc720903632ef823941418210ccd7 | [
"MIT"
] | null | null | null | tardis/adapters/batchsystems/htcondor.py | wiene/tardis | 60d00ae8a6adc720903632ef823941418210ccd7 | [
"MIT"
] | null | null | null | from ...configuration.configuration import Configuration
from ...exceptions.executorexceptions import CommandExecutionFailure
from ...interfaces.batchsystemadapter import BatchSystemAdapter
from ...interfaces.batchsystemadapter import MachineStatus
from ...utilities.utils import async_run_command
from ...utilities.util... | 37.008475 | 107 | 0.639341 | from ...configuration.configuration import Configuration
from ...exceptions.executorexceptions import CommandExecutionFailure
from ...interfaces.batchsystemadapter import BatchSystemAdapter
from ...interfaces.batchsystemadapter import MachineStatus
from ...utilities.utils import async_run_command
from ...utilities.util... | true | true |
f74897e3a1afdc2c2b9a8e9210243f4667b15bee | 6,606 | py | Python | simulation/utils/machine_learning/cycle_gan/models/cycle_gan_model.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | null | null | null | simulation/utils/machine_learning/cycle_gan/models/cycle_gan_model.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | null | null | null | simulation/utils/machine_learning/cycle_gan/models/cycle_gan_model.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | null | null | null | import torch
from torch import Tensor, nn
from torch.nn.functional import mse_loss
from simulation.utils.machine_learning.data.image_pool import ImagePool
from simulation.utils.machine_learning.models.helper import set_requires_grad
from .base_model import BaseModel
from .cycle_gan_stats import CycleGANStats
class ... | 34.768421 | 92 | 0.597639 | import torch
from torch import Tensor, nn
from torch.nn.functional import mse_loss
from simulation.utils.machine_learning.data.image_pool import ImagePool
from simulation.utils.machine_learning.models.helper import set_requires_grad
from .base_model import BaseModel
from .cycle_gan_stats import CycleGANStats
class ... | true | true |
f7489904f6ccc3d6835d16af01bcf69de8db76be | 5,588 | py | Python | netket/driver/steady_state.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | 352 | 2018-04-24T16:45:10.000Z | 2022-03-31T01:15:34.000Z | netket/driver/steady_state.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | 947 | 2018-04-24T20:16:17.000Z | 2022-03-31T17:33:52.000Z | netket/driver/steady_state.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | 148 | 2018-04-25T02:44:20.000Z | 2022-03-11T11:42:34.000Z | # Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34.282209 | 134 | 0.596457 |
import jax
import jax.numpy as jnp
from netket.operator import Squared, AbstractSuperOperator
from netket.vqs import MCMixedState
from netket.utils import warn_deprecation
from netket.optimizer import (
identity_preconditioner,
PreconditionerT,
)
from .vmc_common import info
from .abstract_varia... | true | true |
f7489a2d5e6660a985174858bdca25641c9aa3b3 | 1,195 | py | Python | Sticky-Notes/markdown_functionality.py | v2thegreat/sticky-notes | e79dd10b8fb88e0195ac1ca90d6b8dcb0f56e002 | [
"Apache-2.0"
] | null | null | null | Sticky-Notes/markdown_functionality.py | v2thegreat/sticky-notes | e79dd10b8fb88e0195ac1ca90d6b8dcb0f56e002 | [
"Apache-2.0"
] | null | null | null | Sticky-Notes/markdown_functionality.py | v2thegreat/sticky-notes | e79dd10b8fb88e0195ac1ca90d6b8dcb0f56e002 | [
"Apache-2.0"
] | null | null | null | from os import startfile
from base_functions import base_functions
from markdown import markdownFromFile
class markdown_functionality(base_functions):
"""Seperate Class to hold markdown methods"""
def __init__(self):
super(markdown_functionality, self).__init__()
def compileAndDisplayMarkdown(self, label_index)... | 28.452381 | 134 | 0.779916 | from os import startfile
from base_functions import base_functions
from markdown import markdownFromFile
class markdown_functionality(base_functions):
def __init__(self):
super(markdown_functionality, self).__init__()
def compileAndDisplayMarkdown(self, label_index):
self._compileMarkDownFile(label_index)
se... | true | true |
f7489bf7ca70b7bafc39b779ab6c3d3b3d0e4c27 | 13,436 | py | Python | server/vcr-server/vcr_server/settings.py | crubn/aries-vcr | 403da51a1b758918c8f30f48290d989f65982910 | [
"Apache-2.0"
] | null | null | null | server/vcr-server/vcr_server/settings.py | crubn/aries-vcr | 403da51a1b758918c8f30f48290d989f65982910 | [
"Apache-2.0"
] | null | null | null | server/vcr-server/vcr_server/settings.py | crubn/aries-vcr | 403da51a1b758918c8f30f48290d989f65982910 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 1.9.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/setting... | 31.688679 | 109 | 0.689119 |
import os
import os.path
from pathlib import Path
from snowplow_tracker import Subject, Tracker, AsyncEmitter
from . import authentication, permissions
try:
from . import database
except:
import database
try:
from . import haystack
except:
import haystack
def parse_bool(val):
return val and ... | true | true |
f7489c8de454c96fb4f0c99822269a63283cfce4 | 2,588 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyAlertContactRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyAlertContactRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyAlertContactRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may ... | 35.452055 | 82 | 0.765842 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkemr.endpoint import endpoint_data
class ModifyAlertContactRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Emr', '2016-04-08', 'ModifyAlertContact','emr')
if hasattr(self, "endpoint_map"):
setattr(self, "e... | true | true |
f748a056cf0f8d9687219f34409a9739215aa508 | 1,125 | py | Python | arucoloc/test-aruco-search.py | obo/loev3go | 763c6cf61133add914d231d07bc8c3c29672aba9 | [
"MIT"
] | 1 | 2018-09-05T20:57:40.000Z | 2018-09-05T20:57:40.000Z | arucoloc/test-aruco-search.py | obo/loev3go | 763c6cf61133add914d231d07bc8c3c29672aba9 | [
"MIT"
] | null | null | null | arucoloc/test-aruco-search.py | obo/loev3go | 763c6cf61133add914d231d07bc8c3c29672aba9 | [
"MIT"
] | 2 | 2019-10-05T23:02:41.000Z | 2020-06-25T20:21:02.000Z | #!/usr/bin/env python2
# From: https://gist.github.com/hauptmech/6b8ca2c05a3d935c97b1c75ec9ad85ff
# Needs to install: sudo pip2 install opencv-contrib-python
# Runs video capture and locates aruco markers from the given dictionary.
import numpy as np
import cv2
cap = cv2.VideoCapture(1)
#dictionary = cv2.aruco.getPre... | 32.142857 | 78 | 0.739556 |
import numpy as np
import cv2
cap = cv2.VideoCapture(1)
dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_6X6_250)
while(True):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
res = cv2.aruco.detectMarkers(gray,dictionary)
if len(res[0]) > 0:
... | true | true |
f748a2120a3ad41564019a8239df63c253827008 | 3,254 | py | Python | duplyaml/yconst.py | peterkmurphy/duplyaml | 7ce59cacb4ea04c6b12c6abb27a3e1eec2cca0cf | [
"MIT"
] | null | null | null | duplyaml/yconst.py | peterkmurphy/duplyaml | 7ce59cacb4ea04c6b12c6abb27a3e1eec2cca0cf | [
"MIT"
] | null | null | null | duplyaml/yconst.py | peterkmurphy/duplyaml | 7ce59cacb4ea04c6b12c6abb27a3e1eec2cca0cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The duplyaml YAML processor.
# The yconst.py file.
# Common constants used in YAML.
# First, get the Python version
import sys
PY_VER = sys.version
# These are the constants used to define the Node kinds used with YAML nodes
YAMLNODE_DEF = 0 # Used with the YAMLNode ... | 32.54 | 87 | 0.71051 |
import sys
PY_VER = sys.version
YAMLNODE_DEF = 0
YAMLNODE_SCA = 1
YAMLNODE_SEQ = 2
YAMLNODE_MAP = 3
YAMLMAP_STATUS_KEYREADY = 0
YAMLMAP_STATUS_VALREADY = 1
YAML_NAME_PREFIX = "tag:yaml.org,2002:"
C_SECONDARY_TAG_HANDLE = "!!"
TAG_MAP = "!!map"
TAG_OMAP = "!!omap"
TAG_PAIRS = "!!pairs"
TAG... | true | true |
f748a3a0c6400faa531ec4b771be2573bfd6af4e | 186 | py | Python | student/urls.py | mr-bhuvaneswaran/cms-backend | 74100f3db018ae87564bd1bb7e9887031349f5c7 | [
"MIT"
] | null | null | null | student/urls.py | mr-bhuvaneswaran/cms-backend | 74100f3db018ae87564bd1bb7e9887031349f5c7 | [
"MIT"
] | null | null | null | student/urls.py | mr-bhuvaneswaran/cms-backend | 74100f3db018ae87564bd1bb7e9887031349f5c7 | [
"MIT"
] | null | null | null | from django.conf.urls import url,include
from rest_framework import routers
# router = routers.SimpleRouter()
# router.register(r'^profile/$' ,ProfileView.as_view(),base_name='profile') | 37.2 | 75 | 0.784946 | from django.conf.urls import url,include
from rest_framework import routers
| true | true |
f748a42f6e30f5675e0a5a2d00ae0e3afc5fc379 | 141 | py | Python | streaming/app/config.py | Ingimarsson/gatekeeper | 799031a8c7267866b52ec5fb3b1cd14a7869ce94 | [
"MIT"
] | null | null | null | streaming/app/config.py | Ingimarsson/gatekeeper | 799031a8c7267866b52ec5fb3b1cd14a7869ce94 | [
"MIT"
] | null | null | null | streaming/app/config.py | Ingimarsson/gatekeeper | 799031a8c7267866b52ec5fb3b1cd14a7869ce94 | [
"MIT"
] | null | null | null | import os
config = {
"MAX_LIVE_AGE": int(os.environ.get("GK_MAX_LIVE_AGE", 60)),
"DATA_PATH": os.environ.get("GK_DATA_PATH", "/data/")
} | 23.5 | 61 | 0.673759 | import os
config = {
"MAX_LIVE_AGE": int(os.environ.get("GK_MAX_LIVE_AGE", 60)),
"DATA_PATH": os.environ.get("GK_DATA_PATH", "/data/")
} | true | true |
f748a503ccb9f779ac4667653cd3f6c102e72728 | 472 | py | Python | blog/migrations/0012_post_type_food.py | GhasemMatoo/Mysite_Restaurants | f44e0b0374016850cc47f212db0d5693d6de2ee6 | [
"MIT"
] | null | null | null | blog/migrations/0012_post_type_food.py | GhasemMatoo/Mysite_Restaurants | f44e0b0374016850cc47f212db0d5693d6de2ee6 | [
"MIT"
] | null | null | null | blog/migrations/0012_post_type_food.py | GhasemMatoo/Mysite_Restaurants | f44e0b0374016850cc47f212db0d5693d6de2ee6 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.10 on 2021-12-09 14:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0011_post_tags'),
]
operations = [
migrations.AddField(
model_name='post',
name='Type_Food',
fi... | 24.842105 | 148 | 0.57839 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0011_post_tags'),
]
operations = [
migrations.AddField(
model_name='post',
name='Type_Food',
field=models.CharField(choices=[('D', 'drinks'), (... | true | true |
f748a559cc484cceaf075e6f4e67f10d3407e857 | 56,276 | py | Python | tests/test_model.py | bzaczynski/microanalyst | 915d8b3111b98a5e369dbcfe0b88c84ade9faec8 | [
"MIT"
] | 3 | 2017-06-06T18:54:28.000Z | 2021-06-11T13:06:40.000Z | tests/test_model.py | bzaczynski/microanalyst | 915d8b3111b98a5e369dbcfe0b88c84ade9faec8 | [
"MIT"
] | null | null | null | tests/test_model.py | bzaczynski/microanalyst | 915d8b3111b98a5e369dbcfe0b88c84ade9faec8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2013 Bartosz Zaczynski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the... | 28.829918 | 104 | 0.492892 |
import unittest
import numpy
from random import random
from microanalyst.model import Model
from microanalyst.model.genes import Gene
class TestFilenames(unittest.TestCase):
def test_show_full_path_by_default(self):
model = TestModel.with_filenames(
['C:\\wi... | true | true |
f748a66025da1ae3a88823d6c870dbb990637df0 | 1,258 | py | Python | decorest/HEAD.py | druid8/decorest | c9d78394f3e84828bb31d4b266ad93eb32703277 | [
"Apache-2.0"
] | null | null | null | decorest/HEAD.py | druid8/decorest | c9d78394f3e84828bb31d4b266ad93eb32703277 | [
"Apache-2.0"
] | null | null | null | decorest/HEAD.py | druid8/decorest | c9d78394f3e84828bb31d4b266ad93eb32703277 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018 Bartosz Kryza <bkryza@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 31.45 | 74 | 0.704293 |
from functools import wraps
from .decorators import HttpMethodDecorator, set_decor
from .types import HttpMethod
class HEAD(HttpMethodDecorator):
def __init__(self, path):
super(HEAD, self).__init__(path)
def __call__(self, func):
set_decor(func, 'http_method', HttpMethod.HE... | true | true |
f748a69274813fbb601c2ba537eaace5caf66344 | 3,370 | py | Python | intent_model/metrics.py | amarflybot/intent_classifier | 1a03a0809adf402157df0cd1f906bcf4d38337a8 | [
"Apache-2.0"
] | 88 | 2017-12-29T11:40:29.000Z | 2022-01-04T07:59:47.000Z | intent_model/metrics.py | deepmipt/intent_classifier | 3192644110f0ff1b032eab448ac3197ef52326a7 | [
"Apache-2.0"
] | 8 | 2018-02-11T14:14:45.000Z | 2018-12-03T02:32:21.000Z | intent_model/metrics.py | amarflybot/intent_classifier | 1a03a0809adf402157df0cd1f906bcf4d38337a8 | [
"Apache-2.0"
] | 30 | 2017-12-30T13:37:35.000Z | 2021-03-04T08:34:55.000Z | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 32.718447 | 88 | 0.674184 |
import numpy as np
from keras import backend as K
import sklearn.metrics
def precision_K(y_true, y_pred):
true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
predicted_positives = K.sum(K.round(K.clip(y_pred, 0, 1)))
precision = true_positives / (predicted_positives + K.epsilon(... | true | true |
f748a6bbbc68afe44cd78f619498ebb53dd58f5e | 516 | py | Python | components/ota/script/gen_key.py | LinusZhao/LiteOS | 361678b1eec1d5255534ab9628d11cad2edbaa61 | [
"BSD-3-Clause"
] | 4,335 | 2018-05-08T16:55:45.000Z | 2022-03-31T03:52:42.000Z | components/ota/script/gen_key.py | LinusZhao/LiteOS | 361678b1eec1d5255534ab9628d11cad2edbaa61 | [
"BSD-3-Clause"
] | 106 | 2018-05-16T11:30:54.000Z | 2021-12-27T01:50:33.000Z | components/ota/script/gen_key.py | LinusZhao/LiteOS | 361678b1eec1d5255534ab9628d11cad2edbaa61 | [
"BSD-3-Clause"
] | 1,387 | 2018-05-08T11:06:50.000Z | 2022-03-26T16:03:05.000Z | from Crypto import Random
from Crypto.PublicKey import RSA
DEFAULT_PRIAVTE_KEY_FILE_NAME = 'private_key.pem'
DEFAULT_PUBLIC_KEY_FILE_NAME = 'public_key.pem'
def main():
random_generator = Random.new().read
rsa = RSA.generate(2048, random_generator)
private_pem = rsa.exportKey()
with open(DEFAULT_PRIAVTE_KEY_FIL... | 25.8 | 52 | 0.763566 | from Crypto import Random
from Crypto.PublicKey import RSA
DEFAULT_PRIAVTE_KEY_FILE_NAME = 'private_key.pem'
DEFAULT_PUBLIC_KEY_FILE_NAME = 'public_key.pem'
def main():
random_generator = Random.new().read
rsa = RSA.generate(2048, random_generator)
private_pem = rsa.exportKey()
with open(DEFAULT_PRIAVTE_KEY_FIL... | true | true |
f748a6c8e010f96292a6873cc76d200ebb0a01fa | 894 | py | Python | slack_sdk/socket_mode/response.py | priya1puresoftware/python-slack-sdk | 3503182feaaf4d41b57fd8bf10038ebc99f1f3c7 | [
"MIT"
] | 2,486 | 2016-11-03T14:31:43.000Z | 2020-10-26T23:07:44.000Z | slack_sdk/socket_mode/response.py | priya1puresoftware/python-slack-sdk | 3503182feaaf4d41b57fd8bf10038ebc99f1f3c7 | [
"MIT"
] | 721 | 2016-11-03T21:26:56.000Z | 2020-10-26T12:41:29.000Z | slack_sdk/socket_mode/response.py | priya1puresoftware/python-slack-sdk | 3503182feaaf4d41b57fd8bf10038ebc99f1f3c7 | [
"MIT"
] | 627 | 2016-11-02T19:04:19.000Z | 2020-10-25T19:21:13.000Z | from typing import Union, Optional
from slack_sdk.models import JsonObject
class SocketModeResponse:
envelope_id: str
payload: dict
def __init__(
self, envelope_id: str, payload: Optional[Union[dict, JsonObject, str]] = None
):
self.envelope_id = envelope_id
if payload is No... | 28.83871 | 86 | 0.611857 | from typing import Union, Optional
from slack_sdk.models import JsonObject
class SocketModeResponse:
envelope_id: str
payload: dict
def __init__(
self, envelope_id: str, payload: Optional[Union[dict, JsonObject, str]] = None
):
self.envelope_id = envelope_id
if payload is No... | true | true |
f748a71df3a389820ab6ee00e7e50594678aad86 | 1,419 | py | Python | ChromaLibrary.py | devinhunsberger/PyLaunchpad | 787c4545afad4c92a3f643951492fb842e29a1a6 | [
"MIT"
] | null | null | null | ChromaLibrary.py | devinhunsberger/PyLaunchpad | 787c4545afad4c92a3f643951492fb842e29a1a6 | [
"MIT"
] | null | null | null | ChromaLibrary.py | devinhunsberger/PyLaunchpad | 787c4545afad4c92a3f643951492fb842e29a1a6 | [
"MIT"
] | null | null | null | import mido
import cv2
#Color library using dictionary from RGB to velocity value of the Launchpad MK2
from ClearLaunchpad import RemoveNotes, ClearScreen
from FirstMido import FillNotes
cap = cv2.imread("Velocity2RGB.png")
Complete = cap.copy()
while(True):
Mat = cv2.inRange(cap, (0, 0, 0), (254, 254, 254))
... | 38.351351 | 134 | 0.59549 | import mido
import cv2
from ClearLaunchpad import RemoveNotes, ClearScreen
from FirstMido import FillNotes
cap = cv2.imread("Velocity2RGB.png")
Complete = cap.copy()
while(True):
Mat = cv2.inRange(cap, (0, 0, 0), (254, 254, 254))
cv2.imshow("Mat", Mat)
contours, hierarchy = cv2.findContours(Mat, cv2.RETR... | true | true |
f748a7ad890b9579b425139f4f76ba6323f756ca | 101 | py | Python | primeiros exercicios/sucessor_antecessor.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | primeiros exercicios/sucessor_antecessor.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | primeiros exercicios/sucessor_antecessor.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | a = int(input('Digite um número: '))
print(f'O antecessor de {a} é {a-1}\nO sucessor de {a} é {a+1}') | 50.5 | 64 | 0.613861 | a = int(input('Digite um número: '))
print(f'O antecessor de {a} é {a-1}\nO sucessor de {a} é {a+1}') | true | true |
f748a883c4b24564550bc8cd98b7f8b40ee5d07f | 754 | py | Python | tests/fixture_data/build/lambdas/pre-batch/lambda_function.py | kave/cirrus-geo | cc10a6df55c5e124d87663e9c32b53b871216a62 | [
"Apache-2.0"
] | null | null | null | tests/fixture_data/build/lambdas/pre-batch/lambda_function.py | kave/cirrus-geo | cc10a6df55c5e124d87663e9c32b53b871216a62 | [
"Apache-2.0"
] | null | null | null | tests/fixture_data/build/lambdas/pre-batch/lambda_function.py | kave/cirrus-geo | cc10a6df55c5e124d87663e9c32b53b871216a62 | [
"Apache-2.0"
] | null | null | null | import uuid
from os import getenv
from boto3utils import s3
from cirruslib import Catalog, get_task_logger
# envvars
CATALOG_BUCKET = getenv('CIRRUS_CATALOG_BUCKET')
def lambda_handler(payload, context):
catalog = Catalog.from_payload(payload)
logger = get_task_logger("task.pre-batch", catalog=catalog)
... | 26 | 76 | 0.659151 | import uuid
from os import getenv
from boto3utils import s3
from cirruslib import Catalog, get_task_logger
CATALOG_BUCKET = getenv('CIRRUS_CATALOG_BUCKET')
def lambda_handler(payload, context):
catalog = Catalog.from_payload(payload)
logger = get_task_logger("task.pre-batch", catalog=catalog)
url = f"... | true | true |
f748a88d34818677c034c77d9b8b4efb63f3784f | 20,243 | py | Python | python/osmosis_proto/cosmos/bank/v1beta1/__init__.py | fabio-nukui/osmosis.proto | 4780f22681881626b853109971602a6e29a3fb69 | [
"Apache-2.0"
] | 1 | 2022-02-22T06:18:40.000Z | 2022-02-22T06:18:40.000Z | python/osmosis_proto/cosmos/bank/v1beta1/__init__.py | fabio-nukui/osmosis.proto | 4780f22681881626b853109971602a6e29a3fb69 | [
"Apache-2.0"
] | null | null | null | python/osmosis_proto/cosmos/bank/v1beta1/__init__.py | fabio-nukui/osmosis.proto | 4780f22681881626b853109971602a6e29a3fb69 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: cosmos/bank/v1beta1/bank.proto, cosmos/bank/v1beta1/genesis.proto, cosmos/bank/v1beta1/query.proto, cosmos/bank/v1beta1/tx.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict, List, Optional
import betterprot... | 32.492777 | 139 | 0.674949 |
from dataclasses import dataclass
from typing import Dict, List, Optional
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
import grpclib
@dataclass(eq=False, repr=False)
class Params(betterproto.Message):
send_enabled: List["SendEnabled"] = betterproto.message_field(1)
default_... | true | true |
f748a900f58b9ee8ab469b767af6c4a284f6b710 | 2,579 | py | Python | rf/test/RegFile_test.py | pnnl/open-cgra | c19bc3a1baca3da659dc8f3cbfe32dd6003a2c65 | [
"BSD-3-Clause"
] | 49 | 2020-09-17T19:22:53.000Z | 2022-03-25T18:55:13.000Z | rf/test/RegFile_test.py | pnnl/open-cgra | c19bc3a1baca3da659dc8f3cbfe32dd6003a2c65 | [
"BSD-3-Clause"
] | 8 | 2020-12-30T20:22:29.000Z | 2022-03-29T04:47:27.000Z | rf/test/RegFile_test.py | pnnl/open-cgra | c19bc3a1baca3da659dc8f3cbfe32dd6003a2c65 | [
"BSD-3-Clause"
] | 12 | 2020-12-12T21:38:59.000Z | 2022-03-15T02:21:15.000Z | """
==========================================================================
Phi_test.py
==========================================================================
Test cases for functional unit Phi.
Author : Cheng Tan
Date : November 27, 2019
"""
from pymtl3 import *
from pymtl3.stdlib.test import Tes... | 29.643678 | 74 | 0.577356 |
from pymtl3 import *
from pymtl3.stdlib.test import TestSinkCL
from pymtl3.stdlib.test.test_srcs import TestSrcRTL
from ..RegFile import RegFile
from ...lib.opt_type import *
from ...lib.messages import *
class TestHarness( Component ):
def construct( s, Fu... | true | true |
f748a95c76d0add0894d1f3f835b7d1d5c434db4 | 12,462 | py | Python | qa/rpc-tests/util.py | dmocoin/domino | 68a97e6a47dd508970a3194ada7857c49c09f3d3 | [
"MIT"
] | null | null | null | qa/rpc-tests/util.py | dmocoin/domino | 68a97e6a47dd508970a3194ada7857c49c09f3d3 | [
"MIT"
] | null | null | null | qa/rpc-tests/util.py | dmocoin/domino | 68a97e6a47dd508970a3194ada7857c49c09f3d3 | [
"MIT"
] | 1 | 2018-06-14T17:09:50.000Z | 2018-06-14T17:09:50.000Z | # Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2014-2015 The Dash developers
# Copyright (c) 2015-2017 The PIVX developers
# Copyright (c) 2017-2018 The Domino developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-lic... | 35.913545 | 106 | 0.648211 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc"))
from decimal import Decimal, ROUND_DOWN
import json
import random
import shutil
import subprocess
import time
import re
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
fro... | true | true |
f748a9a909a78e48671f0ce4cbe555ee3d14a07b | 16,432 | py | Python | tools/run_tests/artifacts/artifact_targets.py | Akrog/grpc | 14800b0c1acc2d10d4fd0826731ecae2cb448143 | [
"Apache-2.0"
] | 9 | 2020-12-04T07:34:08.000Z | 2022-03-07T21:10:35.000Z | tools/run_tests/artifacts/artifact_targets.py | Akrog/grpc | 14800b0c1acc2d10d4fd0826731ecae2cb448143 | [
"Apache-2.0"
] | 62 | 2020-02-27T00:53:36.000Z | 2021-02-05T06:10:53.000Z | tools/run_tests/artifacts/artifact_targets.py | Akrog/grpc | 14800b0c1acc2d10d4fd0826731ecae2cb448143 | [
"Apache-2.0"
] | 5 | 2021-02-19T09:46:00.000Z | 2022-03-13T17:33:34.000Z | #!/usr/bin/env python
# Copyright 2016 gRPC 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 o... | 41.08 | 104 | 0.571994 |
import os.path
import random
import string
import sys
sys.path.insert(0, os.path.abspath('..'))
import python_utils.jobset as jobset
def create_docker_jobspec(name,
dockerfile_dir,
shell_command,
environ={},
... | true | true |
f748aa3d2684c9e425f0043e8a6ca5a1c8916a15 | 4,981 | py | Python | finetune/src/evaluate_v1_0.py | Beomi/KoELECTRA | 0e64b1597b567f0f74701dcc53d74aad1dab2aec | [
"Apache-2.0"
] | 1 | 2021-10-04T11:22:13.000Z | 2021-10-04T11:22:13.000Z | finetune/src/evaluate_v1_0.py | Beomi/KoELECTRA | 0e64b1597b567f0f74701dcc53d74aad1dab2aec | [
"Apache-2.0"
] | 1 | 2021-08-10T14:53:09.000Z | 2021-08-10T14:53:09.000Z | finetune/src/evaluate_v1_0.py | SIC98/KoELECTRA | 19fd5f2b698b297a8cf1e2c0c3995c93509298f3 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from collections import Counter
import string
import re
import argparse
import json
import sys
import os
'''KorQuAD v1.0에 대한 공식 평가 스크립트 '''
'''본 스크립트는 SQuAD v1.1 평가 스크립트 https://rajpurkar.github.io/SQuAD-explorer/ 를 바탕으로 작성됨.'''
def normalize_answer(s):
def remove_(text):
... | 34.590278 | 88 | 0.620157 | from __future__ import print_function
from collections import Counter
import string
import re
import argparse
import json
import sys
import os
def normalize_answer(s):
def remove_(text):
text = re.sub("'", " ", text)
text = re.sub('"', " ", text)
text = re.sub('《', " ", text)
text... | true | true |
f748aa7805daad0ebf6c10e12c341455a23ea816 | 13,335 | py | Python | tests/test_netmiko_commit.py | zunya58/netmiko | f12d7640d1dbaa2d3b70912b7ea8448928602f1e | [
"MIT"
] | 2 | 2019-07-23T02:27:19.000Z | 2019-07-23T02:27:25.000Z | tests/test_netmiko_commit.py | tyler-8/netmiko | df317927fcf5d742b5096c0db5ccbd0847c19f84 | [
"MIT"
] | null | null | null | tests/test_netmiko_commit.py | tyler-8/netmiko | df317927fcf5d742b5096c0db5ccbd0847c19f84 | [
"MIT"
] | 1 | 2019-10-16T19:02:32.000Z | 2019-10-16T19:02:32.000Z | #!/usr/bin/env python
"""
test_ssh_connect: verify ssh connectivity
test_config_mode: verify enter config mode
test_commit_base: test std .commit()
test_commit_confirm: test commit with confirm
test_confirm_delay: test commit-confirm with non-std delay
test_no_confirm: test commit-confirm with no confirm
test_commit_ch... | 33.254364 | 88 | 0.715336 |
import time
import re
import random
import string
def gen_random(N=6):
return "".join(
[
random.choice(
string.ascii_lowercase + string.ascii_uppercase + string.digits
)
for x in range(N)
]
)
def retrieve_commands(commands):
config_c... | true | true |
f748ab09a93931b9a55e1b7853d638ff08c42e11 | 1,520 | py | Python | Make_It_Hot_Cold/cold/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 665 | 2017-09-27T21:20:14.000Z | 2022-03-31T09:09:25.000Z | Make_It_Hot_Cold/cold/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 641 | 2017-10-03T19:46:37.000Z | 2022-03-30T18:28:46.000Z | Make_It_Hot_Cold/cold/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 734 | 2017-10-02T22:47:38.000Z | 2022-03-30T14:03:51.000Z | import time
import board
from analogio import AnalogIn
from adafruit_crickit import crickit
import neopixel
print("Peltier Module Demo")
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=False)
def show_value(time_val): # Show time on NeoPixels on CPX
num_pixels = int(10-time_val)
for i in ra... | 30.4 | 75 | 0.634868 | import time
import board
from analogio import AnalogIn
from adafruit_crickit import crickit
import neopixel
print("Peltier Module Demo")
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=False)
def show_value(time_val):
num_pixels = int(10-time_val)
for i in range(num_pixels):
pixels... | true | true |
f748abbfbfb93d5983d81006036f5239c218a838 | 843 | py | Python | ms_coffee.py | Manojpvr/VoxelDEM | bee9cebb83617bc2b58a770a13c3f651518ffb2b | [
"MIT"
] | null | null | null | ms_coffee.py | Manojpvr/VoxelDEM | bee9cebb83617bc2b58a770a13c3f651518ffb2b | [
"MIT"
] | null | null | null | ms_coffee.py | Manojpvr/VoxelDEM | bee9cebb83617bc2b58a770a13c3f651518ffb2b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 21 15:13:07 2021
@author: pvrma
"""
"""
This is the script for voxelising the ellipsoidal super quadric particle
data.
"""
import voxelization
zmax = -0.003 #removes particles above this height, to avoid heaping effect
par_data = voxelization.import_ms_data(... | 36.652174 | 137 | 0.748517 |
import voxelization
zmax = -0.003
par_data = voxelization.import_ms_data('ms_coffee_dem_out.csv','coffee_sphere_data.csv', zmax)
print
rmin = 0.0006
normalized_voxel_size = 0.1
bounding_box_dimensions = [-0.0125,0.0125,-0.0125,0.0125,-0.05,-0.001]
voxel = voxelization.ms_vox(par_data, rmin, bounding_box_dimensi... | true | true |
f748ac86b64501703d56c326aab76b897ebfcb53 | 15,243 | py | Python | tests/humanize_tests/tests.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/humanize_tests/tests.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/humanize_tests/tests.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | import datetime
from decimal import Decimal
from django.contrib.humanize.templatetags import humanize
from django.template import Context, Template, defaultfilters
from django.test import SimpleTestCase, modify_settings, override_settings
from django.utils import translation
from django.utils.html import escape... | 44.70088 | 120 | 0.55678 | import datetime
from decimal import Decimal
from django.contrib.humanize.templatetags import humanize
from django.template import Context, Template, defaultfilters
from django.test import SimpleTestCase, modify_settings, override_settings
from django.utils import translation
from django.utils.html import escape... | true | true |
f748ae553048f63e923f9af90a368dae2c03a09f | 7,958 | py | Python | imgreco/end_operation.py | LittleNightmare/ArknightsAutoHelper | c8df51f00e0d17c636f74ed58c4b16e12459ddbe | [
"MIT"
] | 1 | 2021-05-03T13:39:08.000Z | 2021-05-03T13:39:08.000Z | imgreco/end_operation.py | ZhouZiHao-Moon/ArknightsAutoHelper | 3135b54d69f2255f99c13d42dc936065701c3129 | [
"MIT"
] | null | null | null | imgreco/end_operation.py | ZhouZiHao-Moon/ArknightsAutoHelper | 3135b54d69f2255f99c13d42dc936065701c3129 | [
"MIT"
] | null | null | null | import sys
import pickle
import numpy as np
from PIL import Image, ImageOps
from richlog import get_logger
from . import util
from . import imgops
from . import item
from . import minireco
from . import resources
from .util import any_in
LOGFILE = 'log/drop-recognition.html'
class RecognizeSession:
def __init__... | 34.008547 | 125 | 0.655567 | import sys
import pickle
import numpy as np
from PIL import Image, ImageOps
from richlog import get_logger
from . import util
from . import imgops
from . import item
from . import minireco
from . import resources
from .util import any_in
LOGFILE = 'log/drop-recognition.html'
class RecognizeSession:
def __init__... | true | true |
f748ae72f85779619f6c009846e9a268ccd536d0 | 2,159 | py | Python | dashboard/dashboard/app.py | phtruongan/state-machine-editor | f0bbf4260c5821237d253870a9fb07304111f94b | [
"Apache-2.0"
] | null | null | null | dashboard/dashboard/app.py | phtruongan/state-machine-editor | f0bbf4260c5821237d253870a9fb07304111f94b | [
"Apache-2.0"
] | null | null | null | dashboard/dashboard/app.py | phtruongan/state-machine-editor | f0bbf4260c5821237d253870a9fb07304111f94b | [
"Apache-2.0"
] | 1 | 2019-07-02T12:15:56.000Z | 2019-07-02T12:15:56.000Z | # -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask, render_template
from dashboard import commands, public, user
from dashboard.extensions import bcrypt, cache, csrf_protect, db, debug_toolbar, login_manager, migrate, webpack
def create_app(config_object='dashb... | 29.575342 | 112 | 0.699398 |
from flask import Flask, render_template
from dashboard import commands, public, user
from dashboard.extensions import bcrypt, cache, csrf_protect, db, debug_toolbar, login_manager, migrate, webpack
def create_app(config_object='dashboard.settings'):
app = Flask(__name__.split('.')[0])
app.config.from_objec... | true | true |
f748aee2f097de143a41e445a0826d64a3e44e2b | 2,315 | py | Python | code_examples/Python/sync_HPC_preprocessor_with_file/app/PrepWithFile.py | VPoser/docs-and-training | 55d4aa4c5b964f3c810d58008db4c5b75260322b | [
"Zlib"
] | null | null | null | code_examples/Python/sync_HPC_preprocessor_with_file/app/PrepWithFile.py | VPoser/docs-and-training | 55d4aa4c5b964f3c810d58008db4c5b75260322b | [
"Zlib"
] | 4 | 2019-05-29T06:16:56.000Z | 2021-03-31T19:03:36.000Z | code_examples/Python/sync_HPC_preprocessor_with_file/app/PrepWithFile.py | VPoser/docs-and-training | 55d4aa4c5b964f3c810d58008db4c5b75260322b | [
"Zlib"
] | 3 | 2019-04-02T08:48:31.000Z | 2020-09-23T08:13:35.000Z | """HPC preprocessor for an HPC demo job
Example of an HPC preprocessor which takes a file and a text input and creates
the necessary parameters for the HPC service.
"""
import os
import logging
from spyne import Application, srpc, ServiceBase, Unicode
from spyne.protocol.soap import Soap11
from spyne.model.fault impo... | 34.044118 | 82 | 0.692441 | import os
import logging
from spyne import Application, srpc, ServiceBase, Unicode
from spyne.protocol.soap import Soap11
from spyne.model.fault import Fault
from clfpy import AuthClient, ExtraParameters
TNS = "prepwithfile.sintef.no"
SERVICENAME = "PrepWithFile"
class TokenValidationFailedFault(Fault):
pass... | true | true |
f748af0b9935c5ae65f33ac36cca647e2ae152ff | 2,614 | py | Python | dags/tezosetl_airflow/variables.py | blockchain-etl/tezos-etl-airflow | 4ca43bb9b1bb53c07e79fdcec9787998a2634fbc | [
"MIT"
] | 1 | 2020-06-20T14:15:57.000Z | 2020-06-20T14:15:57.000Z | dags/tezosetl_airflow/variables.py | blockchain-etl/tezos-etl-airflow | 4ca43bb9b1bb53c07e79fdcec9787998a2634fbc | [
"MIT"
] | 1 | 2021-05-20T06:18:35.000Z | 2021-05-20T06:18:35.000Z | dags/tezosetl_airflow/variables.py | blockchain-etl/tezos-etl-airflow | 4ca43bb9b1bb53c07e79fdcec9787998a2634fbc | [
"MIT"
] | null | null | null | from datetime import datetime
from airflow.models import Variable
def read_export_dag_vars(var_prefix, **kwargs):
"""Read Airflow variables for Export DAG"""
export_start_date = read_var('export_start_date', var_prefix, True, **kwargs)
export_start_date = datetime.strptime(export_start_date, '%Y-%m-%d')
... | 42.852459 | 113 | 0.709258 | from datetime import datetime
from airflow.models import Variable
def read_export_dag_vars(var_prefix, **kwargs):
export_start_date = read_var('export_start_date', var_prefix, True, **kwargs)
export_start_date = datetime.strptime(export_start_date, '%Y-%m-%d')
export_end_date = read_var('export_end_date... | true | true |
f748af5921c7f560eab80978c8b992c0e13b3697 | 511 | py | Python | mathgenerator/funcs/binaryComplement1sFunc.py | mahimadubey/mathgenerator | 32d7fe0da1cc6d80a9e6ea241b1968866044db3f | [
"MIT"
] | null | null | null | mathgenerator/funcs/binaryComplement1sFunc.py | mahimadubey/mathgenerator | 32d7fe0da1cc6d80a9e6ea241b1968866044db3f | [
"MIT"
] | null | null | null | mathgenerator/funcs/binaryComplement1sFunc.py | mahimadubey/mathgenerator | 32d7fe0da1cc6d80a9e6ea241b1968866044db3f | [
"MIT"
] | null | null | null | from .__init__ import *
from ..__init__ import Generator
def binaryComplement1sFunc(maxDigits=10):
question = ''
answer = ''
for i in range(random.randint(1, maxDigits)):
temp = str(random.randint(0, 1))
question += temp
answer += "0" if temp == "1" else "1"
problem = questio... | 24.333333 | 74 | 0.60274 | from .__init__ import *
from ..__init__ import Generator
def binaryComplement1sFunc(maxDigits=10):
question = ''
answer = ''
for i in range(random.randint(1, maxDigits)):
temp = str(random.randint(0, 1))
question += temp
answer += "0" if temp == "1" else "1"
problem = questio... | true | true |
f748b1172f3e0ca2af960e6acfaccec75a395009 | 1,051 | py | Python | src/compas_cem/elements/trail.py | dylau/compas_cem | 643c7d60cb9d6a9999cb96d39c44175cc8662a25 | [
"MIT"
] | 15 | 2020-12-11T14:35:19.000Z | 2022-03-31T03:12:30.000Z | src/compas_cem/elements/trail.py | dylau/compas_cem | 643c7d60cb9d6a9999cb96d39c44175cc8662a25 | [
"MIT"
] | 8 | 2020-10-09T00:08:05.000Z | 2021-11-18T00:24:20.000Z | src/compas_cem/elements/trail.py | dylau/compas_cem | 643c7d60cb9d6a9999cb96d39c44175cc8662a25 | [
"MIT"
] | 2 | 2021-12-28T02:29:47.000Z | 2022-03-15T14:04:23.000Z | from compas_cem.elements import Edge
class TrailEdge(Edge):
"""
A trail edge.
Notes
-----
If a plane is defined, it will override the absolute length of the trail edge.
However, the sign of the length (e.g. the combinatorial state) is preserved.
TODO: addexplicit combinatorial state to t... | 30.911765 | 102 | 0.519505 | from compas_cem.elements import Edge
class TrailEdge(Edge):
def __init__(self, u, v, length, plane=None):
super(TrailEdge, self).__init__(u, v)
self.attributes = {"length": length, "type": "trail", "plane": plane}
def __repr__(self):
st = "{0}(length={1!r}, plane={2!... | true | true |
f748b21d9a282f9b2725cbd7731825ef62698595 | 6,219 | py | Python | gubernator/github/models.py | liubin/test-infra | 4c30b2d5d95bb9b4088ec4df0212905ab73fc495 | [
"Apache-2.0"
] | 1 | 2021-04-12T03:45:55.000Z | 2021-04-12T03:45:55.000Z | gubernator/github/models.py | andyzhangx/test-infra | 4c30b2d5d95bb9b4088ec4df0212905ab73fc495 | [
"Apache-2.0"
] | null | null | null | gubernator/github/models.py | andyzhangx/test-infra | 4c30b2d5d95bb9b4088ec4df0212905ab73fc495 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The Kubernetes 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 ... | 31.095 | 99 | 0.636758 |
import datetime
import json
import google.appengine.ext.ndb as ndb
class GithubResource(ndb.Model):
@staticmethod
def make_key(repo, number):
return ndb.Key(GithubResource, '%s %s' % (repo, number))
def shrink(body):
toremove = []
for key, value in body.iteritems():
... | true | true |
f748b226fc05290c729462c2584dde8cc872cb64 | 1,994 | py | Python | day4/day4.py | jberends/aoc2021 | 063a0b19bb13b3a084f367e7c279afddc4f39113 | [
"MIT"
] | null | null | null | day4/day4.py | jberends/aoc2021 | 063a0b19bb13b3a084f367e7c279afddc4f39113 | [
"MIT"
] | null | null | null | day4/day4.py | jberends/aoc2021 | 063a0b19bb13b3a084f367e7c279afddc4f39113 | [
"MIT"
] | null | null | null | # uri: https://adventofcode.com/2021/day/4
from typing import Optional
from base import get_input
file_path = get_input(4, ".txt")
INPUT = """7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 ... | 25.564103 | 90 | 0.591274 |
from typing import Optional
from base import get_input
file_path = get_input(4, ".txt")
INPUT = """7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 5
19 8 7 25 23
20 11 10 24 4
14 21 16 ... | true | true |
f748b24b27483ef7323c784bdd0c56f69fe4f7b4 | 1,082 | py | Python | examples/servo_control/main.py | zerynth/lib-xinabox-oc05 | 6baa0677660c3b312207a14a99d42a93f7160f83 | [
"MIT"
] | null | null | null | examples/servo_control/main.py | zerynth/lib-xinabox-oc05 | 6baa0677660c3b312207a14a99d42a93f7160f83 | [
"MIT"
] | null | null | null | examples/servo_control/main.py | zerynth/lib-xinabox-oc05 | 6baa0677660c3b312207a14a99d42a93f7160f83 | [
"MIT"
] | null | null | null | ###############################################
# This is an example for the OC05 8-channel
# servo driver.
#
# A servo on channel 1 is positioned according
# to a desired degree of rotation.
###############################################
import streams
from xinabox.oc05 import oc05
# create a serial console... | 27.05 | 70 | 0.57671 | true | true | |
f748b3735fe3bcb7905fab7c85053e6d978932b1 | 72 | py | Python | conan/tools/meson/__init__.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | 1 | 2021-08-05T15:33:08.000Z | 2021-08-05T15:33:08.000Z | conan/tools/meson/__init__.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | null | null | null | conan/tools/meson/__init__.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | null | null | null | # noinspection PyUnresolvedReferences
from .meson import MesonToolchain
| 24 | 37 | 0.875 |
from .meson import MesonToolchain
| true | true |
f748b42717f60eb64a5d7d5a261582b6132790d2 | 1,413 | py | Python | api/plots/bridge.py | equinor/lcm | 338bf67e6eb412446e469b4c73f7000990445ebd | [
"MIT"
] | 3 | 2020-12-02T11:14:31.000Z | 2021-12-09T16:53:53.000Z | api/plots/bridge.py | equinor/lcm | 338bf67e6eb412446e469b4c73f7000990445ebd | [
"MIT"
] | 76 | 2020-09-29T10:59:10.000Z | 2022-01-03T07:41:29.000Z | api/plots/bridge.py | equinor/lcm | 338bf67e6eb412446e469b4c73f7000990445ebd | [
"MIT"
] | 2 | 2021-01-25T14:24:57.000Z | 2021-01-25T14:51:16.000Z | import base64
from io import BytesIO
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
from calculators.bridge import calculate_blend_cumulative, SIZE_STEPS, theoretical_bridge
from classes.product import Product
from controllers.products import products_get
def bridge_plot(products: dic... | 32.860465 | 113 | 0.716207 | import base64
from io import BytesIO
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
from calculators.bridge import calculate_blend_cumulative, SIZE_STEPS, theoretical_bridge
from classes.product import Product
from controllers.products import products_get
def bridge_plot(products: dic... | true | true |
f748b42b42ca0aa1d8afc76e26cfefaf5bacf6cb | 8,448 | py | Python | tests/test_sequence_sampler.py | ZheyuYe/gluon-nlp | 23d9d73f89ed83376def818434684eca17a3dea6 | [
"Apache-2.0"
] | 1 | 2020-08-19T09:31:04.000Z | 2020-08-19T09:31:04.000Z | tests/test_sequence_sampler.py | ZheyuYe/gluon-nlp | 23d9d73f89ed83376def818434684eca17a3dea6 | [
"Apache-2.0"
] | null | null | null | tests/test_sequence_sampler.py | ZheyuYe/gluon-nlp | 23d9d73f89ed83376def818434684eca17a3dea6 | [
"Apache-2.0"
] | null | null | null | import collections
import functools
import mxnet as mx
import numpy as np
import scipy
import pytest
from mxnet.gluon import nn, HybridBlock
from numpy.testing import assert_allclose
from gluonnlp.sequence_sampler import BeamSearchScorer, BeamSearchSampler
mx.npx.set_np()
@pytest.mark.parametrize('length', [False, Tr... | 37.883408 | 104 | 0.609257 | import collections
import functools
import mxnet as mx
import numpy as np
import scipy
import pytest
from mxnet.gluon import nn, HybridBlock
from numpy.testing import assert_allclose
from gluonnlp.sequence_sampler import BeamSearchScorer, BeamSearchSampler
mx.npx.set_np()
@pytest.mark.parametrize('length', [False, Tr... | true | true |
f748b461907f6fb977ff9306cb09a346a41eaa24 | 37,316 | py | Python | Lib/test/test_hashlib.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 27 | 2017-04-21T14:57:04.000Z | 2021-11-03T22:10:38.000Z | Lib/test/test_hashlib.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 3 | 2017-04-24T13:25:31.000Z | 2017-04-24T13:27:12.000Z | Lib/test/test_hashlib.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 11 | 2015-01-12T14:50:00.000Z | 2021-08-18T00:48:02.000Z | # Test hashlib module
#
# $Id$
#
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
import array
from binascii import unhexlify
import hashlib
import itertools
import os
import sys
try:
import threading
except ImportError:
threading = None
import... | 40.605005 | 202 | 0.629167 |
import array
from binascii import unhexlify
import hashlib
import itertools
import os
import sys
try:
import threading
except ImportError:
threading = None
import unittest
import warnings
from test import support
from test.support import _4G, bigmemtest, import_fresh_module
from http.client import HTTPE... | true | true |
f748b5051ed00d134f348635410b081d58185c28 | 1,585 | py | Python | brainbox/examples/docs_scatter_raster_plot.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | null | null | null | brainbox/examples/docs_scatter_raster_plot.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | null | null | null | brainbox/examples/docs_scatter_raster_plot.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | null | null | null | """
Plot raster across session
==========================
Example of how to plot scatter plot of spike depths vs spike times with colour and size of scatter
points scaled by spike amplitude
"""
import numpy as np
from brainbox.ephys_plots import scatter_raster_plot
from brainbox.plot_base import plot_scatter
... | 34.456522 | 99 | 0.688328 |
import numpy as np
from brainbox.ephys_plots import scatter_raster_plot
from brainbox.plot_base import plot_scatter
from oneibl.one import ONE
import matplotlib.pyplot as plt
import matplotlib
one = ONE()
eid = '671c7ea7-6726-4fbe-adeb-f89c2c8e489b'
probe = 'probe00'
spikes = one.load_object(eid, obj='... | true | true |
f748b5d586242012e243a06eb784f214b0d7898b | 27,015 | py | Python | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects_operations.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects_operations.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_redirects_operations.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 37.210744 | 90 | 0.637683 |
from msrest.pipeline import ClientRawResponse
from .. import models
class HttpRedirectsOperations(object):
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.config = ... | true | true |
f748b6299ebf950b66545fbfd0f12ef81e4bb378 | 88,853 | py | Python | template_container_macaque/labels/slice_12.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | template_container_macaque/labels/slice_12.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | template_container_macaque/labels/slice_12.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | coordinates_7F0030 = ((137, 134),
(137, 136), (138, 133), (138, 136), (139, 132), (139, 134), (139, 136), (140, 132), (140, 134), (140, 135), (140, 137), (141, 131), (141, 133), (141, 134), (141, 135), (141, 137), (142, 131), (142, 133), (142, 134), (142, 135), (142, 136), (142, 138), (143, 130), (143, 132), (143, 13... | 765.974138 | 865 | 0.499364 | coordinates_7F0030 = ((137, 134),
(137, 136), (138, 133), (138, 136), (139, 132), (139, 134), (139, 136), (140, 132), (140, 134), (140, 135), (140, 137), (141, 131), (141, 133), (141, 134), (141, 135), (141, 137), (142, 131), (142, 133), (142, 134), (142, 135), (142, 136), (142, 138), (143, 130), (143, 132), (143, 13... | true | true |
f748b6424aa449c100d06c2e428638ab969c9ba9 | 1,010 | py | Python | alphatwirl/loop/merge.py | shane-breeze/AlphaTwirl | 59dbd5348af31d02e133d43fd5bfaad6b99a155e | [
"BSD-3-Clause"
] | null | null | null | alphatwirl/loop/merge.py | shane-breeze/AlphaTwirl | 59dbd5348af31d02e133d43fd5bfaad6b99a155e | [
"BSD-3-Clause"
] | null | null | null | alphatwirl/loop/merge.py | shane-breeze/AlphaTwirl | 59dbd5348af31d02e133d43fd5bfaad6b99a155e | [
"BSD-3-Clause"
] | null | null | null | # Tai Sakuma <tai.sakuma@gmail.com>
##__________________________________________________________________||
def merge_in_order(map_, id_, data):
## merge to prev
idx = list(map_.keys()).index(id_)
idx_prev = idx - 1
if idx_prev < 0:
map_[id_] = data
else:
data_prev = list(map_.value... | 29.705882 | 70 | 0.591089 |
idx_prev = idx - 1
if idx_prev < 0:
map_[id_] = data
else:
data_prev = list(map_.values())[idx_prev]
id_prev = list(map_.keys())[idx_prev]
if data_prev is None:
map_[id_] = data
else:
if hasattr(data_prev, 'merge'):
data_prev.m... | true | true |
f748b76720a865c6fd6d0bdb6e9513830e33f897 | 1,644 | py | Python | examples/solutions/plot_brain_size.py | cogmaster-stats/python-cogstats | e8a7082a27370b5ac27721190a05ed2b5a463a10 | [
"CC-BY-3.0"
] | 14 | 2015-07-31T17:28:05.000Z | 2021-09-24T12:47:06.000Z | examples/solutions/plot_brain_size.py | cogmaster-stats/python-cogstats | e8a7082a27370b5ac27721190a05ed2b5a463a10 | [
"CC-BY-3.0"
] | null | null | null | examples/solutions/plot_brain_size.py | cogmaster-stats/python-cogstats | e8a7082a27370b5ac27721190a05ed2b5a463a10 | [
"CC-BY-3.0"
] | 8 | 2015-02-03T11:33:38.000Z | 2019-07-24T20:39:56.000Z | """
Relating Gender and IQ
=======================
Going back to the brain size + IQ data, test if the VIQ of male and
female are different after removing the effect of brain size, height and
weight.
"""
import pandas
from statsmodels.formula.api import ols
data = pandas.read_csv('../brain_size.csv', sep=';', na_valu... | 34.25 | 79 | 0.666667 | import pandas
from statsmodels.formula.api import ols
data = pandas.read_csv('../brain_size.csv', sep=';', na_values='.')
model = ols('VIQ ~ Gender + MRI_Count + Height', data).fit()
print(model.summary())
# coefficient of our model, and not a combination of coefficients.
# However, defining a contrast, which would... | true | true |
f748b7af3d1de5cc5d708d168de2539b8387a982 | 933 | py | Python | publisher/managers.py | akandada/django-model-publisher | ed58426b49c94a55454cf202fa1f129e191073b9 | [
"BSD-3-Clause"
] | null | null | null | publisher/managers.py | akandada/django-model-publisher | ed58426b49c94a55454cf202fa1f129e191073b9 | [
"BSD-3-Clause"
] | null | null | null | publisher/managers.py | akandada/django-model-publisher | ed58426b49c94a55454cf202fa1f129e191073b9 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.db.models.query import QuerySet
from model_utils.managers import PassThroughManagerMixin
from .signals import publisher_pre_delete
from .middleware import get_draft_status
class PublisherQuerySet(QuerySet):
def drafts(self):
from .models import PublisherModelBas... | 30.096774 | 81 | 0.760986 | from django.db import models
from django.db.models.query import QuerySet
from model_utils.managers import PassThroughManagerMixin
from .signals import publisher_pre_delete
from .middleware import get_draft_status
class PublisherQuerySet(QuerySet):
def drafts(self):
from .models import PublisherModelBas... | true | true |
f748b87258b94d3a1f5805fc6b1259db2612f3c8 | 2,328 | py | Python | airflow/kubernetes/volume_mount.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 3 | 2015-08-25T13:56:44.000Z | 2020-03-21T10:26:58.000Z | airflow/kubernetes/volume_mount.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 37 | 2020-07-21T07:50:02.000Z | 2022-03-29T22:31:28.000Z | airflow/kubernetes/volume_mount.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 2 | 2018-07-24T08:54:45.000Z | 2018-08-31T13:41:50.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.459459 | 92 | 0.689433 |
import copy
import kubernetes.client.models as k8s
from airflow.kubernetes.k8s_model import K8SModel
class VolumeMount(K8SModel):
def __init__(self, name, mount_path, sub_path, read_only):
self.name = name
self.mount_path = mount_path
self.sub_path = sub_path
sel... | true | true |
f748b9ed8135410be809d0b12f49e88b1b82c486 | 857 | py | Python | roomate/migrations/0012_auto_20211027_2331.py | TheRK420/roommate | 89b9146cc57e45e32dcc308f859e5f06190159da | [
"Apache-2.0"
] | 1 | 2021-11-12T13:45:35.000Z | 2021-11-12T13:45:35.000Z | roomate/migrations/0012_auto_20211027_2331.py | TheRK420/roommate | 89b9146cc57e45e32dcc308f859e5f06190159da | [
"Apache-2.0"
] | null | null | null | roomate/migrations/0012_auto_20211027_2331.py | TheRK420/roommate | 89b9146cc57e45e32dcc308f859e5f06190159da | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.4 on 2021-10-27 18:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('roomate', '0011_auto_20211027_1651'),
]
operations = [
migrations.AlterField(
model_name='contactus',
name='id',
... | 29.551724 | 108 | 0.605601 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('roomate', '0011_auto_20211027_1651'),
]
operations = [
migrations.AlterField(
model_name='contactus',
name='id',
field=models.AutoField(auto_created=Tr... | true | true |
f748bb598e328e383c03742983690257b2903ec5 | 4,980 | py | Python | tasks.py | catamorphisms/cookiecutter-modern-pypackage | a8fd55a5f3f19e008cf6c536e68e46f51a91d994 | [
"MIT"
] | 1 | 2020-11-21T03:53:56.000Z | 2020-11-21T03:53:56.000Z | tasks.py | catamorphisms/cookiecutter-modern-pypackage | a8fd55a5f3f19e008cf6c536e68e46f51a91d994 | [
"MIT"
] | 168 | 2020-12-11T07:05:32.000Z | 2022-03-28T06:12:05.000Z | tasks.py | m4ta1l/cookiecutter-modern-pypackage | 38d98ffea681ea8a0b3bf089428e824622cc5a03 | [
"MIT"
] | null | null | null | """
Tasks for maintaining the project.
Execute 'invoke --list' for guidance on using Invoke
"""
import platform
import webbrowser
from pathlib import Path
from invoke import call, task
from invoke.context import Context
from invoke.runners import Result
ROOT_DIR = Path(__file__).parent
DOCS_DIR = ROOT_DIR.joinpath("... | 26.210526 | 96 | 0.599799 | import platform
import webbrowser
from pathlib import Path
from invoke import call, task
from invoke.context import Context
from invoke.runners import Result
ROOT_DIR = Path(__file__).parent
DOCS_DIR = ROOT_DIR.joinpath("docs")
DOCS_BUILD_DIR = DOCS_DIR.joinpath("_build")
DOCS_INDEX = DOCS_BUILD_DIR.joinpath("index.h... | true | true |
f748bc112bbf210ee71318efd0bb6a6adaba6770 | 7,079 | py | Python | lib/models/ctvae.py | kushaltirumala/callibratable_style_consistency_flies | d4e87d78bfa61068feff2169523bb963941163e2 | [
"MIT"
] | 1 | 2020-06-20T21:08:40.000Z | 2020-06-20T21:08:40.000Z | lib/models/ctvae.py | kushaltirumala/callibratable_style_consistency_flies | d4e87d78bfa61068feff2169523bb963941163e2 | [
"MIT"
] | null | null | null | lib/models/ctvae.py | kushaltirumala/callibratable_style_consistency_flies | d4e87d78bfa61068feff2169523bb963941163e2 | [
"MIT"
] | 2 | 2019-11-13T19:27:36.000Z | 2020-07-17T12:18:15.000Z | import torch
import torch.nn as nn
import numpy as np
from lib.models.core import BaseSequentialModel
from lib.distributions import Normal
class CTVAE(BaseSequentialModel):
name = 'ctvae' # conditional trajectory VAE policy
model_args = ['state_dim', 'action_dim', 'z_dim', 'h_dim', 'rnn_dim', 'num_layers']
... | 48.486301 | 242 | 0.595988 | import torch
import torch.nn as nn
import numpy as np
from lib.models.core import BaseSequentialModel
from lib.distributions import Normal
class CTVAE(BaseSequentialModel):
name = 'ctvae'
model_args = ['state_dim', 'action_dim', 'z_dim', 'h_dim', 'rnn_dim', 'num_layers']
requires_labels = True
def... | true | true |
f748bcb64d253389958302f20ac0d03d5c857595 | 630 | py | Python | 2015/brutes/b_aoc10.py | mzvk/ubiquitous-broccoli | b6bd1c49926fe852db7241a2f38e2045fbae2dd8 | [
"MIT"
] | null | null | null | 2015/brutes/b_aoc10.py | mzvk/ubiquitous-broccoli | b6bd1c49926fe852db7241a2f38e2045fbae2dd8 | [
"MIT"
] | 1 | 2019-01-02T12:54:07.000Z | 2019-06-13T12:18:09.000Z | 2015/brutes/b_aoc10.py | mzvk/ubiquitous-broccoli | b6bd1c49926fe852db7241a2f38e2045fbae2dd8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
data_in = '../inputs/set01/aoc10.in'
def load(file):
with open(file) as x: output = x.read()
return output.replace('\n', '')
def look_say(start):
(current, counter) = ('', 0)
new = ''
for digit in start:
if current != digit:
if current: new = '{}{}{}'.format(new, counter, cu... | 22.5 | 62 | 0.593651 |
data_in = '../inputs/set01/aoc10.in'
def load(file):
with open(file) as x: output = x.read()
return output.replace('\n', '')
def look_say(start):
(current, counter) = ('', 0)
new = ''
for digit in start:
if current != digit:
if current: new = '{}{}{}'.format(new, counter, current)
current ... | false | true |
f748bd2bdfb1deaf507ae931e2f3e7cc009bb2b8 | 2,465 | py | Python | src/condor_pytorch/losses.py | GarrettJenkinson/condor_pytorch | 53406e11c0b6e27483b81f91f555013cd7d02a71 | [
"MIT"
] | 3 | 2021-11-01T03:14:48.000Z | 2022-02-22T10:25:34.000Z | src/condor_pytorch/losses.py | GarrettJenkinson/condor_pytorch | 53406e11c0b6e27483b81f91f555013cd7d02a71 | [
"MIT"
] | null | null | null | src/condor_pytorch/losses.py | GarrettJenkinson/condor_pytorch | 53406e11c0b6e27483b81f91f555013cd7d02a71 | [
"MIT"
] | null | null | null | import torch.nn.functional as F
import torch
def CondorOrdinalCrossEntropy(logits, levels, importance_weights=None, reduction='mean'):
"""Computes the CONDOR loss described in
CONDOR TBD.
Parameters
----------
logits : torch.tensor, shape(num_examples, num_classes-1)
Outputs of the CONDO... | 32.434211 | 93 | 0.590669 | import torch.nn.functional as F
import torch
def CondorOrdinalCrossEntropy(logits, levels, importance_weights=None, reduction='mean'):
if not logits.shape == levels.shape:
raise ValueError("Please ensure that logits (%s) has the same shape as levels (%s). "
% (logits.shape, level... | true | true |
f748bde925781977b733b5d6a69cbbac329ef5f7 | 14,703 | py | Python | colorthief.py | gsornsen/color-thief-py | 44d582185aa339b4a7d7c664ff70a9f16c624786 | [
"BSD-3-Clause"
] | 2 | 2020-05-13T12:11:05.000Z | 2021-05-26T05:49:05.000Z | colorthief.py | gsornsen/color-thief-py | 44d582185aa339b4a7d7c664ff70a9f16c624786 | [
"BSD-3-Clause"
] | null | null | null | colorthief.py | gsornsen/color-thief-py | 44d582185aa339b4a7d7c664ff70a9f16c624786 | [
"BSD-3-Clause"
] | 2 | 2020-05-13T09:30:22.000Z | 2021-01-13T16:19:25.000Z | # -*- coding: utf-8 -*-
"""
colorthief
~~~~~~~~~~
Grabbing the color palette from an image.
:copyright: (c) 2015 by Shipeng Feng.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.2.1'
import math
from PIL import Image
class cached_property(object):
"""Decorator that create... | 33.264706 | 82 | 0.507447 |
__version__ = '0.2.1'
import math
from PIL import Image
class cached_property(object):
def __init__(self, func):
self.func = func
def __get__(self, instance, type):
res = instance.__dict__[self.func.__name__] = self.func(instance)
return res
class ColorThief(object):
def __in... | true | true |
f748be9967e6a8f958890992acca5b3581085f21 | 50,221 | py | Python | src/textacy/vsm/vectorizers.py | 8W9aG/textacy | 7f3bd999a79d85e967bcba66aa57816ed1172089 | [
"Apache-2.0"
] | 1 | 2021-11-03T19:11:11.000Z | 2021-11-03T19:11:11.000Z | src/textacy/vsm/vectorizers.py | 8W9aG/textacy | 7f3bd999a79d85e967bcba66aa57816ed1172089 | [
"Apache-2.0"
] | null | null | null | src/textacy/vsm/vectorizers.py | 8W9aG/textacy | 7f3bd999a79d85e967bcba66aa57816ed1172089 | [
"Apache-2.0"
] | 1 | 2022-02-20T14:23:03.000Z | 2022-02-20T14:23:03.000Z | """
:mod:`textacy.vsm.vectorizers`: Transform a collection of tokenized documents into
a document-term matrix of shape (# docs, # unique terms), with various ways to filter
or limit included terms and flexible weighting schemes for their values.
A second option aggregates terms in tokenized documents by provided grou... | 42.704932 | 100 | 0.597758 | import collections
import operator
from array import array
from typing import Dict, List
import numpy as np
import scipy.sparse as sp
from sklearn.preprocessing import normalize as normalize_mat
from .. import errors
from .matrix_utils import get_doc_lengths, get_inverse_doc_freqs, filter_terms_by_df
BM25_K1 = 1.6 ... | true | true |
f748bea0cea50b8cf8c56f16094e6249031f8d4e | 10,351 | py | Python | test/functional/zerocoin_publicSpend_reorg.py | MichaelHDesigns/abet | cc1d37ea4e43b48eca5dacc7e0a54c39e9e9f5a6 | [
"MIT"
] | 31 | 2018-10-20T03:48:53.000Z | 2022-03-10T08:41:53.000Z | test/functional/zerocoin_publicSpend_reorg.py | MichaelHDesigns/abet | cc1d37ea4e43b48eca5dacc7e0a54c39e9e9f5a6 | [
"MIT"
] | 25 | 2018-11-09T17:16:11.000Z | 2019-10-19T12:37:12.000Z | test/functional/zerocoin_publicSpend_reorg.py | MichaelHDesigns/abet | cc1d37ea4e43b48eca5dacc7e0a54c39e9e9f5a6 | [
"MIT"
] | 55 | 2018-10-20T13:40:39.000Z | 2022-03-07T07:13:02.000Z | # !/usr/bin/env python3
# Copyright (c) 2019 The PIVX developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Covers the scenario of two valid PoS blocks with same height
and same coinstake input.
'''
from copy import deep... | 49.526316 | 126 | 0.638103 |
from copy import deepcopy
from io import BytesIO
import time
from test_framework.messages import CTransaction, CBlock
from test_framework.util import bytes_to_hex_str, hex_str_to_bytes, assert_equal
from fake_stake.base_test import ABET_FakeStakeTest
class ZerocoinPublicSpendReorg(ABET_FakeStakeTest):
def ... | true | true |
f748bed96aca55d0c319396de63520e170016d9a | 30,445 | py | Python | wofry/propagator/wavefront1D/generic_wavefront.py | lucarebuffi/wofry | 07d1d00c828599b225a96e44713911830b3f0d6b | [
"MIT"
] | 3 | 2020-04-05T22:10:03.000Z | 2021-11-03T04:12:14.000Z | wofry/propagator/wavefront1D/generic_wavefront.py | lucarebuffi/wofry | 07d1d00c828599b225a96e44713911830b3f0d6b | [
"MIT"
] | 2 | 2018-11-09T09:05:17.000Z | 2019-04-03T09:39:47.000Z | wofry/propagator/wavefront1D/generic_wavefront.py | oasys-kit/wofry | 07d1d00c828599b225a96e44713911830b3f0d6b | [
"MIT"
] | 4 | 2019-02-14T10:10:59.000Z | 2021-02-24T22:26:45.000Z | import numpy, copy
import scipy.constants as codata
from srxraylib.util.data_structures import ScaledArray, ScaledMatrix
from wofry.propagator.wavefront import Wavefront, WavefrontDimension
from wofry.propagator.util.gaussian_schell_model import GaussianSchellModel1D
# needed for h5 i/o
import os
import sys
import ... | 47.274845 | 147 | 0.644802 | import numpy, copy
import scipy.constants as codata
from srxraylib.util.data_structures import ScaledArray, ScaledMatrix
from wofry.propagator.wavefront import Wavefront, WavefrontDimension
from wofry.propagator.util.gaussian_schell_model import GaussianSchellModel1D
import os
import sys
import time
from wofry.pro... | true | true |
f748bf4d5cd53901ce3aa12c4278a268332e4046 | 80,548 | py | Python | attractors.py | arielbro/attractor_learning | 33693847f319d294a61a00f0d5c2c6457270fbfe | [
"MIT"
] | null | null | null | attractors.py | arielbro/attractor_learning | 33693847f319d294a61a00f0d5c2c6457270fbfe | [
"MIT"
] | null | null | null | attractors.py | arielbro/attractor_learning | 33693847f319d294a61a00f0d5c2c6457270fbfe | [
"MIT"
] | null | null | null | import numpy as np
import multiprocessing
import utility
import numpy
import os
import itertools
import logic
import graphs
import sympy
import time
import ilp
import random
import csv
import gurobipy
from gurobipy import GRB
import stochastic
import subprocess
from enum import Enum
import pickle
import dill
from patho... | 52.202203 | 252 | 0.623069 | import numpy as np
import multiprocessing
import utility
import numpy
import os
import itertools
import logic
import graphs
import sympy
import time
import ilp
import random
import csv
import gurobipy
from gurobipy import GRB
import stochastic
import subprocess
from enum import Enum
import pickle
import dill
from patho... | false | true |
f748bfd6f8ce027ee3968796a2704f4fb7c078a6 | 6,729 | py | Python | dm-project-3/runner.py | oskopek/dm | a895a97b52052d04f7451ca3dba4205d02d18fc2 | [
"MIT"
] | 2 | 2019-03-04T23:50:15.000Z | 2019-04-19T15:16:13.000Z | dm-project-3/runner.py | oskopek/dm | a895a97b52052d04f7451ca3dba4205d02d18fc2 | [
"MIT"
] | null | null | null | dm-project-3/runner.py | oskopek/dm | a895a97b52052d04f7451ca3dba4205d02d18fc2 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2016 Olivier Bachem
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merg... | 34.685567 | 99 | 0.678704 |
"""Map Reduce Framework for Python (Task3, DM2016)
https://project.las.ethz.ch/task3
1. The framework first loads the python source code specified in `sourcefile`.
The source should contain a `mapper` and a `reducer` function.
The `mapper(key, value)` function takes as input a (key, value) tu... | false | true |
f748c01cbd4ce872f44d6a8f29cc40f9c21d068a | 345 | py | Python | src/participants/helpers.py | leopiresgoss/django-etest | 55ec087999b53fc734c32e6b6a6d73885f224af5 | [
"MIT"
] | 6 | 2022-02-18T17:43:01.000Z | 2022-02-21T23:24:37.000Z | src/participants/helpers.py | leopiresgoss/django-etest | 55ec087999b53fc734c32e6b6a6d73885f224af5 | [
"MIT"
] | null | null | null | src/participants/helpers.py | leopiresgoss/django-etest | 55ec087999b53fc734c32e6b6a6d73885f224af5 | [
"MIT"
] | null | null | null | from tests.models import Test
from datetime import datetime
# To check and return test and participant
def check_test_participant(request, test_code):
test = Test.objects.filter(test_code=test_code, deadline__gte=datetime.now())
participant = request.session.get('participant')
return {'test': test, 'p... | 38.333333 | 81 | 0.765217 | from tests.models import Test
from datetime import datetime
def check_test_participant(request, test_code):
test = Test.objects.filter(test_code=test_code, deadline__gte=datetime.now())
participant = request.session.get('participant')
return {'test': test, 'participant': participant} | true | true |
f748c194a5a19f79f72df3ce0c61500978f55a22 | 3,185 | py | Python | data_conversions/prepare_amsterdam_filelists.py | dmitrykudinov/PointCNN | 2e25f6cb3907728adc602d1d25938c66b7ebacc9 | [
"MIT"
] | 1 | 2021-09-20T09:34:14.000Z | 2021-09-20T09:34:14.000Z | data_conversions/prepare_amsterdam_filelists.py | dmitrykudinov/PointCNN | 2e25f6cb3907728adc602d1d25938c66b7ebacc9 | [
"MIT"
] | null | null | null | data_conversions/prepare_amsterdam_filelists.py | dmitrykudinov/PointCNN | 2e25f6cb3907728adc602d1d25938c66b7ebacc9 | [
"MIT"
] | 1 | 2021-09-20T09:34:20.000Z | 2021-09-20T09:34:20.000Z | #!/usr/bin/python3
'''Prepare Filelists for Semantic3D Segmentation Task.'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import math
import random
import argparse
from datetime import datetime
def main():
parser = argparse.ArgumentParser... | 40.833333 | 119 | 0.613815 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import math
import random
import argparse
from datetime import datetime
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--folder', '-f', help='Path to data folder')
... | true | true |
f748c1f616c0358865083d3f51ce9d9d8c0fe515 | 4,213 | py | Python | mongoengine_migrate/utils.py | vmdhhh/mongoengine-migrate | 9ac00fa9fcc77f56fe5867a68b20e5d64d2c0688 | [
"Apache-2.0"
] | null | null | null | mongoengine_migrate/utils.py | vmdhhh/mongoengine-migrate | 9ac00fa9fcc77f56fe5867a68b20e5d64d2c0688 | [
"Apache-2.0"
] | null | null | null | mongoengine_migrate/utils.py | vmdhhh/mongoengine-migrate | 9ac00fa9fcc77f56fe5867a68b20e5d64d2c0688 | [
"Apache-2.0"
] | null | null | null | __all__ = [
'UNSET',
'Diff',
'Slotinit',
'get_closest_parent',
'get_document_type',
'document_type_to_class_name'
]
import inspect
from typing import Type, Iterable, Optional, NamedTuple, Any
from mongoengine import EmbeddedDocument
from mongoengine.base import BaseDocument
from .flags import... | 28.659864 | 98 | 0.642535 | __all__ = [
'UNSET',
'Diff',
'Slotinit',
'get_closest_parent',
'get_document_type',
'document_type_to_class_name'
]
import inspect
from typing import Type, Iterable, Optional, NamedTuple, Any
from mongoengine import EmbeddedDocument
from mongoengine.base import BaseDocument
from .flags import... | true | true |
f748c25d725c017ebcca12ceb07e300983027167 | 1,923 | py | Python | parser/cmds/predict.py | Jacob-Zhou/spw-parser | 5f746a54d9a1da0591fc34f024eac2639bc3f407 | [
"MIT"
] | null | null | null | parser/cmds/predict.py | Jacob-Zhou/spw-parser | 5f746a54d9a1da0591fc34f024eac2639bc3f407 | [
"MIT"
] | null | null | null | parser/cmds/predict.py | Jacob-Zhou/spw-parser | 5f746a54d9a1da0591fc34f024eac2639bc3f407 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import datetime
from parser import Model
from parser.cmds.cmd import CMD
from parser.utils.corpus import Corpus
from parser.utils.data import TextDataset, batchify
import torch
class Predict(CMD):
def add_subparser(self, name, parser):
subparser = parser.add_parser... | 34.963636 | 73 | 0.580343 |
from datetime import datetime
from parser import Model
from parser.cmds.cmd import CMD
from parser.utils.corpus import Corpus
from parser.utils.data import TextDataset, batchify
import torch
class Predict(CMD):
def add_subparser(self, name, parser):
subparser = parser.add_parser(
name, hel... | true | true |
f748c35b3d373522690182e71799f77c8cb89984 | 4,586 | py | Python | McFee_Functions.py | AntayaScienceAndTechnology/McFee | 96a9a6d552253c622147fe9c9c1c253ba7bc66a2 | [
"MIT"
] | null | null | null | McFee_Functions.py | AntayaScienceAndTechnology/McFee | 96a9a6d552253c622147fe9c9c1c253ba7bc66a2 | [
"MIT"
] | null | null | null | McFee_Functions.py | AntayaScienceAndTechnology/McFee | 96a9a6d552253c622147fe9c9c1c253ba7bc66a2 | [
"MIT"
] | null | null | null | __author__ = 'Chris Jones'
import numpy as np
from scipy.integrate import quad
import heat_xfer as hx
# Values for default parameters
default_rrr = 150
default_I = 200.
default_res_increase = 0.
default_rho_273 = 1.71e-6
linspace_num = 500
def get_kr_ave1(u_l, u_h):
"""
Returns the average k*r value from u... | 24.524064 | 105 | 0.633232 | __author__ = 'Chris Jones'
import numpy as np
from scipy.integrate import quad
import heat_xfer as hx
default_rrr = 150
default_I = 200.
default_res_increase = 0.
default_rho_273 = 1.71e-6
linspace_num = 500
def get_kr_ave1(u_l, u_h):
if u_l == u_h:
return 0.
kr_func = lambda u: hx.therm_cond_cu(... | true | true |
f748c3a0b569e9edf17976133f343a47b0b392bf | 52,491 | py | Python | heat/tests/test_software_deployment.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | heat/tests/test_software_deployment.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | heat/tests/test_software_deployment.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 38.286652 | 79 | 0.575127 |
import copy
import re
import uuid
import mock
import six
from heat.common import exception as exc
from heat.common.i18n import _
from heat.engine.clients.os import nova
from heat.engine.clients.os import swift
from heat.engine.clients.os import zaqar
from heat.engine.resources.openstack.heat import softw... | true | true |
f748c460a3179ff60a98f6203774feea81eee84f | 2,013 | py | Python | chatspace/dataset.py | bestend/chatspace | 04819eaaf4e9e2d43f8aa8ed5b39f3100b33f921 | [
"Apache-2.0"
] | 1 | 2021-01-13T19:22:09.000Z | 2021-01-13T19:22:09.000Z | chatspace/dataset.py | HongSic/chatspace | 04819eaaf4e9e2d43f8aa8ed5b39f3100b33f921 | [
"Apache-2.0"
] | null | null | null | chatspace/dataset.py | HongSic/chatspace | 04819eaaf4e9e2d43f8aa8ed5b39f3100b33f921 | [
"Apache-2.0"
] | 1 | 2021-01-13T23:55:12.000Z | 2021-01-13T23:55:12.000Z | import tensorflow as tf
def make_chatspace_training_dataset(
lookup_table: tf.lookup.StaticHashTable,
space_skip_prob: float,
):
"""
Chatspace 모델에 넣을 Input을 만드는 함수를 반환합니다.
정상 문장을 입력으로 받아 랜덤하게 띄어쓰기를 지웁니다.
:param lookup_table: Vocab 정보로 초기화된 ``tf.lookup.StaticHashTable``
:param space_skip_p... | 30.5 | 81 | 0.518629 | import tensorflow as tf
def make_chatspace_training_dataset(
lookup_table: tf.lookup.StaticHashTable,
space_skip_prob: float,
):
@tf.function
def _mapping_function(
sentence: tf.Tensor,
):
sentence = tf.strings.unicode_split(sentence, "UTF-8")
sentence = tf.strings.regex_r... | true | true |
f748c4a818909a09ac79a7edd1c832ddde05edda | 24,813 | py | Python | lib/googlecloudsdk/third_party/apis/cloudasset/v1p4alpha1/cloudasset_v1p4alpha1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/third_party/apis/cloudasset/v1p4alpha1/cloudasset_v1p4alpha1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/cloudasset/v1p4alpha1/cloudasset_v1p4alpha1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | """Generated message classes for cloudasset version v1p4alpha1.
The cloud asset API manages the history and inventory of cloud resources.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from __future__ import absolute_import
from apitools.base.protorpclite import messages as _messages
from a... | 49.037549 | 110 | 0.738806 |
from __future__ import absolute_import
from apitools.base.protorpclite import messages as _messages
from apitools.base.py import encoding
package = 'cloudasset'
class AnalyzeIamPolicyResponse(_messages.Message):
analysisResults = _messages.MessageField('IamPolicyAnalysisResult', 1, repeated=True)
fullyExplo... | true | true |
f748c4c51fc43dd6b1422b0974a244b3f444910a | 1,429 | py | Python | setup.py | aysa-sa/docker-registry-client | 0051598aedff49a7e853384cd038eb1f2fa5eca7 | [
"MIT"
] | null | null | null | setup.py | aysa-sa/docker-registry-client | 0051598aedff49a7e853384cd038eb1f2fa5eca7 | [
"MIT"
] | 1 | 2019-11-28T14:06:04.000Z | 2019-11-28T14:06:04.000Z | setup.py | aysa-sa/docker-registry-client | 0051598aedff49a7e853384cd038eb1f2fa5eca7 | [
"MIT"
] | null | null | null | # Author: Alejandro M. BERNARDIS
# Email: alejandro.bernardis@gmail.com
# Created: 2019/11/22 14:13
# ~
from os import path
from io import open
from setuptools import setup, find_packages
import aysa.docker.registry.__version__ as registry
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'readme... | 26.962264 | 65 | 0.656403 |
from os import path
from io import open
from setuptools import setup, find_packages
import aysa.docker.registry.__version__ as registry
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'readme.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name=registry.__title__,
... | true | true |
f748c56c4f2f9399b2fc41ce758be0fe860841f8 | 2,325 | py | Python | lib/db/database.py | knightoning/zkdash | de1eaf1f02629f87e4a75f9709bb242fcaf56c10 | [
"Apache-2.0"
] | 748 | 2015-10-15T04:06:31.000Z | 2022-01-29T09:28:37.000Z | lib/db/database.py | knightoning/zkdash | de1eaf1f02629f87e4a75f9709bb242fcaf56c10 | [
"Apache-2.0"
] | 30 | 2015-10-18T09:56:42.000Z | 2021-02-19T05:55:23.000Z | lib/db/database.py | knightoning/zkdash | de1eaf1f02629f87e4a75f9709bb242fcaf56c10 | [
"Apache-2.0"
] | 243 | 2015-10-15T06:59:48.000Z | 2022-03-19T18:58:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014,掌阅科技
All rights reserved.
摘 要: database.py
创 建 者: WangLichao
创建日期: 2015-01-26
"""
# pylint: disable=invalid-name, bare-except
from lib.db.retrydb import MyRetryDB
from peewee import Model as _Model
from peewee import DoesNotExist
from peewee impo... | 24.734043 | 75 | 0.489892 |
from lib.db.retrydb import MyRetryDB
from peewee import Model as _Model
from peewee import DoesNotExist
from peewee import OperationalError
class Database(object):
def __init__(self, **connect_kwargs):
self.connect_kwargs = connect_kwargs
self.load_database()
self.Model = self.get_mo... | true | true |
f748c582f5337911e30c347a0bf7af47b78ad101 | 2,338 | py | Python | tests/integration/element__scroll_to__test.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | 572 | 2015-05-16T19:06:05.000Z | 2022-03-20T08:37:42.000Z | tests/integration/element__scroll_to__test.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | 341 | 2015-11-16T12:16:27.000Z | 2022-03-30T05:57:52.000Z | tests/integration/element__scroll_to__test.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | 160 | 2015-07-05T14:13:18.000Z | 2022-03-02T22:01:41.000Z | # MIT License
#
# Copyright (c) 2015-2021 Iakiv Kramarenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | 39.627119 | 80 | 0.7284 |
from selene import be, command
from tests.integration.helpers.givenpage import GivenPage
def test_can_scroll_to_element_manually(session_browser):
session_browser.driver.set_window_size(1000, 100)
GivenPage(session_browser.driver).opened_with_body(
'''
<div id="paragraph" ... | true | true |
f748c59573e10b0badb53a86f6895c048e12204b | 1,641 | py | Python | learn_anaconda/learn_ml/ep5.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | 2 | 2019-08-04T17:30:53.000Z | 2020-09-21T08:39:55.000Z | learn_anaconda/learn_ml/ep5.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | 5 | 2019-10-31T14:55:58.000Z | 2022-02-26T04:06:39.000Z | learn_anaconda/learn_ml/ep5.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | null | null | null | from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from scipy.spatial import distance
import random
def euc(a, b):
return distance.euclidean(a, b)
# random classifier
class ScrappyRandom:
def fit(self, x_train, y_train):
self.... | 24.492537 | 71 | 0.662401 | from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from scipy.spatial import distance
import random
def euc(a, b):
return distance.euclidean(a, b)
class ScrappyRandom:
def fit(self, x_train, y_train):
self.x_train = x_train
... | true | true |
f748c689e7964d06a9aed27475976a7ffdd41c1c | 22,066 | py | Python | pyscf/mcscf/test/test_addons.py | umamibeef/pyscf | 1263d54b02914caf4476a3ed9a2de5e0c848954c | [
"Apache-2.0"
] | 501 | 2018-12-06T23:48:17.000Z | 2022-03-31T11:53:18.000Z | pyscf/mcscf/test/test_addons.py | fabijan5/pyscf | 09834c8f5a4f5320cdde29d285b6ccd89b3263e0 | [
"Apache-2.0"
] | 710 | 2018-11-26T22:04:52.000Z | 2022-03-30T03:53:12.000Z | pyscf/mcscf/test/test_addons.py | fabijan5/pyscf | 09834c8f5a4f5320cdde29d285b6ccd89b3263e0 | [
"Apache-2.0"
] | 273 | 2018-11-26T10:10:24.000Z | 2022-03-30T12:25:28.000Z | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 44.132 | 220 | 0.609535 |
import copy
import unittest
from functools import reduce
import numpy, scipy
from pyscf import lib
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import fci
b = 1.4
mol = gto.Mole()
mol.build(
verbose = 7,
output = '/dev/null',
atom = [
['N',( 0.000000, 0.000000, -b... | true | true |
f748c69e21156e193e1ec1a7d9e992605164257c | 9,800 | py | Python | HPEDA/FSANet_Train.py | C3Imaging/SyntheticHeadPose | b139aeda41ace2a07138705a4997d2ea65cb11a6 | [
"MIT"
] | 1 | 2021-02-03T09:49:50.000Z | 2021-02-03T09:49:50.000Z | HPEDA/FSANet_Train.py | C3Imaging/SyntheticHeadPose | b139aeda41ace2a07138705a4997d2ea65cb11a6 | [
"MIT"
] | 1 | 2022-03-25T07:30:38.000Z | 2022-03-25T07:33:48.000Z | HPEDA/FSANet_Train.py | C3Imaging/SyntheticHeadPose | b139aeda41ace2a07138705a4997d2ea65cb11a6 | [
"MIT"
] | null | null | null | import time
import sys
import argparse
import datetime
import pathlib
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
# Set seed
torch.manual_seed(0)
# Where to add a new import
from torch.optim.lr_scheduler import StepLR
# from torch.utils.tensorboard import SummaryWriter
... | 35.507246 | 109 | 0.551735 | import time
import sys
import argparse
import datetime
import pathlib
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
torch.manual_seed(0)
from torch.optim.lr_scheduler import StepLR
import datasets
from HPEDA.FSANetDA import FSANet
from utils import AverageMeter
de... | true | true |
f748c6eef9ed81b5657e3dadb49ca344b09f2893 | 5,117 | py | Python | tests/compare_with_ctg/fit_ac_fc/compare_fit_ac_fc.py | bpmunson/ctg | 1407f652fe7aa7df0566d8f619437515aab2e380 | [
"MIT"
] | 2 | 2018-08-24T18:45:19.000Z | 2019-06-26T22:15:00.000Z | tests/compare_with_ctg/fit_ac_fc/compare_fit_ac_fc.py | bpmunson/ctg | 1407f652fe7aa7df0566d8f619437515aab2e380 | [
"MIT"
] | 2 | 2018-08-28T16:43:51.000Z | 2020-07-08T16:01:01.000Z | tests/compare_with_ctg/fit_ac_fc/compare_fit_ac_fc.py | bpmunson/ctg | 1407f652fe7aa7df0566d8f619437515aab2e380 | [
"MIT"
] | 1 | 2020-04-07T18:25:30.000Z | 2020-04-07T18:25:30.000Z | import numpy as np
import pandas as pd
import os
import sys
sys.path.insert(0, "../../../ctg/core")
#from fit_ac_fc import *
from fit_ac_fc2 import Counts
from config import config
abundance_file = os.path.join(config.A549_test, "A549_abundance_thresholds.txt")
counts_file = os.path.join(config.A549_test, "A549_time... | 31.20122 | 110 | 0.615595 | import numpy as np
import pandas as pd
import os
import sys
sys.path.insert(0, "../../../ctg/core")
from fit_ac_fc2 import Counts
from config import config
abundance_file = os.path.join(config.A549_test, "A549_abundance_thresholds.txt")
counts_file = os.path.join(config.A549_test, "A549_timepoint_counts.txt")
time... | true | true |
f748c9fa93f9703acb3b325e70a90737cad5856b | 4,236 | py | Python | ROAR/planning_module/mission_planner/waypoint_following_mission_planner.py | mavabene/ROAR | 51955293ad87128ec2c549142abf91d45314f380 | [
"Apache-2.0"
] | null | null | null | ROAR/planning_module/mission_planner/waypoint_following_mission_planner.py | mavabene/ROAR | 51955293ad87128ec2c549142abf91d45314f380 | [
"Apache-2.0"
] | null | null | null | ROAR/planning_module/mission_planner/waypoint_following_mission_planner.py | mavabene/ROAR | 51955293ad87128ec2c549142abf91d45314f380 | [
"Apache-2.0"
] | null | null | null | from ROAR.planning_module.mission_planner.mission_planner import (
MissionPlanner,
)
from pathlib import Path
import logging
from typing import List, Optional
from ROAR.utilities_module.data_structures_models import Transform, Location, Rotation
from collections import deque
from ROAR.agent_module.agent import Agen... | 36.205128 | 106 | 0.605052 | from ROAR.planning_module.mission_planner.mission_planner import (
MissionPlanner,
)
from pathlib import Path
import logging
from typing import List, Optional
from ROAR.utilities_module.data_structures_models import Transform, Location, Rotation
from collections import deque
from ROAR.agent_module.agent import Agen... | true | true |
f748ca585b30b621a1cc377c8a2fa877efa0fbd9 | 419 | py | Python | backend/delicate_forest_30319/wsgi.py | crowdbotics-apps/delicate-forest-30319 | bbfa9461c8f56a6aa12ca808a59c93f26f203210 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/delicate_forest_30319/wsgi.py | crowdbotics-apps/delicate-forest-30319 | bbfa9461c8f56a6aa12ca808a59c93f26f203210 | [
"FTL",
"AML",
"RSA-MD"
] | 31 | 2021-09-05T01:17:30.000Z | 2022-02-06T17:28:58.000Z | backend/delicate_forest_30319/wsgi.py | crowdbotics-apps/delicate-forest-30319 | bbfa9461c8f56a6aa12ca808a59c93f26f203210 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for delicate_forest_30319 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault... | 24.647059 | 81 | 0.799523 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'delicate_forest_30319.settings')
application = get_wsgi_application()
| true | true |
f748ca6e048700cdf093738524bffc4366879d73 | 3,997 | py | Python | tle_storage_service/tle.py | NikitaKoshelev/tle-storage-service | b891750fbff500ce03784fcd3fd6e0e8c568cd9c | [
"MIT"
] | null | null | null | tle_storage_service/tle.py | NikitaKoshelev/tle-storage-service | b891750fbff500ce03784fcd3fd6e0e8c568cd9c | [
"MIT"
] | null | null | null | tle_storage_service/tle.py | NikitaKoshelev/tle-storage-service | b891750fbff500ce03784fcd3fd6e0e8c568cd9c | [
"MIT"
] | 2 | 2018-03-14T14:39:10.000Z | 2022-02-20T13:11:36.000Z | # -*- coding: utf-8 -*-
import json
from datetime import datetime
import sqlalchemy as sa
from aiopg.sa.result import ResultProxy
from .db import TLE, insert_tle
from .log import logger
from .utils import audit, send_pg_notify
__all__ = (
'get_tle_dt',
'nasa',
'space_track',
)
@audit(logger=logger)
asy... | 31.472441 | 102 | 0.596948 |
import json
from datetime import datetime
import sqlalchemy as sa
from aiopg.sa.result import ResultProxy
from .db import TLE, insert_tle
from .log import logger
from .utils import audit, send_pg_notify
__all__ = (
'get_tle_dt',
'nasa',
'space_track',
)
@audit(logger=logger)
async def space_track(engi... | true | true |
f748cc8796bf3114a59071e4b7c9c0897fac5887 | 289 | py | Python | pythonProject/05al144Subprocess_executar programas e comandos externos/processos.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | pythonProject/05al144Subprocess_executar programas e comandos externos/processos.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | pythonProject/05al144Subprocess_executar programas e comandos externos/processos.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | import subprocess
#Windows - ping 127.0.0.1
#Linux - ping 127.0.0.1 -c 4
# arg0 arg1 arg2 arg3
proc = subprocess.run(
['ping', '127.0.0.1', '-c', '4'],
capture_output=True,
text=True
)
saida = proc.stdout
saida = saida.replace('icmp_seq', 'Dwolter')
print(saida) | 20.642857 | 44 | 0.615917 | import subprocess
proc = subprocess.run(
['ping', '127.0.0.1', '-c', '4'],
capture_output=True,
text=True
)
saida = proc.stdout
saida = saida.replace('icmp_seq', 'Dwolter')
print(saida) | true | true |
f748ccaac94ce45baf7cb45260783933ddd51692 | 3,011 | py | Python | parsers/ecdc.py | rcbevans/covid19_scenarios_data | 4ab313e9feb65e816a06d6995e7ddf568780a0e8 | [
"MIT"
] | null | null | null | parsers/ecdc.py | rcbevans/covid19_scenarios_data | 4ab313e9feb65e816a06d6995e7ddf568780a0e8 | [
"MIT"
] | null | null | null | parsers/ecdc.py | rcbevans/covid19_scenarios_data | 4ab313e9feb65e816a06d6995e7ddf568780a0e8 | [
"MIT"
] | null | null | null | '''
parse country case counts provided by ECDC and write results to TSV
this should be run from the top level of the repo.
Will need to be integrated with other parsers once they become available.
'''
import xlrd
import csv
import json
from urllib.request import urlretrieve
from collections import defaultdict
from da... | 32.376344 | 115 | 0.582531 | import xlrd
import csv
import json
from urllib.request import urlretrieve
from collections import defaultdict
from datetime import datetime, timedelta
from .utils import sorted_date, parse_countries, stoi, store_data
URL = "https://www.ecdc.europa.eu/sites/default/files/documents/COVID-19-geographic-disbtribution... | true | true |
f748cce9b2cdd233330b444202bf55f57327fc77 | 636 | py | Python | keystone/contrib/stats/__init__.py | raildo/keystone-1 | 2b26e45b72e03e64d18dc55cff7db24b7d1b4d5f | [
"Apache-2.0"
] | null | null | null | keystone/contrib/stats/__init__.py | raildo/keystone-1 | 2b26e45b72e03e64d18dc55cff7db24b7d1b4d5f | [
"Apache-2.0"
] | null | null | null | keystone/contrib/stats/__init__.py | raildo/keystone-1 | 2b26e45b72e03e64d18dc55cff7db24b7d1b4d5f | [
"Apache-2.0"
] | 1 | 2021-08-29T16:53:06.000Z | 2021-08-29T16:53:06.000Z | # Copyright 2012 OpenStack Foundation
#
# 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... | 39.75 | 75 | 0.764151 |
from keystone.contrib.stats.core import *
| true | true |
f748ccfe1ceed3c80096c66c0cb5e43aeeb730f3 | 2,886 | py | Python | detect_video.py | ChouaibBELILITA/Final_year_Project | 688cdeaeabb46fc3f924bb29c2e92865be421d26 | [
"MIT"
] | null | null | null | detect_video.py | ChouaibBELILITA/Final_year_Project | 688cdeaeabb46fc3f924bb29c2e92865be421d26 | [
"MIT"
] | null | null | null | detect_video.py | ChouaibBELILITA/Final_year_Project | 688cdeaeabb46fc3f924bb29c2e92865be421d26 | [
"MIT"
] | null | null | null | import time
from absl import app, flags, logging
from absl.flags import FLAGS
import cv2
import tensorflow as tf
from yolov3_tf2.models import (
YoloV3, YoloV3Tiny
)
from yolov3_tf2.dataset import transform_images
from yolov3_tf2.utils import draw_outputs
flags.DEFINE_string('classes', './data/face.names', 'path ... | 31.369565 | 99 | 0.643105 | import time
from absl import app, flags, logging
from absl.flags import FLAGS
import cv2
import tensorflow as tf
from yolov3_tf2.models import (
YoloV3, YoloV3Tiny
)
from yolov3_tf2.dataset import transform_images
from yolov3_tf2.utils import draw_outputs
flags.DEFINE_string('classes', './data/face.names', 'path ... | true | true |
f748cd466f1f2b11a4ac1b37d95bf0ada75aad3b | 48 | py | Python | djangocms_column/__init__.py | SocialSchools/djangocms-column | 83d9f0aa598b3b0823a364382133cb68d1588389 | [
"BSD-3-Clause"
] | null | null | null | djangocms_column/__init__.py | SocialSchools/djangocms-column | 83d9f0aa598b3b0823a364382133cb68d1588389 | [
"BSD-3-Clause"
] | null | null | null | djangocms_column/__init__.py | SocialSchools/djangocms-column | 83d9f0aa598b3b0823a364382133cb68d1588389 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
__version__ = "1.10.0"
| 12 | 23 | 0.520833 |
__version__ = "1.10.0"
| true | true |
f748cf2e2309de88769ca943c2c1d264ac88002a | 262 | py | Python | whattimeis/scripts/webserver.py | ZhangLSW/HomeWork2 | efe21510d75424bbd617ab546e029c7197fa592b | [
"MIT"
] | null | null | null | whattimeis/scripts/webserver.py | ZhangLSW/HomeWork2 | efe21510d75424bbd617ab546e029c7197fa592b | [
"MIT"
] | null | null | null | whattimeis/scripts/webserver.py | ZhangLSW/HomeWork2 | efe21510d75424bbd617ab546e029c7197fa592b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy, os
import SimpleHTTPServer
def kill():
os.system("kill -KILL " + str(os.getpid()))
os.chdir(os.path.dirname(__file__))
rospy.init_node("webserver")
rospy.on_shutdown(kill)
SimpleHTTPServer.test()
| 20.153846 | 47 | 0.706107 |
import rospy, os
import SimpleHTTPServer
def kill():
os.system("kill -KILL " + str(os.getpid()))
os.chdir(os.path.dirname(__file__))
rospy.init_node("webserver")
rospy.on_shutdown(kill)
SimpleHTTPServer.test()
| true | true |
f748d0117c3093c7786fbe49cbb48bb991f7171b | 12,170 | py | Python | src/garage/tf/regressors/bernoulli_mlp_regressor.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | 1 | 2021-03-02T08:43:20.000Z | 2021-03-02T08:43:20.000Z | src/garage/tf/regressors/bernoulli_mlp_regressor.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | null | null | null | src/garage/tf/regressors/bernoulli_mlp_regressor.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | null | null | null | """Bernoulli MLP Regressor based on MLP with Normalized Inputs."""
from dowel import tabular
import numpy as np
import tensorflow as tf
from garage.tf.distributions import Bernoulli
from garage.tf.misc import tensor_utils
from garage.tf.models import NormalizedInputMLPModel
from garage.tf.optimizers import Con... | 39.512987 | 80 | 0.582662 | from dowel import tabular
import numpy as np
import tensorflow as tf
from garage.tf.distributions import Bernoulli
from garage.tf.misc import tensor_utils
from garage.tf.models import NormalizedInputMLPModel
from garage.tf.optimizers import ConjugateGradientOptimizer, LbfgsOptimizer
from garage.tf.regressors.r... | true | true |
f748d0707cafd3c056be6fa65851296d85a08375 | 2,606 | py | Python | blog/views/views_factory.py | hentt30/education4all | 8f930ade7303fe65355cfe4b2ba66787acad93b4 | [
"MIT"
] | null | null | null | blog/views/views_factory.py | hentt30/education4all | 8f930ade7303fe65355cfe4b2ba66787acad93b4 | [
"MIT"
] | null | null | null | blog/views/views_factory.py | hentt30/education4all | 8f930ade7303fe65355cfe4b2ba66787acad93b4 | [
"MIT"
] | 2 | 2021-06-18T08:13:17.000Z | 2021-12-03T05:08:41.000Z | """
Implements a factory for view classes
"""
from abc import ABC, abstractmethod
from blog.views.about_us import AboutUs
from .posts import PostDetail, PostList, PostListAlgorithms, PostListMathematics
from .contact import ContactUs
from .about_us import AboutUs
class ViewsFactory(ABC):
"""
Generates view ob... | 23.477477 | 80 | 0.630084 | from abc import ABC, abstractmethod
from blog.views.about_us import AboutUs
from .posts import PostDetail, PostList, PostListAlgorithms, PostListMathematics
from .contact import ContactUs
from .about_us import AboutUs
class ViewsFactory(ABC):
@abstractmethod
def create(self):
class PostsDetailFactory(ViewsF... | true | true |
f748d26a52d6a31f3ca5fec4f40b649555f071b5 | 2,103 | py | Python | backend/apps/core/middleware/healthchecks.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | 1 | 2020-07-06T12:34:50.000Z | 2020-07-06T12:34:50.000Z | backend/apps/core/middleware/healthchecks.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | null | null | null | backend/apps/core/middleware/healthchecks.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | null | null | null | """
https://www.ianlewis.org/en/kubernetes-health-checks-django
"""
import logging
import os
import redis
from django.http import HttpResponse, HttpResponseServerError
logger = logging.getLogger("django")
r = redis.Redis(host=os.environ.get("REDIS_SERVICE_HOST"))
class HealthCheckMiddleware(object):
def __init... | 31.38806 | 79 | 0.59106 | import logging
import os
import redis
from django.http import HttpResponse, HttpResponseServerError
logger = logging.getLogger("django")
r = redis.Redis(host=os.environ.get("REDIS_SERVICE_HOST"))
class HealthCheckMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
... | true | true |
f748d4bee0bfbe2f558066c6eeac8be68576af91 | 963 | py | Python | editfile.py | cogini/ldapsh | 91d574a19a4d58b052c8a8339c6b377cdb5e02d4 | [
"Apache-2.0"
] | null | null | null | editfile.py | cogini/ldapsh | 91d574a19a4d58b052c8a8339c6b377cdb5e02d4 | [
"Apache-2.0"
] | null | null | null | editfile.py | cogini/ldapsh | 91d574a19a4d58b052c8a8339c6b377cdb5e02d4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Utility functions to spawn an editor to edit a file
import os
import stat
import tempfile
class FileNotFoundError: pass
default_editor = "vi"
def edit_file (filename):
"Spawn an editor to edit the specified file."
if not filename:
raise FileNotFoundError, "Could not open file (%s)" % fi... | 19.653061 | 64 | 0.712357 |
import os
import stat
import tempfile
class FileNotFoundError: pass
default_editor = "vi"
def edit_file (filename):
"Spawn an editor to edit the specified file."
if not filename:
raise FileNotFoundError, "Could not open file (%s)" % filename
try:
editor = os.getenv('EDITOR')
except KeyError:
editor = ... | false | true |
f748d632409b11f9fc7d545d3892dcda883a0a4d | 5,122 | py | Python | docs/conf.py | PEPEcoin/py-evm | 455f1b7bbd284f8ab9760194314672681c025a8b | [
"MIT"
] | 2 | 2018-05-03T03:02:36.000Z | 2018-05-03T03:02:39.000Z | docs/conf.py | PEPEcoin/py-evm | 455f1b7bbd284f8ab9760194314672681c025a8b | [
"MIT"
] | null | null | null | docs/conf.py | PEPEcoin/py-evm | 455f1b7bbd284f8ab9760194314672681c025a8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the... | 28.455556 | 79 | 0.646232 |
import os
about_fields = [
'author',
'description',
'name',
'url',
'version',
]
about = {}
DIR = os.path.dirname('__file__')
with open(os.path.join(DIR, '../setup.py'), 'r') as f:
for line in f:
for field in about_fields:
if ' ' + field + '=' in line:
... | true | true |
f748d64e91b0338f7a9b1ee6155192ba2aa19808 | 4,108 | py | Python | prenoms/utils.py | cnovel/prenoms | e59b7ed886745fde4fe6b5657b96038ebc7da9db | [
"MIT"
] | 2 | 2020-05-08T13:47:19.000Z | 2021-09-19T19:50:29.000Z | prenoms/utils.py | cnovel/prenoms | e59b7ed886745fde4fe6b5657b96038ebc7da9db | [
"MIT"
] | 10 | 2020-05-08T14:07:18.000Z | 2021-05-17T17:16:06.000Z | prenoms/utils.py | cnovel/prenoms | e59b7ed886745fde4fe6b5657b96038ebc7da9db | [
"MIT"
] | null | null | null | from os.path import abspath, join, dirname
import random
from math import floor
from enum import Enum
def full_names_path(filename: str):
return abspath(join(dirname(__file__), 'data', filename))
FILES = {}
for t in ['first', 'last']:
for gdr in ['.m', '.f']:
# Years
for y in range(1891, 202... | 27.205298 | 89 | 0.543087 | from os.path import abspath, join, dirname
import random
from math import floor
from enum import Enum
def full_names_path(filename: str):
return abspath(join(dirname(__file__), 'data', filename))
FILES = {}
for t in ['first', 'last']:
for gdr in ['.m', '.f']:
for y in range(1891, 2021, 10):... | true | true |
f748d726e6563b39dea87acd38b640915c041236 | 183 | py | Python | python/testData/optimizeImports/blankLineBetweenDocstringAndFirstImportPreserved.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/optimizeImports/blankLineBetweenDocstringAndFirstImportPreserved.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/optimizeImports/blankLineBetweenDocstringAndFirstImportPreserved.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | # pylint: disable=missing-docstring, invalid-name
"""2016 - Day 1 Puzzle Part 2 tests."""
import sys
from mod import solve, in_between, Point
print(solve, in_between, Point, sys) | 18.3 | 49 | 0.73224 |
import sys
from mod import solve, in_between, Point
print(solve, in_between, Point, sys) | true | true |
f748d861fd72816d1e6a9e5123921b5dd2796452 | 1,468 | py | Python | torchaudio/__init__.py | mmxgn/audio | 24741fdb97b9257868ae1caf593207aa7e581b6d | [
"BSD-2-Clause"
] | null | null | null | torchaudio/__init__.py | mmxgn/audio | 24741fdb97b9257868ae1caf593207aa7e581b6d | [
"BSD-2-Clause"
] | null | null | null | torchaudio/__init__.py | mmxgn/audio | 24741fdb97b9257868ae1caf593207aa7e581b6d | [
"BSD-2-Clause"
] | null | null | null | from . import extension
from torchaudio._internal import module_utils as _mod_utils
from torchaudio import (
compliance,
datasets,
kaldi_io,
utils,
sox_effects,
transforms
)
from torchaudio.backend import (
list_audio_backends,
get_audio_backend,
set_audio_backend,
save_encinfo,
... | 25.754386 | 84 | 0.737057 | from . import extension
from torchaudio._internal import module_utils as _mod_utils
from torchaudio import (
compliance,
datasets,
kaldi_io,
utils,
sox_effects,
transforms
)
from torchaudio.backend import (
list_audio_backends,
get_audio_backend,
set_audio_backend,
save_encinfo,
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.