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 |
|---|---|---|---|---|---|---|---|---|---|---|
tes_client/__init__.py | elixir-europe/TES-cli | 3 | 6624651 | """
Client for the mockup GA4GH Task Execution Service `mock-TES`.
"""
from urllib.parse import urlparse
from bravado.client import SwaggerClient
from bravado_core.formatter import DEFAULT_FORMATS
from bravado.requests_client import RequestsClient
# Bravado configuration
DEFAULT_CONFIG = {
"validate_requests": Fa... | """
Client for the mockup GA4GH Task Execution Service `mock-TES`.
"""
from urllib.parse import urlparse
from bravado.client import SwaggerClient
from bravado_core.formatter import DEFAULT_FORMATS
from bravado.requests_client import RequestsClient
# Bravado configuration
DEFAULT_CONFIG = {
"validate_requests": Fa... | en | 0.700297 | Client for the mockup GA4GH Task Execution Service `mock-TES`. # Bravado configuration Client for mock-TES service. | 2.157849 | 2 |
coro/ldap/test/t0.py | amitdev/shrapnel | 98 | 6624652 | # -*- Mode: Python -*-
import unittest
import sys
from coro.asn1.ber import *
from coro.ldap.query import *
C = 'context'
pq_tests = [
# simple equality
('(xxx=yyy)',
((C, 3, ['xxx', 'yyy']),
12)),
# simple expression, plus 'present'
('(|(xx=y)(zz=*))',
((C, 1, [(C, 3, ['xx', 'y']), (... | # -*- Mode: Python -*-
import unittest
import sys
from coro.asn1.ber import *
from coro.ldap.query import *
C = 'context'
pq_tests = [
# simple equality
('(xxx=yyy)',
((C, 3, ['xxx', 'yyy']),
12)),
# simple expression, plus 'present'
('(|(xx=y)(zz=*))',
((C, 1, [(C, 3, ['xx', 'y']), (... | en | 0.573388 | # -*- Mode: Python -*- # simple equality # simple expression, plus 'present' # nary expressions # noqa # approximate match # substring # syntax errors # good hex escape # bad hex escape # upper/lower case hex escape # escaped splat # illegal splat # junk/illegal # lots of parens # expression too complex # expression no... | 2.184822 | 2 |
utils/PyRSS2Gen.py | louis-pre/NewsBlur | 3,073 | 6624653 | <filename>utils/PyRSS2Gen.py
"""PyRSS2Gen - A Python library for generating RSS 2.0 feeds."""
__name__ = "PyRSS2Gen"
__version__ = (1, 0, 0)
__author__ = "<NAME> <<EMAIL>>"
_generator_name = __name__ + "-" + ".".join(map(str, __version__))
import datetime
# Could make this the base class; will need to add 'publish'... | <filename>utils/PyRSS2Gen.py
"""PyRSS2Gen - A Python library for generating RSS 2.0 feeds."""
__name__ = "PyRSS2Gen"
__version__ = (1, 0, 0)
__author__ = "<NAME> <<EMAIL>>"
_generator_name = __name__ + "-" + ".".join(map(str, __version__))
import datetime
# Could make this the base class; will need to add 'publish'... | en | 0.811039 | PyRSS2Gen - A Python library for generating RSS 2.0 feeds. # Could make this the base class; will need to add 'publish' # special-case handling to make the API easier # to use for the common case. # It better know how to emit the correct XML. convert a datetime into an RFC 822 formatted date Input date must be in ... | 2.748684 | 3 |
nilmtk/feature_detectors/cluster.py | erayon/nilmtk | 1 | 6624654 | from __future__ import print_function, division
import numpy as np
import pandas as pd
# Fix the seed for repeatability of experiments
SEED = 42
np.random.seed(SEED)
def cluster(X, max_num_clusters=3, exact_num_clusters=None):
'''Applies clustering on reduced data,
i.e. data where power is greater than th... | from __future__ import print_function, division
import numpy as np
import pandas as pd
# Fix the seed for repeatability of experiments
SEED = 42
np.random.seed(SEED)
def cluster(X, max_num_clusters=3, exact_num_clusters=None):
'''Applies clustering on reduced data,
i.e. data where power is greater than th... | en | 0.754337 | # Fix the seed for repeatability of experiments Applies clustering on reduced data, i.e. data where power is greater than threshold. Parameters ---------- X : pd.Series or single-column pd.DataFrame max_num_clusters : int Returns ------- centroids : ndarray of int32s Power in ... | 3.404694 | 3 |
eland/ndframe.py | davidkyle/eland | 0 | 6624655 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | en | 0.560687 | # Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ... | 2.070422 | 2 |
src/openprocurement/tender/pricequotation/models/requirement.py | ProzorroUKR/openprocurement.api | 10 | 6624656 | <reponame>ProzorroUKR/openprocurement.api
from schematics.types import StringType, MD5Type
from schematics.types.compound import ModelType
from schematics.transforms import blacklist
from schematics.validate import ValidationError
from uuid import uuid4
from openprocurement.api.models import schematics_default_role, sc... | from schematics.types import StringType, MD5Type
from schematics.types.compound import ModelType
from schematics.transforms import blacklist
from schematics.validate import ValidationError
from uuid import uuid4
from openprocurement.api.models import schematics_default_role, schematics_embedded_role
from openprocuremen... | none | 1 | 2.23782 | 2 | |
models/sandbox_currency.py | NikolayXHD/tinkoff-api-python | 0 | 6624657 | <reponame>NikolayXHD/tinkoff-api-python
from __future__ import annotations
import enum
class SandboxCurrency(enum.Enum):
RUB = 'RUB'
USD = 'USD'
EUR = 'EUR'
GBP = 'GBP'
HKD = 'HKD'
CHF = 'CHF'
JPY = 'JPY'
CNY = 'CNY'
TRY = 'TRY'
| from __future__ import annotations
import enum
class SandboxCurrency(enum.Enum):
RUB = 'RUB'
USD = 'USD'
EUR = 'EUR'
GBP = 'GBP'
HKD = 'HKD'
CHF = 'CHF'
JPY = 'JPY'
CNY = 'CNY'
TRY = 'TRY' | none | 1 | 2.51757 | 3 | |
tests/python/ConfigTest.py | elsandosgrande/OpenColorIO | 611 | 6624658 | <reponame>elsandosgrande/OpenColorIO
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
import copy
import unittest
import os
import sys
import PyOpenColorIO as OCIO
from UnitTestUtils import (SIMPLE_CONFIG_VIRTUAL_DISPLAY,
SIMPLE_CONFIG_VIRTUAL_DIS... | # SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
import copy
import unittest
import os
import sys
import PyOpenColorIO as OCIO
from UnitTestUtils import (SIMPLE_CONFIG_VIRTUAL_DISPLAY,
SIMPLE_CONFIG_VIRTUAL_DISPLAY_ACTIVE_DISPLAY,
... | en | 0.452218 | # SPDX-License-Identifier: BSD-3-Clause # Copyright Contributors to the OpenColorIO Project. # Legacy tests kept for reference. # # class ConfigTest(unittest.TestCase): # # SIMPLE_PROFILE = """ocio_profile_version: 1 # # search_path: luts # strictparsing: false # luma: [0.2126, 0.7152, 0.0722] # # roles: # default:... | 1.935585 | 2 |
examples/meter_reader/train_detection.py | yaoshanliang/PaddleX | 2 | 6624659 | import os
# 选择使用0号卡
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
from paddlex.det import transforms
import paddlex as pdx
# 下载和解压表计检测数据集
meter_det_dataset = 'https://bj.bcebos.com/paddlex/examples/meter_reader/datasets/meter_det.tar.gz'
pdx.utils.download_and_decompress(meter_det_dataset, path='./')
# 定义训练和验证时的transform... | import os
# 选择使用0号卡
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
from paddlex.det import transforms
import paddlex as pdx
# 下载和解压表计检测数据集
meter_det_dataset = 'https://bj.bcebos.com/paddlex/examples/meter_reader/datasets/meter_det.tar.gz'
pdx.utils.download_and_decompress(meter_det_dataset, path='./')
# 定义训练和验证时的transform... | zh | 0.665709 | # 选择使用0号卡 # 下载和解压表计检测数据集 # 定义训练和验证时的transforms # 定义训练和验证所用的数据集 # 初始化模型,并进行训练 # 可使用VisualDL查看训练指标 # VisualDL启动方式: visualdl --logdir output/yolov3_darknet/vdl_log --port 8001 # 浏览器打开 https://0.0.0.0:8001即可 # 其中0.0.0.0为本机访问,如为远程服务, 改成相应机器IP # API说明: https://paddlex.readthedocs.io/zh_CN/latest/apis/models/detection.html#yo... | 1.840936 | 2 |
dliplib/utils/weights/__init__.py | oterobaguer/ct-dip-benchmark | 0 | 6624660 | <reponame>oterobaguer/ct-dip-benchmark<filename>dliplib/utils/weights/__init__.py
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_weights_path(weights_key):
path = os.path.join(BASE_DIR, 'weights', we... | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_weights_path(weights_key):
path = os.path.join(BASE_DIR, 'weights', weights_key + '.pt')
return path
def save_weights(reconstructor, weights_key, ... | en | 0.747926 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) Saves parameters to a file :param model: PyTorch model that will save the weights :param weights_key: Key that identifies the weights Loads weights from file :param model: PyTorch model that will load the weights :param weights_key:... | 2.678451 | 3 |
senlin_dashboard/cluster/nodes/forms.py | sangtq-vn/senlin-dashboard | 18 | 6624661 | <reponame>sangtq-vn/senlin-dashboard
# 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... | # 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
# distributed under the Li... | en | 0.851908 | # 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 # distributed under the Li... | 1.761661 | 2 |
ooobuild/lo/animations/animation_end_sync.py | Amourspirit/ooo_uno_tmpl | 0 | 6624662 | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | en | 0.842253 | # coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http: // www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab... | 1.612955 | 2 |
app/utils/es_connection.py | raunaktr/pokedex_api | 0 | 6624663 |
def es_verify(val):
if val.get('_shards').get('failed') <= 0:
return "its-working!"
else:
return "es-failure"
|
def es_verify(val):
if val.get('_shards').get('failed') <= 0:
return "its-working!"
else:
return "es-failure"
| none | 1 | 2.167962 | 2 | |
src/train.py | cal859/music-maker-2000 | 0 | 6624664 | <filename>src/train.py
from collections import Counter
from dataclasses import dataclass
import os
import pickle as pkl
import numpy as np
import streamlit as st
import torch
import torch.nn as nn
from prep_data import CleanTextData
# Class for model parameters
@dataclass
class ModelConfig:
seq_size: int
bat... | <filename>src/train.py
from collections import Counter
from dataclasses import dataclass
import os
import pickle as pkl
import numpy as np
import streamlit as st
import torch
import torch.nn as nn
from prep_data import CleanTextData
# Class for model parameters
@dataclass
class ModelConfig:
seq_size: int
bat... | en | 0.709645 | # Class for model parameters # Transfer data to GPU # Tell it we are in training mode # Reset all gradients # Transfer data to GPU (if present) # Perform back-propagation # Update the network's parameters | 2.560292 | 3 |
setup.py | TinghuiWang/pyActLearn | 3 | 6624665 | #!/usr/bin/env python3
#
# Copyright (c) 2015, <NAME> <<EMAIL>>
# All rights reserved.
from setuptools import setup, find_packages
from Cython.Build import cythonize
import os
CLASSIFIERS = """\
Development Status :: 2 - Pre-Alpha
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Ap... | #!/usr/bin/env python3
#
# Copyright (c) 2015, <NAME> <<EMAIL>>
# All rights reserved.
from setuptools import setup, find_packages
from Cython.Build import cythonize
import os
CLASSIFIERS = """\
Development Status :: 2 - Pre-Alpha
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Ap... | en | 0.547343 | #!/usr/bin/env python3 # # Copyright (c) 2015, <NAME> <<EMAIL>> # All rights reserved. \ Development Status :: 2 - Pre-Alpha Intended Audience :: Developers Intended Audience :: Science/Research License :: OSI Approved :: BSD License Operating System :: POSIX Operating System :: POSIX :: Linux Programming Language :: P... | 1.804578 | 2 |
test.py | biguscj7/word_search_creator | 3 | 6624666 | <filename>test.py
# import word_search_creator.py via the execfile function
execfile("word_search_creator.py")
# test createWordSearch function with 8 randomly generated words
returnedWordSearch = createWordSearch(["seemly", "exotic", "obese", "disagreeable", "earn", "spark", "strengthen", "colossal"])
print stringify... | <filename>test.py
# import word_search_creator.py via the execfile function
execfile("word_search_creator.py")
# test createWordSearch function with 8 randomly generated words
returnedWordSearch = createWordSearch(["seemly", "exotic", "obese", "disagreeable", "earn", "spark", "strengthen", "colossal"])
print stringify... | en | 0.403792 | # import word_search_creator.py via the execfile function # test createWordSearch function with 8 randomly generated words | 2.865824 | 3 |
Blog_Website/BlogApp/migrations/0011_alter_blogpost_image.py | MetinIlgar/BlogWebsite | 1 | 6624667 | # Generated by Django 4.0.3 on 2022-03-06 14:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('BlogApp', '0010_aboutme'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='image',
... | # Generated by Django 4.0.3 on 2022-03-06 14:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('BlogApp', '0010_aboutme'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='image',
... | en | 0.835988 | # Generated by Django 4.0.3 on 2022-03-06 14:05 | 1.454325 | 1 |
asg/input/__init__.py | aidangoettsch/asg | 8 | 6624668 | <filename>asg/input/__init__.py
from .spice import spice_to_il
| <filename>asg/input/__init__.py
from .spice import spice_to_il
| none | 1 | 1.055732 | 1 | |
imageproc/tasks.py | rossifranca/genegraphics | 5 | 6624669 | from __future__ import absolute_import, unicode_literals
from .celery import app
from celery.utils.log import get_task_logger
import time
from PIL import Image
import subprocess
from cairosvg import svg2png
from subprocess import check_output, STDOUT
import shlex
import sys
from pathlib import Path
TIMEOUT = 90
logge... | from __future__ import absolute_import, unicode_literals
from .celery import app
from celery.utils.log import get_task_logger
import time
from PIL import Image
import subprocess
from cairosvg import svg2png
from subprocess import check_output, STDOUT
import shlex
import sys
from pathlib import Path
TIMEOUT = 90
logge... | en | 0.825687 | # Get the basename for the output file Make svg file if it doesn't exist and return the file name. If it exists, just return the file name. # Check if svg file exists # Create the svg file # Make PNG file from SVG file # Make EMF file from SVG file # Make EPS file from SVG file # Make TIFF fi... | 2.217723 | 2 |
modules/dbnd/src/dbnd/_core/tracking/tracking_info_convertor.py | turbaszek/dbnd | 0 | 6624670 | import hashlib
import logging
import typing
from functools import partial
from itertools import chain
from dbnd._core.constants import RunState, TaskRunState
from dbnd._core.context.databand_context import DatabandContext
from dbnd._core.tracking.tracking_info_objects import (
TargetInfo,
TaskDefinitionInfo,
... | import hashlib
import logging
import typing
from functools import partial
from itertools import chain
from dbnd._core.constants import RunState, TaskRunState
from dbnd._core.context.databand_context import DatabandContext
from dbnd._core.tracking.tracking_info_objects import (
TargetInfo,
TaskDefinitionInfo,
... | en | 0.875614 | # type: DatabandRun # type: () -> RunInfo # deprecate and airflow # move to task # root and submitted by # type: () -> InitRunArgs # type: (List[TaskRun], bool) -> TaskRunsInfo # we process only tasks in current dag # set children/upstreams maps # type: (Task, Dict[str, TargetInfo]) -> List[TargetInfo] :param run: ... | 1.820341 | 2 |
arjuna/core/types/named_strings.py | test-mile/arjuna | 9 | 6624671 | '''
This file is a part of Test Mile Arjuna
Copyright 2018 Test Mile Software Testing Pvt Ltd
Website: www.TestMile.com
Email: support [at] testmile.com
Creator: <NAME>
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 cop... | '''
This file is a part of Test Mile Arjuna
Copyright 2018 Test Mile Software Testing Pvt Ltd
Website: www.TestMile.com
Email: support [at] testmile.com
Creator: <NAME>
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 cop... | en | 0.850593 | This file is a part of Test Mile Arjuna Copyright 2018 Test Mile Software Testing Pvt Ltd Website: www.TestMile.com Email: support [at] testmile.com Creator: <NAME> 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... | 1.976273 | 2 |
specific_scripts/connect_remote_mongo.py | kenstars/Python_Scripts | 0 | 6624672 | from sshtunnel import SSHTunnelForwarder
import pymongo
MONGO_HOST = "REMOTE HOST IP"
MONGO_DB = "MONGO DB NAME"
MONGO_USER = "USERNAME"
MONGO_PASS = "PASSWORD"
server = SSHTunnelForwarder(
MONGO_HOST,
ssh_username=MONGO_USER,
ssh_password=<PASSWORD>,
remote_bind_address=('127.0.0.1', 27017)
)
server.... | from sshtunnel import SSHTunnelForwarder
import pymongo
MONGO_HOST = "REMOTE HOST IP"
MONGO_DB = "MONGO DB NAME"
MONGO_USER = "USERNAME"
MONGO_PASS = "PASSWORD"
server = SSHTunnelForwarder(
MONGO_HOST,
ssh_username=MONGO_USER,
ssh_password=<PASSWORD>,
remote_bind_address=('127.0.0.1', 27017)
)
server.... | en | 0.380592 | # start the ssh tunnel # server.local_bind_port is assigned local port ############################# # Any mongo queries required can be used here # As per requirement. ############################# # stop the ssh tunnel | 3.007726 | 3 |
happier/util.py | williamhogman/happier | 5 | 6624673 | <reponame>williamhogman/happier<gh_stars>1-10
import os
import os.path
ROOTS = {
"pyproject.toml",
"requirements.txt",
"Pipfile",
}
def find_root(cwd: str = None, max_jumps: int = 7):
if cwd is None:
return os.getcwd()
if max_jumps == 0:
return None
files = {f for f in os.lis... | import os
import os.path
ROOTS = {
"pyproject.toml",
"requirements.txt",
"Pipfile",
}
def find_root(cwd: str = None, max_jumps: int = 7):
if cwd is None:
return os.getcwd()
if max_jumps == 0:
return None
files = {f for f in os.listdir(cwd) if os.path.isfile(os.path.join(cwd, ... | none | 1 | 2.928775 | 3 | |
ichnaea/api/tests.py | szjozsef/ichnaea | 348 | 6624674 | import json
import time
from unittest import mock
import colander
import pytest
from pyramid.request import Request
from ichnaea.api.key import get_key, Key
from ichnaea.api import exceptions as api_exceptions
from ichnaea.api.rate_limit import rate_limit_exceeded
from ichnaea.api.schema import RenamingMapping
from i... | import json
import time
from unittest import mock
import colander
import pytest
from pyramid.request import Request
from ichnaea.api.key import get_key, Key
from ichnaea.api import exceptions as api_exceptions
from ichnaea.api.rate_limit import rate_limit_exceeded
from ichnaea.api.schema import RenamingMapping
from i... | en | 0.672077 | # Test get cache # Test get cache # A global_locate_sample_rate can turn off samples # And can raise a sample rate | 2.036604 | 2 |
serverless_zoom_recordings/finish_ingest.py | openlibraryenvironment/serverless-zoom-recordings | 0 | 6624675 | """
Perform the final actions of the ingestion step function.
"""
import json
import os
import boto3
import structlog
from zoomus import ZoomClient
from .util.identifiers import parse_organization
from .util.log_config import setup_logging
from .util.recording_path import recording_path
DEPLOYMENT_STAGE = os.enviro... | """
Perform the final actions of the ingestion step function.
"""
import json
import os
import boto3
import structlog
from zoomus import ZoomClient
from .util.identifiers import parse_organization
from .util.log_config import setup_logging
from .util.recording_path import recording_path
DEPLOYMENT_STAGE = os.enviro... | en | 0.692205 | Perform the final actions of the ingestion step function. Handle Step Function ##STAGE Save recording document ##STAGE Delete recording from Zoom ##STAGE Send message to website builder routine | 2.149992 | 2 |
IPython/utils/PyColorize.py | dchichkov/ipython | 0 | 6624676 | # -*- coding: utf-8 -*-
"""
Class and program to colorize python source code for ANSI terminals.
Based on an HTML code highlighter by <NAME> found at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
Modifications by <NAME> (<EMAIL>).
Information on the original HTML highlighter follows:
MoinMoin - Pyt... | # -*- coding: utf-8 -*-
"""
Class and program to colorize python source code for ANSI terminals.
Based on an HTML code highlighter by <NAME> found at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
Modifications by <NAME> (<EMAIL>).
Information on the original HTML highlighter follows:
MoinMoin - Pyt... | en | 0.680042 | # -*- coding: utf-8 -*- Class and program to colorize python source code for ANSI terminals. Based on an HTML code highlighter by <NAME> found at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298 Modifications by <NAME> (<EMAIL>). Information on the original HTML highlighter follows: MoinMoin - Python ... | 2.665022 | 3 |
src/pyast_utils.py | kkourt/cmnnc | 8 | 6624677 | <filename>src/pyast_utils.py
# Copyright (c) 2019, IBM Research.
#
# Author: <NAME> <<EMAIL>>
#
# vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4:
import itertools
import copy
import ast as pyast
class StructureTupleYields(pyast.NodeTransformer):
""" AST transformer for "structuring" yielded tuples
... | <filename>src/pyast_utils.py
# Copyright (c) 2019, IBM Research.
#
# Author: <NAME> <<EMAIL>>
#
# vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4:
import itertools
import copy
import ast as pyast
class StructureTupleYields(pyast.NodeTransformer):
""" AST transformer for "structuring" yielded tuples
... | en | 0.74019 | # Copyright (c) 2019, IBM Research. # # Author: <NAME> <<EMAIL>> # # vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: AST transformer for "structuring" yielded tuples For example, if structure is (2,3), then a yield expression, yielding a 5-tuple: yield (a,b,c,d,e) will be transformed to yield ... | 2.722852 | 3 |
tests/test_server.py | vituocgia/izi-grpc | 0 | 6624678 | import os
import signal
import threading
from unittest import mock
from izi_grpc.server import Server
from izi_grpc.signals import server_started, server_stopped
def test_server(app, logstream):
s = Server(app)
assert not s._stopped
def log_started(s):
app.logger.warn('started!')
def log_st... | import os
import signal
import threading
from unittest import mock
from izi_grpc.server import Server
from izi_grpc.signals import server_started, server_stopped
def test_server(app, logstream):
s = Server(app)
assert not s._stopped
def log_started(s):
app.logger.warn('started!')
def log_st... | none | 1 | 2.256482 | 2 | |
pytorch_sound/data/meta/libri_light.py | lunarbridge/pytorch_sound | 86 | 6624679 | import pandas as pd
import os
import json
from typing import List, Tuple
from pytorch_sound.data.meta.commons import split_train_val_frame
from pytorch_sound.data.dataset import SpeechDataLoader, SpeechDataset
from pytorch_sound.data.meta import MetaFrame, MetaType
class LibriLightMeta(MetaFrame):
"""
Exte... | import pandas as pd
import os
import json
from typing import List, Tuple
from pytorch_sound.data.meta.commons import split_train_val_frame
from pytorch_sound.data.dataset import SpeechDataLoader, SpeechDataset
from pytorch_sound.data.meta import MetaFrame, MetaType
class LibriLightMeta(MetaFrame):
"""
Exte... | en | 0.5194 | Extended MetaFrame for using Libri Light Dataset https://github.com/facebookresearch/libri-light # setup parameters # make dict # change meta obj # make speaker as indices # update infos # read duration # split train / val # save data frames # save speaker map as json # TODO: update this function in general # load ... | 2.547925 | 3 |
HW5/model/model_utils.py | joycenerd/Computer_Vision_2021 | 0 | 6624680 | <reponame>joycenerd/Computer_Vision_2021<filename>HW5/model/model_utils.py
from .resnest.restnest import get_model
from options import opt
from efficientnet_pytorch import EfficientNet
import torch
def get_net(model):
if model == 'resnest50':
model = torch.hub.load('zhanghang1989/ResNeSt', 'resnest50', p... | from .resnest.restnest import get_model
from options import opt
from efficientnet_pytorch import EfficientNet
import torch
def get_net(model):
if model == 'resnest50':
model = torch.hub.load('zhanghang1989/ResNeSt', 'resnest50', pretrained=True)
return model
elif model == 'resnest101':
... | none | 1 | 2.489017 | 2 | |
tests/feature_prep_test.py | JherezTaylor/thesis-preprocessing | 13 | 6624681 | # Author: <NAME> <<EMAIL>>
# License: MIT
# Python 3.5
"""Test feature_prep module
"""
import string
from nose.tools import *
from context import hatespeech_core
class TestFeaturePrep(object):
""" init class """
def __init__(self):
self.test_list = ["I'm here", "get rekt", "#squadgoals okay"]
... | # Author: <NAME> <<EMAIL>>
# License: MIT
# Python 3.5
"""Test feature_prep module
"""
import string
from nose.tools import *
from context import hatespeech_core
class TestFeaturePrep(object):
""" init class """
def __init__(self):
self.test_list = ["I'm here", "get rekt", "#squadgoals okay"]
... | en | 0.793851 | # Author: <NAME> <<EMAIL>> # License: MIT # Python 3.5 Test feature_prep module init class This method is run once before _each_ test method is executed This method is run once after _each_ test method is executed This method tests the OR concatenation function | 2.56546 | 3 |
api_tests/entitlements/serializers/test_serializers.py | RCOSDP/osf.io | 0 | 6624682 | <reponame>RCOSDP/osf.io
import pytest
from api.entitlements.serializers import LoginAvailabilitySerializer
@pytest.mark.django_db
class TestLoginAvailabilitySerializer:
def test_serializer(self):
id_test = '1'
payload = {
'institution_id': id_test,
'entitlements': ['gkn1-e... | import pytest
from api.entitlements.serializers import LoginAvailabilitySerializer
@pytest.mark.django_db
class TestLoginAvailabilitySerializer:
def test_serializer(self):
id_test = '1'
payload = {
'institution_id': id_test,
'entitlements': ['gkn1-ent1', 'gkn1-ent2', 'gkn1... | none | 1 | 2.55725 | 3 | |
lib/galaxy/tools/parameters/validation.py | Tomasz69/galaxy | 0 | 6624683 | """
Classes related to parameter validation.
"""
import logging
import re
from six import string_types
from galaxy import (
model,
util
)
log = logging.getLogger(__name__)
class Validator(object):
"""
A validator checks that a value meets some conditions OR raises ValueError
"""
requires_da... | """
Classes related to parameter validation.
"""
import logging
import re
from six import string_types
from galaxy import (
model,
util
)
log = logging.getLogger(__name__)
class Validator(object):
"""
A validator checks that a value meets some conditions OR raises ValueError
"""
requires_da... | en | 0.52011 | Classes related to parameter validation. A validator checks that a value meets some conditions OR raises ValueError Initialize the appropiate Validator class example call `validation.Validator.from_element(ToolParameter_object, Validator_object)` needs to be implemented in the subclasses and should re... | 3.34701 | 3 |
kurisu/cogs/utility.py | khakers/Kurisu | 4 | 6624684 | from io import BytesIO
from typing import cast, Optional, Union
import io
from PIL import Image, ImageDraw
from discord.ext import commands
import discord
from utils.kurisu import KurisuBot
class Utility(commands.Cog):
"""A module filled with informative commands. Could be info a bout a guild, user, etc"""
... | from io import BytesIO
from typing import cast, Optional, Union
import io
from PIL import Image, ImageDraw
from discord.ext import commands
import discord
from utils.kurisu import KurisuBot
class Utility(commands.Cog):
"""A module filled with informative commands. Could be info a bout a guild, user, etc"""
... | en | 0.71681 | A module filled with informative commands. Could be info a bout a guild, user, etc Get information about a certain guild Returns info about a user Returns info about a role Returns information about a emoji/emote(Within the current guild) Get a emoji in big size lol https://github.com/glasnt/emojificate/blob/master/emo... | 2.495177 | 2 |
python/Basit_Kareem/Exercise1_TB_Basit.py | Tech-Buddies/TB-1.0-Intermediate | 0 | 6624685 | <filename>python/Basit_Kareem/Exercise1_TB_Basit.py
from math import *
def add_num(x= 5, y = 7):
sumAnswer = x + y
print("sum of {0} and {1} = {2:.2f}".format(x,y,sumAnswer))
return sumAnswer
def sub_num(x = 4, y = 9):
subAnswer = x - y
print("difference between {0} and {1} = {2:.2f}".format(x,y,s... | <filename>python/Basit_Kareem/Exercise1_TB_Basit.py
from math import *
def add_num(x= 5, y = 7):
sumAnswer = x + y
print("sum of {0} and {1} = {2:.2f}".format(x,y,sumAnswer))
return sumAnswer
def sub_num(x = 4, y = 9):
subAnswer = x - y
print("difference between {0} and {1} = {2:.2f}".format(x,y,s... | none | 1 | 4.160811 | 4 | |
environments/environment.py | geektoni/learning_programs_with_arguments | 0 | 6624686 | <reponame>geektoni/learning_programs_with_arguments
from abc import ABC, abstractmethod
import numpy as np
class Environment(ABC):
def __init__(self, programs_library, prog_to_func, prog_to_precondition, prog_to_postcondition, arguments):
"""
Args:
programs_library (dict): Maps a prog... | from abc import ABC, abstractmethod
import numpy as np
class Environment(ABC):
def __init__(self, programs_library, prog_to_func, prog_to_precondition, prog_to_postcondition, arguments):
"""
Args:
programs_library (dict): Maps a program name to a level and a bool indicating whether re... | en | 0.7979 | Args: programs_library (dict): Maps a program name to a level and a bool indicating whether recursive prog_to_func (dict): Maps 0 level programs to their implementation function prog_to_precondition (dict): Maps a program name to the function that states whether its preconditions are... | 3.251057 | 3 |
src/py/statiskit/core/distribution.py | StatisKit/Core | 0 | 6624687 | <reponame>StatisKit/Core
from functools import wraps
import math
from statiskit import linalg
from statiskit import stl
from . import _core
from .__core.statiskit import (_ShiftedDistribution,
UnivariateDistribution,
_UnivariateFrequencyDistribution,
... | from functools import wraps
import math
from statiskit import linalg
from statiskit import stl
from . import _core
from .__core.statiskit import (_ShiftedDistribution,
UnivariateDistribution,
_UnivariateFrequencyDistribution,
... | en | 0.321473 | # _IndependentMultivariateDistribution, # CategoricalIndependentMultivariateDistribution, # DiscreteIndependentMultivariateDistribution, # ContinuousIndependentMultivariateDistribution, # 'IndependentMultivariateDistribution', #HierarchicalDistribution.__init__ = wrapper(HierarchicalDistribution.__init__) # def wrapper... | 1.495298 | 1 |
optimus/helpers/constants.py | XD-DENG/Optimus | 1 | 6624688 | from optimus.helpers.logger import logger
# Python to PySpark reference
#
# type(None): NullType,
# bool: BooleanType,
# int: LongType,
# float: DoubleType,
# str: StringType,
# bytearray: BinaryType,
# decimal.Decimal: DecimalType,
# datetime.date: DateType,
# datetime.datetime: TimestampType,
# datetime.time: Timest... | from optimus.helpers.logger import logger
# Python to PySpark reference
#
# type(None): NullType,
# bool: BooleanType,
# int: LongType,
# float: DoubleType,
# str: StringType,
# bytearray: BinaryType,
# decimal.Decimal: DecimalType,
# datetime.date: DateType,
# datetime.datetime: TimestampType,
# datetime.time: Timest... | en | 0.425703 | # Python to PySpark reference # # type(None): NullType, # bool: BooleanType, # int: LongType, # float: DoubleType, # str: StringType, # bytearray: BinaryType, # decimal.Decimal: DecimalType, # datetime.date: DateType, # datetime.datetime: TimestampType, # datetime.time: TimestampType, # Profiler Actions that modify a c... | 2.552089 | 3 |
tests/test_align_coord.py | moshi4/GBKviz | 3 | 6624689 | from gbkviz.align_coord import AlignCoord
def test_is_inverted():
"""test is inverted"""
align_coord = AlignCoord(11, 100, 501, 600, 90, 100, 80.0, "ref", "query")
assert align_coord.is_inverted is False
align_coord = AlignCoord(100, 11, 501, 600, 90, 100, 80.0, "ref", "query")
assert align_coord... | from gbkviz.align_coord import AlignCoord
def test_is_inverted():
"""test is inverted"""
align_coord = AlignCoord(11, 100, 501, 600, 90, 100, 80.0, "ref", "query")
assert align_coord.is_inverted is False
align_coord = AlignCoord(100, 11, 501, 600, 90, 100, 80.0, "ref", "query")
assert align_coord... | en | 0.683702 | test is inverted test add offset test filter # No setting # Min Length setting # Identity setting # Both setting | 2.72908 | 3 |
Lib/distutils/tests/test_build_py.py | ystk/debian-python3.1 | 0 | 6624690 | """Tests for distutils.command.build_py."""
import os
import sys
import io
import unittest
from distutils.command.build_py import build_py
from distutils.core import Distribution
from distutils.errors import DistutilsFileError
from distutils.tests import support
class BuildPyTestCase(support.TempdirManager,
... | """Tests for distutils.command.build_py."""
import os
import sys
import io
import unittest
from distutils.command.build_py import build_py
from distutils.core import Distribution
from distutils.errors import DistutilsFileError
from distutils.tests import support
class BuildPyTestCase(support.TempdirManager,
... | en | 0.81388 | Tests for distutils.command.build_py. # script_name need not exist, it just need to be initialized # This makes sure the list of outputs includes byte-compiled # files for Python modules but not for package data files # (there shouldn't *be* byte-code files for those!). # # See SF 1668596/1720897. # create the distribu... | 2.467164 | 2 |
tests/test_errors.py | jdknight/sphinxcontrib-blockdiag | 15 | 6624691 | <filename>tests/test_errors.py<gh_stars>10-100
# -*- coding: utf-8 -*-
from mock import patch
from sphinx_testing import with_app
import sys
import unittest
class TestSphinxcontribBlockdiagErrors(unittest.TestCase):
@with_app(srcdir='tests/docs/basic', write_docstring=True)
def test_parse_error(self, app, s... | <filename>tests/test_errors.py<gh_stars>10-100
# -*- coding: utf-8 -*-
from mock import patch
from sphinx_testing import with_app
import sys
import unittest
class TestSphinxcontribBlockdiagErrors(unittest.TestCase):
@with_app(srcdir='tests/docs/basic', write_docstring=True)
def test_parse_error(self, app, s... | en | 0.667627 | # -*- coding: utf-8 -*- .. blockdiag:: { A -> B; # unload reportlab and make loading it impossible | 2.244143 | 2 |
trainer.py | souschefistry/cs230 | 0 | 6624692 | <reponame>souschefistry/cs230
"""
Copyright (c) 2018 dibghosh AT stanford edu
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
t... | """
Copyright (c) 2018 dibghosh AT stanford edu
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... | en | 0.709666 | Copyright (c) 2018 dibghosh AT stanford edu 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,... | 1.463906 | 1 |
tasks/package_manager/__init__.py | kuwv/spades | 0 | 6624693 | <reponame>kuwv/spades
'''Module for package managers.'''
| '''Module for package managers.''' | en | 0.668532 | Module for package managers. | 1.227145 | 1 |
python/getting_started/main.py | arnemolland/getting-started | 0 | 6624694 | import os
import json
from dotenv import load_dotenv
from .aws_signing import AwsSigningV4
from .request_handler import RequestHandler
load_dotenv()
load_dotenv(os.path.join(os.path.dirname(__name__), "..", ".env"))
client_id = os.environ.get("CLIENT_ID")
client_secret = os.environ.get("CLIENT_SECRET")
api_key = o... | import os
import json
from dotenv import load_dotenv
from .aws_signing import AwsSigningV4
from .request_handler import RequestHandler
load_dotenv()
load_dotenv(os.path.join(os.path.dirname(__name__), "..", ".env"))
client_id = os.environ.get("CLIENT_ID")
client_secret = os.environ.get("CLIENT_SECRET")
api_key = o... | none | 1 | 2.259642 | 2 | |
py/tkhello3.py | jieyaren/hello-world | 3 | 6624695 | #/usr/bin/python3
import tkinter
top = tkinter.Tk()
label = tkinter.Label(top,text='hello world')
label.pack()
q = tkinter.Button(top,text='fuck world',command=top.quit,bg='red',fg='white')
q.pack(fill=tkinter.X,expand=1)
tkinter.mainloop()
| #/usr/bin/python3
import tkinter
top = tkinter.Tk()
label = tkinter.Label(top,text='hello world')
label.pack()
q = tkinter.Button(top,text='fuck world',command=top.quit,bg='red',fg='white')
q.pack(fill=tkinter.X,expand=1)
tkinter.mainloop()
| fr | 0.649008 | #/usr/bin/python3 | 3.636359 | 4 |
pypy/objspace/std/typeobject.py | woodrow/pyoac | 1 | 6624696 | from pypy.objspace.std.objspace import *
from pypy.interpreter.function import Function, StaticMethod
from pypy.interpreter import gateway
from pypy.interpreter.typedef import weakref_descr
from pypy.objspace.std.stdtypedef import std_dict_descr, issubtypedef, Member
from pypy.objspace.std.objecttype import object_type... | from pypy.objspace.std.objspace import *
from pypy.interpreter.function import Function, StaticMethod
from pypy.interpreter import gateway
from pypy.interpreter.typedef import weakref_descr
from pypy.objspace.std.stdtypedef import std_dict_descr, issubtypedef, Member
from pypy.objspace.std.objecttype import object_type... | en | 0.843715 | # from compiler/misc.py # magic constant from compile.c # annotator hint # can be overridden by specific instances # ^^^ for config.objspace.std.getattributeshortcut # (False is a conservative default, fixed during real usage) # or _HEAPTYPE # ^^^ conservative default, fixed during real usage # Invariant: version_tag i... | 1.897947 | 2 |
tests/dummypackage2/setup.py | msabramo/CheesePrism | 0 | 6624697 | from setuptools import setup
from setuptools import find_packages
version = '0.1'
setup(name='dummypackage',
version=version,
description="",
long_description="",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='',
... | from setuptools import setup
from setuptools import find_packages
version = '0.1'
setup(name='dummypackage',
version=version,
description="",
long_description="",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='',
... | en | 0.523309 | # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers # -*- Entry points: -*- | 1.422132 | 1 |
contrib/rackspace/rackspace/tests/test_auto_scale.py | jasondunsmore/heat | 1 | 6624698 | #
# 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
# ... | #
# 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
# ... | en | 0.634972 | # # 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 # ... | 1.962997 | 2 |
l7/z3.py | iCarrrot/Python | 0 | 6624699 | <reponame>iCarrrot/Python<gh_stars>0
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
class MyWindow(Gtk.Window):
def startTimer(self, widget):
t1 = self.time.get_text()
self.timer.start_odliczania(int(t1) - 1)
def startTimer1(self, widget):
t1 = 5 * ... | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
class MyWindow(Gtk.Window):
def startTimer(self, widget):
t1 = self.time.get_text()
self.timer.start_odliczania(int(t1) - 1)
def startTimer1(self, widget):
t1 = 5 * 50
self.timer.start_odliczani... | ja | 0.180888 | # self.time.set_text("czas") | 2.630747 | 3 |
notebooks/stimulus_presentation/ssvep.py | synicalsyntax/eeg-notebooks | 7 | 6624700 | """
Generate Steady-State Visually Evoked Potential (SSVEP)
=======================================================
Steady-State Visually Evoked Potential (SSVEP) stimulus presentation.
"""
from time import time
from optparse import OptionParser
import numpy as np
from pandas import DataFrame
from psyc... | """
Generate Steady-State Visually Evoked Potential (SSVEP)
=======================================================
Steady-State Visually Evoked Potential (SSVEP) stimulus presentation.
"""
from time import time
from optparse import OptionParser
import numpy as np
from pandas import DataFrame
from psyc... | en | 0.771314 | Generate Steady-State Visually Evoked Potential (SSVEP)
=======================================================
Steady-State Visually Evoked Potential (SSVEP) stimulus presentation. # Create markers stream outlet # Set up trial parameters # Set up trial list # Set up graphics Get possible SSVEP stimulation frequenc... | 2.771522 | 3 |
food-app-api/food_app_core/apps.py | sajith-v/food-app-api | 0 | 6624701 | from django.apps import AppConfig
class food_app_coreConfig(AppConfig):
name = 'food_app_core'
| from django.apps import AppConfig
class food_app_coreConfig(AppConfig):
name = 'food_app_core'
| none | 1 | 1.117506 | 1 | |
sorts/insertion_sort/insertion.py | JCode1986/python-data-structures-and-algorithms | 0 | 6624702 | def insertion_sort(lst):
"""
Sorts list from lowest to highest using insertion sort method
In - takes in a list of integers
Out - returns a list of sorted integers
"""
for i in range(1, len(lst)):
j = i - 1
temp = int((lst[i]))
while j >= 0 and temp < lst[j]:
lst[j + 1] = lst[j]
... | def insertion_sort(lst):
"""
Sorts list from lowest to highest using insertion sort method
In - takes in a list of integers
Out - returns a list of sorted integers
"""
for i in range(1, len(lst)):
j = i - 1
temp = int((lst[i]))
while j >= 0 and temp < lst[j]:
lst[j + 1] = lst[j]
... | en | 0.729689 | Sorts list from lowest to highest using insertion sort method In - takes in a list of integers Out - returns a list of sorted integers | 4.215509 | 4 |
examples/websocket/aggs.py | Polygon-io/client-python | 1 | 6624703 | <filename>examples/websocket/aggs.py
from polygon import WebSocketClient
from polygon.websocket.models import WebSocketMessage, EquityTrade
from typing import List
c = WebSocketClient(subscriptions=["T.*"])
class MessageHandler:
count = 0
def handle_msg(self, msgs: List[WebSocketMessage]):
for m in ... | <filename>examples/websocket/aggs.py
from polygon import WebSocketClient
from polygon.websocket.models import WebSocketMessage, EquityTrade
from typing import List
c = WebSocketClient(subscriptions=["T.*"])
class MessageHandler:
count = 0
def handle_msg(self, msgs: List[WebSocketMessage]):
for m in ... | none | 1 | 2.632133 | 3 | |
examples/models/image_object_detection/food_detection/food172.py | zlheui/singa-auto | 10 | 6624704 | from keras.applications.xception import Xception
from singa_auto.darknet.food_objection_base_model import FoodDetectionBase
class FoodDetection172(FoodDetectionBase):
def __init__(self, **knobs):
super().__init__(clf_model_class_name=Xception, **knobs)
# pre config
self.classes = 172
... | from keras.applications.xception import Xception
from singa_auto.darknet.food_objection_base_model import FoodDetectionBase
class FoodDetection172(FoodDetectionBase):
def __init__(self, **knobs):
super().__init__(clf_model_class_name=Xception, **knobs)
# pre config
self.classes = 172
... | en | 0.907479 | # pre config # preload files # this is the model file downloaded from internet, # can choose download locally and upload , or download from server # if download at server side, leave it to none # this is the trained model | 2.343766 | 2 |
src/sagemaker/chainer/model.py | aws-patlin/sagemaker-python-sdk | 0 | 6624705 | <gh_stars>0
# Copyright 2018-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "... | # Copyright 2018-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | en | 0.719968 | # Copyright 2018-2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil... | 1.816185 | 2 |
sym_api_client_python/__init__.py | 3tilley/symphony-api-client-python | 1 | 6624706 | <gh_stars>1-10
name = "sym_api_client_python"
| name = "sym_api_client_python" | none | 1 | 1.131033 | 1 | |
examples/contrib/lectures.py | klorel/or-tools | 279 | 6624707 | # Copyright 2010 <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 law or agreed to in writin... | # Copyright 2010 <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 law or agreed to in writin... | en | 0.850792 | # Copyright 2010 <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 law or agreed to in writin... | 2.358527 | 2 |
docs/podstawy/przyklady/04_listy_01.py | sokol02/python101 | 0 | 6624708 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# ~/python/04_1_listy.py
tupla = input("Podaj liczby oddzielone przecinkami: ")
lista = []
for i in range(len(tupla)):
lista.append(int(tupla[i]))
print "Elementy i ich indeksy:"
for i, v in enumerate(lista):
print v, "[", i, "]"
print "Elementy w odwróconym po... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# ~/python/04_1_listy.py
tupla = input("Podaj liczby oddzielone przecinkami: ")
lista = []
for i in range(len(tupla)):
lista.append(int(tupla[i]))
print "Elementy i ich indeksy:"
for i, v in enumerate(lista):
print v, "[", i, "]"
print "Elementy w odwróconym po... | en | 0.185043 | #! /usr/bin/env python # -*- coding: utf-8 -*- # ~/python/04_1_listy.py | 4.145789 | 4 |
utils/calculix/calculix_utils.py | parallelworks/welding-model | 2 | 6624709 | <gh_stars>1-10
import re
import warnings
import data_IO
def read_setting_from_str(text_line, setting_flag):
x = re.search(setting_flag, text_line, re.IGNORECASE)
if x is None:
warning_msg = 'Cannot find \"{}\" in line \"{}\"'.format(setting_flag, text_line)
print(warning_msg)
warnings.... | import re
import warnings
import data_IO
def read_setting_from_str(text_line, setting_flag):
x = re.search(setting_flag, text_line, re.IGNORECASE)
if x is None:
warning_msg = 'Cannot find \"{}\" in line \"{}\"'.format(setting_flag, text_line)
print(warning_msg)
warnings.warn(warning_ms... | en | 0.751391 | Stores set name and members Stores element set name and element numbers Stores node set name and node numbers Reads/Stores Node sets and element sets Reads and stores the weld pass coordinate information # First get the number of layers: # Then, read the passes in each layer Read time period of UNCOUPLED TEMPERATURE-DI... | 2.785479 | 3 |
tests/settings/__init__.py | Amin-egn/Recipient | 1 | 6624710 | <reponame>Amin-egn/Recipient
from .tests import TestSettings
| from .tests import TestSettings | none | 1 | 1.090032 | 1 | |
src/twisted/test/test_iutils.py | mithodin/twisted | 0 | 6624711 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test running processes with the APIs in L{twisted.internet.utils}.
"""
from __future__ import division, absolute_import
import warnings, os, stat, sys, signal
from twisted.python.compat import _PY3
from twisted.python.runtime import platfor... | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test running processes with the APIs in L{twisted.internet.utils}.
"""
from __future__ import division, absolute_import
import warnings, os, stat, sys, signal
from twisted.python.compat import _PY3
from twisted.python.runtime import platfor... | en | 0.846631 | # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. Test running processes with the APIs in L{twisted.internet.utils}. Test running a process using L{getProcessOutput}, L{getProcessValue}, and L{getProcessOutputAndValue}. Write the given list of lines to a text file and return the absolute ... | 2.113444 | 2 |
srm-service.py | dmshch/srm-service | 0 | 6624712 | # Copyright © 2020 <NAME>. All rights reserved.
# run point
from servmoncode import monitoring_process
monitoring_process.start()
| # Copyright © 2020 <NAME>. All rights reserved.
# run point
from servmoncode import monitoring_process
monitoring_process.start()
| en | 0.846676 | # Copyright © 2020 <NAME>. All rights reserved. # run point | 1.330306 | 1 |
h2o-py/tests/testdir_algos/gbm/pyunit_DEPRECATED_weightsGBM.py | huamichaelchen/h2o-3 | 0 | 6624713 | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import random
def weights_check():
def check_same(data1, data2, min_rows_scale):
gbm1_regression = h2o.gbm(x=data1[["displacement", "power", "weight", "acceleration", "year"]],
y="econo... | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import random
def weights_check():
def check_same(data1, data2, min_rows_scale):
gbm1_regression = h2o.gbm(x=data1[["displacement", "power", "weight", "acceleration", "year"]],
y="econo... | en | 0.93691 | # uniform weights same as no weights # zero weights same as removed observations # doubled weights same as doubled observations # TODO: random weights # TODO: all zero weights??? # TODO: negative weights??? | 2.449243 | 2 |
dephell_archive/_stream.py | jhermann/dephell_archive | 0 | 6624714 | # built-in
from contextlib import suppress
from pathlib import Path, PurePath
from typing import List, Optional, Set
# external
import attr
# app
from ._cached_property import cached_property
def _dir_list(filelist: List[str]) -> Set[str]:
# paths starting with '/' or containing '.' are not supported
dir_li... | # built-in
from contextlib import suppress
from pathlib import Path, PurePath
from typing import List, Optional, Set
# external
import attr
# app
from ._cached_property import cached_property
def _dir_list(filelist: List[str]) -> Set[str]:
# paths starting with '/' or containing '.' are not supported
dir_li... | en | 0.750272 | # built-in # external # app # paths starting with '/' or containing '.' are not supported # type: Set[str] # private # zip file # zip dir # Only zip have implicit dirs # used from ArchivePath # zip # zip explicit dir entry # public interface # extract to cache # read from cache | 2.290866 | 2 |
pyvplm/gui/csv_export.py | ArthurAmmeux/pyVPLM-GUI | 0 | 6624715 | import numpy as np
import csv
import pandas as pd
def open_csv_file(f_name):
"""
:param f_name: name of the csv file
:return: a new csv file with as many (1) as needed to not already exist
"""
try:
f = open(f_name, "x")
return f, f_name
except IOError:
r... | import numpy as np
import csv
import pandas as pd
def open_csv_file(f_name):
"""
:param f_name: name of the csv file
:return: a new csv file with as many (1) as needed to not already exist
"""
try:
f = open(f_name, "x")
return f, f_name
except IOError:
r... | en | 0.618615 | :param f_name: name of the csv file
:return: a new csv file with as many (1) as needed to not already exist Parameters
----------
doeX DOE points in physical space
file_name name of the .csv file (with extension)
parameter_set current physical parameter set (PositiveParameterSet)
out_heade... | 3.340031 | 3 |
algorithm.py | xiongzwfire/LeetCode-Solution | 0 | 6624716 | # coding: utf8
import sys
# ==排序==
"""
冒泡排序、直接插入排序、选择排序,时间复杂度O(n^2)
快速排序、归并排序、堆排序,时间复杂度O(nlogn)
"""
def bubbleSort(nums):
"""
冒泡排序:稳定排序
"""
size = len(nums)
for i in range(size):
flag = True
for j in range(1, size - i):
if nums[j] < nums[j-1]:
nums[j-1],... | # coding: utf8
import sys
# ==排序==
"""
冒泡排序、直接插入排序、选择排序,时间复杂度O(n^2)
快速排序、归并排序、堆排序,时间复杂度O(nlogn)
"""
def bubbleSort(nums):
"""
冒泡排序:稳定排序
"""
size = len(nums)
for i in range(size):
flag = True
for j in range(1, size - i):
if nums[j] < nums[j-1]:
nums[j-1],... | zh | 0.980097 | # coding: utf8 # ==排序== 冒泡排序、直接插入排序、选择排序,时间复杂度O(n^2) 快速排序、归并排序、堆排序,时间复杂度O(nlogn) 冒泡排序:稳定排序 插入排序:稳定排序 选择排序:不稳定排序 快速排序:不稳定 堆排序:不稳定 堆的定义:堆是一颗完全二叉树;若根节点有左孩子,则根节点的值<=左孩子节点的值;若根节点有右孩子,则根节点的值<=右孩子节点的值;以左右孩子为根的子树分别又是一个堆(小根堆) 堆的特性:(n为堆节点的个数) - 堆宜采用顺序存储结构(数组) - 分支节点的索引:0 ~ (n / 2) - 1;叶子节点的索引:n / 2 ~ n - 1 - ... | 3.74895 | 4 |
homeassistant/components/elv/switch.py | MrDelik/core | 30,023 | 6624717 | <reponame>MrDelik/core
"""Support for PCA 301 smart switch."""
from __future__ import annotations
import logging
import pypca
from serial import SerialException
from homeassistant.components.switch import SwitchEntity
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssista... | """Support for PCA 301 smart switch."""
from __future__ import annotations
import logging
import pypca
from serial import SerialException
from homeassistant.components.switch import SwitchEntity
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant
from homeassistant.h... | en | 0.752449 | Support for PCA 301 smart switch. Set up the PCA switch platform. Representation of a PCA Smart Plug switch. Initialize the switch. Return the name of the Smart Plug, if any. Return if switch is available. Return true if switch is on. Turn the switch on. Turn the switch off. Update the PCA switch's state. | 2.385115 | 2 |
utils/regression/forrest_run.py | noahsherrill/force-riscv | 111 | 6624718 | #!/usr/bin/env python3
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
... | #!/usr/bin/env python3
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
... | en | 0.858965 | #!/usr/bin/env python3 # # Copyright (C) [2020] Futurewei Technologies, Inc. # # FORCE-RISCV is 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 ... | 1.773382 | 2 |
garage/tf/exploration_strategies/ou_strategy.py | shadiakiki1986/garage | 3 | 6624719 | """
This module creates an OU exploration strategy.
Ornstein Uhlenbeck exploration strategy comes from the Ornstein-Uhlenbeck
process. It is often used in DDPG algorithm because in continuous control task
it is better to have temporally correlated exploration to get smoother
transitions. And OU process is relatively s... | """
This module creates an OU exploration strategy.
Ornstein Uhlenbeck exploration strategy comes from the Ornstein-Uhlenbeck
process. It is often used in DDPG algorithm because in continuous control task
it is better to have temporally correlated exploration to get smoother
transitions. And OU process is relatively s... | en | 0.782736 | This module creates an OU exploration strategy. Ornstein Uhlenbeck exploration strategy comes from the Ornstein-Uhlenbeck process. It is often used in DDPG algorithm because in continuous control task it is better to have temporally correlated exploration to get smoother transitions. And OU process is relatively smoot... | 3.104356 | 3 |
test/data/t1_expected.py | ci-fuzz/protobuf_parser | 0 | 6624720 | <filename>test/data/t1_expected.py
from proto_parser.proto_parser import ScopedSection, WORD_ROOT, WORD_PROTO_FILE, WORD_SERVICE, Service, RPC, Message, HttpMethod, \
WORD_MESSAGE, MessageField, WORD_FIELD
T1_BASKET_SERVICE_CONTENT = [
"rpc Update(UpdateBasketReq) returns (UpdateBasketResp) {",
"option (go... | <filename>test/data/t1_expected.py
from proto_parser.proto_parser import ScopedSection, WORD_ROOT, WORD_PROTO_FILE, WORD_SERVICE, Service, RPC, Message, HttpMethod, \
WORD_MESSAGE, MessageField, WORD_FIELD
T1_BASKET_SERVICE_CONTENT = [
"rpc Update(UpdateBasketReq) returns (UpdateBasketResp) {",
"option (go... | none | 1 | 2.166019 | 2 | |
PG/7-PPO/config.py | g6ling/Pytorch-Cartpole | 116 | 6624721 | import torch
env_name = 'CartPole-v1'
gamma = 0.99
lr = 0.001
goal_score = 200
log_interval = 10
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
lambda_gae = 0.96
epsilon_clip = 0.2
ciritic_coefficient = 0.5
entropy_coefficient = 0.01
batch_size = 8
epoch_k = 10
| import torch
env_name = 'CartPole-v1'
gamma = 0.99
lr = 0.001
goal_score = 200
log_interval = 10
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
lambda_gae = 0.96
epsilon_clip = 0.2
ciritic_coefficient = 0.5
entropy_coefficient = 0.01
batch_size = 8
epoch_k = 10
| none | 1 | 1.748558 | 2 | |
{{cookiecutter.project_shortname}}/tests/api/test_api_simple_flow.py | mvidalgarcia/cookiecutter-invenio-instance | 0 | 6624722 | {% include 'misc/header.py' %}
"""Test simple rest flow."""
import json
from invenio_search import current_search
def test_simple_flow(client):
"""Test simple flow using REST API."""
headers = [('Content-Type', 'application/json')]
data = {
'title': 'The title of the record ',
'c... | {% include 'misc/header.py' %}
"""Test simple rest flow."""
import json
from invenio_search import current_search
def test_simple_flow(client):
"""Test simple flow using REST API."""
headers = [('Content-Type', 'application/json')]
data = {
'title': 'The title of the record ',
'c... | en | 0.486129 | Test simple rest flow. Test simple flow using REST API. # create a record # retrieve record | 2.239959 | 2 |
resources/2019-05-16/zad1.py | lopiola/2lo | 0 | 6624723 | # -*- coding: utf-8 -*-
# Program otrzymuje listę zbiorów liczb,
# następnie wypisuje listę sum liczb w każdym zbiorze.
# Dla podanego przykładu (list1) program powinien wypisać: [10, 22, 38]
#
# W programie popełniono jednak 2 błędy.
# Znajdź je żeby otrzymać poprawny wynik!
if __name__ == '__main__':
list1 = [(... | # -*- coding: utf-8 -*-
# Program otrzymuje listę zbiorów liczb,
# następnie wypisuje listę sum liczb w każdym zbiorze.
# Dla podanego przykładu (list1) program powinien wypisać: [10, 22, 38]
#
# W programie popełniono jednak 2 błędy.
# Znajdź je żeby otrzymać poprawny wynik!
if __name__ == '__main__':
list1 = [(... | pl | 0.997994 | # -*- coding: utf-8 -*- # Program otrzymuje listę zbiorów liczb, # następnie wypisuje listę sum liczb w każdym zbiorze. # Dla podanego przykładu (list1) program powinien wypisać: [10, 22, 38] # # W programie popełniono jednak 2 błędy. # Znajdź je żeby otrzymać poprawny wynik! | 3.776202 | 4 |
utils/bots/CoreBot/cogs/RedirectService.py | Space-Turtle0/Timmy-BU | 0 | 6624724 | <reponame>Space-Turtle0/Timmy-BU
import os
import aiohttp
import discord
from dotenv import load_dotenv
from core import database
from core.checks import is_botAdmin
from discord.ext import commands
from core import redirect_sdk
load_dotenv()
class RedirectURL(commands.Cog):
def __init__(self, bot):
self... | import os
import aiohttp
import discord
from dotenv import load_dotenv
from core import database
from core.checks import is_botAdmin
from discord.ext import commands
from core import redirect_sdk
load_dotenv()
class RedirectURL(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.domain = ... | none | 1 | 2.407872 | 2 | |
exp.py | YSL-1997/DBx1000 | 0 | 6624725 | <reponame>YSL-1997/DBx1000
#!/usr/bin/env python3
import os
import os.path
import re
import subprocess as sp
from pathlib import Path
CFG_STD = "config-std.h"
CFG_CURR = "config.h"
RESULTS_DIR = Path("results")
def replace(filename, pattern, replacement):
f = open(filename)
s = f.read()
f.close()
s... | #!/usr/bin/env python3
import os
import os.path
import re
import subprocess as sp
from pathlib import Path
CFG_STD = "config-std.h"
CFG_CURR = "config.h"
RESULTS_DIR = Path("results")
def replace(filename, pattern, replacement):
f = open(filename)
s = f.read()
f.close()
s = re.sub(pattern, replacem... | en | 0.468196 | #!/usr/bin/env python3 #define\s" + re.escape(param) + r".*" # for num_threads in [2 ** i for i in range(0, 8)] # run_exp("scalability", scalability_exp) # run_exp("fanout", fanout_exp) # run_exp("contention", contention_exp) # run_exp("hotset", hotset_exp) # run_exp("latch", latch_exp) | 2.590799 | 3 |
test/test_20_filterlogmsg.py | growell/svnhook | 1 | 6624726 | <filename>test/test_20_filterlogmsg.py<gh_stars>1-10
#!/usr/bin/env python
######################################################################
# Test Log Message Filter
######################################################################
import os, re, sys, unittest
# Prefer local modules.
mylib = os.path.normpat... | <filename>test/test_20_filterlogmsg.py<gh_stars>1-10
#!/usr/bin/env python
######################################################################
# Test Log Message Filter
######################################################################
import os, re, sys, unittest
# Prefer local modules.
mylib = os.path.normpat... | en | 0.561861 | #!/usr/bin/env python ###################################################################### # Test Log Message Filter ###################################################################### # Prefer local modules. File Content Filter Tests No regex tag # Define the hook configuration. \ <?xml version="1.0"?> ... | 2.073139 | 2 |
GAN.py | oriyanh/digit-generation | 0 | 6624727 | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.layers import Dense, Flatten, Conv2D, Conv2DTranspose, \
Reshape, BatchNormalization, LeakyReLU, Dropout
from tensorflow.keras import Model
LATENT_DIM = 100
NUM_EPOCHS = 50
BATCH_SIZE = 256
LEARNING_RATE = 1e-4
d_tra... | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.layers import Dense, Flatten, Conv2D, Conv2DTranspose, \
Reshape, BatchNormalization, LeakyReLU, Dropout
from tensorflow.keras import Model
LATENT_DIM = 100
NUM_EPOCHS = 50
BATCH_SIZE = 256
LEARNING_RATE = 1e-4
d_tra... | en | 0.62155 | Wrapper for training step, needed if running more than one model per run :return: train step function Trains a model (subclassing tf.keras.Model) over MNIST data collection :param load_data: :param use_full_train_set: :param Model model: Model to train, whose __call__() function accepts a b... | 2.694555 | 3 |
Easy/BuyTheBundle.py | revanthsenthil/dCoder_select | 1 | 6624728 | <filename>Easy/BuyTheBundle.py
"""
Problem Description:
Jimmy wants to buy books for N students. He went to the bookshop to buy a bundle of books, each bundle has a different number of books. He wants to buy such a bundle that contains the number of books, which can be distributed equally amongst all the students.
Inp... | <filename>Easy/BuyTheBundle.py
"""
Problem Description:
Jimmy wants to buy books for N students. He went to the bookshop to buy a bundle of books, each bundle has a different number of books. He wants to buy such a bundle that contains the number of books, which can be distributed equally amongst all the students.
Inp... | en | 0.964471 | Problem Description: Jimmy wants to buy books for N students. He went to the bookshop to buy a bundle of books, each bundle has a different number of books. He wants to buy such a bundle that contains the number of books, which can be distributed equally amongst all the students. Input: First line contains T, number o... | 3.940804 | 4 |
tools/accuracy_checker/openvino/tools/accuracy_checker/evaluators/custom_evaluators/base_models.py | Ohtani-y/open_model_zoo | 0 | 6624729 | <filename>tools/accuracy_checker/openvino/tools/accuracy_checker/evaluators/custom_evaluators/base_models.py
"""
Copyright (c) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the Licens... | <filename>tools/accuracy_checker/openvino/tools/accuracy_checker/evaluators/custom_evaluators/base_models.py
"""
Copyright (c) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the Licens... | en | 0.850136 | Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing... | 1.739117 | 2 |
ex047_npares2em2.py | elisamariacampos/MundoPhyton | 0 | 6624730 | <reponame>elisamariacampos/MundoPhyton
for c in range (2,51,2):
print(c, end=' ') | for c in range (2,51,2):
print(c, end=' ') | none | 1 | 2.907701 | 3 | |
lowfat/migrations/0041_auto_20160720_1031.py | elena-kolomeets/lowfat | 6 | 6624731 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-20 10:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0040_auto_20160720_1029'),
]
operations =... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-20 10:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0040_auto_20160720_1029'),
]
operations =... | en | 0.750503 | # -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-07-20 10:31 | 1.410289 | 1 |
pyqus/__replaces.py | JorgeDeLosSantos/pyqus | 21 | 6624732 | <gh_stars>10-100
# -*- coding: utf-8 -*-
# __replaces.py
# =============================
# (c) 2015, <NAME>
# ITC-Bypasa
# =============================
#
from cfg import *
CONTENTS_REPLACES = {
"_deformedshape_":r"graphs/elements.png",
"_misesstress_":r"graphs/stress.png",
"_nominalstrain_":r"graphs/strain.png",
"_m... | # -*- coding: utf-8 -*-
# __replaces.py
# =============================
# (c) 2015, <NAME>
# ITC-Bypasa
# =============================
#
from cfg import *
CONTENTS_REPLACES = {
"_deformedshape_":r"graphs/elements.png",
"_misesstress_":r"graphs/stress.png",
"_nominalstrain_":r"graphs/strain.png",
"_materialcurve_":r"... | en | 0.537198 | # -*- coding: utf-8 -*- # __replaces.py # ============================= # (c) 2015, <NAME> # ITC-Bypasa # ============================= # | 1.792904 | 2 |
tcc/dataset_preparation/images_to_tfrecords.py | egonrian/google-research | 3 | 6624733 | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | en | 0.820231 | # coding=utf-8 # Copyright 2020 The Google Research 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 applicab... | 1.746619 | 2 |
users/migrations/0014_alter_address_country.py | MattiMatt8/ship-o-cereal | 1 | 6624734 | # Generated by Django 3.2 on 2021-05-10 10:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("users", "0013_auto_20210506_1329"),
]
operations = [
migrations.AlterField(
model_name="address",... | # Generated by Django 3.2 on 2021-05-10 10:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("users", "0013_auto_20210506_1329"),
]
operations = [
migrations.AlterField(
model_name="address",... | en | 0.834942 | # Generated by Django 3.2 on 2021-05-10 10:53 | 1.466676 | 1 |
tidy.py | ghoost82/sf30ac-extractor | 35 | 6624735 | <filename>tidy.py
#!/usr/bin/env python3
import os
import sys
if len(sys.argv) != 2:
print("Usage: python tidy.py \"C:\\...your extraction folder...\"")
exit(1)
root_dir = sys.argv[1]
if not os.path.exists(root_dir):
print("Cant find the extraction folder, are you sure you're using this correctly? Read ... | <filename>tidy.py
#!/usr/bin/env python3
import os
import sys
if len(sys.argv) != 2:
print("Usage: python tidy.py \"C:\\...your extraction folder...\"")
exit(1)
root_dir = sys.argv[1]
if not os.path.exists(root_dir):
print("Cant find the extraction folder, are you sure you're using this correctly? Read ... | en | 0.776831 | #!/usr/bin/env python3 # Move Second Impact music from Third Strike dir to Second Impact dir. # Move Third Strike music from Main dir to Third Strike dir. | 2.911756 | 3 |
LassoVariants/EnumLasso/paper/paper_synthetic_alpha.py | carushi/Catactor | 0 | 6624736 | # -*- coding: utf-8 -*-
"""
@author: satohara
"""
import sys
sys.path.append('../')
import numpy as np
import matplotlib.pyplot as plt
from EnumerateLinearModel import EnumLasso
# setting - data
dim = 10
L = 5
num = 100
eps = 0.1
alpha = np.logspace(-3, 0, 11)
# setting - EnumLasso
rho = 0.01
ratio = 3
maxitr = 100... | # -*- coding: utf-8 -*-
"""
@author: satohara
"""
import sys
sys.path.append('../')
import numpy as np
import matplotlib.pyplot as plt
from EnumerateLinearModel import EnumLasso
# setting - data
dim = 10
L = 5
num = 100
eps = 0.1
alpha = np.logspace(-3, 0, 11)
# setting - EnumLasso
rho = 0.01
ratio = 3
maxitr = 100... | en | 0.479719 | # -*- coding: utf-8 -*- @author: satohara # setting - data # setting - EnumLasso # test # test # data # EnumLasso # print | 2.293243 | 2 |
tests/ui_interaction/main_menu.py | ow-gryphon/gryphon | 0 | 6624737 | from gryphon.wizard.wizard_text import Text
from .basic_actions import wait_for_output, select_nth_option
NEXT_MENU = "Navigate the categories"
USEFUL_LINKS = "Useful links"
# ON main menu
# AND starting on the first option
def select_init_on_main_menu(process):
select_nth_option(process, n=1)
wait_for_o... | from gryphon.wizard.wizard_text import Text
from .basic_actions import wait_for_output, select_nth_option
NEXT_MENU = "Navigate the categories"
USEFUL_LINKS = "Useful links"
# ON main menu
# AND starting on the first option
def select_init_on_main_menu(process):
select_nth_option(process, n=1)
wait_for_o... | en | 0.752372 | # ON main menu # AND starting on the first option | 2.701705 | 3 |
research-work/src/synth_runner.py | egbuch/super-urop | 0 | 6624738 | ######
#
# Music system playback is possible thanks to:
# Widget-based Synthesizer Logic thanks to <NAME>
# Music21 Python Module via <NAME>
#
######
import sys
sys.path.append('..')
from common.core import *
from common.audio import *
from common.synth import *
from common.gfxutil import *
from common.clock impor... | ######
#
# Music system playback is possible thanks to:
# Widget-based Synthesizer Logic thanks to <NAME>
# Music21 Python Module via <NAME>
#
######
import sys
sys.path.append('..')
from common.core import *
from common.audio import *
from common.synth import *
from common.gfxutil import *
from common.clock impor... | en | 0.776671 | ###### # # Music system playback is possible thanks to: # Widget-based Synthesizer Logic thanks to <NAME> # Music21 Python Module via <NAME> # ###### ## CC CHANNELS ## # set up audio # set song path # create TempoMap, AudioScheduler #TODO: grab tempo from file # Add a looper # Set up FluidSynth # set up a midi chan... | 2.688035 | 3 |
venv/lib/python3.6/site-packages/ansible_collections/check_point/mgmt/tests/units/modules/test_cp_mgmt_verify_software_package.py | usegalaxy-no/usegalaxy | 1 | 6624739 | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dist... | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dist... | en | 0.866831 | # Ansible module to manage CheckPoint Firewall (c) 2019 # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dist... | 1.756769 | 2 |
setup.py | perminovsi/landsatxplore | 1 | 6624740 | <filename>setup.py
from codecs import open
from os import path
from setuptools import find_packages, setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='landsatxplore',
version='0.8',
description='... | <filename>setup.py
from codecs import open
from os import path
from setuptools import find_packages, setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='landsatxplore',
version='0.8',
description='... | it | 0.245937 | [console_scripts] landsatxplore=landsatxplore.cli:cli | 1.430931 | 1 |
dev/breeze/src/airflow_breeze/params/common_build_params.py | holly-evans/airflow | 3 | 6624741 | # 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... | # 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... | en | 0.808451 | # 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... | 1.808971 | 2 |
doban_spider/try_test/processing_mp_test.py | XiaoWu-5759/xwspider | 0 | 6624742 | # -*- coding: utf-8 -*-
'''
@createBy : xiaowu
@date : 2019/10/22 14:16:41
'''
import multiprocessing as mp
def job(q):
res = 0
for i in range(12):
res += i+i**2+i**3
q.put(res)
if __name__ == "__main__":
queue = mp.Queue()
p1 = mp.Process(target=job,args=(queue,))
p1.... | # -*- coding: utf-8 -*-
'''
@createBy : xiaowu
@date : 2019/10/22 14:16:41
'''
import multiprocessing as mp
def job(q):
res = 0
for i in range(12):
res += i+i**2+i**3
q.put(res)
if __name__ == "__main__":
queue = mp.Queue()
p1 = mp.Process(target=job,args=(queue,))
p1.... | en | 0.34467 | # -*- coding: utf-8 -*- @createBy : xiaowu @date : 2019/10/22 14:16:41 | 3.086224 | 3 |
auto/app/lib/appController.py | Strugglingrookie/oldboy2 | 1 | 6624743 | import time
import threading
import queue
import subprocess
import os
from conf.settings import logger,LOG_DIR,APP_PICTUREPATH
from lib.tool import Tool
from appium import webdriver
# 多线程数据隔离
local = threading.local()
# 存放driver队列
drivers_queue = queue.Queue()
# 存放手机设备名称队列
devices_name_queue = queue.Queue()
class C... | import time
import threading
import queue
import subprocess
import os
from conf.settings import logger,LOG_DIR,APP_PICTUREPATH
from lib.tool import Tool
from appium import webdriver
# 多线程数据隔离
local = threading.local()
# 存放driver队列
drivers_queue = queue.Queue()
# 存放手机设备名称队列
devices_name_queue = queue.Queue()
class C... | zh | 0.950969 | # 多线程数据隔离 # 存放driver队列 # 存放手机设备名称队列 # 配置信息 # 所有手机配置信息 # 测试app信息 包名 入口等 # Android or IOS # 启动的服务端口列表,用于校验服务是否成功启动 每次运行之前杀掉之前所有的服务 adb如果重启 夜游神将不会被查到 根据kwargs中ip、端口等信息 启动appium服务 根据配置的手机信息,启动对应的appium服务 # 每次启动前 清掉上一次还存活的端口 # 启动的server加入到这个列表,用来等待所有服务启动起来之后才往下运行 # 将手机操作log加载到配置中 # 提取校验服务启动成功的端口 # 启动多线程开启服务 校验所有app... | 2.219367 | 2 |
test/functional/wallet_createwallet.py | devcoin/devcoin | 0 | 6624744 | <reponame>devcoin/devcoin
#!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core and Devcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test createwallet arguments.
"""
from test_framework.addres... | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core and Devcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test createwallet arguments.
"""
from test_framework.address import key_to_p2wpkh
fro... | en | 0.818897 | #!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core and Devcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. Test createwallet arguments. # Leave IBD for sethdseed # Import private key # Imported pr... | 2.180964 | 2 |
braindecode/datasets/xy.py | Simon-Free/braindecode | 1 | 6624745 | <filename>braindecode/datasets/xy.py
import numpy as np
import pandas as pd
import logging
import mne
from .base import BaseDataset, BaseConcatDataset
from ..datautil.windowers import (
create_fixed_length_windows,)
log = logging.getLogger(__name__)
def create_from_X_y(
X, y, drop_last_window, sfreq=Non... | <filename>braindecode/datasets/xy.py
import numpy as np
import pandas as pd
import logging
import mne
from .base import BaseDataset, BaseConcatDataset
from ..datautil.windowers import (
create_fixed_length_windows,)
log = logging.getLogger(__name__)
def create_from_X_y(
X, y, drop_last_window, sfreq=Non... | en | 0.807352 | Create a BaseConcatDataset of WindowsDatasets from X and y to be used for decoding with skorch and braindecode, where X is a list of pre-cut trials and y are corresponding targets. Parameters ---------- X: array-like list of pre-cut trials as n_trials x n_channels x n_times y: array-lik... | 2.65402 | 3 |
php/python/UpdateDb.py | the16bitgamer/YourflixMkII | 0 | 6624746 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import YourflixDbManager
import DatabaseManager
_user = "pi"
_password = "<PASSWORD>"
dbManager = YourflixDbManager
db = DatabaseManager
db.ConnectToDb(db, _user, _password)
print(dbManager.CheckDatabase(dbManager, db))
db.DisconnectDb(db... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import YourflixDbManager
import DatabaseManager
_user = "pi"
_password = "<PASSWORD>"
dbManager = YourflixDbManager
db = DatabaseManager
db.ConnectToDb(db, _user, _password)
print(dbManager.CheckDatabase(dbManager, db))
db.DisconnectDb(db) | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.353442 | 2 |
bomlib/xlsx_writer.py | BarracudaPff/code-golf-data-pythpn | 0 | 6624747 | try:
pass
except:
def WriteXLSX(filename, groups, net, headings, prefs):
return False
else:
"""
Write BoM out to a XLSX file
filename = path to output file (must be a .xlsx file)
groups = [list of ComponentGroup groups]
net = netlist object
headings = [list of headings to display in the BoM fil... | try:
pass
except:
def WriteXLSX(filename, groups, net, headings, prefs):
return False
else:
"""
Write BoM out to a XLSX file
filename = path to output file (must be a .xlsx file)
groups = [list of ComponentGroup groups]
net = netlist object
headings = [list of headings to display in the BoM fil... | en | 0.809674 | Write BoM out to a XLSX file filename = path to output file (must be a .xlsx file) groups = [list of ComponentGroup groups] net = netlist object headings = [list of headings to display in the BoM file] prefs = BomPref object | 2.782391 | 3 |
arrays/delete-dupes-from-sorted-arr.py | geekidharsh/elements-of-programming | 0 | 6624748 | def delete_dupes_from_sorted_1(arr):
# time O(n) space O(1)
# count number of valid entries
i = 1
for j in range(1, len(arr)):
if arr[i-1] != arr[j]:
arr[i] = arr[j]
i += 1
# resulting arr will still have invalid items but theres no
# requirement of the code to delete items beyond the last valid item
... | def delete_dupes_from_sorted_1(arr):
# time O(n) space O(1)
# count number of valid entries
i = 1
for j in range(1, len(arr)):
if arr[i-1] != arr[j]:
arr[i] = arr[j]
i += 1
# resulting arr will still have invalid items but theres no
# requirement of the code to delete items beyond the last valid item
... | en | 0.735065 | # time O(n) space O(1) # count number of valid entries # resulting arr will still have invalid items but theres no # requirement of the code to delete items beyond the last valid item # optionally # to get all valid items only, use slice: arr[:i] # test # inp # exp out: ([2, 3, 5, 7, 11, 13, 11, 11, 13], 6) | 3.507706 | 4 |
netbox/netbox/settings.py | ae-exact/netbox | 0 | 6624749 | <filename>netbox/netbox/settings.py
import importlib
import logging
import os
import platform
import re
import socket
import warnings
from urllib.parse import urlsplit
from django.contrib.messages import constants as messages
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core.val... | <filename>netbox/netbox/settings.py
import importlib
import logging
import os
import platform
import re
import socket
import warnings
from urllib.parse import urlsplit
from django.contrib.messages import constants as messages
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core.val... | en | 0.571954 | # # Environment setup # # Hostname # Set the base directory two levels up # Validate Python version # # Configuration import # # Import configuration parameters # Enforce required configuration parameters # Set required parameters # Set optional parameters # Enforce trailing slash only # Validate update repo URL and ti... | 2.27069 | 2 |
models_vqa/vis.py | jalonzou/snmn | 71 | 6624750 | <filename>models_vqa/vis.py
import matplotlib; matplotlib.use('Agg') # NOQA
import os
import json
import skimage.io
import skimage.transform
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Arrow
from .config import cfg
from util import boxes
def vis_one_vqa(img_path, words, vqa_sc... | <filename>models_vqa/vis.py
import matplotlib; matplotlib.use('Agg') # NOQA
import os
import json
import skimage.io
import skimage.transform
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Arrow
from .config import cfg
from util import boxes
def vis_one_vqa(img_path, words, vqa_sc... | en | 0.739477 | # NOQA # img # module weights # textual attention # print(np.sum(txt_att, axis=1)) # print(np.sum(txt_att[:, :len(words)], axis=1)) # scores # Visualize the attention stack # att_stack is T x H x W x L -> L x H x T x W # image attention at each timestep # img # module weights # textual attention # print(np.sum(txt_att,... | 2.121954 | 2 |