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
yolox/data/datasets/mot.py
ldelzott/ByteTrack
0
5800
import cv2 import numpy as np from pycocotools.coco import COCO import os from ..dataloading import get_yolox_datadir from .datasets_wrapper import Dataset class MOTDataset(Dataset): """ COCO dataset class. """ def __init__( # This function is called in the exps yolox_x_mot17_half.py in this way: ...
import cv2 import numpy as np from pycocotools.coco import COCO import os from ..dataloading import get_yolox_datadir from .datasets_wrapper import Dataset class MOTDataset(Dataset): """ COCO dataset class. """ def __init__( # This function is called in the exps yolox_x_mot17_half.py in this way: ...
en
0.531465
COCO dataset class. # This function is called in the exps yolox_x_mot17_half.py in this way: dataset = MOTDataset( # data_dir=os.path.join(get_yolox_datadir(), "mot"), # json_file=self.train_ann, # name='train', # img_size=self.input_size, # preproc=TrainTransform(rgb_means=(0.485, 0.456, 0.406), # std=(0.229, 0.224, ...
2.686838
3
src/poetry/console/commands/remove.py
pkoch/poetry
0
5801
<reponame>pkoch/poetry from __future__ import annotations from typing import Any from cleo.helpers import argument from cleo.helpers import option from tomlkit.toml_document import TOMLDocument try: from poetry.core.packages.dependency_group import MAIN_GROUP except ImportError: MAIN_GROUP = "default" from...
from __future__ import annotations from typing import Any from cleo.helpers import argument from cleo.helpers import option from tomlkit.toml_document import TOMLDocument try: from poetry.core.packages.dependency_group import MAIN_GROUP except ImportError: MAIN_GROUP = "default" from poetry.console.command...
en
0.707214
The <info>remove</info> command removes a package from the current list of installed packages <info>poetry remove</info> # We need to account for the old `dev-dependencies` section # Refresh the locker # Update packages
2.189593
2
orrinjelo/aoc2021/day_11.py
orrinjelo/AdventOfCode2021
0
5802
<filename>orrinjelo/aoc2021/day_11.py from orrinjelo.utils.decorators import timeit import numpy as np def parse(lines): return np.array([[int(c) for c in line.strip()] for line in lines]) visited = [] def flash(a, x, y): global visited if (x,y) in visited: return for dx in range(-1,2): ...
<filename>orrinjelo/aoc2021/day_11.py from orrinjelo.utils.decorators import timeit import numpy as np def parse(lines): return np.array([[int(c) for c in line.strip()] for line in lines]) visited = [] def flash(a, x, y): global visited if (x,y) in visited: return for dx in range(-1,2): ...
en
0.2176
# print('a:\n', a) # = Test ================================================ # import matplotlib.pyplot as plt # plt.imshow(parse(inputlist)) # plt.show() # octomap = parse(input_str) #', i) # erase the screen # surface.blit(screen, (0,0))
2.886931
3
exercise_2/exercise_2.1.py
lukaszbinden/ethz-iacv-2020
0
5803
camera_width = 640 camera_height = 480 film_back_width = 1.417 film_back_height = 0.945 x_center = 320 y_center = 240 P_1 = (-0.023, -0.261, 2.376) p_11 = P_1[0] p_12 = P_1[1] p_13 = P_1[2] P_2 = (0.659, -0.071, 2.082) p_21 = P_2[0] p_22 = P_2[1] p_23 = P_2[2] p_1_prime = (52, 163) x_1 = p_1_prime[0] y_1 = p_1_pr...
camera_width = 640 camera_height = 480 film_back_width = 1.417 film_back_height = 0.945 x_center = 320 y_center = 240 P_1 = (-0.023, -0.261, 2.376) p_11 = P_1[0] p_12 = P_1[1] p_13 = P_1[2] P_2 = (0.659, -0.071, 2.082) p_21 = P_2[0] p_22 = P_2[1] p_23 = P_2[2] p_1_prime = (52, 163) x_1 = p_1_prime[0] y_1 = p_1_pr...
en
0.648351
# f_k_x = f * k_x # f_k_y = f * k_y
1.757497
2
services/train/single.py
paper2code/torch2vec-restful-service
2
5804
<reponame>paper2code/torch2vec-restful-service #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 26 19:15:34 2020 @author: deviantpadam """ import pandas as pd import numpy as np import concurrent.futures import os import tqdm from collections import Counter from torch2vec.data import DataPreparati...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 26 19:15:34 2020 @author: deviantpadam """ import pandas as pd import numpy as np import concurrent.futures import os import tqdm from collections import Counter from torch2vec.data import DataPreparation from torch2vec.torch2vec import DM # train ...
en
0.529121
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Aug 26 19:15:34 2020 @author: deviantpadam # train = pd.read_csv('/home/deviantpadam/Downloads/example.csv',delimiter='\t') # train = pd.read_csv('/home/deviantpadam/Downloads/example (1).csv') # result = _add_bigrams(data) # print(cor[i][j]...
2.554475
3
tests/sources/test_document_oereblex.py
geo-bl-ch/pyramid_oereb
0
5805
<reponame>geo-bl-ch/pyramid_oereb # -*- coding: utf-8 -*- import datetime import pytest import requests_mock from geolink_formatter.entity import Document, File from requests.auth import HTTPBasicAuth from pyramid_oereb.contrib.sources.document import OEREBlexSource from pyramid_oereb.lib.records.documents import Do...
# -*- coding: utf-8 -*- import datetime import pytest import requests_mock from geolink_formatter.entity import Document, File from requests.auth import HTTPBasicAuth from pyramid_oereb.contrib.sources.document import OEREBlexSource from pyramid_oereb.lib.records.documents import DocumentRecord, LegalProvisionRecord...
en
0.769321
# -*- coding: utf-8 -*-
2.108226
2
apps/zsh/singletons.py
codecat555/codecat555-fidgetingbits_knausj_talon
4
5806
<reponame>codecat555/codecat555-fidgetingbits_knausj_talon<filename>apps/zsh/singletons.py # A rarely-updated module to assist in writing reload-safe talon modules using # things like threads, which are not normally safe for reloading with talon. # If this file is ever updated, you'll need to restart talon. import lo...
# A rarely-updated module to assist in writing reload-safe talon modules using # things like threads, which are not normally safe for reloading with talon. # If this file is ever updated, you'll need to restart talon. import logging _singletons = {} def singleton(fn): name = f"{fn.__module__}.{fn.__name__}" ...
en
0.841439
# A rarely-updated module to assist in writing reload-safe talon modules using # things like threads, which are not normally safe for reloading with talon. # If this file is ever updated, you'll need to restart talon. # Do any cleanup actions from before. # Do the startup actions on the new object. # Remember the itera...
2.482882
2
trainNN/run_bichrom.py
yztxwd/Bichrom
3
5807
import argparse import yaml from subprocess import call from train import train_bichrom if __name__ == '__main__': # parsing parser = argparse.ArgumentParser(description='Train and Evaluate Bichrom') parser.add_argument('-training_schema_yaml', required=True, help='YAML file with pa...
import argparse import yaml from subprocess import call from train import train_bichrom if __name__ == '__main__': # parsing parser = argparse.ArgumentParser(description='Train and Evaluate Bichrom') parser.add_argument('-training_schema_yaml', required=True, help='YAML file with pa...
en
0.634464
# parsing # load the yaml file with input data paths: # create the output directory:
2.607876
3
setup.py
Fronius-SED/rapidyaml
0
5808
<reponame>Fronius-SED/rapidyaml #!/usr/bin/env python3 # -*- coding: utf-8 -*- # SPDX-License-Identifier: MIT import os import shutil import sys from pathlib import Path from distutils import log from setuptools import setup from setuptools.command.sdist import sdist as SdistCommand from cmake_build_extension import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # SPDX-License-Identifier: MIT import os import shutil import sys from pathlib import Path from distutils import log from setuptools import setup from setuptools.command.sdist import sdist as SdistCommand from cmake_build_extension import BuildExtension, CMakeExtension ...
en
0.690975
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # SPDX-License-Identifier: MIT # Where the Python library is actually found. # Read in the package version when not in a git repository. # Read in the module description from the README.md file. # define a CMake package # Force cmake to use the Python interpreter we are cu...
1.655731
2
litex_boards/targets/digilent_arty_z7.py
machdyne/litex-boards
0
5809
<filename>litex_boards/targets/digilent_arty_z7.py #!/usr/bin/env python3 # # This file is part of LiteX-Boards. # # Copyright (c) 2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause import argparse import subprocess from migen import * from litex_boards.platforms import digilent_arty_z7 from litex.build ...
<filename>litex_boards/targets/digilent_arty_z7.py #!/usr/bin/env python3 # # This file is part of LiteX-Boards. # # Copyright (c) 2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause import argparse import subprocess from migen import * from litex_boards.platforms import digilent_arty_z7 from litex.build ...
en
0.271099
#!/usr/bin/env python3 # # This file is part of LiteX-Boards. # # Copyright (c) 2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause # CRG ---------------------------------------------------------------------------------------------- # # # # Clk. # PLL. # Ignore sys_clk to pll.clkin path created by SoC's rst. ...
1.713165
2
goose/parsers.py
allmalaysianews/article-extractor
0
5810
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by <NAME> Gravity.com licenses this file t...
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by <NAME> Gravity.com licenses this file t...
en
0.870872
# -*- coding: utf-8 -*- \ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by <NAME> Gravity.com licenses this file to y...
2.146014
2
src/infrastructure/database/postgres/sqlhandler.py
SoyBeansLab/daizu-online-judge-backend
7
5811
<reponame>SoyBeansLab/daizu-online-judge-backend<gh_stars>1-10 from logging import getLogger import os from typing import List, Union import psycopg2 from interface.database.sqlhandler import Cursor as AbsCursor from interface.database.sqlhandler import Result as AbsResult from interface.database.sqlhandler import Sq...
from logging import getLogger import os from typing import List, Union import psycopg2 from interface.database.sqlhandler import Cursor as AbsCursor from interface.database.sqlhandler import Result as AbsResult from interface.database.sqlhandler import SqlHandler as AbsSqlHandler from exceptions.waf import SqlTransa...
ja
0.954445
# 環境から取るようにする # self.cursor = self.connection.cursor()
2.61021
3
virtualisation/wrapper/parser/xmlparser.py
CityPulse/CP_Resourcemanagement
2
5812
<reponame>CityPulse/CP_Resourcemanagement from virtualisation.clock.abstractclock import AbstractClock __author__ = '<NAME> (<EMAIL>)' from virtualisation.wrapper.parser.abstractparser import AbstractParser from virtualisation.misc.jsonobject import JSONObject as JOb import datetime as dt class XMLParser(AbstractPa...
from virtualisation.clock.abstractclock import AbstractClock __author__ = '<NAME> (<EMAIL>)' from virtualisation.wrapper.parser.abstractparser import AbstractParser from virtualisation.misc.jsonobject import JSONObject as JOb import datetime as dt class XMLParser(AbstractParser): """ Maps a list of values r...
en
0.894771
Maps a list of values read by a CSVReader with a given naming list # nothing received or nothing in the history -> nothing to parse
2.692445
3
plaso/formatters/interface.py
jonathan-greig/plaso
1,253
5813
<gh_stars>1000+ # -*- coding: utf-8 -*- """This file contains the event formatters interface classes. The l2t_csv and other formats are dependent on a message field, referred to as description_long and description_short in l2t_csv. Plaso no longer stores these field explicitly. A formatter, with a format string defi...
# -*- coding: utf-8 -*- """This file contains the event formatters interface classes. The l2t_csv and other formats are dependent on a message field, referred to as description_long and description_short in l2t_csv. Plaso no longer stores these field explicitly. A formatter, with a format string definition, is used ...
en
0.448071
# -*- coding: utf-8 -*- This file contains the event formatters interface classes. The l2t_csv and other formats are dependent on a message field, referred to as description_long and description_short in l2t_csv. Plaso no longer stores these field explicitly. A formatter, with a format string definition, is used to ...
2.874871
3
python_program/condition.py
LiuKaiqiang94/PyStudyExample
5
5814
<reponame>LiuKaiqiang94/PyStudyExample def main(): val=int(input("input a num")) if val<10: print("A") elif val<20: print("B") elif val<30: print("C") else: print("D") main()
def main(): val=int(input("input a num")) if val<10: print("A") elif val<20: print("B") elif val<30: print("C") else: print("D") main()
none
1
3.784693
4
Annotated_video/test/Annotatedvideo_worm.py
Rukaume/LRCN
1
5815
<filename>Annotated_video/test/Annotatedvideo_worm.py # -*- coding: utf-8 -*- """ Created on Fri Sep 4 22:27:11 2020 @author: Miyazaki """ imdir = "C:/Users/Miyazaki/Desktop/hayashi_lab/20200527_lethargus_analysis/renamed_pillar_chamber-N2/chamber3" resultdir= "C:/Users/Miyazaki/Desktop/hayashi_lab/20200527_lethargu...
<filename>Annotated_video/test/Annotatedvideo_worm.py # -*- coding: utf-8 -*- """ Created on Fri Sep 4 22:27:11 2020 @author: Miyazaki """ imdir = "C:/Users/Miyazaki/Desktop/hayashi_lab/20200527_lethargus_analysis/renamed_pillar_chamber-N2/chamber3" resultdir= "C:/Users/Miyazaki/Desktop/hayashi_lab/20200527_lethargu...
en
0.759141
# -*- coding: utf-8 -*- Created on Fri Sep 4 22:27:11 2020 @author: Miyazaki
2.316146
2
emilia/modules/math.py
masterisira/ELIZA_OF-master
0
5816
<gh_stars>0 from typing import List import requests from telegram import Message, Update, Bot, MessageEntity from telegram.ext import CommandHandler, run_async from emilia import dispatcher from emilia.modules.disable import DisableAbleCommandHandler from emilia.modules.helper_funcs.alternate import send_message import...
from typing import List import requests from telegram import Message, Update, Bot, MessageEntity from telegram.ext import CommandHandler, run_async from emilia import dispatcher from emilia.modules.disable import DisableAbleCommandHandler from emilia.modules.helper_funcs.alternate import send_message import pynewtonmat...
en
0.718668
Under Developmeent.. More features soon - /cos: Cosine `/cos pi` - /sin: Sine `/sin 0` - /tan: Tangent `/tan 0` - /arccos: Inverse Cosine `/arccos 1` - /arcsin: Inverse Sine `/arcsin 0` - /arctan: Inverse Tangent `/arctan 0` - /abs: Absolute Value `/abs -1` - /log: Logarithm `/log 2l8` __Keep in mind__: To find...
2.170117
2
services/IAm.py
matteobjornsson/serverless-rock-paper-scissors
0
5817
# # Created on Thu Apr 22 2021 # <NAME> # import boto3 from botocore.exceptions import ClientError import logging logging.basicConfig(filename="rps.log", level=logging.INFO) iam_resource = boto3.resource("iam") sts_client = boto3.client("sts") def create_role( iam_role_name: str, assume_role_policy_json: str, p...
# # Created on Thu Apr 22 2021 # <NAME> # import boto3 from botocore.exceptions import ClientError import logging logging.basicConfig(filename="rps.log", level=logging.INFO) iam_resource = boto3.resource("iam") sts_client = boto3.client("sts") def create_role( iam_role_name: str, assume_role_policy_json: str, p...
en
0.836532
# # Created on Thu Apr 22 2021 # <NAME> # Create an IAM role with a given policy. :param assume_role_policy_json: A json string that represents the assume role policy defining what resources are allowed to assume the role. :param policy_arns: a list of strings representing existing policy arns to also ...
2.645192
3
stograde/common/run_status.py
babatana/stograde
0
5818
<reponame>babatana/stograde from enum import auto, Enum class RunStatus(Enum): SUCCESS = auto() CALLED_PROCESS_ERROR = auto() FILE_NOT_FOUND = auto() PROCESS_LOOKUP_ERROR = auto() TIMEOUT_EXPIRED = auto()
from enum import auto, Enum class RunStatus(Enum): SUCCESS = auto() CALLED_PROCESS_ERROR = auto() FILE_NOT_FOUND = auto() PROCESS_LOOKUP_ERROR = auto() TIMEOUT_EXPIRED = auto()
none
1
2.580295
3
recsys/__init__.py
shenghuiliuu/recsys
50
5819
<reponame>shenghuiliuu/recsys __all__ = ['cross_validation', 'metrics', 'datasets', 'recommender']
__all__ = ['cross_validation', 'metrics', 'datasets', 'recommender']
none
1
1.053866
1
audiomate/annotations/label_list.py
CostanzoPablo/audiomate
133
5820
import collections import copy import intervaltree from .label import Label class LabelList: """ Represents a list of labels which describe an utterance. An utterance can have multiple label-lists. Args: idx (str): An unique identifier for the label-list within a corpus f...
import collections import copy import intervaltree from .label import Label class LabelList: """ Represents a list of labels which describe an utterance. An utterance can have multiple label-lists. Args: idx (str): An unique identifier for the label-list within a corpus f...
en
0.673993
Represents a list of labels which describe an utterance. An utterance can have multiple label-lists. Args: idx (str): An unique identifier for the label-list within a corpus for one utterance. labels (list): The list containing the :py:class:`audiomate....
3.150233
3
src/views/age_results_widget.py
RubyMarsden/Crayfish
0
5821
<filename>src/views/age_results_widget.py import matplotlib from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QHBoxLayout, QDialog, QPushButton, QWidget, QVBoxLayout, QLabel matplotlib.use('QT5Agg') import matplotlib.pyplot as plt from models.data_key import DataKey from utils import ui_utils class AgeResults...
<filename>src/views/age_results_widget.py import matplotlib from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QHBoxLayout, QDialog, QPushButton, QWidget, QVBoxLayout, QLabel matplotlib.use('QT5Agg') import matplotlib.pyplot as plt from models.data_key import DataKey from utils import ui_utils class AgeResults...
de
0.422458
############### ### Actions ### ############### # TODO plot words on graph # TODO plot some text
2.473469
2
examples/single_run/ocaes_single_run.py
EnergyModels/OCAES
0
5822
import pandas as pd from OCAES import ocaes # ---------------------- # create and run model # ---------------------- data = pd.read_csv('timeseries_inputs_2019.csv') inputs = ocaes.get_default_inputs() # inputs['C_well'] = 5000.0 # inputs['X_well'] = 50.0 # inputs['L_well'] = 50.0 # inputs['X_cmp'] = 0 # inputs['X_exp...
import pandas as pd from OCAES import ocaes # ---------------------- # create and run model # ---------------------- data = pd.read_csv('timeseries_inputs_2019.csv') inputs = ocaes.get_default_inputs() # inputs['C_well'] = 5000.0 # inputs['X_well'] = 50.0 # inputs['L_well'] = 50.0 # inputs['X_cmp'] = 0 # inputs['X_exp...
en
0.231214
# ---------------------- # create and run model # ---------------------- # inputs['C_well'] = 5000.0 # inputs['X_well'] = 50.0 # inputs['L_well'] = 50.0 # inputs['X_cmp'] = 0 # inputs['X_exp'] = 0 # ---------------------- # create plots using built-in functions # ----------------------
2.761805
3
tests/transformations/local_storage_test.py
am-ivanov/dace
1
5823
import unittest import dace import numpy as np from dace.transformation.dataflow import MapTiling, OutLocalStorage N = dace.symbol('N') @dace.program def arange(): out = np.ndarray([N], np.int32) for i in dace.map[0:N]: with dace.tasklet: o >> out[i] o = i return out cla...
import unittest import dace import numpy as np from dace.transformation.dataflow import MapTiling, OutLocalStorage N = dace.symbol('N') @dace.program def arange(): out = np.ndarray([N], np.int32) for i in dace.map[0:N]: with dace.tasklet: o >> out[i] o = i return out cla...
en
0.857422
# For testing uneven decomposition, use longer buffer and ensure # it's not filled over
2.43403
2
astropy/io/fits/hdu/streaming.py
jayvdb/astropy
445
5824
<gh_stars>100-1000 # Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import os from .base import _BaseHDU, BITPIX2DTYPE from .hdulist import HDUList from .image import PrimaryHDU from astropy.io.fits.file import _File from astropy.io.fits.header import _pad_length from astropy.io.fits.util i...
# Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import os from .base import _BaseHDU, BITPIX2DTYPE from .hdulist import HDUList from .image import PrimaryHDU from astropy.io.fits.file import _File from astropy.io.fits.header import _pad_length from astropy.io.fits.util import fileobj_name ...
en
0.854813
# Licensed under a 3-clause BSD style license - see PYFITS.rst A class that provides the capability to stream data to a FITS file instead of requiring data to all be written at once. The following pseudocode illustrates its use:: header = astropy.io.fits.Header() for all the cards you need in...
2.775685
3
geoprisma/tests/test_templatetags.py
groupe-conseil-nutshimit-nippour/django-geoprisma
0
5825
import django from django.test import TestCase from django.template import Template, Context class genericObj(object): """ A generic object for testing templatetags """ def __init__(self): self.name = "test" self.status = "ready" def getOption(self, optionName): ...
import django from django.test import TestCase from django.template import Template, Context class genericObj(object): """ A generic object for testing templatetags """ def __init__(self): self.name = "test" self.status = "ready" def getOption(self, optionName): ...
en
0.24181
A generic object for testing templatetags A shortcut for testing template output. {% load object_extras %} {{ obj|args:"name"|call:"getOption" }} {% load object_extras %} {{ obj|call:"getName" }} {% load object_extras %} {{ obj|obj_type:"genericObj" }} {% load object_extras %} {{ obj...
2.406745
2
src/ggrc_workflows/models/task_group.py
acidburn0zzz/ggrc-core
1
5826
<reponame>acidburn0zzz/ggrc-core # Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """A module containing the workflow TaskGroup model.""" from sqlalchemy import or_ from ggrc import db from ggrc.login import get_current_user from ggrc.models.association...
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """A module containing the workflow TaskGroup model.""" from sqlalchemy import or_ from ggrc import db from ggrc.login import get_current_user from ggrc.models.associationproxy import association_proxy fr...
en
0.516028
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> A module containing the workflow TaskGroup model. Workflow TaskGroup model. # Intentionally do not include `cycle_task_groups` # 'cycle_task_groups', # pylint: disable=unused-argument
1.940208
2
src/tests/app_functions/menu/test_change_auto_login.py
DanielNoord/DuolingoPomodoro
0
5827
import pytest import rumps from src.app_functions.menu.change_auto_login import change_auto_login @pytest.fixture(name="basic_app") def create_app(): """Creates a basic app object with some variables to pass to functions Returns: rumps.App: Basic app """ app = rumps.App("TestApp") app.set...
import pytest import rumps from src.app_functions.menu.change_auto_login import change_auto_login @pytest.fixture(name="basic_app") def create_app(): """Creates a basic app object with some variables to pass to functions Returns: rumps.App: Basic app """ app = rumps.App("TestApp") app.set...
en
0.715062
Creates a basic app object with some variables to pass to functions Returns: rumps.App: Basic app Check if setting is changed correctly if True Check if setting is changed correctly if false
2.511683
3
deepobs/tensorflow/testproblems/cifar100_vgg19.py
H0merJayS1mpson/deepobscustom
0
5828
# -*- coding: utf-8 -*- """VGG 19 architecture for CIFAR-100.""" import tensorflow as tf from ._vgg import _vgg from ..datasets.cifar100 import cifar100 from .testproblem import TestProblem class cifar100_vgg19(TestProblem): """DeepOBS test problem class for the VGG 19 network on Cifar-100. The CIFAR-100 ima...
# -*- coding: utf-8 -*- """VGG 19 architecture for CIFAR-100.""" import tensorflow as tf from ._vgg import _vgg from ..datasets.cifar100 import cifar100 from .testproblem import TestProblem class cifar100_vgg19(TestProblem): """DeepOBS test problem class for the VGG 19 network on Cifar-100. The CIFAR-100 ima...
en
0.783979
# -*- coding: utf-8 -*- VGG 19 architecture for CIFAR-100. DeepOBS test problem class for the VGG 19 network on Cifar-100. The CIFAR-100 images are resized to ``224`` by ``224`` to fit the input dimension of the original VGG network, which was designed for ImageNet. Details about the architecture can be found i...
2.790879
3
write-a-function.py
TheHumanGoogle/Hackerrank-python-solution
1
5829
def is_leap(year): leap=False if year%400==0: leap=True elif year%4==0 and year%100!=0: leap=True else: leap=False return leap year = int(input())
def is_leap(year): leap=False if year%400==0: leap=True elif year%4==0 and year%100!=0: leap=True else: leap=False return leap year = int(input())
none
1
4.076341
4
shortio/utils.py
byshyk/shortio
0
5830
<reponame>byshyk/shortio """Contains utility functions.""" BIN_MODE_ARGS = {'mode', 'buffering', } TEXT_MODE_ARGS = {'mode', 'buffering', 'encoding', 'errors', 'newline'} def split_args(args): """Splits args into two groups: open args and other args. Open args are used by ``open`` function. Other args are u...
"""Contains utility functions.""" BIN_MODE_ARGS = {'mode', 'buffering', } TEXT_MODE_ARGS = {'mode', 'buffering', 'encoding', 'errors', 'newline'} def split_args(args): """Splits args into two groups: open args and other args. Open args are used by ``open`` function. Other args are used by ``load``/``dum...
en
0.593265
Contains utility functions. Splits args into two groups: open args and other args. Open args are used by ``open`` function. Other args are used by ``load``/``dump`` functions. Args: args: Keyword args to split. Returns: open_args: Arguments for ``open``. other_args: Arguments f...
3.43858
3
paasta_tools/async_utils.py
sobolevn/paasta
1,711
5831
import asyncio import functools import time import weakref from collections import defaultdict from typing import AsyncIterable from typing import Awaitable from typing import Callable from typing import Dict from typing import List from typing import Optional from typing import TypeVar T = TypeVar("T") # NOTE: thi...
import asyncio import functools import time import weakref from collections import defaultdict from typing import AsyncIterable from typing import Awaitable from typing import Callable from typing import Dict from typing import List from typing import Optional from typing import TypeVar T = TypeVar("T") # NOTE: thi...
en
0.957342
# NOTE: this method is not thread-safe due to lack of locking while checking # and updating the cache # wrapped # inner # Please note that anything which is put into `key` will be in the # cache forever, potentially causing memory leaks. The most common # case is the `self` arg pointing to a huge object. To mitigate...
2.431043
2
util/dataset.py
MTI830PyTraders/pytrade
3
5832
#!/usr/bin/python ''' generate dataset ''' import csv import argparse import numpy as np import sklearn.metrics import theanets from sklearn.metrics import accuracy_score import logging from trendStrategy import OptTrendStrategy, TrendStrategy from util import visu def compare(stock, field='orders', strategy="TrendSt...
#!/usr/bin/python ''' generate dataset ''' import csv import argparse import numpy as np import sklearn.metrics import theanets from sklearn.metrics import accuracy_score import logging from trendStrategy import OptTrendStrategy, TrendStrategy from util import visu def compare(stock, field='orders', strategy="TrendSt...
en
0.119807
#!/usr/bin/python generate dataset return train, valid (x,y)
2.803501
3
examples/scripts/sc/bpdn.py
manvhah/sporco
0
5833
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. """ Basis Pursuit DeNoising ======================= This example demonstrates the use of class :class:`.admm.bpdn....
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. """ Basis Pursuit DeNoising ======================= This example demonstrates the use of class :class:`.admm.bpdn....
en
0.744403
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. Basis Pursuit DeNoising ======================= This example demonstrates the use of class :class:`.admm.bpdn.BPDN`...
2.942935
3
saleor-env/lib/python3.7/site-packages/snowballstemmer/nepali_stemmer.py
tadartefactorist/mask
0
5834
<filename>saleor-env/lib/python3.7/site-packages/snowballstemmer/nepali_stemmer.py # This file was generated automatically by the Snowball to Python compiler # http://snowballstem.org/ from .basestemmer import BaseStemmer from .among import Among class NepaliStemmer(BaseStemmer): ''' This class was automatic...
<filename>saleor-env/lib/python3.7/site-packages/snowballstemmer/nepali_stemmer.py # This file was generated automatically by the Snowball to Python compiler # http://snowballstem.org/ from .basestemmer import BaseStemmer from .among import Among class NepaliStemmer(BaseStemmer): ''' This class was automatic...
en
0.733334
# This file was generated automatically by the Snowball to Python compiler # http://snowballstem.org/ This class was automatically generated by a Snowball to Python compiler It implements the stemming algorithm defined by a snowball script. # (, line 53 # [, line 54 # substring, line 54 # ], line 54 # (, line 58 # ...
2.413572
2
tests/auto_test_class_creation_spec.py
MountainField/uspec
2
5835
<reponame>MountainField/uspec # -*- coding: utf-8 -*- # ================================================================= # uspec # # Copyright (c) 2020 <NAME> # # This software is released under the MIT License. # http://opensource.org/licenses/mit-license.php # =======================================================...
# -*- coding: utf-8 -*- # ================================================================= # uspec # # Copyright (c) 2020 <NAME> # # This software is released under the MIT License. # http://opensource.org/licenses/mit-license.php # ================================================================= from __future__ im...
en
0.32903
# -*- coding: utf-8 -*- # ================================================================= # uspec # # Copyright (c) 2020 <NAME> # # This software is released under the MIT License. # http://opensource.org/licenses/mit-license.php # ================================================================= ####################...
2.950168
3
main.py
Matthewk01/Snake-AI
0
5836
import pygame from game.game_logic.game import Game import matplotlib.pyplot as plt def main(): scores_history = [] GAME_COUNT = 2 for i in range(GAME_COUNT): game = Game(400, "Snake AI") score = game.start() scores_history.append(score) print("Game:", i) plt.ylim(0, 3...
import pygame from game.game_logic.game import Game import matplotlib.pyplot as plt def main(): scores_history = [] GAME_COUNT = 2 for i in range(GAME_COUNT): game = Game(400, "Snake AI") score = game.start() scores_history.append(score) print("Game:", i) plt.ylim(0, 3...
none
1
3.868509
4
closed/Intel/code/resnet50/openvino-cpu/src/tools/create_image_list.py
ctuning/inference_results_v1.1
19
5837
import os import sys from glob import glob def create_list(images_dir, output_file, img_ext=".jpg"): ImgList = os.listdir(images_dir) val_list = [] for img in ImgList: img,ext = img.split(".") val_list.append(img) with open(os.path.join(images_dir, output_file),'w') as fid: ...
import os import sys from glob import glob def create_list(images_dir, output_file, img_ext=".jpg"): ImgList = os.listdir(images_dir) val_list = [] for img in ImgList: img,ext = img.split(".") val_list.append(img) with open(os.path.join(images_dir, output_file),'w') as fid: ...
none
1
3.317107
3
AI/others/churn/churn_2.py
honchardev/Fun
0
5838
#!/usr/bin/env python # coding: utf-8 # In[1]: # src: http://datareview.info/article/prognozirovanie-ottoka-klientov-so-scikit-learn/ # In[ ]: # Показатель оттока клиентов – бизнес-термин, описывающий # насколько интенсивно клиенты покидают компанию или # прекращают оплачивать товары или услуги. # Это ключевой ...
#!/usr/bin/env python # coding: utf-8 # In[1]: # src: http://datareview.info/article/prognozirovanie-ottoka-klientov-so-scikit-learn/ # In[ ]: # Показатель оттока клиентов – бизнес-термин, описывающий # насколько интенсивно клиенты покидают компанию или # прекращают оплачивать товары или услуги. # Это ключевой ...
ru
0.838077
#!/usr/bin/env python # coding: utf-8 # In[1]: # src: http://datareview.info/article/prognozirovanie-ottoka-klientov-so-scikit-learn/ # In[ ]: # Показатель оттока клиентов – бизнес-термин, описывающий # насколько интенсивно клиенты покидают компанию или # прекращают оплачивать товары или услуги. # Это ключевой показате...
2.783286
3
airbyte-integrations/connectors/source-google-sheets/google_sheets_source/models/spreadsheet.py
rajatariya21/airbyte
0
5839
<reponame>rajatariya21/airbyte # MIT License # # Copyright (c) 2020 Airbyte # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
# MIT License # # Copyright (c) 2020 Airbyte # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
en
0.765101
# MIT License # # Copyright (c) 2020 Airbyte # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
2.054264
2
pytrivia/trivia.py
Dnewman9/Python-Trivia-API
6
5840
<filename>pytrivia/trivia.py """ A simple python api wrapper for https://opentdb.com/ """ from aiohttp import ClientSession from requests import get from pytrivia.__helpers import decode_dict, get_token, make_request from pytrivia.enums import * class Trivia: def __init__(self, with_token: bool): """ ...
<filename>pytrivia/trivia.py """ A simple python api wrapper for https://opentdb.com/ """ from aiohttp import ClientSession from requests import get from pytrivia.__helpers import decode_dict, get_token, make_request from pytrivia.enums import * class Trivia: def __init__(self, with_token: bool): """ ...
en
0.775196
A simple python api wrapper for https://opentdb.com/ Initialize an instance of the Trivia class :param with_token: If True then the instance will uses a session token Send an api request to https://opentdb.com/ Limitations: Only 1 Category can be requested per API Call. To get questions ...
3.704848
4
utils.py
py-ranoid/practical-nlp
0
5841
import requests import tarfile import os def download_file(url, directory): local_filename = os.path.join(directory, url.split('/')[-1]) print ("Downloading %s --> %s"%(url, local_filename)) with requests.get(url, stream=True) as r: r.raise_for_status() with open(local_filename, 'wb') as f:...
import requests import tarfile import os def download_file(url, directory): local_filename = os.path.join(directory, url.split('/')[-1]) print ("Downloading %s --> %s"%(url, local_filename)) with requests.get(url, stream=True) as r: r.raise_for_status() with open(local_filename, 'wb') as f:...
none
1
3.160349
3
spritecss/config.py
yostudios/Spritemapper
49
5842
import shlex from os import path from itertools import imap, ifilter from urlparse import urljoin from .css import CSSParser, iter_events def parse_config_stmt(line, prefix="spritemapper."): line = line.strip() if line.startswith(prefix) and "=" in line: (key, value) = line.split("=", 1) return...
import shlex from os import path from itertools import imap, ifilter from urlparse import urljoin from .css import CSSParser, iter_events def parse_config_stmt(line, prefix="spritemapper."): line = line.strip() if line.startswith(prefix) and "=" in line: (key, value) = line.split("=", 1) return...
en
0.78278
# this is mostly so you can go CSSConfig(base=CSSConfig(..)) Normalize a possibly relative path *p* to the root. Make an absolute reference to *p* from any configured base URL.
2.649427
3
plotting/make_bar_graph.py
DanielTakeshi/debridement-code
3
5843
""" A bar graph. (c) September 2017 by <NAME> """ import argparse from collections import defaultdict from keras.models import Sequential from keras.layers import Dense, Activation import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import sys np.set_printoptions(suppress=True, ...
""" A bar graph. (c) September 2017 by <NAME> """ import argparse from collections import defaultdict from keras.models import Sequential from keras.layers import Dense, Activation import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import sys np.set_printoptions(suppress=True, ...
en
0.949406
A bar graph. (c) September 2017 by <NAME> # Some matplotlib settings. This is a deprecated method, only to show how to possibly combine these into one plot. However, I find this unwieldly. # sys.exit() # Use this to determine which DNN models should be here. # Gah! Now I can finally make the bar chart. I think it'...
2.785101
3
setup.py
tzengerink/groceries-api
0
5844
<filename>setup.py #!/usr/bin/env python from setuptools import find_packages, setup import os import re ROOT = os.path.dirname(__file__) VERSION_RE = re.compile(r'''__version__ = \'([0-9.]+)\'''') def get_version(): init = open(os.path.join(ROOT, 'application', '__init__.py')).read() return VERSION_RE.sear...
<filename>setup.py #!/usr/bin/env python from setuptools import find_packages, setup import os import re ROOT = os.path.dirname(__file__) VERSION_RE = re.compile(r'''__version__ = \'([0-9.]+)\'''') def get_version(): init = open(os.path.join(ROOT, 'application', '__init__.py')).read() return VERSION_RE.sear...
de
0.096414
#!/usr/bin/env python __version__ = \'([0-9.]+)\
1.725562
2
toontown/suit/DistributedLawbotBoss.py
SuperM0use24/TT-CL-Edition
0
5845
from direct.showbase.ShowBase import * from direct.interval.IntervalGlobal import * from toontown.battle.BattleProps import * from direct.distributed.ClockDelta import * from direct.showbase.PythonUtil import Functor from direct.showbase.PythonUtil import StackTrace from direct.gui.DirectGui import * from panda3d.core ...
from direct.showbase.ShowBase import * from direct.interval.IntervalGlobal import * from toontown.battle.BattleProps import * from direct.distributed.ClockDelta import * from direct.showbase.PythonUtil import Functor from direct.showbase.PythonUtil import StackTrace from direct.gui.DirectGui import * from panda3d.core ...
none
1
1.623799
2
tests/test_custom_rnncell.py
lightmatter-ai/tensorflow-onnx
0
5846
# SPDX-License-Identifier: Apache-2.0 """Unit Tests for custom rnns.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tensorflow.python.ops import init_ops from backend_test_base import Tf2OnnxBackendTest...
# SPDX-License-Identifier: Apache-2.0 """Unit Tests for custom rnns.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tensorflow.python.ops import init_ops from backend_test_base import Tf2OnnxBackendTest...
en
0.65891
# SPDX-License-Identifier: Apache-2.0 Unit Tests for custom rnns. # pylint: disable=wildcard-import, unused-wildcard-import # pylint: disable=missing-docstring,invalid-name,unused-argument,using-constant-test # pylint: disable=abstract-method,arguments-differ # size of each model layer. # size of each model layer. # no...
1.947525
2
cookie-cutter/src/templates/template.py
noname34/CHARM_Project_Hazard_Perception_I
0
5847
#!/user/bin/env python3 # -*- coding: utf-8 -*- #!/user/bin/env python3 # -*- coding: utf-8 -*- # @Author: <NAME> # @Email: <EMAIL> # @Date: 04.2020 # Context: CHARM PROJECT - Harzard perception """ Module documentation. """ # Imports import sys #import os # Global variables # Class declarations # Function decl...
#!/user/bin/env python3 # -*- coding: utf-8 -*- #!/user/bin/env python3 # -*- coding: utf-8 -*- # @Author: <NAME> # @Email: <EMAIL> # @Date: 04.2020 # Context: CHARM PROJECT - Harzard perception """ Module documentation. """ # Imports import sys #import os # Global variables # Class declarations # Function decl...
en
0.392715
#!/user/bin/env python3 # -*- coding: utf-8 -*- #!/user/bin/env python3 # -*- coding: utf-8 -*- # @Author: <NAME> # @Email: <EMAIL> # @Date: 04.2020 # Context: CHARM PROJECT - Harzard perception Module documentation. # Imports #import os # Global variables # Class declarations # Function declarations # Main body
1.800605
2
utils/gridpeak.py
siwill22/magSA
0
5848
<filename>utils/gridpeak.py import numpy def gridpeak(t, X=None): # GP = GRIDPEAK(...) # gp = gridpeak(t) return gridpeaks based on Blakely # and Simpson method # gp = gridpeak(t,X) optionally remove peak values scoring less than X, # where X can be between 1 and 4....
<filename>utils/gridpeak.py import numpy def gridpeak(t, X=None): # GP = GRIDPEAK(...) # gp = gridpeak(t) return gridpeaks based on Blakely # and Simpson method # gp = gridpeak(t,X) optionally remove peak values scoring less than X, # where X can be between 1 and 4....
en
0.909618
# GP = GRIDPEAK(...) # gp = gridpeak(t) return gridpeaks based on Blakely # and Simpson method # gp = gridpeak(t,X) optionally remove peak values scoring less than X, # where X can be between 1 and 4.
2.632954
3
Chapter 10/trackbackLog.py
Miillky/automate_the_boring_stuff_with_python
0
5849
<reponame>Miillky/automate_the_boring_stuff_with_python<gh_stars>0 import traceback try: raise Exception('This is the error message.') except: errorFile = open('./Chapter 10/errorInfo.txt', 'w') errorFile.write(traceback.format_exc()) errorFile.close() print('The traceback info was written to errorI...
import traceback try: raise Exception('This is the error message.') except: errorFile = open('./Chapter 10/errorInfo.txt', 'w') errorFile.write(traceback.format_exc()) errorFile.close() print('The traceback info was written to errorInfo.txt')
none
1
3.421912
3
Module_III/PySparkNetworkSimilarityClass.py
wuchiehhan/KDD2019-HandsOn-Tutorial
0
5850
# Databricks notebook source from pyspark.sql.types import * from pyspark.sql import functions as F import base64 import array # COMMAND ---------- # s is a base64 encoded float[] with first element being the magnitude def Base64ToFloatArray(s): arr = array.array('f', base64.b64decode(s)) return (arr[0], arr[1:])...
# Databricks notebook source from pyspark.sql.types import * from pyspark.sql import functions as F import base64 import array # COMMAND ---------- # s is a base64 encoded float[] with first element being the magnitude def Base64ToFloatArray(s): arr = array.array('f', base64.b64decode(s)) return (arr[0], arr[1:])...
en
0.665724
# Databricks notebook source # COMMAND ---------- # s is a base64 encoded float[] with first element being the magnitude # Register udf functions so that it could be used in dataframe # # Perform same computation as cosineSimilarity() # # COMMAND ---------- # MAGIC %md **NetworkSimilarity** class to compute Network Sim...
2.799745
3
fizzbuzz.py
vagnes/fizzbuzzgame
0
5851
print("Press q to quit") quit = False while quit is False: in_val = input("Please enter a positive integer.\n > ") if in_val is 'q': quit = True elif int(in_val) % 3 == 0 and int(in_val) % 5 == 0: print("FizzBuzz") elif int(in_val) % 5 == 0: print("Buzz") elif int(in_val) % ...
print("Press q to quit") quit = False while quit is False: in_val = input("Please enter a positive integer.\n > ") if in_val is 'q': quit = True elif int(in_val) % 3 == 0 and int(in_val) % 5 == 0: print("FizzBuzz") elif int(in_val) % 5 == 0: print("Buzz") elif int(in_val) % ...
none
1
4.078772
4
lesson10019_projects/pen/data/transition.py
muzudho/py-state-machine-practice
0
5852
from lesson14_projects.pen.data.const import ( A, E_A, E_AN, E_IS, E_OVER, E_PEN, E_PIN, E_THAT, E_THIS, E_WAS, INIT, IS, PEN, THIS, ) pen_transition_doc_v19 = { "title": "This is a pen", "entry_state": INIT, "data": { INIT: { E_OV...
from lesson14_projects.pen.data.const import ( A, E_A, E_AN, E_IS, E_OVER, E_PEN, E_PIN, E_THAT, E_THIS, E_WAS, INIT, IS, PEN, THIS, ) pen_transition_doc_v19 = { "title": "This is a pen", "entry_state": INIT, "data": { INIT: { E_OV...
none
1
1.638897
2
Animation/Main.py
olesmith/SmtC
0
5853
<filename>Animation/Main.py import gd,os,time from Html import Animation_Html from Iteration import Animation_Iteration from Write import Animation_Write from Base import * from Canvas2 import * from Canvas2 import Canvas2 from Image import Image from HTML import HTML __Canvas__=None class Animation( Animat...
<filename>Animation/Main.py import gd,os,time from Html import Animation_Html from Iteration import Animation_Iteration from Write import Animation_Write from Base import * from Canvas2 import * from Canvas2 import Canvas2 from Image import Image from HTML import HTML __Canvas__=None class Animation( Animat...
en
0.439908
#Clean up afterwords ##! ##! Overrride __str__ to print some useful info. ##! ##! ##! Returns Canvas object, stored in self.__Canvas__ ##! # Needed to modify global copy of __Canvas__
2.984998
3
pytorch_metric_learning/miners/distance_weighted_miner.py
junjungoal/pytorch_metric_learning
1
5854
#! /usr/bin/env python3 from .base_miner import BasePostGradientMiner import torch from ..utils import loss_and_miner_utils as lmu # adapted from # https://github.com/chaoyuaw/incubator-mxnet/blob/master/example/gluon/ # /embedding_learning/model.py class DistanceWeightedMiner(BasePostGradientMiner): def __init_...
#! /usr/bin/env python3 from .base_miner import BasePostGradientMiner import torch from ..utils import loss_and_miner_utils as lmu # adapted from # https://github.com/chaoyuaw/incubator-mxnet/blob/master/example/gluon/ # /embedding_learning/model.py class DistanceWeightedMiner(BasePostGradientMiner): def __init_...
en
0.827671
#! /usr/bin/env python3 # adapted from # https://github.com/chaoyuaw/incubator-mxnet/blob/master/example/gluon/ # /embedding_learning/model.py # so that we don't get log(0). We mask the diagonal out later anyway # Cut off to avoid high variance. # Subtract max(log(distance)) for stability. # See the first equation from...
2.429768
2
Keywords/__init__.py
cassie01/PumpLibrary
0
5855
<reponame>cassie01/PumpLibrary # -*- coding: utf-8 -*- from .Alarm.alarm import Alarm from .DeliveryView.bolus import Bolus from .DeliveryView.info import Info from .DeliveryView.infusion import Infusion from .DeliveryView.infusion_parameter import InfusionParameter from .DeliveryView.priming import Priming from .Hard...
# -*- coding: utf-8 -*- from .Alarm.alarm import Alarm from .DeliveryView.bolus import Bolus from .DeliveryView.info import Info from .DeliveryView.infusion import Infusion from .DeliveryView.infusion_parameter import InfusionParameter from .DeliveryView.priming import Priming from .HardwareControl.motor import Motor ...
en
0.769321
# -*- coding: utf-8 -*-
1.194637
1
src/responsibleai/rai_analyse/constants.py
Azure/automl-devplat2-preview
7
5856
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- class DashboardInfo: MODEL_ID_KEY = "id" # To match Model schema MODEL_INFO_FILENAME = "model_info.json" RAI_INSIGHTS_MODEL_...
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- class DashboardInfo: MODEL_ID_KEY = "id" # To match Model schema MODEL_INFO_FILENAME = "model_info.json" RAI_INSIGHTS_MODEL_...
en
0.684615
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # To match Model schema # The property to indicate the type of Run # Property to point at the model under examination # Property for tool ru...
1.705515
2
pulsar/apps/data/redis/store.py
goodboy/pulsar
1
5857
from functools import partial from pulsar import Connection, Pool, get_actor from pulsar.utils.pep import to_string from pulsar.apps.data import RemoteStore from pulsar.apps.ds import redis_parser from .client import RedisClient, Pipeline, Consumer, ResponseError from .pubsub import RedisPubSub, RedisChannels class...
from functools import partial from pulsar import Connection, Pool, get_actor from pulsar.utils.pep import to_string from pulsar.apps.data import RemoteStore from pulsar.apps.ds import redis_parser from .client import RedisClient, Pipeline, Consumer, ResponseError from .pubsub import RedisPubSub, RedisChannels class...
en
0.375284
Redis :class:`.Store` implementation. The prefix namespace to append to all transaction on keys Get a :class:`.RedisClient` for the Store Get a :class:`.Pipeline` for the Store Close all open connections. Extract model metadata for lua script stdnet/lib/lua/odm.lua # indices = dict(((idx.attname, idx.unique) for idx i...
2.304471
2
tasks/migrations/0005_auto_20200616_0123.py
tschelbs18/fruitful
0
5858
# Generated by Django 3.0.7 on 2020-06-16 05:23 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('tasks', '0004_auto_20200616_0116'), ] operations = [ migrations.AddField( model_name='userreward', ...
# Generated by Django 3.0.7 on 2020-06-16 05:23 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('tasks', '0004_auto_20200616_0116'), ] operations = [ migrations.AddField( model_name='userreward', ...
en
0.800741
# Generated by Django 3.0.7 on 2020-06-16 05:23
1.835806
2
pcg_libraries/src/pcg_gazebo/parsers/types/vector.py
boschresearch/pcg_gazebo_pkgs
42
5859
<filename>pcg_libraries/src/pcg_gazebo/parsers/types/vector.py # Copyright (c) 2019 - The Procedural Generation for Gazebo authors # For information on the respective copyright owner see the NOTICE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...
<filename>pcg_libraries/src/pcg_gazebo/parsers/types/vector.py # Copyright (c) 2019 - The Procedural Generation for Gazebo authors # For information on the respective copyright owner see the NOTICE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...
en
0.846276
# Copyright (c) 2019 - The Procedural Generation for Gazebo authors # For information on the respective copyright owner see the NOTICE file # # 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 # #...
2.60067
3
tests/main/helpers/test_buyers_helpers.py
uk-gov-mirror/alphagov.digitalmarketplace-briefs-frontend
1
5860
<filename>tests/main/helpers/test_buyers_helpers.py import mock import pytest from werkzeug.exceptions import NotFound import app.main.helpers as helpers from dmcontent.content_loader import ContentLoader from dmtestutils.api_model_stubs import BriefStub, FrameworkStub, LotStub content_loader = ContentLoader('tests/...
<filename>tests/main/helpers/test_buyers_helpers.py import mock import pytest from werkzeug.exceptions import NotFound import app.main.helpers as helpers from dmcontent.content_loader import ContentLoader from dmtestutils.api_model_stubs import BriefStub, FrameworkStub, LotStub content_loader = ContentLoader('tests/...
none
1
2.163727
2
Plot/src/test/java/io/deephaven/db/plot/example_plots/PlottingPQ.py
devinrsmith/deephaven-core
0
5861
import deephaven.TableTools as tt import deephaven.Plot as plt t = tt.emptyTable(50)\ .update("X = i + 5", "XLow = X -1", "XHigh = X + 1", "Y = Math.random() * 5", "YLow = Y - 1", "YHigh = Y + 1", "USym = i % 2 == 0 ? `AAPL` : `MSFT`") p = plt.plot("S1", t, "X", "Y").lineColor("black").show() p2 = plt.plot("S1"...
import deephaven.TableTools as tt import deephaven.Plot as plt t = tt.emptyTable(50)\ .update("X = i + 5", "XLow = X -1", "XHigh = X + 1", "Y = Math.random() * 5", "YLow = Y - 1", "YHigh = Y + 1", "USym = i % 2 == 0 ? `AAPL` : `MSFT`") p = plt.plot("S1", t, "X", "Y").lineColor("black").show() p2 = plt.plot("S1"...
none
1
2.248311
2
rhoci/test/routes.py
ahmedmagdyawaad/redhat-ci-dashboard
8
5862
# Copyright 2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
# Copyright 2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
en
0.847371
# Copyright 2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
2.011013
2
mitmproxy/net/http/http1/__init__.py
aarnaut/mitmproxy
0
5863
from .read import ( read_request_head, read_response_head, connection_close, expected_http_body_size, validate_headers, ) from .assemble import ( assemble_request, assemble_request_head, assemble_response, assemble_response_head, assemble_body, ) __all__ = [ "read_request_head", ...
from .read import ( read_request_head, read_response_head, connection_close, expected_http_body_size, validate_headers, ) from .assemble import ( assemble_request, assemble_request_head, assemble_response, assemble_response_head, assemble_body, ) __all__ = [ "read_request_head", ...
none
1
1.275877
1
request_token/migrations/0009_requesttokenerror.py
alex-hutton/django-request-token
0
5864
<filename>request_token/migrations/0009_requesttokenerror.py # -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-05-21 19:33 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('...
<filename>request_token/migrations/0009_requesttokenerror.py # -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-05-21 19:33 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('...
en
0.815204
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-05-21 19:33
1.84369
2
01-basic-programs/04-lines.py
ncodeitgithub1/python-get-hands-dirty-programs
0
5865
<filename>01-basic-programs/04-lines.py #4 lines: Fibonacci, tuple assignment parents, babies = (1, 1) while babies < 100: print ('This generation has {0} babies'.format(babies)) parents, babies = (babies, parents + babies)
<filename>01-basic-programs/04-lines.py #4 lines: Fibonacci, tuple assignment parents, babies = (1, 1) while babies < 100: print ('This generation has {0} babies'.format(babies)) parents, babies = (babies, parents + babies)
en
0.688581
#4 lines: Fibonacci, tuple assignment
3.729131
4
winter/controller.py
EvgenySmekalin/winter
1
5866
import typing from .core import Component _Controller = typing.TypeVar('_Controller') _ControllerType = typing.Type[_Controller] ControllerFactory = typing.NewType('ControllerFactory', typing.Callable[[typing.Type], object]) _controller_factory: typing.Optional[ControllerFactory] = None def controller(controller_cl...
import typing from .core import Component _Controller = typing.TypeVar('_Controller') _ControllerType = typing.Type[_Controller] ControllerFactory = typing.NewType('ControllerFactory', typing.Callable[[typing.Type], object]) _controller_factory: typing.Optional[ControllerFactory] = None def controller(controller_cl...
none
1
2.390264
2
go/def.bzl
bobg/rules_go
0
5867
# Copyright 2014 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
# Copyright 2014 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
en
0.762168
# Copyright 2014 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
1.265601
1
anyway/parsers/united.py
ayalapol/anyway
0
5868
#!/usr/bin/env python # -*- coding: utf-8 -*- import calendar import csv from datetime import datetime import os from flask_sqlalchemy import SQLAlchemy from sqlalchemy import and_ from ..constants import CONST from ..models import AccidentMarker from ..utilities import init_flask, decode_hebrew, open_utf8 from ..imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- import calendar import csv from datetime import datetime import os from flask_sqlalchemy import SQLAlchemy from sqlalchemy import and_ from ..constants import CONST from ..models import AccidentMarker from ..utilities import init_flask, decode_hebrew, open_utf8 from ..imp...
en
0.5102
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################################ # United.py is responsible for the parsing and deployment of "united hatzala" data to the DB ########################################################################################...
2.100095
2
libact/query_strategies/tests/test_variance_reduction.py
joequant/libact
1
5869
import unittest from numpy.testing import assert_array_equal import numpy as np from libact.base.dataset import Dataset from libact.models import LogisticRegression from libact.query_strategies import VarianceReduction from .utils import run_qs class VarianceReductionTestCase(unittest.TestCase): """Variance red...
import unittest from numpy.testing import assert_array_equal import numpy as np from libact.base.dataset import Dataset from libact.models import LogisticRegression from libact.query_strategies import VarianceReduction from .utils import run_qs class VarianceReductionTestCase(unittest.TestCase): """Variance red...
en
0.496079
Variance reduction test case using artifitial dataset
2.522628
3
hysds/log_utils.py
fgreg/hysds
0
5870
<reponame>fgreg/hysds<gh_stars>0 from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import open from builtins import str from future import standard_library standard_library.install_aliases() import os impo...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import open from builtins import str from future import standard_library standard_library.install_aliases() import os import re import json import copy imp...
en
0.633933
# logger # redis connection pools # job status key template # worker status key template # task worker key template Return max value for backoff. Return max tries for backoff. Return minimum gap time after soft time limit. Ensure hard time limit gap. Set redis connection pool for job status. Set redis connection pool f...
1.971723
2
openstack_dashboard/api/rest/swift.py
CplusShen/aurora-horizon
0
5871
# Copyright 2015, Rackspace, US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
# Copyright 2015, Rackspace, US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
en
0.828269
# Copyright 2015, Rackspace, US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
1.879091
2
datagen.py
kuangliu/pytorch-ssd
124
5872
'''Load image/class/box from a annotation file. The annotation file is organized as: image_name #obj xmin ymin xmax ymax class_index .. ''' from __future__ import print_function import os import sys import os.path import random import numpy as np import torch import torch.utils.data as data import torchvision.t...
'''Load image/class/box from a annotation file. The annotation file is organized as: image_name #obj xmin ymin xmax ymax class_index .. ''' from __future__ import print_function import os import sys import os.path import random import numpy as np import torch import torch.utils.data as data import torchvision.t...
en
0.634131
Load image/class/box from a annotation file. The annotation file is organized as: image_name #obj xmin ymin xmax ymax class_index .. Args: root: (str) ditectory to images. list_file: (str) path to index file. train: (boolean) train or test. transform: ([transforms]) image tr...
2.92938
3
lingvo/core/builder.py
allenwang28/lingvo
2,611
5873
# Lint as: python3 # Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
# Lint as: python3 # Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
en
0.790118
# Lint as: python3 # Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
1.962996
2
instmakelib/instmake_toolnames.py
gilramir/instmake
0
5874
<filename>instmakelib/instmake_toolnames.py # Copyright (c) 2010 by Cisco Systems, Inc. """ Manage the tool plugins and use them appropriately. """ import os TOOLNAME_PLUGIN_PREFIX = "toolname" class ToolNameManager: """ToolName plugins have to register with this manager the circumstances under which they wis...
<filename>instmakelib/instmake_toolnames.py # Copyright (c) 2010 by Cisco Systems, Inc. """ Manage the tool plugins and use them appropriately. """ import os TOOLNAME_PLUGIN_PREFIX = "toolname" class ToolNameManager: """ToolName plugins have to register with this manager the circumstances under which they wis...
en
0.869263
# Copyright (c) 2010 by Cisco Systems, Inc. Manage the tool plugins and use them appropriately. ToolName plugins have to register with this manager the circumstances under which they wish to be called. Call back parameters: first_arg, argv, cwd Call back parameters: first_arg, argv, cwd, regex_match Call back param...
2.400373
2
raiden/tests/integration/long_running/test_stress.py
tirkarthi/raiden
2,101
5875
<gh_stars>1000+ import time from http import HTTPStatus from itertools import count from typing import Sequence import gevent import grequests import pytest import structlog from eth_utils import to_canonical_address from flask import url_for from raiden.api.python import RaidenAPI from raiden.api.rest import APIServ...
import time from http import HTTPStatus from itertools import count from typing import Sequence import gevent import grequests import pytest import structlog from eth_utils import to_canonical_address from flask import url_for from raiden.api.python import RaidenAPI from raiden.api.rest import APIServer, RestAPI from...
en
0.898093
Iteratively wait and get on passed greenlets. This ensures exceptions in the greenlets are re-raised as soon as possible. # url_for() expects binary address so we have to convert here # required for url_for Stop an app and start it back Send `deposit` transfers of value `1` one at a time, without changing the ...
1.906236
2
pyabsa/utils/preprocess.py
jackie930/PyABSA
0
5876
# -*- coding: utf-8 -*- # file: preprocess.py # author: jackie # Copyright (C) 2021. All Rights Reserved. import os import pandas as pd import argparse import emoji import re from sklearn.model_selection import train_test_split parser = argparse.ArgumentParser() parser.add_argument("--inpath", type=str, required=True...
# -*- coding: utf-8 -*- # file: preprocess.py # author: jackie # Copyright (C) 2021. All Rights Reserved. import os import pandas as pd import argparse import emoji import re from sklearn.model_selection import train_test_split parser = argparse.ArgumentParser() parser.add_argument("--inpath", type=str, required=True...
en
0.40353
# -*- coding: utf-8 -*- # file: preprocess.py # author: jackie # Copyright (C) 2021. All Rights Reserved. # convert label to list # convert label to list # 过滤表情 # 写之前,先检验文件是否存在,存在就删掉 # preprocess for emoji # 只保留review的长度小于600的 # train test split # print (data_res.head()) # 写之前,先检验文件是否存在,存在就删掉 # preprocess for emoji # d...
2.718255
3
apps/06_lolcat_factory/you_try/PRD/cat_service.py
dparito/10Apps-Python_w-Andy
1
5877
import os import shutil import requests def get_cat(folder, name): url = "http://consuming-python-services-api.azurewebsites.net/cats/random" data = get_data_from_url(url) save_image(folder, name, data) def get_data_from_url(url): response = requests.get(url, stream=True) return response.raw ...
import os import shutil import requests def get_cat(folder, name): url = "http://consuming-python-services-api.azurewebsites.net/cats/random" data = get_data_from_url(url) save_image(folder, name, data) def get_data_from_url(url): response = requests.get(url, stream=True) return response.raw ...
none
1
3.171842
3
dask/dataframe/io/hdf.py
TryTestspace/dask
1
5878
<filename>dask/dataframe/io/hdf.py from __future__ import absolute_import, division, print_function from fnmatch import fnmatch from glob import glob import os import uuid from warnings import warn import pandas as pd from toolz import merge from .io import _link from ...base import get_scheduler from ..core import ...
<filename>dask/dataframe/io/hdf.py from __future__ import absolute_import, division, print_function from fnmatch import fnmatch from glob import glob import os import uuid from warnings import warn import pandas as pd from toolz import merge from .io import _link from ...base import get_scheduler from ..core import ...
en
0.682914
A wrapper function around pd_to_hdf that enables locking Store Dask Dataframe to Hierarchical Data Format (HDF) files This is a parallel version of the Pandas function of the same name. Please see the Pandas docstring for more detailed information about shared keyword arguments. This function differs...
2.450891
2
src/charma/media_info/manager.py
mononobi/charma-server
1
5879
# -*- coding: utf-8 -*- """ media info manager module. """ from pyrin.core.mixin import HookMixin from pyrin.core.structs import Manager import pyrin.utils.path as path_utils from charma.media_info import MediaInfoPackage from charma.media_info.interface import AbstractMediaInfoProvider from charma.media_info.except...
# -*- coding: utf-8 -*- """ media info manager module. """ from pyrin.core.mixin import HookMixin from pyrin.core.structs import Manager import pyrin.utils.path as path_utils from charma.media_info import MediaInfoPackage from charma.media_info.interface import AbstractMediaInfoProvider from charma.media_info.except...
en
0.561102
# -*- coding: utf-8 -*- media info manager module. media info manager class. gets a value indicating that given media info is complete. :param dict info: media info to be checked. :rtype: bool registers the given instance into media info providers. :param AbstractMediaInfoProvider instance: m...
2.201364
2
tests/test_parsers.py
FlorisHoogenboom/BoxRec
5
5880
import unittest from boxrec.parsers import FightParser class MockResponse(object): def __init__(self, content, encoding, url): self.content= content self.encoding = encoding self.url = url class TestFightParser(unittest.TestCase): def setUp(self): with open('mock_data/fights/...
import unittest from boxrec.parsers import FightParser class MockResponse(object): def __init__(self, content, encoding, url): self.content= content self.encoding = encoding self.url = url class TestFightParser(unittest.TestCase): def setUp(self): with open('mock_data/fights/...
en
0.468279
Test it correctly handles draws
3.108279
3
hyperdock/common/workqueue.py
ErikGartner/hyperdock
8
5881
<filename>hyperdock/common/workqueue.py<gh_stars>1-10 from datetime import datetime, timedelta from bson.objectid import ObjectId WORK_TIMEOUT = 600 class WorkQueue: """ A simple MongoDB priority work queue that handles the queue of experiment. """ def __init__(self, mongodb): super()._...
<filename>hyperdock/common/workqueue.py<gh_stars>1-10 from datetime import datetime, timedelta from bson.objectid import ObjectId WORK_TIMEOUT = 600 class WorkQueue: """ A simple MongoDB priority work queue that handles the queue of experiment. """ def __init__(self, mongodb): super()._...
en
0.946062
A simple MongoDB priority work queue that handles the queue of experiment. Assigns the next free job to worker. Returns the object from the mongodb. Adds new work to the workqueue. Marks the job as alive and post an update from the job. Checks if a certain job has been cancelled or all together removed. Mar...
2.553946
3
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/apache_libcloud-0.15.1-py2.7.egg/libcloud/test/test_connection.py
poojavade/Genomics_Docker
1
5882
<gh_stars>1-10 # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more§ # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version...
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more§ # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
en
0.861274
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more§ # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
2.010945
2
igibson/utils/data_utils/ext_object/scripts/step_1_visual_mesh.py
mamadbiabon/iGibson
360
5883
<reponame>mamadbiabon/iGibson<filename>igibson/utils/data_utils/ext_object/scripts/step_1_visual_mesh.py import os import sys import bpy script_dir = os.path.dirname(os.path.abspath(__file__)) utils_dir = os.path.join(script_dir, "../../blender_utils") sys.path.append(utils_dir) from utils import bake_model, clean_u...
import os import sys import bpy script_dir = os.path.dirname(os.path.abspath(__file__)) utils_dir = os.path.join(script_dir, "../../blender_utils") sys.path.append(utils_dir) from utils import bake_model, clean_unused, export_ig_object, import_obj_folder ############################################# # Parse command...
de
0.692698
############################################# # Parse command line arguments ############################################# ############################################# # Importing obj files from source dir ############################################# ############################################# # Optional UV Unwrapp...
2.163142
2
ceilometerclient/common/base.py
mail2nsrajesh/python-ceilometerclient
0
5884
# Copyright 2012 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 requ...
# Copyright 2012 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 requ...
en
0.829696
# Copyright 2012 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 requ...
2.057812
2
lib/charms/layer/azure.py
freyes/charm-azure-integrator
0
5885
<reponame>freyes/charm-azure-integrator import json import os import re import subprocess from base64 import b64decode from enum import Enum from math import ceil, floor from pathlib import Path from urllib.error import HTTPError from urllib.request import urlopen import yaml from charmhelpers.core import hookenv fro...
import json import os import re import subprocess from base64 import b64decode from enum import Enum from math import ceil, floor from pathlib import Path from urllib.error import HTTPError from urllib.request import urlopen import yaml from charmhelpers.core import hookenv from charmhelpers.core.unitdata import kv ...
en
0.855192
# When debugging hooks, for some reason HOME is set to /home/ubuntu, whereas # during normal hook execution, it's /root. Set it here to be consistent. Get the credentials from either the config or the hook tool. Prefers the config so that it can be overridden. # try to use Juju's trust feature # juju trust not ava...
1.939384
2
Assignment-1/Code/server3.py
pankajk22/Computer-Networks-Assignments
0
5886
import socket import csv import traceback import threading s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) usrpass={} def openfile(): filename="login_credentials.csv" with open(filename,'r')as csvfile: csv_file = csv.reader(csvfile, delimiter=",") for col in csv_file: usrpas...
import socket import csv import traceback import threading s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) usrpass={} def openfile(): filename="login_credentials.csv" with open(filename,'r')as csvfile: csv_file = csv.reader(csvfile, delimiter=",") for col in csv_file: usrpas...
en
0.515401
#print(usrpass) # def checkusr(username): # if username in usrpass: # return 1 # else: # print("Invalid Username") # return -1 # count=0 # while (count<6): # new_thread=threading.Thread(target =socketaccept) # new_thread.start() # count=count+1
2.950306
3
research/utils/_check_pipelines.py
joaopfonseca/research
1
5887
from itertools import product from sklearn.base import clone from sklearn.preprocessing import FunctionTransformer from sklearn.model_selection import ParameterGrid from imblearn.pipeline import Pipeline from rlearn.utils import check_random_states def check_pipelines(objects_list, random_state, n_runs): """Extra...
from itertools import product from sklearn.base import clone from sklearn.preprocessing import FunctionTransformer from sklearn.model_selection import ParameterGrid from imblearn.pipeline import Pipeline from rlearn.utils import check_random_states def check_pipelines(objects_list, random_state, n_runs): """Extra...
en
0.385976
Extract estimators and parameters grids. # Create random states # name, object, sub grid # Create estimator # Create intermediate parameter grids # Create parameter grids # Avoid multiple runs over pipelines without random state
2.355225
2
mushroom_rl/utils/plots/common_plots.py
PuzeLiu/mushroom-rl
344
5888
from mushroom_rl.utils.plots import PlotItemBuffer, DataBuffer from mushroom_rl.utils.plots.plot_item_buffer import PlotItemBufferLimited class RewardPerStep(PlotItemBuffer): """ Class that represents a plot for the reward at every step. """ def __init__(self, plot_buffer): """ Constr...
from mushroom_rl.utils.plots import PlotItemBuffer, DataBuffer from mushroom_rl.utils.plots.plot_item_buffer import PlotItemBufferLimited class RewardPerStep(PlotItemBuffer): """ Class that represents a plot for the reward at every step. """ def __init__(self, plot_buffer): """ Constr...
en
0.79389
Class that represents a plot for the reward at every step. Constructor. Args: plot_buffer (DataBuffer): data buffer to be used. Class that represents a plot for the accumulated reward per episode. Constructor. Args: plot_buffer (DataBuffer): data buffer to be used. Class that r...
2.929836
3
libs/python-daemon-2.2.0/test/test_metadata.py
helion-security/helion
1
5889
<reponame>helion-security/helion # -*- coding: utf-8 -*- # # test/test_metadata.py # Part of ‘python-daemon’, an implementation of PEP 3143. # # This is free software, and you are welcome to redistribute it under # certain conditions; see the end of this file for copyright # information, grant of license, and disclaime...
# -*- coding: utf-8 -*- # # test/test_metadata.py # Part of ‘python-daemon’, an implementation of PEP 3143. # # This is free software, and you are welcome to redistribute it under # certain conditions; see the end of this file for copyright # information, grant of license, and disclaimer of warranty. """ Unit test for...
en
0.746268
# -*- coding: utf-8 -*- # # test/test_metadata.py # Part of ‘python-daemon’, an implementation of PEP 3143. # # This is free software, and you are welcome to redistribute it under # certain conditions; see the end of this file for copyright # information, grant of license, and disclaimer of warranty. Unit test for ‘_me...
2.676897
3
objectModel/Python/cdm/persistence/cdmfolder/types/purpose_reference.py
wheatdog/CDM
0
5890
<reponame>wheatdog/CDM # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. from typing import Union, List from .purpose import * from .trait_reference import TraitReference from cdm.utilities import JObject class...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. from typing import Union, List from .purpose import * from .trait_reference import TraitReference from cdm.utilities import JObject class PurposeReference(JObje...
en
0.685778
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # type: Union[str, Purpose] # type: List[Union[str, TraitReference]]
2.06319
2
text_preprocessing/normalizer.py
cyberpunk317/inverted_index
9
5891
<filename>text_preprocessing/normalizer.py import re from typing import Union, List import nltk from bs4 import BeautifulSoup class Normalizer: def __init__(self): self.lemmatizer = nltk.stem.WordNetLemmatizer() def normalize(self, x: Union[list, str]) -> List[str]: """ Acce...
<filename>text_preprocessing/normalizer.py import re from typing import Union, List import nltk from bs4 import BeautifulSoup class Normalizer: def __init__(self): self.lemmatizer = nltk.stem.WordNetLemmatizer() def normalize(self, x: Union[list, str]) -> List[str]: """ Acce...
en
0.921839
Accepts text (possibly tokenized) and makes it suitable for machine processing Removes stop words from text in english Removes endings,
3.078187
3
env/lib/python3.7/site-packages/prompt_toolkit/filters/cli.py
MarcoMancha/BreastCancerDetector
2
5892
""" For backwards-compatibility. keep this file. (Many people are going to have key bindings that rely on this file.) """ from __future__ import unicode_literals from .app import * __all__ = [ # Old names. 'HasArg', 'HasCompletions', 'HasFocus', 'HasSelection', 'HasValidationError', 'IsDon...
""" For backwards-compatibility. keep this file. (Many people are going to have key bindings that rely on this file.) """ from __future__ import unicode_literals from .app import * __all__ = [ # Old names. 'HasArg', 'HasCompletions', 'HasFocus', 'HasSelection', 'HasValidationError', 'IsDon...
en
0.928335
For backwards-compatibility. keep this file. (Many people are going to have key bindings that rely on this file.) # Old names. # Keep the original classnames for backwards compatibility. # No lambda here! (Has_focus is callable that returns a callable.)
1.320987
1
genetic/spaces.py
shilpasayura/bk
4
5893
<filename>genetic/spaces.py<gh_stars>1-10 #spaces.py ''' AlgoHack Genetic Algorithm for University Semaster Planning Version 0.03 2018 <NAME> Sh<EMAIL> ''' import xdb def crt_spaces_table(cursor,drop=False): if (drop): sql="DROP TABLE IF EXISTS spaces;" success, count=xdb.runSQL(cursor...
<filename>genetic/spaces.py<gh_stars>1-10 #spaces.py ''' AlgoHack Genetic Algorithm for University Semaster Planning Version 0.03 2018 <NAME> Sh<EMAIL> ''' import xdb def crt_spaces_table(cursor,drop=False): if (drop): sql="DROP TABLE IF EXISTS spaces;" success, count=xdb.runSQL(cursor...
en
0.568252
#spaces.py AlgoHack Genetic Algorithm for University Semaster Planning Version 0.03 2018 <NAME> Sh<EMAIL> CREATE TABLE IF NOT EXISTS spaces ( spid INTEGER PRIMARY KEY AUTOINCREMENT, name varchar(30), sptype INTEGER, fitness INTEGER, gid INTEGER DEFAULT 0, semid INTEGER DEFAULT 0) # nlabs...
2.641896
3
threaded_remote_pi_camera.py
hyansuper/flask-video-streaming
7
5894
<reponame>hyansuper/flask-video-streaming import urllib.request import cv2 import numpy as np import time import threading class ThreadedRemotePiCamera: def __init__(self, pi_address, resolution=(320,240), framerate=10, hflip=False, vflip=False): if hflip and vflip: self.flip = -1 elif ...
import urllib.request import cv2 import numpy as np import time import threading class ThreadedRemotePiCamera: def __init__(self, pi_address, resolution=(320,240), framerate=10, hflip=False, vflip=False): if hflip and vflip: self.flip = -1 elif hflip: self.flip = 0 e...
en
0.585694
while self.frame is None: time.sleep(.1) f = self.frame self.frame = None return f # JPEG end # JPEG start
2.856614
3
scheduler/misc/Ec2SpotCustomScheduler_jan19.py
jalawala/custom-kubernetes-scheduler
4
5895
#! /usr/bin/python3 import time import random import json import os from pprint import pprint from kubernetes.client.rest import ApiException from pint import UnitRegistry from collections import defaultdict from kubernetes import client, config, watch from timeloop import Timeloop from datetime import timedelt...
#! /usr/bin/python3 import time import random import json import os from pprint import pprint from kubernetes.client.rest import ApiException from pint import UnitRegistry from collections import defaultdict from kubernetes import client, config, watch from timeloop import Timeloop from datetime import timedelt...
en
0.37067
#! /usr/bin/python3 #config.load_incluster_config() # doing this computation within a k8s cluster #k8s.config.load_incluster_config() #sdclient = SdcClient(<Your Sysdig API token>) #scheduler_name = "Ec2SpotK8sScheduler" #tl = Timeloop() #global pendingPodsList #global failedPodsList #exit(0) #namespace = 'default' #li...
2.04668
2
local/utils/validate_label_locale.py
DewiBrynJones/docker-deepspeech-cy
3
5896
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from clean_transcript import clean_transcript ALPHABET_FILE_PATH = "/DeepSpeech/bin/bangor_welsh/alphabet.txt" def validate_label(label): clean = clean_transcript(ALPHABET_FILE_PATH) cleaned, transcript = clean.clean(label) if cleaned: return transc...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from clean_transcript import clean_transcript ALPHABET_FILE_PATH = "/DeepSpeech/bin/bangor_welsh/alphabet.txt" def validate_label(label): clean = clean_transcript(ALPHABET_FILE_PATH) cleaned, transcript = clean.clean(label) if cleaned: return transc...
en
0.308914
#!/usr/bin/env python3 # -*- coding: utf-8 -*-
3.003535
3
src/models/nn/adaptive_softmax.py
dumpmemory/state-spaces
513
5897
# Copyright (c) 2019-2020, NVIDIA CORPORATION. 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...
# Copyright (c) 2019-2020, NVIDIA CORPORATION. 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...
en
0.666912
# Copyright (c) 2019-2020, NVIDIA CORPORATION. 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...
1.722004
2
the_el/cli.py
CityOfPhiladelphia/the-el
11
5898
import json import csv import sys import os import re import codecs import logging from logging.config import dictConfig import click import yaml from sqlalchemy import create_engine from jsontableschema_sql import Storage from smart_open import smart_open from . import postgres from . import carto csv.field_size_li...
import json import csv import sys import os import re import codecs import logging from logging.config import dictConfig import click import yaml from sqlalchemy import create_engine from jsontableschema_sql import Storage from smart_open import smart_open from . import postgres from . import carto csv.field_size_li...
en
0.575377
## TODO: csv settings? use Frictionless Data csv standard? ## TODO: support line delimted json? ## TODO: truncate? carto does. Makes this idempotent ## TODO: csv settings? use Frictionless Data csv standard? ## TODO: support line delimited json? # Oracle does not allow table modification within a transaction, so make i...
2.288196
2
examples/asr/experimental/speech_to_text_sclite.py
vadam5/NeMo
2
5899
# Copyright (c) 2020, NVIDIA CORPORATION. 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...
# Copyright (c) 2020, NVIDIA CORPORATION. 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...
en
0.876364
# Copyright (c) 2020, NVIDIA CORPORATION. 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...
1.840271
2