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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/test_authentication.py | movermeyer/cellardoor | 0 | 4500 | import unittest
from mock import Mock
import base64
from cellardoor import errors
from cellardoor.authentication import *
from cellardoor.authentication.basic import BasicAuthIdentifier
class FooIdentifier(Identifier):
pass
class BarAuthenticator(Authenticator):
pass
class TestAuthentication(unittest.TestCase... | import unittest
from mock import Mock
import base64
from cellardoor import errors
from cellardoor.authentication import *
from cellardoor.authentication.basic import BasicAuthIdentifier
class FooIdentifier(Identifier):
pass
class BarAuthenticator(Authenticator):
pass
class TestAuthentication(unittest.TestCase... | none | 1 | 2.85665 | 3 | |
src/styleaug/__init__.py | somritabanerjee/speedplusbaseline | 69 | 4501 | <reponame>somritabanerjee/speedplusbaseline<filename>src/styleaug/__init__.py
from .styleAugmentor import StyleAugmentor | from .styleAugmentor import StyleAugmentor | none | 1 | 1.103477 | 1 | |
configs/classification/imagenet/mixups/convnext/convnext_tiny_smooth_mix_8xb256_accu2_ema_fp16.py | Westlake-AI/openmixup | 10 | 4502 | _base_ = [
'../../../_base_/datasets/imagenet/swin_sz224_4xbs256.py',
'../../../_base_/default_runtime.py',
]
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=0.2,
mix_mode="cutmix",
mix_args=dict(
attentivemix=dict(grid_size=32, top_k=None, beta=8),... | _base_ = [
'../../../_base_/datasets/imagenet/swin_sz224_4xbs256.py',
'../../../_base_/default_runtime.py',
]
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=0.2,
mix_mode="cutmix",
mix_args=dict(
attentivemix=dict(grid_size=32, top_k=None, beta=8),... | en | 0.695917 | # model settings # AttentiveMix+ in this repo (use pre-trained) # require pre-trained mixblock # adjust t_batch_size if CUDA out of memory # block_num<=4 and mp=2/4 for fast training # require pre-trained mixblock # mixup CE + label smooth # gap_before_final_norm is True # interval for accumulate gradient # total: 8 x ... | 1.397789 | 1 |
mcstasscript/interface/reader.py | PaNOSC-ViNYL/McStasScript | 3 | 4503 | import os
from mcstasscript.instr_reader.control import InstrumentReader
from mcstasscript.interface.instr import McStas_instr
class McStas_file:
"""
Reader of McStas files, can add to an existing McStasScript
instrument instance or create a corresponding McStasScript python
file.
Methods
---... | import os
from mcstasscript.instr_reader.control import InstrumentReader
from mcstasscript.interface.instr import McStas_instr
class McStas_file:
"""
Reader of McStas files, can add to an existing McStasScript
instrument instance or create a corresponding McStasScript python
file.
Methods
---... | en | 0.595179 | Reader of McStas files, can add to an existing McStasScript instrument instance or create a corresponding McStasScript python file. Methods ------- add_to_instr(Instr) Add information from McStas file to McStasScript Instr instance write_python_file(filename) Write python file... | 3.114677 | 3 |
src/regrtest.py | ucsd-progsys/csolve-bak | 0 | 4504 | <reponame>ucsd-progsys/csolve-bak<filename>src/regrtest.py
#!/usr/bin/python
# Copyright (c) 2009 The Regents of the University of California. All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and ... | #!/usr/bin/python
# Copyright (c) 2009 The Regents of the University of California. All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and its documentation for any purpose, provided that the
# abov... | en | 0.533057 | #!/usr/bin/python # Copyright (c) 2009 The Regents of the University of California. All rights reserved. # # Permission is hereby granted, without written agreement and without # license or royalty fees, to use, copy, modify, and distribute this # software and its documentation for any purpose, provided that the # abov... | 2.068935 | 2 |
country_capital_guesser.py | NathanMH/ComputerClub | 0 | 4505 | #! /usr/bin/env python3
#######################
"""####################
Index:
1. Imports and Readme
2. Functions
3. Main
4. Testing
####################"""
#######################
###################################################################
# 1. IMPORTS AND README
#############################... | #! /usr/bin/env python3
#######################
"""####################
Index:
1. Imports and Readme
2. Functions
3. Main
4. Testing
####################"""
#######################
###################################################################
# 1. IMPORTS AND README
#############################... | de | 0.529589 | #! /usr/bin/env python3 ####################### #################### Index: 1. Imports and Readme 2. Functions 3. Main 4. Testing #################### ####################### ################################################################### # 1. IMPORTS AND README #####################################... | 3.07661 | 3 |
data_analysis/audiocommons_ffont/scripts/rekordbox_xml_to_analysis_rhythm_rekordbox_file.py | aframires/freesound-loop-annotator | 18 | 4506 | # Need this to import from parent directory when running outside pycharm
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
from ac_utils.general import save_to_json, load_from_json
import click
import xml.etree.ElementTree
from urllib import unquote
def find_c... | # Need this to import from parent directory when running outside pycharm
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
from ac_utils.general import save_to_json, load_from_json
import click
import xml.etree.ElementTree
from urllib import unquote
def find_c... | en | 0.785415 | # Need this to import from parent directory when running outside pycharm Read information from rekordbox_rhythm.xml present in dataset_path and convert it into analsysis_rhythm_rekordbox.json to be stored in the same folder and compatible with our evaluation framework. | 2.360991 | 2 |
inventree/part.py | SergeoLacruz/inventree-python | 0 | 4507 | <filename>inventree/part.py
# -*- coding: utf-8 -*-
import logging
import re
import inventree.base
import inventree.stock
import inventree.company
import inventree.build
logger = logging.getLogger('inventree')
class PartCategory(inventree.base.InventreeObject):
""" Class representing the PartCategory database... | <filename>inventree/part.py
# -*- coding: utf-8 -*-
import logging
import re
import inventree.base
import inventree.stock
import inventree.company
import inventree.build
logger = logging.getLogger('inventree')
class PartCategory(inventree.base.InventreeObject):
""" Class representing the PartCategory database... | en | 0.818907 | # -*- coding: utf-8 -*- Class representing the PartCategory database model fetch_parent: enable to fetch templates for parent categories Class representing the Part database model Return the part category associated with this part Return all test templates associated with this part Return the supplier parts associated ... | 2.559568 | 3 |
tests/test_web_urldispatcher.py | avstarkov/aiohttp | 0 | 4508 | import functools
import os
import shutil
import tempfile
from unittest import mock
from unittest.mock import MagicMock
import pytest
from aiohttp import abc, web
from aiohttp.web_urldispatcher import SystemRoute
@pytest.fixture(scope='function')
def tmp_dir_path(request):
"""
Give a path for a temporary dir... | import functools
import os
import shutil
import tempfile
from unittest import mock
from unittest.mock import MagicMock
import pytest
from aiohttp import abc, web
from aiohttp.web_urldispatcher import SystemRoute
@pytest.fixture(scope='function')
def tmp_dir_path(request):
"""
Give a path for a temporary dir... | en | 0.848296 | Give a path for a temporary directory The directory is destroyed at the end of the test. # Temporary directory. # Delete the whole directory: Tests the operation of static file server. Try to access the root of static file server, and make sure that correct HTTP statuses are returned depending if we directo... | 2.49554 | 2 |
R-GMM-VGAE/model_citeseer.py | nairouz/R-GAE | 26 | 4509 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Authors : <NAME> (<EMAIL>) & <NAME> (<EMAIL>)
# @Paper : Rethinking Graph Autoencoder Models for Attributed Graph Clustering
# @License : MIT License
import torch
import numpy as np
import torch.nn as nn
import scipy.sparse as sp
import torch.nn.functional as F
from t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Authors : <NAME> (<EMAIL>) & <NAME> (<EMAIL>)
# @Paper : Rethinking Graph Autoencoder Models for Attributed Graph Clustering
# @License : MIT License
import torch
import numpy as np
import torch.nn as nn
import scipy.sparse as sp
import torch.nn.functional as F
from t... | en | 0.598721 | #!/usr/bin/env python # -*- coding: utf-8 -*- # @Authors : <NAME> (<EMAIL>) & <NAME> (<EMAIL>) # @Paper : Rethinking Graph Autoencoder Models for Attributed Graph Clustering # @License : MIT License # best mapping between true_label and predict label # match two clustering results by Munkres algorithm # get the match... | 2.179918 | 2 |
odoo-13.0/addons/stock_account/models/account_chart_template.py | VaibhavBhujade/Blockchain-ERP-interoperability | 0 | 4510 | <filename>odoo-13.0/addons/stock_account/models/account_chart_template.py
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, _
import logging
_logger = logging.getLogger(__name__)
class AccountChartTemplate(models.Model):
_inherit = "... | <filename>odoo-13.0/addons/stock_account/models/account_chart_template.py
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, _
import logging
_logger = logging.getLogger(__name__)
class AccountChartTemplate(models.Model):
_inherit = "... | en | 0.598433 | # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Property Stock Journal # the property exist: modify it # create the property # Property Stock Accounts # create the property # update the property if False | 1.992221 | 2 |
lib/roi_data/loader.py | BarneyQiao/pcl.pytorch | 233 | 4511 | import math
import numpy as np
import numpy.random as npr
import torch
import torch.utils.data as data
import torch.utils.data.sampler as torch_sampler
from torch.utils.data.dataloader import default_collate
from torch._six import int_classes as _int_classes
from core.config import cfg
from roi_data.minibatch import ... | import math
import numpy as np
import numpy.random as npr
import torch
import torch.utils.data as data
import torch.utils.data.sampler as torch_sampler
from torch.utils.data.dataloader import default_collate
from torch._six import int_classes as _int_classes
from core.config import cfg
from roi_data.minibatch import ... | en | 0.761852 | # from model.rpn.bbox_transform import bbox_transform_inv, clip_boxes #TODO: Check if minibatch is valid ? If not, abandon it. # Need to change _worker_loop in torch.utils.data.dataloader.py. # Squeeze batch dim # for key in blobs: # if key != 'roidb': # blobs[key] = blobs[key].squeeze(axis=0) Given the rat... | 1.918296 | 2 |
venv/Lib/site-packages/sklearn/linear_model/tests/test_least_angle.py | andywu113/fuhe_predict | 3 | 4512 | <reponame>andywu113/fuhe_predict<gh_stars>1-10
import warnings
from distutils.version import LooseVersion
import numpy as np
import pytest
from scipy import linalg
from sklearn.model_selection import train_test_split
from sklearn.utils.testing import assert_allclose
from sklearn.utils.testing import assert_array_alm... | import warnings
from distutils.version import LooseVersion
import numpy as np
import pytest
from scipy import linalg
from sklearn.model_selection import train_test_split
from sklearn.utils.testing import assert_allclose
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import ass... | en | 0.802961 | # TODO: use another dataset that has multiple drops # Principle of Lars is to keep covariances tied and decreasing # also test verbose output # no more than max_pred variables can go into the active set # The same, with precomputed Gram matrix # no more than max_pred variables can go into the active set # Test that lar... | 2.313413 | 2 |
parser.py | FeroxTL/pynginxconfig-new | 8 | 4513 | <filename>parser.py
#coding: utf8
import copy
import re
from blocks import Block, EmptyBlock, KeyValueOption, Comment, Location
def parse(s, parent_block):
config = copy.copy(s)
pos, brackets_level, param_start = 0, 0, 0
while pos < len(config):
if config[pos] == '#' and brackets_level == 0:
... | <filename>parser.py
#coding: utf8
import copy
import re
from blocks import Block, EmptyBlock, KeyValueOption, Comment, Location
def parse(s, parent_block):
config = copy.copy(s)
pos, brackets_level, param_start = 0, 0, 0
while pos < len(config):
if config[pos] == '#' and brackets_level == 0:
... | en | 0.344171 | #coding: utf8 #(?P<comment>.*)$', config, re.M) #{ asd #qweqeqwe{} servername qweqweqweqweqwe; # comment {lalalal} #1 server { listen 8080 tls; root /data/up1; location / { l200; } location /qwe{ s 500; }#123 }#qweqwe servername wqeqweqwe; http { ## # Basic... | 2.969656 | 3 |
cocos2d/tools/jenkins-scripts/configs/cocos-2dx-develop-win32.py | triompha/EarthWarrior3D | 0 | 4514 | import os
import subprocess
import sys
print 'Build Config:'
print ' Host:win7 x86'
print ' Branch:develop'
print ' Target:win32'
print ' "%VS110COMNTOOLS%..\IDE\devenv.com" "build\cocos2d-win32.vc2012.sln" /Build "Debug|Win32"'
if(os.path.exists('build/cocos2d-win32.vc2012.sln') == False):
node_... | import os
import subprocess
import sys
print 'Build Config:'
print ' Host:win7 x86'
print ' Branch:develop'
print ' Target:win32'
print ' "%VS110COMNTOOLS%..\IDE\devenv.com" "build\cocos2d-win32.vc2012.sln" /Build "Debug|Win32"'
if(os.path.exists('build/cocos2d-win32.vc2012.sln') == False):
node_... | none | 1 | 2.01909 | 2 | |
iris_sdk/models/data/ord/rate_center_search_order.py | NumberAI/python-bandwidth-iris | 2 | 4515 | <filename>iris_sdk/models/data/ord/rate_center_search_order.py
#!/usr/bin/env python
from iris_sdk.models.base_resource import BaseData
from iris_sdk.models.maps.ord.rate_center_search_order import \
RateCenterSearchOrderMap
class RateCenterSearchOrder(RateCenterSearchOrderMap, BaseData):
pass | <filename>iris_sdk/models/data/ord/rate_center_search_order.py
#!/usr/bin/env python
from iris_sdk.models.base_resource import BaseData
from iris_sdk.models.maps.ord.rate_center_search_order import \
RateCenterSearchOrderMap
class RateCenterSearchOrder(RateCenterSearchOrderMap, BaseData):
pass | ru | 0.26433 | #!/usr/bin/env python | 1.555727 | 2 |
optimizer.py | thanusha22/CEC-1 | 0 | 4516 | <reponame>thanusha22/CEC-1
from pathlib import Path
import optimizers.PSO as pso
import optimizers.MVO as mvo
import optimizers.GWO as gwo
import optimizers.MFO as mfo
import optimizers.CS as cs
import optimizers.BAT as bat
import optimizers.WOA as woa
import optimizers.FFA as ffa
import optimizers.SSA as ssa
import o... | from pathlib import Path
import optimizers.PSO as pso
import optimizers.MVO as mvo
import optimizers.GWO as gwo
import optimizers.MFO as mfo
import optimizers.CS as cs
import optimizers.BAT as bat
import optimizers.WOA as woa
import optimizers.FFA as ffa
import optimizers.SSA as ssa
import optimizers.GA as ga
import op... | en | 0.733502 | It serves as the main interface of the framework for running the experiments. Parameters ---------- optimizer : list The list of optimizers names objectivefunc : list The list of benchmark functions NumOfRuns : int The number of independent runs params : set The... | 2.016714 | 2 |
tests/fields/test_primitive_types.py | slawak/dataclasses-avroschema | 0 | 4517 | import dataclasses
import pytest
from dataclasses_avroschema import fields
from . import consts
@pytest.mark.parametrize("primitive_type", fields.PYTHON_INMUTABLE_TYPES)
def test_primitive_types(primitive_type):
name = "a_field"
field = fields.Field(name, primitive_type, dataclasses.MISSING)
avro_type ... | import dataclasses
import pytest
from dataclasses_avroschema import fields
from . import consts
@pytest.mark.parametrize("primitive_type", fields.PYTHON_INMUTABLE_TYPES)
def test_primitive_types(primitive_type):
name = "a_field"
field = fields.Field(name, primitive_type, dataclasses.MISSING)
avro_type ... | none | 1 | 2.529388 | 3 | |
Bindings/Python/examples/Moco/examplePredictAndTrack.py | mcx/opensim-core | 532 | 4518 | <reponame>mcx/opensim-core
# -------------------------------------------------------------------------- #
# OpenSim Moco: examplePredictAndTrack.py #
# -------------------------------------------------------------------------- #
# Copyright (c) 2018 Stanford University and the Authors... | # -------------------------------------------------------------------------- #
# OpenSim Moco: examplePredictAndTrack.py #
# -------------------------------------------------------------------------- #
# Copyright (c) 2018 Stanford University and the Authors #
# ... | en | 0.741515 | # -------------------------------------------------------------------------- # # OpenSim Moco: examplePredictAndTrack.py # # -------------------------------------------------------------------------- # # Copyright (c) 2018 Stanford University and the Authors # # ... | 2.349186 | 2 |
StorageSystem.py | aaronFritz2302/ZoomAuto | 0 | 4519 | <gh_stars>0
import sqlite3
from pandas import DataFrame
conn = sqlite3.connect('./data.db',check_same_thread=False)
class DataBase():
cursor = conn.cursor()
def __init__(self):
self.createTable()
def createTable(self):
'''
Creates A Table If it Doesnt E... | import sqlite3
from pandas import DataFrame
conn = sqlite3.connect('./data.db',check_same_thread=False)
class DataBase():
cursor = conn.cursor()
def __init__(self):
self.createTable()
def createTable(self):
'''
Creates A Table If it Doesnt Exist
... | en | 0.263199 | Creates A Table If it Doesnt Exist CREATE TABLE IF NOT EXISTS MeetingData (Name text,ID text,Password text, DateTime text,Audio text,Video Text) Enters Data From The UI Table To The DataBase Reads Data From The SQL DataBase SELECT * FROM MeetingData | 3.799651 | 4 |
pymapd/_parsers.py | mflaxman10/pymapd | 0 | 4520 | """
Utility methods for parsing data returned from MapD
"""
import datetime
from collections import namedtuple
from sqlalchemy import text
import mapd.ttypes as T
from ._utils import seconds_to_time
Description = namedtuple("Description", ["name", "type_code", "display_size",
... | """
Utility methods for parsing data returned from MapD
"""
import datetime
from collections import namedtuple
from sqlalchemy import text
import mapd.ttypes as T
from ._utils import seconds_to_time
Description = namedtuple("Description", ["name", "type_code", "display_size",
... | en | 0.523759 | Utility methods for parsing data returned from MapD # type: (T.TColumnType, T.TDatum) -> Any # type: (T.TColumnType, T.TColumn) -> Any # type: (List[T.TColumnType]) -> List[Description] Return a tuple of (name, type_code, display_size, internal_size, precision, scale, null_ok) https://www.py... | 2.716197 | 3 |
featuretools/entityset/entity.py | rohit901/featuretools | 1 | 4521 | import logging
import warnings
import dask.dataframe as dd
import numpy as np
import pandas as pd
from featuretools import variable_types as vtypes
from featuretools.utils.entity_utils import (
col_is_datetime,
convert_all_variable_data,
convert_variable_data,
get_linked_vars,
infer_variable_types... | import logging
import warnings
import dask.dataframe as dd
import numpy as np
import pandas as pd
from featuretools import variable_types as vtypes
from featuretools.utils.entity_utils import (
col_is_datetime,
convert_all_variable_data,
convert_variable_data,
get_linked_vars,
infer_variable_types... | en | 0.643607 | Represents an entity in a Entityset, and stores relevant metadata and data An Entity is analogous to a table in a relational database See Also: :class:`.Relationship`, :class:`.Variable`, :class:`.EntitySet` Create Entity Args: id (str): Id of Entity. df (pd.DataFrame)... | 2.891881 | 3 |
githubdl/url_helpers.py | wilvk/githubdl | 16 | 4522 | <gh_stars>10-100
import re
from urllib.parse import urlparse
import logging
def check_url_is_http(repo_url):
predicate = re.compile('^https?://.*$')
match = predicate.search(repo_url)
return False if match is None else True
def check_url_is_ssh(repo_url):
predicate = re.compile(r'^git\@.*\.git$')
... | import re
from urllib.parse import urlparse
import logging
def check_url_is_http(repo_url):
predicate = re.compile('^https?://.*$')
match = predicate.search(repo_url)
return False if match is None else True
def check_url_is_ssh(repo_url):
predicate = re.compile(r'^git\@.*\.git$')
match = predicate... | none | 1 | 2.877995 | 3 | |
RECOVERED_FILES/root/ez-segway/simulator/ez_lib/cen_scheduler.py | AlsikeE/Ez | 0 | 4523 | <reponame>AlsikeE/Ez
import itertools
from ez_lib import ez_flow_tool
from collections import defaultdict
from ez_scheduler import EzScheduler
from ez_lib.ez_ob import CenUpdateInfo, UpdateNext
from misc import constants, logger
from domain.message import *
from collections import deque
from misc import global_vars
im... | import itertools
from ez_lib import ez_flow_tool
from collections import defaultdict
from ez_scheduler import EzScheduler
from ez_lib.ez_ob import CenUpdateInfo, UpdateNext
from misc import constants, logger
from domain.message import *
from collections import deque
from misc import global_vars
import time
import even... | en | 0.514963 | ########## Begin three properties are used for parallel processes ########## ########### End three properties are used for parallel processes ########### ########## Begin three properties are used for parallel processes ########## ########### End three properties are used for parallel processes ########### # self.log.i... | 2.032023 | 2 |
src/trackbar.py | clovadev/opencv-python | 0 | 4524 | <reponame>clovadev/opencv-python
import numpy as np
import cv2 as cv
def nothing(x):
pass
# Create a black image, a window
img = np.zeros((300, 512, 3), np.uint8)
cv.namedWindow('image')
# create trackbars for color change
cv.createTrackbar('R', 'image', 0, 255, nothing)
cv.createTrackbar('G', 'image', 0, 255,... | import numpy as np
import cv2 as cv
def nothing(x):
pass
# Create a black image, a window
img = np.zeros((300, 512, 3), np.uint8)
cv.namedWindow('image')
# create trackbars for color change
cv.createTrackbar('R', 'image', 0, 255, nothing)
cv.createTrackbar('G', 'image', 0, 255, nothing)
cv.createTrackbar('B', ... | ko | 0.372834 | # Create a black image, a window # create trackbars for color change # create switch for ON/OFF functionality # get current positions of four trackbars # 스위치가 꺼져 있으면 흑백, 켜져 있으면 색상 # 이미지 표시 | 3.224525 | 3 |
aoc_2015/src/day20.py | ambertests/adventofcode | 0 | 4525 | <reponame>ambertests/adventofcode
from functools import reduce
# https://stackoverflow.com/questions/6800193/what-is-the-most-efficient-way-of-finding-all-the-factors-of-a-number-in-python
def factors(n):
step = 2 if n%2 else 1
return set(reduce(list.__add__,
([i, n//i] for i in ran... | from functools import reduce
# https://stackoverflow.com/questions/6800193/what-is-the-most-efficient-way-of-finding-all-the-factors-of-a-number-in-python
def factors(n):
step = 2 if n%2 else 1
return set(reduce(list.__add__,
([i, n//i] for i in range(1, int(n**0.5)+1, step) if not ... | en | 0.792748 | # https://stackoverflow.com/questions/6800193/what-is-the-most-efficient-way-of-finding-all-the-factors-of-a-number-in-python # takes around 20s | 3.56355 | 4 |
setup.py | jean/labels | 1 | 4526 | <reponame>jean/labels<gh_stars>1-10
import pathlib
import setuptools
def read(*args: str) -> str:
file_path = pathlib.Path(__file__).parent.joinpath(*args)
return file_path.read_text("utf-8")
setuptools.setup(
name="labels",
version="0.3.0.dev0",
author="<NAME>",
author_email="<EMAIL>",
... | import pathlib
import setuptools
def read(*args: str) -> str:
file_path = pathlib.Path(__file__).parent.joinpath(*args)
return file_path.read_text("utf-8")
setuptools.setup(
name="labels",
version="0.3.0.dev0",
author="<NAME>",
author_email="<EMAIL>",
maintainer="<NAME>",
maintainer_... | none | 1 | 1.878022 | 2 | |
colab/__init__.py | caseywstark/colab | 1 | 4527 | <gh_stars>1-10
# -*- coding: utf-8 -*-
__about__ = """
This project demonstrates a social networking site. It provides profiles,
friends, photos, blogs, tribes, wikis, tweets, bookmarks, swaps,
locations and user-to-user messaging.
In 0.5 this was called "complete_project".
"""
| # -*- coding: utf-8 -*-
__about__ = """
This project demonstrates a social networking site. It provides profiles,
friends, photos, blogs, tribes, wikis, tweets, bookmarks, swaps,
locations and user-to-user messaging.
In 0.5 this was called "complete_project".
""" | en | 0.850903 | # -*- coding: utf-8 -*- This project demonstrates a social networking site. It provides profiles,
friends, photos, blogs, tribes, wikis, tweets, bookmarks, swaps,
locations and user-to-user messaging.
In 0.5 this was called "complete_project". | 1.481658 | 1 |
src/ralph/ui/forms/util.py | quamilek/ralph | 0 | 4528 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from ralph.business.models import Venture, VentureRole
def all_ventures():
yield '', '---------'
for v in Venture.objects.filter(show_in... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from ralph.business.models import Venture, VentureRole
def all_ventures():
yield '', '---------'
for v in Venture.objects.filter(show_in... | en | 0.419042 | # -*- coding: utf-8 -*- # u00A0 == 'no-break space' | 2.067998 | 2 |
tests/syntax/missing_in_with_for.py | matan-h/friendly | 287 | 4529 | <filename>tests/syntax/missing_in_with_for.py
for x range(4):
print(x)
| <filename>tests/syntax/missing_in_with_for.py
for x range(4):
print(x)
| none | 1 | 1.716395 | 2 | |
services/users/manage.py | eventprotocol/event-protocol-webapp | 0 | 4530 | """
manage.py for flask application
"""
import unittest
import coverage
import os
from flask.cli import FlaskGroup
from project import create_app, db
from project.api.models import User
# Code coverage
COV = coverage.Coverage(
branch=True,
include='project/*',
omit=[
'project/tests/*',
'p... | """
manage.py for flask application
"""
import unittest
import coverage
import os
from flask.cli import FlaskGroup
from project import create_app, db
from project.api.models import User
# Code coverage
COV = coverage.Coverage(
branch=True,
include='project/*',
omit=[
'project/tests/*',
'p... | en | 0.948874 | manage.py for flask application # Code coverage Runs the unit tests with coverage Destroys all db and recreates a new db Runs test without code coverage Seeds the database with some initial data This is the best meeting space you will ever see We sell space We are not buying Reimagine your looks with us We are serving ... | 2.682455 | 3 |
keras_transformer/keras_transformer/training/custom_callbacks/CustomCheckpointer.py | erelcan/keras-transformer | 3 | 4531 | <gh_stars>1-10
import os
from keras.callbacks import ModelCheckpoint
from keras_transformer.training.custom_callbacks.CustomCallbackABC import CustomCallbackABC
from keras_transformer.utils.io_utils import save_to_pickle
class CustomCheckpointer(ModelCheckpoint, CustomCallbackABC):
def __init__(self, workspace_p... | import os
from keras.callbacks import ModelCheckpoint
from keras_transformer.training.custom_callbacks.CustomCallbackABC import CustomCallbackABC
from keras_transformer.utils.io_utils import save_to_pickle
class CustomCheckpointer(ModelCheckpoint, CustomCallbackABC):
def __init__(self, workspace_path, artifacts,... | none | 1 | 2.212389 | 2 | |
train_test_val.py | arashk7/Yolo5_Dataset_Generator | 0 | 4532 | import os
import shutil
input_dir = 'E:\Dataset\zhitang\Dataset_Zhitang_Yolo5'
output_dir = 'E:\Dataset\zhitang\Dataset_Zhitang_Yolo5\ZhitangYolo5'
in_img_dir = os.path.join(input_dir, 'Images')
in_label_dir = os.path.join(input_dir, 'Labels')
out_img_dir = os.path.join(output_dir, 'images')
out_label_dir = os.path.jo... | import os
import shutil
input_dir = 'E:\Dataset\zhitang\Dataset_Zhitang_Yolo5'
output_dir = 'E:\Dataset\zhitang\Dataset_Zhitang_Yolo5\ZhitangYolo5'
in_img_dir = os.path.join(input_dir, 'Images')
in_label_dir = os.path.join(input_dir, 'Labels')
out_img_dir = os.path.join(output_dir, 'images')
out_label_dir = os.path.jo... | none | 1 | 2.50493 | 3 | |
homeassistant/components/media_player/pjlink.py | dauden1184/home-assistant | 4 | 4533 | """
Support for controlling projector via the PJLink protocol.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.pjlink/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
PLATFORM_SCHEMA, SUPP... | """
Support for controlling projector via the PJLink protocol.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.pjlink/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
PLATFORM_SCHEMA, SUPP... | en | 0.717062 | Support for controlling projector via the PJLink protocol. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.pjlink/ Set up the PJLink platform. Format input source for display in UI. Representation of a PJLink device. Iinitialize the PJLink de... | 2.336952 | 2 |
leetcode/regex_matching.py | Kaushalya/algo_journal | 0 | 4534 | <reponame>Kaushalya/algo_journal
# Level: Hard
def isMatch(s: str, p: str) -> bool:
if not p:
return not s
n_s = len(s)
n_p = len(p)
j = 0
i = -1
while i < n_s-1:
i = i+ 1
if j >= n_p:
return False
if p[j] == '*':
while s[i]==s[i-1]:
... | # Level: Hard
def isMatch(s: str, p: str) -> bool:
if not p:
return not s
n_s = len(s)
n_p = len(p)
j = 0
i = -1
while i < n_s-1:
i = i+ 1
if j >= n_p:
return False
if p[j] == '*':
while s[i]==s[i-1]:
i += 1
j... | en | 0.55005 | # Level: Hard # continue | 3.59614 | 4 |
tests/factories.py | luzik/waliki | 324 | 4535 | <reponame>luzik/waliki<filename>tests/factories.py
import factory
from django.contrib.auth.models import User, Group, Permission
from waliki.models import ACLRule, Page, Redirect
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: u'user{0}'.format(n))
password = factor... | import factory
from django.contrib.auth.models import User, Group, Permission
from waliki.models import ACLRule, Page, Redirect
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: u'user{0}'.format(n))
password = factory.PostGenerationMethodCall('set_password', '<PASSWO... | en | 0.982166 | # Simple build, do nothing. # A list of groups were passed in, use them #%s" % n) # Simple build, do nothing. # A list of groups were passed in, use them # Simple build, do nothing. # A list of groups were passed in, use them # Simple build, do nothing. # A list of groups were passed in, use them # Simple build, do not... | 2.239375 | 2 |
nxt_editor/commands.py | dalteocraft/nxt_editor | 131 | 4536 | # Built-in
import copy
import logging
import time
# External
from Qt.QtWidgets import QUndoCommand
# Internal
from nxt_editor import colors
from nxt_editor import user_dir
from nxt import nxt_path
from nxt.nxt_layer import LAYERS, SAVE_KEY
from nxt.nxt_node import (INTERNAL_ATTRS, META_ATTRS, get_node_as_dict,
... | # Built-in
import copy
import logging
import time
# External
from Qt.QtWidgets import QUndoCommand
# Internal
from nxt_editor import colors
from nxt_editor import user_dir
from nxt import nxt_path
from nxt.nxt_layer import LAYERS, SAVE_KEY
from nxt.nxt_node import (INTERNAL_ATTRS, META_ATTRS, get_node_as_dict,
... | en | 0.862943 | # Built-in # External # Internal Gets the effected state for a given layer with context to this command. Since a single command can effect layers in different ways. :param layer_path: string of layer real path :return: (bool, bool) | (first_effected_by_undo, first_effected_by_redo) When the mod... | 2.242468 | 2 |
mietrechtspraxis/mietrechtspraxis/doctype/arbitration_authority/arbitration_authority.py | libracore/mietrechtspraxis | 1 | 4537 | # -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore AG and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from datetime import datetime
from PyPDF2 import PdfFileWriter
from frappe.utils.file_manager im... | # -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore AG and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from datetime import datetime
from PyPDF2 import PdfFileWriter
from frappe.utils.file_manager im... | de | 0.244687 | # -*- coding: utf-8 -*- # Copyright (c) 2021, libracore AG and contributors # For license information, please see license.txt call on [IP]/api/method/mietrechtspraxis.api.get_sb Mandatory Parameter: - token - plz # check that token is present # 400 Bad Request (Missing Token) # check that token is c... | 2.366243 | 2 |
easysockets/client_socket.py | Matthias1590/EasySockets | 2 | 4538 | from .connection import Connection
import socket
class ClientSocket:
def __init__(self) -> None:
self.__socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def connect(self, host: str, port: int) -> Connection:
self.__socket.connect((host, port))
return Connection(self.__socke... | from .connection import Connection
import socket
class ClientSocket:
def __init__(self) -> None:
self.__socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def connect(self, host: str, port: int) -> Connection:
self.__socket.connect((host, port))
return Connection(self.__socke... | none | 1 | 3.055594 | 3 | |
pxr/usd/usdGeom/testenv/testUsdGeomSchemata.py | yurivict/USD | 1 | 4539 | #!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | #!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | en | 0.847874 | #!/pxrpythonsubst # # Copyright 2017 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ... | 1.955492 | 2 |
round_robin_generator/matchup_times.py | avadavat/round_robin_generator | 0 | 4540 | import pandas as pd
from datetime import timedelta
def generate_times(matchup_df: pd.DataFrame, tournament_start_time, game_duration, game_stagger):
time_df = pd.DataFrame(index=matchup_df.index, columns=matchup_df.columns)
if game_stagger == 0:
for round_num in range(time_df.shape[0]):
ro... | import pandas as pd
from datetime import timedelta
def generate_times(matchup_df: pd.DataFrame, tournament_start_time, game_duration, game_stagger):
time_df = pd.DataFrame(index=matchup_df.index, columns=matchup_df.columns)
if game_stagger == 0:
for round_num in range(time_df.shape[0]):
ro... | en | 0.955553 | # Given the algorithm, at worst every player can play every (game duration + stagger time) # This is b/c your opponent begins play one stagger count after you at the latest. | 2.977309 | 3 |
src/commands/locate_item.py | seisatsu/DennisMUD-ESP32 | 19 | 4541 | <reponame>seisatsu/DennisMUD-ESP32<filename>src/commands/locate_item.py
#######################
# <NAME> #
# locate_item.py #
# Copyright 2018-2020 #
# <NAME> #
#######################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and ass... | #######################
# <NAME> #
# locate_item.py #
# Copyright 2018-2020 #
# <NAME> #
#######################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software ... | en | 0.794838 | ####################### # <NAME> # # locate_item.py # # Copyright 2018-2020 # # <NAME> # ####################### # ********** # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software w... | 2.403082 | 2 |
modelling/scsb/models/monthly-comparisons.py | bcgov-c/wally | 0 | 4542 | <filename>modelling/scsb/models/monthly-comparisons.py
import json
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestRegressor
from sklearn.tree import DecisionTreeRegressor
from xgboost import XGBRegressor
from catboost import... | <filename>modelling/scsb/models/monthly-comparisons.py
import json
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestRegressor
from sklearn.tree import DecisionTreeRegressor
from xgboost import XGBRegressor
from catboost import... | en | 0.699757 | # with open('../../data/output/training_data/annual_mean_training_dataset_08-11-2020.json', 'r') as f: # data = json.load(f) # calculate monthly estimations for 3 models # compare the outputs of scsb against the 3 models | 2.531964 | 3 |
src/week2-mlflow/AutoML/XGBoost-fake-news-automl.py | xzhnshng/databricks-zero-to-mlops | 0 | 4543 | # Databricks notebook source
# MAGIC %md
# MAGIC # XGBoost training
# MAGIC This is an auto-generated notebook. To reproduce these results, attach this notebook to the **10-3-ML-Cluster** cluster and rerun it.
# MAGIC - Compare trials in the [MLflow experiment](#mlflow/experiments/406583024052808/s?orderByKey=metrics.%... | # Databricks notebook source
# MAGIC %md
# MAGIC # XGBoost training
# MAGIC This is an auto-generated notebook. To reproduce these results, attach this notebook to the **10-3-ML-Cluster** cluster and rerun it.
# MAGIC - Compare trials in the [MLflow experiment](#mlflow/experiments/406583024052808/s?orderByKey=metrics.%... | en | 0.674775 | # Databricks notebook source # MAGIC %md # MAGIC # XGBoost training # MAGIC This is an auto-generated notebook. To reproduce these results, attach this notebook to the **10-3-ML-Cluster** cluster and rerun it. # MAGIC - Compare trials in the [MLflow experiment](#mlflow/experiments/406583024052808/s?orderByKey=metrics.%... | 2.250176 | 2 |
lucky_guess/__init__.py | mfinzi/lucky-guess-chemist | 0 | 4544 |
import importlib
import pkgutil
__all__ = []
for loader, module_name, is_pkg in pkgutil.walk_packages(__path__):
module = importlib.import_module('.'+module_name,package=__name__)
try:
globals().update({k: getattr(module, k) for k in module.__all__})
__all__ += module.__all__
except Att... |
import importlib
import pkgutil
__all__ = []
for loader, module_name, is_pkg in pkgutil.walk_packages(__path__):
module = importlib.import_module('.'+module_name,package=__name__)
try:
globals().update({k: getattr(module, k) for k in module.__all__})
__all__ += module.__all__
except Att... | none | 1 | 2.08649 | 2 | |
shuffling_algorithm.py | BaptisteLafoux/aztec_tiling | 0 | 4545 | <filename>shuffling_algorithm.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 22:04:48 2020
@author: baptistelafoux
"""
import domino
import numpy as np
import numpy.lib.arraysetops as aso
def spawn_block(x, y):
if np.random.rand() > 0.5:
d1 = domino.domino(np.array([x, ... | <filename>shuffling_algorithm.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 22:04:48 2020
@author: baptistelafoux
"""
import domino
import numpy as np
import numpy.lib.arraysetops as aso
def spawn_block(x, y):
if np.random.rand() > 0.5:
d1 = domino.domino(np.array([x, ... | en | 0.538777 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Dec 30 22:04:48 2020 @author: baptistelafoux | 3.068167 | 3 |
scripts/matrix_operations.py | h3ct0r/gas_mapping_example | 1 | 4546 | import numpy as np
def get_position_of_minimum(matrix):
return np.unravel_index(np.nanargmin(matrix), matrix.shape)
def get_position_of_maximum(matrix):
return np.unravel_index(np.nanargmax(matrix), matrix.shape)
def get_distance_matrix(cell_grid_x, cell_grid_y, x, y):
return np.sqrt((x - cell_grid_x)... | import numpy as np
def get_position_of_minimum(matrix):
return np.unravel_index(np.nanargmin(matrix), matrix.shape)
def get_position_of_maximum(matrix):
return np.unravel_index(np.nanargmax(matrix), matrix.shape)
def get_distance_matrix(cell_grid_x, cell_grid_y, x, y):
return np.sqrt((x - cell_grid_x)... | none | 1 | 2.972148 | 3 | |
ShanghaiPower/build_up.py | biljiang/pyprojects | 0 | 4547 | <gh_stars>0
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize(["license_chk.py"]))
| from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize(["license_chk.py"])) | none | 1 | 1.197877 | 1 | |
quantum/plugins/nicira/extensions/nvp_qos.py | yamt/neutron | 0 | 4548 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | en | 0.779465 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Nicira, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/lice... | 2.014259 | 2 |
easyneuron/math/__init__.py | TrendingTechnology/easyneuron | 1 | 4549 | <reponame>TrendingTechnology/easyneuron
"""easyneuron.math contains all of the maths tools that you'd ever need for your AI projects, when used alongside Numpy.
To suggest more to be added, please add an issue on the GitHub repo.
"""
from easyneuron.math.distance import euclidean_distance | """easyneuron.math contains all of the maths tools that you'd ever need for your AI projects, when used alongside Numpy.
To suggest more to be added, please add an issue on the GitHub repo.
"""
from easyneuron.math.distance import euclidean_distance | en | 0.921172 | easyneuron.math contains all of the maths tools that you'd ever need for your AI projects, when used alongside Numpy. To suggest more to be added, please add an issue on the GitHub repo. | 1.785511 | 2 |
tests/unit/concurrently/test_TaskPackageDropbox_put.py | shane-breeze/AlphaTwirl | 0 | 4550 | <reponame>shane-breeze/AlphaTwirl
# <NAME> <<EMAIL>>
import pytest
try:
import unittest.mock as mock
except ImportError:
import mock
from alphatwirl.concurrently import TaskPackageDropbox
##__________________________________________________________________||
@pytest.fixture()
def workingarea():
return mo... | # <NAME> <<EMAIL>>
import pytest
try:
import unittest.mock as mock
except ImportError:
import mock
from alphatwirl.concurrently import TaskPackageDropbox
##__________________________________________________________________||
@pytest.fixture()
def workingarea():
return mock.MagicMock()
@pytest.fixture()
... | en | 0.166226 | # <NAME> <<EMAIL>> ##__________________________________________________________________|| ##__________________________________________________________________|| # pkgidx # runid # pkgidx # runid ##__________________________________________________________________|| | 2.190953 | 2 |
networking_odl/tests/unit/dhcp/test_odl_dhcp_driver.py | gokarslan/networking-odl2 | 0 | 4551 | # Copyright (c) 2017 OpenStack Foundation
# 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 ... | # Copyright (c) 2017 OpenStack Foundation
# 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 ... | en | 0.850673 | # Copyright (c) 2017 OpenStack Foundation # 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 ... | 1.94665 | 2 |
users/migrations/0002_auto_20191113_1352.py | Dragonite/djangohat | 2 | 4552 | # Generated by Django 2.2.2 on 2019-11-13 13:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='users',
name='site_key',
fi... | # Generated by Django 2.2.2 on 2019-11-13 13:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='users',
name='site_key',
fi... | en | 0.72807 | # Generated by Django 2.2.2 on 2019-11-13 13:52 | 1.616634 | 2 |
premium/backend/src/baserow_premium/api/admin/dashboard/views.py | cjh0613/baserow | 839 | 4553 | <reponame>cjh0613/baserow
from datetime import timedelta
from django.contrib.auth import get_user_model
from drf_spectacular.utils import extend_schema
from rest_framework.response import Response
from rest_framework.permissions import IsAdminUser
from rest_framework.views import APIView
from baserow.api.decorators... | from datetime import timedelta
from django.contrib.auth import get_user_model
from drf_spectacular.utils import extend_schema
from rest_framework.response import Response
from rest_framework.permissions import IsAdminUser
from rest_framework.views import APIView
from baserow.api.decorators import accept_timezone
fr... | en | 0.874891 | Returns the new and active users for the last 24 hours, 7 days and 30 days. The `previous_` values are the values of the period before, so for example `previous_new_users_last_24_hours` are the new users that signed up from 48 to 24 hours ago. It can be used to calculate an increase or decrease ... | 2.28471 | 2 |
src/clientOld.py | dan3612812/socketChatRoom | 0 | 4554 | # -*- coding: UTF-8 -*-
import sys
import socket
import time
import threading
import select
HOST = '192.168.11.98'
PORT = int(sys.argv[1])
queue = []
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
queue.append(s)
print("add client to queue")
def socketRecv():
while True:
... | # -*- coding: UTF-8 -*-
import sys
import socket
import time
import threading
import select
HOST = '192.168.11.98'
PORT = int(sys.argv[1])
queue = []
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
queue.append(s)
print("add client to queue")
def socketRecv():
while True:
... | en | 0.152644 | # -*- coding: UTF-8 -*- # inputThread = Thread(target=inputJob) # inputThread.start() # s.close() # 關閉連線 # socketThread.join() # inputThread.join() | 3.017425 | 3 |
plugins/anomali_threatstream/komand_anomali_threatstream/actions/import_observable/schema.py | lukaszlaszuk/insightconnect-plugins | 46 | 4555 | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Import observable(s) into Anomali ThreatStream with approval"
class Input:
FILE = "file"
OBSERVABLE_SETTINGS = "observable_settings"
class Output:
RESULTS = "results"
class ImportObservableI... | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Import observable(s) into Anomali ThreatStream with approval"
class Input:
FILE = "file"
OBSERVABLE_SETTINGS = "observable_settings"
class Output:
RESULTS = "results"
class ImportObservableI... | en | 0.464882 | # GENERATED BY KOMAND SDK - DO NOT EDIT { "type": "object", "title": "Variables", "properties": { "file": { "$ref": "#/definitions/file", "title": "File", "description": "File of data to be imported into Anomali ThreatStream", "order": 1 }, "observable_settings": { "$ref"... | 2.482971 | 2 |
trove/tests/unittests/quota/test_quota.py | citrix-openstack-build/trove | 0 | 4556 | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | en | 0.844262 | # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l... | 1.909539 | 2 |
analisador_sintatico/blueprints/api/parsers.py | viniciusandd/uri-analisador-sintatico | 0 | 4557 | from flask_restful import reqparse
def retornar_parser():
parser = reqparse.RequestParser()
parser.add_argument('sentenca', type=str, required=True)
return parser
| from flask_restful import reqparse
def retornar_parser():
parser = reqparse.RequestParser()
parser.add_argument('sentenca', type=str, required=True)
return parser
| none | 1 | 2.236321 | 2 | |
demo_large_image.py | gunlyungyou/AerialDetection | 9 | 4558 | <reponame>gunlyungyou/AerialDetection<filename>demo_large_image.py<gh_stars>1-10
from mmdet.apis import init_detector, inference_detector, show_result, draw_poly_detections
import mmcv
from mmcv import Config
from mmdet.datasets import get_dataset
import cv2
import os
import numpy as np
from tqdm import tqdm
import DOT... | from mmdet.apis import init_detector, inference_detector, show_result, draw_poly_detections
import mmcv
from mmcv import Config
from mmdet.datasets import get_dataset
import cv2
import os
import numpy as np
from tqdm import tqdm
import DOTA_devkit.polyiou as polyiou
import math
import pdb
CLASS_NAMES_KR = ('소형 선박', '대... | en | 0.209269 | # init RoITransformer # TODO: check the corner case # import pdb; pdb.set_trace() # print('i: ', i, 'j: ', j) # print('result: ', result) # import pdb;pdb.set_trace() # nms #roitransformer = DetectorModel(r'configs/DOTA/faster_rcnn_RoITrans_r50_fpn_1x_dota.py', # r'work_dirs/faster_rcnn_RoITrans_r50_fpn_1x... | 2.008017 | 2 |
ImageSearcher/admin.py | carpensa/dicom-harpooner | 1 | 4559 | from django.contrib import admin
from dicoms.models import Subject
from dicoms.models import Session
from dicoms.models import Series
admin.site.register(Session)
admin.site.register(Subject)
admin.site.register(Series)
| from django.contrib import admin
from dicoms.models import Subject
from dicoms.models import Session
from dicoms.models import Series
admin.site.register(Session)
admin.site.register(Subject)
admin.site.register(Series)
| none | 1 | 1.134231 | 1 | |
src/djangoreactredux/wsgi.py | noscripter/django-react-redux-jwt-base | 4 | 4560 | <filename>src/djangoreactredux/wsgi.py
"""
WSGI config for django-react-redux-jwt-base project.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoreactredux.settings.dev")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
application = get_wsgi_appli... | <filename>src/djangoreactredux/wsgi.py
"""
WSGI config for django-react-redux-jwt-base project.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoreactredux.settings.dev")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
application = get_wsgi_appli... | en | 0.491599 | WSGI config for django-react-redux-jwt-base project. | 1.294849 | 1 |
simple_settings/dynamic_settings/base.py | matthewh/simple-settings | 0 | 4561 | <gh_stars>0
# -*- coding: utf-8 -*-
import re
from copy import deepcopy
import jsonpickle
class BaseReader(object):
"""
Base class for dynamic readers
"""
_default_conf = {}
def __init__(self, conf):
self.conf = deepcopy(self._default_conf)
self.conf.update(conf)
self.key... | # -*- coding: utf-8 -*-
import re
from copy import deepcopy
import jsonpickle
class BaseReader(object):
"""
Base class for dynamic readers
"""
_default_conf = {}
def __init__(self, conf):
self.conf = deepcopy(self._default_conf)
self.conf.update(conf)
self.key_pattern = s... | en | 0.658018 | # -*- coding: utf-8 -*- Base class for dynamic readers Prepends the configured prefix to the key (if applicable). :param key: The unprefixed key. :return: The key with any configured prefix prepended. | 2.784909 | 3 |
scripts/map_frame_to_utm_tf_publisher.py | coincar-sim/lanelet2_interface_ros | 7 | 4562 | #!/usr/bin/env python
#
# Copyright (c) 2018
# FZI Forschungszentrum Informatik, Karlsruhe, Germany (www.fzi.de)
# KIT, Institute of Measurement and Control, Karlsruhe, Germany (www.mrt.kit.edu)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted p... | #!/usr/bin/env python
#
# Copyright (c) 2018
# FZI Forschungszentrum Informatik, Karlsruhe, Germany (www.fzi.de)
# KIT, Institute of Measurement and Control, Karlsruhe, Germany (www.mrt.kit.edu)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted p... | en | 0.690297 | #!/usr/bin/env python # # Copyright (c) 2018 # FZI Forschungszentrum Informatik, Karlsruhe, Germany (www.fzi.de) # KIT, Institute of Measurement and Control, Karlsruhe, Germany (www.mrt.kit.edu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted p... | 1.404683 | 1 |
lectures/05-python-intro/examples/argv.py | mattmiller899/biosys-analytics | 14 | 4563 | #!/usr/bin/env python3
import sys
print(sys.argv)
| #!/usr/bin/env python3
import sys
print(sys.argv)
| fr | 0.221828 | #!/usr/bin/env python3 | 1.514919 | 2 |
tests/fixtures.py | easyas314159/cnftools | 0 | 4564 | <gh_stars>0
from itertools import chain
def make_comparable(*clauses):
return set((frozenset(c) for c in chain(*clauses)))
def count_clauses(*clauses):
total = 0
for subclauses in clauses:
total += len(subclauses)
return total
def unique_literals(*clauses):
literals = set()
for clause in chain(*clauses):
l... | from itertools import chain
def make_comparable(*clauses):
return set((frozenset(c) for c in chain(*clauses)))
def count_clauses(*clauses):
total = 0
for subclauses in clauses:
total += len(subclauses)
return total
def unique_literals(*clauses):
literals = set()
for clause in chain(*clauses):
literals.upda... | none | 1 | 3.228983 | 3 | |
applications/FluidDynamicsApplication/tests/sod_shock_tube_test.py | Rodrigo-Flo/Kratos | 0 | 4565 | # Import kratos core and applications
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics.kratos_utilities as KratosUtilities
from KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis import FluidDynamicsAnalysis
class SodShockTubeTest(KratosUni... | # Import kratos core and applications
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics.kratos_utilities as KratosUtilities
from KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis import FluidDynamicsAnalysis
class SodShockTubeTest(KratosUni... | en | 0.319237 | # Import kratos core and applications # Read the simulation settings # If required, add the output process to the test settings # If required, add the reference values output process to the test settings # Create the test simulation # Customize simulation settings { "python_module" : "gid_output_process", ... | 1.926205 | 2 |
src/controllers/__init__.py | TonghanWang/NDQ | 63 | 4566 | from .basic_controller import BasicMAC
from .cate_broadcast_comm_controller import CateBCommMAC
from .cate_broadcast_comm_controller_full import CateBCommFMAC
from .cate_broadcast_comm_controller_not_IB import CateBCommNIBMAC
from .tar_comm_controller import TarCommMAC
from .cate_pruned_broadcast_comm_controller import... | from .basic_controller import BasicMAC
from .cate_broadcast_comm_controller import CateBCommMAC
from .cate_broadcast_comm_controller_full import CateBCommFMAC
from .cate_broadcast_comm_controller_not_IB import CateBCommNIBMAC
from .tar_comm_controller import TarCommMAC
from .cate_pruned_broadcast_comm_controller import... | none | 1 | 1.313562 | 1 | |
main.py | 1999foxes/run-cmd-from-websocket | 0 | 4567 | import asyncio
import json
import logging
import websockets
logging.basicConfig()
async def counter(websocket, path):
try:
print("connect")
async for message in websocket:
print(message)
finally:
USERS.remove(websocket)
async def main():
async with websockets.serve(c... | import asyncio
import json
import logging
import websockets
logging.basicConfig()
async def counter(websocket, path):
try:
print("connect")
async for message in websocket:
print(message)
finally:
USERS.remove(websocket)
async def main():
async with websockets.serve(c... | en | 0.156018 | # run forever | 2.790567 | 3 |
3d_Vnet/3dvnet.py | GingerSpacetail/Brain-Tumor-Segmentation-and-Survival-Prediction-using-Deep-Neural-Networks | 100 | 4568 | <filename>3d_Vnet/3dvnet.py
import random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import tensorflow as tf
import keras.backend as K
from keras.utils import to_categorical
from keras import metrics
from keras.models import Model, load_model
from keras.layers i... | <filename>3d_Vnet/3dvnet.py
import random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import tensorflow as tf
import keras.backend as K
from keras.utils import to_categorical
from keras import metrics
from keras.models import Model, load_model
from keras.layers i... | en | 0.378047 | #%matplotlib inline # from medpy.io import load #import cv2 #c1 = conv_block(input_img,n_filters,3,batch_norm) #c1 = add([c1,input_img]) #c6 = conv_block(p5, n_filters*8,5,True) #p6 = Conv3D(n_filters*16,kernel_size = (2,2,2) , strides = (2,2,2) , padding='same')(c6) #c9 = conv_block(u9,n_filters,3,batch_norm) | 2.134141 | 2 |
vk/types/additional/active_offer.py | Inzilkin/vk.py | 24 | 4569 | from ..base import BaseModel
# returned from https://vk.com/dev/account.getActiveOffers
class ActiveOffer(BaseModel):
id: str = None
title: str = None
instruction: str = None
instruction_html: str = None
short_description: str = None
description: str = None
img: str = None
tag: str = ... | from ..base import BaseModel
# returned from https://vk.com/dev/account.getActiveOffers
class ActiveOffer(BaseModel):
id: str = None
title: str = None
instruction: str = None
instruction_html: str = None
short_description: str = None
description: str = None
img: str = None
tag: str = ... | en | 0.845386 | # returned from https://vk.com/dev/account.getActiveOffers | 1.693942 | 2 |
lib/networks/Resnet50_train.py | yangxue0827/TF_Deformable_Net | 193 | 4570 | <reponame>yangxue0827/TF_Deformable_Net
# --------------------------------------------------------
# TFFRCNN - Resnet50
# Copyright (c) 2016
# Licensed under The MIT License [see LICENSE for details]
# Written by miraclebiu
# --------------------------------------------------------
import tensorflow as tf
from .networ... | # --------------------------------------------------------
# TFFRCNN - Resnet50
# Copyright (c) 2016
# Licensed under The MIT License [see LICENSE for details]
# Written by miraclebiu
# --------------------------------------------------------
import tensorflow as tf
from .network import Network
from ..fast_rcnn.config... | en | 0.366395 | # -------------------------------------------------------- # TFFRCNN - Resnet50 # Copyright (c) 2016 # Licensed under The MIT License [see LICENSE for details] # Written by miraclebiu # -------------------------------------------------------- # anchor_scales = [8, 16, 32] #========= RPN ============ # Loss of rpn_cls &... | 2.064142 | 2 |
lib/aws_sso_lib/assignments.py | vdesjardins/aws-sso-util | 330 | 4571 | import re
import numbers
import collections
import logging
from collections.abc import Iterable
import itertools
import aws_error_utils
from .lookup import Ids, lookup_accounts_for_ou
from .format import format_account_id
LOGGER = logging.getLogger(__name__)
_Context = collections.namedtuple("_Context", [
"sess... | import re
import numbers
import collections
import logging
from collections.abc import Iterable
import itertools
import aws_error_utils
from .lookup import Ids, lookup_accounts_for_ou
from .format import format_account_id
LOGGER = logging.getLogger(__name__)
_Context = collections.namedtuple("_Context", [
"sess... | en | 0.762889 | # if context.get_target_names: # organizations_client = context.session.client("organizations") # ou = organizations_client.describe_organizational_unit(OrganizationalUnitId=target[1])["OrganizationalUnit"] # if ou.get("Name"): # target_name = ou("Name") Iterate over AWS SSO assignments. Args: ... | 2.22112 | 2 |
solutions/pic_search/webserver/src/service/theardpool.py | naetimus/bootcamp | 1 | 4572 | <reponame>naetimus/bootcamp<filename>solutions/pic_search/webserver/src/service/theardpool.py
import threading
from concurrent.futures import ThreadPoolExecutor
from service.train import do_train
def thread_runner(thread_num, func, *args):
executor = ThreadPoolExecutor(thread_num)
f = executor.submit(do_train... | import threading
from concurrent.futures import ThreadPoolExecutor
from service.train import do_train
def thread_runner(thread_num, func, *args):
executor = ThreadPoolExecutor(thread_num)
f = executor.submit(do_train, *args) | none | 1 | 2.501651 | 3 | |
buildutil/main.py | TediCreations/buildutils | 0 | 4573 | #!/usr/bin/env python3
import os
import argparse
import subprocess
if __name__ == '__main__':
from version import __version__
from configParser import ConfigParser
else:
from .version import __version__
from .configParser import ConfigParser
def command(cmd):
"""Run a shell command"""
subprocess.call(cmd, sh... | #!/usr/bin/env python3
import os
import argparse
import subprocess
if __name__ == '__main__':
from version import __version__
from configParser import ConfigParser
else:
from .version import __version__
from .configParser import ConfigParser
def command(cmd):
"""Run a shell command"""
subprocess.call(cmd, sh... | en | 0.132647 | #!/usr/bin/env python3 Run a shell command cmd_split = cmd.split() process = subprocess.Popen(cmd_split, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) stdout, stderr = process.communicate() return stdout, stderr # parser.add_argument('-v', '--verbose', # ... | 2.64358 | 3 |
python/get_links.py | quiddity-wp/mediawiki-api-demos | 63 | 4574 | <filename>python/get_links.py
#This file is auto-generated. See modules.json and autogenerator.py for details
#!/usr/bin/python3
"""
get_links.py
MediaWiki API Demos
Demo of `Links` module: Get all links on the given page(s)
MIT License
"""
import requests
S = requests.Session()
URL = "https://en... | <filename>python/get_links.py
#This file is auto-generated. See modules.json and autogenerator.py for details
#!/usr/bin/python3
"""
get_links.py
MediaWiki API Demos
Demo of `Links` module: Get all links on the given page(s)
MIT License
"""
import requests
S = requests.Session()
URL = "https://en... | en | 0.327635 | #This file is auto-generated. See modules.json and autogenerator.py for details #!/usr/bin/python3 get_links.py MediaWiki API Demos Demo of `Links` module: Get all links on the given page(s) MIT License | 3.193562 | 3 |
gautools/submit_gaussian.py | thompcinnamon/QM-calc-scripts | 0 | 4575 | <reponame>thompcinnamon/QM-calc-scripts<filename>gautools/submit_gaussian.py<gh_stars>0
#! /usr/bin/env python3
########################################################################
# #
# This script was written by <NAME> in 2015. ... | #! /usr/bin/env python3
########################################################################
# #
# This script was written by <NAME> in 2015. #
# <EMAIL> <EMAIL> #
# ... | en | 0.83204 | #! /usr/bin/env python3 ######################################################################## # # # This script was written by <NAME> in 2015. # # <EMAIL> <EMAIL> # # ... | 2.060936 | 2 |
experiments/recorder.py | WeiChengTseng/maddpg | 3 | 4576 | import json
import copy
import pdb
import numpy as np
import pickle
def listify_mat(matrix):
matrix = np.array(matrix).astype(str)
if len(matrix.shape) > 1:
matrix_list = []
for row in matrix:
try:
matrix_list.append(list(row))
except:
pd... | import json
import copy
import pdb
import numpy as np
import pickle
def listify_mat(matrix):
matrix = np.array(matrix).astype(str)
if len(matrix.shape) > 1:
matrix_list = []
for row in matrix:
try:
matrix_list.append(list(row))
except:
pd... | en | 0.119925 | # self._cur_traj.append((o, a, r, d)) # pdb.set_trace() # json.dumps(traj, sort_keys=True, indent=4) | 2.659916 | 3 |
generate/dummy_data/mvp/gen_csv.py | ifekxp/data | 0 | 4577 | <reponame>ifekxp/data
from faker import Faker
import csv
# Reference: https://pypi.org/project/Faker/
output = open('data.CSV', 'w', newline='')
fake = Faker()
header = ['name', 'age', 'street', 'city', 'state', 'zip', 'lng', 'lat']
mywriter=csv.writer(output)
mywriter.writerow(header)
for r in rang... | from faker import Faker
import csv
# Reference: https://pypi.org/project/Faker/
output = open('data.CSV', 'w', newline='')
fake = Faker()
header = ['name', 'age', 'street', 'city', 'state', 'zip', 'lng', 'lat']
mywriter=csv.writer(output)
mywriter.writerow(header)
for r in range(1000):
mywriter... | en | 0.760783 | # Reference: https://pypi.org/project/Faker/ | 2.947114 | 3 |
subir/ingreso/migrations/0004_auto_20191003_1509.py | Brandon1625/subir | 0 | 4578 | # Generated by Django 2.2.4 on 2019-10-03 21:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ingreso', '0003_auto_20190907_2152'),
]
operations = [
migrations.AlterField(
model_name='detal... | # Generated by Django 2.2.4 on 2019-10-03 21:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ingreso', '0003_auto_20190907_2152'),
]
operations = [
migrations.AlterField(
model_name='detal... | en | 0.756748 | # Generated by Django 2.2.4 on 2019-10-03 21:09 | 1.317779 | 1 |
pyscf/nao/test/test_0017_tddft_iter_nao.py | mfkasim1/pyscf | 3 | 4579 | from __future__ import print_function, division
import os,unittest
from pyscf.nao import tddft_iter
dname = os.path.dirname(os.path.abspath(__file__))
td = tddft_iter(label='water', cd=dname)
try:
from pyscf.lib import misc
libnao_gpu = misc.load_library("libnao_gpu")
td_gpu = tddft_iter(label='water', cd... | from __future__ import print_function, division
import os,unittest
from pyscf.nao import tddft_iter
dname = os.path.dirname(os.path.abspath(__file__))
td = tddft_iter(label='water', cd=dname)
try:
from pyscf.lib import misc
libnao_gpu = misc.load_library("libnao_gpu")
td_gpu = tddft_iter(label='water', cd... | en | 0.587116 | This is iterative TDDFT with SIESTA starting point # water: O -- 6 electrons in the valence + H2 -- 2 electrons Test GPU version # water: O -- 6 electrons in the valence + H2 -- 2 electrons | 2.325101 | 2 |
setup.py | dimasciput/osm2geojson | 0 | 4580 | import io
from os import path
from setuptools import setup
dirname = path.abspath(path.dirname(__file__))
with io.open(path.join(dirname, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def parse_requirements(filename):
lines = (line.strip() for line in open(path.join(dirname, filename)))
... | import io
from os import path
from setuptools import setup
dirname = path.abspath(path.dirname(__file__))
with io.open(path.join(dirname, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def parse_requirements(filename):
lines = (line.strip() for line in open(path.join(dirname, filename)))
... | none | 1 | 2.068578 | 2 | |
Cap_11/ex11.6.py | gguilherme42/Livro-de-Python | 4 | 4581 | import sqlite3
from contextlib import closing
nome = input('Nome do produto: ').lower().capitalize()
with sqlite3.connect('precos.db') as conexao:
with closing(conexao.cursor()) as cursor:
cursor.execute('SELECT * FROM Precos WHERE nome_produto = ?', (nome,))
registro = cursor.fetchone()
... | import sqlite3
from contextlib import closing
nome = input('Nome do produto: ').lower().capitalize()
with sqlite3.connect('precos.db') as conexao:
with closing(conexao.cursor()) as cursor:
cursor.execute('SELECT * FROM Precos WHERE nome_produto = ?', (nome,))
registro = cursor.fetchone()
... | none | 1 | 3.595259 | 4 | |
jet20/backend/solver.py | JTJL/jet20 | 1 | 4582 | <filename>jet20/backend/solver.py<gh_stars>1-10
import torch
import time
import copy
from jet20.backend.constraints import *
from jet20.backend.obj import *
from jet20.backend.config import *
from jet20.backend.core import solve,OPTIMAL,SUB_OPTIMAL,USER_STOPPED
import logging
logger = logging.getLogger(__name__)
... | <filename>jet20/backend/solver.py<gh_stars>1-10
import torch
import time
import copy
from jet20.backend.constraints import *
from jet20.backend.obj import *
from jet20.backend.config import *
from jet20.backend.core import solve,OPTIMAL,SUB_OPTIMAL,USER_STOPPED
import logging
logger = logging.getLogger(__name__)
... | en | 0.66558 | # p = p.double() | 2.153517 | 2 |
tests/test_transforms.py | mengfu188/mmdetection.bak | 2 | 4583 | import torch
from mmdet.datasets.pipelines.transforms import Pad
from mmdet.datasets.pipelines.transforms import FilterBox
import numpy as np
import cv2
def test_pad():
raw = dict(
img=np.zeros((200, 401, 3), dtype=np.uint8)
)
cv2.imshow('raw', raw['img'])
pad = Pad(square=True, pad_val=255)
... | import torch
from mmdet.datasets.pipelines.transforms import Pad
from mmdet.datasets.pipelines.transforms import FilterBox
import numpy as np
import cv2
def test_pad():
raw = dict(
img=np.zeros((200, 401, 3), dtype=np.uint8)
)
cv2.imshow('raw', raw['img'])
pad = Pad(square=True, pad_val=255)
... | hr | 0.214488 | # test_pad() | 2.507407 | 3 |
dev/Tools/build/waf-1.7.13/lmbrwaflib/unit_test_lumberyard_modules.py | akulamartin/lumberyard | 8 | 4584 | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | en | 0.8154 | # # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or th... | 1.980759 | 2 |
linprog_curvefit.py | drofp/linprog_curvefit | 0 | 4585 | #!/usr/bin/env python3
"""Curve fitting with linear programming.
Minimizes the sum of error for each fit point to find the optimal coefficients
for a given polynomial.
Overview:
Objective: Sum of errors
Subject to: Bounds on coefficients
Credit: "Curve Fitting with Linear Programming", <NAME> and <NAME>
"""... | #!/usr/bin/env python3
"""Curve fitting with linear programming.
Minimizes the sum of error for each fit point to find the optimal coefficients
for a given polynomial.
Overview:
Objective: Sum of errors
Subject to: Bounds on coefficients
Credit: "Curve Fitting with Linear Programming", <NAME> and <NAME>
"""... | en | 0.720109 | #!/usr/bin/env python3 Curve fitting with linear programming. Minimizes the sum of error for each fit point to find the optimal coefficients for a given polynomial. Overview: Objective: Sum of errors Subject to: Bounds on coefficients Credit: "Curve Fitting with Linear Programming", <NAME> and <NAME> Create ... | 3.645413 | 4 |
build-script-helper.py | aciidb0mb3r/swift-stress-tester | 0 | 4586 | <filename>build-script-helper.py
#!/usr/bin/env python
"""
This source file is part of the Swift.org open source project
Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See https://swift.org/LICENSE.txt for license informati... | <filename>build-script-helper.py
#!/usr/bin/env python
"""
This source file is part of the Swift.org open source project
Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See https://swift.org/LICENSE.txt for license informati... | en | 0.794874 | #!/usr/bin/env python This source file is part of the Swift.org open source project Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information See https://swift.org/CONTRIBUTORS.... | 1.946842 | 2 |
tests/components/deconz/test_scene.py | pcaston/core | 1 | 4587 | <filename>tests/components/deconz/test_scene.py
"""deCONZ scene platform tests."""
from unittest.mock import patch
from openpeerpower.components.scene import DOMAIN as SCENE_DOMAIN, SERVICE_TURN_ON
from openpeerpower.const import ATTR_ENTITY_ID
from .test_gateway import (
DECONZ_WEB_REQUEST,
mock_deconz_put_... | <filename>tests/components/deconz/test_scene.py
"""deCONZ scene platform tests."""
from unittest.mock import patch
from openpeerpower.components.scene import DOMAIN as SCENE_DOMAIN, SERVICE_TURN_ON
from openpeerpower.const import ATTR_ENTITY_ID
from .test_gateway import (
DECONZ_WEB_REQUEST,
mock_deconz_put_... | en | 0.875399 | deCONZ scene platform tests. Test that scenes can be loaded without scenes being available. Test that scenes works. # Verify service calls # Service turn on scene | 2.123346 | 2 |
tensorhive/config.py | roscisz/TensorHive | 129 | 4588 | from pathlib import PosixPath
import configparser
from typing import Dict, Optional, Any, List
from inspect import cleandoc
import shutil
import tensorhive
import os
import logging
log = logging.getLogger(__name__)
class CONFIG_FILES:
# Where to copy files
# (TensorHive tries to load these by default)
con... | from pathlib import PosixPath
import configparser
from typing import Dict, Optional, Any, List
from inspect import cleandoc
import shutil
import tensorhive
import os
import logging
log = logging.getLogger(__name__)
class CONFIG_FILES:
# Where to copy files
# (TensorHive tries to load these by default)
con... | en | 0.65824 | # Where to copy files # (TensorHive tries to load these by default) # Where to get file templates from # (Clone file when it's not found in config directory) Makes sure that all default config files exist # 1. Check if all config files exist # 1. Create directory for stroing config files # 2. Clone templates safely fro... | 2.235766 | 2 |
model.py | iz2late/baseline-seq2seq | 1 | 4589 | import random
from typing import Tuple
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch import Tensor
class Encoder(nn.Module):
def __init__(self, input_dim, emb_dim, enc_hid_dim, dec_hid_dim, dropout):
super().__init__()
self.input_dim = in... | import random
from typing import Tuple
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch import Tensor
class Encoder(nn.Module):
def __init__(self, input_dim, emb_dim, enc_hid_dim, dec_hid_dim, dropout):
super().__init__()
self.input_dim = in... | en | 0.79339 | # output of bi-directional rnn should be concatenated # first input to the decoder is the <sos> token | 2.309471 | 2 |
ML/Pytorch/more_advanced/Seq2Seq/seq2seq.py | xuyannus/Machine-Learning-Collection | 3,094 | 4590 | <filename>ML/Pytorch/more_advanced/Seq2Seq/seq2seq.py<gh_stars>1000+
import torch
import torch.nn as nn
import torch.optim as optim
from torchtext.datasets import Multi30k
from torchtext.data import Field, BucketIterator
import numpy as np
import spacy
import random
from torch.utils.tensorboard import SummaryWriter # ... | <filename>ML/Pytorch/more_advanced/Seq2Seq/seq2seq.py<gh_stars>1000+
import torch
import torch.nn as nn
import torch.optim as optim
from torchtext.datasets import Multi30k
from torchtext.data import Field, BucketIterator
import numpy as np
import spacy
import random
from torch.utils.tensorboard import SummaryWriter # ... | en | 0.886051 | # to print to tensorboard # x shape: (seq_length, N) where N is batch size # embedding shape: (seq_length, N, embedding_size) # outputs shape: (seq_length, N, hidden_size) # x shape: (N) where N is for batch size, we want it to be (1, N), seq_length # is 1 here because we are sending in a single word and not a sentence... | 2.313295 | 2 |
gail_chatbot/light/sqil/light_sentence_imitate_mixin.py | eublefar/gail_chatbot | 0 | 4591 | from typing import Dict, Any, List
import string
from parlai.core.agents import Agent
from parlai.core.message import Message
from random import sample
import pathlib
path = pathlib.Path(__file__).parent.absolute()
class LightImitateMixin(Agent):
"""Abstract class that handles passing expert trajectories alo... | from typing import Dict, Any, List
import string
from parlai.core.agents import Agent
from parlai.core.message import Message
from random import sample
import pathlib
path = pathlib.Path(__file__).parent.absolute()
class LightImitateMixin(Agent):
"""Abstract class that handles passing expert trajectories alo... | en | 0.775423 | Abstract class that handles passing expert trajectories alongside self-play sampling # Add generated histories to data ones Implement sampling utterances and memorization here Implement update here Update weights here | 2.480315 | 2 |
pytudes/_2021/educative/grokking_the_coding_interview/fast_and_slow_pointers/_1__linked_list_cycle__easy.py | TeoZosa/pytudes | 1 | 4592 | <reponame>TeoZosa/pytudes
"""https://www.educative.io/courses/grokking-the-coding-interview/N7rwVyAZl6D
Categories:
- Binary
- Bit Manipulation
- Blind 75
See Also:
- pytudes/_2021/leetcode/blind_75/linked_list/_141__linked_list_cycle__easy.py
"""
from pytudes._2021.utils.linked_list import (
Li... | """https://www.educative.io/courses/grokking-the-coding-interview/N7rwVyAZl6D
Categories:
- Binary
- Bit Manipulation
- Blind 75
See Also:
- pytudes/_2021/leetcode/blind_75/linked_list/_141__linked_list_cycle__easy.py
"""
from pytudes._2021.utils.linked_list import (
ListNode,
NodeType,
... | en | 0.550349 | https://www.educative.io/courses/grokking-the-coding-interview/N7rwVyAZl6D Categories: - Binary - Bit Manipulation - Blind 75 See Also: - pytudes/_2021/leetcode/blind_75/linked_list/_141__linked_list_cycle__easy.py Args: head: head of a singly-linked list of nodes Returns: whether... | 3.955476 | 4 |
httpd.py | whtt8888/TritonHTTPserver | 2 | 4593 | <filename>httpd.py
import sys
import os
import socket
import time
import threading
class MyServer:
def __init__(self, port, doc_root):
self.port = port
self.doc_root = doc_root
self.host = '127.0.0.1'
self.res_200 = "HTTP/1.1 200 OK\r\nServer: Myserver 1.0\r\n"
self.res_40... | <filename>httpd.py
import sys
import os
import socket
import time
import threading
class MyServer:
def __init__(self, port, doc_root):
self.port = port
self.doc_root = doc_root
self.host = '127.0.0.1'
self.res_200 = "HTTP/1.1 200 OK\r\nServer: Myserver 1.0\r\n"
self.res_40... | en | 0.475011 | # map request into dict # 400 malform # mapping url, return 404 escape or absolute filename # judge whether escape # path escape from file root # map index.html # generate response # 404 escape # 400 malform req # 404 not found # a valid 200 req # for jpg and png # print('closed') # print('Connected by', addr) # print(... | 2.816509 | 3 |
metric/metric.py | riven314/ENetDepth_TimeAnlysis_Tmp | 0 | 4594 | <gh_stars>0
class Metric(object):
"""Base class for all metrics.
From: https://github.com/pytorch/tnt/blob/master/torchnet/meter/meter.py
"""
def reset(self):
pass
def add(self):
pass
def value(self):
pass
| class Metric(object):
"""Base class for all metrics.
From: https://github.com/pytorch/tnt/blob/master/torchnet/meter/meter.py
"""
def reset(self):
pass
def add(self):
pass
def value(self):
pass | en | 0.435681 | Base class for all metrics.
From: https://github.com/pytorch/tnt/blob/master/torchnet/meter/meter.py | 2.364983 | 2 |
pf_pweb_sourceman/task/git_repo_man.py | problemfighter/pf-pweb-sourceman | 0 | 4595 | from git import Repo
from pf_pweb_sourceman.common.console import console
from pf_py_file.pfpf_file_util import PFPFFileUtil
class GitRepoMan:
def get_repo_name_from_url(self, url: str):
if not url:
return None
last_slash_index = url.rfind("/")
last_suffix_index = url.rfind("... | from git import Repo
from pf_pweb_sourceman.common.console import console
from pf_py_file.pfpf_file_util import PFPFFileUtil
class GitRepoMan:
def get_repo_name_from_url(self, url: str):
if not url:
return None
last_slash_index = url.rfind("/")
last_suffix_index = url.rfind("... | none | 1 | 2.765305 | 3 | |
tool/remote_info.py | shanmukmichael/Asset-Discovery-Tool | 0 | 4596 | <filename>tool/remote_info.py
import socket
import paramiko
import json
Hostname = '172.16.17.32'
Username = 'ec2-user'
key = 'G:/Projects/Python/Asset-Discovery-Tool/tool/s.pem'
def is_connected():
try:
# connect to the host -- tells us if the host is actually
# reachable
socket.create_c... | <filename>tool/remote_info.py
import socket
import paramiko
import json
Hostname = '172.16.17.32'
Username = 'ec2-user'
key = 'G:/Projects/Python/Asset-Discovery-Tool/tool/s.pem'
def is_connected():
try:
# connect to the host -- tells us if the host is actually
# reachable
socket.create_c... | en | 0.375971 | # connect to the host -- tells us if the host is actually # reachable # commands #_, stdout_8, _ = ssh.exec_command("sudo {}/24".format()) # egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' --IP-address # --------------------------------- # ---------------------------------- # ssh.close() | 2.746469 | 3 |
hvac/api/secrets_engines/kv_v2.py | Famoco/hvac | 0 | 4597 | <filename>hvac/api/secrets_engines/kv_v2.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""KvV2 methods module."""
from hvac import exceptions, utils
from hvac.api.vault_api_base import VaultApiBase
DEFAULT_MOUNT_POINT = 'secret'
class KvV2(VaultApiBase):
"""KV Secrets Engine - Version 2 (API).
Reference:... | <filename>hvac/api/secrets_engines/kv_v2.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""KvV2 methods module."""
from hvac import exceptions, utils
from hvac.api.vault_api_base import VaultApiBase
DEFAULT_MOUNT_POINT = 'secret'
class KvV2(VaultApiBase):
"""KV Secrets Engine - Version 2 (API).
Reference:... | en | 0.839289 | #!/usr/bin/env python # -*- coding: utf-8 -*- KvV2 methods module. KV Secrets Engine - Version 2 (API). Reference: https://www.vaultproject.io/api/secret/kv/kv-v2.html Configure backend level settings that are applied to every key in the key-value store. Supported methods: POST: /{mount_point}... | 2.518856 | 3 |
android/install-all.py | SaschaWillems/vulkan_slim | 28 | 4598 | # Install all examples to connected device(s)
import subprocess
import sys
answer = input("Install all vulkan examples to attached device, this may take some time! (Y/N)").lower() == 'y'
if answer:
BUILD_ARGUMENTS = ""
for arg in sys.argv[1:]:
if arg == "-validation":
BUILD_ARGUMENTS += "-v... | # Install all examples to connected device(s)
import subprocess
import sys
answer = input("Install all vulkan examples to attached device, this may take some time! (Y/N)").lower() == 'y'
if answer:
BUILD_ARGUMENTS = ""
for arg in sys.argv[1:]:
if arg == "-validation":
BUILD_ARGUMENTS += "-v... | en | 0.852691 | # Install all examples to connected device(s) | 2.580082 | 3 |
main.py | juangallostra/moonboard | 0 | 4599 | from generators.ahoughton import AhoughtonGenerator
from render_config import RendererConfig
from problem_renderer import ProblemRenderer
from moonboard import get_moonboard
from adapters.default import DefaultProblemAdapter
from adapters.crg import CRGProblemAdapter
from adapters.ahoughton import AhoughtonAdapter
impo... | from generators.ahoughton import AhoughtonGenerator
from render_config import RendererConfig
from problem_renderer import ProblemRenderer
from moonboard import get_moonboard
from adapters.default import DefaultProblemAdapter
from adapters.crg import CRGProblemAdapter
from adapters.ahoughton import AhoughtonAdapter
impo... | en | 0.540627 | # Create Renderer # Load data # Ahoughton generator and adapter test # 2016 # 2017 | 2.202421 | 2 |