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 |
|---|---|---|---|---|---|---|---|---|---|---|
configs/efficientnet/retinanet_effb3_fpn_crop896_8x4_1x_coco.py | chenxinfeng4/mmdetection | 6 | 11300 | <filename>configs/efficientnet/retinanet_effb3_fpn_crop896_8x4_1x_coco.py
_base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco_detection.py', '../_base_/default_runtime.py'
]
cudnn_benchmark = True
norm_cfg = dict(type='BN', requires_grad=True)
checkpoint = 'https://download.openmmlab.c... | <filename>configs/efficientnet/retinanet_effb3_fpn_crop896_8x4_1x_coco.py
_base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco_detection.py', '../_base_/default_runtime.py'
]
cudnn_benchmark = True
norm_cfg = dict(type='BN', requires_grad=True)
checkpoint = 'https://download.openmmlab.c... | en | 0.662807 | # noqa # training and testing settings # dataset settings # optimizer # learning policy # runtime settings # NOTE: This variable is for automatically scaling LR, # USER SHOULD NOT CHANGE THIS VALUE. # (8 GPUs) x (4 samples per GPU) | 1.37725 | 1 |
tests/test_model.py | Sebastiencreoff/mongo_tool | 0 | 11301 | <gh_stars>0
#!/usr/bin/env python
import datetime
import mock
import mom
class ExampleClass(mom.Model):
JSON_SCHEMA = {
'$schema': 'http://json-schema.org/schema#',
'title': 'Test class for JSON',
'type': 'object',
'properties': {
'value_datetime': {'type': ['datetim... | #!/usr/bin/env python
import datetime
import mock
import mom
class ExampleClass(mom.Model):
JSON_SCHEMA = {
'$schema': 'http://json-schema.org/schema#',
'title': 'Test class for JSON',
'type': 'object',
'properties': {
'value_datetime': {'type': ['datetime', 'null']}... | en | 0.336764 | #!/usr/bin/env python #', # Test without data # Test with data # Update one parameter. # Update parameters with function. | 2.626818 | 3 |
src/koeda/utils/stopwords.py | toriving/KoEDA | 48 | 11302 | import os
import json
STOPWORDS_JSON_PATH = os.path.join(
os.path.dirname(os.path.abspath(__file__)), os.pardir, "corpora/stopwords.json"
)
with open(STOPWORDS_JSON_PATH, "r", encoding="utf-8") as f:
STOPWORD = json.load(f)["stopwords"]
| import os
import json
STOPWORDS_JSON_PATH = os.path.join(
os.path.dirname(os.path.abspath(__file__)), os.pardir, "corpora/stopwords.json"
)
with open(STOPWORDS_JSON_PATH, "r", encoding="utf-8") as f:
STOPWORD = json.load(f)["stopwords"]
| none | 1 | 2.303099 | 2 | |
glue/core/tests/test_message.py | ejeschke/glue | 3 | 11303 | <reponame>ejeschke/glue
from __future__ import absolute_import, division, print_function
import pytest
from .. import message as msg
def test_invalid_subset_msg():
with pytest.raises(TypeError) as exc:
msg.SubsetMessage(None)
assert exc.value.args[0].startswith('Sender must be a subset')
def test_... | from __future__ import absolute_import, division, print_function
import pytest
from .. import message as msg
def test_invalid_subset_msg():
with pytest.raises(TypeError) as exc:
msg.SubsetMessage(None)
assert exc.value.args[0].startswith('Sender must be a subset')
def test_invalid_data_msg():
... | none | 1 | 2.301032 | 2 | |
fabfile/config.py | kurochan/config-collector | 1 | 11304 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import os
import util
from fabric.api import *
from fabric.state import output
from fabric.colors import *
from base import BaseTask
from helper.print_helper import task_puts
class CollectConfig(BaseTask):
"""
collect configuration
"""
name = "collect"
def run_task(sel... | # -*- coding: utf-8 -*-
import os
import util
from fabric.api import *
from fabric.state import output
from fabric.colors import *
from base import BaseTask
from helper.print_helper import task_puts
class CollectConfig(BaseTask):
"""
collect configuration
"""
name = "collect"
def run_task(self, *args, **kwa... | en | 0.566849 | # -*- coding: utf-8 -*- collect configuration # print config | 2.296172 | 2 |
python/paddle/fluid/tests/unittests/ir/inference/test_trt_transpose_flatten_concat_fuse_pass.py | LWhite027/PaddleBox | 10 | 11305 | <filename>python/paddle/fluid/tests/unittests/ir/inference/test_trt_transpose_flatten_concat_fuse_pass.py
# Copyright (c) 2020 PaddlePaddle 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 obtai... | <filename>python/paddle/fluid/tests/unittests/ir/inference/test_trt_transpose_flatten_concat_fuse_pass.py
# Copyright (c) 2020 PaddlePaddle 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 obtai... | en | 0.85559 | # Copyright (c) 2020 PaddlePaddle 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 appli... | 2.261052 | 2 |
src/stage_02_base_model_creation.py | TUCchkul/Dog-Cat-Classification-with-MLflow | 0 | 11306 | import argparse
import os
import shutil
from tqdm import tqdm
import logging
from src.utils.common import read_yaml, create_directories
import random
from src.utils.model import log_model_summary
import tensorflow as tf
STAGE= "Base Model Creation"
logging.basicConfig(
filename=os.path.join("logs",'running_logs.... | import argparse
import os
import shutil
from tqdm import tqdm
import logging
from src.utils.common import read_yaml, create_directories
import random
from src.utils.model import log_model_summary
import tensorflow as tf
STAGE= "Base Model Creation"
logging.basicConfig(
filename=os.path.join("logs",'running_logs.... | none | 1 | 2.144926 | 2 | |
test_calculator.py | Kidatoy/Advanced-Calculator | 0 | 11307 | <reponame>Kidatoy/Advanced-Calculator
import unittest # https://docs.python.org/3/library/unittest.html
from modules.calculator import Calculator as Calc
class TestCalculator(unittest.TestCase):
"""
Test Driven Development Unittest File
Module: Calculator
Updated: 12/16/2019
Author: <NAME>
"""... | import unittest # https://docs.python.org/3/library/unittest.html
from modules.calculator import Calculator as Calc
class TestCalculator(unittest.TestCase):
"""
Test Driven Development Unittest File
Module: Calculator
Updated: 12/16/2019
Author: <NAME>
"""
def test_addition(self):
... | en | 0.537257 | # https://docs.python.org/3/library/unittest.html Test Driven Development Unittest File Module: Calculator Updated: 12/16/2019 Author: <NAME> Evaluate addition corner cases Evaluate subtraction corner cases Evaluate multiplication corner cases Test division corner cases Note: division by zero is han... | 4.127766 | 4 |
pddf_psuutil/main.py | deran1980/sonic-utilities | 0 | 11308 | <reponame>deran1980/sonic-utilities
#!/usr/bin/env python3
#
# main.py
#
# Command-line utility for interacting with PSU Controller in PDDF mode in SONiC
#
try:
import sys
import os
import click
from tabulate import tabulate
from utilities_common.util_base import UtilHelper
except ImportError as e:... | #!/usr/bin/env python3
#
# main.py
#
# Command-line utility for interacting with PSU Controller in PDDF mode in SONiC
#
try:
import sys
import os
import click
from tabulate import tabulate
from utilities_common.util_base import UtilHelper
except ImportError as e:
raise ImportError("%s - require... | en | 0.665157 | #!/usr/bin/env python3 # # main.py # # Command-line utility for interacting with PSU Controller in PDDF mode in SONiC # # Global platform-specific psuutil class instance # Wrapper APIs so that this util is suited to both 1.0 and 2.0 platform APIs # ==================== CLI commands and groups ==================== # Thi... | 2.50304 | 3 |
gifbox/core/serializers.py | timmygee/gifbox | 0 | 11309 | <gh_stars>0
from rest_framework import serializers
from versatileimagefield.serializers import VersatileImageFieldSerializer
from .models import Image, AnimatedGif
class ImageSerializer(serializers.ModelSerializer):
class Meta:
model = Image
fields = ('image',)
image = VersatileImageFieldSe... | from rest_framework import serializers
from versatileimagefield.serializers import VersatileImageFieldSerializer
from .models import Image, AnimatedGif
class ImageSerializer(serializers.ModelSerializer):
class Meta:
model = Image
fields = ('image',)
image = VersatileImageFieldSerializer(
... | none | 1 | 2.093599 | 2 | |
ginga/canvas/coordmap.py | saimn/ginga | 0 | 11310 | <filename>ginga/canvas/coordmap.py
#
# coordmap.py -- coordinate mappings.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga import trcalc
from ginga.util import wcs
from ginga.util.six.moves import map
__all__ = ['CanvasMapper', 'DataMapper', 'O... | <filename>ginga/canvas/coordmap.py
#
# coordmap.py -- coordinate mappings.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga import trcalc
from ginga.util import wcs
from ginga.util.six.moves import map
__all__ = ['CanvasMapper', 'DataMapper', 'O... | en | 0.726674 | # # coordmap.py -- coordinate mappings. # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # A coordinate mapper that maps to the viewer's canvas in canvas coordinates. # record the viewer just in case # TODO? Not sure if it is needed with this mapper type... | 2.674404 | 3 |
train.py | zpc-666/Paddle-Stochastic-Depth-ResNet110 | 0 | 11311 | # coding: utf-8
# Copyright (c) 2021 PaddlePaddle 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
# Un... | # coding: utf-8
# Copyright (c) 2021 PaddlePaddle 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
# Un... | en | 0.471027 | # coding: utf-8 # Copyright (c) 2021 PaddlePaddle 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 require... | 2.001995 | 2 |
dataloader/EDSR/video.py | pidan1231239/SR-Stereo2 | 1 | 11312 | import os
from . import common
import cv2
import numpy as np
import imageio
import torch
import torch.utils.data as data
class Video(data.Dataset):
def __init__(self, args, name='Video', train=False, benchmark=False):
self.args = args
self.name = name
self.scale = args.scale
self... | import os
from . import common
import cv2
import numpy as np
import imageio
import torch
import torch.utils.data as data
class Video(data.Dataset):
def __init__(self, args, name='Video', train=False, benchmark=False):
self.args = args
self.name = name
self.scale = args.scale
self... | none | 1 | 2.465841 | 2 | |
backend/views/__init__.py | chriamue/flask-unchained-react-spa | 5 | 11313 | <filename>backend/views/__init__.py
from .contact_submission_resource import ContactSubmissionResource
| <filename>backend/views/__init__.py
from .contact_submission_resource import ContactSubmissionResource
| none | 1 | 1.086787 | 1 | |
blink_handler.py | oyiptong/chromium-dashboard | 0 | 11314 | <filename>blink_handler.py
# -*- coding: utf-8 -*-
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | <filename>blink_handler.py
# -*- coding: utf-8 -*-
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | en | 0.70253 | # -*- coding: utf-8 -*- # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or... | 2.230769 | 2 |
OBlog/blueprint/pages/main.py | OhYee/OBlog | 23 | 11315 | <gh_stars>10-100
from OBlog import database as db
from flask import g, current_app
import re
def getPages():
if not hasattr(g, "getPages"):
res = db.query_db('select * from pages;')
res.sort(key=lambda x: int(x["idx"]))
g.getPages = res
return g.getPages
def getPagesDict()... | from OBlog import database as db
from flask import g, current_app
import re
def getPages():
if not hasattr(g, "getPages"):
res = db.query_db('select * from pages;')
res.sort(key=lambda x: int(x["idx"]))
g.getPages = res
return g.getPages
def getPagesDict():
if not has... | zh | 0.998683 | # 已经存在 # 重复url # 不存在 | 2.488742 | 2 |
lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/Cheetah/Compiler.py | CymaticLabs/Unity3d.Amqp | 83 | 11316 | #!/usr/bin/env python
# $Id: Compiler.py,v 1.148 2006/06/22 00:18:22 tavis_rudd Exp $
"""Compiler classes for Cheetah:
ModuleCompiler aka 'Compiler'
ClassCompiler
MethodCompiler
If you are trying to grok this code start with ModuleCompiler.__init__,
ModuleCompiler.compile, and ModuleCompiler.__getattr__.
Meta-Data
==... | #!/usr/bin/env python
# $Id: Compiler.py,v 1.148 2006/06/22 00:18:22 tavis_rudd Exp $
"""Compiler classes for Cheetah:
ModuleCompiler aka 'Compiler'
ClassCompiler
MethodCompiler
If you are trying to grok this code start with ModuleCompiler.__init__,
ModuleCompiler.compile, and ModuleCompiler.__getattr__.
Meta-Data
==... | en | 0.583215 | #!/usr/bin/env python # $Id: Compiler.py,v 1.148 2006/06/22 00:18:22 tavis_rudd Exp $ Compiler classes for Cheetah: ModuleCompiler aka 'Compiler' ClassCompiler MethodCompiler If you are trying to grok this code start with ModuleCompiler.__init__, ModuleCompiler.compile, and ModuleCompiler.__getattr__. Meta-Data =====... | 2.436712 | 2 |
tests/simple_cmd_checks.py | Rhoynar/plmn-regression | 11 | 11317 | <filename>tests/simple_cmd_checks.py
# -*- coding: utf-8 -*-
import compat
import unittest
import sys
from plmn.utils import *
from plmn.results import *
from plmn.modem_cmds import *
from plmn.simple_cmds import *
class SimpleCmdChecks(unittest.TestCase):
def test_simple_status_cmd(self):
SimpleCmds.sim... | <filename>tests/simple_cmd_checks.py
# -*- coding: utf-8 -*-
import compat
import unittest
import sys
from plmn.utils import *
from plmn.results import *
from plmn.modem_cmds import *
from plmn.simple_cmds import *
class SimpleCmdChecks(unittest.TestCase):
def test_simple_status_cmd(self):
SimpleCmds.sim... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.563447 | 3 |
mogan/tests/unit/notifications/test_notification.py | GURUIFENG9139/rocky-mogan | 0 | 11318 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | en | 0.872447 | # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in... | 1.886802 | 2 |
plash/macros/packagemanagers.py | 0xflotus/plash | 0 | 11319 | from plash.eval import eval, register_macro, shell_escape_args
@register_macro()
def defpm(name, *lines):
'define a new package manager'
@register_macro(name, group='package managers')
@shell_escape_args
def package_manager(*packages):
if not packages:
return
sh_packages =... | from plash.eval import eval, register_macro, shell_escape_args
@register_macro()
def defpm(name, *lines):
'define a new package manager'
@register_macro(name, group='package managers')
@shell_escape_args
def package_manager(*packages):
if not packages:
return
sh_packages =... | none | 1 | 1.842577 | 2 | |
app/schemas/email.py | waynesun09/notify-service | 5 | 11320 | <reponame>waynesun09/notify-service
from typing import Optional, List
from pydantic import BaseModel, EmailStr
from . import result
class EmailBase(BaseModel):
email: Optional[EmailStr] = None
class EmailSend(EmailBase):
msg: str
class EmailResult(BaseModel):
pre_header: Optional[str] = None
begi... | from typing import Optional, List
from pydantic import BaseModel, EmailStr
from . import result
class EmailBase(BaseModel):
email: Optional[EmailStr] = None
class EmailSend(EmailBase):
msg: str
class EmailResult(BaseModel):
pre_header: Optional[str] = None
begin: Optional[str] = None
content:... | none | 1 | 2.636539 | 3 | |
example.py | ErikPel/rankedchoicevoting | 1 | 11321 | <filename>example.py
from rankedchoicevoting import Poll
candidatesA = {"Bob": 0, "Sue": 0, "Bill": 0}
#votes in array sorted by first choice to last choice
votersA = {
"a": ['Bob', 'Bill', 'Sue'],
"b": ['Sue', 'Bob', 'Bill'],
"c": ['Bill', 'Sue', 'Bob'],
"d": ['Bob', 'Bill', 'Sue'],
"f": ['Sue',... | <filename>example.py
from rankedchoicevoting import Poll
candidatesA = {"Bob": 0, "Sue": 0, "Bill": 0}
#votes in array sorted by first choice to last choice
votersA = {
"a": ['Bob', 'Bill', 'Sue'],
"b": ['Sue', 'Bob', 'Bill'],
"c": ['Bill', 'Sue', 'Bob'],
"d": ['Bob', 'Bill', 'Sue'],
"f": ['Sue',... | en | 0.829817 | #votes in array sorted by first choice to last choice | 3.559593 | 4 |
DeployScript.py | junoteam/TelegramBot | 3 | 11322 | <reponame>junoteam/TelegramBot<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- author: Alex -*-
from Centos6_Bit64 import *
from SystemUtils import *
# Checking version of OS should happened before menu appears
# Check version of CentOS
SystemUtils.check_centos_version()
# Clear screen before to sh... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- author: Alex -*-
from Centos6_Bit64 import *
from SystemUtils import *
# Checking version of OS should happened before menu appears
# Check version of CentOS
SystemUtils.check_centos_version()
# Clear screen before to show menu
os.system('clear')
answer = True
whi... | en | 0.510639 | #!/usr/bin/env python # -*- coding: utf-8 -*- # -*- author: Alex -*- # Checking version of OS should happened before menu appears # Check version of CentOS # Clear screen before to show menu LAMP Deploy Script V: 0.1 for CentOS 6.5/6.6 64Bit: --------------------------------------------------- 1. Check version... | 2.732758 | 3 |
distributed/register/application.py | ADKosm/concurrency | 0 | 11323 | <reponame>ADKosm/concurrency<filename>distributed/register/application.py
import asyncio
import os
import time
from dataclasses import dataclass
import requests_unixsocket
from aiohttp import ClientSession, web
@dataclass(frozen=True)
class Replica:
replica_id: str
ip: str
is_self: bool
def replicas_di... | import asyncio
import os
import time
from dataclasses import dataclass
import requests_unixsocket
from aiohttp import ClientSession, web
@dataclass(frozen=True)
class Replica:
replica_id: str
ip: str
is_self: bool
def replicas_discovery():
session = requests_unixsocket.Session()
number_of_repli... | en | 0.153821 | # print(r.headers['ReplicaId'], flush=True) | 2.689217 | 3 |
setup.py | greenaddress/txjsonrpc | 0 | 11324 | <gh_stars>0
from __future__ import absolute_import
from setuptools import setup
from txjsonrpc import meta
from txjsonrpc.util import dist
setup(
name=meta.display_name,
version=meta.version,
description=meta.description,
author=meta.author,
author_email=meta.author_email,
url=meta.url,
l... | from __future__ import absolute_import
from setuptools import setup
from txjsonrpc import meta
from txjsonrpc.util import dist
setup(
name=meta.display_name,
version=meta.version,
description=meta.description,
author=meta.author,
author_email=meta.author_email,
url=meta.url,
license=meta.... | none | 1 | 1.235765 | 1 | |
gsflow/gsflow.py | pygsflow/pygsflow | 17 | 11325 | <reponame>pygsflow/pygsflow<gh_stars>10-100
# -*- coding: utf-8 -*-
import os
from .control import ControlFile
from .prms import PrmsModel
from .utils import gsflow_io, GsConstant
from .prms import Helper
from .modflow import Modflow
from .modsim import Modsim
import flopy
import subprocess as sp
import platform
import... | # -*- coding: utf-8 -*-
import os
from .control import ControlFile
from .prms import PrmsModel
from .utils import gsflow_io, GsConstant
from .prms import Helper
from .modflow import Modflow
from .modsim import Modsim
import flopy
import subprocess as sp
import platform
import warnings
warnings.simplefilter("always", P... | en | 0.582442 | # -*- coding: utf-8 -*- GsflowModel is the GSFLOW model object. This class can be used to build a GSFLOW model, to load a GSFLOW model from it's control file, to write input files for GSFLOW and to run GSFLOW. Parameters ---------- control_file : str control file path and name prms : Pr... | 2.396169 | 2 |
tests/integration/storage_memory/test_storage_memory_write.py | Sam-Martin/cloud-wanderer | 1 | 11326 | <filename>tests/integration/storage_memory/test_storage_memory_write.py
import logging
import pytest
from moto import mock_ec2, mock_iam, mock_sts
from cloudwanderer.cloud_wanderer_resource import CloudWandererResource
from cloudwanderer.storage_connectors import MemoryStorageConnector
from cloudwanderer.urn import U... | <filename>tests/integration/storage_memory/test_storage_memory_write.py
import logging
import pytest
from moto import mock_ec2, mock_iam, mock_sts
from cloudwanderer.cloud_wanderer_resource import CloudWandererResource
from cloudwanderer.storage_connectors import MemoryStorageConnector
from cloudwanderer.urn import U... | en | 0.969476 | If we are deleting a parent resource we should delete all its subresources. # Delete the parent and ensure the subresources are also deleted | 1.87547 | 2 |
tt/satisfiability/picosat.py | fkromer/tt | 233 | 11327 | <reponame>fkromer/tt
"""Python wrapper around the _clibs PicoSAT extension."""
import os
from tt.errors.arguments import (
InvalidArgumentTypeError,
InvalidArgumentValueError)
if os.environ.get('READTHEDOCS') != 'True':
from tt._clibs import picosat as _c_picosat
VERSION = _c_picosat.VERSION
def sa... | """Python wrapper around the _clibs PicoSAT extension."""
import os
from tt.errors.arguments import (
InvalidArgumentTypeError,
InvalidArgumentValueError)
if os.environ.get('READTHEDOCS') != 'True':
from tt._clibs import picosat as _c_picosat
VERSION = _c_picosat.VERSION
def sat_one(clauses, assump... | en | 0.685624 | Python wrapper around the _clibs PicoSAT extension. Find a solution that satisfies the specified clauses and assumptions. This provides a light Python wrapper around the same method in the PicoSAT C-extension. While completely tested and usable, this method is probably not as useful as the interface provid... | 2.905373 | 3 |
tests/test_text_visualization.py | dianna-ai/dianna | 9 | 11328 | import os
import re
import shutil
import unittest
from pathlib import Path
from dianna.visualization.text import highlight_text
class Example1:
original_text = 'Doloremque aliquam totam ut. Aspernatur repellendus autem quia deleniti. Natus accusamus ' \
'doloribus et in quam officiis veniam et... | import os
import re
import shutil
import unittest
from pathlib import Path
from dianna.visualization.text import highlight_text
class Example1:
original_text = 'Doloremque aliquam totam ut. Aspernatur repellendus autem quia deleniti. Natus accusamus ' \
'doloribus et in quam officiis veniam et... | en | 0.840145 | # regex taken from # https://stackoverflow.com/questions/12683201/python-re-split-to-split-by-spaces-commas-and-periods-but-not-in-cases-like # explanation: split by \s (whitespace), and only split by commas and # periods if they are not followed (?!\d) or preceded (?<!\d) by a digit. | 2.938459 | 3 |
setup.py | guilhermeleobas/rbc | 0 | 11329 | import os
import sys
import builtins
import versioneer
if sys.version_info[:2] < (3, 7):
raise RuntimeError("Python version >= 3.7 required.")
builtins.__RBC_SETUP__ = True
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
CONDA_BUILD = int(os.environ.get('CONDA_BUILD', '0'))
CONDA_ENV = os.environ.get('... | import os
import sys
import builtins
import versioneer
if sys.version_info[:2] < (3, 7):
raise RuntimeError("Python version >= 3.7 required.")
builtins.__RBC_SETUP__ = True
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
CONDA_BUILD = int(os.environ.get('CONDA_BUILD', '0'))
CONDA_ENV = os.environ.get('... | en | 0.835446 | # noqa: E402 The aim of the Remote Backend Compiler project is to distribute the tasks of a program JIT compilation process to separate computer systems using the client-server model. The frontend of the compiler runs on the client computer and the backend runs on the server computer. The compiler frontend will send th... | 1.875629 | 2 |
src/prefect/schedules/adjustments.py | concreted/prefect | 8,633 | 11330 | """
Schedule adjustments are functions that accept a `datetime` and modify it in some way.
Adjustments have the signature `Callable[[datetime], datetime]`.
"""
from datetime import datetime, timedelta
from typing import Callable
import pendulum
import prefect.schedules.filters
def add(interval: timedelta) -> Calla... | """
Schedule adjustments are functions that accept a `datetime` and modify it in some way.
Adjustments have the signature `Callable[[datetime], datetime]`.
"""
from datetime import datetime, timedelta
from typing import Callable
import pendulum
import prefect.schedules.filters
def add(interval: timedelta) -> Calla... | en | 0.797368 | Schedule adjustments are functions that accept a `datetime` and modify it in some way. Adjustments have the signature `Callable[[datetime], datetime]`. Adjustment that adds a specified interval to the date. Args: - interval (timedelta): the amount of time to add Returns: - Callable[[datetime]... | 3.48315 | 3 |
src/pyfmodex/sound.py | Loodoor/UnamedPy | 1 | 11331 | from .fmodobject import *
from .fmodobject import _dll
from .structures import TAG, VECTOR
from .globalvars import get_class
class ConeSettings(object):
def __init__(self, sptr):
self._sptr = sptr
self._in = c_float()
self._out = c_float()
self._outvol = c_float()
ckresult(... | from .fmodobject import *
from .fmodobject import _dll
from .structures import TAG, VECTOR
from .globalvars import get_class
class ConeSettings(object):
def __init__(self, sptr):
self._sptr = sptr
self._in = c_float()
self._out = c_float()
self._outvol = c_float()
ckresult(... | en | 0.82374 | Returns the custom rolloff curve. :rtype: List of [x, y, z] lists. Sets the custom rolloff curve. :param curve: The curve to set. :type curve: A list of something that can be treated as a list of [x, y, z] values e.g. implements indexing in some way. Returns tuple of two tuples ((start, startuni... | 2.050313 | 2 |
src/pynwb/retinotopy.py | weiglszonja/pynwb | 132 | 11332 | <reponame>weiglszonja/pynwb
from collections.abc import Iterable
import warnings
from hdmf.utils import docval, popargs, call_docval_func, get_docval
from . import register_class, CORE_NAMESPACE
from .core import NWBDataInterface, NWBData
class RetinotopyImage(NWBData):
"""Gray-scale anatomical image of cortica... | from collections.abc import Iterable
import warnings
from hdmf.utils import docval, popargs, call_docval_func, get_docval
from . import register_class, CORE_NAMESPACE
from .core import NWBDataInterface, NWBData
class RetinotopyImage(NWBData):
"""Gray-scale anatomical image of cortical surface. Array structure: ... | en | 0.829644 | Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Abstract two-dimensional map of responses to stimuli along a single response axis (e.g., altitude)... | 2.182396 | 2 |
GreenMoon/forms.py | ma010/green-moon | 0 | 11333 | <reponame>ma010/green-moon
"""
Implement a class function for user to put in a zip-code and
search relevant information about business entities in that zip-code area.
"""
from flask.ext.wtf import Form
from wtforms import StringField, BooleanField
from wtforms.validators import DataRequired
class inputZipForm... | """
Implement a class function for user to put in a zip-code and
search relevant information about business entities in that zip-code area.
"""
from flask.ext.wtf import Form
from wtforms import StringField, BooleanField
from wtforms.validators import DataRequired
class inputZipForm(Form):
inputZip = Stri... | en | 0.865676 | Implement a class function for user to put in a zip-code and search relevant information about business entities in that zip-code area. | 3.274934 | 3 |
Phase-2/Linked List/Day-70.py | CodedLadiesInnovateTech/python-challenges | 11 | 11334 | <reponame>CodedLadiesInnovateTech/python-challenges<gh_stars>10-100
'''
1. Write a Python program to access a specific item in a singly linked list using index value.
2. Write a Python program to set a new value of an item in a singly linked list using index value.
3. Write a Python program to delete the first item f... | '''
1. Write a Python program to access a specific item in a singly linked list using index value.
2. Write a Python program to set a new value of an item in a singly linked list using index value.
3. Write a Python program to delete the first item from a singly linked list.
''' | en | 0.758131 | 1. Write a Python program to access a specific item in a singly linked list using index value. 2. Write a Python program to set a new value of an item in a singly linked list using index value. 3. Write a Python program to delete the first item from a singly linked list. | 4.158957 | 4 |
ngboost/version.py | dsharpc/ngboost | 0 | 11335 | <reponame>dsharpc/ngboost
__version__ = "0.3.4dev"
| __version__ = "0.3.4dev" | none | 1 | 1.040124 | 1 | |
premailer/tests/test_utils.py | p12tic/premailer | 0 | 11336 | <gh_stars>0
import unittest
from premailer.premailer import capitalize_float_margin
class UtilsTestCase(unittest.TestCase):
def testcapitalize_float_margin(self):
self.assertEqual(
capitalize_float_margin('margin:1em'),
'Margin:1em')
self.assertEqual(
capitaliz... | import unittest
from premailer.premailer import capitalize_float_margin
class UtilsTestCase(unittest.TestCase):
def testcapitalize_float_margin(self):
self.assertEqual(
capitalize_float_margin('margin:1em'),
'Margin:1em')
self.assertEqual(
capitalize_float_marg... | none | 1 | 3.238847 | 3 | |
home/vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython_wrapper.py | qwertzy-antonio-godinho/dots | 6 | 11337 | <reponame>qwertzy-antonio-godinho/dots<filename>home/vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython_wrapper.py
import sys
try:
try:
from _pydevd_bundle_ext import pydevd_cython as mod
except ImportError:
f... | import sys
try:
try:
from _pydevd_bundle_ext import pydevd_cython as mod
except ImportError:
from _pydevd_bundle import pydevd_cython as mod
except ImportError:
import struct
try:
is_python_64bit = (struct.calcsize('P') == 8)
except:
# In Jython this ... | en | 0.949556 | # In Jython this call fails, but this is Ok, we don't support Jython for speedups anyways. # We also accept things as: # # _pydevd_bundle.pydevd_cython_win32_27_32 # _pydevd_bundle.pydevd_cython_win32_34_64 # # to have multiple pre-compiled pyds distributed along the IDE # (generated by build_tools/build_binaries_windo... | 1.821072 | 2 |
tests/test_thumbnails.py | pypeclub/openpype4-tests | 0 | 11338 | <reponame>pypeclub/openpype4-tests
from tests.fixtures import api, PROJECT_NAME
assert api
THUMB_DATA1 = b"thisisaveryrandomthumbnailcontent"
THUMB_DATA2 = b"thisihbhihjhuuyiooanothbnlcontent"
def test_folder_thumbnail(api):
response = api.post(
f"projects/{PROJECT_NAME}/folders",
name="testice... | from tests.fixtures import api, PROJECT_NAME
assert api
THUMB_DATA1 = b"thisisaveryrandomthumbnailcontent"
THUMB_DATA2 = b"thisihbhihjhuuyiooanothbnlcontent"
def test_folder_thumbnail(api):
response = api.post(
f"projects/{PROJECT_NAME}/folders",
name="testicek",
folderType="Asset",
... | en | 0.793852 | # Ensure we cannot create an empty thumbnail # Create a thumbnail for the folder # Ensure the thumbnail is there # Get the id of the thumbnail (we can re-use it later) # Update thumbnail # Ensure the thumbnail changed # Let the folder use the old thumbnail # Ensure the thumbnail is switched to the old one # Create fold... | 2.469233 | 2 |
POO/Heranca/aula107_classes.py | pinheirogus/Curso-Python-Udemy | 1 | 11339 | # Generalizando para não repetir o código!
class Pessoa:
def __init__(self, nome, idade):
self.nome = nome
self.idade = idade
self.nomeclasse = self.__class__.__name__
def falar(self):
print(f'{self.nomeclasse} está falando.')
class Cliente(Pessoa):
def comprar(self):
... | # Generalizando para não repetir o código!
class Pessoa:
def __init__(self, nome, idade):
self.nome = nome
self.idade = idade
self.nomeclasse = self.__class__.__name__
def falar(self):
print(f'{self.nomeclasse} está falando.')
class Cliente(Pessoa):
def comprar(self):
... | pt | 0.992929 | # Generalizando para não repetir o código! # Como a classe Cliente não possui o método falar(), o Python busca na superclasse o método. | 4.05592 | 4 |
nncf/experimental/onnx/algorithms/quantization/default_quantization.py | vuiseng9/nncf_pytorch | 136 | 11340 | """
Copyright (c) 2022 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 writin... | """
Copyright (c) 2022 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 writin... | en | 0.855738 | Copyright (c) 2022 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, so... | 1.076583 | 1 |
Package/CONFIG.py | YuanYuLin/samba | 0 | 11341 | <filename>Package/CONFIG.py
import ops
import iopc
TARBALL_FILE="samba-4.8.4.tar.gz"
TARBALL_DIR="samba-4.8.4"
INSTALL_DIR="samba-bin"
pkg_path = ""
output_dir = ""
tarball_pkg = ""
tarball_dir = ""
install_dir = ""
install_tmp_dir = ""
cc_host = ""
tmp_include_dir = ""
dst_include_dir = ""
dst_lib_dir = ""
dst_usr_lo... | <filename>Package/CONFIG.py
import ops
import iopc
TARBALL_FILE="samba-4.8.4.tar.gz"
TARBALL_DIR="samba-4.8.4"
INSTALL_DIR="samba-bin"
pkg_path = ""
output_dir = ""
tarball_pkg = ""
tarball_dir = ""
install_dir = ""
install_tmp_dir = ""
cc_host = ""
tmp_include_dir = ""
dst_include_dir = ""
dst_lib_dir = ""
dst_usr_lo... | en | 0.144684 | ops.exportEnv(ops.setEnv("CXX", ops.getEnv("CROSS_COMPILE") + "g++")) ops.exportEnv(ops.setEnv("CPP", ops.getEnv("CROSS_COMPILE") + "g++")) ops.exportEnv(ops.setEnv("AR", ops.getEnv("CROSS_COMPILE") + "ar")) ops.exportEnv(ops.setEnv("RANLIB", ops.getEnv("CROSS_COMPILE") + "ranlib")) ops.exportEnv(ops.se... | 2.134278 | 2 |
packages/pyre/tracking/Chain.py | lijun99/pyre | 3 | 11342 | <reponame>lijun99/pyre
# -*- coding: utf-8 -*-
#
# <NAME>. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# declaration
class Chain:
"""
A locator that ties together two others in order to express that something in {next}
caused {this} to be recorded
"""
# meta methods
def __init... | # -*- coding: utf-8 -*-
#
# <NAME>. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# declaration
class Chain:
"""
A locator that ties together two others in order to express that something in {next}
caused {this} to be recorded
"""
# meta methods
def __init__(self, this, next):
... | en | 0.840564 | # -*- coding: utf-8 -*- # # <NAME>. aïvázis # orthologue # (c) 1998-2019 all rights reserved # # declaration A locator that ties together two others in order to express that something in {next} caused {this} to be recorded # meta methods # if {next} is non-trivial, show the chain # otherwise don't # implementation ... | 2.963023 | 3 |
tests/resources/accepted/res_0_minpyversion_3_0.py | matteogabburo/python-ast-utils | 3 | 11343 | import os
x = 7
print(x + 1)
| import os
x = 7
print(x + 1)
| none | 1 | 1.920445 | 2 | |
Mod 03/03 Prova.py | SauloCav/CN | 0 | 11344 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
import math
def f(x):
return math.exp(x)/x**3
def int(a,b):
h = (b-a)/104
x_par = a+h
x_impar = a+2*h
soma_par = 0
soma_impar = 0
for i in range(52):
soma_par += f(x_par)
x_par += 2*h
for i in range(51):
soma_impar... | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
import math
def f(x):
return math.exp(x)/x**3
def int(a,b):
h = (b-a)/104
x_par = a+h
x_impar = a+2*h
soma_par = 0
soma_impar = 0
for i in range(52):
soma_par += f(x_par)
x_par += 2*h
for i in range(51):
soma_impar... | en | 0.305311 | #! /usr/bin/env python3 # -*- coding: utf-8 -*- | 3.582109 | 4 |
almetro/al.py | arnour/almetro | 0 | 11345 | <gh_stars>0
from almetro.instance import growing
from almetro.metro import Metro
import timeit
class ExecutionSettings:
def __init__(self, trials=1, runs=1):
if not trials or trials < 1:
raise TypeError('#trials must be provided')
if not runs or runs < 1:
raise TypeError('#... | from almetro.instance import growing
from almetro.metro import Metro
import timeit
class ExecutionSettings:
def __init__(self, trials=1, runs=1):
if not trials or trials < 1:
raise TypeError('#trials must be provided')
if not runs or runs < 1:
raise TypeError('#runs must be... | none | 1 | 2.401626 | 2 | |
yt_dlp/extractor/archiveorg.py | mrBliss/yt-dlp | 80 | 11346 | <filename>yt_dlp/extractor/archiveorg.py
# coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from .youtube import YoutubeIE, YoutubeBaseInfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
compat_HTTP... | <filename>yt_dlp/extractor/archiveorg.py
# coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from .youtube import YoutubeIE, YoutubeBaseInfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
compat_HTTP... | en | 0.708764 | # coding: utf-8 #]+)(?:[?].*)?$' #1', (?xs) <input (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'|))*? \s+class=['"]?js-play8-playlist['"]? (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'|))*? \s*/> # Archive.org metadata API doesn't... | 2.053039 | 2 |
Interfas Grafica XI (GUI)/InterfasGraficaXI.py | BrianMarquez3/Python-Course | 20 | 11347 | <filename>Interfas Grafica XI (GUI)/InterfasGraficaXI.py
# Interfas Grafica XI
# Menu
from tkinter import *
root=Tk()
barraMenu=Menu(root)
root.config(menu=barraMenu, width=600, height=400)
archivoMenu=Menu(barraMenu, tearoff=0)
archivoMenu.add_command(label="Nuevo")
archivoMenu.add_command(label="Guardar")
archiv... | <filename>Interfas Grafica XI (GUI)/InterfasGraficaXI.py
# Interfas Grafica XI
# Menu
from tkinter import *
root=Tk()
barraMenu=Menu(root)
root.config(menu=barraMenu, width=600, height=400)
archivoMenu=Menu(barraMenu, tearoff=0)
archivoMenu.add_command(label="Nuevo")
archivoMenu.add_command(label="Guardar")
archiv... | en | 0.096318 | # Interfas Grafica XI # Menu | 2.551477 | 3 |
virtual/lib/python3.6/site-packages/macaroonbakery/tests/__init__.py | marknesh/pitches | 0 | 11348 | # Copyright 2017 Canonical Ltd.
# Licensed under the LGPLv3, see LICENCE file for details.
| # Copyright 2017 Canonical Ltd.
# Licensed under the LGPLv3, see LICENCE file for details.
| en | 0.833708 | # Copyright 2017 Canonical Ltd. # Licensed under the LGPLv3, see LICENCE file for details. | 0.702622 | 1 |
08/postgresql_demo.py | catcherwong-archive/2019 | 27 | 11349 | <reponame>catcherwong-archive/2019<gh_stars>10-100
# -*- coding: UTF-8 -*-
import psycopg2 #postgresql
import time
import datetime
class PgDemo:
def __init__(self, host, port, db, user, pwd):
self.host = host
self.port = port
self.db = db
self.user = user
se... | # -*- coding: UTF-8 -*-
import psycopg2 #postgresql
import time
import datetime
class PgDemo:
def __init__(self, host, port, db, user, pwd):
self.host = host
self.port = port
self.db = db
self.user = user
self.pwd = <PASSWORD>
def getConne... | es | 0.290218 | # -*- coding: UTF-8 -*- #postgresql # print(res) # print(res) # print(res) | 3.296258 | 3 |
examples/convert/pipe2sparky_2d.py | thegooglecodearchive/nmrglue | 1 | 11350 | #! /usr/bin/env python
import nmrglue as ng
# read in the varian data
dic,data = ng.pipe.read("../common_data/2d_pipe/test.ft2")
# Set the parameters
u = ng.pipe.guess_udic(dic,data)
# create the converter object and initilize with varian data
C = ng.convert.converter()
C.from_pipe(dic,data,u)
# create pipe data ... | #! /usr/bin/env python
import nmrglue as ng
# read in the varian data
dic,data = ng.pipe.read("../common_data/2d_pipe/test.ft2")
# Set the parameters
u = ng.pipe.guess_udic(dic,data)
# create the converter object and initilize with varian data
C = ng.convert.converter()
C.from_pipe(dic,data,u)
# create pipe data ... | en | 0.496189 | #! /usr/bin/env python # read in the varian data # Set the parameters # create the converter object and initilize with varian data # create pipe data and then write it out # check the conversion against NMRPipe | 2.437186 | 2 |
jaqs/trade/analyze/analyze.py | WayneWan413/JAQS | 0 | 11351 | # encoding: utf-8
from __future__ import print_function
import os
import json
from collections import OrderedDict
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import Formatter
from jaqs.trade.analyze.report import Report
from jaqs.data import ... | # encoding: utf-8
from __future__ import print_function
import os
import json
from collections import OrderedDict
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import Formatter
from jaqs.trade.analyze.report import Report
from jaqs.data import ... | en | 0.337247 | # encoding: utf-8 # scale # font size Return the label for time x at position pos # return self.dates[ind].strftime(self.fmt) Attributes ---------- _trades : pd.DataFrame _configs : dict data_api : BaseDataServer _universe : set All securities that have been traded. Read-only attribute Read-... | 2.167517 | 2 |
lightnet/data/transform/__init__.py | eavise-kul/lightnet | 6 | 11352 | #
# Lightnet data transforms
# Copyright EAVISE
#
from .pre import *
from .post import *
from .util import *
| #
# Lightnet data transforms
# Copyright EAVISE
#
from .pre import *
from .post import *
from .util import *
| en | 0.554044 | # # Lightnet data transforms # Copyright EAVISE # | 0.862164 | 1 |
ufdl-core-app/src/ufdl/core_app/exceptions/_BadSource.py | waikato-ufdl/ufdl-backend | 0 | 11353 | from rest_framework import status
from rest_framework.exceptions import APIException
class BadSource(APIException):
"""
Exception for when a lazily-loaded data source can't
be accessed for some reason
"""
status_code = status.HTTP_417_EXPECTATION_FAILED
default_code = 'bad_source'
def __i... | from rest_framework import status
from rest_framework.exceptions import APIException
class BadSource(APIException):
"""
Exception for when a lazily-loaded data source can't
be accessed for some reason
"""
status_code = status.HTTP_417_EXPECTATION_FAILED
default_code = 'bad_source'
def __i... | en | 0.909103 | Exception for when a lazily-loaded data source can't be accessed for some reason | 2.527316 | 3 |
build_tools/docker/manage_images.py | BernhardRiemann/iree | 1 | 11354 | <filename>build_tools/docker/manage_images.py
#!/usr/bin/env python3
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICE... | <filename>build_tools/docker/manage_images.py
#!/usr/bin/env python3
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICE... | en | 0.791573 | #!/usr/bin/env python3 # Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o... | 1.899449 | 2 |
suncasa/pygsfit/gsutils.py | wyq24/suncasa | 0 | 11355 | <reponame>wyq24/suncasa<filename>suncasa/pygsfit/gsutils.py
import numpy as np
# import sys
import math
import os, sys, platform
import astropy.units as u
from sunpy import map as smap
from astropy.coordinates import SkyCoord
from suncasa.io import ndfits
import lmfit
from astropy.time import Time
import matplotlib.pyp... | import numpy as np
# import sys
import math
import os, sys, platform
import astropy.units as u
from sunpy import map as smap
from astropy.coordinates import SkyCoord
from suncasa.io import ndfits
import lmfit
from astropy.time import Time
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplot... | en | 0.490618 | # import sys # name of the fast gyrosynchrotron codes shared library # print(ka_mu, em) # frequency in Hz # flux in sfu # area: area of the radio source in arcsec^2 # sr = np.pi * (size[0] / 206265. / 2.) * (size[1] / 206265. / 2.) # frequency in Hz # brightness temperature in K # area: area of the radio source in arcs... | 1.723515 | 2 |
msgvis/apps/questions/migrations/0001_initial.py | hds-lab/textvis-drg | 10 | 11356 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('dimensions', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Article',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('dimensions', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Article',
fields=[
... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.758883 | 2 |
test/test_check_alert.py | russ-lewis/cs120-queuebot | 0 | 11357 | import io
import sys
import unittest
import asyncio
import random
from contextlib import redirect_stdout
from .utils import *
from queuebot import QueueBot, QueueConfig, DiscordUser
config = {
"SECRET_TOKEN": "<PASSWORD>",
"TA_ROLES": ["UGTA"],
"LISTEN_CHANNELS": ["join-queue"],
"CHECK_VOICE_WAITING":... | import io
import sys
import unittest
import asyncio
import random
from contextlib import redirect_stdout
from .utils import *
from queuebot import QueueBot, QueueConfig, DiscordUser
config = {
"SECRET_TOKEN": "<PASSWORD>",
"TA_ROLES": ["UGTA"],
"LISTEN_CHANNELS": ["join-queue"],
"CHECK_VOICE_WAITING":... | en | 0.771916 | # TODO Comment each test case # self.bot.waiting_room = MockVoice(config.VOICE_WAITING) # Reset queue # Empty voice channels # No TAs in rooms #1")) # If we run out of TAs while going through all the rooms # Check for both alerted # Remove first student from queue # First ta helps first student # Another student joins | 2.392976 | 2 |
iam/__init__.py | dataday/aws-utilities-sdk | 0 | 11358 | """
.. module:: aws_utilities_cli.iam
:platform: OS X
:synopsis: Small collection of utilities that
use the Amazon Web Services (AWS) SDK
.. moduleauthor:: dataday
"""
__all__ = ['generate_identity', 'generate_policy']
| """
.. module:: aws_utilities_cli.iam
:platform: OS X
:synopsis: Small collection of utilities that
use the Amazon Web Services (AWS) SDK
.. moduleauthor:: dataday
"""
__all__ = ['generate_identity', 'generate_policy']
| en | 0.376001 | .. module:: aws_utilities_cli.iam :platform: OS X :synopsis: Small collection of utilities that use the Amazon Web Services (AWS) SDK .. moduleauthor:: dataday | 1.103853 | 1 |
tests/common/test_run/triangle_run.py | KnowingNothing/akg-test | 0 | 11359 | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | en | 0.842479 | # Copyright 2019 Huawei Technologies Co., Ltd # # 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... | 1.748838 | 2 |
profiles/migrations/0018_auto_20180514_2106.py | brentfraser/geotabloid | 2 | 11360 | <reponame>brentfraser/geotabloid<gh_stars>1-10
# Generated by Django 2.0.3 on 2018-05-14 21:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0017_otherfiles_location'),
]
operations = [
migrations.AlterField(
m... | # Generated by Django 2.0.3 on 2018-05-14 21:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0017_otherfiles_location'),
]
operations = [
migrations.AlterField(
model_name='project',
name='url',
... | en | 0.765892 | # Generated by Django 2.0.3 on 2018-05-14 21:06 | 1.40317 | 1 |
orio/main/tuner/tuner.py | parsabee/Orio | 24 | 11361 | <reponame>parsabee/Orio
#
# The tuner class to initiate the empirical performance tuning process
#
import re, sys, os
from orio.main.util.globals import *
import orio.main.dyn_loader, orio.main.tspec.tspec, orio.main.tuner.ptest_codegen, orio.main.tuner.ptest_driver
#------------------------------------------------... | #
# The tuner class to initiate the empirical performance tuning process
#
import re, sys, os
from orio.main.util.globals import *
import orio.main.dyn_loader, orio.main.tspec.tspec, orio.main.tuner.ptest_codegen, orio.main.tuner.ptest_driver
#--------------------------------------------------
# the name of the mo... | en | 0.548912 | # # The tuner class to initiate the empirical performance tuning process # #-------------------------------------------------- # the name of the module containing various search algorithms #-------------------------------------------------- The empirical performance tuner. This class is responsible for invoking the... | 2.843457 | 3 |
verify_data.py | goowell/DrAdvice | 0 | 11362 | from transformer import *
from logger import logger
def find_missing():
from db import paients_source, paients_info
import re
for pi in paients_info.find():
if paients_source.find({'_id': re.compile(pi['住院号'], re.IGNORECASE)}).count()>0:
pass
else:
print(pi['住院号'])
... | from transformer import *
from logger import logger
def find_missing():
from db import paients_source, paients_info
import re
for pi in paients_info.find():
if paients_source.find({'_id': re.compile(pi['住院号'], re.IGNORECASE)}).count()>0:
pass
else:
print(pi['住院号'])
... | en | 0.174131 | # verify_data(paients_source) # get_info(collection) | 2.673144 | 3 |
jvm-packages/cudautils.py | NVIDIA/spark-xgboost | 15 | 11363 | #!/usr/bin/env python
import os
import re
import subprocess
import sys
# version -> classifier
# '' means default classifier
cuda_vers = {
'11.2': ['cuda11', '']
}
def check_classifier(classifier):
'''
Check the mapping from cuda version to jar classifier.
Used by maven build.
'''
cu_ver = detec... | #!/usr/bin/env python
import os
import re
import subprocess
import sys
# version -> classifier
# '' means default classifier
cuda_vers = {
'11.2': ['cuda11', '']
}
def check_classifier(classifier):
'''
Check the mapping from cuda version to jar classifier.
Used by maven build.
'''
cu_ver = detec... | en | 0.76906 | #!/usr/bin/env python # version -> classifier # '' means default classifier Check the mapping from cuda version to jar classifier. Used by maven build. Get the supported cuda versions. Get the supported cuda versions and join them as a string. Used by shell script. Detect the cuda version from current nvcc tool... | 2.566539 | 3 |
hitchhikeproject/hitchhikeapp/migrations/0011_delete_dog.py | AlexW57/HitchHikeProject | 0 | 11364 | # Generated by Django 3.0.2 on 2020-03-29 19:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hitchhikeapp', '0010_userdata_userid'),
]
operations = [
migrations.DeleteModel(
name='Dog',
),
]
| # Generated by Django 3.0.2 on 2020-03-29 19:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hitchhikeapp', '0010_userdata_userid'),
]
operations = [
migrations.DeleteModel(
name='Dog',
),
]
| en | 0.823644 | # Generated by Django 3.0.2 on 2020-03-29 19:11 | 1.587345 | 2 |
support/models.py | gurupratap-matharu/django-tickets-app | 1 | 11365 | <filename>support/models.py
import pytz
from datetime import date, time, datetime, timedelta
from django.core.exceptions import ValidationError
from django.db import models
START_HOUR = 9
END_HOUR = 18
workingHours = END_HOUR - START_HOUR
class Vendor(models.Model):
"""
This class defines which vendors are... | <filename>support/models.py
import pytz
from datetime import date, time, datetime, timedelta
from django.core.exceptions import ValidationError
from django.db import models
START_HOUR = 9
END_HOUR = 18
workingHours = END_HOUR - START_HOUR
class Vendor(models.Model):
"""
This class defines which vendors are... | en | 0.914262 | This class defines which vendors are allowed raise tickets with our system. Define the holiday or non-working days for each based on each region. We define the type of category to which a particular ticket belongs here. Our ticket models objects are created here and stored in the database as a table with the attrib... | 2.891178 | 3 |
tests/port_tests/point_tests/test_bounding_box.py | skrat/martinez | 7 | 11366 | <gh_stars>1-10
from hypothesis import given
from tests.port_tests.hints import (PortedBoundingBox,
PortedPoint)
from tests.utils import equivalence
from . import strategies
@given(strategies.points)
def test_basic(point: PortedPoint) -> None:
assert isinstance(point.bounding_b... | from hypothesis import given
from tests.port_tests.hints import (PortedBoundingBox,
PortedPoint)
from tests.utils import equivalence
from . import strategies
@given(strategies.points)
def test_basic(point: PortedPoint) -> None:
assert isinstance(point.bounding_box, PortedBound... | none | 1 | 2.671464 | 3 | |
test/conftest.py | alexandonian/lightning | 0 | 11367 | <reponame>alexandonian/lightning
import pytest
# import station
def pytest_addoption(parser):
parser.addoption("--engine", action="store", default="local",
help="engine to run tests with")
@pytest.fixture(scope='module')
def eng(request):
engine = request.config.getoption("--engine")
... | import pytest
# import station
def pytest_addoption(parser):
parser.addoption("--engine", action="store", default="local",
help="engine to run tests with")
@pytest.fixture(scope='module')
def eng(request):
engine = request.config.getoption("--engine")
if engine == 'local':
... | en | 0.692076 | # import station | 2.24381 | 2 |
pytorch_translate/dual_learning/dual_learning_models.py | dzhulgakov/translate | 1 | 11368 | #!/usr/bin/env python3
import logging
import torch.nn as nn
from fairseq import checkpoint_utils
from fairseq.models import BaseFairseqModel, register_model
from pytorch_translate import rnn
from pytorch_translate.rnn import (
LSTMSequenceEncoder,
RNNDecoder,
RNNEncoder,
RNNModel,
base_architectur... | #!/usr/bin/env python3
import logging
import torch.nn as nn
from fairseq import checkpoint_utils
from fairseq.models import BaseFairseqModel, register_model
from pytorch_translate import rnn
from pytorch_translate.rnn import (
LSTMSequenceEncoder,
RNNDecoder,
RNNEncoder,
RNNModel,
base_architectur... | en | 0.945339 | #!/usr/bin/env python3 An architecture to jointly train primal model and dual model by leveraging distribution duality, which exist for both parallel data and monolingual data. If batch is monolingual, need to run beam decoding to generate fake prev_output_tokens. # TODO: pass to dual model too Train tw... | 2.409901 | 2 |
thgsp/sampling/__init__.py | qiuyy20/thgsp | 0 | 11369 | from ._utils import construct_dia, construct_hth, construct_sampling_matrix
from .bsgda import bsgda, computing_sets, recon_bsgda, solving_set_covering
from .ess import ess, ess_sampling, recon_ess
from .fastgsss import fastgsss, recon_fastssss
from .rsbs import cheby_coeff4ideal_band_pass, estimate_lk, recon_rsbs, rsb... | from ._utils import construct_dia, construct_hth, construct_sampling_matrix
from .bsgda import bsgda, computing_sets, recon_bsgda, solving_set_covering
from .ess import ess, ess_sampling, recon_ess
from .fastgsss import fastgsss, recon_fastssss
from .rsbs import cheby_coeff4ideal_band_pass, estimate_lk, recon_rsbs, rsb... | en | 0.467122 | # reconstruction # utils | 1.139232 | 1 |
h2o-py/tests/testdir_generic_model/pyunit_generic_model_mojo_glm.py | vishalbelsare/h2o-3 | 1 | 11370 | <filename>h2o-py/tests/testdir_generic_model/pyunit_generic_model_mojo_glm.py
import tempfile
import os
import sys
sys.path.insert(1,"../../")
import h2o
from h2o.estimators import H2OGeneralizedLinearEstimator, H2OGenericEstimator
from tests import pyunit_utils
from tests.testdir_generic_model import compare_output, ... | <filename>h2o-py/tests/testdir_generic_model/pyunit_generic_model_mojo_glm.py
import tempfile
import os
import sys
sys.path.insert(1,"../../")
import h2o
from h2o.estimators import H2OGeneralizedLinearEstimator, H2OGenericEstimator
from tests import pyunit_utils
from tests.testdir_generic_model import compare_output, ... | en | 0.13528 | # GLM # alpha = 1, lambda_ = 1, bad values, use default | 2.323365 | 2 |
test/HPE3ParClient_base.py | jyotsnalothe/python-3parclient | 35 | 11371 | <filename>test/HPE3ParClient_base.py
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
#
# 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-... | <filename>test/HPE3ParClient_base.py
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
#
# 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-... | en | 0.848651 | # (c) Copyright 2015 Hewlett Packard Enterprise Development LP # # 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.165778 | 2 |
test/drivers/second_quantization/hdf5d/test_driver_hdf5.py | jschuhmac/qiskit-nature | 0 | 11372 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | en | 0.830854 | # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat... | 2.209028 | 2 |
01_test_pytorch.py | yokaji/dcase2021_task2_baseline_ae | 0 | 11373 | <gh_stars>0
########################################################################
# import default libraries
########################################################################
import os
import csv
import sys
import gc
########################################################################
########... | ########################################################################
# import default libraries
########################################################################
import os
import csv
import sys
import gc
########################################################################
####################... | de | 0.657903 | ######################################################################## # import default libraries ######################################################################## ######################################################################## ######################################################################## #... | 1.731969 | 2 |
Replace Downloads/replace_downloads.py | crake7/Defensor-Fortis- | 0 | 11374 | <gh_stars>0
#!/usr/bin/env python
import netfilterqueue
import scapy.all as scapy
ack_list = []
def set_load(packet, load):
packet[scapy.Raw].load = load
del packet[scapy.IP].len
del packet[scapy.IP].chksum
del packet[scapy.TCP].chksum
return packet
def process_packet(packet):
"""Modify dow... | #!/usr/bin/env python
import netfilterqueue
import scapy.all as scapy
ack_list = []
def set_load(packet, load):
packet[scapy.Raw].load = load
del packet[scapy.IP].len
del packet[scapy.IP].chksum
del packet[scapy.TCP].chksum
return packet
def process_packet(packet):
"""Modify downloads files... | en | 0.625297 | #!/usr/bin/env python Modify downloads files on the fly while target uses HTTP/HTTPS. Do not forget to choose the port you will be using in line 22/29. Do not forget to modify line 24 and 35 and uncomment them afterwards. #CHOOSE PORT HERE: 80 / 10000: # print("HTTP Request") #Input IP of your web server here: ... | 2.870829 | 3 |
tmpmodels.py | firaan1/iamgrateful | 0 | 11375 | <reponame>firaan1/iamgrateful
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, Text, ForeignKey, DateTime, func, Boolean
from sqlalchemy.orm import relation, sessionmaker, relationship, backref
from datetime import datetime
imp... | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, Text, ForeignKey, DateTime, func, Boolean
from sqlalchemy.orm import relation, sessionmaker, relationship, backref
from datetime import datetime
import os
# Database
DATABASE = ... | en | 0.402332 | # Database # ORM # model # if __name__ == '__main__': # connection # initialize database | 3.013021 | 3 |
doc/filters.py | CargobaseDev/openpyxl | 6 | 11376 | from openpyxl import Workbook
wb = Workbook()
ws = wb.active
data = [
["Fruit", "Quantity"],
["Kiwi", 3],
["Grape", 15],
["Apple", 3],
["Peach", 3],
["Pomegranate", 3],
["Pear", 3],
["Tangerine", 3],
["Blueberry", 3],
["Mango", 3],
["Watermelon", 3],
["Blackberry", 3],
... | from openpyxl import Workbook
wb = Workbook()
ws = wb.active
data = [
["Fruit", "Quantity"],
["Kiwi", 3],
["Grape", 15],
["Apple", 3],
["Peach", 3],
["Pomegranate", 3],
["Pear", 3],
["Tangerine", 3],
["Blueberry", 3],
["Mango", 3],
["Watermelon", 3],
["Blackberry", 3],
... | none | 1 | 2.769828 | 3 | |
Bleak/two_devices.py | mbdev2/MIS_FindMyProfessor | 0 | 11377 | from bleak import BleakClient
import asyncio
import functools
notify_uuid = "00002a19-0000-1000-8000-00805f9b34fb".format(0x2A19)
def callback(sender, data, mac_address):
#data = bytearray(data)
dataint = int.from_bytes(data, byteorder='little', signed=True)
print(mac_address, dataint)
def run(addresses... | from bleak import BleakClient
import asyncio
import functools
notify_uuid = "00002a19-0000-1000-8000-00805f9b34fb".format(0x2A19)
def callback(sender, data, mac_address):
#data = bytearray(data)
dataint = int.from_bytes(data, byteorder='little', signed=True)
print(mac_address, dataint)
def run(addresses... | en | 0.409194 | #data = bytearray(data) #model_number = await client.read_gatt_char(address) | 2.446332 | 2 |
binary search tree insertion.py | buhuhaha/python | 0 | 11378 | <filename>binary search tree insertion.py<gh_stars>0
class Node:
left = right = None
def __init__(self, data):
self.data = data
def inorder(root):
if root is None:
return
inorder(root.left)
print(root.data, end=' ')
inorder(root.right)
def insert(root, key):
if root is None... | <filename>binary search tree insertion.py<gh_stars>0
class Node:
left = right = None
def __init__(self, data):
self.data = data
def inorder(root):
if root is None:
return
inorder(root.left)
print(root.data, end=' ')
inorder(root.right)
def insert(root, key):
if root is None... | none | 1 | 3.708163 | 4 | |
tests/test_env_helpers.py | Azraeht/py-ndebug | 0 | 11379 | <reponame>Azraeht/py-ndebug
from ndebug import env_helpers
def test_inspect_ops(mocker):
mocker.patch.dict('os.environ', {'DEBUG_COLORS': 'no',
'DEBUG_DEPTH': '10',
'DEBUG_SHOW_HIDDEN': 'enabled',
'DEBUG... | from ndebug import env_helpers
def test_inspect_ops(mocker):
mocker.patch.dict('os.environ', {'DEBUG_COLORS': 'no',
'DEBUG_DEPTH': '10',
'DEBUG_SHOW_HIDDEN': 'enabled',
'DEBUG_SOMETHING': 'null'})
ac... | none | 1 | 2.275687 | 2 | |
relay_lib_seeed_test_2.py | johnwargo/seeed-studio-relay-v2 | 1 | 11380 | #!/usr/bin/python
'''*****************************************************************************************************************
Seeed Studio Relay Board Library V2
Test Application #2
By <NAME> (https://www.johnwargo.com)
*******************************************************************************... | #!/usr/bin/python
'''*****************************************************************************************************************
Seeed Studio Relay Board Library V2
Test Application #2
By <NAME> (https://www.johnwargo.com)
*******************************************************************************... | en | 0.625909 | #!/usr/bin/python ***************************************************************************************************************** Seeed Studio Relay Board Library V2 Test Application #2 By <NAME> (https://www.johnwargo.com) **********************************************************************************... | 2.855885 | 3 |
quasar/sa_database.py | stevencyrway/quasar | 12 | 11381 | <reponame>stevencyrway/quasar
import os
from sqlalchemy import bindparam, create_engine, exc
from sqlalchemy.dialects.postgresql.json import JSONB
from sqlalchemy.engine.url import URL
from sqlalchemy.sql import text
from .utils import log, logerr
# Setup SQL Alchemy vars.
pg_opts = {
'drivername': os.getenv('PG... | import os
from sqlalchemy import bindparam, create_engine, exc
from sqlalchemy.dialects.postgresql.json import JSONB
from sqlalchemy.engine.url import URL
from sqlalchemy.sql import text
from .utils import log, logerr
# Setup SQL Alchemy vars.
pg_opts = {
'drivername': os.getenv('PG_DRIVER'),
'username': os.... | en | 0.718902 | # Setup SQL Alchemy vars. # Setup SQL Alchemy postgres connection. # Run query with string substitution using ':thisvar' SQL Alchemy # standard based formatting. e.g. # query = 'INSERT :bar into foo;', record = {bar: 'baz'} # Based on the post https://stackoverflow.com/a/46031085, this # function forces a JSONB binding... | 2.691261 | 3 |
commands/__init__.py | CorneliaXaos/Command-Block-Assembly | 1 | 11382 | import abc
class CommandBlock:
def __init__(self, command, conditional=True, mode='CHAIN', auto=True,
opposite=False, single_use=True):
self.command = command
self.cond = conditional
self.mode = mode
self.auto = auto
self.opposite = opposite
self.sin... | import abc
class CommandBlock:
def __init__(self, command, conditional=True, mode='CHAIN', auto=True,
opposite=False, single_use=True):
self.command = command
self.cond = conditional
self.mode = mode
self.auto = auto
self.opposite = opposite
self.sin... | en | 0.674776 | # TODO path validation # Don't use our constructor # https://stackoverflow.com/a/2440786 # TODO quoted keys | 2.934923 | 3 |
top/clearlight/reptile/bilibili/bj_tech_mooc/example_04_360.py | ClearlightY/Python_learn | 1 | 11383 | import requests
keyword = "python"
try:
kv = {'q':keyword}
r = requests.get('http://www.so.com/s', params=kv)
print(r.request.url)
r.raise_for_status()
print(len(r.text))
except:
print('爬取失败') | import requests
keyword = "python"
try:
kv = {'q':keyword}
r = requests.get('http://www.so.com/s', params=kv)
print(r.request.url)
r.raise_for_status()
print(len(r.text))
except:
print('爬取失败') | none | 1 | 2.816193 | 3 | |
rodnet/models/backbones/cdc_deep.py | zhengzangw/RODNet | 0 | 11384 | import torch.nn as nn
class RODEncode(nn.Module):
def __init__(self, in_channels=2):
super(RODEncode, self).__init__()
self.conv1a = nn.Conv3d(
in_channels=in_channels,
out_channels=64,
kernel_size=(9, 5, 5),
stride=(1, 1, 1),
padding=(4,... | import torch.nn as nn
class RODEncode(nn.Module):
def __init__(self, in_channels=2):
super(RODEncode, self).__init__()
self.conv1a = nn.Conv3d(
in_channels=in_channels,
out_channels=64,
kernel_size=(9, 5, 5),
stride=(1, 1, 1),
padding=(4,... | en | 0.518925 | # (B, 2, W, 128, 128) -> (B, 64, W, 128, 128) # additional # (B, 64, W, 128, 128) -> (B, 64, W, 128, 128) # (B, 64, W, 128, 128) -> (B, 64, W, 128, 128) # (B, 64, W, 128, 128) -> (B, 64, W/2, 64, 64) # (B, 64, W/2, 64, 64) -> (B, 128, W/2, 64, 64) # (B, 128, W/2, 64, 64) -> (B, 128, W/4, 32, 32) # (B, 128, W/4, 32, 32)... | 2.376875 | 2 |
File/admin.py | alstn2468/Likelion_DRF_Project | 28 | 11385 | from django.contrib import admin
from .models import File
admin.site.register(File)
| from django.contrib import admin
from .models import File
admin.site.register(File)
| none | 1 | 1.284369 | 1 | |
agent/windows/agent.py | fortinet/ips-bph-framework | 21 | 11386 | <reponame>fortinet/ips-bph-framework
import shutil
import socket
import subprocess
import threading
import json
import pickle
import tempfile
import time
import box
import threading
import os
import base64
import getpass
import urllib
import requests
import zipfile
import sys
import pprint
import plat... | import shutil
import socket
import subprocess
import threading
import json
import pickle
import tempfile
import time
import box
import threading
import os
import base64
import getpass
import urllib
import requests
import zipfile
import sys
import pprint
import platform
DEBUG = True
BPH_TEMPLATE_... | en | 0.802196 | # To avoid tool issues when dealing with white-spaced paths. # unfiltered_data should be a list # os.path.expandvars('%appdata%'), # "peid" # "peid.exe" ## Searching Variable ###: {}".format(unfiltered_string) # return " ".join(self.filtered_data) #time.sleep(5) # When a file is bein created as compressed file (zip), i... | 2.057821 | 2 |
python/src/learn/lstmSequence.py | kakaba2009/MachineLearning | 0 | 11387 | # LSTM with Variable Length Input Sequences to One Character Output
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.utils import np_utils
from keras.preprocessing.sequence import pad_sequences
from theano.tensor.shared_randomstreams import ... | # LSTM with Variable Length Input Sequences to One Character Output
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.utils import np_utils
from keras.preprocessing.sequence import pad_sequences
from theano.tensor.shared_randomstreams import ... | en | 0.747745 | # LSTM with Variable Length Input Sequences to One Character Output # fix random seed for reproducibility # define the raw dataset # create mapping of characters to integers (0-25) and the reverse # prepare the dataset of input to output pairs encoded as integers # convert list of lists to array and pad sequences if ne... | 2.923519 | 3 |
DATA/prediction/direction/pred_script.py | korcsmarosgroup/ARN2DataBase | 0 | 11388 | """
Direction prediction based on learning dataset from reactome
PPI direction calculated from domain interaction directions
"""
# Imports
import sqlite3, csv, os
import pandas as pd
import logging
import pickle
# # Initiating logger
# logger = logging.getLogger()
# handler = logging.FileHandler('../../workflow/SLK3.l... | """
Direction prediction based on learning dataset from reactome
PPI direction calculated from domain interaction directions
"""
# Imports
import sqlite3, csv, os
import pandas as pd
import logging
import pickle
# # Initiating logger
# logger = logging.getLogger()
# handler = logging.FileHandler('../../workflow/SLK3.l... | en | 0.686393 | Direction prediction based on learning dataset from reactome PPI direction calculated from domain interaction directions # Imports # # Initiating logger # logger = logging.getLogger() # handler = logging.FileHandler('../../workflow/SLK3.log') # logger.setLevel(logging.DEBUG) # handler.setLevel(logging.DEBUG) # formatte... | 2.296176 | 2 |
src/main.py | vcodrins/json_to_folder | 0 | 11389 | import json
import os.path
import sys
from exceptions import *
from create_folder_structure import create_folder_structure
def main():
try:
if len(sys.argv) != 3:
raise InvalidArgumentCount
if not os.path.exists(sys.argv[2]):
raise InvalidFilePath
if not os.path.exi... | import json
import os.path
import sys
from exceptions import *
from create_folder_structure import create_folder_structure
def main():
try:
if len(sys.argv) != 3:
raise InvalidArgumentCount
if not os.path.exists(sys.argv[2]):
raise InvalidFilePath
if not os.path.exi... | en | 0.643232 | Invalid number of arguments Please make sure to use quotes for outputFolder and jsonFile if path includes spaces Valid paths may be: "file.json" "./file.json" "folder/file.json" "./folder/file.json" "absolute/path/t... | 3.694792 | 4 |
app/conftest.py | hbyyy/newsmailing | 0 | 11390 | <gh_stars>0
from datetime import timedelta
import pytest
from model_bakery import baker
@pytest.fixture()
def create_expire_user():
def make_user(**kwargs):
user = baker.make('members.User')
user.created -= timedelta(days=4)
return user
return make_user
| from datetime import timedelta
import pytest
from model_bakery import baker
@pytest.fixture()
def create_expire_user():
def make_user(**kwargs):
user = baker.make('members.User')
user.created -= timedelta(days=4)
return user
return make_user | none | 1 | 2.054505 | 2 | |
src/SecurityDecorator.py | JanCwik/SoftwarePraktikum | 7 | 11391 | from flask import request
from google.auth.transport import requests
import google.oauth2.id_token
from server.ApplikationsAdministration import ApplikationsAdministration
#Benutzer.py, BenutzerMapper + BenutzerMethoden in ApplikationsAdministration
def secured(function):
"""Decorator zur Google Firebase-basiert... | from flask import request
from google.auth.transport import requests
import google.oauth2.id_token
from server.ApplikationsAdministration import ApplikationsAdministration
#Benutzer.py, BenutzerMapper + BenutzerMethoden in ApplikationsAdministration
def secured(function):
"""Decorator zur Google Firebase-basiert... | de | 0.973057 | #Benutzer.py, BenutzerMapper + BenutzerMethoden in ApplikationsAdministration Decorator zur Google Firebase-basierten Authentifizierung von Benutzern Da es sich bei diesem System um eine basale Fallstudie zu Lehrzwecken handelt, wurde hier bewusst auf ein ausgefeiltes Berechtigungskonzept verzichtet. Vielmehr ... | 2.927772 | 3 |
code/django18/django18/newsletter/forms.py | dvl/celerytalk | 0 | 11392 | <reponame>dvl/celerytalk
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
class NewsletterForm(forms.Form):
assunto = forms.CharField()
mensagem = forms.CharField(widget=forms.Textarea)
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
class NewsletterForm(forms.Form):
assunto = forms.CharField()
mensagem = forms.CharField(widget=forms.Textarea) | en | 0.769321 | # -*- coding: utf-8 -*- | 1.683185 | 2 |
RecoEgamma/ElectronIdentification/python/Identification/mvaElectronID_Fall17_noIso_V1_cff.py | ckamtsikis/cmssw | 852 | 11393 | import FWCore.ParameterSet.Config as cms
from RecoEgamma.ElectronIdentification.Identification.mvaElectronID_tools import *
# Documentation of the MVA
# https://twiki.cern.ch/twiki/bin/viewauth/CMS/MultivariateElectronIdentificationRun2
# https://rembserj.web.cern.ch/rembserj/notes/Electron_MVA_ID_2017_documentation
... | import FWCore.ParameterSet.Config as cms
from RecoEgamma.ElectronIdentification.Identification.mvaElectronID_tools import *
# Documentation of the MVA
# https://twiki.cern.ch/twiki/bin/viewauth/CMS/MultivariateElectronIdentificationRun2
# https://rembserj.web.cern.ch/rembserj/notes/Electron_MVA_ID_2017_documentation
... | en | 0.730866 | # Documentation of the MVA # https://twiki.cern.ch/twiki/bin/viewauth/CMS/MultivariateElectronIdentificationRun2 # https://rembserj.web.cern.ch/rembserj/notes/Electron_MVA_ID_2017_documentation # # In this file we define the locations of the MVA weights, cuts on the MVA values # for specific working points, and configu... | 1.746455 | 2 |
dqn_plus/notebooks/code/train_ram.py | hadleyhzy34/reinforcement_learning | 0 | 11394 | <reponame>hadleyhzy34/reinforcement_learning<gh_stars>0
import numpy as np
import gym
from utils import *
from agent import *
from config import *
def train(env, agent, num_episode, eps_init, eps_decay, eps_min, max_t):
rewards_log = []
average_log = []
eps = eps_init
for i in range(1, 1 + num_episode... | import numpy as np
import gym
from utils import *
from agent import *
from config import *
def train(env, agent, num_episode, eps_init, eps_decay, eps_min, max_t):
rewards_log = []
average_log = []
eps = eps_init
for i in range(1, 1 + num_episode):
episodic_reward = 0
done = False
... | none | 1 | 2.401767 | 2 | |
tools/parallel_launcher/parallel_launcher.py | Gitman1989/chromium | 2 | 11395 | #!/usr/bin/python
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This tool launches several shards of a gtest-based binary
in parallel on a local machine.
Example usage:
parallel_launcher.py pat... | #!/usr/bin/python
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This tool launches several shards of a gtest-based binary
in parallel on a local machine.
Example usage:
parallel_launcher.py pat... | en | 0.831023 | #!/usr/bin/python # Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. This tool launches several shards of a gtest-based binary in parallel on a local machine. Example usage: parallel_launcher.py path/to/... | 2.468857 | 2 |
05_Practice1/Step06/yj.py | StudyForCoding/BEAKJOON | 0 | 11396 | a = int(input())
for i in range(a):
print('* '*(a-a//2))
print(' *'*(a//2)) | a = int(input())
for i in range(a):
print('* '*(a-a//2))
print(' *'*(a//2)) | none | 1 | 3.528922 | 4 | |
greydot/errors.py | TralahM/greydot-api | 0 | 11397 | <gh_stars>0
class NoMessageRecipients(Exception):
"""
Raised when Message Recipients are not specified.
"""
pass
class InvalidAmount(Exception):
"""
Raised when an invalid currency amount is specified
"""
pass
| class NoMessageRecipients(Exception):
"""
Raised when Message Recipients are not specified.
"""
pass
class InvalidAmount(Exception):
"""
Raised when an invalid currency amount is specified
"""
pass | en | 0.75097 | Raised when Message Recipients are not specified. Raised when an invalid currency amount is specified | 1.950328 | 2 |
ginga/util/dp.py | kyraikeda/ginga | 76 | 11398 | <gh_stars>10-100
#
# dp.py -- Data pipeline and reduction routines
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import numpy as np
from collections import OrderedDict
from ginga import AstroImage, colors
from ginga.RGBImage import RGBImage
from ginga.... | #
# dp.py -- Data pipeline and reduction routines
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import numpy as np
from collections import OrderedDict
from ginga import AstroImage, colors
from ginga.RGBImage import RGBImage
from ginga.util import wcs
... | en | 0.646065 | # # dp.py -- Data pipeline and reduction routines # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # # counter used to name anonymous images # Prepare a new image with the numpy array as data # Set the header to be the old image header updated # with items fr... | 2.501046 | 3 |
jigsaw/datasets/datasets.py | alexvishnevskiy/jigsaw | 0 | 11399 | <gh_stars>0
from torch.utils.data import Dataset
from ..utils.optimal_lenght import find_optimal_lenght
class PairedDataset(Dataset):
def __init__(
self,
df,
cfg,
tokenizer,
more_toxic_col='more_toxic',
less_toxic_col='less_toxic'
):
self.df = d... | from torch.utils.data import Dataset
from ..utils.optimal_lenght import find_optimal_lenght
class PairedDataset(Dataset):
def __init__(
self,
df,
cfg,
tokenizer,
more_toxic_col='more_toxic',
less_toxic_col='less_toxic'
):
self.df = df
se... | none | 1 | 2.56159 | 3 |