max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
pitchfork/serializers.py | lemoswilson/NewsAggregator | 0 | 6626051 | <gh_stars>0
from rest_framework import serializers
from .models import Pitchfork_model
class PitchforkSerializer(serializers.ModelSerializer):
class Meta:
model = Pitchfork_model
fields = ("link", "headline", "description", "date", "tags") | from rest_framework import serializers
from .models import Pitchfork_model
class PitchforkSerializer(serializers.ModelSerializer):
class Meta:
model = Pitchfork_model
fields = ("link", "headline", "description", "date", "tags") | none | 1 | 2.087067 | 2 | |
sahara/plugins/hdp/versions/versionhandlerfactory.py | esikachev/sahara-backup | 0 | 6626052 | <reponame>esikachev/sahara-backup
# Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | # Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | en | 0.86972 | # Copyright (c) 2013 Hortonworks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ... | 1.86255 | 2 |
igibson/external/motion/__init__.py | mamadbiabon/iGibson | 360 | 6626053 | """
Developed by <NAME> in pybullet-planning repository (https://github.com/caelan/pybullet-planning)
and adapted by iGibson team.
"""
| """
Developed by <NAME> in pybullet-planning repository (https://github.com/caelan/pybullet-planning)
and adapted by iGibson team.
"""
| en | 0.875557 | Developed by <NAME> in pybullet-planning repository (https://github.com/caelan/pybullet-planning) and adapted by iGibson team. | 1.205642 | 1 |
Pyron/Engine/Saving/SaveScene.py | Dmunch04/PyronEngine | 1 | 6626054 | import os
def SaveScene (_Scene, _Path = ''):
"""
Saves the given window/scene into a folder called 'Build'
Files in the folder:
Scene.eve
Models
- Model1.obj
- Model2.obj
- etc.
"""
if _Path.endswith ('/'):
Pa... | import os
def SaveScene (_Scene, _Path = ''):
"""
Saves the given window/scene into a folder called 'Build'
Files in the folder:
Scene.eve
Models
- Model1.obj
- Model2.obj
- etc.
"""
if _Path.endswith ('/'):
Pa... | en | 0.463232 | Saves the given window/scene into a folder called 'Build' Files in the folder: Scene.eve Models - Model1.obj - Model2.obj - etc. Camera = [ f"'{_Scene.Camera.znear}'", f"'{_Scene.Camera.zfar}'", f"'{_Scene.Camera.nam... | 3.265284 | 3 |
official/modeling/tf_utils.py | akshit-protonn/models | 8 | 6626055 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | en | 0.744561 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 2.451432 | 2 |
userbot/modules/qoroskop.py | im-bb/CyberUserBot | 2 | 6626056 | <reponame>im-bb/CyberUserBot<gh_stars>1-10
# Copyright (C) 2021 CyberUserBot.
#
# All rights reserved.
import pyaztro
from userbot.events import register
from userbot.cmdhelp import CmdHelp
CYBER = ""
@register(outgoing=True, disable_errors=True, pattern=r"^\.qoroskop (.*)")
async def cyber(e):
await e.edit("M... | # Copyright (C) 2021 CyberUserBot.
#
# All rights reserved.
import pyaztro
from userbot.events import register
from userbot.cmdhelp import CmdHelp
CYBER = ""
@register(outgoing=True, disable_errors=True, pattern=r"^\.qoroskop (.*)")
async def cyber(e):
await e.edit("Məlumatlar hazırlanır..\nBu biraz vaxt apara... | en | 0.74155 | # Copyright (C) 2021 CyberUserBot. # # All rights reserved. | 2.238956 | 2 |
Lab 2/coding_class_1/coding_class_1.py | BrendonPurchase2002-CS/Projects- | 0 | 6626057 | <filename>Lab 2/coding_class_1/coding_class_1.py
# author: <NAME>
# Student Number: 119473576
def all_pairs(s1, s2):
"""
:param s1: = list/string
:param s2: = list/string
:return: = a list with all pairs of elements from list s1 and s2 respectively, with the second element varying more
rapidly t... | <filename>Lab 2/coding_class_1/coding_class_1.py
# author: <NAME>
# Student Number: 119473576
def all_pairs(s1, s2):
"""
:param s1: = list/string
:param s2: = list/string
:return: = a list with all pairs of elements from list s1 and s2 respectively, with the second element varying more
rapidly t... | en | 0.804111 | # author: <NAME> # Student Number: 119473576 :param s1: = list/string :param s2: = list/string :return: = a list with all pairs of elements from list s1 and s2 respectively, with the second element varying more rapidly than the first | 3.670386 | 4 |
Mundo 2/ex036.py | Alef-Martins/Exercicios_python_mundo-2 | 0 | 6626058 | #Escreva um programa para aprovar o empréstimo bancário para a compra de uma casa. Pergunte o valor da casa, o salário do comprador e em quantos anos ele vai pagar. A prestação mensal não pode exeder 30% do salário do comprador ou o empréstimo será negado.
valor = float(input('Informe o valor da casa: '))
salario = flo... | #Escreva um programa para aprovar o empréstimo bancário para a compra de uma casa. Pergunte o valor da casa, o salário do comprador e em quantos anos ele vai pagar. A prestação mensal não pode exeder 30% do salário do comprador ou o empréstimo será negado.
valor = float(input('Informe o valor da casa: '))
salario = flo... | pt | 0.9954 | #Escreva um programa para aprovar o empréstimo bancário para a compra de uma casa. Pergunte o valor da casa, o salário do comprador e em quantos anos ele vai pagar. A prestação mensal não pode exeder 30% do salário do comprador ou o empréstimo será negado. | 4.151836 | 4 |
code/processing/growth_rates/2021-07-25_r1_SingleKO_glucose/processing.py | cremerlab/useless_expression | 0 | 6626059 | #%%
import numpy as np
import pandas as pd
import futileprot.io
import futileprot.viz
import altair as alt
import altair_saver
colors, palette = futileprot.viz.altair_style()
# Define experiment parameters
DATE = '2021-07-25'
STRAINS = 'SingleKO'
MEDIUM = 'glucose'
RUN_NO = 1
ROOT = '../../../..'
SKIPROWS = 28
OD_B... | #%%
import numpy as np
import pandas as pd
import futileprot.io
import futileprot.viz
import altair as alt
import altair_saver
colors, palette = futileprot.viz.altair_style()
# Define experiment parameters
DATE = '2021-07-25'
STRAINS = 'SingleKO'
MEDIUM = 'glucose'
RUN_NO = 1
ROOT = '../../../..'
SKIPROWS = 28
OD_B... | en | 0.576668 | #%% # Define experiment parameters # Add the well identifiers # Generate a list of all valid wells # Load the data # Melt and drop unnecessary stuff # Add strain identifier and replicates # Add information regarding date and growth medium # Convert time to elapsed time # Drop unnecessary Time columns # Reformat blank v... | 2.261472 | 2 |
ample/util/logging_util.py | fsimkovic/ample | 6 | 6626060 | from enum import Enum
import json
import logging.config
import os
import sys
from ample.constants import AMPLE_LOGGER_CONFIG
class LogColors(Enum):
"""Color container for log messages"""
CRITICAL = 31
DEBUG = 34
DEFAULT = 0
ERROR = 31
WARNING = 33
class LogColorFormatter(logging.Formatter)... | from enum import Enum
import json
import logging.config
import os
import sys
from ample.constants import AMPLE_LOGGER_CONFIG
class LogColors(Enum):
"""Color container for log messages"""
CRITICAL = 31
DEBUG = 34
DEFAULT = 0
ERROR = 31
WARNING = 33
class LogColorFormatter(logging.Formatter)... | en | 0.553172 | Color container for log messages Formatter for log messages Read JSON config for logger and return root logger Also sets the path to the AMPLE logfile in the dictionary (required for pyrvapi) Set up logging to the console - required for the individual modules. Parameters ---------- level : int... | 2.596921 | 3 |
setup.py | johncollins/metric-learn | 4 | 6626061 | <gh_stars>1-10
# setup.py
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Create the setup dict
setup_args = {
'name' : 'metric-learn',
'version' : '0.0.0',
'author' : '<NAME>',
'author_email' : '<EMAIL>',
'packages' : ['metric_learn', 'metric_learn.... | # setup.py
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Create the setup dict
setup_args = {
'name' : 'metric-learn',
'version' : '0.0.0',
'author' : '<NAME>',
'author_email' : '<EMAIL>',
'packages' : ['metric_learn', 'metric_learn.test'],
'sc... | en | 0.658495 | # setup.py # Create the setup dict | 1.404083 | 1 |
torch_points_kernels/gridding.py | maskjp/torch-points-kernels | 0 | 6626062 | import torch
from torch.cuda.amp import custom_bwd,custom_fwd
if torch.cuda.is_available():
import torch_points_kernels.points_cuda as tpcuda
class GriddingFunction(torch.autograd.Function):
@staticmethod
@custom_fwd(cast_inputs=torch.half)
def forward(ctx, ptcloud, scale):
if not torch.cuda.... | import torch
from torch.cuda.amp import custom_bwd,custom_fwd
if torch.cuda.is_available():
import torch_points_kernels.points_cuda as tpcuda
class GriddingFunction(torch.autograd.Function):
@staticmethod
@custom_fwd(cast_inputs=torch.half)
def forward(ctx, ptcloud, scale):
if not torch.cuda.... | en | 0.70657 | # print(grid.size()) # torch.Size(batch_size, n_grid_vertices) # print(grid_pt_weights.size()) # torch.Size(batch_size, n_pts, 8, 3) # print(grid_pt_indexes.size()) # torch.Size(batch_size, n_pts, 8) # print(grad_ptcloud.size()) # torch.Size(batch_size, n_pts, 3) Converts the input point clouds into 3D ... | 2.613104 | 3 |
sdk/python/pulumi_azure_native/appconfiguration/v20200601/get_configuration_store.py | sebtelko/pulumi-azure-native | 0 | 6626063 | <gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _u... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | en | 0.853487 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The configuration store along with all resource properties. The Configuration Store will have all information to begin utilizing it. The creation date o... | 1.731057 | 2 |
lexicon/tests/providers/test_transip.py | nextgens/lexicon | 0 | 6626064 | <filename>lexicon/tests/providers/test_transip.py
"""Integration tests for Transip"""
import re
from unittest import TestCase
import pytest
from lexicon.tests.providers.integration_tests import (
IntegrationTestsV2,
vcr_integration_test,
)
FAKE_KEY = """
-----<KEY>
"""
# Currently TransipProviderTests class... | <filename>lexicon/tests/providers/test_transip.py
"""Integration tests for Transip"""
import re
from unittest import TestCase
import pytest
from lexicon.tests.providers.integration_tests import (
IntegrationTestsV2,
vcr_integration_test,
)
FAKE_KEY = """
-----<KEY>
"""
# Currently TransipProviderTests class... | en | 0.793803 | Integration tests for Transip -----<KEY> # Currently TransipProviderTests class is configured to use a fake key so that the CI system does # not need an actual key when integration tests are run with the recorded cassettes. # If you want to run again manually the integration tests against the live API, and so use a val... | 2.218884 | 2 |
app_widget.py | project-k-0-1/project-k | 1 | 6626065 | <gh_stars>1-10
""" App widget functionalities """
from app_head import get_head
from app_body import get_body
from app_page import set_page
from app_loading import get_loading_head, get_loading_body
from app_ogp import set_ogp
from app_title import get_title
from app_metatags import get_metatags
from bootstrap import g... | """ App widget functionalities """
from app_head import get_head
from app_body import get_body
from app_page import set_page
from app_loading import get_loading_head, get_loading_body
from app_ogp import set_ogp
from app_title import get_title
from app_metatags import get_metatags
from bootstrap import get_bootstrap
fr... | en | 0.102377 | App widget functionalities #------------------------------------------------------------------------------- # Insert here module of the widget to load #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- xxx xxx | 1.368214 | 1 |
run_predictions.py | MingshuLiang/caltech-ee148-spring2020-hw01 | 0 | 6626066 | import os
import numpy as np
import json
from PIL import Image, ImageDraw
import matplotlib.pyplot as plt
def detect_red_light(I, kernel):
'''
This function takes a numpy array <I> and a numpy array <kernel> and returns a list <bounding_boxes>.
The list <bounding_boxes> should have one element for each red... | import os
import numpy as np
import json
from PIL import Image, ImageDraw
import matplotlib.pyplot as plt
def detect_red_light(I, kernel):
'''
This function takes a numpy array <I> and a numpy array <kernel> and returns a list <bounding_boxes>.
The list <bounding_boxes> should have one element for each red... | en | 0.676291 | This function takes a numpy array <I> and a numpy array <kernel> and returns a list <bounding_boxes>. The list <bounding_boxes> should have one element for each red light in the image. Each element of <bounding_boxes> should itself be a list, containing four integers that specify a bounding box: the row a... | 3.314515 | 3 |
Wrapping/Generators/Python/itk/support/itkBase.py | okaerin/ITK | 0 | 6626067 | # ==========================================================================
#
# Copyright NumFOCUS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | # ==========================================================================
#
# Copyright NumFOCUS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | en | 0.744796 | # ========================================================================== # # Copyright NumFOCUS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/... | 1.942755 | 2 |
models/ClassicNetwork/blocks/SK_block.py | Dou-Yu-xuan/deep-learning-visal | 150 | 6626068 | import torch.nn as nn
from functools import reduce
class SKConv(nn.Module):
def __init__(self,in_channels,out_channels,stride=1,M=2,r=16,L=32):
super(SKConv,self).__init__()
d=max(in_channels//r,L)
self.M=M
self.out_channels=out_channels
self.conv=nn.ModuleList()
... | import torch.nn as nn
from functools import reduce
class SKConv(nn.Module):
def __init__(self,in_channels,out_channels,stride=1,M=2,r=16,L=32):
super(SKConv,self).__init__()
d=max(in_channels//r,L)
self.M=M
self.out_channels=out_channels
self.conv=nn.ModuleList()
... | en | 0.659338 | #the part of split #print(i,conv(input).size()) #the part of fusion #the part of selection #split to a and b Constructor
Args:
features: input channel dimensionality.
M: the number of branchs.
G: num of convolution groups.
r: the ratio for compute d, the leng... | 2.641925 | 3 |
resolwe/flow/executors/startup_communication_container.py | gregorjerse/resolwe | 0 | 6626069 | """Communication container startup script."""
import asyncio
import functools
import logging
import os
import shutil
import signal
import sys
from contextlib import suppress
from distutils.util import strtobool
from pathlib import Path
from typing import Optional
import zmq
import zmq.asyncio
from executors.collect i... | """Communication container startup script."""
import asyncio
import functools
import logging
import os
import shutil
import signal
import sys
from contextlib import suppress
from distutils.util import strtobool
from pathlib import Path
from typing import Optional
import zmq
import zmq.asyncio
from executors.collect i... | en | 0.852417 | Communication container startup script. # Socket used to connect with the processing container. # Listener IP and port are read from environment. Purge the content of the secrets directory. The directory itself is mounted as volume, so it can not be deleted. Handle permission errors while removing data directories... | 2.25125 | 2 |
slack_sdk/oauth/installation_store/async_cacheable_installation_store.py | timgates42/python-slack-sdk | 0 | 6626070 | from logging import Logger
from typing import Optional, Dict
from slack_sdk.oauth.installation_store import Bot, Installation
from slack_sdk.oauth.installation_store.async_installation_store import (
AsyncInstallationStore,
)
class AsyncCacheableInstallationStore(AsyncInstallationStore):
underlying: AsyncIns... | from logging import Logger
from typing import Optional, Dict
from slack_sdk.oauth.installation_store import Bot, Installation
from slack_sdk.oauth.installation_store.async_installation_store import (
AsyncInstallationStore,
)
class AsyncCacheableInstallationStore(AsyncInstallationStore):
underlying: AsyncIns... | en | 0.470335 | A simple memory cache wrapper for any installation stores. :param installation_store: the installation store to wrap | 2.226038 | 2 |
lesson-07/pwd_strength_v3.0.py | hemiaoio/pylearning | 1 | 6626071 | """
3.0:存储密码到文件
"""
def check_number_exists(str):
isnumeric = False
for c in str:
if c.isnumeric():
isnumeric = True
break
return isnumeric
def check_letter_exists(str):
isalpha = False
for c in str:
if c.isalpha():
isalpha = True
... | """
3.0:存储密码到文件
"""
def check_number_exists(str):
isnumeric = False
for c in str:
if c.isnumeric():
isnumeric = True
break
return isnumeric
def check_letter_exists(str):
isalpha = False
for c in str:
if c.isalpha():
isalpha = True
... | zh | 0.931002 | 3.0:存储密码到文件 # 规则一:密码长度大于8 # 规则二:包含数字 # 规则三:包含字母 | 3.906351 | 4 |
venv/Lib/site-packages/jupyter_client/tests/test_public_api.py | ajayiagbebaku/NFL-Model | 7 | 6626072 | <gh_stars>1-10
"""Test the jupyter_client public API
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import jupyter_client
from jupyter_client import connect
from jupyter_client import launcher
def test_kms():
for base in ("", "Async", "Multi"):
KM ... | """Test the jupyter_client public API
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import jupyter_client
from jupyter_client import connect
from jupyter_client import launcher
def test_kms():
for base in ("", "Async", "Multi"):
KM = base + "Kerne... | en | 0.800516 | Test the jupyter_client public API # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. | 2.336477 | 2 |
setup.py | DocWinter/THSF2017 | 0 | 6626073 | from setuptools import setup
setup(
name = 'THSF Radio',
version = '1.0.0',
author = '<NAME>',
author_email = '<EMAIL>',
description = ("A simple webapp to quickly send RDS data"
"to the RPI."),
license = "BSD",
packages = ['flask', 'flask-sqlalchemy', 'flask-wtf']
) | from setuptools import setup
setup(
name = 'THSF Radio',
version = '1.0.0',
author = '<NAME>',
author_email = '<EMAIL>',
description = ("A simple webapp to quickly send RDS data"
"to the RPI."),
license = "BSD",
packages = ['flask', 'flask-sqlalchemy', 'flask-wtf']
) | none | 1 | 1.066096 | 1 | |
tests/python/pants_test/backend/jvm/tasks/jvm_compile/test_jvm_compile.py | anthonyjpratti/pants | 0 | 6626074 | <reponame>anthonyjpratti/pants<gh_stars>0
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from pants.backend.jvm.subsystems.zinc import Zinc
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backend.jv... | # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from pants.backend.jvm.subsystems.zinc import Zinc
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backend.jvm.tasks.classpath_products import Classpat... | en | 0.528453 | # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). | 1.875303 | 2 |
PycharmProjects/PythonExercicios/ex047.py | RodrigoMASRamos/Projects.py | 0 | 6626075 | <gh_stars>0
# Exercício Python #047 - Contagem de pares
#
# Crie um programa que mostre na tela TODOS OS NÚMEROS PARES que estão no intervalo entre 1 e 50.
for num in range(0, 51, 2):
print(num,end=' ')
print('\033[1;30mFoi?\033[m') | # Exercício Python #047 - Contagem de pares
#
# Crie um programa que mostre na tela TODOS OS NÚMEROS PARES que estão no intervalo entre 1 e 50.
for num in range(0, 51, 2):
print(num,end=' ')
print('\033[1;30mFoi?\033[m') | pt | 0.822812 | # Exercício Python #047 - Contagem de pares # # Crie um programa que mostre na tela TODOS OS NÚMEROS PARES que estão no intervalo entre 1 e 50. | 3.861029 | 4 |
colorList.py | handsomeguyu/get_image_color | 0 | 6626076 | <filename>colorList.py
import numpy as np
import collections
# 定义字典存放颜色分量上下限
# 例如:{颜色 [min分量, max分量]}
# {'red' [array([160, 43, 46]), array([179, 255, 255])]}
def getColorList():
dict = collections.defaultdict(list)
# 黑色
lower_black = np.array([0, 0, 0])
upper_black = np.array([180, 2... | <filename>colorList.py
import numpy as np
import collections
# 定义字典存放颜色分量上下限
# 例如:{颜色 [min分量, max分量]}
# {'red' [array([160, 43, 46]), array([179, 255, 255])]}
def getColorList():
dict = collections.defaultdict(list)
# 黑色
lower_black = np.array([0, 0, 0])
upper_black = np.array([180, 2... | zh | 0.642157 | # 定义字典存放颜色分量上下限 # 例如:{颜色 [min分量, max分量]} # {'red' [array([160, 43, 46]), array([179, 255, 255])]} # 黑色 # #灰色 # lower_gray = np.array([0, 0, 46]) # upper_gray = np.array([180, 43, 220]) # color_list = [] # color_list.append(lower_gray) # color_list.append(upper_gray) # dict['gray']=color_list # 白色 # 红色 # 红色2 # 橙色 # 黄色... | 3.315881 | 3 |
setup.py | hackingmaterials/flows | 2 | 6626077 | <filename>setup.py
from pathlib import Path
from setuptools import find_packages, setup
module_dir = Path(__file__).resolve().parent
with open(module_dir / "README.md") as f:
long_desc = f.read()
setup(
name="jobflow",
description="jobflow is library for writing computational workflows",
long_descri... | <filename>setup.py
from pathlib import Path
from setuptools import find_packages, setup
module_dir = Path(__file__).resolve().parent
with open(module_dir / "README.md") as f:
long_desc = f.read()
setup(
name="jobflow",
description="jobflow is library for writing computational workflows",
long_descri... | none | 1 | 1.422599 | 1 | |
apps/shortener_app/migrations/0010_auto_20190123_1908.py | escrichov/shortener | 6 | 6626078 | # Generated by Django 2.1.5 on 2019-01-23 19:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shortener_app', '0009_auto_20190123_1903'),
]
operations = [
migrations.AlterField(
model_name='shorturl',
name='url... | # Generated by Django 2.1.5 on 2019-01-23 19:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shortener_app', '0009_auto_20190123_1903'),
]
operations = [
migrations.AlterField(
model_name='shorturl',
name='url... | en | 0.769091 | # Generated by Django 2.1.5 on 2019-01-23 19:08 | 1.438601 | 1 |
sardine/resolvers/manifest/base.py | JavierLuna/sardine | 0 | 6626079 | from abc import ABCMeta, abstractmethod
from typing import Optional, Dict
from sardine.lang.manifest.builder import StackManifestBuilder
from sardine.lang.parser.objects import StackDeclaration
from sardine.lang.parser.parser import Parser
from sardine.lang.tokenizer.tokenizer import Tokenizer
from sardine.types impor... | from abc import ABCMeta, abstractmethod
from typing import Optional, Dict
from sardine.lang.manifest.builder import StackManifestBuilder
from sardine.lang.parser.objects import StackDeclaration
from sardine.lang.parser.parser import Parser
from sardine.lang.tokenizer.tokenizer import Tokenizer
from sardine.types impor... | none | 1 | 2.187362 | 2 | |
tensorflow_federated/python/core/utils/test.py | federated-learning-experiments/federated | 0 | 6626080 | # Lint as: python3
# Copyright 2019, The TensorFlow Federated 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 ... | # Lint as: python3
# Copyright 2019, The TensorFlow Federated 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 ... | en | 0.765746 | # Lint as: python3 # Copyright 2019, The TensorFlow Federated 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 ... | 2.375416 | 2 |
fluent_contents/plugins/googledocsviewer/models.py | vinnyrose/django-fluent-contents | 0 | 6626081 | <filename>fluent_contents/plugins/googledocsviewer/models.py
from future.utils import python_2_unicode_compatible
from django.db import models
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
from fluent_contents.utils import validate_html_size
@python_2_unicode_c... | <filename>fluent_contents/plugins/googledocsviewer/models.py
from future.utils import python_2_unicode_compatible
from django.db import models
from django.utils.translation import ugettext_lazy as _
from fluent_contents.models import ContentItem
from fluent_contents.utils import validate_html_size
@python_2_unicode_c... | en | 0.767079 | A Google Docs viewer that is displayed at the page. | 2.144134 | 2 |
model/roi_module.py | mahavird/vehicle_detection | 274 | 6626082 | from collections import namedtuple
from string import Template
import cupy, torch
import cupy as cp
import torch as t
from torch.autograd import Function
from model.utils.roi_cupy import kernel_backward, kernel_forward
Stream = namedtuple('Stream', ['ptr'])
@cupy.util.memoize(for_each_device=True)
def load_kernel(... | from collections import namedtuple
from string import Template
import cupy, torch
import cupy as cp
import torch as t
from torch.autograd import Function
from model.utils.roi_cupy import kernel_backward, kernel_forward
Stream = namedtuple('Stream', ['ptr'])
@cupy.util.memoize(for_each_device=True)
def load_kernel(... | en | 0.477735 | NOTE:only CUDA-compatible # NOTE: MAKE SURE input is contiguous too ##NOTE: IMPORTANT CONTIGUOUS # TODO: input ## fake data### # pytorch version # chainer version,if you're going to run this # pip install chainer | 2.482296 | 2 |
EFT_Auto_Examine.py | xvorost/Escape-from-Tarkov-Auto-Examine | 1 | 6626083 | <filename>EFT_Auto_Examine.py
import os,random,string
randtitle=str(''.join(random.choice('_'+string.hexdigits) for i in range(random.randint(12,28))))
os.system('title '+randtitle)
import keyboard,sys,threading
from loguru import logger as log
from functools import partialmethod
from pyautogui import center, c... | <filename>EFT_Auto_Examine.py
import os,random,string
randtitle=str(''.join(random.choice('_'+string.hexdigits) for i in range(random.randint(12,28))))
os.system('title '+randtitle)
import keyboard,sys,threading
from loguru import logger as log
from functools import partialmethod
from pyautogui import center, c... | en | 0.786741 | #filepath fix # edit here; if issues with image detection 1 # avoids overlapping # avoids examine errors & timeouts # edit here; if issues with image detection 2 # edit here; if too much or too less scrolling # edit here; if issues with image detection 3 # tabs load up time #not proud on exception handling | 2.47931 | 2 |
constants.py | tatarinovst2/2021-2-level-ctlr | 0 | 6626084 | <reponame>tatarinovst2/2021-2-level-ctlr<filename>constants.py
"""
Useful constant variables
"""
from pathlib import Path
PROJECT_ROOT = Path(__file__).parent
ASSETS_PATH = PROJECT_ROOT / 'tmp' / 'articles'
CRAWLER_CONFIG_PATH = PROJECT_ROOT / 'scrapper_config.json'
ROOT_URL = "http://www.vestnik.unn.ru/"
RUSSIAN_ROO... | """
Useful constant variables
"""
from pathlib import Path
PROJECT_ROOT = Path(__file__).parent
ASSETS_PATH = PROJECT_ROOT / 'tmp' / 'articles'
CRAWLER_CONFIG_PATH = PROJECT_ROOT / 'scrapper_config.json'
ROOT_URL = "http://www.vestnik.unn.ru/"
RUSSIAN_ROOT_URL = ROOT_URL + 'ru'
DOMAIN_URL = RUSSIAN_ROOT_URL + "/nomer... | en | 0.553361 | Useful constant variables | 1.823529 | 2 |
commentary/admin.py | mangadventure/django-user-comments | 0 | 6626085 | <filename>commentary/admin.py
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _, ngettext
from commentary import get_model
from commentary.views.moderation import (
perform_flag, perform_approve, perform_delete
)
USERNAME_FIELD =... | <filename>commentary/admin.py
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _, ngettext
from commentary import get_model
from commentary.views.moderation import (
perform_flag, perform_approve, perform_delete
)
USERNAME_FIELD =... | en | 0.875428 | # Only superusers should be able to delete the comments from the DB. Flag, approve, or remove some comments from an admin action. Actually calls the `action` argument to perform the heavy lifting. # Only register the default admin if the model is the built-in comment model # (this won't be true if there's a cus... | 2.057128 | 2 |
pic/model/register.py | hankyul2/pytorch-image-classification | 0 | 6626086 | import sys
from inspect import signature, _empty
from typing import Iterable
_name_to_model = {}
_argument_of_model = []
def register_model(fn):
# 1. load config dict
module = sys.modules[fn.__module__]
config = getattr(module, 'model_config', None)
if config is None:
raise ValueError(f"pleas... | import sys
from inspect import signature, _empty
from typing import Iterable
_name_to_model = {}
_argument_of_model = []
def register_model(fn):
# 1. load config dict
module = sys.modules[fn.__module__]
config = getattr(module, 'model_config', None)
if config is None:
raise ValueError(f"pleas... | en | 0.341263 | # 1. load config dict # 2. parse for argument parser # 3. parse for create_model # Todo: support for boolean type # 1. load model and config # 2. update parameter by kwargs only if it appears in model config # Todo: Add pretrain handler | 2.735039 | 3 |
atlssncli/issuehandler.py | bkryza/atlssncli | 1 | 6626087 | # -*- coding: utf-8 -*-
#
# Copyright 2019 <NAME> <<EMAIL>>
#
# 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... | # -*- coding: utf-8 -*-
#
# Copyright 2019 <NAME> <<EMAIL>>
#
# 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... | en | 0.841704 | # -*- coding: utf-8 -*- # # Copyright 2019 <NAME> <<EMAIL>> # # 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... | 2.153785 | 2 |
Data Processing.py | biof309/group-project-ajk | 0 | 6626088 | <gh_stars>0
# import packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# import excel file and create dataframe called NCHS
NCHS = pd.read_csv('NCHS_-_Leading_Causes_of_Death__United_States.csv')
# examine the data
NCHS.info()
'''
Select the column names of interest.
Group this new d... | # import packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# import excel file and create dataframe called NCHS
NCHS = pd.read_csv('NCHS_-_Leading_Causes_of_Death__United_States.csv')
# examine the data
NCHS.info()
'''
Select the column names of interest.
Group this new dataset by ye... | en | 0.844558 | # import packages # import excel file and create dataframe called NCHS # examine the data Select the column names of interest. Group this new dataset by year and by cause name to create the x-axis and different types in each bar in bar plot Sum this new group to create the y-axis in bar plot print(year_group_total) pri... | 3.887026 | 4 |
VAE_fit.py | BrianNingUT/ArbFreeIV-VAE | 2 | 6626089 | <filename>VAE_fit.py
import torch
from torch import nn
from torch.nn import functional as F
import random
from typing import List
from torch import Tensor
import numpy as np
class VAE(nn.Module):
"""
The main VAE class used to fit the VAE model, class parameters include:
beta: The beta value used in ... | <filename>VAE_fit.py
import torch
from torch import nn
from torch.nn import functional as F
import random
from typing import List
from torch import Tensor
import numpy as np
class VAE(nn.Module):
"""
The main VAE class used to fit the VAE model, class parameters include:
beta: The beta value used in ... | en | 0.576717 | The main VAE class used to fit the VAE model, class parameters include: beta: The beta value used in the beta VAE, constant across epochs latent_dim: The number of latent dimensions (z) in_channels: The dimension of input parameters (x) norm_mean: normalized inputs mean, used in decoding only durin... | 2.910861 | 3 |
study/python/OtherTutorials/decorator_example.py | YoungsAppWorkshop/dev_environment_setup | 0 | 6626090 | # Decorators
from functools import wraps
def my_logger(orig_func):
import logging
logging.basicConfig(filename='{}.log'.format(orig_func.__name__),
level=logging.INFO)
@wraps(orig_func)
def wrapper(*args, **kwargs):
logging.info(
'Ran with args: {}, and kw... | # Decorators
from functools import wraps
def my_logger(orig_func):
import logging
logging.basicConfig(filename='{}.log'.format(orig_func.__name__),
level=logging.INFO)
@wraps(orig_func)
def wrapper(*args, **kwargs):
logging.info(
'Ran with args: {}, and kw... | en | 0.649361 | # Decorators | 3.22953 | 3 |
Python_Aulas_3,6+/07_Formatação _de_strings.py | PASSINP/Python_3-Django | 1 | 6626091 | <reponame>PASSINP/Python_3-Django
nome = 'Paulo'
idade = 21
altura = 1.89
# Exsitem algumas manerieas de se fazer concatenação. Uma delas, que foi
# implementada na Versão 3.6 do Python, se chama f string.
# Para se fazer isso, se começa colocando f antes das aspas. Em seguida você
# coloca entre chaves a variavel q... | nome = 'Paulo'
idade = 21
altura = 1.89
# Exsitem algumas manerieas de se fazer concatenação. Uma delas, que foi
# implementada na Versão 3.6 do Python, se chama f string.
# Para se fazer isso, se começa colocando f antes das aspas. Em seguida você
# coloca entre chaves a variavel que deseja utilizar {assim}
print(f... | pt | 0.997477 | # Exsitem algumas manerieas de se fazer concatenação. Uma delas, que foi # implementada na Versão 3.6 do Python, se chama f string. # Para se fazer isso, se começa colocando f antes das aspas. Em seguida você # coloca entre chaves a variavel que deseja utilizar {assim} # Outra coisa que podemos utilizar na formatação é... | 4.262618 | 4 |
src/ramstk/models/dbtables/commondb_stakeholders_table.py | weibullguy/ramstk | 4 | 6626092 | # -*- coding: utf-8 -*-
#
# ramstk.models.commondb.stakeholders.table.py is part of The RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Stakeholders Table Model."""
# Standard Library Imports
from typing import Type
# RAMSTK Loc... | # -*- coding: utf-8 -*-
#
# ramstk.models.commondb.stakeholders.table.py is part of The RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Stakeholders Table Model."""
# Standard Library Imports
from typing import Type
# RAMSTK Loc... | en | 0.599126 | # -*- coding: utf-8 -*- # # ramstk.models.commondb.stakeholders.table.py is part of The RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com Stakeholders Table Model. # Standard Library Imports # RAMSTK Local Imports Contain the attribute... | 2.040912 | 2 |
src/insulaudit/console/__init__.py | bewest/insulaudit | 22 | 6626093 |
from command import Command
from subcommand import Subcommand
from application import Application
import utils
import device
__all__ = [ 'Command', 'Subcommand'
, 'Application'
, 'Device'
, 'utils' ]
#####
# EOF
|
from command import Command
from subcommand import Subcommand
from application import Application
import utils
import device
__all__ = [ 'Command', 'Subcommand'
, 'Application'
, 'Device'
, 'utils' ]
#####
# EOF
| de | 0.735042 | ##### # EOF | 1.562139 | 2 |
main.py | serge-v/soilsensor | 0 | 6626094 | import machine
import time
import esp32
import tinypico as TinyPICO
from machine import RTC, WDT
from micropython import const
import blink, wifi, soilsensor
wdt = WDT(timeout=30000)
wdt.feed()
print("blink.init")
blink.init()
reset = machine.reset_cause()
if reset == machine.DEEPSLEEP_RESET:
blink.blink(1, b... | import machine
import time
import esp32
import tinypico as TinyPICO
from machine import RTC, WDT
from micropython import const
import blink, wifi, soilsensor
wdt = WDT(timeout=30000)
wdt.feed()
print("blink.init")
blink.init()
reset = machine.reset_cause()
if reset == machine.DEEPSLEEP_RESET:
blink.blink(1, b... | none | 1 | 2.53793 | 3 | |
server/test.py | tbor8080/pyprog | 0 | 6626095 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
from wsgiref import simple_server,util
from wsgiref.handlers import CGIHandler
from wsgiref.handlers import SimpleHandler
def app(environs, start_response):
status='200 OK'
headers=[('Content-type', 'application/x-httpd-cgi charset=utf-8')]
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
from wsgiref import simple_server,util
from wsgiref.handlers import CGIHandler
from wsgiref.handlers import SimpleHandler
def app(environs, start_response):
status='200 OK'
headers=[('Content-type', 'application/x-httpd-cgi charset=utf-8')]
... | en | 0.308914 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- | 2.087944 | 2 |
corehq/apps/couch_sql_migration/tests/test_lrudict.py | dimagilg/commcare-hq | 1 | 6626096 | from nose.plugins.skip import SkipTest
from testil import assert_raises, eq
from ..lrudict import LRUDict
def test_getitem():
lru = LRUDict(3)
for x in range(4):
lru[x] = x * 2
eq(lru[0], 0, "x: %s" % x)
with assert_raises(KeyError):
lru[-1]
assert_items_equal(lru, [(2, 4), (3... | from nose.plugins.skip import SkipTest
from testil import assert_raises, eq
from ..lrudict import LRUDict
def test_getitem():
lru = LRUDict(3)
for x in range(4):
lru[x] = x * 2
eq(lru[0], 0, "x: %s" % x)
with assert_raises(KeyError):
lru[-1]
assert_items_equal(lru, [(2, 4), (3... | none | 1 | 2.197047 | 2 | |
__main_v2__.py | iomegak12/pythondockertry | 0 | 6626097 | <reponame>iomegak12/pythondockertry
from injector import Injector, Inject
import crmsystem
def configure(binder):
binder.bind(crmsystem.CustomerService,
to=crmsystem.CustomerService(lambda customers:
print(crmsystem.PrettyTableGenerator.get_customer_tab... | from injector import Injector, Inject
import crmsystem
def configure(binder):
binder.bind(crmsystem.CustomerService,
to=crmsystem.CustomerService(lambda customers:
print(crmsystem.PrettyTableGenerator.get_customer_table(customers))))
binder.bind(cr... | none | 1 | 2.354097 | 2 | |
html_parsing/exclusive_games/xbox_360__gematsu_com.py | DazEB2/SimplePyScripts | 117 | 6626098 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from common import get_game_list_from
url = 'https://gematsu.com/exclusives/xbox-360'
exclusive_games = get_game_list_from(url, 'fullexclusive', 'platformexclusive', 'consoleexclusive')
print(f'Games ({len(exclusive_games)})... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from common import get_game_list_from
url = 'https://gematsu.com/exclusives/xbox-360'
exclusive_games = get_game_list_from(url, 'fullexclusive', 'platformexclusive', 'consoleexclusive')
print(f'Games ({len(exclusive_games)}):')
for i, game in ... | en | 0.308914 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- | 3.023313 | 3 |
settings/kobo_conf.py | philipsales/couchbase-python-elasticsearch | 0 | 6626099 |
#SERVER Configuration
KoboENV = "production"
KoboConfig = {
'local': {
'USERNAME': '',
'PASSWORD': '',
'PROTOCOL': 'http',
'SCHEME': 'kobo',
'IP': '127.0.0.1',
'HOST': '',
'PORT': '',
'VERSION':'v1',
'TIMEOUT': 7200,
'FORM': ''
},... |
#SERVER Configuration
KoboENV = "production"
KoboConfig = {
'local': {
'USERNAME': '',
'PASSWORD': '',
'PROTOCOL': 'http',
'SCHEME': 'kobo',
'IP': '127.0.0.1',
'HOST': '',
'PORT': '',
'VERSION':'v1',
'TIMEOUT': 7200,
'FORM': ''
},... | en | 0.522845 | #SERVER Configuration # FORM: 33 for testing 2 set # FORM: 12 for actual testing # FROM: 13 for production | 1.453563 | 1 |
trains/utilities/check_updates.py | doliveralg/trains | 0 | 6626100 | <filename>trains/utilities/check_updates.py<gh_stars>0
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
import requests
import six
if six.PY3:
from math import inf
else:
inf = float('inf')
class InvalidVersion(ValueError):
"""
An invalid v... | <filename>trains/utilities/check_updates.py<gh_stars>0
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
import requests
import six
if six.PY3:
from math import inf
else:
inf = float('inf')
class InvalidVersion(ValueError):
"""
An invalid v... | en | 0.827823 | An invalid version was found, users should refer to PEP 440. v? (?: (?:(?P<epoch>[0-9]+)!)? # epoch (?P<release>[0-9]+(?:\.[0-9]+)*) # release segment (?P<pre> # pre-release [-... | 2.345894 | 2 |
tensorflow_federated/python/core/impl/executors/executor_service.py | j35tor/federated | 1 | 6626101 | # Copyright 2019, The TensorFlow Federated 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... | # Copyright 2019, The TensorFlow Federated 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... | en | 0.854227 | # Copyright 2019, The TensorFlow Federated 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... | 1.599204 | 2 |
src/tests/api/conftest.py | n0emis/pretix | 0 | 6626102 | <filename>src/tests/api/conftest.py
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 <NAME> and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Pub... | <filename>src/tests/api/conftest.py
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 <NAME> and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Pub... | en | 0.902868 | # # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 <NAME> and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free... | 1.436081 | 1 |
pythonProject/desafio082.py | maisalobao/Python | 1 | 6626103 | num = list()
pares = list()
impares = list()
while True:
num.append(int(input('Digite um valor:')))
escolha = str(input('Deseja continuar?')).upper().strip()[0]
if escolha in 'N':
break
print(f'Os valores da lista são: {num}')
for i,v in enumerate(num):
if v % 2 == 0:
pares.append(v)
... | num = list()
pares = list()
impares = list()
while True:
num.append(int(input('Digite um valor:')))
escolha = str(input('Deseja continuar?')).upper().strip()[0]
if escolha in 'N':
break
print(f'Os valores da lista são: {num}')
for i,v in enumerate(num):
if v % 2 == 0:
pares.append(v)
... | none | 1 | 3.864744 | 4 | |
exoctk/tests/test_atmospheric_retrievals.py | bourque/exoctk | 21 | 6626104 | <reponame>bourque/exoctk
#! /usr/bin/env python
"""Tests for the ``atmopshric_retrievals`` package.
Authors
-------
<NAME>
Use
---
These tests can be run via the command line (omit the ``-s`` to
suppress verbose output to stdout):
::
pytest -s test_atmospheric_retrievals.py
"""
import num... | #! /usr/bin/env python
"""Tests for the ``atmopshric_retrievals`` package.
Authors
-------
<NAME>
Use
---
These tests can be run via the command line (omit the ``-s`` to
suppress verbose output to stdout):
::
pytest -s test_atmospheric_retrievals.py
"""
import numpy as np
import os
from p... | en | 0.517606 | #! /usr/bin/env python Tests for the ``atmopshric_retrievals`` package. Authors ------- <NAME> Use --- These tests can be run via the command line (omit the ``-s`` to suppress verbose output to stdout): :: pytest -s test_atmospheric_retrievals.py Return a ``PlatonWrapper`` object for use by... | 2.271282 | 2 |
clairvoyante/callVarBam.py | strixy16/Clairvoyante | 171 | 6626105 | <gh_stars>100-1000
import os
import sys
import argparse
import param
import shlex
import subprocess
import multiprocessing
import signal
import random
import time
class InstancesClass(object):
def __init__(self):
self.EVCInstance = None
self.CTInstance = None
self.CVInstance = None
def... | import os
import sys
import argparse
import param
import shlex
import subprocess
import multiprocessing
import signal
import random
import time
class InstancesClass(object):
def __init__(self):
self.EVCInstance = None
self.CTInstance = None
self.CVInstance = None
def poll(self):
... | en | 0.206371 | #print >> sys.stderr, c.EVCInstance.returncode, c.CTInstance.returncode, c.CVInstance.returncode | 2.315008 | 2 |
edk2/BaseTools/Source/Python/UPT/Library/ParserValidate.py | awwiniot/Aw1689UEFI | 21 | 6626106 | <reponame>awwiniot/Aw1689UEFI<filename>edk2/BaseTools/Source/Python/UPT/Library/ParserValidate.py
## @file ParserValidate.py
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the B... | ## @file ParserValidate.py
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
... | en | 0.431366 | ## @file ParserValidate.py # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution. The full text of the license may be found at # http://... | 3.072659 | 3 |
cloud_ml_sdk/cloud_ml_sdk/models/quota.py | NanCSN/cloud-ml-sdk | 32 | 6626107 | <filename>cloud_ml_sdk/cloud_ml_sdk/models/quota.py
# Copyright 2017 Xiaomi, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | <filename>cloud_ml_sdk/cloud_ml_sdk/models/quota.py
# Copyright 2017 Xiaomi, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | en | 0.635303 | # Copyright 2017 Xiaomi, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,... | 2.16979 | 2 |
Rico/RicoFormat.py | victor-luis/Clear-Corretora | 1 | 6626108 | from pprint import pprint
from db import model
from db.model import register_transaction, clear_transactions
from helpers import format_currency, parse_transaction, convert_date
provider_id = 12
def format_json(json):
applications = json['applications']
date = json['date']
in_account = format_currency(... | from pprint import pprint
from db import model
from db.model import register_transaction, clear_transactions
from helpers import format_currency, parse_transaction, convert_date
provider_id = 12
def format_json(json):
applications = json['applications']
date = json['date']
in_account = format_currency(... | pt | 0.892469 | # atualiza valor da conta corrente # atualiza valor das aplicações (tesouro, fundo, COE...) # atualiza extrato # pprint(transaction) # print(to_account) | 2.367941 | 2 |
api/python/indigo/ml/mpp/run.py | alkaberna/Indigo | 0 | 6626109 | <reponame>alkaberna/Indigo
import click
import config as config
import torch # type: ignore
from datasets import MolDataset, load_data
from eval import evaluate
from models import MPNNRegressor
from tqdm import trange # type: ignore
@click.command()
@click.argument("filename", type=click.Path(exists=True))
@click.a... | import click
import config as config
import torch # type: ignore
from datasets import MolDataset, load_data
from eval import evaluate
from models import MPNNRegressor
from tqdm import trange # type: ignore
@click.command()
@click.argument("filename", type=click.Path(exists=True))
@click.argument("smiles", type=str)... | en | 0.249627 | # type: ignore # type: ignore Simpel property prediction | 2.439299 | 2 |
src/eval_settings/imagenet_c.py | saarimrahman/imagenet-testbed | 69 | 6626110 | <reponame>saarimrahman/imagenet-testbed
from registry import registry
from eval_settings.eval_setting_base import EvalSetting, StandardDataset
from eval_settings.image_utils import *
from eval_settings.eval_setting_subsample import idx_subsample_list_50k_10percent
from eval_settings.image_utils import corruption_dict
... | from registry import registry
from eval_settings.eval_setting_base import EvalSetting, StandardDataset
from eval_settings.image_utils import *
from eval_settings.eval_setting_subsample import idx_subsample_list_50k_10percent
from eval_settings.image_utils import corruption_dict
on_disk_corruptions = [
'imagenet-c.bri... | none | 1 | 1.55431 | 2 | |
addons/Sprytile-6b68d00/rx/linq/observable/manyselect.py | trisadmeslek/V-Sekai-Blender-tools | 733 | 6626111 | from rx.core import Observable
from rx.core import ObservableBase
from rx.internal.basic import noop
from rx.subjects import AsyncSubject
from rx.disposables import CompositeDisposable
from rx.concurrency import immediate_scheduler, current_thread_scheduler
from rx.internal import extensionmethod
class ChainObservabl... | from rx.core import Observable
from rx.core import ObservableBase
from rx.internal.basic import noop
from rx.subjects import AsyncSubject
from rx.disposables import CompositeDisposable
from rx.concurrency import immediate_scheduler, current_thread_scheduler
from rx.internal import extensionmethod
class ChainObservabl... | en | 0.710308 | Comonadic bind operator. Internally projects a new observable for each value, and it pushes each observable into the user-defined selector function that projects/queries each observable into some result. Keyword arguments: selector -- {Function} A transform function to apply to each element. schedu... | 2.33538 | 2 |
company_house_ua/urls.py | dchaplinsky/ragoogle | 3 | 6626112 | <gh_stars>1-10
from django.urls import path
from django.conf.urls import url
from .views import CompanyHouseUaDetailsView
urlpatterns = [
path('<pk>', CompanyHouseUaDetailsView.as_view(), name="company_house_ua>details"),
]
| from django.urls import path
from django.conf.urls import url
from .views import CompanyHouseUaDetailsView
urlpatterns = [
path('<pk>', CompanyHouseUaDetailsView.as_view(), name="company_house_ua>details"),
] | none | 1 | 1.665691 | 2 | |
api/users/serializers.py | admariner/flagsmith | 0 | 6626113 | <filename>api/users/serializers.py
from djoser.serializers import UserSerializer as DjoserUserSerializer
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from organisations.invites.models import Invite
from organisations.models import Organisation
from organisations.serializ... | <filename>api/users/serializers.py
from djoser.serializers import UserSerializer as DjoserUserSerializer
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from organisations.invites.models import Invite
from organisations.models import Organisation
from organisations.serializ... | en | 0.612821 | # TODO: remove users from here and just add a summary of number of users | 2.187282 | 2 |
src/multimodal_ensemble/multimodal_main.py | tahleen-rahman/all2friends | 0 | 6626114 | <reponame>tahleen-rahman/all2friends
# Created by rahman at 17:20 2020-03-10 using PyCharm
import sys
from multimodal_ensemble.multimodal_utils import makeHCI, recalculate_missingHCI, write_posteriors, \
unite_posteriors, score_avg5probs, score_subsets_weighted, split_train_test_cv, split_train_test
from network_... | # Created by rahman at 17:20 2020-03-10 using PyCharm
import sys
from multimodal_ensemble.multimodal_utils import makeHCI, recalculate_missingHCI, write_posteriors, \
unite_posteriors, score_avg5probs, score_subsets_weighted, split_train_test_cv, split_train_test
from network_attacks.friend2vec_main import attack... | en | 0.936927 | # Created by rahman at 17:20 2020-03-10 using PyCharm # get the file suffixes for each cross val iteration subgraph of friends in the training set # to use for node2vec for the network attack as well as for the multimodal attack later | 2.347625 | 2 |
sources/algorithms/sweepln/regionsweepdebug.py | tipech/OverlapGraph | 0 | 6626115 | <reponame>tipech/OverlapGraph
#!/usr/bin/env python
"""
Debugging for One-pass Sweep-line Algorithm over Regions
Implements the RegionSweepDebug class that prints a block of debugging output
for every Event broadcasted from the one-pass sweep-line algorithm, through a
subscription to RegionSweep.
Classes:
- RegionSw... | #!/usr/bin/env python
"""
Debugging for One-pass Sweep-line Algorithm over Regions
Implements the RegionSweepDebug class that prints a block of debugging output
for every Event broadcasted from the one-pass sweep-line algorithm, through a
subscription to RegionSweep.
Classes:
- RegionSweepDebug
"""
from typing impo... | en | 0.812444 | #!/usr/bin/env python Debugging for One-pass Sweep-line Algorithm over Regions Implements the RegionSweepDebug class that prints a block of debugging output for every Event broadcasted from the one-pass sweep-line algorithm, through a subscription to RegionSweep. Classes: - RegionSweepDebug Debugging for One-pass Swe... | 2.723573 | 3 |
extraction/FlattenData.py | Neyzoter/Nelearn | 0 | 6626116 |
import numpy as np
def getFlatData(X):
'''
输入:(x,...)的矩阵,比如图片,x张图片、像素m*n、y个通道
输出:(特征个数,x)的扁平化矩阵,即每一列是一个样本的工程
'''
# 让X转化为样本数*所有特征向量化.T
X_flatten = X.reshape(X.shape[0],-1).T
return X_flatten
|
import numpy as np
def getFlatData(X):
'''
输入:(x,...)的矩阵,比如图片,x张图片、像素m*n、y个通道
输出:(特征个数,x)的扁平化矩阵,即每一列是一个样本的工程
'''
# 让X转化为样本数*所有特征向量化.T
X_flatten = X.reshape(X.shape[0],-1).T
return X_flatten
| zh | 0.949001 | 输入:(x,...)的矩阵,比如图片,x张图片、像素m*n、y个通道 输出:(特征个数,x)的扁平化矩阵,即每一列是一个样本的工程 # 让X转化为样本数*所有特征向量化.T | 3.454455 | 3 |
main.py | Yilmaz4/Encrypt-n-Decrypt | 8 | 6626117 | <reponame>Yilmaz4/Encrypt-n-Decrypt<gh_stars>1-10
from cryptpy import *
cipher = AES(key = generateKey(32))
print(cipher.encryptData(data="hi everybody"))
| from cryptpy import *
cipher = AES(key = generateKey(32))
print(cipher.encryptData(data="hi everybody")) | none | 1 | 2.765224 | 3 | |
google/appengine/ext/datastore_admin/backup_handler.py | luduvigo/app-blog-code | 0 | 6626118 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | en | 0.769499 | #!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o... | 1.682728 | 2 |
Text_Sentiment_Analysis_Web_Multinomial_Naive_Bayes/env/Lib/site-packages/pandas/tests/extension/base/getitem.py | ee2110/Machine_Learning_based_web_applications | 6 | 6626119 | <reponame>ee2110/Machine_Learning_based_web_applications
import numpy as np
import pytest
import pandas as pd
from .base import BaseExtensionTests
class BaseGetitemTests(BaseExtensionTests):
"""Tests for ExtensionArray.__getitem__."""
def test_iloc_series(self, data):
ser = pd.Series(data)
... | import numpy as np
import pytest
import pandas as pd
from .base import BaseExtensionTests
class BaseGetitemTests(BaseExtensionTests):
"""Tests for ExtensionArray.__getitem__."""
def test_iloc_series(self, data):
ser = pd.Series(data)
result = ser.iloc[:4]
expected = pd.Series(data[:... | en | 0.658485 | Tests for ExtensionArray.__getitem__. # slice -> frame # sequence -> frame # slice -> series # sequence -> series # slice -> frame # sequence -> frame # slice -> series # sequence -> series # GH#27110 bug in ExtensionBlock.iget caused df.iloc[n] to incorrectly # return a scalar # Indexing with empty list # Empty mask,... | 2.388879 | 2 |
app/dao/service_email_reply_to_dao.py | tlwr/notifications-api | 10 | 6626120 | from sqlalchemy import desc
from app import db
from app.dao.dao_utils import transactional
from app.errors import InvalidRequest
from app.exceptions import ArchiveValidationError
from app.models import ServiceEmailReplyTo
def dao_get_reply_to_by_service_id(service_id):
reply_to = db.session.query(
Servic... | from sqlalchemy import desc
from app import db
from app.dao.dao_utils import transactional
from app.errors import InvalidRequest
from app.exceptions import ArchiveValidationError
from app.models import ServiceEmailReplyTo
def dao_get_reply_to_by_service_id(service_id):
reply_to = db.session.query(
Servic... | en | 0.530851 | # noqa # noqa # check that the update is not updating the only default to false | 2.054982 | 2 |
Mundo 2/exercicio054.py | samudoki/Python-Curso-em-Video | 1 | 6626121 | <reponame>samudoki/Python-Curso-em-Video
#Exercicio 54
from datetime import date
total_maior = 0
total_menor = 0
ano_atual = date.today().year
for n in range(1, 7):
ano = int(input(f'Em que ano nasceu a {n}° pessoa? '))
idade = ano_atual - ano
if idade >= 18:
total_maior += 1
... | #Exercicio 54
from datetime import date
total_maior = 0
total_menor = 0
ano_atual = date.today().year
for n in range(1, 7):
ano = int(input(f'Em que ano nasceu a {n}° pessoa? '))
idade = ano_atual - ano
if idade >= 18:
total_maior += 1
else:
total_menor += ... | nl | 0.292496 | #Exercicio 54 | 3.742688 | 4 |
examples/retries_with_mapping.py | jamestwebber/prefect | 0 | 6626122 | """
This example showcases a few basic Prefect concepts:
- the ability to "map" tasks across the dynamic output of upstream tasks; additionally, it is not required that the
upstream task actually passes data to the downstream task, as this example demonstrates
- task retries: `flow.run()` will perform r... | """
This example showcases a few basic Prefect concepts:
- the ability to "map" tasks across the dynamic output of upstream tasks; additionally, it is not required that the
upstream task actually passes data to the downstream task, as this example demonstrates
- task retries: `flow.run()` will perform r... | en | 0.958913 | This example showcases a few basic Prefect concepts: - the ability to "map" tasks across the dynamic output of upstream tasks; additionally, it is not required that the upstream task actually passes data to the downstream task, as this example demonstrates - task retries: `flow.run()` will perform retri... | 3.426869 | 3 |
setup.py | aldegoeij/aws-shell | 0 | 6626123 | <filename>setup.py
#!/usr/bin/env python
import re
import ast
from setuptools import setup, find_packages
requires = [
'awscli>=1.16.87,<2.0.0',
'prompt-toolkit>=1.0.15,<2.0.0',
'boto3>=1.9.77,<3.0.0',
'configobj>=5.0.6,<6.0.0',
'Pygments>=2.1.3,<3.0.0',
]
with open('awsshell/__init__.py', 'r')... | <filename>setup.py
#!/usr/bin/env python
import re
import ast
from setuptools import setup, find_packages
requires = [
'awscli>=1.16.87,<2.0.0',
'prompt-toolkit>=1.0.15,<2.0.0',
'boto3>=1.9.77,<3.0.0',
'configobj>=5.0.6,<6.0.0',
'Pygments>=2.1.3,<3.0.0',
]
with open('awsshell/__init__.py', 'r')... | ru | 0.26433 | #!/usr/bin/env python | 1.42295 | 1 |
azure-mgmt-batchai/azure/mgmt/batchai/models/node_state_counts_py3.py | JonathanGailliez/azure-sdk-for-python | 1 | 6626124 | # 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 ... | # 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 ... | en | 0.706599 | # 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 ... | 1.857788 | 2 |
holoviews/plotting/bokeh/tabular.py | fedario/holoviews | 0 | 6626125 | <filename>holoviews/plotting/bokeh/tabular.py
from __future__ import absolute_import, division, unicode_literals
import param
from bokeh.models import Column
from bokeh.models.widgets import (
DataTable, TableColumn, NumberEditor, NumberFormatter, DateFormatter,
DateEditor, StringFormatter, StringEditor, IntE... | <filename>holoviews/plotting/bokeh/tabular.py
from __future__ import absolute_import, division, unicode_literals
import param
from bokeh.models import Column
from bokeh.models.widgets import (
DataTable, TableColumn, NumberEditor, NumberFormatter, DateFormatter,
DateEditor, StringFormatter, StringEditor, IntE... | en | 0.69499 | Deprecated; use hooks options instead. Optional list of hooks called when finalizing a plot. The hook is passed the plot object and the displayed element, and other plotting handles can be accessed via plot.handles. Initializes a new plot object with the last available frame. # Get element key and range... | 2.6094 | 3 |
surveys/models/surveys.py | jerivas/mezzanine-surveys | 0 | 6626126 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import uuid
from builtins import range
from django.db import models
from django.core.urlresolvers import reverse
from django.core.validators import MinValueValidator, MaxValueValidator
from django.utils.encoding import python_2_unicode_comp... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import uuid
from builtins import range
from django.db import models
from django.core.urlresolvers import reverse
from django.core.validators import MinValueValidator, MaxValueValidator
from django.utils.encoding import python_2_unicode_comp... | en | 0.895917 | # -*- coding: utf-8 -*- Survey that's available for purchase. Collect all questions related to this survey. Code to gain access to a Survey without paying. Generate a UUID if the code hasn't been defined A record of a user purchasing a Survey. Generate a report of all responses related to this purchase. A cache... | 2.249979 | 2 |
reports/models.py | termtegrity/django-libreport | 0 | 6626127 | <filename>reports/models.py<gh_stars>0
import json
import logging
from copy import deepcopy
from datetime import datetime, time, timedelta
from importlib import import_module
from pkgutil import walk_packages
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.contrib.postgres... | <filename>reports/models.py<gh_stars>0
import json
import logging
from copy import deepcopy
from datetime import datetime, time, timedelta
from importlib import import_module
from pkgutil import walk_packages
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.contrib.postgres... | en | 0.858095 | # Dynamically load reports Abstract Base Report Model for Report and ReportSchedule fields. Contains common columns. Indicates that the document is generated Schedules a task to generate the document Generate and save the document # Setting save to false to avoid hashed_upload_to raising an exception # because of d... | 2.104957 | 2 |
pdfappend.py | hwarpefelt/pdfappend | 0 | 6626128 | <gh_stars>0
# Copyright (c) 2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | # Copyright (c) 2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | en | 0.680801 | # Copyright (c) 2016 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, ... | 2.536924 | 3 |
dataset/consistent/related_process_title.py | open-contracting/pelican-backend | 1 | 6626129 | import random
from tools.checks import get_empty_result_dataset
from tools.getter import get_values
version = 1.0
examples_cap = 100
def add_item(scope, item, item_id):
if not scope:
scope = {
"original_ocid": dict(),
"related_processes": dict(),
"meta": {
... | import random
from tools.checks import get_empty_result_dataset
from tools.getter import get_values
version = 1.0
examples_cap = 100
def add_item(scope, item, item_id):
if not scope:
scope = {
"original_ocid": dict(),
"related_processes": dict(),
"meta": {
... | en | 0.631349 | # checking if all required fields are set | 2.293822 | 2 |
great_expectations/expectations/metrics/column_aggregate_metrics/column_max.py | vanderGoes/great_expectations | 2 | 6626130 | from great_expectations.execution_engine import (
PandasExecutionEngine,
SparkDFExecutionEngine,
)
from great_expectations.execution_engine.sqlalchemy_execution_engine import (
SqlAlchemyExecutionEngine,
)
from great_expectations.expectations.metrics.column_aggregate_metric import (
ColumnMetricProvider... | from great_expectations.execution_engine import (
PandasExecutionEngine,
SparkDFExecutionEngine,
)
from great_expectations.execution_engine.sqlalchemy_execution_engine import (
SqlAlchemyExecutionEngine,
)
from great_expectations.expectations.metrics.column_aggregate_metric import (
ColumnMetricProvider... | none | 1 | 2.244062 | 2 | |
lambdata_gagansingh23/__init__.py | gagansingh23/lambdata | 0 | 6626131 | """
a collection of data science helper functions
"""
import pandas as pd
import numpy as np
#sample code
ONES = pd.DataFrame(np.ones(10))
ZEROS = pd.DataFrame(np.zeros(50))
| """
a collection of data science helper functions
"""
import pandas as pd
import numpy as np
#sample code
ONES = pd.DataFrame(np.ones(10))
ZEROS = pd.DataFrame(np.zeros(50))
| en | 0.456765 | a collection of data science helper functions #sample code | 2.912612 | 3 |
tests/parsers/bencode_plugins/transmission.py | pyllyukko/plaso | 2 | 6626132 | <reponame>pyllyukko/plaso
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the bencode parser plugin for Transmission BitTorrent files."""
import unittest
from plaso.lib import definitions
from plaso.parsers import bencode_parser
from tests.parsers.bencode_plugins import test_lib
class TransmissionPlugi... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the bencode parser plugin for Transmission BitTorrent files."""
import unittest
from plaso.lib import definitions
from plaso.parsers import bencode_parser
from tests.parsers.bencode_plugins import test_lib
class TransmissionPluginTest(test_lib.BencodePlug... | en | 0.735488 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Tests for the bencode parser plugin for Transmission BitTorrent files. Tests for bencode parser plugin for Transmission BitTorrent files. Tests the Process function. # The order in which BencodeParser generates events is nondeterministic # hence we sort the events. # Test ... | 2.432962 | 2 |
setup.py | aroth-arsoft/trac-advancedworkflow | 0 | 6626133 | <filename>setup.py
#!/usr/bin/env python
#
# Copyright (C) 2008-2014 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from setuptools import setup, find_packages
extra = {}
try:
import babel
d... | <filename>setup.py
#!/usr/bin/env python
#
# Copyright (C) 2008-2014 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from setuptools import setup, find_packages
extra = {}
try:
import babel
d... | en | 0.961805 | #!/usr/bin/env python # # Copyright (C) 2008-2014 <NAME> <<EMAIL>> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # zip_safe = False, | 1.38104 | 1 |
config.py | soolstafir/Applying-3D-U-Net-Architecture-to-the-Task-of-Multi-Organ-Segmentation-in-Computed-Tomography | 17 | 6626134 | import json
import os
from common import ModelType
def save_config(path_dir, config):
with open(os.path.join(path_dir, 'config.json'), 'w') as outfile:
json.dump(config, outfile)
def load_config(path_dir):
with open(path_dir, 'r') as json_file:
data = json.load(json_file)
return data
d... | import json
import os
from common import ModelType
def save_config(path_dir, config):
with open(os.path.join(path_dir, 'config.json'), 'w') as outfile:
json.dump(config, outfile)
def load_config(path_dir):
with open(path_dir, 'r') as json_file:
data = json.load(json_file)
return data
d... | none | 1 | 2.357023 | 2 | |
scraper.py | jovannypcg/python_scheduler | 0 | 6626135 | #!/usr/bin/env python
import requests
from BeautifulSoup import BeautifulSoup
from celery import Celery
HOST = 'amqp://guest@localhost'
QUEUE = 'celery_pages'
app = Celery(QUEUE, broker=HOST)
@app.task
def scrape(url):
print "-> Starting: [%s]" % url
r = requests.get(url)
soup = BeautifulSoup(r.text)
... | #!/usr/bin/env python
import requests
from BeautifulSoup import BeautifulSoup
from celery import Celery
HOST = 'amqp://guest@localhost'
QUEUE = 'celery_pages'
app = Celery(QUEUE, broker=HOST)
@app.task
def scrape(url):
print "-> Starting: [%s]" % url
r = requests.get(url)
soup = BeautifulSoup(r.text)
... | ru | 0.26433 | #!/usr/bin/env python | 2.963649 | 3 |
AceAi.py | LeFatCat001/AceAi | 2 | 6626136 | ############################################## _
#(_) _ __ ___ _ __ ___ _ __ | |_ ___
#| || '_ ` _ \ | '_ \ / _ \ | '__|| __|/ __|
#| || | | | | || |_) || (_) || | | |_ \__ \
#|_||_| |_| |_|| .__/ \___/ |_| \__||___/
# |_|
################################... | ############################################## _
#(_) _ __ ___ _ __ ___ _ __ | |_ ___
#| || '_ ` _ \ | '_ \ / _ \ | '__|| __|/ __|
#| || | | | | || |_) || (_) || | | |_ \__ \
#|_||_| |_| |_|| .__/ \___/ |_| \__||___/
# |_|
################################... | de | 0.514872 | ############################################## _ #(_) _ __ ___ _ __ ___ _ __ | |_ ___ #| || '_ ` _ \ | '_ \ / _ \ | '__|| __|/ __| #| || | | | | || |_) || (_) || | | |_ \__ \ #|_||_| |_| |_|| .__/ \___/ |_| \__||___/ # |_| ######################################... | 2.163832 | 2 |
CarOperation.py | circleacid/car_sale | 0 | 6626137 | <gh_stars>0
import wx
import wx.grid
from mydb import Sql_operation
#跳转至管理界面
class CarOperation(wx.Frame):
'''
操作界面
'''
def __init__(self,*args,**kw):
# ensure the parent's __init__ is called
super(CarOperation,self).__init__(*args, **kw)
#设置窗口屏幕居中
self.Center()
#创建窗口
self.pnl = wx.Panel(s... | import wx
import wx.grid
from mydb import Sql_operation
#跳转至管理界面
class CarOperation(wx.Frame):
'''
操作界面
'''
def __init__(self,*args,**kw):
# ensure the parent's __init__ is called
super(CarOperation,self).__init__(*args, **kw)
#设置窗口屏幕居中
self.Center()
#创建窗口
self.pnl = wx.Panel(self)
#调用操... | zh | 0.799155 | #跳转至管理界面 操作界面 # ensure the parent's __init__ is called #设置窗口屏幕居中 #创建窗口 #调用操作界面函数 #创建垂直方向box布局管理器 ################################################################################# #创建logo静态文本,设置字体属性 #添加logo静态文本到vbox布局管理中 ################################################################################# #创建左侧的静态框 #创建垂直方向b... | 2.532583 | 3 |
wntr/network/controls.py | algchyhao/WNTR | 0 | 6626138 | <filename>wntr/network/controls.py
"""
The wntr.network.controls module includes methods to define network controls
and control actions. These controls modify parameters in the network during
simulation.
.. rubric:: Contents
.. autosummary::
Subject
Observer
Comparison
ControlPriority
ControlCon... | <filename>wntr/network/controls.py
"""
The wntr.network.controls module includes methods to define network controls
and control actions. These controls modify parameters in the network during
simulation.
.. rubric:: Contents
.. autosummary::
Subject
Observer
Comparison
ControlPriority
ControlCon... | en | 0.79994 | The wntr.network.controls module includes methods to define network controls and control actions. These controls modify parameters in the network during simulation. .. rubric:: Contents .. autosummary:: Subject Observer Comparison ControlPriority ControlCondition TimeOfDayCondition SimTi... | 2.870396 | 3 |
exercicios/ex025.py | Siqueira-Vinicius/Python | 0 | 6626139 | print('É da familia Silva?')
nome = str(input('Qual é o seu nome completo?: '))
nome = nome.strip()
nome = nome.upper()
silva = 'SILVA' in nome
print('Você pertence a familia Silva?')
print('R:{}'.format(silva))
| print('É da familia Silva?')
nome = str(input('Qual é o seu nome completo?: '))
nome = nome.strip()
nome = nome.upper()
silva = 'SILVA' in nome
print('Você pertence a familia Silva?')
print('R:{}'.format(silva))
| none | 1 | 4.067384 | 4 | |
tests/tools/emr/test_terminate_idle_clusters.py | timgates42/mrjob | 4 | 6626140 | # Copyright 2009-2012 Yelp
# Copyright 2013 Lyft
# Copyright 2014 <NAME>
# Copyright 2015-2018 Yelp
# Copyright 2019 Yelp
#
# 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... | # Copyright 2009-2012 Yelp
# Copyright 2013 Lyft
# Copyright 2014 <NAME>
# Copyright 2015-2018 Yelp
# Copyright 2019 Yelp
#
# 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... | en | 0.8823 | # Copyright 2009-2012 Yelp # Copyright 2013 Lyft # Copyright 2014 <NAME> # Copyright 2015-2018 Yelp # Copyright 2019 Yelp # # 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... | 1.481829 | 1 |
di_store/node_tracker/node_tracker_client.py | jasonzhang1998/DI-store | 59 | 6626141 | <gh_stars>10-100
import grpc
from . import node_tracker_pb2
from . import node_tracker_pb2_grpc
from ..tracing import trace, wrap_channel
# todo grpc with multiprocessing
# https://github.com/grpc/grpc/issues/18321
@trace
class NodeTrackerClient:
def __init__(self, node_tracker_host='127.0.0.1', node_tracker_po... | import grpc
from . import node_tracker_pb2
from . import node_tracker_pb2_grpc
from ..tracing import trace, wrap_channel
# todo grpc with multiprocessing
# https://github.com/grpc/grpc/issues/18321
@trace
class NodeTrackerClient:
def __init__(self, node_tracker_host='127.0.0.1', node_tracker_port=50050):
... | en | 0.524692 | # todo grpc with multiprocessing # https://github.com/grpc/grpc/issues/18321 | 2.318139 | 2 |
hill-cipher-encryption.py | Samarth-Khatri/Hacktoberfest-2022 | 13 | 6626142 | <reponame>Samarth-Khatri/Hacktoberfest-2022
## cryptography - Hill cipher encryption algorithm implementation
## input - any plaintext and a key(mostly used of size 9)
## Matrix of 3*3 is formed
## Output is a ciphertext generated using hill cipher encryption algorithm
## Characters considered for encryption are A-Z ... | ## cryptography - Hill cipher encryption algorithm implementation
## input - any plaintext and a key(mostly used of size 9)
## Matrix of 3*3 is formed
## Output is a ciphertext generated using hill cipher encryption algorithm
## Characters considered for encryption are A-Z and ".,!" So mod 29 method is used
## eg. Sa... | en | 0.718202 | ## cryptography - Hill cipher encryption algorithm implementation ## input - any plaintext and a key(mostly used of size 9) ## Matrix of 3*3 is formed ## Output is a ciphertext generated using hill cipher encryption algorithm ## Characters considered for encryption are A-Z and ".,!" So mod 29 method is used ## eg. Samp... | 4.307861 | 4 |
course/migrations/0107_rename_flowpagedata_ordinal_to_page_ordinal.py | inducer/courseflow | 284 | 6626143 | <reponame>inducer/courseflow
# Generated by Django 1.10.7 on 2017-12-19 02:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('course', '0106_add_auth_tokens_permission'),
]
operations = [
migrations.RenameField(
model_name='flowpage... | # Generated by Django 1.10.7 on 2017-12-19 02:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('course', '0106_add_auth_tokens_permission'),
]
operations = [
migrations.RenameField(
model_name='flowpagedata',
old_name='... | en | 0.819372 | # Generated by Django 1.10.7 on 2017-12-19 02:37 | 1.691371 | 2 |
array/inversion_number.py | fujihiraryo/library | 0 | 6626144 | <reponame>fujihiraryo/library<filename>array/inversion_number.py
INF = 1 << 30
def merge(x, y):
cnt = 0
nx, ny = len(x), len(y)
x.append(INF)
y.append(INF)
z = []
i, j = 0, 0
for k in range(nx + ny):
if x[i] < y[j]:
z.append(x[i])
i += 1
else:
... | INF = 1 << 30
def merge(x, y):
cnt = 0
nx, ny = len(x), len(y)
x.append(INF)
y.append(INF)
z = []
i, j = 0, 0
for k in range(nx + ny):
if x[i] < y[j]:
z.append(x[i])
i += 1
else:
z.append(y[j])
j += 1
cnt += nx - i... | none | 1 | 3.268082 | 3 | |
moip_sdk/payment/schemas.py | mastertech/moip-sdk-python | 2 | 6626145 | from marshmallow import fields
from marshmallow_enum import EnumField
from moip_sdk.common.converters import CamelCasedSchema
from moip_sdk.payment.enums import MoipPaymentMethod
class PaymentSchema(CamelCasedSchema):
installment_count = fields.Integer(required=True)
statement_descriptor = fields.String(requ... | from marshmallow import fields
from marshmallow_enum import EnumField
from moip_sdk.common.converters import CamelCasedSchema
from moip_sdk.payment.enums import MoipPaymentMethod
class PaymentSchema(CamelCasedSchema):
installment_count = fields.Integer(required=True)
statement_descriptor = fields.String(requ... | none | 1 | 2.217144 | 2 | |
htsinfer/get_library_type.py | zavolanlab/htsinfer | 5 | 6626146 | <reponame>zavolanlab/htsinfer
"""Infer mate information from sample data."""
import logging
from pathlib import Path
import re
from typing import (List, Optional)
from Bio.SeqIO.QualityIO import FastqGeneralIterator # type: ignore
from htsinfer.exceptions import (
FileProblem,
InconsistentFastqIdentifiers,
... | """Infer mate information from sample data."""
import logging
from pathlib import Path
import re
from typing import (List, Optional)
from Bio.SeqIO.QualityIO import FastqGeneralIterator # type: ignore
from htsinfer.exceptions import (
FileProblem,
InconsistentFastqIdentifiers,
MetadataWarning,
Unkno... | en | 0.799165 | Infer mate information from sample data. # type: ignore Determine type (single/paired) information for a single or a pair of FASTQ sequencing libraries. Args: path_1: Path to single-end library or first mate file. path_2: Path to second mate file. Attributes: path_1: Path to single... | 2.425914 | 2 |
pcapass/__init__.py | ksadowski13/PCAPass | 3 | 6626147 | <filename>pcapass/__init__.py
from .layer import PCAPass
| <filename>pcapass/__init__.py
from .layer import PCAPass
| none | 1 | 1.139054 | 1 | |
994. Rotting Oranges/994. Rotting Oranges.py | JawadAsifBD/leetcode | 0 | 6626148 | <reponame>JawadAsifBD/leetcode
from typing import List
from itertools import product
from collections import deque
class Solution:
def orangesRotting(self, grid: List[List[int]]) -> int:
queue = deque([])
m = len(grid)
n = len(grid[0])
rottenTimes = [[-1 for _ in range(n)] for _ in... | from typing import List
from itertools import product
from collections import deque
class Solution:
def orangesRotting(self, grid: List[List[int]]) -> int:
queue = deque([])
m = len(grid)
n = len(grid[0])
rottenTimes = [[-1 for _ in range(n)] for _ in range(m)]
# print(rott... | en | 0.417007 | # print(rottenTime) # rotten # print(i, j) # check left # grid[i][j] == 0 for no apple # check right # check up # check down # print(rottenTimes) # grid = [[2, 1, 1], [1, 1, 0], [0, 1, 1]] # grid = [[2, 1, 1], [0, 1, 1], [1, 0, 1]] # grid = [[0, 2]] | 3.328804 | 3 |
nutils/points.py | RezaZeinali91/NUTLIS | 0 | 6626149 | <gh_stars>0
# Copyright (c) 2014 Evalf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | # Copyright (c) 2014 Evalf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, s... | en | 0.803451 | # Copyright (c) 2014 Evalf # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, s... | 1.611705 | 2 |
test/shared/utils.py | Chia-Network/cibuildwheel | 0 | 6626150 | '''
Utility functions used by the cibuildwheel tests.
This file is added to the PYTHONPATH in the test runner at bin/run_test.py.
'''
import os
import platform as pm
import shutil
import subprocess
import sys
from contextlib import contextmanager
from tempfile import mkdtemp
IS_WINDOWS_RUNNING_ON_AZURE = os.path.exi... | '''
Utility functions used by the cibuildwheel tests.
This file is added to the PYTHONPATH in the test runner at bin/run_test.py.
'''
import os
import platform as pm
import shutil
import subprocess
import sys
from contextlib import contextmanager
from tempfile import mkdtemp
IS_WINDOWS_RUNNING_ON_AZURE = os.path.exi... | en | 0.830927 | Utility functions used by the cibuildwheel tests. This file is added to the PYTHONPATH in the test runner at bin/run_test.py. # Python 2 does not have a tempfile.TemporaryDirectory context manager Returns the list of build identifiers that cibuildwheel will try to build for the current platform. Runs cibuildwheel ... | 2.481622 | 2 |